@openlist-frontend/openlist-frontend 4.0.7 → 4.0.9
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-2cc2atzU.js +1 -0
- package/dist/assets/2fa-legacy-Bv6NDiiZ.js +1 -0
- package/dist/assets/About-Cu11TW0D.js +1 -0
- package/dist/assets/About-legacy-QsfCSVxq.js +1 -0
- package/dist/assets/AddOrEdit-B2PSnD-9.js +1 -0
- package/dist/assets/AddOrEdit-B7sPaR10.js +1 -0
- package/dist/assets/AddOrEdit-DKPH7EZ_.js +1 -0
- package/dist/assets/AddOrEdit-legacy-BLNrBEUZ.js +1 -0
- package/dist/assets/AddOrEdit-legacy-COHYBFCt.js +1 -0
- package/dist/assets/AddOrEdit-legacy-DxIDnAk7.js +1 -0
- package/dist/assets/Common-CrTYhaeL.js +1 -0
- package/dist/assets/Common-legacy-CYNGdYU-.js +1 -0
- package/dist/assets/Copy-CENvweJK.js +1 -0
- package/dist/assets/Copy-legacy-D_8otiMK.js +1 -0
- package/dist/assets/Decompress-CzLWbcw1.js +1 -0
- package/dist/assets/Decompress-legacy-Dv_Jku2u.js +1 -0
- package/dist/{lite/assets/DeletePopover-2f2d4ac4.js → assets/DeletePopover-BFBUMopn.js} +1 -1
- package/dist/assets/DeletePopover-legacy-BEDnzn-m.js +1 -0
- package/dist/assets/File-DOBK5V8m.js +2 -0
- package/dist/assets/File-legacy-D1ODACuv.js +1 -0
- package/dist/assets/Folder-CGWdNP6D.js +115 -0
- package/dist/assets/Folder-legacy-YsG9JF-C.js +43 -0
- package/dist/assets/{Folder-6651c4e8.css → Folder-pZUjROFs.css} +1 -1
- package/dist/assets/FolderTree-BopfuzE_.js +1 -0
- package/dist/assets/FolderTree-legacy-DH3Vf9XJ.js +1 -0
- package/dist/assets/Grid-DPqNI8Qb.js +1 -0
- package/dist/assets/Grid-legacy-BgCqAxPk.js +1 -0
- package/dist/assets/GridItem-DKsYPXRd.js +1 -0
- package/dist/assets/GridItem-legacy-B5BlOcYb.js +1 -0
- package/dist/assets/{ImageWithError-41a9698b.js → ImageWithError-gG_AK8KG.js} +1 -1
- package/dist/assets/ImageWithError-legacy-B07XhroH.js +1 -0
- package/dist/assets/Images-OiLzswiq.js +1 -0
- package/dist/assets/Images-legacy-ByM1mPR1.js +1 -0
- package/dist/assets/Layout-CyS6jJ_b.js +6 -0
- package/dist/assets/Layout-legacy-D9Zk98K6.js +6 -0
- package/dist/assets/List-CZc2zrbB.js +1 -0
- package/dist/assets/List-legacy-CFAZAIBP.js +1 -0
- package/dist/assets/Messenger-Dmz66wIv.js +1 -0
- package/dist/assets/Messenger-legacy-DEa2mtGl.js +1 -0
- package/dist/assets/Metas-BV8fZzUC.js +1 -0
- package/dist/assets/Metas-legacy-Dsed9U0b.js +1 -0
- package/dist/assets/Move-CjmsQ4oK.js +1 -0
- package/dist/assets/Move-legacy-BJYFMCwm.js +1 -0
- package/dist/assets/Other-DXc0kpSC.js +1 -0
- package/dist/assets/Other-legacy-38X7w6nZ.js +1 -0
- package/dist/assets/PackageDownload-CwKBLgrB.js +1 -0
- package/dist/assets/PackageDownload-legacy-DghWe59X.js +1 -0
- package/dist/{lite/assets/Paginator-f6464798.js → assets/Paginator-CfTq8QGy.js} +1 -1
- package/dist/assets/Paginator-legacy-BBwW9rLz.js +1 -0
- package/dist/assets/Password-_jCVU1BX.js +1 -0
- package/dist/assets/Password-legacy-B7VWpO0t.js +1 -0
- package/dist/{lite/assets/Profile-73999eaa.js → assets/Profile-DQqzso6r.js} +1 -1
- package/dist/assets/Profile-legacy-DxHXHWHS.js +1 -0
- package/dist/assets/PublicKeys-BUewmKb-.js +1 -0
- package/dist/assets/PublicKeys-legacy-L19QKXEm.js +1 -0
- package/dist/assets/ResponsiveGrid-DBqpPiu2.js +1 -0
- package/dist/assets/ResponsiveGrid-legacy-io27eqXp.js +1 -0
- package/dist/assets/S3-Ue8_AwRX.js +1 -0
- package/dist/assets/S3-legacy-BEIExV0a.js +1 -0
- package/dist/assets/SettingItem-CoyA-wst.js +1 -0
- package/dist/assets/SettingItem-legacy-FkrTuUbn.js +1 -0
- package/dist/assets/Storages-B0zOmRwd.js +1 -0
- package/dist/assets/Storages-legacy-CBl6TdCy.js +1 -0
- package/dist/assets/Upload-9DDOLajr.js +1 -0
- package/dist/assets/Upload-legacy-BX35PWMt.js +1 -0
- package/dist/assets/Upload-legacy-uISx3f64.js +6 -0
- package/dist/assets/Upload-y6lHsBbS.js +5 -0
- package/dist/assets/Users-BNQGZuWH.js +1 -0
- package/dist/assets/Users-legacy-BINPeiuk.js +1 -0
- package/dist/assets/Wether-enRDnS5x.js +1 -0
- package/dist/assets/Wether-legacy-CUYxMAIK.js +1 -0
- package/dist/assets/aliyun_office-4kFcJSQ7.js +1 -0
- package/dist/assets/aliyun_office-legacy-CeoV_l42.js +1 -0
- package/dist/assets/aliyun_video-CwA2k3Pu.js +1 -0
- package/dist/assets/aliyun_video-legacy-BpsCIyHp.js +1 -0
- package/dist/assets/archive-96T1hx83.js +1 -0
- package/dist/assets/archive-legacy-DNLQfLr5.js +1 -0
- package/dist/assets/asciinema-CyHXgEN-.js +1 -0
- package/dist/assets/asciinema-legacy-t3iZqcax.js +1 -0
- package/dist/assets/audio-DSt_Oo19.js +1 -0
- package/dist/assets/{audio-43f4c02b.css → audio-DVCFhzL6.css} +1 -1
- package/dist/assets/audio-legacy-BhsBrhkI.js +1 -0
- package/dist/assets/{backup-restore-065598cd.js → backup-restore-C5uaukNL.js} +1 -1
- package/dist/assets/backup-restore-legacy-BNzSREad.js +1 -0
- package/dist/assets/entry-8adOMWDV.js +1 -0
- package/dist/assets/entry-CzYCw4_c.js +1 -0
- package/dist/assets/entry-legacy-BJi3IsKO.js +1 -0
- package/dist/assets/entry-legacy-CPgG9LS1.js +1 -0
- package/dist/assets/flash-Be81XNne.js +1 -0
- package/dist/assets/flash-legacy-CPqjLHQp.js +1 -0
- package/dist/assets/heic-DpvwRot7.js +1 -0
- package/dist/assets/heic-legacy-BoU2N_4X.js +1 -0
- package/dist/assets/helper-CJdkogiC.js +1 -0
- package/dist/assets/helper-Ha9z54Sm.js +1 -0
- package/dist/assets/helper-legacy-B4Xut8Z5.js +1 -0
- package/dist/assets/helper-legacy-CiLX6aDH.js +1 -0
- package/dist/assets/hls-CdGSrFYh.js +6 -0
- package/dist/assets/hls-legacy-BR5PAXA5.js +8 -0
- package/dist/{lite/assets/html-b83dd5df.js → assets/html-CBeb2Gu_.js} +1 -1
- package/dist/assets/html-legacy-DS9vIClh.js +1 -0
- package/dist/assets/{icon-14cfcca0.js → icon-CgK9sKtW.js} +1 -1
- package/dist/assets/icon-legacy-jbuQXJrW.js +1 -0
- package/dist/assets/image-DK0tWDig.js +1 -0
- package/dist/assets/image-legacy-BpyMVaKK.js +1 -0
- package/dist/assets/index-BClBcNEu.js +1 -0
- package/dist/assets/index-BJaZW_cl.js +1 -0
- package/dist/assets/index-BS5bVjs5.js +14 -0
- package/dist/{lite/assets/index-356c5622.js → assets/index-C7ih00qx.js} +1 -1
- package/dist/assets/index-CSwg5QXS.js +21 -0
- package/dist/assets/index-D0sWo-se.js +2 -0
- package/dist/{lite/assets/index-fc52fbd8.js → assets/index-DNDW0loe.js} +1 -1
- package/dist/assets/{index-03b25937.js → index-DOY4u_GJ.js} +1 -1
- package/dist/assets/{index-cd2c990e.js → index-DV8SB530.js} +1 -1
- package/dist/assets/{index-7a338fd8.js → index-DqW5xUnX.js} +1 -1
- package/dist/assets/index-legacy-BYcwzmYP.js +1 -0
- package/dist/assets/index-legacy-C5X1tU4Z.js +1 -0
- package/dist/assets/index-legacy-CDfFAMGs.js +18 -0
- package/dist/assets/index-legacy-CtC7fn6O.js +28 -0
- package/dist/assets/index-legacy-Ctuk5AXi.js +1 -0
- package/dist/assets/index-legacy-CwvCVg8-.js +1 -0
- package/dist/assets/index-legacy-DIduvs2M.js +1 -0
- package/dist/assets/index-legacy-DkZZKHvO.js +1 -0
- package/dist/assets/index-legacy-nH7bmAdo.js +1 -0
- package/dist/assets/index-legacy-zjwrrR91.js +1 -0
- package/dist/assets/indexes-Ba0IqlDk.js +1 -0
- package/dist/assets/indexes-legacy-DOV4Irpp.js +1 -0
- package/dist/assets/ipa-CThENlHd.js +1 -0
- package/dist/assets/ipa-legacy-ruQ-749T.js +1 -0
- package/dist/assets/item_type-legacy-NfhfVKtF.js +1 -0
- package/dist/assets/markdown-DAEQr1YU.js +1 -0
- package/dist/assets/markdown-legacy-DtXqlrxB.js +1 -0
- package/dist/assets/markdown_with_word_wrap-D_gGyBgt.js +1 -0
- package/dist/assets/markdown_with_word_wrap-legacy-D-tfNhGw.js +1 -0
- package/dist/assets/offline_download--qix7jck.js +1 -0
- package/dist/assets/offline_download-legacy-TAKRiM_z.js +1 -0
- package/dist/assets/pdf-ClWVlnx_.css +1 -0
- package/dist/assets/pdf-DS1TLqP2.js +1 -0
- package/dist/assets/pdf-legacy-BF9lSw5M.js +45 -0
- package/dist/assets/pdf.worker.min--PgD6g2g.mjs +29 -0
- package/dist/assets/plist-BdQrMloW.js +1 -0
- package/dist/assets/plist-legacy-Dzyq_tdc.js +1 -0
- package/dist/assets/polyfills-legacy-BPfokQaO.js +4 -0
- package/dist/assets/style-QIM1DiTv.js +1 -0
- package/dist/assets/style-legacy-DqRFDAwL.js +1 -0
- package/dist/assets/text-editor-BvoSciLk.js +1 -0
- package/dist/assets/text-editor-legacy-AXNOcpgF.js +1 -0
- package/dist/assets/url-BdlNs2qR.js +1 -0
- package/dist/assets/url-legacy-BObEvUIa.js +1 -0
- package/dist/assets/useTitle-DVdBzpBf.js +1 -0
- package/dist/assets/useTitle-legacy-CeyL-0_E.js +1 -0
- package/dist/assets/video-legacy-DYsnLlgJ.js +9 -0
- package/dist/assets/video-oPytqEM3.js +7 -0
- package/dist/assets/video360-Ceo5Bzr3.js +14 -0
- package/dist/assets/video360-legacy-DKyKnnjk.js +16 -0
- package/dist/assets/video_box-BSgDB9Qt.js +6 -0
- package/dist/assets/video_box-legacy-OIbbmS-k.js +8 -0
- package/dist/assets/webauthn-json.browser-ponyfill-legacy-8XJfKV2b.js +1 -0
- package/dist/i18n.tar.gz +0 -0
- package/dist/index.html +5 -12
- package/dist/lite/VERSION +1 -1
- package/dist/{assets/2fa-d1cc0baf.js → lite/assets/2fa-d2e88785.js} +1 -1
- package/dist/lite/assets/{2fa-legacy-e2c894a4.js → 2fa-legacy-300dfa68.js} +1 -1
- package/dist/lite/assets/{About-15ed8f32.js → About-e76de340.js} +1 -1
- package/dist/lite/assets/{About-legacy-dbe282e7.js → About-legacy-79773dac.js} +1 -1
- package/dist/{assets/AddOrEdit-c7d55332.js → lite/assets/AddOrEdit-3d3353a8.js} +1 -1
- package/dist/{assets/AddOrEdit-f8292227.js → lite/assets/AddOrEdit-807696e5.js} +1 -1
- package/dist/{assets/AddOrEdit-5476f281.js → lite/assets/AddOrEdit-d6caff63.js} +1 -1
- package/dist/{assets/AddOrEdit-legacy-6f125745.js → lite/assets/AddOrEdit-legacy-8f86f1ff.js} +1 -1
- package/dist/{assets/AddOrEdit-legacy-5f044346.js → lite/assets/AddOrEdit-legacy-9983f6e1.js} +1 -1
- package/dist/{assets/AddOrEdit-legacy-7a0f8a91.js → lite/assets/AddOrEdit-legacy-d0c7c380.js} +1 -1
- package/dist/{assets/Common-78d44bc1.js → lite/assets/Common-9c9167f7.js} +1 -1
- package/dist/{assets/Common-legacy-5332d52e.js → lite/assets/Common-legacy-d52fea2b.js} +1 -1
- package/dist/{assets/Copy-3fe708d1.js → lite/assets/Copy-104d7d48.js} +1 -1
- package/dist/{assets/Copy-legacy-1a808989.js → lite/assets/Copy-legacy-e1bce4e6.js} +1 -1
- package/dist/lite/assets/Decompress-62fd7241.js +1 -0
- package/dist/{assets/Decompress-legacy-e272dc60.js → lite/assets/Decompress-legacy-bd78eb4f.js} +1 -1
- package/dist/{assets/DeletePopover-a6ef19b8.js → lite/assets/DeletePopover-239d6d9d.js} +1 -1
- package/dist/{assets/DeletePopover-legacy-06d966eb.js → lite/assets/DeletePopover-legacy-f4764c72.js} +1 -1
- package/dist/{assets/File-b89f0ed9.js → lite/assets/File-9bb7b3b6.js} +1 -1
- package/dist/{assets/File-legacy-78ac3c0d.js → lite/assets/File-legacy-dbaad256.js} +1 -1
- package/dist/{assets/Folder-9c3d62e7.js → lite/assets/Folder-80505a0c.js} +2 -2
- package/dist/lite/assets/{Folder-legacy-f93e2ce1.js → Folder-legacy-dbe7957d.js} +2 -2
- package/dist/{assets/FolderTree-273f78d5.js → lite/assets/FolderTree-a7545b65.js} +1 -1
- package/dist/{assets/FolderTree-legacy-5dc26853.js → lite/assets/FolderTree-legacy-cc6e2591.js} +1 -1
- package/dist/lite/assets/Grid-2ea09356.js +1 -0
- package/dist/{assets/Grid-legacy-c313bc09.js → lite/assets/Grid-legacy-7e146882.js} +1 -1
- package/dist/{assets/GridItem-b48c24d7.js → lite/assets/GridItem-a16cc1c5.js} +1 -1
- package/dist/{assets/GridItem-legacy-ab3f6026.js → lite/assets/GridItem-legacy-3d2048e2.js} +1 -1
- package/dist/lite/assets/{ImageWithError-ed009be3.js → ImageWithError-7a45dab8.js} +1 -1
- package/dist/{assets/ImageWithError-legacy-0ef29c89.js → lite/assets/ImageWithError-legacy-c2f680e8.js} +1 -1
- package/dist/{assets/Images-16d0a269.js → lite/assets/Images-137f7509.js} +1 -1
- package/dist/{assets/Images-legacy-05991593.js → lite/assets/Images-legacy-a43b6098.js} +1 -1
- package/dist/lite/assets/{Layout-0e6d3f27.js → Layout-ac0937fd.js} +2 -2
- package/dist/lite/assets/{Layout-legacy-c0a1d22d.js → Layout-legacy-0be654c6.js} +2 -2
- package/dist/lite/assets/{List-9f4742b0.js → List-64c7752c.js} +1 -1
- package/dist/{assets/List-legacy-a2ffcf0a.js → lite/assets/List-legacy-913c133e.js} +1 -1
- package/dist/{assets/Messenger-4bcad850.js → lite/assets/Messenger-254abffb.js} +1 -1
- package/dist/{assets/Messenger-legacy-1261cc87.js → lite/assets/Messenger-legacy-97283620.js} +1 -1
- package/dist/{assets/Metas-8b8f927c.js → lite/assets/Metas-1bad1832.js} +1 -1
- package/dist/{assets/Metas-legacy-f2c289b6.js → lite/assets/Metas-legacy-7042cb89.js} +1 -1
- package/dist/lite/assets/{Other-8bdeeb20.js → Other-29b70647.js} +1 -1
- package/dist/{assets/Other-legacy-8cf4c7d1.js → lite/assets/Other-legacy-607dbff6.js} +1 -1
- package/dist/{assets/PackageDownload-4f0330d9.js → lite/assets/PackageDownload-e264bfda.js} +1 -1
- package/dist/{assets/PackageDownload-legacy-3bbe0bc9.js → lite/assets/PackageDownload-legacy-55a29bc7.js} +1 -1
- package/dist/{assets/Paginator-39fe817e.js → lite/assets/Paginator-c6bbb723.js} +1 -1
- package/dist/{assets/Paginator-legacy-a402278c.js → lite/assets/Paginator-legacy-612bab7f.js} +1 -1
- package/dist/{assets/Password-471eea70.js → lite/assets/Password-647ac2f5.js} +1 -1
- package/dist/{assets/Password-legacy-de9d4f94.js → lite/assets/Password-legacy-2e2010d5.js} +1 -1
- package/dist/{assets/Profile-2cce75ba.js → lite/assets/Profile-8e13fe60.js} +1 -1
- package/dist/{assets/Profile-legacy-43831309.js → lite/assets/Profile-legacy-93d7fe2b.js} +1 -1
- package/dist/{assets/PublicKeys-c537243f.js → lite/assets/PublicKeys-7daab5c3.js} +1 -1
- package/dist/{assets/PublicKeys-legacy-0f045703.js → lite/assets/PublicKeys-legacy-83570ba5.js} +1 -1
- package/dist/{assets/ResponsiveGrid-46291470.js → lite/assets/ResponsiveGrid-f263846b.js} +1 -1
- package/dist/{assets/ResponsiveGrid-legacy-c93c64dc.js → lite/assets/ResponsiveGrid-legacy-a8200443.js} +1 -1
- package/dist/{assets/S3-5bd27dd1.js → lite/assets/S3-40b2a439.js} +1 -1
- package/dist/{assets/S3-legacy-0119328d.js → lite/assets/S3-legacy-310983e4.js} +1 -1
- package/dist/{assets/SettingItem-1ade1595.js → lite/assets/SettingItem-72aa2179.js} +1 -1
- package/dist/lite/assets/{SettingItem-legacy-42ee0812.js → SettingItem-legacy-91ff3c53.js} +1 -1
- package/dist/lite/assets/{Storages-19fcbe71.js → Storages-90b21781.js} +1 -1
- package/dist/lite/assets/{Storages-legacy-5ebc3d51.js → Storages-legacy-49b7b995.js} +1 -1
- package/dist/lite/assets/{Upload-bab976d1.js → Upload-9447b1be.js} +1 -1
- package/dist/lite/assets/Upload-98dd51d8.js +1 -0
- package/dist/{assets/Upload-legacy-697222a4.js → lite/assets/Upload-legacy-3b92717c.js} +1 -1
- package/dist/{assets/Upload-legacy-97456639.js → lite/assets/Upload-legacy-ac99e541.js} +1 -1
- package/dist/{assets/Users-91b7f8a8.js → lite/assets/Users-30333127.js} +1 -1
- package/dist/{assets/Users-legacy-9e3df04e.js → lite/assets/Users-legacy-0719c277.js} +1 -1
- package/dist/{assets/Wether-43b7603f.js → lite/assets/Wether-b430b024.js} +1 -1
- package/dist/{assets/Wether-legacy-cc1f0291.js → lite/assets/Wether-legacy-274cd4f2.js} +1 -1
- package/dist/{assets/aliyun_office-d59c5e9a.js → lite/assets/aliyun_office-b0b45663.js} +1 -1
- package/dist/{assets/aliyun_office-legacy-6d97f684.js → lite/assets/aliyun_office-legacy-2d148972.js} +1 -1
- package/dist/lite/assets/{aliyun_video-0b1ad786.js → aliyun_video-b2790a1e.js} +1 -1
- package/dist/lite/assets/{aliyun_video-legacy-9f85902b.js → aliyun_video-legacy-6a647909.js} +1 -1
- package/dist/{assets/archive-0260fce8.js → lite/assets/archive-25c8ef3b.js} +1 -1
- package/dist/{assets/archive-legacy-e1a34b36.js → lite/assets/archive-legacy-348dc806.js} +1 -1
- package/dist/lite/assets/{asciinema-a593d25d.js → asciinema-03a03960.js} +1 -1
- package/dist/lite/assets/{asciinema-legacy-b15a697e.js → asciinema-legacy-1917d686.js} +1 -1
- package/dist/{assets/audio-98fc9dcc.js → lite/assets/audio-ea14d1c5.js} +1 -1
- package/dist/lite/assets/{audio-legacy-b511a260.js → audio-legacy-303c3bd9.js} +1 -1
- package/dist/lite/assets/{backup-restore-1f83d822.js → backup-restore-a1922c8b.js} +1 -1
- package/dist/lite/assets/{backup-restore-legacy-6af6248e.js → backup-restore-legacy-d4b0f25c.js} +1 -1
- package/dist/lite/assets/entry-27030f25.js +1 -0
- package/dist/lite/assets/{entry-9990379e.js → entry-f2e52067.js} +1 -1
- package/dist/lite/assets/entry-legacy-a1d93529.js +1 -0
- package/dist/lite/assets/{entry-legacy-f84cdf4a.js → entry-legacy-fd98eab3.js} +1 -1
- package/dist/lite/assets/{flash-4515c76f.js → flash-9e68a05e.js} +1 -1
- package/dist/lite/assets/{flash-legacy-337c4527.js → flash-legacy-80373572.js} +1 -1
- package/dist/lite/assets/{heic-25d064c0.js → heic-2554ec65.js} +1 -1
- package/dist/lite/assets/{heic-legacy-0759765a.js → heic-legacy-2c1c78ca.js} +1 -1
- package/dist/lite/assets/{helper-38d5804e.js → helper-59016ddf.js} +1 -1
- package/dist/lite/assets/{helper-1b501c84.js → helper-af29c315.js} +1 -1
- package/dist/lite/assets/{helper-legacy-a87fd1d8.js → helper-legacy-25bddff0.js} +1 -1
- package/dist/lite/assets/{helper-legacy-67cc1ad2.js → helper-legacy-94b49e67.js} +1 -1
- package/dist/lite/assets/{hls-e3fef076.js → hls-e031156d.js} +1 -1
- package/dist/lite/assets/{hls-legacy-19090a77.js → hls-legacy-20bdc1ee.js} +1 -1
- package/dist/{assets/html-bdc035e8.js → lite/assets/html-a748c03a.js} +1 -1
- package/dist/lite/assets/{html-legacy-71f39b76.js → html-legacy-619368c0.js} +1 -1
- package/dist/lite/assets/{icon-34a64e98.js → icon-cb9eb834.js} +1 -1
- package/dist/lite/assets/{icon-legacy-bc0a1d16.js → icon-legacy-eb0f5143.js} +1 -1
- package/dist/{assets/image-61c012df.js → lite/assets/image-c8b0bac2.js} +1 -1
- package/dist/{assets/image-legacy-a92bf4a3.js → lite/assets/image-legacy-7afc3d49.js} +1 -1
- package/dist/lite/assets/{index-bc9e61a1.js → index-3f395f83.js} +1 -1
- package/dist/lite/assets/{index-15e9db8f.js → index-53a1dd81.js} +2 -2
- package/dist/lite/assets/{index-c9ff382d.js → index-67a90f4f.js} +1 -1
- package/dist/lite/assets/{index-246c0bc3.js → index-6a28cbb7.js} +1 -1
- package/dist/{assets/index-1129f816.js → lite/assets/index-83750b21.js} +1 -1
- package/dist/{assets/index-b9e3ee84.js → lite/assets/index-9d2d674f.js} +1 -1
- package/dist/lite/assets/{index-8e8c9799.js → index-a14fae00.js} +1 -1
- package/dist/{assets/index-0777f5f5.js → lite/assets/index-b8211a8c.js} +1 -1
- package/dist/lite/assets/{index-a734ae71.js → index-b94004c5.js} +1 -1
- package/dist/{assets/index-f48d4e42.js → lite/assets/index-dfffd899.js} +1 -1
- package/dist/{assets/index-legacy-6fd08752.js → lite/assets/index-legacy-17656f04.js} +1 -1
- package/dist/{assets/index-legacy-3f9e8d60.js → lite/assets/index-legacy-3d6bd4ab.js} +1 -1
- package/dist/{assets/index-legacy-a0d1b466.js → lite/assets/index-legacy-52bb5f2d.js} +1 -1
- package/dist/lite/assets/{index-legacy-d6a1873d.js → index-legacy-6dddbd7f.js} +1 -1
- package/dist/lite/assets/{index-legacy-a2982e85.js → index-legacy-737b5776.js} +1 -1
- package/dist/lite/assets/{index-legacy-81513d1e.js → index-legacy-a79f37d7.js} +3 -3
- package/dist/{assets/index-legacy-39757966.js → lite/assets/index-legacy-b6946699.js} +1 -1
- package/dist/lite/assets/{index-legacy-aad632b4.js → index-legacy-d4734338.js} +1 -1
- package/dist/{assets/index-legacy-c1bd8450.js → lite/assets/index-legacy-e78804fc.js} +1 -1
- package/dist/{assets/index-legacy-fa97fb43.js → lite/assets/index-legacy-e78c6961.js} +1 -1
- package/dist/{assets/indexes-1309365a.js → lite/assets/indexes-8d6a3830.js} +1 -1
- package/dist/lite/assets/{indexes-legacy-b14be20a.js → indexes-legacy-8aad9cf2.js} +1 -1
- package/dist/{assets/ipa-912977e2.js → lite/assets/ipa-14799eac.js} +1 -1
- package/dist/{assets/ipa-legacy-55dbdce4.js → lite/assets/ipa-legacy-05317cab.js} +1 -1
- package/dist/{assets/markdown-19a32e31.js → lite/assets/markdown-438acebf.js} +1 -1
- package/dist/{assets/markdown-legacy-58ea0265.js → lite/assets/markdown-legacy-85cc7347.js} +1 -1
- package/dist/{assets/markdown_with_word_wrap-ec60452e.js → lite/assets/markdown_with_word_wrap-02b3d898.js} +1 -1
- package/dist/{assets/markdown_with_word_wrap-legacy-6675ead0.js → lite/assets/markdown_with_word_wrap-legacy-c80bbc34.js} +1 -1
- package/dist/lite/assets/offline_download-64a4f5ec.js +1 -0
- package/dist/{assets/offline_download-legacy-ba6d5dfc.js → lite/assets/offline_download-legacy-13c80c46.js} +1 -1
- package/dist/lite/assets/plist-caa63a1c.js +1 -0
- package/dist/{assets/plist-legacy-3a518b2d.js → lite/assets/plist-legacy-97df7129.js} +1 -1
- package/dist/lite/assets/{style-9cf67432.js → style-da60bdcd.js} +1 -1
- package/dist/lite/assets/{style-legacy-6d756fee.js → style-legacy-56f6ffc2.js} +1 -1
- package/dist/{assets/text-editor-edb83794.js → lite/assets/text-editor-faffc12e.js} +1 -1
- package/dist/{assets/text-editor-legacy-e6fc3983.js → lite/assets/text-editor-legacy-c28b9e68.js} +1 -1
- package/dist/{assets/url-335a199b.js → lite/assets/url-e7419bc0.js} +1 -1
- package/dist/lite/assets/{url-legacy-11b12bb3.js → url-legacy-c605c2b3.js} +1 -1
- package/dist/{assets/useTitle-a0cc1267.js → lite/assets/useTitle-3c39724b.js} +1 -1
- package/dist/{assets/useTitle-legacy-8bb574fc.js → lite/assets/useTitle-legacy-f359aa82.js} +1 -1
- package/dist/lite/assets/{video-67ac47cd.js → video-bdb2443b.js} +1 -1
- package/dist/{assets/video-legacy-a6aec191.js → lite/assets/video-legacy-aaca36d8.js} +1 -1
- package/dist/lite/assets/{video360-0e243801.js → video360-8fe849f4.js} +1 -1
- package/dist/{assets/video360-legacy-7a311ddd.js → lite/assets/video360-legacy-60cbacb5.js} +1 -1
- package/dist/{assets/video_box-0784b340.js → lite/assets/video_box-cfac536c.js} +1 -1
- package/dist/lite/assets/{video_box-legacy-b13adc7a.js → video_box-legacy-6b3ebc5b.js} +1 -1
- package/dist/lite/i18n.tar.gz +0 -0
- package/dist/lite/index.html +2 -2
- package/dist/static/manifest.json +1 -1
- package/package.json +20 -18
- package/dist/assets/2fa-legacy-22edf20f.js +0 -1
- package/dist/assets/About-7e5b3b83.js +0 -1
- package/dist/assets/About-legacy-6ced781d.js +0 -1
- package/dist/assets/Decompress-d99b16fc.js +0 -1
- package/dist/assets/Folder-legacy-b235c81a.js +0 -49
- package/dist/assets/Grid-913e5eac.js +0 -1
- package/dist/assets/Layout-27cd7d3f.js +0 -5
- package/dist/assets/Layout-legacy-c2c3d3bd.js +0 -6
- package/dist/assets/List-8b310ff4.js +0 -1
- package/dist/assets/Other-ac0d3329.js +0 -1
- package/dist/assets/SettingItem-legacy-300ae843.js +0 -1
- package/dist/assets/Storages-f2af63a0.js +0 -1
- package/dist/assets/Storages-legacy-1ea433dc.js +0 -1
- package/dist/assets/Upload-3c1fdf69.js +0 -1
- package/dist/assets/Upload-aaa6fe72.js +0 -5
- package/dist/assets/aliyun_video-b93ab8b8.js +0 -1
- package/dist/assets/aliyun_video-legacy-1e4f8f43.js +0 -1
- package/dist/assets/asciinema-aec02c46.js +0 -1
- package/dist/assets/asciinema-legacy-a761e605.js +0 -1
- package/dist/assets/audio-legacy-1f157d6e.js +0 -1
- package/dist/assets/backup-restore-legacy-0dd24564.js +0 -1
- package/dist/assets/entry-2d4c1a75.js +0 -1
- package/dist/assets/entry-be62f917.js +0 -1
- package/dist/assets/entry-legacy-b33a0fe8.js +0 -1
- package/dist/assets/entry-legacy-dcb91d2e.js +0 -1
- package/dist/assets/flash-77b7654a.js +0 -1
- package/dist/assets/flash-legacy-6c417ebd.js +0 -1
- package/dist/assets/heic-691aecae.js +0 -1
- package/dist/assets/heic-legacy-cf98e8e1.js +0 -1
- package/dist/assets/helper-452d7547.js +0 -1
- package/dist/assets/helper-f97d7d8c.js +0 -1
- package/dist/assets/helper-legacy-019e7dfd.js +0 -1
- package/dist/assets/helper-legacy-1c759197.js +0 -1
- package/dist/assets/hls-c79fa4ed.js +0 -6
- package/dist/assets/hls-legacy-f5373e92.js +0 -8
- package/dist/assets/html-legacy-b77e2ab2.js +0 -1
- package/dist/assets/icon-legacy-25c3f675.js +0 -1
- package/dist/assets/index-4174808c.js +0 -1
- package/dist/assets/index-745d7911.js +0 -20
- package/dist/assets/index-884ad8d5.js +0 -14
- package/dist/assets/index-legacy-0ce22645.js +0 -1
- package/dist/assets/index-legacy-105e76a6.js +0 -1
- package/dist/assets/index-legacy-54a561d9.js +0 -27
- package/dist/assets/index-legacy-b6b8ee86.js +0 -18
- package/dist/assets/indexes-legacy-d9fa87a4.js +0 -1
- package/dist/assets/item_type-legacy-d49ae974.js +0 -1
- package/dist/assets/offline_download-2ef93ac9.js +0 -1
- package/dist/assets/plist-e0ec85eb.js +0 -1
- package/dist/assets/polyfills-legacy-fa59231c.js +0 -1
- package/dist/assets/style-b219cc12.js +0 -1
- package/dist/assets/style-legacy-d75c8bd3.js +0 -1
- package/dist/assets/url-legacy-50fb2219.js +0 -1
- package/dist/assets/video-facd78dd.js +0 -7
- package/dist/assets/video360-5e189f21.js +0 -14
- package/dist/assets/video_box-legacy-4eed19e4.js +0 -8
- package/dist/assets/webauthn-json.browser-ponyfill-legacy-456cc8e1.js +0 -1
- package/dist/lite/assets/2fa-4a465895.js +0 -1
- package/dist/lite/assets/AddOrEdit-05eddf37.js +0 -1
- package/dist/lite/assets/AddOrEdit-0a32ef2b.js +0 -1
- package/dist/lite/assets/AddOrEdit-a672a89e.js +0 -1
- package/dist/lite/assets/AddOrEdit-legacy-410a39ae.js +0 -1
- package/dist/lite/assets/AddOrEdit-legacy-635b291f.js +0 -1
- package/dist/lite/assets/AddOrEdit-legacy-c9de1dcb.js +0 -1
- package/dist/lite/assets/Common-d7f1cd18.js +0 -1
- package/dist/lite/assets/Common-legacy-02442dbd.js +0 -1
- package/dist/lite/assets/Copy-9d04e9c2.js +0 -1
- package/dist/lite/assets/Copy-legacy-f0411d3f.js +0 -1
- package/dist/lite/assets/Decompress-560c482c.js +0 -1
- package/dist/lite/assets/Decompress-legacy-41d6332f.js +0 -1
- package/dist/lite/assets/DeletePopover-legacy-9608bf45.js +0 -1
- package/dist/lite/assets/File-67912414.js +0 -1
- package/dist/lite/assets/File-legacy-1c237b3a.js +0 -1
- package/dist/lite/assets/Folder-676d5a43.js +0 -114
- package/dist/lite/assets/FolderTree-fb1c4d9d.js +0 -1
- package/dist/lite/assets/FolderTree-legacy-ce0bae10.js +0 -1
- package/dist/lite/assets/Grid-41c23624.js +0 -1
- package/dist/lite/assets/Grid-legacy-39784739.js +0 -1
- package/dist/lite/assets/GridItem-e81d1ac0.js +0 -1
- package/dist/lite/assets/GridItem-legacy-957fe815.js +0 -1
- package/dist/lite/assets/ImageWithError-legacy-e07fe62a.js +0 -1
- package/dist/lite/assets/Images-b006a129.js +0 -1
- package/dist/lite/assets/Images-legacy-3f8cb948.js +0 -1
- package/dist/lite/assets/List-legacy-13be9e59.js +0 -1
- package/dist/lite/assets/Messenger-f78d1d2d.js +0 -1
- package/dist/lite/assets/Messenger-legacy-b9210e6d.js +0 -1
- package/dist/lite/assets/Metas-1d100729.js +0 -1
- package/dist/lite/assets/Metas-legacy-7a3076ce.js +0 -1
- package/dist/lite/assets/Other-legacy-acf23a73.js +0 -1
- package/dist/lite/assets/PackageDownload-d6aa53a6.js +0 -1
- package/dist/lite/assets/PackageDownload-legacy-3848c46c.js +0 -1
- package/dist/lite/assets/Paginator-legacy-275039ed.js +0 -1
- package/dist/lite/assets/Password-3d5ea869.js +0 -1
- package/dist/lite/assets/Password-legacy-0c24d858.js +0 -1
- package/dist/lite/assets/Profile-legacy-61e003fb.js +0 -1
- package/dist/lite/assets/PublicKeys-2352a7bb.js +0 -1
- package/dist/lite/assets/PublicKeys-legacy-1b812dd5.js +0 -1
- package/dist/lite/assets/ResponsiveGrid-4dd21281.js +0 -1
- package/dist/lite/assets/ResponsiveGrid-legacy-1c08fe8e.js +0 -1
- package/dist/lite/assets/S3-7d0f028b.js +0 -1
- package/dist/lite/assets/S3-legacy-232d5988.js +0 -1
- package/dist/lite/assets/SettingItem-0ebae0a8.js +0 -1
- package/dist/lite/assets/Upload-7273e8c2.js +0 -1
- package/dist/lite/assets/Upload-legacy-7ffd4a40.js +0 -6
- package/dist/lite/assets/Upload-legacy-ab16f638.js +0 -1
- package/dist/lite/assets/Users-a49cab2c.js +0 -1
- package/dist/lite/assets/Users-legacy-29182339.js +0 -1
- package/dist/lite/assets/Wether-c8cd1781.js +0 -1
- package/dist/lite/assets/Wether-legacy-7580e6d4.js +0 -1
- package/dist/lite/assets/aliyun_office-6727a571.js +0 -1
- package/dist/lite/assets/aliyun_office-legacy-ec27781d.js +0 -1
- package/dist/lite/assets/archive-8c9d1291.js +0 -1
- package/dist/lite/assets/archive-legacy-69bdedf0.js +0 -1
- package/dist/lite/assets/audio-61f09d3f.js +0 -1
- package/dist/lite/assets/entry-8bce92dd.js +0 -1
- package/dist/lite/assets/entry-legacy-ef414ba2.js +0 -1
- package/dist/lite/assets/image-ad6c3478.js +0 -1
- package/dist/lite/assets/image-legacy-b1b12514.js +0 -1
- package/dist/lite/assets/index-04bae706.js +0 -1
- package/dist/lite/assets/index-079cd1f2.js +0 -1
- package/dist/lite/assets/index-legacy-26fd6706.js +0 -1
- package/dist/lite/assets/index-legacy-47ddae0d.js +0 -1
- package/dist/lite/assets/index-legacy-c5ef6985.js +0 -1
- package/dist/lite/assets/index-legacy-c65cb5fa.js +0 -1
- package/dist/lite/assets/index-legacy-ee8d78f1.js +0 -1
- package/dist/lite/assets/index-legacy-eff70e35.js +0 -1
- package/dist/lite/assets/indexes-9f8a0da5.js +0 -1
- package/dist/lite/assets/ipa-58520283.js +0 -1
- package/dist/lite/assets/ipa-legacy-54b93dc8.js +0 -1
- package/dist/lite/assets/markdown-2474d31f.js +0 -1
- package/dist/lite/assets/markdown-legacy-d6aa61d6.js +0 -1
- package/dist/lite/assets/markdown_with_word_wrap-7d6648bc.js +0 -1
- package/dist/lite/assets/markdown_with_word_wrap-legacy-c1248f0d.js +0 -1
- package/dist/lite/assets/offline_download-26cf1159.js +0 -1
- package/dist/lite/assets/offline_download-legacy-c3c505b2.js +0 -1
- package/dist/lite/assets/plist-5b15735d.js +0 -1
- package/dist/lite/assets/plist-legacy-74505ae8.js +0 -1
- package/dist/lite/assets/text-editor-7e706d71.js +0 -1
- package/dist/lite/assets/text-editor-legacy-3874bbc7.js +0 -1
- package/dist/lite/assets/url-6f48922c.js +0 -1
- package/dist/lite/assets/useTitle-47d2061a.js +0 -1
- package/dist/lite/assets/useTitle-legacy-29ec3cc1.js +0 -1
- package/dist/lite/assets/video-legacy-d8a5c028.js +0 -9
- package/dist/lite/assets/video360-legacy-0fdffd53.js +0 -16
- package/dist/lite/assets/video_box-21c6a895.js +0 -6
- /package/dist/assets/{SourceHanSansCN-Bold-b5627435.woff2 → SourceHanSansCN-Bold-ufPDHtmM.woff2} +0 -0
- /package/dist/assets/{TimesNewRoman-d9fb32eb.ttf → TimesNewRoman-CJFXaXxy.ttf} +0 -0
- /package/dist/assets/{asciinema-9107553b.css → asciinema-CxBn2iyI.css} +0 -0
- /package/dist/assets/{index-c0564af7.css → index-DYLAoZjS.css} +0 -0
- /package/dist/assets/{item_type-32dc6fdf.js → item_type-CV3e5W3l.js} +0 -0
- /package/dist/assets/{lg-f2fe1c00.svg → lg-B0dIV2BS.svg} +0 -0
- /package/dist/assets/{lg-fefc5c0d.woff → lg-CosQH4Cu.woff} +0 -0
- /package/dist/assets/{lg-22b72ba5.ttf → lg-oyjwlqP2.ttf} +0 -0
- /package/dist/assets/{loading-298ad3ff.gif → loading-BZOHaeKn.gif} +0 -0
- /package/dist/assets/{style-a6d16836.css → style-qq4T_k44.css} +0 -0
- /package/dist/assets/{subtitles-octopus-worker-f95f2186.js → subtitles-octopus-worker-BE_B0Qbi.js} +0 -0
- /package/dist/assets/{subtitles-octopus-worker-62892886.wasm → subtitles-octopus-worker-DBPz2dPT.wasm} +0 -0
- /package/dist/assets/{video360-f0192288.css → video360-Cpoa0Nlv.css} +0 -0
- /package/dist/assets/{webauthn-json.browser-ponyfill-29d8152c.js → webauthn-json.browser-ponyfill-CVZeZdny.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b_=Object.defineProperty;var zg=h=>{throw TypeError(h)};var w_=(h,t,e)=>t in h?b_(h,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):h[t]=e;var k=(h,t,e)=>w_(h,typeof t!="symbol"?t+"":t,e),Gg=(h,t,e)=>t.has(h)||zg("Cannot "+e),tw=(h,t)=>Object(t)!==t?zg('Cannot use the "in" operator on this value'):h.has(t),r=(h,t,e)=>(Gg(h,t,"read from private field"),e?e.call(h):t.get(h)),m=(h,t,e)=>t.has(h)?zg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(h):t.set(h,e),f=(h,t,e,i)=>(Gg(h,t,"write to private field"),i?i.call(h,e):t.set(h,e),e),p=(h,t,e)=>(Gg(h,t,"access private method"),e);var se=(h,t,e,i)=>({set _(s){f(h,t,s,e)},get _(){return r(h,t,i)}});import{e5 as v_,dK as y_,e6 as ew,bT as A_,e7 as __,B as $i,e8 as E_,N as uc,C as Ou,cu as S_,av as Lb,e4 as Mv,aZ as kv,D as O,bV as P_,V as Zf,ck as Dv,dH as Nv,e9 as x_,ea as C_,aS as Sn,Q as T_,aY as I_,cR as L_,am as Nr,a6 as Qf,a3 as Jf,o as Fv,aV as $r,aA as Ln,ag as R_,S as vc,O as M_,a4 as Uo,eb as k_,ec as D_,di as Xg,ed as N_,aJ as F_,az as O_,K as Ov,aF as B_,ee as iw,ef as sw,aG as nw,eg as V_,I as H_}from"./index-CSwg5QXS.js";const Ce=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),bp=[.001,0,0,.001,0,0],qg=1.35,si={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},vs={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Bv="pdfjs_internal_editor_",Y={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101},st={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_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},j_={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},ge={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},rf={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Bt={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},Lo={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},Ng={ERRORS:0,WARNINGS:1,INFOS:5},tg={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},Wu={moveTo:0,lineTo:1,curveTo:2,closePath:3},$_={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Fg=Ng.WARNINGS;function U_(h){Number.isInteger(h)&&(Fg=h)}function W_(){return Fg}function Og(h){Fg>=Ng.INFOS&&console.log("Info: ".concat(h))}function Z(h){Fg>=Ng.WARNINGS&&console.log("Warning: ".concat(h))}function gt(h){throw new Error(h)}function Ht(h,t){h||gt(t)}function z_(h){switch(h==null?void 0:h.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Vv(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=K_(h)}catch(s){}}const i=t?URL.parse(h,t):URL.parse(h);return z_(i)?i:null}function Hv(h,t,e=!1){const i=URL.parse(h);return i?(i.hash=t,i.href):e&&Vv(h,"http://example.com")?h.split("#",1)[0]+"".concat(t?"#".concat(t):""):""}function nt(h,t,e,i=!1){return Object.defineProperty(h,t,{value:e,enumerable:!i,configurable:!0,writable:!1}),e}const Co=function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class rw extends Co{constructor(t,e){super(t,"PasswordException"),this.code=e}}class Yg extends Co{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}let wp=class extends Co{constructor(t){super(t,"InvalidPDFException")}},eg=class extends Co{constructor(t,e,i){super(t,"ResponseException"),this.status=e,this.missing=i}};class G_ extends Co{constructor(t){super(t,"FormatError")}}let Fr=class extends Co{constructor(t){super(t,"AbortException")}};function jv(h){(typeof h!="object"||(h==null?void 0:h.length)===void 0)&>("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),a=h.subarray(s,n);i.push(String.fromCharCode.apply(null,a))}return i.join("")}function Bu(h){typeof h!="string"&>("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 X_(h){return String.fromCharCode(h>>24&255,h>>16&255,h>>8&255,h&255)}function q_(){const h=new Uint8Array(4);return h[0]=1,new Uint32Array(h.buffer,0,1)[0]===1}function Y_(){try{return new Function(""),!0}catch(h){return!1}}class fe{static get isLittleEndian(){return nt(this,"isLittleEndian",q_())}static get isEvalSupported(){return nt(this,"isEvalSupported",Y_())}static get isOffscreenCanvasSupported(){return nt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return nt(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:e}=navigator;return nt(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 nt(this,"isCSSRoundSupported",(e=(t=globalThis.CSS)==null?void 0:t.supports)==null?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const Kg=Array.from(Array(256).keys(),h=>h.toString(16).padStart(2,"0"));var An,pp,af,vp;let q=(pp=class{static makeHexColor(t,e,i){return"#".concat(Kg[t]).concat(Kg[e]).concat(Kg[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],a=e[2],o=e[3],l=e[4],c=e[5];for(let d=0;d<6;d+=2){const u=t[i+d],g=t[i+d+1];t[i+d]=u*s+g*a+l,t[i+d+1]=u*n+g*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],a=e[2],o=e[3],l=e[4],c=e[5],d=t[0],u=t[1],g=t[2],b=t[3];let w=s*d+l,v=w,y=s*g+l,A=y,E=o*u+c,_=E,S=o*b+c,P=S;if(n!==0||a!==0){const x=n*d,T=n*g,I=a*u,C=a*b;w+=I,A+=I,y+=C,v+=C,E+=x,P+=x,S+=T,_+=T}i[0]=Math.min(i[0],w,y,v,A),i[1]=Math.min(i[1],E,S,_,P),i[2]=Math.max(i[2],w,y,v,A),i[3]=Math.max(i[3],E,S,_,P)}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],a=t[3],o=i**2+s**2,l=i*n+s*a,c=n**2+a**2,d=(o+c)/2,u=Math.sqrt(d**2-(o*c-l**2));e[0]=Math.sqrt(d+u||1),e[1]=Math.sqrt(d-u||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const 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])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return n>a?null:[i,n,s,a]}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,a,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),p(this,An,vp).call(this,t,i,n,o,e,s,a,l,3*(-t+3*(i-n)+o),6*(t-2*i+n),3*(i-t),c),p(this,An,vp).call(this,t,i,n,o,e,s,a,l,3*(-e+3*(s-a)+l),6*(e-2*s+a),3*(s-e),c)}},An=new WeakSet,af=function(t,e,i,s,n,a,o,l,c,d){if(c<=0||c>=1)return;const u=1-c,g=c*c,b=g*c,w=u*(u*(u*t+3*c*e)+3*g*i)+b*s,v=u*(u*(u*n+3*c*a)+3*g*o)+b*l;d[0]=Math.min(d[0],w),d[1]=Math.min(d[1],v),d[2]=Math.max(d[2],w),d[3]=Math.max(d[3],v)},vp=function(t,e,i,s,n,a,o,l,c,d,u,g){if(Math.abs(c)<1e-12){Math.abs(d)>=1e-12&&p(this,An,af).call(this,t,e,i,s,n,a,o,l,-u/d,g);return}const b=d**2-4*u*c;if(b<0)return;const w=Math.sqrt(b),v=2*c;p(this,An,af).call(this,t,e,i,s,n,a,o,l,(-d+w)/v,g),p(this,An,af).call(this,t,e,i,s,n,a,o,l,(-d-w)/v,g)},m(pp,An),pp);function K_(h){return decodeURIComponent(escape(h))}let Zg=null,aw=null;function Z_(h){return Zg||(Zg=/([\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,aw=new Map([["ſt","ſt"]])),h.replaceAll(Zg,(t,e,i)=>e?e.normalize("NFKC"):aw.get(i))}function $v(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const h=new Uint8Array(32);return crypto.getRandomValues(h),jv(h)}const Rb="pdfjs_internal_id_";function Q_(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 a=n.length;let o=!0;switch(s.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return a===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(a!==4)return!1;o=!1;break;default:return!1}for(const l of n)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function Te(h,t,e){return Math.min(Math.max(h,t),e)}function Uv(h){return Uint8Array.prototype.toBase64?h.toBase64():btoa(jv(h))}function J_(h){return Uint8Array.fromBase64?Uint8Array.fromBase64(h):Bu(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 Ss="http://www.w3.org/2000/svg";var ws;let Or=(ws=class{},k(ws,"CSS",96),k(ws,"PDF",72),k(ws,"PDF_TO_CSS_UNITS",ws.CSS/ws.PDF),ws);async function Vu(h,t="text"){if(Bh(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 Hu{constructor({viewBox:t,userUnit:e,scale:i,rotation:s,offsetX:n=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=t,this.userUnit=e,this.scale=i,this.rotation=s,this.offsetX=n,this.offsetY=a,i*=e;const l=(t[2]+t[0])/2,c=(t[3]+t[1])/2;let d,u,g,b;switch(s%=360,s<0&&(s+=360),s){case 180:d=-1,u=0,g=0,b=1;break;case 90:d=0,u=1,g=1,b=0;break;case 270:d=0,u=-1,g=-1,b=0;break;case 0:d=1,u=0,g=0,b=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(g=-g,b=-b);let w,v,y,A;d===0?(w=Math.abs(c-t[1])*i+n,v=Math.abs(l-t[0])*i+a,y=(t[3]-t[1])*i,A=(t[2]-t[0])*i):(w=Math.abs(l-t[0])*i+n,v=Math.abs(c-t[1])*i+a,y=(t[2]-t[0])*i,A=(t[3]-t[1])*i),this.transform=[d*i,u*i,g*i,b*i,w-d*i*l-g*i*c,v-u*i*l-b*i*c],this.width=y,this.height=A}get rawDims(){const t=this.viewBox;return nt(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 Hu({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 Ih=class extends Co{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}};function Bg(h){const t=h.length;let e=0;for(;e<t&&h[e].trim()==="";)e++;return h.substring(e,e+5).toLowerCase()==="data:"}function Mb(h){return typeof h=="string"&&/\.pdf$/i.test(h)}function tE(h){return[h]=h.split(/[#?]/,1),h.substring(h.lastIndexOf("/")+1)}function Wv(h,t="document.pdf"){if(typeof h!="string")return t;if(Bg(h))return Z('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(d){try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch(u){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,a=i.pathname.split("/").at(-1);if(n.test(a))return s(a);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 ow{constructor(){k(this,"started",Object.create(null));k(this,"times",[])}time(t){t in this.started&&Z("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||Z("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 Bh(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 Wi(h){h.preventDefault()}function Vt(h){h.preventDefault(),h.stopPropagation()}function eE(h){console.log("Deprecated API usage: "+h)}var mp,Pc;let ig=(mp=class{static toDateObject(t){if(!t||typeof t!="string")return null;r(this,Pc)||f(this,Pc,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=r(this,Pc).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 a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let d=parseInt(e[8],10);d=d>=0&&d<=23?d:0;let u=parseInt(e[9],10)||0;return u=u>=0&&u<=59?u:0,c==="-"?(a+=d,o+=u):c==="+"&&(a-=d,o-=u),new Date(Date.UTC(i,s,n,a,o,l))}},Pc=new WeakMap,m(mp,Pc),mp);function zv(h,{scale:t=1,rotation:e=0}){const{width:i,height:s}=h.attributes.style,n=[0,0,parseInt(i),parseInt(s)];return new Hu({viewBox:n,userUnit:1,scale:t,rotation:e})}function kb(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):(Z('Not a valid color format: "'.concat(h,'"')),[0,0,0])}function iE(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,kb(i))}t.remove()}function Ct(h){const{a:t,b:e,c:i,d:s,e:n,f:a}=h.getTransform();return[t,e,i,s,n,a]}function Gi(h){const{a:t,b:e,c:i,d:s,e:n,f:a}=h.getTransform().invertSelf();return[t,e,i,s,n,a]}function Eo(h,t,e=!1,i=!0){if(t instanceof Hu){const{pageWidth:s,pageHeight:n}=t.rawDims,{style:a}=h,o=fe.isCSSRoundSupported,l="var(--total-scale-factor) * ".concat(s,"px"),c="var(--total-scale-factor) * ".concat(n,"px"),d=o?"round(down, ".concat(l,", var(--scale-round-x))"):"calc(".concat(l,")"),u=o?"round(down, ".concat(c,", var(--scale-round-y))"):"calc(".concat(c,")");!e||t.rotation%180===0?(a.width=d,a.height=u):(a.width=u,a.height=d)}i&&h.setAttribute("data-main-rotation",t.rotation)}let So=class yp{constructor(){const{pixelRatio:t}=yp;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 a=1/0,o=1/0,l=1/0;i=yp.capPixels(i,n),i>0&&(a=Math.sqrt(i/(t*e))),s!==-1&&(o=s/t,l=s/e);const c=Math.min(a,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 Ap=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];var kn,ta,fi,Dn,xc,Zo,Cc,ug,Gv,Ie,Xv,qv,Vh,of;const Ts=class Ts{constructor(t){m(this,Ie);m(this,kn,null);m(this,ta,null);m(this,fi);m(this,Dn,null);m(this,xc,null);m(this,Zo,null);f(this,fi,t),r(Ts,Cc)||f(Ts,Cc,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=f(this,kn,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=r(this,fi)._uiManager._signal;t.addEventListener("contextmenu",Wi,{signal:e}),t.addEventListener("pointerdown",p(Ts,ug,Gv),{signal:e});const i=f(this,Dn,document.createElement("div"));i.className="buttons",t.append(i);const s=r(this,fi).toolbarPosition;if(s){const{style:n}=t,a=r(this,fi)._uiManager.direction==="ltr"?1-s[0]:s[0];n.insetInlineEnd="".concat(100*a,"%"),n.top="calc(".concat(100*s[1],"% + var(--editor-toolbar-vert-offset))")}return t}get div(){return r(this,kn)}hide(){var t;r(this,kn).classList.add("hidden"),(t=r(this,ta))==null||t.hideDropdown()}show(){var t;r(this,kn).classList.remove("hidden"),(t=r(this,xc))==null||t.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=r(this,fi),i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",r(Ts,Cc)[t]),p(this,Ie,Vh).call(this,i),i.addEventListener("click",s=>{e.delete()},{signal:e._signal}),r(this,Dn).append(i)}async addAltText(t){const e=await t.render();p(this,Ie,Vh).call(this,e),r(this,Dn).append(e,r(this,Ie,of)),f(this,xc,t)}addColorPicker(t){f(this,ta,t);const e=t.renderButton();p(this,Ie,Vh).call(this,e),r(this,Dn).append(e,r(this,Ie,of))}async addEditSignatureButton(t){const e=f(this,Zo,await t.renderEditButton(r(this,fi)));p(this,Ie,Vh).call(this,e),r(this,Dn).append(e,r(this,Ie,of))}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}}updateEditSignatureButton(t){r(this,Zo)&&(r(this,Zo).title=t)}remove(){var t;r(this,kn).remove(),(t=r(this,ta))==null||t.destroy(),f(this,ta,null)}};kn=new WeakMap,ta=new WeakMap,fi=new WeakMap,Dn=new WeakMap,xc=new WeakMap,Zo=new WeakMap,Cc=new WeakMap,ug=new WeakSet,Gv=function(t){t.stopPropagation()},Ie=new WeakSet,Xv=function(t){r(this,fi)._focusEventsAllowed=!1,Vt(t)},qv=function(t){r(this,fi)._focusEventsAllowed=!0,Vt(t)},Vh=function(t){const e=r(this,fi)._uiManager._signal;t.addEventListener("focusin",p(this,Ie,Xv).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",p(this,Ie,qv).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",Wi,{signal:e})},of=function(){const t=document.createElement("div");return t.className="divider",t},m(Ts,ug),m(Ts,Cc,null);let _p=Ts;var Tc,ea,ia,Vr,Yv,Kv,Zv;class sE{constructor(t){m(this,Vr);m(this,Tc,null);m(this,ea,null);m(this,ia);f(this,ia,t)}show(t,e,i){const[s,n]=p(this,Vr,Kv).call(this,e,i),{style:a}=r(this,ea)||f(this,ea,p(this,Vr,Yv).call(this));t.append(r(this,ea)),a.insetInlineEnd="".concat(100*s,"%"),a.top="calc(".concat(100*n,"% + var(--editor-toolbar-vert-offset))")}hide(){r(this,ea).remove()}}Tc=new WeakMap,ea=new WeakMap,ia=new WeakMap,Vr=new WeakSet,Yv=function(){const t=f(this,ea,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",Wi,{signal:r(this,ia)._signal});const e=f(this,Tc,document.createElement("div"));return e.className="buttons",t.append(e),p(this,Vr,Zv).call(this),t},Kv=function(t,e){let i=0,s=0;for(const n of t){const a=n.y+n.height;if(a<i)continue;const o=n.x+(e?n.width:0);if(a>i){s=o,i=a;continue}e?o>s&&(s=o):o<s&&(s=o)}return[e?1-s:s,i]},Zv=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=r(this,ia)._signal;t.addEventListener("contextmenu",Wi,{signal:i}),t.addEventListener("click",()=>{r(this,ia).highlightSelection("floating_button")},{signal:i}),r(this,Tc).append(t)};function Qv(h,t,e){for(const i of e)t.addEventListener(i,h[i].bind(h))}var fg;class nE{constructor(){m(this,fg,0)}get id(){return"".concat(Bv).concat(se(this,fg)._++)}}fg=new WeakMap;var Qo,Ic,me,Jo,lf;const qb=class qb{constructor(){m(this,Jo);m(this,Qo,$v());m(this,Ic,0);m(this,me,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 nt(this,"_isSVGFittingCanvas",n)}async getFromFile(t){const{lastModified:e,name:i,size:s,type:n}=t;return p(this,Jo,lf).call(this,"".concat(e,"_").concat(i,"_").concat(s,"_").concat(n),t)}async getFromUrl(t){return p(this,Jo,lf).call(this,t,t)}async getFromBlob(t,e){const i=await e;return p(this,Jo,lf).call(this,t,i)}async getFromId(t){r(this,me)||f(this,me,new Map);const e=r(this,me).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){r(this,me)||f(this,me,new Map);let i=r(this,me).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(r(this,Qo),"_").concat(se(this,Ic)._++),refCounter:1,isSvg:!1},r(this,me).set(t,i),r(this,me).set(i.id,i),i}getSvgUrl(t){const e=r(this,me).get(t);return e!=null&&e.isSvg?e.svgUrl:null}deleteId(t){var s;r(this,me)||f(this,me,new Map);const e=r(this,me).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(r(this,Qo),"_"))}};Qo=new WeakMap,Ic=new WeakMap,me=new WeakMap,Jo=new WeakSet,lf=async function(t,e){r(this,me)||f(this,me,new Map);let i=r(this,me).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(r(this,Qo),"_").concat(se(this,Ic)._++),refCounter:0,isSvg:!1});let s;if(typeof e=="string"?(i.url=e,s=await Vu(e,"blob")):e instanceof File?s=i.file=e:e instanceof Blob&&(s=e),s.type==="image/svg+xml"){const n=qb._isSVGFittingCanvas,a=new FileReader,o=new Image,l=new Promise((c,d)=>{o.onload=()=>{i.bitmap=o,i.isSvg=!0,c()},a.onload=async()=>{const u=i.svgUrl=a.result;o.src=await n?"".concat(u,"#svgView(preserveAspectRatio(none))"):u},o.onerror=a.onerror=d});a.readAsDataURL(s),await l}else i.bitmap=await createImageBitmap(s);i.refCounter=1}catch(s){Z(s),i=null}return r(this,me).set(t,i),i&&r(this,me).set(i.id,i),i};let Ep=qb;var Dt,Nn,Lc,xt;class rE{constructor(t=128){m(this,Dt,[]);m(this,Nn,!1);m(this,Lc);m(this,xt,-1);f(this,Lc,t)}add({cmd:t,undo:e,post:i,mustExec:s,type:n=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(s&&t(),r(this,Nn))return;const l={cmd:t,undo:e,post:i,type:n};if(r(this,xt)===-1){r(this,Dt).length>0&&(r(this,Dt).length=0),f(this,xt,0),r(this,Dt).push(l);return}if(a&&r(this,Dt)[r(this,xt)].type===n){o&&(l.undo=r(this,Dt)[r(this,xt)].undo),r(this,Dt)[r(this,xt)]=l;return}const c=r(this,xt)+1;c===r(this,Lc)?r(this,Dt).splice(0,1):(f(this,xt,c),c<r(this,Dt).length&&r(this,Dt).splice(c)),r(this,Dt).push(l)}undo(){if(r(this,xt)===-1)return;f(this,Nn,!0);const{undo:t,post:e}=r(this,Dt)[r(this,xt)];t(),e==null||e(),f(this,Nn,!1),f(this,xt,r(this,xt)-1)}redo(){if(r(this,xt)<r(this,Dt).length-1){f(this,xt,r(this,xt)+1),f(this,Nn,!0);const{cmd:t,post:e}=r(this,Dt)[r(this,xt)];t(),e==null||e(),f(this,Nn,!1)}}hasSomethingToUndo(){return r(this,xt)!==-1}hasSomethingToRedo(){return r(this,xt)<r(this,Dt).length-1}cleanType(t){if(r(this,xt)!==-1){for(let e=r(this,xt);e>=0;e--)if(r(this,Dt)[e].type!==t){r(this,Dt).splice(e+1,r(this,xt)-e),f(this,xt,e);return}r(this,Dt).length=0,f(this,xt,-1)}}destroy(){f(this,Dt,null)}}Dt=new WeakMap,Nn=new WeakMap,Lc=new WeakMap,xt=new WeakMap;var gg,Jv;class ju{constructor(t){m(this,gg);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=fe.platform;for(const[i,s,n={}]of t)for(const a of i){const o=a.startsWith("mac+");e&&o?(this.callbacks.set(a.slice(4),{callback:s,options:n}),this.allKeys.add(a.split("+").at(-1))):!e&&!o&&(this.callbacks.set(a,{callback:s,options:n}),this.allKeys.add(a.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(p(this,gg,Jv).call(this,e));if(!i)return;const{callback:s,options:{bubbles:n=!1,args:a=[],checker:o=null}}=i;o&&!o(t,e)||(s.bind(t,...a,e)(),n||Vt(e))}}gg=new WeakSet,Jv=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 pg=class pg{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return iE(t),nt(this,"_colors",t)}convert(t){const e=kb(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,s]of this._colors)if(s.every((n,a)=>n===e[a]))return pg._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?q.makeHexColor(...e):t}};k(pg,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let Sp=pg;var tl,$e,Ut,ne,el,Rs,il,gi,Fn,On,sl,sa,Zi,Pi,na,Rc,Mc,nl,kc,Qi,Bn,rl,Vn,Ji,mg,Hn,Dc,jn,ra,aa,$n,Nc,Yt,dt,Ms,Un,oa,Fc,Oc,Wn,ts,ks,Bc,Vc,pi,vn,F,hf,Pp,ty,ey,cf,iy,sy,ny,xp,ry,Cp,Tp,ay,ye,Ps,oy,ly,Ip,hy,Hh,Lp;let yc=(vn=class{constructor(t,e,i,s,n,a,o,l,c,d,u,g,b,w,v){m(this,F);m(this,tl,new AbortController);m(this,$e,null);m(this,Ut,new Map);m(this,ne,new Map);m(this,el,null);m(this,Rs,null);m(this,il,null);m(this,gi,new rE);m(this,Fn,null);m(this,On,null);m(this,sl,0);m(this,sa,new Set);m(this,Zi,null);m(this,Pi,null);m(this,na,new Set);k(this,"_editorUndoBar",null);m(this,Rc,!1);m(this,Mc,!1);m(this,nl,!1);m(this,kc,null);m(this,Qi,null);m(this,Bn,null);m(this,rl,null);m(this,Vn,!1);m(this,Ji,null);m(this,mg,new nE);m(this,Hn,!1);m(this,Dc,!1);m(this,jn,null);m(this,ra,null);m(this,aa,null);m(this,$n,null);m(this,Nc,null);m(this,Yt,Y.NONE);m(this,dt,new Set);m(this,Ms,null);m(this,Un,null);m(this,oa,null);m(this,Fc,null);m(this,Oc,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});m(this,Wn,[0,0]);m(this,ts,null);m(this,ks,null);m(this,Bc,null);m(this,Vc,null);m(this,pi,null);const y=this._signal=r(this,tl).signal;f(this,ks,t),f(this,Bc,e),f(this,Vc,i),f(this,el,s),f(this,Un,n),this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:y}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:y}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:y}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:y}),a._on("setpreference",this.onSetPreference.bind(this),{signal:y}),a._on("switchannotationeditorparams",A=>this.updateParams(A.type,A.value),{signal:y}),p(this,F,iy).call(this),p(this,F,ay).call(this),p(this,F,xp).call(this),f(this,Rs,o.annotationStorage),f(this,kc,o.filterFactory),f(this,oa,l),f(this,rl,c||null),f(this,Rc,d),f(this,Mc,u),f(this,nl,g),f(this,Nc,b||null),this.viewParameters={realScale:Or.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=w||null,this._supportsPinchToZoom=v!==!1}static get _keyboardManager(){const t=vn.prototype,e=a=>r(a,ks).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),i=(a,{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 nt(this,"_keyboardManager",new ju([[["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:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&r(a,ks).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&r(a,ks).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,a,o,l;(t=r(this,pi))==null||t.resolve(),f(this,pi,null),(e=r(this,tl))==null||e.abort(),f(this,tl,null),this._signal=null;for(const c of r(this,ne).values())c.destroy();r(this,ne).clear(),r(this,Ut).clear(),r(this,na).clear(),(i=r(this,$n))==null||i.clear(),f(this,$e,null),r(this,dt).clear(),r(this,gi).destroy(),(s=r(this,el))==null||s.destroy(),(n=r(this,Un))==null||n.destroy(),(a=r(this,Ji))==null||a.hide(),f(this,Ji,null),(o=r(this,aa))==null||o.destroy(),f(this,aa,null),r(this,Qi)&&(clearTimeout(r(this,Qi)),f(this,Qi,null)),r(this,ts)&&(clearTimeout(r(this,ts)),f(this,ts,null)),(l=this._editorUndoBar)==null||l.destroy()}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return r(this,Nc)}get useNewAltTextFlow(){return r(this,Mc)}get useNewAltTextWhenAddingImage(){return r(this,nl)}get hcmFilter(){return nt(this,"hcmFilter",r(this,oa)?r(this,kc).addHCMFilter(r(this,oa).foreground,r(this,oa).background):"none")}get direction(){return nt(this,"direction",getComputedStyle(r(this,ks)).direction)}get highlightColors(){return nt(this,"highlightColors",r(this,rl)?new Map(r(this,rl).split(",").map(t=>(t=t.split("=").map(e=>e.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColorNames(){return nt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),f(this,On,t)}setMainHighlightColorPicker(t){f(this,aa,t)}editAltText(t,e=!1){var i;(i=r(this,el))==null||i.editAltText(this,t,e)}getSignature(t){var e;(e=r(this,Un))==null||e.getSignature({uiManager:this,editor:t})}get signatureManager(){return r(this,Un)}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":f(this,nl,e);break}}onPageChanging({pageNumber:t}){f(this,sl,t-1)}focusMainContainer(){r(this,ks).focus()}findParent(t,e){for(const i of r(this,ne).values()){const{x:s,y:n,width:a,height:o}=i.div.getBoundingClientRect();if(t>=s&&t<=s+a&&e>=n&&e<=n+o)return i}return null}disableUserSelect(t=!1){r(this,Bc).classList.toggle("noUserSelect",t)}addShouldRescale(t){r(this,na).add(t)}removeShouldRescale(t){r(this,na).delete(t)}onScaleChanging({scale:t}){var e;this.commitOrRemove(),this.viewParameters.realScale=t*Or.PDF_TO_CSS_UNITS;for(const i of r(this,na))i.onScaleChanging();(e=r(this,On))==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:a}=e,o=e.toString(),c=p(this,F,hf).call(this,e).closest(".textLayer"),d=this.getSelectionBoxes(c);if(!d)return;e.empty();const u=p(this,F,Pp).call(this,c),g=r(this,Yt)===Y.NONE,b=()=>{u==null||u.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:d,anchorNode:i,anchorOffset:s,focusNode:n,focusOffset:a,text:o}),g&&this.showAllEditors("highlight",!0,!0)};if(g){this.switchToMode(Y.HIGHLIGHT,b);return}b()}addToAnnotationStorage(t){!t.isEmpty()&&r(this,Rs)&&!r(this,Rs).has(t.id)&&r(this,Rs).setValue(t.id,t)}a11yAlert(t,e=null){const i=r(this,Vc);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,r(this,Vn)&&(f(this,Vn,!1),p(this,F,cf).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of r(this,dt))if(e.div.contains(t)){f(this,ra,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!r(this,ra))return;const[t,e]=r(this,ra);f(this,ra,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){p(this,F,xp).call(this),p(this,F,Cp).call(this)}removeEditListeners(){p(this,F,ry).call(this),p(this,F,Tp).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of r(this,Pi))if(i.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const e of t.dataTransfer.items)for(const i of r(this,Pi))if(i.isHandlingMimeForPasting(e.type)){i.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){var i;if(t.preventDefault(),(i=r(this,$e))==null||i.commitOrRemove(),!this.hasSelection)return;const e=[];for(const s of r(this,dt)){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 a of r(this,Pi))if(a.isHandlingMimeForPasting(n.type)){a.paste(n,this.currentLayer);return}let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(n){Z('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 a=()=>{for(const l of n)p(this,F,Ip).call(this,l);p(this,F,Lp).call(this,n)},o=()=>{for(const l of n)l.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(n){Z('paste: "'.concat(n.message,'".'))}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),r(this,Yt)!==Y.NONE&&!this.isEditorHandlingKeyboard&&vn._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,r(this,Vn)&&(f(this,Vn,!1),p(this,F,cf).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?(p(this,F,sy).call(this),p(this,F,Cp).call(this),p(this,F,ye).call(this,{isEditing:r(this,Yt)!==Y.NONE,isEmpty:p(this,F,Hh).call(this),hasSomethingToUndo:r(this,gi).hasSomethingToUndo(),hasSomethingToRedo:r(this,gi).hasSomethingToRedo(),hasSelectedEditor:!1})):(p(this,F,ny).call(this),p(this,F,Tp).call(this),p(this,F,ye).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!r(this,Pi)){f(this,Pi,t);for(const e of r(this,Pi))p(this,F,Ps).call(this,e.defaultPropertiesToUpdate)}}getId(){return r(this,mg).id}get currentLayer(){return r(this,ne).get(r(this,sl))}getLayer(t){return r(this,ne).get(t)}get currentPageIndex(){return r(this,sl)}addLayer(t){r(this,ne).set(t.pageIndex,t),r(this,Hn)?t.enable():t.disable()}removeLayer(t){r(this,ne).delete(t.pageIndex)}async updateMode(t,e=null,i=!1,s=!1){var n,a,o;if(r(this,Yt)!==t&&!(r(this,pi)&&(await r(this,pi).promise,!r(this,pi)))){if(f(this,pi,Promise.withResolvers()),(n=r(this,On))==null||n.commitOrRemove(),f(this,Yt,t),t===Y.NONE){this.setEditingState(!1),p(this,F,ly).call(this),(a=this._editorUndoBar)==null||a.hide(),r(this,pi).resolve();return}t===Y.SIGNATURE&&await((o=r(this,Un))==null?void 0:o.loadSignatures()),this.setEditingState(!0),await p(this,F,oy).call(this),this.unselectAll();for(const l of r(this,ne).values())l.updateMode(t);if(!e){i&&this.addNewEditorFromKeyboard(),r(this,pi).resolve();return}for(const l of r(this,Ut).values())l.annotationElementId===e||l.id===e?(this.setSelected(l),s&&l.enterInEditMode()):l.unselect();r(this,pi).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==r(this,Yt)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){var i;if(r(this,Pi)){switch(t){case st.CREATE:this.currentLayer.addNewEditor(e);return;case st.HIGHLIGHT_DEFAULT_COLOR:(i=r(this,aa))==null||i.updateColor(e);break;case st.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(r(this,Fc)||f(this,Fc,new Map)).set(t,e),this.showAllEditors("highlight",e);break}for(const s of r(this,dt))s.updateParams(t,e);for(const s of r(this,Pi))s.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){var n,a;for(const o of r(this,Ut).values())o.editorType===t&&o.show(e);((a=(n=r(this,Fc))==null?void 0:n.get(st.HIGHLIGHT_SHOW_ALL))!=null?a:!0)!==e&&p(this,F,Ps).call(this,[[st.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(r(this,Dc)!==t){f(this,Dc,t);for(const e of r(this,ne).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const i of r(this,Ut).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return r(this,Ut).get(t)}addEditor(t){r(this,Ut).set(t.id,t)}removeEditor(t){var e,i;t.div.contains(document.activeElement)&&(r(this,Qi)&&clearTimeout(r(this,Qi)),f(this,Qi,setTimeout(()=>{this.focusMainContainer(),f(this,Qi,null)},0))),r(this,Ut).delete(t.id),t.annotationElementId&&((e=r(this,$n))==null||e.delete(t.annotationElementId)),this.unselect(t),(!t.annotationElementId||!r(this,sa).has(t.annotationElementId))&&((i=r(this,Rs))==null||i.remove(t.id))}addDeletedAnnotationElement(t){r(this,sa).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return r(this,sa).has(t)}removeDeletedAnnotationElement(t){r(this,sa).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){r(this,$e)!==t&&(f(this,$e,t),t&&p(this,F,Ps).call(this,t.propertiesToUpdate))}updateUI(t){r(this,F,hy)===t&&p(this,F,Ps).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){p(this,F,Ps).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(r(this,dt).has(t)){r(this,dt).delete(t),t.unselect(),p(this,F,ye).call(this,{hasSelectedEditor:this.hasSelection});return}r(this,dt).add(t),t.select(),p(this,F,Ps).call(this,t.propertiesToUpdate),p(this,F,ye).call(this,{hasSelectedEditor:!0})}setSelected(t){var e;this.updateToolbar({mode:t.mode,editId:t.id}),(e=r(this,On))==null||e.commitOrRemove();for(const i of r(this,dt))i!==t&&i.unselect();r(this,dt).clear(),r(this,dt).add(t),t.select(),p(this,F,Ps).call(this,t.propertiesToUpdate),p(this,F,ye).call(this,{hasSelectedEditor:!0})}isSelected(t){return r(this,dt).has(t)}get firstSelectedEditor(){return r(this,dt).values().next().value}unselect(t){t.unselect(),r(this,dt).delete(t),p(this,F,ye).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return r(this,dt).size!==0}get isEnterHandled(){return r(this,dt).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var t;r(this,gi).undo(),p(this,F,ye).call(this,{hasSomethingToUndo:r(this,gi).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:p(this,F,Hh).call(this)}),(t=this._editorUndoBar)==null||t.hide()}redo(){r(this,gi).redo(),p(this,F,ye).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:r(this,gi).hasSomethingToRedo(),isEmpty:p(this,F,Hh).call(this)})}addCommands(t){r(this,gi).add(t),p(this,F,ye).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:p(this,F,Hh).call(this)})}cleanUndoStack(t){r(this,gi).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]:[...r(this,dt)],i=()=>{var a;(a=this._editorUndoBar)==null||a.show(s,e.length===1?e[0].editorType:e.length);for(const o of e)o.remove()},s=()=>{for(const a of e)p(this,F,Ip).call(this,a)};this.addCommands({cmd:i,undo:s,mustExec:!0})}commitOrRemove(){var t;(t=r(this,$e))==null||t.commitOrRemove()}hasSomethingToControl(){return r(this,$e)||this.hasSelection}selectAll(){for(const t of r(this,dt))t.commit();p(this,F,Lp).call(this,r(this,Ut).values())}unselectAll(){var t;if(!(r(this,$e)&&(r(this,$e).commitOrRemove(),r(this,Yt)!==Y.NONE))&&!((t=r(this,On))!=null&&t.commitOrRemove())&&this.hasSelection){for(const e of r(this,dt))e.unselect();r(this,dt).clear(),p(this,F,ye).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;r(this,Wn)[0]+=t,r(this,Wn)[1]+=e;const[s,n]=r(this,Wn),a=[...r(this,dt)],o=1e3;r(this,ts)&&clearTimeout(r(this,ts)),f(this,ts,setTimeout(()=>{f(this,ts,null),r(this,Wn)[0]=r(this,Wn)[1]=0,this.addCommands({cmd:()=>{for(const l of a)r(this,Ut).has(l.id)&&(l.translateInPage(s,n),l.translationDone())},undo:()=>{for(const l of a)r(this,Ut).has(l.id)&&(l.translateInPage(-s,-n),l.translationDone())},mustExec:!1})},o));for(const l of a)l.translateInPage(t,e),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),f(this,Zi,new Map);for(const t of r(this,dt))r(this,Zi).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!r(this,Zi))return!1;this.disableUserSelect(!1);const t=r(this,Zi);f(this,Zi,null);let e=!1;for(const[{x:s,y:n,pageIndex:a},o]of t)o.newX=s,o.newY=n,o.newPageIndex=a,e||(e=s!==o.savedX||n!==o.savedY||a!==o.savedPageIndex);if(!e)return!1;const i=(s,n,a,o)=>{if(r(this,Ut).has(s.id)){const l=r(this,ne).get(o);l?s._setParentAndPosition(l,n,a):(s.pageIndex=o,s.x=n,s.y=a)}};return this.addCommands({cmd:()=>{for(const[s,{newX:n,newY:a,newPageIndex:o}]of t)i(s,n,a,o)},undo:()=>{for(const[s,{savedX:n,savedY:a,savedPageIndex:o}]of t)i(s,n,a,o)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(r(this,Zi))for(const i of r(this,Zi).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())||r(this,dt).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return r(this,$e)===t}getActive(){return r(this,$e)}getMode(){return r(this,Yt)}get imageManager(){return nt(this,"imageManager",new Ep)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let c=0,d=e.rangeCount;c<d;c++)if(!t.contains(e.getRangeAt(c).commonAncestorContainer))return null;const{x:i,y:s,width:n,height:a}=t.getBoundingClientRect();let o;switch(t.getAttribute("data-main-rotation")){case"90":o=(c,d,u,g)=>({x:(d-s)/a,y:1-(c+u-i)/n,width:g/a,height:u/n});break;case"180":o=(c,d,u,g)=>({x:1-(c+u-i)/n,y:1-(d+g-s)/a,width:u/n,height:g/a});break;case"270":o=(c,d,u,g)=>({x:1-(d+g-s)/a,y:(c-i)/n,width:g/a,height:u/n});break;default:o=(c,d,u,g)=>({x:(c-i)/n,y:(d-s)/a,width:u/n,height:g/a});break}const l=[];for(let c=0,d=e.rangeCount;c<d;c++){const u=e.getRangeAt(c);if(!u.collapsed)for(const{x:g,y:b,width:w,height:v}of u.getClientRects())w===0||v===0||l.push(o(g,b,w,v))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:t,id:e}){(r(this,il)||f(this,il,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){var e;(e=r(this,il))==null||e.delete(t)}renderAnnotationElement(t){var s;const e=(s=r(this,il))==null?void 0:s.get(t.data.id);if(!e)return;const i=r(this,Rs).getRawValue(e);i&&(r(this,Yt)===Y.NONE&&!i.hasBeenModified||i.renderAnnotationElement(t))}setMissingCanvas(t,e,i){var n;const s=(n=r(this,$n))==null?void 0:n.get(t);s&&(s.setCanvas(e,i),r(this,$n).delete(t))}addMissingCanvas(t,e){(r(this,$n)||f(this,$n,new Map)).set(t,e)}},tl=new WeakMap,$e=new WeakMap,Ut=new WeakMap,ne=new WeakMap,el=new WeakMap,Rs=new WeakMap,il=new WeakMap,gi=new WeakMap,Fn=new WeakMap,On=new WeakMap,sl=new WeakMap,sa=new WeakMap,Zi=new WeakMap,Pi=new WeakMap,na=new WeakMap,Rc=new WeakMap,Mc=new WeakMap,nl=new WeakMap,kc=new WeakMap,Qi=new WeakMap,Bn=new WeakMap,rl=new WeakMap,Vn=new WeakMap,Ji=new WeakMap,mg=new WeakMap,Hn=new WeakMap,Dc=new WeakMap,jn=new WeakMap,ra=new WeakMap,aa=new WeakMap,$n=new WeakMap,Nc=new WeakMap,Yt=new WeakMap,dt=new WeakMap,Ms=new WeakMap,Un=new WeakMap,oa=new WeakMap,Fc=new WeakMap,Oc=new WeakMap,Wn=new WeakMap,ts=new WeakMap,ks=new WeakMap,Bc=new WeakMap,Vc=new WeakMap,pi=new WeakMap,F=new WeakSet,hf=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},Pp=function(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of r(this,ne).values())if(i.hasTextLayer(t))return i;return null},ty=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=p(this,F,hf).call(this,t).closest(".textLayer"),s=this.getSelectionBoxes(i);s&&(r(this,Ji)||f(this,Ji,new sE(this)),r(this,Ji).show(i,s,this.direction==="ltr"))},ey=function(){var n,a,o;const t=document.getSelection();if(!t||t.isCollapsed){r(this,Ms)&&((n=r(this,Ji))==null||n.hide(),f(this,Ms,null),p(this,F,ye).call(this,{hasSelectedText:!1}));return}const{anchorNode:e}=t;if(e===r(this,Ms))return;const s=p(this,F,hf).call(this,t).closest(".textLayer");if(!s){r(this,Ms)&&((a=r(this,Ji))==null||a.hide(),f(this,Ms,null),p(this,F,ye).call(this,{hasSelectedText:!1}));return}if((o=r(this,Ji))==null||o.hide(),f(this,Ms,e),p(this,F,ye).call(this,{hasSelectedText:!0}),!(r(this,Yt)!==Y.HIGHLIGHT&&r(this,Yt)!==Y.NONE)&&(r(this,Yt)===Y.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),f(this,Vn,this.isShiftKeyDown),!this.isShiftKeyDown)){const l=r(this,Yt)===Y.HIGHLIGHT?p(this,F,Pp).call(this,s):null;l==null||l.toggleDrawing();const c=new AbortController,d=this.combinedSignal(c),u=g=>{g.type==="pointerup"&&g.button!==0||(c.abort(),l==null||l.toggleDrawing(!0),g.type==="pointerup"&&p(this,F,cf).call(this,"main_toolbar"))};window.addEventListener("pointerup",u,{signal:d}),window.addEventListener("blur",u,{signal:d})}},cf=function(t=""){r(this,Yt)===Y.HIGHLIGHT?this.highlightSelection(t):r(this,Rc)&&p(this,F,ty).call(this)},iy=function(){document.addEventListener("selectionchange",p(this,F,ey).bind(this),{signal:this._signal})},sy=function(){if(r(this,Bn))return;f(this,Bn,new AbortController);const t=this.combinedSignal(r(this,Bn));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},ny=function(){var t;(t=r(this,Bn))==null||t.abort(),f(this,Bn,null)},xp=function(){if(r(this,jn))return;f(this,jn,new AbortController);const t=this.combinedSignal(r(this,jn));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},ry=function(){var t;(t=r(this,jn))==null||t.abort(),f(this,jn,null)},Cp=function(){if(r(this,Fn))return;f(this,Fn,new AbortController);const t=this.combinedSignal(r(this,Fn));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})},Tp=function(){var t;(t=r(this,Fn))==null||t.abort(),f(this,Fn,null)},ay=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},ye=function(t){Object.entries(t).some(([i,s])=>r(this,Oc)[i]!==s)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(r(this,Oc),t)}),r(this,Yt)===Y.HIGHLIGHT&&t.hasSelectedEditor===!1&&p(this,F,Ps).call(this,[[st.HIGHLIGHT_FREE,!0]]))},Ps=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},oy=async function(){if(!r(this,Hn)){f(this,Hn,!0);const t=[];for(const e of r(this,ne).values())t.push(e.enable());await Promise.all(t);for(const e of r(this,Ut).values())e.enable()}},ly=function(){if(this.unselectAll(),r(this,Hn)){f(this,Hn,!1);for(const t of r(this,ne).values())t.disable();for(const t of r(this,Ut).values())t.disable()}},Ip=function(t){const e=r(this,ne).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},hy=function(){let t=null;for(t of r(this,dt));return t},Hh=function(){if(r(this,Ut).size===0)return!0;if(r(this,Ut).size===1)for(const t of r(this,Ut).values())return t.isEmpty();return!1},Lp=function(t){for(const e of r(this,dt))e.unselect();r(this,dt).clear();for(const e of t)e.isEmpty()||(r(this,dt).add(e),e.select());p(this,F,ye).call(this,{hasSelectedEditor:this.hasSelection})},k(vn,"TRANSLATE_SMALL",1),k(vn,"TRANSLATE_BIG",10),vn);var Kt,es,xi,al,is,Ue,ol,ss,ke,Ds,la,ns,zn,Ui,jh,df;const Ae=class Ae{constructor(t){m(this,Ui);m(this,Kt,null);m(this,es,!1);m(this,xi,null);m(this,al,null);m(this,is,null);m(this,Ue,null);m(this,ol,!1);m(this,ss,null);m(this,ke,null);m(this,Ds,null);m(this,la,null);m(this,ns,!1);f(this,ke,t),f(this,ns,t._uiManager.useNewAltTextFlow),r(Ae,zn)||f(Ae,zn,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=Ae._l10n)!=null||(Ae._l10n=t)}async render(){const t=f(this,xi,document.createElement("button"));t.className="altText",t.tabIndex="0";const e=f(this,al,document.createElement("span"));t.append(e),r(this,ns)?(t.classList.add("new"),t.setAttribute("data-l10n-id",r(Ae,zn).missing),e.setAttribute("data-l10n-id",r(Ae,zn)["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=r(this,ke)._uiManager._signal;t.addEventListener("contextmenu",Wi,{signal:i}),t.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:i});const s=n=>{n.preventDefault(),r(this,ke)._uiManager.editAltText(r(this,ke)),r(this,ns)&&r(this,ke)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:r(this,Ui,jh)}})};return t.addEventListener("click",s,{capture:!0,signal:i}),t.addEventListener("keydown",n=>{n.target===t&&n.key==="Enter"&&(f(this,ol,!0),s(n))},{signal:i}),await p(this,Ui,df).call(this),t}finish(){r(this,xi)&&(r(this,xi).focus({focusVisible:r(this,ol)}),f(this,ol,!1))}isEmpty(){return r(this,ns)?r(this,Kt)===null:!r(this,Kt)&&!r(this,es)}hasData(){return r(this,ns)?r(this,Kt)!==null||!!r(this,Ds):this.isEmpty()}get guessedText(){return r(this,Ds)}async setGuessedText(t){r(this,Kt)===null&&(f(this,Ds,t),f(this,la,await Ae._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),p(this,Ui,df).call(this))}toggleAltTextBadge(t=!1){var e;if(!r(this,ns)||r(this,Kt)){(e=r(this,ss))==null||e.remove(),f(this,ss,null);return}if(!r(this,ss)){const i=f(this,ss,document.createElement("div"));i.className="noAltTextBadge",r(this,ke).div.append(i)}r(this,ss).classList.toggle("hidden",!t)}serialize(t){let e=r(this,Kt);return!t&&r(this,Ds)===e&&(e=r(this,la)),{altText:e,decorative:r(this,es),guessedText:r(this,Ds),textWithDisclaimer:r(this,la)}}get data(){return{altText:r(this,Kt),decorative:r(this,es)}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:s,cancel:n=!1}){i&&(f(this,Ds,i),f(this,la,s)),!(r(this,Kt)===t&&r(this,es)===e)&&(n||(f(this,Kt,t),f(this,es,e)),p(this,Ui,df).call(this))}toggle(t=!1){r(this,xi)&&(!t&&r(this,Ue)&&(clearTimeout(r(this,Ue)),f(this,Ue,null)),r(this,xi).disabled=!t)}shown(){r(this,ke)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:r(this,Ui,jh)}})}destroy(){var t,e;(t=r(this,xi))==null||t.remove(),f(this,xi,null),f(this,al,null),f(this,is,null),(e=r(this,ss))==null||e.remove(),f(this,ss,null)}};Kt=new WeakMap,es=new WeakMap,xi=new WeakMap,al=new WeakMap,is=new WeakMap,Ue=new WeakMap,ol=new WeakMap,ss=new WeakMap,ke=new WeakMap,Ds=new WeakMap,la=new WeakMap,ns=new WeakMap,zn=new WeakMap,Ui=new WeakSet,jh=function(){return r(this,Kt)&&"added"||r(this,Kt)===null&&this.guessedText&&"review"||"missing"},df=async function(){var s,n,a;const t=r(this,xi);if(!t)return;if(r(this,ns)){if(t.classList.toggle("done",!!r(this,Kt)),t.setAttribute("data-l10n-id",r(Ae,zn)[r(this,Ui,jh)]),(s=r(this,al))==null||s.setAttribute("data-l10n-id",r(Ae,zn)["".concat(r(this,Ui,jh),"-label")]),!r(this,Kt)){(n=r(this,is))==null||n.remove();return}}else{if(!r(this,Kt)&&!r(this,es)){t.classList.remove("done"),(a=r(this,is))==null||a.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=r(this,is);if(!e){f(this,is,e=document.createElement("span")),e.className="tooltip",e.setAttribute("role","tooltip"),e.id="alt-text-tooltip-".concat(r(this,ke).id);const o=100,l=r(this,ke)._uiManager._signal;l.addEventListener("abort",()=>{clearTimeout(r(this,Ue)),f(this,Ue,null)},{once:!0}),t.addEventListener("mouseenter",()=>{f(this,Ue,setTimeout(()=>{f(this,Ue,null),r(this,is).classList.add("show"),r(this,ke)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:l}),t.addEventListener("mouseleave",()=>{var c;r(this,Ue)&&(clearTimeout(r(this,Ue)),f(this,Ue,null)),(c=r(this,is))==null||c.classList.remove("show")},{signal:l})}r(this,es)?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=r(this,Kt)),e.parentNode||t.append(e);const i=r(this,ke).getElementForAltText();i==null||i.setAttribute("aria-describedby",e.id)},m(Ae,zn,null),k(Ae,"_l10n",null);let sg=Ae;var ll,ha,Hc,jc,$c,Uc,Wc,Ns,ca,Fs,da,Os,Hr,dy,uy,fy,hl;let cy=(hl=class{constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:i=null,onPinchStart:s=null,onPinching:n=null,onPinchEnd:a=null,signal:o}){m(this,Hr);m(this,ll);m(this,ha,!1);m(this,Hc,null);m(this,jc);m(this,$c);m(this,Uc);m(this,Wc);m(this,Ns,null);m(this,ca);m(this,Fs,null);m(this,da);m(this,Os,null);f(this,ll,t),f(this,Hc,i),f(this,jc,e),f(this,$c,s),f(this,Uc,n),f(this,Wc,a),f(this,da,new AbortController),f(this,ca,AbortSignal.any([o,r(this,da).signal])),t.addEventListener("touchstart",p(this,Hr,dy).bind(this),{passive:!1,signal:r(this,ca)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/So.pixelRatio}destroy(){var t,e;(t=r(this,da))==null||t.abort(),f(this,da,null),(e=r(this,Ns))==null||e.abort(),f(this,Ns,null)}},ll=new WeakMap,ha=new WeakMap,Hc=new WeakMap,jc=new WeakMap,$c=new WeakMap,Uc=new WeakMap,Wc=new WeakMap,Ns=new WeakMap,ca=new WeakMap,Fs=new WeakMap,da=new WeakMap,Os=new WeakMap,Hr=new WeakSet,dy=function(t){var s,n,a;if((s=r(this,jc))!=null&&s.call(this))return;if(t.touches.length===1){if(r(this,Ns))return;const o=f(this,Ns,new AbortController),l=AbortSignal.any([r(this,ca),o.signal]),c=r(this,ll),d={capture:!0,signal:l,passive:!1},u=g=>{var b;g.pointerType==="touch"&&((b=r(this,Ns))==null||b.abort(),f(this,Ns,null))};c.addEventListener("pointerdown",g=>{g.pointerType==="touch"&&(Vt(g),u(g))},d),c.addEventListener("pointerup",u,d),c.addEventListener("pointercancel",u,d);return}if(!r(this,Os)){f(this,Os,new AbortController);const o=AbortSignal.any([r(this,ca),r(this,Os).signal]),l=r(this,ll),c={signal:o,capture:!1,passive:!1};l.addEventListener("touchmove",p(this,Hr,uy).bind(this),c);const d=p(this,Hr,fy).bind(this);l.addEventListener("touchend",d,c),l.addEventListener("touchcancel",d,c),c.capture=!0,l.addEventListener("pointerdown",Vt,c),l.addEventListener("pointermove",Vt,c),l.addEventListener("pointercancel",Vt,c),l.addEventListener("pointerup",Vt,c),(n=r(this,$c))==null||n.call(this)}if(Vt(t),t.touches.length!==2||(a=r(this,Hc))!=null&&a.call(this)){f(this,Fs,null);return}let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]),f(this,Fs,{touch0X:e.screenX,touch0Y:e.screenY,touch1X:i.screenX,touch1Y:i.screenY})},uy=function(t){var S;if(!r(this,Fs)||t.touches.length!==2)return;Vt(t);let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]);const{screenX:s,screenY:n}=e,{screenX:a,screenY:o}=i,l=r(this,Fs),{touch0X:c,touch0Y:d,touch1X:u,touch1Y:g}=l,b=u-c,w=g-d,v=a-s,y=o-n,A=Math.hypot(v,y)||1,E=Math.hypot(b,w)||1;if(!r(this,ha)&&Math.abs(E-A)<=hl.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=s,l.touch0Y=n,l.touch1X=a,l.touch1Y=o,!r(this,ha)){f(this,ha,!0);return}const _=[(s+a)/2,(n+o)/2];(S=r(this,Uc))==null||S.call(this,_,E,A)},fy=function(t){var e;t.touches.length>=2||(r(this,Os)&&(r(this,Os).abort(),f(this,Os,null),(e=r(this,Wc))==null||e.call(this)),r(this,Fs)&&(Vt(t),f(this,Fs,null),f(this,ha,!1)))},hl);var ua,Ci,_t,cl,Gn,zc,fa,re,ga,Bs,Xn,Gc,pa,We,Xc,ma,Vs,rs,dl,ul,mi,ba,qc,bg,K,Rp,Yc,Mp,uf,gy,py,kp,ff,Dp,my,by,wy,Np,vy,Fp,yy,Ay,_y,Op,$h;const et=class et{constructor(t){m(this,K);m(this,ua,null);m(this,Ci,null);m(this,_t,null);m(this,cl,!1);m(this,Gn,null);m(this,zc,"");m(this,fa,!1);m(this,re,null);m(this,ga,null);m(this,Bs,null);m(this,Xn,null);m(this,Gc,"");m(this,pa,!1);m(this,We,null);m(this,Xc,!1);m(this,ma,!1);m(this,Vs,!1);m(this,rs,null);m(this,dl,0);m(this,ul,0);m(this,mi,null);m(this,ba,null);k(this,"isSelected",!1);k(this,"_isCopy",!1);k(this,"_editToolbar",null);k(this,"_initialOptions",Object.create(null));k(this,"_initialData",null);k(this,"_isVisible",!0);k(this,"_uiManager",null);k(this,"_focusEventsAllowed",!0);m(this,qc,!1);m(this,bg,et._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:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,s],this.pageTranslation=[n,a];const[o,l]=this.parentDimensions;this.x=t.x/o,this.y=t.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const t=et.prototype._resizeWithKeyboard,e=yc.TRANSLATE_SMALL,i=yc.TRANSLATE_BIG;return nt(this,"_resizerKeyboardManager",new ju([[["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"],et.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 nt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new aE({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=et._l10n)!=null||(et._l10n=t),et._l10nResizer||(et._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"})),et._borderLineWidth!==-1)return;const i=getComputedStyle(document.documentElement);et._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){gt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return r(this,qc)}set _isDraggable(t){var e;f(this,qc,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=r(this,bg)}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):p(this,K,$h).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(r(this,pa)?f(this,pa,!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,a]=this.parentDimensions;[i,s]=this.screenToPageTranslation(i,s),this.x=(t+i)/n,this.y=(e+s)/a,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){p(this,K,Rp).call(this,this.parentDimensions,t,e)}translateInPage(t,e){r(this,We)||f(this,We,[this.x,this.y,this.width,this.height]),p(this,K,Rp).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){r(this,We)||f(this,We,[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:u,y:g}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,g)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this;const[l,c]=this.getBaseTranslation();a+=l,o+=c;const{style:d}=i;d.left="".concat((100*a).toFixed(2),"%"),d.top="".concat((100*o).toFixed(2),"%"),this._onTranslating(a,o),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!r(this,We)&&(r(this,We)[0]!==this.x||r(this,We)[1]!==this.y)}get _hasBeenResized(){return!!r(this,We)&&(r(this,We)[2]!==this.width||r(this,We)[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=et,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:a,width:o,height:l}=this;if(o*=i,l*=s,n*=i,a*=s,this._mustFixPosition)switch(t){case 0:n=Te(n,0,i-o),a=Te(a,0,s-l);break;case 90:n=Te(n,0,i-l),a=Te(a,o,s);break;case 180:n=Te(n,o,i),a=Te(a,l,s);break;case 270:n=Te(n,l,i),a=Te(a,0,s-o);break}this.x=n/=i,this.y=a/=s;const[c,d]=this.getBaseTranslation();n+=c,a+=d,e.left="".concat((100*n).toFixed(2),"%"),e.top="".concat((100*a).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(t,e){var i;return p(i=et,Yc,Mp).call(i,t,e,this.parentRotation)}pageTranslationToScreen(t,e){var i;return p(i=et,Yc,Mp).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),"%"),r(this,fa)||(n.height="".concat((100*e/s).toFixed(2),"%"))}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,s=i.endsWith("%"),n=!r(this,fa)&&e.endsWith("%");if(s&&n)return;const[a,o]=this.parentDimensions;s||(t.width="".concat((100*parseFloat(i)/a).toFixed(2),"%")),!r(this,fa)&&!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=r(this,_t))==null||t.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||r(this,ma))return this._editToolbar;this._editToolbar=new _p(this),this.div.append(this._editToolbar.render());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=r(this,_t))==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 r(this,_t)||(sg.initialize(et._l10n),f(this,_t,new sg(this)),r(this,ua)&&(r(this,_t).data=r(this,ua),f(this,ua,null))),r(this,_t)}get altTextData(){var t;return(t=r(this,_t))==null?void 0:t.data}set altTextData(t){r(this,_t)&&(r(this,_t).data=t)}get guessedAltText(){var t;return(t=r(this,_t))==null?void 0:t.guessedText}async setGuessedAltText(t){var e;await((e=r(this,_t))==null?void 0:e.setGuessedText(t))}serializeAltText(t){var e;return(e=r(this,_t))==null?void 0:e.serialize(t)}hasAltText(){return!!r(this,_t)&&!r(this,_t).isEmpty()}hasAltTextData(){var t,e;return(e=(t=r(this,_t))==null?void 0:t.hasData())!=null?e:!1}render(){var a;const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=r(this,cl)?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),p(this,K,Fp).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),Qv(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(r(this,ba)||f(this,ba,new cy({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:p(this,K,my).bind(this),onPinching:p(this,K,by).bind(this),onPinchEnd:p(this,K,wy).bind(this),signal:this._uiManager._signal}))),(a=this._uiManager._editorUndoBar)==null||a.hide(),t}pointerdown(t){const{isMac:e}=fe.platform;if(t.button!==0||t.ctrlKey&&e){t.preventDefault();return}if(f(this,pa,!0),this._isDraggable){p(this,K,vy).call(this,t);return}p(this,K,Np).call(this,t)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){r(this,rs)&&clearTimeout(r(this,rs)),f(this,rs,setTimeout(()=>{var t;f(this,rs,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,a]=this.pageDimensions,[o,l]=this.pageTranslation,c=t/s,d=e/s,u=this.x*n,g=this.y*a,b=this.width*n,w=this.height*a;switch(i){case 0:return[u+c+o,a-g-d-w+l,u+c+b+o,a-g-d+l];case 90:return[u+d+o,a-g+c+l,u+d+w+o,a-g+c+b+l];case 180:return[u-c-b+o,a-g+d+l,u-c+o,a-g+d+w+l];case 270:return[u-d-w+o,a-g-c-b+l,u-d+o,a-g-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,s,n,a]=t,o=n-i,l=a-s;switch(this.rotation){case 0:return[i,e-a,o,l];case 90:return[i,e-s,l,o];case 180:return[n,e-s,o,l];case 270:return[n,e-a,l,o];default:throw new Error("Invalid rotation")}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),f(this,ma,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),f(this,ma,!1),!0):!1}isInEditMode(){return r(this,ma)}shouldGetKeyboardEvents(){return r(this,Vs)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:s}=this.getClientDimensions(),{innerHeight:n,innerWidth:a}=window;return e<a&&s>0&&t<n&&i>0}rebuild(){p(this,K,Fp).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){gt("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,f(s,ua,t.accessibilityData),s._isCopy=t.isCopy||!1;const[n,a]=s.pageDimensions,[o,l,c,d]=s.getRectInCurrentCoords(t.rect,a);return s.x=o/n,s.y=l/a,s.width=c/n,s.height=d/a,s}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var t,e;if((t=r(this,Xn))==null||t.abort(),f(this,Xn,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),r(this,rs)&&(clearTimeout(r(this,rs)),f(this,rs,null)),p(this,K,$h).call(this),this.removeEditToolbar(),r(this,mi)){for(const i of r(this,mi).values())clearTimeout(i);f(this,mi,null)}this.parent=null,(e=r(this,ba))==null||e.destroy(),f(this,ba,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(p(this,K,gy).call(this),r(this,re).classList.remove("hidden"))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),f(this,Bs,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=r(this,re).children;if(!r(this,Ci)){f(this,Ci,Array.from(e));const a=p(this,K,yy).bind(this),o=p(this,K,Ay).bind(this),l=this._uiManager._signal;for(const c of r(this,Ci)){const d=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",a,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",p(this,K,_y).bind(this,d),{signal:l}),c.setAttribute("data-l10n-id",et._l10nResizer[d])}}const i=r(this,Ci)[0];let s=0;for(const a of e){if(a===i)break;s++}const n=(360-this.rotation+this.parentRotation)%360/90*(r(this,Ci).length/4);if(n!==s){if(n<s)for(let o=0;o<s-n;o++)r(this,re).append(r(this,re).firstChild);else if(n>s)for(let o=0;o<n-s;o++)r(this,re).firstChild.before(r(this,re).lastChild);let a=0;for(const o of e){const c=r(this,Ci)[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",et._l10nResizer[c])}}p(this,K,Op).call(this,0),f(this,Vs,!0),r(this,re).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){r(this,Vs)&&p(this,K,Dp).call(this,r(this,Gc),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){p(this,K,$h).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=r(this,_t))==null||i.toggleAltTextBadge(!1)}}unselect(){var t,e,i,s,n;this.isSelected&&(this.isSelected=!1,(t=r(this,re))==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=r(this,_t))==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 r(this,Xc)}set isEditing(t){f(this,Xc,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){f(this,fa,!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){r(this,mi)||f(this,mi,new Map);const{action:i}=t;let s=r(this,mi).get(i);s&&clearTimeout(s),s=setTimeout(()=>{this._reportTelemetry(t),r(this,mi).delete(i),r(this,mi).size===0&&f(this,mi,null)},et._telemetryTimeout),r(this,mi).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),f(this,cl,!1)}disable(){this.div&&(this.div.tabIndex=-1),f(this,cl,!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()}};ua=new WeakMap,Ci=new WeakMap,_t=new WeakMap,cl=new WeakMap,Gn=new WeakMap,zc=new WeakMap,fa=new WeakMap,re=new WeakMap,ga=new WeakMap,Bs=new WeakMap,Xn=new WeakMap,Gc=new WeakMap,pa=new WeakMap,We=new WeakMap,Xc=new WeakMap,ma=new WeakMap,Vs=new WeakMap,rs=new WeakMap,dl=new WeakMap,ul=new WeakMap,mi=new WeakMap,ba=new WeakMap,qc=new WeakMap,bg=new WeakMap,K=new WeakSet,Rp=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()},Yc=new WeakSet,Mp=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]}},uf=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]}},gy=function(){if(r(this,re))return;f(this,re,document.createElement("div")),r(this,re).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");r(this,re).append(s),s.classList.add("resizer",i),s.setAttribute("data-resizer-name",i),s.addEventListener("pointerdown",p(this,K,py).bind(this,i),{signal:e}),s.addEventListener("contextmenu",Wi,{signal:e}),s.tabIndex=-1}this.div.prepend(r(this,re))},py=function(t,e){var d;e.preventDefault();const{isMac:i}=fe.platform;if(e.button!==0||e.ctrlKey&&i)return;(d=r(this,_t))==null||d.toggle(!1);const s=this._isDraggable;this._isDraggable=!1,f(this,ga,[e.screenX,e.screenY]);const n=new AbortController,a=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",p(this,K,Dp).bind(this,t),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",Vt,{passive:!1,signal:a}),window.addEventListener("contextmenu",Wi,{signal:a}),f(this,Bs,{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 u;n.abort(),this.parent.togglePointerEvents(!0),(u=r(this,_t))==null||u.toggle(!0),this._isDraggable=s,this.parent.div.style.cursor=o,this.div.style.cursor=l,p(this,K,ff).call(this)};window.addEventListener("pointerup",c,{signal:a}),window.addEventListener("blur",c,{signal:a})},kp=function(t,e,i,s){this.width=i,this.height=s,this.x=t,this.y=e;const[n,a]=this.parentDimensions;this.setDims(n*i,a*s),this.fixAndSetPosition(),this._onResized()},ff=function(){if(!r(this,Bs))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:s}=r(this,Bs);f(this,Bs,null);const n=this.x,a=this.y,o=this.width,l=this.height;n===t&&a===e&&o===i&&l===s||this.addCommands({cmd:p(this,K,kp).bind(this,n,a,o,l),undo:p(this,K,kp).bind(this,t,e,i,s),mustExec:!0})},Dp=function(t,e){const[i,s]=this.parentDimensions,n=this.x,a=this.y,o=this.width,l=this.height,c=et.MIN_SIZE/i,d=et.MIN_SIZE/s,u=p(this,K,uf).call(this,this.rotation),g=(V,N)=>[u[0]*V+u[2]*N,u[1]*V+u[3]*N],b=p(this,K,uf).call(this,360-this.rotation),w=(V,N)=>[b[0]*V+b[2]*N,b[1]*V+b[3]*N];let v,y,A=!1,E=!1;switch(t){case"topLeft":A=!0,v=(V,N)=>[0,0],y=(V,N)=>[V,N];break;case"topMiddle":v=(V,N)=>[V/2,0],y=(V,N)=>[V/2,N];break;case"topRight":A=!0,v=(V,N)=>[V,0],y=(V,N)=>[0,N];break;case"middleRight":E=!0,v=(V,N)=>[V,N/2],y=(V,N)=>[0,N/2];break;case"bottomRight":A=!0,v=(V,N)=>[V,N],y=(V,N)=>[0,0];break;case"bottomMiddle":v=(V,N)=>[V/2,N],y=(V,N)=>[V/2,0];break;case"bottomLeft":A=!0,v=(V,N)=>[0,N],y=(V,N)=>[V,0];break;case"middleLeft":E=!0,v=(V,N)=>[0,N/2],y=(V,N)=>[V,N/2];break}const _=v(o,l),S=y(o,l);let P=g(...S);const x=et._round(n+P[0]),T=et._round(a+P[1]);let I=1,C=1,L,M;if(e.fromKeyboard)({deltaX:L,deltaY:M}=e);else{const{screenX:V,screenY:N}=e,[mt,At]=r(this,ga);[L,M]=this.screenToPageTranslation(V-mt,N-At),r(this,ga)[0]=V,r(this,ga)[1]=N}if([L,M]=w(L/i,M/s),A){const V=Math.hypot(o,l);I=C=Math.max(Math.min(Math.hypot(S[0]-_[0]-L,S[1]-_[1]-M)/V,1/o,1/l),c/o,d/l)}else E?I=Te(Math.abs(S[0]-_[0]-L),c,1)/o:C=Te(Math.abs(S[1]-_[1]-M),d,1)/l;const G=et._round(o*I),W=et._round(l*C);P=g(...y(G,W));const $=x-P[0],Tt=T-P[1];r(this,We)||f(this,We,[this.x,this.y,this.width,this.height]),this.width=G,this.height=W,this.x=$,this.y=Tt,this.setDims(i*G,s*W),this.fixAndSetPosition(),this._onResizing()},my=function(){var t;f(this,Bs,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(t=r(this,_t))==null||t.toggle(!1),this.parent.togglePointerEvents(!1)},by=function(t,e,i){let n=.7*(i/e)+1-.7;if(n===1)return;const a=p(this,K,uf).call(this,this.rotation),o=(x,T)=>[a[0]*x+a[2]*T,a[1]*x+a[3]*T],[l,c]=this.parentDimensions,d=this.x,u=this.y,g=this.width,b=this.height,w=et.MIN_SIZE/l,v=et.MIN_SIZE/c;n=Math.max(Math.min(n,1/g,1/b),w/g,v/b);const y=et._round(g*n),A=et._round(b*n);if(y===g&&A===b)return;r(this,We)||f(this,We,[d,u,g,b]);const E=o(g/2,b/2),_=et._round(d+E[0]),S=et._round(u+E[1]),P=o(y/2,A/2);this.x=_-P[0],this.y=S-P[1],this.width=y,this.height=A,this.setDims(l*y,c*A),this.fixAndSetPosition(),this._onResizing()},wy=function(){var t;(t=r(this,_t))==null||t.toggle(!0),this.parent.togglePointerEvents(!0),p(this,K,ff).call(this)},Np=function(t){const{isMac:e}=fe.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},vy=function(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const s=new AbortController,n=this._uiManager.combinedSignal(s),a={capture:!0,passive:!1,signal:n},o=c=>{s.abort(),f(this,Gn,null),f(this,pa,!1),this._uiManager.endDragSession()||p(this,K,Np).call(this,c),i&&this._onStopDragging()};e&&(f(this,dl,t.clientX),f(this,ul,t.clientY),f(this,Gn,t.pointerId),f(this,zc,t.pointerType),window.addEventListener("pointermove",c=>{i||(i=!0,this._onStartDragging());const{clientX:d,clientY:u,pointerId:g}=c;if(g!==r(this,Gn)){Vt(c);return}const[b,w]=this.screenToPageTranslation(d-r(this,dl),u-r(this,ul));f(this,dl,d),f(this,ul,u),this._uiManager.dragSelectedEditors(b,w)},a),window.addEventListener("touchmove",Vt,a),window.addEventListener("pointerdown",c=>{c.pointerType===r(this,zc)&&(r(this,ba)||c.isPrimary)&&o(c),Vt(c)},a));const l=c=>{if(!r(this,Gn)||r(this,Gn)===c.pointerId){o(c);return}Vt(c)};window.addEventListener("pointerup",l,{signal:n}),window.addEventListener("blur",l,{signal:n})},Fp=function(){if(r(this,Xn)||!this.div)return;f(this,Xn,new AbortController);const t=this._uiManager.combinedSignal(r(this,Xn));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},yy=function(t){et._resizerKeyboardManager.exec(this,t)},Ay=function(t){var e;r(this,Vs)&&((e=t.relatedTarget)==null?void 0:e.parentNode)!==r(this,re)&&p(this,K,$h).call(this)},_y=function(t){f(this,Gc,r(this,Vs)?t:"")},Op=function(t){if(r(this,Ci))for(const e of r(this,Ci))e.tabIndex=t},$h=function(){f(this,Vs,!1),p(this,K,Op).call(this,-1),p(this,K,ff).call(this)},m(et,Yc),k(et,"_l10n",null),k(et,"_l10nResizer",null),k(et,"_borderLineWidth",-1),k(et,"_colorManager",new Sp),k(et,"_zIndex",1),k(et,"_telemetryTimeout",1e3);let vt=et;class aE extends vt{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const lw=3285377520,ui=4294901760,Xi=65535;class Ey{constructor(t){this.h1=t?t&4294967295:lw,this.h2=t?t&4294967295:lw}update(t){let e,i;if(typeof t=="string"){e=new Uint8Array(t.length*2),i=0;for(let v=0,y=t.length;v<y;v++){const A=t.charCodeAt(v);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,a=new Uint32Array(e.buffer,0,s);let o=0,l=0,c=this.h1,d=this.h2;const u=3432918353,g=461845907,b=u&Xi,w=gΞfor(let v=0;v<s;v++)v&1?(o=a[v],o=o*u&ui|o*b&Xi,o=o<<15|o>>>17,o=o*g&ui|o*w&Xi,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(l=a[v],l=l*u&ui|l*b&Xi,l=l<<15|l>>>17,l=l*g&ui|l*w&Xi,d^=l,d=d<<13|d>>>19,d=d*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*u&ui|o*b&Xi,o=o<<15|o>>>17,o=o*g&ui|o*w&Xi,s&1?c^=o:d^=o}this.h1=c,this.h2=d}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&ui|t*36045&Xi,e=e*4283543511&ui|((e<<16|t>>>16)*2950163797&ui)>>>16,t^=e>>>1,t=t*444984403&ui|t*60499&Xi,e=e*3301882366&ui|((e<<16|t>>>16)*3120437893&ui)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const Bp=Object.freeze({map:null,hash:"",transfer:void 0});var wa,va,ae,wg,Sy;class Db{constructor(){m(this,wg);m(this,wa,!1);m(this,va,null);m(this,ae,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=r(this,ae).get(t);return i===void 0?e:Object.assign(e,i)}getRawValue(t){return r(this,ae).get(t)}remove(t){if(r(this,ae).delete(t),r(this,ae).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const e of r(this,ae).values())if(e instanceof vt)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=r(this,ae).get(t);let s=!1;if(i!==void 0)for(const[n,a]of Object.entries(e))i[n]!==a&&(s=!0,i[n]=a);else s=!0,r(this,ae).set(t,e);s&&p(this,wg,Sy).call(this),e instanceof vt&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(e.constructor._type)}has(t){return r(this,ae).has(t)}get size(){return r(this,ae).size}resetModified(){r(this,wa)&&(f(this,wa,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new Py(this)}get serializable(){if(r(this,ae).size===0)return Bp;const t=new Map,e=new Ey,i=[],s=Object.create(null);let n=!1;for(const[a,o]of r(this,ae)){const l=o instanceof vt?o.serialize(!1,s):o;l&&(t.set(a,l),e.update("".concat(a,":").concat(JSON.stringify(l))),n||(n=!!l.bitmap))}if(n)for(const a of t.values())a.bitmap&&i.push(a.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:Bp}get editorStats(){var i;let t=null;const e=new Map;for(const s of r(this,ae).values()){if(!(s instanceof vt))continue;const n=s.telemetryFinalData;if(!n)continue;const{type:a}=n;e.has(a)||e.set(a,Object.getPrototypeOf(s).constructor),t||(t=Object.create(null));const o=t[a]||(t[a]=new Map);for(const[l,c]of Object.entries(n)){if(l==="type")continue;let d=o.get(l);d||(d=new Map,o.set(l,d));const u=(i=d.get(c))!=null?i:0;d.set(c,u+1)}}for(const[s,n]of e)t[s]=n.computeTelemetryFinalData(t[s]);return t}resetModifiedIds(){f(this,va,null)}get modifiedIds(){if(r(this,va))return r(this,va);const t=[];for(const e of r(this,ae).values())!(e instanceof vt)||!e.annotationElementId||!e.serialize()||t.push(e.annotationElementId);return f(this,va,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return r(this,ae).entries()}}wa=new WeakMap,va=new WeakMap,ae=new WeakMap,wg=new WeakSet,Sy=function(){r(this,wa)||(f(this,wa,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var Kc;class Py extends Db{constructor(e){super();m(this,Kc);const{map:i,hash:s,transfer:n}=e.serializable,a=structuredClone(i,n?{transfer:n}:null);f(this,Kc,{map:a,hash:s,transfer:n})}get print(){gt("Should not call PrintAnnotationStorage.print")}get serializable(){return r(this,Kc)}get modifiedIds(){return nt(this,"modifiedIds",{ids:new Set,hash:""})}}Kc=new WeakMap;var fl;class oE{constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){m(this,fl,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(),r(this,fl).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:i}){if(!(!t||r(this,fl).has(t.loadedName))){if(Ht(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:s,src:n,style:a}=t,o=new FontFace(s,n,a);this.addNativeFontFace(o);try{await o.load(),r(this,fl).add(s),i==null||i(t)}catch(l){Z("Cannot load system font: ".concat(t.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(o)}return}gt("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 Z("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 nt(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return nt(this,"isSyncFontLoadingSupported",Ce||fe.platform.isFirefox)}_queueLoadingCallback(t){function e(){for(Ht(!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 nt(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function i(S,P){return S.charCodeAt(P)<<24|S.charCodeAt(P+1)<<16|S.charCodeAt(P+2)<<8|S.charCodeAt(P+3)&255}function s(S,P,x,T){const I=S.substring(0,P),C=S.substring(P+x);return I+T+C}let n,a;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;function d(S,P){if(++c>30){Z("Load test font never loaded."),P();return}if(l.font="30px "+S,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){P();return}setTimeout(d.bind(null,S,P))}const u="lt".concat(Date.now()).concat(this.loadTestFontId++);let g=this._loadTestFont;g=s(g,976,u.length,u);const w=16,v=1482184792;let y=i(g,w);for(n=0,a=u.length-3;n<a;n+=4)y=y-v+i(u,n)|0;n<u.length&&(y=y-v+i(u+"XXX",n)|0),g=s(g,w,4,X_(y));const A="url(data:font/opentype;base64,".concat(btoa(g),");"),E='@font-face {font-family:"'.concat(u,'";src:').concat(A,"}");this.insertRule(E);const _=this._document.createElement("div");_.style.visibility="hidden",_.style.width=_.style.height="10px",_.style.position="absolute",_.style.top=_.style.left="0px";for(const S of[t.loadedName,u]){const P=this._document.createElement("span");P.textContent="Hi",P.style.fontFamily=S,_.append(P)}this._document.body.append(_),d(u,()=>{_.remove(),e.complete()})}}fl=new WeakMap;class lE{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(Uv(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(a){Z('getPathGenerator - ignoring character: "'.concat(a,'".'))}const n=new Path2D(s||"");return this.fontExtraProperties||t.delete(i),this.compiledGlyphs[e]=n}}function hE(h){if(h instanceof URL)return h.href;if(typeof h=="string"){if(Ce)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 cE(h){if(Ce&&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 Bu(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 zu(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 Vp=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,dE=h=>typeof h=="object"&&typeof(h==null?void 0:h.name)=="string",uE=Q_.bind(null,Vp,dE);var Hs,vg;class fE{constructor(){m(this,Hs,new Map);m(this,vg,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};r(this,vg).then(()=>{for(const[s]of r(this,Hs))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){Z("LoopbackPort - cannot use an `aborted` signal.");return}const a=()=>this.removeEventListener(t,e);s=()=>n.removeEventListener("abort",a),n.addEventListener("abort",a)}r(this,Hs).set(e,s)}removeEventListener(t,e){const i=r(this,Hs).get(e);i==null||i(),r(this,Hs).delete(e)}terminate(){for(const[,t]of r(this,Hs))t==null||t();r(this,Hs).clear()}}Hs=new WeakMap,vg=new WeakMap;const Gu={DATA:1,ERROR:2},Ot={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function hw(){}function Me(h){if(h instanceof Fr||h instanceof wp||h instanceof rw||h instanceof eg||h instanceof Yg)return h;switch(h instanceof Error||typeof h=="object"&&h!==null||gt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),h.name){case"AbortException":return new Fr(h.message);case"InvalidPDFException":return new wp(h.message);case"PasswordException":return new rw(h.message,h.code);case"ResponseException":return new eg(h.message,h.status,h.missing);case"UnknownErrorException":return new Yg(h.message,h.details)}return new Yg(h.message,h.toString())}var gl,Ei,xy,Cy,Ty,gf;class Uh{constructor(t,e,i){m(this,Ei);m(this,gl,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",p(this,Ei,xy).bind(this),{signal:r(this,gl).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(a){n.reject(a)}return n.promise}sendWithStream(t,e,i,s){const n=this.streamId++,a=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const d=Promise.withResolvers();return this.streamControllers[n]={controller:c,startCall:d,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:o,action:t,streamId:n,data:e,desiredSize:c.desiredSize},s),d.promise},pull:c=>{const d=Promise.withResolvers();return this.streamControllers[n].pullCall=d,l.postMessage({sourceName:a,targetName:o,stream:Ot.PULL,streamId:n,desiredSize:c.desiredSize}),d.promise},cancel:c=>{Ht(c instanceof Error,"cancel must have a valid reason");const d=Promise.withResolvers();return this.streamControllers[n].cancelCall=d,this.streamControllers[n].isClosed=!0,l.postMessage({sourceName:a,targetName:o,stream:Ot.CANCEL,streamId:n,reason:Me(c)}),d.promise}},i)}destroy(){var t;(t=r(this,gl))==null||t.abort(),f(this,gl,null)}}gl=new WeakMap,Ei=new WeakSet,xy=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){p(this,Ei,Ty).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===Gu.DATA)s.resolve(t.data);else if(t.callback===Gu.ERROR)s.reject(Me(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(a){n.postMessage({sourceName:i,targetName:s,callback:Gu.DATA,callbackId:t.callbackId,data:a})},function(a){n.postMessage({sourceName:i,targetName:s,callback:Gu.ERROR,callbackId:t.callbackId,reason:Me(a)})});return}if(t.streamId){p(this,Ei,Cy).call(this,t);return}e(t.data)},Cy=function(t){const e=t.streamId,i=this.sourceName,s=t.sourceName,n=this.comObj,a=this,o=this.actionHandler[t.action],l={enqueue(c,d=1,u){if(this.isCancelled)return;const g=this.desiredSize;this.desiredSize-=d,g>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),n.postMessage({sourceName:i,targetName:s,stream:Ot.ENQUEUE,streamId:e,chunk:c},u)},close(){this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:i,targetName:s,stream:Ot.CLOSE,streamId:e}),delete a.streamSinks[e])},error(c){Ht(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,n.postMessage({sourceName:i,targetName:s,stream:Ot.ERROR,streamId:e,reason:Me(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:Ot.START_COMPLETE,streamId:e,success:!0})},function(c){n.postMessage({sourceName:i,targetName:s,stream:Ot.START_COMPLETE,streamId:e,reason:Me(c)})})},Ty=function(t){const e=t.streamId,i=this.sourceName,s=t.sourceName,n=this.comObj,a=this.streamControllers[e],o=this.streamSinks[e];switch(t.stream){case Ot.START_COMPLETE:t.success?a.startCall.resolve():a.startCall.reject(Me(t.reason));break;case Ot.PULL_COMPLETE:t.success?a.pullCall.resolve():a.pullCall.reject(Me(t.reason));break;case Ot.PULL:if(!o){n.postMessage({sourceName:i,targetName:s,stream:Ot.PULL_COMPLETE,streamId:e,success:!0});break}o.desiredSize<=0&&t.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=t.desiredSize,Promise.try(o.onPull||hw).then(function(){n.postMessage({sourceName:i,targetName:s,stream:Ot.PULL_COMPLETE,streamId:e,success:!0})},function(c){n.postMessage({sourceName:i,targetName:s,stream:Ot.PULL_COMPLETE,streamId:e,reason:Me(c)})});break;case Ot.ENQUEUE:if(Ht(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case Ot.CLOSE:if(Ht(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),p(this,Ei,gf).call(this,a,e);break;case Ot.ERROR:Ht(a,"error should have stream controller"),a.controller.error(Me(t.reason)),p(this,Ei,gf).call(this,a,e);break;case Ot.CANCEL_COMPLETE:t.success?a.cancelCall.resolve():a.cancelCall.reject(Me(t.reason)),p(this,Ei,gf).call(this,a,e);break;case Ot.CANCEL:if(!o)break;const l=Me(t.reason);Promise.try(o.onCancel||hw,l).then(function(){n.postMessage({sourceName:i,targetName:s,stream:Ot.CANCEL_COMPLETE,streamId:e,success:!0})},function(c){n.postMessage({sourceName:i,targetName:s,stream:Ot.CANCEL_COMPLETE,streamId:e,reason:Me(c)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},gf=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 Zc;class Iy{constructor({enableHWA:t=!1}){m(this,Zc,!1);f(this,Zc,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:!r(this,Zc)})}}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){gt("Abstract method `_createCanvas` called.")}}Zc=new WeakMap;class gE extends Iy{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 Ly{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){gt("Abstract method `_fetch` called.")}}class cw extends Ly{async _fetch(t){const e=await Vu(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):Bu(e)}}class Ry{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 ya,pl,js,$s,be,Aa,_a,B,pe,Wh,Ro,pf,Mo,My,Hp,ko,zh,Gh,jp,Xh;class pE extends Ry{constructor({docId:e,ownerDocument:i=globalThis.document}){super();m(this,B);m(this,ya);m(this,pl);m(this,js);m(this,$s);m(this,be);m(this,Aa);m(this,_a,0);f(this,$s,e),f(this,be,i)}addFilter(e){if(!e)return"none";let i=r(this,B,pe).get(e);if(i)return i;const[s,n,a]=p(this,B,pf).call(this,e),o=e.length===1?s:"".concat(s).concat(n).concat(a);if(i=r(this,B,pe).get(o),i)return r(this,B,pe).set(e,i),i;const l="g_".concat(r(this,$s),"_transfer_map_").concat(se(this,_a)._++),c=p(this,B,Mo).call(this,l);r(this,B,pe).set(e,c),r(this,B,pe).set(o,c);const d=p(this,B,ko).call(this,l);return p(this,B,Gh).call(this,s,n,a,d),c}addHCMFilter(e,i){var w;const s="".concat(e,"-").concat(i),n="base";let a=r(this,B,Wh).get(n);if((a==null?void 0:a.key)===s||(a?((w=a.filter)==null||w.remove(),a.key=s,a.url="none",a.filter=null):(a={key:s,url:"none",filter:null},r(this,B,Wh).set(n,a)),!e||!i))return a.url;const o=p(this,B,Xh).call(this,e);e=q.makeHexColor(...o);const l=p(this,B,Xh).call(this,i);if(i=q.makeHexColor(...l),r(this,B,Ro).style.color="",e==="#000000"&&i==="#ffffff"||e===i)return a.url;const c=new Array(256);for(let v=0;v<=255;v++){const y=v/255;c[v]=y<=.03928?y/12.92:((y+.055)/1.055)**2.4}const d=c.join(","),u="g_".concat(r(this,$s),"_hcm_filter"),g=a.filter=p(this,B,ko).call(this,u);p(this,B,Gh).call(this,d,d,d,g),p(this,B,Hp).call(this,g);const b=(v,y)=>{const A=o[v]/255,E=l[v]/255,_=new Array(y+1);for(let S=0;S<=y;S++)_[S]=A+S/y*(E-A);return _.join(",")};return p(this,B,Gh).call(this,b(0,5),b(1,5),b(2,5),g),a.url=p(this,B,Mo).call(this,u),a.url}addAlphaFilter(e){let i=r(this,B,pe).get(e);if(i)return i;const[s]=p(this,B,pf).call(this,[e]),n="alpha_".concat(s);if(i=r(this,B,pe).get(n),i)return r(this,B,pe).set(e,i),i;const a="g_".concat(r(this,$s),"_alpha_map_").concat(se(this,_a)._++),o=p(this,B,Mo).call(this,a);r(this,B,pe).set(e,o),r(this,B,pe).set(n,o);const l=p(this,B,ko).call(this,a);return p(this,B,jp).call(this,s,l),o}addLuminosityFilter(e){let i=r(this,B,pe).get(e||"luminosity");if(i)return i;let s,n;if(e?([s]=p(this,B,pf).call(this,[e]),n="luminosity_".concat(s)):n="luminosity",i=r(this,B,pe).get(n),i)return r(this,B,pe).set(e,i),i;const a="g_".concat(r(this,$s),"_luminosity_map_").concat(se(this,_a)._++),o=p(this,B,Mo).call(this,a);r(this,B,pe).set(e,o),r(this,B,pe).set(n,o);const l=p(this,B,ko).call(this,a);return p(this,B,My).call(this,l),e&&p(this,B,jp).call(this,s,l),o}addHighlightHCMFilter(e,i,s,n,a){var E;const o="".concat(i,"-").concat(s,"-").concat(n,"-").concat(a);let l=r(this,B,Wh).get(e);if((l==null?void 0:l.key)===o||(l?((E=l.filter)==null||E.remove(),l.key=o,l.url="none",l.filter=null):(l={key:o,url:"none",filter:null},r(this,B,Wh).set(e,l)),!i||!s))return l.url;const[c,d]=[i,s].map(p(this,B,Xh).bind(this));let u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),g=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),[b,w]=[n,a].map(p(this,B,Xh).bind(this));g<u&&([u,g,b,w]=[g,u,w,b]),r(this,B,Ro).style.color="";const v=(_,S,P)=>{const x=new Array(256),T=(g-u)/P,I=_/255,C=(S-_)/(255*P);let L=0;for(let M=0;M<=P;M++){const G=Math.round(u+M*T),W=I+M*C;for(let $=L;$<=G;$++)x[$]=W;L=G+1}for(let M=L;M<256;M++)x[M]=x[L-1];return x.join(",")},y="g_".concat(r(this,$s),"_hcm_").concat(e,"_filter"),A=l.filter=p(this,B,ko).call(this,y);return p(this,B,Hp).call(this,A),p(this,B,Gh).call(this,v(b[0],w[0],5),v(b[1],w[1],5),v(b[2],w[2],5),A),l.url=p(this,B,Mo).call(this,y),l.url}destroy(e=!1){var i,s,n,a;e&&((i=r(this,Aa))!=null&&i.size)||((s=r(this,js))==null||s.parentNode.parentNode.remove(),f(this,js,null),(n=r(this,pl))==null||n.clear(),f(this,pl,null),(a=r(this,Aa))==null||a.clear(),f(this,Aa,null),f(this,_a,0))}}ya=new WeakMap,pl=new WeakMap,js=new WeakMap,$s=new WeakMap,be=new WeakMap,Aa=new WeakMap,_a=new WeakMap,B=new WeakSet,pe=function(){return r(this,pl)||f(this,pl,new Map)},Wh=function(){return r(this,Aa)||f(this,Aa,new Map)},Ro=function(){if(!r(this,js)){const e=r(this,be).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=r(this,be).createElementNS(Ss,"svg");s.setAttribute("width",0),s.setAttribute("height",0),f(this,js,r(this,be).createElementNS(Ss,"defs")),e.append(s),s.append(r(this,js)),r(this,be).body.append(e)}return r(this,js)},pf=function(e){if(e.length===1){const c=e[0],d=new Array(256);for(let g=0;g<256;g++)d[g]=c[g]/255;const u=d.join(",");return[u,u,u]}const[i,s,n]=e,a=new Array(256),o=new Array(256),l=new Array(256);for(let c=0;c<256;c++)a[c]=i[c]/255,o[c]=s[c]/255,l[c]=n[c]/255;return[a.join(","),o.join(","),l.join(",")]},Mo=function(e){if(r(this,ya)===void 0){f(this,ya,"");const i=r(this,be).URL;i!==r(this,be).baseURI&&(Bg(i)?Z('#createUrl: ignore "data:"-URL for performance reasons.'):f(this,ya,Hv(i,"")))}return"url(".concat(r(this,ya),"#").concat(e,")")},My=function(e){const i=r(this,be).createElementNS(Ss,"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)},Hp=function(e){const i=r(this,be).createElementNS(Ss,"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)},ko=function(e){const i=r(this,be).createElementNS(Ss,"filter");return i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("id",e),r(this,B,Ro).append(i),i},zh=function(e,i,s){const n=r(this,be).createElementNS(Ss,i);n.setAttribute("type","discrete"),n.setAttribute("tableValues",s),e.append(n)},Gh=function(e,i,s,n){const a=r(this,be).createElementNS(Ss,"feComponentTransfer");n.append(a),p(this,B,zh).call(this,a,"feFuncR",e),p(this,B,zh).call(this,a,"feFuncG",i),p(this,B,zh).call(this,a,"feFuncB",s)},jp=function(e,i){const s=r(this,be).createElementNS(Ss,"feComponentTransfer");i.append(s),p(this,B,zh).call(this,s,"feFuncA",e)},Xh=function(e){return r(this,B,Ro).style.color=e,kb(getComputedStyle(r(this,B,Ro)).getPropertyValue("color"))};class ky{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){gt("Abstract method `_fetch` called.")}}class dw extends ky{async _fetch(t){const e=await Vu(t,"arraybuffer");return new Uint8Array(e)}}class Dy{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){gt("Abstract method `_fetch` called.")}}class uw extends Dy{async _fetch(t){const e=await Vu(t,"arraybuffer");return new Uint8Array(e)}}Ce&&Z("Please use the `legacy` build in Node.js environments.");async function Nb(h){const e=await process.getBuiltinModule("fs").promises.readFile(h);return new Uint8Array(e)}class mE extends Ry{}class bE extends Iy{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,e)}}class wE extends Ly{async _fetch(t){return Nb(t)}}class vE extends ky{async _fetch(t){return Nb(t)}}class yE extends Dy{async _fetch(t){return Nb(t)}}const de={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function $p(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 Fb{isModifyingCurrentTransform(){return!1}getPattern(){gt("Abstract method `getPattern` called.")}}class AE extends Fb{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===de.STROKE||s===de.FILL){const a=e.current.getClippedPathBoundingBox(s,Ct(t))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,c=e.cachedCanvases.getCanvas("pattern",o,l),d=c.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-a[0],-a[1]),i=q.transform(i,[1,0,0,1,a[0],a[1]]),d.transform(...e.baseTransform),this.matrix&&d.transform(...this.matrix),$p(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),n=t.createPattern(c.canvas,"no-repeat");const u=new DOMMatrix(i);n.setTransform(u)}else $p(t,this._bbox),n=this._createGradient(t);return n}}function Qg(h,t,e,i,s,n,a,o){const l=t.coords,c=t.colors,d=h.data,u=h.width*4;let g;l[e+1]>l[i+1]&&(g=e,e=i,i=g,g=n,n=a,a=g),l[i+1]>l[s+1]&&(g=i,i=s,s=g,g=a,a=o,o=g),l[e+1]>l[i+1]&&(g=e,e=i,i=g,g=n,n=a,a=g);const b=(l[e]+t.offsetX)*t.scaleX,w=(l[e+1]+t.offsetY)*t.scaleY,v=(l[i]+t.offsetX)*t.scaleX,y=(l[i+1]+t.offsetY)*t.scaleY,A=(l[s]+t.offsetX)*t.scaleX,E=(l[s+1]+t.offsetY)*t.scaleY;if(w>=E)return;const _=c[n],S=c[n+1],P=c[n+2],x=c[a],T=c[a+1],I=c[a+2],C=c[o],L=c[o+1],M=c[o+2],G=Math.round(w),W=Math.round(E);let $,Tt,V,N,mt,At,di,Es;for(let qt=G;qt<=W;qt++){if(qt<y){const It=qt<w?0:(w-qt)/(w-y);$=b-(b-v)*It,Tt=_-(_-x)*It,V=S-(S-T)*It,N=P-(P-I)*It}else{let It;qt>E?It=1:y===E?It=0:It=(y-qt)/(y-E),$=v-(v-A)*It,Tt=x-(x-C)*It,V=T-(T-L)*It,N=I-(I-M)*It}let kt;qt<w?kt=0:qt>E?kt=1:kt=(w-qt)/(w-E),mt=b-(b-A)*kt,At=_-(_-C)*kt,di=S-(S-L)*kt,Es=P-(P-M)*kt;const Io=Math.round(Math.min($,mt)),Pn=Math.round(Math.max($,mt));let xn=u*qt+Io*4;for(let It=Io;It<=Pn;It++)kt=($-It)/($-mt),kt<0?kt=0:kt>1&&(kt=1),d[xn++]=Tt-(Tt-At)*kt|0,d[xn++]=V-(V-di)*kt|0,d[xn++]=N-(N-Es)*kt|0,d[xn++]=255}}function _E(h,t,e){const i=t.coords,s=t.colors;let n,a;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 d=n*o;for(let u=0;u<c;u++,d++)Qg(h,e,i[d],i[d+1],i[d+o],s[d],s[d+1],s[d+o]),Qg(h,e,i[d+o+1],i[d+1],i[d+o],s[d+o+1],s[d+1],s[d+o])}break;case"triangles":for(n=0,a=i.length;n<a;n+=3)Qg(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 EE extends Fb{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,d=Math.ceil(this._bounds[3])-l,u=Math.min(Math.ceil(Math.abs(c*t[0]*1.1)),3e3),g=Math.min(Math.ceil(Math.abs(d*t[1]*1.1)),3e3),b=c/u,w=d/g,v={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/b,scaleY:1/w},y=u+2*2,A=g+2*2,E=i.getCanvas("mesh",y,A),_=E.context,S=_.createImageData(u,g);if(e){const x=S.data;for(let T=0,I=x.length;T<I;T+=4)x[T]=e[0],x[T+1]=e[1],x[T+2]=e[2],x[T+3]=255}for(const x of this._figures)_E(S,x,v);return _.putImageData(S,2,2),{canvas:E.canvas,offsetX:o-2*b,offsetY:l-2*w,scaleX:b,scaleY:w}}isModifyingCurrentTransform(){return!0}getPattern(t,e,i,s){$p(t,this._bbox);const n=new Float32Array(2);if(s===de.SHADING)q.singularValueDecompose2dScale(Ct(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 a=this._createMeshCanvas(n,s===de.SHADING?null:this._background,e.cachedCanvases);return s!==de.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(a.offsetX,a.offsetY),t.scale(a.scaleX,a.scaleY),t.createPattern(a.canvas,"no-repeat")}}class SE extends Fb{getPattern(){return"hotpink"}}function PE(h){switch(h[0]){case"RadialAxial":return new AE(h);case"Mesh":return new EE(h);case"Dummy":return new SE}throw new Error("Unknown IR type: ".concat(h[0]))}const fw={COLORED:1,UNCOLORED:2},yg=class yg{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:a,canvasGraphicsFactory:o}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),Og("TilingType: "+n);const d=e[0],u=e[1],g=e[2],b=e[3],w=g-d,v=b-u,y=new Float32Array(2);q.singularValueDecompose2dScale(this.matrix,y);const[A,E]=y;q.singularValueDecompose2dScale(this.baseTransform,y);const _=A*y[0],S=E*y[1];let P=w,x=v,T=!1,I=!1;const C=Math.ceil(l*_),L=Math.ceil(c*S),M=Math.ceil(w*_),G=Math.ceil(v*S);C>=M?P=l:T=!0,L>=G?x=c:I=!0;const W=this.getSizeAndScale(P,this.ctx.canvas.width,_),$=this.getSizeAndScale(x,this.ctx.canvas.height,S),Tt=t.cachedCanvases.getCanvas("pattern",W.size,$.size),V=Tt.context,N=o.createCanvasGraphics(V);if(N.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(N,s,a),V.translate(-W.scale*d,-$.scale*u),N.transform(W.scale,0,0,$.scale,0,0),V.save(),this.clipBbox(N,d,u,g,b),N.baseTransform=Ct(N.ctx),N.executeOperatorList(i),N.endDrawing(),V.restore(),T||I){const mt=Tt.canvas;T&&(P=l),I&&(x=c);const At=this.getSizeAndScale(P,this.ctx.canvas.width,_),di=this.getSizeAndScale(x,this.ctx.canvas.height,S),Es=At.size,qt=di.size,kt=t.cachedCanvases.getCanvas("pattern-workaround",Es,qt),Io=kt.context,Pn=T?Math.floor(w/l):0,xn=I?Math.floor(v/c):0;for(let It=0;It<=Pn;It++)for(let Lh=0;Lh<=xn;Lh++)Io.drawImage(mt,Es*It,qt*Lh,Es,qt,0,0,Es,qt);return{canvas:kt.canvas,scaleX:At.scale,scaleY:di.scale,offsetX:d,offsetY:u}}return{canvas:Tt.canvas,scaleX:W.scale,scaleY:$.scale,offsetX:d,offsetY:u}}getSizeAndScale(t,e,i){const s=Math.max(yg.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 a=s-e,o=n-i;t.ctx.rect(e,i,a,o),q.axialAlignedBoundingBox([e,i,s,n],Ct(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const s=t.ctx,n=t.current;switch(e){case fw.COLORED:const{fillStyle:a,strokeStyle:o}=this.ctx;s.fillStyle=n.fillColor=a,s.strokeStyle=n.strokeColor=o;break;case fw.UNCOLORED:s.fillStyle=s.strokeStyle=i,n.fillColor=n.strokeColor=i;break;default:throw new G_("Unsupported paint type: ".concat(e))}}isModifyingCurrentTransform(){return!1}getPattern(t,e,i,s){let n=i;s!==de.SHADING&&(n=q.transform(n,e.baseTransform),this.matrix&&(n=q.transform(n,this.matrix)));const a=this.createPatternCanvas(e);let o=new DOMMatrix(n);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);const l=t.createPattern(a.canvas,"repeat");return l.setTransform(o),l}};k(yg,"MAX_PATTERN_SIZE",3e3);let Up=yg;function xE({src:h,srcPos:t=0,dest:e,width:i,height:s,nonBlackColor:n=4294967295,inverseDecode:a=!1}){const o=fe.isLittleEndian?4278190080:255,[l,c]=a?[n,o]:[o,n],d=i>>3,u=i&7,g=h.length;e=new Uint32Array(e.buffer);let b=0;for(let w=0;w<s;w++){for(const y=t+d;t<y;t++){const A=t<g?h[t]:255;e[b++]=A&128?c:l,e[b++]=A&64?c:l,e[b++]=A&32?c:l,e[b++]=A&16?c:l,e[b++]=A&8?c:l,e[b++]=A&4?c:l,e[b++]=A&2?c:l,e[b++]=A&1?c:l}if(u===0)continue;const v=t<g?h[t++]:255;for(let y=0;y<u;y++)e[b++]=v&1<<7-y?c:l}return{srcPos:t,destPos:b}}const gw=16,pw=100,CE=15,mw=10,Be=16,Jg=new DOMMatrix,ri=new Float32Array(2),Wo=new Float32Array([1/0,1/0,-1/0,-1/0]);function TE(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,a,o){t.transform(e,i,s,n,a,o),this.__originalTransform(e,i,s,n,a,o)},h.setTransform=function(e,i,s,n,a,o){t.setTransform(e,i,s,n,a,o),this.__originalSetTransform(e,i,s,n,a,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,a,o){t.bezierCurveTo(e,i,s,n,a,o),this.__originalBezierCurveTo(e,i,s,n,a,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 IE{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 Xu(h,t,e,i,s,n,a,o,l,c){const[d,u,g,b,w,v]=Ct(h);if(u===0&&g===0){const E=a*d+w,_=Math.round(E),S=o*b+v,P=Math.round(S),x=(a+l)*d+w,T=Math.abs(Math.round(x)-_)||1,I=(o+c)*b+v,C=Math.abs(Math.round(I)-P)||1;return h.setTransform(Math.sign(d),0,0,Math.sign(b),_,P),h.drawImage(t,e,i,s,n,0,0,T,C),h.setTransform(d,u,g,b,w,v),[T,C]}if(d===0&&b===0){const E=o*g+w,_=Math.round(E),S=a*u+v,P=Math.round(S),x=(o+c)*g+w,T=Math.abs(Math.round(x)-_)||1,I=(a+l)*u+v,C=Math.abs(Math.round(I)-P)||1;return h.setTransform(0,Math.sign(u),Math.sign(g),0,_,P),h.drawImage(t,e,i,s,n,0,0,C,T),h.setTransform(d,u,g,b,w,v),[C,T]}h.drawImage(t,e,i,s,n,a,o,l,c);const y=Math.hypot(d,u),A=Math.hypot(g,b);return[y*l,A*c]}class bw{constructor(t,e){k(this,"alphaIsShape",!1);k(this,"fontSize",0);k(this,"fontSizeScale",1);k(this,"textMatrix",null);k(this,"textMatrixScale",1);k(this,"fontMatrix",bp);k(this,"leading",0);k(this,"x",0);k(this,"y",0);k(this,"lineX",0);k(this,"lineY",0);k(this,"charSpacing",0);k(this,"wordSpacing",0);k(this,"textHScale",1);k(this,"textRenderingMode",ge.FILL);k(this,"textRise",0);k(this,"fillColor","#000000");k(this,"strokeColor","#000000");k(this,"patternFill",!1);k(this,"patternStroke",!1);k(this,"fillAlpha",1);k(this,"strokeAlpha",1);k(this,"lineWidth",1);k(this,"activeSMask",null);k(this,"transferMaps","none");this.clipBox=new Float32Array([0,0,t,e]),this.minMax=Wo.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=de.FILL,e=null){const i=this.minMax.slice();if(t===de.STROKE){e||gt("Stroke bounding box must include transform."),q.singularValueDecompose2dScale(e,ri);const s=ri[0]*this.lineWidth/2,n=ri[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(Wo,0)}getClippedPathBoundingBox(t=de.FILL,e=null){return q.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function ww(h,t){if(t instanceof ImageData){h.putImageData(t,0,0);return}const e=t.height,i=t.width,s=e%Be,n=(e-s)/Be,a=s===0?n:n+1,o=h.createImageData(i,Be);let l=0,c;const d=t.data,u=o.data;let g,b,w,v;if(t.kind===rf.GRAYSCALE_1BPP){const y=d.byteLength,A=new Uint32Array(u.buffer,0,u.byteLength>>2),E=A.length,_=i+7>>3,S=4294967295,P=fe.isLittleEndian?4278190080:255;for(g=0;g<a;g++){for(w=g<n?Be:s,c=0,b=0;b<w;b++){const x=y-l;let T=0;const I=x>_?i:x*8-7,C=I&-8;let L=0,M=0;for(;T<C;T+=8)M=d[l++],A[c++]=M&128?S:P,A[c++]=M&64?S:P,A[c++]=M&32?S:P,A[c++]=M&16?S:P,A[c++]=M&8?S:P,A[c++]=M&4?S:P,A[c++]=M&2?S:P,A[c++]=M&1?S:P;for(;T<I;T++)L===0&&(M=d[l++],L=128),A[c++]=M&L?S:P,L>>=1}for(;c<E;)A[c++]=0;h.putImageData(o,0,g*Be)}}else if(t.kind===rf.RGBA_32BPP){for(b=0,v=i*Be*4,g=0;g<n;g++)u.set(d.subarray(l,l+v)),l+=v,h.putImageData(o,0,b),b+=Be;g<a&&(v=i*s*4,u.set(d.subarray(l,l+v)),h.putImageData(o,0,b))}else if(t.kind===rf.RGB_24BPP)for(w=Be,v=i*w,g=0;g<a;g++){for(g>=n&&(w=s,v=i*w),c=0,b=v;b--;)u[c++]=d[l++],u[c++]=d[l++],u[c++]=d[l++],u[c++]=255;h.putImageData(o,0,g*Be)}else throw new Error("bad image kind: ".concat(t.kind))}function vw(h,t){if(t.bitmap){h.drawImage(t.bitmap,0,0);return}const e=t.height,i=t.width,s=e%Be,n=(e-s)/Be,a=s===0?n:n+1,o=h.createImageData(i,Be);let l=0;const c=t.data,d=o.data;for(let u=0;u<a;u++){const g=u<n?Be:s;({srcPos:l}=xE({src:c,srcPos:l,dest:d,width:i,height:g,nonBlackColor:0})),h.putImageData(o,0,u*Be)}}function Rh(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 qu(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 yw(h,t){if(t)return!0;q.singularValueDecompose2dScale(h,ri);const e=Math.fround(So.pixelRatio*Or.PDF_TO_CSS_UNITS);return ri[0]<=e&&ri[1]<=e}const LE=["butt","round","square"],RE=["miter","round","bevel"],ME={},Aw={};var zi,Wp,zp,Gp;const Yb=class Yb{constructor(t,e,i,s,n,{optionalContentConfig:a,markedContentStack:o=null},l,c){m(this,zi);this.ctx=t,this.current=new bw(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=a,this.cachedCanvases=new IE(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,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,n,a),this.ctx.fillStyle=o,i){const l=this.cachedCanvases.getCanvas("transparent",n,a);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...Ct(this.compositeCtx))}this.ctx.save(),qu(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=Ct(this.ctx)}executeOperatorList(t,e,i,s){const n=t.argsArray,a=t.fnArray;let o=e||0;const l=n.length;if(l===o)return o;const c=l-o>mw&&typeof i=="function",d=c?Date.now()+CE:0;let u=0;const g=this.commonObjs,b=this.objs;let w;for(;;){if(s!==void 0&&o===s.nextBreakPoint)return s.breakIt(o,i),o;if(w=a[o],w!==tg.dependency)this[w].apply(this,n[o]);else for(const v of n[o]){const y=v.startsWith("g_")?g:b;if(!y.has(v))return y.get(v,i),o}if(o++,o===l)return o;if(c&&++u>mw){if(Date.now()>d)return i(),o;u=0}}}endDrawing(){p(this,zi,Wp).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(),p(this,zi,zp).call(this)}_scaleImage(t,e){var g,b;const i=(g=t.width)!=null?g:t.displayWidth,s=(b=t.height)!=null?b:t.displayHeight;let n=Math.max(Math.hypot(e[0],e[1]),1),a=Math.max(Math.hypot(e[2],e[3]),1),o=i,l=s,c="prescale1",d,u;for(;n>2&&o>1||a>2&&l>1;){let w=o,v=l;n>2&&o>1&&(w=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),n/=o/w),a>2&&l>1&&(v=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,a/=l/v),d=this.cachedCanvases.getCanvas(c,w,v),u=d.context,u.clearRect(0,0,w,v),u.drawImage(t,0,0,o,l,0,0,w,v),t=d.canvas,o=w,l=v,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,a=this.current.patternFill,o=Ct(e);let l,c,d,u;if((t.bitmap||t.data)&&t.count>1){const C=t.bitmap||t.data.buffer;c=JSON.stringify(a?o:[o.slice(0,4),n]),l=this._cachedBitmapsMap.get(C),l||(l=new Map,this._cachedBitmapsMap.set(C,l));const L=l.get(c);if(L&&!a){const M=Math.round(Math.min(o[0],o[2])+o[4]),G=Math.round(Math.min(o[1],o[3])+o[5]);return{canvas:L,offsetX:M,offsetY:G}}d=L}d||(u=this.cachedCanvases.getCanvas("maskCanvas",i,s),vw(u.context,t));let g=q.transform(o,[1/i,0,0,-1/s,0,0]);g=q.transform(g,[1,0,0,1,0,-s]);const b=Wo.slice();q.axialAlignedBoundingBox([0,0,i,s],g,b);const[w,v,y,A]=b,E=Math.round(y-w)||1,_=Math.round(A-v)||1,S=this.cachedCanvases.getCanvas("fillCanvas",E,_),P=S.context,x=w,T=v;P.translate(-x,-T),P.transform(...g),d||(d=this._scaleImage(u.canvas,Gi(P)),d=d.img,l&&a&&l.set(c,d)),P.imageSmoothingEnabled=yw(Ct(P),t.interpolate),Xu(P,d,0,0,d.width,d.height,0,0,i,s),P.globalCompositeOperation="source-in";const I=q.transform(Gi(P),[1,0,0,1,-x,-T]);return P.fillStyle=a?n.getPattern(e,this,I,de.FILL):n,P.fillRect(0,0,i,s),l&&!a&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,S.canvas)),{canvas:S.canvas,offsetX:Math.round(x),offsetY:Math.round(T)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=LE[t]}setLineJoin(t){this.ctx.lineJoin=RE[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()),Rh(this.suspendedCtx,n),TE(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(),Rh(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],a=s[1],o=s[2]-n,l=s[3]-a;o===0||l===0||(this.genericComposeSMask(e.context,i,o,l,e.subtype,e.backdrop,e.transferMap,n,a,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,a,o,l,c,d,u){let g=t.canvas,b=l-d,w=c-u;if(a)if(b<0||w<0||b+i>g.width||w+s>g.height){const y=this.cachedCanvases.getCanvas("maskExtension",i,s),A=y.context;A.drawImage(g,-b,-w),A.globalCompositeOperation="destination-atop",A.fillStyle=a,A.fillRect(0,0,i,s),A.globalCompositeOperation="source-over",g=y.canvas,b=w=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const y=new Path2D;y.rect(b,w,i,s),t.clip(y),t.globalCompositeOperation="destination-atop",t.fillStyle=a,t.fillRect(b,w,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 v=new Path2D;v.rect(l,c,i,s),e.clip(v),e.globalCompositeOperation="destination-in",e.drawImage(g,b,w,i,s,l,c,i,s),e.restore()}save(){this.inSMaskMode&&Rh(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&&Rh(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,e,i,s,n,a){this.ctx.transform(t,e,i,s,n,a),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 a=0,o=s.length;a<o;)switch(s[a++]){case Wu.moveTo:n.moveTo(s[a++],s[a++]);break;case Wu.lineTo:n.lineTo(s[a++],s[a++]);break;case Wu.curveTo:n.bezierCurveTo(s[a++],s[a++],s[a++],s[a++],s[a++],s[a++]);break;case Wu.closePath:n.closePath();break;default:Z("Unrecognized drawing path operator: ".concat(s[a-1]));break}s=n}q.axialAlignedBoundingBox(i,Ct(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,Gi(i),de.STROKE),n){const a=new Path2D;a.addPath(t,i.getTransform().invertSelf().multiplySelf(n)),t=a}this.rescaleAndStroke(t,!1),i.restore()}else this.rescaleAndStroke(t,!0);e&&this.consumePath(t,this.current.getClippedPathBoundingBox(de.STROKE,Ct(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 a=!1;if(n){const l=s.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.fillStyle=s.getPattern(i,this,Gi(i),de.FILL),l){const c=new Path2D;c.addPath(t,i.getTransform().invertSelf().multiplySelf(l)),t=c}a=!0}const o=this.current.getClippedPathBoundingBox();this.contentVisible&&o!==null&&(this.pendingEOFill?(i.fill(t,"evenodd"),this.pendingEOFill=!1):i.fill(t)),a&&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=ME}eoClip(){this.pendingClip=Aw}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:a,y:o,fontSize:l,path:c}of t)i.addPath(c,new DOMMatrix(n).preMultiplySelf(s).translate(a,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 d;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||bp,(s.fontMatrix[0]===0||s.fontMatrix[3]===0)&&Z("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",a=((d=i.systemFontInfo)==null?void 0:d.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<gw?c=gw:e>pw&&(c=pw),this.current.fontSizeScale=e/c,this.ctx.font="".concat(l," ").concat(o," ").concat(c,"px ").concat(a)}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t){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 a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,u=c&ge.FILL_STROKE_MASK,g=!!(c&ge.ADD_TO_PATH_FLAG),b=o.patternFill&&!l.missingFile,w=o.patternStroke&&!l.missingFile;let v;if((l.disableFontFace||g||b||w)&&(v=l.getPathGenerator(this.commonObjs,t)),l.disableFontFace||b||w){a.save(),a.translate(e,i),a.scale(d,-d);let y;if((u===ge.FILL||u===ge.FILL_STROKE)&&(s?(y=a.getTransform(),a.setTransform(...s),a.fill(p(this,zi,Gp).call(this,v,y,s))):a.fill(v)),u===ge.STROKE||u===ge.FILL_STROKE)if(n){y||(y=a.getTransform()),a.setTransform(...n);const{a:A,b:E,c:_,d:S}=y,P=q.inverseTransform(n),x=q.transform([A,E,_,S,0,0],P);q.singularValueDecompose2dScale(x,ri),a.lineWidth*=Math.max(ri[0],ri[1])/d,a.stroke(p(this,zi,Gp).call(this,v,y,n))}else a.lineWidth/=d,a.stroke(v);a.restore()}else(u===ge.FILL||u===ge.FILL_STROKE)&&a.fillText(t,e,i),(u===ge.STROKE||u===ge.FILL_STROKE)&&a.strokeText(t,e,i);g&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Ct(a),x:e,y:i,fontSize:d,path:v})}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 nt(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,a=e.fontSizeScale,o=e.charSpacing,l=e.wordSpacing,c=e.fontDirection,d=e.textHScale*c,u=t.length,g=i.vertical,b=g?1:-1,w=i.defaultVMetrics,v=s*e.fontMatrix[0],y=e.textRenderingMode===ge.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(d,-1):n.scale(d,1);let A,E;if(e.patternFill){n.save();const T=e.fillColor.getPattern(n,this,Gi(n),de.FILL);A=Ct(n),n.restore(),n.fillStyle=T}if(e.patternStroke){n.save();const T=e.strokeColor.getPattern(n,this,Gi(n),de.STROKE);E=Ct(n),n.restore(),n.strokeStyle=T}let _=e.lineWidth;const S=e.textMatrixScale;if(S===0||_===0){const T=e.textRenderingMode&ge.FILL_STROKE_MASK;(T===ge.STROKE||T===ge.FILL_STROKE)&&(_=this.getSinglePixelWidth())}else _/=S;if(a!==1&&(n.scale(a,a),_/=a),n.lineWidth=_,i.isInvalidPDFjsFont){const T=[];let I=0;for(const C of t)T.push(C.unicode),I+=C.width;n.fillText(T.join(""),0,0),e.x+=I*v*d,n.restore(),this.compose();return}let P=0,x;for(x=0;x<u;++x){const T=t[x];if(typeof T=="number"){P+=b*T*s/1e3;continue}let I=!1;const C=(T.isSpace?l:0)+o,L=T.fontChar,M=T.accent;let G,W,$=T.width;if(g){const V=T.vmetric||w,N=-(T.vmetric?V[1]:$*.5)*v,mt=V[2]*v;$=V?-V[0]:$,G=N/a,W=(P+mt)/a}else G=P/a,W=0;if(i.remeasure&&$>0){const V=n.measureText(L).width*1e3/s*a;if($<V&&this.isFontSubpixelAAEnabled){const N=$/V;I=!0,n.save(),n.scale(N,1),G/=N}else $!==V&&(G+=($-V)/2e3*s/a)}if(this.contentVisible&&(T.isInFont||i.missingFile)){if(y&&!M)n.fillText(L,G,W);else if(this.paintChar(L,G,W,A,E),M){const V=G+s*M.offset.x/a,N=W-s*M.offset.y/a;this.paintChar(M.fontChar,V,N,A,E)}}const Tt=g?$*v-C*c:$*v+C*c;P+=Tt,I&&n.restore()}g?e.y-=P:e.x+=P*d,n.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,s=i.font,n=i.fontSize,a=i.fontDirection,o=s.vertical?1:-1,l=i.charSpacing,c=i.wordSpacing,d=i.textHScale*a,u=i.fontMatrix||bp,g=t.length,b=i.textRenderingMode===ge.INVISIBLE;let w,v,y,A;if(!(b||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(d,a),w=0;w<g;++w){if(v=t[w],typeof v=="number"){A=o*v*n/1e3,this.ctx.translate(A,0),i.x+=A*d;continue}const E=(v.isSpace?c:0)+l,_=s.charProcOperatorList[v.operatorListId];_?this.contentVisible&&(this.save(),e.scale(n,n),e.transform(...u),this.executeOperatorList(_),this.restore()):Z('Type3 character "'.concat(v.operatorListId,'" is not available.'));const S=[v.width,0];q.applyTransform(S,u),y=S[0]*n+E,e.translate(y,0),i.x+=y*d}e.restore()}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,s,n,a){const o=new Path2D;o.rect(i,s,n-i,a-s),this.ctx.clip(o),this.endPath()}getColorN_Pattern(t){let e;if(t[0]==="TilingPattern"){const i=this.baseTransform||Ct(this.ctx),s={createCanvasGraphics:n=>new Yb(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new Up(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=PE(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,Gi(e),de.SHADING);const s=Gi(e);if(s){const{width:n,height:a}=e.canvas,o=Wo.slice();q.axialAlignedBoundingBox([0,0,n,a],s,o);const[l,c,d,u]=o;this.ctx.fillRect(l,c,d-l,u-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){gt("Should not call beginInlineImage")}beginImageData(){gt("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Ct(this.ctx),e)){q.axialAlignedBoundingBox(e,this.baseTransform,this.current.minMax);const[i,s,n,a]=e,o=new Path2D;o.rect(i,s,n-i,a-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||Og("TODO: Support non-isolated groups."),t.knockout&&Z("Knockout groups not supported.");const i=Ct(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let s=Wo.slice();q.axialAlignedBoundingBox(t.bbox,Ct(e),s);const n=[0,0,e.canvas.width,e.canvas.height];s=q.intersect(s,n)||[0,0,0,0];const a=Math.floor(s[0]),o=Math.floor(s[1]),l=Math.max(Math.ceil(s[2])-a,1),c=Math.max(Math.ceil(s[3])-o,1);this.current.startNewPathAndClipBox([0,0,l,c]);let d="groupAt"+this.groupLevel;t.smask&&(d+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(d,l,c),g=u.context;g.translate(-a,-o),g.transform(...i);let b=new Path2D;const[w,v,y,A]=t.bbox;if(b.rect(w,v,y-w,A-v),t.matrix){const E=new Path2D;E.addPath(b,new DOMMatrix(t.matrix)),b=E}g.clip(b),t.smask?this.smaskStack.push({canvas:u.canvas,context:g,offsetX:a,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(a,o),e.save()),Rh(e,g),this.ctx=g,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=Ct(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...s);const n=Wo.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(p(this,zi,Wp).call(this),qu(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const a=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]=a,e[3]=o,q.singularValueDecompose2dScale(Ct(this.ctx),ri);const{viewportScale:l}=this,c=Math.ceil(a*this.outputScaleX*l),d=Math.ceil(o*this.outputScaleY*l);this.annotationCanvas=this.canvasFactory.create(c,d);const{canvas:u,context:g}=this.annotationCanvas;this.annotationCanvasMap.set(t,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=g,this.ctx.save(),this.ctx.setTransform(ri[0],0,0,-ri[1],0,o*ri[1]),qu(this.ctx)}else{qu(this.ctx),this.endPath();const l=new Path2D;l.rect(e[0],e[1],a,o),this.ctx.clip(l)}}this.current=new bw(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),p(this,zi,zp).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,a){if(!this.contentVisible)return;t=this.getObject(t.data,t);const o=this.ctx;o.save();const l=Ct(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 d=0,u=a.length;d<u;d+=2){const g=q.transform(l,[e,i,s,n,a[d],a[d+1]]);o.drawImage(c.canvas,g[4],g[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:a,width:o,height:l,transform:c}=n,d=this.cachedCanvases.getCanvas("maskCanvas",o,l),u=d.context;u.save();const g=this.getObject(a,n);vw(u,g),u.globalCompositeOperation="source-in",u.fillStyle=s?i.getPattern(u,this,Gi(e),de.FILL):i,u.fillRect(0,0,o,l),u.restore(),e.save(),e.transform(...c),e.scale(1,-1),Xu(e,d.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){Z("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){Z("Dependent image isn't ready yet");return}const a=n.width,o=n.height,l=[];for(let c=0,d=s.length;c<d;c+=2)l.push({transform:[e,0,0,i,s[c],s[c+1]],x:0,y:0,w:a,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),a=n.context;return a.filter=this.current.transferMaps,a.drawImage(e,0,0),a.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 a;if(t.bitmap)a=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)a=t;else{const c=this.cachedCanvases.getCanvas("inlineImage",e,i).context;ww(c,t),a=this.applyTransferMapsToCanvas(c)}const o=this._scaleImage(a,Gi(s));s.imageSmoothingEnabled=yw(Ct(s),t.interpolate),Xu(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,a=t.height,l=this.cachedCanvases.getCanvas("inlineImage",n,a).context;ww(l,t),s=this.applyTransferMapsToCanvas(l)}for(const n of e)i.save(),i.transform(...n.transform),i.scale(1,-1),Xu(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===Aw?s.clip(t,"evenodd"):s.clip(t)),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Ct(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),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 a,o;if(i===0&&s===0){const l=Math.abs(e),c=Math.abs(n);if(l===c)if(t===0)a=o=1/l;else{const d=l*t;a=o=d<1?1/d:1}else if(t===0)a=1/l,o=1/c;else{const d=l*t,u=c*t;a=d<1?1/d:1,o=u<1?1/u:1}}else{const l=Math.abs(e*n-i*s),c=Math.hypot(e,i),d=Math.hypot(s,n);if(t===0)a=d/l,o=c/l;else{const u=t*l;a=d>u?d/u:1,o=c>u?c/u:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:i,current:{lineWidth:s}}=this,[n,a]=this.getScaleForStroking();if(n===a){i.lineWidth=(s||1)*n,i.stroke(t);return}const o=i.getLineDash();e&&i.save(),i.scale(n,a),Jg.a=1/n,Jg.d=1/a;const l=new Path2D;if(l.addPath(t,Jg),o.length>0){const c=Math.max(n,a);i.setLineDash(o.map(d=>d/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}};zi=new WeakSet,Wp=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)},zp=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}}},Gp=function(t,e,i){const s=new Path2D;return s.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),s};let Xo=Yb;for(const h in tg)Xo.prototype[h]!==void 0&&(Xo.prototype[tg[h]]=Xo.prototype[h]);var nf,Qc,Jc;let Mn=(nf=class{static get workerPort(){return r(this,Qc)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");f(this,Qc,t)}static get workerSrc(){return r(this,Jc)}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");f(this,Jc,t)}},Qc=new WeakMap,Jc=new WeakMap,m(nf,Qc,null),m(nf,Jc,""),nf);var ml,td;class kE{constructor({parsedData:t,rawData:e}){m(this,ml);m(this,td);f(this,ml,t),f(this,td,e)}getRaw(){return r(this,td)}get(t){var e;return(e=r(this,ml).get(t))!=null?e:null}[Symbol.iterator](){return r(this,ml).entries()}}ml=new WeakMap,td=new WeakMap;const Do=Symbol("INTERNAL");var ed,id,sd,bl;class DE{constructor(t,{name:e,intent:i,usage:s,rbGroups:n}){m(this,ed,!1);m(this,id,!1);m(this,sd,!1);m(this,bl,!0);f(this,ed,!!(t&si.DISPLAY)),f(this,id,!!(t&si.PRINT)),this.name=e,this.intent=i,this.usage=s,this.rbGroups=n}get visible(){if(r(this,sd))return r(this,bl);if(!r(this,bl))return!1;const{print:t,view:e}=this.usage;return r(this,ed)?(e==null?void 0:e.viewState)!=="OFF":r(this,id)?(t==null?void 0:t.printState)!=="OFF":!0}_setVisible(t,e,i=!1){t!==Do&>("Internal method `_setVisible` called."),f(this,sd,i),f(this,bl,e)}}ed=new WeakMap,id=new WeakMap,sd=new WeakMap,bl=new WeakMap;var qn,ut,wl,vl,nd,Xp;class NE{constructor(t,e=si.DISPLAY){m(this,nd);m(this,qn,null);m(this,ut,new Map);m(this,wl,null);m(this,vl,null);if(this.renderingIntent=e,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,f(this,vl,t.order);for(const i of t.groups)r(this,ut).set(i.id,new DE(e,i));if(t.baseState==="OFF")for(const i of r(this,ut).values())i._setVisible(Do,!1);for(const i of t.on)r(this,ut).get(i)._setVisible(Do,!0);for(const i of t.off)r(this,ut).get(i)._setVisible(Do,!1);f(this,wl,this.getHash())}}isVisible(t){if(r(this,ut).size===0)return!0;if(!t)return Og("Optional content group not defined."),!0;if(t.type==="OCG")return r(this,ut).has(t.id)?r(this,ut).get(t.id).visible:(Z("Optional content group not found: ".concat(t.id)),!0);if(t.type==="OCMD"){if(t.expression)return p(this,nd,Xp).call(this,t.expression);if(!t.policy||t.policy==="AnyOn"){for(const e of t.ids){if(!r(this,ut).has(e))return Z("Optional content group not found: ".concat(e)),!0;if(r(this,ut).get(e).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const e of t.ids){if(!r(this,ut).has(e))return Z("Optional content group not found: ".concat(e)),!0;if(!r(this,ut).get(e).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const e of t.ids){if(!r(this,ut).has(e))return Z("Optional content group not found: ".concat(e)),!0;if(!r(this,ut).get(e).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const e of t.ids){if(!r(this,ut).has(e))return Z("Optional content group not found: ".concat(e)),!0;if(r(this,ut).get(e).visible)return!1}return!0}return Z("Unknown optional content policy ".concat(t.policy,".")),!0}return Z("Unknown group type ".concat(t.type,".")),!0}setVisibility(t,e=!0,i=!0){var n;const s=r(this,ut).get(t);if(!s){Z("Optional content group not found: ".concat(t));return}if(i&&e&&s.rbGroups.length)for(const a of s.rbGroups)for(const o of a)o!==t&&((n=r(this,ut).get(o))==null||n._setVisible(Do,!1,!0));s._setVisible(Do,!!e,!0),f(this,qn,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=r(this,ut).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}}f(this,qn,null)}get hasInitialVisibility(){return r(this,wl)===null||this.getHash()===r(this,wl)}getOrder(){return r(this,ut).size?r(this,vl)?r(this,vl).slice():[...r(this,ut).keys()]:null}getGroup(t){return r(this,ut).get(t)||null}getHash(){if(r(this,qn)!==null)return r(this,qn);const t=new Ey;for(const[e,i]of r(this,ut))t.update("".concat(e,":").concat(i.visible));return f(this,qn,t.hexdigest())}[Symbol.iterator](){return r(this,ut).entries()}}qn=new WeakMap,ut=new WeakMap,wl=new WeakMap,vl=new WeakMap,nd=new WeakSet,Xp=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 a;if(Array.isArray(n))a=p(this,nd,Xp).call(this,n);else if(r(this,ut).has(n))a=r(this,ut).get(n).visible;else return Z("Optional content group not found: ".concat(n)),!0;switch(i){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return i==="And"};class FE{constructor(t,{disableRange:e=!1,disableStream:i=!1}){Ht(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:n,progressiveDone:a,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=a,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)});Ht(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(){Ht(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new OE(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new BE(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 OE{constructor(t,e,i=!1,s=null){this._stream=t,this._done=i||!1,this._filename=Mb(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 BE{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 VE(h){let t=!0,e=i("filename\\*","i").exec(h);if(e){e=e[1];let d=o(e);return d=unescape(d),d=l(d),d=c(d),n(d)}if(e=a(h),e){const d=c(e);return n(d)}if(e=i("filename","i").exec(h),e){e=e[1];let d=o(e);return d=c(d),n(d)}function i(d,u){return new RegExp("(?:^|;)\\s*"+d+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',u)}function s(d,u){if(d){if(!/^[\x00-\xFF]+$/.test(u))return u;try{const g=new TextDecoder(d,{fatal:!0}),b=Bu(u);u=g.decode(b),t=!1}catch(g){}}return u}function n(d){return t&&/[\x80-\xff]/.test(d)&&(d=s("utf-8",d),t&&(d=s("iso-8859-1",d))),d}function a(d){const u=[];let g;const b=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(g=b.exec(d))!==null;){let[,v,y,A]=g;if(v=parseInt(v,10),v in u){if(v===0)break;continue}u[v]=[y,A]}const w=[];for(let v=0;v<u.length&&v in u;++v){let[y,A]=u[v];A=o(A),y&&(A=unescape(A),v===0&&(A=l(A))),w.push(A)}return w.join("")}function o(d){if(d.startsWith('"')){const u=d.slice(1).split('\\"');for(let g=0;g<u.length;++g){const b=u[g].indexOf('"');b!==-1&&(u[g]=u[g].slice(0,b),u.length=g+1),u[g]=u[g].replaceAll(/\\(.)/g,"$1")}d=u.join('"')}return d}function l(d){const u=d.indexOf("'");if(u===-1)return d;const g=d.slice(0,u),w=d.slice(u+1).replace(/^[^']*'/,"");return s(g,w)}function c(d){return!d.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(d)?d:d.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(u,g,b,w){if(b==="q"||b==="Q")return w=w.replaceAll("_"," "),w=w.replaceAll(/=([0-9a-fA-F]{2})/g,function(v,y){return String.fromCharCode(parseInt(y,16))}),s(g,w);try{w=atob(w)}catch(v){}return s(g,w)})}return""}function Ny(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 Vg(h){var t,e;return(e=(t=URL.parse(h))==null?void 0:t.origin)!=null?e:null}function Fy({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 Oy(h){const t=h.get("Content-Disposition");if(t){let e=VE(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch(i){}if(Mb(e))return e}return null}function $u(h,t){return new eg("Unexpected server response (".concat(h,') while retrieving PDF "').concat(t,'".'),h,h===404||h===0&&t.startsWith("file:"))}function By(h){return h===200||h===206}function Vy(h,t,e){return{method:"GET",headers:h,signal:e.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function Hy(h){return h instanceof Uint8Array?h.buffer:h instanceof ArrayBuffer?h:(Z("getArrayBuffer - unexpected data format: ".concat(h)),new Uint8Array(h).buffer)}class HE{constructor(t){k(this,"_responseOrigin",null);this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=Ny(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 Ht(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new jE(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new $E(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 jE{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,Vy(i,this._withCredentials,this._abortController)).then(n=>{if(t._responseOrigin=Vg(n.url),!By(n.status))throw $u(n.status,s);this._reader=n.body.getReader(),this._headersCapability.resolve();const a=n.headers,{allowRangeRequests:o,suggestedLength:l}=Fy({responseHeaders:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=Oy(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Fr("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:Hy(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}class $E{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 a=s.url;fetch(a,Vy(n,this._withCredentials,this._abortController)).then(o=>{const l=Vg(o.url);if(l!==t._responseOrigin)throw new Error('Expected range response-origin "'.concat(l,'" to match "').concat(t._responseOrigin,'".'));if(!By(o.status))throw $u(o.status,a);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var 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:Hy(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}const tp=200,ep=206;function UE(h){const t=h.response;return typeof t!="string"?t:Bu(t).buffer}class WE{constructor({url:t,httpHeaders:e,withCredentials:i}){k(this,"_responseOrigin",null);this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=Ny(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,a]of this.headers)e.setRequestHeader(n,a);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1)),s.expectedStatus=ep):s.expectedStatus=tp,e.responseType="arraybuffer",Ht(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||tp;if(!(n===tp&&i.expectedStatus===ep)&&n!==i.expectedStatus){i.onError(s.status);return}const o=UE(s);if(n===ep){const l=s.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);c?i.onDone({begin:parseInt(c[1],10),chunk:o}):(Z('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 zE{constructor(t){this._source=t,this._manager=new WE(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 Ht(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new GE(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new XE(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 GE{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=Vg(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:a}=Fy({responseHeaders:s,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=Oy(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=$u(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 XE{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=Vg((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=$u(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 qE=/^[a-z][a-z0-9\-+.]+:/i;function YE(h){if(qE.test(h))return new URL(h);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(h))}class KE{constructor(t){this.source=t,this.url=YE(t.url),Ht(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 Ht(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new ZE(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new QE(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 ZE{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=$u(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 Fr("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class QE{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 Mh=Symbol("INITIAL_DATA");var ze,rd,qp;class jy{constructor(){m(this,rd);m(this,ze,Object.create(null))}get(t,e=null){if(e){const s=p(this,rd,qp).call(this,t);return s.promise.then(()=>e(s.data)),null}const i=r(this,ze)[t];if(!i||i.data===Mh)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}has(t){const e=r(this,ze)[t];return!!e&&e.data!==Mh}delete(t){const e=r(this,ze)[t];return!e||e.data===Mh?!1:(delete r(this,ze)[t],!0)}resolve(t,e=null){const i=p(this,rd,qp).call(this,t);i.data=e,i.resolve()}clear(){var t;for(const e in r(this,ze)){const{data:i}=r(this,ze)[e];(t=i==null?void 0:i.bitmap)==null||t.close()}f(this,ze,Object.create(null))}*[Symbol.iterator](){for(const t in r(this,ze)){const{data:e}=r(this,ze)[t];e!==Mh&&(yield[t,e])}}}ze=new WeakMap,rd=new WeakSet,qp=function(t){var e;return(e=r(this,ze))[t]||(e[t]={...Promise.withResolvers(),data:Mh})};const JE=1e5,_w=30;var Lv,Yn,De,ad,od,Ea,Us,ld,hd,Sa,yl,Al,Kn,_l,cd,El,Pa,dd,ud,Mt,Sl,xa,fd,Zn,Pl,En,$y,Uy,Kp,hi,mf,Zp,Wy,zy;let Yp=(Mt=class{constructor({textContentSource:t,container:e,viewport:i}){m(this,En);m(this,Yn,Promise.withResolvers());m(this,De,null);m(this,ad,!1);m(this,od,!!((Lv=globalThis.FontInspector)!=null&&Lv.enabled));m(this,Ea,null);m(this,Us,null);m(this,ld,0);m(this,hd,0);m(this,Sa,null);m(this,yl,null);m(this,Al,0);m(this,Kn,0);m(this,_l,Object.create(null));m(this,cd,[]);m(this,El,null);m(this,Pa,[]);m(this,dd,new WeakMap);m(this,ud,null);var l;if(t instanceof ReadableStream)f(this,El,t);else if(typeof t=="object")f(this,El,new ReadableStream({start(c){c.enqueue(t),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');f(this,De,f(this,yl,e)),f(this,Kn,i.scale*So.pixelRatio),f(this,Al,i.rotation),f(this,Us,{div:null,properties:null,ctx:null});const{pageWidth:s,pageHeight:n,pageX:a,pageY:o}=i.rawDims;f(this,ud,[1,0,0,-1,-a,o+n]),f(this,hd,s),f(this,ld,n),p(l=Mt,hi,Wy).call(l),Eo(e,i),r(this,Yn).promise.finally(()=>{r(Mt,Pl).delete(this),f(this,Us,null),f(this,_l,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=fe.platform;return nt(this,"fontFamilyMap",new Map([["sans-serif","".concat(t&&e?"Calibri, ":"","sans-serif")],["monospace","".concat(t&&e?"Lucida Console, ":"","monospace")]]))}render(){const t=()=>{r(this,Sa).read().then(({value:e,done:i})=>{var s;if(i){r(this,Yn).resolve();return}(s=r(this,Ea))!=null||f(this,Ea,e.lang),Object.assign(r(this,_l),e.styles),p(this,En,$y).call(this,e.items),t()},r(this,Yn).reject)};return f(this,Sa,r(this,El).getReader()),r(Mt,Pl).add(this),t(),r(this,Yn).promise}update({viewport:t,onBefore:e=null}){var n;const i=t.scale*So.pixelRatio,s=t.rotation;if(s!==r(this,Al)&&(e==null||e(),f(this,Al,s),Eo(r(this,yl),{rotation:s})),i!==r(this,Kn)){e==null||e(),f(this,Kn,i);const a={div:null,properties:null,ctx:p(n=Mt,hi,mf).call(n,r(this,Ea))};for(const o of r(this,Pa))a.properties=r(this,dd).get(o),a.div=o,p(this,En,Kp).call(this,a)}}cancel(){var e;const t=new Fr("TextLayer task cancelled.");(e=r(this,Sa))==null||e.cancel(t).catch(()=>{}),f(this,Sa,null),r(this,Yn).reject(t)}get textDivs(){return r(this,Pa)}get textContentItemsStr(){return r(this,cd)}static cleanup(){if(!(r(this,Pl).size>0)){r(this,Sl).clear();for(const{canvas:t}of r(this,xa).values())t.remove();r(this,xa).clear()}}},Yn=new WeakMap,De=new WeakMap,ad=new WeakMap,od=new WeakMap,Ea=new WeakMap,Us=new WeakMap,ld=new WeakMap,hd=new WeakMap,Sa=new WeakMap,yl=new WeakMap,Al=new WeakMap,Kn=new WeakMap,_l=new WeakMap,cd=new WeakMap,El=new WeakMap,Pa=new WeakMap,dd=new WeakMap,ud=new WeakMap,Sl=new WeakMap,xa=new WeakMap,fd=new WeakMap,Zn=new WeakMap,Pl=new WeakMap,En=new WeakSet,$y=function(t){var s,n,a;if(r(this,ad))return;(a=(n=r(this,Us)).ctx)!=null||(n.ctx=p(s=Mt,hi,mf).call(s,r(this,Ea)));const e=r(this,Pa),i=r(this,cd);for(const o of t){if(e.length>JE){Z("Ignoring additional textDivs for performance reasons."),f(this,ad,!0);return}if(o.str===void 0){if(o.type==="beginMarkedContentProps"||o.type==="beginMarkedContent"){const l=r(this,De);f(this,De,document.createElement("span")),r(this,De).classList.add("markedContent"),o.id!==null&&r(this,De).setAttribute("id","".concat(o.id)),l.append(r(this,De))}else o.type==="endMarkedContent"&&f(this,De,r(this,De).parentNode);continue}i.push(o.str),p(this,En,Uy).call(this,o)}},Uy=function(t){var v;const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};r(this,Pa).push(e);const s=q.transform(r(this,ud),t.transform);let n=Math.atan2(s[1],s[0]);const a=r(this,_l)[t.fontName];a.vertical&&(n+=Math.PI/2);let o=r(this,od)&&a.fontSubstitution||a.fontFamily;o=Mt.fontFamilyMap.get(o)||o;const l=Math.hypot(s[2],s[3]),c=l*p(v=Mt,hi,zy).call(v,o,a,r(this,Ea));let d,u;n===0?(d=s[4],u=s[5]-c):(d=s[4]+c*Math.sin(n),u=s[5]-c*Math.cos(n));const g="calc(var(--total-scale-factor) *",b=e.style;r(this,De)===r(this,yl)?(b.left="".concat((100*d/r(this,hd)).toFixed(2),"%"),b.top="".concat((100*u/r(this,ld)).toFixed(2),"%")):(b.left="".concat(g).concat(d.toFixed(2),"px)"),b.top="".concat(g).concat(u.toFixed(2),"px)")),b.fontSize="".concat(g).concat((r(Mt,Zn)*l).toFixed(2),"px)"),b.fontFamily=o,i.fontSize=l,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,r(this,od)&&(e.dataset.fontName=a.fontSubstitutionLoadedName||t.fontName),n!==0&&(i.angle=n*(180/Math.PI));let w=!1;if(t.str.length>1)w=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const y=Math.abs(t.transform[0]),A=Math.abs(t.transform[3]);y!==A&&Math.max(y,A)/Math.min(y,A)>1.5&&(w=!0)}if(w&&(i.canvasWidth=a.vertical?t.height:t.width),r(this,dd).set(e,i),r(this,Us).div=e,r(this,Us).properties=i,p(this,En,Kp).call(this,r(this,Us)),i.hasText&&r(this,De).append(e),i.hasEOL){const y=document.createElement("br");y.setAttribute("role","presentation"),r(this,De).append(y)}},Kp=function(t){var o;const{div:e,properties:i,ctx:s}=t,{style:n}=e;let a="";if(r(Mt,Zn)>1&&(a="scale(".concat(1/r(Mt,Zn),")")),i.canvasWidth!==0&&i.hasText){const{fontFamily:l}=n,{canvasWidth:c,fontSize:d}=i;p(o=Mt,hi,Zp).call(o,s,d*r(this,Kn),l);const{width:u}=s.measureText(e.textContent);u>0&&(a="scaleX(".concat(c*r(this,Kn)/u,") ").concat(a))}i.angle!==0&&(a="rotate(".concat(i.angle,"deg) ").concat(a)),a.length>0&&(n.transform=a)},hi=new WeakSet,mf=function(t=null){let e=r(this,xa).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}),r(this,xa).set(t,e),r(this,fd).set(e,{size:0,family:""})}return e},Zp=function(t,e,i){const s=r(this,fd).get(t);e===s.size&&i===s.family||(t.font="".concat(e,"px ").concat(i),s.size=e,s.family=i)},Wy=function(){if(r(this,Zn)!==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),f(this,Zn,t.getBoundingClientRect().height),t.remove()},zy=function(t,e,i){const s=r(this,Sl).get(t);if(s)return s;const n=p(this,hi,mf).call(this,i);n.canvas.width=n.canvas.height=_w,p(this,hi,Zp).call(this,n,_w,t);const a=n.measureText(""),o=a.fontBoundingBoxAscent,l=Math.abs(a.fontBoundingBoxDescent);n.canvas.width=n.canvas.height=0;let c=.8;return o?c=o/(o+l):(fe.platform.isFirefox&&Z("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)),r(this,Sl).set(t,c),c},m(Mt,hi),m(Mt,Sl,new Map),m(Mt,xa,new Map),m(Mt,fd,new WeakMap),m(Mt,Zn,null),m(Mt,Pl,new Set),Mt);class Ac{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};function s(n){var l;if(!n)return;let a=null;const o=n.name;if(o==="#text")a=n.value;else if(Ac.shouldBuildText(o))(l=n==null?void 0:n.attributes)!=null&&l.textContent?a=n.attributes.textContent:n.value&&(a=n.value);else return;if(a!==null&&e.push({str:a}),!!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 tS=100;function Gy(h={}){var Zb,Qb;typeof h=="string"||h instanceof URL?h={url:h}:(h instanceof ArrayBuffer||ArrayBuffer.isView(h))&&(h={data:h});const t=new Qp,{docId:e}=t,i=h.url?hE(h.url):null,s=h.data?cE(h.data):null,n=h.httpHeaders||null,a=h.withCredentials===!0,o=(Zb=h.password)!=null?Zb:null,l=h.range instanceof Xy?h.range:null,c=Number.isInteger(h.rangeChunkSize)&&h.rangeChunkSize>0?h.rangeChunkSize:2**16;let d=h.worker instanceof Jp?h.worker:null;const u=h.verbosity,g=typeof h.docBaseUrl=="string"&&!Bg(h.docBaseUrl)?h.docBaseUrl:null,b=zu(h.cMapUrl),w=h.cMapPacked!==!1,v=h.CMapReaderFactory||(Ce?wE:cw),y=zu(h.iccUrl),A=zu(h.standardFontDataUrl),E=h.StandardFontDataFactory||(Ce?vE:dw),_=zu(h.wasmUrl),S=h.WasmFactory||(Ce?yE:uw),P=h.stopAtErrors!==!0,x=Number.isInteger(h.maxImageSize)&&h.maxImageSize>-1?h.maxImageSize:-1,T=h.isEvalSupported!==!1,I=typeof h.isOffscreenCanvasSupported=="boolean"?h.isOffscreenCanvasSupported:!Ce,C=typeof h.isImageDecoderSupported=="boolean"?h.isImageDecoderSupported:!Ce&&(fe.platform.isFirefox||!globalThis.chrome),L=Number.isInteger(h.canvasMaxAreaInBytes)?h.canvasMaxAreaInBytes:-1,M=typeof h.disableFontFace=="boolean"?h.disableFontFace:Ce,G=h.fontExtraProperties===!0,W=h.enableXfa===!0,$=h.ownerDocument||globalThis.document,Tt=h.disableRange===!0,V=h.disableStream===!0,N=h.disableAutoFetch===!0,mt=h.pdfBug===!0,At=h.CanvasFactory||(Ce?bE:gE),di=h.FilterFactory||(Ce?mE:pE),Es=h.enableHWA===!0,qt=h.useWasm!==!1,kt=l?l.length:(Qb=h.length)!=null?Qb:NaN,Io=typeof h.useSystemFonts=="boolean"?h.useSystemFonts:!Ce&&!M,Pn=typeof h.useWorkerFetch=="boolean"?h.useWorkerFetch:!!(v===cw&&E===dw&&S===uw&&b&&A&&_&&Bh(b,document.baseURI)&&Bh(A,document.baseURI)&&Bh(_,document.baseURI)),xn=null;U_(u);const It={canvasFactory:new At({ownerDocument:$,enableHWA:Es}),filterFactory:new di({docId:e,ownerDocument:$}),cMapReaderFactory:Pn?null:new v({baseUrl:b,isCompressed:w}),standardFontDataFactory:Pn?null:new E({baseUrl:A}),wasmFactory:Pn?null:new S({baseUrl:_})};d||(d=Jp.create({verbosity:u,port:Mn.workerPort}),t._worker=d);const Lh={docId:e,apiVersion:"5.3.93",data:s,password:o,disableAutoFetch:N,rangeChunkSize:c,length:kt,docBaseUrl:g,enableXfa:W,evaluatorOptions:{maxImageSize:x,disableFontFace:M,ignoreErrors:P,isEvalSupported:T,isOffscreenCanvasSupported:I,isImageDecoderSupported:C,canvasMaxAreaInBytes:L,fontExtraProperties:G,useSystemFonts:Io,useWasm:qt,useWorkerFetch:Pn,cMapUrl:b,iccUrl:y,standardFontDataUrl:A,wasmUrl:_}},g_={ownerDocument:$,pdfBug:mt,styleElement:xn,loadingParams:{disableAutoFetch:N,enableXfa:W}};return d.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const p_=d.messageHandler.sendWithPromise("GetDocRequest",Lh,s?[s.buffer]:null);let Ug;if(l)Ug=new FE(l,{disableRange:Tt,disableStream:V});else if(!s){if(!i)throw new Error("getDocument - no `url` parameter provided.");const Wg=Bh(i)?HE:Ce?KE:zE;Ug=new Wg({url:i,length:kt,httpHeaders:n,withCredentials:a,rangeChunkSize:c,disableRange:Tt,disableStream:V})}return p_.then(Wg=>{if(t.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const Jb=new Uh(e,Wg,d.port),m_=new sS(Jb,t,Ug,g_,It);t._transport=m_,Jb.send("Ready",null)})}).catch(t._capability.reject),t}var Ag;const _g=class _g{constructor(){k(this,"_capability",Promise.withResolvers());k(this,"_transport",null);k(this,"_worker",null);k(this,"docId","d".concat(se(_g,Ag)._++));k(this,"destroyed",!1);k(this,"onPassword",null);k(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()}};Ag=new WeakMap,m(_g,Ag,0);let Qp=_g;var Ca,gd,pd,md,bd,Rv;let Xy=(Rv=class{constructor(t,e,i=!1,s=null){m(this,Ca,Promise.withResolvers());m(this,gd,[]);m(this,pd,[]);m(this,md,[]);m(this,bd,[]);this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=s}addRangeListener(t){r(this,bd).push(t)}addProgressListener(t){r(this,md).push(t)}addProgressiveReadListener(t){r(this,pd).push(t)}addProgressiveDoneListener(t){r(this,gd).push(t)}onDataRange(t,e){for(const i of r(this,bd))i(t,e)}onDataProgress(t,e){r(this,Ca).promise.then(()=>{for(const i of r(this,md))i(t,e)})}onDataProgressiveRead(t){r(this,Ca).promise.then(()=>{for(const e of r(this,pd))e(t)})}onDataProgressiveDone(){r(this,Ca).promise.then(()=>{for(const t of r(this,gd))t()})}transportReady(){r(this,Ca).resolve()}requestDataRange(t,e){gt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},Ca=new WeakMap,gd=new WeakMap,pd=new WeakMap,md=new WeakMap,bd=new WeakMap,Rv);class eS{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 nt(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 Ws,Ta,qh;class iS{constructor(t,e,i,s=!1){m(this,Ta);m(this,Ws,!1);this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=s?new ow:null,this._pdfBug=s,this.commonObjs=i.commonObjs,this.objs=new jy,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 Hu({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 nt(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,viewport:e,intent:i="display",annotationMode:s=vs.ENABLE,transform:n=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:d=null,isEditing:u=!1}){var S,P;(S=this._stats)==null||S.time("Overall");const g=this._transport.getRenderingIntent(i,s,d,u),{renderingIntent:b,cacheKey:w}=g;f(this,Ws,!1),o||(o=this._transport.getOptionalContentConfig(b));let v=this._intentStates.get(w);v||(v=Object.create(null),this._intentStates.set(w,v)),v.streamReaderCancelTimeout&&(clearTimeout(v.streamReaderCancelTimeout),v.streamReaderCancelTimeout=null);const y=!!(b&si.PRINT);v.displayReadyCapability||(v.displayReadyCapability=Promise.withResolvers(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(P=this._stats)==null||P.time("Page Request"),this._pumpOperatorList(g));const A=x=>{var T;v.renderTasks.delete(E),y&&f(this,Ws,!0),p(this,Ta,qh).call(this),x?(E.capability.reject(x),this._abortOperatorList({intentState:v,reason:x instanceof Error?x:new Error(x)})):E.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(T=globalThis.Stats)!=null&&T.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},E=new tm({callback:A,params:{canvasContext:t,viewport:e,transform:n,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:c});(v.renderTasks||(v.renderTasks=new Set)).add(E);const _=E.task;return Promise.all([v.displayReadyCapability.promise,o]).then(([x,T])=>{var I;if(this.destroyed){A();return}if((I=this._stats)==null||I.time("Rendering"),!(T.renderingIntent&b))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");E.initializeGraphics({transparency:x,optionalContentConfig:T}),E.operatorListChanged()}).catch(A),_}getOperatorList({intent:t="display",annotationMode:e=vs.ENABLE,printAnnotationStorage:i=null,isEditing:s=!1}={}){var c;function n(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const a=this._transport.getRenderingIntent(t,e,i,s,!0);let o=this._intentStates.get(a.cacheKey);o||(o=Object.create(null),this._intentStates.set(a.cacheKey,o));let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=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(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:e===!0},{highWaterMark:100,size(s){return s.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Ac.textContent(i));const e=this.streamTextContent(t);return new Promise(function(i,s){function n(){a.read().then(function({value:l,done:c}){var d;if(c){i(o);return}(d=o.lang)!=null||(o.lang=l.lang),Object.assign(o.styles,l.styles),o.items.push(...l.items),n()},s)}const a=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(),f(this,Ws,!1),Promise.all(t)}cleanup(t=!1){f(this,Ws,!0);const e=p(this,Ta,qh).call(this);return t&&e&&this._stats&&(this._stats=new ow),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&&p(this,Ta,qh).call(this)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i,modifiedIds:s}){const{map:n,transfer:a}=i,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:n,modifiedIds:s},a).getReader(),c=this._intentStates.get(e);c.streamReader=l;const d=()=>{l.read().then(({value:u,done:g})=>{if(g){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(u,c),d())},u=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const g of c.renderTasks)g.operatorListChanged();p(this,Ta,qh).call(this)}if(c.displayReadyCapability)c.displayReadyCapability.reject(u);else if(c.opListReadCapability)c.opListReadCapability.reject(u);else throw u}})};d()}_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 Ih){let s=tS;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 Fr(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}}Ws=new WeakMap,Ta=new WeakSet,qh=function(){if(!r(this,Ws)||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(),f(this,Ws,!1),!0};var Qn,Ti,zs,Ia,bt,Eg,La,Ra,Le,bf,qy,Yy,Yh,xl,wf;let Jp=(bt=class{constructor({name:t=null,port:e=null,verbosity:i=W_()}={}){m(this,Le);m(this,Qn,Promise.withResolvers());m(this,Ti,null);m(this,zs,null);m(this,Ia,null);if(this.name=t,this.destroyed=!1,this.verbosity=i,e){if(r(bt,Ra).has(e))throw new Error("Cannot use more than one PDFWorker per port.");r(bt,Ra).set(e,this),p(this,Le,qy).call(this,e)}else p(this,Le,Yy).call(this)}get promise(){return r(this,Qn).promise}get port(){return r(this,zs)}get messageHandler(){return r(this,Ti)}destroy(){var t,e;this.destroyed=!0,(t=r(this,Ia))==null||t.terminate(),f(this,Ia,null),r(bt,Ra).delete(r(this,zs)),f(this,zs,null),(e=r(this,Ti))==null||e.destroy(),f(this,Ti,null)}static create(t){const e=r(this,Ra).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 bt(t)}static get workerSrc(){if(Mn.workerSrc)return Mn.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return nt(this,"_setupFakeWorkerGlobal",(async()=>r(this,xl,wf)?r(this,xl,wf):(await import(this.workerSrc)).WorkerMessageHandler)())}},Qn=new WeakMap,Ti=new WeakMap,zs=new WeakMap,Ia=new WeakMap,Eg=new WeakMap,La=new WeakMap,Ra=new WeakMap,Le=new WeakSet,bf=function(){r(this,Qn).resolve(),r(this,Ti).send("configure",{verbosity:this.verbosity})},qy=function(t){f(this,zs,t),f(this,Ti,new Uh("main","worker",t)),r(this,Ti).on("ready",()=>{}),p(this,Le,bf).call(this)},Yy=function(){if(r(bt,La)||r(bt,xl,wf)){p(this,Le,Yh).call(this);return}let{workerSrc:t}=bt;try{bt._isSameOrigin(window.location,t)||(t=bt._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new Uh("main","worker",e),s=()=>{n.abort(),i.destroy(),e.terminate(),this.destroyed?r(this,Qn).reject(new Error("Worker was destroyed")):p(this,Le,Yh).call(this)},n=new AbortController;e.addEventListener("error",()=>{r(this,Ia)||s()},{signal:n.signal}),i.on("test",o=>{if(n.abort(),this.destroyed||!o){s();return}f(this,Ti,i),f(this,zs,e),f(this,Ia,e),p(this,Le,bf).call(this)}),i.on("ready",o=>{if(n.abort(),this.destroyed){s();return}try{a()}catch(l){p(this,Le,Yh).call(this)}});const a=()=>{const o=new Uint8Array;i.send("test",o,[o.buffer])};a();return}catch(e){Og("The worker has been disabled.")}p(this,Le,Yh).call(this)},Yh=function(){r(bt,La)||(Z("Setting up fake worker."),f(bt,La,!0)),bt._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){r(this,Qn).reject(new Error("Worker was destroyed"));return}const e=new fE;f(this,zs,e);const i="fake".concat(se(bt,Eg)._++),s=new Uh(i+"_worker",i,e);t.setup(s,e),f(this,Ti,new Uh(i,i+"_worker",e)),p(this,Le,bf).call(this)}).catch(t=>{r(this,Qn).reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))})},xl=new WeakSet,wf=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch(e){return null}},m(bt,xl),m(bt,Eg,0),m(bt,La,!1),m(bt,Ra,new WeakMap),Ce&&(f(bt,La,!0),Mn.workerSrc||(Mn.workerSrc="./pdf.worker.mjs")),bt._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},bt._createCDNWrapper=t=>{const e='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},bt.fromPort=t=>{if(eE("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!(t!=null&&t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return bt.create(t)},bt);var Gs,as,Cl,Tl,Xs,Ma,Kh;class sS{constructor(t,e,i,s,n){m(this,Ma);m(this,Gs,new Map);m(this,as,new Map);m(this,Cl,new Map);m(this,Tl,new Map);m(this,Xs,null);this.messageHandler=t,this.loadingTask=e,this.commonObjs=new jy,this.fontLoader=new oE({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.setupMessageHandler()}get annotationStorage(){return nt(this,"annotationStorage",new Db)}getRenderingIntent(t,e=vs.ENABLE,i=null,s=!1,n=!1){let a=si.DISPLAY,o=Bp;switch(t){case"any":a=si.ANY;break;case"display":break;case"print":a=si.PRINT;break;default:Z("getRenderingIntent - invalid intent: ".concat(t))}const l=a&si.PRINT&&i instanceof Py?i:this.annotationStorage;switch(e){case vs.DISABLE:a+=si.ANNOTATIONS_DISABLE;break;case vs.ENABLE:break;case vs.ENABLE_FORMS:a+=si.ANNOTATIONS_FORMS;break;case vs.ENABLE_STORAGE:a+=si.ANNOTATIONS_STORAGE,o=l.serializable;break;default:Z("getRenderingIntent - invalid annotationMode: ".concat(e))}s&&(a+=si.IS_EDITING),n&&(a+=si.OPLIST);const{ids:c,hash:d}=l.modifiedIds,u=[a,o.hash,d];return{renderingIntent:a,cacheKey:u.join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){var i;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(i=r(this,Xs))==null||i.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const s of r(this,as).values())t.push(s._destroy());r(this,as).clear(),r(this,Cl).clear(),r(this,Tl).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(),r(this,Gs).clear(),this.filterFactory.destroy(),Yp.cleanup(),(s=this._networkStream)==null||s.cancelAllRequests(new Fr("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)=>{Ht(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:a}){if(a){s.close();return}Ht(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(a=>{if(!this.destroyed)throw a})}}),t.on("ReaderHeadersReady",async i=>{var o;await this._fullReader.headersReady;const{isStreamingSupported:s,isRangeSupported:n,contentLength:a}=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:a}}),t.on("GetRangeReader",(i,s)=>{Ht(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:a,done:o}){if(o){s.close();return}Ht(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{s.error(a)})},s.onCancel=a=>{n.cancel(a),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 eS(i,this))}),t.on("DocException",i=>{e._capability.reject(Me(i))}),t.on("PasswordRequest",i=>{f(this,Xs,Promise.withResolvers());try{if(!e.onPassword)throw Me(i);const s=n=>{n instanceof Error?r(this,Xs).reject(n):r(this,Xs).resolve({password:n})};e.onPassword(s,i.code)}catch(s){r(this,Xs).reject(s)}return r(this,Xs).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;r(this,as).get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),t.on("commonobj",([i,s,n])=>{var a;if(this.destroyed||this.commonObjs.has(i))return null;switch(s){case"Font":if("error"in n){const d=n.error;Z("Error during font loading: ".concat(d)),this.commonObjs.resolve(i,d);break}const o=this._params.pdfBug&&((a=globalThis.FontInspector)!=null&&a.enabled)?(d,u)=>globalThis.FontInspector.fontAdded(d,u):null,l=new lE(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;Ht(c,"The imageRef must be defined.");for(const d of r(this,as).values())for(const[,u]of d.objs)if((u==null?void 0:u.ref)===c)return u.dataLen?(this.commonObjs.resolve(i,structuredClone(u)),u.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,a])=>{var l;if(this.destroyed)return;const o=r(this,as).get(s);if(!o.objs.has(i)){if(o._intentStates.size===0){(l=a==null?void 0:a.bitmap)==null||l.close();return}switch(n){case"Image":case"Pattern":o.objs.resolve(i,a);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&&Z("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=r(this,Cl).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&&r(this,Tl).set(n.refStr,t);const a=new iS(e,n,this,this._params.pdfBug);return r(this,as).set(e,a),a});return r(this,Cl).set(e,s),s}getPageIndex(t){return Vp(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 p(this,Ma,Kh).call(this,"GetFieldObjects")}hasJSActions(){return p(this,Ma,Kh).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 p(this,Ma,Kh).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 p(this,Ma,Kh).call(this,"GetOptionalContentConfig").then(e=>new NE(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=r(this,Gs).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(s=>{var n,a,o,l;return{info:s[0],metadata:s[1]?new kE(s[1]):null,contentDispositionFilename:(a=(n=this._fullReader)==null?void 0:n.filename)!=null?a:null,contentLength:(l=(o=this._fullReader)==null?void 0:o.contentLength)!=null?l:null}});return r(this,Gs).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 r(this,as).values())if(!e.cleanup())throw new Error("startCleanup: Page ".concat(e.pageNumber," is currently rendering."));this.commonObjs.clear(),t||this.fontLoader.clear(),r(this,Gs).clear(),this.filterFactory.destroy(!0),Yp.cleanup()}}cachedPageNumber(t){var i;if(!Vp(t))return null;const e=t.gen===0?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return(i=r(this,Tl).get(e))!=null?i:null}}Gs=new WeakMap,as=new WeakMap,Cl=new WeakMap,Tl=new WeakMap,Xs=new WeakMap,Ma=new WeakSet,Kh=function(t,e=null){const i=r(this,Gs).get(t);if(i)return i;const s=this.messageHandler.sendWithPromise(t,e);return r(this,Gs).set(t,s),s};var Jn;class nS{constructor(t){m(this,Jn,null);k(this,"onContinue",null);k(this,"onError",null);f(this,Jn,t)}get promise(){return r(this,Jn).capability.promise}cancel(t=0){r(this,Jn).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=r(this,Jn).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=r(this,Jn);return t.form||t.canvas&&(e==null?void 0:e.size)>0}}Jn=new WeakMap;var tr,ka;const Qr=class Qr{constructor({callback:t,params:e,objs:i,commonObjs:s,annotationCanvasMap:n,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:u=!1,pageColors:g=null}){m(this,tr,null);this.callback=t,this.params=e,this.objs=i,this.commonObjs=s,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=u,this.pageColors=g,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=d===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new nS(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){var o,l;if(this.cancelled)return;if(this._canvas){if(r(Qr,ka).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.");r(Qr,ka).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{canvasContext:i,viewport:s,transform:n,background:a}=this.params;this.gfx=new Xo(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:n,viewport:s,transparency:t,background:a}),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(),r(this,tr)&&(window.cancelAnimationFrame(r(this,tr)),f(this,tr,null)),r(Qr,ka).delete(this._canvas),t||(t=new Ih("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?f(this,tr,window.requestAnimationFrame(()=>{f(this,tr,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(),r(Qr,ka).delete(this._canvas),this.callback())))}};tr=new WeakMap,ka=new WeakMap,m(Qr,ka,new WeakSet);let tm=Qr;const rS="5.3.93",aS="cbeef3233";function Ew(h){return Math.floor(Math.max(0,Math.min(1,h))*255).toString(16).padStart(2,"0")}function kh(h){return Math.max(0,Math.min(255,255*h))}class Sw{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=kh(t),[t,t,t]}static G_HTML([t]){const e=Ew(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(kh)}static RGB_HTML(t){return"#".concat(t.map(Ew).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[kh(1-Math.min(1,t+s)),kh(1-Math.min(1,i+s)),kh(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,a=1-i,o=Math.min(s,n,a);return["CMYK",s,n,a,o]}}class oS{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){gt("Abstract method `_createSVG` called.")}}let ng=class extends oS{_createSVG(t){return document.createElementNS(Ss,t)}},Ky=class{static setupStorage(t,e,i,s,n){const a=s.getValue(e,{value:null});switch(i.name){case"textarea":if(a.value!==null&&(t.textContent=a.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(a.value===i.attributes.xfaOn?t.setAttribute("checked",!0):a.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(a.value!==null&&t.setAttribute("value",a.value),n==="print")break;t.addEventListener("input",o=>{s.setValue(e,{value:o.target.value})})}break;case"select":if(a.value!==null){t.setAttribute("value",a.value);for(const o of i.children)o.attributes.value===a.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}t.addEventListener("input",o=>{const l=o.target.options,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:a}=e,o=t instanceof HTMLAnchorElement;a.type==="radio"&&(a.name="".concat(a.name,"-").concat(s));for(const[l,c]of Object.entries(a))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,a.href,a.newWindow),i&&a.dataId&&this.setupStorage(t,a.dataId,e,i)}static render(t){var u,g;const e=t.annotationStorage,i=t.linkService,s=t.xfaHtml,n=t.intent||"display",a=document.createElement(s.name);s.attributes&&this.setAttributes({html:a,element:s,intent:n,linkService:i});const o=n!=="richText",l=t.div;if(l.append(a),t.viewport){const b="matrix(".concat(t.viewport.transform.join(","),")");l.style.transform=b}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(s.children.length===0){if(s.value){const b=document.createTextNode(s.value);a.append(b),o&&Ac.shouldBuildText(s.name)&&c.push(b)}return{textDivs:c}}const d=[[s,-1,a]];for(;d.length>0;){const[b,w,v]=d.at(-1);if(w+1===b.children.length){d.pop();continue}const y=b.children[++d.at(-1)[1]];if(y===null)continue;const{name:A}=y;if(A==="#text"){const _=document.createTextNode(y.value);c.push(_),v.append(_);continue}const E=(u=y==null?void 0:y.attributes)!=null&&u.xmlns?document.createElementNS(y.attributes.xmlns,A):document.createElement(A);if(v.append(E),y.attributes&&this.setAttributes({html:E,element:y,storage:e,intent:n,linkService:i}),((g=y.children)==null?void 0:g.length)>0)d.push([y,-1,E]);else if(y.value){const _=document.createTextNode(y.value);o&&Ac.shouldBuildText(A)&&c.push(_),E.append(_)}}for(const b of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))b.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 lS=9,Po=new WeakSet;class Pw{static create(t){switch(t.data.annotationType){case Bt.LINK:return new Zy(t);case Bt.TEXT:return new hS(t);case Bt.WIDGET:switch(t.data.fieldType){case"Tx":return new cS(t);case"Btn":return t.data.radioButton?new tA(t):t.data.checkBox?new uS(t):new fS(t);case"Ch":return new gS(t);case"Sig":return new dS(t)}return new To(t);case Bt.POPUP:return new im(t);case Bt.FREETEXT:return new rA(t);case Bt.LINE:return new mS(t);case Bt.SQUARE:return new bS(t);case Bt.CIRCLE:return new wS(t);case Bt.POLYLINE:return new aA(t);case Bt.CARET:return new yS(t);case Bt.INK:return new Ob(t);case Bt.POLYGON:return new vS(t);case Bt.HIGHLIGHT:return new oA(t);case Bt.UNDERLINE:return new AS(t);case Bt.SQUIGGLY:return new _S(t);case Bt.STRIKEOUT:return new ES(t);case Bt.STAMP:return new lA(t);case Bt.FILEATTACHMENT:return new SS(t);default:return new Ft(t)}}}var Da,Il,Ll,wd,em;const Kb=class Kb{constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:s=!1}={}){m(this,wd);m(this,Da,null);m(this,Il,!1);m(this,Ll,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 Kb._hasPopupData(this.data)}updateEdited(t){var i;if(!this.container)return;r(this,Da)||f(this,Da,{rect:this.data.rect.slice(0)});const{rect:e}=t;e&&p(this,wd,em).call(this,e),(i=r(this,Ll))==null||i.popup.updateEdited(t)}resetEdited(){var t;r(this,Da)&&(p(this,wd,em).call(this,r(this,Da).rect),(t=r(this,Ll))==null||t.popup.resetEdited(),f(this,Da,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 To||(n.tabIndex=0);const{style:a}=n;if(a.zIndex=this.parent.zIndex++,e.alternativeText&&(n.title=e.alternativeText),e.noRotate&&n.classList.add("norotate"),!e.rect||this instanceof im){const{rotation:v}=e;return!e.hasOwnCanvas&&v!==0&&this.setRotation(v,n),n}const{width:o,height:l}=this;if(!t&&e.borderStyle.width>0){a.borderWidth="".concat(e.borderStyle.width,"px");const v=e.borderStyle.horizontalCornerRadius,y=e.borderStyle.verticalCornerRadius;if(v>0||y>0){const E="calc(".concat(v,"px * var(--total-scale-factor)) / calc(").concat(y,"px * var(--total-scale-factor))");a.borderRadius=E}else if(this instanceof tA){const E="calc(".concat(o,"px * var(--total-scale-factor)) / calc(").concat(l,"px * var(--total-scale-factor))");a.borderRadius=E}switch(e.borderStyle.style){case Lo.SOLID:a.borderStyle="solid";break;case Lo.DASHED:a.borderStyle="dashed";break;case Lo.BEVELED:Z("Unimplemented border style: beveled");break;case Lo.INSET:Z("Unimplemented border style: inset");break;case Lo.UNDERLINE:a.borderBottomStyle="solid";break}const A=e.borderColor||null;A?(f(this,Il,!0),a.borderColor=q.makeHexColor(A[0]|0,A[1]|0,A[2]|0)):a.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:d,pageHeight:u,pageX:g,pageY:b}=s.rawDims;a.left="".concat(100*(c[0]-g)/d,"%"),a.top="".concat(100*(c[1]-b)/u,"%");const{rotation:w}=e;return e.hasOwnCanvas||w===0?(a.width="".concat(100*o/d,"%"),a.height="".concat(100*l/u,"%")):this.setRotation(w,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:a}=this;t%180!==0&&([n,a]=[a,n]),e.style.width="".concat(100*n/i,"%"),e.style.height="".concat(100*a/s,"%"),e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(e,i,s)=>{const n=s.detail[e],a=n[0],o=n.slice(1);s.target.style[i]=Sw["".concat(a,"_HTML")](o),this.annotationStorage.setValue(this.data.id,{[i]:Sw["".concat(a,"_rgb")](o)})};return nt(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 a=i[s];if(a){const o={detail:{[s]:n},target:t};a(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(v=>Math.fround(v));if(t.length===8){const[v,y,A,E]=t.subarray(2,6);if(s===v&&n===y&&e===A&&i===E)return}const{style:a}=this.container;let o;if(r(this,Il)){const{borderColor:v,borderWidth:y}=a;a.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">','<g fill="transparent" stroke="'.concat(v,'" stroke-width="').concat(y,'">')],this.container.classList.add("hasBorder")}const l=s-e,c=n-i,{svgFactory:d}=this,u=d.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0),u.role="none";const g=d.createElement("defs");u.append(g);const b=d.createElement("clipPath"),w="clippath_".concat(this.data.id);b.setAttribute("id",w),b.setAttribute("clipPathUnits","objectBoundingBox"),g.append(b);for(let v=2,y=t.length;v<y;v+=8){const A=t[v],E=t[v+1],_=t[v+2],S=t[v+3],P=d.createElement("rect"),x=(_-e)/l,T=(n-E)/c,I=(A-_)/l,C=(E-S)/c;P.setAttribute("x",x),P.setAttribute("y",T),P.setAttribute("width",I),P.setAttribute("height",C),b.append(P),o==null||o.push('<rect vector-effect="non-scaling-stroke" x="'.concat(x,'" y="').concat(T,'" width="').concat(I,'" height="').concat(C,'"/>'))}r(this,Il)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(u),this.container.style.clipPath="url(#".concat(w,")")}_createPopup(){const{data:t}=this,e=f(this,Ll,new im({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:"popup_".concat(t.id),rotation:t.rotation,noRotate:!0},parent:this.parent,elements:[this]}));this.parent.div.append(e.render())}render(){gt("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:a,exportValues:o}of s){if(n===-1||a===e)continue;const l=typeof o=="string"?o:null,c=document.querySelector('[data-element-id="'.concat(a,'"]'));if(c&&!Po.has(c)){Z("_getElementsByName - element not allowed: ".concat(a));continue}i.push({id:a,exportValue:l,domElement:c})}return i}for(const s of document.getElementsByName(t)){const{exportValue:n}=s,a=s.getAttribute("data-element-id");a!==e&&Po.has(s)&&i.push({id:a,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]}};Da=new WeakMap,Il=new WeakMap,Ll=new WeakMap,wd=new WeakSet,em=function(t){const{container:{style:e},data:{rect:i,rotation:s},parent:{viewport:{rawDims:{pageWidth:n,pageHeight:a,pageX:o,pageY:l}}}}=this;i==null||i.splice(0,4,...t),e.left="".concat(100*(t[0]-o)/n,"%"),e.top="".concat(100*(a-t[3]+l)/a,"%"),s===0?(e.width="".concat(100*(t[2]-t[0])/n,"%"),e.height="".concat(100*(t[3]-t[1])/a,"%")):this.setRotation(s)};let Ft=Kb;var oi,Ur,Qy,Jy;class Zy extends Ft{constructor(e,i=null){super(e,{isRenderable:!0,ignoreBorder:!!(i!=null&&i.ignoreBorder),createQuadrilaterals:!0});m(this,oi);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),n=!0):e.attachment?(p(this,oi,Qy).call(this,s,e.attachment,e.attachmentDest),n=!0):e.setOCGState?(p(this,oi,Jy).call(this,s,e.setOCGState),n=!0):e.dest?(this._bindLink(s,e.dest),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){e.href=this.linkService.getDestinationHash(i),e.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&p(this,oi,Ur).call(this)}_bindNamedAction(e,i){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(i),!1),p(this,oi,Ur).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 a=s.get(n);a&&(e[a]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:n}}),!1})}e.onclick||(e.onclick=()=>!1),p(this,oi,Ur).call(this)}_bindResetFormAction(e,i){const s=e.onclick;if(s||(e.href=this.linkService.getAnchorUrl("")),p(this,oi,Ur).call(this),!this._fieldObjects){Z('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),s||(e.onclick=()=>!1);return}e.onclick=()=>{var u;s==null||s();const{fields:n,refs:a,include:o}=i,l=[];if(n.length!==0||a.length!==0){const g=new Set(a);for(const b of n){const w=this._fieldObjects[b]||[];for(const{id:v}of w)g.add(v)}for(const b of Object.values(this._fieldObjects))for(const w of b)g.has(w.id)===o&&l.push(w)}else for(const g of Object.values(this._fieldObjects))l.push(...g);const c=this.annotationStorage,d=[];for(const g of l){const{id:b}=g;switch(d.push(b),g.type){case"text":{const v=g.defaultValue||"";c.setValue(b,{value:v});break}case"checkbox":case"radiobutton":{const v=g.defaultValue===g.exportValues;c.setValue(b,{value:v});break}case"combobox":case"listbox":{const v=g.defaultValue||"";c.setValue(b,{value:v});break}default:continue}const w=document.querySelector('[data-element-id="'.concat(b,'"]'));if(w){if(!Po.has(w)){Z("_bindResetFormAction - element not allowed: ".concat(b));continue}}else continue;w.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((u=this.linkService.eventBus)==null||u.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:d,name:"ResetForm"}})),!1}}}oi=new WeakSet,Ur=function(){this.container.setAttribute("data-internal-link","")},Qy=function(e,i,s=null){e.href=this.linkService.getAnchorUrl(""),i.description&&(e.title=i.description),e.onclick=()=>{var n;return(n=this.downloadManager)==null||n.openOrDownloadData(i.content,i.filename,s),!1},p(this,oi,Ur).call(this)},Jy=function(e,i){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(i),!1),p(this,oi,Ur).call(this)};class hS extends Ft{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 To extends Ft{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 fe.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,s,n){i.includes("mouse")?t.addEventListener(i,a=>{var o;(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):t.addEventListener(i,a=>{var o;if(i==="blur"){if(!e.focused||!a.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(a)}}))})}_setEventListeners(t,e,i,s){var n,a,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"&&!((a=this.data.actions)!=null&&a.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||lS,n=t.style;let a;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),d=Math.round(c/(qg*s))||1,u=c/d;a=Math.min(s,l(u/qg))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(s,l(c/qg))}n.fontSize="calc(".concat(a,"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 cS extends To{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 a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=i),n.setValue(a.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 a=t.getValue(e,{value:this.data.fieldValue});let o=a.value||"";const l=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;l&&o.length>l&&(o=o.slice(0,l));let c=a.formattedValue||((s=this.data.textContent)==null?void 0:s.join("\n"))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const d={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),Po.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const u=this.data.dateFormat||this.data.timeFormat;u&&(i.title=u),this._setRequired(i,this.data.required),l&&(i.maxLength=l),i.addEventListener("input",b=>{t.setValue(e,{value:b.target.value}),this.setPropertyOnSiblings(i,"value",b.target.value,"value"),d.formattedValue=null}),i.addEventListener("resetform",b=>{var v;const w=(v=this.data.defaultFieldValue)!=null?v:"";i.value=d.userValue=w,d.formattedValue=null});let g=b=>{const{formattedValue:w}=d;w!=null&&(b.target.value=w),b.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",w=>{var y;if(d.focused)return;const{target:v}=w;d.userValue&&(v.value=d.userValue),d.lastCommittedValue=v.value,d.commitKey=1,(y=this.data.actions)!=null&&y.Focus||(d.focused=!0)}),i.addEventListener("updatefromsandbox",w=>{this.showElementAndHideCanvas(w.target);const v={value(y){var A;d.userValue=(A=y.detail.value)!=null?A:"",t.setValue(e,{value:d.userValue.toString()}),y.target.value=d.userValue},formattedValue(y){const{formattedValue:A}=y.detail;d.formattedValue=A,A!=null&&y.target!==document.activeElement&&(y.target.value=A),t.setValue(e,{formattedValue:A})},selRange(y){y.target.setSelectionRange(...y.detail.selRange)},charLimit:y=>{var S;const{charLimit:A}=y.detail,{target:E}=y;if(A===0){E.removeAttribute("maxLength");return}E.setAttribute("maxLength",A);let _=d.userValue;!_||_.length<=A||(_=_.slice(0,A),E.value=d.userValue=_,t.setValue(e,{value:_}),(S=this.linkService.eventBus)==null||S.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:_,willCommit:!0,commitKey:1,selStart:E.selectionStart,selEnd:E.selectionEnd}}))}};this._dispatchEventFromSandbox(v,w)}),i.addEventListener("keydown",w=>{var A;d.commitKey=1;let v=-1;if(w.key==="Escape"?v=0:w.key==="Enter"&&!this.data.multiLine?v=2:w.key==="Tab"&&(d.commitKey=3),v===-1)return;const{value:y}=w.target;d.lastCommittedValue!==y&&(d.lastCommittedValue=y,d.userValue=y,(A=this.linkService.eventBus)==null||A.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:y,willCommit:!0,commitKey:v,selStart:w.target.selectionStart,selEnd:w.target.selectionEnd}}))});const b=g;g=null,i.addEventListener("blur",w=>{var y,A;if(!d.focused||!w.relatedTarget)return;(y=this.data.actions)!=null&&y.Blur||(d.focused=!1);const{value:v}=w.target;d.userValue=v,d.lastCommittedValue!==v&&((A=this.linkService.eventBus)==null||A.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:v,willCommit:!0,commitKey:d.commitKey,selStart:w.target.selectionStart,selEnd:w.target.selectionEnd}})),b(w)}),(n=this.data.actions)!=null&&n.Keystroke&&i.addEventListener("beforeinput",w=>{var x;d.lastCommittedValue=null;const{data:v,target:y}=w,{value:A,selectionStart:E,selectionEnd:_}=y;let S=E,P=_;switch(w.inputType){case"deleteWordBackward":{const T=A.substring(0,E).match(/\w*[^\w]*$/);T&&(S-=T[0].length);break}case"deleteWordForward":{const T=A.substring(E).match(/^[^\w]*\w*/);T&&(P+=T[0].length);break}case"deleteContentBackward":E===_&&(S-=1);break;case"deleteContentForward":E===_&&(P+=1);break}w.preventDefault(),(x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:A,change:v||"",willCommit:!1,selStart:S,selEnd:P}})}),this._setEventListeners(i,d,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],w=>w.target.value)}if(g&&i.addEventListener("blur",g),this.data.comb){const w=(this.data.rect[2]-this.data.rect[0])/l;i.classList.add("comb"),i.style.letterSpacing="calc(".concat(w,"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 dS extends To{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class uS extends To{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 Po.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",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,i)){const d=l&&c.exportValue===e.exportValue;c.domElement&&(c.domElement.checked=d),t.setValue(c.id,{value:d})}t.setValue(i,{value:l})}),n.addEventListener("resetform",a=>{const o=e.defaultFieldValue||"Off";a.target.checked=o===e.exportValue}),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",a=>{const o={value(l){l.target.checked=l.detail.value!=="Off",t.setValue(i,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class tA extends To{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 a of this._getElementsByName(e.fieldName,i))t.setValue(a.id,{value:!1});const n=document.createElement("input");if(Po.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",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,i))t.setValue(c.id,{value:!1});t.setValue(i,{value:l})}),n.addEventListener("resetform",a=>{const o=e.defaultFieldValue;a.target.checked=o!=null&&o===e.buttonValue}),this.enableScripting&&this.hasJSActions){const a=e.buttonValue;n.addEventListener("updatefromsandbox",o=>{const l={value:c=>{const d=a===c.detail.value;for(const u of this._getElementsByName(c.target.name)){const g=d&&u.id===i;u.domElement&&(u.domElement.checked=g),t.setValue(u.id,{value:g})}}};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 fS extends Zy{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 gS extends To{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");Po.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",d=>{const u=this.data.defaultFieldValue;for(const g of s.options)g.selected=g.value===u});for(const d of this.data.options){const u=document.createElement("option");u.textContent=d.displayValue,u.value=d.exportValue,i.value.includes(d.exportValue)&&(u.setAttribute("selected",!0),n=!1),s.append(u)}let a=null;if(n){const d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),s.prepend(d),a=()=>{d.remove(),s.removeEventListener("input",a),a=null},s.addEventListener("input",a)}const o=d=>{const u=d?"value":"textContent",{options:g,multiple:b}=s;return b?Array.prototype.filter.call(g,w=>w.selected).map(w=>w[u]):g.selectedIndex===-1?null:g[g.selectedIndex][u]};let l=o(!1);const c=d=>{const u=d.target.options;return Array.prototype.map.call(u,g=>({displayValue:g.textContent,exportValue:g.value}))};return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",d=>{const u={value(g){a==null||a();const b=g.detail.value,w=new Set(Array.isArray(b)?b:[b]);for(const v of s.options)v.selected=w.has(v.value);t.setValue(e,{value:o(!0)}),l=o(!1)},multipleSelection(g){s.multiple=!0},remove(g){const b=s.options,w=g.detail.remove;b[w].selected=!1,s.remove(w),b.length>0&&Array.prototype.findIndex.call(b,y=>y.selected)===-1&&(b[0].selected=!0),t.setValue(e,{value:o(!0),items:c(g)}),l=o(!1)},clear(g){for(;s.length!==0;)s.remove(0);t.setValue(e,{value:null,items:[]}),l=o(!1)},insert(g){const{index:b,displayValue:w,exportValue:v}=g.detail.insert,y=s.children[b],A=document.createElement("option");A.textContent=w,A.value=v,y?y.before(A):s.append(A),t.setValue(e,{value:o(!0),items:c(g)}),l=o(!1)},items(g){const{items:b}=g.detail;for(;s.length!==0;)s.remove(0);for(const w of b){const{displayValue:v,exportValue:y}=w,A=document.createElement("option");A.textContent=v,A.value=y,s.append(A)}s.options.length>0&&(s.options[0].selected=!0),t.setValue(e,{value:o(!0),items:c(g)}),l=o(!1)},indices(g){const b=new Set(g.detail.indices);for(const w of g.target.options)w.selected=b.has(w.index);t.setValue(e,{value:o(!0)}),l=o(!1)},editable(g){g.target.disabled=!g.detail.editable}};this._dispatchEventFromSandbox(u,d)}),s.addEventListener("input",d=>{var b;const u=o(!0),g=o(!1);t.setValue(e,{value:u}),d.preventDefault(),(b=this.linkService.eventBus)==null||b.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:l,change:g,changeEx:u,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"]],d=>d.target.value)):s.addEventListener("input",function(d){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 im extends Ft{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:Ft._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 pS({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),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(Rb).concat(s)).join(",")),this.container}}var Rl,Sg,Pg,Ml,kl,Lt,qs,Na,vd,yd,Dl,Ys,Ii,Ks,Ad,Zs,_d,Fa,Oa,pt,vf,sm,eA,iA,sA,nA,yf,Af,nm;class pS{constructor({container:t,color:e,elements:i,titleObj:s,modificationDate:n,contentsObj:a,richText:o,parent:l,rect:c,parentRect:d,open:u}){m(this,pt);m(this,Rl,p(this,pt,sA).bind(this));m(this,Sg,p(this,pt,nm).bind(this));m(this,Pg,p(this,pt,Af).bind(this));m(this,Ml,p(this,pt,yf).bind(this));m(this,kl,null);m(this,Lt,null);m(this,qs,null);m(this,Na,null);m(this,vd,null);m(this,yd,null);m(this,Dl,null);m(this,Ys,!1);m(this,Ii,null);m(this,Ks,null);m(this,Ad,null);m(this,Zs,null);m(this,_d,null);m(this,Fa,null);m(this,Oa,!1);var g;f(this,Lt,t),f(this,_d,s),f(this,qs,a),f(this,Zs,o),f(this,yd,l),f(this,kl,e),f(this,Ad,c),f(this,Dl,d),f(this,vd,i),f(this,Na,ig.toDateObject(n)),this.trigger=i.flatMap(b=>b.getElementsToTriggerPopup());for(const b of this.trigger)b.addEventListener("click",r(this,Ml)),b.addEventListener("mouseenter",r(this,Pg)),b.addEventListener("mouseleave",r(this,Sg)),b.classList.add("popupTriggerArea");for(const b of i)(g=b.container)==null||g.addEventListener("keydown",r(this,Rl));r(this,Lt).hidden=!0,u&&p(this,pt,yf).call(this)}render(){if(r(this,Ii))return;const t=f(this,Ii,document.createElement("div"));if(t.className="popup",r(this,kl)){const n=t.style.outlineColor=q.makeHexColor(...r(this,kl));t.style.backgroundColor="color-mix(in srgb, ".concat(n," 30%, white)")}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),{dir:i.dir,str:i.textContent}=r(this,_d),t.append(e),r(this,Na)){const n=document.createElement("time");n.classList.add("popupDate"),n.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),n.setAttribute("data-l10n-args",JSON.stringify({dateObj:r(this,Na).valueOf()})),n.dateTime=r(this,Na).toISOString(),e.append(n)}const s=r(this,pt,vf);if(s)Ky.render({xfaHtml:s,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const n=this._formatContents(r(this,qs));t.append(n)}r(this,Lt).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,a=s.length;n<a;++n){const o=s[n];i.append(document.createTextNode(o)),n<a-1&&i.append(document.createElement("br"))}return i}updateEdited({rect:t,popupContent:e}){var i;r(this,Fa)||f(this,Fa,{contentsObj:r(this,qs),richText:r(this,Zs)}),t&&f(this,Ks,null),e&&(f(this,Zs,p(this,pt,iA).call(this,e)),f(this,qs,null)),(i=r(this,Ii))==null||i.remove(),f(this,Ii,null)}resetEdited(){var t;r(this,Fa)&&({contentsObj:se(this,qs)._,richText:se(this,Zs)._}=r(this,Fa),f(this,Fa,null),(t=r(this,Ii))==null||t.remove(),f(this,Ii,null),f(this,Ks,null))}forceHide(){f(this,Oa,this.isVisible),r(this,Oa)&&(r(this,Lt).hidden=!0)}maybeShow(){r(this,Oa)&&(r(this,Ii)||p(this,pt,Af).call(this),f(this,Oa,!1),r(this,Lt).hidden=!1)}get isVisible(){return r(this,Lt).hidden===!1}}Rl=new WeakMap,Sg=new WeakMap,Pg=new WeakMap,Ml=new WeakMap,kl=new WeakMap,Lt=new WeakMap,qs=new WeakMap,Na=new WeakMap,vd=new WeakMap,yd=new WeakMap,Dl=new WeakMap,Ys=new WeakMap,Ii=new WeakMap,Ks=new WeakMap,Ad=new WeakMap,Zs=new WeakMap,_d=new WeakMap,Fa=new WeakMap,Oa=new WeakMap,pt=new WeakSet,vf=function(){const t=r(this,Zs),e=r(this,qs);return t!=null&&t.str&&(!(e!=null&&e.str)||e.str===t.str)&&r(this,Zs).html||null},sm=function(){var t,e,i;return((i=(e=(t=r(this,pt,vf))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.fontSize)||0},eA=function(){var t,e,i;return((i=(e=(t=r(this,pt,vf))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.color)||null},iA=function(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},s={style:{color:r(this,pt,eA),fontSize:r(this,pt,sm)?"calc(".concat(r(this,pt,sm),"px * var(--total-scale-factor))"):""}};for(const n of t.split("\n"))e.push({name:"span",value:n,attributes:s});return i},sA=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&r(this,Ys))&&p(this,pt,yf).call(this)},nA=function(){if(r(this,Ks)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:s,pageY:n}}}=r(this,yd);let a=!!r(this,Dl),o=a?r(this,Dl):r(this,Ad);for(const w of r(this,vd))if(!o||q.intersect(w.data.rect,o)!==null){o=w.data.rect,a=!0;break}const l=q.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),d=a?o[2]-o[0]+5:0,u=l[0]+d,g=l[1];f(this,Ks,[100*(u-s)/e,100*(g-n)/i]);const{style:b}=r(this,Lt);b.left="".concat(r(this,Ks)[0],"%"),b.top="".concat(r(this,Ks)[1],"%")},yf=function(){f(this,Ys,!r(this,Ys)),r(this,Ys)?(p(this,pt,Af).call(this),r(this,Lt).addEventListener("click",r(this,Ml)),r(this,Lt).addEventListener("keydown",r(this,Rl))):(p(this,pt,nm).call(this),r(this,Lt).removeEventListener("click",r(this,Ml)),r(this,Lt).removeEventListener("keydown",r(this,Rl)))},Af=function(){r(this,Ii)||this.render(),this.isVisible?r(this,Ys)&&r(this,Lt).classList.add("focused"):(p(this,pt,nA).call(this),r(this,Lt).hidden=!1,r(this,Lt).style.zIndex=parseInt(r(this,Lt).style.zIndex)+1e3)},nm=function(){r(this,Lt).classList.remove("focused"),!(r(this,Ys)||!this.isVisible)&&(r(this,Lt).hidden=!0,r(this,Lt).style.zIndex=parseInt(r(this,Lt).style.zIndex)-1e3)};class rA extends Ft{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Y.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 Ed;class mS extends Ft{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});m(this,Ed,null)}render(){this.container.classList.add("lineAnnotation");const{data:e,width:i,height:s}=this,n=this.svgFactory.create(i,s,!0),a=f(this,Ed,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return r(this,Ed)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ed=new WeakMap;var Sd;class bS extends Ft{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});m(this,Sd,null)}render(){this.container.classList.add("squareAnnotation");const{data:e,width:i,height:s}=this,n=this.svgFactory.create(i,s,!0),a=e.borderStyle.width,o=f(this,Sd,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",i-a),o.setAttribute("height",s-a),o.setAttribute("stroke-width",a||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 r(this,Sd)}addHighlightArea(){this.container.classList.add("highlightArea")}}Sd=new WeakMap;var Pd;class wS extends Ft{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});m(this,Pd,null)}render(){this.container.classList.add("circleAnnotation");const{data:e,width:i,height:s}=this,n=this.svgFactory.create(i,s,!0),a=e.borderStyle.width,o=f(this,Pd,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",i/2),o.setAttribute("cy",s/2),o.setAttribute("rx",i/2-a/2),o.setAttribute("ry",s/2-a/2),o.setAttribute("stroke-width",a||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 r(this,Pd)}addHighlightArea(){this.container.classList.add("highlightArea")}}Pd=new WeakMap;var xd;class aA extends Ft{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});m(this,xd,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:a,height:o}=this;if(!i)return this.container;const l=this.svgFactory.create(a,o,!0);let c=[];for(let u=0,g=i.length;u<g;u+=2){const b=i[u]-e[0],w=e[3]-i[u+1];c.push("".concat(b,",").concat(w))}c=c.join(" ");const d=f(this,xd,this.svgFactory.createElement(this.svgElementName));return d.setAttribute("points",c),d.setAttribute("stroke-width",s.width||1),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),l.append(d),this.container.append(l),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return r(this,xd)}addHighlightArea(){this.container.classList.add("highlightArea")}}xd=new WeakMap;class vS extends aA{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class yS extends Ft{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 Cd,Ba,Td,rm;class Ob extends Ft{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});m(this,Td);m(this,Cd,null);m(this,Ba,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?Y.HIGHLIGHT:Y.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,rotation:i,inkLists:s,borderStyle:n,popupRef:a}}=this,{transform:o,width:l,height:c}=p(this,Td,rm).call(this,i,e),d=this.svgFactory.create(l,c,!0),u=f(this,Cd,this.svgFactory.createElement("svg:g"));d.append(u),u.setAttribute("stroke-width",n.width||1),u.setAttribute("stroke-linecap","round"),u.setAttribute("stroke-linejoin","round"),u.setAttribute("stroke-miterlimit",10),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),u.setAttribute("transform",o);for(let g=0,b=s.length;g<b;g++){const w=this.svgFactory.createElement(this.svgElementName);r(this,Ba).push(w),w.setAttribute("points",s[g].join(",")),u.append(w)}return!a&&this.hasPopupData&&this._createPopup(),this.container.append(d),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);const{thickness:i,points:s,rect:n}=e,a=r(this,Cd);if(i>=0&&a.setAttribute("stroke-width",i||1),s)for(let o=0,l=r(this,Ba).length;o<l;o++)r(this,Ba)[o].setAttribute("points",s[o].join(","));if(n){const{transform:o,width:l,height:c}=p(this,Td,rm).call(this,this.data.rotation,n);a.parentElement.setAttribute("viewBox","0 0 ".concat(l," ").concat(c)),a.setAttribute("transform",o)}}getElementsToTriggerPopup(){return r(this,Ba)}addHighlightArea(){this.container.classList.add("highlightArea")}}Cd=new WeakMap,Ba=new WeakMap,Td=new WeakSet,rm=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 oA extends Ft{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Y.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 AS extends Ft{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 _S extends Ft{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 ES extends Ft{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 lA extends Ft{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Y.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 Id,Ld,am;class SS extends Ft{constructor(e){var s;super(e,{isRenderable:!0});m(this,Ld);m(this,Id,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",p(this,Ld,am).bind(this)),f(this,Id,s);const{isMac:n}=fe.platform;return e.addEventListener("keydown",a=>{a.key==="Enter"&&(n?a.metaKey:a.ctrlKey)&&p(this,Ld,am).call(this)}),!i.popupRef&&this.hasPopupData?this._createPopup():s.classList.add("popupTriggerArea"),e.append(s),e}getElementsToTriggerPopup(){return r(this,Id)}addHighlightArea(){this.container.classList.add("highlightArea")}}Id=new WeakMap,Ld=new WeakSet,am=function(){var e;(e=this.downloadManager)==null||e.openOrDownloadData(this.content,this.filename)};var Rd,Va,er,Md,jr,om,lm,Nl;let PS=(Nl=class{constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:s,page:n,viewport:a,structTreeLayer:o}){m(this,jr);m(this,Rd,null);m(this,Va,null);m(this,er,new Map);m(this,Md,null);this.div=t,f(this,Rd,e),f(this,Va,i),f(this,Md,o||null),this.page=n,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=s}hasEditableAnnotations(){return r(this,er).size>0}async render(t){var a;const{annotations:e}=t,i=this.div;Eo(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 ng,annotationStorage:t.annotationStorage||new Db,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===Bt.POPUP;if(l){const u=s.get(o.id);if(!u)continue;n.elements=u}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;n.data=o;const c=Pw.create(n);if(!c.isRenderable)continue;if(!l&&o.popupRef){const u=s.get(o.popupRef);u?u.push(c):s.set(o.popupRef,[c])}const d=c.render();o.hidden&&(d.style.visibility="hidden"),await p(this,jr,om).call(this,d,o.id,n.elements),c._isEditable&&(r(this,er).set(c.data.id,c),(a=this._annotationEditorUIManager)==null||a.renderAnnotationElement(c))}p(this,jr,lm).call(this)}async addLinkAnnotations(t,e){const i={data:null,layer:this.div,linkService:e,svgFactory:new ng,parent:this};for(const s of t){s.borderStyle||(s.borderStyle=Nl._defaultBorderStyle),i.data=s;const n=Pw.create(i);if(!n.isRenderable)continue;const a=n.render();await p(this,jr,om).call(this,a,s.id,null)}}update({viewport:t}){const e=this.div;this.viewport=t,Eo(e,{rotation:t.rotation}),p(this,jr,lm).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(r(this,er).values())}getEditableAnnotation(t){return r(this,er).get(t)}static get _defaultBorderStyle(){return nt(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:Lo.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},Rd=new WeakMap,Va=new WeakMap,er=new WeakMap,Md=new WeakMap,jr=new WeakSet,om=async function(t,e,i){var o,l;const s=t.firstChild||t,n=s.id="".concat(Rb).concat(e),a=await((o=r(this,Md))==null?void 0:o.getAriaAttributes(n));if(a)for(const[c,d]of a)s.setAttribute(c,d);i?i.at(-1).container.after(t):(this.div.append(t),(l=r(this,Rd))==null||l.moveElementInDOM(this.div,t,s,!1))},lm=function(){var e;if(!r(this,Va))return;const t=this.div;for(const[i,s]of r(this,Va)){const n=t.querySelector('[data-annotation-id="'.concat(i,'"]'));if(!n)continue;s.className="annotationContent";const{firstChild:a}=n;a?a.nodeName==="CANVAS"?a.replaceWith(s):a.classList.contains("annotationContent")?a.after(s):a.before(s):n.append(s);const o=r(this,er).get(i);o&&(o._hasNoCanvas?((e=this._annotationEditorUIManager)==null||e.setMissingCanvas(i,n.id,s),o._hasNoCanvas=!1):o.canvas=s)}r(this,Va).clear()},Nl);const Yu=/\r\n?|\n/g;var Li,Ge,kd,Ha,Xe,$t,hA,cA,dA,_f,_n,Ef,Sf,uA,cm,fA;const wt=class wt extends vt{constructor(e){super({...e,name:"freeTextEditor"});m(this,$t);m(this,Li);m(this,Ge,"");m(this,kd,"".concat(this.id,"-editor"));m(this,Ha,null);m(this,Xe);f(this,Li,e.color||wt._defaultColor||vt._defaultLineColor),f(this,Xe,e.fontSize||wt._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static get _keyboardManager(){const e=wt.prototype,i=a=>a.isEmpty(),s=yc.TRANSLATE_SMALL,n=yc.TRANSLATE_BIG;return nt(this,"_keyboardManager",new ju([[["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){vt.initialize(e,i);const s=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(s.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,i){switch(e){case st.FREETEXT_SIZE:wt._defaultFontSize=i;break;case st.FREETEXT_COLOR:wt._defaultColor=i;break}}updateParams(e,i){switch(e){case st.FREETEXT_SIZE:p(this,$t,hA).call(this,i);break;case st.FREETEXT_COLOR:p(this,$t,cA).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[st.FREETEXT_SIZE,wt._defaultFontSize],[st.FREETEXT_COLOR,wt._defaultColor||vt._defaultLineColor]]}get propertiesToUpdate(){return[[st.FREETEXT_SIZE,r(this,Xe)],[st.FREETEXT_COLOR,r(this,Li)]]}_translateEmpty(e,i){this._uiManager.translateSelectedEditors(e,i,!0)}getInitialTranslation(){const e=this.parentScale;return[-wt._internalPadding*e,-(wt._internalPadding+r(this,Xe))*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"),f(this,Ha,new AbortController);const e=this._uiManager.combinedSignal(r(this,Ha));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",r(this,kd)),this._isDraggable=!0,(e=r(this,Ha))==null||e.abort(),f(this,Ha,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=r(this,Ge),i=f(this,Ge,p(this,$t,dA).call(this).trimEnd());if(e===i)return;const s=n=>{if(f(this,Ge,n),!n){this.remove();return}p(this,$t,Sf).call(this),this._uiManager.rebuild(this),p(this,$t,_f).call(this)};this.addCommands({cmd:()=>{s(i)},undo:()=>{s(e)},mustExec:!1}),p(this,$t,_f).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){wt._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",r(this,kd)),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(r(this,Xe),"px * var(--total-scale-factor))"),s.color=r(this,Li),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,a]=this.parentDimensions;if(this.annotationElementId){const{position:o}=this._initialData;let[l,c]=this.getInitialTranslation();[l,c]=this.pageTranslationToScreen(l,c);const[d,u]=this.pageDimensions,[g,b]=this.pageTranslation;let w,v;switch(this.rotation){case 0:w=e+(o[0]-g)/d,v=i+this.height-(o[1]-b)/u;break;case 90:w=e+(o[0]-g)/d,v=i-(o[1]-b)/u,[l,c]=[c,-l];break;case 180:w=e-this.width+(o[0]-g)/d,v=i-(o[1]-b)/u,[l,c]=[-l,-c];break;case 270:w=e+(o[0]-g-this.height*u)/d,v=i+(o[1]-b-this.width*d)/u,[l,c]=[-c,l];break}this.setAt(w*n,v*a,l,c)}else this._moveAfterPaste(e,i);p(this,$t,Sf).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(e){var w,v,y;const i=e.clipboardData||window.clipboardData,{types:s}=i;if(s.length===1&&s[0]==="text/plain")return;e.preventDefault();const n=p(w=wt,_n,cm).call(w,i.getData("text")||"").replaceAll(Yu,"\n");if(!n)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!n.includes("\n")){o.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:l,startOffset:c}=o,d=[],u=[];if(l.nodeType===Node.TEXT_NODE){const A=l.parentElement;if(u.push(l.nodeValue.slice(c).replaceAll(Yu,"")),A!==this.editorDiv){let E=d;for(const _ of this.editorDiv.childNodes){if(_===A){E=u;continue}E.push(p(v=wt,_n,Ef).call(v,_))}}d.push(l.nodeValue.slice(0,c).replaceAll(Yu,""))}else if(l===this.editorDiv){let A=d,E=0;for(const _ of this.editorDiv.childNodes)E++===c&&(A=u),A.push(p(y=wt,_n,Ef).call(y,_))}f(this,Ge,"".concat(d.join("\n")).concat(n).concat(u.join("\n"))),p(this,$t,Sf).call(this);const g=new Range;let b=Math.sumPrecise(d.map(A=>A.length));for(const{firstChild:A}of this.editorDiv.childNodes)if(A.nodeType===Node.TEXT_NODE){const E=A.nodeValue.length;if(b<=E){g.setStart(A,b),g.setEnd(A,b);break}b-=E}a.removeAllRanges(),a.addRange(g)}get contentDiv(){return this.editorDiv}static async deserialize(e,i,s){var o;let n=null;if(e instanceof rA){const{data:{defaultAppearanceData:{fontSize:l,fontColor:c},rect:d,rotation:u,id:g,popupRef:b},textContent:w,textPosition:v,parent:{page:{pageNumber:y}}}=e;if(!w||w.length===0)return null;n=e={annotationType:Y.FREETEXT,color:Array.from(c),fontSize:l,value:w.join("\n"),position:v,pageIndex:y-1,rect:d.slice(0),rotation:u,annotationElementId:g,id:g,deleted:!1,popupRef:b}}const a=await super.deserialize(e,i,s);return f(a,Xe,e.fontSize),f(a,Li,q.makeHexColor(...e.color)),f(a,Ge,p(o=wt,_n,cm).call(o,e.value)),a._initialData=n,a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=wt._internalPadding*this.parentScale,s=this.getRect(i,i),n=vt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:r(this,Li)),a={annotationType:Y.FREETEXT,color:n,fontSize:r(this,Xe),value:p(this,$t,uA).call(this),pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?(a.isCopy=!0,a):this.annotationElementId&&!p(this,$t,fA).call(this,a)?null:(a.id=this.annotationElementId,a)}renderAnnotationElement(e){const i=super.renderAnnotationElement(e);if(this.deleted)return i;const{style:s}=i;s.fontSize="calc(".concat(r(this,Xe),"px * var(--total-scale-factor))"),s.color=r(this,Li),i.replaceChildren();for(const a of r(this,Ge).split("\n")){const o=document.createElement("div");o.append(a?document.createTextNode(a):document.createElement("br")),i.append(o)}const n=wt._internalPadding*this.parentScale;return e.updateEdited({rect:this.getRect(n,n),popupContent:r(this,Ge)}),i}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}};Li=new WeakMap,Ge=new WeakMap,kd=new WeakMap,Ha=new WeakMap,Xe=new WeakMap,$t=new WeakSet,hA=function(e){const i=n=>{this.editorDiv.style.fontSize="calc(".concat(n,"px * var(--total-scale-factor))"),this.translate(0,-(n-r(this,Xe))*this.parentScale),f(this,Xe,n),p(this,$t,_f).call(this)},s=r(this,Xe);this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:st.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},cA=function(e){const i=n=>{f(this,Li,this.editorDiv.style.color=n)},s=r(this,Li);this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:st.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},dA=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(p(s=wt,_n,Ef).call(s,n)),i=n);return e.join("\n")},_f=function(){const[e,i]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:n,div:a}=this,o=a.style.display,l=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",n.div.append(this.div),s=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.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,Ef=function(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(Yu,"")},Sf=function(){if(this.editorDiv.replaceChildren(),!!r(this,Ge))for(const e of r(this,Ge).split("\n")){const i=document.createElement("div");i.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(i)}},uA=function(){return r(this,Ge).replaceAll(" "," ")},cm=function(e){return e.replaceAll(" "," ")},fA=function(e){const{value:i,fontSize:s,color:n,pageIndex:a}=this._initialData;return this._hasBeenMoved||e.value!==i||e.fontSize!==s||e.color.some((o,l)=>o!==n[l])||e.pageIndex!==a},m(wt,_n),k(wt,"_freeTextDefaultContent",""),k(wt,"_internalPadding",0),k(wt,"_defaultColor",null),k(wt,"_defaultFontSize",10),k(wt,"_type","freetext"),k(wt,"_editorType",Y.FREETEXT);let hm=wt;class H{toSVGPath(){gt("Abstract method `toSVGPath` must be implemented.")}get box(){gt("Abstract getter `box` must be implemented.")}serialize(t,e){gt("Abstract method `serialize` must be implemented.")}static _rescale(t,e,i,s,n,a){a||(a=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)a[o]=e+t[o]*s,a[o+1]=i+t[o+1]*n;return a}static _rescaleAndSwap(t,e,i,s,n,a){a||(a=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)a[o]=e+t[o+1]*s,a[o+1]=i+t[o]*n;return a}static _translate(t,e,i,s){s||(s=new Float32Array(t.length));for(let n=0,a=t.length;n<a;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,a){return[(t+5*i)/6,(e+5*s)/6,(5*i+n)/6,(5*s+a)/6,(i+n)/2,(s+a)/2]}}k(H,"PRECISION",1e-4);var qe,Ri,Fl,Ol,os,it,ja,$a,Dd,Nd,Bl,Vl,ir,Fd,xg,Cg,Xt,Zh,gA,pA,mA,bA,wA,vA;const Is=class Is{constructor({x:t,y:e},i,s,n,a,o=0){m(this,Xt);m(this,qe);m(this,Ri,[]);m(this,Fl);m(this,Ol);m(this,os,[]);m(this,it,new Float32Array(18));m(this,ja);m(this,$a);m(this,Dd);m(this,Nd);m(this,Bl);m(this,Vl);m(this,ir,[]);f(this,qe,i),f(this,Vl,n*s),f(this,Ol,a),r(this,it).set([NaN,NaN,NaN,NaN,t,e],6),f(this,Fl,o),f(this,Nd,r(Is,Fd)*s),f(this,Dd,r(Is,Cg)*s),f(this,Bl,s),r(this,ir).push(t,e)}isEmpty(){return isNaN(r(this,it)[8])}add({x:t,y:e}){var C;f(this,ja,t),f(this,$a,e);const[i,s,n,a]=r(this,qe);let[o,l,c,d]=r(this,it).subarray(8,12);const u=t-c,g=e-d,b=Math.hypot(u,g);if(b<r(this,Dd))return!1;const w=b-r(this,Nd),v=w/b,y=v*u,A=v*g;let E=o,_=l;o=c,l=d,c+=y,d+=A,(C=r(this,ir))==null||C.push(t,e);const S=-A/w,P=y/w,x=S*r(this,Vl),T=P*r(this,Vl);return r(this,it).set(r(this,it).subarray(2,8),0),r(this,it).set([c+x,d+T],4),r(this,it).set(r(this,it).subarray(14,18),12),r(this,it).set([c-x,d-T],16),isNaN(r(this,it)[6])?(r(this,os).length===0&&(r(this,it).set([o+x,l+T],2),r(this,os).push(NaN,NaN,NaN,NaN,(o+x-i)/n,(l+T-s)/a),r(this,it).set([o-x,l-T],14),r(this,Ri).push(NaN,NaN,NaN,NaN,(o-x-i)/n,(l-T-s)/a)),r(this,it).set([E,_,o,l,c,d],6),!this.isEmpty()):(r(this,it).set([E,_,o,l,c,d],6),Math.abs(Math.atan2(_-l,E-o)-Math.atan2(A,y))<Math.PI/2?([o,l,c,d]=r(this,it).subarray(2,6),r(this,os).push(NaN,NaN,NaN,NaN,((o+c)/2-i)/n,((l+d)/2-s)/a),[o,l,E,_]=r(this,it).subarray(14,18),r(this,Ri).push(NaN,NaN,NaN,NaN,((E+o)/2-i)/n,((_+l)/2-s)/a),!0):([E,_,o,l,c,d]=r(this,it).subarray(0,6),r(this,os).push(((E+5*o)/6-i)/n,((_+5*l)/6-s)/a,((5*o+c)/6-i)/n,((5*l+d)/6-s)/a,((o+c)/2-i)/n,((l+d)/2-s)/a),[c,d,o,l,E,_]=r(this,it).subarray(12,18),r(this,Ri).push(((E+5*o)/6-i)/n,((_+5*l)/6-s)/a,((5*o+c)/6-i)/n,((5*l+d)/6-s)/a,((o+c)/2-i)/n,((l+d)/2-s)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const t=r(this,os),e=r(this,Ri);if(isNaN(r(this,it)[6])&&!this.isEmpty())return p(this,Xt,gA).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]));p(this,Xt,mA).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 p(this,Xt,pA).call(this,i),i.join(" ")}newFreeDrawOutline(t,e,i,s,n,a){return new yA(t,e,i,s,n,a)}getOutlines(){var u,g;const t=r(this,os),e=r(this,Ri),i=r(this,it),[s,n,a,o]=r(this,qe),l=new Float32Array(((g=(u=r(this,ir))==null?void 0:u.length)!=null?g:0)+2);for(let b=0,w=l.length-2;b<w;b+=2)l[b]=(r(this,ir)[b]-s)/a,l[b+1]=(r(this,ir)[b+1]-n)/o;if(l[l.length-2]=(r(this,ja)-s)/a,l[l.length-1]=(r(this,$a)-n)/o,isNaN(i[6])&&!this.isEmpty())return p(this,Xt,bA).call(this,l);const c=new Float32Array(r(this,os).length+24+r(this,Ri).length);let d=t.length;for(let b=0;b<d;b+=2){if(isNaN(t[b])){c[b]=c[b+1]=NaN;continue}c[b]=t[b],c[b+1]=t[b+1]}d=p(this,Xt,vA).call(this,c,d);for(let b=e.length-6;b>=6;b-=6)for(let w=0;w<6;w+=2){if(isNaN(e[b+w])){c[d]=c[d+1]=NaN,d+=2;continue}c[d]=e[b+w],c[d+1]=e[b+w+1],d+=2}return p(this,Xt,wA).call(this,c,d),this.newFreeDrawOutline(c,l,r(this,qe),r(this,Bl),r(this,Fl),r(this,Ol))}};qe=new WeakMap,Ri=new WeakMap,Fl=new WeakMap,Ol=new WeakMap,os=new WeakMap,it=new WeakMap,ja=new WeakMap,$a=new WeakMap,Dd=new WeakMap,Nd=new WeakMap,Bl=new WeakMap,Vl=new WeakMap,ir=new WeakMap,Fd=new WeakMap,xg=new WeakMap,Cg=new WeakMap,Xt=new WeakSet,Zh=function(){const t=r(this,it).subarray(4,6),e=r(this,it).subarray(16,18),[i,s,n,a]=r(this,qe);return[(r(this,ja)+(t[0]-e[0])/2-i)/n,(r(this,$a)+(t[1]-e[1])/2-s)/a,(r(this,ja)+(e[0]-t[0])/2-i)/n,(r(this,$a)+(e[1]-t[1])/2-s)/a]},gA=function(){const[t,e,i,s]=r(this,qe),[n,a,o,l]=p(this,Xt,Zh).call(this);return"M".concat((r(this,it)[2]-t)/i," ").concat((r(this,it)[3]-e)/s," L").concat((r(this,it)[4]-t)/i," ").concat((r(this,it)[5]-e)/s," L").concat(n," ").concat(a," L").concat(o," ").concat(l," L").concat((r(this,it)[16]-t)/i," ").concat((r(this,it)[17]-e)/s," L").concat((r(this,it)[14]-t)/i," ").concat((r(this,it)[15]-e)/s," Z")},pA=function(t){const e=r(this,Ri);t.push("L".concat(e[4]," ").concat(e[5]," Z"))},mA=function(t){const[e,i,s,n]=r(this,qe),a=r(this,it).subarray(4,6),o=r(this,it).subarray(16,18),[l,c,d,u]=p(this,Xt,Zh).call(this);t.push("L".concat((a[0]-e)/s," ").concat((a[1]-i)/n," L").concat(l," ").concat(c," L").concat(d," ").concat(u," L").concat((o[0]-e)/s," ").concat((o[1]-i)/n))},bA=function(t){const e=r(this,it),[i,s,n,a]=r(this,qe),[o,l,c,d]=p(this,Xt,Zh).call(this),u=new Float32Array(36);return u.set([NaN,NaN,NaN,NaN,(e[2]-i)/n,(e[3]-s)/a,NaN,NaN,NaN,NaN,(e[4]-i)/n,(e[5]-s)/a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,d,NaN,NaN,NaN,NaN,(e[16]-i)/n,(e[17]-s)/a,NaN,NaN,NaN,NaN,(e[14]-i)/n,(e[15]-s)/a],0),this.newFreeDrawOutline(u,t,r(this,qe),r(this,Bl),r(this,Fl),r(this,Ol))},wA=function(t,e){const i=r(this,Ri);return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+=6},vA=function(t,e){const i=r(this,it).subarray(4,6),s=r(this,it).subarray(16,18),[n,a,o,l]=r(this,qe),[c,d,u,g]=p(this,Xt,Zh).call(this);return t.set([NaN,NaN,NaN,NaN,(i[0]-n)/o,(i[1]-a)/l,NaN,NaN,NaN,NaN,c,d,NaN,NaN,NaN,NaN,u,g,NaN,NaN,NaN,NaN,(s[0]-n)/o,(s[1]-a)/l],e),e+=24},m(Is,Fd,8),m(Is,xg,2),m(Is,Cg,r(Is,Fd)+r(Is,xg));let rg=Is;var Hl,Ua,Qs,Od,Ye,Bd,Nt,Tg,AA;class yA extends H{constructor(e,i,s,n,a,o){super();m(this,Tg);m(this,Hl);m(this,Ua,new Float32Array(4));m(this,Qs);m(this,Od);m(this,Ye);m(this,Bd);m(this,Nt);f(this,Nt,e),f(this,Ye,i),f(this,Hl,s),f(this,Bd,n),f(this,Qs,a),f(this,Od,o),this.lastPoint=[NaN,NaN],p(this,Tg,AA).call(this,o);const[l,c,d,u]=r(this,Ua);for(let g=0,b=e.length;g<b;g+=2)e[g]=(e[g]-l)/d,e[g+1]=(e[g+1]-c)/u;for(let g=0,b=i.length;g<b;g+=2)i[g]=(i[g]-l)/d,i[g+1]=(i[g+1]-c)/u}toSVGPath(){const e=["M".concat(r(this,Nt)[4]," ").concat(r(this,Nt)[5])];for(let i=6,s=r(this,Nt).length;i<s;i+=6){if(isNaN(r(this,Nt)[i])){e.push("L".concat(r(this,Nt)[i+4]," ").concat(r(this,Nt)[i+5]));continue}e.push("C".concat(r(this,Nt)[i]," ").concat(r(this,Nt)[i+1]," ").concat(r(this,Nt)[i+2]," ").concat(r(this,Nt)[i+3]," ").concat(r(this,Nt)[i+4]," ").concat(r(this,Nt)[i+5]))}return e.push("Z"),e.join(" ")}serialize([e,i,s,n],a){const o=s-e,l=n-i;let c,d;switch(a){case 0:c=H._rescale(r(this,Nt),e,n,o,-l),d=H._rescale(r(this,Ye),e,n,o,-l);break;case 90:c=H._rescaleAndSwap(r(this,Nt),e,i,o,l),d=H._rescaleAndSwap(r(this,Ye),e,i,o,l);break;case 180:c=H._rescale(r(this,Nt),s,i,-o,l),d=H._rescale(r(this,Ye),s,i,-o,l);break;case 270:c=H._rescaleAndSwap(r(this,Nt),s,n,-o,-l),d=H._rescaleAndSwap(r(this,Ye),s,n,-o,-l);break}return{outline:Array.from(c),points:[Array.from(d)]}}get box(){return r(this,Ua)}newOutliner(e,i,s,n,a,o=0){return new rg(e,i,s,n,a,o)}getNewOutline(e,i){const[s,n,a,o]=r(this,Ua),[l,c,d,u]=r(this,Hl),g=a*d,b=o*u,w=s*d+l,v=n*u+c,y=this.newOutliner({x:r(this,Ye)[0]*g+w,y:r(this,Ye)[1]*b+v},r(this,Hl),r(this,Bd),e,r(this,Od),i!=null?i:r(this,Qs));for(let A=2;A<r(this,Ye).length;A+=2)y.add({x:r(this,Ye)[A]*g+w,y:r(this,Ye)[A+1]*b+v});return y.getOutlines()}}Hl=new WeakMap,Ua=new WeakMap,Qs=new WeakMap,Od=new WeakMap,Ye=new WeakMap,Bd=new WeakMap,Nt=new WeakMap,Tg=new WeakSet,AA=function(e){const i=r(this,Nt);let s=i[4],n=i[5];const a=[s,n,s,n];let o=s,l=n;const c=e?Math.max:Math.min;for(let u=6,g=i.length;u<g;u+=6){const b=i[u+4],w=i[u+5];if(isNaN(i[u]))q.pointBoundingBox(b,w,a),l<w?(o=b,l=w):l===w&&(o=c(o,b));else{const v=[1/0,1/0,-1/0,-1/0];q.bezierBoundingBox(s,n,...i.slice(u,u+6),v),q.rectBoundingBox(...v,a),l<v[3]?(o=v[2],l=v[3]):l===v[3]&&(o=c(o,v[2]))}s=b,n=w}const d=r(this,Ua);d[0]=a[0]-r(this,Qs),d[1]=a[1]-r(this,Qs),d[2]=a[2]-a[0]+2*r(this,Qs),d[3]=a[3]-a[1]+2*r(this,Qs),this.lastPoint=[o,l]};var Vd,Hd,sr,Mi,Re,_A,Pf,EA,SA,um;class dm{constructor(t,e=0,i=0,s=!0){m(this,Re);m(this,Vd);m(this,Hd);m(this,sr,[]);m(this,Mi,[]);const n=[1/0,1/0,-1/0,-1/0],a=10**-4;for(const{x:b,y:w,width:v,height:y}of t){const A=Math.floor((b-e)/a)*a,E=Math.ceil((b+v+e)/a)*a,_=Math.floor((w-e)/a)*a,S=Math.ceil((w+y+e)/a)*a,P=[A,_,S,!0],x=[E,_,S,!1];r(this,sr).push(P,x),q.rectBoundingBox(A,_,E,S,n)}const o=n[2]-n[0]+2*i,l=n[3]-n[1]+2*i,c=n[0]-i,d=n[1]-i,u=r(this,sr).at(s?-1:-2),g=[u[0],u[2]];for(const b of r(this,sr)){const[w,v,y]=b;b[0]=(w-c)/o,b[1]=(v-d)/l,b[2]=(y-d)/l}f(this,Vd,new Float32Array([c,d,o,l])),f(this,Hd,g)}getOutlines(){r(this,sr).sort((e,i)=>e[0]-i[0]||e[1]-i[1]||e[2]-i[2]);const t=[];for(const e of r(this,sr))e[3]?(t.push(...p(this,Re,um).call(this,e)),p(this,Re,EA).call(this,e)):(p(this,Re,SA).call(this,e),t.push(...p(this,Re,um).call(this,e)));return p(this,Re,_A).call(this,t)}}Vd=new WeakMap,Hd=new WeakMap,sr=new WeakMap,Mi=new WeakMap,Re=new WeakSet,_A=function(t){const e=[],i=new Set;for(const a of t){const[o,l,c]=a;e.push([o,l,a],[o,c,a])}e.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=e.length;a<o;a+=2){const l=e[a][2],c=e[a+1][2];l.push(c),c.push(l),i.add(l),i.add(c)}const s=[];let n;for(;i.size>0;){const a=i.values().next().value;let[o,l,c,d,u]=a;i.delete(a);let g=o,b=l;for(n=[o,c],s.push(n);;){let w;if(i.has(d))w=d;else if(i.has(u))w=u;else break;i.delete(w),[o,l,c,d,u]=w,g!==o&&(n.push(g,b,o,b===l?l:c),g=o),b=b===l?c:l}n.push(g,b)}return new xS(s,r(this,Vd),r(this,Hd))},Pf=function(t){const e=r(this,Mi);let i=0,s=e.length-1;for(;i<=s;){const n=i+s>>1,a=e[n][0];if(a===t)return n;a<t?i=n+1:s=n-1}return s+1},EA=function([,t,e]){const i=p(this,Re,Pf).call(this,t);r(this,Mi).splice(i,0,[t,e])},SA=function([,t,e]){const i=p(this,Re,Pf).call(this,t);for(let s=i;s<r(this,Mi).length;s++){const[n,a]=r(this,Mi)[s];if(n!==t)break;if(n===t&&a===e){r(this,Mi).splice(s,1);return}}for(let s=i-1;s>=0;s--){const[n,a]=r(this,Mi)[s];if(n!==t)break;if(n===t&&a===e){r(this,Mi).splice(s,1);return}}},um=function(t){const[e,i,s]=t,n=[[e,i,s]],a=p(this,Re,Pf).call(this,s);for(let o=0;o<a;o++){const[l,c]=r(this,Mi)[o];for(let d=0,u=n.length;d<u;d++){const[,g,b]=n[d];if(!(c<=g||b<=l)){if(g>=l){if(b>c)n[d][1]=c;else{if(u===1)return[];n.splice(d,1),d--,u--}continue}n[d][2]=l,b>c&&n.push([e,c,b])}}}return n};var jd,jl;class xS extends H{constructor(e,i,s){super();m(this,jd);m(this,jl);f(this,jl,e),f(this,jd,i),this.lastPoint=s}toSVGPath(){const e=[];for(const i of r(this,jl)){let[s,n]=i;e.push("M".concat(s," ").concat(n));for(let a=2;a<i.length;a+=2){const o=i[a],l=i[a+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],a){const o=[],l=s-e,c=n-i;for(const d of r(this,jl)){const u=new Array(d.length);for(let g=0;g<d.length;g+=2)u[g]=e+d[g]*l,u[g+1]=n-d[g+1]*c;o.push(u)}return o}get box(){return r(this,jd)}get classNamesForOutlining(){return["highlightOutline"]}}jd=new WeakMap,jl=new WeakMap;class fm extends rg{newFreeDrawOutline(t,e,i,s,n,a){return new CS(t,e,i,s,n,a)}}class CS extends yA{newOutliner(t,e,i,s,n,a=0){return new fm(t,e,i,s,n,a)}}var Ke,Wa,$l,Wt,$d,Ul,Js,Ud,nr,ki,Wl,he,Wd,ft,gm,pm,mm,Wr,xA,Cn;let PA=(he=class{constructor({editor:t=null,uiManager:e=null}){m(this,ft);m(this,Ke,null);m(this,Wa,null);m(this,$l);m(this,Wt,null);m(this,$d,!1);m(this,Ul,!1);m(this,Js,null);m(this,Ud);m(this,nr,null);m(this,ki,null);m(this,Wl);var i,s;t?(f(this,Ul,!1),f(this,Wl,st.HIGHLIGHT_COLOR),f(this,Js,t)):(f(this,Ul,!0),f(this,Wl,st.HIGHLIGHT_DEFAULT_COLOR)),f(this,ki,(t==null?void 0:t._uiManager)||e),f(this,Ud,r(this,ki)._eventBus),f(this,$l,((i=t==null?void 0:t.color)==null?void 0:i.toUpperCase())||((s=r(this,ki))==null?void 0:s.highlightColors.values().next().value)||"#FFFF98"),r(he,Wd)||f(he,Wd,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 nt(this,"_keyboardManager",new ju([[["Escape","mac+Escape"],he.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],he.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],he.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],he.prototype._moveToPrevious],[["Home","mac+Home"],he.prototype._moveToBeginning],[["End","mac+End"],he.prototype._moveToEnd]]))}renderButton(){const t=f(this,Ke,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",r(this,Js)&&(t.ariaControls="".concat(r(this,Js).id,"_colorpicker_dropdown"));const e=r(this,ki)._signal;t.addEventListener("click",p(this,ft,Wr).bind(this),{signal:e}),t.addEventListener("keydown",p(this,ft,mm).bind(this),{signal:e});const i=f(this,Wa,document.createElement("span"));return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=r(this,$l),t.append(i),t}renderMainDropdown(){const t=f(this,Wt,p(this,ft,gm).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===r(this,Ke)){p(this,ft,Wr).call(this,t);return}const e=t.target.getAttribute("data-color");e&&p(this,ft,pm).call(this,e,t)}_moveToNext(t){var e,i;if(!r(this,ft,Cn)){p(this,ft,Wr).call(this,t);return}if(t.target===r(this,Ke)){(e=r(this,Wt).firstChild)==null||e.focus();return}(i=t.target.nextSibling)==null||i.focus()}_moveToPrevious(t){var e,i;if(t.target===((e=r(this,Wt))==null?void 0:e.firstChild)||t.target===r(this,Ke)){r(this,ft,Cn)&&this._hideDropdownFromKeyboard();return}r(this,ft,Cn)||p(this,ft,Wr).call(this,t),(i=t.target.previousSibling)==null||i.focus()}_moveToBeginning(t){var e;if(!r(this,ft,Cn)){p(this,ft,Wr).call(this,t);return}(e=r(this,Wt).firstChild)==null||e.focus()}_moveToEnd(t){var e;if(!r(this,ft,Cn)){p(this,ft,Wr).call(this,t);return}(e=r(this,Wt).lastChild)==null||e.focus()}hideDropdown(){var t,e;(t=r(this,Wt))==null||t.classList.add("hidden"),r(this,Ke).ariaExpanded="false",(e=r(this,nr))==null||e.abort(),f(this,nr,null)}_hideDropdownFromKeyboard(){var t;if(!r(this,Ul)){if(!r(this,ft,Cn)){(t=r(this,Js))==null||t.unselect();return}this.hideDropdown(),r(this,Ke).focus({preventScroll:!0,focusVisible:r(this,$d)})}}updateColor(t){if(r(this,Wa)&&(r(this,Wa).style.backgroundColor=t),!r(this,Wt))return;const e=r(this,ki).highlightColors.values();for(const i of r(this,Wt).children)i.ariaSelected=e.next().value===t.toUpperCase()}destroy(){var t,e;(t=r(this,Ke))==null||t.remove(),f(this,Ke,null),f(this,Wa,null),(e=r(this,Wt))==null||e.remove(),f(this,Wt,null)}},Ke=new WeakMap,Wa=new WeakMap,$l=new WeakMap,Wt=new WeakMap,$d=new WeakMap,Ul=new WeakMap,Js=new WeakMap,Ud=new WeakMap,nr=new WeakMap,ki=new WeakMap,Wl=new WeakMap,Wd=new WeakMap,ft=new WeakSet,gm=function(){const t=document.createElement("div"),e=r(this,ki)._signal;t.addEventListener("contextmenu",Wi,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),r(this,Js)&&(t.id="".concat(r(this,Js).id,"_colorpicker_dropdown"));for(const[i,s]of r(this,ki).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",r(he,Wd)[i]);const a=document.createElement("span");n.append(a),a.className="swatch",a.style.backgroundColor=s,n.ariaSelected=s===r(this,$l),n.addEventListener("click",p(this,ft,pm).bind(this,s),{signal:e}),t.append(n)}return t.addEventListener("keydown",p(this,ft,mm).bind(this),{signal:e}),t},pm=function(t,e){e.stopPropagation(),r(this,Ud).dispatch("switchannotationeditorparams",{source:this,type:r(this,Wl),value:t})},mm=function(t){he._keyboardManager.exec(this,t)},Wr=function(t){if(r(this,ft,Cn)){this.hideDropdown();return}if(f(this,$d,t.detail===0),r(this,nr)||(f(this,nr,new AbortController),window.addEventListener("pointerdown",p(this,ft,xA).bind(this),{signal:r(this,ki).combinedSignal(r(this,nr))})),r(this,Ke).ariaExpanded="true",r(this,Wt)){r(this,Wt).classList.remove("hidden");return}const e=f(this,Wt,p(this,ft,gm).call(this));r(this,Ke).append(e)},xA=function(t){var e;(e=r(this,Wt))!=null&&e.contains(t.target)||this.hideDropdown()},Cn=function(){return r(this,Wt)&&!r(this,Wt).classList.contains("hidden")},m(he,Wd,null),he);var zl,zd,tn,za,Gd,Ne,Xd,qd,Ga,bi,Ze,oe,Gl,en,we,Xl,wi,Yd,J,bm,xf,CA,TA,IA,wm,zr,_i,No,LA,Cf,Qh,RA,MA,kA,DA,NA;const lt=class lt extends vt{constructor(e){super({...e,name:"highlightEditor"});m(this,J);m(this,zl,null);m(this,zd,0);m(this,tn);m(this,za,null);m(this,Gd,null);m(this,Ne,null);m(this,Xd,null);m(this,qd,0);m(this,Ga,null);m(this,bi,null);m(this,Ze,null);m(this,oe,!1);m(this,Gl,null);m(this,en);m(this,we,null);m(this,Xl,"");m(this,wi);m(this,Yd,"");this.color=e.color||lt._defaultColor,f(this,wi,e.thickness||lt._defaultThickness),f(this,en,e.opacity||lt._defaultOpacity),f(this,tn,e.boxes||null),f(this,Yd,e.methodOfCreation||""),f(this,Xl,e.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(f(this,oe,!0),p(this,J,xf).call(this,e),p(this,J,zr).call(this)):r(this,tn)&&(f(this,zl,e.anchorNode),f(this,zd,e.anchorOffset),f(this,Xd,e.focusNode),f(this,qd,e.focusOffset),p(this,J,bm).call(this),p(this,J,zr).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const e=lt.prototype;return nt(this,"_keyboardManager",new ju([[["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:r(this,oe)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:r(this,wi),methodOfCreation:r(this,Yd)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}static initialize(e,i){var s;vt.initialize(e,i),lt._defaultColor||(lt._defaultColor=((s=i.highlightColors)==null?void 0:s.values().next().value)||"#fff066")}static updateDefaultParams(e,i){switch(e){case st.HIGHLIGHT_DEFAULT_COLOR:lt._defaultColor=i;break;case st.HIGHLIGHT_THICKNESS:lt._defaultThickness=i;break}}translateInPage(e,i){}get toolbarPosition(){return r(this,Gl)}updateParams(e,i){switch(e){case st.HIGHLIGHT_COLOR:p(this,J,CA).call(this,i);break;case st.HIGHLIGHT_THICKNESS:p(this,J,TA).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[st.HIGHLIGHT_DEFAULT_COLOR,lt._defaultColor],[st.HIGHLIGHT_THICKNESS,lt._defaultThickness]]}get propertiesToUpdate(){return[[st.HIGHLIGHT_COLOR,this.color||lt._defaultColor],[st.HIGHLIGHT_THICKNESS,r(this,wi)||lt._defaultThickness],[st.HIGHLIGHT_FREE,r(this,oe)]]}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",f(this,Gd,new PA({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(p(this,J,Qh).call(this))}getBaseTranslation(){return[0,0]}getRect(e,i){return super.getRect(e,i,p(this,J,Qh).call(this))}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){p(this,J,wm).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(p(this,J,zr).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){var s;let i=!1;this.parent&&!e?p(this,J,wm).call(this):e&&(p(this,J,zr).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,a,o;const{drawLayer:i}=this.parent;let s;r(this,oe)?(e=(e-this.rotation+360)%360,s=p(n=lt,_i,No).call(n,r(this,bi).box,e)):s=p(a=lt,_i,No).call(a,[this.x,this.y,this.width,this.height],e),i.updateProperties(r(this,Ze),{bbox:s,root:{"data-main-rotation":e}}),i.updateProperties(r(this,we),{bbox:p(o=lt,_i,No).call(o,r(this,Ne).box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;const e=super.render();r(this,Xl)&&(e.setAttribute("aria-label",r(this,Xl)),e.setAttribute("role","mark")),r(this,oe)?e.classList.add("free"):this.div.addEventListener("keydown",p(this,J,LA).bind(this),{signal:this._uiManager._signal});const i=f(this,Ga,document.createElement("div"));e.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",i.style.clipPath=r(this,za);const[s,n]=this.parentDimensions;return this.setDims(this.width*s,this.height*n),Qv(this,r(this,Ga),["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){var e;this.isSelected||(e=this.parent)==null||e.drawLayer.updateProperties(r(this,we),{rootClass:{hovered:!0}})}pointerleave(){var e;this.isSelected||(e=this.parent)==null||e.drawLayer.updateProperties(r(this,we),{rootClass:{hovered:!1}})}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:p(this,J,Cf).call(this,!0);break;case 1:case 3:p(this,J,Cf).call(this,!1);break}}select(){var e;super.select(),r(this,we)&&((e=this.parent)==null||e.drawLayer.updateProperties(r(this,we),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var e;super.unselect(),r(this,we)&&((e=this.parent)==null||e.drawLayer.updateProperties(r(this,we),{rootClass:{selected:!1}}),r(this,oe)||p(this,J,Cf).call(this,!1))}get _mustFixPosition(){return!r(this,oe)}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(r(this,Ze),{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(r(this,we),{rootClass:{hidden:!e}}))}static startHighlighting(e,i,{target:s,x:n,y:a}){const{x:o,y:l,width:c,height:d}=s.getBoundingClientRect(),u=new AbortController,g=e.combinedSignal(u),b=w=>{u.abort(),p(this,_i,DA).call(this,e,w)};window.addEventListener("blur",b,{signal:g}),window.addEventListener("pointerup",b,{signal:g}),window.addEventListener("pointerdown",Vt,{capture:!0,passive:!1,signal:g}),window.addEventListener("contextmenu",Wi,{signal:g}),s.addEventListener("pointermove",p(this,_i,kA).bind(this,e),{signal:g}),this._freeHighlight=new fm({x:n,y:a},[o,l,c,d],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 v,y,A,E;let n=null;if(e instanceof oA){const{data:{quadPoints:_,rect:S,rotation:P,id:x,color:T,opacity:I,popupRef:C},parent:{page:{pageNumber:L}}}=e;n=e={annotationType:Y.HIGHLIGHT,color:Array.from(T),opacity:I,quadPoints:_,boxes:null,pageIndex:L-1,rect:S.slice(0),rotation:P,annotationElementId:x,id:x,deleted:!1,popupRef:C}}else if(e instanceof Ob){const{data:{inkLists:_,rect:S,rotation:P,id:x,color:T,borderStyle:{rawWidth:I},popupRef:C},parent:{page:{pageNumber:L}}}=e;n=e={annotationType:Y.HIGHLIGHT,color:Array.from(T),thickness:I,inkLists:_,boxes:null,pageIndex:L-1,rect:S.slice(0),rotation:P,annotationElementId:x,id:x,deleted:!1,popupRef:C}}const{color:a,quadPoints:o,inkLists:l,opacity:c}=e,d=await super.deserialize(e,i,s);d.color=q.makeHexColor(...a),f(d,en,c||1),l&&f(d,wi,e.thickness),d._initialData=n;const[u,g]=d.pageDimensions,[b,w]=d.pageTranslation;if(o){const _=f(d,tn,[]);for(let S=0;S<o.length;S+=8)_.push({x:(o[S]-b)/u,y:1-(o[S+1]-w)/g,width:(o[S+2]-o[S])/u,height:(o[S+1]-o[S+5])/g});p(v=d,J,bm).call(v),p(y=d,J,zr).call(y),d.rotate(d.rotation)}else if(l){f(d,oe,!0);const _=l[0],S={x:_[0]-b,y:g-(_[1]-w)},P=new fm(S,[0,0,u,g],1,r(d,wi)/2,!0,.001);for(let I=0,C=_.length;I<C;I+=2)S.x=_[I]-b,S.y=g-(_[I+1]-w),P.add(S);const{id:x,clipPathId:T}=i.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:d.color,"fill-opacity":d._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:P.toSVGPath()}},!0,!0);p(A=d,J,xf).call(A,{highlightOutlines:P.getOutlines(),highlightId:x,clipPathId:T}),p(E=d,J,zr).call(E),d.rotate(d.parentRotation)}return d}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const i=this.getRect(0,0),s=vt._colorManager.convert(this.color),n={annotationType:Y.HIGHLIGHT,color:s,opacity:r(this,en),thickness:r(this,wi),quadPoints:p(this,J,RA).call(this),outlines:p(this,J,MA).call(this,i),pageIndex:this.pageIndex,rect:i,rotation:p(this,J,Qh).call(this),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!p(this,J,NA).call(this,n)?null:(n.id=this.annotationElementId,n)}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};zl=new WeakMap,zd=new WeakMap,tn=new WeakMap,za=new WeakMap,Gd=new WeakMap,Ne=new WeakMap,Xd=new WeakMap,qd=new WeakMap,Ga=new WeakMap,bi=new WeakMap,Ze=new WeakMap,oe=new WeakMap,Gl=new WeakMap,en=new WeakMap,we=new WeakMap,Xl=new WeakMap,wi=new WeakMap,Yd=new WeakMap,J=new WeakSet,bm=function(){const e=new dm(r(this,tn),.001);f(this,bi,e.getOutlines()),[this.x,this.y,this.width,this.height]=r(this,bi).box;const i=new dm(r(this,tn),.0025,.001,this._uiManager.direction==="ltr");f(this,Ne,i.getOutlines());const{lastPoint:s}=r(this,Ne);f(this,Gl,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height])},xf=function({highlightOutlines:e,highlightId:i,clipPathId:s}){var u,g;if(f(this,bi,e),f(this,Ne,e.getNewOutline(r(this,wi)/2+1.5,.0025)),i>=0)f(this,Ze,i),f(this,za,s),this.parent.drawLayer.finalizeDraw(i,{bbox:e.box,path:{d:e.toSVGPath()}}),f(this,we,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:r(this,Ne).box,path:{d:r(this,Ne).toSVGPath()}},!0));else if(this.parent){const b=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(r(this,Ze),{bbox:p(u=lt,_i,No).call(u,r(this,bi).box,(b-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(r(this,we),{bbox:p(g=lt,_i,No).call(g,r(this,Ne).box,b),path:{d:r(this,Ne).toSVGPath()}})}const[a,o,l,c]=e.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=l,this.height=c;break;case 90:{const[b,w]=this.parentDimensions;this.x=o,this.y=1-a,this.width=l*w/b,this.height=c*b/w;break}case 180:this.x=1-a,this.y=1-o,this.width=l,this.height=c;break;case 270:{const[b,w]=this.parentDimensions;this.x=1-o,this.y=a,this.width=l*w/b,this.height=c*b/w;break}}const{lastPoint:d}=r(this,Ne);f(this,Gl,[(d[0]-a)/l,(d[1]-o)/c])},CA=function(e){const i=(a,o)=>{var l,c;this.color=a,f(this,en,o),(l=this.parent)==null||l.drawLayer.updateProperties(r(this,Ze),{root:{fill:a,"fill-opacity":o}}),(c=r(this,Gd))==null||c.updateColor(a)},s=this.color,n=r(this,en);this.addCommands({cmd:i.bind(this,e,lt._defaultOpacity),undo:i.bind(this,s,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:st.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(e)},!0)},TA=function(e){const i=r(this,wi),s=n=>{f(this,wi,n),p(this,J,IA).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:st.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)},IA=function(e){if(!r(this,oe))return;p(this,J,xf).call(this,{highlightOutlines:r(this,bi).getNewOutline(e/2)}),this.fixAndSetPosition();const[i,s]=this.parentDimensions;this.setDims(this.width*i,this.height*s)},wm=function(){r(this,Ze)===null||!this.parent||(this.parent.drawLayer.remove(r(this,Ze)),f(this,Ze,null),this.parent.drawLayer.remove(r(this,we)),f(this,we,null))},zr=function(e=this.parent){r(this,Ze)===null&&({id:se(this,Ze)._,clipPathId:se(this,za)._}=e.drawLayer.draw({bbox:r(this,bi).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":r(this,en)},rootClass:{highlight:!0,free:r(this,oe)},path:{d:r(this,bi).toSVGPath()}},!1,!0),f(this,we,e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:r(this,oe)},bbox:r(this,Ne).box,path:{d:r(this,Ne).toSVGPath()}},r(this,oe))),r(this,Ga)&&(r(this,Ga).style.clipPath=r(this,za)))},_i=new WeakSet,No=function([e,i,s,n],a){switch(a){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]},LA=function(e){lt._keyboardManager.exec(this,e)},Cf=function(e){if(!r(this,zl))return;const i=window.getSelection();e?i.setPosition(r(this,zl),r(this,zd)):i.setPosition(r(this,Xd),r(this,qd))},Qh=function(){return r(this,oe)?this.rotation:0},RA=function(){if(r(this,oe))return null;const[e,i]=this.pageDimensions,[s,n]=this.pageTranslation,a=r(this,tn),o=new Float32Array(a.length*8);let l=0;for(const{x:c,y:d,width:u,height:g}of a){const b=c*e+s,w=(1-d)*i+n;o[l]=o[l+4]=b,o[l+1]=o[l+3]=w,o[l+2]=o[l+6]=b+u*e,o[l+5]=o[l+7]=w-g*i,l+=8}return o},MA=function(e){return r(this,bi).serialize(e,p(this,J,Qh).call(this))},kA=function(e,i){this._freeHighlight.add(i)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},DA=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=""},NA=function(e){const{color:i}=this._initialData;return e.color.some((s,n)=>s!==i[n])},m(lt,_i),k(lt,"_defaultColor",null),k(lt,"_defaultOpacity",1),k(lt,"_defaultThickness",12),k(lt,"_type","highlight"),k(lt,"_editorType",Y.HIGHLIGHT),k(lt,"_freeHighlightId",-1),k(lt,"_freeHighlight",null),k(lt,"_freeHighlightClipId","");let ag=lt;var Xa;class FA{constructor(){m(this,Xa,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){r(this,Xa)[t]=e}toSVGProperties(){const t=r(this,Xa);return f(this,Xa,Object.create(null)),{root:t}}reset(){f(this,Xa,Object.create(null))}updateAll(t=this){this.updateProperties(t)}clone(){gt("Not implemented")}}Xa=new WeakMap;var Qe,ql,Zt,qa,Ya,rr,ar,or,Ka,at,vm,ym,Am,Jh,OA,Tf,tc,Fo;const j=class j extends vt{constructor(e){super(e);m(this,at);m(this,Qe,null);m(this,ql);k(this,"_drawId",null);f(this,ql,e.mustBeCommitted||!1),this._addOutlines(e)}_addOutlines(e){e.drawOutlines&&(p(this,at,vm).call(this,e),p(this,at,Jh).call(this))}static _mergeSVGProperties(e,i){const s=new Set(Object.keys(e));for(const[n,a]of Object.entries(i))s.has(n)?Object.assign(e[n],a):e[n]=a;return e}static getDefaultDrawingOptions(e){gt("Not implemented")}static get typesMap(){gt("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&&(r(j,Zt).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,a=n[i],o=l=>{var d;n.updateProperty(i,l);const c=r(this,Qe).updateProperty(i,l);c&&p(this,at,tc).call(this,c),(d=this.parent)==null||d.drawLayer.updateProperties(this._drawId,n.toSVGProperties())};this.addCommands({cmd:o.bind(this,s),undo:o.bind(this,a),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,j._mergeSVGProperties(r(this,Qe).getPathResizingSVGProperties(p(this,at,Tf).call(this)),{bbox:p(this,at,Fo).call(this)}))}_onResized(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,j._mergeSVGProperties(r(this,Qe).getPathResizedSVGProperties(p(this,at,Tf).call(this)),{bbox:p(this,at,Fo).call(this)}))}_onTranslating(e,i){var s;(s=this.parent)==null||s.drawLayer.updateProperties(this._drawId,{bbox:p(this,at,Fo).call(this)})}_onTranslated(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,j._mergeSVGProperties(r(this,Qe).getPathTranslatedSVGProperties(p(this,at,Tf).call(this),this.parentDimensions),{bbox:p(this,at,Fo).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,r(this,ql)&&(f(this,ql,!1),this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){p(this,at,Am).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(p(this,at,Jh).call(this),p(this,at,tc).call(this,r(this,Qe).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){var s;let i=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),p(this,at,Am).call(this)):e&&(this._uiManager.addShouldRescale(this),p(this,at,Jh).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,j._mergeSVGProperties({bbox:p(this,at,Fo).call(this)},r(this,Qe).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&p(this,at,tc).call(this,r(this,Qe).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[a,o]=this.parentDimensions;return this.setDims(this.width*a,this.height*o),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,i),s}static createDrawerInstance(e,i,s,n,a){gt("Not implemented")}static startDrawing(e,i,s,n){var y,A;const{target:a,offsetX:o,offsetY:l,pointerId:c,pointerType:d}=n;if(r(j,ar)&&r(j,ar)!==d)return;const{viewport:{rotation:u}}=e,{width:g,height:b}=a.getBoundingClientRect(),w=f(j,qa,new AbortController),v=e.combinedSignal(w);if(r(j,rr)||f(j,rr,c),(y=r(j,ar))!=null||f(j,ar,d),window.addEventListener("pointerup",E=>{var _;r(j,rr)===E.pointerId?this._endDraw(E):(_=r(j,or))==null||_.delete(E.pointerId)},{signal:v}),window.addEventListener("pointercancel",E=>{var _;r(j,rr)===E.pointerId?this._currentParent.endDrawingSession():(_=r(j,or))==null||_.delete(E.pointerId)},{signal:v}),window.addEventListener("pointerdown",E=>{r(j,ar)===E.pointerType&&((r(j,or)||f(j,or,new Set)).add(E.pointerId),r(j,Zt).isCancellable()&&(r(j,Zt).removeLastElement(),r(j,Zt).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:v}),window.addEventListener("contextmenu",Wi,{signal:v}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:v}),a.addEventListener("touchmove",E=>{E.timeStamp===r(j,Ka)&&Vt(E)},{signal:v}),e.toggleDrawing(),(A=i._editorUndoBar)==null||A.hide(),r(j,Zt)){e.drawLayer.updateProperties(this._currentDrawId,r(j,Zt).startNew(o,l,g,b,u));return}i.updateUIForDefaultProperties(this),f(j,Zt,this.createDrawerInstance(o,l,g,b,u)),f(j,Ya,this.getDefaultDrawingOptions()),this._currentParent=e,{id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(r(j,Ya).toSVGProperties(),r(j,Zt).defaultSVGProperties),!0,!1)}static _drawMove(e){var a;if(f(j,Ka,-1),!r(j,Zt))return;const{offsetX:i,offsetY:s,pointerId:n}=e;if(r(j,rr)===n){if(((a=r(j,or))==null?void 0:a.size)>=1){this._endDraw(e);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,r(j,Zt).add(i,s)),f(j,Ka,e.timeStamp),Vt(e)}}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,f(j,Zt,null),f(j,Ya,null),f(j,ar,null),f(j,Ka,NaN)),r(j,qa)&&(r(j,qa).abort(),f(j,qa,null),f(j,rr,NaN),f(j,or,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,r(j,Zt).end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){const s=r(j,Zt),n=this._currentDrawId,a=s.getLastElement();i.addCommands({cmd:()=>{i.drawLayer.updateProperties(n,s.setLastElement(a))},undo:()=>{i.drawLayer.updateProperties(n,s.removeLastElement())},mustExec:!1,type:st.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(e){const i=this._currentParent;if(!i)return null;if(i.toggleDrawing(!0),i.cleanUndoStack(st.DRAW_STEP),!r(j,Zt).isEmpty()){const{pageDimensions:[s,n],scale:a}=i,o=i.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:r(j,Zt).getOutlines(s*a,n*a,a,this._INNER_MARGIN),drawingOptions:r(j,Ya),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,a,o){gt("Not implemented")}static async deserialize(e,i,s){var u,g;const{rawDims:{pageWidth:n,pageHeight:a,pageX:o,pageY:l}}=i.viewport,c=this.deserializeDraw(o,l,n,a,this._INNER_MARGIN,e),d=await super.deserialize(e,i,s);return d.createDrawingOptions(e),p(u=d,at,vm).call(u,{drawOutlines:c}),p(g=d,at,Jh).call(g),d.onScaleChanging(),d.rotate(),d}serializeDraw(e){const[i,s]=this.pageTranslation,[n,a]=this.pageDimensions;return r(this,Qe).serialize([i,s,n,a],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};Qe=new WeakMap,ql=new WeakMap,Zt=new WeakMap,qa=new WeakMap,Ya=new WeakMap,rr=new WeakMap,ar=new WeakMap,or=new WeakMap,Ka=new WeakMap,at=new WeakSet,vm=function({drawOutlines:e,drawId:i,drawingOptions:s}){f(this,Qe,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=p(this,at,ym).call(this,e,this.parent),p(this,at,tc).call(this,e.box)},ym=function(e,i){const{id:s}=i.drawLayer.draw(j._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return s},Am=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},Jh=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=p(this,at,ym).call(this,r(this,Qe),e)}},OA=function([e,i,s,n]){const{parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[i,1-e,s*(o/a),n*(a/o)];case 180:return[1-e,1-i,s,n];case 270:return[1-i,e,s*(o/a),n*(a/o)];default:return[e,i,s,n]}},Tf=function(){const{x:e,y:i,width:s,height:n,parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[1-i,e,s*(a/o),n*(o/a)];case 180:return[1-e,1-i,s,n];case 270:return[i,1-e,s*(a/o),n*(o/a)];default:return[e,i,s,n]}},tc=function(e){if([this.x,this.y,this.width,this.height]=p(this,at,OA).call(this,e),this.div){this.fixAndSetPosition();const[i,s]=this.parentDimensions;this.setDims(this.width*i,this.height*s)}this._onResized()},Fo=function(){const{x:e,y:i,width:s,height:n,rotation:a,parentRotation:o,parentDimensions:[l,c]}=this;switch((a*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]}},k(j,"_currentDrawId",-1),k(j,"_currentParent",null),m(j,Zt,null),m(j,qa,null),m(j,Ya,null),m(j,rr,NaN),m(j,ar,null),m(j,or,null),m(j,Ka,NaN),k(j,"_INNER_MARGIN",3);let og=j;var ls,Qt,Jt,Za,Yl,_e,le,vi,Qa,Ja,to,Kl,If;class TS{constructor(t,e,i,s,n,a){m(this,Kl);m(this,ls,new Float64Array(6));m(this,Qt);m(this,Jt);m(this,Za);m(this,Yl);m(this,_e);m(this,le,"");m(this,vi,0);m(this,Qa,new Uu);m(this,Ja);m(this,to);f(this,Ja,i),f(this,to,s),f(this,Za,n),f(this,Yl,a),[t,e]=p(this,Kl,If).call(this,t,e);const o=f(this,Qt,[NaN,NaN,NaN,NaN,t,e]);f(this,_e,[t,e]),f(this,Jt,[{line:o,points:r(this,_e)}]),r(this,ls).set(o,0)}updateProperty(t,e){t==="stroke-width"&&f(this,Yl,e)}isEmpty(){return!r(this,Jt)||r(this,Jt).length===0}isCancellable(){return r(this,_e).length<=10}add(t,e){[t,e]=p(this,Kl,If).call(this,t,e);const[i,s,n,a]=r(this,ls).subarray(2,6),o=t-n,l=e-a;return Math.hypot(r(this,Ja)*o,r(this,to)*l)<=2?null:(r(this,_e).push(t,e),isNaN(i)?(r(this,ls).set([n,a,t,e],2),r(this,Qt).push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(r(this,ls)[0])&&r(this,Qt).splice(6,6),r(this,ls).set([i,s,n,a,t,e],0),r(this,Qt).push(...H.createBezierPoints(i,s,n,a,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const i=this.add(t,e);return i||(r(this,_e).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,i,s,n){f(this,Ja,i),f(this,to,s),f(this,Za,n),[t,e]=p(this,Kl,If).call(this,t,e);const a=f(this,Qt,[NaN,NaN,NaN,NaN,t,e]);f(this,_e,[t,e]);const o=r(this,Jt).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),r(this,Jt).push({line:a,points:r(this,_e)}),r(this,ls).set(a,0),f(this,vi,0),this.toSVGPath(),null}getLastElement(){return r(this,Jt).at(-1)}setLastElement(t){return r(this,Jt)?(r(this,Jt).push(t),f(this,Qt,t.line),f(this,_e,t.points),f(this,vi,0),{path:{d:this.toSVGPath()}}):r(this,Qa).setLastElement(t)}removeLastElement(){if(!r(this,Jt))return r(this,Qa).removeLastElement();r(this,Jt).pop(),f(this,le,"");for(let t=0,e=r(this,Jt).length;t<e;t++){const{line:i,points:s}=r(this,Jt)[t];f(this,Qt,i),f(this,_e,s),f(this,vi,0),this.toSVGPath()}return{path:{d:r(this,le)}}}toSVGPath(){const t=H.svgRound(r(this,Qt)[4]),e=H.svgRound(r(this,Qt)[5]);if(r(this,_e).length===2)return f(this,le,"".concat(r(this,le)," M ").concat(t," ").concat(e," Z")),r(this,le);if(r(this,_e).length<=6){const s=r(this,le).lastIndexOf("M");f(this,le,"".concat(r(this,le).slice(0,s)," M ").concat(t," ").concat(e)),f(this,vi,6)}if(r(this,_e).length===4){const s=H.svgRound(r(this,Qt)[10]),n=H.svgRound(r(this,Qt)[11]);return f(this,le,"".concat(r(this,le)," L ").concat(s," ").concat(n)),f(this,vi,12),r(this,le)}const i=[];r(this,vi)===0&&(i.push("M ".concat(t," ").concat(e)),f(this,vi,6));for(let s=r(this,vi),n=r(this,Qt).length;s<n;s+=6){const[a,o,l,c,d,u]=r(this,Qt).slice(s,s+6).map(H.svgRound);i.push("C".concat(a," ").concat(o," ").concat(l," ").concat(c," ").concat(d," ").concat(u))}return f(this,le,r(this,le)+i.join(" ")),f(this,vi,r(this,Qt).length),r(this,le)}getOutlines(t,e,i,s){const n=r(this,Jt).at(-1);return n.line=new Float32Array(n.line),n.points=new Float32Array(n.points),r(this,Qa).build(r(this,Jt),t,e,i,r(this,Za),r(this,Yl),s),f(this,ls,null),f(this,Qt,null),f(this,Jt,null),f(this,le,null),r(this,Qa)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}ls=new WeakMap,Qt=new WeakMap,Jt=new WeakMap,Za=new WeakMap,Yl=new WeakMap,_e=new WeakMap,le=new WeakMap,vi=new WeakMap,Qa=new WeakMap,Ja=new WeakMap,to=new WeakMap,Kl=new WeakSet,If=function(t,e){return H._normalizePoint(t,e,r(this,Ja),r(this,to),r(this,Za))};var Ee,Kd,Zd,Je,hs,cs,Zl,Ql,eo,ue,xs,BA,VA,HA;class Uu extends H{constructor(){super(...arguments);m(this,ue);m(this,Ee);m(this,Kd,0);m(this,Zd);m(this,Je);m(this,hs);m(this,cs);m(this,Zl);m(this,Ql);m(this,eo)}build(e,i,s,n,a,o,l){f(this,hs,i),f(this,cs,s),f(this,Zl,n),f(this,Ql,a),f(this,eo,o),f(this,Zd,l!=null?l:0),f(this,Je,e),p(this,ue,VA).call(this)}get thickness(){return r(this,eo)}setLastElement(e){return r(this,Je).push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return r(this,Je).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const e=[];for(const{line:i}of r(this,Je)){if(e.push("M".concat(H.svgRound(i[4])," ").concat(H.svgRound(i[5]))),i.length===6){e.push("Z");continue}if(i.length===12&&isNaN(i[6])){e.push("L".concat(H.svgRound(i[10])," ").concat(H.svgRound(i[11])));continue}for(let s=6,n=i.length;s<n;s+=6){const[a,o,l,c,d,u]=i.subarray(s,s+6).map(H.svgRound);e.push("C".concat(a," ").concat(o," ").concat(l," ").concat(c," ").concat(d," ").concat(u))}}return e.join("")}serialize([e,i,s,n],a){const o=[],l=[],[c,d,u,g]=p(this,ue,BA).call(this);let b,w,v,y,A,E,_,S,P;switch(r(this,Ql)){case 0:P=H._rescale,b=e,w=i+n,v=s,y=-n,A=e+c*s,E=i+(1-d-g)*n,_=e+(c+u)*s,S=i+(1-d)*n;break;case 90:P=H._rescaleAndSwap,b=e,w=i,v=s,y=n,A=e+d*s,E=i+c*n,_=e+(d+g)*s,S=i+(c+u)*n;break;case 180:P=H._rescale,b=e+s,w=i,v=-s,y=n,A=e+(1-c-u)*s,E=i+d*n,_=e+(1-c)*s,S=i+(d+g)*n;break;case 270:P=H._rescaleAndSwap,b=e+s,w=i+n,v=-s,y=-n,A=e+(1-d-g)*s,E=i+(1-c-u)*n,_=e+(1-d)*s,S=i+(1-c)*n;break}for(const{line:x,points:T}of r(this,Je))o.push(P(x,b,w,v,y,a?new Array(x.length):null)),l.push(P(T,b,w,v,y,a?new Array(T.length):null));return{lines:o,points:l,rect:[A,E,_,S]}}static deserialize(e,i,s,n,a,{paths:{lines:o,points:l},rotation:c,thickness:d}){const u=[];let g,b,w,v,y;switch(c){case 0:y=H._rescale,g=-e/s,b=i/n+1,w=1/s,v=-1/n;break;case 90:y=H._rescaleAndSwap,g=-i/n,b=-e/s,w=1/n,v=1/s;break;case 180:y=H._rescale,g=e/s+1,b=-i/n,w=-1/s,v=1/n;break;case 270:y=H._rescaleAndSwap,g=i/n+1,b=e/s+1,w=-1/n,v=-1/s;break}if(!o){o=[];for(const E of l){const _=E.length;if(_===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,E[0],E[1]]));continue}if(_===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,E[0],E[1],NaN,NaN,NaN,NaN,E[2],E[3]]));continue}const S=new Float32Array(3*(_-2));o.push(S);let[P,x,T,I]=E.subarray(0,4);S.set([NaN,NaN,NaN,NaN,P,x],0);for(let C=4;C<_;C+=2){const L=E[C],M=E[C+1];S.set(H.createBezierPoints(P,x,T,I,L,M),(C-2)*3),[P,x,T,I]=[T,I,L,M]}}}for(let E=0,_=o.length;E<_;E++)u.push({line:y(o[E].map(S=>S!=null?S:NaN),g,b,w,v),points:y(l[E].map(S=>S!=null?S:NaN),g,b,w,v)});const A=new this.prototype.constructor;return A.build(u,s,n,1,c,d,a),A}get box(){return r(this,Ee)}updateProperty(e,i){return e==="stroke-width"?p(this,ue,HA).call(this,i):null}updateParentDimensions([e,i],s){const[n,a]=p(this,ue,xs).call(this);f(this,hs,e),f(this,cs,i),f(this,Zl,s);const[o,l]=p(this,ue,xs).call(this),c=o-n,d=l-a,u=r(this,Ee);return u[0]-=c,u[1]-=d,u[2]+=2*c,u[3]+=2*d,u}updateRotation(e){return f(this,Kd,e),{path:{transform:this.rotationTransform}}}get viewBox(){return r(this,Ee).map(H.svgRound).join(" ")}get defaultProperties(){const[e,i]=r(this,Ee);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(H.svgRound(e)," ").concat(H.svgRound(i))}}}get rotationTransform(){const[,,e,i]=r(this,Ee);let s=0,n=0,a=0,o=0,l=0,c=0;switch(r(this,Kd)){case 90:n=i/e,a=-e/i,l=e;break;case 180:s=-1,o=-1,l=e,c=i;break;case 270:n=-i/e,a=e/i,c=i;break;default:return""}return"matrix(".concat(s," ").concat(n," ").concat(a," ").concat(o," ").concat(H.svgRound(l)," ").concat(H.svgRound(c),")")}getPathResizingSVGProperties([e,i,s,n]){const[a,o]=p(this,ue,xs).call(this),[l,c,d,u]=r(this,Ee);if(Math.abs(d-a)<=H.PRECISION||Math.abs(u-o)<=H.PRECISION){const y=e+s/2-(l+d/2),A=i+n/2-(c+u/2);return{path:{"transform-origin":"".concat(H.svgRound(e)," ").concat(H.svgRound(i)),transform:"".concat(this.rotationTransform," translate(").concat(y," ").concat(A,")")}}}const g=(s-2*a)/(d-2*a),b=(n-2*o)/(u-2*o),w=d/s,v=u/n;return{path:{"transform-origin":"".concat(H.svgRound(l)," ").concat(H.svgRound(c)),transform:"".concat(this.rotationTransform," scale(").concat(w," ").concat(v,") ")+"translate(".concat(H.svgRound(a)," ").concat(H.svgRound(o),") scale(").concat(g," ").concat(b,") ")+"translate(".concat(H.svgRound(-a)," ").concat(H.svgRound(-o),")")}}}getPathResizedSVGProperties([e,i,s,n]){const[a,o]=p(this,ue,xs).call(this),l=r(this,Ee),[c,d,u,g]=l;if(l[0]=e,l[1]=i,l[2]=s,l[3]=n,Math.abs(u-a)<=H.PRECISION||Math.abs(g-o)<=H.PRECISION){const A=e+s/2-(c+u/2),E=i+n/2-(d+g/2);for(const{line:_,points:S}of r(this,Je))H._translate(_,A,E,_),H._translate(S,A,E,S);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(H.svgRound(e)," ").concat(H.svgRound(i)),transform:this.rotationTransform||null,d:this.toSVGPath()}}}const b=(s-2*a)/(u-2*a),w=(n-2*o)/(g-2*o),v=-b*(c+a)+e+a,y=-w*(d+o)+i+o;if(b!==1||w!==1||v!==0||y!==0)for(const{line:A,points:E}of r(this,Je))H._rescale(A,v,y,b,w,A),H._rescale(E,v,y,b,w,E);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(H.svgRound(e)," ").concat(H.svgRound(i)),transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,i],s){const[n,a]=s,o=r(this,Ee),l=e-o[0],c=i-o[1];if(r(this,hs)===n&&r(this,cs)===a)for(const{line:d,points:u}of r(this,Je))H._translate(d,l,c,d),H._translate(u,l,c,u);else{const d=r(this,hs)/n,u=r(this,cs)/a;f(this,hs,n),f(this,cs,a);for(const{line:g,points:b}of r(this,Je))H._rescale(g,l,c,d,u,g),H._rescale(b,l,c,d,u,b);o[2]*=d,o[3]*=u}return o[0]=e,o[1]=i,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":"".concat(H.svgRound(e)," ").concat(H.svgRound(i))}}}get defaultSVGProperties(){const e=r(this,Ee);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":"".concat(H.svgRound(e[0])," ").concat(H.svgRound(e[1])),transform:this.rotationTransform||null},bbox:e}}}Ee=new WeakMap,Kd=new WeakMap,Zd=new WeakMap,Je=new WeakMap,hs=new WeakMap,cs=new WeakMap,Zl=new WeakMap,Ql=new WeakMap,eo=new WeakMap,ue=new WeakSet,xs=function(e=r(this,eo)){const i=r(this,Zd)+e/2*r(this,Zl);return r(this,Ql)%180===0?[i/r(this,hs),i/r(this,cs)]:[i/r(this,cs),i/r(this,hs)]},BA=function(){const[e,i,s,n]=r(this,Ee),[a,o]=p(this,ue,xs).call(this,0);return[e+a,i+o,s-2*a,n-2*o]},VA=function(){const e=f(this,Ee,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:n}of r(this,Je)){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 a=n[4],o=n[5];for(let l=6,c=n.length;l<c;l+=6){const[d,u,g,b,w,v]=n.subarray(l,l+6);q.bezierBoundingBox(a,o,d,u,g,b,w,v,e),a=w,o=v}}const[i,s]=p(this,ue,xs).call(this);e[0]=Te(e[0]-i,0,1),e[1]=Te(e[1]-s,0,1),e[2]=Te(e[2]+i,0,1),e[3]=Te(e[3]+s,0,1),e[2]-=e[0],e[3]-=e[1]},HA=function(e){const[i,s]=p(this,ue,xs).call(this);f(this,eo,e);const[n,a]=p(this,ue,xs).call(this),[o,l]=[n-i,a-s],c=r(this,Ee);return c[0]-=o,c[1]-=l,c[2]+=2*o,c[3]+=2*l,c};class Hg extends FA{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:vt._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 Hg(this._viewParameters);return t.updateAll(this),t}}var Ig,jA;const zo=class zo extends og{constructor(e){super({...e,name:"inkEditor"});m(this,Ig);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,i){vt.initialize(e,i),this._defaultDrawingOptions=new Hg(i.viewParameters)}static getDefaultDrawingOptions(e){const i=this._defaultDrawingOptions.clone();return i.updateProperties(e),i}static get supportMultipleDrawings(){return!0}static get typesMap(){return nt(this,"typesMap",new Map([[st.INK_THICKNESS,"stroke-width"],[st.INK_COLOR,"stroke"],[st.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,i,s,n,a){return new TS(e,i,s,n,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,i,s,n,a,o){return Uu.deserialize(e,i,s,n,a,o)}static async deserialize(e,i,s){let n=null;if(e instanceof Ob){const{data:{inkLists:o,rect:l,rotation:c,id:d,color:u,opacity:g,borderStyle:{rawWidth:b},popupRef:w},parent:{page:{pageNumber:v}}}=e;n=e={annotationType:Y.INK,color:Array.from(u),thickness:b,opacity:g,paths:{points:o},boxes:null,pageIndex:v-1,rect:l.slice(0),rotation:c,annotationElementId:d,id:d,deleted:!1,popupRef:w}}const a=await super.deserialize(e,i,s);return a._initialData=n,a}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=zo.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:a,"stroke-opacity":o,"stroke-width":l}}=this,c={annotationType:Y.INK,color:vt._colorManager.convert(a),opacity:o,thickness:l,paths:{lines:i,points:s},pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?(c.isCopy=!0,c):this.annotationElementId&&!p(this,Ig,jA).call(this,c)?null:(c.id=this.annotationElementId,c)}renderAnnotationElement(e){const{points:i,rect:s}=this.serializeDraw(!1);return e.updateEdited({rect:s,thickness:this._drawingOptions["stroke-width"],points:i}),null}};Ig=new WeakSet,jA=function(e){const{color:i,thickness:s,opacity:n,pageIndex:a}=this._initialData;return this._hasBeenMoved||this._hasBeenResized||e.color.some((o,l)=>o!==i[l])||e.thickness!==s||e.opacity!==n||e.pageIndex!==a},k(zo,"_type","ink"),k(zo,"_editorType",Y.INK),k(zo,"_defaultDrawingOptions",null);let _m=zo;class Em extends Uu{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}const Ku=8,Dh=3;var Oh,io,ct,Sm,Di,$A,UA,Pm,Lf,WA,zA,GA,xm,Cm,XA;let Oo=(Oh=class{static extractContoursFromText(t,{fontFamily:e,fontStyle:i,fontWeight:s},n,a,o,l){let c=new OffscreenCanvas(1,1),d=c.getContext("2d",{alpha:!1});const u=200,g=d.font="".concat(i," ").concat(s," ").concat(u,"px ").concat(e),{actualBoundingBoxLeft:b,actualBoundingBoxRight:w,actualBoundingBoxAscent:v,actualBoundingBoxDescent:y,fontBoundingBoxAscent:A,fontBoundingBoxDescent:E,width:_}=d.measureText(t),S=1.5,P=Math.ceil(Math.max(Math.abs(b)+Math.abs(w)||0,_)*S),x=Math.ceil(Math.max(Math.abs(v)+Math.abs(y)||u,Math.abs(A)+Math.abs(E)||u)*S);c=new OffscreenCanvas(P,x),d=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),d.font=g,d.filter="grayscale(1)",d.fillStyle="white",d.fillRect(0,0,P,x),d.fillStyle="black",d.fillText(t,P*(S-1)/2,x*(3-S)/2);const T=p(this,ct,xm).call(this,d.getImageData(0,0,P,x).data),I=p(this,ct,GA).call(this,T),C=p(this,ct,Cm).call(this,I),L=p(this,ct,Pm).call(this,T,P,x,C);return this.processDrawnLines({lines:{curves:L,width:P,height:x},pageWidth:n,pageHeight:a,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(t,e,i,s,n){const[a,o,l]=p(this,ct,XA).call(this,t),[c,d]=p(this,ct,zA).call(this,a,o,l,Math.hypot(o,l)*r(this,io).sigmaSFactor,r(this,io).sigmaR,r(this,io).kernelSize),u=p(this,ct,Cm).call(this,d),g=p(this,ct,Pm).call(this,c,o,l,u);return this.processDrawnLines({lines:{curves:g,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:a,areContours:o}){var E;s%180!==0&&([e,i]=[i,e]);const{curves:l,width:c,height:d}=t,u=(E=t.thickness)!=null?E:0,g=[],b=Math.min(e/c,i/d),w=b/e,v=b/i,y=[];for(const{points:_}of l){const S=a?p(this,ct,WA).call(this,_):_;if(!S)continue;y.push(S);const P=S.length,x=new Float32Array(P),T=new Float32Array(3*(P===2?2:P-2));if(g.push({line:T,points:x}),P===2){x[0]=S[0]*w,x[1]=S[1]*v,T.set([NaN,NaN,NaN,NaN,x[0],x[1]],0);continue}let[I,C,L,M]=S;I*=w,C*=v,L*=w,M*=v,x.set([I,C,L,M],0),T.set([NaN,NaN,NaN,NaN,I,C],0);for(let G=4;G<P;G+=2){const W=x[G]=S[G]*w,$=x[G+1]=S[G+1]*v;T.set(H.createBezierPoints(I,C,L,M,W,$),(G-2)*3),[I,C,L,M]=[L,M,W,$]}}if(g.length===0)return null;const A=o?new Em:new Uu;return A.build(g,e,i,1,s,o?0:u,n),{outline:A,newCurves:y,areContours:o,thickness:u,width:c,height:d}}static async compressSignature({outlines:t,areContours:e,thickness:i,width:s,height:n}){let a=1/0,o=-1/0,l=0;for(const _ of t){l+=_.length;for(let S=2,P=_.length;S<P;S++){const x=_[S]-_[S-2];a=Math.min(a,x),o=Math.max(o,x)}}let c;a>=-128&&o<=127?c=Int8Array:a>=-32768&&o<=32767?c=Int16Array:c=Int32Array;const d=t.length,u=Ku+Dh*d,g=new Uint32Array(u);let b=0;g[b++]=u*Uint32Array.BYTES_PER_ELEMENT+(l-2*d)*c.BYTES_PER_ELEMENT,g[b++]=0,g[b++]=s,g[b++]=n,g[b++]=e?0:1,g[b++]=Math.max(0,Math.floor(i!=null?i:0)),g[b++]=d,g[b++]=c.BYTES_PER_ELEMENT;for(const _ of t)g[b++]=_.length-2,g[b++]=_[0],g[b++]=_[1];const w=new CompressionStream("deflate-raw"),v=w.writable.getWriter();await v.ready,v.write(g);const y=c.prototype.constructor;for(const _ of t){const S=new y(_.length-2);for(let P=2,x=_.length;P<x;P++)S[P-2]=_[P]-_[P-2];v.write(S)}v.close();const A=await new Response(w.readable).arrayBuffer(),E=new Uint8Array(A);return Uv(E)}static async decompressSignature(t){try{const e=J_(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 a=null,o=0;for await(const _ of i)a||(a=new Uint8Array(new Uint32Array(_.buffer,0,4)[0])),a.set(_,o),o+=_.length;const l=new Uint32Array(a.buffer,0,a.length>>2),c=l[1];if(c!==0)throw new Error("Invalid version: ".concat(c));const d=l[2],u=l[3],g=l[4]===0,b=l[5],w=l[6],v=l[7],y=[],A=(Ku+Dh*w)*Uint32Array.BYTES_PER_ELEMENT;let E;switch(v){case Int8Array.BYTES_PER_ELEMENT:E=new Int8Array(a.buffer,A);break;case Int16Array.BYTES_PER_ELEMENT:E=new Int16Array(a.buffer,A);break;case Int32Array.BYTES_PER_ELEMENT:E=new Int32Array(a.buffer,A);break}o=0;for(let _=0;_<w;_++){const S=l[Dh*_+Ku],P=new Float32Array(S+2);y.push(P);for(let x=0;x<Dh-1;x++)P[x]=l[Dh*_+Ku+x+1];for(let x=0;x<S;x++)P[x+2]=P[x]+E[o++]}return{areContours:g,thickness:b,outlines:y,width:d,height:u}}catch(e){return Z("decompressSignature: ".concat(e)),null}}},io=new WeakMap,ct=new WeakSet,Sm=function(t,e,i,s){return i-=t,s-=e,i===0?s>0?0:4:i===1?s+6:2-s},Di=new WeakMap,$A=function(t,e,i,s,n,a,o){const l=p(this,ct,Sm).call(this,i,s,n,a);for(let c=0;c<8;c++){const d=(-c+l-o+16)%8,u=r(this,Di)[2*d],g=r(this,Di)[2*d+1];if(t[(i+u)*e+(s+g)]!==0)return d}return-1},UA=function(t,e,i,s,n,a,o){const l=p(this,ct,Sm).call(this,i,s,n,a);for(let c=0;c<8;c++){const d=(c+l+o+16)%8,u=r(this,Di)[2*d],g=r(this,Di)[2*d+1];if(t[(i+u)*e+(s+g)]!==0)return d}return-1},Pm=function(t,e,i,s){const n=t.length,a=new Int32Array(n);for(let d=0;d<n;d++)a[d]=t[d]<=s?1:0;for(let d=1;d<i-1;d++)a[d*e]=a[d*e+e-1]=0;for(let d=0;d<e;d++)a[d]=a[e*i-1-d]=0;let o=1,l;const c=[];for(let d=1;d<i-1;d++){l=1;for(let u=1;u<e-1;u++){const g=d*e+u,b=a[g];if(b===0)continue;let w=d,v=u;if(b===1&&a[g-1]===0)o+=1,v-=1;else if(b>=1&&a[g+1]===0)o+=1,v+=1,b>1&&(l=b);else{b!==1&&(l=Math.abs(b));continue}const y=[u,d],A=v===u+1,E={isHole:A,points:y,id:o,parent:0};c.push(E);let _;for(const M of c)if(M.id===l){_=M;break}_?_.isHole?E.parent=A?_.parent:l:E.parent=A?l:_.parent:E.parent=A?l:0;const S=p(this,ct,$A).call(this,a,e,d,u,w,v,0);if(S===-1){a[g]=-o,a[g]!==1&&(l=Math.abs(a[g]));continue}let P=r(this,Di)[2*S],x=r(this,Di)[2*S+1];const T=d+P,I=u+x;w=T,v=I;let C=d,L=u;for(;;){const M=p(this,ct,UA).call(this,a,e,C,L,w,v,1);P=r(this,Di)[2*M],x=r(this,Di)[2*M+1];const G=C+P,W=L+x;y.push(W,G);const $=C*e+L;if(a[$+1]===0?a[$]=-o:a[$]===1&&(a[$]=o),G===d&&W===u&&C===T&&L===I){a[g]!==1&&(l=Math.abs(a[g]));break}else w=C,v=L,C=G,L=W}}}return c},Lf=function(t,e,i,s){if(i-e<=4){for(let T=e;T<i-2;T+=2)s.push(t[T],t[T+1]);return}const n=t[e],a=t[e+1],o=t[i-4]-n,l=t[i-3]-a,c=Math.hypot(o,l),d=o/c,u=l/c,g=d*a-u*n,b=l/o,w=1/c,v=Math.atan(b),y=Math.cos(v),A=Math.sin(v),E=w*(Math.abs(y)+Math.abs(A)),_=w*(1-E+E**2),S=Math.max(Math.atan(Math.abs(A+y)*_),Math.atan(Math.abs(A-y)*_));let P=0,x=e;for(let T=e+2;T<i-2;T+=2){const I=Math.abs(g-d*t[T+1]+u*t[T]);I>P&&(x=T,P=I)}P>(c*S)**2?(p(this,ct,Lf).call(this,t,e,x+2,s),p(this,ct,Lf).call(this,t,x,i,s)):s.push(n,a)},WA=function(t){const e=[],i=t.length;return p(this,ct,Lf).call(this,t,0,i,e),e.push(t[i-2],t[i-1]),e.length<=4?null:e},zA=function(t,e,i,s,n,a){const o=new Float32Array(a**2),l=-2*s**2,c=a>>1;for(let v=0;v<a;v++){const y=(v-c)**2;for(let A=0;A<a;A++)o[v*a+A]=Math.exp((y+(A-c)**2)/l)}const d=new Float32Array(256),u=-2*n**2;for(let v=0;v<256;v++)d[v]=Math.exp(v**2/u);const g=t.length,b=new Uint8Array(g),w=new Uint32Array(256);for(let v=0;v<i;v++)for(let y=0;y<e;y++){const A=v*e+y,E=t[A];let _=0,S=0;for(let x=0;x<a;x++){const T=v+x-c;if(!(T<0||T>=i))for(let I=0;I<a;I++){const C=y+I-c;if(C<0||C>=e)continue;const L=t[T*e+C],M=o[x*a+I]*d[Math.abs(L-E)];_+=L*M,S+=M}}const P=b[A]=Math.round(_/S);w[P]++}return[b,w]},GA=function(t){const e=new Uint32Array(256);for(const i of t)e[i]++;return e},xm=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++){if(t[(o<<2)+3]===0){s=i[o]=255;continue}const d=i[o]=t[o<<2];d>s&&(s=d),d<n&&(n=d)}const a=255/(s-n);for(let o=0;o<e;o++)i[o]=(i[o]-n)*a;return i},Cm=function(t){let e,i=-1/0,s=-1/0;const n=t.findIndex(l=>l!==0);let a=n,o=n;for(e=n;e<256;e++){const l=t[e];l>i&&(e-a>s&&(s=e-a,o=e-1),i=l,a=e)}for(e=o-1;e>=0&&!(t[e]>t[e+1]);e--);return e},XA=function(t){const e=t,{width:i,height:s}=t,{maxDim:n}=r(this,io);let a=i,o=s;if(i>n||s>n){let g=i,b=s,w=Math.log2(Math.max(i,s)/n);const v=Math.floor(w);w=w===v?v-1:v;for(let A=0;A<w;A++){a=Math.ceil(g/2),o=Math.ceil(b/2);const E=new OffscreenCanvas(a,o);E.getContext("2d").drawImage(t,0,0,g,b,0,0,a,o),g=a,b=o,t!==e&&t.close(),t=E.transferToImageBitmap()}const y=Math.min(n/a,n/o);a=Math.round(a*y),o=Math.round(o*y)}const c=new OffscreenCanvas(a,o).getContext("2d",{willReadFrequently:!0});c.filter="grayscale(1)",c.drawImage(t,0,0,t.width,t.height,0,0,a,o);const d=c.getImageData(0,0,a,o).data;return[p(this,ct,xm).call(this,d),a,o]},m(Oh,ct),m(Oh,io,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),m(Oh,Di,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1])),Oh);class Bb extends FA{constructor(){super(),super.updateProperties({fill:vt._defaultLineColor,"stroke-width":0})}clone(){const t=new Bb;return t.updateAll(this),t}}class Vb extends Hg{constructor(t){super(t),super.updateProperties({stroke:vt._defaultLineColor,"stroke-width":1})}clone(){const t=new Vb(this._viewParameters);return t.updateAll(this),t}}var lr,ds,hr,so;const je=class je extends og{constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"});m(this,lr,!1);m(this,ds,null);m(this,hr,null);m(this,so,null);this._willKeepAspectRatio=!0,f(this,hr,e.signatureData||null),f(this,ds,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,i){vt.initialize(e,i),this._defaultDrawingOptions=new Bb,this._defaultDrawnSignatureOptions=new Vb(i.viewParameters)}static getDefaultDrawingOptions(e){const i=this._defaultDrawingOptions.clone();return i.updateProperties(e),i}static get supportMultipleDrawings(){return!1}static get typesMap(){return nt(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!r(this,ds)}}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(r(this,hr)){const{lines:n,mustSmooth:a,areContours:o,description:l,uuid:c,heightInPage:d}=r(this,hr),{rawDims:{pageWidth:u,pageHeight:g},rotation:b}=this.parent.viewport,w=Oo.processDrawnLines({lines:n,pageWidth:u,pageHeight:g,rotation:b,innerMargin:je._INNER_MARGIN,mustSmooth:a,areContours:o});this.addSignature(w,d,l,c)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);return s&&(this._isCopy=!0,this._moveAfterPaste(e,i)),this.div}setUuid(e){f(this,so,e),this.addEditToolbar()}getUuid(){return r(this,so)}get description(){return r(this,ds)}set description(e){f(this,ds,e),super.addEditToolbar().then(i=>{i==null||i.updateEditSignatureButton(e)})}getSignaturePreview(){const{newCurves:e,areContours:i,thickness:s,width:n,height:a}=r(this,hr),o=Math.max(n,a),l=Oo.processDrawnLines({lines:{curves:e.map(c=>({points:c})),thickness:s,width:n,height:a},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:a,y:o}=this,{outline:l}=f(this,hr,e);f(this,lr,l instanceof Em),this.description=s,this.div.setAttribute("data-l10n-args",JSON.stringify({description:s}));let c;r(this,lr)?c=je.getDefaultDrawingOptions():(c=je._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":l.thickness})),this._addOutlines({drawOutlines:l,drawingOptions:c});const[d,u]=this.parentDimensions,[,g]=this.pageDimensions;let b=i/g;b=b>=1?.5:b,this.width*=b/this.height,this.width>=1&&(b*=.9/this.width,this.width=.9),this.height=b,this.setDims(d*this.width,u*this.height),this.x=a,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 Oo.process(e,i,s,n,je._INNER_MARGIN)}getFromText(e,i){const{rawDims:{pageWidth:s,pageHeight:n},rotation:a}=this.parent.viewport;return Oo.extractContoursFromText(e,i,s,n,a,je._INNER_MARGIN)}getDrawnSignature(e){const{rawDims:{pageWidth:i,pageHeight:s},rotation:n}=this.parent.viewport;return Oo.processDrawnLines({lines:e,pageWidth:i,pageHeight:s,rotation:n,innerMargin:je._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:i}){e?this._drawingOptions=je.getDefaultDrawingOptions():(this._drawingOptions=je._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":a}}=this,o={annotationType:Y.SIGNATURE,isSignature:!0,areContours:r(this,lr),color:[0,0,0],thickness:r(this,lr)?0:a,pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?(o.paths={lines:i,points:s},o.uuid=r(this,so),o.isCopy=!0):o.lines=i,r(this,ds)&&(o.accessibilityData={type:"Figure",alt:r(this,ds)}),o}static deserializeDraw(e,i,s,n,a,o){return o.areContours?Em.deserialize(e,i,s,n,a,o):Uu.deserialize(e,i,s,n,a,o)}static async deserialize(e,i,s){var a;const n=await super.deserialize(e,i,s);return f(n,lr,e.areContours),f(n,ds,((a=e.accessibilityData)==null?void 0:a.alt)||""),f(n,so,e.uuid),n}};lr=new WeakMap,ds=new WeakMap,hr=new WeakMap,so=new WeakMap,k(je,"_type","signature"),k(je,"_editorType",Y.SIGNATURE),k(je,"_defaultDrawingOptions",null);let Tm=je;var Et,te,cr,sn,dr,Jl,nn,no,us,ti,th,ot,ec,ic,Rf,Mf,kf,Lm,Df,qA;class Im extends vt{constructor(e){super({...e,name:"stampEditor"});m(this,ot);m(this,Et,null);m(this,te,null);m(this,cr,null);m(this,sn,null);m(this,dr,null);m(this,Jl,"");m(this,nn,null);m(this,no,!1);m(this,us,null);m(this,ti,!1);m(this,th,!1);f(this,sn,e.bitmapUrl),f(this,dr,e.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(e,i){vt.initialize(e,i)}static isHandlingMimeForPasting(e){return Ap.includes(e)}static paste(e,i){i.pasteEditor({mode:Y.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:a,height:o}=e||this.copyCanvas(null,null,!0).imageData,l=await s.guess({name:"altText",request:{data:n,width:a,height:o,channels:n.length/(a*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;r(this,te)&&(f(this,Et,null),this._uiManager.imageManager.deleteId(r(this,te)),(e=r(this,nn))==null||e.remove(),f(this,nn,null),r(this,us)&&(clearTimeout(r(this,us)),f(this,us,null))),super.remove()}rebuild(){if(!this.parent){r(this,te)&&p(this,ot,Rf).call(this);return}super.rebuild(),this.div!==null&&(r(this,te)&&r(this,nn)===null&&p(this,ot,Rf).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(r(this,cr)||r(this,Et)||r(this,sn)||r(this,dr)||r(this,te)||r(this,no))}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(),r(this,no)||(r(this,Et)?p(this,ot,Mf).call(this):p(this,ot,Rf).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)&&(f(this,te,s),n&&f(this,Et,n),f(this,no,!1),p(this,ot,Mf).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;r(this,us)!==null&&clearTimeout(r(this,us)),f(this,us,setTimeout(()=>{f(this,us,null),p(this,ot,Lm).call(this)},200))}copyCanvas(e,i,s=!1){var b;e||(e=224);const{width:n,height:a}=r(this,Et),o=new So;let l=r(this,Et),c=n,d=a,u=null;if(i){if(n>i||a>i){const I=Math.min(i/n,i/a);c=Math.floor(n*I),d=Math.floor(a*I)}u=document.createElement("canvas");const w=u.width=Math.ceil(c*o.sx),v=u.height=Math.ceil(d*o.sy);r(this,ti)||(l=p(this,ot,kf).call(this,w,v));const y=u.getContext("2d");y.filter=this._uiManager.hcmFilter;let A="white",E="#cfcfd8";this._uiManager.hcmFilter!=="none"?E="black":(b=window.matchMedia)!=null&&b.call(window,"(prefers-color-scheme: dark)").matches&&(A="#8f8f9d",E="#42414d");const _=15,S=_*o.sx,P=_*o.sy,x=new OffscreenCanvas(S*2,P*2),T=x.getContext("2d");T.fillStyle=A,T.fillRect(0,0,S*2,P*2),T.fillStyle=E,T.fillRect(0,0,S,P),T.fillRect(S,P,S,P),y.fillStyle=y.createPattern(x,"repeat"),y.fillRect(0,0,w,v),y.drawImage(l,0,0,l.width,l.height,0,0,w,v)}let g=null;if(s){let w,v;if(o.symmetric&&l.width<e&&l.height<e)w=l.width,v=l.height;else if(l=r(this,Et),n>e||a>e){const E=Math.min(e/n,e/a);w=Math.floor(n*E),v=Math.floor(a*E),r(this,ti)||(l=p(this,ot,kf).call(this,w,v))}const A=new OffscreenCanvas(w,v).getContext("2d",{willReadFrequently:!0});A.drawImage(l,0,0,l.width,l.height,0,0,w,v),g={width:w,height:v,data:A.getImageData(0,0,w,v).data}}return{canvas:u,width:c,height:d,imageData:g}}static async deserialize(e,i,s){var y;let n=null,a=!1;if(e instanceof lA){const{data:{rect:A,rotation:E,id:_,structParent:S,popupRef:P},container:x,parent:{page:{pageNumber:T}},canvas:I}=e;let C,L;I?(delete e.canvas,{id:C,bitmap:L}=s.imageManager.getFromCanvas(x.id,I),I.remove()):(a=!0,e._hasNoCanvas=!0);const M=((y=await i._structTree.getAriaAttributes("".concat(Rb).concat(_)))==null?void 0:y.get("aria-label"))||"";n=e={annotationType:Y.STAMP,bitmapId:C,bitmap:L,pageIndex:T-1,rect:A.slice(0),rotation:E,annotationElementId:_,id:_,deleted:!1,accessibilityData:{decorative:!1,altText:M},isSvg:!1,structParent:S,popupRef:P}}const o=await super.deserialize(e,i,s),{rect:l,bitmap:c,bitmapUrl:d,bitmapId:u,isSvg:g,accessibilityData:b}=e;a?(s.addMissingCanvas(e.id,o),f(o,no,!0)):u&&s.imageManager.isValidId(u)?(f(o,te,u),c&&f(o,Et,c)):f(o,sn,d),f(o,ti,g);const[w,v]=o.pageDimensions;return o.width=(l[2]-l[0])/w,o.height=(l[3]-l[1])/v,b&&(o.altTextData=b),o._initialData=n,f(o,th,!!n),o}serialize(e=!1,i=null){var l;if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s={annotationType:Y.STAMP,bitmapId:r(this,te),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:r(this,ti),structTreeParentId:this._structTreeParentId};if(e)return s.bitmapUrl=p(this,ot,Df).call(this,!0),s.accessibilityData=this.serializeAltText(!0),s.isCopy=!0,s;const{decorative:n,altText:a}=this.serializeAltText(!1);if(!n&&a&&(s.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const c=p(this,ot,qA).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=r(this,ti)?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(!i.stamps.has(r(this,te)))i.stamps.set(r(this,te),{area:o,serialized:s}),s.bitmap=p(this,ot,Df).call(this,!1);else if(r(this,ti)){const c=i.stamps.get(r(this,te));o>c.area&&(c.area=o,c.serialized.bitmap.close(),c.serialized.bitmap=p(this,ot,Df).call(this,!1))}return s}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}}Et=new WeakMap,te=new WeakMap,cr=new WeakMap,sn=new WeakMap,dr=new WeakMap,Jl=new WeakMap,nn=new WeakMap,no=new WeakMap,us=new WeakMap,ti=new WeakMap,th=new WeakMap,ot=new WeakSet,ec=function(e,i=!1){if(!e){this.remove();return}f(this,Et,e.bitmap),i||(f(this,te,e.id),f(this,ti,e.isSvg)),e.file&&f(this,Jl,e.file.name),p(this,ot,Mf).call(this)},ic=function(){if(f(this,cr,null),this._uiManager.enableWaiting(!1),!!r(this,nn)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&r(this,Et)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&r(this,Et)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch(e){}}this.div.focus()}},Rf=function(){if(r(this,te)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(r(this,te)).then(s=>p(this,ot,ec).call(this,s,!0)).finally(()=>p(this,ot,ic).call(this));return}if(r(this,sn)){const s=r(this,sn);f(this,sn,null),this._uiManager.enableWaiting(!0),f(this,cr,this._uiManager.imageManager.getFromUrl(s).then(n=>p(this,ot,ec).call(this,n)).finally(()=>p(this,ot,ic).call(this)));return}if(r(this,dr)){const s=r(this,dr);f(this,dr,null),this._uiManager.enableWaiting(!0),f(this,cr,this._uiManager.imageManager.getFromFile(s).then(n=>p(this,ot,ec).call(this,n)).finally(()=>p(this,ot,ic).call(this)));return}const e=document.createElement("input");e.type="file",e.accept=Ap.join(",");const i=this._uiManager._signal;f(this,cr,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}}),p(this,ot,ec).call(this,n)}s()},{signal:i}),e.addEventListener("cancel",()=>{this.remove(),s()},{signal:i})}).finally(()=>p(this,ot,ic).call(this))),e.click()},Mf=function(){var u;const{div:e}=this;let{width:i,height:s}=r(this,Et);const[n,a]=this.pageDimensions,o=.75;if(this.width)i=this.width*n,s=this.height*a;else if(i>o*n||s>o*a){const g=Math.min(o*n/i,o*a/s);i*=g,s*=g}const[l,c]=this.parentDimensions;this.setDims(i*l/n,s*c/a),this._uiManager.enableWaiting(!1);const d=f(this,nn,document.createElement("canvas"));d.setAttribute("role","img"),this.addContainer(d),this.width=i/n,this.height=s/a,(u=this._initialOptions)!=null&&u.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),p(this,ot,Lm).call(this),r(this,th)||(this.parent.addUndoableEditor(this),f(this,th,!0)),this._reportTelemetry({action:"inserted_image"}),r(this,Jl)&&this.div.setAttribute("aria-description",r(this,Jl)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},kf=function(e,i){const{width:s,height:n}=r(this,Et);let a=s,o=n,l=r(this,Et);for(;a>2*e||o>2*i;){const c=a,d=o;a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*i&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const u=new OffscreenCanvas(a,o);u.getContext("2d").drawImage(l,0,0,c,d,0,0,a,o),l=u.transferToImageBitmap()}return l},Lm=function(){const[e,i]=this.parentDimensions,{width:s,height:n}=this,a=new So,o=Math.ceil(s*e*a.sx),l=Math.ceil(n*i*a.sy),c=r(this,nn);if(!c||c.width===o&&c.height===l)return;c.width=o,c.height=l;const d=r(this,ti)?r(this,Et):p(this,ot,kf).call(this,o,l),u=c.getContext("2d");u.filter=this._uiManager.hcmFilter,u.drawImage(d,0,0,d.width,d.height,0,0,o,l)},Df=function(e){if(e){if(r(this,ti)){const n=this._uiManager.imageManager.getSvgUrl(r(this,te));if(n)return n}const i=document.createElement("canvas");return{width:i.width,height:i.height}=r(this,Et),i.getContext("2d").drawImage(r(this,Et),0,0),i.toDataURL()}if(r(this,ti)){const[i,s]=this.pageDimensions,n=Math.round(this.width*i*Or.PDF_TO_CSS_UNITS),a=Math.round(this.height*s*Or.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(n,a);return o.getContext("2d").drawImage(r(this,Et),0,0,r(this,Et).width,r(this,Et).height,0,0,n,a),o.transferToImageBitmap()}return structuredClone(r(this,Et))},qA=function(e){var o;const{pageIndex:i,accessibilityData:{altText:s}}=this._initialData,n=e.pageIndex===i,a=(((o=e.accessibilityData)==null?void 0:o.alt)||"")===s;return{isSame:!this._hasBeenMoved&&!this._hasBeenResized&&n&&a,isSameAltText:a}},k(Im,"_type","stamp"),k(Im,"_editorType",Y.STAMP);var ro,eh,fs,ur,rn,ei,fr,ih,ao,Ni,an,ee,on,gr,sh,z,Ve,pr,Pt,YA,qi,Rm,Mm,Nf;let IS=(Ve=class{constructor({uiManager:t,pageIndex:e,div:i,structTreeLayer:s,accessibilityManager:n,annotationLayer:a,drawLayer:o,textLayer:l,viewport:c,l10n:d}){m(this,Pt);m(this,ro);m(this,eh,!1);m(this,fs,null);m(this,ur,null);m(this,rn,null);m(this,ei,new Map);m(this,fr,!1);m(this,ih,!1);m(this,ao,!1);m(this,Ni,null);m(this,an,null);m(this,ee,null);m(this,on,null);m(this,gr,null);m(this,sh,-1);m(this,z);const u=[...r(Ve,pr).values()];if(!Ve._initialized){Ve._initialized=!0;for(const g of u)g.initialize(d,t)}t.registerEditorTypes(u),f(this,z,t),this.pageIndex=e,this.div=i,f(this,ro,n),f(this,fs,a),this.viewport=c,f(this,ee,l),this.drawLayer=o,this._structTree=s,r(this,z).addLayer(this)}get isEmpty(){return r(this,ei).size===0}get isInvisible(){return this.isEmpty&&r(this,z).getMode()===Y.NONE}updateToolbar(t){r(this,z).updateToolbar(t)}updateMode(t=r(this,z).getMode()){switch(p(this,Pt,Nf).call(this),t){case Y.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Y.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Y.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 r(Ve,pr).values())e.toggle("".concat(i._type,"Editing"),t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===((e=r(this,ee))==null?void 0:e.div)}setEditingState(t){r(this,z).setEditingState(t)}addCommands(t){r(this,z).addCommands(t)}cleanUndoStack(t){r(this,z).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=r(this,fs))==null||e.div.classList.toggle("disabled",!t)}async enable(){var i;f(this,ao,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),(i=r(this,gr))==null||i.abort(),f(this,gr,null);const t=new Set;for(const s of r(this,ei).values())s.enableEditing(),s.show(!0),s.annotationElementId&&(r(this,z).removeChangedExistingAnnotation(s),t.add(s.annotationElementId));if(!r(this,fs)){f(this,ao,!1);return}const e=r(this,fs).getEditableAnnotations();for(const s of e){if(s.hide(),r(this,z).isDeletedAnnotationElement(s.data.id)||t.has(s.data.id))continue;const n=await this.deserialize(s);n&&(this.addOrRebuild(n),n.enableEditing())}f(this,ao,!1)}disable(){var s;if(f(this,ih,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),r(this,ee)&&!r(this,gr)){f(this,gr,new AbortController);const n=r(this,z).combinedSignal(r(this,gr));r(this,ee).div.addEventListener("pointerdown",a=>{const{clientX:l,clientY:c,timeStamp:d}=a,u=r(this,sh);if(d-u>500){f(this,sh,d);return}f(this,sh,-1);const{classList:g}=this.div;g.toggle("getElements",!0);const b=document.elementsFromPoint(l,c);if(g.toggle("getElements",!1),!this.div.contains(b[0]))return;let w;const v=new RegExp("^".concat(Bv,"[0-9]+$"));for(const A of b)if(v.test(A.id)){w=A.id;break}if(!w)return;const y=r(this,ei).get(w);(y==null?void 0:y.annotationElementId)===null&&(a.stopPropagation(),a.preventDefault(),y.dblclick())},{signal:n,capture:!0})}const t=new Map,e=new Map;for(const n of r(this,ei).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(r(this,fs)){const n=r(this,fs).getEditableAnnotations();for(const a of n){const{id:o}=a.data;if(r(this,z).isDeletedAnnotationElement(o))continue;let l=e.get(o);if(l){l.resetAnnotationElement(a),l.show(!1),a.show();continue}l=t.get(o),l&&(r(this,z).addChangedExistingAnnotation(l),l.renderAnnotationElement(a)&&l.show(!1)),a.show()}}p(this,Pt,Nf).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const n of r(Ve,pr).values())i.remove("".concat(n._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),f(this,ih,!1)}getEditableAnnotation(t){var e;return((e=r(this,fs))==null?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){r(this,z).getActive()!==t&&r(this,z).setActiveEditor(t)}enableTextSelection(){var t;if(this.div.tabIndex=-1,(t=r(this,ee))!=null&&t.div&&!r(this,on)){f(this,on,new AbortController);const e=r(this,z).combinedSignal(r(this,on));r(this,ee).div.addEventListener("pointerdown",p(this,Pt,YA).bind(this),{signal:e}),r(this,ee).div.classList.add("highlighting")}}disableTextSelection(){var t;this.div.tabIndex=0,(t=r(this,ee))!=null&&t.div&&r(this,on)&&(r(this,on).abort(),f(this,on,null),r(this,ee).div.classList.remove("highlighting"))}enableClick(){if(r(this,ur))return;f(this,ur,new AbortController);const t=r(this,z).combinedSignal(r(this,ur));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=r(this,ur))==null||t.abort(),f(this,ur,null)}attach(t){r(this,ei).set(t.id,t);const{annotationElementId:e}=t;e&&r(this,z).isDeletedAnnotationElement(e)&&r(this,z).removeDeletedAnnotationElement(t)}detach(t){var e;r(this,ei).delete(t.id),(e=r(this,ro))==null||e.removePointerInTextLayer(t.contentDiv),!r(this,ih)&&t.annotationElementId&&r(this,z).addDeletedAnnotationElement(t)}remove(t){this.detach(t),r(this,z).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(r(this,z).addDeletedAnnotationElement(t.annotationElementId),vt.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),r(this,z).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!r(this,ao)),r(this,z).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var i;if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!r(this,rn)&&(t._focusEventsAllowed=!1,f(this,rn,setTimeout(()=>{f(this,rn,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:r(this,z)._signal}),e.focus())},0))),t._structTreeParentId=(i=r(this,ro))==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 r(this,z).getId()}combinedSignal(t){return r(this,z).combinedSignal(t)}canCreateNewEmptyEditor(){var t;return(t=r(this,Pt,qi))==null?void 0:t.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await r(this,z).updateMode(t.mode);const{offsetX:i,offsetY:s}=p(this,Pt,Mm).call(this),n=this.getNextId(),a=p(this,Pt,Rm).call(this,{parent:this,id:n,x:i,y:s,uiManager:r(this,z),isCentered:!0,...e});a&&this.add(a)}async deserialize(t){var e,i;return await((i=r(Ve,pr).get((e=t.annotationType)!=null?e:t.annotationEditorType))==null?void 0:i.deserialize(t,this,r(this,z)))||null}createAndAddNewEditor(t,e,i={}){const s=this.getNextId(),n=p(this,Pt,Rm).call(this,{parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:r(this,z),isCentered:e,...i});return n&&this.add(n),n}addNewEditor(t={}){this.createAndAddNewEditor(p(this,Pt,Mm).call(this),!0,t)}setSelected(t){r(this,z).setSelected(t)}toggleSelected(t){r(this,z).toggleSelected(t)}unselect(t){r(this,z).unselect(t)}pointerup(t){var s;const{isMac:e}=fe.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div||!r(this,fr)||(f(this,fr,!1),(s=r(this,Pt,qi))!=null&&s.isDrawer&&r(this,Pt,qi).supportMultipleDrawings))return;if(!r(this,eh)){f(this,eh,!0);return}const i=r(this,z).getMode();if(i===Y.STAMP||i===Y.SIGNATURE){r(this,z).unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){var s;if(r(this,z).getMode()===Y.HIGHLIGHT&&this.enableTextSelection(),r(this,fr)){f(this,fr,!1);return}const{isMac:e}=fe.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div)return;if(f(this,fr,!0),(s=r(this,Pt,qi))!=null&&s.isDrawer){this.startDrawingSession(t);return}const i=r(this,z).getActive();f(this,eh,!i||i.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),r(this,Ni)){r(this,Pt,qi).startDrawing(this,r(this,z),!1,t);return}r(this,z).setCurrentDrawingSession(this),f(this,Ni,new AbortController);const e=r(this,z).combinedSignal(r(this,Ni));this.div.addEventListener("blur",({relatedTarget:i})=>{i&&!this.div.contains(i)&&(f(this,an,null),this.commitOrRemove())},{signal:e}),r(this,Pt,qi).startDrawing(this,r(this,z),!1,t)}pause(t){if(t){const{activeElement:e}=document;this.div.contains(e)&&f(this,an,e);return}r(this,an)&&setTimeout(()=>{var e;(e=r(this,an))==null||e.focus(),f(this,an,null)},0)}endDrawingSession(t=!1){return r(this,Ni)?(r(this,z).setCurrentDrawingSession(null),r(this,Ni).abort(),f(this,Ni,null),f(this,an,null),r(this,Pt,qi).endDrawing(t)):null}findNewParent(t,e,i){const s=r(this,z).findParent(e,i);return s===null||s===this?!1:(s.changeParent(t),!0)}commitOrRemove(){return r(this,Ni)?(this.endDrawingSession(),!0):!1}onScaleChanging(){r(this,Ni)&&r(this,Pt,qi).onScaleChangingWhenDrawing(this)}destroy(){var t,e;this.commitOrRemove(),((t=r(this,z).getActive())==null?void 0:t.parent)===this&&(r(this,z).commitOrRemove(),r(this,z).setActiveEditor(null)),r(this,rn)&&(clearTimeout(r(this,rn)),f(this,rn,null));for(const i of r(this,ei).values())(e=r(this,ro))==null||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove();this.div=null,r(this,ei).clear(),r(this,z).removeLayer(this)}render({viewport:t}){this.viewport=t,Eo(this.div,t);for(const e of r(this,z).getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:t}){r(this,z).commitOrRemove(),p(this,Pt,Nf).call(this);const e=this.viewport.rotation,i=t.rotation;if(this.viewport=t,Eo(this.div,{rotation:i}),e!==i)for(const s of r(this,ei).values())s.rotate(i)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return r(this,z).viewParameters.realScale}},ro=new WeakMap,eh=new WeakMap,fs=new WeakMap,ur=new WeakMap,rn=new WeakMap,ei=new WeakMap,fr=new WeakMap,ih=new WeakMap,ao=new WeakMap,Ni=new WeakMap,an=new WeakMap,ee=new WeakMap,on=new WeakMap,gr=new WeakMap,sh=new WeakMap,z=new WeakMap,pr=new WeakMap,Pt=new WeakSet,YA=function(t){r(this,z).unselectAll();const{target:e}=t;if(e===r(this,ee).div||(e.getAttribute("role")==="img"||e.classList.contains("endOfContent"))&&r(this,ee).div.contains(e)){const{isMac:i}=fe.platform;if(t.button!==0||t.ctrlKey&&i)return;r(this,z).showAllEditors("highlight",!0,!0),r(this,ee).div.classList.add("free"),this.toggleDrawing(),ag.startHighlighting(this,r(this,z).direction==="ltr",{target:r(this,ee).div,x:t.x,y:t.y}),r(this,ee).div.addEventListener("pointerup",()=>{r(this,ee).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:r(this,z)._signal}),t.preventDefault()}},qi=function(){return r(Ve,pr).get(r(this,z).getMode())},Rm=function(t){const e=r(this,Pt,qi);return e?new e.prototype.constructor(t):null},Mm=function(){const{x:t,y:e,width:i,height:s}=this.div.getBoundingClientRect(),n=Math.max(0,t),a=Math.max(0,e),o=Math.min(window.innerWidth,t+i),l=Math.min(window.innerHeight,e+s),c=(n+o)/2-t,d=(a+l)/2-e,[u,g]=this.viewport.rotation%180===0?[c,d]:[d,c];return{offsetX:u,offsetY:g}},Nf=function(){for(const t of r(this,ei).values())t.isEmpty()&&t.remove()},k(Ve,"_initialized",!1),m(Ve,pr,new Map([hm,_m,Im,ag,Tm].map(t=>[t._editorType,t]))),Ve);var Fi,Se,oo,Rt,Qd,Lg,KA,ys,km,ZA,Dm;let LS=(Rt=class{constructor({pageIndex:t}){m(this,ys);m(this,Fi,null);m(this,Se,new Map);m(this,oo,new Map);this.pageIndex=t}setParent(t){if(!r(this,Fi)){f(this,Fi,t);return}if(r(this,Fi)!==t){if(r(this,Se).size>0)for(const e of r(this,Se).values())e.remove(),t.append(e);f(this,Fi,t)}}static get _svgFactory(){return nt(this,"_svgFactory",new ng)}draw(t,e=!1,i=!1){const s=se(Rt,Qd)._++,n=p(this,ys,km).call(this),a=Rt._svgFactory.createElement("defs");n.append(a);const o=Rt._svgFactory.createElement("path");a.append(o);const l="path_p".concat(this.pageIndex,"_").concat(s);o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),e&&r(this,oo).set(s,o);const c=i?p(this,ys,ZA).call(this,a,l):null,d=Rt._svgFactory.createElement("use");return n.append(d),d.setAttribute("href","#".concat(l)),this.updateProperties(n,t),r(this,Se).set(s,n),{id:s,clipPathId:"url(#".concat(c,")")}}drawOutline(t,e){const i=se(Rt,Qd)._++,s=p(this,ys,km).call(this),n=Rt._svgFactory.createElement("defs");s.append(n);const a=Rt._svgFactory.createElement("path");n.append(a);const o="path_p".concat(this.pageIndex,"_").concat(i);a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke");let l;if(e){const u=Rt._svgFactory.createElement("mask");n.append(u),l="mask_p".concat(this.pageIndex,"_").concat(i),u.setAttribute("id",l),u.setAttribute("maskUnits","objectBoundingBox");const g=Rt._svgFactory.createElement("rect");u.append(g),g.setAttribute("width","1"),g.setAttribute("height","1"),g.setAttribute("fill","white");const b=Rt._svgFactory.createElement("use");u.append(b),b.setAttribute("href","#".concat(o)),b.setAttribute("stroke","none"),b.setAttribute("fill","black"),b.setAttribute("fill-rule","nonzero"),b.classList.add("mask")}const c=Rt._svgFactory.createElement("use");s.append(c),c.setAttribute("href","#".concat(o)),l&&c.setAttribute("mask","url(#".concat(l,")"));const d=c.cloneNode();return s.append(d),c.classList.add("mainOutline"),d.classList.add("secondaryOutline"),this.updateProperties(s,t),r(this,Se).set(i,s),i}finalizeDraw(t,e){r(this,oo).delete(t),this.updateProperties(t,e)}updateProperties(t,e){var l;if(!e)return;const{root:i,bbox:s,rootClass:n,path:a}=e,o=typeof t=="number"?r(this,Se).get(t):t;if(o){if(i&&p(this,ys,Dm).call(this,o,i),s&&p(l=Rt,Lg,KA).call(l,o,s),n){const{classList:c}=o;for(const[d,u]of Object.entries(n))c.toggle(d,u)}if(a){const d=o.firstChild.firstChild;p(this,ys,Dm).call(this,d,a)}}}updateParent(t,e){if(e===this)return;const i=r(this,Se).get(t);i&&(r(e,Fi).append(i),r(this,Se).delete(t),r(e,Se).set(t,i))}remove(t){r(this,oo).delete(t),r(this,Fi)!==null&&(r(this,Se).get(t).remove(),r(this,Se).delete(t))}destroy(){f(this,Fi,null);for(const t of r(this,Se).values())t.remove();r(this,Se).clear(),r(this,oo).clear()}},Fi=new WeakMap,Se=new WeakMap,oo=new WeakMap,Qd=new WeakMap,Lg=new WeakSet,KA=function(t,[e,i,s,n]){const{style:a}=t;a.top="".concat(100*i,"%"),a.left="".concat(100*e,"%"),a.width="".concat(100*s,"%"),a.height="".concat(100*n,"%")},ys=new WeakSet,km=function(){const t=Rt._svgFactory.create(1,1,!0);return r(this,Fi).append(t),t.setAttribute("aria-hidden",!0),t},ZA=function(t,e){const i=Rt._svgFactory.createElement("clipPath");t.append(i);const s="clip_".concat(e);i.setAttribute("id",s),i.setAttribute("clipPathUnits","objectBoundingBox");const n=Rt._svgFactory.createElement("use");return i.append(n),n.setAttribute("href","#".concat(e)),n.classList.add("clip"),s},Dm=function(t,e){for(const[i,s]of Object.entries(e))s===null?t.removeAttribute(i):t.setAttribute(i,s)},m(Rt,Lg),m(Rt,Qd,0),Rt);globalThis._pdfjsTestingUtils={HighlightOutliner:dm};globalThis.pdfjsLib={AbortException:Fr,AnnotationEditorLayer:IS,AnnotationEditorParamsType:st,AnnotationEditorType:Y,AnnotationEditorUIManager:yc,AnnotationLayer:PS,AnnotationMode:vs,AnnotationType:Bt,build:aS,ColorPicker:PA,createValidAbsoluteUrl:Vv,DOMSVGFactory:ng,DrawLayer:LS,FeatureTest:fe,fetchData:Vu,getDocument:Gy,getFilenameFromUrl:tE,getPdfFilenameFromUrl:Wv,getUuid:$v,getXfaPageViewport:zv,GlobalWorkerOptions:Mn,ImageKind:rf,InvalidPDFException:wp,isDataScheme:Bg,isPdfFile:Mb,isValidExplicitDest:uE,MathClamp:Te,noContextMenu:Wi,normalizeUnicode:Z_,OPS:tg,OutputScale:So,PasswordResponses:$_,PDFDataRangeTransport:Xy,PDFDateString:ig,PDFWorker:Jp,PermissionFlag:j_,PixelsPerInch:Or,RenderingCancelledException:Ih,ResponseException:eg,setLayerDimensions:Eo,shadow:nt,SignatureExtractor:Oo,stopEvent:Vt,SupportedImageMimeTypes:Ap,TextLayer:Yp,TouchManager:cy,updateUrlHash:Hv,Util:q,VerbosityLevel:Ng,version:rS,XfaLayer:Ky};const{AbortException:RS,AnnotationEditorLayer:MS,AnnotationEditorParamsType:qC,AnnotationEditorType:He,AnnotationEditorUIManager:kS,AnnotationLayer:DS,AnnotationMode:bn,AnnotationType:QA,build:YC,ColorPicker:KC,createValidAbsoluteUrl:JA,DOMSVGFactory:ZC,DrawLayer:NS,FeatureTest:FS,fetchData:xw,getDocument:QC,getFilenameFromUrl:JC,getPdfFilenameFromUrl:OS,getUuid:tT,getXfaPageViewport:eT,GlobalWorkerOptions:iT,ImageKind:sT,InvalidPDFException:nT,isDataScheme:rT,isPdfFile:BS,isValidExplicitDest:VS,MathClamp:Hb,noContextMenu:aT,normalizeUnicode:HS,OPS:oT,OutputScale:Ff,PasswordResponses:lT,PDFDataRangeTransport:hT,PDFDateString:cT,PDFWorker:dT,PermissionFlag:Zu,PixelsPerInch:Ls,RenderingCancelledException:Nm,ResponseException:uT,setLayerDimensions:t0,shadow:lg,SignatureExtractor:fT,stopEvent:Fm,SupportedImageMimeTypes:gT,TextLayer:jS,TouchManager:pT,updateUrlHash:$S,Util:jb,VerbosityLevel:mT,version:Cw,XfaLayer:ip}=globalThis.pdfjsLib,US="auto",e0=1,Tw=1.1,WS=.1,zS=10,sp=0,GS=1.25,Iw=40,Lw=5,ht={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},qo={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},bs={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2},rt={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},ve={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};function i0(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;if(t&&(t.top!==void 0&&(s+=t.top),t.left!==void 0)){const a=h.getBoundingClientRect().width,o=Hb((i.clientWidth-a)/2,20,400),l=t.left-o;n+=l,i.scrollLeft=n}i.scrollTop=s}function XS(h,t,e=void 0){const i=function(a){n||(n=window.requestAnimationFrame(function(){n=null;const l=h.scrollLeft,c=s.lastX;l!==c&&(s.right=l>c),s.lastX=l;const d=h.scrollTop,u=s.lastY;d!==u&&(s.down=d>u),s.lastY=d,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 jg(h){const t=new Map;for(const[e,i]of new URLSearchParams(h))t.set(e.toLowerCase(),i);return t}const Rw=/[\x00-\x1F]/g;function fc(h,t=!1){return Rw.test(h)?t?h.replaceAll(Rw,e=>e==="\0"?"":" "):h.replaceAll("\0",""):h}function _c(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,a=h[n];t(a)?s=n:i=n+1}return i}function Mw(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,a=1,o=1;for(;;){const c=s+a,d=n+o;if(d>e)break;i<=c/d?(a=c,o=d):(s=c,n=d)}let l;return i-s/n<a/o-i?l=i===h?[s,n]:[n,s]:l=i===h?[a,o]:[o,a],l}function Qu(h,t){return h-h%t}function qS(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 YS({scrollEl:h,views:t,sortByVisibility:e=!1,horizontal:i=!1,rtl:s=!1}){const n=h.scrollTop,a=n+h.clientHeight,o=h.scrollLeft,l=o+h.clientWidth;function c(E){const _=E.div;return _.offsetTop+_.clientTop+_.clientHeight>n}function d(E){const _=E.div,S=_.offsetLeft+_.clientLeft,P=S+_.clientWidth;return s?S<l:P>o}const u=[],g=new Set,b=t.length;let w=_c(t,i?d:c);w>0&&w<b&&!i&&(w=qS(w,t,n));let v=i?l:-1;for(let E=w;E<b;E++){const _=t[E],S=_.div,P=S.offsetLeft+S.clientLeft,x=S.offsetTop+S.clientTop,T=S.clientWidth,I=S.clientHeight,C=P+T,L=x+I;if(v===-1)L>=a&&(v=L);else if((i?P:x)>v)break;if(L<=n||x>=a||C<=o||P>=l)continue;const M=Math.max(0,n-x),G=Math.max(0,o-P),W=M+Math.max(0,L-a),$=G+Math.max(0,C-l),Tt=(I-W)/I,V=(T-$)/T,N=Tt*V*100|0;u.push({id:_.id,x:P,y:x,visibleArea:N===100?null:{minX:G,minY:M,maxX:Math.min(C,l)-P,maxY:Math.min(L,a)-x},view:_,percent:N,widthPercent:V*100|0}),g.add(_.id)}const y=u[0],A=u.at(-1);return e&&u.sort(function(E,_){const S=E.percent-_.percent;return Math.abs(S)>.001?-S:E.id-_.id}),{first:y,last:A,views:u,ids:g}}function s0(h){return Number.isInteger(h)&&h%90===0}function KS(h){return Number.isInteger(h)&&Object.values(rt).includes(h)&&h!==rt.UNKNOWN}function ZS(h){return Number.isInteger(h)&&Object.values(ve).includes(h)&&h!==ve.UNKNOWN}function kw(h){return h.width<=h.height}new Promise(function(h){window.requestAnimationFrame(h)});const QS=document.documentElement.style;var mr,lo,br,nh,ho;class JS{constructor(t){m(this,mr,null);m(this,lo,null);m(this,br,0);m(this,nh,null);m(this,ho,!0);f(this,mr,t.classList),f(this,nh,t.style)}get percent(){return r(this,br)}set percent(t){if(f(this,br,Hb(t,0,100)),isNaN(t)){r(this,mr).add("indeterminate");return}r(this,mr).remove("indeterminate"),r(this,nh).setProperty("--progressBar-percent","".concat(r(this,br),"%"))}setWidth(t){if(!t)return;const i=t.parentNode.offsetWidth-t.offsetWidth;i>0&&r(this,nh).setProperty("--progressBar-end-offset","".concat(i,"px"))}setDisableAutoFetch(t=5e3){r(this,br)===100||isNaN(r(this,br))||(r(this,lo)&&clearTimeout(r(this,lo)),this.show(),f(this,lo,setTimeout(()=>{f(this,lo,null),this.hide()},t)))}hide(){r(this,ho)&&(f(this,ho,!1),r(this,mr).add("hidden"))}show(){r(this,ho)||(f(this,ho,!0),r(this,mr).remove("hidden"))}}mr=new WeakMap,lo=new WeakMap,br=new WeakMap,nh=new WeakMap,ho=new WeakMap;function tP(h){let t=rt.VERTICAL,e=ve.NONE;switch(h){case"SinglePage":t=rt.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=rt.PAGE;case"TwoColumnLeft":e=ve.ODD;break;case"TwoPageRight":t=rt.PAGE;case"TwoColumnRight":e=ve.EVEN;break}return{scrollMode:t,spreadMode:e}}const Ju=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}(),Si={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};function eP(h){return h<11904}function iP(h){return(h&65408)===0}function sP(h){return h>=97&&h<=122||h>=65&&h<=90}function nP(h){return h>=48&&h<=57}function rP(h){return h===32||h===9||h===13||h===10}function aP(h){return h>=13312&&h<=40959||h>=63744&&h<=64255}function oP(h){return h>=12448&&h<=12543}function lP(h){return h>=12352&&h<=12447}function hP(h){return h>=65376&&h<=65439}function cP(h){return(h&65408)===3584}function tf(h){return eP(h)?iP(h)?rP(h)?Si.SPACE:sP(h)||nP(h)||h===95?Si.ALPHA_LETTER:Si.PUNCT:cP(h)?Si.THAI_LETTER:h===160?Si.SPACE:Si.ALPHA_LETTER:aP(h)?Si.HAN_LETTER:oP(h)?Si.KATAKANA_LETTER:lP(h)?Si.HIRAGANA_LETTER:hP(h)?Si.HALFWIDTH_KATAKANA_LETTER:Si.ALPHA_LETTER}let Dw;function dP(){return Dw||(Dw=" ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩"),Dw}const Tn={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3},uP=250,fP=-50,Nw={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},Fw=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 Ow;const gP=new RegExp("\\p{M}+","gu"),pP=new RegExp("([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})","gu"),mP=new RegExp("([^\\p{M}])\\p{M}*$","u"),bP=new RegExp("^\\p{M}*([^\\p{M}])","u"),wP=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,Bw=new Map,vP="[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]",Vw=new Map;let np=null,rp=null;function Of(h,t={}){var E;const e=[];let i;for(;(i=wP.exec(h))!==null;){let{index:_}=i;for(const S of i[0]){let P=Bw.get(S);P||(P=S.normalize("NFD").length,Bw.set(S,P)),e.push([P,_++])}}const s=e.length>0,n=(E=t.ignoreDashEOL)!=null?E:!1;let a;if(!s&&np)a=np;else if(s&&rp)a=rp;else{const _=Object.keys(Nw).join(""),S=dP(),I=["[".concat(_,"]"),"[".concat(S,"]"),"".concat("(?:゙|゚)","\\n"),"\\p{M}+(?:-\\n)?","".concat("\\p{Ll}-\\n(?=\\p{Ll})|\\p{Lu}-\\n(?=\\p{L})"),"\\S-\\n","".concat("(?:\\p{Ideographic}|[-ヿ])","\\n"),"\\n",s?vP:"\\u0000"];a=new RegExp(I.map(C=>"(".concat(C,")")).join("|"),"gum"),s?rp=a:np=a}const o=[];for(;(i=gP.exec(h))!==null;)o.push([i[0].length,i.index]);let l=h.normalize("NFD");const c=[0,0];let d=0,u=0,g=0,b=0,w=0,v=!1;l=l.replace(a,(_,S,P,x,T,I,C,L,M,G,W)=>{var $,Tt,V;if(W-=b,S){const N=Nw[S],mt=N.length;for(let At=1;At<mt;At++)c.push(W-g+At,g-At);return g-=mt-1,N}if(P){let N=Vw.get(P);N||(N=P.normalize("NFKC"),Vw.set(P,N));const mt=N.length;for(let At=1;At<mt;At++)c.push(W-g+At,g-At);return g-=mt-1,N}if(x)return v=!0,W+w===(($=o[d])==null?void 0:$[1])?++d:(c.push(W-1-g+1,g-1),g-=1,b+=1),c.push(W-g+1,g),b+=1,w+=1,x.charAt(0);if(T){const N=T.endsWith("\n"),mt=N?T.length-2:T.length;v=!0;let At=mt;W+w===((Tt=o[d])==null?void 0:Tt[1])&&(At-=o[d][0],++d);for(let di=1;di<=At;di++)c.push(W-1-g+di,g-di);return g-=At,b+=At,N?(W+=mt-1,c.push(W-g+1,1+g),g+=1,b+=1,w+=1,T.slice(0,mt)):T}if(I){if(n)return b+=1,w+=1,I.slice(0,-1);const N=I.length-2;return c.push(W-g+N,1+g),g+=1,b+=1,w+=1,I.slice(0,-2)}if(C)return b+=1,w+=1,C.slice(0,-1);if(L){const N=L.length-1;return c.push(W-g+N,g),b+=1,w+=1,L.slice(0,-1)}if(M)return c.push(W-g+1,g-1),g-=1,b+=1,w+=1," ";if(W+w===((V=e[u])==null?void 0:V[1])){const N=e[u][0]-1;++u;for(let mt=1;mt<=N;mt++)c.push(W-(g-mt),g-mt);g-=N,b+=N}return G}),c.push(l.length,g);const y=new Uint32Array(c.length>>1),A=new Int32Array(c.length>>1);for(let _=0,S=c.length;_<S;_+=2)y[_>>1]=c[_],A[_>>1]=c[_+1];return[l,[y,A],v]}function n0(h,t,e){if(!h)return[t,e];const[i,s]=h,n=t,a=t+e-1;let o=_c(i,g=>g>=n);i[o]>n&&--o;let l=_c(i,g=>g>=a,o);i[l]>a&&--l;const c=n+s[o],u=a+s[l]+1-c;return[c,u]}var zt,rh,co,U,a0,Om,Bm,o0,l0,Vm,h0,c0,Bf,sc,Bo,d0,Hm,jm,Vf,u0,$m,Um,nc;class r0{constructor({linkService:t,eventBus:e,updateMatchesCountOnProgress:i=!0}){m(this,U);m(this,zt,null);m(this,rh,!0);m(this,co,0);this._linkService=t,this._eventBus=e,f(this,rh,i),this.onIsPageVisible=null,p(this,U,Om).call(this),e._on("find",p(this,U,a0).bind(this)),e._on("findbarclose",p(this,U,u0).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 r(this,zt)}setDocument(t){this._pdfDocument&&p(this,U,Om).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,i0(t,{top:fP,left:e},!0)}match(t,e,i){const s=this._hasDiacritics[i];let n=!1;if(typeof t=="string"?[n,t]=p(this,U,Vm).call(this,t,s):t=t.sort().reverse().map(u=>{const[g,b]=p(this,U,Vm).call(this,u,s);return n||(n=g),"(".concat(b,")")}).join("|"),!t)return;const{caseSensitive:a,entireWord:o}=r(this,zt),l="g".concat(n?"u":"").concat(a?"":"i");t=new RegExp(t,l);const c=[];let d;for(;(d=t.exec(e))!==null;)o&&!p(this,U,l0).call(this,e,d.index,d[0].length)||c.push({index:d.index,length:d[0].length});return c}}zt=new WeakMap,rh=new WeakMap,co=new WeakMap,U=new WeakSet,a0=function(t){if(!t)return;const e=this._pdfDocument,{type:i}=t;(r(this,zt)===null||p(this,U,o0).call(this,t))&&(this._dirtyMatch=!0),f(this,zt,t),i!=="highlightallchange"&&p(this,U,nc).call(this,Tn.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||e&&this._pdfDocument!==e)return;p(this,U,c0).call(this);const s=!this._highlightMatches,n=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),i?this._dirtyMatch?p(this,U,Bo).call(this):i==="again"?(p(this,U,Bo).call(this),s&&r(this,zt).highlightAll&&p(this,U,sc).call(this)):i==="highlightallchange"?(n?p(this,U,Bo).call(this):this._highlightMatches=!0,p(this,U,sc).call(this)):p(this,U,Bo).call(this):this._findTimeout=setTimeout(()=>{p(this,U,Bo).call(this),this._findTimeout=null},uP)})},Om=function(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],f(this,co,0),f(this,zt,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()},Bm=function(){const{query:t}=r(this,zt);return typeof t=="string"?(t!==this._rawQuery&&(this._rawQuery=t,[this._normalizedQuery]=Of(t)),this._normalizedQuery):(t||[]).filter(e=>!!e).map(e=>Of(e)[0])},o0=function(t){var a,o;const e=t.query,i=r(this,zt).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=(a=this.onIsPageVisible)==null?void 0:a.call(this,l))==null||o);case"highlightallchange":return!1}return!0},l0=function(t,e,i){let s=t.slice(0,e).match(mP);if(s){const n=t.charCodeAt(e),a=s[1].charCodeAt(0);if(tf(n)===tf(a))return!1}if(s=t.slice(e+i).match(bP),s){const n=t.charCodeAt(e+i-1),a=s[1].charCodeAt(0);if(tf(n)===tf(a))return!1}return!0},Vm=function(t,e){const{matchDiacritics:i}=r(this,zt);let s=!1;t=t.replaceAll(pP,(a,o,l,c,d,u)=>o?"[ ]*\\".concat(o,"[ ]*"):l?"[ ]*".concat(l,"[ ]*"):c?"[ ]+":i?d||u:d?Fw.has(d.charCodeAt(0))?d:"":e?(s=!0,"".concat(u,"\\p{M}*")):u);const n="[ ]*";return t.endsWith(n)&&(t=t.slice(0,t.length-n.length)),i&&e&&(Ow||(Ow=String.fromCharCode(...Fw)),s=!0,t="".concat(t,"(?=[").concat(Ow,"]|[^\\p{M}]|$)")),[s,t]},h0=function(t){if(!r(this,zt))return;const e=r(this,U,Bm);if(e.length===0)return;const i=this._pageContents[t],s=this.match(e,i,t),n=this._pageMatches[t]=[],a=this._pageMatchesLength[t]=[],o=this._pageDiffs[t];s==null||s.forEach(({index:c,length:d})=>{const[u,g]=n0(o,c,d);g&&(n.push(u),a.push(g))}),r(this,zt).highlightAll&&p(this,U,Bf).call(this,t),this._resumePageIdx===t&&(this._resumePageIdx=null,p(this,U,Hm).call(this));const l=n.length;this._matchesCountTotal+=l,r(this,rh)?l>0&&p(this,U,Um).call(this):++se(this,co)._===this._linkService.pagesCount&&p(this,U,Um).call(this)},c0=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:a,resolve:o}=Promise.withResolvers();this._extractTextPromises[s]=a,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 d of l.items)c.push(d.str),d.hasEOL&&c.push("\n");[this._pageContents[s],this._pageDiffs[s],this._hasDiacritics[s]]=Of(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()})})}},Bf=function(t){this._scrollMatches&&this._selected.pageIdx===t&&(this._linkService.page=t+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:t})},sc=function(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})},Bo=function(){const t=r(this,zt).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,f(this,co,0),this._matchesCountTotal=0,p(this,U,sc).call(this);for(let a=0;a<i;a++)this._pendingFindMatches.has(a)||(this._pendingFindMatches.add(a),this._extractTextPromises[a].then(()=>{this._pendingFindMatches.delete(a),p(this,U,h0).call(this,a)}))}if(r(this,U,Bm).length===0){p(this,U,nc).call(this,Tn.FOUND);return}if(this._resumePageIdx)return;const n=this._offset;if(this._pagesToSearch=i,n.matchIdx!==null){const a=this._pageMatches[n.pageIdx].length;if(!t&&n.matchIdx+1<a||t&&n.matchIdx>0){n.matchIdx=t?n.matchIdx-1:n.matchIdx+1,p(this,U,Vf).call(this,!0);return}p(this,U,jm).call(this,t)}p(this,U,Hm).call(this)},d0=function(t){const e=this._offset,i=t.length,s=r(this,zt).findPrevious;return i?(e.matchIdx=s?i-1:0,p(this,U,Vf).call(this,!0),!0):(p(this,U,jm).call(this,s),e.wrapped&&(e.matchIdx=null,this._pagesToSearch<0)?(p(this,U,Vf).call(this,!1),!0):!1)},Hm=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(!p(this,U,d0).call(this,t))},jm=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)},Vf=function(t=!1){let e=Tn.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?Tn.WRAPPED:Tn.FOUND,s!==-1&&s!==this._selected.pageIdx&&p(this,U,Bf).call(this,s)}p(this,U,nc).call(this,e,r(this,zt).findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,p(this,U,Bf).call(this,this._selected.pageIdx))},u0=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),p(this,U,nc).call(this,Tn.FOUND),this._highlightMatches=!1,p(this,U,sc).call(this))})},$m=function(){var n;const{pageIdx:t,matchIdx:e}=this._selected;let i=0,s=this._matchesCountTotal;if(e!==-1){for(let a=0;a<t;a++)i+=((n=this._pageMatches[a])==null?void 0:n.length)||0;i+=e+1}return(i<1||i>s)&&(i=s=0),{current:i,total:s}},Um=function(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:p(this,U,$m).call(this)})},nc=function(t,e=!1){var i,s,n,a;!r(this,rh)&&(r(this,co)!==this._linkService.pagesCount||t===Tn.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:t,previous:e,entireWord:(s=(i=r(this,zt))==null?void 0:i.entireWord)!=null?s:null,matchesCount:p(this,U,$m).call(this),rawQuery:(a=(n=r(this,zt))==null?void 0:n.query)!=null?a:null})};const yP="noopener noreferrer nofollow",Gr={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};class $b{constructor({eventBus:t,externalLinkTarget:e=null,externalLinkRel:i=null,ignoreDestinationZoom:s=!1}={}){k(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(a){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})}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?Gr.BLANK:this.externalLinkTarget,n=this.externalLinkRel;this.externalLinkEnabled?t.href=t.title=e:(t.href="",t.title="Disabled: ".concat(e),t.onclick=()=>!1);let a="";switch(s){case Gr.NONE:break;case Gr.SELF:a="_self";break;case Gr.BLANK:a="_blank";break;case Gr.PARENT:a="_parent";break;case Gr.TOP:a="_top";break}t.target=a,t.rel=typeof n=="string"?n:yP}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=jg(t);if(s.has("search")){const n=s.get("search").replaceAll('"',""),a=s.get("phrase")==="true";this.eventBus.dispatch("findfromurlhash",{source:this,query:a?n:n.match(/\S+/g)})}if(s.has("page")&&(e=s.get("page")|0||1),s.has("zoom")){const n=s.get("zoom").split(","),a=n[0],o=parseFloat(a);a.includes("Fit")?a==="Fit"||a==="FitB"?i=[null,{name:a}]:a==="FitH"||a==="FitBH"||a==="FitV"||a==="FitBV"?i=[null,{name:a},n.length>1?n[1]|0:null]:a==="FitR"?n.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):i=[null,{name:a},n[1]|0,n[2]|0,n[3]|0,n[4]|0]:console.error('PDFLinkService.setHash: "'.concat(a,'" 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:a]}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"||VS(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 $g extends $b{setDocument(t,e=null){}}var wr,Jd,tu,vr,eu,As,Wm,zm,g0;class f0{constructor({pdfPage:t,linkService:e,downloadManager:i,annotationStorage:s=null,imageResourcesPath:n="",renderForms:a=!0,enableScripting:o=!1,hasJSActionsPromise:l=null,fieldObjectsPromise:c=null,annotationCanvasMap:d=null,accessibilityManager:u=null,annotationEditorUIManager:g=null,onAppend:b=null}){m(this,As);m(this,wr,null);m(this,Jd,!1);m(this,tu,null);m(this,vr,null);m(this,eu,!1);this.pdfPage=t,this.linkService=e,this.downloadManager=i,this.imageResourcesPath=n,this.renderForms=a,this.annotationStorage=s,this.enableScripting=o,this._hasJSActionsPromise=l||Promise.resolve(!1),this._fieldObjectsPromise=c||Promise.resolve(null),this._annotationCanvasMap=d,this._accessibilityManager=u,this._annotationEditorUIManager=g,f(this,tu,b),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,a]=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=r(this,tu))==null||l.call(this,o),s.length===0){f(this,wr,s),this.hide(!0);return}p(this,As,Wm).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:a}),f(this,wr,s),this.linkService.isInPresentationMode&&p(this,As,zm).call(this,qo.FULLSCREEN),r(this,vr)||(f(this,vr,new AbortController),(c=this._eventBus)==null||c._on("presentationmodechanged",d=>{p(this,As,zm).call(this,d.state)},{signal:r(this,vr).signal}))}cancel(){var t;this._cancelled=!0,(t=r(this,vr))==null||t.abort(),f(this,vr,null)}hide(t=!1){f(this,Jd,!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(r(this,wr)===null)throw new Error("`render` method must be called before `injectLinkAnnotations`.");if(this._cancelled||r(this,eu))return;f(this,eu,!0);const s=r(this,wr).length?p(this,As,g0).call(this,t):t;s.length&&(this.annotationLayer||(p(this,As,Wm).call(this,e,i),t0(this.div,e)),await this.annotationLayer.addLinkAnnotations(s,this.linkService),r(this,Jd)||(this.div.hidden=!1))}}wr=new WeakMap,Jd=new WeakMap,tu=new WeakMap,vr=new WeakMap,eu=new WeakMap,As=new WeakSet,Wm=function(t,e){this.annotationLayer=new DS({div:this.div,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,page:this.pdfPage,viewport:t.clone({dontFlip:!0}),structTreeLayer:e})},zm=function(t){if(!this.div)return;let e=!1;switch(t){case qo.FULLSCREEN:e=!0;break;case qo.NORMAL:break;default:return}for(const i of this.div.childNodes)i.hasAttribute("data-internal-link")||(i.inert=e)},g0=function(t){function e(n){if(!n.quadPoints)return[n.rect];const a=[];for(let o=2,l=n.quadPoints.length;o<l;o+=8){const c=n.quadPoints[o],d=n.quadPoints[o+1],u=n.quadPoints[o+2],g=n.quadPoints[o+3];a.push([u,g,c,d])}return a}function i(n,a){const o=[],l=e(n),c=e(a);for(const d of l)for(const u of c){const g=jb.intersect(d,u);g&&o.push(g)}return o}function s(n){let a=0;for(const o of n)a+=Math.abs((o[2]-o[0])*(o[3]-o[1]));return a}return t.filter(n=>{let a;for(const o of r(this,wr)){if(o.annotationType!==QA.LINK||!o.url)continue;const l=i(o,n);if(l.length!==0&&(a!=null||(a=s(e(n))),s(l)/a>.5))return!1}return!0})};function Hw(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 Ib;class p0{constructor(){m(this,Ib,new WeakMap)}downloadData(t,e,i){const s=URL.createObjectURL(new Blob([t],{type:i}));Hw(s,e)}openOrDownloadData(t,e,i=null){const n=BS(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(!JA(e,"http://example.com")){console.error("download - not a valid URL: ".concat(e));return}s=e+"#pdfjs.action=download"}Hw(s,i)}}Ib=new WeakMap;const jw={EVENT:"event",TIMEOUT:"timeout"};async function AP({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 a(c){n.abort(),clearTimeout(l),s(c)}const o=h instanceof Ub?"_on":"addEventListener";h[o](t,a.bind(null,jw.EVENT),{signal:n.signal});const l=setTimeout(a.bind(null,jw.TIMEOUT),e);return i}var ah;class Ub{constructor(){m(this,ah,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=r(this,ah)[t];if(!i||i.length===0)return;let s;for(const{listener:n,external:a,once:o}of i.slice(0)){if(o&&this._off(t,n),a){(s||(s=[])).push(n);continue}n(e)}if(s){for(const n of s)n(e);s=null}}_on(t,e,i=null){var a;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)}((a=r(this,ah))[t]||(a[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=r(this,ah)[t];if(s)for(let a=0,o=s.length;a<o;a++){const l=s[a];if(l.listener===e){(n=l.rmAbort)==null||n.call(l),s.splice(a,1);return}}}}ah=new WeakMap;class Yo{constructor(t){this.value=t}valueOf(){return this.value}}class jt extends Yo{constructor(t="???"){super(t)}toString(t){return"{".concat(this.value,"}")}}class yn extends Yo{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 Br extends Yo{static supportsValue(t){if(typeof t=="number"||t instanceof Date)return!0;if(t instanceof Yo)return Br.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 Br?(e={...t.opts,...e},t=t.value):t instanceof Yo&&(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 $w=100,_P="",EP="";function SP(h,t,e){if(e===t||e instanceof yn&&t instanceof yn&&e.value===t.value)return!0;if(t instanceof yn&&typeof e=="string"){let i=h.memoizeIntlObject(Intl.PluralRules,t.opts).select(t.value);if(e===i)return!0}return!1}function Uw(h,t,e){return t[e]?xh(h,t[e].value):(h.reportError(new RangeError("No default")),new jt)}function Gm(h,t){const e=[],i=Object.create(null);for(const s of t)s.type==="narg"?i[s.name]=Ec(h,s.value):e.push(Ec(h,s));return{positional:e,named:i}}function Ec(h,t){switch(t.type){case"str":return t.value;case"num":return new yn(t.value,{minimumFractionDigits:t.precision});case"var":return PP(h,t);case"mesg":return xP(h,t);case"term":return CP(h,t);case"func":return TP(h,t);case"select":return IP(h,t);default:return new jt}}function PP(h,{name:t}){let e;if(h.params)if(Object.prototype.hasOwnProperty.call(h.params,t))e=h.params[t];else return new jt("$".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 jt("$".concat(t));if(e instanceof Yo)return e;switch(typeof e){case"string":return e;case"number":return new yn(e);case"object":if(Br.supportsValue(e))return new Br(e);default:return h.reportError(new TypeError("Variable type not supported: $".concat(t,", ").concat(typeof e))),new jt("$".concat(t))}}function xP(h,{name:t,attr:e}){const i=h.bundle._messages.get(t);if(!i)return h.reportError(new ReferenceError("Unknown message: ".concat(t))),new jt(t);if(e){const s=i.attributes[e];return s?xh(h,s):(h.reportError(new ReferenceError("Unknown attribute: ".concat(e))),new jt("".concat(t,".").concat(e)))}return i.value?xh(h,i.value):(h.reportError(new ReferenceError("No value: ".concat(t))),new jt(t))}function CP(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 jt(s);if(e){const o=n.attributes[e];if(o){h.params=Gm(h,i).named;const l=xh(h,o);return h.params=null,l}return h.reportError(new ReferenceError("Unknown attribute: ".concat(e))),new jt("".concat(s,".").concat(e))}h.params=Gm(h,i).named;const a=xh(h,n.value);return h.params=null,a}function TP(h,{name:t,args:e}){let i=h.bundle._functions[t];if(!i)return h.reportError(new ReferenceError("Unknown function: ".concat(t,"()"))),new jt("".concat(t,"()"));if(typeof i!="function")return h.reportError(new TypeError("Function ".concat(t,"() is not callable"))),new jt("".concat(t,"()"));try{let s=Gm(h,e);return i(s.positional,s.named)}catch(s){return h.reportError(s),new jt("".concat(t,"()"))}}function IP(h,{selector:t,variants:e,star:i}){let s=Ec(h,t);if(s instanceof jt)return Uw(h,e,i);for(const n of e){const a=Ec(h,n.key);if(SP(h,s,a))return xh(h,n.value)}return Uw(h,e,i)}function m0(h,t){if(h.dirty.has(t))return h.reportError(new RangeError("Cyclic reference")),new jt;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>$w)throw h.dirty.delete(t),new RangeError("Too many placeables expanded: ".concat(h.placeables,", ")+"max allowed is ".concat($w));i&&e.push(_P),e.push(Ec(h,s).toString(h)),i&&e.push(EP)}return h.dirty.delete(t),e.join("")}function xh(h,t){return typeof t=="string"?h.bundle._transform(t):m0(h,t)}class LP{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 Xm(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 Ww=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function RP(h,t){let e=h[0];if(e instanceof jt)return new jt("NUMBER(".concat(e.valueOf(),")"));if(e instanceof yn)return new yn(e.valueOf(),{...e.opts,...Xm(t,Ww)});if(e instanceof Br)return new yn(e.toNumber(),{...Xm(t,Ww)});throw new TypeError("Invalid argument to NUMBER")}const MP=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function kP(h,t){let e=h[0];if(e instanceof jt)return new jt("DATETIME(".concat(e.valueOf(),")"));if(e instanceof Br||e instanceof yn)return new Br(e,Xm(t,MP));throw new TypeError("Invalid argument to DATETIME")}const zw=new Map;function DP(h){const t=Array.isArray(h)?h.join(" "):h;let e=zw.get(t);return e===void 0&&(e=new Map,zw.set(t,e)),e}class NP{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:RP,DATETIME:kP,...e},this._useIsolating=i,this._transform=s,this._intls=DP(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 LP(this,i,e);try{return m0(s,t).toString(s)}catch(n){if(s.errors&&n instanceof Error)return s.errors.push(n),new jt().toString(s);throw n}}}const ap=/^(-?[a-zA-Z][\w-]*) *= */gm,Gw=/\.([a-zA-Z][\w-]*) *= */y,FP=/\*?\[/y,op=/(-?[0-9]+(?:\.([0-9]+))?)/y,OP=/([a-zA-Z][\w-]*)/y,Xw=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,BP=/^[A-Z][A-Z0-9_-]*$/,ef=/([^{}\n\r]+)/y,VP=/([^\\"\n\r]*)/y,qw=/\\([\\"])/y,Yw=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,HP=/^\n+/,Kw=/ +$/,jP=/ *\r?\n/g,$P=/( *)$/,UP=/{\s*/y,Zw=/\s*}/y,WP=/\[\s*/y,zP=/\s*] */y,GP=/\s*\(\s*/y,XP=/\s*->\s*/y,qP=/\s*:\s*/y,YP=/\s*,?\s*/y,KP=/\s+/y;class ZP{constructor(t){this.body=[],ap.lastIndex=0;let e=0;for(;;){let C=ap.exec(t);if(C===null)break;e=ap.lastIndex;try{this.body.push(l(C[1]))}catch(L){if(L instanceof SyntaxError)continue;throw L}}function i(C){return C.lastIndex=e,C.test(t)}function s(C,L){if(t[e]===C)return e++,!0;if(L)throw new L("Expected ".concat(C));return!1}function n(C,L){if(i(C))return e=C.lastIndex,!0;if(L)throw new L("Expected ".concat(C.toString()));return!1}function a(C){C.lastIndex=e;let L=C.exec(t);if(L===null)throw new SyntaxError("Expected ".concat(C.toString()));return e=C.lastIndex,L}function o(C){return a(C)[1]}function l(C){let L=d(),M=c();if(L===null&&Object.keys(M).length===0)throw new SyntaxError("Expected message value or attributes");return{id:C,value:L,attributes:M}}function c(){let C=Object.create(null);for(;i(Gw);){let L=o(Gw),M=d();if(M===null)throw new SyntaxError("Expected attribute value");C[L]=M}return C}function d(){let C;if(i(ef)&&(C=o(ef)),t[e]==="{"||t[e]==="}")return u(C?[C]:[],1/0);let L=x();return L?C?u([C,L],L.length):(L.value=T(L.value,HP),u([L],L.length)):C?T(C,Kw):null}function u(C=[],L){for(;;){if(i(ef)){C.push(o(ef));continue}if(t[e]==="{"){C.push(g());continue}if(t[e]==="}")throw new SyntaxError("Unbalanced closing brace");let $=x();if($){C.push($),L=Math.min(L,$.length);continue}break}let M=C.length-1,G=C[M];typeof G=="string"&&(C[M]=T(G,Kw));let W=[];for(let $ of C)$ instanceof Qw&&($=$.value.slice(0,$.value.length-L)),$&&W.push($);return W}function g(){n(UP,SyntaxError);let C=b();if(n(Zw))return C;if(n(XP)){let L=y();return n(Zw,SyntaxError),{type:"select",selector:C,...L}}throw new SyntaxError("Unclosed placeable")}function b(){if(t[e]==="{")return g();if(i(Xw)){let[,C,L,M=null]=a(Xw);if(C==="$")return{type:"var",name:L};if(n(GP)){let G=w();if(C==="-")return{type:"term",name:L,attr:M,args:G};if(BP.test(L))return{type:"func",name:L,args:G};throw new SyntaxError("Function names must be all upper-case")}return C==="-"?{type:"term",name:L,attr:M,args:[]}:{type:"mesg",name:L,attr:M}}return E()}function w(){let C=[];for(;;){switch(t[e]){case")":return e++,C;case void 0:throw new SyntaxError("Unclosed argument list")}C.push(v()),n(YP)}}function v(){let C=b();return C.type!=="mesg"?C:n(qP)?{type:"narg",name:C.name,value:E()}:C}function y(){let C=[],L=0,M;for(;i(FP);){s("*")&&(M=L);let G=A(),W=d();if(W===null)throw new SyntaxError("Expected variant value");C[L++]={key:G,value:W}}if(L===0)return null;if(M===void 0)throw new SyntaxError("Expected default variant");return{variants:C,star:M}}function A(){n(WP,SyntaxError);let C;return i(op)?C=_():C={type:"str",value:o(OP)},n(zP,SyntaxError),C}function E(){if(i(op))return _();if(t[e]==='"')return S();throw new SyntaxError("Invalid expression")}function _(){let[,C,L=""]=a(op),M=L.length;return{type:"num",value:parseFloat(C),precision:M}}function S(){s('"',SyntaxError);let C="";for(;;){if(C+=o(VP),t[e]==="\\"){C+=P();continue}if(s('"'))return{type:"str",value:C};throw new SyntaxError("Unclosed string literal")}}function P(){if(i(qw))return o(qw);if(i(Yw)){let[,C,L]=a(Yw),M=parseInt(C||L,16);return M<=55295||57344<=M?String.fromCodePoint(M):"�"}throw new SyntaxError("Unknown escape sequence")}function x(){let C=e;switch(n(KP),t[e]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return I(t.slice(C,e))}return t[e-1]===" "?I(t.slice(C,e)):!1}function T(C,L){return C.replace(L,"")}function I(C){let L=C.replace(jP,"\n"),M=$P.exec(C)[1].length;return new Qw(L,M)}}}class Qw{constructor(t,e){this.value=t,this.length=e}}const QP=/<|&#?\w+;/,JP={"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"]},tx={"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 ex(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(!QP.test(e))h.textContent=e;else{const i=h.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");i.innerHTML=e,ix(i.content,h)}b0(t,h)}function ix(h,t){for(const e of h.childNodes)if(e.nodeType!==e.TEXT_NODE){if(e.hasAttribute("data-l10n-name")){const i=nx(t,e);h.replaceChild(i,e);continue}if(ax(e)){const i=rx(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(qm(e),e)}t.textContent="",t.appendChild(h)}function sx(h,t){if(!h)return!1;for(let e of h)if(e.name===t)return!0;return!1}function b0(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))Jw(i.name,t,e)&&!sx(h.attributes,i.name)&&t.removeAttribute(i.name);if(h.attributes)for(const i of Array.from(h.attributes))Jw(i.name,t,e)&&t.getAttribute(i.name)!==i.value&&t.setAttribute(i.name,i.value)}function nx(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.")),qm(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,").")),qm(t);h.removeChild(i);const s=i.cloneNode(!1);return w0(t,s)}function rx(h){const t=h.ownerDocument.createElement(h.localName);return w0(h,t)}function qm(h){return h.ownerDocument.createTextNode(h.textContent)}function ax(h){const t=JP[h.namespaceURI];return t&&t.includes(h.localName)}function Jw(h,t,e=null){if(e&&e.includes(h))return!0;const i=tx[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 a=t.type.toLowerCase();if(a==="submit"||a==="button"||a==="reset")return!0}return!1}function w0(h,t){return t.textContent=h.textContent,b0(h,t),t}class ox extends Array{static from(t){return t instanceof this?t:new this(t)}}class lx extends ox{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 hx{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 a=ux(e,n,t,i);if(a.size===0)break;if(typeof console<"u"){const o=n.locales[0],l=Array.from(a).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,dx)}formatValues(t){return this.formatWithFallback(t,cx)}async formatValue(t,e){const[i]=await this.formatValues([{id:t,args:e}]);return i}handleEvent(){this.onChange()}onChange(t=!1){this.bundles=lx.from(this.generateBundles(this.resourceIds)),t&&this.bundles.touchNext(2)}}function cx(h,t,e,i){return e.value?h.formatPattern(e.value,i,t):null}function dx(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[a,o]of n.entries()){let l=h.formatPattern(e.attributes[o],i,t);s.attributes[a]={name:o,value:l}}}return s}function ux(h,t,e,i){const s=[],n=new Set;return e.forEach(({id:a,args:o},l)=>{if(i[l]!==void 0)return;let c=t.getMessage(a);if(c){if(s.length=0,i[l]=h(t,s,c,o),s.length>0&&typeof console<"u"){const d=t.locales[0],u=s.join(", ");console.warn("[fluent][resolver] errors in ".concat(d,"/").concat(a,": ").concat(u,"."))}}else n.add(a)}),n}const Xr="data-l10n-id",Nh="data-l10n-args",fx="[".concat(Xr,"]");class gx extends hx{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:[Xr,Nh]}}onChange(t=!1){super.onChange(t),this.roots&&this.translateRoots()}setAttributes(t,e,i){return t.setAttribute(Xr,e),i?t.setAttribute(Nh,JSON.stringify(i)):t.removeAttribute(Nh),t}getAttributes(t){return{id:t.getAttribute(Xr),args:JSON.parse(t.getAttribute(Nh)||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(Xr)&&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&&ex(t[i],e[i]);this.resumeObserving()}getTranslatables(t){const e=Array.from(t.querySelectorAll(fx));return typeof t.hasAttribute=="function"&&t.hasAttribute(Xr)&&e.push(t),e}getKeysForElement(t){return{id:t.getAttribute(Xr),args:JSON.parse(t.getAttribute(Nh)||null)}}}var iu,yr,oh,Fe,Ch,v0,y0;const wc=class wc{constructor({lang:t,isRTL:e},i=null){m(this,iu);m(this,yr);m(this,oh);m(this,Fe);var s,n;f(this,oh,p(s=wc,Ch,v0).call(s,t)),f(this,Fe,i),f(this,iu,(e!=null?e:p(n=wc,Ch,y0).call(n,r(this,oh)))?"rtl":"ltr")}_setL10n(t){f(this,Fe,t)}getLanguage(){return r(this,oh)}getDirection(){return r(this,iu)}async get(t,e=null,i){var n;return Array.isArray(t)?(t=t.map(o=>({id:o})),(await r(this,Fe).formatMessages(t)).map(o=>o.value)):((n=(await r(this,Fe).formatMessages([{id:t,args:e}]))[0])==null?void 0:n.value)||i}async translate(t){(r(this,yr)||f(this,yr,new Set)).add(t);try{r(this,Fe).connectRoot(t),await r(this,Fe).translateRoots()}catch(e){}}async translateOnce(t){try{await r(this,Fe).translateElements([t])}catch(e){console.error("translateOnce:",e)}}async destroy(){if(r(this,yr)){for(const t of r(this,yr))r(this,Fe).disconnectRoot(t);r(this,yr).clear(),f(this,yr,null)}r(this,Fe).pauseObserving()}pause(){r(this,Fe).pauseObserving()}resume(){r(this,Fe).resumeObserving()}};iu=new WeakMap,yr=new WeakMap,oh=new WeakMap,Fe=new WeakMap,Ch=new WeakSet,v0=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},y0=function(t){const e=t.split("-",1)[0];return["ar","he","fa","ps","ur"].includes(e)},m(wc,Ch);let Ym=wc;function px(){const{isAndroid:h,isLinux:t,isMac:e,isWindows:i}=FS.platform;return t?"linux":i?"windows":e?"macos":h?"android":"other"}function tv(h,t){const e=new ZP(t),i=new NP(h,{functions:{PLATFORM:px}}),s=i.addResource(e);return s.length&&console.error("L10n errors",s),i}var ci,A0,_0,E0,S0,Km;const Jr=class Jr extends Ym{constructor(t){super({lang:t});const e=t?p(Jr,ci,A0).bind(Jr,"en-us",this.getLanguage()):p(Jr,ci,S0).bind(Jr,this.getLanguage());this._setL10n(new gx([],e))}};ci=new WeakSet,A0=async function*(t,e){const{baseURL:i,paths:s}=await p(this,ci,E0).call(this),n=[e];if(t!==e){const o=e.split("-",1)[0];o!==e&&n.push(o),n.push(t)}const a=n.map(o=>[o,p(this,ci,_0).call(this,o,i,s)]);for(const[o,l]of a){const c=await l;c?yield c:o==="en-us"&&(yield p(this,ci,Km).call(this,o))}},_0=async function(t,e,i){const s=i[t];if(!s)return null;const n=new URL(s,e),a=await xw(n,"text");return tv(t,a)},E0=async function(){try{const{href:t}=document.querySelector('link[type="application/l10n"]'),e=await xw(t,"json");return{baseURL:t.substring(0,t.lastIndexOf("/")+1)||"./",paths:e}}catch(t){}return{baseURL:"./",paths:Object.create(null)}},S0=async function*(t){yield p(this,ci,Km).call(this,t)},Km=async function(t){return tv(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-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\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-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')},m(Jr,ci);let xo=Jr;const mx=1e3,bx=50,wx=1e3;function lp(){return document.location.hash}var Ar,Q,Cs,Hf,jf,rc,$f,Zm,P0,x0,Qm,C0,T0;class vx{constructor({linkService:t,eventBus:e}){m(this,Q);m(this,Ar,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,p(this,Q,C0).call(this);const n=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=lp(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!p(this,Q,rc).call(this,n,!0)||e){const{hash:o,page:l,rotation:c}=p(this,Q,Zm).call(this,!0);if(!o||s||e){p(this,Q,Cs).call(this,null,!0);return}p(this,Q,Cs).call(this,{hash:o,page:l,rotation:c},!0);return}const a=n.destination;p(this,Q,$f).call(this,a,n.uid,!0),a.rotation!==void 0&&(this._initialRotation=a.rotation),a.dest?(this._initialBookmark=JSON.stringify(a.dest),this._destination.page=null):a.hash?this._initialBookmark=a.hash:a.page&&(this._initialBookmark="page=".concat(a.page))}reset(){this._initialized&&(p(this,Q,Qm).call(this),this._initialized=!1,p(this,Q,T0).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(!p(this,Q,jf).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&&(yx(this._destination.hash,s)||Ax(this._destination.dest,e))){if(this._destination.page)return;n=!0}this._popStateInProgress&&!n||(p(this,Q,Cs).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(!p(this,Q,jf).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||(p(this,Q,Cs).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||p(this,Q,Hf).call(this)}back(){if(!this._initialized||this._popStateInProgress)return;const t=window.history.state;p(this,Q,rc).call(this,t)&&t.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const t=window.history.state;p(this,Q,rc).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}}Ar=new WeakMap,Q=new WeakSet,Cs=function(t,e=!1){const i=e||!this._destination,s={fingerprint:this._fingerprint,uid:i?this._uid:this._uid+1,destination:t};p(this,Q,$f).call(this,t,s.uid);let n;if(this._updateUrl&&(t!=null&&t.hash)){const{href:a,protocol:o}=document.location;o!=="file:"&&(n=$S(a,t.hash))}i?window.history.replaceState(s,"",n):window.history.pushState(s,"",n)},Hf=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){p(this,Q,Cs).call(this,e);return}if(this._destination.temporary){p(this,Q,Cs).call(this,e,!0);return}if(this._destination.hash===e.hash||!this._destination.page&&this._numPositionUpdates<=bx)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}p(this,Q,Cs).call(this,e,i)},jf=function(t){return Number.isInteger(t)&&t>0&&t<=this.linkService.pagesCount},rc=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")},$f=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},Zm=function(t=!1){const e=unescape(lp()).substring(1),i=jg(e),s=i.get("nameddest")||"";let n=i.get("page")|0;return(!p(this,Q,jf).call(this,n)||t&&s.length>0)&&(n=null),{hash:e,page:n,rotation:this.linkService.rotation}},P0=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||p(this,Q,Hf).call(this,!0),this._updateViewareaTimeout=null},wx))},x0=function({state:t}){const e=lp(),i=this._currentHash!==e;if(this._currentHash=e,!t){this._uid++;const{hash:n,page:a,rotation:o}=p(this,Q,Zm).call(this);p(this,Q,Cs).call(this,{hash:n,page:a,rotation:o},!0);return}if(!p(this,Q,rc).call(this,t))return;this._popStateInProgress=!0,i&&(this._blockHashChange++,AP({target:window,name:"hashchange",delay:mx}).then(()=>{this._blockHashChange--}));const s=t.destination;p(this,Q,$f).call(this,s,t.uid,!0),s0(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})},Qm=function(){(!this._destination||this._destination.temporary)&&p(this,Q,Hf).call(this)},C0=function(){if(r(this,Ar))return;f(this,Ar,new AbortController);const{signal:t}=r(this,Ar);this.eventBus._on("updateviewarea",p(this,Q,P0).bind(this),{signal:t}),window.addEventListener("popstate",p(this,Q,x0).bind(this),{signal:t}),window.addEventListener("pagehide",p(this,Q,Qm).bind(this),{signal:t})},T0=function(){var t;(t=r(this,Ar))==null||t.abort(),f(this,Ar,null)};function yx(h,t){return typeof h!="string"||typeof t!="string"?!1:h===t||jg(h).get("nameddest")===t}function Ax(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 su,nu,ru,au,ou,lh;class _x{constructor(t){m(this,su,null);m(this,nu,null);m(this,ru,null);m(this,au,null);m(this,ou,null);m(this,lh);this.pdfPage=t.pdfPage,this.accessibilityManager=t.accessibilityManager,this.l10n=t.l10n,this.l10n||(this.l10n=new xo),this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,f(this,lh,t.uiManager),f(this,su,t.annotationLayer||null),f(this,ou,t.textLayer||null),f(this,nu,t.drawLayer||null),f(this,ru,t.onAppend||null),f(this,au,t.structTreeLayer||null)}async render({viewport:t,intent:e="display"}){var a;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=r(this,lh).direction,(a=r(this,ru))==null||a.call(this,s),this.annotationEditorLayer=new MS({uiManager:r(this,lh),div:s,structTreeLayer:r(this,au),accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:i,annotationLayer:r(this,su),textLayer:r(this,ou),drawLayer:r(this,nu)});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))}}su=new WeakMap,nu=new WeakMap,ru=new WeakMap,au=new WeakMap,ou=new WeakMap,lh=new WeakMap;{var Jm=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)&&Jm.set("maxCanvasPixels",5242880)})(),function(){i&&Jm.set("useSystemFonts",!1)}()}const R={BROWSER:1,VIEWER:2,API:4,WORKER:8,EVENT_DISPATCH:16,PREFERENCE:128},tb={BOOLEAN:1,NUMBER:2,OBJECT:4,STRING:8,UNDEFINED:16},wn={allowedGlobalEvents:{value:null,kind:R.BROWSER},canvasMaxAreaInBytes:{value:-1,kind:R.BROWSER+R.API},isInAutomation:{value:!1,kind:R.BROWSER},localeProperties:{value:{lang:navigator.language||"en-US"},kind:R.BROWSER},maxCanvasDim:{value:32767,kind:R.BROWSER+R.VIEWER},nimbusDataStr:{value:"",kind:R.BROWSER},supportsCaretBrowsingMode:{value:!1,kind:R.BROWSER},supportsDocumentFonts:{value:!0,kind:R.BROWSER},supportsIntegratedFind:{value:!1,kind:R.BROWSER},supportsMouseWheelZoomCtrlKey:{value:!0,kind:R.BROWSER},supportsMouseWheelZoomMetaKey:{value:!0,kind:R.BROWSER},supportsPinchToZoom:{value:!0,kind:R.BROWSER},supportsPrinting:{value:!0,kind:R.BROWSER},toolbarDensity:{value:0,kind:R.BROWSER+R.EVENT_DISPATCH},altTextLearnMoreUrl:{value:"",kind:R.VIEWER+R.PREFERENCE},annotationEditorMode:{value:0,kind:R.VIEWER+R.PREFERENCE},annotationMode:{value:2,kind:R.VIEWER+R.PREFERENCE},capCanvasAreaFactor:{value:200,kind:R.VIEWER+R.PREFERENCE},cursorToolOnLoad:{value:0,kind:R.VIEWER+R.PREFERENCE},debuggerSrc:{value:"./debugger.mjs",kind:R.VIEWER},defaultZoomDelay:{value:400,kind:R.VIEWER+R.PREFERENCE},defaultZoomValue:{value:"",kind:R.VIEWER+R.PREFERENCE},disableHistory:{value:!1,kind:R.VIEWER},disablePageLabels:{value:!1,kind:R.VIEWER+R.PREFERENCE},enableAltText:{value:!1,kind:R.VIEWER+R.PREFERENCE},enableAltTextModelDownload:{value:!0,kind:R.VIEWER+R.PREFERENCE+R.EVENT_DISPATCH},enableAutoLinking:{value:!0,kind:R.VIEWER+R.PREFERENCE},enableDetailCanvas:{value:!0,kind:R.VIEWER},enableGuessAltText:{value:!0,kind:R.VIEWER+R.PREFERENCE+R.EVENT_DISPATCH},enableHighlightFloatingButton:{value:!1,kind:R.VIEWER+R.PREFERENCE},enableNewAltTextWhenAddingImage:{value:!0,kind:R.VIEWER+R.PREFERENCE},enablePermissions:{value:!1,kind:R.VIEWER+R.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:R.VIEWER+R.PREFERENCE},enableScripting:{value:!0,kind:R.VIEWER+R.PREFERENCE},enableSignatureEditor:{value:!1,kind:R.VIEWER+R.PREFERENCE},enableUpdatedAddImage:{value:!1,kind:R.VIEWER+R.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:R.VIEWER},externalLinkTarget:{value:0,kind:R.VIEWER+R.PREFERENCE},highlightEditorColors:{value:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",kind:R.VIEWER+R.PREFERENCE},historyUpdateUrl:{value:!1,kind:R.VIEWER+R.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:R.VIEWER+R.PREFERENCE},imageResourcesPath:{value:"./images/",kind:R.VIEWER},maxCanvasPixels:{value:2**25,kind:R.VIEWER},minDurationToUpdateCanvas:{value:500,kind:R.VIEWER},forcePageColors:{value:!1,kind:R.VIEWER+R.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:R.VIEWER+R.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:R.VIEWER+R.PREFERENCE},pdfBugEnabled:{value:!1,kind:R.VIEWER+R.PREFERENCE},printResolution:{value:150,kind:R.VIEWER},sidebarViewOnLoad:{value:-1,kind:R.VIEWER+R.PREFERENCE},scrollModeOnLoad:{value:-1,kind:R.VIEWER+R.PREFERENCE},spreadModeOnLoad:{value:-1,kind:R.VIEWER+R.PREFERENCE},textLayerMode:{value:1,kind:R.VIEWER+R.PREFERENCE},viewerCssTheme:{value:0,kind:R.VIEWER+R.PREFERENCE},viewOnLoad:{value:0,kind:R.VIEWER+R.PREFERENCE},cMapPacked:{value:!0,kind:R.API},cMapUrl:{value:"../web/cmaps/",kind:R.API},disableAutoFetch:{value:!1,kind:R.API+R.PREFERENCE},disableFontFace:{value:!1,kind:R.API+R.PREFERENCE},disableRange:{value:!1,kind:R.API+R.PREFERENCE},disableStream:{value:!1,kind:R.API+R.PREFERENCE},docBaseUrl:{value:"",kind:R.API},enableHWA:{value:!0,kind:R.API+R.VIEWER+R.PREFERENCE},enableXfa:{value:!0,kind:R.API+R.PREFERENCE},fontExtraProperties:{value:!1,kind:R.API},iccUrl:{value:"../web/iccs/",kind:R.API},isEvalSupported:{value:!0,kind:R.API},isOffscreenCanvasSupported:{value:!0,kind:R.API},maxImageSize:{value:-1,kind:R.API},pdfBug:{value:!1,kind:R.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:R.API},useSystemFonts:{value:void 0,kind:R.API,type:tb.BOOLEAN+tb.UNDEFINED},verbosity:{value:1,kind:R.API},wasmUrl:{value:"../web/wasm/",kind:R.API},workerPort:{value:null,kind:R.WORKER},workerSrc:{value:"../build/pdf.worker.mjs",kind:R.WORKER}};wn.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:R.VIEWER},wn.sandboxBundleSrc={value:"../build/pdf.sandbox.mjs",kind:R.VIEWER},wn.enableFakeMLManager={value:!0,kind:R.VIEWER};wn.disablePreferences={value:!1,kind:R.VIEWER};var _r;const Ki=class Ki{static get(t){return r(this,_r).get(t)}static getAll(t=null,e=!1){const i=Object.create(null);for(const s in wn){const n=wn[s];t&&!(t&n.kind)||(i[s]=e?n.value:r(this,_r).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=wn[s],a=t[s];if(!n||!(typeof a==typeof n.value||tb[(typeof a).toUpperCase()]&n.type))continue;const{kind:o}=n;e&&!(o&R.BROWSER||o&R.PREFERENCE)||(this.eventBus&&o&R.EVENT_DISPATCH&&(i||(i=new Map)).set(s,a),r(this,_r).set(s,a))}if(i)for(const[s,n]of i)this.eventBus.dispatch(s.toLowerCase(),{source:this,value:n})}};_r=new WeakMap,k(Ki,"eventBus"),m(Ki,_r,new Map),(()=>{for(const t in wn)r(Ki,_r).set(t,wn[t].value);for(const[t,e]of Jm)r(Ki,_r).set(t,e);Ki._hasInvokedSet=!1,Ki._checkDisablePreferences=()=>Ki.get("disablePreferences")?!0:(Ki._hasInvokedSet&&console.warn('The Preferences may override manually set AppOptions; please use the "disablePreferences"-option to prevent that.'),!1)})();let gc=Ki;function ev({width:h,height:t,left:e,top:i},s){if(h===0||t===0)return null;const n=s.textLayer.div.getBoundingClientRect(),a=s.getPagePoint(e-n.left,i-n.top),o=s.getPagePoint(e-n.left+h,i-n.top+t);return jb.normalizeRect([a[0],a[1],o[0],o[1]])}function Ex(h,t){const e=h.getClientRects();if(e.length===1)return{rect:ev(e[0],t)};const i=[1/0,1/0,-1/0,-1/0],s=[];let n=0;for(const a of e){const o=ev(a,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],jb.rectBoundingBox(...o,i),n+=8)}return{quadPoints:s,rect:i}}function iv(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 Sx({url:h,index:t,length:e},i,s){const n=i._textHighlighter,[{begin:a,end:o}]=n._convertMatches([t],[e]),l=new Range;return l.setStart(...iv(n.textDivs[a.divIdx],a.offset)),l.setEnd(...iv(n.textDivs[o.divIdx],o.offset)),{id:"inferred_link_".concat(s),unsafeUrl:h,url:h,annotationType:QA.LINK,rotation:0,...Ex(l,i),borderStyle:null}}var Rg,lu;class eb{static findLinks(t){var a;(a=r(this,lu))!=null||f(this,lu,new RegExp("\\b(?:https?:\\/\\/|mailto:|www\\.)(?:[\\S--[\\p{P}<>]]|\\/|[\\S--[\\[\\]]]+[\\S--[\\p{P}<>]])+|\\b[\\S--[@\\p{Ps}\\p{Pe}<>]]+@([\\S--[\\p{P}<>]]+(?:\\.[\\S--[\\p{P}<>]]+)+)","gmv"));const[e,i]=Of(t,{ignoreDashEOL:!0}),s=e.matchAll(r(this,lu)),n=[];for(const o of s){const[l,c]=o;let d;if(l.startsWith("www.")||l.startsWith("http://")||l.startsWith("https://"))d=l;else if(URL.canParse("http://".concat(c)))d=l.startsWith("mailto:")?l:"mailto:".concat(l);else continue;const u=JA(d,null,{addDefaultProtocol:!0});if(u){const[g,b]=n0(i,o.index,l.length);n.push({url:u.href,index:g,length:b})}}return n}static processLinks(t){return this.findLinks(t._textHighlighter.textContentItemsStr.join("\n")).map(e=>Sx(e,t,se(this,Rg)._++))}}Rg=new WeakMap,lu=new WeakMap,m(eb,Rg,0),m(eb,lu);var uo,Er,hh,ch,dh,ln,Sr,hn,Mg,hu,ib;class I0{constructor(t){m(this,hu);m(this,uo,!1);m(this,Er,null);m(this,hh,0);m(this,ch,null);m(this,dh,ht.INITIAL);m(this,ln,null);m(this,Sr,0);m(this,hn,null);k(this,"canvas",null);k(this,"div",null);k(this,"eventBus",null);k(this,"id",null);k(this,"pageColors",null);k(this,"renderingQueue",null);k(this,"renderTask",null);k(this,"resume",null);m(this,Mg,t=>{var e;if((e=r(this,ln))==null||e.call(this,!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this)){this.renderingState=ht.PAUSED,this.resume=()=>{this.renderingState=ht.RUNNING,t()};return}t()});var e;f(this,uo,tw(uo,t)?r(t,uo):t.enableHWA||!1),this.eventBus=t.eventBus,this.id=t.id,this.pageColors=t.pageColors||null,this.renderingQueue=t.renderingQueue,f(this,hh,(e=t.minDurationToUpdateCanvas)!=null?e:500)}get renderingState(){return r(this,dh)}set renderingState(t){var e;if(t!==r(this,dh))switch(f(this,dh,t),r(this,Er)&&(clearTimeout(r(this,Er)),f(this,Er,null)),t){case ht.PAUSED:this.div.classList.remove("loading"),f(this,Sr,0),(e=r(this,ln))==null||e.call(this,!1);break;case ht.RUNNING:this.div.classList.add("loadingIcon"),f(this,Er,setTimeout(()=>{this.div.classList.add("loading"),f(this,Er,null)},0)),f(this,Sr,Date.now());break;case ht.INITIAL:case ht.FINISHED:this.div.classList.remove("loadingIcon","loading"),f(this,Sr,0);break}}_createCanvas(t,e=!1){const{pageColors:i}=this,s=!!(i!=null&&i.background&&(i!=null&&i.foreground)),n=this.canvas,a=!n&&!s&&!e;let o=this.canvas=document.createElement("canvas");f(this,ln,c=>{if(a){let d=r(this,hn);if(!c&&r(this,hh)>0){if(Date.now()-r(this,Sr)<r(this,hh))return;d||(d=f(this,hn,o),o=this.canvas=o.cloneNode(!1),t(o))}if(d){o.getContext("2d",{alpha:!1}).drawImage(d,0,0),c?p(this,hu,ib).call(this):f(this,Sr,Date.now());return}t(o),f(this,ln,null);return}c&&(n?(n.replaceWith(o),n.width=n.height=0):t(o))});const l=o.getContext("2d",{alpha:!1,willReadFrequently:!r(this,uo)});return{canvas:o,prevCanvas:n,ctx:l}}_resetCanvas(){const{canvas:t}=this;t&&(t.remove(),t.width=t.height=0,this.canvas=null,p(this,hu,ib).call(this))}async _drawCanvas(t,e,i){var a,o;const s=this.renderTask=this.pdfPage.render(t);s.onContinue=r(this,Mg),s.onError=l=>{l instanceof Nm&&(e(),f(this,ch,null))};let n=null;try{await s.promise,(a=r(this,ln))==null||a.call(this,!0)}catch(l){if(l instanceof Nm)return;n=l,(o=r(this,ln))==null||o.call(this,!0)}finally{f(this,ch,n),s===this.renderTask&&(this.renderTask=null)}if(this.renderingState=ht.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:r(this,ch)})}}uo=new WeakMap,Er=new WeakMap,hh=new WeakMap,ch=new WeakMap,dh=new WeakMap,ln=new WeakMap,Sr=new WeakMap,hn=new WeakMap,Mg=new WeakMap,hu=new WeakSet,ib=function(){r(this,hn)&&(r(this,hn).width=r(this,hn).height=0,f(this,hn,null))};var gs;class Px{constructor(t){m(this,gs,null);this.pageIndex=t.pageIndex}async render({intent:t="display"}){t!=="display"||r(this,gs)||this._cancelled||f(this,gs,new NS({pageIndex:this.pageIndex}))}cancel(){this._cancelled=!0,r(this,gs)&&(r(this,gs).destroy(),f(this,gs,null))}setParent(t){var e;(e=r(this,gs))==null||e.setParent(t)}getDrawLayer(){return r(this,gs)}}gs=new WeakMap;var Oi,kg,L0;class xx extends I0{constructor({pageView:e}){super(e);m(this,kg);m(this,Oi,null);k(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===ht.RUNNING||this.renderingState===ht.PAUSED;this.cancelRendering(),this.renderingState=ht.INITIAL,this.renderingCancelled=i,e||this._resetCanvas()}update({visibleArea:e=null,underlyingViewUpdated:i=!1}={}){if(i){this.cancelRendering(),this.renderingState=ht.INITIAL;return}if(!p(this,kg,L0).call(this,e))return;const{viewport:s,maxCanvasPixels:n,capCanvasAreaFactor:a}=this.pageView,o=e.maxX-e.minX,l=e.maxY-e.minY,c=o*l*Ff.pixelRatio**2,u=(Math.sqrt(Ff.capPixels(n,a)/c)-1)/2;let g=Math.min(1,u);g<0&&(g=0);const b=o*g,w=l*g,v=Math.max(0,e.minX-b),y=Math.min(s.width,e.maxX+b),A=Math.max(0,e.minY-w),E=Math.min(s.height,e.maxY+w),_=y-v,S=E-A;f(this,Oi,{minX:v,minY:A,width:_,height:S,scale:s.scale}),this.reset({keepCanvas:!0})}async draw(){if(this.pageView.detailView!==this)return;const e=this.pageView.renderingState===ht.FINISHED||this.renderingState===ht.FINISHED;this.renderingState!==ht.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=ht.FINISHED,new Error("pdfPage is not loaded");this.renderingState=ht.RUNNING;const a=this.pageView._ensureCanvasWrapper(),{canvas:o,prevCanvas:l,ctx:c}=this._createCanvas(A=>{var E;((E=a.firstElementChild)==null?void 0:E.tagName)==="CANVAS"?a.firstElementChild.after(A):a.prepend(A)},e);o.setAttribute("aria-hidden","true");const{width:d,height:u}=n,g=r(this,Oi),{pixelRatio:b}=Ff,w=[b,0,0,b,-g.minX*b,-g.minY*b];o.width=g.width*b,o.height=g.height*b;const{style:v}=o;v.width="".concat(g.width*100/d,"%"),v.height="".concat(g.height*100/u,"%"),v.top="".concat(g.minY*100/u,"%"),v.left="".concat(g.minX*100/d,"%");const y=this._drawCanvas(this.pageView._getRenderingContext(c,w),()=>{var A;(A=this.canvas)==null||A.remove(),this.canvas=l},()=>{this.dispatchPageRendered(!1,!0)});return i.setAttribute("data-loaded",!0),this.dispatchPageRender(),y}}Oi=new WeakMap,kg=new WeakSet,L0=function(e){if(!r(this,Oi))return!0;const i=r(this,Oi).minX,s=r(this,Oi).minY,n=r(this,Oi).width+i,a=r(this,Oi).height+s;if(e.minX<i||e.minY<s||e.maxX>n||e.maxY>a)return!0;const{width:o,height:l,scale:c}=this.pageView.viewport;if(r(this,Oi).scale!==c)return!0;const d=e.minX-i,u=n-e.maxX,g=e.minY-s,b=a-e.maxY,w=.5,v=(1+w)/w;return i>0&&u/d>v||n<o&&d/u>v||s>0&&b/g>v||a<l&&g/b>v};const sv={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},Cx=/^H(\d+)$/;var uh,Bi,fh,gh,ph,Pr,_s,sb,M0,nb;class R0{constructor(t,e){m(this,_s);m(this,uh);m(this,Bi,null);m(this,fh);m(this,gh,new Map);m(this,ph);m(this,Pr,null);f(this,uh,t.getStructTree()),f(this,ph,e)}async render(){var s;if(r(this,fh))return r(this,fh);const{promise:t,resolve:e,reject:i}=Promise.withResolvers();f(this,fh,t);try{f(this,Bi,p(this,_s,nb).call(this,await r(this,uh)))}catch(n){i(n)}return f(this,uh,null),(s=r(this,Bi))==null||s.classList.add("structTree"),e(r(this,Bi)),t}async getAriaAttributes(t){try{return await this.render(),r(this,gh).get(t)}catch(e){}return null}hide(){r(this,Bi)&&!r(this,Bi).hidden&&(r(this,Bi).hidden=!0)}show(){var t;(t=r(this,Bi))!=null&&t.hidden&&(r(this,Bi).hidden=!1)}addElementsToTextLayer(){var t;if(r(this,Pr)){for(const[e,i]of r(this,Pr))(t=document.getElementById(e))==null||t.append(i);r(this,Pr).clear(),f(this,Pr,null)}}}uh=new WeakMap,Bi=new WeakMap,fh=new WeakMap,gh=new WeakMap,ph=new WeakMap,Pr=new WeakMap,_s=new WeakSet,sb=function(t,e){const{alt:i,id:s,lang:n}=t;if(i!==void 0){let a=!1;const o=fc(i);for(const l of t.children)if(l.type==="annotation"){let c=r(this,gh).get(l.id);c||(c=new Map,r(this,gh).set(l.id,c)),c.set("aria-label",o),a=!0}a||e.setAttribute("aria-label",o)}s!==void 0&&e.setAttribute("aria-owns",s),n!==void 0&&e.setAttribute("lang",fc(n,!0))},M0=function(t,e){const{alt:i,bbox:s,children:n}=t,a=n==null?void 0:n[0];if(!r(this,ph)||!i||!s||(a==null?void 0:a.type)!=="content")return!1;const{id:o}=a;if(!o)return!1;e.setAttribute("aria-owns",o);const l=document.createElement("span");(r(this,Pr)||f(this,Pr,new Map)).set(o,l),l.setAttribute("role","img"),l.setAttribute("aria-label",fc(i));const{pageHeight:c,pageX:d,pageY:u}=r(this,ph),g="calc(var(--total-scale-factor) *",{style:b}=l;return b.width="".concat(g).concat(s[2]-s[0],"px)"),b.height="".concat(g).concat(s[3]-s[1],"px)"),b.left="".concat(g).concat(s[0]-d,"px)"),b.top="".concat(g).concat(c-s[3]+u,"px)"),!0},nb=function(t){if(!t)return null;const e=document.createElement("span");if("role"in t){const{role:i}=t,s=i.match(Cx);if(s?(e.setAttribute("role","heading"),e.setAttribute("aria-level",s[1])):sv[i]&&e.setAttribute("role",sv[i]),i==="Figure"&&p(this,_s,M0).call(this,t,e))return e}if(p(this,_s,sb).call(this,t,e),t.children)if(t.children.length===1&&"id"in t.children[0])p(this,_s,sb).call(this,t.children[0],e);else for(const i of t.children)e.append(p(this,_s,nb).call(this,i));return e};var cn,yi,dn,xr,mh,Uf,cu,ab;const Go=class Go{constructor(){m(this,cu);m(this,cn,!1);m(this,yi,null);m(this,dn,new Map);m(this,xr,new Map)}setTextMapping(t){f(this,yi,t)}enable(){if(r(this,cn))throw new Error("TextAccessibilityManager is already enabled.");if(!r(this,yi))throw new Error("Text divs and strings have not been set.");if(f(this,cn,!0),f(this,yi,r(this,yi).slice()),r(this,yi).sort(p(Go,mh,Uf)),r(this,dn).size>0){const t=r(this,yi);for(const[e,i]of r(this,dn)){if(!document.getElementById(e)){r(this,dn).delete(e);continue}p(this,cu,ab).call(this,e,t[i])}}for(const[t,e]of r(this,xr))this.addPointerInTextLayer(t,e);r(this,xr).clear()}disable(){r(this,cn)&&(r(this,xr).clear(),f(this,yi,null),f(this,cn,!1))}removePointerInTextLayer(t){if(!r(this,cn)){r(this,xr).delete(t);return}const e=r(this,yi);if(!e||e.length===0)return;const{id:i}=t,s=r(this,dn).get(i);if(s===void 0)return;const n=e[s];r(this,dn).delete(i);let a=n.getAttribute("aria-owns");a!=null&&a.includes(i)&&(a=a.split(" ").filter(o=>o!==i).join(" "),a?n.setAttribute("aria-owns",a):(n.removeAttribute("aria-owns"),n.setAttribute("role","presentation")))}addPointerInTextLayer(t,e){const{id:i}=t;if(!i)return null;if(!r(this,cn))return r(this,xr).set(t,e),null;e&&this.removePointerInTextLayer(t);const s=r(this,yi);if(!s||s.length===0)return null;const n=_c(s,c=>{var d;return p(d=Go,mh,Uf).call(d,t,c)<0}),a=Math.max(0,n-1),o=s[a];p(this,cu,ab).call(this,i,o),r(this,dn).set(i,a);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 a=Array.from(t.childNodes).filter(c=>c!==e);if(a.length===0)return n;const o=i||e,l=_c(a,c=>{var d;return p(d=Go,mh,Uf).call(d,o,c)<0});return l===0?a[0].before(e):a[l-1].after(e),n}};cn=new WeakMap,yi=new WeakMap,dn=new WeakMap,xr=new WeakMap,mh=new WeakSet,Uf=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,a=i.y+i.height,o=i.y+i.height/2,l=s.y,c=s.y+s.height,d=s.y+s.height/2;if(o<=l&&d>=a)return-1;if(d<=n&&o>=c)return 1;const u=i.x+i.width/2,g=s.x+s.width/2;return u-g},cu=new WeakSet,ab=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")},m(Go,mh);let rb=Go;var Cr;class Tx{constructor({findController:t,eventBus:e,pageIndex:i}){m(this,Cr,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,r(this,Cr)||(f(this,Cr,new AbortController),this.eventBus._on("updatetextlayermatches",t=>{(t.pageIndex===this.pageIdx||t.pageIndex===-1)&&this._updateMatches()},{signal:r(this,Cr).signal})),this._updateMatches()}disable(){var t;this.enabled&&(this.enabled=!1,(t=r(this,Cr))==null||t.abort(),f(this,Cr,null),this._updateMatches(!0))}_convertMatches(t,e){if(!t)return[];const{textContentItemsStr:i}=this;let s=0,n=0;const a=i.length-1,o=[];for(let l=0,c=t.length;l<c;l++){let d=t[l];for(;s!==a&&d>=n+i[s].length;)n+=i[s].length,s++;s===i.length&&console.error("Could not find a matching mapping");const u={begin:{divIdx:s,offset:d-n}};for(d+=e[l];s!==a&&d>n+i[s].length;)n+=i[s].length,s++;u.end={divIdx:s,offset:d-n},o.push(u)}return o}_renderMatches(t){if(t.length===0)return;const{findController:e,pageIdx:i}=this,{textContentItemsStr:s,textDivs:n}=this,a=i===e.selected.pageIdx,o=e.selected.matchIdx,l=e.state.highlightAll;let c=null;const d={offset:void 0};function u(A,E){const _=A.divIdx;return n[_].textContent="",g(_,0,A.offset,E)}function g(A,E,_,S){let P=n[A];if(P.nodeType===Node.TEXT_NODE){const I=document.createElement("span");P.before(I),I.append(P),n[A]=I,P=I}const x=s[A].substring(E,_),T=document.createTextNode(x);if(S){const I=document.createElement("span");if(I.className="".concat(S," appended"),I.append(T),P.append(I),S.includes("selected")){const{left:C}=I.getClientRects()[0],L=P.getBoundingClientRect().left;return C-L}return 0}return P.append(T),0}let b=o,w=b+1;if(l)b=0,w=t.length;else if(!a)return;let v=-1,y=-1;for(let A=b;A<w;A++){const E=t[A],_=E.begin;if(_.divIdx===v&&_.offset===y)continue;v=_.divIdx,y=_.offset;const S=E.end,P=a&&A===o,x=P?" selected":"";let T=0;if(!c||_.divIdx!==c.divIdx?(c!==null&&g(c.divIdx,c.offset,d.offset),u(_)):g(c.divIdx,c.offset,_.offset),_.divIdx===S.divIdx)T=g(_.divIdx,_.offset,S.offset,"highlight"+x);else{T=g(_.divIdx,_.offset,d.offset,"highlight begin"+x);for(let I=_.divIdx+1,C=S.divIdx;I<C;I++)n[I].className="highlight middle"+x;u(S,"highlight end"+x)}c=S,P&&e.scrollMatchIntoView({element:n[_.divIdx],selectedLeft:T,pageIndex:i,matchIndex:o})}c&&g(c.divIdx,c.offset,d.offset)}_updateMatches(t=!1){if(!this.enabled&&!t)return;const{findController:e,matches:i,pageIdx:s}=this,{textContentItemsStr:n,textDivs:a}=this;let o=-1;for(const d of i){const u=Math.max(o,d.begin.divIdx);for(let g=u,b=d.end.divIdx;g<=b;g++){const w=a[g];w.textContent=n[g],w.className=""}o=d.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)}}Cr=new WeakMap;var du,uu,fo,ps,Oe,Tr,Dg,k0,Th,D0,N0;const Rn=class Rn{constructor({pdfPage:t,highlighter:e=null,accessibilityManager:i=null,enablePermissions:s=!1,onAppend:n=null}){m(this,Dg);m(this,du,!1);m(this,uu,null);m(this,fo,!1);m(this,ps,null);this.pdfPage=t,this.highlighter=e,this.accessibilityManager=i,f(this,du,s===!0),f(this,uu,n),this.div=document.createElement("div"),this.div.tabIndex=0,this.div.className="textLayer"}async render({viewport:t,textContentParams:e=null}){var a,o,l,c,d;if(r(this,fo)&&r(this,ps)){r(this,ps).update({viewport:t,onBefore:this.hide.bind(this)}),this.show();return}this.cancel(),f(this,ps,new jS({textContentSource:this.pdfPage.streamTextContent(e||{includeMarkedContent:!0,disableNormalization:!0}),container:this.div,viewport:t}));const{textDivs:i,textContentItemsStr:s}=r(this,ps);(a=this.highlighter)==null||a.setTextMapping(i,s),(o=this.accessibilityManager)==null||o.setTextMapping(i),await r(this,ps).render(),f(this,fo,!0);const n=document.createElement("div");n.className="endOfContent",this.div.append(n),p(this,Dg,k0).call(this,n),(l=r(this,uu))==null||l.call(this,this.div),(c=this.highlighter)==null||c.enable(),(d=this.accessibilityManager)==null||d.enable()}hide(){var t;!this.div.hidden&&r(this,fo)&&((t=this.highlighter)==null||t.disable(),this.div.hidden=!0)}show(){var t;this.div.hidden&&r(this,fo)&&(this.div.hidden=!1,(t=this.highlighter)==null||t.enable())}cancel(){var t,e,i,s;(t=r(this,ps))==null||t.cancel(),f(this,ps,null),(e=this.highlighter)==null||e.disable(),(i=this.accessibilityManager)==null||i.disable(),p(s=Rn,Th,D0).call(s,this.div)}};du=new WeakMap,uu=new WeakMap,fo=new WeakMap,ps=new WeakMap,Oe=new WeakMap,Tr=new WeakMap,Dg=new WeakSet,k0=function(t){var i;const{div:e}=this;e.addEventListener("mousedown",()=>{e.classList.add("selecting")}),e.addEventListener("copy",s=>{if(!r(this,du)){const n=document.getSelection();s.clipboardData.setData("text/plain",fc(HS(n.toString())))}Fm(s)}),r(Rn,Oe).set(e,t),p(i=Rn,Th,N0).call(i)},Th=new WeakSet,D0=function(t){var e;r(this,Oe).delete(t),r(this,Oe).size===0&&((e=r(this,Tr))==null||e.abort(),f(this,Tr,null))},N0=function(){if(r(this,Tr))return;f(this,Tr,new AbortController);const{signal:t}=r(this,Tr),e=(a,o)=>{o.append(a),a.style.width="",a.style.height="",o.classList.remove("selecting")};let i=!1;document.addEventListener("pointerdown",()=>{i=!0},{signal:t}),document.addEventListener("pointerup",()=>{i=!1,r(this,Oe).forEach(e)},{signal:t}),window.addEventListener("blur",()=>{i=!1,r(this,Oe).forEach(e)},{signal:t}),document.addEventListener("keyup",()=>{i||r(this,Oe).forEach(e)},{signal:t});var s,n;document.addEventListener("selectionchange",()=>{var b;const a=document.getSelection();if(a.rangeCount===0){r(this,Oe).forEach(e);return}const o=new Set;for(let w=0;w<a.rangeCount;w++){const v=a.getRangeAt(w);for(const y of r(this,Oe).keys())!o.has(y)&&v.intersectsNode(y)&&o.add(y)}for(const[w,v]of r(this,Oe))o.has(w)?w.classList.add("selecting"):e(v,w);if(s!=null||(s=getComputedStyle(r(this,Oe).values().next().value).getPropertyValue("-moz-user-select")==="none"),s)return;const l=a.getRangeAt(0),c=n&&(l.compareBoundaryPoints(Range.END_TO_END,n)===0||l.compareBoundaryPoints(Range.START_TO_END,n)===0);let d=c?l.startContainer:l.endContainer;if(d.nodeType===Node.TEXT_NODE&&(d=d.parentNode),!c&&l.endOffset===0)do{for(;!d.previousSibling;)d=d.parentNode;d=d.previousSibling}while(!d.childNodes.length);const u=(b=d.parentElement)==null?void 0:b.closest(".textLayer"),g=r(this,Oe).get(u);g&&(g.style.width=u.style.width,g.style.height=u.style.height,d.parentElement.insertBefore(g,c?d:d.nextSibling)),n=l.cloneRange()},{signal:t})},m(Rn,Th),m(Rn,Oe,new Map),m(Rn,Tr,null);let hg=Rn;class Wb{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,ip.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?ip.update(s):(this.div=document.createElement("div"),s.div=this.div,ip.render(s))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}const Ix={annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new $g}},Lx=new Map([["canvasWrapper",0],["textLayer",1],["annotationLayer",2],["annotationEditorLayer",3],["xfaLayer",3]]);var go,Ir,fu,gu,pu,Lr,Rr,bh,mu,bu,wu,wh,vu,un,Mr,tt,Vo,Wf,ac,ob,lb,hb,cb,db,O0,B0,V0,ub;class F0 extends I0{constructor(e){var a,o,l,c,d,u,g;super(e);m(this,tt);m(this,go,bn.ENABLE_FORMS);m(this,Ir,null);m(this,fu,!0);m(this,gu,!1);m(this,pu,!1);m(this,Lr,null);m(this,Rr,!1);m(this,bh,null);m(this,mu,null);m(this,bu,1);m(this,wu,1);m(this,wh,bs.ENABLE);m(this,vu,1);m(this,un,{directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0});m(this,Mr,[null,null,null,null]);const i=e.container,s=e.defaultViewport;this.renderingId="page"+this.id,f(this,Lr,e.layerProperties||Ix),this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||e0,this.viewport=s,this.pdfPageRotate=s.rotation,this._optionalContentConfigPromise=e.optionalContentConfigPromise||null,f(this,wh,(a=e.textLayerMode)!=null?a:bs.ENABLE),f(this,go,(o=e.annotationMode)!=null?o:bn.ENABLE_FORMS),this.imageResourcesPath=e.imageResourcesPath||"",this.enableDetailCanvas=(l=e.enableDetailCanvas)!=null?l:!0,this.maxCanvasPixels=(c=e.maxCanvasPixels)!=null?c:gc.get("maxCanvasPixels"),this.maxCanvasDim=e.maxCanvasDim||gc.get("maxCanvasDim"),this.capCanvasAreaFactor=(d=e.capCanvasAreaFactor)!=null?d:gc.get("capCanvasAreaFactor"),f(this,fu,e.enableAutoLinking!==!1),this.l10n=e.l10n,this.l10n||(this.l10n=new xo),this._isStandalone=!((u=this.renderingQueue)!=null&&u.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,p(this,tt,Wf).call(this),i==null||i.append(n),this._isStandalone){i==null||i.style.setProperty("--scale-factor",this.scale*Ls.PDF_TO_CSS_UNITS),(g=this.pageColors)!=null&&g.background&&(i==null||i.style.setProperty("--page-bg-color",this.pageColors.background));const{optionalContentConfigPromise:b}=e;b&&b.then(w=>{b===this._optionalContentConfigPromise&&(r(this,un).initialOptionalContent=w.hasInitialVisibility)}),e.l10n||this.l10n.translate(this.div)}}setPdfPage(e){var s,n,a,o;this._isStandalone&&(((s=this.pageColors)==null?void 0:s.foreground)==="CanvasText"||((n=this.pageColors)==null?void 0:n.background)==="Canvas")&&((a=this._container)==null||a.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*Ls.PDF_TO_CSS_UNITS,rotation:i}),p(this,tt,Wf).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 lg(this,"_textHighlighter",new Tx({pageIndex:this.id-1,eventBus:this.eventBus,findController:r(this,Lr).findController}))}_resetCanvas(){super._resetCanvas(),f(this,bh,null)}reset({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:i=!1,keepXfaLayer:s=!1,keepTextLayer:n=!1,keepCanvasWrapper:a=!1,preserveDetailViewState:o=!1}={}){var v,y,A,E,_,S;this.cancelRendering({keepAnnotationLayer:e,keepAnnotationEditorLayer:i,keepXfaLayer:s,keepTextLayer:n}),this.renderingState=ht.INITIAL;const l=this.div,c=l.childNodes,d=e&&((v=this.annotationLayer)==null?void 0:v.div)||null,u=i&&((y=this.annotationEditorLayer)==null?void 0:y.div)||null,g=s&&((A=this.xfaLayer)==null?void 0:A.div)||null,b=n&&((E=this.textLayer)==null?void 0:E.div)||null,w=a&&r(this,Ir)||null;for(let P=c.length-1;P>=0;P--){const x=c[P];switch(x){case d:case u:case g:case b:case w:continue}x.remove();const T=r(this,Mr).indexOf(x);T>=0&&(r(this,Mr)[T]=null)}l.removeAttribute("data-loaded"),d&&this.annotationLayer.hide(),u&&this.annotationEditorLayer.hide(),g&&this.xfaLayer.hide(),b&&this.textLayer.hide(),(_=this.structTreeLayer)==null||_.hide(),!a&&r(this,Ir)&&(f(this,Ir,null),this._resetCanvas()),o||((S=this.detailView)==null||S.reset({keepCanvas:a}),a||(this.detailView=null))}toggleEditingMode(e){f(this,pu,e),this.hasEditableAnnotations()&&this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0})}updateVisibleArea(e){var i;this.enableDetailCanvas&&(r(this,Rr)&&this.maxCanvasPixels>0&&e?((i=this.detailView)!=null||(this.detailView=new xx({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(d=>{s===this._optionalContentConfigPromise&&(r(this,un).initialOptionalContent=d.hasInitialVisibility)})),r(this,un).directDrawing=!0;const a=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*Ls.PDF_TO_CSS_UNITS,rotation:a}),p(this,tt,Wf).call(this),this._isStandalone&&((o=this._container)==null||o.style.setProperty("--scale-factor",this.viewport.scale)),p(this,tt,ub).call(this),this.canvas){const d=r(this,gu)&&r(this,Rr),u=n>=0&&n<1e3;if(u||d){u&&!d&&this.renderingState!==ht.FINISHED&&(this.cancelRendering({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:n}),this.renderingState=ht.FINISHED,r(this,un).directDrawing=!1),this.cssTransform({redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!u,hideTextLayer:u}),u||((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:a=0}={}){var o;super.cancelRendering({cancelExtraDelay:a}),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:a=!1}){var c;const{canvas:o}=this;if(!o)return;const l=r(this,bh);if(this.viewport!==l){const d=(360+this.viewport.rotation-l.rotation)%360;if(d===90||d===270){const{width:u,height:g}=this.viewport,b=g/u,w=u/g;o.style.transform="rotate(".concat(d,"deg) scale(").concat(b,",").concat(w,")")}else o.style.transform=d===0?"":"rotate(".concat(d,"deg)")}e&&this.annotationLayer&&p(this,tt,ob).call(this),i&&this.annotationEditorLayer&&(this.drawLayer&&p(this,tt,hb).call(this),p(this,tt,lb).call(this)),s&&this.xfaLayer&&p(this,tt,cb).call(this),this.textLayer&&(a?(this.textLayer.hide(),(c=this.structTreeLayer)==null||c.hide()):n&&p(this,tt,db).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=r(this,Ir);return e||(e=f(this,Ir,document.createElement("div")),e.classList.add("canvasWrapper"),p(this,tt,Vo).call(this,e,"canvasWrapper")),e}_getRenderingContext(e,i){return{canvasContext:e,transform:i,viewport:this.viewport,annotationMode:r(this,go),optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:this.pageColors,isEditing:r(this,pu)}}async draw(){this.renderingState!==ht.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=ht.FINISHED,new Error("pdfPage is not loaded");this.renderingState=ht.RUNNING;const a=this._ensureCanvasWrapper();if(!this.textLayer&&r(this,wh)!==bs.DISABLE&&!s.isPureXfa&&(this._accessibilityManager||(this._accessibilityManager=new rb),this.textLayer=new hg({pdfPage:s,highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,enablePermissions:r(this,wh)===bs.ENABLE_PERMISSIONS,onAppend:P=>{this.l10n.pause(),p(this,tt,Vo).call(this,P,"textLayer"),this.l10n.resume()}})),!this.annotationLayer&&r(this,go)!==bn.DISABLE){const{annotationStorage:P,annotationEditorUIManager:x,downloadManager:T,enableScripting:I,fieldObjectsPromise:C,hasJSActionsPromise:L,linkService:M}=r(this,Lr);this._annotationCanvasMap||(this._annotationCanvasMap=new Map),this.annotationLayer=new f0({pdfPage:s,annotationStorage:P,imageResourcesPath:this.imageResourcesPath,renderForms:r(this,go)===bn.ENABLE_FORMS,linkService:M,downloadManager:T,enableScripting:I,hasJSActionsPromise:L,fieldObjectsPromise:C,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager,annotationEditorUIManager:x,onAppend:G=>{p(this,tt,Vo).call(this,G,"annotationLayer")}})}const{width:o,height:l}=n;f(this,bh,n);const{canvas:c,prevCanvas:d,ctx:u}=this._createCanvas(P=>{a.prepend(P)});c.setAttribute("role","presentation"),this.outputScale||p(this,tt,ub).call(this);const{outputScale:g}=this;f(this,gu,r(this,Rr));const b=Mw(g.sx),w=Mw(g.sy),v=c.width=Qu(Ju(o*g.sx),b[0]),y=c.height=Qu(Ju(l*g.sy),w[0]),A=Qu(Ju(o),b[1]),E=Qu(Ju(l),w[1]);g.sx=v/A,g.sy=y/E,r(this,bu)!==b[1]&&(e.style.setProperty("--scale-round-x","".concat(b[1],"px")),f(this,bu,b[1])),r(this,wu)!==w[1]&&(e.style.setProperty("--scale-round-y","".concat(w[1],"px")),f(this,wu,w[1]));const _=g.scaled?[g.sx,0,0,g.sy,0,0]:null,S=this._drawCanvas(this._getRenderingContext(u,_),()=>{d==null||d.remove(),this._resetCanvas()},P=>{r(this,un).regularAnnotations=!P.separateAnnots,this.dispatchPageRendered(!1,!1)}).then(async()=>{var T;this.structTreeLayer||(this.structTreeLayer=new R0(s,n.rawDims));const P=p(this,tt,db).call(this);this.annotationLayer&&(await p(this,tt,ob).call(this),r(this,fu)&&this.annotationLayer&&this.textLayer&&await p(this,tt,V0).call(this,P));const{annotationEditorUIManager:x}=r(this,Lr);x&&(this.drawLayer||(this.drawLayer=new Px({pageIndex:this.id})),await p(this,tt,hb).call(this),this.drawLayer.setParent(a),this.annotationEditorLayer||(this.annotationEditorLayer=new _x({uiManager:x,pdfPage:s,l10n:i,structTreeLayer:this.structTreeLayer,accessibilityManager:this._accessibilityManager,annotationLayer:(T=this.annotationLayer)==null?void 0:T.annotationLayer,textLayer:this.textLayer,drawLayer:this.drawLayer.getDrawLayer(),onAppend:I=>{p(this,tt,Vo).call(this,I,"annotationEditorLayer")}})),p(this,tt,lb).call(this))});if(s.isPureXfa){if(!this.xfaLayer){const{annotationStorage:P,linkService:x}=r(this,Lr);this.xfaLayer=new Wb({pdfPage:s,annotationStorage:P,linkService:x})}p(this,tt,cb).call(this)}return e.setAttribute("data-loaded",!0),this.dispatchPageRender(),S}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}=r(this,un);return e&&i&&s?this.canvas:null}}go=new WeakMap,Ir=new WeakMap,fu=new WeakMap,gu=new WeakMap,pu=new WeakMap,Lr=new WeakMap,Rr=new WeakMap,bh=new WeakMap,mu=new WeakMap,bu=new WeakMap,wu=new WeakMap,wh=new WeakMap,vu=new WeakMap,un=new WeakMap,Mr=new WeakMap,tt=new WeakSet,Vo=function(e,i){const s=Lx.get(i),n=r(this,Mr)[s];if(r(this,Mr)[s]=e,n){n.replaceWith(e);return}for(let a=s-1;a>=0;a--){const o=r(this,Mr)[a];if(o){o.after(e);return}}this.div.prepend(e)},Wf=function(){const{div:e,viewport:i}=this;if(i.userUnit!==r(this,vu)&&(i.userUnit!==1?e.style.setProperty("--user-unit",i.userUnit):e.style.removeProperty("--user-unit"),f(this,vu,i.userUnit)),this.pdfPage){if(r(this,mu)===i.rotation)return;f(this,mu,i.rotation)}t0(e,i,!0,!1)},ac=function(e,i){this.eventBus.dispatch(e,{source:this,pageNumber:this.id,error:i})},ob=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{p(this,tt,ac).call(this,"annotationlayerrendered",e)}},lb=async function(){let e=null;try{await this.annotationEditorLayer.render({viewport:this.viewport,intent:"display"})}catch(i){console.error("#renderAnnotationEditorLayer:",i),e=i}finally{p(this,tt,ac).call(this,"annotationeditorlayerrendered",e)}},hb=async function(){try{await this.drawLayer.render({intent:"display"})}catch(e){console.error("#renderDrawLayer:",e)}},cb=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&&p(this,tt,B0).call(this,s.textDivs)}catch(s){console.error("#renderXfaLayer:",s),e=s}finally{(i=this.xfaLayer)!=null&&i.div&&(this.l10n.pause(),p(this,tt,Vo).call(this,this.xfaLayer.div,"xfaLayer"),this.l10n.resume()),p(this,tt,ac).call(this,"xfalayerrendered",e)}},db=async function(){if(!this.textLayer)return;let e=null;try{await this.textLayer.render({viewport:this.viewport})}catch(i){if(i instanceof RS)return;console.error("#renderTextLayer:",i),e=i}p(this,tt,ac).call(this,"textlayerrendered",e),p(this,tt,O0).call(this)},O0=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()},B0=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()},V0=async function(e){try{if(await e,!this.annotationLayer)return;await this.annotationLayer.injectLinkAnnotations({inferredLinks:eb.processLinks(this),viewport:this.viewport,structTreeLayer:this.structTreeLayer})}catch(i){console.error("#injectLinkAnnotations:",i)}},ub=function(){const{width:e,height:i}=this.viewport,s=this.outputScale=new Ff;if(this.maxCanvasPixels===0){const n=1/this.scale;s.sx*=n,s.sy*=n,f(this,Rr,!0)}else f(this,Rr,s.limitCanvas(e,i,this.maxCanvasPixels,this.maxCanvasDim,this.capCanvasAreaFactor))};async function Rx(h){const t="",e="",{info:i,metadata:s,contentDispositionFilename:n,contentLength:a}=await h.getMetadata();return{...i,baseURL:e,filesize:a||(await h.getDownloadInfo()).length,filename:n||OS(t),metadata:s==null?void 0:s.getRaw(),authors:s==null?void 0:s.get("dc:creator"),numPages:h.numPages,URL:t}}class Mx{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 ms,po,yu,mo,bo,Au,Pe,fn,vh,Gt,Ai,ie,H0,zf,fb,j0,oc;class kx{constructor({eventBus:t,externalServices:e=null,docProperties:i=null}){m(this,ie);m(this,ms,null);m(this,po,null);m(this,yu,null);m(this,mo,null);m(this,bo,null);m(this,Au,null);m(this,Pe,null);m(this,fn,null);m(this,vh,!1);m(this,Gt,null);m(this,Ai,null);f(this,bo,t),f(this,Au,e),f(this,yu,i)}setViewer(t){f(this,fn,t)}async setDocument(t){var o;if(r(this,Pe)&&await p(this,ie,oc).call(this),f(this,Pe,t),!t)return;const[e,i,s]=await Promise.all([t.getFieldObjects(),t.getCalculationOrderIds(),t.getJSActions()]);if(!e&&!s){await p(this,ie,oc).call(this);return}if(t!==r(this,Pe))return;try{f(this,Gt,p(this,ie,j0).call(this))}catch(l){console.error("setDocument:",l),await p(this,ie,oc).call(this);return}const n=r(this,bo);f(this,mo,new AbortController);const{signal:a}=r(this,mo);n._on("updatefromsandbox",l=>{(l==null?void 0:l.source)===window&&p(this,ie,H0).call(this,l.detail)},{signal:a}),n._on("dispatcheventinsandbox",l=>{var c;(c=r(this,Gt))==null||c.dispatchEventInSandbox(l.detail)},{signal:a}),n._on("pagechanging",({pageNumber:l,previous:c})=>{l!==c&&(p(this,ie,fb).call(this,c),p(this,ie,zf).call(this,l))},{signal:a}),n._on("pagerendered",({pageNumber:l})=>{this._pageOpenPending.has(l)&&l===r(this,fn).currentPageNumber&&p(this,ie,zf).call(this,l)},{signal:a}),n._on("pagesdestroy",async()=>{var l,c;await p(this,ie,fb).call(this,r(this,fn).currentPageNumber),await((l=r(this,Gt))==null?void 0:l.dispatchEventInSandbox({id:"doc",name:"WillClose"})),(c=r(this,ms))==null||c.resolve()},{signal:a});try{const l=await r(this,yu).call(this,t);if(t!==r(this,Pe))return;await r(this,Gt).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 p(this,ie,oc).call(this);return}await((o=r(this,Gt))==null?void 0:o.dispatchEventInSandbox({id:"doc",name:"Open"})),await p(this,ie,zf).call(this,r(this,fn).currentPageNumber,!0),Promise.resolve().then(()=>{t===r(this,Pe)&&f(this,vh,!0)})}async dispatchWillSave(){var t;return(t=r(this,Gt))==null?void 0:t.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(){var t;return(t=r(this,Gt))==null?void 0:t.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(){var t;if(r(this,Gt)){await((t=r(this,Ai))==null?void 0:t.promise),f(this,Ai,Promise.withResolvers());try{await r(this,Gt).dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(e){throw r(this,Ai).resolve(),f(this,Ai,null),e}await r(this,Ai).promise}}async dispatchDidPrint(){var t;return(t=r(this,Gt))==null?void 0:t.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){var t;return((t=r(this,po))==null?void 0:t.promise)||null}get ready(){return r(this,vh)}get _pageOpenPending(){return lg(this,"_pageOpenPending",new Set)}get _visitedPages(){return lg(this,"_visitedPages",new Map)}}ms=new WeakMap,po=new WeakMap,yu=new WeakMap,mo=new WeakMap,bo=new WeakMap,Au=new WeakMap,Pe=new WeakMap,fn=new WeakMap,vh=new WeakMap,Gt=new WeakMap,Ai=new WeakMap,ie=new WeakSet,H0=async function(t){var c,d;const e=r(this,fn),i=e.isInPresentationMode||e.isChangingPresentationMode,{id:s,siblings:n,command:a,value:o}=t;if(!s){switch(a){case"clear":console.clear();break;case"error":console.error(o);break;case"layout":if(!i){const u=tP(o);e.spreadMode=u.spreadMode}break;case"page-num":e.currentPageNumber=o+1;break;case"print":await e.pagesPromise,r(this,bo).dispatch("print",{source:this});break;case"println":console.log(o);break;case"zoom":i||(e.currentScaleValue=o);break;case"SaveAs":r(this,bo).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=r(this,Ai))==null||c.resolve(),f(this,Ai,null);break}return}if(i&&t.focus)return;delete t.id,delete t.siblings;const l=n?[s,...n]:[s];for(const u of l){const g=document.querySelector('[data-element-id="'.concat(u,'"]'));g?g.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:t})):(d=r(this,Pe))==null||d.annotationStorage.setValue(u,t)}},zf=async function(t,e=!1){const i=r(this,Pe),s=this._visitedPages;if(e&&f(this,ms,Promise.withResolvers()),!r(this,ms))return;const n=r(this,fn).getPageView(t-1);if((n==null?void 0:n.renderingState)!==ht.FINISHED){this._pageOpenPending.add(t);return}this._pageOpenPending.delete(t);const a=(async()=>{var l,c;const o=await(s.has(t)?null:(l=n.pdfPage)==null?void 0:l.getJSActions());i===r(this,Pe)&&await((c=r(this,Gt))==null?void 0:c.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:t,actions:o}))})();s.set(t,a)},fb=async function(t){var n;const e=r(this,Pe),i=this._visitedPages;if(!r(this,ms)||this._pageOpenPending.has(t))return;const s=i.get(t);s&&(i.set(t,null),await s,e===r(this,Pe)&&await((n=r(this,Gt))==null?void 0:n.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:t})))},j0=function(){if(f(this,po,Promise.withResolvers()),r(this,Gt))throw new Error("#initScripting: Scripting already exists.");return r(this,Au).createScripting()},oc=async function(){var t,e,i,s;if(!r(this,Gt)){f(this,Pe,null),(t=r(this,po))==null||t.resolve();return}r(this,ms)&&(await Promise.race([r(this,ms).promise,new Promise(n=>{setTimeout(n,1e3)})]).catch(()=>{}),f(this,ms,null)),f(this,Pe,null);try{await r(this,Gt).destroySandbox()}catch(n){}(e=r(this,Ai))==null||e.reject(new Error("Scripting destroyed.")),f(this,Ai,null),(i=r(this,mo))==null||i.abort(),f(this,mo,null),this._pageOpenPending.clear(),this._visitedPages.clear(),f(this,Gt,null),f(this,vh,!1),(s=r(this,po))==null||s.resolve()};class Dx extends kx{constructor(t){t.externalServices||window.addEventListener("updatefromsandbox",e=>{t.eventBus.dispatch("updatefromsandbox",{source:window,detail:e.detail})}),t.externalServices||(t.externalServices={createScripting:()=>new Mx(t.sandboxBundleSrc)}),t.docProperties||(t.docProperties=e=>Rx(e)),super(t)}}const Nx=3e4;let Fx=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),Nx)))}getHighestPriority(t,e,i,s=!1,n=!1){const a=t.views,o=a.length;if(o===0)return null;for(let g=0;g<o;g++){const b=a[g].view;if(!this.isViewFinished(b))return b}if(!n)for(let g=0;g<o;g++){const{detailView:b}=a[g].view;if(b&&!this.isViewFinished(b))return b}const l=t.first.id,c=t.last.id;if(c-l+1>o){const g=t.ids;for(let b=1,w=c-l;b<w;b++){const v=i?l+b:c-b;if(g.has(v))continue;const y=e[v-1];if(!this.isViewFinished(y))return y}}let d=i?c:l-2,u=e[d];return u&&!this.isViewFinished(u)||s&&(d+=i?1:-1,u=e[d],u&&!this.isViewFinished(u))?u:null}isViewFinished(t){return t.renderingState===ht.FINISHED}renderView(t){switch(t.renderingState){case ht.FINISHED:return!1;case ht.PAUSED:this.highestPriorityPage=t.renderingId,t.resume();break;case ht.RUNNING:this.highestPriorityPage=t.renderingId;break;case ht.INITIAL:this.highestPriorityPage=t.renderingId,t.draw().finally(()=>{this.renderHighestPriority()}).catch(e=>{e instanceof Nm||console.error("renderView:",e)});break}return!0}};const nv=10,sf={FORCE_SCROLL_MODE_PAGE:1e4,FORCE_LAZY_PAGE_INIT:5e3,PAUSE_EAGER_PAGE_INIT:250};function rv(h){return Object.values(He).includes(h)&&h!==He.DISABLE}var gn,wo,_u,gb;class Ox{constructor(t){m(this,_u);m(this,gn,new Set);m(this,wo,0);f(this,wo,t)}push(t){const e=r(this,gn);e.has(t)&&e.delete(t),e.add(t),e.size>r(this,wo)&&p(this,_u,gb).call(this)}resize(t,e=null){f(this,wo,t);const i=r(this,gn);if(e){const s=i.size;let n=1;for(const a of i)if(e.has(a.id)&&(i.delete(a),i.add(a)),++n>s)break}for(;i.size>r(this,wo);)p(this,_u,gb).call(this)}has(t){return r(this,gn).has(t)}[Symbol.iterator](){return r(this,gn).keys()}}gn=new WeakMap,wo=new WeakMap,_u=new WeakSet,gb=function(){const t=r(this,gn).keys().next().value;t==null||t.destroy(),r(this,gn).delete(t)};var pn,Eu,Su,Vi,ii,vo,Pu,xu,Cu,Tu,Iu,Lu,Ru,Mu,kr,ku,yh,Hi,yo,Ao,Ah,Dr,_h,Du,Eh,_o,mn,Sh,Nu,Ph,Fu,X,$0,U0,W0,lc,Gf,z0,pb,G0,In,mb,X0,q0,Y0,bb,K0,wb,Xf,vb;class zb{constructor(t){m(this,X);m(this,pn,null);m(this,Eu,null);m(this,Su,null);m(this,Vi,He.NONE);m(this,ii,null);m(this,vo,bn.ENABLE_FORMS);m(this,Pu,null);m(this,xu,null);m(this,Cu,!1);m(this,Tu,!1);m(this,Iu,!1);m(this,Lu,!1);m(this,Ru,!1);m(this,Mu,!0);m(this,kr,null);m(this,ku,0);m(this,yh,null);m(this,Hi,null);m(this,yo,null);m(this,Ao,null);m(this,Ah,!1);m(this,Dr,null);m(this,_h,!1);m(this,Du,0);m(this,Eh,new ResizeObserver(p(this,X,K0).bind(this)));m(this,_o,null);m(this,mn,null);m(this,Sh,null);m(this,Nu,!0);m(this,Ph,bs.ENABLE);m(this,Fu,null);var s,n,a,o,l,c,d;const e="5.3.93";if(Cw!==e)throw new Error('The API version "'.concat(Cw,'" does not match the Viewer version "').concat(e,'".'));if(this.container=t.container,this.viewer=t.viewer||t.container.firstElementChild,f(this,Fu,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.");r(this,Eh).observe(this.container),this.eventBus=t.eventBus,this.linkService=t.linkService||new $g,this.downloadManager=t.downloadManager||null,this.findController=t.findController||null,f(this,Eu,t.altTextManager||null),f(this,Sh,t.signatureManager||null),f(this,xu,t.editorUndoBar||null),this.findController&&(this.findController.onIsPageVisible=u=>this._getVisiblePages().ids.has(u)),this._scriptingManager=t.scriptingManager||null,f(this,Ph,(a=t.textLayerMode)!=null?a:bs.ENABLE),f(this,vo,(o=t.annotationMode)!=null?o:bn.ENABLE_FORMS),f(this,Vi,(l=t.annotationEditorMode)!=null?l:He.NONE),f(this,Su,t.annotationEditorHighlightColors||null),f(this,Tu,t.enableHighlightFloatingButton===!0),f(this,Lu,t.enableUpdatedAddImage===!0),f(this,Ru,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 xo),f(this,Iu,t.enablePermissions||!1),this.pageColors=t.pageColors||null,f(this,yh,t.mlManager||null),f(this,Cu,t.enableHWA||!1),f(this,Nu,t.supportsPinchToZoom!==!1),f(this,Mu,t.enableAutoLinking!==!1),f(this,ku,(d=t.minDurationToUpdateCanvas)!=null?d:500),this.defaultRenderingQueue=!t.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new Fx,this.renderingQueue.setViewer(this)):this.renderingQueue=t.renderingQueue;const{abortSignal:i}=t;i==null||i.addEventListener("abort",()=>{r(this,Eh).disconnect(),f(this,Eh,null)},{once:!0}),this.scroll=XS(this.container,this._scrollUpdate.bind(this),i),this.presentationModeState=qo.UNKNOWN,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),p(this,X,bb).call(this),this.eventBus._on("thumbnailrendered",({pageNumber:u,pdfPage:g})=>{const b=this._pages[u-1];r(this,pn).has(b)||g==null||g.cleanup()}),t.l10n||this.l10n.translate(this.container)}get pagesCount(){return this._pages.length}getPageView(t){return this._pages[t]}getCachedPageViews(){return new Set(r(this,pn))}get pageViewsReady(){return this._pages.every(t=>t==null?void 0:t.pdfPage)}get renderForms(){return r(this,vo)===bn.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&&p(this,X,mb).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&&p(this,X,mb).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!==sp?this._currentScale:e0}set currentScale(t){if(isNaN(t))throw new Error("Invalid numeric scale.");this.pdfDocument&&p(this,X,In).call(this,t,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(t){this.pdfDocument&&p(this,X,In).call(this,t,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(t){if(!s0(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&&p(this,X,In).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 lg(this,"_layerProperties",{get annotationEditorUIManager(){return r(t,ii)},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(r(this,_h))return null;e.length=0;const n=await this.pdfDocument.getPage(i),{items:a}=await n.getTextContent();for(const o of a)o.str&&e.push(o.str),o.hasEOL&&e.push("\n");t.push(fc(e.join("")))}return t.join("\n")}setDocument(t){var g,b,w;if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),(g=this.findController)==null||g.setDocument(null),(b=this._scriptingManager)==null||b.setDocument(null),(w=r(this,ii))==null||w.destroy(),f(this,ii,null)),this.pdfDocument=t,!t)return;const e=t.numPages,i=t.getPage(1),s=t.getOptionalContentConfig({intent:"display"}),n=r(this,Iu)?t.getPermissions():Promise.resolve(),{eventBus:a,pageColors:o,viewer:l}=this;f(this,kr,new AbortController);const{signal:c}=r(this,kr);if(e>sf.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const v=this._scrollMode=rt.PAGE;a.dispatch("scrollmodechanged",{source:this,mode:v})}this._pagesCapability.promise.then(()=>{a.dispatch("pagesloaded",{source:this,pagesCount:e})},()=>{});const d=v=>{const y=this._pages[v.pageNumber-1];y&&r(this,pn).push(y)};a._on("pagerender",d,{signal:c});const u=v=>{v.cssTransform||v.isDetailView||(this._onePageRenderedCapability.resolve({timestamp:v.timestamp}),a._off("pagerendered",u))};a._on("pagerendered",u,{signal:c}),Promise.all([i,n]).then(([v,y])=>{var T;if(t!==this.pdfDocument)return;this._firstPageCapability.resolve(v),this._optionalContentConfigPromise=s;const{annotationEditorMode:A,annotationMode:E,textLayerMode:_}=p(this,X,$0).call(this,y);if(_!==bs.DISABLE){const I=f(this,Dr,document.createElement("div"));I.id="hiddenCopyElement",l.before(I)}if(A!==He.DISABLE){const I=A;t.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):rv(I)?(f(this,ii,new kS(this.container,l,r(this,Fu),r(this,Eu),r(this,Sh),a,t,o,r(this,Su),r(this,Tu),r(this,Lu),r(this,Ru),r(this,yh),r(this,xu),r(this,Nu))),a.dispatch("annotationeditoruimanager",{source:this,uiManager:r(this,ii)}),I!==He.NONE&&(p(this,X,vb).call(this,I),r(this,ii).updateMode(I))):console.error("Invalid AnnotationEditor mode: ".concat(I))}const S=this._scrollMode===rt.PAGE?null:l,P=this.currentScale,x=v.getViewport({scale:P*Ls.PDF_TO_CSS_UNITS});l.style.setProperty("--scale-factor",x.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 C=new F0({container:S,eventBus:a,id:I,scale:P,defaultViewport:x.clone(),optionalContentConfigPromise:s,renderingQueue:this.renderingQueue,textLayerMode:_,annotationMode:E,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,maxCanvasDim:this.maxCanvasDim,capCanvasAreaFactor:this.capCanvasAreaFactor,enableDetailCanvas:this.enableDetailCanvas,pageColors:o,l10n:this.l10n,layerProperties:this._layerProperties,enableHWA:r(this,Cu),enableAutoLinking:r(this,Mu),minDurationToUpdateCanvas:r(this,ku)});this._pages.push(C)}(T=this._pages[0])==null||T.setPdfPage(v),this._scrollMode===rt.PAGE?p(this,X,lc).call(this):this._spreadMode!==ve.NONE&&this._updateSpreadMode(),p(this,X,U0).call(this,c).then(async()=>{var C,L;if(t!==this.pdfDocument)return;if((C=this.findController)==null||C.setDocument(t),(L=this._scriptingManager)==null||L.setDocument(t),r(this,Dr)&&document.addEventListener("copy",p(this,X,W0).bind(this,_),{signal:c}),r(this,ii)&&a.dispatch("annotationeditormodechanged",{source:this,mode:r(this,Vi)}),t.loadingParams.disableAutoFetch||e>sf.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let I=e-1;if(I<=0){this._pagesCapability.resolve();return}for(let M=2;M<=e;++M){const G=t.getPage(M).then(W=>{const $=this._pages[M-1];$.pdfPage||$.setPdfPage(W),--I===0&&this._pagesCapability.resolve()},W=>{console.error("Unable to get page ".concat(M," to initialize viewer"),W),--I===0&&this._pagesCapability.resolve()});M%sf.PAUSE_EAGER_PAGE_INIT===0&&await G}}),a.dispatch("pagesinit",{source:this}),t.getMetadata().then(({info:I})=>{t===this.pdfDocument&&I.Language&&(l.lang=I.Language)}),this.defaultRenderingQueue&&this.update()}).catch(v=>{console.error("Unable to initialize viewer",v),this._pagesCapability.reject(v)})}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=sp,this._currentScaleValue=null,this._pageLabels=null,f(this,pn,new Ox(nv)),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=Promise.withResolvers(),this._onePageRenderedCapability=Promise.withResolvers(),this._pagesCapability=Promise.withResolvers(),this._scrollMode=rt.VERTICAL,this._previousScrollMode=rt.UNKNOWN,this._spreadMode=ve.NONE,f(this,_o,{previousPageNumber:1,scrollDown:!0,pages:[]}),(t=r(this,kr))==null||t.abort(),f(this,kr,null),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),(e=r(this,Dr))==null||e.remove(),f(this,Dr,null),p(this,X,wb).call(this),p(this,X,Xf).call(this)}_scrollUpdate(){this.pagesCount!==0&&(r(this,Hi)&&clearTimeout(r(this,Hi)),f(this,Hi,setTimeout(()=>{f(this,Hi,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 a=0,o=0,l=0,c=0,d,u;const g=n.rotation%180!==0,b=(g?n.height:n.width)/n.scale/Ls.PDF_TO_CSS_UNITS,w=(g?n.width:n.height)/n.scale/Ls.PDF_TO_CSS_UNITS;let v=0;switch(e[1].name){case"XYZ":a=e[2],o=e[3],v=e[4],a=a!==null?a:0,o=o!==null?o:w;break;case"Fit":case"FitB":v="page-fit";break;case"FitH":case"FitBH":o=e[2],v="page-width",o===null&&this._location?(a=this._location.left,o=this._location.top):(typeof o!="number"||o<0)&&(o=w);break;case"FitV":case"FitBV":a=e[2],l=b,c=w,v="page-height";break;case"FitR":a=e[2],o=e[3],l=e[4]-a,c=e[5]-o;let _=Iw,S=Lw;this.removePageBorders&&(_=S=0),d=(this.container.clientWidth-_)/l/Ls.PDF_TO_CSS_UNITS,u=(this.container.clientHeight-S)/c/Ls.PDF_TO_CSS_UNITS,v=Math.min(Math.abs(d),Math.abs(u));break;default:console.error('scrollPageIntoView: "'.concat(e[1].name,'" is not a valid destination type.'));return}if(s||(v&&v!==this._currentScale?this.currentScaleValue=v:this._currentScale===sp&&(this.currentScaleValue=US)),v==="page-fit"&&!e[4]){p(this,X,Gf).call(this,n);return}const y=[n.viewport.convertToViewportPoint(a,o),n.viewport.convertToViewportPoint(a+l,o+c)];let A=Math.min(y[0][0],y[1][0]),E=Math.min(y[0][1],y[1][1]);i||(A=Math.max(A,0),E=Math.max(E,0)),p(this,X,Gf).call(this,n,{left:A,top:E})}_updateLocation(t){const e=this._currentScale,i=this._currentScaleValue,s=parseFloat(i)===e?Math.round(e*1e4)/100:i,n=t.id,a=this._pages[n-1],o=this.container,l=a.getPagePoint(o.scrollLeft-t.x,o.scrollTop-t.y),c=Math.round(l[0]),d=Math.round(l[1]);let u="#page=".concat(n);this.isInPresentationMode||(u+="&zoom=".concat(s,",").concat(c,",").concat(d)),this._location={pageNumber:n,scale:s,top:d,left:c,rotation:this._pagesRotation,pdfOpenParams:u}}update(){const t=this._getVisiblePages(),e=t.views,i=e.length;if(i===0)return;const s=Math.max(nv,2*i+1);r(this,pn).resize(s,t.ids);for(const{view:l,visibleArea:c}of e)l.updateVisibleArea(c);for(const l of r(this,pn))t.ids.has(l.id)||l.updateVisibleArea(null);this.renderingQueue.renderHighestPriority(t);const n=this._spreadMode===ve.NONE&&(this._scrollMode===rt.PAGE||this._scrollMode===rt.VERTICAL),a=this._currentPageNumber;let o=!1;for(const l of e){if(l.percent<100)break;if(l.id===a&&n){o=!0;break}}this._setCurrentPageNumber(o?a: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===qo.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===qo.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===rt.PAGE?r(this,_o).pages:this._pages,e=this._scrollMode===rt.HORIZONTAL,i=e&&this._isContainerRtl;return YS({scrollEl:this.container,views:t,sortByVisibility:!0,horizontal:e,rtl:i})}cleanup(){for(const t of this._pages)t.renderingState!==ht.FINISHED&&t.reset()}_cancelRendering(){for(const t of this._pages)t.cancelRendering()}forceRendering(t){const e=t||this._getVisiblePages(),i=p(this,X,Y0).call(this,e),s=this._spreadMode!==ve.NONE&&this._scrollMode!==rt.HORIZONTAL,n=r(this,mn)!==null||r(this,Hi)!==null&&e.views.some(o=>{var l;return(l=o.detailView)==null?void 0:l.renderingCancelled}),a=this.renderingQueue.getHighestPriority(e,this._pages,i,s,n);return a?(p(this,X,q0).call(this,a).then(()=>{this.renderingQueue.renderView(a)}),!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=kw(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(!KS(t))throw new Error("Invalid scroll mode: ".concat(t));this.pagesCount>sf.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===rt.HORIZONTAL),i.classList.toggle("scrollWrapped",e===rt.WRAPPED),!(!this.pdfDocument||!t)&&(e===rt.PAGE?p(this,X,lc).call(this):this._previousScrollMode===rt.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&p(this,X,In).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(!ZS(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===rt.PAGE)p(this,X,lc).call(this);else if(e.textContent="",this._spreadMode===ve.NONE)for(const s of this._pages)e.append(s.div);else{const s=this._spreadMode-1;let n=null;for(let a=0,o=i.length;a<o;++a)n===null?(n=document.createElement("div"),n.className="spread",e.append(n)):a%2===s&&(n=n.cloneNode(!1),e.append(n)),n.append(i[a].div)}t&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&p(this,X,In).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(t,!0),this.update())}_getPageAdvance(t,e=!1){switch(this._scrollMode){case rt.WRAPPED:{const{views:i}=this._getVisiblePages(),s=new Map;for(const{id:n,y:a,percent:o,widthPercent:l}of i){if(o===0||l<100)continue;let c=s.get(a);c||s.set(a,c||(c=[])),c.push(n)}for(const n of s.values()){const a=n.indexOf(t);if(a===-1)continue;const o=n.length;if(o===1)break;if(e)for(let l=a-1,c=0;l>=c;l--){const d=n[l],u=n[l+1]-1;if(d<u)return t-u}else for(let l=a+1,c=o;l<c;l++){const d=n[l],u=n[l-1]+1;if(d>u)return u-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 rt.HORIZONTAL:break;case rt.PAGE:case rt.VERTICAL:{if(this._spreadMode===ve.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:a,percent:o,widthPercent:l}of s)if(a===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 a=i>0?Tw:1/Tw,o=i>0?Math.ceil:Math.floor;i=Math.abs(i);do n=o((n*a).toFixed(2)*10)/10;while(--i>0)}n=Hb(n,WS,zS),p(this,X,In).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 r(this,Pu)||f(this,Pu,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return r(this,ii)?r(this,Vi):He.DISABLE}set annotationEditorMode({mode:t,editId:e=null,isFromKeyboard:i=!1,mustEnterInEditMode:s=!1}){if(!r(this,ii))throw new Error("The AnnotationEditor is not enabled.");if(r(this,Vi)===t)return;if(!rv(t))throw new Error("Invalid AnnotationEditor mode: ".concat(t));if(!this.pdfDocument)return;p(this,X,vb).call(this,t);const{eventBus:n,pdfDocument:a}=this,o=async()=>{p(this,X,Xf).call(this),f(this,Vi,t),await r(this,ii).updateMode(t,e,i,s),!(t!==r(this,Vi)||a!==this.pdfDocument)&&n.dispatch("annotationeditormodechanged",{source:this,mode:t})};if(t===He.NONE||r(this,Vi)===He.NONE){const l=t!==He.NONE;l||this.pdfDocument.annotationStorage.resetModifiedIds();for(const d of this._pages)d.toggleEditingMode(l);const c=p(this,X,X0).call(this);if(l&&c){p(this,X,Xf).call(this),f(this,yo,new AbortController);const d=AbortSignal.any([r(this,kr).signal,r(this,yo).signal]);n._on("pagerendered",({pageNumber:u})=>{c.delete(u),c.size===0&&f(this,Ao,setTimeout(o,0))},{signal:d});return}}o()}refresh(t=!1,e=Object.create(null)){if(this.pdfDocument){for(const i of this._pages)i.update(e);p(this,X,wb).call(this),t||this.update()}}}pn=new WeakMap,Eu=new WeakMap,Su=new WeakMap,Vi=new WeakMap,ii=new WeakMap,vo=new WeakMap,Pu=new WeakMap,xu=new WeakMap,Cu=new WeakMap,Tu=new WeakMap,Iu=new WeakMap,Lu=new WeakMap,Ru=new WeakMap,Mu=new WeakMap,kr=new WeakMap,ku=new WeakMap,yh=new WeakMap,Hi=new WeakMap,yo=new WeakMap,Ao=new WeakMap,Ah=new WeakMap,Dr=new WeakMap,_h=new WeakMap,Du=new WeakMap,Eh=new WeakMap,_o=new WeakMap,mn=new WeakMap,Sh=new WeakMap,Nu=new WeakMap,Ph=new WeakMap,Fu=new WeakMap,X=new WeakSet,$0=function(t){const e={annotationEditorMode:r(this,Vi),annotationMode:r(this,vo),textLayerMode:r(this,Ph)};return t&&(!t.includes(Zu.COPY)&&r(this,Ph)===bs.ENABLE&&(e.textLayerMode=bs.ENABLE_PERMISSIONS),t.includes(Zu.MODIFY_CONTENTS)||(e.annotationEditorMode=He.DISABLE),!t.includes(Zu.MODIFY_ANNOTATIONS)&&!t.includes(Zu.FILL_INTERACTIVE_FORMS)&&r(this,vo)===bn.ENABLE_FORMS&&(e.annotationMode=bn.ENABLE)),e},U0=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()},W0=function(t,e){const i=document.getSelection(),{focusNode:s,anchorNode:n}=i;if(n&&s&&i.containsNode(r(this,Dr))){if(r(this,Ah)||t===bs.ENABLE_PERMISSIONS){Fm(e);return}f(this,Ah,!0);const{classList:a}=this.viewer;a.add("copyAll");const o=new AbortController;window.addEventListener("keydown",l=>f(this,_h,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(()=>{f(this,Ah,!1),f(this,_h,!1),o.abort(),a.remove("copyAll")}),Fm(e)}},lc=function(){if(this._scrollMode!==rt.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const t=this._currentPageNumber,e=r(this,_o),i=this.viewer;if(i.textContent="",e.pages.length=0,this._spreadMode===ve.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 a=document.createElement("div");if(a.className="spread",this.isInPresentationMode){const o=document.createElement("div");o.className="dummyPage",a.append(o)}for(const o of s){const l=this._pages[o];l&&(a.append(l.div),e.pages.push(l))}i.append(a)}e.scrollDown=t>=e.previousPageNumber,e.previousPageNumber=t},Gf=function(t,e=null){const{div:i,id:s}=t;if(this._currentPageNumber!==s&&this._setCurrentPageNumber(s),this._scrollMode===rt.PAGE&&(p(this,X,lc).call(this),this.update()),!e&&!this.isInPresentationMode){const n=i.offsetLeft+i.clientLeft,a=n+i.clientWidth,{scrollLeft:o,clientWidth:l}=this.container;(this._scrollMode===rt.HORIZONTAL||n<o||a>o+l)&&(e={left:0,top:0})}i0(i,e),!this._currentScaleValue&&this._location&&(this._location=null)},z0=function(t){return t===this._currentScale||Math.abs(t-this._currentScale)<1e-15},pb=function(t,e,{noScroll:i=!1,preset:s=!1,drawingDelay:n=-1,origin:a=null}){if(this._currentScaleValue=e.toString(),p(this,X,z0).call(this,t)){s&&this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:e});return}this.viewer.style.setProperty("--scale-factor",t*Ls.PDF_TO_CSS_UNITS);const o=n>=0&&n<1e3;this.refresh(!0,{scale:t,drawingDelay:o?n:-1}),o&&f(this,mn,setTimeout(()=>{f(this,mn,null),this.refresh()},n));const l=this._currentScale;if(this._currentScale=t,!i){let c=this._currentPageNumber,d;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(c=this._location.pageNumber,d=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:c,destArray:d,allowNegativeOffset:!0}),Array.isArray(a)){const u=t/l-1,[g,b]=this.containerTopLeft;this.container.scrollLeft+=(a[0]-b)*u,this.container.scrollTop+=(a[1]-g)*u}}this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:s?e:void 0}),this.defaultRenderingQueue&&this.update()},G0=function(){return this._spreadMode!==ve.NONE&&this._scrollMode!==rt.HORIZONTAL?2:1},In=function(t,e){let i=parseFloat(t);if(i>0)e.preset=!1,p(this,X,pb).call(this,i,t,e);else{const s=this._pages[this._currentPageNumber-1];if(!s)return;let n=Iw,a=Lw;this.isInPresentationMode?(n=a=4,this._spreadMode!==ve.NONE&&(n*=2)):this.removePageBorders?n=a=0:this._scrollMode===rt.HORIZONTAL&&([n,a]=[a,n]);const o=(this.container.clientWidth-n)/s.width*s.scale/r(this,X,G0),l=(this.container.clientHeight-a)/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=kw(s)?o:Math.min(l,o);i=Math.min(GS,c);break;default:console.error('#setScale: "'.concat(t,'" is an unknown zoom value.'));return}e.preset=!0,p(this,X,pb).call(this,i,t,e)}},mb=function(){const t=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&p(this,X,In).call(this,this._currentScaleValue,{noScroll:!0}),p(this,X,Gf).call(this,t)},X0=function(){const t=this._getVisiblePages(),e=[],{ids:i,views:s}=t;for(const n of s){const{view:a}=n;if(!a.hasEditableAnnotations()){i.delete(a.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)},q0=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}},Y0=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 rt.PAGE:return r(this,_o).scrollDown;case rt.HORIZONTAL:return this.scroll.right}return this.scroll.down},bb=function(t=this.container.clientHeight){t!==r(this,Du)&&(f(this,Du,t),QS.setProperty("--viewer-container-height","".concat(t,"px")))},K0=function(t){for(const e of t)if(e.target===this.container){p(this,X,bb).call(this,Math.floor(e.borderBoxSize[0].blockSize)),f(this,Pu,null);break}},wb=function(){r(this,mn)!==null&&(clearTimeout(r(this,mn)),f(this,mn,null)),r(this,Hi)!==null&&(clearTimeout(r(this,Hi)),f(this,Hi,null))},Xf=function(){var t;(t=r(this,yo))==null||t.abort(),f(this,yo,null),r(this,Ao)!==null&&(clearTimeout(r(this,Ao)),f(this,Ao,null))},vb=function(t){var e,i;switch(t){case He.STAMP:(e=r(this,yh))==null||e.loadModel("altText");break;case He.SIGNATURE:(i=r(this,Sh))==null||i.loadSignatures();break}};class Z0 extends zb{_resetView(){super._resetView(),this._scrollMode=rt.PAGE,this._spreadMode=ve.NONE}set scrollMode(t){}_updateScrollMode(){}set spreadMode(t){}_updateSpreadMode(){}}globalThis.pdfjsViewer={AnnotationLayerBuilder:f0,DownloadManager:p0,EventBus:Ub,FindState:Tn,GenericL10n:xo,LinkTarget:Gr,parseQueryString:jg,PDFFindController:r0,PDFHistory:vx,PDFLinkService:$b,PDFPageView:F0,PDFScriptingManager:Dx,PDFSinglePageViewer:Z0,PDFViewer:zb,ProgressBar:JS,RenderingStates:ht,ScrollMode:rt,SimpleLinkService:$g,SpreadMode:ve,StructTreeLayerBuilder:R0,TextLayerBuilder:hg,XfaLayerBuilder:Wb};const av=h=>{let t;const e=new Set,i=(c,d)=>{const u=typeof c=="function"?c(t):c;if(!Object.is(u,t)){const g=t;t=(d!=null?d:typeof u!="object"||u===null)?u:Object.assign({},t,u),e.forEach(b=>b(t,g))}},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},Bx=h=>h?av(h):av;function li(h,t,e,i){function s(n){return n instanceof e?n:new e(function(a){a(n)})}return new(e||(e=Promise))(function(n,a){function o(d){try{c(i.next(d))}catch(u){a(u)}}function l(d){try{c(i.throw(d))}catch(u){a(u)}}function c(d){d.done?n(d.value):s(d.value).then(o,l)}c((i=i.apply(h,t||[])).next())})}function D(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 yt(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 ce={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},Zr={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},Vx={ENABLE:1},cg={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},Sc={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};class Hx{constructor(){const t=window.devicePixelRatio||1;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}}function jx(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 $x(h,t,e=void 0){const i=function(a){n||(n=window.requestAnimationFrame(function(){n=null;const l=h.scrollLeft,c=s.lastX;l!==c&&(s.right=l>c),s.lastX=l;const d=h.scrollTop,u=s.lastY;d!==u&&(s.down=d>u),s.lastY=d,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 Ux(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,a=h[n];t(a)?s=n:i=n+1}return i}function Wx({view:h,userUnit:t,rotate:e}){const[i,s,n,a]=h,o=e%180!==0,l=(n-i)/72*t,c=(a-s)/72*t;return{width:o?c:l,height:o?l:c}}function zx(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 Gx({scrollEl:h,views:t,sortByVisibility:e=!1,horizontal:i=!1,rtl:s=!1}){const n=h.scrollTop,a=n+h.clientHeight,o=h.scrollLeft,l=o+h.clientWidth;function c(E){const _=E.div;return _.offsetTop+_.clientTop+_.clientHeight>n}function d(E){const _=E.div,S=_.offsetLeft+_.clientLeft,P=S+_.clientWidth;return s?S<l:P>o}const u=[],g=new Set,b=t.length;let w=Ux(t,i?d:c);w>0&&w<b&&!i&&(w=zx(w,t,n));let v=i?l:-1;for(let E=w;E<b;E++){const _=t[E],S=_.div,P=S.offsetLeft+S.clientLeft,x=S.offsetTop+S.clientTop,T=S.clientWidth,I=S.clientHeight,C=P+T,L=x+I;if(v===-1)L>=a&&(v=L);else if((i?P:x)>v)break;if(L<=n||x>=a||C<=o||P>=l)continue;const M=Math.max(0,n-x)+Math.max(0,L-a),G=Math.max(0,o-P)+Math.max(0,C-l),W=(I-M)/I,$=(T-G)/T,Tt=W*$*100|0;u.push({id:_.id,x:P,y:x,view:_,percent:Tt,widthPercent:$*100|0}),g.add(_.id)}const y=u[0],A=u.at(-1);return e&&u.sort(function(E,_){const S=E.percent-_.percent;return Math.abs(S)>.001?-S:E.id-_.id}),{first:y,last:A,views:u,ids:g}}function Xx(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 qx(h){const t=h.deltaMode;let e=Xx(h);const i=30,s=30;return t===WheelEvent.DOM_DELTA_PIXEL?e/=i*s:t===WheelEvent.DOM_DELTA_LINE&&(e/=s),e}function Q0(h){return Number.isInteger(h)&&h%90===0}function Yx(h){return Number.isInteger(h)&&Object.values(cg).includes(h)&&h!==cg.UNKNOWN}function Kx(h){return Number.isInteger(h)&&Object.values(Sc).includes(h)&&h!==Sc.UNKNOWN}function Zx(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 Qx=3e4;class Jx{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),Qx)))}getHighestPriority(t,e,i,s=!1){const n=t.views,a=n.length;if(a===0)return null;for(let u=0;u<a;u++){const g=n[u].view;if(!this.isViewFinished(g))return g}const o=t.first.id,l=t.last.id;if(l-o+1>a){const u=t.ids;for(let g=1,b=l-o;g<b;g++){const w=i?o+g:l-g;if(u.has(w))continue;const v=e[w-1];if(!this.isViewFinished(v))return v}}let c=i?l:o-2,d=e[c];return d&&!this.isViewFinished(d)||s&&(c+=i?1:-1,d=e[c],d&&!this.isViewFinished(d))?d:null}isViewFinished(t){return t.renderingState===ce.FINISHED}renderView(t){switch(t.renderingState){case ce.FINISHED:return!1;case ce.PAUSED:this.highestPriorityPage=t.renderingId,t.resume();break;case ce.RUNNING:this.highestPriorityPage=t.renderingId;break;case ce.INITIAL:this.highestPriorityPage=t.renderingId,t.draw().finally(()=>{this.renderHighestPriority()}).catch(e=>{e instanceof Ih||console.error("renderView:",e)});break}return!0}}var hc,cc,ji,yb,Ab,_b,Eb,ov;const lv=2,hv=3;class Gb{static getCanvas(t,e){const i=yt(this,hc,D(this,hc,"f",cc)||document.createElement("canvas"),"f",cc);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=D(this,hc,"f",cc);t&&(t.width=0,t.height=0),yt(this,hc,null,"f",cc)}}hc=Gb;cc={value:null};class tC{constructor({container:t,eventBus:e,id:i,defaultViewport:s,optionalContentConfigPromise:n,linkService:a,renderingQueue:o,pageColors:l,enableHWA:c,store:d,thumbnailWidth:u}){ji.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=a,this.renderingQueue=o,this.renderTask=null,this.renderingState=ce.INITIAL,this.resume=null,this.store=d,this.thumbnailWidth=u,this.loaded=!1;const g=document.createElement("div");g.className="thumbnail pdfSlickThumbHolder",g.setAttribute("data-page-number",this.id.toString()),this.div=g,D(this,ji,"m",yb).call(this),t.append(g)}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=ce.INITIAL,this.div.removeAttribute("data-loaded"),this.loaded=!1,D(this,ji,"m",yb).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 li(this,void 0,void 0,function*(){if(this.renderingState!==ce.INITIAL){console.error("Must be in new state before drawing");return}const{pdfPage:t}=this;if(!t)throw this.renderingState=ce.FINISHED,new Error("pdfPage is not loaded");this.renderingState=ce.RUNNING;const{ctx:e,canvas:i,transform:s}=D(this,ji,"m",Ab).call(this,lv),n=this.viewport.clone({scale:lv*this.scale}),a=d=>{if(!this.renderingQueue.isHighestPriority(this)){this.renderingState=ce.PAUSED,this.resume=()=>{this.renderingState=ce.RUNNING,d()};return}d()},o={canvasContext:e,transform:s,viewport:n,optionalContentConfigPromise:this._optionalContentConfigPromise,pageColors:this.pageColors},l=this.renderTask=t.render(o);l.onContinue=a;const c=l.promise.then(()=>D(this,ji,"m",Eb).call(this,l,i),d=>D(this,ji,"m",Eb).call(this,l,i,d));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!==ce.INITIAL)return;const{thumbnailCanvas:e,pdfPage:i,scale:s}=t;e&&(this.pdfPage||this.setPdfPage(i),!(s<this.scale)&&(this.renderingState=ce.FINISHED,D(this,ji,"m",_b).call(this,e)))}setPageLabel(t){this.pageLabel=typeof t=="string"?t:null}}ji=new WeakSet,yb=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"))},Ab=function(t=1,e=this.enableHWA){const i=document.createElement("canvas"),s=i.getContext("2d",{alpha:!1,willReadFrequently:!e}),n=new Hx;i.width=t*this.canvasWidth*n.sx|0,i.height=t*this.canvasHeight*n.sy|0;const a=n.scaled?[n.sx,0,0,n.sy,0,0]:null;return{ctx:s,canvas:i,transform:a}},_b=function(t){if(this.renderingState!==ce.FINISHED)throw new Error("#convertCanvasToImage: Rendering has not finished.");const e=D(this,ji,"m",ov).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},Eb=function(t,e){return li(this,arguments,void 0,function*(i,s,n=null){if(i===this.renderTask&&(this.renderTask=null),!(n instanceof Ih)&&(this.renderingState=ce.FINISHED,D(this,ji,"m",_b).call(this,s),n))throw n})},ov=function(t){const{ctx:e,canvas:i}=D(this,ji,"m",Ab).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<<hv,n=i.height<<hv;const[a,o]=Gb.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(a,0,0,s,n,0,0,s>>1,n>>1),s>>=1,n>>=1;return e.drawImage(a,0,0,s,n,0,0,i.width,i.height),i};var Yi,J0,Sb,Pb,t_,e_,i_;const eC=-19,hp="selected";class iC{constructor({container:t,eventBus:e,linkService:i,renderingQueue:s,pageColors:n,abortSignal:a,enableHWA:o,store:l,thumbnailWidth:c}){Yi.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=$x(this.container,D(this,Yi,"m",J0).bind(this),a),D(this,Yi,"m",Pb).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(hp),e.div.classList.add(hp));const{first:i,last:s,views:n}=D(this,Yi,"m",Sb).call(this);if(n.length>0){let a=!1;if(t<=i.id||t>=s.id)a=!0;else for(const{id:o,percent:l}of n)if(o===t){a=l<100;break}a&&jx(e.div,{top:eC})}this._currentPageNumber=t}get pagesRotation(){return this._pagesRotation}set pagesRotation(t){if(!Q0(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!==ce.FINISHED&&t.reset();Gb.destroyCanvas()}setDocument(t){if(this.pdfDocument&&(D(this,Yi,"m",t_).call(this),D(this,Yi,"m",Pb).call(this)),this.pdfDocument=t,!t)return;const e=t.getPage(1),i=t.getOptionalContentConfig({intent:"display"});e.then(s=>{var n;const a=t.numPages,o=s.getViewport({scale:1});for(let c=1;c<=a;++c){const d=new tC({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(d)}(n=this._thumbnails[0])===null||n===void 0||n.setPdfPage(s),this._thumbnails[this._currentPageNumber-1].div.classList.add(hp),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=D(this,Yi,"m",Sb).call(this),e=D(this,Yi,"m",i_).call(this,t),i=this.renderingQueue.getHighestPriority(t,this._thumbnails,e);return i?(D(this,Yi,"m",e_).call(this,i).then(()=>{this.renderingQueue.renderView(i)}),!0):!1}}Yi=new WeakSet,J0=function(){this.renderingQueue.renderHighestPriority()},Sb=function(){return Gx({scrollEl:this.container,views:this._thumbnails})},Pb=function(){this._thumbnails=[],this._currentPageNumber=1,this._pageLabels=null,this._pagesRotation=0,this.container.textContent=""},t_=function(){for(const t of this._thumbnails)t.cancelRendering()},e_=function(t){return li(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}})},i_=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 sC(h,t){const e=t.allXfaHtml,i=new $g,s=Math.round(Or.PDF_TO_CSS_UNITS*100)/100;for(const n of e==null?void 0:e.children){const a=document.createElement("div");a.className="xfaPrintedPage",h.append(a);const o=new Wb({pdfPage:null,annotationStorage:t.annotationStorage,linkService:i,xfaHtml:n}),l=zv(n,{scale:s});o.render({viewport:l,intent:"print"}),a.append(o.div)}}let pc=null;function nC(h,t,e,i,s,n,a){const o=h.scratchCanvas,l=s/Or.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),a]).then(function([d,u]){const g={canvasContext:c,transform:[l,0,0,l,0,0],viewport:d.getViewport({scale:1,rotation:i.rotation}),intent:"print",annotationMode:vs.ENABLE_STORAGE,optionalContentConfigPromise:n,printAnnotationStorage:u};return d.render(g).promise.catch(w=>{throw w instanceof Ih||console.error(w),w})})}class rC{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(pc!==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,pc=null}renderPages(t){if(this.pdfDocument.isPureXfa)return sC(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 a=this.currentPage;t({index:a,total:e}),nC(this,this.pdfDocument,a+1,this.pagesOverview[a],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(a=>{t.src=URL.createObjectURL(a)});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===pc}throwIfInactive(){if(!this.active)throw new Error("This print request was cancelled or completed.")}}const s_={instance:{supportsPrinting:!0,createPrintService(h){if(pc)throw new Error("The print service is created and active.");return pc=new rC(h)}}};var St,mc,xe,qr,Yr,cv,bc,dv,uv,fv,gv,cp,pv,Fh,mv,bv,wv,n_,xb;const aC=3e3,vv="pdfPresentationMode",dp="pdfPresentationModeControls",oC=50,lC=.1,yv=50,up=Math.PI/6;class hC{constructor({container:t,pdfViewer:e,eventBus:i}){St.add(this),mc.set(this,Zr.UNKNOWN),xe.set(this,null),qr.set(this,null),Yr.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 li(this,void 0,void 0,function*(){const{container:t,pdfViewer:e}=this;if(this.active||!e.pagesCount||!t.requestFullscreen)return!1;D(this,St,"m",n_).call(this),D(this,St,"m",bc).call(this,Zr.CHANGING);const i=t.requestFullscreen();yt(this,xe,{pageNumber:e.currentPageNumber,scaleValue:e.currentScaleValue,scrollMode:e.scrollMode,spreadMode:null,annotationEditorMode:null}),e.spreadMode!==Sc.NONE&&!(e.pageViewsReady&&e.hasEqualPageSizes)&&(console.warn("Ignoring Spread modes when entering PresentationMode, since the document may contain varying page sizes."),D(this,xe,"f").spreadMode=e.spreadMode),e.annotationEditorMode!==Y.DISABLE&&(D(this,xe,"f").annotationEditorMode=e.annotationEditorMode);try{return yield i,e.focus(),!0}catch(s){D(this,St,"m",xb).call(this),D(this,St,"m",bc).call(this,Zr.NORMAL)}return!1})}get active(){return D(this,mc,"f")===Zr.CHANGING||D(this,mc,"f")===Zr.FULLSCREEN}}mc=new WeakMap,xe=new WeakMap,qr=new WeakMap,Yr=new WeakMap,St=new WeakSet,cv=function(t){if(!this.active)return;t.preventDefault();const e=qx(t),i=Date.now(),s=this.mouseScrollTimeStamp;if(!(i>s&&i-s<oC)&&((this.mouseScrollDelta>0&&e<0||this.mouseScrollDelta<0&&e>0)&&D(this,St,"m",Fh).call(this),this.mouseScrollDelta+=e,Math.abs(this.mouseScrollDelta)>=lC)){const n=this.mouseScrollDelta;D(this,St,"m",Fh).call(this),(n>0?this.pdfViewer.previousPage():this.pdfViewer.nextPage())&&(this.mouseScrollTimeStamp=i)}},bc=function(t){yt(this,mc,t),this.eventBus.dispatch("presentationmodechanged",{source:this,state:t})},dv=function(){var t;D(this,St,"m",bc).call(this,Zr.FULLSCREEN),this.container.classList.add(vv),setTimeout(()=>{this.pdfViewer.scrollMode=cg.PAGE,D(this,xe,"f").spreadMode!==null&&(this.pdfViewer.spreadMode=Sc.NONE),this.pdfViewer.currentPageNumber=D(this,xe,"f").pageNumber,this.pdfViewer.currentScaleValue="page-fit",D(this,xe,"f").annotationEditorMode!==null&&(this.pdfViewer.annotationEditorMode={mode:Y.NONE})},0),D(this,St,"m",bv).call(this),D(this,St,"m",cp).call(this),this.contextMenuOpen=!1,(t=document.getSelection())===null||t===void 0||t.empty()},uv=function(){const t=this.pdfViewer.currentPageNumber;this.container.classList.remove(vv),setTimeout(()=>{D(this,St,"m",xb).call(this),D(this,St,"m",bc).call(this,Zr.NORMAL),this.pdfViewer.scrollMode=D(this,xe,"f").scrollMode,D(this,xe,"f").spreadMode!==null&&(this.pdfViewer.spreadMode=D(this,xe,"f").spreadMode),this.pdfViewer.currentScaleValue=D(this,xe,"f").scaleValue,this.pdfViewer.currentPageNumber=t,D(this,xe,"f").annotationEditorMode!==null&&(this.pdfViewer.annotationEditorMode={mode:D(this,xe,"f").annotationEditorMode}),yt(this,xe,null)},0),D(this,St,"m",wv).call(this),D(this,St,"m",pv).call(this),D(this,St,"m",Fh).call(this),this.contextMenuOpen=!1},fv=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()))},gv=function(){this.contextMenuOpen=!0},cp=function(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(dp),this.controlsTimeout=setTimeout(()=>{this.container.classList.remove(dp),delete this.controlsTimeout},aC)},pv=function(){this.controlsTimeout&&(clearTimeout(this.controlsTimeout),this.container.classList.remove(dp),delete this.controlsTimeout)},Fh=function(){this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0},mv=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)>yv&&(n<=up||n>=Math.PI-up)?e=i:Math.abs(s)>yv&&Math.abs(n-Math.PI/2)<=up&&(e=s),e>0?this.pdfViewer.previousPage():e<0&&this.pdfViewer.nextPage();break}}},bv=function(){if(D(this,Yr,"f"))return;yt(this,Yr,new AbortController);const{signal:t}=D(this,Yr,"f"),e=D(this,St,"m",mv).bind(this);window.addEventListener("mousemove",D(this,St,"m",cp).bind(this),{signal:t}),window.addEventListener("mousedown",D(this,St,"m",fv).bind(this),{signal:t}),window.addEventListener("wheel",D(this,St,"m",cv).bind(this),{passive:!1,signal:t}),window.addEventListener("keydown",D(this,St,"m",Fh).bind(this),{signal:t}),window.addEventListener("contextmenu",D(this,St,"m",gv).bind(this),{signal:t}),window.addEventListener("touchstart",e,{signal:t}),window.addEventListener("touchmove",e,{signal:t}),window.addEventListener("touchend",e,{signal:t})},wv=function(){var t;(t=D(this,Yr,"f"))===null||t===void 0||t.abort(),yt(this,Yr,null)},n_=function(){D(this,qr,"f")||(yt(this,qr,new AbortController),window.addEventListener("fullscreenchange",()=>{document.fullscreenElement?D(this,St,"m",dv).call(this):D(this,St,"m",uv).call(this)},{signal:D(this,qr,"f").signal}))},xb=function(){var t;(t=D(this,qr,"f"))===null||t===void 0||t.abort(),yt(this,qr,null)};const cC={isDocumentLoaded:!1,pagesReady:!1,url:null,numPages:0,pageNumber:0,scale:0,scaleValue:"auto",pagesRotation:0,spreadMode:Sc.UNKNOWN,scrollMode:cg.UNKNOWN,documentOutline:null,attachments:new Map,thumbnails:new Map,thumbnailViews:new Map,annotationEditorMode:Y.NONE,pdfSlick:null},r_=()=>Bx((h,t)=>Object.assign(Object.assign({},cC),{_setThumbnailView:(e,i)=>{const s=new Map(t().thumbnails),n=new Map(t().thumbnailViews),{canvasWidth:a,canvasHeight:o,scale:l,rotation:c,loaded:d,pageLabel:u,src:g=null}=i;n.set(e,i),s.set(e,{pageNumber:e,width:a,height:o,scale:l,rotation:c,loaded:d,pageLabel:u,src:g}),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:a,canvasHeight:o,scale:l,rotation:c,loaded:d,pageLabel:u,src:g=null}=n;return[n.id,{pageNumber:n.id,width:a,height:o,scale:l,rotation:c,loaded:d,pageLabel:u,src:g}]}));h({thumbnailViews:i,thumbnails:s})}}));var qf,ai,Ho,jo,a_,o_;class dC{constructor({eventBus:t,slick:e,printDialog:i}){qf.add(this),ai.set(this,null),Ho.set(this,null),jo.set(this,null),this.eventBus=t,this.slick=e,this.printDialog=i!=null?i:null,this.bindEvents()}get supportsPrinting(){return s_.instance.supportsPrinting}get printing(){return!!D(this,ai,"f")}print(){return li(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=D(this,ai,"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===D(this,ai,"f")&&this.abort()})}}}})}abort(){var t;D(this,ai,"f")&&(D(this,ai,"f").destroy(),(t=this.printDialog)===null||t===void 0||t.close(),this.eventBus.dispatch("afterprint",{source:this}))}bindEvents(){yt(this,Ho,new AbortController);const{signal:t}=D(this,Ho,"f"),e={signal:t};this.eventBus._on("beforeprint",D(this,qf,"m",a_).bind(this),e),this.eventBus._on("afterprint",D(this,qf,"m",o_).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=D(this,Ho,"f"))===null||t===void 0||t.abort(),yt(this,Ho,null)}}ai=new WeakMap,Ho=new WeakMap,jo=new WeakMap,qf=new WeakSet,a_=function(){if(!D(this,ai,"f")&&this.supportsPrinting){if(!this.slick.viewer.pageViewsReady){this.slick.l10n.get("printing_not_ready",null).then(t=>{window.alert(t)});return}yt(this,jo,uC()),yt(this,ai,s_.instance.createPrintService({pdfDocument:this.slick.document,pagesOverview:this.slick.viewer.getPagesOverview(),printContainer:D(this,jo,"f").element,printResolution:this.slick.printResolution,optionalContentConfigPromise:null,printAnnotationStoragePromise:null})),this.slick.forceRendering(),D(this,ai,"f").layout()}},o_=function(){var t,e,i;D(this,ai,"f")&&(D(this,ai,"f").destroy(),yt(this,ai,null),(t=this.printDialog)===null||t===void 0||t.close(),(e=D(this,jo,"f"))===null||e===void 0||e.remove(),yt(this,jo,null),(i=this.slick.document)===null||i===void 0||i.annotationStorage.resetModified()),this.slick.forceRendering()};function uC(){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 Xb{static create(){let t=document.querySelector("#printServiceDialog");if(!t){const e=(i,s,n)=>{const a=document.createElement(i);return Object.entries(s).forEach(([o,l])=>a.setAttribute(o,l)),a.append(...n),a};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 Xb(t)}constructor(t){this.dialog=t}open(t){return li(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 ni,$o,Cb,Tb,dg,Kr,Yf,Kf,dc,Ko,l_,h_,Av,c_,_v,Ev,Sv,Pv,xv,Cv,Tv;Mn.workerSrc=new URL( window.__dynamic_base__+"/assets/pdf.worker.min--PgD6g2g.mjs",import.meta.url).toString();const fC={"8.5x11":"Letter","8.5x14":"Legal"},Iv={"297x420":"A3","210x297":"A4"};function fp(h,t,e){const i=t?h.width:h.height,s=t?h.height:h.width;return e["".concat(i,"x").concat(s)]}class gC{constructor({container:t,viewer:e,thumbs:i,store:s=r_(),options:n,onError:a,printDialog:o}){var l,c,d,u,g,b,w,v,y,A,E,_,S,P,x;ni.add(this),$o.set(this,void 0),Cb.set(this,void 0),Tb.set(this,void 0),dg.set(this,void 0),Kr.set(this,void 0),this.downloadManager=null,this.findController=null,this.pdfPresentationMode=null,this.document=null,Yf.set(this,void 0),Kf.set(this,void 0),dc.set(this,void 0),Ko.set(this,void 0),yt(this,Cb,t),yt(this,Tb,e),yt(this,dg,i),yt(this,dc,a),this.l10n=(l=n==null?void 0:n.l10n)!==null&&l!==void 0?l:new xo(navigator.language),this.downloadManager=new p0,this.textLayerMode=(c=n==null?void 0:n.textLayerMode)!==null&&c!==void 0?c:Vx.ENABLE,yt(this,Yf,(d=n==null?void 0:n.annotationMode)!==null&&d!==void 0?d:vs.ENABLE_FORMS),yt(this,Kf,(u=n==null?void 0:n.annotationEditorMode)!==null&&u!==void 0?u:Y.NONE),this.annotationEditorHighlightColors=(g=n==null?void 0:n.annotationEditorHighlightColors)!==null&&g!==void 0?g:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",this.removePageBorders=(b=n==null?void 0:n.removePageBorders)!==null&&b!==void 0?b:!1,this.singlePageViewer=(w=n==null?void 0:n.singlePageViewer)!==null&&w!==void 0?w:!1,this.enablePrintAutoRotate=(v=n==null?void 0:n.enablePrintAutoRotate)!==null&&v!==void 0?v:!1,this.useOnlyCssZoom=(y=n==null?void 0:n.useOnlyCssZoom)!==null&&y!==void 0?y:!1,this.pageColors=(A=n==null?void 0:n.pageColors)!==null&&A!==void 0?A:null,this.maxCanvasPixels=(E=n==null?void 0:n.maxCanvasPixels)!==null&&E!==void 0?E:16777216,this.printResolution=(_=n==null?void 0:n.printResolution)!==null&&_!==void 0?_:96,this.thumbnailWidth=(S=n==null?void 0:n.thumbnailWidth)!==null&&S!==void 0?S:125,this.getDocumentParams=(P=n==null?void 0:n.getDocumentParams)!==null&&P!==void 0?P:{},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 T=new Jx;T.onIdle=this._cleanup.bind(this),T.isThumbnailViewEnabled=!0,yt(this,$o,T);const I=new Ub,C=new $b({eventBus:I,externalLinkTarget:2,externalLinkRel:"noopener noreferrer nofollow",ignoreDestinationZoom:!1}),L=new r0({eventBus:I,linkService:C}),M=Object.assign(Object.assign({container:t},e&&{viewer:e}),{eventBus:I,linkService:C,findController:L,renderingQueue:T,textLayerMode:this.textLayerMode,annotationEditorHighlightColors:this.annotationEditorHighlightColors,l10n:this.l10n,annotationMode:D(this,Yf,"f"),annotationEditorMode:D(this,Kf,"f"),removePageBorders:this.removePageBorders,imageResourcesPath:"/images/"}),G=this.singlePageViewer?new Z0(M):new zb(M);T.setViewer(G),i&&(this.thumbnailViewer=new iC({container:i,eventBus:I,linkService:C,renderingQueue:T,pageColors:this.pageColors,enableHWA:void 0,store:s,thumbnailWidth:this.thumbnailWidth}),T.setThumbnailViewer(this.thumbnailViewer)),document.fullscreenEnabled&&(this.pdfPresentationMode=new hC({container:t,pdfViewer:G,eventBus:I})),this.eventBus=I,this.linkService=C,this.findController=L,this.viewer=G,this.linkService.setViewer(G),yt(this,Kr,new dC({eventBus:I,slick:this,printDialog:o!=null?o:Xb.create()}));const W=(x=n==null?void 0:n.scaleValue)!==null&&x!==void 0?x:"auto";this.store.setState({scaleValue:W})}loadDocument(t,e){return li(this,void 0,void 0,function*(){var i,s,n,a,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:Wv((a=this.url)===null||a===void 0?void 0:a.toString());this.filename=l;const c=Gy(Object.assign(Object.assign({},this.getDocumentParams),{url:this.url,isEvalSupported:!1}));e!=null&&e.onProgress&&(c.onProgress=e.onProgress);const d=yield c.promise;this.document=d,this.viewer.setDocument(this.document),this.linkService.setDocument(this.document),this.thumbnailViewer&&((o=this.thumbnailViewer)===null||o===void 0||o.setDocument(d)),D(this,ni,"m",c_).call(this),yield D(this,ni,"m",l_).call(this),this.store.setState({filename:l,numPages:d.numPages,pageNumber:1,isDocumentLoaded:!0,url:t.toString()});const u=yield d.getAttachments(),g=new Map(Object.keys(u!=null?u:{}).sort((b,w)=>b.toLowerCase().localeCompare(w.toLowerCase())).map(b=>[b,u[b]]));this.store.setState({attachments:g}),yield D(this,ni,"m",h_).call(this),this.forceRendering()}catch(l){D(this,dc,"f")&&D(this,dc,"f").call(this,l)}})}forceRendering(t=!0){D(this,$o,"f").printing=!!D(this,Kr,"f").printing,D(this,$o,"f").isThumbnailViewEnabled=t,D(this,$o,"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 li(this,void 0,void 0,function*(){var t,e;const i=this.url,{filename:s}=this;try{const n=yield this.document.getData(),a=new Blob([n],{type:"application/pdf"});yield(t=this.downloadManager)===null||t===void 0?void 0:t.download(a,i,s)}catch(n){yield(e=this.downloadManager)===null||e===void 0?void 0:e.download(null,i,s)}})}save(){return li(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 D(this,Kr,"f").supportsPrinting}requestPresentationMode(){var t;(t=this.pdfPresentationMode)===null||t===void 0||t.request()}triggerPrinting(){D(this,Kr,"f").print()}unbindEvents(){var t;(t=D(this,Ko,"f"))===null||t===void 0||t.abort(),yt(this,Ko,null),D(this,Kr,"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(Y.HIGHLIGHT),this.setAnnotationEditorParams([{type:st.HIGHLIGHT_DEFAULT_COLOR,value:t}]),this.store.setState({highlightDefaultColor:t})}setSpreadMode(t){Kx(t)&&(this.viewer.spreadMode=t,this.dispatch("switchspreadmode",{mode:t}))}setScrollMode(t){Yx(t)&&(this.viewer.scrollMode=t,this.dispatch("switchscrollmode",{mode:t}))}setRotation(t){Q0(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)}}$o=new WeakMap,Cb=new WeakMap,Tb=new WeakMap,dg=new WeakMap,Kr=new WeakMap,Yf=new WeakMap,Kf=new WeakMap,dc=new WeakMap,Ko=new WeakMap,ni=new WeakSet,l_=function(){return li(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,a=0;for(let c=0;c<s;c++){const d=i[c];if(d===(c+1).toString())n++;else if(d==="")a++;else break}if(n>=s||a>=s)return;const{viewer:o,thumbnailViewer:l}=this;o.setPageLabels(i),l==null||l.setPageLabels(i)})},h_=function(){return li(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=>D(this,ni,"m",Av).call(this,Wx(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:ig.toDateObject(t.CreationDate),modificationDate:ig.toDateObject(t.ModDate),isLinearized:t.IsLinearized,pageSize:i})})},Av=function(t,e){return li(this,void 0,void 0,function*(){if(!t)return;e%180!==0&&(t={width:t.height,height:t.width});const i=Zx(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},a=fp(s,i,fC)||fp(n,i,Iv);if(!a&&!(Number.isInteger(n.width)&&Number.isInteger(n.height))){const g={width:t.width*25.4,height:t.height*25.4},b={width:Math.round(n.width),height:Math.round(n.height)};Math.abs(g.width-b.width)<.1&&Math.abs(g.height-b.height)<.1&&(a=fp(b,i,Iv),a&&(s={width:Math.round(b.width/25.4*100)/100,height:Math.round(b.height/25.4*100)/100},n=b))}const[{width:o,height:l},c,d,u]=yield Promise.all([s,this.l10n.get("document_properties_page_size_unit_inches",null),a&&this.l10n.get("document_properties_page_size_name_".concat(a.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:d,orientation:u}})},c_=function(){yt(this,Ko,new AbortController);const{signal:t}=D(this,Ko,"f"),e={signal:t};this.eventBus._on("pagesinit",D(this,ni,"m",_v).bind(this),e),this.eventBus._on("scalechanging",D(this,ni,"m",xv).bind(this),e),this.eventBus._on("pagechanging",D(this,ni,"m",Cv).bind(this),e),this.eventBus._on("pagerendered",D(this,ni,"m",Tv).bind(this),e),this.eventBus._on("rotationchanging",D(this,ni,"m",Ev).bind(this),e),this.eventBus._on("switchspreadmode",D(this,ni,"m",Sv).bind(this),e),this.eventBus._on("switchscrollmode",D(this,ni,"m",Pv).bind(this),e)},_v=function(t){return li(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})})},Ev=function({pagesRotation:t,pageNumber:e}){this.store.setState({pagesRotation:t}),this.thumbnailViewer&&(this.thumbnailViewer.pagesRotation=t),this.forceRendering(),this.viewer.currentPageNumber=e},Sv=function({mode:t}){this.store.setState({spreadMode:t})},Pv=function({mode:t}){this.store.setState({scrollMode:t})},xv=function({scale:t,presetValue:e}){this.store.setState({scale:t,scaleValue:e}),this.viewer.update()},Cv=function({pageNumber:t}){var e;(e=this.thumbnailViewer)===null||e===void 0||e.scrollThumbnailIntoView(t),this.store.setState({pageNumber:t})},Tv=function({pageNumber:t,error:e}){var i;if(D(this,dg,"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 pC(h){const t={...h},e={...h},i={},s=a=>{let o=i[a];if(!o){if(!__())return t[a];i[a]=o=$i(t[a],{internal:!0}),delete t[a]}return o[0]()};for(const a in h)Object.defineProperty(e,a,{get:()=>s(a),enumerable:!0});const n=(a,o)=>{const l=i[a];if(l)return l[1](o);a in t&&(t[a]=ew(o,t[a]))};return[e,(a,o)=>{if(v_(a)){const l=y_(()=>Object.entries(ew(a,e)));A_(()=>{for(const[c,d]of l)n(c,()=>d)})}else n(a,o);return e}]}const d_={width:null,height:null};function gp(h){if(!h)return{...d_};const{width:t,height:e}=h.getBoundingClientRect();return{width:t,height:e}}function u_(h){const t=typeof h=="function",[e,i]=pC(E_.context||t?d_:gp(h)),s=new ResizeObserver(([n])=>i(gp(n.target)));return uc(()=>s.disconnect()),t?Ou(()=>{const n=h();n&&(i(gp(n)),s.observe(n),uc(()=>s.unobserve(n)))}):(s.observe(h),uc(()=>s.unobserve(h))),e}var mC=Lb('<div id=viewerContainer><div id=viewer class="pdfSlickViewer pdfViewer">');function bC(h){const[t,e]=$i(),i=u_(t);return Ou(()=>{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=mC();return Mv(n=>{h.viewerRef(n),e(n)},s),s.style.setProperty("position","absolute"),s.style.setProperty("inset","0"),s.style.setProperty("overflow","auto"),Dv(()=>{var n;return Nv(s,"pdfSlickContainer ".concat((n=h.class)!=null?n:""))}),s})()}var wC=Lb("<div>");function vC(h){const[t,e]=$i(),i=u_(t);return Ou(()=>{var s;i.width&&i.height&&((s=h.store.pdfSlick)==null||s.forceRendering())}),(()=>{var s=wC();return Mv(n=>{h.thumbsRef(n),e(n)},s),s.style.setProperty("position","absolute"),s.style.setProperty("overflow","auto"),s.style.setProperty("inset","0"),kv(s,O(Zf,{get each(){return Array.from(h.store.thumbnailViews)},children:([n,a])=>O(P_,{get mount(){return a.div},get children(){var o;return h.children({pageNumber:n,width:a.canvasWidth,height:a.canvasHeight,scale:a.scale,src:(o=a==null?void 0:a.src)!=null?o:null,rotation:a.rotation,pageLabel:a.pageLabel,loaded:a.loaded})}})})),Dv(n=>{var l,c;var a=(l=h.class)!=null?l:"",o=(c=h.classList)!=null?c:{};return a!==n.e&&Nv(s,n.e=a),n.t=x_(s,o,n.t),n},{e:void 0,t:void 0}),s})()}function yC(h,t=h.getState,e){const i=t(h.getState()),[s,n]=S_(i),a=(l,c)=>{t(c);const d=t(l);n(C_(d))},o=h.subscribe(a);return uc(()=>o()),s}const AC=(h,t)=>{const[e,i]=$i(!1),[s,n]=$i(!1),[a,o]=$i(null),[l,c]=$i(null),[d,u]=$i(null),[g,b]=$i(null),w=r_(),v=yC(w),y=E=>{o(E),n(!0)},A=E=>{c(E)};return Ou(()=>{if(h&&s()){const E=new gC({container:a(),thumbs:l(),store:w,options:t,onError:_=>u(_)});b(E),w.setState({pdfSlick:E}),E.loadDocument(h,t).then(()=>{i(!0)})}}),{isDocumentLoaded:e,viewerRef:y,thumbsRef:A,pdfSlick:g,pdfSlickStore:v,PDFSlickViewer:bC,PDFSlickThumbnails:vC,error:d}};function _C(h){return Sn({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 EC(h){return Sn({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 SC(h){return Sn({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 PC(h){return Sn({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2 1 1 2v12l1 1h12l1-1V2l-1-1H2Zm0 13V2h4v12H2Zm5 0V2h7v12H7Z"/>'},h)}function xC(h){return Sn({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 CC(h){return Sn({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 TC(h){return Sn({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 IC(h){return Sn({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 LC(h){return Sn({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 RC=Lb("<form>");const wT=()=>{const{viewerRef:h,pdfSlickStore:t,PDFSlickViewer:e}=AC(T_.raw_url),[i,s]=$i(1),{isOpen:n,onToggle:a,onClose:o}=I_(),l=d=>{var g;d.preventDefault();const u=parseInt(i()+"");Number.isInteger(u)&&u>0&&u<=t.numPages?(g=t.pdfSlick)==null||g.linkService.goToPage(u):s(t.pageNumber)},c=({pageNumber:d})=>s(d);return Ou(()=>{t.pdfSlick&&t.pdfSlick.on("pagechanging",c)}),uc(()=>{t.pdfSlick&&t.pdfSlick.off("pagechanging",c)}),O(Nr,{w:"$full",h:"70vh",pos:"relative",display:"flex",get children(){return[O(kC,{store:t,get isOpen(){return n()},onClose:o}),O(L_,{w:"$full",h:"$full",pos:"relative",flex:1,get children(){return[O(DC,{store:t,get isOpen(){return n()},onToggle:a,wantedPageNumber:i,onPageNumberChange:s,onPageNumberSubmit:l}),O(e,{store:t,viewerRef:h})]}})]}})},MC=h=>{const[t,e]=$i(!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 O(Nr,{mb:"$1",get children(){return[O(Qf,{spacing:"$1",alignItems:"center",get children(){return[O(vc,{get when(){return i()},get fallback(){return O(Nr,{w:"16px"})},get children(){return O(Ln,{size:"xs",variant:"ghost","aria-label":"Toggle",get icon(){return Uo(()=>!!t())()?O(CC,{}):O(TC,{})},minW:"16px",h:"16px",onClick:()=>e(!t())})}}),O(Ov,{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}})]}}),O(vc,{get when(){return Uo(()=>!!i())()&&t()},get children(){return O(Nr,{get pl(){return"".concat((h.level+1)*16,"px")},get children(){return O(f_,{get items(){return h.item.items},get level(){return h.level+1},get store(){return h.store}})}})}})]}})},f_=h=>!h.items||h.items.length===0?null:O(Zf,{get each(){return h.items},children:t=>O(MC,{item:t,get level(){return h.level||0},get store(){return h.store}})}),kC=h=>{const t=Fv();return O(vc,{get when(){return h.isOpen},get children(){return O(Nr,{w:"280px",h:"$full",bgColor:"$neutral1",borderRight:"1px solid $neutral6",display:"flex",flexDirection:"column",transition:"all 0.3s ease",zIndex:"10",get children(){return[O(Qf,{spacing:"$2",p:"$3",borderBottom:"1px solid $neutral6",bgColor:"$neutral2",get children(){return[O(Jf,{fontWeight:"$semibold",color:"$neutral12",get children(){return t("home.preview.pdf.document_outline")}}),O(Nr,{flex:1}),O($r,{withArrow:!0,get label(){return t("home.preview.pdf.close_sidebar")},get children(){return O(Ln,{size:"sm",get"aria-label"(){return t("home.preview.pdf.close_sidebar")},get icon(){return O(SC,{})},get onClick(){return h.onClose}})}})]}}),O(Nr,{flex:1,overflow:"auto",p:"$3",get children(){return O(R_,{spacing:"$2",alignItems:"stretch",get children(){return O(vc,{get when(){return h.store.documentOutline&&h.store.documentOutline.length>0},get fallback(){return O(Jf,{size:"sm",color:"$neutral11",textAlign:"center",mt:"$4",get children(){return t("home.preview.pdf.no_outline")}})},get children(){return O(f_,{get items(){return h.store.documentOutline},get store(){return h.store}})}})}})}})]}})}})},DC=h=>{const t=Fv();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=M_(()=>{if(h.store.scaleValue){const c=i.find(([d])=>d===h.store.scaleValue);if(c)return c[1]}return"".concat(Math.floor(h.store.scale*100),"%")}),a=c=>{h.store.pdfSlick&&(h.store.pdfSlick.currentScaleValue=c)},o=c=>{h.store.pdfSlick&&(h.store.pdfSlick.currentScale=c)},l=()=>h.store.annotationEditorMode===Y.INK;return O(Nr,{pos:"absolute",left:"50%",transform:"translateX(-50%)",display:"flex",zIndex:"1",css:{top:"$2",bottom:"auto","@sm":{top:"auto",bottom:"$2"}},get children(){return O(Qf,{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[O(vc,{get when(){return h.store.documentOutline&&h.store.documentOutline.length>0},get children(){return O($r,{withArrow:!0,get label(){return t("home.preview.pdf.toggle_sidebar")},get children(){return O(Ln,{size:"sm",colorScheme:"neutral",get"aria-label"(){return t("home.preview.pdf.toggle_sidebar")},get icon(){return Uo(()=>!!h.isOpen)()?O(PC,{}):O(xC,{})},get onClick(){return h.onToggle}})}})}}),O($r,{withArrow:!0,get label(){return t("home.preview.pdf.toggle_pen")},get children(){return O(Ln,{size:"sm",get"aria-label"(){return t("home.preview.pdf.toggle_pen")},get colorScheme(){return l()&&"primary"||"neutral"},onClick:()=>{var d,u;const c=l()?Y.NONE:Y.INK;(d=h.store.pdfSlick)==null||d.setAnnotationEditorMode(c),(u=h.store.pdfSlick)==null||u.setAnnotationEditorParams({type:st.INK_COLOR,value:"#ff0000"})},get icon(){return Uo(()=>!!l())()&&O(k_,{})||O(D_,{})}})}}),O(Xg,{orientation:"vertical",h:"24px"}),O(N_,{colorScheme:"neutral",attached:!0,get children(){return[O($r,{withArrow:!0,get label(){return t("home.preview.pdf.zoom_out")},get children(){return O(Ln,{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,d;return(d=(c=h.store.pdfSlick)==null?void 0:c.viewer)==null?void 0:d.decreaseScale()},get icon(){return O(LC,{})}})}}),O(F_,{motionPreset:"scale-bottom-left",get children(){return[O(O_,{as:Ov,size:"sm",minW:"60px",get children(){return O(Jf,{size:"sm",get children(){return Uo(()=>!!h.store.pdfSlick)()?n():t("home.preview.pdf.loading")}})}}),O(B_,{get children(){return[O(iw,{get children(){return[O(sw,{get children(){return t("home.preview.pdf.zoom_presets")}}),O(Zf,{each:i,children:c=>O(nw,{onSelect:()=>a(c[0]),get children(){return c[1]}})})]}}),O(Xg,{role:"presentation",my:"$1"}),O(iw,{get children(){return[O(sw,{get children(){return t("home.preview.pdf.zoom_levels")}}),O(Zf,{each:s,children:c=>O(nw,{onSelect:()=>o(c[0]),get children(){return c[1]}})})]}})]}})]}}),O($r,{withArrow:!0,get label(){return t("home.preview.pdf.zoom_in")},get children(){return O(Ln,{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,d;return(d=(c=h.store.pdfSlick)==null?void 0:c.viewer)==null?void 0:d.increaseScale()},get icon(){return O(IC,{})}})}})]}}),O(Xg,{orientation:"vertical",h:"24px"}),O(Qf,{spacing:"$2",alignItems:"center",get children(){return[(()=>{var c=RC();return V_(c,"submit",h.onPageNumberSubmit),kv(c,O(H_,{size:"sm",ref(d){var u=e;typeof u=="function"?u(d):e=d},type:"text",get value(){return h.wantedPageNumber()},w:"50px",textAlign:"center",onFocus:()=>e.select(),onChange:d=>h.onPageNumberChange(d.currentTarget.value)})),c})(),O(Jf,{size:"sm",minW:"$full",get children(){return["/ ",Uo(()=>h.store.numPages)]}})]}}),O($r,{withArrow:!0,get label(){return t("home.preview.pdf.prev_page")},get children(){return O(Ln,{size:"sm",get"aria-label"(){return t("home.preview.pdf.prev_page")},colorScheme:"neutral",get disabled(){return h.store.pageNumber<=1},onClick:()=>{var c,d;return(d=(c=h.store.pdfSlick)==null?void 0:c.viewer)==null?void 0:d.previousPage()},get icon(){return O(EC,{})}})}}),O($r,{withArrow:!0,get label(){return t("home.preview.pdf.next_page")},get children(){return O(Ln,{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,d;return(d=(c=h.store.pdfSlick)==null?void 0:c.viewer)==null?void 0:d.nextPage()},get icon(){return O(_C,{})}})}})]}})}})};export{wT as default};
|