@kne-components/components-core 0.1.13 → 0.1.15
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/build/asset-manifest.json +146 -146
- package/build/index.html +1 -1
- package/build/remoteEntry.js +1 -1
- package/build/remoteEntry.js.map +1 -1
- package/build/static/css/1151.7685055d.chunk.css +2 -0
- package/build/static/css/{1151.ec1bbfc0.chunk.css.map → 1151.7685055d.chunk.css.map} +1 -1
- package/build/static/css/1153.5d7ebb6e.chunk.css +2 -0
- package/build/static/css/{1153.bd20b743.chunk.css.map → 1153.5d7ebb6e.chunk.css.map} +1 -1
- package/build/static/css/1454.58495e5b.chunk.css +2 -0
- package/build/static/css/{1454.c0a0991e.chunk.css.map → 1454.58495e5b.chunk.css.map} +1 -1
- package/build/static/css/1554.0d3e06d3.chunk.css +2 -0
- package/build/static/css/{1554.a585edf1.chunk.css.map → 1554.0d3e06d3.chunk.css.map} +1 -1
- package/build/static/css/192.d05ba773.chunk.css +2 -0
- package/build/static/css/{192.73637503.chunk.css.map → 192.d05ba773.chunk.css.map} +1 -1
- package/build/static/css/1932.294b9127.chunk.css +2 -0
- package/build/static/css/{1932.0bf35bc9.chunk.css.map → 1932.294b9127.chunk.css.map} +1 -1
- package/build/static/css/{2503.48eb44fa.chunk.css → 2503.9770bf73.chunk.css} +2 -2
- package/build/static/css/{2503.48eb44fa.chunk.css.map → 2503.9770bf73.chunk.css.map} +1 -1
- package/build/static/css/{2517.5b666562.chunk.css → 2517.fa9b1397.chunk.css} +2 -2
- package/build/static/css/{2517.5b666562.chunk.css.map → 2517.fa9b1397.chunk.css.map} +1 -1
- package/build/static/css/2637.9ad7cbc2.chunk.css +2 -0
- package/build/static/css/2637.9ad7cbc2.chunk.css.map +1 -0
- package/build/static/css/2716.1f3e3207.chunk.css +2 -0
- package/build/static/css/{2716.6f49ddb5.chunk.css.map → 2716.1f3e3207.chunk.css.map} +1 -1
- package/build/static/css/{2730.e0efe797.chunk.css → 2730.ef220620.chunk.css} +2 -2
- package/build/static/css/{2730.e0efe797.chunk.css.map → 2730.ef220620.chunk.css.map} +1 -1
- package/build/static/css/2921.45c14b75.chunk.css +2 -0
- package/build/static/css/2921.45c14b75.chunk.css.map +1 -0
- package/build/static/css/3333.77e4fcf9.chunk.css +2 -0
- package/build/static/css/{3333.7d0ae50b.chunk.css.map → 3333.77e4fcf9.chunk.css.map} +1 -1
- package/build/static/css/{3843.ea9110c1.chunk.css → 3843.6ce81d34.chunk.css} +2 -2
- package/build/static/css/{3843.ea9110c1.chunk.css.map → 3843.6ce81d34.chunk.css.map} +1 -1
- package/build/static/css/4666.586a9ec3.chunk.css +2 -0
- package/build/static/css/{4666.6b5dde12.chunk.css.map → 4666.586a9ec3.chunk.css.map} +1 -1
- package/build/static/css/5196.5d237736.chunk.css +2 -0
- package/build/static/css/{5196.29f6749e.chunk.css.map → 5196.5d237736.chunk.css.map} +1 -1
- package/build/static/css/5362.aa21dd87.chunk.css +2 -0
- package/build/static/css/{5362.db0ec87d.chunk.css.map → 5362.aa21dd87.chunk.css.map} +1 -1
- package/build/static/css/5600.2dcdbcf2.chunk.css +2 -0
- package/build/static/css/{5600.bc21bda7.chunk.css.map → 5600.2dcdbcf2.chunk.css.map} +1 -1
- package/build/static/css/5673.7ebd0210.chunk.css +2 -0
- package/build/static/css/{5673.79f68b31.chunk.css.map → 5673.7ebd0210.chunk.css.map} +1 -1
- package/build/static/css/5941.bdec1678.chunk.css +2 -0
- package/build/static/css/5941.bdec1678.chunk.css.map +1 -0
- package/build/static/css/{5996.a2ddbe9b.chunk.css → 5996.1b216b52.chunk.css} +2 -2
- package/build/static/css/{5996.a2ddbe9b.chunk.css.map → 5996.1b216b52.chunk.css.map} +1 -1
- package/build/static/css/7227.f9016cca.chunk.css +2 -0
- package/build/static/css/{7227.c8f5f467.chunk.css.map → 7227.f9016cca.chunk.css.map} +1 -1
- package/build/static/css/8148.a0719bd9.chunk.css +2 -0
- package/build/static/css/8148.a0719bd9.chunk.css.map +1 -0
- package/build/static/css/{8725.baf97c0e.chunk.css → 8725.f40145d8.chunk.css} +2 -2
- package/build/static/css/{8725.baf97c0e.chunk.css.map → 8725.f40145d8.chunk.css.map} +1 -1
- package/build/static/css/9053.7b37e027.chunk.css +2 -0
- package/build/static/css/{9053.6a1a6919.chunk.css.map → 9053.7b37e027.chunk.css.map} +1 -1
- package/build/static/css/931.91d9fab7.chunk.css +2 -0
- package/build/static/css/{931.7a220088.chunk.css.map → 931.91d9fab7.chunk.css.map} +1 -1
- package/build/static/css/9689.42a0661f.chunk.css +2 -0
- package/build/static/css/{9689.7397d527.chunk.css.map → 9689.42a0661f.chunk.css.map} +1 -1
- package/build/static/css/9911.2e27b159.chunk.css +2 -0
- package/build/static/css/{9911.75d3b627.chunk.css.map → 9911.2e27b159.chunk.css.map} +1 -1
- package/build/static/js/{1153.0d52625e.chunk.js → 1153.d7532da7.chunk.js} +3 -3
- package/build/static/js/{1153.0d52625e.chunk.js.map → 1153.d7532da7.chunk.js.map} +1 -1
- package/build/static/js/1454.664aac87.chunk.js +3 -0
- package/build/static/js/{1454.c087b2eb.chunk.js.map → 1454.664aac87.chunk.js.map} +1 -1
- package/build/static/js/1554.12b6d54b.chunk.js +3 -0
- package/build/static/js/{1554.2e647156.chunk.js.map → 1554.12b6d54b.chunk.js.map} +1 -1
- package/build/static/js/{1664.169d6c37.chunk.js → 1664.6b6f85c6.chunk.js} +2 -2
- package/build/static/js/{1664.169d6c37.chunk.js.map → 1664.6b6f85c6.chunk.js.map} +1 -1
- package/build/static/js/{192.db4b6754.chunk.js → 192.01a6f575.chunk.js} +2 -2
- package/build/static/js/{192.db4b6754.chunk.js.map → 192.01a6f575.chunk.js.map} +1 -1
- package/build/static/js/{1922.c52450c3.chunk.js → 1922.e69b6391.chunk.js} +2 -2
- package/build/static/js/1922.e69b6391.chunk.js.map +1 -0
- package/build/static/js/1932.9fd15c7e.chunk.js +2 -0
- package/build/static/js/{1932.a0e955f3.chunk.js.map → 1932.9fd15c7e.chunk.js.map} +1 -1
- package/build/static/js/2503.e749e723.chunk.js +2 -0
- package/build/static/js/2503.e749e723.chunk.js.map +1 -0
- package/build/static/js/2517.9555a943.chunk.js +2 -0
- package/build/static/js/{2517.bfbef0e3.chunk.js.map → 2517.9555a943.chunk.js.map} +1 -1
- package/build/static/js/{2637.4a57844b.chunk.js → 2637.14b830e7.chunk.js} +2 -2
- package/build/static/js/2637.14b830e7.chunk.js.map +1 -0
- package/build/static/js/2716.1d4a549a.chunk.js +3 -0
- package/build/static/js/{2716.303242fa.chunk.js.map → 2716.1d4a549a.chunk.js.map} +1 -1
- package/build/static/js/2730.fec3f6af.chunk.js +2 -0
- package/build/static/js/{2730.40a28c60.chunk.js.map → 2730.fec3f6af.chunk.js.map} +1 -1
- package/build/static/js/2921.81b04b80.chunk.js +2 -0
- package/build/static/js/2921.81b04b80.chunk.js.map +1 -0
- package/build/static/js/{2950.5e36a971.chunk.js → 2950.ba94676e.chunk.js} +2 -2
- package/build/static/js/{2950.5e36a971.chunk.js.map → 2950.ba94676e.chunk.js.map} +1 -1
- package/build/static/js/3245.e987bbef.chunk.js +3 -0
- package/build/static/js/{3245.3eeca0e4.chunk.js.LICENSE.txt → 3245.e987bbef.chunk.js.LICENSE.txt} +3 -3
- package/build/static/js/3245.e987bbef.chunk.js.map +1 -0
- package/build/static/js/{3333.40a6c257.chunk.js → 3333.74a81fea.chunk.js} +2 -2
- package/build/static/js/{3333.40a6c257.chunk.js.map → 3333.74a81fea.chunk.js.map} +1 -1
- package/build/static/js/3805.8b4f9a3a.chunk.js +2 -0
- package/build/static/js/3805.8b4f9a3a.chunk.js.map +1 -0
- package/build/static/js/{3843.a9b49a31.chunk.js → 3843.0a60bb49.chunk.js} +2 -2
- package/build/static/js/{3843.a9b49a31.chunk.js.map → 3843.0a60bb49.chunk.js.map} +1 -1
- package/build/static/js/4168.cb27218c.chunk.js +2 -0
- package/build/static/js/4168.cb27218c.chunk.js.map +1 -0
- package/build/static/js/4666.918bc59c.chunk.js +2 -0
- package/build/static/js/{4666.d14420a6.chunk.js.map → 4666.918bc59c.chunk.js.map} +1 -1
- package/build/static/js/5196.ea53bdcd.chunk.js +2 -0
- package/build/static/js/{5196.a2cba1ec.chunk.js.map → 5196.ea53bdcd.chunk.js.map} +1 -1
- package/build/static/js/5362.955d4a28.chunk.js +3 -0
- package/build/static/js/{5362.5fc27935.chunk.js.map → 5362.955d4a28.chunk.js.map} +1 -1
- package/build/static/js/5600.aaecbab3.chunk.js +2 -0
- package/build/static/js/{5600.85ba4bf2.chunk.js.map → 5600.aaecbab3.chunk.js.map} +1 -1
- package/build/static/js/{5673.1fab0476.chunk.js → 5673.2770297c.chunk.js} +2 -2
- package/build/static/js/{5673.1fab0476.chunk.js.map → 5673.2770297c.chunk.js.map} +1 -1
- package/build/static/js/5941.d4d1dad5.chunk.js +2 -0
- package/build/static/js/5941.d4d1dad5.chunk.js.map +1 -0
- package/build/static/js/5996.4870d600.chunk.js +2 -0
- package/build/static/js/{5996.71e827a6.chunk.js.map → 5996.4870d600.chunk.js.map} +1 -1
- package/build/static/js/6213.dd73c376.chunk.js +2 -0
- package/build/static/js/6213.dd73c376.chunk.js.map +1 -0
- package/build/static/js/6499.afdde7b5.chunk.js +2 -0
- package/build/static/js/6499.afdde7b5.chunk.js.map +1 -0
- package/build/static/js/6900.7c1ed7ed.chunk.js +2 -0
- package/build/static/js/6900.7c1ed7ed.chunk.js.map +1 -0
- package/build/static/js/7227.a49f4250.chunk.js +3 -0
- package/build/static/js/{7227.4db45669.chunk.js.map → 7227.a49f4250.chunk.js.map} +1 -1
- package/build/static/js/7285.58da05db.chunk.js +2 -0
- package/build/static/js/7285.58da05db.chunk.js.map +1 -0
- package/build/static/js/7777.0c5175a2.chunk.js +2 -0
- package/build/static/js/{7777.55b9c954.chunk.js.map → 7777.0c5175a2.chunk.js.map} +1 -1
- package/build/static/js/{8016.ffba9f87.chunk.js → 8016.402ea860.chunk.js} +2 -2
- package/build/static/js/{8016.ffba9f87.chunk.js.map → 8016.402ea860.chunk.js.map} +1 -1
- package/build/static/js/{8111.97de8531.chunk.js → 8111.d6e9abcd.chunk.js} +2 -2
- package/build/static/js/{8111.97de8531.chunk.js.map → 8111.d6e9abcd.chunk.js.map} +1 -1
- package/build/static/js/8148.8cdb53e4.chunk.js +3 -0
- package/build/static/js/8148.8cdb53e4.chunk.js.map +1 -0
- package/build/static/js/{8151.e9794f31.chunk.js → 8151.bc656841.chunk.js} +2 -2
- package/build/static/js/{8151.e9794f31.chunk.js.map → 8151.bc656841.chunk.js.map} +1 -1
- package/build/static/js/8267.7fe589b0.chunk.js +2 -0
- package/build/static/js/{8267.a19b2789.chunk.js.map → 8267.7fe589b0.chunk.js.map} +1 -1
- package/build/static/js/8564.8f01b47a.chunk.js +2 -0
- package/build/static/js/8564.8f01b47a.chunk.js.map +1 -0
- package/build/static/js/{8725.8c209220.chunk.js → 8725.6ae3fe5a.chunk.js} +2 -2
- package/build/static/js/{8725.8c209220.chunk.js.map → 8725.6ae3fe5a.chunk.js.map} +1 -1
- package/build/static/js/{9053.94b035ac.chunk.js → 9053.d313b308.chunk.js} +3 -3
- package/build/static/js/{9053.94b035ac.chunk.js.map → 9053.d313b308.chunk.js.map} +1 -1
- package/build/static/js/{931.75a9d316.chunk.js → 931.35bb15eb.chunk.js} +2 -2
- package/build/static/js/{931.75a9d316.chunk.js.map → 931.35bb15eb.chunk.js.map} +1 -1
- package/build/static/js/9666.6ab09d66.chunk.js +2 -0
- package/build/static/js/9666.6ab09d66.chunk.js.map +1 -0
- package/build/static/js/{9911.7aee726d.chunk.js → 9911.2d3e9bd1.chunk.js} +2 -2
- package/build/static/js/{9911.7aee726d.chunk.js.map → 9911.2d3e9bd1.chunk.js.map} +1 -1
- package/build/static/js/{main.d3a20250.js → main.5e3c5ac0.js} +2 -2
- package/build/static/js/main.5e3c5ac0.js.map +1 -0
- package/package.json +1 -1
- package/build/static/css/1151.ec1bbfc0.chunk.css +0 -2
- package/build/static/css/1153.bd20b743.chunk.css +0 -2
- package/build/static/css/1454.c0a0991e.chunk.css +0 -2
- package/build/static/css/1554.a585edf1.chunk.css +0 -2
- package/build/static/css/192.73637503.chunk.css +0 -2
- package/build/static/css/1932.0bf35bc9.chunk.css +0 -2
- package/build/static/css/2637.ae1f2887.chunk.css +0 -2
- package/build/static/css/2637.ae1f2887.chunk.css.map +0 -1
- package/build/static/css/2716.6f49ddb5.chunk.css +0 -2
- package/build/static/css/2921.935ed0ce.chunk.css +0 -2
- package/build/static/css/2921.935ed0ce.chunk.css.map +0 -1
- package/build/static/css/3333.7d0ae50b.chunk.css +0 -2
- package/build/static/css/4666.6b5dde12.chunk.css +0 -2
- package/build/static/css/5196.29f6749e.chunk.css +0 -2
- package/build/static/css/5362.db0ec87d.chunk.css +0 -2
- package/build/static/css/5600.bc21bda7.chunk.css +0 -2
- package/build/static/css/5673.79f68b31.chunk.css +0 -2
- package/build/static/css/5941.6743598e.chunk.css +0 -2
- package/build/static/css/5941.6743598e.chunk.css.map +0 -1
- package/build/static/css/7227.c8f5f467.chunk.css +0 -2
- package/build/static/css/8148.7a78b9f0.chunk.css +0 -2
- package/build/static/css/8148.7a78b9f0.chunk.css.map +0 -1
- package/build/static/css/9053.6a1a6919.chunk.css +0 -2
- package/build/static/css/931.7a220088.chunk.css +0 -2
- package/build/static/css/9689.7397d527.chunk.css +0 -2
- package/build/static/css/9911.75d3b627.chunk.css +0 -2
- package/build/static/js/1454.c087b2eb.chunk.js +0 -3
- package/build/static/js/1554.2e647156.chunk.js +0 -3
- package/build/static/js/1922.c52450c3.chunk.js.map +0 -1
- package/build/static/js/1932.a0e955f3.chunk.js +0 -2
- package/build/static/js/2503.e9de0bb4.chunk.js +0 -2
- package/build/static/js/2503.e9de0bb4.chunk.js.map +0 -1
- package/build/static/js/2517.bfbef0e3.chunk.js +0 -2
- package/build/static/js/2637.4a57844b.chunk.js.map +0 -1
- package/build/static/js/2716.303242fa.chunk.js +0 -3
- package/build/static/js/2730.40a28c60.chunk.js +0 -2
- package/build/static/js/2921.a64b88fb.chunk.js +0 -2
- package/build/static/js/2921.a64b88fb.chunk.js.map +0 -1
- package/build/static/js/3245.3eeca0e4.chunk.js +0 -3
- package/build/static/js/3245.3eeca0e4.chunk.js.map +0 -1
- package/build/static/js/3805.6149ae4b.chunk.js +0 -2
- package/build/static/js/3805.6149ae4b.chunk.js.map +0 -1
- package/build/static/js/4168.bc1cc45c.chunk.js +0 -2
- package/build/static/js/4168.bc1cc45c.chunk.js.map +0 -1
- package/build/static/js/4666.d14420a6.chunk.js +0 -2
- package/build/static/js/5196.a2cba1ec.chunk.js +0 -2
- package/build/static/js/5362.5fc27935.chunk.js +0 -3
- package/build/static/js/5600.85ba4bf2.chunk.js +0 -2
- package/build/static/js/5941.178c2afc.chunk.js +0 -2
- package/build/static/js/5941.178c2afc.chunk.js.map +0 -1
- package/build/static/js/5996.71e827a6.chunk.js +0 -2
- package/build/static/js/6213.8d51d652.chunk.js +0 -2
- package/build/static/js/6213.8d51d652.chunk.js.map +0 -1
- package/build/static/js/6499.3dcf0f88.chunk.js +0 -2
- package/build/static/js/6499.3dcf0f88.chunk.js.map +0 -1
- package/build/static/js/6900.67ca7456.chunk.js +0 -2
- package/build/static/js/6900.67ca7456.chunk.js.map +0 -1
- package/build/static/js/7227.4db45669.chunk.js +0 -3
- package/build/static/js/7285.e023f277.chunk.js +0 -2
- package/build/static/js/7285.e023f277.chunk.js.map +0 -1
- package/build/static/js/7777.55b9c954.chunk.js +0 -2
- package/build/static/js/8148.71868223.chunk.js +0 -3
- package/build/static/js/8148.71868223.chunk.js.map +0 -1
- package/build/static/js/8267.a19b2789.chunk.js +0 -2
- package/build/static/js/8564.c755faf3.chunk.js +0 -2
- package/build/static/js/8564.c755faf3.chunk.js.map +0 -1
- package/build/static/js/9666.7b24426a.chunk.js +0 -2
- package/build/static/js/9666.7b24426a.chunk.js.map +0 -1
- package/build/static/js/main.d3a20250.js.map +0 -1
- /package/build/static/js/{1153.0d52625e.chunk.js.LICENSE.txt → 1153.d7532da7.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1454.c087b2eb.chunk.js.LICENSE.txt → 1454.664aac87.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1554.2e647156.chunk.js.LICENSE.txt → 1554.12b6d54b.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{2716.303242fa.chunk.js.LICENSE.txt → 2716.1d4a549a.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{5362.5fc27935.chunk.js.LICENSE.txt → 5362.955d4a28.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{7227.4db45669.chunk.js.LICENSE.txt → 7227.a49f4250.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{8148.71868223.chunk.js.LICENSE.txt → 8148.8cdb53e4.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{9053.94b035ac.chunk.js.LICENSE.txt → 9053.d313b308.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(self.webpackChunk_kne_components_components_core=self.webpackChunk_kne_components_components_core||[]).push([[4168],{46749:(module,__unused_webpack_exports,__webpack_require__)=>{var _classPrivateGetter=__webpack_require__(183).default,_defineProperty=__webpack_require__(43693).default,_classPrivateMethodInitSpec=__webpack_require__(93312).default,_assertClassBrand=__webpack_require__(81756).default,_classPrivateFieldInitSpec=__webpack_require__(42459).default,_classPrivateFieldGet=__webpack_require__(16668).default,_classPrivateFieldSet=__webpack_require__(37088).default,factory;globalThis,factory=()=>(()=>{"use strict";var __webpack_modules__=[,(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.RenderingIntentFlag=e.PromiseCapability=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.MAX_IMAGE_SIZE_TO_CACHE=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMode=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0,e.assert=function(t,e){t||a(e)},e.bytesToString=function(t){"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.length)||a("Invalid argument for bytesToString");const e=t.length,s=8192;if(e<s)return String.fromCharCode.apply(null,t);const i=[];for(let n=0;n<e;n+=s){const a=Math.min(n+s,e),r=t.subarray(n,a);i.push(String.fromCharCode.apply(null,r))}return i.join("")},e.createValidAbsoluteUrl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(s&&"string"===typeof t){if(s.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);(null===e||void 0===e?void 0:e.length)>=2&&(t="http://".concat(t))}if(s.tryConvertEncoding)try{t=u(t)}catch(i){}}const n=e?new URL(t,e):new URL(t);if(function(t){switch(null===t||void 0===t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch(i){}return null},e.getModificationDate=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")},e.getVerbosityLevel=function(){return i},e.info=function(t){i>=s.INFOS&&console.log("Info: ".concat(t))},e.isArrayBuffer=function(t){return"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.byteLength)},e.isArrayEqual=function(t,e){if(t.length!==e.length)return!1;for(let s=0,i=t.length;s<i;s++)if(t[s]!==e[s])return!1;return!0},e.normalizeUnicode=function(t){return f||(f=/([\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,g=new Map([["\ufb05","\u017ft"]])),t.replaceAll(f,((t,e,s)=>e?e.normalize("NFKC"):g.get(s)))},e.objectFromMap=function(t){const e=Object.create(null);for(const[s,i]of t)e[s]=i;return e},e.objectSize=function(t){return Object.keys(t).length},e.setVerbosityLevel=function(t){Number.isInteger(t)&&(i=t)},e.shadow=r,e.string32=function(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)},e.stringToBytes=l,e.stringToPDFString=function(t){if(t[0]>="\xef"){let e;if("\xfe"===t[0]&&"\xff"===t[1]?e="utf-16be":"\xff"===t[0]&&"\xfe"===t[1]?e="utf-16le":"\xef"===t[0]&&"\xbb"===t[1]&&"\xbf"===t[2]&&(e="utf-8"),e)try{const s=new TextDecoder(e,{fatal:!0}),i=l(t);return s.decode(i)}catch(s){n('stringToPDFString: "'.concat(s,'".'))}}const e=[];for(let i=0,n=t.length;i<n;i++){const s=h[t.charCodeAt(i)];e.push(s?String.fromCharCode(s):t.charAt(i))}return e.join("")},e.stringToUTF8String=u,e.unreachable=a,e.utf8StringToString=function(t){return unescape(encodeURIComponent(t))},e.warn=n,e.IDENTITY_MATRIX=[1,0,0,1,0,0],e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],e.MAX_IMAGE_SIZE_TO_CACHE=1e7,e.LINE_FACTOR=1.35,e.LINE_DESCENT_FACTOR=.35,e.BASELINE_FACTOR=.25925925925925924,e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},e.AnnotationEditorPrefix="pdfjs_internal_editor_",e.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15},e.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13},e.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},e.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},e.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},e.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},e.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"},e.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"},e.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"},e.AnnotationReplyType={GROUP:"Group",REPLY:"R"},e.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},e.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},e.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},e.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},e.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},e.PageActionEventType={O:"PageOpen",C:"PageClose"};const s={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=s,e.CMapCompressionType={NONE:0,BINARY:1},e.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let i=s.WARNINGS;function n(t){i>=s.WARNINGS&&console.log("Warning: ".concat(t))}function a(t){throw new Error(t)}function r(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(t,e,{value:s,enumerable:!i,configurable:!0,writable:!1}),s}const o=function(){function t(e,s){this.constructor===t&&a("Cannot initialize BaseException."),this.message=e,this.name=s}return t.prototype=new Error,t.constructor=t,t}();function l(t){"string"!==typeof t&&a("Invalid argument for stringToBytes");const e=t.length,s=new Uint8Array(e);for(let i=0;i<e;++i)s[i]=255&t.charCodeAt(i);return s}e.BaseException=o,e.PasswordException=class extends o{constructor(t,e){super(t,"PasswordException"),this.code=e}},e.UnknownErrorException=class extends o{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},e.InvalidPDFException=class extends o{constructor(t){super(t,"InvalidPDFException")}},e.MissingPDFException=class extends o{constructor(t){super(t,"MissingPDFException")}},e.UnexpectedResponseException=class extends o{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}},e.FormatError=class extends o{constructor(t){super(t,"FormatError")}},e.AbortException=class extends o{constructor(t){super(t,"AbortException")}},e.FeatureTest=class{static get isLittleEndian(){return r(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return r(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return r(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get platform(){return"undefined"===typeof navigator?r(this,"platform",{isWin:!1,isMac:!1}):r(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}};const c=[...Array(256).keys()].map((t=>t.toString(16).padStart(2,"0")));class d{static makeHexColor(t,e,s){return"#".concat(c[t]).concat(c[e]).concat(c[s])}static scaleMinMax(t,e){let s;t[0]?(t[0]<0&&(s=e[0],e[0]=e[1],e[1]=s),e[0]*=t[0],e[1]*=t[0],t[3]<0&&(s=e[2],e[2]=e[3],e[3]=s),e[2]*=t[3],e[3]*=t[3]):(s=e[0],e[0]=e[2],e[2]=s,s=e[1],e[1]=e[3],e[3]=s,t[1]<0&&(s=e[2],e[2]=e[3],e[3]=s),e[2]*=t[1],e[3]*=t[1],t[2]<0&&(s=e[0],e[0]=e[1],e[1]=s),e[0]*=t[2],e[1]*=t[2]),e[0]+=t[4],e[1]+=t[4],e[2]+=t[5],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){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const s=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/s,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/s]}static getAxialAlignedBoundingBox(t,e){const s=d.applyTransform(t,e),i=d.applyTransform(t.slice(2,4),e),n=d.applyTransform([t[0],t[3]],e),a=d.applyTransform([t[2],t[1]],e);return[Math.min(s[0],i[0],n[0],a[0]),Math.min(s[1],i[1],n[1],a[1]),Math.max(s[0],i[0],n[0],a[0]),Math.max(s[1],i[1],n[1],a[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],s=t[0]*e[0]+t[1]*e[2],i=t[0]*e[1]+t[1]*e[3],n=t[2]*e[0]+t[3]*e[2],a=t[2]*e[1]+t[3]*e[3],r=(s+a)/2,o=Math.sqrt((s+a)**2-4*(s*a-n*i))/2,l=r+o||1,c=r-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const s=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(s>i)return null;const 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:[s,n,i,a]}static bezierBoundingBox(t,e,s,i,n,a,r,o){const l=[],c=[[],[]];let d,h,u,p,f,g,m,_;for(let A=0;A<2;++A)if(0===A?(h=6*t-12*s+6*n,d=-3*t+9*s-9*n+3*r,u=3*s-3*t):(h=6*e-12*i+6*a,d=-3*e+9*i-9*a+3*o,u=3*i-3*e),Math.abs(d)<1e-12){if(Math.abs(h)<1e-12)continue;p=-u/h,0<p&&p<1&&l.push(p)}else m=h*h-4*u*d,_=Math.sqrt(m),m<0||(f=(-h+_)/(2*d),0<f&&f<1&&l.push(f),g=(-h-_)/(2*d),0<g&&g<1&&l.push(g));let v,b=l.length;const y=b;for(;b--;)p=l[b],v=1-p,c[0][b]=v*v*v*t+3*v*v*p*s+3*v*p*p*n+p*p*p*r,c[1][b]=v*v*v*e+3*v*v*p*i+3*v*p*p*a+p*p*p*o;return c[0][y]=t,c[1][y]=e,c[0][y+1]=r,c[1][y+1]=o,c[0].length=c[1].length=y+2,[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}}e.Util=d;const h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function u(t){return decodeURIComponent(escape(t))}var p=new WeakMap;e.PromiseCapability=class{constructor(){_classPrivateFieldInitSpec(this,p,!1),this.promise=new Promise(((t,e)=>{this.resolve=e=>{_classPrivateFieldSet(p,this,!0),t(e)},this.reject=t=>{_classPrivateFieldSet(p,this,!0),e(t)}}))}get settled(){return _classPrivateFieldGet(p,this)}};let f=null,g=null},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_is_node=__w_pdfjs_require__(10),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_xfa_text=__w_pdfjs_require__(19);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultFilterFactory=_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory,createPDFNetworkStream;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:t,NodeCMapReaderFactory:e,NodeFilterFactory:s,NodeStandardFontDataFactory:i}=__w_pdfjs_require__(20);exports.DefaultCanvasFactory=DefaultCanvasFactory=t,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=e,exports.DefaultFilterFactory=DefaultFilterFactory=s,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=i}if(_is_node.isNodeJS){const{PDFNodeStream:t}=__w_pdfjs_require__(21);createPDFNetworkStream=e=>new t(e)}else{const{PDFNetworkStream:t}=__w_pdfjs_require__(24),{PDFFetchStream:e}=__w_pdfjs_require__(25);createPDFNetworkStream=s=>(0,_display_utils.isValidFetchUrl)(s.url)?new e(s):new t(s)}function getDocument(t){var e,s;if("string"===typeof t||t instanceof URL?t={url:t}:(0,_util.isArrayBuffer)(t)&&(t={data:t}),"object"!==typeof t)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const i=new PDFDocumentLoadingTask,{docId:n}=i,a=t.url?getUrlProp(t.url):null,r=t.data?getDataProp(t.data):null,o=t.httpHeaders||null,l=!0===t.withCredentials,c=null!==(e=t.password)&&void 0!==e?e:null,d=t.range instanceof PDFDataRangeTransport?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let u=t.worker instanceof PDFWorker?t.worker:null;const p=t.verbosity,f="string"!==typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,g="string"===typeof t.cMapUrl?t.cMapUrl:null,m=!1!==t.cMapPacked,_=t.CMapReaderFactory||DefaultCMapReaderFactory,v="string"===typeof t.standardFontDataUrl?t.standardFontDataUrl:null,b=t.StandardFontDataFactory||DefaultStandardFontDataFactory,y=!0!==t.stopAtErrors,A=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,P=!1!==t.isEvalSupported,S="boolean"===typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_is_node.isNodeJS,F=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x="boolean"===typeof t.disableFontFace?t.disableFontFace:_is_node.isNodeJS,C=!0===t.fontExtraProperties,w=!0===t.enableXfa,E=t.ownerDocument||globalThis.document,k=!0===t.disableRange,T=!0===t.disableStream,M=!0===t.disableAutoFetch,R=!0===t.pdfBug,I=d?d.length:null!==(s=t.length)&&void 0!==s?s:NaN,D="boolean"===typeof t.useSystemFonts?t.useSystemFonts:!_is_node.isNodeJS&&!x,O="boolean"===typeof t.useWorkerFetch?t.useWorkerFetch:_===_display_utils.DOMCMapReaderFactory&&b===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(g,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(v,document.baseURI),L=t.canvasFactory||new DefaultCanvasFactory({ownerDocument:E}),G=t.filterFactory||new DefaultFilterFactory({docId:n,ownerDocument:E});(0,_util.setVerbosityLevel)(p);const N={canvasFactory:L,filterFactory:G};if(O||(N.cMapReaderFactory=new _({baseUrl:g,isCompressed:m}),N.standardFontDataFactory=new b({baseUrl:v})),!u){const t={verbosity:p,port:_worker_options.GlobalWorkerOptions.workerPort};u=t.port?PDFWorker.fromPort(t):new PDFWorker(t),i._worker=u}const B={docId:n,apiVersion:"3.6.172",data:r,password:c,disableAutoFetch:M,rangeChunkSize:h,length:I,docBaseUrl:f,enableXfa:w,evaluatorOptions:{maxImageSize:A,disableFontFace:x,ignoreErrors:y,isEvalSupported:P,isOffscreenCanvasSupported:S,canvasMaxAreaInBytes:F,fontExtraProperties:C,useSystemFonts:D,cMapUrl:O?g:null,standardFontDataUrl:O?v:null}},j={ignoreErrors:y,isEvalSupported:P,disableFontFace:x,fontExtraProperties:C,enableXfa:w,ownerDocument:E,disableAutoFetch:M,pdfBug:R,styleElement:null};return u.promise.then((function(){if(i.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(u,B),e=new Promise((function(t){let e;d?e=new _transport_stream.PDFDataTransportStream({length:I,initialData:d.initialData,progressiveDone:d.progressiveDone,contentDispositionFilename:d.contentDispositionFilename,disableRange:k,disableStream:T},d):r||(e=createPDFNetworkStream({url:a,length:I,httpHeaders:o,withCredentials:l,rangeChunkSize:h,disableRange:k,disableStream:T})),t(e)}));return Promise.all([t,e]).then((function(t){let[e,s]=t;if(i.destroyed)throw new Error("Loading aborted");const a=new _message_handler.MessageHandler(n,e,u.port),r=new WorkerTransport(a,i,s,j,N);i._transport=r,a.send("Ready",null)}))})).catch(i._capability.reject),i}async function _fetchDocument(t,e){if(t.destroyed)throw new Error("Worker was destroyed");const s=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return s}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch(e){if(_is_node.isNodeJS&&"string"===typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_is_node.isNodeJS&&"undefined"!==typeof Buffer&&t instanceof Buffer)return(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`."),new Uint8Array(t);if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"===typeof t)return(0,_util.stringToBytes)(t);if("object"===typeof t&&!isNaN(null===t||void 0===t?void 0:t.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{constructor(){var t,e;this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d".concat((_docId._=(t=_docId._,e=t++,t),e)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var t;this.destroyed=!0,await(null===(t=this._transport)||void 0===t?void 0:t.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}var _docId={_:0};exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=s,this.contentDispositionFilename=i,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const s of this._rangeListeners)s(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const s of this._progressListeners)s(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(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()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}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()}}exports.PDFDocumentProxy=PDFDocumentProxy;var _delayedCleanupTimeout=new WeakMap,_pendingCleanup=new WeakMap,_PDFPageProxy_brand=new WeakSet;class PDFPageProxy{constructor(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_classPrivateMethodInitSpec(this,_PDFPageProxy_brand),_classPrivateFieldInitSpec(this,_delayedCleanupTimeout,null),_classPrivateFieldInitSpec(this,_pendingCleanup,!1),this._pageIndex=t,this._pageInfo=e,this._transport=s,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,this.commonObjs=s.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,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(){let{scale:t,rotation:e=this.rotate,offsetX:s=0,offsetY:i=0,dontFlip:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:s,offsetY:i,dontFlip:n})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,s,i;let{canvasContext:n,viewport:a,intent:r="display",annotationMode:o=_util.AnnotationMode.ENABLE,transform:l=null,background:c=null,optionalContentConfigPromise:d=null,annotationCanvasMap:h=null,pageColors:u=null,printAnnotationStorage:p=null}=t;if(null!==(e=arguments[0])&&void 0!==e&&e.canvasFactory)throw new Error("render no longer accepts the `canvasFactory`-option, please pass it to the `getDocument`-function instead.");null===(s=this._stats)||void 0===s||s.time("Overall");const f=this._transport.getRenderingIntent(r,o,p);_classPrivateFieldSet(_pendingCleanup,this,!1),_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),d||(d=this._transport.getOptionalContentConfig());let g=this._intentStates.get(f.cacheKey);g||(g=Object.create(null),this._intentStates.set(f.cacheKey,g)),g.streamReaderCancelTimeout&&(clearTimeout(g.streamReaderCancelTimeout),g.streamReaderCancelTimeout=null);const m=!!(f.renderingIntent&_util.RenderingIntentFlag.PRINT);var _;g.displayReadyCapability||(g.displayReadyCapability=new _util.PromiseCapability,g.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(_=this._stats)||void 0===_||_.time("Page Request"),this._pumpOperatorList(f));const v=t=>{var e,s;g.renderTasks.delete(b),(this._maybeCleanupAfterRender||m)&&_classPrivateFieldSet(_pendingCleanup,this,!0),_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!m),t?(b.capability.reject(t),this._abortOperatorList({intentState:g,reason:t instanceof Error?t:new Error(t)})):b.capability.resolve(),null===(e=this._stats)||void 0===e||e.timeEnd("Rendering"),null===(s=this._stats)||void 0===s||s.timeEnd("Overall")},b=new InternalRenderTask({callback:v,params:{canvasContext:n,viewport:a,transform:l,background:c},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:g.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!m,pdfBug:this._pdfBug,pageColors:u});((i=g).renderTasks||(i.renderTasks=new Set)).add(b);const y=b.task;return Promise.all([g.displayReadyCapability.promise,d]).then((t=>{var e;let[s,i]=t;_classPrivateFieldGet(_pendingCleanup,this)?v():(null===(e=this._stats)||void 0===e||e.time("Rendering"),b.initializeGraphics({transparency:s,optionalContentConfig:i}),b.operatorListChanged())})).catch(v),y}getOperatorList(){let{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:s=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=this._transport.getRenderingIntent(t,e,s,!0);let n,a=this._intentStates.get(i.cacheKey);var r,o;return a||(a=Object.create(null),this._intentStates.set(i.cacheKey,a)),a.opListReadCapability||(n=Object.create(null),n.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(n))},a.opListReadCapability=new _util.PromiseCapability,((r=a).renderTasks||(r.renderTasks=new Set)).add(n),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(o=this._stats)||void 0===o||o.time("Page Request"),this._pumpOperatorList(i)),a.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((t=>_xfa_text.XfaText.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,s){const i=e.getReader(),n={items:[],styles:Object.create(null)};!function e(){i.read().then((function(s){let{value:i,done:a}=s;a?t(n):(Object.assign(n.styles,i.styles),n.items.push(...i.items),e())}),s)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const s of e.renderTasks)t.push(s.completed),s.cancel();return this.objs.clear(),_classPrivateFieldSet(_pendingCleanup,this,!1),_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classPrivateFieldSet(_pendingCleanup,this,!0);const e=_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!1);return t&&e&&this._stats&&(this._stats=new _display_utils.StatTimer),e}_startRenderPage(t,e){var s,i;const n=this._intentStates.get(e);n&&(null===(s=this._stats)||void 0===s||s.timeEnd("Page Request"),null===(i=n.displayReadyCapability)||void 0===i||i.resolve(t))}_renderPageChunk(t,e){for(let s=0,i=t.length;s<i;s++)e.operatorList.fnArray.push(t.fnArray[s]),e.operatorList.argsArray.push(t.argsArray[s]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const s of e.renderTasks)s.operatorListChanged();t.lastChunk&&_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!0)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:s,annotationStorageMap:i}=t;const n=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:s,annotationStorage:i}).getReader(),a=this._intentStates.get(s);a.streamReader=n;const r=()=>{n.read().then((t=>{let{value:e,done:s}=t;s?a.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,a),r())}),(t=>{if(a.streamReader=null,!this._transport.destroyed){if(a.operatorList){a.operatorList.lastChunk=!0;for(const t of a.renderTasks)t.operatorListChanged();_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!0)}if(a.displayReadyCapability)a.displayReadyCapability.reject(t);else{if(!a.opListReadCapability)throw t;a.opListReadCapability.reject(t)}}}))};r()}_abortOperatorList(t){let{intentState:e,reason:s,force:i=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!i){if(e.renderTasks.size>0)return;if(s instanceof _display_utils.RenderingCancelledException){let t=RENDERING_CANCELLED_TIMEOUT;return s.extraDelay>0&&s.extraDelay<1e3&&(t+=s.extraDelay),void(e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:s,force:!0})}),t))}}if(e.streamReader.cancel(new _util.AbortException(s.message)).catch((()=>{})),e.streamReader=null,!this._transport.destroyed){for(const[t,s]of this._intentStates)if(s===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}function _tryCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),!_classPrivateFieldGet(_pendingCleanup,this))return!1;if(t)return _classPrivateFieldSet(_delayedCleanupTimeout,this,setTimeout((()=>{_classPrivateFieldSet(_delayedCleanupTimeout,this,null),_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!1)}),DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:e,operatorList:s}of this._intentStates.values())if(e.size>0||!s.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),_classPrivateFieldSet(_pendingCleanup,this,!1),!0}function _abortDelayedCleanup(){_classPrivateFieldGet(_delayedCleanupTimeout,this)&&(clearTimeout(_classPrivateFieldGet(_delayedCleanupTimeout,this)),_classPrivateFieldSet(_delayedCleanupTimeout,this,null))}exports.PDFPageProxy=PDFPageProxy;var _listeners=new WeakMap,_deferred=new WeakMap;class LoopbackPort{constructor(){_classPrivateFieldInitSpec(this,_listeners,new Set),_classPrivateFieldInitSpec(this,_deferred,Promise.resolve())}postMessage(t,e){const s={data:structuredClone(t,e?{transfer:e}:null)};_classPrivateFieldGet(_deferred,this).then((()=>{for(const t of _classPrivateFieldGet(_listeners,this))t.call(this,s)}))}addEventListener(t,e){_classPrivateFieldGet(_listeners,this).add(e)}removeEventListener(t,e){_classPrivateFieldGet(_listeners,this).delete(e)}terminate(){_classPrivateFieldGet(_listeners,this).clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_is_node.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"===typeof document){var _document;const t=null===(_document=document)||void 0===_document||null===(_document=_document.currentScript)||void 0===_document?void 0:_document.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let s;try{if(s=new URL(t),!s.origin||"null"===s.origin)return!1}catch(n){return!1}const i=new URL(e,s);return s.origin===i.origin},PDFWorkerUtil.createCDNWrapper=function(t){const e='importScripts("'.concat(t,'");');return URL.createObjectURL(new Blob([e]))};class PDFWorker{constructor(){let{name:t=null,port:e=null,verbosity:s=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e&&_workerPorts._.has(e))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=t,this.destroyed=!1,this.verbosity=s,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,e)return _workerPorts._.set(e,this),void this._initializeFromPort(e);this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new _message_handler.MessageHandler("main","worker",t),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:e}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,e)||(e=PDFWorkerUtil.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),s=new _message_handler.MessageHandler("main","worker",t),i=()=>{t.removeEventListener("error",n),s.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},n=()=>{this._webWorker||i()};t.addEventListener("error",n),s.on("test",(e=>{t.removeEventListener("error",n),this.destroyed?i():e?(this._messageHandler=s,this._port=t,this._webWorker=t,this._readyCapability.resolve(),s.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),s.destroy(),t.terminate())})),s.on("ready",(e=>{if(t.removeEventListener("error",n),this.destroyed)i();else try{a()}catch(s){this._setupFakeWorker()}}));const a=()=>{const t=new Uint8Array;s.send("test",t,[t.buffer])};return void a()}catch(t){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new LoopbackPort;this._port=e;const s="fake".concat(PDFWorkerUtil.fakeWorkerId++),i=new _message_handler.MessageHandler(s+"_worker",s,e);t.setup(i,e);const n=new _message_handler.MessageHandler(s,s+"_worker",e);this._messageHandler=n,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})})).catch((t=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),_workerPorts._.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(null===t||void 0===t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return _assertClassBrand(PDFWorker,this,_workerPorts)._.has(t.port)?_assertClassBrand(PDFWorker,this,_workerPorts)._.get(t.port):new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var t;return(null===(t=globalThis.pdfjsWorker)||void 0===t?void 0:t.WorkerMessageHandler)||null}catch(e){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}var _workerPorts={_:new WeakMap};exports.PDFWorker=PDFWorker;var _methodPromises=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_WorkerTransport_brand=new WeakSet;class WorkerTransport{constructor(t,e,s,i,n){_classPrivateMethodInitSpec(this,_WorkerTransport_brand),_classPrivateFieldInitSpec(this,_methodPromises,new Map),_classPrivateFieldInitSpec(this,_pageCache,new Map),_classPrivateFieldInitSpec(this,_pagePromises,new Map),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this._params=i,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=s,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=_util.RenderingIntentFlag.DISPLAY,a=null;switch(t){case"any":n=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":n=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(t))}switch(e){case _util.AnnotationMode.DISABLE:n+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:n+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:n+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,a=(n&_util.RenderingIntentFlag.PRINT&&s instanceof _annotation_storage.PrintAnnotationStorage?s:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(e))}return i&&(n+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:n,cacheKey:"".concat(n,"_").concat(_annotation_storage.AnnotationStorage.getHash(a)),annotationStorageMap:a}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const s of _classPrivateFieldGet(_pageCache,this).values())t.push(s._destroy());_classPrivateFieldGet(_pageCache,this).clear(),_classPrivateFieldGet(_pagePromises,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),_classPrivateFieldGet(_methodPromises,this).clear(),this.filterFactory.destroy(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then((function(t){let{value:s,done:i}=t;i?e.close():((0,_util.assert)(s instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(s),1,[s]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(t=>{const s=new _util.PromiseCapability,i=this._fullReader;return i.headersReady.then((()=>{var t;i.isStreamingSupported&&i.isRangeSupported||(this._lastProgress&&(null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress)),i.onProgress=t=>{var s;null===(s=e.onProgress)||void 0===s||s.call(e,{loaded:t.loaded,total:t.total})});s.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})}),s.reject),s.promise})),t.on("GetRangeReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const s=this._networkStream.getRangeReader(t.begin,t.end);s?(e.onPull=()=>{s.read().then((function(t){let{value:s,done:i}=t;i?e.close():((0,_util.assert)(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(s),1,[s]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{s.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}):e.close()})),t.on("GetDoc",(t=>{let{pdfInfo:s}=t;this._numPages=s.numPages,this._htmlForXfa=s.htmlForXfa,delete s.htmlForXfa,e._capability.resolve(new PDFDocumentProxy(s,this))})),t.on("DocException",(function(t){let s;switch(t.name){case"PasswordException":s=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":s=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":s=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":s=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":s=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(s)})),t.on("PasswordRequest",(t=>{if(this._passwordCapability=new _util.PromiseCapability,e.onPassword){const i=t=>{t instanceof Error?this._passwordCapability.reject(t):this._passwordCapability.resolve({password:t})};try{e.onPassword(i,t.code)}catch(s){this._passwordCapability.reject(s)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise})),t.on("DataLoaded",(t=>{var s;null===(s=e.onProgress)||void 0===s||s.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{this.destroyed||_classPrivateFieldGet(_pageCache,this).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(e=>{var s;let[i,n,a]=e;if(!this.destroyed&&!this.commonObjs.has(i))switch(n){case"Font":const e=this._params;if("error"in a){const t=a.error;(0,_util.warn)("Error during font loading: ".concat(t)),this.commonObjs.resolve(i,t);break}const r=e.pdfBug&&null!==(s=globalThis.FontInspector)&&void 0!==s&&s.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,o=new _font_loader.FontFaceObject(a,{isEvalSupported:e.isEvalSupported,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,inspectFont:r});this.fontLoader.bind(o).catch((e=>t.sendWithPromise("FontFallback",{id:i}))).finally((()=>{!e.fontExtraProperties&&o.data&&(o.data=null),this.commonObjs.resolve(i,o)}));break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,a);break;default:throw new Error("Got unknown common object type ".concat(n))}})),t.on("obj",(t=>{let[e,s,i,n]=t;if(this.destroyed)return;const a=_classPrivateFieldGet(_pageCache,this).get(s);if(!a.objs.has(e))switch(i){case"Image":if(a.objs.resolve(e,n),n){let t;if(n.bitmap){const{width:e,height:s}=n;t=e*s*4}else{var r;t=(null===(r=n.data)||void 0===r?void 0:r.length)||0}t>_util.MAX_IMAGE_SIZE_TO_CACHE&&(a._maybeCleanupAfterRender=!0)}break;case"Pattern":a.objs.resolve(e,n);break;default:throw new Error("Got unknown object type ".concat(i))}})),t.on("DocProgress",(t=>{var s;this.destroyed||null===(s=e.onProgress)||void 0===s||s.call(e,{loaded:t.loaded,total:t.total})})),t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t,e;return this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null}).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,s=_classPrivateFieldGet(_pagePromises,this).get(e);if(s)return s;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((t=>{if(this.destroyed)throw new Error("Transport destroyed");const s=new PDFPageProxy(e,t,this,this._params.pdfBug);return _classPrivateFieldGet(_pageCache,this).set(e,s),s}));return _classPrivateFieldGet(_pagePromises,this).set(e,i),i}getPageIndex(t){return"object"!==typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return _assertClassBrand(_WorkerTransport_brand,this,_cacheSimpleMethod).call(this,"GetFieldObjects")}hasJSActions(){return _assertClassBrand(_WorkerTransport_brand,this,_cacheSimpleMethod).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!==typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((t=>new _optional_content_config.OptionalContentConfig(t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=_classPrivateFieldGet(_methodPromises,this).get(t);if(e)return e;const s=this.messageHandler.sendWithPromise(t,null).then((t=>{var e,s,i,n;return{info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:null!==(e=null===(s=this._fullReader)||void 0===s?void 0:s.filename)&&void 0!==e?e:null,contentLength:null!==(i=null===(n=this._fullReader)||void 0===n?void 0:n.contentLength)&&void 0!==i?i:null}}));return _classPrivateFieldGet(_methodPromises,this).set(t,s),s}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of _classPrivateFieldGet(_pageCache,this).values())if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."));this.commonObjs.clear(),t||this.fontLoader.clear(),_classPrivateFieldGet(_methodPromises,this).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:t,enableXfa:e}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:e})}}function _cacheSimpleMethod(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const s=_classPrivateFieldGet(_methodPromises,this).get(t);if(s)return s;const i=this.messageHandler.sendWithPromise(t,e);return _classPrivateFieldGet(_methodPromises,this).set(t,i),i}var _objs=new WeakMap,_PDFObjects_brand=new WeakSet;class PDFObjects{constructor(){_classPrivateMethodInitSpec(this,_PDFObjects_brand),_classPrivateFieldInitSpec(this,_objs,Object.create(null))}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const s=_assertClassBrand(_PDFObjects_brand,this,_ensureObj).call(this,t);return s.capability.promise.then((()=>e(s.data))),null}const s=_classPrivateFieldGet(_objs,this)[t];if(null===s||void 0===s||!s.capability.settled)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return s.data}has(t){const e=_classPrivateFieldGet(_objs,this)[t];return(null===e||void 0===e?void 0:e.capability.settled)||!1}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const s=_assertClassBrand(_PDFObjects_brand,this,_ensureObj).call(this,t);s.data=e,s.capability.resolve()}clear(){for(const e in _classPrivateFieldGet(_objs,this)){var t;const{data:s}=_classPrivateFieldGet(_objs,this)[e];null===s||void 0===s||null===(t=s.bitmap)||void 0===t||t.close()}_classPrivateFieldSet(_objs,this,Object.create(null))}}function _ensureObj(t){const e=_classPrivateFieldGet(_objs,this)[t];return e||(_classPrivateFieldGet(_objs,this)[t]={capability:new _util.PromiseCapability,data:null})}var _internalRenderTask=new WeakMap;class RenderTask{constructor(t){_classPrivateFieldInitSpec(this,_internalRenderTask,null),_classPrivateFieldSet(_internalRenderTask,this,t),this.onContinue=null}get promise(){return _classPrivateFieldGet(_internalRenderTask,this).capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;_classPrivateFieldGet(_internalRenderTask,this).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=_classPrivateFieldGet(_internalRenderTask,this).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=_classPrivateFieldGet(_internalRenderTask,this);return t.form||t.canvas&&(null===e||void 0===e?void 0:e.size)>0}}exports.RenderTask=RenderTask;class InternalRenderTask{constructor(t){let{callback:e,params:s,objs:i,commonObjs:n,annotationCanvasMap:a,operatorList:r,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:h=!1,pageColors:u=null}=t;this.callback=e,this.params=s,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=h,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===d&&"undefined"!==typeof window,this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=s.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){var e,s;let{transparency:i=!1,optionalContentConfig:n}=t;if(this.cancelled)return;if(this._canvas){if(_canvasInUse._.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");_canvasInUse._.add(this._canvas)}this._pdfBug&&null!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:a,viewport:r,transform:o,background:l}=this.params;this.gfx=new _canvas.CanvasGraphics(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:r,transparency:i,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null===(s=this.graphicsReadyCallback)||void 0===s||s.call(this)}cancel(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(t=this.gfx)||void 0===t||t.endDrawing(),this._canvas&&_canvasInUse._.delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),"canvas",s))}operatorListChanged(){var t;this.graphicsReady?(null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(this.pageColors),this._canvas&&_canvasInUse._.delete(this._canvas),this.callback())))}}var _canvasInUse={_:new WeakSet};const version="3.6.172";exports.version=version;const build="4d3dfe254";exports.build=build},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var i=s(1),n=s(4),a=s(8),r=new WeakMap,o=new WeakMap,l=new WeakSet;class c{constructor(){_classPrivateMethodInitSpec(this,l),_classPrivateFieldInitSpec(this,r,!1),_classPrivateFieldInitSpec(this,o,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const s=_classPrivateFieldGet(o,this).get(t);return void 0===s?e:Object.assign(e,s)}getRawValue(t){return _classPrivateFieldGet(o,this).get(t)}remove(t){if(_classPrivateFieldGet(o,this).delete(t),0===_classPrivateFieldGet(o,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const t of _classPrivateFieldGet(o,this).values())if(t instanceof n.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){const s=_classPrivateFieldGet(o,this).get(t);let i=!1;if(void 0!==s)for(const[n,a]of Object.entries(e))s[n]!==a&&(i=!0,s[n]=a);else i=!0,_classPrivateFieldGet(o,this).set(t,e);i&&_assertClassBrand(l,this,d).call(this),e instanceof n.AnnotationEditor&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return _classPrivateFieldGet(o,this).has(t)}getAll(){return _classPrivateFieldGet(o,this).size>0?(0,i.objectFromMap)(_classPrivateFieldGet(o,this)):null}setAll(t){for(const[e,s]of Object.entries(t))this.setValue(e,s)}get size(){return _classPrivateFieldGet(o,this).size}resetModified(){_classPrivateFieldGet(r,this)&&(_classPrivateFieldSet(r,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new u(this)}get serializable(){if(0===_classPrivateFieldGet(o,this).size)return null;const t=new Map;for(const[e,s]of _classPrivateFieldGet(o,this)){const i=s instanceof n.AnnotationEditor?s.serialize():s;i&&t.set(e,i)}return t}static getHash(t){if(!t)return"";const e=new a.MurmurHash3_64;for(const[s,i]of t)e.update("".concat(s,":").concat(JSON.stringify(i)));return e.hexdigest()}}function d(){_classPrivateFieldGet(r,this)||(_classPrivateFieldSet(r,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}e.AnnotationStorage=c;var h=new WeakMap;class u extends c{constructor(t){super(),_classPrivateFieldInitSpec(this,h,null),_classPrivateFieldSet(h,this,structuredClone(t.serializable))}get print(){(0,i.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return _classPrivateFieldGet(h,this)}}e.PrintAnnotationStorage=u},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditor=void 0;var i=s(5),n=s(1),a=new WeakMap,r=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap;class h{constructor(t){_classPrivateFieldInitSpec(this,a,this.focusin.bind(this)),_classPrivateFieldInitSpec(this,r,this.focusout.bind(this)),_classPrivateFieldInitSpec(this,o,!1),_classPrivateFieldInitSpec(this,l,!1),_classPrivateFieldInitSpec(this,c,!1),_defineProperty(this,"_uiManager",null),_classPrivateFieldInitSpec(this,d,h._zIndex++),this.constructor===h&&(0,n.unreachable)("Cannot initialize AnnotationEditor."),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;const{rotation:e,rawDims:{pageWidth:s,pageHeight:i,pageX:u,pageY:p}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[s,i],this.pageTranslation=[u,p];const[f,g]=this.parentDimensions;this.x=t.x/f,this.y=t.y/g,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,n.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=_classPrivateFieldGet(d,this)}setParent(t){null!==t&&(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions),this.parent=t}focusin(t){_classPrivateFieldGet(o,this)?_classPrivateFieldSet(o,this,!1):this.parent.setSelected(this)}focusout(t){var e;if(!this.isAttachedToDOM)return;const s=t.relatedTarget;null!==s&&void 0!==s&&s.closest("#".concat(this.id))||(t.preventDefault(),null!==(e=this.parent)&&void 0!==e&&e.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(t){const e=this.parent.div.getBoundingClientRect();this.startX=t.clientX-e.x,this.startY=t.clientY-e.y,t.dataTransfer.setData("text/plain",this.id),t.dataTransfer.effectAllowed="move"}setAt(t,e,s,i){const[n,a]=this.parentDimensions;[s,i]=this.screenToPageTranslation(s,i),this.x=(t+s)/n,this.y=(e+i)/a,this.div.style.left="".concat(100*this.x,"%"),this.div.style.top="".concat(100*this.y,"%")}translate(t,e){const[s,i]=this.parentDimensions;[t,e]=this.screenToPageTranslation(t,e),this.x+=t/s,this.y+=e/i,this.div.style.left="".concat(100*this.x,"%"),this.div.style.top="".concat(100*this.y,"%")}screenToPageTranslation(t,e){switch(this.parentRotation){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{realScale:t}=this._uiManager.viewParameters,[e,s]=this.pageDimensions;return[e*t,s*t]}setDims(t,e){const[s,i]=this.parentDimensions;this.div.style.width="".concat(100*t/s,"%"),this.div.style.height="".concat(100*e/i,"%")}fixDims(){const{style:t}=this.div,{height:e,width:s}=t,i=s.endsWith("%"),n=e.endsWith("%");if(i&&n)return;const[a,r]=this.parentDimensions;i||(t.width="".concat(100*parseFloat(s)/a,"%")),n||(t.height="".concat(100*parseFloat(e)/r,"%"))}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",_classPrivateFieldGet(a,this)),this.div.addEventListener("focusout",_classPrivateFieldGet(r,this));const[t,e]=this.getInitialTranslation();return this.translate(t,e),(0,i.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(t){const{isMac:e}=n.FeatureTest.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this),_classPrivateFieldSet(o,this,!0))}getRect(t,e){const s=this.parentScale,[i,n]=this.pageDimensions,[a,r]=this.pageTranslation,o=t/s,l=e/s,c=this.x*i,d=this.y*n,h=this.width*i,u=this.height*n;switch(this.rotation){case 0:return[c+o+a,n-d-l-u+r,c+o+h+a,n-d-l+r];case 90:return[c+l+a,n-d+o+r,c+l+u+a,n-d+o+h+r];case 180:return[c-o-h+a,n-d+l+r,c-o+a,n-d+l+u+r];case 270:return[c-l-u+a,n-d-o-h+r,c-l+a,n-d-o+r];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[s,i,n,a]=t,r=n-s,o=a-i;switch(this.rotation){case 0:return[s,e-a,r,o];case 90:return[s,e-i,o,r];case 180:return[n,e-i,r,o];case 270:return[n,e-a,o,r];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){_classPrivateFieldSet(c,this,!0)}disableEditMode(){_classPrivateFieldSet(c,this,!1)}isInEditMode(){return _classPrivateFieldGet(c,this)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t;null===(t=this.div)||void 0===t||t.addEventListener("focusin",_classPrivateFieldGet(a,this))}serialize(){(0,n.unreachable)("An editor must be serializable")}static deserialize(t,e,s){const i=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:s});i.rotation=t.rotation;const[n,a]=i.pageDimensions,[r,o,l,c]=i.getRectInCurrentCoords(t.rect,a);return i.x=r/n,i.y=o/a,i.width=l/n,i.height=c/a,i}remove(){this.div.removeEventListener("focusin",_classPrivateFieldGet(a,this)),this.div.removeEventListener("focusout",_classPrivateFieldGet(r,this)),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){var t;null===(t=this.div)||void 0===t||t.classList.add("selectedEditor")}unselect(){var t;null===(t=this.div)||void 0===t||t.classList.remove("selectedEditor")}updateParams(t,e){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return _classPrivateFieldGet(l,this)}set isEditing(t){_classPrivateFieldSet(l,this,t),t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}}_defineProperty(h,"_colorManager",new i.ColorManager),_defineProperty(h,"_zIndex",1),e.AnnotationEditor=h},(t,e,s)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0,e.bindEvents=function(t,e,s){for(const i of s)e.addEventListener(i,t[i].bind(t))},e.opacityToHex=function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};var n=s(1),a=s(6),r=new WeakMap;class o{constructor(){_classPrivateFieldInitSpec(this,r,0)}getId(){var t,e;return"".concat(n.AnnotationEditorPrefix).concat((_classPrivateFieldSet(r,this,(t=_classPrivateFieldGet(r,this),e=t++,t)),e))}}var l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap;class u{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;_classPrivateFieldInitSpec(this,l,[]),_classPrivateFieldInitSpec(this,c,!1),_classPrivateFieldInitSpec(this,d,void 0),_classPrivateFieldInitSpec(this,h,-1),_classPrivateFieldSet(d,this,t)}add(t){let{cmd:e,undo:s,mustExec:i,type:n=NaN,overwriteIfSameType:a=!1,keepUndo:r=!1}=t;if(i&&e(),_classPrivateFieldGet(c,this))return;const o={cmd:e,undo:s,type:n};if(-1===_classPrivateFieldGet(h,this))return _classPrivateFieldGet(l,this).length>0&&(_classPrivateFieldGet(l,this).length=0),_classPrivateFieldSet(h,this,0),void _classPrivateFieldGet(l,this).push(o);if(a&&_classPrivateFieldGet(l,this)[_classPrivateFieldGet(h,this)].type===n)return r&&(o.undo=_classPrivateFieldGet(l,this)[_classPrivateFieldGet(h,this)].undo),void(_classPrivateFieldGet(l,this)[_classPrivateFieldGet(h,this)]=o);const u=_classPrivateFieldGet(h,this)+1;u===_classPrivateFieldGet(d,this)?_classPrivateFieldGet(l,this).splice(0,1):(_classPrivateFieldSet(h,this,u),u<_classPrivateFieldGet(l,this).length&&_classPrivateFieldGet(l,this).splice(u)),_classPrivateFieldGet(l,this).push(o)}undo(){-1!==_classPrivateFieldGet(h,this)&&(_classPrivateFieldSet(c,this,!0),_classPrivateFieldGet(l,this)[_classPrivateFieldGet(h,this)].undo(),_classPrivateFieldSet(c,this,!1),_classPrivateFieldSet(h,this,_classPrivateFieldGet(h,this)-1))}redo(){_classPrivateFieldGet(h,this)<_classPrivateFieldGet(l,this).length-1&&(_classPrivateFieldSet(h,this,_classPrivateFieldGet(h,this)+1),_classPrivateFieldSet(c,this,!0),_classPrivateFieldGet(l,this)[_classPrivateFieldGet(h,this)].cmd(),_classPrivateFieldSet(c,this,!1))}hasSomethingToUndo(){return-1!==_classPrivateFieldGet(h,this)}hasSomethingToRedo(){return _classPrivateFieldGet(h,this)<_classPrivateFieldGet(l,this).length-1}destroy(){_classPrivateFieldSet(l,this,null)}}e.CommandManager=u;var p=new WeakSet;class f{constructor(t){_classPrivateMethodInitSpec(this,p),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=n.FeatureTest.platform;for(const[s,i]of t)for(const t of s){const s=t.startsWith("mac+");e&&s?(this.callbacks.set(t.slice(4),i),this.allKeys.add(t.split("+").at(-1))):e||s||(this.callbacks.set(t,i),this.allKeys.add(t.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const s=this.callbacks.get(_assertClassBrand(p,this,g).call(this,e));s&&(s.bind(t)(),e.stopPropagation(),e.preventDefault())}}function g(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}e.KeyboardManager=f;class m{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return(0,a.getColorValues)(t),(0,n.shadow)(this,"_colors",t)}convert(t){const e=(0,a.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[s,i]of this._colors)if(i.every(((t,s)=>t===e[s])))return m._colorsMapping.get(s);return e}getHexCode(t){const e=this._colors.get(t);return e?n.Util.makeHexColor(...e):t}}_defineProperty(m,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]])),e.ColorManager=m;var _=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,A=new WeakMap,P=new WeakMap,S=new WeakMap,F=new WeakMap,x=new WeakMap,C=new WeakMap,w=new WeakMap,E=new WeakMap,k=new WeakMap,T=new WeakMap,M=new WeakMap,R=new WeakMap,I=new WeakMap,D=new WeakMap,O=new WeakMap,L=new WeakMap,G=new WeakMap,N=new WeakMap,B=new WeakMap,j=new WeakSet;class W{constructor(t,e,s){_classPrivateMethodInitSpec(this,j),_classPrivateFieldInitSpec(this,_,null),_classPrivateFieldInitSpec(this,v,new Map),_classPrivateFieldInitSpec(this,b,new Map),_classPrivateFieldInitSpec(this,y,null),_classPrivateFieldInitSpec(this,A,new u),_classPrivateFieldInitSpec(this,P,0),_classPrivateFieldInitSpec(this,S,null),_classPrivateFieldInitSpec(this,F,new Set),_classPrivateFieldInitSpec(this,x,null),_classPrivateFieldInitSpec(this,C,new o),_classPrivateFieldInitSpec(this,w,!1),_classPrivateFieldInitSpec(this,E,n.AnnotationEditorType.NONE),_classPrivateFieldInitSpec(this,k,new Set),_classPrivateFieldInitSpec(this,T,this.copy.bind(this)),_classPrivateFieldInitSpec(this,M,this.cut.bind(this)),_classPrivateFieldInitSpec(this,R,this.paste.bind(this)),_classPrivateFieldInitSpec(this,I,this.keydown.bind(this)),_classPrivateFieldInitSpec(this,D,this.onEditingAction.bind(this)),_classPrivateFieldInitSpec(this,O,this.onPageChanging.bind(this)),_classPrivateFieldInitSpec(this,L,this.onScaleChanging.bind(this)),_classPrivateFieldInitSpec(this,G,this.onRotationChanging.bind(this)),_classPrivateFieldInitSpec(this,N,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}),_classPrivateFieldInitSpec(this,B,null),_classPrivateFieldSet(B,this,t),_classPrivateFieldSet(x,this,e),_classPrivateFieldGet(x,this)._on("editingaction",_classPrivateFieldGet(D,this)),_classPrivateFieldGet(x,this)._on("pagechanging",_classPrivateFieldGet(O,this)),_classPrivateFieldGet(x,this)._on("scalechanging",_classPrivateFieldGet(L,this)),_classPrivateFieldGet(x,this)._on("rotationchanging",_classPrivateFieldGet(G,this)),_classPrivateFieldSet(y,this,s),this.viewParameters={realScale:a.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){_assertClassBrand(j,this,q).call(this),_classPrivateFieldGet(x,this)._off("editingaction",_classPrivateFieldGet(D,this)),_classPrivateFieldGet(x,this)._off("pagechanging",_classPrivateFieldGet(O,this)),_classPrivateFieldGet(x,this)._off("scalechanging",_classPrivateFieldGet(L,this)),_classPrivateFieldGet(x,this)._off("rotationchanging",_classPrivateFieldGet(G,this));for(const t of _classPrivateFieldGet(b,this).values())t.destroy();_classPrivateFieldGet(b,this).clear(),_classPrivateFieldGet(v,this).clear(),_classPrivateFieldGet(F,this).clear(),_classPrivateFieldSet(_,this,null),_classPrivateFieldGet(k,this).clear(),_classPrivateFieldGet(A,this).destroy()}onPageChanging(t){let{pageNumber:e}=t;_classPrivateFieldSet(P,this,e-1)}focusMainContainer(){_classPrivateFieldGet(B,this).focus()}addShouldRescale(t){_classPrivateFieldGet(F,this).add(t)}removeShouldRescale(t){_classPrivateFieldGet(F,this).delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove(),this.viewParameters.realScale=e*a.PixelsPerInch.PDF_TO_CSS_UNITS;for(const s of _classPrivateFieldGet(F,this))s.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}addToAnnotationStorage(t){t.isEmpty()||!_classPrivateFieldGet(y,this)||_classPrivateFieldGet(y,this).has(t.id)||_classPrivateFieldGet(y,this).setValue(t.id,t)}copy(t){if(t.preventDefault(),_classPrivateFieldGet(_,this)&&_classPrivateFieldGet(_,this).commitOrRemove(),!this.hasSelection)return;const e=[];for(const s of _classPrivateFieldGet(k,this))s.isEmpty()||e.push(s.serialize());0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();let e=t.clipboardData.getData("application/pdfjs");if(!e)return;try{e=JSON.parse(e)}catch(i){return void(0,n.warn)('paste: "'.concat(i.message,'".'))}if(!Array.isArray(e))return;this.unselectAll();const s=_classPrivateFieldGet(b,this).get(_classPrivateFieldGet(P,this));try{const t=[];for(const a of e){const e=s.deserialize(a);if(!e)return;t.push(e)}const i=()=>{for(const e of t)_assertClassBrand(j,this,J).call(this,e);_assertClassBrand(j,this,Z).call(this,t)},n=()=>{for(const e of t)e.remove()};this.addCommands({cmd:i,undo:n,mustExec:!0})}catch(i){(0,n.warn)('paste: "'.concat(i.message,'".'))}}keydown(t){var e;null!==(e=this.getActive())&&void 0!==e&&e.shouldGetKeyboardEvents()||W._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}setEditingState(t){t?(_assertClassBrand(j,this,U).call(this),_assertClassBrand(j,this,H).call(this),_assertClassBrand(j,this,z).call(this,{isEditing:_classPrivateFieldGet(E,this)!==n.AnnotationEditorType.NONE,isEmpty:_assertClassBrand(j,this,Q).call(this),hasSomethingToUndo:_classPrivateFieldGet(A,this).hasSomethingToUndo(),hasSomethingToRedo:_classPrivateFieldGet(A,this).hasSomethingToRedo(),hasSelectedEditor:!1})):(_assertClassBrand(j,this,q).call(this),_assertClassBrand(j,this,V).call(this),_assertClassBrand(j,this,z).call(this,{isEditing:!1}))}registerEditorTypes(t){if(!_classPrivateFieldGet(S,this)){_classPrivateFieldSet(S,this,t);for(const t of _classPrivateFieldGet(S,this))_assertClassBrand(j,this,X).call(this,t.defaultPropertiesToUpdate)}}getId(){return _classPrivateFieldGet(C,this).getId()}get currentLayer(){return _classPrivateFieldGet(b,this).get(_classPrivateFieldGet(P,this))}get currentPageIndex(){return _classPrivateFieldGet(P,this)}addLayer(t){_classPrivateFieldGet(b,this).set(t.pageIndex,t),_classPrivateFieldGet(w,this)?t.enable():t.disable()}removeLayer(t){_classPrivateFieldGet(b,this).delete(t.pageIndex)}updateMode(t){if(_classPrivateFieldSet(E,this,t),t===n.AnnotationEditorType.NONE)this.setEditingState(!1),_assertClassBrand(j,this,K).call(this);else{this.setEditingState(!0),_assertClassBrand(j,this,Y).call(this);for(const e of _classPrivateFieldGet(b,this).values())e.updateMode(t)}}updateToolbar(t){t!==_classPrivateFieldGet(E,this)&&_classPrivateFieldGet(x,this).dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(_classPrivateFieldGet(S,this)){for(const s of _classPrivateFieldGet(k,this))s.updateParams(t,e);for(const s of _classPrivateFieldGet(S,this))s.updateDefaultParams(t,e)}}getEditors(t){const e=[];for(const s of _classPrivateFieldGet(v,this).values())s.pageIndex===t&&e.push(s);return e}getEditor(t){return _classPrivateFieldGet(v,this).get(t)}addEditor(t){_classPrivateFieldGet(v,this).set(t.id,t)}removeEditor(t){var e;_classPrivateFieldGet(v,this).delete(t.id),this.unselect(t),null===(e=_classPrivateFieldGet(y,this))||void 0===e||e.remove(t.id)}setActiveEditor(t){_classPrivateFieldGet(_,this)!==t&&(_classPrivateFieldSet(_,this,t),t&&_assertClassBrand(j,this,X).call(this,t.propertiesToUpdate))}toggleSelected(t){if(_classPrivateFieldGet(k,this).has(t))return _classPrivateFieldGet(k,this).delete(t),t.unselect(),void _assertClassBrand(j,this,z).call(this,{hasSelectedEditor:this.hasSelection});_classPrivateFieldGet(k,this).add(t),t.select(),_assertClassBrand(j,this,X).call(this,t.propertiesToUpdate),_assertClassBrand(j,this,z).call(this,{hasSelectedEditor:!0})}setSelected(t){for(const e of _classPrivateFieldGet(k,this))e!==t&&e.unselect();_classPrivateFieldGet(k,this).clear(),_classPrivateFieldGet(k,this).add(t),t.select(),_assertClassBrand(j,this,X).call(this,t.propertiesToUpdate),_assertClassBrand(j,this,z).call(this,{hasSelectedEditor:!0})}isSelected(t){return _classPrivateFieldGet(k,this).has(t)}unselect(t){t.unselect(),_classPrivateFieldGet(k,this).delete(t),_assertClassBrand(j,this,z).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==_classPrivateFieldGet(k,this).size}undo(){_classPrivateFieldGet(A,this).undo(),_assertClassBrand(j,this,z).call(this,{hasSomethingToUndo:_classPrivateFieldGet(A,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:_assertClassBrand(j,this,Q).call(this)})}redo(){_classPrivateFieldGet(A,this).redo(),_assertClassBrand(j,this,z).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:_classPrivateFieldGet(A,this).hasSomethingToRedo(),isEmpty:_assertClassBrand(j,this,Q).call(this)})}addCommands(t){_classPrivateFieldGet(A,this).add(t),_assertClassBrand(j,this,z).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:_assertClassBrand(j,this,Q).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[..._classPrivateFieldGet(k,this)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)_assertClassBrand(j,this,J).call(this,e)},mustExec:!0})}commitOrRemove(){var t;null===(t=_classPrivateFieldGet(_,this))||void 0===t||t.commitOrRemove()}selectAll(){for(const t of _classPrivateFieldGet(k,this))t.commit();_assertClassBrand(j,this,Z).call(this,_classPrivateFieldGet(v,this).values())}unselectAll(){if(_classPrivateFieldGet(_,this))_classPrivateFieldGet(_,this).commitOrRemove();else if(0!==_classPrivateFieldGet(k,this).size){for(const t of _classPrivateFieldGet(k,this))t.unselect();_classPrivateFieldGet(k,this).clear(),_assertClassBrand(j,this,z).call(this,{hasSelectedEditor:!1})}}isActive(t){return _classPrivateFieldGet(_,this)===t}getActive(){return _classPrivateFieldGet(_,this)}getMode(){return _classPrivateFieldGet(E,this)}}function U(){_classPrivateFieldGet(B,this).addEventListener("keydown",_classPrivateFieldGet(I,this))}function q(){_classPrivateFieldGet(B,this).removeEventListener("keydown",_classPrivateFieldGet(I,this))}function H(){document.addEventListener("copy",_classPrivateFieldGet(T,this)),document.addEventListener("cut",_classPrivateFieldGet(M,this)),document.addEventListener("paste",_classPrivateFieldGet(R,this))}function V(){document.removeEventListener("copy",_classPrivateFieldGet(T,this)),document.removeEventListener("cut",_classPrivateFieldGet(M,this)),document.removeEventListener("paste",_classPrivateFieldGet(R,this))}function z(t){Object.entries(t).some((t=>{let[e,s]=t;return _classPrivateFieldGet(N,this)[e]!==s}))&&_classPrivateFieldGet(x,this).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(_classPrivateFieldGet(N,this),t)})}function X(t){_classPrivateFieldGet(x,this).dispatch("annotationeditorparamschanged",{source:this,details:t})}function Y(){if(!_classPrivateFieldGet(w,this)){_classPrivateFieldSet(w,this,!0);for(const t of _classPrivateFieldGet(b,this).values())t.enable()}}function K(){if(this.unselectAll(),_classPrivateFieldGet(w,this)){_classPrivateFieldSet(w,this,!1);for(const t of _classPrivateFieldGet(b,this).values())t.disable()}}function J(t){const e=_classPrivateFieldGet(b,this).get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}function Q(){if(0===_classPrivateFieldGet(v,this).size)return!0;if(1===_classPrivateFieldGet(v,this).size)for(const t of _classPrivateFieldGet(v,this).values())return t.isEmpty();return!1}function Z(t){_classPrivateFieldGet(k,this).clear();for(const e of t)e.isEmpty()||(_classPrivateFieldGet(k,this).add(e),e.select());_assertClassBrand(j,this,z).call(this,{hasSelectedEditor:!0})}_defineProperty(W,"_keyboardManager",new f([[["ctrl+a","mac+meta+a"],(i=W).prototype.selectAll],[["ctrl+z","mac+meta+z"],i.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],i.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],i.prototype.delete],[["Escape","mac+Escape"],i.prototype.unselectAll]])),e.AnnotationEditorUIManager=W},(t,e,s)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMFilterFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=e.AnnotationPrefix=void 0,e.deprecated=function(t){console.log("Deprecated API usage: "+t)},e.getColorValues=function(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const s of t.keys()){e.style.color=s;const i=window.getComputedStyle(e).color;t.set(s,M(i))}e.remove()},e.getCurrentTransform=function(t){const{a:e,b:s,c:i,d:n,e:a,f:r}=t.getTransform();return[e,s,i,n,a,r]},e.getCurrentTransformInverse=function(t){const{a:e,b:s,c:i,d:n,e:a,f:r}=t.getTransform().invertSelf();return[e,s,i,n,a,r]},e.getFilenameFromUrl=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||([t]=t.split(/[#?]/,1)),t.substring(t.lastIndexOf("/")+1)},e.getPdfFilenameFromUrl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(E(t))return(0,a.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const s=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let n=s.exec(i[1])||s.exec(i[2])||s.exec(i[3]);if(n&&(n=n[0],n.includes("%")))try{n=s.exec(decodeURIComponent(n))[0]}catch(r){}return n||e},e.getRGB=M,e.getXfaPageViewport=function(t,e){let{scale:s=1,rotation:i=0}=e;const{width:n,height:a}=t.attributes.style,r=[0,0,parseInt(n),parseInt(a)];return new C({viewBox:r,scale:s,rotation:i})},e.isDataScheme=E,e.isPdfFile=function(t){return"string"===typeof t&&/\.pdf$/i.test(t)},e.isValidFetchUrl=k,e.loadScript=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(((s,i)=>{const n=document.createElement("script");n.src=t,n.onload=function(t){e&&n.remove(),s(t)},n.onerror=function(){i(new Error("Cannot load script at: ".concat(n.src)))},(document.head||document.documentElement).append(n)}))},e.setLayerDimensions=function(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof C){const{pageWidth:i,pageHeight:n}=e.rawDims,{style:a}=t,r="calc(var(--scale-factor) * ".concat(i,"px)"),o="calc(var(--scale-factor) * ".concat(n,"px)");s&&e.rotation%180!==0?(a.width=o,a.height=r):(a.width=r,a.height=o)}i&&t.setAttribute("data-main-rotation",e.rotation)};var n=s(7),a=s(1);const r="http://www.w3.org/2000/svg";e.AnnotationPrefix="pdfjs_internal_id_";class o{}i=o,_defineProperty(o,"CSS",96),_defineProperty(o,"PDF",72),_defineProperty(o,"PDF_TO_CSS_UNITS",i.CSS/i.PDF),e.PixelsPerInch=o;var l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,m=new WeakSet;class _ extends n.BaseFilterFactory{constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),_classPrivateMethodInitSpec(this,m),_classPrivateFieldInitSpec(this,l,void 0),_classPrivateFieldInitSpec(this,c,void 0),_classPrivateFieldInitSpec(this,d,void 0),_classPrivateFieldInitSpec(this,h,void 0),_classPrivateFieldInitSpec(this,u,void 0),_classPrivateFieldInitSpec(this,p,void 0),_classPrivateFieldInitSpec(this,f,void 0),_classPrivateFieldInitSpec(this,g,0),_classPrivateFieldSet(d,this,t),_classPrivateFieldSet(h,this,e)}addFilter(t){var e,s;if(!t)return"none";let i,n,a,o,l=_classPrivateGetter(m,this,v).get(t);if(l)return l;if(1===t.length){const e=t[0],s=new Array(256);for(let t=0;t<256;t++)s[t]=e[t]/255;o=i=n=a=s.join(",")}else{const[e,s,r]=t,l=new Array(256),c=new Array(256),d=new Array(256);for(let t=0;t<256;t++)l[t]=e[t]/255,c[t]=s[t]/255,d[t]=r[t]/255;i=l.join(","),n=c.join(","),a=d.join(","),o="".concat(i).concat(n).concat(a)}if(l=_classPrivateGetter(m,this,v).get(o),l)return _classPrivateGetter(m,this,v).set(t,l),l;const c="g_".concat(_classPrivateFieldGet(d,this),"_transfer_map_").concat((_classPrivateFieldSet(g,this,(e=_classPrivateFieldGet(g,this),s=e++,e)),s)),u="url(#".concat(c,")");_classPrivateGetter(m,this,v).set(t,u),_classPrivateGetter(m,this,v).set(o,u);const p=_classPrivateFieldGet(h,this).createElementNS(r,"filter",r);p.setAttribute("id",c),p.setAttribute("color-interpolation-filters","sRGB");const f=_classPrivateFieldGet(h,this).createElementNS(r,"feComponentTransfer");return p.append(f),_assertClassBrand(m,this,y).call(this,f,"feFuncR",i),_assertClassBrand(m,this,y).call(this,f,"feFuncG",n),_assertClassBrand(m,this,y).call(this,f,"feFuncB",a),_classPrivateGetter(m,this,b).append(p),u}addHCMFilter(t,e){var s;const i="".concat(t,"-").concat(e);if(_classPrivateFieldGet(p,this)===i)return _classPrivateFieldGet(f,this);if(_classPrivateFieldSet(p,this,i),_classPrivateFieldSet(f,this,"none"),null===(s=_classPrivateFieldGet(u,this))||void 0===s||s.remove(),!t||!e)return _classPrivateFieldGet(f,this);_classPrivateGetter(m,this,b).style.color=t;const n=M(t=getComputedStyle(_classPrivateGetter(m,this,b)).getPropertyValue("color"));t=a.Util.makeHexColor(...n),_classPrivateGetter(m,this,b).style.color=e;const o=M(e=getComputedStyle(_classPrivateGetter(m,this,b)).getPropertyValue("color"));if(e=a.Util.makeHexColor(...o),_classPrivateGetter(m,this,b).style.color="","#000000"===t&&"#ffffff"===e||t===e)return _classPrivateFieldGet(f,this);const l=new Array(256);for(let a=0;a<=255;a++){const t=a/255;l[a]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const c=l.join(","),g="g_".concat(_classPrivateFieldGet(d,this),"_hcm_filter"),_=_classPrivateFieldSet(u,this,_classPrivateFieldGet(h,this).createElementNS(r,"filter",r));_.setAttribute("id",g),_.setAttribute("color-interpolation-filters","sRGB");let v=_classPrivateFieldGet(h,this).createElementNS(r,"feComponentTransfer");_.append(v),_assertClassBrand(m,this,y).call(this,v,"feFuncR",c),_assertClassBrand(m,this,y).call(this,v,"feFuncG",c),_assertClassBrand(m,this,y).call(this,v,"feFuncB",c);const A=_classPrivateFieldGet(h,this).createElementNS(r,"feColorMatrix");A.setAttribute("type","matrix"),A.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"),_.append(A),v=_classPrivateFieldGet(h,this).createElementNS(r,"feComponentTransfer"),_.append(v);const P=(t,e)=>{const s=n[t]/255,i=o[t]/255,a=new Array(e+1);for(let n=0;n<=e;n++)a[n]=s+n/e*(i-s);return a.join(",")};return _assertClassBrand(m,this,y).call(this,v,"feFuncR",P(0,5)),_assertClassBrand(m,this,y).call(this,v,"feFuncG",P(1,5)),_assertClassBrand(m,this,y).call(this,v,"feFuncB",P(2,5)),_classPrivateGetter(m,this,b).append(_),_classPrivateFieldSet(f,this,"url(#".concat(g,")")),_classPrivateFieldGet(f,this)}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&_classPrivateFieldGet(f,this)||(_classPrivateFieldGet(c,this)&&(_classPrivateFieldGet(c,this).parentNode.parentNode.remove(),_classPrivateFieldSet(c,this,null)),_classPrivateFieldGet(l,this)&&(_classPrivateFieldGet(l,this).clear(),_classPrivateFieldSet(l,this,null)),_classPrivateFieldSet(g,this,0))}}function v(t){return _classPrivateFieldGet(l,t)||_classPrivateFieldSet(l,t,new Map)}function b(t){if(!_classPrivateFieldGet(c,t)){const e=_classPrivateFieldGet(h,t).createElement("div"),{style:s}=e;s.visibility="hidden",s.contain="strict",s.width=s.height=0,s.position="absolute",s.top=s.left=0,s.zIndex=-1;const i=_classPrivateFieldGet(h,t).createElementNS(r,"svg");i.setAttribute("width",0),i.setAttribute("height",0),_classPrivateFieldSet(c,t,_classPrivateFieldGet(h,t).createElementNS(r,"defs")),e.append(i),i.append(_classPrivateFieldGet(c,t)),_classPrivateFieldGet(h,t).body.append(e)}return _classPrivateFieldGet(c,t)}function y(t,e,s){const i=_classPrivateFieldGet(h,this).createElementNS(r,e);i.setAttribute("type","discrete"),i.setAttribute("tableValues",s),t.append(i)}e.DOMFilterFactory=_;class A extends n.BaseCanvasFactory{constructor(){let{ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=t}_createCanvas(t,e){const s=this._document.createElement("canvas");return s.width=t,s.height=e,s}}async function P(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(k(t,document.baseURI)){const s=await fetch(t);if(!s.ok)throw new Error(s.statusText);return e?new Uint8Array(await s.arrayBuffer()):(0,a.stringToBytes)(await s.text())}return new Promise(((s,i)=>{const n=new XMLHttpRequest;n.open("GET",t,!0),e&&(n.responseType="arraybuffer"),n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(200===n.status||0===n.status){let t;if(e&&n.response?t=new Uint8Array(n.response):!e&&n.responseText&&(t=(0,a.stringToBytes)(n.responseText)),t)return void s(t)}i(new Error(n.statusText))}},n.send(null)}))}e.DOMCanvasFactory=A;class S extends n.BaseCMapReaderFactory{_fetchData(t,e){return P(t,this.isCompressed).then((t=>({cMapData:t,compressionType:e})))}}e.DOMCMapReaderFactory=S;class F extends n.BaseStandardFontDataFactory{_fetchData(t){return P(t,!0)}}e.DOMStandardFontDataFactory=F;class x extends n.BaseSVGFactory{_createSVG(t){return document.createElementNS(r,t)}}e.DOMSVGFactory=x;class C{constructor(t){let{viewBox:e,scale:s,rotation:i,offsetX:n=0,offsetY:a=0,dontFlip:r=!1}=t;this.viewBox=e,this.scale=s,this.rotation=i,this.offsetX=n,this.offsetY=a;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,d,h,u,p,f,g,m;switch(i%=360,i<0&&(i+=360),i){case 180:c=-1,d=0,h=0,u=1;break;case 90:c=0,d=1,h=1,u=0;break;case 270:c=0,d=-1,h=-1,u=0;break;case 0:c=1,d=0,h=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(h=-h,u=-u),0===c?(p=Math.abs(l-e[1])*s+n,f=Math.abs(o-e[0])*s+a,g=(e[3]-e[1])*s,m=(e[2]-e[0])*s):(p=Math.abs(o-e[0])*s+n,f=Math.abs(l-e[1])*s+a,g=(e[2]-e[0])*s,m=(e[3]-e[1])*s),this.transform=[c*s,d*s,h*s,u*s,p-c*s*o-h*s*l,f-d*s*o-u*s*l],this.width=g,this.height=m}get rawDims(){const{viewBox:t}=this;return(0,a.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:s=this.offsetX,offsetY:i=this.offsetY,dontFlip:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new C({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:s,offsetY:i,dontFlip:n})}convertToViewportPoint(t,e){return a.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=a.Util.applyTransform([t[0],t[1]],this.transform),s=a.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],s[0],s[1]]}convertToPdfPoint(t,e){return a.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=C;class w extends a.BaseException{constructor(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;super(t,"RenderingCancelledException"),this.type=e,this.extraDelay=s}}function E(t){const e=t.length;let s=0;for(;s<e&&""===t[s].trim();)s++;return"data:"===t.substring(s,s+5).toLowerCase()}function k(t,e){try{const{protocol:s}=e?new URL(t,e):new URL(t);return"http:"===s||"https:"===s}catch(s){return!1}}let T;function M(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map((t=>parseInt(t))):t.startsWith("rgba(")?t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3):((0,a.warn)('Not a valid color format: "'.concat(t,'"')),[0,0,0])}e.RenderingCancelledException=w,e.StatTimer=class{constructor(){_defineProperty(this,"started",Object.create(null)),_defineProperty(this,"times",[])}time(t){t in this.started&&(0,a.warn)("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,a.warn)("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:s}of this.times)e=Math.max(s.length,e);for(const{name:s,start:i,end:n}of this.times)t.push("".concat(s.padEnd(e)," ").concat(n-i,"ms\n"));return t.join("")}},e.PDFDateString=class{static toDateObject(t){if(!t||"string"!==typeof t)return null;T||(T=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=T.exec(t);if(!e)return null;const s=parseInt(e[1],10);let i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;let 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 r=parseInt(e[5],10);r=r>=0&&r<=59?r:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===l?(a+=c,r+=d):"+"===l&&(a-=c,r-=d),new Date(Date.UTC(s,i,n,a,r,o))}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseFilterFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var i=s(1);class n{constructor(){this.constructor===n&&(0,i.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}destroy(){}}e.BaseFilterFactory=n;class a{constructor(){this.constructor===a&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const s=this._createCanvas(t,e);return{canvas:s,context:s.getContext("2d")}}reset(t,e,s){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||s<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=s}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){(0,i.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=a;class r{constructor(t){let{baseUrl:e=null,isCompressed:s=!0}=t;this.constructor===r&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=s}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const s=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return this._fetchData(s,n).catch((t=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(s))}))}_fetchData(t,e){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=r;class o{constructor(t){let{baseUrl:e=null}=t;this.constructor===o&&(0,i.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const s="".concat(this.baseUrl).concat(e);return this._fetchData(s).catch((t=>{throw new Error("Unable to load font data at: ".concat(s))}))}_fetchData(t){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=o;class l{constructor(){this.constructor===l&&(0,i.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),s||(i.setAttribute("width","".concat(t,"px")),i.setAttribute("height","".concat(e,"px"))),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox","0 0 ".concat(t," ").concat(e)),i}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,i.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=l},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MurmurHash3_64=void 0;var i=s(1);const n=3285377520,a=4294901760,r=65535;e.MurmurHash3_64=class{constructor(t){this.h1=t?4294967295&t:n,this.h2=t?4294967295&t:n}update(t){let e,s;if("string"===typeof t){e=new Uint8Array(2*t.length),s=0;for(let i=0,n=t.length;i<n;i++){const n=t.charCodeAt(i);n<=255?e[s++]=n:(e[s++]=n>>>8,e[s++]=255&n)}}else{if(!(0,i.isArrayBuffer)(t))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");e=t.slice(),s=e.byteLength}const n=s>>2,o=s-4*n,l=new Uint32Array(e.buffer,0,n);let c=0,d=0,h=this.h1,u=this.h2;const p=3432918353,f=461845907,g=11601,m=13715;for(let i=0;i<n;i++)1&i?(c=l[i],c=c*p&a|c*g&r,c=c<<15|c>>>17,c=c*f&a|c*m&r,h^=c,h=h<<13|h>>>19,h=5*h+3864292196):(d=l[i],d=d*p&a|d*g&r,d=d<<15|d>>>17,d=d*f&a|d*m&r,u^=d,u=u<<13|u>>>19,u=5*u+3864292196);switch(c=0,o){case 3:c^=e[4*n+2]<<16;case 2:c^=e[4*n+1]<<8;case 1:c^=e[4*n],c=c*p&a|c*g&r,c=c<<15|c>>>17,c=c*f&a|c*m&r,1&n?h^=c:u^=c}this.h1=h,this.h2=u}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&a|36045*t&r,e=4283543511*e&a|(2950163797*(e<<16|t>>>16)&a)>>>16,t^=e>>>1,t=444984403*t&a|60499*t&r,e=3301882366*e&a|(3120437893*(e<<16|t>>>16)&a)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var i=s(1),n=s(10);e.FontLoader=class{constructor(t){let{ownerDocument:e=globalThis.document,styleElement:s=null}=t;this._document=e,this.nativeFontFaces=[],this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.push(t),this._document.fonts.add(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.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(t){if(t.attached||t.missingFile)return;if(t.attached=!0,this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(s){throw(0,i.warn)("Failed to load font '".concat(e.family,"': '").concat(s,"'.")),t.disableFontFace=!0,s}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise((e=>{const s=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,s)}))}}get isFontLoadingAPISupported(){var t;const e=!(null===(t=this._document)||void 0===t||!t.fonts);return(0,i.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let t=!1;return(n.isNodeJS||"undefined"!==typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),(0,i.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,s={done:!1,complete:function(){for((0,i.assert)(!s.done,"completeRequest() cannot be called twice."),s.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(s),s}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,i.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function s(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function n(t,e,s,i){return t.substring(0,e)+i+t.substring(e+s)}let a,r;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;const d="lt".concat(Date.now()).concat(this.loadTestFontId++);let h=this._loadTestFont;h=n(h,976,d.length,d);const u=1482184792;let p=s(h,16);for(a=0,r=d.length-3;a<r;a+=4)p=p-u+s(d,a)|0;a<d.length&&(p=p-u+s(d+"XXX",a)|0),h=n(h,16,4,(0,i.string32)(p));const f="url(data:font/opentype;base64,".concat(btoa(h),");"),g='@font-face {font-family:"'.concat(d,'";src:').concat(f,"}");this.insertRule(g);const m=this._document.createElement("div");m.style.visibility="hidden",m.style.width=m.style.height="10px",m.style.position="absolute",m.style.top=m.style.left="0px";for(const i of[t.loadedName,d]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=i,m.append(t)}this._document.body.append(m),function t(e,s){if(++c>30)return(0,i.warn)("Load test font never loaded."),void s();l.font="30px "+e,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?s():setTimeout(t.bind(null,e,s))}(d,(()=>{m.remove(),e.complete()}))}},e.FontFaceObject=class{constructor(t,e){let{isEvalSupported:s=!0,disableFontFace:i=!1,ignoreErrors:n=!1,inspectFont:a=null}=e;this.compiledGlyphs=Object.create(null);for(const r in t)this[r]=t[r];this.isEvalSupported=!1!==s,this.disableFontFace=!0===i,this.ignoreErrors=!0===n,this._inspectFont=a}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return null===(t=this._inspectFont)||void 0===t||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e=(0,i.bytesToString)(this.data),s="url(data:".concat(this.mimetype,";base64,").concat(btoa(e),");");let n;if(this.cssFontInfo){let t="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(t+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),n='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(t,"src:").concat(s,"}")}else n='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(s,"}");return null===(t=this._inspectFont)||void 0===t||t.call(this,this,s),n}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let s;try{s=t.get(this.loadedName+"_path_"+e)}catch(n){if(!this.ignoreErrors)throw n;return(0,i.warn)('getPathGenerator - ignoring character: "'.concat(n,'".')),this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&i.FeatureTest.isEvalSupported){const t=[];for(const e of s){const s=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",s,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const i of s)"scale"===i.cmd&&(i.args=[e,-e]),t[i.cmd].apply(t,i.args)}}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNodeJS=void 0;const s="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=s},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var i=s(1),n=s(6),a=s(12),r=s(13),o=s(10);const l=4096,c=16;class d{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,s){let i;return void 0!==this.cache[t]?(i=this.cache[t],this.canvasFactory.reset(i,e,s)):(i=this.canvasFactory.create(e,s),this.cache[t]=i),i}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function h(t,e,s,i,a,r,o,l,c,d){const[h,u,p,f,g,m]=(0,n.getCurrentTransform)(t);if(0===u&&0===p){const n=o*h+g,_=Math.round(n),v=l*f+m,b=Math.round(v),y=(o+c)*h+g,A=Math.abs(Math.round(y)-_)||1,P=(l+d)*f+m,S=Math.abs(Math.round(P)-b)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(f),_,b),t.drawImage(e,s,i,a,r,0,0,A,S),t.setTransform(h,u,p,f,g,m),[A,S]}if(0===h&&0===f){const n=l*p+g,_=Math.round(n),v=o*u+m,b=Math.round(v),y=(l+d)*p+g,A=Math.abs(Math.round(y)-_)||1,P=(o+c)*u+m,S=Math.abs(Math.round(P)-b)||1;return t.setTransform(0,Math.sign(u),Math.sign(p),0,_,b),t.drawImage(e,s,i,a,r,0,0,S,A),t.setTransform(h,u,p,f,g,m),[S,A]}return t.drawImage(e,s,i,a,r,o,l,c,d),[Math.hypot(h,u)*c,Math.hypot(p,f)*d]}class u{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=i.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=i.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=i.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,s){[e,s]=i.Util.applyTransform([e,s],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,s),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,s)}updateRectMinMax(t,e){const s=i.Util.applyTransform(e,t),n=i.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,s[0],n[0]),this.minY=Math.min(this.minY,s[1],n[1]),this.maxX=Math.max(this.maxX,s[0],n[0]),this.maxY=Math.max(this.maxY,s[1],n[1])}updateScalingPathMinMax(t,e){i.Util.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.maxX=Math.max(this.maxX,e[1]),this.minY=Math.min(this.minY,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,s,n,a,r,o,l,c,d){const h=i.Util.bezierBoundingBox(e,s,n,a,r,o,l,c);if(d)return d[0]=Math.min(d[0],h[0],h[2]),d[1]=Math.max(d[1],h[0],h[2]),d[2]=Math.min(d[2],h[1],h[3]),void(d[3]=Math.max(d[3],h[1],h[3]));this.updateRectMinMax(t,h)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const s=[this.minX,this.minY,this.maxX,this.maxY];if(t===a.PathType.STROKE){e||(0,i.unreachable)("Stroke bounding box must include transform.");const t=i.Util.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,a=t[1]*this.lineWidth/2;s[0]-=n,s[1]-=a,s[2]+=n,s[3]+=a}return s}updateClipFromPath(){const t=i.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return i.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function p(t,e){if("undefined"!==typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);const s=e.height,n=e.width,a=s%c,r=(s-a)/c,o=0===a?r:r+1,l=t.createImageData(n,c);let d,h=0;const u=e.data,p=l.data;let f,g,m,_;if(e.kind===i.ImageKind.GRAYSCALE_1BPP){const e=u.byteLength,s=new Uint32Array(p.buffer,0,p.byteLength>>2),_=s.length,v=n+7>>3,b=4294967295,y=i.FeatureTest.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(m=f<r?c:a,d=0,g=0;g<m;g++){const t=e-h;let i=0;const a=t>v?n:8*t-7,r=-8&a;let o=0,l=0;for(;i<r;i+=8)l=u[h++],s[d++]=128&l?b:y,s[d++]=64&l?b:y,s[d++]=32&l?b:y,s[d++]=16&l?b:y,s[d++]=8&l?b:y,s[d++]=4&l?b:y,s[d++]=2&l?b:y,s[d++]=1&l?b:y;for(;i<a;i++)0===o&&(l=u[h++],o=128),s[d++]=l&o?b:y,o>>=1}for(;d<_;)s[d++]=0;t.putImageData(l,0,f*c)}}else if(e.kind===i.ImageKind.RGBA_32BPP){for(g=0,_=n*c*4,f=0;f<r;f++)p.set(u.subarray(h,h+_)),h+=_,t.putImageData(l,0,g),g+=c;f<o&&(_=n*a*4,p.set(u.subarray(h,h+_)),t.putImageData(l,0,g))}else{if(e.kind!==i.ImageKind.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));for(m=c,_=n*m,f=0;f<o;f++){for(f>=r&&(m=a,_=n*m),d=0,g=_;g--;)p[d++]=u[h++],p[d++]=u[h++],p[d++]=u[h++],p[d++]=255;t.putImageData(l,0,f*c)}}}function f(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const s=e.height,i=e.width,n=s%c,a=(s-n)/c,o=0===n?a:a+1,l=t.createImageData(i,c);let d=0;const h=e.data,u=l.data;for(let p=0;p<o;p++){const e=p<a?c:n;({srcPos:d}=(0,r.convertBlackAndWhiteToRGBA)({src:h,srcPos:d,dest:u,width:i,height:e,nonBlackColor:0})),t.putImageData(l,0,p*c)}}function g(t,e){const s=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of s)void 0!==t[i]&&(e[i]=t[i]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function m(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),o.isNodeJS||(t.filter="none")}function _(t,e,s,i){const n=t.length;for(let a=3;a<n;a+=4){const n=t[a];if(0===n)t[a-3]=e,t[a-2]=s,t[a-1]=i;else if(n<255){const r=255-n;t[a-3]=t[a-3]*n+e*r>>8,t[a-2]=t[a-2]*n+s*r>>8,t[a-1]=t[a-1]*n+i*r>>8}}}function v(t,e,s){const i=t.length;for(let n=3;n<i;n+=4){const i=s?s[t[n]]:t[n];e[n]=e[n]*i*.00392156862745098|0}}function b(t,e,s){const i=t.length;for(let n=3;n<i;n+=4){const i=77*t[n-3]+152*t[n-2]+28*t[n-1];e[n]=s?e[n]*s[i>>8]>>8:e[n]*i>>16}}function y(t,e,s,i){const n=i[0],a=i[1],r=i[2]-n,o=i[3]-a;0!==r&&0!==o&&(function(t,e,s,i,n,a,r,o,l,c,d){const h=!!a,u=h?a[0]:0,p=h?a[1]:0,f=h?a[2]:0;let g;g="Luminosity"===n?b:v;const m=Math.min(i,Math.ceil(1048576/s));for(let v=0;v<i;v+=m){const n=Math.min(m,i-v),a=t.getImageData(o-c,v+(l-d),s,n),b=e.getImageData(o,v+l,s,n);h&&_(a.data,u,p,f),g(a.data,b.data,r),e.putImageData(b,o,v+l)}}(e.context,s,r,o,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(s.canvas,0,0),t.restore())}function A(t,e){const s=i.Util.singularValueDecompose2dScale(t);s[0]=Math.fround(s[0]),s[1]=Math.fround(s[1]);const a=Math.fround((globalThis.devicePixelRatio||1)*n.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:s[0]<=a||s[1]<=a}const P=["butt","round","square"],S=["miter","round","bevel"],F={},x={};var C=new WeakSet;class w{constructor(t,e,s,i,n,a,r,o){let{optionalContentConfig:l,markedContentStack:c=null}=a;_classPrivateMethodInitSpec(this,C),this.ctx=t,this.current=new u(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=s,this.canvasFactory=i,this.filterFactory=n,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=c||[],this.optionalContentConfig=l,this.cachedCanvases=new d(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=r,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:s,transparency:i=!1,background:a=null}=t;const r=this.ctx.canvas.width,o=this.ctx.canvas.height,l=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,r,o),this.ctx.fillStyle=l,i){const t=this.cachedCanvases.getCanvas("transparent",r,o);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...(0,n.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),m(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...s.transform),this.viewportScale=s.scale,this.baseTransform=(0,n.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,s,n){const a=t.argsArray,r=t.fnArray;let o=e||0;const l=a.length;if(l===o)return o;const c=l-o>10&&"function"===typeof s,d=c?Date.now()+15:0;let h=0;const u=this.commonObjs,p=this.objs;let f;for(;;){if(void 0!==n&&o===n.nextBreakPoint)return n.breakIt(o,s),o;if(f=r[o],f!==i.OPS.dependency)this[f].apply(this,a[o]);else for(const t of a[o]){const e=t.startsWith("g_")?u:p;if(!e.has(t))return e.get(t,s),o}if(o++,o===l)return o;if(c&&++h>10){if(Date.now()>d)return s(),o;h=0}}}endDrawing(){_assertClassBrand(C,this,E).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),_assertClassBrand(C,this,k).call(this)}_scaleImage(t,e){const s=t.width,i=t.height;let n,a,r=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=s,c=i,d="prescale1";for(;r>2&&l>1||o>2&&c>1;){let e=l,s=c;r>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),r/=l/e),o>2&&c>1&&(s=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/s),n=this.cachedCanvases.getCanvas(d,e,s),a=n.context,a.clearRect(0,0,e,s),a.drawImage(t,0,0,l,c,0,0,e,s),t=n.canvas,l=e,c=s,d="prescale1"===d?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:s,height:r}=t,o=this.current.fillColor,l=this.current.patternFill,c=(0,n.getCurrentTransform)(e);let d,u,p,g;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;u=JSON.stringify(l?c:[c.slice(0,4),o]),d=this._cachedBitmapsMap.get(e),d||(d=new Map,this._cachedBitmapsMap.set(e,d));const s=d.get(u);if(s&&!l)return{canvas:s,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])};p=s}p||(g=this.cachedCanvases.getCanvas("maskCanvas",s,r),f(g.context,t));let m=i.Util.transform(c,[1/s,0,0,-1/r,0,0]);m=i.Util.transform(m,[1,0,0,1,0,-r]);const _=i.Util.applyTransform([0,0],m),v=i.Util.applyTransform([s,r],m),b=i.Util.normalizeRect([_[0],_[1],v[0],v[1]]),y=Math.round(b[2]-b[0])||1,P=Math.round(b[3]-b[1])||1,S=this.cachedCanvases.getCanvas("fillCanvas",y,P),F=S.context,x=Math.min(_[0],v[0]),C=Math.min(_[1],v[1]);F.translate(-x,-C),F.transform(...m),p||(p=this._scaleImage(g.canvas,(0,n.getCurrentTransformInverse)(F)),p=p.img,d&&l&&d.set(u,p)),F.imageSmoothingEnabled=A((0,n.getCurrentTransform)(F),t.interpolate),h(F,p,0,0,p.width,p.height,0,0,s,r),F.globalCompositeOperation="source-in";const w=i.Util.transform((0,n.getCurrentTransformInverse)(F),[1,0,0,1,-x,-C]);return F.fillStyle=l?o.getPattern(e,this,w,a.PathType.FILL):o,F.fillRect(0,0,s,r),d&&!l&&(this.cachedCanvases.delete("fillCanvas"),d.set(u,S.canvas)),{canvas:S.canvas,offsetX:Math.round(x),offsetY:Math.round(C)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=P[t]}setLineJoin(t){this.ctx.lineJoin=S[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const s=this.ctx;void 0!==s.setLineDash&&(s.setLineDash(t),s.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,s]of t)switch(e){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s[0],s[1]);break;case"CA":this.current.strokeAlpha=s;break;case"ca":this.current.fillAlpha=s,this.ctx.globalAlpha=s;break;case"BM":this.ctx.globalCompositeOperation=s;break;case"SMask":this.current.activeSMask=s?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(s)}}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,s="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(s,t,e);this.suspendedCtx=this.ctx,this.ctx=i.context;const a=this.ctx;a.setTransform(...(0,n.getCurrentTransform)(this.suspendedCtx)),g(this.suspendedCtx,a),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,s){e.translate(t,s),this.__originalTranslate(t,s)},t.scale=function(t,s){e.scale(t,s),this.__originalScale(t,s)},t.transform=function(t,s,i,n,a,r){e.transform(t,s,i,n,a,r),this.__originalTransform(t,s,i,n,a,r)},t.setTransform=function(t,s,i,n,a,r){e.setTransform(t,s,i,n,a,r),this.__originalSetTransform(t,s,i,n,a,r)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,s){e.moveTo(t,s),this.__originalMoveTo(t,s)},t.lineTo=function(t,s){e.lineTo(t,s),this.__originalLineTo(t,s)},t.bezierCurveTo=function(t,s,i,n,a,r){e.bezierCurveTo(t,s,i,n,a,r),this.__originalBezierCurveTo(t,s,i,n,a,r)},t.rect=function(t,s,i,n){e.rect(t,s,i,n),this.__originalRect(t,s,i,n)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(a,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),g(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;y(this.suspendedCtx,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()}save(){this.inSMaskMode?(g(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),g(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null)}transform(t,e,s,i,n,a){this.ctx.transform(t,e,s,i,n,a),this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null}constructPath(t,e,s){const a=this.ctx,r=this.current;let o,l,c=r.x,d=r.y;const h=(0,n.getCurrentTransform)(a),u=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],p=u?s.slice(0):null;for(let n=0,f=0,g=t.length;n<g;n++)switch(0|t[n]){case i.OPS.rectangle:c=e[f++],d=e[f++];const t=e[f++],s=e[f++],n=c+t,g=d+s;a.moveTo(c,d),0===t||0===s?a.lineTo(n,g):(a.lineTo(n,d),a.lineTo(n,g),a.lineTo(c,g)),u||r.updateRectMinMax(h,[c,d,n,g]),a.closePath();break;case i.OPS.moveTo:c=e[f++],d=e[f++],a.moveTo(c,d),u||r.updatePathMinMax(h,c,d);break;case i.OPS.lineTo:c=e[f++],d=e[f++],a.lineTo(c,d),u||r.updatePathMinMax(h,c,d);break;case i.OPS.curveTo:o=c,l=d,c=e[f+4],d=e[f+5],a.bezierCurveTo(e[f],e[f+1],e[f+2],e[f+3],c,d),r.updateCurvePathMinMax(h,o,l,e[f],e[f+1],e[f+2],e[f+3],c,d,p),f+=6;break;case i.OPS.curveTo2:o=c,l=d,a.bezierCurveTo(c,d,e[f],e[f+1],e[f+2],e[f+3]),r.updateCurvePathMinMax(h,o,l,c,d,e[f],e[f+1],e[f+2],e[f+3],p),c=e[f+2],d=e[f+3],f+=4;break;case i.OPS.curveTo3:o=c,l=d,c=e[f+2],d=e[f+3],a.bezierCurveTo(e[f],e[f+1],c,d,c,d),r.updateCurvePathMinMax(h,o,l,e[f],e[f+1],c,d,c,d,p),f+=4;break;case i.OPS.closePath:a.closePath()}u&&r.updateScalingPathMinMax(h,p),r.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,s=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof s&&null!==s&&void 0!==s&&s.getPattern?(e.save(),e.strokeStyle=s.getPattern(e,this,(0,n.getCurrentTransformInverse)(e),a.PathType.STROKE),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,s=this.current.fillColor;let i=!1;this.current.patternFill&&(e.save(),e.fillStyle=s.getPattern(e,this,(0,n.getCurrentTransformInverse)(e),a.PathType.FILL),i=!0);const r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),i&&e.restore(),t&&this.consumePath(r)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=F}eoClip(){this.pendingClip=x}beginText(){this.current.textMatrix=i.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const s of t)e.setTransform(...s.transform),e.translate(s.x,s.y),s.addToPath(e,s.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const s=this.commonObjs.get(t),n=this.current;if(!s)throw new Error("Can't find font for ".concat(t));if(n.fontMatrix=s.fontMatrix||i.FONT_IDENTITY_MATRIX,0!==n.fontMatrix[0]&&0!==n.fontMatrix[3]||(0,i.warn)("Invalid font matrix for font "+t),e<0?(e=-e,n.fontDirection=-1):n.fontDirection=1,this.current.font=s,this.current.fontSize=e,s.isType3Font)return;const a=s.loadedName||"sans-serif";let r="normal";s.black?r="900":s.bold&&(r="bold");const o=s.italic?"italic":"normal",l='"'.concat(a,'", ').concat(s.fallbackName);let c=e;e<16?c=16:e>100&&(c=100),this.current.fontSizeScale=e/c,this.ctx.font="".concat(o," ").concat(r," ").concat(c,"px ").concat(l)}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,s,i,n,a){this.current.textMatrix=[t,e,s,i,n,a],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,s,a){const r=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,h=c&i.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&i.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let f;(l.disableFontFace||u||p)&&(f=l.getPathGenerator(this.commonObjs,t)),l.disableFontFace||p?(r.save(),r.translate(e,s),r.beginPath(),f(r,d),a&&r.setTransform(...a),h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||r.fill(),h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||r.stroke(),r.restore()):(h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||r.fillText(t,e,s),h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||r.strokeText(t,e,s)),u&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,n.getCurrentTransform)(r),x:e,y:s,fontSize:d,addToPath:f})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let s=!1;for(let i=3;i<e.length;i+=4)if(e[i]>0&&e[i]<255){s=!0;break}return(0,i.shadow)(this,"isFontSubpixelAAEnabled",s)}showText(t){const e=this.current,s=e.font;if(s.isType3Font)return this.showType3Text(t);const r=e.fontSize;if(0===r)return;const o=this.ctx,l=e.fontSizeScale,c=e.charSpacing,d=e.wordSpacing,h=e.fontDirection,u=e.textHScale*h,p=t.length,f=s.vertical,g=f?1:-1,m=s.defaultVMetrics,_=r*e.fontMatrix[0],v=e.textRenderingMode===i.TextRenderingMode.FILL&&!s.disableFontFace&&!e.patternFill;let b;if(o.save(),o.transform(...e.textMatrix),o.translate(e.x,e.y+e.textRise),h>0?o.scale(u,-1):o.scale(u,1),e.patternFill){o.save();const t=e.fillColor.getPattern(o,this,(0,n.getCurrentTransformInverse)(o),a.PathType.FILL);b=(0,n.getCurrentTransform)(o),o.restore(),o.fillStyle=t}let y=e.lineWidth;const A=e.textMatrixScale;if(0===A||0===y){const t=e.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;t!==i.TextRenderingMode.STROKE&&t!==i.TextRenderingMode.FILL_STROKE||(y=this.getSinglePixelWidth())}else y/=A;if(1!==l&&(o.scale(l,l),y/=l),o.lineWidth=y,s.isInvalidPDFjsFont){const s=[];let i=0;for(const e of t)s.push(e.unicode),i+=e.width;return o.fillText(s.join(""),0,0),e.x+=i*_*u,o.restore(),void this.compose()}let P,S=0;for(P=0;P<p;++P){const e=t[P];if("number"===typeof e){S+=g*e*r/1e3;continue}let i=!1;const n=(e.isSpace?d:0)+c,a=e.fontChar,u=e.accent;let p,y,A,F=e.width;if(f){const t=e.vmetric||m,s=-(e.vmetric?t[1]:.5*F)*_,i=t[2]*_;F=t?-t[0]:F,p=s/l,y=(S+i)/l}else p=S/l,y=0;if(s.remeasure&&F>0){const t=1e3*o.measureText(a).width/r*l;if(F<t&&this.isFontSubpixelAAEnabled){const e=F/t;i=!0,o.save(),o.scale(e,1),p/=e}else F!==t&&(p+=(F-t)/2e3*r/l)}if(this.contentVisible&&(e.isInFont||s.missingFile))if(v&&!u)o.fillText(a,p,y);else if(this.paintChar(a,p,y,b),u){const t=p+r*u.offset.x/l,e=y-r*u.offset.y/l;this.paintChar(u.fontChar,t,e,b)}A=f?F*_-n*h:F*_+n*h,S+=A,i&&o.restore()}f?e.y-=S:e.x+=S*u,o.restore(),this.compose()}showType3Text(t){const e=this.ctx,s=this.current,n=s.font,a=s.fontSize,r=s.fontDirection,o=n.vertical?1:-1,l=s.charSpacing,c=s.wordSpacing,d=s.textHScale*r,h=s.fontMatrix||i.FONT_IDENTITY_MATRIX,u=t.length;let p,f,g,m;if(s.textRenderingMode!==i.TextRenderingMode.INVISIBLE&&0!==a){for(this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...s.textMatrix),e.translate(s.x,s.y),e.scale(d,r),p=0;p<u;++p){if(f=t[p],"number"===typeof f){m=o*f*a/1e3,this.ctx.translate(m,0),s.x+=m*d;continue}const r=(f.isSpace?c:0)+l,u=n.charProcOperatorList[f.operatorListId];u?(this.contentVisible&&(this.processingType3=f,this.save(),e.scale(a,a),e.transform(...h),this.executeOperatorList(u),this.restore()),g=i.Util.applyTransform([f.width,0],h)[0]*a+r,e.translate(g,0),s.x+=g*d):(0,i.warn)('Type3 character "'.concat(f.operatorListId,'" is not available.'))}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,s,i,n,a){this.ctx.rect(s,i,n-s,a-i),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const s=t[1],i=this.baseTransform||(0,n.getCurrentTransform)(this.ctx),r={createCanvasGraphics:t=>new w(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new a.TilingPattern(t,s,this.ctx,r,i)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,s){const n=i.Util.makeHexColor(t,e,s);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,s){const n=i.Util.makeHexColor(t,e,s);this.ctx.fillStyle=n,this.current.fillColor=n,this.current.patternFill=!1}_getPattern(t){let e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=(0,a.getShadingPattern)(this.getObject(t)),this.cachedPatterns.set(t,e)),s&&(e.matrix=s),e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const s=this._getPattern(t);e.fillStyle=s.getPattern(e,this,(0,n.getCurrentTransformInverse)(e),a.PathType.SHADING);const r=(0,n.getCurrentTransformInverse)(e);if(r){const t=e.canvas,s=t.width,n=t.height,a=i.Util.applyTransform([0,0],r),o=i.Util.applyTransform([0,n],r),l=i.Util.applyTransform([s,0],r),c=i.Util.applyTransform([s,n],r),d=Math.min(a[0],o[0],l[0],c[0]),h=Math.min(a[1],o[1],l[1],c[1]),u=Math.max(a[0],o[0],l[0],c[0]),p=Math.max(a[1],o[1],l[1],c[1]);this.ctx.fillRect(d,h,u-d,p-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,i.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,i.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(t)&&6===t.length&&this.transform(...t),this.baseTransform=(0,n.getCurrentTransform)(this.ctx),e)){const t=e[2]-e[0],s=e[3]-e[1];this.ctx.rect(e[0],e[1],t,s),this.current.updateRectMinMax((0,n.getCurrentTransform)(this.ctx),e),this.clip(),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||(0,i.info)("TODO: Support non-isolated groups."),t.knockout&&(0,i.warn)("Knockout groups not supported.");const s=(0,n.getCurrentTransform)(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=i.Util.getAxialAlignedBoundingBox(t.bbox,(0,n.getCurrentTransform)(e));const r=[0,0,e.canvas.width,e.canvas.height];a=i.Util.intersect(a,r)||[0,0,0,0];const o=Math.floor(a[0]),c=Math.floor(a[1]);let d=Math.max(Math.ceil(a[2])-o,1),h=Math.max(Math.ceil(a[3])-c,1),u=1,p=1;d>l&&(u=d/l,d=l),h>l&&(p=h/l,h=l),this.current.startNewPathAndClipBox([0,0,d,h]);let f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);const m=this.cachedCanvases.getCanvas(f,d,h),_=m.context;_.scale(1/u,1/p),_.translate(-o,-c),_.transform(...s),t.smask?this.smaskStack.push({canvas:m.canvas,context:_,offsetX:o,offsetY:c,scaleX:u,scaleY:p,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(o,c),e.scale(u,p),e.save()),g(e,_),this.ctx=_,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,s=this.groupStack.pop();if(this.ctx=s,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=(0,n.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const s=i.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(t,e,s,a,r){if(_assertClassBrand(C,this,E).call(this),m(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(e)&&4===e.length){const a=e[2]-e[0],o=e[3]-e[1];if(r&&this.annotationCanvasMap){(s=s.slice())[4]-=e[0],s[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=a,e[3]=o;const[r,l]=i.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,d=Math.ceil(a*this.outputScaleX*c),h=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,h);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(r,0,0,-l,0,o*l),m(this.ctx)}else m(this.ctx),this.ctx.rect(e[0],e[1],a,o),this.ctx.clip(),this.endPath()}this.current=new u(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...s),this.transform(...a)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),_assertClassBrand(C,this,k).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)).count=e;const s=this.ctx,i=this.processingType3;if(i&&(void 0===i.compiled&&(i.compiled=function(t){const{width:e,height:s}=t;if(e>1e3||s>1e3)return null;const i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),n=e+1;let a,r,o,l=new Uint8Array(n*(s+1));const c=e+7&-8;let d=new Uint8Array(c*s),h=0;for(const g of t.data){let t=128;for(;t>0;)d[h++]=g&t?0:255,t>>=1}let u=0;for(h=0,0!==d[h]&&(l[0]=1,++u),r=1;r<e;r++)d[h]!==d[h+1]&&(l[r]=d[h]?2:1,++u),h++;for(0!==d[h]&&(l[r]=2,++u),a=1;a<s;a++){h=a*c,o=a*n,d[h-c]!==d[h]&&(l[o]=d[h]?1:8,++u);let t=(d[h]?4:0)+(d[h-c]?8:0);for(r=1;r<e;r++)t=(t>>2)+(d[h+1]?4:0)+(d[h-c+1]?8:0),i[t]&&(l[o+r]=i[t],++u),h++;if(d[h-c]!==d[h]&&(l[o+r]=d[h]?2:4,++u),u>1e3)return null}for(h=c*(s-1),o=a*n,0!==d[h]&&(l[o]=8,++u),r=1;r<e;r++)d[h]!==d[h+1]&&(l[o+r]=d[h]?4:8,++u),h++;if(0!==d[h]&&(l[o+r]=4,++u),u>1e3)return null;const p=new Int32Array([0,n,-1,0,-n,0,0,0,1]),f=new Path2D;for(a=0;u&&a<=s;a++){let t=a*n;const s=t+e;for(;t<s&&!l[t];)t++;if(t===s)continue;f.moveTo(t%n,a);const i=t;let r=l[t];do{const e=p[r];do{t+=e}while(!l[t]);const s=l[t];5!==s&&10!==s?(r=s,l[t]=0):(r=s&51*r>>4,l[t]&=r>>2|r<<2),f.lineTo(t%n,t/n|0),l[t]||--u}while(i!==t);--a}return d=null,l=null,function(t){t.save(),t.scale(1/e,-1/s),t.translate(0,-s),t.fill(f),t.beginPath(),t.restore()}}(t)),i.compiled))return void i.compiled(s);const n=this._createMaskCanvas(t),a=n.canvas;s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(a,n.offsetX,n.offsetY),s.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const l=this.ctx;l.save();const c=(0,n.getCurrentTransform)(l);l.transform(e,s,a,r,0,0);const d=this._createMaskCanvas(t);l.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]);for(let n=0,h=o.length;n<h;n+=2){const t=i.Util.transform(c,[e,s,a,r,o[n],o[n+1]]),[h,u]=i.Util.applyTransform([0,0],t);l.drawImage(d.canvas,h,u)}l.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,s=this.current.fillColor,i=this.current.patternFill;for(const r of t){const{data:t,width:o,height:l,transform:c}=r,d=this.cachedCanvases.getCanvas("maskCanvas",o,l),u=d.context;u.save(),f(u,this.getObject(t,r)),u.globalCompositeOperation="source-in",u.fillStyle=i?s.getPattern(u,this,(0,n.getCurrentTransformInverse)(e),a.PathType.FILL):s,u.fillRect(0,0,o,l),u.restore(),e.save(),e.transform(...c),e.scale(1,-1),h(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);e?this.paintInlineImageXObject(e):(0,i.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,s,n){if(!this.contentVisible)return;const a=this.getObject(t);if(!a)return void(0,i.warn)("Dependent image isn't ready yet");const r=a.width,o=a.height,l=[];for(let i=0,c=n.length;i<c;i+=2)l.push({transform:[e,0,0,s,n[i],n[i+1]],x:0,y:0,w:r,h:o});this.paintInlineImageXObjectGroup(a,l)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:s,height:i}=t,n=this.cachedCanvases.getCanvas("inlineImage",s,i),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,s=t.height,i=this.ctx;let a;if(this.save(),o.isNodeJS||(i.filter="none"),i.scale(1/e,-1/s),t.bitmap)a=this.applyTransferMapsToBitmap(t);else if("function"===typeof HTMLElement&&t instanceof HTMLElement||!t.data)a=t;else{const i=this.cachedCanvases.getCanvas("inlineImage",e,s).context;p(i,t),a=this.applyTransferMapsToCanvas(i)}const r=this._scaleImage(a,(0,n.getCurrentTransformInverse)(i));i.imageSmoothingEnabled=A((0,n.getCurrentTransform)(i),t.interpolate),h(i,r.img,0,0,r.paintWidth,r.paintHeight,0,-s,e,s),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const s=this.ctx;let i;if(t.bitmap)i=t.bitmap;else{const e=t.width,s=t.height,n=this.cachedCanvases.getCanvas("inlineImage",e,s).context;p(n,t),i=this.applyTransferMapsToCanvas(n)}for(const n of e)s.save(),s.transform(...n.transform),s.scale(1,-1),h(s,i,n.x,n.y,n.w,n.h,0,-1,1,1),s.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){"OC"===t?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){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const s=this.ctx;this.pendingClip&&(e||(this.pendingClip===x?s.clip("evenodd"):s.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),s.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=(0,n.getCurrentTransform)(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),s=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(s,i)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:t}=this.current,e=(0,n.getCurrentTransform)(this.ctx);let s,i;if(0===e[1]&&0===e[2]){const n=Math.abs(e[0]),a=Math.abs(e[3]);if(0===t)s=1/n,i=1/a;else{const e=n*t,r=a*t;s=e<1?1/e:1,i=r<1?1/r:1}}else{const n=Math.abs(e[0]*e[3]-e[2]*e[1]),a=Math.hypot(e[0],e[1]),r=Math.hypot(e[2],e[3]);if(0===t)s=r/n,i=a/n;else{const e=t*n;s=r>e?r/e:1,i=a>e?a/e:1}}this._cachedScaleForStroking=[s,i]}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:s}=this.current,[i,a]=this.getScaleForStroking();if(e.lineWidth=s||1,1===i&&1===a)return void e.stroke();let r,o,l;t&&(r=(0,n.getCurrentTransform)(e),o=e.getLineDash().slice(),l=e.lineDashOffset),e.scale(i,a);const c=Math.max(i,a);e.setLineDash(e.getLineDash().map((t=>t/c))),e.lineDashOffset/=c,e.stroke(),t&&(e.setTransform(...r),e.setLineDash(o),e.lineDashOffset=l)}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}function E(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}function k(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}e.CanvasGraphics=w;for(const T in i.OPS)void 0!==w.prototype[T]&&(w.prototype[i.OPS[T]]=w.prototype[T])},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TilingPattern=e.PathType=void 0,e.getShadingPattern=function(t){switch(t[0]){case"RadialAxial":return new l(t);case"Mesh":return new h(t);case"Dummy":return new u}throw new Error("Unknown IR type: ".concat(t[0]))};var i=s(1),n=s(6);const a={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function r(t,e){if(!e)return;const s=e[2]-e[0],i=e[3]-e[1],n=new Path2D;n.rect(e[0],e[1],s,i),t.clip(n)}e.PathType=a;class o{constructor(){this.constructor===o&&(0,i.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,i.unreachable)("Abstract method `getPattern` called.")}}class l extends o{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const s of this._colorStops)e.addColorStop(s[0],s[1]);return e}getPattern(t,e,s,o){let l;if(o===a.STROKE||o===a.FILL){const a=e.current.getClippedPathBoundingBox(o,(0,n.getCurrentTransform)(t))||[0,0,0,0],c=Math.ceil(a[2]-a[0])||1,d=Math.ceil(a[3]-a[1])||1,h=e.cachedCanvases.getCanvas("pattern",c,d,!0),u=h.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-a[0],-a[1]),s=i.Util.transform(s,[1,0,0,1,a[0],a[1]]),u.transform(...e.baseTransform),this.matrix&&u.transform(...this.matrix),r(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),l=t.createPattern(h.canvas,"no-repeat");const p=new DOMMatrix(s);l.setTransform(p)}else r(t,this._bbox),l=this._createGradient(t);return l}}function c(t,e,s,i,n,a,r,o){const l=e.coords,c=e.colors,d=t.data,h=4*t.width;let u;l[s+1]>l[i+1]&&(u=s,s=i,i=u,u=a,a=r,r=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=o,o=u),l[s+1]>l[i+1]&&(u=s,s=i,i=u,u=a,a=r,r=u);const p=(l[s]+e.offsetX)*e.scaleX,f=(l[s+1]+e.offsetY)*e.scaleY,g=(l[i]+e.offsetX)*e.scaleX,m=(l[i+1]+e.offsetY)*e.scaleY,_=(l[n]+e.offsetX)*e.scaleX,v=(l[n+1]+e.offsetY)*e.scaleY;if(f>=v)return;const b=c[a],y=c[a+1],A=c[a+2],P=c[r],S=c[r+1],F=c[r+2],x=c[o],C=c[o+1],w=c[o+2],E=Math.round(f),k=Math.round(v);let T,M,R,I,D,O,L,G;for(let N=E;N<=k;N++){if(N<m){let t;t=N<f?0:(f-N)/(f-m),T=p-(p-g)*t,M=b-(b-P)*t,R=y-(y-S)*t,I=A-(A-F)*t}else{let t;t=N>v?1:m===v?0:(m-N)/(m-v),T=g-(g-_)*t,M=P-(P-x)*t,R=S-(S-C)*t,I=F-(F-w)*t}let t;t=N<f?0:N>v?1:(f-N)/(f-v),D=p-(p-_)*t,O=b-(b-x)*t,L=y-(y-C)*t,G=A-(A-w)*t;const e=Math.round(Math.min(T,D)),s=Math.round(Math.max(T,D));let i=h*N+4*e;for(let n=e;n<=s;n++)t=(T-n)/(T-D),t<0?t=0:t>1&&(t=1),d[i++]=M-(M-O)*t|0,d[i++]=R-(R-L)*t|0,d[i++]=I-(I-G)*t|0,d[i++]=255}}function d(t,e,s){const i=e.coords,n=e.colors;let a,r;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(i.length/o)-1,d=o-1;for(a=0;a<l;a++){let e=a*o;for(let a=0;a<d;a++,e++)c(t,s,i[e],i[e+1],i[e+o],n[e],n[e+1],n[e+o]),c(t,s,i[e+o+1],i[e+1],i[e+o],n[e+o+1],n[e+1],n[e+o])}break;case"triangles":for(a=0,r=i.length;a<r;a+=3)c(t,s,i[a],i[a+1],i[a+2],n[a],n[a+1],n[a+2]);break;default:throw new Error("illegal figure")}}class h extends o{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,s){const i=Math.floor(this._bounds[0]),n=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-i,r=Math.ceil(this._bounds[3])-n,o=Math.min(Math.ceil(Math.abs(a*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(r*t[1]*1.1)),3e3),c=a/o,h=r/l,u={coords:this._coords,colors:this._colors,offsetX:-i,offsetY:-n,scaleX:1/c,scaleY:1/h},p=o+4,f=l+4,g=s.getCanvas("mesh",p,f,!1),m=g.context,_=m.createImageData(o,l);if(e){const t=_.data;for(let s=0,i=t.length;s<i;s+=4)t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=255}for(const v of this._figures)d(_,v,u);return m.putImageData(_,2,2),{canvas:g.canvas,offsetX:i-2*c,offsetY:n-2*h,scaleX:c,scaleY:h}}getPattern(t,e,s,o){let l;if(r(t,this._bbox),o===a.SHADING)l=i.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(t));else if(l=i.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=i.Util.singularValueDecompose2dScale(this.matrix);l=[l[0]*t[0],l[1]*t[1]]}const c=this._createMeshCanvas(l,o===a.SHADING?null:this._background,e.cachedCanvases);return o!==a.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(c.offsetX,c.offsetY),t.scale(c.scaleX,c.scaleY),t.createPattern(c.canvas,"no-repeat")}}class u extends o{getPattern(){return"hotpink"}}const p=1,f=2;class g{constructor(t,e,s,i,n){this.operatorList=t[2],this.matrix=t[3]||[1,0,0,1,0,0],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=s,this.canvasGraphicsFactory=i,this.baseTransform=n}createPatternCanvas(t){const e=this.operatorList,s=this.bbox,a=this.xstep,r=this.ystep,o=this.paintType,l=this.tilingType,c=this.color,d=this.canvasGraphicsFactory;(0,i.info)("TilingType: "+l);const h=s[0],u=s[1],p=s[2],f=s[3],g=i.Util.singularValueDecompose2dScale(this.matrix),m=i.Util.singularValueDecompose2dScale(this.baseTransform),_=[g[0]*m[0],g[1]*m[1]],v=this.getSizeAndScale(a,this.ctx.canvas.width,_[0]),b=this.getSizeAndScale(r,this.ctx.canvas.height,_[1]),y=t.cachedCanvases.getCanvas("pattern",v.size,b.size,!0),A=y.context,P=d.createCanvasGraphics(A);P.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(P,o,c);let S=h,F=u,x=p,C=f;return h<0&&(S=0,x+=Math.abs(h)),u<0&&(F=0,C+=Math.abs(u)),A.translate(-v.scale*S,-b.scale*F),P.transform(v.scale,0,0,b.scale,0,0),A.save(),this.clipBbox(P,S,F,x,C),P.baseTransform=(0,n.getCurrentTransform)(P.ctx),P.executeOperatorList(e),P.endDrawing(),{canvas:y.canvas,scaleX:v.scale,scaleY:b.scale,offsetX:S,offsetY:F}}getSizeAndScale(t,e,s){t=Math.abs(t);const i=Math.max(g.MAX_PATTERN_SIZE,e);let n=Math.ceil(t*s);return n>=i?n=i:s=n/t,{scale:s,size:n}}clipBbox(t,e,s,i,a){const r=i-e,o=a-s;t.ctx.rect(e,s,r,o),t.current.updateRectMinMax((0,n.getCurrentTransform)(t.ctx),[e,s,i,a]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,s){const n=t.ctx,a=t.current;switch(e){case p:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,a.fillColor=t.fillStyle,a.strokeColor=t.strokeStyle;break;case f:const r=i.Util.makeHexColor(s[0],s[1],s[2]);n.fillStyle=r,n.strokeStyle=r,a.fillColor=r,a.strokeColor=r;break;default:throw new i.FormatError("Unsupported paint type: ".concat(e))}}getPattern(t,e,s,n){let r=s;n!==a.SHADING&&(r=i.Util.transform(r,e.baseTransform),this.matrix&&(r=i.Util.transform(r,this.matrix)));const o=this.createPatternCanvas(e);let l=new DOMMatrix(r);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");return c.setTransform(l),c}}_defineProperty(g,"MAX_PATTERN_SIZE",3e3),e.TilingPattern=g},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertBlackAndWhiteToRGBA=n,e.convertToRGBA=function(t){switch(t.kind){case i.ImageKind.GRAYSCALE_1BPP:return n(t);case i.ImageKind.RGB_24BPP:return function(t){let{src:e,srcPos:s=0,dest:n,destPos:a=0,width:r,height:o}=t,l=0;const c=e.length>>2,d=new Uint32Array(e.buffer,s,c);if(i.FeatureTest.isLittleEndian){for(;l<c-2;l+=3,a+=4){const t=d[l],e=d[l+1],s=d[l+2];n[a]=4278190080|t,n[a+1]=t>>>24|e<<8|4278190080,n[a+2]=e>>>16|s<<16|4278190080,n[a+3]=s>>>8|4278190080}for(let t=4*l,s=e.length;t<s;t+=3)n[a++]=e[t]|e[t+1]<<8|e[t+2]<<16|4278190080}else{for(;l<c-2;l+=3,a+=4){const t=d[l],e=d[l+1],s=d[l+2];n[a]=255|t,n[a+1]=t<<24|e>>>8|255,n[a+2]=e<<16|s>>>16|255,n[a+3]=s<<8|255}for(let t=4*l,s=e.length;t<s;t+=3)n[a++]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|255}return{srcPos:s,destPos:a}}(t)}return null},e.grayToRGBA=function(t,e){if(i.FeatureTest.isLittleEndian)for(let s=0,i=t.length;s<i;s++)e[s]=65793*t[s]|4278190080;else for(let s=0,i=t.length;s<i;s++)e[s]=16843008*t[s]|255};var i=s(1);function n(t){let{src:e,srcPos:s=0,dest:n,width:a,height:r,nonBlackColor:o=4294967295,inverseDecode:l=!1}=t;const c=i.FeatureTest.isLittleEndian?4278190080:255,[d,h]=l?[o,c]:[c,o],u=a>>3,p=7&a,f=e.length;n=new Uint32Array(n.buffer);let g=0;for(let i=0;i<r;i++){for(const i=s+u;s<i;s++){const t=s<f?e[s]:255;n[g++]=128&t?h:d,n[g++]=64&t?h:d,n[g++]=32&t?h:d,n[g++]=16&t?h:d,n[g++]=8&t?h:d,n[g++]=4&t?h:d,n[g++]=2&t?h:d,n[g++]=1&t?h:d}if(0===p)continue;const t=s<f?e[s++]:255;for(let e=0;e<p;e++)n[g++]=t&1<<7-e?h:d}return{srcPos:s,destPos:g}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;const s=Object.create(null);e.GlobalWorkerOptions=s,s.workerPort=null,s.workerSrc=""},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;var i=s(1);const n=1,a=2,r=1,o=2,l=3,c=4,d=5,h=6,u=7,p=8;function f(t){switch(t instanceof Error||"object"===typeof t&&null!==t||(0,i.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new i.AbortException(t.message);case"MissingPDFException":return new i.MissingPDFException(t.message);case"PasswordException":return new i.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new i.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new i.UnknownErrorException(t.message,t.details);default:return new i.UnknownErrorException(t.message,t.toString())}}var g=new WeakSet;function m(t){const e=t.streamId,s=this.sourceName,n=t.sourceName,a=this.comObj,r=this,o=this.actionHandler[t.action],h={enqueue(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=r,l>0&&this.desiredSize<=0&&(this.sinkCapability=new i.PromiseCapability,this.ready=this.sinkCapability.promise),a.postMessage({sourceName:s,targetName:n,stream:c,streamId:e,chunk:t},o)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:s,targetName:n,stream:l,streamId:e}),delete r.streamSinks[e])},error(t){(0,i.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:s,targetName:n,stream:d,streamId:e,reason:f(t)}))},sinkCapability:new i.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};h.sinkCapability.resolve(),h.ready=h.sinkCapability.promise,this.streamSinks[e]=h,new Promise((function(e){e(o(t.data,h))})).then((function(){a.postMessage({sourceName:s,targetName:n,stream:p,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:n,stream:p,streamId:e,reason:f(t)})}))}function _(t){const e=t.streamId,s=this.sourceName,n=t.sourceName,a=this.comObj,m=this.streamControllers[e],_=this.streamSinks[e];switch(t.stream){case p:t.success?m.startCall.resolve():m.startCall.reject(f(t.reason));break;case u:t.success?m.pullCall.resolve():m.pullCall.reject(f(t.reason));break;case h:if(!_){a.postMessage({sourceName:s,targetName:n,stream:u,streamId:e,success:!0});break}_.desiredSize<=0&&t.desiredSize>0&&_.sinkCapability.resolve(),_.desiredSize=t.desiredSize,new Promise((function(t){var e;t(null===(e=_.onPull)||void 0===e?void 0:e.call(_))})).then((function(){a.postMessage({sourceName:s,targetName:n,stream:u,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:n,stream:u,streamId:e,reason:f(t)})}));break;case c:if((0,i.assert)(m,"enqueue should have stream controller"),m.isClosed)break;m.controller.enqueue(t.chunk);break;case l:if((0,i.assert)(m,"close should have stream controller"),m.isClosed)break;m.isClosed=!0,m.controller.close(),_assertClassBrand(g,this,v).call(this,m,e);break;case d:(0,i.assert)(m,"error should have stream controller"),m.controller.error(f(t.reason)),_assertClassBrand(g,this,v).call(this,m,e);break;case o:t.success?m.cancelCall.resolve():m.cancelCall.reject(f(t.reason)),_assertClassBrand(g,this,v).call(this,m,e);break;case r:if(!_)break;new Promise((function(e){var s;e(null===(s=_.onCancel)||void 0===s?void 0:s.call(_,f(t.reason)))})).then((function(){a.postMessage({sourceName:s,targetName:n,stream:o,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:n,stream:o,streamId:e,reason:f(t)})})),_.sinkCapability.reject(f(t.reason)),_.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async function v(t,e){var s,i,n;await Promise.allSettled([null===(s=t.startCall)||void 0===s?void 0:s.promise,null===(i=t.pullCall)||void 0===i?void 0:i.promise,null===(n=t.cancelCall)||void 0===n?void 0:n.promise]),delete this.streamControllers[e]}e.MessageHandler=class{constructor(t,e,s){_classPrivateMethodInitSpec(this,g),this.sourceName=t,this.targetName=e,this.comObj=s,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream)return void _assertClassBrand(g,this,_).call(this,e);if(e.callback){const t=e.callbackId,s=this.callbackCapabilities[t];if(!s)throw new Error("Cannot resolve callback ".concat(t));if(delete this.callbackCapabilities[t],e.callback===n)s.resolve(e.data);else{if(e.callback!==a)throw new Error("Unexpected callback case");s.reject(f(e.reason))}return}const i=this.actionHandler[e.action];if(!i)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){const t=this.sourceName,r=e.sourceName;new Promise((function(t){t(i(e.data))})).then((function(i){s.postMessage({sourceName:t,targetName:r,callback:n,callbackId:e.callbackId,data:i})}),(function(i){s.postMessage({sourceName:t,targetName:r,callback:a,callbackId:e.callbackId,reason:f(i)})}))}else e.streamId?_assertClassBrand(g,this,m).call(this,e):i(e.data)},s.addEventListener("message",this._onComObjOnMessage)}on(t,e){const s=this.actionHandler;if(s[t])throw new Error('There is already an actionName called "'.concat(t,'"'));s[t]=e}send(t,e,s){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},s)}sendWithPromise(t,e,s){const n=this.callbackId++,a=new i.PromiseCapability;this.callbackCapabilities[n]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},s)}catch(r){a.reject(r)}return a.promise}sendWithStream(t,e,s,n){const a=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:s=>{const r=new i.PromiseCapability;return this.streamControllers[a]={controller:s,startCall:r,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:o,targetName:l,action:t,streamId:a,data:e,desiredSize:s.desiredSize},n),r.promise},pull:t=>{const e=new i.PromiseCapability;return this.streamControllers[a].pullCall=e,c.postMessage({sourceName:o,targetName:l,stream:h,streamId:a,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,i.assert)(t instanceof Error,"cancel must have a valid reason");const e=new i.PromiseCapability;return this.streamControllers[a].cancelCall=e,this.streamControllers[a].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:r,streamId:a,reason:f(t)}),e.promise}},s)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var i=s(1),n=new WeakMap,a=new WeakMap;e.Metadata=class{constructor(t){let{parsedData:e,rawData:s}=t;_classPrivateFieldInitSpec(this,n,void 0),_classPrivateFieldInitSpec(this,a,void 0),_classPrivateFieldSet(n,this,e),_classPrivateFieldSet(a,this,s)}getRaw(){return _classPrivateFieldGet(a,this)}get(t){var e;return null!==(e=_classPrivateFieldGet(n,this).get(t))&&void 0!==e?e:null}getAll(){return(0,i.objectFromMap)(_classPrivateFieldGet(n,this))}has(t){return _classPrivateFieldGet(n,this).has(t)}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var i=s(1),n=s(8);const a=Symbol("INTERNAL");var r=new WeakMap;class o{constructor(t,e){_classPrivateFieldInitSpec(this,r,!0),this.name=t,this.intent=e}get visible(){return _classPrivateFieldGet(r,this)}_setVisible(t,e){t!==a&&(0,i.unreachable)("Internal method `_setVisible` called."),_classPrivateFieldSet(r,this,e)}}var l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakSet;function p(t){const e=t.length;if(e<2)return!0;const s=t[0];for(let n=1;n<e;n++){const e=t[n];let a;if(Array.isArray(e))a=_assertClassBrand(u,this,p).call(this,e);else{if(!_classPrivateFieldGet(c,this).has(e))return(0,i.warn)("Optional content group not found: ".concat(e)),!0;a=_classPrivateFieldGet(c,this).get(e).visible}switch(s){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return"And"===s}e.OptionalContentConfig=class{constructor(t){if(_classPrivateMethodInitSpec(this,u),_classPrivateFieldInitSpec(this,l,null),_classPrivateFieldInitSpec(this,c,new Map),_classPrivateFieldInitSpec(this,d,null),_classPrivateFieldInitSpec(this,h,null),this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,_classPrivateFieldSet(h,this,t.order);for(const e of t.groups)_classPrivateFieldGet(c,this).set(e.id,new o(e.name,e.intent));if("OFF"===t.baseState)for(const t of _classPrivateFieldGet(c,this).values())t._setVisible(a,!1);for(const e of t.on)_classPrivateFieldGet(c,this).get(e)._setVisible(a,!0);for(const e of t.off)_classPrivateFieldGet(c,this).get(e)._setVisible(a,!1);_classPrivateFieldSet(d,this,this.getHash())}}isVisible(t){if(0===_classPrivateFieldGet(c,this).size)return!0;if(!t)return(0,i.warn)("Optional content group not defined."),!0;if("OCG"===t.type)return _classPrivateFieldGet(c,this).has(t.id)?_classPrivateFieldGet(c,this).get(t.id).visible:((0,i.warn)("Optional content group not found: ".concat(t.id)),!0);if("OCMD"===t.type){if(t.expression)return _assertClassBrand(u,this,p).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(c,this).has(e))return(0,i.warn)("Optional content group not found: ".concat(e)),!0;if(_classPrivateFieldGet(c,this).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(c,this).has(e))return(0,i.warn)("Optional content group not found: ".concat(e)),!0;if(!_classPrivateFieldGet(c,this).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(c,this).has(e))return(0,i.warn)("Optional content group not found: ".concat(e)),!0;if(!_classPrivateFieldGet(c,this).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(c,this).has(e))return(0,i.warn)("Optional content group not found: ".concat(e)),!0;if(_classPrivateFieldGet(c,this).get(e).visible)return!1}return!0}return(0,i.warn)("Unknown optional content policy ".concat(t.policy,".")),!0}return(0,i.warn)("Unknown group type ".concat(t.type,".")),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];_classPrivateFieldGet(c,this).has(t)?(_classPrivateFieldGet(c,this).get(t)._setVisible(a,!!e),_classPrivateFieldSet(l,this,null)):(0,i.warn)("Optional content group not found: ".concat(t))}get hasInitialVisibility(){return this.getHash()===_classPrivateFieldGet(d,this)}getOrder(){return _classPrivateFieldGet(c,this).size?_classPrivateFieldGet(h,this)?_classPrivateFieldGet(h,this).slice():[..._classPrivateFieldGet(c,this).keys()]:null}getGroups(){return _classPrivateFieldGet(c,this).size>0?(0,i.objectFromMap)(_classPrivateFieldGet(c,this)):null}getGroup(t){return _classPrivateFieldGet(c,this).get(t)||null}getHash(){if(null!==_classPrivateFieldGet(l,this))return _classPrivateFieldGet(l,this);const t=new n.MurmurHash3_64;for(const[e,s]of _classPrivateFieldGet(c,this))t.update("".concat(e,":").concat(s.visible));return _classPrivateFieldSet(l,this,t.hexdigest())}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0;var i=s(1),n=s(6);e.PDFDataTransportStream=class{constructor(t,e){let{length:s,initialData:n,progressiveDone:a=!1,contentDispositionFilename:r=null,disableRange:o=!1,disableStream:l=!1}=t;if((0,i.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=r,(null===n||void 0===n?void 0:n.length)>0){const t=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!l,this._isRangeSupported=!o,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})})),this._pdfDataRangeTransport.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})})),this._pdfDataRangeTransport.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){let{begin:e,chunk:s}=t;const n=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const t=this._rangeReaders.some((function(t){return t._begin===e&&(t._enqueue(n),!0)}));(0,i.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}_onProgress(t){var e,s,i,n;void 0===t.total?null===(e=this._rangeReaders[0])||void 0===e||null===(s=e.onProgress)||void 0===s||s.call(e,{loaded:t.loaded}):null===(i=this._fullRequestReader)||void 0===i||null===(n=i.onProgress)||void 0===n||n.call(i,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new a(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new r(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(s),s}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const s of this._rangeReaders.slice(0))s.cancel(t);this._pdfDataRangeTransport.abort()}};class a{constructor(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=s||!1,this._filename=(0,n.isPdfFile)(i)?i: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=new i.PromiseCapability;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 r{constructor(t,e,s){this._stream=t,this._begin=e,this._end=s,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;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)}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaText=void 0;class s{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){var n;if(!i)return;let a=null;const r=i.name;if("#text"===r)a=i.value;else{if(!s.shouldBuildText(r))return;null!==i&&void 0!==i&&null!==(n=i.attributes)&&void 0!==n&&n.textContent?a=i.attributes.textContent:i.value&&(a=i.value)}if(null!==a&&e.push({str:a}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=s},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeFilterFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var i=s(7);const n=function(t){return new Promise(((e,s)=>{__webpack_require__(23237).readFile(t,((t,i)=>{!t&&i?e(new Uint8Array(i)):s(new Error(t))}))}))};class a extends i.BaseFilterFactory{}e.NodeFilterFactory=a;class r extends i.BaseCanvasFactory{_createCanvas(t,e){return __webpack_require__(17640).createCanvas(t,e)}}e.NodeCanvasFactory=r;class o extends i.BaseCMapReaderFactory{_fetchData(t,e){return n(t).then((t=>({cMapData:t,compressionType:e})))}}e.NodeCMapReaderFactory=o;class l extends i.BaseStandardFontDataFactory{_fetchData(t){return n(t)}}e.NodeStandardFontDataFactory=l},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var i=s(1),n=s(22);const a=__webpack_require__(23237),r=__webpack_require__(97492),o=__webpack_require__(31815),l=__webpack_require__(66671),c=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class{constructor(t){this.source=t,this.url=function(t){const e=l.parse(t);return"file:"===e.protocol||e.host?e:/^[a-z]:[/\\]/i.test(t)?l.parse("file:///".concat(t)):(e.host||(e.protocol="file:"),e)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new g(this):new p(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=this.isFsUrl?new m(this,t,e):new f(this,t,e);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}};class d{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=new i.PromiseCapability,this._headersCapability=new i.PromiseCapability}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 t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=new i.PromiseCapability,this.read()):(this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class h{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new i.PromiseCapability;const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=new i.PromiseCapability,this.read()):(this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function u(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class p extends d{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new i.MissingPDFException('Missing PDF "'.concat(this._url,'".'));return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const s=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:a,suggestedLength:r}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:s,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=r||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(s)};this._request=null,"http:"===this._url.protocol?this._request=r.request(u(this._url,t.httpHeaders),e):this._request=o.request(u(this._url,t.httpHeaders),e),this._request.on("error",(t=>{this._storedError=t,this._headersCapability.reject(t)})),this._request.end()}}class f extends h{constructor(t,e,s){super(t),this._httpHeaders={};for(const i in t.httpHeaders){const e=t.httpHeaders[i];void 0!==e&&(this._httpHeaders[i]=e)}this._httpHeaders.Range="bytes=".concat(e,"-").concat(s-1);const n=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new i.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=t}};this._request=null,"http:"===this._url.protocol?this._request=r.request(u(this._url,this._httpHeaders),n):this._request=o.request(u(this._url,this._httpHeaders),n),this._request.on("error",(t=>{this._storedError=t})),this._request.end()}}class g extends d{constructor(t){super(t);let e=decodeURIComponent(this._url.path);c.test(this._url.href)&&(e=e.replace(/^\//,"")),a.lstat(e,((t,s)=>{if(t)return"ENOENT"===t.code&&(t=new i.MissingPDFException('Missing PDF "'.concat(e,'".'))),this._storedError=t,void this._headersCapability.reject(t);this._contentLength=s.size,this._setReadableStream(a.createReadStream(e)),this._headersCapability.resolve()}))}}class m extends h{constructor(t,e,s){super(t);let i=decodeURIComponent(this._url.path);c.test(this._url.href)&&(i=i.replace(/^\//,"")),this._setReadableStream(a.createReadStream(i,{start:e,end:s-1}))}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=function(t,e){return 404===t||0===t&&e.startsWith("file:")?new i.MissingPDFException('Missing PDF "'+e+'".'):new i.UnexpectedResponseException("Unexpected server response (".concat(t,') while retrieving PDF "').concat(e,'".'),t)},e.extractFilenameFromHeader=function(t){const e=t("Content-Disposition");if(e){let t=(0,n.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(s){}if((0,a.isPdfFile)(t))return t}return null},e.validateRangeRequestCapabilities=function(t){let{getResponseHeader:e,isHttp:s,rangeChunkSize:i,disableRange:n}=t;const a={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(e("Content-Length"),10);return Number.isInteger(r)?(a.suggestedLength=r,r<=2*i||n||!s||"bytes"!==e("Accept-Ranges")||"identity"!==(e("Content-Encoding")||"identity")||(a.allowRangeRequests=!0),a):a},e.validateResponseStatus=function(t){return 200===t||206===t};var i=s(1),n=s(23),a=s(6)},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=function(t){let e=!0,s=n("filename\\*","i").exec(t);if(s){s=s[1];let t=o(s);return t=unescape(t),t=l(t),t=c(t),r(t)}if(s=function(t){const e=[];let s;const i=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(s=i.exec(t));){let[,t,i,n]=s;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[i,n]}const a=[];for(let n=0;n<e.length&&n in e;++n){let[t,s]=e[n];s=o(s),t&&(s=unescape(s),0===n&&(s=l(s))),a.push(s)}return a.join("")}(t),s)return r(c(s));if(s=n("filename","i").exec(t),s){s=s[1];let t=o(s);return t=c(t),r(t)}function n(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function a(t,s){if(t){if(!/^[\x00-\xFF]+$/.test(s))return s;try{const n=new TextDecoder(t,{fatal:!0}),a=(0,i.stringToBytes)(s);s=n.decode(a),e=!1}catch(n){}}return s}function r(t){return e&&/[\x80-\xff]/.test(t)&&(t=a("utf-8",t),e&&(t=a("iso-8859-1",t))),t}function o(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const s=e[t].indexOf('"');-1!==s&&(e[t]=e[t].slice(0,s),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function l(t){const e=t.indexOf("'");return-1===e?t:a(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function c(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,s,i){if("q"===s||"Q"===s)return a(e,i=(i=i.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{i=atob(i)}catch(n){}return a(e,i)}))}return""};var i=s(1)},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0;var i=s(1),n=s(22);class a{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,s){const i={begin:t,end:e};for(const n in s)i[n]=s[n];return this.request(i)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,s=this.currXhrId++,i=this.pendingRequests[s]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const n in this.httpHeaders){const t=this.httpHeaders[n];void 0!==t&&e.setRequestHeader(n,t)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1)),i.expectedStatus=206):i.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(s){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,s),e.onprogress=this.onProgress.bind(this,s),i.onHeadersReceived=t.onHeadersReceived,i.onDone=t.onDone,i.onError=t.onError,i.onProgress=t.onProgress,e.send(null),s}onProgress(t,e){var s;const i=this.pendingRequests[t];i&&(null===(s=i.onProgress)||void 0===s||s.call(i,e))}onStateChange(t,e){const s=this.pendingRequests[t];if(!s)return;const n=s.xhr;if(n.readyState>=2&&s.onHeadersReceived&&(s.onHeadersReceived(),delete s.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;var a;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void(null===(a=s.onError)||void 0===a||a.call(s,n.status));const r=n.status||200;var o;if((200!==r||206!==s.expectedStatus)&&r!==s.expectedStatus)return void(null===(o=s.onError)||void 0===o||o.call(s,n.status));const l=function(t){const e=t.response;return"string"!==typeof e?e:(0,i.stringToBytes)(e).buffer}(n);if(206===r){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);s.onDone({begin:parseInt(e[1],10),chunk:l})}else if(l)s.onDone({begin:0,chunk:l});else{var c;null===(c=s.onError)||void 0===c||c.call(s,n.status)}}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}e.PDFNetworkStream=class{constructor(t){this._source=t,this._manager=new a(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new r(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const s=new o(this._manager,t,e);return s.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}};class r{constructor(t,e){this._manager=t;const s={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(s),this._headersReceivedCapability=new i.PromiseCapability,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),s=t=>e.getResponseHeader(t),{allowRangeRequests:i,suggestedLength:a}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:s,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(s),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=(0,n.createResponseStatusError)(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null===(e=this.onProgress)||void 0===e||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._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.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 o{constructor(t,e,s){this._manager=t;const i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,s,i),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=(0,n.createResponseStatusError)(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;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()}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var i=s(1),n=s(22);function a(t,e,s){return{method:"GET",headers:t,signal:s.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function r(t){const e=new Headers;for(const s in t){const i=t[s];void 0!==i&&e.append(s,i)}return e}function o(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:((0,i.warn)("getArrayBuffer - unexpected data format: ".concat(t)),new Uint8Array(t).buffer)}e.PDFFetchStream=class{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new l(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new c(this,t,e);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}};class l{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=new i.PromiseCapability,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,this._headers=r(this._stream.httpHeaders);const s=e.url;fetch(s,a(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,s);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:a,suggestedLength:r}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=r||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new i.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._headersCapability.promise;const{value:e,done:s}=await this._reader.read();return s?{value:e,done:s}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:o(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class c{constructor(t,e,s){this._stream=t,this._reader=null,this._loaded=0;const o=t.source;this._withCredentials=o.withCredentials||!1,this._readCapability=new i.PromiseCapability,this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController,this._headers=r(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(e,"-").concat(s-1));const l=o.url;fetch(l,a(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,l);this._readCapability.resolve(),this._reader=t.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;const{value:e,done:s}=await this._reader.read();return s?{value:e,done:s}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),{value:o(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayerRenderTask=void 0,e.renderTextLayer=function(t){t.textContentSource||!t.textContent&&!t.textContentStream||((0,n.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),t.textContentSource=t.textContent||t.textContentStream);const{container:e,viewport:s}=t,i=getComputedStyle(e),a=i.getPropertyValue("visibility"),r=parseFloat(i.getPropertyValue("--scale-factor"));"visible"===a&&(!r||Math.abs(r-s.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const o=new h(t);return o._render(),o},e.updateTextLayer=function(t){let{container:e,viewport:s,textDivs:i,textDivProperties:a,isOffscreenCanvasSupported:r,mustRotate:o=!0,mustRescale:c=!0}=t;if(o&&(0,n.setLayerDimensions)(e,{rotation:s.rotation}),c){const t=l(0,r),e={prevFontSize:null,prevFontFamily:null,div:null,scale:s.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(const s of i)e.properties=a.get(s),e.div=s,d(e)}};var i=s(1),n=s(6);const a=30,r=.8,o=new Map;function l(t,e){let s;if(e&&i.FeatureTest.isOffscreenCanvasSupported)s=new OffscreenCanvas(t,t).getContext("2d",{alpha:!1});else{const e=document.createElement("canvas");e.width=e.height=t,s=e.getContext("2d",{alpha:!1})}return s}function c(t,e,s){const n=document.createElement("span"),c={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(n);const d=i.Util.transform(t._transform,e.transform);let h=Math.atan2(d[1],d[0]);const u=s[e.fontName];u.vertical&&(h+=Math.PI/2);const p=Math.hypot(d[2],d[3]),f=p*function(t,e){const s=o.get(t);if(s)return s;const i=l(a,e);i.font="".concat(a,"px ").concat(t);const n=i.measureText("");let c=n.fontBoundingBoxAscent,d=Math.abs(n.fontBoundingBoxDescent);if(c){const e=c/(c+d);return o.set(t,e),i.canvas.width=i.canvas.height=0,e}i.strokeStyle="red",i.clearRect(0,0,a,a),i.strokeText("g",0,0);let h=i.getImageData(0,0,a,a).data;d=0;for(let r=h.length-1-3;r>=0;r-=4)if(h[r]>0){d=Math.ceil(r/4/a);break}i.clearRect(0,0,a,a),i.strokeText("A",0,a),h=i.getImageData(0,0,a,a).data,c=0;for(let r=0,o=h.length;r<o;r+=4)if(h[r]>0){c=a-Math.floor(r/4/a);break}if(i.canvas.width=i.canvas.height=0,c){const e=c/(c+d);return o.set(t,e),e}return o.set(t,r),r}(u.fontFamily,t._isOffscreenCanvasSupported);let g,m;0===h?(g=d[4],m=d[5]-f):(g=d[4]+f*Math.sin(h),m=d[5]-f*Math.cos(h));const _="calc(var(--scale-factor)*",v=n.style;t._container===t._rootContainer?(v.left="".concat((100*g/t._pageWidth).toFixed(2),"%"),v.top="".concat((100*m/t._pageHeight).toFixed(2),"%")):(v.left="".concat(_).concat(g.toFixed(2),"px)"),v.top="".concat(_).concat(m.toFixed(2),"px)")),v.fontSize="".concat(_).concat(p.toFixed(2),"px)"),v.fontFamily=u.fontFamily,c.fontSize=p,n.setAttribute("role","presentation"),n.textContent=e.str,n.dir=e.dir,t._fontInspectorEnabled&&(n.dataset.fontName=e.fontName),0!==h&&(c.angle=h*(180/Math.PI));let b=!1;if(e.str.length>1)b=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),s=Math.abs(e.transform[3]);t!==s&&Math.max(t,s)/Math.min(t,s)>1.5&&(b=!0)}b&&(c.canvasWidth=u.vertical?e.height:e.width),t._textDivProperties.set(n,c),t._isReadableStream&&t._layoutText(n)}function d(t){const{div:e,scale:s,properties:i,ctx:n,prevFontSize:a,prevFontFamily:r}=t,{style:o}=e;let l="";if(0!==i.canvasWidth&&i.hasText){const{fontFamily:c}=o,{canvasWidth:d,fontSize:h}=i;a===h&&r===c||(n.font="".concat(h*s,"px ").concat(c),t.prevFontSize=h,t.prevFontFamily=c);const{width:u}=n.measureText(e.textContent);u>0&&(l="scaleX(".concat(d*s/u,")"))}0!==i.angle&&(l="rotate(".concat(i.angle,"deg) ").concat(l)),l.length>0&&(o.transform=l)}class h{constructor(t){var e;let{textContentSource:s,container:a,viewport:r,textDivs:o,textDivProperties:c,textContentItemsStr:d,isOffscreenCanvasSupported:h}=t;this._textContentSource=s,this._isReadableStream=s instanceof ReadableStream,this._container=this._rootContainer=a,this._textDivs=o||[],this._textContentItemsStr=d||[],this._isOffscreenCanvasSupported=h,this._fontInspectorEnabled=!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled),this._reader=null,this._textDivProperties=c||new WeakMap,this._canceled=!1,this._capability=new i.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:r.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:l(0,h)};const{pageWidth:u,pageHeight:p,pageX:f,pageY:g}=r.rawDims;this._transform=[1,0,0,-1,-f,g+p],this._pageWidth=u,this._pageHeight=p,(0,n.setLayerDimensions)(a,r),this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new i.AbortException("TextLayer task cancelled.")).catch((()=>{})),this._reader=null),this._capability.reject(new i.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(const s of t)if(void 0!==s.str)this._textContentItemsStr.push(s.str),c(this,s,e);else if("beginMarkedContentProps"===s.type||"beginMarkedContent"===s.type){const t=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==s.id&&this._container.setAttribute("id","".concat(s.id)),t.append(this._container)}else"endMarkedContent"===s.type&&(this._container=this._container.parentNode)}_layoutText(t){const e=this._layoutTextParams.properties=this._textDivProperties.get(t);if(this._layoutTextParams.div=t,d(this._layoutTextParams),e.hasText&&this._container.append(t),e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this._container.append(t)}}_render(){const t=new i.PromiseCapability;let e=Object.create(null);if(this._isReadableStream){const s=()=>{this._reader.read().then((i=>{let{value:n,done:a}=i;a?t.resolve():(Object.assign(e,n.styles),this._processItems(n.items,e),s())}),t.reject)};this._reader=this._textContentSource.getReader(),s()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:e,styles:s}=this._textContentSource;this._processItems(e,s),t.resolve()}}t.promise.then((()=>{e=null,function(t){if(t._canceled)return;const e=t._textDivs,s=t._capability;if(e.length>1e5)s.resolve();else{if(!t._isReadableStream)for(const s of e)t._layoutText(s);s.resolve()}}(this)}),this._capability.reject)}}e.TextLayerRenderTask=h},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditorLayer=void 0;var i=s(1),n=s(5),a=s(28),r=s(29),o=s(6),l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,m=new WeakSet;class _{constructor(t){_classPrivateMethodInitSpec(this,m),_classPrivateFieldInitSpec(this,l,void 0),_classPrivateFieldInitSpec(this,c,!1),_classPrivateFieldInitSpec(this,d,this.pointerup.bind(this)),_classPrivateFieldInitSpec(this,h,this.pointerdown.bind(this)),_classPrivateFieldInitSpec(this,u,new Map),_classPrivateFieldInitSpec(this,p,!1),_classPrivateFieldInitSpec(this,f,!1),_classPrivateFieldInitSpec(this,g,void 0),_._initialized||(_._initialized=!0,a.FreeTextEditor.initialize(t.l10n),r.InkEditor.initialize(t.l10n)),t.uiManager.registerEditorTypes([a.FreeTextEditor,r.InkEditor]),_classPrivateFieldSet(g,this,t.uiManager),this.pageIndex=t.pageIndex,this.div=t.div,_classPrivateFieldSet(l,this,t.accessibilityManager),_classPrivateFieldGet(g,this).addLayer(this)}get isEmpty(){return 0===_classPrivateFieldGet(u,this).size}updateToolbar(t){_classPrivateFieldGet(g,this).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_classPrivateFieldGet(g,this).getMode();_assertClassBrand(m,this,A).call(this),t===i.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),_classPrivateFieldGet(g,this).unselectAll(),t!==i.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",t===i.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",t===i.AnnotationEditorType.INK),this.div.hidden=!1)}addInkEditorIfNeeded(t){if(t||_classPrivateFieldGet(g,this).getMode()===i.AnnotationEditorType.INK){if(!t)for(const t of _classPrivateFieldGet(u,this).values())if(t.isEmpty())return void t.setInBackground();_assertClassBrand(m,this,y).call(this,{offsetX:0,offsetY:0}).setInBackground()}}setEditingState(t){_classPrivateFieldGet(g,this).setEditingState(t)}addCommands(t){_classPrivateFieldGet(g,this).addCommands(t)}enable(){this.div.style.pointerEvents="auto";for(const t of _classPrivateFieldGet(u,this).values())t.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const t of _classPrivateFieldGet(u,this).values())t.disableEditing();_assertClassBrand(m,this,A).call(this),this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(t){_classPrivateFieldGet(g,this).getActive()!==t&&_classPrivateFieldGet(g,this).setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",_classPrivateFieldGet(h,this)),this.div.addEventListener("pointerup",_classPrivateFieldGet(d,this))}disableClick(){this.div.removeEventListener("pointerdown",_classPrivateFieldGet(h,this)),this.div.removeEventListener("pointerup",_classPrivateFieldGet(d,this))}attach(t){_classPrivateFieldGet(u,this).set(t.id,t)}detach(t){var e;_classPrivateFieldGet(u,this).delete(t.id),null===(e=_classPrivateFieldGet(l,this))||void 0===e||e.removePointerInTextLayer(t.contentDiv)}remove(t){_classPrivateFieldGet(g,this).removeEditor(t),this.detach(t),t.div.style.display="none",setTimeout((()=>{t.div.style.display="",t.div.remove(),t.isAttachedToDOM=!1,document.activeElement===document.body&&_classPrivateFieldGet(g,this).focusMainContainer()}),0),_classPrivateFieldGet(f,this)||this.addInkEditorIfNeeded(!1)}add(t){if(_assertClassBrand(m,this,v).call(this,t),_classPrivateFieldGet(g,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}this.moveEditorInDOM(t),t.onceAdded(),_classPrivateFieldGet(g,this).addToAnnotationStorage(t)}moveEditorInDOM(t){var e;null===(e=_classPrivateFieldGet(l,this))||void 0===e||e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addANewEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!0})}addUndoableEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!1})}getNextId(){return _classPrivateFieldGet(g,this).getId()}deserialize(t){switch(t.annotationType){case i.AnnotationEditorType.FREETEXT:return a.FreeTextEditor.deserialize(t,this,_classPrivateFieldGet(g,this));case i.AnnotationEditorType.INK:return r.InkEditor.deserialize(t,this,_classPrivateFieldGet(g,this))}return null}setSelected(t){_classPrivateFieldGet(g,this).setSelected(t)}toggleSelected(t){_classPrivateFieldGet(g,this).toggleSelected(t)}isSelected(t){return _classPrivateFieldGet(g,this).isSelected(t)}unselect(t){_classPrivateFieldGet(g,this).unselect(t)}pointerup(t){const{isMac:e}=i.FeatureTest.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&_classPrivateFieldGet(p,this)&&(_classPrivateFieldSet(p,this,!1),_classPrivateFieldGet(c,this)?_assertClassBrand(m,this,y).call(this,t):_classPrivateFieldSet(c,this,!0))}pointerdown(t){const{isMac:e}=i.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;_classPrivateFieldSet(p,this,!0);const s=_classPrivateFieldGet(g,this).getActive();_classPrivateFieldSet(c,this,!s||s.isEmpty())}drop(t){const e=t.dataTransfer.getData("text/plain"),s=_classPrivateFieldGet(g,this).getEditor(e);if(!s)return;t.preventDefault(),t.dataTransfer.dropEffect="move",_assertClassBrand(m,this,v).call(this,s);const i=this.div.getBoundingClientRect(),n=t.clientX-i.x,a=t.clientY-i.y;s.translate(n-s.startX,a-s.startY),this.moveEditorInDOM(s),s.div.focus()}dragover(t){t.preventDefault()}destroy(){var t;(null===(t=_classPrivateFieldGet(g,this).getActive())||void 0===t?void 0:t.parent)===this&&_classPrivateFieldGet(g,this).setActiveEditor(null);for(const s of _classPrivateFieldGet(u,this).values()){var e;null===(e=_classPrivateFieldGet(l,this))||void 0===e||e.removePointerInTextLayer(s.contentDiv),s.setParent(null),s.isAttachedToDOM=!1,s.div.remove()}this.div=null,_classPrivateFieldGet(u,this).clear(),_classPrivateFieldGet(g,this).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e,(0,o.setLayerDimensions)(this.div,e),(0,n.bindEvents)(this,this.div,["dragover","drop"]);for(const s of _classPrivateFieldGet(g,this).getEditors(this.pageIndex))this.add(s);this.updateMode()}update(t){let{viewport:e}=t;_classPrivateFieldGet(g,this).commitOrRemove(),this.viewport=e,(0,o.setLayerDimensions)(this.div,{rotation:e.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}function v(t){var e;t.parent!==this&&(this.attach(t),null===(e=t.parent)||void 0===e||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}function b(t){switch(_classPrivateFieldGet(g,this).getMode()){case i.AnnotationEditorType.FREETEXT:return new a.FreeTextEditor(t);case i.AnnotationEditorType.INK:return new r.InkEditor(t)}return null}function y(t){const e=this.getNextId(),s=_assertClassBrand(m,this,b).call(this,{parent:this,id:e,x:t.offsetX,y:t.offsetY,uiManager:_classPrivateFieldGet(g,this)});return s&&this.add(s),s}function A(){_classPrivateFieldSet(f,this,!0);for(const t of _classPrivateFieldGet(u,this).values())t.isEmpty()&&t.remove();_classPrivateFieldSet(f,this,!1)}_defineProperty(_,"_initialized",!1),e.AnnotationEditorLayer=_},(t,e,s)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.FreeTextEditor=void 0;var n=s(1),a=s(5),r=s(4),o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,m=new WeakSet;class _ extends r.AnnotationEditor{constructor(t){super({...t,name:"freeTextEditor"}),_classPrivateMethodInitSpec(this,m),_classPrivateFieldInitSpec(this,o,this.editorDivBlur.bind(this)),_classPrivateFieldInitSpec(this,l,this.editorDivFocus.bind(this)),_classPrivateFieldInitSpec(this,c,this.editorDivInput.bind(this)),_classPrivateFieldInitSpec(this,d,this.editorDivKeydown.bind(this)),_classPrivateFieldInitSpec(this,h,void 0),_classPrivateFieldInitSpec(this,u,""),_classPrivateFieldInitSpec(this,p,"".concat(this.id,"-editor")),_classPrivateFieldInitSpec(this,f,!1),_classPrivateFieldInitSpec(this,g,void 0),_classPrivateFieldSet(h,this,t.color||_._defaultColor||r.AnnotationEditor._defaultLineColor),_classPrivateFieldSet(g,this,t.fontSize||_._defaultFontSize)}static initialize(t){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map((e=>[e,t.get(e)])));const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case n.AnnotationEditorParamsType.FREETEXT_SIZE:_._defaultFontSize=e;break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:_._defaultColor=e}}updateParams(t,e){switch(t){case n.AnnotationEditorParamsType.FREETEXT_SIZE:_assertClassBrand(m,this,v).call(this,e);break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:_assertClassBrand(m,this,b).call(this,e)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,_._defaultFontSize],[n.AnnotationEditorParamsType.FREETEXT_COLOR,_._defaultColor||r.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,_classPrivateFieldGet(g,this)],[n.AnnotationEditorParamsType.FREETEXT_COLOR,_classPrivateFieldGet(h,this)]]}getInitialTranslation(){const t=this.parentScale;return[-_._internalPadding*t,-(_._internalPadding+_classPrivateFieldGet(g,this))*t]}rebuild(){super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(n.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",_classPrivateFieldGet(d,this)),this.editorDiv.addEventListener("focus",_classPrivateFieldGet(l,this)),this.editorDiv.addEventListener("blur",_classPrivateFieldGet(o,this)),this.editorDiv.addEventListener("input",_classPrivateFieldGet(c,this)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",_classPrivateFieldGet(p,this)),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",_classPrivateFieldGet(d,this)),this.editorDiv.removeEventListener("focus",_classPrivateFieldGet(l,this)),this.editorDiv.removeEventListener("blur",_classPrivateFieldGet(o,this)),this.editorDiv.removeEventListener("input",_classPrivateFieldGet(c,this)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(t){super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}commit(){this.isInEditMode()&&(super.commit(),_classPrivateFieldGet(f,this)||(_classPrivateFieldSet(f,this,!0),this.parent.addUndoableEditor(this)),this.disableEditMode(),_classPrivateFieldSet(u,this,_assertClassBrand(m,this,y).call(this).trimEnd()),_assertClassBrand(m,this,A).call(this))}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(t){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(t){_._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){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)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",_classPrivateFieldGet(p,this)),this.enableEditing(),_._l10nPromise.get("editor_free_text2_aria_label").then((t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("aria-label",t)})),_._l10nPromise.get("free_text2_default_content").then((t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("default-content",t)})),this.editorDiv.contentEditable=!0;const{style:s}=this.editorDiv;if(s.fontSize="calc(".concat(_classPrivateFieldGet(g,this),"px * var(--scale-factor))"),s.color=_classPrivateFieldGet(h,this),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,a.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[s,i]=this.parentDimensions;this.setAt(t*s,e*i,this.width*s,this.height*i);for(const t of _classPrivateFieldGet(u,this).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(t,e,s){const i=super.deserialize(t,e,s);return _classPrivateFieldSet(g,i,t.fontSize),_classPrivateFieldSet(h,i,n.Util.makeHexColor(...t.color)),_classPrivateFieldSet(u,i,t.value),i}serialize(){if(this.isEmpty())return null;const t=_._internalPadding*this.parentScale,e=this.getRect(t,t),s=r.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:_classPrivateFieldGet(h,this));return{annotationType:n.AnnotationEditorType.FREETEXT,color:s,fontSize:_classPrivateFieldGet(g,this),value:_classPrivateFieldGet(u,this),pageIndex:this.pageIndex,rect:e,rotation:this.rotation}}}function v(t){const e=t=>{this.editorDiv.style.fontSize="calc(".concat(t,"px * var(--scale-factor))"),this.translate(0,-(t-_classPrivateFieldGet(g,this))*this.parentScale),_classPrivateFieldSet(g,this,t),_assertClassBrand(m,this,A).call(this)},s=_classPrivateFieldGet(g,this);this.addCommands({cmd:()=>{e(t)},undo:()=>{e(s)},mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function b(t){const e=_classPrivateFieldGet(h,this);this.addCommands({cmd:()=>{_classPrivateFieldSet(h,this,this.editorDiv.style.color=t)},undo:()=>{_classPrivateFieldSet(h,this,this.editorDiv.style.color=e)},mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function y(){const t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;const e=[];for(const s of t)e.push(s.innerText.replace(/\r\n?|\n/,""));return e.join("\n")}function A(){const[t,e]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,i=e.style.display;e.style.display="hidden",t.div.append(this.div),s=e.getBoundingClientRect(),e.remove(),e.style.display=i}this.width=s.width/t,this.height=s.height/e}i=_,_defineProperty(_,"_freeTextDefaultContent",""),_defineProperty(_,"_l10nPromise",void 0),_defineProperty(_,"_internalPadding",0),_defineProperty(_,"_defaultColor",null),_defineProperty(_,"_defaultFontSize",10),_defineProperty(_,"_keyboardManager",new a.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],i.prototype.commitOrRemove]])),_defineProperty(_,"_type","freetext"),e.FreeTextEditor=_},(t,e,s)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.InkEditor=void 0,Object.defineProperty(e,"fitCurve",{enumerable:!0,get:function(){return r.fitCurve}});var n=s(1),a=s(4),r=s(30),o=s(5);const l=16;var c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,m=new WeakMap,_=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,A=new WeakMap,P=new WeakMap,S=new WeakSet;class F extends a.AnnotationEditor{constructor(t){super({...t,name:"inkEditor"}),_classPrivateMethodInitSpec(this,S),_classPrivateFieldInitSpec(this,c,0),_classPrivateFieldInitSpec(this,d,0),_classPrivateFieldInitSpec(this,h,0),_classPrivateFieldInitSpec(this,u,this.canvasPointermove.bind(this)),_classPrivateFieldInitSpec(this,p,this.canvasPointerleave.bind(this)),_classPrivateFieldInitSpec(this,f,this.canvasPointerup.bind(this)),_classPrivateFieldInitSpec(this,g,this.canvasPointerdown.bind(this)),_classPrivateFieldInitSpec(this,m,!1),_classPrivateFieldInitSpec(this,_,!1),_classPrivateFieldInitSpec(this,v,null),_classPrivateFieldInitSpec(this,b,null),_classPrivateFieldInitSpec(this,y,0),_classPrivateFieldInitSpec(this,A,0),_classPrivateFieldInitSpec(this,P,null),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(t){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map((e=>[e,t.get(e)])))}static updateDefaultParams(t,e){switch(t){case n.AnnotationEditorParamsType.INK_THICKNESS:F._defaultThickness=e;break;case n.AnnotationEditorParamsType.INK_COLOR:F._defaultColor=e;break;case n.AnnotationEditorParamsType.INK_OPACITY:F._defaultOpacity=e/100}}updateParams(t,e){switch(t){case n.AnnotationEditorParamsType.INK_THICKNESS:_assertClassBrand(S,this,x).call(this,e);break;case n.AnnotationEditorParamsType.INK_COLOR:_assertClassBrand(S,this,C).call(this,e);break;case n.AnnotationEditorParamsType.INK_OPACITY:_assertClassBrand(S,this,w).call(this,e)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.INK_THICKNESS,F._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,F._defaultColor||a.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*F._defaultOpacity)]]}get propertiesToUpdate(){var t;return[[n.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||F._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,this.color||F._defaultColor||a.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(null!==(t=this.opacity)&&void 0!==t?t:F._defaultOpacity))]]}rebuild(){super.rebuild(),null!==this.div&&(this.canvas||(_assertClassBrand(S,this,O).call(this),_assertClassBrand(S,this,L).call(this)),this.isAttachedToDOM||(this.parent.add(this),_assertClassBrand(S,this,G).call(this)),_assertClassBrand(S,this,z).call(this))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,_classPrivateFieldGet(b,this).disconnect(),_classPrivateFieldSet(b,this,null),super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,s=this.width*t,i=this.height*e;this.setDimensions(s,i)}enableEditMode(){_classPrivateFieldGet(m,this)||null===this.canvas||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",_classPrivateFieldGet(g,this)),this.canvas.addEventListener("pointerup",_classPrivateFieldGet(f,this)))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(g,this)),this.canvas.removeEventListener("pointerup",_classPrivateFieldGet(f,this)))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){_classPrivateFieldGet(m,this)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),_classPrivateFieldSet(m,this,!0),this.div.classList.add("disabled"),_assertClassBrand(S,this,z).call(this,!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus({preventScroll:!0}))}focusin(t){super.focusin(t),this.enableEditMode()}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!_classPrivateFieldGet(m,this)&&(this.setInForeground(),"mouse"!==t.type&&this.div.focus(),t.stopPropagation(),this.canvas.addEventListener("pointerleave",_classPrivateFieldGet(p,this)),this.canvas.addEventListener("pointermove",_classPrivateFieldGet(u,this)),_assertClassBrand(S,this,T).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.stopPropagation(),_assertClassBrand(S,this,M).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){0===t.button&&this.isInEditMode()&&0!==this.currentPath.length&&(t.stopPropagation(),_assertClassBrand(S,this,D).call(this,t),this.setInBackground())}canvasPointerleave(t){_assertClassBrand(S,this,D).call(this,t),this.setInBackground()}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),F._l10nPromise.get("editor_ink2_aria_label").then((t=>{var e;return null===(e=this.div)||void 0===e?void 0:e.setAttribute("aria-label",t)}));const[s,i,n,a]=_assertClassBrand(S,this,E).call(this);if(this.setAt(s,i,0,0),this.setDims(n,a),_assertClassBrand(S,this,O).call(this),this.width){const[s,i]=this.parentDimensions;this.setAt(t*s,e*i,this.width*s,this.height*i),_classPrivateFieldSet(_,this,!0),_assertClassBrand(S,this,G).call(this),this.setDims(this.width*s,this.height*i),_assertClassBrand(S,this,I).call(this),_assertClassBrand(S,this,X).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return _assertClassBrand(S,this,L).call(this),this.div}setDimensions(t,e){const s=Math.round(t),i=Math.round(e);if(_classPrivateFieldGet(y,this)===s&&_classPrivateFieldGet(A,this)===i)return;_classPrivateFieldSet(y,this,s),_classPrivateFieldSet(A,this,i),this.canvas.style.visibility="hidden",_classPrivateFieldGet(c,this)&&Math.abs(_classPrivateFieldGet(c,this)-t/e)>.01&&(e=Math.ceil(t/_classPrivateFieldGet(c,this)),this.setDims(t,e));const[n,a]=this.parentDimensions;this.width=t/n,this.height=e/a,_classPrivateFieldGet(m,this)&&_assertClassBrand(S,this,N).call(this,t,e),_assertClassBrand(S,this,G).call(this),_assertClassBrand(S,this,I).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(t,e,s){const i=super.deserialize(t,e,s);i.thickness=t.thickness,i.color=n.Util.makeHexColor(...t.color),i.opacity=t.opacity;const[a,r]=i.pageDimensions,o=i.width*a,u=i.height*r,p=i.parentScale,f=t.thickness/2;_classPrivateFieldSet(c,i,o/u),_classPrivateFieldSet(m,i,!0),_classPrivateFieldSet(y,i,Math.round(o)),_classPrivateFieldSet(A,i,Math.round(u));for(const{bezier:n}of t.paths){const t=[];i.paths.push(t);let e=p*(n[0]-f),s=p*(u-n[1]-f);for(let i=2,r=n.length;i<r;i+=6){const a=p*(n[i]-f),r=p*(u-n[i+1]-f),o=p*(n[i+2]-f),l=p*(u-n[i+3]-f),c=p*(n[i+4]-f),d=p*(u-n[i+5]-f);t.push([[e,s],[a,r],[o,l],[c,d]]),e=c,s=d}const a=_assertClassBrand(F,this,j).call(this,t);i.bezierPath2D.push(a)}const g=_assertClassBrand(S,i,H).call(i);return _classPrivateFieldSet(h,i,Math.max(l,g[2]-g[0])),_classPrivateFieldSet(d,i,Math.max(l,g[3]-g[1])),_assertClassBrand(S,i,N).call(i,o,u),i}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=this.rotation%180===0?t[3]-t[1]:t[2]-t[0],s=a.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:n.AnnotationEditorType.INK,color:s,thickness:this.thickness,opacity:this.opacity,paths:_assertClassBrand(S,this,W).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:t,rotation:this.rotation}}}function x(t){const e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t,_assertClassBrand(S,this,z).call(this)},undo:()=>{this.thickness=e,_assertClassBrand(S,this,z).call(this)},mustExec:!0,type:n.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function C(t){const e=this.color;this.addCommands({cmd:()=>{this.color=t,_assertClassBrand(S,this,I).call(this)},undo:()=>{this.color=e,_assertClassBrand(S,this,I).call(this)},mustExec:!0,type:n.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function w(t){t/=100;const e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t,_assertClassBrand(S,this,I).call(this)},undo:()=>{this.opacity=e,_assertClassBrand(S,this,I).call(this)},mustExec:!0,type:n.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function E(){const{parentRotation:t,parentDimensions:[e,s]}=this;switch(t){case 90:return[0,s,s,e];case 180:return[e,s,e,s];case 270:return[e,0,s,e];default:return[0,0,e,s]}}function k(){const{ctx:t,color:e,opacity:s,thickness:i,parentScale:n,scaleFactor:a}=this;t.lineWidth=i*n/a,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle="".concat(e).concat((0,o.opacityToHex)(s))}function T(t,e){var s;this.isEditing=!0,_classPrivateFieldGet(_,this)||(_classPrivateFieldSet(_,this,!0),_assertClassBrand(S,this,G).call(this),this.thickness||(this.thickness=i._defaultThickness),this.color||(this.color=i._defaultColor||a.AnnotationEditor._defaultLineColor),null!==(s=this.opacity)&&void 0!==s||(this.opacity=i._defaultOpacity)),this.currentPath.push([t,e]),_classPrivateFieldSet(v,this,null),_assertClassBrand(S,this,k).call(this),this.ctx.beginPath(),this.ctx.moveTo(t,e),_classPrivateFieldSet(P,this,(()=>{_classPrivateFieldGet(P,this)&&(_classPrivateFieldGet(v,this)&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):_assertClassBrand(S,this,I).call(this),this.ctx.lineTo(..._classPrivateFieldGet(v,this)),_classPrivateFieldSet(v,this,null),this.ctx.stroke()),window.requestAnimationFrame(_classPrivateFieldGet(P,this)))})),window.requestAnimationFrame(_classPrivateFieldGet(P,this))}function M(t,e){const[s,i]=this.currentPath.at(-1);t===s&&e===i||(this.currentPath.push([t,e]),_classPrivateFieldSet(v,this,[t,e]))}function R(t,e){this.ctx.closePath(),_classPrivateFieldSet(P,this,null),t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height);const[s,n]=this.currentPath.at(-1);let a;if(t===s&&e===n||this.currentPath.push([t,e]),1!==this.currentPath.length)a=(0,r.fitCurve)(this.currentPath,30,null);else{const s=[t,e];a=[[s,s.slice(),s.slice(),s]]}const o=j.call(i,a);this.currentPath.length=0,this.addCommands({cmd:()=>{this.paths.push(a),this.bezierPath2D.push(o),this.rebuild()},undo:()=>{this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(_assertClassBrand(S,this,O).call(this),_assertClassBrand(S,this,L).call(this)),_assertClassBrand(S,this,z).call(this))},mustExec:!0})}function I(){if(this.isEmpty())return void _assertClassBrand(S,this,B).call(this);_assertClassBrand(S,this,k).call(this);const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),_assertClassBrand(S,this,B).call(this);for(const s of this.bezierPath2D)e.stroke(s)}function D(t){_assertClassBrand(S,this,R).call(this,t.offsetX,t.offsetY),this.canvas.removeEventListener("pointerleave",_classPrivateFieldGet(p,this)),this.canvas.removeEventListener("pointermove",_classPrivateFieldGet(u,this)),this.addToAnnotationStorage()}function O(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",i._l10nPromise.get("editor_ink_canvas_aria_label").then((t=>{var e;return null===(e=this.canvas)||void 0===e?void 0:e.setAttribute("aria-label",t)})),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function L(){_classPrivateFieldSet(b,this,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}))),_classPrivateFieldGet(b,this).observe(this.div)}function G(){if(!_classPrivateFieldGet(_,this))return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),_assertClassBrand(S,this,B).call(this)}function N(t,e){const s=_assertClassBrand(S,this,V).call(this),i=(t-s)/_classPrivateFieldGet(h,this),n=(e-s)/_classPrivateFieldGet(d,this);this.scaleFactor=Math.min(i,n)}function B(){const t=_assertClassBrand(S,this,V).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function j(t){const e=new Path2D;for(let s=0,i=t.length;s<i;s++){const[i,n,a,r]=t[s];0===s&&e.moveTo(...i),e.bezierCurveTo(n[0],n[1],a[0],a[1],r[0],r[1])}return e}function W(t,e,s,i){const n=[],a=this.thickness/2;let r,o;for(const l of this.paths){r=[],o=[];for(let n=0,c=l.length;n<c;n++){const[c,d,h,u]=l[n],p=t*(c[0]+e)+a,f=i-t*(c[1]+s)-a,g=t*(d[0]+e)+a,m=i-t*(d[1]+s)-a,_=t*(h[0]+e)+a,v=i-t*(h[1]+s)-a,b=t*(u[0]+e)+a,y=i-t*(u[1]+s)-a;0===n&&(r.push(p,f),o.push(p,f)),r.push(g,m,_,v,b,y),_assertClassBrand(S,this,U).call(this,p,f,g,m,_,v,b,y,4,o)}n.push({bezier:r,points:o})}return n}function U(t,e,s,i,n,a,r,o,l,c){if(_assertClassBrand(S,this,q).call(this,t,e,s,i,n,a,r,o))c.push(r,o);else{for(let d=1;d<l-1;d++){const h=d/l,u=1-h;let p=h*t+u*s,f=h*e+u*i,g=h*s+u*n,m=h*i+u*a;p=h*p+u*g,f=h*f+u*m,g=h*g+u*(h*n+u*r),m=h*m+u*(h*a+u*o),p=h*p+u*g,f=h*f+u*m,c.push(p,f)}c.push(r,o)}}function q(t,e,s,i,n,a,r,o){const l=(3*s-2*t-r)**2,c=(3*i-2*e-o)**2,d=(3*n-t-2*r)**2,h=(3*a-e-2*o)**2;return Math.max(l,d)+Math.max(c,h)<=10}function H(){let t=1/0,e=-1/0,s=1/0,i=-1/0;for(const a of this.paths)for(const[r,o,l,c]of a){const a=n.Util.bezierBoundingBox(...r,...o,...l,...c);t=Math.min(t,a[0]),s=Math.min(s,a[1]),e=Math.max(e,a[2]),i=Math.max(i,a[3])}return[t,s,e,i]}function V(){return _classPrivateFieldGet(m,this)?Math.ceil(this.thickness*this.parentScale):0}function z(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!_classPrivateFieldGet(m,this))return void _assertClassBrand(S,this,I).call(this);const e=_assertClassBrand(S,this,H).call(this),s=_assertClassBrand(S,this,V).call(this);_classPrivateFieldSet(h,this,Math.max(l,e[2]-e[0])),_classPrivateFieldSet(d,this,Math.max(l,e[3]-e[1]));const i=Math.ceil(s+_classPrivateFieldGet(h,this)*this.scaleFactor),n=Math.ceil(s+_classPrivateFieldGet(d,this)*this.scaleFactor),[a,r]=this.parentDimensions;this.width=i/a,this.height=n/r,_classPrivateFieldSet(c,this,i/n),_assertClassBrand(S,this,X).call(this);const o=this.translationX,u=this.translationY;this.translationX=-e[0],this.translationY=-e[1],_assertClassBrand(S,this,G).call(this),_assertClassBrand(S,this,I).call(this),_classPrivateFieldSet(y,this,i),_classPrivateFieldSet(A,this,n),this.setDims(i,n);const p=t?s/this.scaleFactor/2:0;this.translate(o-this.translationX-p,u-this.translationY-p)}function X(){const{style:t}=this.div;_classPrivateFieldGet(c,this)>=1?(t.minHeight="".concat(l,"px"),t.minWidth="".concat(Math.round(_classPrivateFieldGet(c,this)*l),"px")):(t.minWidth="".concat(l,"px"),t.minHeight="".concat(Math.round(l/_classPrivateFieldGet(c,this)),"px"))}i=F,_defineProperty(F,"_defaultColor",null),_defineProperty(F,"_defaultOpacity",1),_defineProperty(F,"_defaultThickness",1),_defineProperty(F,"_l10nPromise",void 0),_defineProperty(F,"_type","ink"),e.InkEditor=F},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fitCurve=void 0;const i=s(31);e.fitCurve=i},t=>{function e(t,n,a,r,o){var c,d,h,u,p,f,g,m,_,v,b,y,A;if(2===t.length)return y=l.vectorLen(l.subtract(t[0],t[1]))/3,[c=[t[0],l.addArrays(t[0],l.mulItems(n,y)),l.addArrays(t[1],l.mulItems(a,y)),t[1]]];if(d=function(t){var e,s,i,n=[];return t.forEach(((t,a)=>{e=a?s+l.vectorLen(l.subtract(t,i)):0,n.push(e),s=e,i=t})),n=n.map((t=>t/s))}(t),[c,u,f]=s(t,d,d,n,a,o),0===u||u<r)return[c];if(u<r*r)for(h=d,p=u,g=f,A=0;A<20;A++){if(h=i(c,t,h),[c,u,f]=s(t,d,h,n,a,o),u<r)return[c];if(f===g){let t=u/p;if(t>.9999&&t<1.0001)break}p=u,g=f}return b=[],(m=l.subtract(t[f-1],t[f+1])).every((t=>0===t))&&(m=l.subtract(t[f-1],t[f]),[m[0],m[1]]=[-m[1],m[0]]),_=l.normalize(m),v=l.mulItems(_,-1),b=(b=b.concat(e(t.slice(0,f+1),n,_,r,o))).concat(e(t.slice(f),v,a,r,o))}function s(t,e,s,i,n,o){var d,h,u;return d=function(t,e,s,i){var n,a,r,o,d,h,u,p,f,g,m,_,v,b,y,A,P,S=t[0],F=t[t.length-1];for(n=[S,null,null,F],a=l.zeros_Xx2x2(e.length),v=0,b=e.length;v<b;v++)P=1-(A=e[v]),(r=a[v])[0]=l.mulItems(s,3*A*(P*P)),r[1]=l.mulItems(i,3*P*(A*A));for(o=[[0,0],[0,0]],d=[0,0],v=0,b=t.length;v<b;v++)A=e[v],r=a[v],o[0][0]+=l.dot(r[0],r[0]),o[0][1]+=l.dot(r[0],r[1]),o[1][0]+=l.dot(r[0],r[1]),o[1][1]+=l.dot(r[1],r[1]),y=l.subtract(t[v],c.q([S,S,F,F],A)),d[0]+=l.dot(r[0],y),d[1]+=l.dot(r[1],y);return h=o[0][0]*o[1][1]-o[1][0]*o[0][1],u=o[0][0]*d[1]-o[1][0]*d[0],p=d[0]*o[1][1]-d[1]*o[0][1],f=0===h?0:p/h,g=0===h?0:u/h,_=l.vectorLen(l.subtract(S,F)),f<(m=1e-6*_)||g<m?(n[1]=l.addArrays(S,l.mulItems(s,_/3)),n[2]=l.addArrays(F,l.mulItems(i,_/3))):(n[1]=l.addArrays(S,l.mulItems(s,f)),n[2]=l.addArrays(F,l.mulItems(i,g))),n}(t,s,i,n),[h,u]=function(t,e,s){var i,n,o,d,h,u,p,f;n=0,o=Math.floor(t.length/2);const g=a(e,10);for(h=0,u=t.length;h<u;h++)p=t[h],f=r(0,s[h],g,10),(i=(d=l.subtract(c.q(e,f),p))[0]*d[0]+d[1]*d[1])>n&&(n=i,o=h);return[n,o]}(t,d,e),o&&o({bez:d,points:t,params:e,maxErr:h,maxPoint:u}),[d,h,u]}function i(t,e,s){return s.map(((s,i)=>n(t,e[i],s)))}function n(t,e,s){var i=l.subtract(c.q(t,s),e),n=c.qprime(t,s),a=l.mulMatrix(i,n),r=l.sum(l.squareItems(n))+2*l.mulMatrix(i,c.qprimeprime(t,s));return 0===r?s:s-a/r}var a=function(t,e){for(var s,i=[0],n=t[0],a=0,r=1;r<=e;r++)s=c.q(t,r/e),a+=l.vectorLen(l.subtract(s,n)),i.push(a),n=s;return i=i.map((t=>t/a))};function r(t,e,s,i){if(e<0)return 0;if(e>1)return 1;for(var n,a,r,o,l=1;l<=i;l++)if(e<=s[l]){r=(l-1)/i,a=l/i,o=(e-(n=s[l-1]))/(s[l]-n)*(a-r)+r;break}return o}function o(t,e){return l.normalize(l.subtract(t,e))}class l{static zeros_Xx2x2(t){for(var e=[];t--;)e.push([0,0]);return e}static mulItems(t,e){return t.map((t=>t*e))}static mulMatrix(t,e){return t.reduce(((t,s,i)=>t+s*e[i]),0)}static subtract(t,e){return t.map(((t,s)=>t-e[s]))}static addArrays(t,e){return t.map(((t,s)=>t+e[s]))}static addItems(t,e){return t.map((t=>t+e))}static sum(t){return t.reduce(((t,e)=>t+e))}static dot(t,e){return l.mulMatrix(t,e)}static vectorLen(t){return Math.hypot(...t)}static divItems(t,e){return t.map((t=>t/e))}static squareItems(t){return t.map((t=>t*t))}static normalize(t){return this.divItems(t,this.vectorLen(t))}}class c{static q(t,e){var s=1-e,i=l.mulItems(t[0],s*s*s),n=l.mulItems(t[1],3*s*s*e),a=l.mulItems(t[2],3*s*e*e),r=l.mulItems(t[3],e*e*e);return l.addArrays(l.addArrays(i,n),l.addArrays(a,r))}static qprime(t,e){var s=1-e,i=l.mulItems(l.subtract(t[1],t[0]),3*s*s),n=l.mulItems(l.subtract(t[2],t[1]),6*s*e),a=l.mulItems(l.subtract(t[3],t[2]),3*e*e);return l.addArrays(l.addArrays(i,n),a)}static qprimeprime(t,e){return l.addArrays(l.mulItems(l.addArrays(l.subtract(t[2],l.mulItems(t[1],2)),t[0]),6*(1-e)),l.mulItems(l.addArrays(l.subtract(t[3],l.mulItems(t[2],2)),t[1]),6*e))}}t.exports=function(t,s,i){if(!Array.isArray(t))throw new TypeError("First argument should be an array");if(t.forEach((e=>{if(!Array.isArray(e)||e.some((t=>"number"!==typeof t))||e.length!==t[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")})),(t=t.filter(((e,s)=>0===s||!e.every(((e,i)=>e===t[s-1][i]))))).length<2)return[];const n=t.length,a=o(t[1],t[0]),r=o(t[n-2],t[n-1]);return e(t,a,r,s,i)},t.exports.fitCubic=e,t.exports.createTangent=o},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationLayer=void 0;var i=s(1),n=s(6),a=s(3),r=s(33),o=s(34);const l=1e3,c=new WeakSet;function d(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class h{static create(t){switch(t.data.annotationType){case i.AnnotationType.LINK:return new f(t);case i.AnnotationType.TEXT:return new _(t);case i.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new b(t);case"Btn":return t.data.radioButton?new A(t):t.data.checkBox?new y(t):new P(t);case"Ch":return new S(t)}return new v(t);case i.AnnotationType.POPUP:return new F(t);case i.AnnotationType.FREETEXT:return new C(t);case i.AnnotationType.LINE:return new w(t);case i.AnnotationType.SQUARE:return new E(t);case i.AnnotationType.CIRCLE:return new k(t);case i.AnnotationType.POLYLINE:return new T(t);case i.AnnotationType.CARET:return new R(t);case i.AnnotationType.INK:return new I(t);case i.AnnotationType.POLYGON:return new M(t);case i.AnnotationType.HIGHLIGHT:return new D(t);case i.AnnotationType.UNDERLINE:return new O(t);case i.AnnotationType.SQUIGGLY:return new L(t);case i.AnnotationType.STRIKEOUT:return new G(t);case i.AnnotationType.STAMP:return new N(t);case i.AnnotationType.FILEATTACHMENT:return new B(t);default:return new u(t)}}}class u{constructor(t){let{isRenderable:e=!1,ignoreBorder:s=!1,createQuadrilaterals:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.page=t.page,this.viewport=t.viewport,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,e&&(this.container=this._createContainer(s)),i&&(this.quadrilaterals=this._createQuadrilaterals(s))}_createContainer(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{data:e,page:s,viewport:n}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",e.id),e.noRotate&&a.classList.add("norotate");const{pageWidth:r,pageHeight:o,pageX:l,pageY:c}=n.rawDims,{width:h,height:u}=d(e.rect),p=i.Util.normalizeRect([e.rect[0],s.view[3]-e.rect[1]+s.view[1],e.rect[2],s.view[3]-e.rect[3]+s.view[1]]);if(!t&&e.borderStyle.width>0){a.style.borderWidth="".concat(e.borderStyle.width,"px");const t=e.borderStyle.horizontalCornerRadius,s=e.borderStyle.verticalCornerRadius;if(t>0||s>0){const e="calc(".concat(t,"px * var(--scale-factor)) / calc(").concat(s,"px * var(--scale-factor))");a.style.borderRadius=e}else if(this instanceof A){const t="calc(".concat(h,"px * var(--scale-factor)) / calc(").concat(u,"px * var(--scale-factor))");a.style.borderRadius=t}switch(e.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid"}const n=e.borderColor||null;n?a.style.borderColor=i.Util.makeHexColor(0|n[0],0|n[1],0|n[2]):a.style.borderWidth=0}a.style.left="".concat(100*(p[0]-l)/r,"%"),a.style.top="".concat(100*(p[1]-c)/o,"%");const{rotation:f}=e;return e.hasOwnCanvas||0===f?(a.style.width="".concat(100*h/r,"%"),a.style.height="".concat(100*u/o,"%")):this.setRotation(f,a),a}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;const{pageWidth:s,pageHeight:i}=this.viewport.rawDims,{width:n,height:a}=d(this.data.rect);let r,o;t%180===0?(r=100*n/s,o=100*a/i):(r=100*a/s,o=100*n/i),e.style.width="".concat(r,"%"),e.style.height="".concat(o,"%"),e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,s)=>{const i=s.detail[t];s.target.style[e]=r.ColorConverters["".concat(i[0],"_HTML")](i.slice(1))};return(0,i.shadow)(this,"_commonActions",{display:t=>{const e=t.detail.display%2===1;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:e,print:0===t.detail.display||3===t.detail.display})},print:t=>{this.annotationStorage.setValue(this.data.id,{print:t.detail.print})},hidden:t=>{this.container.style.visibility=t.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:t.detail.hidden})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.detail.readonly?t.target.setAttribute("readonly",""):t.target.removeAttribute("readonly")},required:t=>{this._setRequired(t.target,t.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:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const s=this._commonActions;for(const i of Object.keys(e.detail)){const n=t[i]||s[i];null===n||void 0===n||n(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const s=this._commonActions;for(const[i,n]of Object.entries(e)){const a=s[i];a&&(a({detail:{[i]:n},target:t}),delete e[i])}}_createQuadrilaterals(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;const e=[],s=this.data.rect;for(const i of this.data.quadPoints)this.data.rect=[i[2].x,i[2].y,i[1].x,i[1].y],e.push(this._createContainer(t));return this.data.rect=s,e}_createPopup(t,e){let s=this.container;this.quadrilaterals&&(t||(t=this.quadrilaterals),s=this.quadrilaterals[0]),t||((t=document.createElement("div")).classList.add("popupTriggerArea"),s.append(t));const i=new x({container:s,trigger:t,color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,hideWrapper:!0}).render();i.style.left="100%",s.append(i)}_renderQuadrilaterals(t){for(const e of this.quadrilaterals)e.classList.add(t);return this.quadrilaterals}render(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const s=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:a,exportValues:r}of n){if(-1===t)continue;if(a===e)continue;const n="string"===typeof r?r:null,o=document.querySelector('[data-element-id="'.concat(a,'"]'));!o||c.has(o)?s.push({id:a,exportValue:n,domElement:o}):(0,i.warn)("_getElementsByName - element not allowed: ".concat(a))}return s}for(const i of document.getElementsByName(t)){const{exportValue:t}=i,n=i.getAttribute("data-element-id");n!==e&&c.has(i)&&s.push({id:n,exportValue:t,domElement:i})}return s}}var p=new WeakSet;class f extends u{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null===e||void 0===e||!e.ignoreBorder),createQuadrilaterals:!0}),_classPrivateMethodInitSpec(this,p),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,s=document.createElement("a");s.setAttribute("data-element-id",t.id);let i=!1;return t.url?(e.addLinkAttributes(s,t.url,t.newWindow),i=!0):t.action?(this._bindNamedAction(s,t.action),i=!0):t.attachment?(this._bindAttachment(s,t.attachment),i=!0):t.setOCGState?(_assertClassBrand(p,this,m).call(this,s,t.setOCGState),i=!0):t.dest?(this._bindLink(s,t.dest),i=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(s,t),i=!0),t.resetForm?(this._bindResetFormAction(s,t.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(s,""),i=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map(((t,e)=>{const i=0===e?s:s.cloneNode();return t.append(i),t})):(this.container.classList.add("linkAnnotation"),i&&this.container.append(s),this.container)}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&_assertClassBrand(p,this,g).call(this)}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),_assertClassBrand(p,this,g).call(this)}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.container,e.content,e.filename),!1},_assertClassBrand(p,this,g).call(this)}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(e.actions)){const n=s.get(i);n&&(t[n]=()=>{var t;return null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:i}}),!1})}t.onclick||(t.onclick=()=>!1),_assertClassBrand(p,this,g).call(this)}_bindResetFormAction(t,e){const s=t.onclick;if(s||(t.href=this.linkService.getAnchorUrl("")),_assertClassBrand(p,this,g).call(this),!this._fieldObjects)return(0,i.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(s||(t.onclick=()=>!1));t.onclick=()=>{null===s||void 0===s||s();const{fields:t,refs:n,include:a}=e,r=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const s of t){const t=this._fieldObjects[s]||[];for(const{id:s}of t)e.add(s)}for(const t of Object.values(this._fieldObjects))for(const s of t)e.has(s.id)===a&&r.push(s)}else for(const e of Object.values(this._fieldObjects))r.push(...e);const o=this.annotationStorage,l=[];for(const e of r){const{id:t}=e;switch(l.push(t),e.type){case"text":{const s=e.defaultValue||"";o.setValue(t,{value:s});break}case"checkbox":case"radiobutton":{const s=e.defaultValue===e.exportValues;o.setValue(t,{value:s});break}case"combobox":case"listbox":{const s=e.defaultValue||"";o.setValue(t,{value:s});break}default:continue}const s=document.querySelector('[data-element-id="'.concat(t,'"]'));s&&(c.has(s)?s.dispatchEvent(new Event("resetform")):(0,i.warn)("_bindResetFormAction - element not allowed: ".concat(t)))}var d;return this.enableScripting&&(null===(d=this.linkService.eventBus)||void 0===d||d.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}})),!1}}}function g(){this.container.setAttribute("data-internal-link","")}function m(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),_assertClassBrand(p,this,g).call(this)}class _ extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str)})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.alt="[{{type}} Annotation]",t.dataset.l10nId="text_annotation_type",t.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(t,this.data),this.container.append(t),this.container}}class v extends u{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null===(e=t.previousSibling)||void 0===e?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){const{isWin:e,isMac:s}=i.FeatureTest.platform;return e&&t.ctrlKey||s&&t.metaKey}_setEventListener(t,e,s,i){e.includes("mouse")?t.addEventListener(e,(t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:i(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(e,(t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:i(t)}})}))}_setEventListeners(t,e,s){for(const[n,a]of e){var i;("Action"===a||null!==(i=this.data.actions)&&void 0!==i&&i[a])&&this._setEventListener(t,n,a,s)}}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":i.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:s}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,a=t.style;let r;const o=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(i.LINE_FACTOR*n))||1);r=Math.min(n,o(e/i.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,o(t/i.LINE_FACTOR))}a.fontSize="calc(".concat(r,"px * var(--scale-factor))"),a.color=i.Util.makeHexColor(s[0],s[1],s[2]),null!==this.data.textAlignment&&(a.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class b extends v{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,s,i){const n=this.annotationStorage;for(const a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=s),n.setValue(a.id,{[i]:s})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let s=null;if(this.renderForms){const n=t.getValue(e,{value:this.data.fieldValue});let a=n.formattedValue||n.value||"";const r=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;r&&a.length>r&&(a=a.slice(0,r));const o={userValue:a,formattedValue:null,lastCommittedValue:null,commitKey:1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=a,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type="text",s.setAttribute("value",a),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),c.add(s),s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=l,this._setRequired(s,this.data.required),r&&(s.maxLength=r),s.addEventListener("input",(i=>{t.setValue(e,{value:i.target.value}),this.setPropertyOnSiblings(s,"value",i.target.value,"value")})),s.addEventListener("resetform",(t=>{var e;const i=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";s.value=o.userValue=i,o.formattedValue=null}));let d=t=>{const{formattedValue:e}=o;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var i;s.addEventListener("focus",(t=>{const{target:e}=t;o.userValue&&(e.value=o.userValue),o.lastCommittedValue=e.value,o.commitKey=1})),s.addEventListener("updatefromsandbox",(s=>{this.showElementAndHideCanvas(s.target);const i={value(s){var i;o.userValue=null!==(i=s.detail.value)&&void 0!==i?i:"",t.setValue(e,{value:o.userValue.toString()}),s.target.value=o.userValue},formattedValue(s){const{formattedValue:i}=s.detail;o.formattedValue=i,null!==i&&void 0!==i&&s.target!==document.activeElement&&(s.target.value=i),t.setValue(e,{formattedValue:i})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:s=>{var i;const{charLimit:n}=s.detail,{target:a}=s;if(0===n)return void a.removeAttribute("maxLength");a.setAttribute("maxLength",n);let r=o.userValue;!r||r.length<=n||(r=r.slice(0,n),a.value=o.userValue=r,t.setValue(e,{value:r}),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:a.selectionStart,selEnd:a.selectionEnd}}))}};this._dispatchEventFromSandbox(i,s)})),s.addEventListener("keydown",(t=>{var s;o.commitKey=1;let i=-1;if("Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):i=2,-1===i)return;const{value:n}=t.target;o.lastCommittedValue!==n&&(o.lastCommittedValue=n,o.userValue=n,null===(s=this.linkService.eventBus)||void 0===s||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const n=d;d=null,s.addEventListener("blur",(t=>{if(!t.relatedTarget)return;const{value:s}=t.target;var i;o.userValue=s,o.lastCommittedValue!==s&&(null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})),n(t)})),null!==(i=this.data.actions)&&void 0!==i&&i.Keystroke&&s.addEventListener("beforeinput",(t=>{var s;o.lastCommittedValue=null;const{data:i,target:n}=t,{value:a,selectionStart:r,selectionEnd:l}=n;let c=r,d=l;switch(t.inputType){case"deleteWordBackward":{const t=a.substring(0,r).match(/\w*[^\w]*$/);t&&(c-=t[0].length);break}case"deleteWordForward":{const t=a.substring(r).match(/^[^\w]*\w*/);t&&(d+=t[0].length);break}case"deleteContentBackward":r===l&&(c-=1);break;case"deleteContentForward":r===l&&(d+=1)}t.preventDefault(),null===(s=this.linkService.eventBus)||void 0===s||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,change:i||"",willCommit:!1,selStart:c,selEnd:d}})})),this._setEventListeners(s,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(d&&s.addEventListener("blur",d),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/r;s.classList.add("comb"),s.style.letterSpacing="calc(".concat(t,"px * var(--scale-factor) - 1ch)")}}else s=document.createElement("div"),s.textContent=this.data.fieldValue,s.style.verticalAlign="middle",s.style.display="table-cell";return this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class y extends v{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,s=e.id;let i=t.getValue(s,{value:e.exportValue===e.fieldValue}).value;"string"===typeof i&&(i="Off"!==i,t.setValue(s,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return c.add(n),n.setAttribute("data-element-id",s),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=e.fieldName,i&&n.setAttribute("checked",!0),n.setAttribute("exportValue",e.exportValue),n.tabIndex=l,n.addEventListener("change",(i=>{const{name:n,checked:a}=i.target;for(const r of this._getElementsByName(n,s)){const s=a&&r.exportValue===e.exportValue;r.domElement&&(r.domElement.checked=s),t.setValue(r.id,{value:s})}t.setValue(s,{value:a})})),n.addEventListener("resetform",(t=>{const s=e.defaultFieldValue||"Off";t.target.checked=s===e.exportValue})),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",(e=>{const i={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(s,{value:e.target.checked})}};this._dispatchEventFromSandbox(i,e)})),this._setEventListeners(n,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class A extends v{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,s=e.id;let i=t.getValue(s,{value:e.fieldValue===e.buttonValue}).value;"string"===typeof i&&(i=i!==e.buttonValue,t.setValue(s,{value:i}));const n=document.createElement("input");if(c.add(n),n.setAttribute("data-element-id",s),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=e.fieldName,i&&n.setAttribute("checked",!0),n.tabIndex=l,n.addEventListener("change",(e=>{const{name:i,checked:n}=e.target;for(const a of this._getElementsByName(i,s))t.setValue(a.id,{value:!1});t.setValue(s,{value:n})})),n.addEventListener("resetform",(t=>{const s=e.defaultFieldValue;t.target.checked=null!==s&&void 0!==s&&s===e.buttonValue})),this.enableScripting&&this.hasJSActions){const i=e.buttonValue;n.addEventListener("updatefromsandbox",(e=>{const n={value:e=>{const n=i===e.detail.value;for(const i of this._getElementsByName(e.target.name)){const e=n&&i.id===s;i.domElement&&(i.domElement.checked=e),t.setValue(i.id,{value:e})}}};this._dispatchEventFromSandbox(n,e)})),this._setEventListeners(n,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class P extends f{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(t.title=this.data.alternativeText);const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))),t}}class S extends v{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,s=t.getValue(e,{value:this.data.fieldValue}),i=document.createElement("select");c.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=l;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const s of i.options)s.selected=s.value===e}));for(const l of this.data.options){const t=document.createElement("option");t.textContent=l.displayValue,t.value=l.exportValue,s.value.includes(l.exportValue)&&(t.setAttribute("selected",!0),n=!1),i.append(t)}let a=null;if(n){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),i.prepend(t),a=()=>{t.remove(),i.removeEventListener("input",a),a=null},i.addEventListener("input",a)}const r=t=>{const e=t?"value":"textContent",{options:s,multiple:n}=i;return n?Array.prototype.filter.call(s,(t=>t.selected)).map((t=>t[e])):-1===s.selectedIndex?null:s[s.selectedIndex][e]};let o=r(!1);const d=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",(s=>{const n={value(s){var n;null===(n=a)||void 0===n||n();const l=s.detail.value,c=new Set(Array.isArray(l)?l:[l]);for(const t of i.options)t.selected=c.has(t.value);t.setValue(e,{value:r(!0)}),o=r(!1)},multipleSelection(t){i.multiple=!0},remove(s){const n=i.options,a=s.detail.remove;n[a].selected=!1,i.remove(a),n.length>0&&-1===Array.prototype.findIndex.call(n,(t=>t.selected))&&(n[0].selected=!0),t.setValue(e,{value:r(!0),items:d(s)}),o=r(!1)},clear(s){for(;0!==i.length;)i.remove(0);t.setValue(e,{value:null,items:[]}),o=r(!1)},insert(s){const{index:n,displayValue:a,exportValue:l}=s.detail.insert,c=i.children[n],h=document.createElement("option");h.textContent=a,h.value=l,c?c.before(h):i.append(h),t.setValue(e,{value:r(!0),items:d(s)}),o=r(!1)},items(s){const{items:n}=s.detail;for(;0!==i.length;)i.remove(0);for(const t of n){const{displayValue:e,exportValue:s}=t,n=document.createElement("option");n.textContent=e,n.value=s,i.append(n)}i.options.length>0&&(i.options[0].selected=!0),t.setValue(e,{value:r(!0),items:d(s)}),o=r(!1)},indices(s){const i=new Set(s.detail.indices);for(const t of s.target.options)t.selected=i.has(t.index);t.setValue(e,{value:r(!0)}),o=r(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(n,s)})),i.addEventListener("input",(s=>{var i;const n=r(!0);t.setValue(e,{value:n}),s.preventDefault(),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))):i.addEventListener("input",(function(s){t.setValue(e,{value:r(!0)})})),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class F extends u{constructor(t){var e,s,i;const{data:n}=t;super(t,{isRenderable:!F.IGNORE_TYPES.has(n.parentType)&&!!(null!==(e=n.titleObj)&&void 0!==e&&e.str||null!==(s=n.contentsObj)&&void 0!==s&&s.str||null!==(i=n.richText)&&void 0!==i&&i.str)})}render(){this.container.classList.add("popupAnnotation");const t=this.layer.querySelectorAll('[data-annotation-id="'.concat(this.data.parentId,'"]'));if(0===t.length)return this.container;const e=new x({container:this.container,trigger:Array.from(t),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),s=this.page,n=i.Util.normalizeRect([this.data.parentRect[0],s.view[3]-this.data.parentRect[1]+s.view[1],this.data.parentRect[2],s.view[3]-this.data.parentRect[3]+s.view[1]]),a=n[0]+this.data.parentRect[2]-this.data.parentRect[0],r=n[1],{pageWidth:o,pageHeight:l,pageX:c,pageY:d}=this.viewport.rawDims;return this.container.style.left="".concat(100*(a-c)/o,"%"),this.container.style.top="".concat(100*(r-d)/l,"%"),this.container.append(e.render()),this.container}}_defineProperty(F,"IGNORE_TYPES",new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]));class x{constructor(t){this.container=t.container,this.trigger=t.trigger,this.color=t.color,this.titleObj=t.titleObj,this.modificationDate=t.modificationDate,this.contentsObj=t.contentsObj,this.richText=t.richText,this.hideWrapper=t.hideWrapper||!1,this.pinned=!1}render(){var t,e;const s=document.createElement("div");s.classList.add("popupWrapper"),this.hideElement=this.hideWrapper?s:this.container,this.hideElement.hidden=!0;const a=document.createElement("div");a.classList.add("popup");const r=this.color;if(r){const t=.7*(255-r[0])+r[0],e=.7*(255-r[1])+r[1],s=.7*(255-r[2])+r[2];a.style.backgroundColor=i.Util.makeHexColor(0|t,0|e,0|s)}const l=document.createElement("h1");l.dir=this.titleObj.dir,l.textContent=this.titleObj.str,a.append(l);const c=n.PDFDateString.toDateObject(this.modificationDate);if(c){const t=document.createElement("span");t.classList.add("popupDate"),t.textContent="{{date}}, {{time}}",t.dataset.l10nId="annotation_date_string",t.dataset.l10nArgs=JSON.stringify({date:c.toLocaleDateString(),time:c.toLocaleTimeString()}),a.append(t)}if(null===(t=this.richText)||void 0===t||!t.str||null!==(e=this.contentsObj)&&void 0!==e&&e.str&&this.contentsObj.str!==this.richText.str){const t=this._formatContents(this.contentsObj);a.append(t)}else o.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:a}),a.lastChild.classList.add("richText","popupContent");Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const i of this.trigger)i.addEventListener("click",this._toggle.bind(this)),i.addEventListener("mouseover",this._show.bind(this,!1)),i.addEventListener("mouseout",this._hide.bind(this,!1));return a.addEventListener("click",this._hide.bind(this,!0)),s.append(a),s}_formatContents(t){let{str:e,dir:s}=t;const i=document.createElement("p");i.classList.add("popupContent"),i.dir=s;const n=e.split(/(?:\r\n?|\n)/);for(let a=0,r=n.length;a<r;++a){const t=n[a];i.append(document.createTextNode(t)),a<r-1&&i.append(document.createElement("br"))}return i}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3)}_hide(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.pinned=!1),this.hideElement.hidden||this.pinned||(this.hideElement.hidden=!0,this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3)}}class C extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0}),this.textContent=t.data.textContent}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const s=document.createElement("span");s.textContent=e,t.append(s)}this.container.append(t)}return this.data.hasPopup||this._createPopup(null,this.data),this.container}}class w extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:s}=d(t.rect),i=this.svgFactory.create(e,s,!0),n=this.svgFactory.createElement("svg:line");return n.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),n.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),n.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),n.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),i.append(n),this.container.append(i),this._createPopup(n,t),this.container}}class E extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:s}=d(t.rect),i=this.svgFactory.create(e,s,!0),n=t.borderStyle.width,a=this.svgFactory.createElement("svg:rect");return a.setAttribute("x",n/2),a.setAttribute("y",n/2),a.setAttribute("width",e-n),a.setAttribute("height",s-n),a.setAttribute("stroke-width",n||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),this._createPopup(a,t),this.container}}class k extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:s}=d(t.rect),i=this.svgFactory.create(e,s,!0),n=t.borderStyle.width,a=this.svgFactory.createElement("svg:ellipse");return a.setAttribute("cx",e/2),a.setAttribute("cy",s/2),a.setAttribute("rx",e/2-n/2),a.setAttribute("ry",s/2-n/2),a.setAttribute("stroke-width",n||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),this._createPopup(a,t),this.container}}class T extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:e,height:s}=d(t.rect),i=this.svgFactory.create(e,s,!0);let n=[];for(const r of t.vertices){const e=r.x-t.rect[0],s=t.rect[3]-r.y;n.push(e+","+s)}n=n.join(" ");const a=this.svgFactory.createElement(this.svgElementName);return a.setAttribute("points",n),a.setAttribute("stroke-width",t.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),this._createPopup(a,t),this.container}}class M extends T{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class R extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class I extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:e,height:s}=d(t.rect),i=this.svgFactory.create(e,s,!0);for(const n of t.inkLists){let e=[];for(const i of n){const s=i.x-t.rect[0],n=t.rect[3]-i.y;e.push("".concat(s,",").concat(n))}e=e.join(" ");const s=this.svgFactory.createElement(this.svgElementName);s.setAttribute("points",e),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),this._createPopup(s,t),i.append(s)}return this.container.append(i),this.container}}class D extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.classList.add("highlightAnnotation"),this.container)}}class O extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.classList.add("underlineAnnotation"),this.container)}}class L extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.classList.add("squigglyAnnotation"),this.container)}}class G extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.classList.add("strikeoutAnnotation"),this.container)}}class N extends u{constructor(t){var e,s,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(s=t.data.contentsObj)&&void 0!==s&&s.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class B extends u{constructor(t){var e;super(t,{isRenderable:!0});const{filename:s,content:i}=this.data.file;this.filename=(0,n.getFilenameFromUrl)(s,!0),this.content=i,null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",{source:this,filename:s,content:i})}render(){var t,e;let s;return this.container.classList.add("fileAttachmentAnnotation"),this.data.hasAppearance?s=document.createElement("div"):(s=document.createElement("img"),s.src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(this.data.name)?"paperclip":"pushpin",".svg")),s.classList.add("popupTriggerArea"),s.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&(null!==(t=this.data.titleObj)&&void 0!==t&&t.str||null!==(e=this.data.contentsObj)&&void 0!==e&&e.str||this.data.richText)&&this._createPopup(s,this.data),this.container.append(s),this.container}_download(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.container,this.content,this.filename)}}class j{static render(t){const{annotations:e,div:s,viewport:r,accessibilityManager:o}=t;(0,n.setLayerDimensions)(s,r);const l={data:null,layer:s,page:t.page,viewport:r,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new n.DOMSVGFactory,annotationStorage:t.annotationStorage||new a.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects};let c=0;for(const n of e){if(n.noHTML)continue;if(n.annotationType!==i.AnnotationType.POPUP){const{width:t,height:e}=d(n.rect);if(t<=0||e<=0)continue}l.data=n;const t=h.create(l);if(!t.isRenderable)continue;const e=t.render();if(n.hidden&&(e.style.visibility="hidden"),Array.isArray(e))for(const i of e)i.style.zIndex=c++,W.call(j,i,n.id,s,o);else e.style.zIndex=c++,t instanceof F?s.prepend(e):W.call(j,e,n.id,s,o)}_assertClassBrand(j,this,U).call(this,s,t.annotationCanvasMap)}static update(t){const{annotationCanvasMap:e,div:s,viewport:i}=t;(0,n.setLayerDimensions)(s,{rotation:i.rotation}),_assertClassBrand(j,this,U).call(this,s,e),s.hidden=!1}}function W(t,e,s,i){const a=t.firstChild||t;a.id="".concat(n.AnnotationPrefix).concat(e),s.append(t),null===i||void 0===i||i.moveElementInDOM(s,t,a,!1)}function U(t,e){if(e){for(const[s,i]of e){const e=t.querySelector('[data-annotation-id="'.concat(s,'"]'));if(!e)continue;const{firstChild:n}=e;n?"CANVAS"===n.nodeName?n.replaceWith(i):n.before(i):e.append(i)}e.clear()}}e.AnnotationLayer=j},(t,e)=>{function s(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConverters=void 0,e.ColorConverters=class{static CMYK_G(t){let[e,s,i,n]=t;return["G",1-Math.min(1,.3*e+.59*i+.11*s+n)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_HTML(t){let[e]=t;const i=s(e);return"#".concat(i).concat(i).concat(i)}static RGB_G(t){let[e,s,i]=t;return["G",.3*e+.59*s+.11*i]}static RGB_HTML(t){let[e,i,n]=t;const a=s(e),r=s(i),o=s(n);return"#".concat(a).concat(r).concat(o)}static T_HTML(){return"#00000000"}static CMYK_RGB(t){let[e,s,i,n]=t;return["RGB",1-Math.min(1,e+n),1-Math.min(1,i+n),1-Math.min(1,s+n)]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,s,i]=t;const n=1-e,a=1-s,r=1-i;return["CMYK",n,a,r,Math.min(n,a,r)]}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0;var i=s(19);e.XfaLayer=class{static setupStorage(t,e,s,i,n){const a=i.getValue(e,{value:null});switch(s.name){case"textarea":if(null!==a.value&&(t.textContent=a.value),"print"===n)break;t.addEventListener("input",(t=>{i.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===s.attributes.type||"checkbox"===s.attributes.type){if(a.value===s.attributes.xfaOn?t.setAttribute("checked",!0):a.value===s.attributes.xfaOff&&t.removeAttribute("checked"),"print"===n)break;t.addEventListener("change",(t=>{i.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{if(null!==a.value&&t.setAttribute("value",a.value),"print"===n)break;t.addEventListener("input",(t=>{i.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==a.value)for(const t of s.children)t.attributes.value===a.value&&(t.attributes.selected=!0);t.addEventListener("input",(t=>{const s=t.target.options,n=-1===s.selectedIndex?"":s[s.selectedIndex].value;i.setValue(e,{value:n})}))}}static setAttributes(t){let{html:e,element:s,storage:i=null,intent:n,linkService:a}=t;const{attributes:r}=s,o=e instanceof HTMLAnchorElement;"radio"===r.type&&(r.name="".concat(r.name,"-").concat(n));for(const[l,c]of Object.entries(r))if(null!==c&&void 0!==c)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||"href"!==l&&"newWindow"!==l)&&e.setAttribute(l,c)}o&&a.addLinkAttributes(e,r.href,r.newWindow),i&&r.dataId&&this.setupStorage(e,r.dataId,s,i)}static render(t){const e=t.annotationStorage,s=t.linkService,n=t.xfaHtml,a=t.intent||"display",r=document.createElement(n.name);n.attributes&&this.setAttributes({html:r,element:n,intent:a,linkService:s});const o=[[n,-1,r]],l=t.div;if(l.append(r),t.viewport){const e="matrix(".concat(t.viewport.transform.join(","),")");l.style.transform=e}"richText"!==a&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){var d;const[t,n,r]=o.at(-1);if(n+1===t.children.length){o.pop();continue}const l=t.children[++o.at(-1)[1]];if(null===l)continue;const{name:h}=l;if("#text"===h){const t=document.createTextNode(l.value);c.push(t),r.append(t);continue}let u;if(u=null!==l&&void 0!==l&&null!==(d=l.attributes)&&void 0!==d&&d.xmlns?document.createElementNS(l.attributes.xmlns,h):document.createElement(h),r.append(u),l.attributes&&this.setAttributes({html:u,element:l,storage:e,intent:a,linkService:s}),l.children&&l.children.length>0)o.push([l,-1,u]);else if(l.value){const t=document.createTextNode(l.value);i.XfaText.shouldBuildText(h)&&c.push(t),u.append(t)}}for(const i of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))i.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}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var i=s(6),n=s(1),a=s(10);let r=class{constructor(){(0,n.unreachable)("Not implemented: SVGGraphics")}};e.SVGGraphics=r;{const o={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",d=["butt","round","square"],h=["miter","round","bevel"],u=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!==typeof Blob&&!s)return URL.createObjectURL(new Blob([t],{type:e}));const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n="data:".concat(e,";base64,");for(let a=0,r=t.length;a<r;a+=3){const e=255&t[a],s=255&t[a+1],o=255&t[a+2];n+=i[e>>2]+i[(3&e)<<4|s>>4]+i[a+1<r?(15&s)<<2|o>>6:64]+i[a+2<r?63&o:64]}return n},p=function(){const t=new Uint8Array([137,80,78,71,13,10,26,10]),e=new Int32Array(256);for(let n=0;n<256;n++){let t=n;for(let e=0;e<8;e++)t=1&t?3988292384^t>>1&2147483647:t>>1&2147483647;e[n]=t}function s(t,s,i,n){let a=n;const r=s.length;i[a]=r>>24&255,i[a+1]=r>>16&255,i[a+2]=r>>8&255,i[a+3]=255&r,a+=4,i[a]=255&t.charCodeAt(0),i[a+1]=255&t.charCodeAt(1),i[a+2]=255&t.charCodeAt(2),i[a+3]=255&t.charCodeAt(3),a+=4,i.set(s,a),a+=s.length;const o=function(t,s,i){let n=-1;for(let a=s;a<i;a++){const s=255&(n^t[a]);n=n>>>8^e[s]}return-1^n}(i,n+4,a);i[a]=o>>24&255,i[a+1]=o>>16&255,i[a+2]=o>>8&255,i[a+3]=255&o}function i(t){let e=t.length;const s=65535,i=Math.ceil(e/s),n=new Uint8Array(2+e+5*i+4);let a=0;n[a++]=120,n[a++]=156;let r=0;for(;e>s;)n[a++]=0,n[a++]=255,n[a++]=255,n[a++]=0,n[a++]=0,n.set(t.subarray(r,r+s),a),a+=s,r+=s,e-=s;n[a++]=1,n[a++]=255&e,n[a++]=e>>8&255,n[a++]=255&~e,n[a++]=(65535&~e)>>8&255,n.set(t.subarray(r),a),a+=t.length-r;const o=function(t,e,s){let i=1,n=0;for(let a=e;a<s;++a)i=(i+(255&t[a]))%65521,n=(n+i)%65521;return n<<16|i}(t,0,t.length);return n[a++]=o>>24&255,n[a++]=o>>16&255,n[a++]=o>>8&255,n[a++]=255&o,n}function r(e,r,o,l){const c=e.width,d=e.height;let h,p,f;const g=e.data;switch(r){case n.ImageKind.GRAYSCALE_1BPP:p=0,h=1,f=c+7>>3;break;case n.ImageKind.RGB_24BPP:p=2,h=8,f=3*c;break;case n.ImageKind.RGBA_32BPP:p=6,h=8,f=4*c;break;default:throw new Error("invalid format")}const m=new Uint8Array((1+f)*d);let _=0,v=0;for(let t=0;t<d;++t)m[_++]=0,m.set(g.subarray(v,v+f),_),v+=f,_+=f;if(r===n.ImageKind.GRAYSCALE_1BPP&&l){_=0;for(let t=0;t<d;t++){_++;for(let t=0;t<f;t++)m[_++]^=255}}const b=new Uint8Array([c>>24&255,c>>16&255,c>>8&255,255&c,d>>24&255,d>>16&255,d>>8&255,255&d,h,p,0,0,0]),y=function(t){if(!a.isNodeJS)return i(t);try{let e;e=parseInt(process.versions.node)>=8?t:Buffer.from(t);const s=__webpack_require__(82787).deflateSync(e,{level:9});return s instanceof Uint8Array?s:new Uint8Array(s)}catch(e){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return i(t)}(m),A=t.length+36+b.length+y.length,P=new Uint8Array(A);let S=0;return P.set(t,S),S+=t.length,s("IHDR",b,P,S),S+=12+b.length,s("IDATA",y,P,S),S+=12+y.length,s("IEND",new Uint8Array(0),P,S),u(P,"image/png",o)}return function(t,e,s){return r(t,void 0===t.kind?n.ImageKind.GRAYSCALE_1BPP:t.kind,e,s)}}();class f{constructor(){this.fontSizeScale=1,this.fontWeight=o.fontWeight,this.fontSize=0,this.textMatrix=n.IDENTITY_MATRIX,this.fontMatrix=n.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=n.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=o.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(t,e){this.x=t,this.y=e}}function g(t){let e=[];const s=[];for(const i of t)"save"!==i.fn?"restore"===i.fn?e=s.pop():e.push(i):(e.push({fnId:92,fn:"group",items:[]}),s.push(e),e=e.at(-1).items);return e}function m(t){if(Number.isInteger(t))return t.toString();const e=t.toFixed(10);let s=e.length-1;if("0"!==e[s])return e;do{s--}while("0"===e[s]);return e.substring(0,"."===e[s]?s:s+1)}function _(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":"scale(".concat(m(t[0])," ").concat(m(t[3]),")");if(t[0]===t[3]&&t[1]===-t[2]){const e=180*Math.acos(t[0])/Math.PI;return"rotate(".concat(m(e),")")}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return"translate(".concat(m(t[4])," ").concat(m(t[5]),")");return"matrix(".concat(m(t[0])," ").concat(m(t[1])," ").concat(m(t[2])," ").concat(m(t[3])," ").concat(m(t[4])," ")+"".concat(m(t[5]),")")}let v=0,b=0,y=0;e.SVGGraphics=r=class{constructor(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,i.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new i.DOMSVGFactory,this.current=new f,this.transformMatrix=n.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=t,this.objs=e,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!s,this._operatorIdMapping=[];for(const i in n.OPS)this._operatorIdMapping[n.OPS[i]]=i}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}save(){this.transformStack.push(this.transformMatrix);const t=this.current;this.extraStack.push(t),this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(t){this.save(),this.executeOpTree(t),this.restore()}loadDependencies(t){const e=t.fnArray,s=t.argsArray;for(let i=0,a=e.length;i<a;i++)if(e[i]===n.OPS.dependency)for(const t of s[i]){const e=t.startsWith("g_")?this.commonObjs:this.objs,s=new Promise((s=>{e.get(t,s)}));this.current.dependencies.push(s)}return Promise.all(this.current.dependencies)}transform(t,e,s,i,a,r){const o=[t,e,s,i,a,r];this.transformMatrix=n.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(t,e){this.viewport=e;const s=this._initialize(e);return this.loadDependencies(t).then((()=>(this.transformMatrix=n.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),s)))}convertOpList(t){const e=this._operatorIdMapping,s=t.argsArray,i=t.fnArray,n=[];for(let a=0,r=i.length;a<r;a++){const t=i[a];n.push({fnId:t,fn:e[t],args:s[a]})}return g(n)}executeOpTree(t){for(const e of t){const t=e.fn,s=e.fnId,i=e.args;switch(0|s){case n.OPS.beginText:this.beginText();break;case n.OPS.dependency:break;case n.OPS.setLeading:this.setLeading(i);break;case n.OPS.setLeadingMoveText:this.setLeadingMoveText(i[0],i[1]);break;case n.OPS.setFont:this.setFont(i);break;case n.OPS.showText:case n.OPS.showSpacedText:this.showText(i[0]);break;case n.OPS.endText:this.endText();break;case n.OPS.moveText:this.moveText(i[0],i[1]);break;case n.OPS.setCharSpacing:this.setCharSpacing(i[0]);break;case n.OPS.setWordSpacing:this.setWordSpacing(i[0]);break;case n.OPS.setHScale:this.setHScale(i[0]);break;case n.OPS.setTextMatrix:this.setTextMatrix(i[0],i[1],i[2],i[3],i[4],i[5]);break;case n.OPS.setTextRise:this.setTextRise(i[0]);break;case n.OPS.setTextRenderingMode:this.setTextRenderingMode(i[0]);break;case n.OPS.setLineWidth:this.setLineWidth(i[0]);break;case n.OPS.setLineJoin:this.setLineJoin(i[0]);break;case n.OPS.setLineCap:this.setLineCap(i[0]);break;case n.OPS.setMiterLimit:this.setMiterLimit(i[0]);break;case n.OPS.setFillRGBColor:this.setFillRGBColor(i[0],i[1],i[2]);break;case n.OPS.setStrokeRGBColor:this.setStrokeRGBColor(i[0],i[1],i[2]);break;case n.OPS.setStrokeColorN:this.setStrokeColorN(i);break;case n.OPS.setFillColorN:this.setFillColorN(i);break;case n.OPS.shadingFill:this.shadingFill(i[0]);break;case n.OPS.setDash:this.setDash(i[0],i[1]);break;case n.OPS.setRenderingIntent:this.setRenderingIntent(i[0]);break;case n.OPS.setFlatness:this.setFlatness(i[0]);break;case n.OPS.setGState:this.setGState(i[0]);break;case n.OPS.fill:this.fill();break;case n.OPS.eoFill:this.eoFill();break;case n.OPS.stroke:this.stroke();break;case n.OPS.fillStroke:this.fillStroke();break;case n.OPS.eoFillStroke:this.eoFillStroke();break;case n.OPS.clip:this.clip("nonzero");break;case n.OPS.eoClip:this.clip("evenodd");break;case n.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case n.OPS.paintImageXObject:this.paintImageXObject(i[0]);break;case n.OPS.paintInlineImageXObject:this.paintInlineImageXObject(i[0]);break;case n.OPS.paintImageMaskXObject:this.paintImageMaskXObject(i[0]);break;case n.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(i[0],i[1]);break;case n.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case n.OPS.closePath:this.closePath();break;case n.OPS.closeStroke:this.closeStroke();break;case n.OPS.closeFillStroke:this.closeFillStroke();break;case n.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case n.OPS.nextLine:this.nextLine();break;case n.OPS.transform:this.transform(i[0],i[1],i[2],i[3],i[4],i[5]);break;case n.OPS.constructPath:this.constructPath(i[0],i[1]);break;case n.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;default:(0,n.warn)("Unimplemented operator ".concat(t))}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,s,i,n,a){const r=this.current;r.textMatrix=r.lineMatrix=[t,e,s,i,n,a],r.textMatrixScale=Math.hypot(t,e),r.x=r.lineX=0,r.y=r.lineY=0,r.xcoords=[],r.ycoords=[],r.tspan=this.svgFactory.createElement("svg:tspan"),r.tspan.setAttributeNS(null,"font-family",r.fontFamily),r.tspan.setAttributeNS(null,"font-size","".concat(m(r.fontSize),"px")),r.tspan.setAttributeNS(null,"y",m(-r.y)),r.txtElement=this.svgFactory.createElement("svg:text"),r.txtElement.append(r.tspan)}beginText(){const t=this.current;t.x=t.lineX=0,t.y=t.lineY=0,t.textMatrix=n.IDENTITY_MATRIX,t.lineMatrix=n.IDENTITY_MATRIX,t.textMatrixScale=1,t.tspan=this.svgFactory.createElement("svg:tspan"),t.txtElement=this.svgFactory.createElement("svg:text"),t.txtgrp=this.svgFactory.createElement("svg:g"),t.xcoords=[],t.ycoords=[]}moveText(t,e){const s=this.current;s.x=s.lineX+=t,s.y=s.lineY+=e,s.xcoords=[],s.ycoords=[],s.tspan=this.svgFactory.createElement("svg:tspan"),s.tspan.setAttributeNS(null,"font-family",s.fontFamily),s.tspan.setAttributeNS(null,"font-size","".concat(m(s.fontSize),"px")),s.tspan.setAttributeNS(null,"y",m(-s.y))}showText(t){const e=this.current,s=e.font,i=e.fontSize;if(0===i)return;const a=e.fontSizeScale,r=e.charSpacing,c=e.wordSpacing,d=e.fontDirection,h=e.textHScale*d,u=s.vertical,p=u?1:-1,f=s.defaultVMetrics,g=i*e.fontMatrix[0];let v=0;for(const n of t){if(null===n){v+=d*c;continue}if("number"===typeof n){v+=p*n*i/1e3;continue}const t=(n.isSpace?c:0)+r,o=n.fontChar;let l,h,m,_=n.width;if(u){let t;const e=n.vmetric||f;t=n.vmetric?e[1]:.5*_,t=-t*g;const s=e[2]*g;_=e?-e[0]:_,l=t/a,h=(v+s)/a}else l=v/a,h=0;(n.isInFont||s.missingFile)&&(e.xcoords.push(e.x+l),u&&e.ycoords.push(-e.y+h),e.tspan.textContent+=o),m=u?_*g-t*d:_*g+t*d,v+=m}e.tspan.setAttributeNS(null,"x",e.xcoords.map(m).join(" ")),u?e.tspan.setAttributeNS(null,"y",e.ycoords.map(m).join(" ")):e.tspan.setAttributeNS(null,"y",m(-e.y)),u?e.y-=v:e.x+=v*h,e.tspan.setAttributeNS(null,"font-family",e.fontFamily),e.tspan.setAttributeNS(null,"font-size","".concat(m(e.fontSize),"px")),e.fontStyle!==o.fontStyle&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle),e.fontWeight!==o.fontWeight&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);const b=e.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(b===n.TextRenderingMode.FILL||b===n.TextRenderingMode.FILL_STROKE?(e.fillColor!==o.fillColor&&e.tspan.setAttributeNS(null,"fill",e.fillColor),e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)):e.textRenderingMode===n.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none"),b===n.TextRenderingMode.STROKE||b===n.TextRenderingMode.FILL_STROKE){const t=1/(e.textMatrixScale||1);this._setStrokeAttributes(e.tspan,t)}let y=e.textMatrix;0!==e.textRise&&(y=y.slice(),y[5]+=e.textRise),e.txtElement.setAttributeNS(null,"transform","".concat(_(y)," scale(").concat(m(h),", -1)")),e.txtElement.setAttributeNS(l,"xml:space","preserve"),e.txtElement.append(e.tspan),e.txtgrp.append(e.txtElement),this._ensureTransformGroup().append(e.txtElement)}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}addFontStyle(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const e=u(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+='@font-face { font-family: "'.concat(t.loadedName,'";')+" src: url(".concat(e,"); }\n")}setFont(t){const e=this.current,s=this.commonObjs.get(t[0]);let i=t[1];e.font=s,!this.embedFonts||s.missingFile||this.embeddedFonts[s.loadedName]||(this.addFontStyle(s),this.embeddedFonts[s.loadedName]=s),e.fontMatrix=s.fontMatrix||n.FONT_IDENTITY_MATRIX;let a="normal";s.black?a="900":s.bold&&(a="bold");const r=s.italic?"italic":"normal";i<0?(i=-i,e.fontDirection=-1):e.fontDirection=1,e.fontSize=i,e.fontFamily=s.loadedName,e.fontWeight=a,e.fontStyle=r,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",m(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){var t;const e=this.current;e.textRenderingMode&n.TextRenderingMode.ADD_TO_PATH_FLAG&&null!==(t=e.txtElement)&&void 0!==t&&t.hasChildNodes()&&(e.element=e.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(t){t>0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=d[t]}setLineJoin(t){this.current.lineJoin=h[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,s){this.current.strokeColor=n.Util.makeHexColor(t,e,s)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,s){this.current.fillColor=n.Util.makeHexColor(t,e,s),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){const e=this.viewport.width,s=this.viewport.height,i=n.Util.inverseTransform(this.transformMatrix),a=n.Util.applyTransform([0,0],i),r=n.Util.applyTransform([0,s],i),o=n.Util.applyTransform([e,0],i),l=n.Util.applyTransform([e,s],i),c=Math.min(a[0],r[0],o[0],l[0]),d=Math.min(a[1],r[1],o[1],l[1]),h=Math.max(a[0],r[0],o[0],l[0]),u=Math.max(a[1],r[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c),p.setAttributeNS(null,"y",d),p.setAttributeNS(null,"width",h-c),p.setAttributeNS(null,"height",u-d),p.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(p)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){const e=t[1],s=t[2],i=t[3]||n.IDENTITY_MATRIX,[a,r,o,l]=t[4],c=t[5],d=t[6],h=t[7],u="shading".concat(y++),[p,f,g,m]=n.Util.normalizeRect([...n.Util.applyTransform([a,r],i),...n.Util.applyTransform([o,l],i)]),[_,v]=n.Util.singularValueDecompose2dScale(i),b=c*_,A=d*v,P=this.svgFactory.createElement("svg:pattern");P.setAttributeNS(null,"id",u),P.setAttributeNS(null,"patternUnits","userSpaceOnUse"),P.setAttributeNS(null,"width",b),P.setAttributeNS(null,"height",A),P.setAttributeNS(null,"x","".concat(p)),P.setAttributeNS(null,"y","".concat(f));const S=this.svg,F=this.transformMatrix,x=this.current.fillColor,C=this.current.strokeColor,w=this.svgFactory.create(g-p,m-f);if(this.svg=w,this.transformMatrix=i,2===h){const t=n.Util.makeHexColor(...e);this.current.fillColor=t,this.current.strokeColor=t}return this.executeOpTree(this.convertOpList(s)),this.svg=S,this.transformMatrix=F,this.current.fillColor=x,this.current.strokeColor=C,P.append(w.childNodes[0]),this.defs.append(P),"url(#".concat(u,")")}_makeShadingPattern(t){switch("string"===typeof t&&(t=this.objs.get(t)),t[0]){case"RadialAxial":const e="shading".concat(y++),s=t[3];let i;switch(t[1]){case"axial":const s=t[4],n=t[5];i=this.svgFactory.createElement("svg:linearGradient"),i.setAttributeNS(null,"id",e),i.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),i.setAttributeNS(null,"x1",s[0]),i.setAttributeNS(null,"y1",s[1]),i.setAttributeNS(null,"x2",n[0]),i.setAttributeNS(null,"y2",n[1]);break;case"radial":const a=t[4],r=t[5],o=t[6],l=t[7];i=this.svgFactory.createElement("svg:radialGradient"),i.setAttributeNS(null,"id",e),i.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),i.setAttributeNS(null,"cx",r[0]),i.setAttributeNS(null,"cy",r[1]),i.setAttributeNS(null,"r",l),i.setAttributeNS(null,"fx",a[0]),i.setAttributeNS(null,"fy",a[1]),i.setAttributeNS(null,"fr",o);break;default:throw new Error("Unknown RadialAxial type: ".concat(t[1]))}for(const t of s){const e=this.svgFactory.createElement("svg:stop");e.setAttributeNS(null,"offset",t[0]),e.setAttributeNS(null,"stop-color",t[1]),i.append(e)}return this.defs.append(i),"url(#".concat(e,")");case"Mesh":return(0,n.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(t[0]))}}setDash(t,e){this.current.dashArray=t,this.current.dashPhase=e}constructPath(t,e){const s=this.current;let i=s.x,a=s.y,r=[],o=0;for(const l of t)switch(0|l){case n.OPS.rectangle:i=e[o++],a=e[o++];const t=i+e[o++],s=a+e[o++];r.push("M",m(i),m(a),"L",m(t),m(a),"L",m(t),m(s),"L",m(i),m(s),"Z");break;case n.OPS.moveTo:i=e[o++],a=e[o++],r.push("M",m(i),m(a));break;case n.OPS.lineTo:i=e[o++],a=e[o++],r.push("L",m(i),m(a));break;case n.OPS.curveTo:i=e[o+4],a=e[o+5],r.push("C",m(e[o]),m(e[o+1]),m(e[o+2]),m(e[o+3]),m(i),m(a)),o+=6;break;case n.OPS.curveTo2:r.push("C",m(i),m(a),m(e[o]),m(e[o+1]),m(e[o+2]),m(e[o+3])),i=e[o+2],a=e[o+3],o+=4;break;case n.OPS.curveTo3:i=e[o+2],a=e[o+3],r.push("C",m(e[o]),m(e[o+1]),m(i),m(a),m(i),m(a)),o+=4;break;case n.OPS.closePath:r.push("Z")}r=r.join(" "),s.path&&t.length>0&&t[0]!==n.OPS.rectangle&&t[0]!==n.OPS.moveTo?r=s.path.getAttributeNS(null,"d")+r:(s.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(s.path)),s.path.setAttributeNS(null,"d",r),s.path.setAttributeNS(null,"fill","none"),s.element=s.path,s.setCurrentPoint(i,a)}endPath(){const t=this.current;if(t.path=null,!this.pendingClip)return;if(!t.element)return void(this.pendingClip=null);const e="clippath".concat(v++),s=this.svgFactory.createElement("svg:clipPath");s.setAttributeNS(null,"id",e),s.setAttributeNS(null,"transform",_(this.transformMatrix));const i=t.element.cloneNode(!0);if("evenodd"===this.pendingClip?i.setAttributeNS(null,"clip-rule","evenodd"):i.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,s.append(i),this.defs.append(s),t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;s.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl="url(#".concat(e,")"),this.tgrp=null}clip(t){this.pendingClip=t}closePath(){const t=this.current;if(t.path){const e="".concat(t.path.getAttributeNS(null,"d"),"Z");t.path.setAttributeNS(null,"d",e)}}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,s]of t)switch(e){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s);break;case"CA":this.setStrokeAlpha(s);break;case"ca":this.setFillAlpha(s);break;default:(0,n.warn)("Unimplemented graphic state operator ".concat(e))}}fill(){const t=this.current;t.element&&(t.element.setAttributeNS(null,"fill",t.fillColor),t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha),this.endPath())}stroke(){const t=this.current;t.element&&(this._setStrokeAttributes(t.element),t.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const s=this.current;let i=s.dashArray;1!==e&&i.length>0&&(i=i.map((function(t){return e*t}))),t.setAttributeNS(null,"stroke",s.strokeColor),t.setAttributeNS(null,"stroke-opacity",s.strokeAlpha),t.setAttributeNS(null,"stroke-miterlimit",m(s.miterLimit)),t.setAttributeNS(null,"stroke-linecap",s.lineCap),t.setAttributeNS(null,"stroke-linejoin",s.lineJoin),t.setAttributeNS(null,"stroke-width",m(e*s.lineWidth)+"px"),t.setAttributeNS(null,"stroke-dasharray",i.map(m).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",m(e*s.dashPhase)+"px")}eoFill(){var t;null===(t=this.current.element)||void 0===t||t.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var t;null===(t=this.current.element)||void 0===t||t.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0"),t.setAttributeNS(null,"y","0"),t.setAttributeNS(null,"width","1px"),t.setAttributeNS(null,"height","1px"),t.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(t)}paintImageXObject(t){const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,n.warn)("Dependent image with object ID ".concat(t," is not ready yet"))}paintInlineImageXObject(t,e){const s=t.width,i=t.height,n=p(t,this.forceDataSchema,!!e),a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",m(s)),a.setAttributeNS(null,"height",m(i)),this.current.element=a,this.clip("nonzero");const r=this.svgFactory.createElement("svg:image");r.setAttributeNS(c,"xlink:href",n),r.setAttributeNS(null,"x","0"),r.setAttributeNS(null,"y",m(-i)),r.setAttributeNS(null,"width",m(s)+"px"),r.setAttributeNS(null,"height",m(i)+"px"),r.setAttributeNS(null,"transform","scale(".concat(m(1/s)," ").concat(m(-1/i),")")),e?e.append(r):this._ensureTransformGroup().append(r)}paintImageMaskXObject(t){const e=this.getObject(t.data,t);if(e.bitmap)return void(0,n.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");const s=this.current,i=e.width,a=e.height,r=s.fillColor;s.maskId="mask".concat(b++);const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",s.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width",m(i)),l.setAttributeNS(null,"height",m(a)),l.setAttributeNS(null,"fill",r),l.setAttributeNS(null,"mask","url(#".concat(s.maskId,")")),this.defs.append(o),this._ensureTransformGroup().append(l),this.paintInlineImageXObject(e,o)}paintFormXObjectBegin(t,e){if(Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e){const t=e[2]-e[0],s=e[3]-e[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",e[0]),i.setAttributeNS(null,"y",e[1]),i.setAttributeNS(null,"width",m(t)),i.setAttributeNS(null,"height",m(s)),this.current.element=i,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(t){const e=this.svgFactory.create(t.width,t.height),s=this.svgFactory.createElement("svg:defs");e.append(s),this.defs=s;const i=this.svgFactory.createElement("svg:g");return i.setAttributeNS(null,"transform",_(t.transform)),e.append(i),this.svg=i,e}_ensureClipGroup(){if(!this.current.clipGroup){const t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(t),this.current.clipGroup=t}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",_(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var s=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](s,s.exports,__w_pdfjs_require__),s.exports}var __nested_webpack_exports__={};return(()=>{var t=__nested_webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AbortException",{enumerable:!0,get:function(){return e.AbortException}}),Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return a.AnnotationEditorLayer}}),Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}}),Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}}),Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return r.AnnotationEditorUIManager}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}}),Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}}),Object.defineProperty(t,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return s.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return s.PDFWorker}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}}),Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return i.PixelsPerInch}}),Object.defineProperty(t,"PromiseCapability",{enumerable:!0,get:function(){return e.PromiseCapability}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return i.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return c.SVGGraphics}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}}),Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return d.XfaLayer}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return s.build}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return s.getDocument}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return i.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return i.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return i.getXfaPageViewport}}),Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return i.isDataScheme}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return i.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return i.loadScript}}),Object.defineProperty(t,"normalizeUnicode",{enumerable:!0,get:function(){return e.normalizeUnicode}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return n.renderTextLayer}}),Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return i.setLayerDimensions}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return n.updateTextLayer}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return s.version}});var e=__w_pdfjs_require__(1),s=__w_pdfjs_require__(2),i=__w_pdfjs_require__(6),n=__w_pdfjs_require__(26),a=__w_pdfjs_require__(27),r=__w_pdfjs_require__(5),o=__w_pdfjs_require__(32),l=__w_pdfjs_require__(14),c=__w_pdfjs_require__(35),d=__w_pdfjs_require__(34)})(),__nested_webpack_exports__})(),module.exports=factory()},94168:(t,e,s)=>{"use strict";s.r(e),s.d(e,{Document:()=>J,Outline:()=>ot,Page:()=>wt,Thumbnail:()=>Tt,pdfjs:()=>i,useDocumentContext:()=>tt,useOutlineContext:()=>et,usePageContext:()=>vt});var i=s(46749),n=s(73884),a=s.n(n),r=s(33444),o=s.n(r),l=function(t,e,s){if(s||2===arguments.length)for(var i,n=0,a=e.length;n<a;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},c=l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function d(t,e){var s={};return c.forEach((function(i){var n=t[i];n&&(s[i]=e?function(t){return n(t,e(i))}:n)})),s}function h(t){var e=!1;return{promise:new Promise((function(s,i){t.then((function(t){return!e&&s(t)})).catch((function(t){return!e&&i(t)}))})),cancel:function(){e=!0}}}function u(t){var e,s,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(s=u(t[e]))&&(i&&(i+=" "),i+=s);else for(e in t)t[e]&&(i&&(i+=" "),i+=e);return i}const p=function(){for(var t,e,s=0,i="";s<arguments.length;)(t=arguments[s++])&&(e=u(t))&&(i&&(i+=" "),i+=e);return i};var f=!0,g="Invariant failed";function m(t,e){if(!t){if(f)throw new Error(g);var s="function"===typeof e?e():e,i=s?"".concat(g,": ").concat(s):g;throw new Error(i)}}const _=function(t,e){},v=(0,n.createContext)(null);function b(t){let{children:e,type:s}=t;return a().createElement("div",{className:"react-pdf__message react-pdf__message--".concat(s)},e)}b.propTypes={children:o().node,type:o().oneOf(["error","loading","no-data"]).isRequired};class y{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return m(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){m(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise((e=>{m(this.pdfDocument,"PDF document not loaded."),m(t,"Destination is not specified."),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)})).then((t=>{m(Array.isArray(t),'"'.concat(t,'" is not a valid destination array.'));const e=t[0];new Promise((t=>{m(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then((e=>{t(e)})).catch((()=>{m(!1,'"'.concat(e,'" is not a valid page reference.'))})):"number"===typeof e?t(e):m(!1,'"'.concat(e,'" is not a valid destination reference.'))})).then((e=>{const s=e+1;m(this.pdfViewer,"PDF viewer is not initialized."),m(s>=1&&s<=this.pagesCount,'"'.concat(s,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:s})}))}))}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;m(this.pdfViewer,"PDF viewer is not initialized."),m(t>=1&&t<=this.pagesCount,'"'.concat(t,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,s){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=s?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const A={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},P="undefined"!==typeof document,S=P&&"file:"===window.location.protocol;function F(t){return"undefined"!==typeof t}function x(t){return F(t)&&null!==t}function C(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function w(t){m(C(t),"Invalid data URI.");const[e="",s=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(s):unescape(s)}const E="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function k(){_(!S,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(E))}function T(t){t&&t.cancel&&t.cancel()}function M(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function R(t){return"RenderingCancelledException"===t.name}function I(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function D(){return(0,n.useReducer)(I,{value:void 0,error:void 0})}const O=(()=>{const t={};return c.forEach((e=>{t[e]=o().func})),t})(),L=o().oneOfType([o().instanceOf(Int8Array),o().instanceOf(Uint8Array),o().instanceOf(Uint8ClampedArray),o().instanceOf(Int16Array),o().instanceOf(Uint16Array),o().instanceOf(Int32Array),o().instanceOf(Uint32Array),o().instanceOf(Float32Array),o().instanceOf(Float64Array)]),G=[o().string,o().instanceOf(ArrayBuffer),o().shape({data:o().oneOfType([o().string,o().instanceOf(ArrayBuffer),o().arrayOf(o().number.isRequired),L]).isRequired}),o().shape({range:o().instanceOf(i.PDFDataRangeTransport).isRequired}),o().shape({url:o().string.isRequired})];"undefined"!==typeof Blob&&G.push(o().instanceOf(Blob));const N=o().oneOfType([o().string,o().arrayOf(o().string)]),B=o().oneOfType(G),j=(o().instanceOf(y),o().oneOf(["_self","_blank","_parent","_top"]),o().shape({commonObjs:o().shape({}).isRequired,getAnnotations:o().func.isRequired,getTextContent:o().func.isRequired,getViewport:o().func.isRequired,render:o().func.isRequired}),o().oneOfType([o().shape({getDestination:o().func.isRequired,getOutline:o().func.isRequired,getPage:o().func.isRequired,numPages:o().number.isRequired}),o().bool])),W=o().oneOfType([o().func,o().exact({current:o().any})]),U=o().oneOf(["canvas","none","svg"]),q=o().oneOf([0,90,180,270]);var H=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function r(t){try{l(i.next(t))}catch(e){a(e)}}function o(t){try{l(i.throw(t))}catch(e){a(e)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(r,o)}l((i=i.apply(t,e||[])).next())}))},V=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s};const{PDFDataRangeTransport:z}=i,X=(t,e)=>{switch(e){case A.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case A.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}},Y=(0,n.forwardRef)((function(t,e){var{children:s,className:r,error:o="Failed to load PDF file.",externalLinkRel:l,externalLinkTarget:c,file:u,inputRef:f,imageResourcesPath:g,loading:A="Loading PDF\u2026",noData:S="No PDF file specified.",onItemClick:F,onLoadError:x,onLoadProgress:E,onLoadSuccess:M,onPassword:R=X,onSourceError:I,onSourceSuccess:O,options:L,renderMode:G,rotate:N}=t,B=V(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[j,W]=D(),{value:U,error:q}=j,[Y,K]=D(),{value:J,error:Q}=Y,Z=(0,n.useRef)(new y),$=(0,n.useRef)([]),tt=(0,n.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:s,pageIndex:i=s-1}=t;if(F)return void F({dest:e,pageIndex:i,pageNumber:s});const n=$.current[i];n?n.scrollIntoView():_(!1,"An internal link leading to page ".concat(s," was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>."))}});(0,n.useImperativeHandle)(e,(()=>({linkService:Z,pages:$,viewer:tt})),[]),(0,n.useEffect)((function(){W({type:"RESET"})}),[u,W]);const et=(0,n.useCallback)((()=>H(this,void 0,void 0,(function*(){if(!u)return null;if("string"===typeof u){if(C(u)){return{data:w(u)}}return k(),{url:u}}if(u instanceof z)return{range:u};if(u instanceof ArrayBuffer)return{data:u};if(P&&function(t){return m(P,"isBlob can only be used in a browser environment"),t instanceof Blob}(u)){const t=yield function(t){return new Promise(((e,s)=>{const i=new FileReader;i.onload=()=>{if(!i.result)return s(new Error("Error while reading a file."));e(i.result)},i.onerror=t=>{if(!t.target)return s(new Error("Error while reading a file."));const{error:e}=t.target;if(!e)return s(new Error("Error while reading a file."));switch(e.code){case e.NOT_FOUND_ERR:return s(new Error("Error while reading a file: File not found."));case e.SECURITY_ERR:return s(new Error("Error while reading a file: Security error."));case e.ABORT_ERR:return s(new Error("Error while reading a file: Aborted."));default:return s(new Error("Error while reading a file."))}},i.readAsArrayBuffer(t)}))}(u);return{data:t}}if(m("object"===typeof u,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),m("data"in u||"range"in u||"url"in u,"Invalid parameter object: need either .data, .range or .url"),"url"in u&&"string"===typeof u.url){if(C(u.url)){const{url:t}=u,e=V(u,["url"]),s=w(t);return Object.assign({data:s},e)}k()}return u}))),[u]);function st(t,e){$.current[t]=e}function it(t){delete $.current[t]}(0,n.useEffect)((()=>{const t=h(et());return t.promise.then((t=>{W({type:"RESOLVE",value:t})})).catch((t=>{W({type:"REJECT",error:t})})),()=>{T(t)}}),[et,W]),(0,n.useEffect)((()=>{"undefined"!==typeof U&&(!1!==U?O&&O():q&&(_(!1,q.toString()),I&&I(q)))}),[U]),(0,n.useEffect)((function(){K({type:"RESET"})}),[K,U]),(0,n.useEffect)((function(){if(!U)return;const t=L?Object.assign(Object.assign({},U),L):U,e=i.getDocument(t);E&&(e.onProgress=E),R&&(e.onPassword=R);const s=e;return s.promise.then((t=>{K({type:"RESOLVE",value:t})})).catch((t=>{s.destroyed||K({type:"REJECT",error:t})})),()=>{s.destroy()}}),[L,K,U]),(0,n.useEffect)((()=>{"undefined"!==typeof J&&(!1!==J?J&&(M&&M(J),$.current=new Array(J.numPages),Z.current.setDocument(J)):Q&&(_(!1,Q.toString()),x&&x(Q)))}),[J]),(0,n.useEffect)((function(){Z.current.setViewer(tt.current),Z.current.setExternalLinkRel(l),Z.current.setExternalLinkTarget(c)}),[l,c]);const nt=(0,n.useMemo)((()=>({imageResourcesPath:g,linkService:Z.current,onItemClick:F,pdf:J,registerPage:st,renderMode:G,rotate:N,unregisterPage:it})),[g,F,J,G,N]),at=(0,n.useMemo)((()=>d(B,(()=>J))),[B,J]);return a().createElement("div",Object.assign({className:p("react-pdf__Document",r),ref:f,style:{"--scale-factor":"1"}},at),u?void 0===J||null===J?a().createElement(b,{type:"loading"},"function"===typeof A?A():A):!1===J?a().createElement(b,{type:"error"},"function"===typeof o?o():o):a().createElement(v.Provider,{value:nt},s):a().createElement(b,{type:"no-data"},"function"===typeof S?S():S))})),K=o().oneOfType([o().func,o().node]);Y.propTypes=Object.assign(Object.assign({},O),{children:o().node,className:N,error:K,externalLinkRel:o().string,externalLinkTarget:o().oneOf(["_self","_blank","_parent","_top"]),file:B,imageResourcesPath:o().string,inputRef:W,loading:K,noData:K,onItemClick:o().func,onLoadError:o().func,onLoadProgress:o().func,onLoadSuccess:o().func,onPassword:o().func,onSourceError:o().func,onSourceSuccess:o().func,options:o().shape({canvasFactory:o().any,canvasMaxAreaInBytes:o().number,cMapPacked:o().bool,CMapReaderFactory:o().any,cMapUrl:o().string,disableAutoFetch:o().bool,disableFontFace:o().bool,disableRange:o().bool,disableStream:o().bool,docBaseUrl:o().string,enableXfa:o().bool,filterFactory:o().any,fontExtraProperties:o().bool,httpHeaders:o().object,isEvalSupported:o().bool,isOffscreenCanvasSupported:o().bool,length:o().number,maxImageSize:o().number,ownerDocument:o().any,password:o().string,pdfBug:o().bool,rangeChunkSize:o().number,StandardFontDataFactory:o().any,standardFontDataUrl:o().string,stopAtErrors:o().bool,useSystemFonts:o().bool,useWorkerFetch:o().bool,verbosity:o().number,withCredentials:o().bool,worker:o().any}),rotate:o().number});const J=Y,Q=(0,n.createContext)(null);class Z{constructor(t){let{num:e,gen:s}=t;this.num=e,this.gen=s}toString(){let t="".concat(this.num,"R");return 0!==this.gen&&(t+=this.gen),t}}function $(t){const e=(0,n.useRef)(),s=e.current;return F(s)?()=>s:()=>{const s=t();return e.current=s,s}}function tt(){return(0,n.useContext)(v)}function et(){return(0,n.useContext)(Q)}var st=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function r(t){try{l(i.next(t))}catch(e){a(e)}}function o(t){try{l(i.throw(t))}catch(e){a(e)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(r,o)}l((i=i.apply(t,e||[])).next())}))},it=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s};function nt(t){const e=tt();m(e,"Unable to find Document context. Did you wrap <Outline /> in <Document />?");const s=et();m(s,"Unable to find Outline context.");const i=Object.assign(Object.assign(Object.assign({},e),s),t),{item:n,linkService:r,onItemClick:o,pdf:l}=i,c=it(i,["item","linkService","onItemClick","pdf"]);m(l,"Attempted to load an outline, but no document was specified.");const d=$((()=>"string"===typeof n.dest?l.getDestination(n.dest):n.dest)),h=$((()=>st(this,void 0,void 0,(function*(){const t=yield d();if(!t)throw new Error("Destination not found.");const[e]=t;return l.getPageIndex(new Z(e))})))),u=$((()=>st(this,void 0,void 0,(function*(){return(yield h())+1}))));return a().createElement("li",null,a().createElement("a",{href:"#",onClick:function(t){t.preventDefault(),o?Promise.all([d(),h(),u()]).then((t=>{let[e,s,i]=t;o({dest:e,pageIndex:s,pageNumber:i})})):r.goToDestination(n.dest)}},n.title),function(){if(!n.items||!n.items.length)return null;const{items:t}=n;return a().createElement("ul",null,t.map(((t,e)=>a().createElement(nt,Object.assign({key:"string"===typeof t.dest?t.dest:e,item:t},c)))))}())}const at=o().oneOfType([o().string,o().arrayOf(o().any)]);nt.propTypes={item:o().shape({dest:at,items:o().arrayOf(o().shape({dest:at,title:o().string})),title:o().string}).isRequired};var rt=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s};function ot(t){const e=tt();m(e,"Unable to find Document context. Did you wrap <Outline /> in <Document />?");const s=Object.assign(Object.assign({},e),t),{className:i,inputRef:r,onItemClick:o,onLoadError:l,onLoadSuccess:c,pdf:u}=s,f=rt(s,["className","inputRef","onItemClick","onLoadError","onLoadSuccess","pdf"]);m(u,"Attempted to load an outline, but no document was specified.");const[g,v]=D(),{value:b,error:y}=g;(0,n.useEffect)((function(){v({type:"RESET"})}),[v,u]),(0,n.useEffect)((function(){if(!u)return;const t=h(u.getOutline()),e=t;return t.promise.then((t=>{v({type:"RESOLVE",value:t})})).catch((t=>{v({type:"REJECT",error:t})})),()=>T(e)}),[v,u]),(0,n.useEffect)((()=>{void 0!==b&&(!1!==b?"undefined"!==typeof b&&!1!==b&&c&&c(b):y&&(_(!1,y.toString()),l&&l(y)))}),[b]);const A=(0,n.useMemo)((()=>({onItemClick:o})),[o]),P=(0,n.useMemo)((()=>d(f,(()=>b))),[f,b]);if(!b)return null;return a().createElement("div",Object.assign({className:p("react-pdf__Outline",i),ref:r},P),a().createElement(Q.Provider,{value:A},b?a().createElement("ul",null,b.map(((t,e)=>a().createElement(nt,{key:"string"===typeof t.dest?t.dest:e,item:t})))):null))}function lt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var s=t.filter(Boolean);return s.length<=1?s[0]||null:function(t){s.forEach((function(e){"function"===typeof e?e(t):e&&(e.current=t)}))}}ot.propTypes=Object.assign(Object.assign({},O),{className:N,inputRef:W,onItemClick:o().func,onLoadError:o().func,onLoadSuccess:o().func,pdf:j});const ct=(0,n.createContext)(null),dt={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},ht=/^H(\d+)$/;function ut(t){return"children"in t}function pt(t){return!!ut(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function ft(t){const e={};if(ut(t)){const{role:s}=t,i=s.match(ht);if(i)e.role="heading",e["aria-level"]=Number(i[1]);else if(function(t){return t in dt}(s)){const t=dt[s];t&&(e.role=t)}}return e}function gt(t){const e={};if(ut(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),pt(t)){const[s]=t.children;if(s){const t=gt(s);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function mt(t){return t?Object.assign(Object.assign({},ft(t)),gt(t)):null}function _t(t){let{className:e,node:s}=t;const i=(0,n.useMemo)((()=>mt(s)),[s]),r=(0,n.useMemo)((()=>ut(s)?pt(s)?null:s.children.map(((t,e)=>a().createElement(_t,{key:e,node:t}))):null),[s]);return a().createElement("span",Object.assign({className:e},i),r)}function vt(){return(0,n.useContext)(ct)}function bt(){const t=vt();m(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:s}=t,[i,r]=D(),{value:o,error:l}=i,{customTextRenderer:c,page:d}=t;return(0,n.useEffect)((function(){r({type:"RESET"})}),[r,d]),(0,n.useEffect)((function(){if(c)return;if(!d)return;const t=h(d.getStructTree()),e=t;return t.promise.then((t=>{r({type:"RESOLVE",value:t})})).catch((t=>{r({type:"REJECT",error:t})})),()=>T(e)}),[c,d,r]),(0,n.useEffect)((()=>{void 0!==o&&(!1!==o?o&&s&&s(o):l&&(_(!1,l.toString()),e&&e(l)))}),[o]),o?a().createElement(_t,{className:"react-pdf__Page__structTree structTree",node:o}):null}_t.propTypes={node:o().oneOfType([o().shape({children:o().object,role:o().string}),o().shape({id:o().string,type:o().string})]).isRequired};const yt=i.AnnotationMode;function At(t){const e=vt();m(e,"Unable to find Page context.");const s=Object.assign(Object.assign({},e),t),{_className:i,canvasBackground:r,devicePixelRatio:o,onRenderError:l,onRenderSuccess:c,page:d,renderForms:h,renderTextLayer:u,rotate:p,scale:f}=s,{canvasRef:g}=t,v=(0,n.useRef)(null);m(d,"Attempted to render page canvas, but no page was specified.");const b=o||P&&window.devicePixelRatio||1;function y(t){R(t)||(_(!1,t.toString()),l&&l(t))}const A=(0,n.useMemo)((()=>d.getViewport({scale:f*b,rotation:p})),[b,d,p,f]),S=(0,n.useMemo)((()=>d.getViewport({scale:f,rotation:p})),[d,p,f]);(0,n.useEffect)((function(){if(!d)return;d.cleanup();const{current:t}=v;if(!t)return;t.width=A.width,t.height=A.height,t.style.width="".concat(Math.floor(S.width),"px"),t.style.height="".concat(Math.floor(S.height),"px"),t.style.visibility="hidden";const e={annotationMode:h?yt.ENABLE_FORMS:yt.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:A};r&&(e.background=r);const s=d.render(e),i=s;return s.promise.then((()=>{t.style.visibility="",d&&c&&c(M(d,f))})).catch(y),()=>T(i)}),[r,v,b,d,h,A,S]);const F=(0,n.useCallback)((()=>{const{current:t}=v;t&&(t.width=0,t.height=0)}),[v]);return(0,n.useEffect)((()=>F),[F]),a().createElement("canvas",{className:"".concat(i,"__canvas"),dir:"ltr",ref:lt(g,v),style:{display:"block",userSelect:"none"}},u?a().createElement(bt,null):null)}function Pt(){const t=vt();m(t,"Unable to find Page context.");const{_className:e,onRenderSuccess:s,onRenderError:r,page:o,rotate:l,scale:c}=t,[d,u]=D(),{value:p,error:f}=d;m(o,"Attempted to render page SVG, but no page was specified.");const g=(0,n.useMemo)((()=>o.getViewport({scale:c,rotation:l})),[o,l,c]);(0,n.useEffect)((function(){u({type:"RESET"})}),[o,u,g]),(0,n.useEffect)((function(){if(!o)return;const t=h(o.getOperatorList());return t.promise.then((t=>{new i.SVGGraphics(o.commonObjs,o.objs).getSVG(t,g).then((t=>{u({type:"RESOLVE",value:t})})).catch((t=>{u({type:"REJECT",error:t})}))})).catch((t=>{u({type:"REJECT",error:t})})),()=>T(t)}),[o,u,g]),(0,n.useEffect)((()=>{void 0!==p&&(!1!==p?o&&s&&s(M(o,c)):f&&(R(f)||(_(!1,f.toString()),r&&r(f))))}),[p]);const{width:v,height:b}=g;return a().createElement("div",{className:"".concat(e,"__svg"),ref:t=>function(t){if(!t||!p)return;t.firstElementChild||t.appendChild(p);const{width:e,height:s}=g;p.setAttribute("width","".concat(e)),p.setAttribute("height","".concat(s))}(t),style:{display:"block",backgroundColor:"white",overflow:"hidden",width:v,height:b,userSelect:"none"}})}function St(){const t=vt();m(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:s,onGetTextSuccess:r,onRenderTextLayerError:o,onRenderTextLayerSuccess:l,page:c,pageIndex:d,pageNumber:u,rotate:f,scale:g}=t,[v,b]=D(),{value:y,error:A}=v,P=(0,n.useRef)(null),S=(0,n.useRef)();m(c,"Attempted to load page text content, but no page was specified."),_(1===parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),(0,n.useEffect)((function(){b({type:"RESET"})}),[c,b]),(0,n.useEffect)((function(){if(!c)return;const t=h(c.getTextContent()),e=t;return t.promise.then((t=>{b({type:"RESOLVE",value:t})})).catch((t=>{b({type:"REJECT",error:t})})),()=>T(e)}),[c,b]),(0,n.useEffect)((()=>{void 0!==y&&(!1!==y?y&&r&&r(y):A&&(_(!1,A.toString()),s&&s(A)))}),[y]);const F=(0,n.useCallback)((()=>{l&&l()}),[l]),x=(0,n.useCallback)((t=>{_(!1,t.toString()),o&&o(t)}),[o]);const C=(0,n.useMemo)((()=>c.getViewport({scale:g,rotation:f})),[c,f,g]);return(0,n.useLayoutEffect)((function(){if(!c||!y)return;const{current:t}=P;if(!t)return;t.innerHTML="";const s=c.streamTextContent({includeMarkedContent:!0}),n={container:t,textContentSource:s,viewport:C},a=i.renderTextLayer(n),r=a;return a.promise.then((()=>{const s=document.createElement("div");s.className="endOfContent",t.append(s),S.current=s;const i=Boolean(t.querySelector(".markedContent"))?t.querySelectorAll(".markedContent > *:not(.markedContent"):t.children;if(e){let t=0;y.items.forEach(((s,n)=>{if(!function(t){return"str"in t}(s))return;const a=i[t];if(!a)return;const r=e(Object.assign({pageIndex:d,pageNumber:u,itemIndex:n},s));a.innerHTML=r,t+=s.str&&s.hasEOL?2:1}))}F()})).catch(x),()=>T(r)}),[e,x,F,c,d,u,y,C]),a().createElement("div",{className:p("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=S.current;t&&t.classList.remove("active")},onMouseDown:function(){const t=S.current;t&&t.classList.add("active")},ref:P})}function Ft(){const t=tt();m(t,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const e=vt();m(e,"Unable to find Page context.");const s=Object.assign(Object.assign({},t),e),{imageResourcesPath:r,linkService:o,onGetAnnotationsError:l,onGetAnnotationsSuccess:c,onRenderAnnotationLayerError:d,onRenderAnnotationLayerSuccess:u,page:f,pdf:g,renderForms:v,rotate:b,scale:y=1}=s,[A,P]=D(),{value:S,error:F}=A,x=(0,n.useRef)(null);m(f,"Attempted to load page annotations, but no page was specified."),_(1===parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),(0,n.useEffect)((function(){P({type:"RESET"})}),[P,f]),(0,n.useEffect)((function(){if(!f)return;const t=h(f.getAnnotations()),e=t;return t.promise.then((t=>{P({type:"RESOLVE",value:t})})).catch((t=>{P({type:"REJECT",error:t})})),()=>{T(e)}}),[P,f,v]),(0,n.useEffect)((()=>{void 0!==S&&(!1!==S?S&&c&&c(S):F&&(_(!1,F.toString()),l&&l(F)))}),[S]);const C=(0,n.useMemo)((()=>f.getViewport({scale:y,rotation:b})),[f,b,y]);return(0,n.useEffect)((function(){if(!g||!f||!S)return;const{current:t}=x;if(!t)return;const e=C.clone({dontFlip:!0}),s={annotations:S,annotationStorage:g.annotationStorage,div:t,downloadManager:null,imageResourcesPath:r,linkService:o,page:f,renderForms:v,viewport:e};t.innerHTML="";try{i.AnnotationLayer.render(s),u&&u()}catch(n){!function(t){_(!1,"".concat(t)),d&&d(t)}(n)}return()=>{}}),[S,r,o,f,v,C]),a().createElement("div",{className:p("react-pdf__Page__annotations","annotationLayer"),ref:x})}At.propTypes={canvasRef:W};var xt=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s};const Ct=1;function wt(t){const e=tt();m(e,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const s=Object.assign(Object.assign({},e),t),{_className:i="react-pdf__Page",_enableRegisterUnregisterPage:r=!0,canvasBackground:o,canvasRef:l,children:c,className:u,customTextRenderer:f,devicePixelRatio:g,error:v="Failed to load the page.",height:y,inputRef:A,loading:P="Loading page\u2026",noData:S="No page specified.",onGetAnnotationsError:F,onGetAnnotationsSuccess:C,onGetStructTreeError:w,onGetStructTreeSuccess:E,onGetTextError:k,onGetTextSuccess:R,onLoadError:I,onLoadSuccess:O,onRenderAnnotationLayerError:L,onRenderAnnotationLayerSuccess:G,onRenderError:N,onRenderSuccess:B,onRenderTextLayerError:j,onRenderTextLayerSuccess:W,pageIndex:U,pageNumber:q,pdf:H,registerPage:V,renderAnnotationLayer:z=!0,renderForms:X=!1,renderMode:Y="canvas",renderTextLayer:K=!0,rotate:J,scale:Q=Ct,unregisterPage:Z,width:$}=s,et=xt(s,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[st,it]=D(),{value:nt,error:at}=st,rt=(0,n.useRef)(null);m(H,"Attempted to load a page, but no document was specified.");const ot=x(q)?q-1:null!==U&&void 0!==U?U:null,dt=null!==q&&void 0!==q?q:x(U)?U+1:null,ht=null!==J&&void 0!==J?J:nt?nt.rotate:null,ut=(0,n.useMemo)((()=>{if(!nt)return null;let t=1;const e=null!==Q&&void 0!==Q?Q:Ct;if($||y){const e=nt.getViewport({scale:1,rotation:ht});$?t=$/e.width:y&&(t=y/e.height)}return e*t}),[y,nt,ht,Q,$]);(0,n.useEffect)((function(){return()=>{x(ot)&&r&&Z&&Z(ot)}}),[r,H,ot,Z]),(0,n.useEffect)((function(){it({type:"RESET"})}),[it,H,ot]),(0,n.useEffect)((function(){if(!H||!dt)return;const t=h(H.getPage(dt)),e=t;return t.promise.then((t=>{it({type:"RESOLVE",value:t})})).catch((t=>{it({type:"REJECT",error:t})})),()=>T(e)}),[it,H,ot,dt,V]),(0,n.useEffect)((()=>{void 0!==nt&&(!1!==nt?function(){if(O){if(!nt||!ut)return;O(M(nt,ut))}if(r&&V){if(!x(ot)||!rt.current)return;V(ot,rt.current)}}():at&&(_(!1,at.toString()),I&&I(at)))}),[nt,ut]);const pt=(0,n.useMemo)((()=>nt&&x(ot)&&dt&&x(ht)&&x(ut)?{_className:i,canvasBackground:o,customTextRenderer:f,devicePixelRatio:g,onGetAnnotationsError:F,onGetAnnotationsSuccess:C,onGetStructTreeError:w,onGetStructTreeSuccess:E,onGetTextError:k,onGetTextSuccess:R,onRenderAnnotationLayerError:L,onRenderAnnotationLayerSuccess:G,onRenderError:N,onRenderSuccess:B,onRenderTextLayerError:j,onRenderTextLayerSuccess:W,page:nt,pageIndex:ot,pageNumber:dt,renderForms:X,renderTextLayer:K,rotate:ht,scale:ut}:null),[i,o,f,g,F,C,w,E,k,R,L,G,N,B,j,W,nt,ot,dt,X,K,ht,ut]),ft=(0,n.useMemo)((()=>d(et,(()=>nt?ut?M(nt,ut):void 0:nt))),[et,nt,ut]),gt="".concat(ot,"@").concat(ut,"/").concat(ht),mt="".concat(ot,"/").concat(ht);function _t(){return a().createElement(ct.Provider,{value:pt},function(){switch(Y){case"none":return null;case"svg":return a().createElement(Pt,{key:"".concat(mt,"_svg")});default:return a().createElement(At,{key:"".concat(gt,"_canvas"),canvasRef:l})}}(),K?a().createElement(St,{key:"".concat(gt,"_text")}):null,z?a().createElement(Ft,{key:"".concat(gt,"_annotations")}):null,c)}return a().createElement("div",Object.assign({className:p(i,u),"data-page-number":dt,ref:lt(A,rt),style:{"--scale-factor":"".concat(ut),backgroundColor:o||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},ft),dt?null===H||void 0===nt||null===nt?a().createElement(b,{type:"loading"},"function"===typeof P?P():P):!1===H||!1===nt?a().createElement(b,{type:"error"},"function"===typeof v?v():v):_t():a().createElement(b,{type:"no-data"},"function"===typeof S?S():S))}const Et=o().oneOfType([o().func,o().node]);wt.propTypes=Object.assign(Object.assign({},O),{canvasBackground:o().string,canvasRef:W,children:o().node,className:N,customTextRenderer:o().func,devicePixelRatio:o().number,error:Et,height:o().number,imageResourcesPath:o().string,inputRef:W,loading:Et,noData:Et,onGetTextError:o().func,onGetTextSuccess:o().func,onLoadError:o().func,onLoadSuccess:o().func,onRenderError:o().func,onRenderSuccess:o().func,onRenderTextLayerError:o().func,onRenderTextLayerSuccess:o().func,pageIndex:function(t,e,s){const{[e]:i,pageNumber:n,pdf:a}=t;if(!F(a))return null;if(F(i)){if("number"!==typeof i)return new Error("`".concat(e,"` of type `").concat(typeof i,"` supplied to `").concat(s,"`, expected `number`."));if(i<0)return new Error("Expected `".concat(e,"` to be greater or equal to 0."));const{numPages:t}=a;if(i+1>t)return new Error("Expected `".concat(e,"` to be less or equal to ").concat(t-1,"."))}else if(!F(n))return new Error("`".concat(e,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(s,"`."));return null},pageNumber:function(t,e,s){const{[e]:i,pageIndex:n,pdf:a}=t;if(!F(a))return null;if(F(i)){if("number"!==typeof i)return new Error("`".concat(e,"` of type `").concat(typeof i,"` supplied to `").concat(s,"`, expected `number`."));if(i<1)return new Error("Expected `".concat(e,"` to be greater or equal to 1."));const{numPages:t}=a;if(i>t)return new Error("Expected `".concat(e,"` to be less or equal to ").concat(t,"."))}else if(!F(n))return new Error("`".concat(e,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(s,"`."));return null},pdf:j,renderAnnotationLayer:o().bool,renderForms:o().bool,renderMode:U,renderTextLayer:o().bool,rotate:q,scale:o().number,width:o().number});var kt=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s};function Tt(t){const e=tt();m(e,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const s=Object.assign(Object.assign({},e),t),{className:i,linkService:n,onItemClick:r,pageIndex:o,pageNumber:l}=s,c=x(l)?l-1:null!==o&&void 0!==o?o:null,d=null!==l&&void 0!==l?l:x(o)?o+1:null;const{className:h,onItemClick:u}=t,f=kt(t,["className","onItemClick"]);return a().createElement("a",{className:p("react-pdf__Thumbnail",i),href:d?"#":void 0,onClick:function(t){t.preventDefault(),x(c)&&d&&(r?r({pageIndex:c,pageNumber:d}):n.goToPage(d))}},a().createElement(wt,Object.assign({},f,{_className:"react-pdf__Thumbnail__page",_enableRegisterUnregisterPage:!1,renderAnnotationLayer:!1,renderTextLayer:!1})))}_(!S,"Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ".concat(E)),i.GlobalWorkerOptions.workerSrc="pdf.worker.js"},81756:t=>{t.exports=function(t,e,s){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:s;throw new TypeError("Private element is not present on this object")},t.exports.__esModule=!0,t.exports.default=t.exports},97101:t=>{t.exports=function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")},t.exports.__esModule=!0,t.exports.default=t.exports},16668:(t,e,s)=>{var i=s(81756);t.exports=function(t,e){return t.get(i(t,e))},t.exports.__esModule=!0,t.exports.default=t.exports},42459:(t,e,s)=>{var i=s(97101);t.exports=function(t,e,s){i(t,e),e.set(t,s)},t.exports.__esModule=!0,t.exports.default=t.exports},37088:(t,e,s)=>{var i=s(81756);t.exports=function(t,e,s){return t.set(i(t,e),s),s},t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,e,s)=>{var i=s(81756);t.exports=function(t,e,s){return s(i(t,e))},t.exports.__esModule=!0,t.exports.default=t.exports},93312:(t,e,s)=>{var i=s(97101);t.exports=function(t,e){i(t,e),e.add(t)},t.exports.__esModule=!0,t.exports.default=t.exports},43693:(t,e,s)=>{var i=s(77736);t.exports=function(t,e,s){return(e=i(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t},t.exports.__esModule=!0,t.exports.default=t.exports},89045:(t,e,s)=>{var i=s(73738).default;t.exports=function(t,e){if("object"!=i(t)||!t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var n=s.call(t,e||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},77736:(t,e,s)=>{var i=s(73738).default,n=s(89045);t.exports=function(t){var e=n(t,"string");return"symbol"==i(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},73738:t=>{function e(s){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(s)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}}]);
|
|
2
|
+
//# sourceMappingURL=4168.cb27218c.chunk.js.map
|