@kne-components/components-core 0.4.39 → 0.4.40
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 +101 -105
- package/build/index.html +1 -1
- package/build/remoteEntry.js +1 -1
- package/build/remoteEntry.js.map +1 -1
- package/build/static/css/1742.fef10b56.chunk.css +2 -0
- package/build/static/css/{1742.0d695953.chunk.css.map → 1742.fef10b56.chunk.css.map} +1 -1
- package/build/static/css/{1996.ca84a80c.chunk.css → 1996.7bc5bcf7.chunk.css} +2 -2
- package/build/static/css/{1996.ca84a80c.chunk.css.map → 1996.7bc5bcf7.chunk.css.map} +1 -1
- package/build/static/css/2004.bd9a4a93.chunk.css +2 -0
- package/build/static/css/{2004.f30987e0.chunk.css.map → 2004.bd9a4a93.chunk.css.map} +1 -1
- package/build/static/css/2307.617a5d99.chunk.css +2 -0
- package/build/static/css/{2307.a8273c29.chunk.css.map → 2307.617a5d99.chunk.css.map} +1 -1
- package/build/static/css/254.d80175e8.chunk.css +2 -0
- package/build/static/css/{254.7802310a.chunk.css.map → 254.d80175e8.chunk.css.map} +1 -1
- package/build/static/css/3404.9c125d00.chunk.css +2 -0
- package/build/static/css/{3404.5755777d.chunk.css.map → 3404.9c125d00.chunk.css.map} +1 -1
- package/build/static/css/{3771.eb333843.chunk.css → 3771.1d19be0e.chunk.css} +2 -2
- package/build/static/css/{3771.eb333843.chunk.css.map → 3771.1d19be0e.chunk.css.map} +1 -1
- package/build/static/css/{3790.f92d7658.chunk.css → 3790.395a0e69.chunk.css} +2 -2
- package/build/static/css/{3790.f92d7658.chunk.css.map → 3790.395a0e69.chunk.css.map} +1 -1
- package/build/static/css/4834.798c673f.chunk.css +2 -0
- package/build/static/css/{4834.ab40675f.chunk.css.map → 4834.798c673f.chunk.css.map} +1 -1
- package/build/static/css/5195.63ecacac.chunk.css +2 -0
- package/build/static/css/{5195.29fb391a.chunk.css.map → 5195.63ecacac.chunk.css.map} +1 -1
- package/build/static/css/{6763.b0b78a75.chunk.css → 6763.2ebdb6d0.chunk.css} +2 -2
- package/build/static/css/{6763.b0b78a75.chunk.css.map → 6763.2ebdb6d0.chunk.css.map} +1 -1
- package/build/static/css/6956.9db8843a.chunk.css +2 -0
- package/build/static/css/{6956.d28bfd77.chunk.css.map → 6956.9db8843a.chunk.css.map} +1 -1
- package/build/static/css/7227.b6d935c3.chunk.css +2 -0
- package/build/static/css/{7227.dd7c675a.chunk.css.map → 7227.b6d935c3.chunk.css.map} +1 -1
- package/build/static/css/7371.ced39ce7.chunk.css +2 -0
- package/build/static/css/{7371.2abb5289.chunk.css.map → 7371.ced39ce7.chunk.css.map} +1 -1
- package/build/static/css/7548.1f050084.chunk.css +12 -0
- package/build/static/css/{7548.290a057e.chunk.css.map → 7548.1f050084.chunk.css.map} +1 -1
- package/build/static/css/7569.d0338e03.chunk.css +2 -0
- package/build/static/css/7569.d0338e03.chunk.css.map +1 -0
- package/build/static/css/{760.0662f4a4.chunk.css → 760.54cd6d81.chunk.css} +2 -2
- package/build/static/css/{760.0662f4a4.chunk.css.map → 760.54cd6d81.chunk.css.map} +1 -1
- package/build/static/css/833.4b4414cb.chunk.css +2 -0
- package/build/static/css/{833.d533fba3.chunk.css.map → 833.4b4414cb.chunk.css.map} +1 -1
- package/build/static/css/{8593.715903c7.chunk.css → 8593.3cf54be7.chunk.css} +2 -2
- package/build/static/css/{8593.715903c7.chunk.css.map → 8593.3cf54be7.chunk.css.map} +1 -1
- package/build/static/css/9556.b702777c.chunk.css +2 -0
- package/build/static/css/{9556.27ba8731.chunk.css.map → 9556.b702777c.chunk.css.map} +1 -1
- package/build/static/js/1125.d307a210.chunk.js +2 -0
- package/build/static/js/1125.d307a210.chunk.js.map +1 -0
- package/build/static/js/1742.a420998d.chunk.js +2 -0
- package/build/static/js/{1742.b4f4b704.chunk.js.map → 1742.a420998d.chunk.js.map} +1 -1
- package/build/static/js/{196.8370bf58.chunk.js → 196.6fac5cd3.chunk.js} +1 -1
- package/build/static/js/{1996.b3b3091e.chunk.js → 1996.3c2883f9.chunk.js} +2 -2
- package/build/static/js/{1996.b3b3091e.chunk.js.map → 1996.3c2883f9.chunk.js.map} +1 -1
- package/build/static/js/{2004.415ec569.chunk.js → 2004.597e684c.chunk.js} +3 -3
- package/build/static/js/{2004.415ec569.chunk.js.map → 2004.597e684c.chunk.js.map} +1 -1
- package/build/static/js/2086.49b16ee8.chunk.js +3 -0
- package/build/static/js/2086.49b16ee8.chunk.js.map +1 -0
- package/build/static/js/{2242.7df7a936.chunk.js → 2242.5dc84c52.chunk.js} +2 -2
- package/build/static/js/{2242.7df7a936.chunk.js.map → 2242.5dc84c52.chunk.js.map} +1 -1
- package/build/static/js/254.730cbef5.chunk.js +2 -0
- package/build/static/js/{254.74a183e3.chunk.js.map → 254.730cbef5.chunk.js.map} +1 -1
- package/build/static/js/2635.5e09af98.chunk.js +3 -0
- package/build/static/js/2635.5e09af98.chunk.js.map +1 -0
- package/build/static/js/2931.2ad9df38.chunk.js.map +1 -1
- package/build/static/js/{3404.7563c64f.chunk.js → 3404.d72d469f.chunk.js} +3 -3
- package/build/static/js/{3404.7563c64f.chunk.js.map → 3404.d72d469f.chunk.js.map} +1 -1
- package/build/static/js/3771.7b17e936.chunk.js +2 -0
- package/build/static/js/{3771.6e798324.chunk.js.map → 3771.7b17e936.chunk.js.map} +1 -1
- package/build/static/js/{3790.3f96b374.chunk.js → 3790.5e45cab0.chunk.js} +2 -2
- package/build/static/js/{3790.3f96b374.chunk.js.map → 3790.5e45cab0.chunk.js.map} +1 -1
- package/build/static/js/3856.7c253a55.chunk.js +2 -0
- package/build/static/js/{3856.b2c0f91a.chunk.js.map → 3856.7c253a55.chunk.js.map} +1 -1
- package/build/static/js/4474.54b6dbc5.chunk.js +2 -0
- package/build/static/js/{4474.afbb9500.chunk.js.map → 4474.54b6dbc5.chunk.js.map} +1 -1
- package/build/static/js/{4834.aa9f99eb.chunk.js → 4834.4e0afb79.chunk.js} +2 -2
- package/build/static/js/{4834.aa9f99eb.chunk.js.map → 4834.4e0afb79.chunk.js.map} +1 -1
- package/build/static/js/5195.a76d89e7.chunk.js +2 -0
- package/build/static/js/{5195.98fd8eb2.chunk.js.map → 5195.a76d89e7.chunk.js.map} +1 -1
- package/build/static/js/6453.92eff892.chunk.js +2 -0
- package/build/static/js/6453.92eff892.chunk.js.map +1 -0
- package/build/static/js/6763.02a19c95.chunk.js +2 -0
- package/build/static/js/{6763.4903b74a.chunk.js.map → 6763.02a19c95.chunk.js.map} +1 -1
- package/build/static/js/{6956.75686d06.chunk.js → 6956.b30f0baf.chunk.js} +2 -2
- package/build/static/js/{6956.75686d06.chunk.js.map → 6956.b30f0baf.chunk.js.map} +1 -1
- package/build/static/js/{7227.0a0dc1ac.chunk.js → 7227.2eea005d.chunk.js} +3 -3
- package/build/static/js/{7227.0a0dc1ac.chunk.js.map → 7227.2eea005d.chunk.js.map} +1 -1
- package/build/static/js/{7371.33b6b89a.chunk.js → 7371.25528aac.chunk.js} +2 -2
- package/build/static/js/{7371.33b6b89a.chunk.js.map → 7371.25528aac.chunk.js.map} +1 -1
- package/build/static/js/{7548.5dad90a3.chunk.js → 7548.572562c0.chunk.js} +2 -2
- package/build/static/js/{7548.5dad90a3.chunk.js.map → 7548.572562c0.chunk.js.map} +1 -1
- package/build/static/js/{2054.0c582959.chunk.js → 7569.5d4cf447.chunk.js} +2 -2
- package/build/static/js/{2054.0c582959.chunk.js.map → 7569.5d4cf447.chunk.js.map} +1 -1
- package/build/static/js/{7591.83d402a4.chunk.js → 7591.72cd06f6.chunk.js} +2 -2
- package/build/static/js/7591.72cd06f6.chunk.js.map +1 -0
- package/build/static/js/{760.09016d75.chunk.js → 760.2e4b9746.chunk.js} +2 -2
- package/build/static/js/{760.09016d75.chunk.js.map → 760.2e4b9746.chunk.js.map} +1 -1
- package/build/static/js/{833.5161bd8a.chunk.js → 833.2a8d0e1d.chunk.js} +2 -2
- package/build/static/js/{833.5161bd8a.chunk.js.map → 833.2a8d0e1d.chunk.js.map} +1 -1
- package/build/static/js/8593.a7729eeb.chunk.js +2 -0
- package/build/static/js/{8593.cf0415d0.chunk.js.map → 8593.a7729eeb.chunk.js.map} +1 -1
- package/build/static/js/8706.b5cfdf89.chunk.js +2 -0
- package/build/static/js/8706.b5cfdf89.chunk.js.map +1 -0
- package/build/static/js/{9556.26768f27.chunk.js → 9556.f591f290.chunk.js} +3 -3
- package/build/static/js/{9556.26768f27.chunk.js.map → 9556.f591f290.chunk.js.map} +1 -1
- package/build/static/js/main.3ebd96a6.js +2 -0
- package/build/static/js/main.3ebd96a6.js.map +1 -0
- package/package.json +2 -2
- package/build/static/css/1742.0d695953.chunk.css +0 -2
- package/build/static/css/2004.f30987e0.chunk.css +0 -2
- package/build/static/css/2054.730ac615.chunk.css +0 -2
- package/build/static/css/2054.730ac615.chunk.css.map +0 -1
- package/build/static/css/2307.a8273c29.chunk.css +0 -2
- package/build/static/css/254.7802310a.chunk.css +0 -2
- package/build/static/css/3404.5755777d.chunk.css +0 -2
- package/build/static/css/4834.ab40675f.chunk.css +0 -2
- package/build/static/css/5195.29fb391a.chunk.css +0 -2
- package/build/static/css/6956.d28bfd77.chunk.css +0 -2
- package/build/static/css/7227.dd7c675a.chunk.css +0 -2
- package/build/static/css/7371.2abb5289.chunk.css +0 -2
- package/build/static/css/7548.290a057e.chunk.css +0 -12
- package/build/static/css/833.d533fba3.chunk.css +0 -2
- package/build/static/css/9556.27ba8731.chunk.css +0 -2
- package/build/static/js/1125.991180cf.chunk.js +0 -2
- package/build/static/js/1125.991180cf.chunk.js.map +0 -1
- package/build/static/js/1742.b4f4b704.chunk.js +0 -2
- package/build/static/js/1815.badeac0c.chunk.js +0 -1
- package/build/static/js/182.435f5645.chunk.js +0 -2
- package/build/static/js/182.435f5645.chunk.js.map +0 -1
- package/build/static/js/2086.3ca70084.chunk.js +0 -3
- package/build/static/js/2086.3ca70084.chunk.js.map +0 -1
- package/build/static/js/254.74a183e3.chunk.js +0 -2
- package/build/static/js/3237.777b99ba.chunk.js +0 -1
- package/build/static/js/3771.6e798324.chunk.js +0 -2
- package/build/static/js/3856.b2c0f91a.chunk.js +0 -2
- package/build/static/js/4474.afbb9500.chunk.js +0 -2
- package/build/static/js/5195.98fd8eb2.chunk.js +0 -2
- package/build/static/js/6671.e04efa14.chunk.js +0 -1
- package/build/static/js/6763.4903b74a.chunk.js +0 -2
- package/build/static/js/7492.b5d8b8c4.chunk.js +0 -1
- package/build/static/js/7591.83d402a4.chunk.js.map +0 -1
- package/build/static/js/8593.cf0415d0.chunk.js +0 -2
- package/build/static/js/8706.aa4dfbf5.chunk.js +0 -2
- package/build/static/js/8706.aa4dfbf5.chunk.js.map +0 -1
- package/build/static/js/8970.4a7ef88e.chunk.js +0 -3
- package/build/static/js/8970.4a7ef88e.chunk.js.map +0 -1
- package/build/static/js/main.eb7a565d.js +0 -2
- package/build/static/js/main.eb7a565d.js.map +0 -1
- /package/build/static/js/{2004.415ec569.chunk.js.LICENSE.txt → 2004.597e684c.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{2086.3ca70084.chunk.js.LICENSE.txt → 2086.49b16ee8.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{3404.7563c64f.chunk.js.LICENSE.txt → 2635.5e09af98.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{7227.0a0dc1ac.chunk.js.LICENSE.txt → 3404.d72d469f.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{8970.4a7ef88e.chunk.js.LICENSE.txt → 7227.2eea005d.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{9556.26768f27.chunk.js.LICENSE.txt → 9556.f591f290.chunk.js.LICENSE.txt} +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 8970.4a7ef88e.chunk.js.LICENSE.txt */
|
|
2
|
-
(self.webpackChunk_kne_components_components_core=self.webpackChunk_kne_components_components_core||[]).push([[814,2273,6125,8970,9379],{1488:(t,e,i)=>{var n=i(50149),s=i(97132),r=i(88140),a=i(35324),o=i(96614),l=i(96761),c=i(15857),h=i(68592),d=c(function(t,e){var i={};if(null==t)return i;var c=!1;e=n(e,function(e){return e=a(e,t),c||(c=e.length>1),e}),o(t,h(t),i),c&&(i=s(i,7,l));for(var d=e.length;d--;)r(i,e[d]);return i});t.exports=d},3343:t=>{t.exports=function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}},3523:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"}},3892:t=>{t.exports=function(t){return this.__data__.has(t)}},4262:(t,e,i)=>{var n=i(48895),s=i(54052);t.exports=function(t,e,i){var r=e(t);return s(t)?r:n(r,i(t))}},4757:(t,e,i)=>{var n=i(56552);t.exports=function(){return n.Date.now()}},5538:(t,e,i)=>{var n=i(97160),s=i(84545),r=i(10793),a=i(27760),o=i(3892),l=i(76788);function c(t){var e=this.__data__=new n(t);this.size=e.size}c.prototype.clear=s,c.prototype.delete=r,c.prototype.get=a,c.prototype.has=o,c.prototype.set=l,t.exports=c},5654:(t,e,i)=>{var n=i(87937),s=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();t.exports=s},5791:(t,e,i)=>{var n=i(26924),s=i(22761);t.exports=function(t){return s(t)&&"[object Map]"==n(t)}},6571:(t,e,i)=>{var n=i(11629),s=i(56173);t.exports=function(t){return null!=t&&s(t.length)&&!n(t)}},6806:(t,e,i)=>{var n=i(61516);t.exports=function(t,e){var i=e?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}},8195:(t,e,i)=>{"use strict";function n(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}i.d(e,{A:()=>n})},9056:()=>{},9812:(t,e,i)=>{var n=i(56552).Symbol;t.exports=n},10143:t=>{var e=/\s/;t.exports=function(t){for(var i=t.length;i--&&e.test(t.charAt(i)););return i}},10793:t=>{t.exports=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}},11295:(t,e,i)=>{var n=i(9812),s=n?n.prototype:void 0,r=s?s.valueOf:void 0;t.exports=function(t){return r?Object(r.call(t)):{}}},11629:(t,e,i)=>{var n=i(16913),s=i(46686);t.exports=function(t){if(!s(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},12322:(t,e,i)=>{var n=i(16913),s=i(85990),r=i(22761),a=Function.prototype,o=Object.prototype,l=a.toString,c=o.hasOwnProperty,h=l.call(Object);t.exports=function(t){if(!r(t)||"[object Object]"!=n(t))return!1;var e=s(t);if(null===e)return!0;var i=c.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&l.call(i)==h}},12622:(t,e,i)=>{var n=i(70705);t.exports=function(t,e){var i=t.__data__;return n(e)?i["string"==typeof e?"string":"hash"]:i.map}},13028:t=>{t.exports=function(t,e){return function(i){return t(e(i))}}},13440:(t,e,i)=>{var n=i(56552)["__core-js_shared__"];t.exports=n},14079:(t,e,i)=>{var n=i(88259),s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=n(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(s,function(t,i,n,s){e.push(n?s.replace(r,"$1"):i||t)}),e});t.exports=a},14657:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},15193:(t,e,i)=>{var n=i(16913),s=i(22761);t.exports=function(t){return s(t)&&"[object Arguments]"==n(t)}},15797:(t,e,i)=>{var n=i(64816);function s(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var n=arguments,s=e?e.apply(this,n):n[0],r=i.cache;if(r.has(s))return r.get(s);var a=t.apply(this,n);return i.cache=r.set(s,a)||r,a};return i.cache=new(s.Cache||n),i}s.Cache=n,t.exports=s},15857:(t,e,i)=>{var n=i(20819),s=i(55636),r=i(46350);t.exports=function(t){return r(s(t,void 0,n),t+"")}},16095:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},16913:(t,e,i)=>{var n=i(9812),s=i(34552),r=i(16095),a=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?s(t):r(t)}},17529:t=>{t.exports=function(t,e){for(var i=-1,n=null==t?0:t.length,s=0,r=[];++i<n;){var a=t[i];e(a,i,t)&&(r[s++]=a)}return r}},18630:(t,e,i)=>{var n=i(61516),s=i(6806),r=i(18962),a=i(11295),o=i(38710);t.exports=function(t,e,i){var l=t.constructor;switch(e){case"[object ArrayBuffer]":return n(t);case"[object Boolean]":case"[object Date]":return new l(+t);case"[object DataView]":return s(t,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(t,i);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(t);case"[object RegExp]":return r(t);case"[object Symbol]":return a(t)}}},18962:t=>{var e=/\w*$/;t.exports=function(t){var i=new t.constructor(t.source,e.exec(t));return i.lastIndex=t.lastIndex,i}},19841:(t,e,i)=>{var n=i(16913),s=i(22761);t.exports=function(t){return"symbol"==typeof t||s(t)&&"[object Symbol]"==n(t)}},20310:(t,e,i)=>{var n=i(21817),s=i(85990),r=i(36140);t.exports=function(t){return"function"!=typeof t.constructor||r(t)?{}:n(s(t))}},20449:(t,e,i)=>{var n=i(26924),s=i(22761);t.exports=function(t){return s(t)&&"[object Set]"==n(t)}},20816:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(82284);function s(t){var e=function(t,e){if("object"!=(0,n.A)(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!=(0,n.A)(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==(0,n.A)(e)?e:e+""}},20819:(t,e,i)=>{var n=i(80755);t.exports=function(t){return(null==t?0:t.length)?n(t,1):[]}},21676:(t,e,i)=>{var n=i(52969),s=i(53871);t.exports=function(t,e){return e.length<2?t:n(t,s(e,0,-1))}},21817:(t,e,i)=>{var n=i(46686),s=Object.create,r=function(){function t(){}return function(e){if(!n(e))return{};if(s)return s(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}();t.exports=r},22541:t=>{t.exports=function(t){return function(){return t}}},22662:(t,e,i)=>{var n=i(95575);t.exports=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},22761:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},22777:(t,e,i)=>{var n=i(15193),s=i(22761),r=Object.prototype,a=r.hasOwnProperty,o=r.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(t){return s(t)&&a.call(t,"callee")&&!o.call(t,"callee")};t.exports=l},22929:(t,e,i)=>{var n=i(56552).Uint8Array;t.exports=n},23253:(t,e,i)=>{var n=i(5538),s=i(63868),r=i(94258),a=i(83223),o=i(46686),l=i(30474),c=i(53737);t.exports=function t(e,i,h,d,u){e!==i&&r(i,function(r,l){if(u||(u=new n),o(r))a(e,i,l,h,t,d,u);else{var p=d?d(c(e,l),r,l+"",e,i,u):void 0;void 0===p&&(p=r),s(e,l,p)}},l)}},24190:(t,e,i)=>{var n=i(61340);t.exports=function(t){var e=this.__data__,i=n(e,t);return i<0?void 0:e[i][1]}},24558:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(26562);function s(t,e,i){return t.set((0,n.A)(t,e),i),i}},25051:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},26562:(t,e,i)=>{"use strict";function n(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}i.d(e,{A:()=>n})},26600:(t,e,i)=>{var n=i(87937)(i(56552),"WeakMap");t.exports=n},26924:(t,e,i)=>{var n=i(97685),s=i(85204),r=i(65387),a=i(72070),o=i(26600),l=i(16913),c=i(96996),h="[object Map]",d="[object Promise]",u="[object Set]",p="[object WeakMap]",f="[object DataView]",g=c(n),A=c(s),m=c(r),v=c(a),b=c(o),w=l;(n&&w(new n(new ArrayBuffer(1)))!=f||s&&w(new s)!=h||r&&w(r.resolve())!=d||a&&w(new a)!=u||o&&w(new o)!=p)&&(w=function(t){var e=l(t),i="[object Object]"==e?t.constructor:void 0,n=i?c(i):"";if(n)switch(n){case g:return f;case A:return h;case m:return d;case v:return u;case b:return p}return e}),t.exports=w},27615:(t,e,i)=>{var n=i(95575);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},27760:t=>{t.exports=function(t){return this.__data__.get(t)}},28325:(t,e,i)=>{var n=i(22541),s=i(5654),r=i(33279),a=s?function(t,e){return s(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:r;t.exports=a},28673:(t,e,i)=>{var n=i(73204),s=i(83713),r=i(6571);t.exports=function(t){return r(t)?n(t):s(t)}},29075:(t,e,i)=>{var n=i(96614),s=i(56326);t.exports=function(t,e){return n(t,s(t),e)}},29935:(t,e,i)=>{var n=i(61340),s=Array.prototype.splice;t.exports=function(t){var e=this.__data__,i=n(e,t);return!(i<0)&&(i==e.length-1?e.pop():s.call(e,i,1),--this.size,!0)}},30474:(t,e,i)=>{var n=i(73204),s=i(58122),r=i(6571);t.exports=function(t){return r(t)?n(t,!0):s(t)}},31170:t=>{t.exports=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}},33279:t=>{t.exports=function(t){return t}},34552:(t,e,i)=>{var n=i(9812),s=Object.prototype,r=s.hasOwnProperty,a=s.toString,o=n?n.toStringTag:void 0;t.exports=function(t){var e=r.call(t,o),i=t[o];try{t[o]=void 0;var n=!0}catch(l){}var s=a.call(t);return n&&(e?t[o]=i:delete t[o]),s}},34677:(t,e,i)=>{var n=i(23253),s=i(84570)(function(t,e,i){n(t,e,i)});t.exports=s},35324:(t,e,i)=>{var n=i(54052),s=i(62597),r=i(14079),a=i(41069);t.exports=function(t,e){return n(t)?t:s(t,e)?[t]:r(a(t))}},35428:(t,e,i)=>{var n=i(16913),s=i(56173),r=i(22761),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return r(t)&&s(t.length)&&!!a[n(t)]}},36140:t=>{var e=Object.prototype;t.exports=function(t){var i=t&&t.constructor;return t===("function"==typeof i&&i.prototype||e)}},36954:(t,e,i)=>{var n=i(11629),s=i(37857),r=i(46686),a=i(96996),o=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,h=l.toString,d=c.hasOwnProperty,u=RegExp("^"+h.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!r(t)||s(t))&&(n(t)?u:o).test(a(t))}},37105:(t,e,i)=>{var n="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;t.exports=n},37159:(t,e,i)=>{var n=i(12622);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},37857:(t,e,i)=>{var n=i(13440),s=function(){var t=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=function(t){return!!s&&s in t}},38268:t=>{var e=Object.prototype.hasOwnProperty;t.exports=function(t){var i=t.length,n=new t.constructor(i);return i&&"string"==typeof t[0]&&e.call(t,"index")&&(n.index=t.index,n.input=t.input),n}},38458:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(26562);function s(t,e){return t.get((0,n.A)(t,e))}},38541:(t,e,i)=>{var n=i(9812),s=i(50149),r=i(54052),a=i(19841),o=n?n.prototype:void 0,l=o?o.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(r(e))return s(e,t)+"";if(a(e))return l?l.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i}},38710:(t,e,i)=>{var n=i(61516);t.exports=function(t,e){var i=e?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}},39790:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(8195);function s(t,e){(0,n.A)(t,e),e.add(t)}},40801:(t,e,i)=>{var n=i(61141),s=i(46686),r=i(19841),a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(s(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=s(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var i=o.test(t);return i||l.test(t)?c(t.slice(2),i?2:8):a.test(t)?NaN:+t}},41069:(t,e,i)=>{var n=i(38541);t.exports=function(t){return null==t?"":n(t)}},43516:t=>{t.exports=function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}},44353:(t,e,i)=>{t=i.nmd(t);var n=i(56552),s=e&&!e.nodeType&&e,r=s&&t&&!t.nodeType&&t,a=r&&r.exports===s?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var i=t.length,n=o?o(i):new t.constructor(i);return t.copy(n),n}},44543:(t,e,i)=>{t=i.nmd(t);var n=i(56552),s=i(60014),r=e&&!e.nodeType&&e,a=r&&t&&!t.nodeType&&t,o=a&&a.exports===r?n.Buffer:void 0,l=(o?o.isBuffer:void 0)||s;t.exports=l},45921:(t,e,i)=>{var n=i(20449),s=i(47574),r=i(56832),a=r&&r.isSet,o=a?s(a):n;t.exports=o},46350:(t,e,i)=>{var n=i(28325),s=i(86578)(n);t.exports=s},46686:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},47251:(t,e,i)=>{var n=i(98724),s=i(97160),r=i(85204);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(r||s),string:new n}}},47574:t=>{t.exports=function(t){return function(e){return t(e)}}},48734:(t,e,i)=>{var n=i(95575),s=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:s.call(e,t)}},48895:t=>{t.exports=function(t,e){for(var i=-1,n=e.length,s=t.length;++i<n;)t[s+i]=e[i];return t}},49242:(t,e,i)=>{"use strict";i.r(e),i.d(e,{AudioPreview:()=>Ym,Download:()=>Cm,FileButton:()=>fv,FileInput:()=>qv,FileList:()=>Nv,FileListOptionButtons:()=>Rv,FileModal:()=>uv,FilePreview:()=>nv,FileUpload:()=>Yv,HtmlPreview:()=>Nm,Image:()=>Tv,ImagePreview:()=>qm,OSSFilePreview:()=>ev,OfficePreview:()=>Hm,PdfPreview:()=>zm,PrintButton:()=>rv,TextPreview:()=>Um,UnknownPreview:()=>Vm,VideoPreview:()=>Qm,computedAccept:()=>Kv,default:()=>Am,defaultAccept:()=>Uv,download:()=>mm,downloadBlobFile:()=>vm,useDownload:()=>xm,useFileModal:()=>dv,useFileModalProps:()=>hv,useFileUpload:()=>Wv,withOSSFile:()=>fm});var n={};i.r(n),i.d(n,{dU:()=>yg,ng:()=>_g,EA:()=>xg,Tm:()=>Eg,D6:()=>kg,YE:()=>Cg});var s=i(73884),r=i.n(s),a=i(83694),o=i(87558),l=i.n(o),c=i(34677),h=i.n(c),d=i(55199),u=i(58168),p=i(56760),f=i(78478);const g=s.forwardRef(function(t,e){return s.createElement(f.A,(0,u.A)({},t,{ref:e,icon:p.A}))});const A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M820 436h-40c-4.4 0-8 3.6-8 8v40c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-40c0-4.4-3.6-8-8-8zm32-104H732V120c0-4.4-3.6-8-8-8H300c-4.4 0-8 3.6-8 8v212H172c-44.2 0-80 35.8-80 80v328c0 17.7 14.3 32 32 32h168v132c0 4.4 3.6 8 8 8h424c4.4 0 8-3.6 8-8V772h168c17.7 0 32-14.3 32-32V412c0-44.2-35.8-80-80-80zM360 180h304v152H360V180zm304 664H360V568h304v276zm200-140H732V500H292v204H160V412c0-6.6 5.4-12 12-12h680c6.6 0 12 5.4 12 12v292z"}}]},name:"printer",theme:"outlined"};const m=s.forwardRef(function(t,e){return s.createElement(f.A,(0,u.A)({},t,{ref:e,icon:A}))});const v={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};const b=s.forwardRef(function(t,e){return s.createElement(f.A,(0,u.A)({},t,{ref:e,icon:v}))});var w=i(82211);const y=s.forwardRef(function(t,e){return s.createElement(f.A,(0,u.A)({},t,{ref:e,icon:w.A}))});var _=i(71360);const x=s.forwardRef(function(t,e){return s.createElement(f.A,(0,u.A)({},t,{ref:e,icon:_.A}))});var E=i(3523);const k=s.forwardRef(function(t,e){return s.createElement(f.A,(0,u.A)({},t,{ref:e,icon:E.A}))});const C={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"};const S=s.forwardRef(function(t,e){return s.createElement(f.A,(0,u.A)({},t,{ref:e,icon:C}))});var M,L=i(96418),T=i.n(L),R=i(1488),P=i.n(R),F=i(52526),I=0,D=!1,O=!1,N="[iFrameSizer]",W=null,j=window.requestAnimationFrame,B=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),H={},z=null,U=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){Q("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function V(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function G(t,e,i){t.addEventListener(e,i,!1)}function q(t,e,i){t.removeEventListener(e,i,!1)}function X(t){return N+"["+function(t){var e="Host page: "+t;return window.top!==window.self&&(e=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+t:"Nested host page: "+t),e}(t)+"]"}function Y(t){return H[t]?H[t].log:D}function K(t,e){Z("log",t,e,Y(t))}function Q(t,e){Z("warn",t,e,!0)}function Z(t,e,i,n){!0===n&&"object"===typeof window.console&&console[t](X(e),i)}function J(t){function e(){s("Height"),s("Width"),ot(function(){at(p),nt(f),d("onResized",p)},p,"init")}function i(t){return"border-box"!==t.boxSizing?0:(t.paddingTop?parseInt(t.paddingTop,10):0)+(t.paddingBottom?parseInt(t.paddingBottom,10):0)}function n(t){return"border-box"!==t.boxSizing?0:(t.borderTopWidth?parseInt(t.borderTopWidth,10):0)+(t.borderBottomWidth?parseInt(t.borderBottomWidth,10):0)}function s(t){var e=Number(H[f]["max"+t]),i=Number(H[f]["min"+t]),n=t.toLowerCase(),s=Number(p[n]);K(f,"Checking "+n+" is in range "+i+"-"+e),s<i&&(s=i,K(f,"Set "+n+" to min value")),s>e&&(s=e,K(f,"Set "+n+" to max value")),p[n]=""+s}function r(t){return u.slice(u.indexOf(":")+7+t)}function a(t,e){var i,n,s;i=function(){lt("Send Page Info","pageInfo:"+function(){var t=document.body.getBoundingClientRect(),e=p.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:e.height,iframeWidth:e.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(e.top-t.top,10),offsetLeft:parseInt(e.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}(),t,e)},n=32,ut[s=e]||(ut[s]=setTimeout(function(){ut[s]=null,i()},n))}function o(t){var e=t.getBoundingClientRect();return it(f),{x:Math.floor(Number(e.left)+Number(W.x)),y:Math.floor(Number(e.top)+Number(W.y))}}function l(t){var e=t?o(p.iframe):{x:0,y:0},i={x:Number(p.width)+e.x,y:Number(p.height)+e.y};K(f,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top===window.self?(W=i,c(),K(f,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](i.x,i.y):Q(f,"Unable to scroll to requested position, window.parentIFrame not found")}function c(){!1===d("onScroll",W)?st():nt(f)}function h(t){var e={};if(0===Number(p.width)&&0===Number(p.height)){var i=r(9).split(":");e={x:i[1],y:i[0]}}else e={x:p.width,y:p.height};d(t,{iframe:p.iframe,screenX:Number(e.x),screenY:Number(e.y),type:p.type})}function d(t,e){return $(f,t,e)}var u=t.data,p={},f=null;"[iFrameResizerChild]Ready"===u?function(){for(var t in H)lt("iFrame requested init",ct(t),H[t].iframe,t)}():N===(""+u).slice(0,13)&&u.slice(13).split(":")[0]in H?(p=function(){var t=u.slice(13).split(":"),e=t[1]?parseInt(t[1],10):0,s=H[t[0]]&&H[t[0]].iframe,r=getComputedStyle(s);return{iframe:s,id:t[0],height:e+i(r)+n(r),width:t[2],type:t[3]}}(),f=p.id,H[f]&&(H[f].loaded=!0),!function(){var t=p.type in{true:1,false:1,undefined:1};return t&&K(f,"Ignoring init message from meta parent page"),t}()&&function(t){var e=!0;return H[t]||(e=!1,Q(p.type+" No settings for "+t+". Message was: "+u)),e}(f)&&(K(f,"Received: "+u),function(){var t=!0;return null===p.iframe&&(Q(f,"IFrame ("+p.id+") not found"),t=!1),t}()&&function(){var e=t.origin,i=H[f]&&H[f].checkOrigin;if(i&&""+e!=="null"&&!(i.constructor===Array?function(){var t=0,n=!1;for(K(f,"Checking connection is from allowed list of origins: "+i);t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){var t=H[f]&&H[f].remoteHost;return K(f,"Checking connection is from: "+t),e===t}()))throw new Error("Unexpected message received from: "+e+" for "+p.iframe.id+". Message was: "+t.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(H[f]&&H[f].firstRun&&H[f]&&(H[f].firstRun=!1),p.type){case"close":et(p.iframe);break;case"message":t=r(6),K(f,"onMessage passed: {iframe: "+p.iframe.id+", message: "+t+"}"),d("onMessage",{iframe:p.iframe,message:JSON.parse(t)}),K(f,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":H[f].autoResize=JSON.parse(r(9));break;case"scrollTo":l(!1);break;case"scrollToOffset":l(!0);break;case"pageInfo":a(H[f]&&H[f].iframe,f),function(){function t(t,n){function s(){H[i]?a(H[i].iframe,i):e()}["scroll","resize"].forEach(function(e){K(i,t+e+" listener for sendPageInfo"),n(window,e,s)})}function e(){t("Remove ",q)}var i=f;t("Add ",G),H[i]&&(H[i].stopPageInfo=e)}();break;case"pageInfoStop":H[f]&&H[f].stopPageInfo&&(H[f].stopPageInfo(),delete H[f].stopPageInfo);break;case"inPageLink":!function(t){var e=t.split("#")[1]||"",i=decodeURIComponent(e),n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){var t=o(n);K(f,"Moving to in page link (#"+e+") at x: "+t.x+" y: "+t.y),W={x:t.x,y:t.y},c(),K(f,"--")}():window.top===window.self?K(f,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):K(f,"In page link #"+e+" not found and window.parentIFrame not found")}(r(9));break;case"reset":rt(p);break;case"init":e(),d("onInit",p.iframe);break;default:0===Number(p.width)&&0===Number(p.height)?Q("Unsupported message received ("+p.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):e()}var t}())):function(t,e){Z("info",t,e,Y(t))}(f,"Ignored: "+u)}function $(t,e,i){var n=null,s=null;if(H[t]){if("function"!==typeof(n=H[t][e]))throw new TypeError(e+" on iFrame["+t+"] is not a function");s=n(i)}return s}function tt(t){var e=t.id;delete H[e]}function et(t){var e=t.id;if(!1!==$(e,"onClose",e)){K(e,"Removing iFrame: "+e);try{t.parentNode&&t.parentNode.removeChild(t)}catch(i){Q(i)}$(e,"onClosed",e),K(e,"--"),tt(t),M&&(M.disconnect(),M=null)}else K(e,"Close iframe cancelled by onClose event")}function it(t){null===W&&K(t,"Get page position: "+(W={x:void 0===window.pageXOffset?document.documentElement.scrollLeft:window.pageXOffset,y:void 0===window.pageYOffset?document.documentElement.scrollTop:window.pageYOffset}).x+","+W.y)}function nt(t){null!==W&&(window.scrollTo(W.x,W.y),K(t,"Set page position: "+W.x+","+W.y),st())}function st(){W=null}function rt(t){K(t.id,"Size reset requested by "+("init"===t.type?"host page":"iFrame")),it(t.id),ot(function(){at(t),lt("reset","reset",t.iframe,t.id)},t,"reset")}function at(t){function e(e){O||"0"!==t[e]||(O=!0,K(n,"Hidden iFrame detected, creating visibility listener"),function(){function t(){function t(t){function e(e){return"0px"===(H[t]&&H[t].iframe.style[e])}function i(t){return null!==t.offsetParent}H[t]&&i(H[t].iframe)&&(e("height")||e("width"))&<("Visibility change","resize",H[t].iframe,t)}Object.keys(H).forEach(function(e){t(e)})}function e(e){K("window","Mutation observed: "+e[0].target+" "+e[0].type),dt(t,16)}function i(){var t=document.querySelector("body"),i={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};new n(e).observe(t,i)}var n=V();n&&i()}())}function i(i){!function(e){t.id?(t.iframe.style[e]=t[e]+"px",K(t.id,"IFrame ("+n+") "+e+" set to "+t[e]+"px")):K("undefined","messageData id not set")}(i),e(i)}var n=t.iframe.id;H[n]&&(H[n].sizeHeight&&i("height"),H[n].sizeWidth&&i("width"))}function ot(t,e,i){i!==e.type&&j&&!window.jasmine?(K(e.id,"Requesting animation frame"),j(t)):t()}function lt(t,e,i,n,s){var r=!1;n=n||i.id,H[n]&&(i&&"contentWindow"in i&&null!==i.contentWindow?function(){var s=H[n]&&H[n].targetOrigin;K(n,"["+t+"] Sending msg to iframe["+n+"] ("+e+") targetOrigin: "+s),i.contentWindow.postMessage(N+e,s)}():Q(n,"["+t+"] IFrame("+n+") not found"),s&&H[n]&&H[n].warningTimeout&&(H[n].msgTimeout=setTimeout(function(){!H[n]||H[n].loaded||r||(r=!0,Q(n,"IFrame has not responded within "+H[n].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))},H[n].warningTimeout)))}function ct(t){return t+":"+H[t].bodyMarginV1+":"+H[t].sizeWidth+":"+H[t].log+":"+H[t].interval+":"+H[t].enablePublicMethods+":"+H[t].autoResize+":"+H[t].bodyMargin+":"+H[t].heightCalculationMethod+":"+H[t].bodyBackground+":"+H[t].bodyPadding+":"+H[t].tolerance+":"+H[t].inPageLinks+":"+H[t].resizeFrom+":"+H[t].widthCalculationMethod+":"+H[t].mouseEvents}function ht(t,e){function i(t){var e=t.split("Callback");if(2===e.length){var i="on"+e[0].charAt(0).toUpperCase()+e[0].slice(1);this[i]=this[t],delete this[t],Q(n,"Deprecated: '"+t+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}var n=function(i){if("string"!==typeof i)throw new TypeError("Invaild id for iFrame. Expected String");return""===i&&(t.id=i=function(){var t=e&&e.id||U.id+I++;return null!==document.getElementById(t)&&(t+=I++),t}(),D=(e||{}).log,K(i,"Added missing iframe ID: "+i+" ("+t.src+")")),i}(t.id);n in H&&"iFrameResizer"in t?Q(n,"Ignored iFrame, already setup."):(!function(e){var s;e=e||{},H[n]=Object.create(null),H[n].iframe=t,H[n].firstRun=!0,H[n].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(t){if("object"!==typeof t)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(i,e),function(t){for(var e in U)Object.prototype.hasOwnProperty.call(U,e)&&(H[n][e]=Object.prototype.hasOwnProperty.call(t,e)?t[e]:U[e])}(e),H[n]&&(H[n].targetOrigin=!0===H[n].checkOrigin?""===(s=H[n].remoteHost)||null!==s.match(/^(about:blank|javascript:|file:\/\/)/)?"*":s:"*")}(e),function(){switch(K(n,"IFrame scrolling "+(H[n]&&H[n].scrolling?"enabled":"disabled")+" for "+n),t.style.overflow=!1===(H[n]&&H[n].scrolling)?"hidden":"auto",H[n]&&H[n].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=H[n]?H[n].scrolling:"no"}}(),function(){function e(e){var i=H[n][e];1/0!==i&&0!==i&&(t.style[e]="number"===typeof i?i+"px":i,K(n,"Set "+e+" = "+t.style[e]))}function i(t){if(H[n]["min"+t]>H[n]["max"+t])throw new Error("Value for min"+t+" can not be greater than max"+t)}i("Height"),i("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!==typeof(H[n]&&H[n].bodyMargin)&&"0"!==(H[n]&&H[n].bodyMargin)||(H[n].bodyMarginV1=H[n].bodyMargin,H[n].bodyMargin=H[n].bodyMargin+"px"),function(e){var i=V();i&&(M=function(e){if(!t.parentNode)return null;var i=new e(function(e){e.forEach(function(e){Array.prototype.slice.call(e.removedNodes).forEach(function(e){e===t&&et(t)})})});return i.observe(t.parentNode,{childList:!0}),i}(i)),G(t,"load",function(){lt("iFrame.onload",e,t,void 0,!0),function(){var e=H[n]&&H[n].firstRun,i=H[n]&&H[n].heightCalculationMethod in B;!e&&i&&rt({iframe:t,height:0,width:0,type:"init"})}()}),lt("init",e,t,void 0,!0)}(ct(n)),H[n]&&(H[n].iframe.iFrameResizer={close:et.bind(null,H[n].iframe),removeListeners:tt.bind(null,H[n].iframe),resize:lt.bind(null,"Window resize","resize",H[n].iframe),moveToAnchor:function(t){lt("Move to anchor","moveToAnchor:"+t,H[n].iframe,n)},sendMessage:function(t){lt("Send Message","message:"+(t=JSON.stringify(t)),H[n].iframe,n)}}))}function dt(t,e){null===z&&(z=setTimeout(function(){z=null,t()},e))}var ut={};function pt(){"hidden"!==document.visibilityState&&(K("document","Trigger event: Visibility change"),dt(function(){ft("Tab Visible","resize")},16))}function ft(t,e){Object.keys(H).forEach(function(i){(function(t){return H[t]&&"parent"===H[t].resizeFrom&&H[t].autoResize&&!H[t].firstRun})(i)&<(t,e,H[i].iframe,i)})}function gt(){G(window,"message",J),G(window,"resize",function(){var t;K("window","Trigger event: "+(t="resize")),dt(function(){ft("Window "+t,"resize")},16)}),G(document,"visibilitychange",pt),G(document,"-webkit-visibilitychange",pt)}var At=function(){function t(t,i){i&&(!function(){if(!i.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==i.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+i.tagName+">")}(),ht(i,t),e.push(i))}var e;return function(){var t,e=["moz","webkit","o","ms"];for(t=0;t<e.length&&!j;t+=1)j=window[e[t]+"RequestAnimationFrame"];j?j=j.bind(window):K("setup","RequestAnimationFrame not supported")}(),gt(),function(i,n){switch(e=[],function(t){t&&t.enablePublicMethods&&Q("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof n){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(n||"iframe"),t.bind(void 0,i));break;case"object":t(i,n);break;default:throw new TypeError("Unexpected data type ("+typeof n+")")}return e}}(),mt=i(83136),vt=i.n(mt),bt=i(89379);function wt(t,e,i){e||(e=[]);var n=e.length++;return Object.defineProperty({},"_",{set:function(s){e[n]=s,t.apply(i,e)}})}var yt=i(53986),_t=i(39790),xt=i(26562);function Et(t,e,i){return i((0,xt.A)(t,e))}var kt=i(64467),Ct=i(55149),St=i(38458),Mt=i(24558);const Lt=["textContentSource","container","viewport"];var Tt,Rt,Pt,Ft,It,Dt,Ot,Nt,Wt,jt,Bt,Ht,zt={d:(t,e)=>{for(var i in e)zt.o(e,i)&&!zt.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Ut=globalThis.pdfjsLib={};zt.d(Ut,{AbortException:()=>ei,AnnotationEditorLayer:()=>rg,AnnotationEditorParamsType:()=>ne,AnnotationEditorType:()=>ie,AnnotationEditorUIManager:()=>Ys,AnnotationLayer:()=>Ad,AnnotationMode:()=>ee,CMapCompressionType:()=>Oe,ColorPicker:()=>Vu,DOMSVGFactory:()=>Ji,DrawLayer:()=>mg,FeatureTest:()=>ri,GlobalWorkerOptions:()=>ao,ImageKind:()=>de,InvalidPDFException:()=>Ze,MissingPDFException:()=>Je,OPS:()=>Ne,Outliner:()=>Gd,PDFDataRangeTransport:()=>nc,PDFDateString:()=>dn,PDFWorker:()=>Ac,PasswordResponses:()=>We,PermissionFlag:()=>se,PixelsPerInch:()=>Ti,RenderingCancelledException:()=>tn,TextLayer:()=>Il,UnexpectedResponseException:()=>$e,Util:()=>oi,VerbosityLevel:()=>De,XfaLayer:()=>Uc,build:()=>jc,createValidAbsoluteUrl:()=>qe,fetchData:()=>Ki,getDocument:()=>$l,getFilenameFromUrl:()=>sn,getPdfFilenameFromUrl:()=>rn,getXfaPageViewport:()=>un,isDataScheme:()=>en,isPdfFile:()=>nn,noContextMenu:()=>ln,normalizeUnicode:()=>ui,renderTextLayer:()=>Gl,setLayerDimensions:()=>An,shadow:()=>Xe,updateTextLayer:()=>ql,version:()=>Wc});const Vt="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),Gt=[1,0,0,1,0,0],qt=[.001,0,0,.001,0,0],Xt=1.35,Yt=1,Kt=2,Qt=4,Zt=16,Jt=32,$t=64,te=256,ee={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},ie={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},ne={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},se={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},re=0,ae=1,oe=2,le=3,ce=3,he=4,de={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},ue=1,pe=2,fe=3,ge=4,Ae=5,me=6,ve=7,be=8,we=9,ye=10,_e=11,xe=12,Ee=13,ke=14,Ce=15,Se=16,Me=17,Le=20,Te=1,Re=2,Pe=3,Fe=4,Ie=5,De={ERRORS:0,WARNINGS:1,INFOS:5},Oe={NONE:0,BINARY:1},Ne={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},We={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let je=De.WARNINGS;function Be(t){Number.isInteger(t)&&(je=t)}function He(){return je}function ze(t){je>=De.INFOS&&console.log("Info: ".concat(t))}function Ue(t){je>=De.WARNINGS&&console.log("Warning: ".concat(t))}function Ve(t){throw new Error(t)}function Ge(t,e){t||Ve(e)}function qe(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(i&&"string"===typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);(null===e||void 0===e?void 0:e.length)>=2&&(t="http://".concat(t))}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch(n){}}const s=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}}(s))return s}catch(s){}return null}function Xe(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const Ye=function(){function t(e,i){this.constructor===t&&Ve("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class Ke extends Ye{constructor(t,e){super(t,"PasswordException"),this.code=e}}class Qe extends Ye{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Ze extends Ye{constructor(t){super(t,"InvalidPDFException")}}class Je extends Ye{constructor(t){super(t,"MissingPDFException")}}class $e extends Ye{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class ti extends Ye{constructor(t){super(t,"FormatError")}}class ei extends Ye{constructor(t){super(t,"AbortException")}}function ii(t){"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.length)||Ve("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const n=[];for(let s=0;s<e;s+=i){const r=Math.min(s+i,e),a=t.subarray(s,r);n.push(String.fromCharCode.apply(null,a))}return n.join("")}function ni(t){"string"!==typeof t&&Ve("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let n=0;n<e;++n)i[n]=255&t.charCodeAt(n);return i}function si(t){const e=Object.create(null);for(const[i,n]of t)e[i]=n;return e}class ri{static get isLittleEndian(){return Xe(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return Xe(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return Xe(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get platform(){var t;return"undefined"!==typeof navigator&&"string"===typeof(null===(t=navigator)||void 0===t?void 0:t.platform)?Xe(this,"platform",{isMac:navigator.platform.includes("Mac")}):Xe(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var t,e;return Xe(this,"isCSSRoundSupported",null===(t=globalThis.CSS)||void 0===t||null===(e=t.supports)||void 0===e?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const ai=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class oi{static makeHexColor(t,e,i){return"#".concat(ai[t]).concat(ai[e]).concat(ai[i])}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){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 i=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])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),n=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),r=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],n[0],s[0],r[0]),Math.min(i[1],n[1],s[1],r[1]),Math.max(i[0],n[0],s[0],r[0]),Math.max(i[1],n[1],s[1],r[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]],i=t[0]*e[0]+t[1]*e[2],n=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],r=t[2]*e[1]+t[3]*e[3],a=(i+r)/2,o=Math.sqrt((i+r)**2-4*(i*r-s*n))/2,l=a+o||1,c=a-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 i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>r?null:[i,s,n,r]}static bezierBoundingBox(t,e,i,n,s,r,a,o,l){return l?(l[0]=Math.min(l[0],t,a),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,a),l[3]=Math.max(l[3],e,o)):l=[Math.min(t,a),Math.min(e,o),Math.max(t,a),Math.max(e,o)],(0,xt.A)(oi,this,ci).call(this,t,i,s,a,e,n,r,o,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),l),(0,xt.A)(oi,this,ci).call(this,t,i,s,a,e,n,r,o,3*(3*(n-r)-e+o),6*(e-2*n+r),3*(n-e),l),l}}function li(t,e,i,n,s,r,a,o,l,c){if(l<=0||l>=1)return;const h=1-l,d=l*l,u=d*l,p=h*(h*(h*t+3*l*e)+3*d*i)+u*n,f=h*(h*(h*s+3*l*r)+3*d*a)+u*o;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],f),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],f)}function ci(t,e,i,n,s,r,a,o,l,c,h,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&(0,xt.A)(Tt,this,li).call(this,t,e,i,n,s,r,a,o,-h/c,d));const u=c**2-4*h*l;if(u<0)return;const p=Math.sqrt(u),f=2*l;(0,xt.A)(Tt,this,li).call(this,t,e,i,n,s,r,a,o,(-c+p)/f,d),(0,xt.A)(Tt,this,li).call(this,t,e,i,n,s,r,a,o,(-c-p)/f,d)}Tt=oi;let hi=null,di=null;function ui(t){return hi||(hi=/([\xA0\xB5\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+)/g,di=new Map([["\ufb05","\u017ft"]])),t.replaceAll(hi,(t,e,i)=>e?e.normalize("NFKC"):di.get(i))}const pi="pdfjs_internal_id_",fi=0,gi=1,Ai=2,mi=3,vi=4,bi=5,wi=6,yi=7,_i=8;class xi{constructor(){this.constructor===xi&&Ve("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,s){return"none"}destroy(){}}var Ei=new WeakMap;class ki{constructor(){let{enableHWA:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,Ct.A)(this,Ei,!1),this.constructor===ki&&Ve("Cannot initialize BaseCanvasFactory."),(0,Mt.A)(Ei,this,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!(0,St.A)(Ei,this)})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){Ve("Abstract method `_createCanvas` called.")}}class Ci{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.constructor===Ci&&Ve("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=i}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 i=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?Oe.BINARY:Oe.NONE;return this._fetchData(i,n).catch(t=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(i))})}_fetchData(t,e){Ve("Abstract method `_fetchData` called.")}}class Si{constructor(t){let{baseUrl:e=null}=t;this.constructor===Si&&Ve("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 i="".concat(this.baseUrl).concat(e);return this._fetchData(i).catch(t=>{throw new Error("Unable to load font data at: ".concat(i))})}_fetchData(t){Ve("Abstract method `_fetchData` called.")}}class Mi{constructor(){this.constructor===Mi&&Ve("Cannot initialize BaseSVGFactory.")}create(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width","".concat(t,"px")),n.setAttribute("height","".concat(e,"px"))),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox","0 0 ".concat(t," ").concat(e)),n}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Ve("Abstract method `_createSVG` called.")}}const Li="http://www.w3.org/2000/svg";class Ti{}Rt=Ti,(0,kt.A)(Ti,"CSS",96),(0,kt.A)(Ti,"PDF",72),(0,kt.A)(Ti,"PDF_TO_CSS_UNITS",Rt.CSS/Rt.PDF);var Ri=new WeakMap,Pi=new WeakMap,Fi=new WeakMap,Ii=new WeakMap,Di=new WeakMap,Oi=new WeakMap,Ni=new WeakSet;function Wi(t){return(0,St.A)(Ri,t)||(0,Mt.A)(Ri,t,new Map)}function ji(t){return(0,St.A)(Di,t)||(0,Mt.A)(Di,t,new Map)}function Bi(t){if(!(0,St.A)(Pi,t)){const e=(0,St.A)(Ii,t).createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const n=(0,St.A)(Ii,t).createElementNS(Li,"svg");n.setAttribute("width",0),n.setAttribute("height",0),(0,Mt.A)(Pi,t,(0,St.A)(Ii,t).createElementNS(Li,"defs")),e.append(n),n.append((0,St.A)(Pi,t)),(0,St.A)(Ii,t).body.append(e)}return(0,St.A)(Pi,t)}function Hi(t){if(1===t.length){const e=t[0],i=new Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;const n=i.join(",");return[n,n,n]}const[e,i,n]=t,s=new Array(256),r=new Array(256),a=new Array(256);for(let o=0;o<256;o++)s[o]=e[o]/255,r[o]=i[o]/255,a[o]=n[o]/255;return[s.join(","),r.join(","),a.join(",")]}function zi(t){const e=(0,St.A)(Ii,this).createElementNS(Li,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}function Ui(t){const e=(0,St.A)(Ii,this).createElementNS(Li,"feColorMatrix");e.setAttribute("type","matrix"),e.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"),t.append(e)}function Vi(t){const e=(0,St.A)(Ii,this).createElementNS(Li,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),Et(Ni,this,Bi).append(e),e}function Gi(t,e,i){const n=(0,St.A)(Ii,this).createElementNS(Li,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}function qi(t,e,i,n){const s=(0,St.A)(Ii,this).createElementNS(Li,"feComponentTransfer");n.append(s),(0,xt.A)(Ni,this,Gi).call(this,s,"feFuncR",t),(0,xt.A)(Ni,this,Gi).call(this,s,"feFuncG",e),(0,xt.A)(Ni,this,Gi).call(this,s,"feFuncB",i)}function Xi(t,e){const i=(0,St.A)(Ii,this).createElementNS(Li,"feComponentTransfer");e.append(i),(0,xt.A)(Ni,this,Gi).call(this,i,"feFuncA",t)}function Yi(t){return Et(Ni,this,Bi).style.color=t,pn(getComputedStyle(Et(Ni,this,Bi)).getPropertyValue("color"))}async function Ki(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(on(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,n)=>{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE)if(200!==s.status&&0!==s.status)n(new Error(s.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":return void i(s.response)}i(s.responseText)}},s.send(null)})}class Qi extends Ci{_fetchData(t,e){return Ki(t,this.isCompressed?"arraybuffer":"text").then(t=>({cMapData:t instanceof ArrayBuffer?new Uint8Array(t):ni(t),compressionType:e}))}}class Zi extends Si{_fetchData(t){return Ki(t,"arraybuffer").then(t=>new Uint8Array(t))}}class Ji extends Mi{_createSVG(t){return document.createElementNS(Li,t)}}class $i{constructor(t){let{viewBox:e,scale:i,rotation:n,offsetX:s=0,offsetY:r=0,dontFlip:a=!1}=t;this.viewBox=e,this.scale=i,this.rotation=n,this.offsetX=s,this.offsetY=r;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,h,d,u,p,f,g,A;switch(n%=360,n<0&&(n+=360),n){case 180:c=-1,h=0,d=0,u=1;break;case 90:c=0,h=1,d=1,u=0;break;case 270:c=0,h=-1,d=-1,u=0;break;case 0:c=1,h=0,d=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(d=-d,u=-u),0===c?(p=Math.abs(l-e[1])*i+s,f=Math.abs(o-e[0])*i+r,g=(e[3]-e[1])*i,A=(e[2]-e[0])*i):(p=Math.abs(o-e[0])*i+s,f=Math.abs(l-e[1])*i+r,g=(e[2]-e[0])*i,A=(e[3]-e[1])*i),this.transform=[c*i,h*i,d*i,u*i,p-c*i*o-d*i*l,f-h*i*o-u*i*l],this.width=g,this.height=A}get rawDims(){const{viewBox:t}=this;return Xe(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:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new $i({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return oi.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=oi.applyTransform([t[0],t[1]],this.transform),i=oi.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return oi.applyInverseTransform([t,e],this.transform)}}class tn extends Ye{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function en(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function nn(t){return"string"===typeof t&&/\.pdf$/i.test(t)}function sn(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function rn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(en(t))return Ue('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let s=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch(r){}return s||e}class an{constructor(){(0,kt.A)(this,"started",Object.create(null)),(0,kt.A)(this,"times",[])}time(t){t in this.started&&Ue("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||Ue("Timer has not been started for ".concat(t)),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:n,end:s}of this.times)t.push("".concat(i.padEnd(e)," ").concat(s-n,"ms\n"));return t.join("")}}function on(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch(i){return!1}}function ln(t){t.preventDefault()}function cn(t){console.log("Deprecated API usage: "+t)}let hn;class dn{static toDateObject(t){if(!t||"string"!==typeof t)return null;hn||(hn=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=hn.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a: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 h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===l?(r+=c,a+=h):"+"===l&&(r-=c,a-=h),new Date(Date.UTC(i,n,s,r,a,o))}}function un(t,e){let{scale:i=1,rotation:n=0}=e;const{width:s,height:r}=t.attributes.style,a=[0,0,parseInt(s),parseInt(r)];return new $i({viewBox:a,scale:i,rotation:n})}function pn(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):(Ue('Not a valid color format: "'.concat(t,'"')),[0,0,0])}function fn(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform();return[e,i,n,s,r,a]}function gn(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform().invertSelf();return[e,i,n,s,r,a]}function An(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof $i){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:r}=t,a=ri.isCSSRoundSupported,o="var(--scale-factor) * ".concat(n,"px"),l="var(--scale-factor) * ".concat(s,"px"),c=a?"round(".concat(o,", 1px)"):"calc(".concat(o,")"),h=a?"round(".concat(l,", 1px)"):"calc(".concat(l,")");i&&e.rotation%180!==0?(r.width=h,r.height=c):(r.width=c,r.height=h)}n&&t.setAttribute("data-main-rotation",e.rotation)}var mn=new WeakMap,vn=new WeakMap,bn=new WeakMap,wn=new WeakMap,yn=new WeakSet;class _n{constructor(t){(0,_t.A)(this,yn),(0,Ct.A)(this,mn,null),(0,Ct.A)(this,vn,null),(0,Ct.A)(this,bn,void 0),(0,Ct.A)(this,wn,null),(0,Mt.A)(bn,this,t)}render(){const t=(0,Mt.A)(mn,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=(0,St.A)(bn,this)._uiManager._signal;t.addEventListener("contextmenu",ln,{signal:e}),t.addEventListener("pointerdown",xn,{signal:e});const i=(0,Mt.A)(wn,this,document.createElement("div"));i.className="buttons",t.append(i);const n=(0,St.A)(bn,this).toolbarPosition;if(n){const{style:e}=t,i="ltr"===(0,St.A)(bn,this)._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd="".concat(100*i,"%"),e.top="calc(".concat(100*n[1],"% + var(--editor-toolbar-vert-offset))")}return(0,xt.A)(yn,this,Sn).call(this),t}hide(){var t;(0,St.A)(mn,this).classList.add("hidden"),null===(t=(0,St.A)(vn,this))||void 0===t||t.hideDropdown()}show(){(0,St.A)(mn,this).classList.remove("hidden")}addAltTextButton(t){(0,xt.A)(yn,this,Cn).call(this,t),(0,St.A)(wn,this).prepend(t,Et(yn,this,Mn))}addColorPicker(t){(0,Mt.A)(vn,this,t);const e=t.renderButton();(0,xt.A)(yn,this,Cn).call(this,e),(0,St.A)(wn,this).prepend(e,Et(yn,this,Mn))}remove(){var t;(0,St.A)(mn,this).remove(),null===(t=(0,St.A)(vn,this))||void 0===t||t.destroy(),(0,Mt.A)(vn,this,null)}}function xn(t){t.stopPropagation()}function En(t){(0,St.A)(bn,this)._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}function kn(t){(0,St.A)(bn,this)._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}function Cn(t){const e=(0,St.A)(bn,this)._uiManager._signal;t.addEventListener("focusin",(0,xt.A)(yn,this,En).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",(0,xt.A)(yn,this,kn).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",ln,{signal:e})}function Sn(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-editor-remove-".concat((0,St.A)(bn,this).editorType,"-button")),(0,xt.A)(yn,this,Cn).call(this,t),t.addEventListener("click",t=>{(0,St.A)(bn,this)._uiManager.delete()},{signal:(0,St.A)(bn,this)._uiManager._signal}),(0,St.A)(wn,this).append(t)}function Mn(t){const e=document.createElement("div");return e.className="divider",e}var Ln=new WeakMap,Tn=new WeakMap,Rn=new WeakMap,Pn=new WeakSet;class Fn{constructor(t){(0,_t.A)(this,Pn),(0,Ct.A)(this,Ln,null),(0,Ct.A)(this,Tn,null),(0,Ct.A)(this,Rn,void 0),(0,Mt.A)(Rn,this,t)}show(t,e,i){const[n,s]=(0,xt.A)(Pn,this,Dn).call(this,e,i),{style:r}=(0,St.A)(Tn,this)||(0,Mt.A)(Tn,this,(0,xt.A)(Pn,this,In).call(this));t.append((0,St.A)(Tn,this)),r.insetInlineEnd="".concat(100*n,"%"),r.top="calc(".concat(100*s,"% + var(--editor-toolbar-vert-offset))")}hide(){(0,St.A)(Tn,this).remove()}}function In(){const t=(0,Mt.A)(Tn,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",ln,{signal:(0,St.A)(Rn,this)._signal});const e=(0,Mt.A)(Ln,this,document.createElement("div"));return e.className="buttons",t.append(e),(0,xt.A)(Pn,this,On).call(this),t}function Dn(t,e){let i=0,n=0;for(const s of t){const t=s.y+s.height;if(t<i)continue;const r=s.x+(e?s.width:0);t>i?(n=r,i=t):e?r>n&&(n=r):r<n&&(n=r)}return[e?1-n:n,i]}function On(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=(0,St.A)(Rn,this)._signal;t.addEventListener("contextmenu",ln,{signal:i}),t.addEventListener("click",()=>{(0,St.A)(Rn,this).highlightSelection("floating_button")},{signal:i}),(0,St.A)(Ln,this).append(t)}function Nn(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}var Wn=new WeakMap;class jn{constructor(){(0,Ct.A)(this,Wn,0)}get id(){var t,e;return"".concat("pdfjs_internal_editor_").concat(((0,Mt.A)(Wn,this,(t=(0,St.A)(Wn,this),e=t++,t)),e))}}var Bn=new WeakMap,Hn=new WeakMap,zn=new WeakMap,Un=new WeakSet;class Vn{constructor(){(0,_t.A)(this,Un),(0,Ct.A)(this,Bn,function(){var t,e;if("undefined"!==typeof crypto&&"function"===typeof(null===(t=crypto)||void 0===t?void 0:t.randomUUID))return crypto.randomUUID();const i=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof(null===(e=crypto)||void 0===e?void 0:e.getRandomValues))crypto.getRandomValues(i);else for(let n=0;n<32;n++)i[n]=Math.floor(255*Math.random());return ii(i)}()),(0,Ct.A)(this,Hn,0),(0,Ct.A)(this,zn,null)}static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';return Xe(this,"_isSVGFittingCanvas",e.decode().then(()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0])))}async getFromFile(t){const{lastModified:e,name:i,size:n,type:s}=t;return(0,xt.A)(Un,this,Gn).call(this,"".concat(e,"_").concat(i,"_").concat(n,"_").concat(s),t)}async getFromUrl(t){return(0,xt.A)(Un,this,Gn).call(this,t,t)}async getFromId(t){(0,St.A)(zn,this)||(0,Mt.A)(zn,this,new Map);const e=(0,St.A)(zn,this).get(t);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(t){const e=(0,St.A)(zn,this).get(t);return null!==e&&void 0!==e&&e.isSvg?e.svgUrl:null}deleteId(t){(0,St.A)(zn,this)||(0,Mt.A)(zn,this,new Map);const e=(0,St.A)(zn,this).get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith("image_".concat((0,St.A)(Bn,this),"_"))}}async function Gn(t,e){var i;(0,St.A)(zn,this)||(0,Mt.A)(zn,this,new Map);let n=(0,St.A)(zn,this).get(t);if(null===n)return null;if(null!==(i=n)&&void 0!==i&&i.bitmap)return n.refCounter+=1,n;try{var s,r;let t;if(n||(n={bitmap:null,id:"image_".concat((0,St.A)(Bn,this),"_").concat(((0,Mt.A)(Hn,this,(s=(0,St.A)(Hn,this),r=s++,s)),r)),refCounter:0,isSvg:!1}),"string"===typeof e?(n.url=e,t=await Ki(e,"blob")):t=n.file=e,"image/svg+xml"===t.type){const e=Pt._isSVGFittingCanvas,i=new FileReader,s=new Image,r=new Promise((t,r)=>{s.onload=()=>{n.bitmap=s,n.isSvg=!0,t()},i.onload=async()=>{const t=n.svgUrl=i.result;s.src=await e?"".concat(t,"#svgView(preserveAspectRatio(none))"):t},s.onerror=i.onerror=r});i.readAsDataURL(t),await r}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(a){console.error(a),n=null}return(0,St.A)(zn,this).set(t,n),n&&(0,St.A)(zn,this).set(n.id,n),n}Pt=Vn;var qn=new WeakMap,Xn=new WeakMap,Yn=new WeakMap,Kn=new WeakMap;class Qn{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;(0,Ct.A)(this,qn,[]),(0,Ct.A)(this,Xn,!1),(0,Ct.A)(this,Yn,void 0),(0,Ct.A)(this,Kn,-1),(0,Mt.A)(Yn,this,t)}add(t){let{cmd:e,undo:i,post:n,mustExec:s,type:r=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}=t;if(s&&e(),(0,St.A)(Xn,this))return;const l={cmd:e,undo:i,post:n,type:r};if(-1===(0,St.A)(Kn,this))return(0,St.A)(qn,this).length>0&&((0,St.A)(qn,this).length=0),(0,Mt.A)(Kn,this,0),void(0,St.A)(qn,this).push(l);if(a&&(0,St.A)(qn,this)[(0,St.A)(Kn,this)].type===r)return o&&(l.undo=(0,St.A)(qn,this)[(0,St.A)(Kn,this)].undo),void((0,St.A)(qn,this)[(0,St.A)(Kn,this)]=l);const c=(0,St.A)(Kn,this)+1;c===(0,St.A)(Yn,this)?(0,St.A)(qn,this).splice(0,1):((0,Mt.A)(Kn,this,c),c<(0,St.A)(qn,this).length&&(0,St.A)(qn,this).splice(c)),(0,St.A)(qn,this).push(l)}undo(){if(-1===(0,St.A)(Kn,this))return;(0,Mt.A)(Xn,this,!0);const{undo:t,post:e}=(0,St.A)(qn,this)[(0,St.A)(Kn,this)];t(),null===e||void 0===e||e(),(0,Mt.A)(Xn,this,!1),(0,Mt.A)(Kn,this,(0,St.A)(Kn,this)-1)}redo(){if((0,St.A)(Kn,this)<(0,St.A)(qn,this).length-1){(0,Mt.A)(Kn,this,(0,St.A)(Kn,this)+1),(0,Mt.A)(Xn,this,!0);const{cmd:t,post:e}=(0,St.A)(qn,this)[(0,St.A)(Kn,this)];t(),null===e||void 0===e||e(),(0,Mt.A)(Xn,this,!1)}}hasSomethingToUndo(){return-1!==(0,St.A)(Kn,this)}hasSomethingToRedo(){return(0,St.A)(Kn,this)<(0,St.A)(qn,this).length-1}destroy(){(0,Mt.A)(qn,this,null)}}var Zn=new WeakSet;class Jn{constructor(t){(0,_t.A)(this,Zn),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=ri.platform;for(const[i,n,s={}]of t)for(const t of i){const i=t.startsWith("mac+");e&&i?(this.callbacks.set(t.slice(4),{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1))):e||i||(this.callbacks.set(t,{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get((0,xt.A)(Zn,this,$n).call(this,e));if(!i)return;const{callback:n,options:{bubbles:s=!1,args:r=[],checker:a=null}}=i;a&&!a(t,e)||(n.bind(t,...r,e)(),s||(e.stopPropagation(),e.preventDefault()))}}function $n(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}class ts{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,pn(n))}e.remove()}(t),Xe(this,"_colors",t)}convert(t){const e=pn(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,n]of this._colors)if(n.every((t,i)=>t===e[i]))return ts._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?oi.makeHexColor(...e):t}}(0,kt.A)(ts,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var es=new WeakMap,is=new WeakMap,ns=new WeakMap,ss=new WeakMap,rs=new WeakMap,as=new WeakMap,os=new WeakMap,ls=new WeakMap,cs=new WeakMap,hs=new WeakMap,ds=new WeakMap,us=new WeakMap,ps=new WeakMap,fs=new WeakMap,gs=new WeakMap,As=new WeakMap,ms=new WeakMap,vs=new WeakMap,bs=new WeakMap,ws=new WeakMap,ys=new WeakMap,_s=new WeakMap,xs=new WeakMap,Es=new WeakMap,ks=new WeakMap,Cs=new WeakMap,Ss=new WeakMap,Ms=new WeakMap,Ls=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,Ps=new WeakMap,Fs=new WeakMap,Is=new WeakMap,Ds=new WeakMap,Os=new WeakMap,Ns=new WeakMap,Ws=new WeakMap,js=new WeakMap,Bs=new WeakMap,Hs=new WeakMap,zs=new WeakMap,Us=new WeakMap,Vs=new WeakMap,Gs=new WeakMap,qs=new WeakMap,Xs=new WeakSet;class Ys{static get _keyboardManager(){const t=Ys.prototype,e=t=>(0,St.A)(Gs,t).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,e)=>{let{target:i}=e;if(i instanceof HTMLInputElement){const{type:t}=i;return"text"!==t&&"number"!==t}return!0},n=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return Xe(this,"_keyboardManager",new Jn([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&(0,St.A)(Gs,t).contains(i)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&(0,St.A)(Gs,t).contains(document.activeElement)}}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}constructor(t,e,i,n,s,r,a,o,l){(0,_t.A)(this,Xs),(0,Ct.A)(this,es,new AbortController),(0,Ct.A)(this,is,null),(0,Ct.A)(this,ns,new Map),(0,Ct.A)(this,ss,new Map),(0,Ct.A)(this,rs,null),(0,Ct.A)(this,as,null),(0,Ct.A)(this,os,null),(0,Ct.A)(this,ls,new Qn),(0,Ct.A)(this,cs,0),(0,Ct.A)(this,hs,new Set),(0,Ct.A)(this,ds,null),(0,Ct.A)(this,us,null),(0,Ct.A)(this,ps,new Set),(0,Ct.A)(this,fs,!1),(0,Ct.A)(this,gs,null),(0,Ct.A)(this,As,null),(0,Ct.A)(this,ms,null),(0,Ct.A)(this,vs,!1),(0,Ct.A)(this,bs,null),(0,Ct.A)(this,ws,new jn),(0,Ct.A)(this,ys,!1),(0,Ct.A)(this,_s,!1),(0,Ct.A)(this,xs,null),(0,Ct.A)(this,Es,null),(0,Ct.A)(this,ks,null),(0,Ct.A)(this,Cs,ie.NONE),(0,Ct.A)(this,Ss,new Set),(0,Ct.A)(this,Ms,null),(0,Ct.A)(this,Ls,null),(0,Ct.A)(this,Ts,null),(0,Ct.A)(this,Rs,this.blur.bind(this)),(0,Ct.A)(this,Ps,this.focus.bind(this)),(0,Ct.A)(this,Fs,this.copy.bind(this)),(0,Ct.A)(this,Is,this.cut.bind(this)),(0,Ct.A)(this,Ds,this.paste.bind(this)),(0,Ct.A)(this,Os,this.keydown.bind(this)),(0,Ct.A)(this,Ns,this.keyup.bind(this)),(0,Ct.A)(this,Ws,this.onEditingAction.bind(this)),(0,Ct.A)(this,js,this.onPageChanging.bind(this)),(0,Ct.A)(this,Bs,this.onScaleChanging.bind(this)),(0,Ct.A)(this,Hs,this.onRotationChanging.bind(this)),(0,Ct.A)(this,zs,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),(0,Ct.A)(this,Us,[0,0]),(0,Ct.A)(this,Vs,null),(0,Ct.A)(this,Gs,null),(0,Ct.A)(this,qs,null),this._signal=(0,St.A)(es,this).signal,(0,Mt.A)(Gs,this,t),(0,Mt.A)(qs,this,e),(0,Mt.A)(rs,this,i),this._eventBus=n,this._eventBus._on("editingaction",(0,St.A)(Ws,this)),this._eventBus._on("pagechanging",(0,St.A)(js,this)),this._eventBus._on("scalechanging",(0,St.A)(Bs,this)),this._eventBus._on("rotationchanging",(0,St.A)(Hs,this)),(0,xt.A)(Xs,this,$s).call(this),(0,xt.A)(Xs,this,ar).call(this),(0,xt.A)(Xs,this,ir).call(this),(0,Mt.A)(as,this,s.annotationStorage),(0,Mt.A)(gs,this,s.filterFactory),(0,Mt.A)(Ls,this,r),(0,Mt.A)(ms,this,a||null),(0,Mt.A)(fs,this,o),(0,Mt.A)(ks,this,l||null),this.viewParameters={realScale:Ti.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){var t,e,i;null===(t=(0,St.A)(es,this))||void 0===t||t.abort(),(0,Mt.A)(es,this,null),this._signal=null,this._eventBus._off("editingaction",(0,St.A)(Ws,this)),this._eventBus._off("pagechanging",(0,St.A)(js,this)),this._eventBus._off("scalechanging",(0,St.A)(Bs,this)),this._eventBus._off("rotationchanging",(0,St.A)(Hs,this));for(const n of(0,St.A)(ss,this).values())n.destroy();(0,St.A)(ss,this).clear(),(0,St.A)(ns,this).clear(),(0,St.A)(ps,this).clear(),(0,Mt.A)(is,this,null),(0,St.A)(Ss,this).clear(),(0,St.A)(ls,this).destroy(),null===(e=(0,St.A)(rs,this))||void 0===e||e.destroy(),null===(i=(0,St.A)(bs,this))||void 0===i||i.hide(),(0,Mt.A)(bs,this,null),(0,St.A)(As,this)&&(clearTimeout((0,St.A)(As,this)),(0,Mt.A)(As,this,null)),(0,St.A)(Vs,this)&&(clearTimeout((0,St.A)(Vs,this)),(0,Mt.A)(Vs,this,null))}async mlGuess(t){var e;return(null===(e=(0,St.A)(ks,this))||void 0===e?void 0:e.guess(t))||null}get hasMLManager(){return!!(0,St.A)(ks,this)}get hcmFilter(){return Xe(this,"hcmFilter",(0,St.A)(Ls,this)?(0,St.A)(gs,this).addHCMFilter((0,St.A)(Ls,this).foreground,(0,St.A)(Ls,this).background):"none")}get direction(){return Xe(this,"direction",getComputedStyle((0,St.A)(Gs,this)).direction)}get highlightColors(){return Xe(this,"highlightColors",(0,St.A)(ms,this)?new Map((0,St.A)(ms,this).split(",").map(t=>t.split("=").map(t=>t.trim()))):null)}get highlightColorNames(){return Xe(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){(0,Mt.A)(Es,this,t)}editAltText(t){var e;null===(e=(0,St.A)(rs,this))||void 0===e||e.editAltText(this,t)}onPageChanging(t){let{pageNumber:e}=t;(0,Mt.A)(cs,this,e-1)}focusMainContainer(){(0,St.A)(Gs,this).focus()}findParent(t,e){for(const i of(0,St.A)(ss,this).values()){const{x:n,y:s,width:r,height:a}=i.div.getBoundingClientRect();if(t>=n&&t<=n+r&&e>=s&&e<=s+a)return i}return null}disableUserSelect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,St.A)(qs,this).classList.toggle("noUserSelect",t)}addShouldRescale(t){(0,St.A)(ps,this).add(t)}removeShouldRescale(t){(0,St.A)(ps,this).delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove(),this.viewParameters.realScale=e*Ti.PDF_TO_CSS_UNITS;for(const i of(0,St.A)(ps,this))i.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}=e,a=e.toString(),o=(0,xt.A)(Xs,this,Ks).call(this,e).closest(".textLayer"),l=this.getSelectionBoxes(o);if(l){e.empty(),(0,St.A)(Cs,this)===ie.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:ie.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const e of(0,St.A)(ss,this).values())if(e.hasTextLayer(o)){e.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:l,anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r,text:a});break}}}addToAnnotationStorage(t){t.isEmpty()||!(0,St.A)(as,this)||(0,St.A)(as,this).has(t.id)||(0,St.A)(as,this).setValue(t.id,t)}blur(){if(this.isShiftKeyDown=!1,(0,St.A)(vs,this)&&((0,Mt.A)(vs,this,!1),(0,xt.A)(Xs,this,Js).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of(0,St.A)(Ss,this))if(e.div.contains(t)){(0,Mt.A)(xs,this,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!(0,St.A)(xs,this))return;const[t,e]=(0,St.A)(xs,this);(0,Mt.A)(xs,this,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){(0,xt.A)(Xs,this,ir).call(this),(0,xt.A)(Xs,this,sr).call(this)}removeEditListeners(){(0,xt.A)(Xs,this,nr).call(this),(0,xt.A)(Xs,this,rr).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of(0,St.A)(us,this))if(i.isHandlingMimeForPasting(e))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const e of t.dataTransfer.items)for(const i of(0,St.A)(us,this))if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){var e;if(t.preventDefault(),null===(e=(0,St.A)(is,this))||void 0===e||e.commitOrRemove(),!this.hasSelection)return;const i=[];for(const n of(0,St.A)(Ss,this)){const t=n.serialize(!0);t&&i.push(t)}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:e}=t;for(const r of e.items)for(const t of(0,St.A)(us,this))if(t.isHandlingMimeForPasting(r.type))return void t.paste(r,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(s){return void Ue('paste: "'.concat(s.message,'".'))}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const r of i){const e=n.deserialize(r);if(!e)return;t.push(e)}const e=()=>{for(const e of t)(0,xt.A)(Xs,this,dr).call(this,e);(0,xt.A)(Xs,this,fr).call(this,t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(s){Ue('paste: "'.concat(s.message,'".'))}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),(0,St.A)(Cs,this)===ie.NONE||this.isEditorHandlingKeyboard||Ys._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,(0,St.A)(vs,this)&&((0,Mt.A)(vs,this,!1),(0,xt.A)(Xs,this,Js).call(this,"main_toolbar")))}onEditingAction(t){let{name:e}=t;switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu")}}setEditingState(t){t?((0,xt.A)(Xs,this,tr).call(this),(0,xt.A)(Xs,this,sr).call(this),(0,xt.A)(Xs,this,or).call(this,{isEditing:(0,St.A)(Cs,this)!==ie.NONE,isEmpty:(0,xt.A)(Xs,this,pr).call(this),hasSomethingToUndo:(0,St.A)(ls,this).hasSomethingToUndo(),hasSomethingToRedo:(0,St.A)(ls,this).hasSomethingToRedo(),hasSelectedEditor:!1})):((0,xt.A)(Xs,this,er).call(this),(0,xt.A)(Xs,this,rr).call(this),(0,xt.A)(Xs,this,or).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!(0,St.A)(us,this)){(0,Mt.A)(us,this,t);for(const t of(0,St.A)(us,this))(0,xt.A)(Xs,this,lr).call(this,t.defaultPropertiesToUpdate)}}getId(){return(0,St.A)(ws,this).id}get currentLayer(){return(0,St.A)(ss,this).get((0,St.A)(cs,this))}getLayer(t){return(0,St.A)(ss,this).get(t)}get currentPageIndex(){return(0,St.A)(cs,this)}addLayer(t){(0,St.A)(ss,this).set(t.pageIndex,t),(0,St.A)(ys,this)?t.enable():t.disable()}removeLayer(t){(0,St.A)(ss,this).delete(t.pageIndex)}updateMode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,St.A)(Cs,this)!==t){if((0,Mt.A)(Cs,this,t),t===ie.NONE)return this.setEditingState(!1),void(0,xt.A)(Xs,this,hr).call(this);this.setEditingState(!0),(0,xt.A)(Xs,this,cr).call(this),this.unselectAll();for(const e of(0,St.A)(ss,this).values())e.updateMode(t);if(e||!i){if(e)for(const t of(0,St.A)(ns,this).values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}else this.addNewEditorFromKeyboard()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==(0,St.A)(Cs,this)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){var i;if((0,St.A)(us,this)){switch(t){case ne.CREATE:return void this.currentLayer.addNewEditor();case ne.HIGHLIGHT_DEFAULT_COLOR:null===(i=(0,St.A)(Es,this))||void 0===i||i.updateColor(e);break;case ne.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),((0,St.A)(Ts,this)||(0,Mt.A)(Ts,this,new Map)).set(t,e),this.showAllEditors("highlight",e)}for(const i of(0,St.A)(Ss,this))i.updateParams(t,e);for(const i of(0,St.A)(us,this))i.updateDefaultParams(t,e)}}showAllEditors(t,e){var i,n;for(const s of(0,St.A)(ns,this).values())s.editorType===t&&s.show(e);(null===(i=null===(n=(0,St.A)(Ts,this))||void 0===n?void 0:n.get(ne.HIGHLIGHT_SHOW_ALL))||void 0===i||i)!==e&&(0,xt.A)(Xs,this,lr).call(this,[[ne.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if((0,St.A)(_s,this)!==t){(0,Mt.A)(_s,this,t);for(const e of(0,St.A)(ss,this).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const i of(0,St.A)(ns,this).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return(0,St.A)(ns,this).get(t)}addEditor(t){(0,St.A)(ns,this).set(t.id,t)}removeEditor(t){var e;(t.div.contains(document.activeElement)&&((0,St.A)(As,this)&&clearTimeout((0,St.A)(As,this)),(0,Mt.A)(As,this,setTimeout(()=>{this.focusMainContainer(),(0,Mt.A)(As,this,null)},0))),(0,St.A)(ns,this).delete(t.id),this.unselect(t),t.annotationElementId&&(0,St.A)(hs,this).has(t.annotationElementId))||(null===(e=(0,St.A)(as,this))||void 0===e||e.remove(t.id))}addDeletedAnnotationElement(t){(0,St.A)(hs,this).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return(0,St.A)(hs,this).has(t)}removeDeletedAnnotationElement(t){(0,St.A)(hs,this).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){(0,St.A)(is,this)!==t&&((0,Mt.A)(is,this,t),t&&(0,xt.A)(Xs,this,lr).call(this,t.propertiesToUpdate))}updateUI(t){Et(Xs,this,ur)===t&&(0,xt.A)(Xs,this,lr).call(this,t.propertiesToUpdate)}toggleSelected(t){if((0,St.A)(Ss,this).has(t))return(0,St.A)(Ss,this).delete(t),t.unselect(),void(0,xt.A)(Xs,this,or).call(this,{hasSelectedEditor:this.hasSelection});(0,St.A)(Ss,this).add(t),t.select(),(0,xt.A)(Xs,this,lr).call(this,t.propertiesToUpdate),(0,xt.A)(Xs,this,or).call(this,{hasSelectedEditor:!0})}setSelected(t){for(const e of(0,St.A)(Ss,this))e!==t&&e.unselect();(0,St.A)(Ss,this).clear(),(0,St.A)(Ss,this).add(t),t.select(),(0,xt.A)(Xs,this,lr).call(this,t.propertiesToUpdate),(0,xt.A)(Xs,this,or).call(this,{hasSelectedEditor:!0})}isSelected(t){return(0,St.A)(Ss,this).has(t)}get firstSelectedEditor(){return(0,St.A)(Ss,this).values().next().value}unselect(t){t.unselect(),(0,St.A)(Ss,this).delete(t),(0,xt.A)(Xs,this,or).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==(0,St.A)(Ss,this).size}get isEnterHandled(){return 1===(0,St.A)(Ss,this).size&&this.firstSelectedEditor.isEnterHandled}undo(){(0,St.A)(ls,this).undo(),(0,xt.A)(Xs,this,or).call(this,{hasSomethingToUndo:(0,St.A)(ls,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:(0,xt.A)(Xs,this,pr).call(this)})}redo(){(0,St.A)(ls,this).redo(),(0,xt.A)(Xs,this,or).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:(0,St.A)(ls,this).hasSomethingToRedo(),isEmpty:(0,xt.A)(Xs,this,pr).call(this)})}addCommands(t){(0,St.A)(ls,this).add(t),(0,xt.A)(Xs,this,or).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:(0,xt.A)(Xs,this,pr).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...(0,St.A)(Ss,this)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)(0,xt.A)(Xs,this,dr).call(this,e)},mustExec:!0})}commitOrRemove(){var t;null===(t=(0,St.A)(is,this))||void 0===t||t.commitOrRemove()}hasSomethingToControl(){return(0,St.A)(is,this)||this.hasSelection}selectAll(){for(const t of(0,St.A)(Ss,this))t.commit();(0,xt.A)(Xs,this,fr).call(this,(0,St.A)(ns,this).values())}unselectAll(){if((!(0,St.A)(is,this)||((0,St.A)(is,this).commitOrRemove(),(0,St.A)(Cs,this)===ie.NONE))&&this.hasSelection){for(const t of(0,St.A)(Ss,this))t.unselect();(0,St.A)(Ss,this).clear(),(0,xt.A)(Xs,this,or).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;(0,St.A)(Us,this)[0]+=t,(0,St.A)(Us,this)[1]+=e;const[i,n]=(0,St.A)(Us,this),s=[...(0,St.A)(Ss,this)];(0,St.A)(Vs,this)&&clearTimeout((0,St.A)(Vs,this)),(0,Mt.A)(Vs,this,setTimeout(()=>{(0,Mt.A)(Vs,this,null),(0,St.A)(Us,this)[0]=(0,St.A)(Us,this)[1]=0,this.addCommands({cmd:()=>{for(const t of s)(0,St.A)(ns,this).has(t.id)&&t.translateInPage(i,n)},undo:()=>{for(const t of s)(0,St.A)(ns,this).has(t.id)&&t.translateInPage(-i,-n)},mustExec:!1})},1e3));for(const r of s)r.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),(0,Mt.A)(ds,this,new Map);for(const t of(0,St.A)(Ss,this))(0,St.A)(ds,this).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!(0,St.A)(ds,this))return!1;this.disableUserSelect(!1);const t=(0,St.A)(ds,this);(0,Mt.A)(ds,this,null);let e=!1;for(const[{x:n,y:s,pageIndex:r},a]of t)a.newX=n,a.newY=s,a.newPageIndex=r,e||(e=n!==a.savedX||s!==a.savedY||r!==a.savedPageIndex);if(!e)return!1;const i=(t,e,i,n)=>{if((0,St.A)(ns,this).has(t.id)){const s=(0,St.A)(ss,this).get(n);s?t._setParentAndPosition(s,e,i):(t.pageIndex=n,t.x=e,t.y=i)}};return this.addCommands({cmd:()=>{for(const[e,{newX:n,newY:s,newPageIndex:r}]of t)i(e,n,s,r)},undo:()=>{for(const[e,{savedX:n,savedY:s,savedPageIndex:r}]of t)i(e,n,s,r)},mustExec:!0}),!0}dragSelectedEditors(t,e){if((0,St.A)(ds,this))for(const i of(0,St.A)(ds,this).keys())i.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return(null===(t=this.getActive())||void 0===t?void 0:t.shouldGetKeyboardEvents())||1===(0,St.A)(Ss,this).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return(0,St.A)(is,this)===t}getActive(){return(0,St.A)(is,this)}getMode(){return(0,St.A)(Cs,this)}get imageManager(){return Xe(this,"imageManager",new Vn)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let l=0,c=e.rangeCount;l<c;l++)if(!t.contains(e.getRangeAt(l).commonAncestorContainer))return null;const{x:i,y:n,width:s,height:r}=t.getBoundingClientRect();let a;switch(t.getAttribute("data-main-rotation")){case"90":a=(t,e,a,o)=>({x:(e-n)/r,y:1-(t+a-i)/s,width:o/r,height:a/s});break;case"180":a=(t,e,a,o)=>({x:1-(t+a-i)/s,y:1-(e+o-n)/r,width:a/s,height:o/r});break;case"270":a=(t,e,a,o)=>({x:1-(e+o-n)/r,y:(t-i)/s,width:o/r,height:a/s});break;default:a=(t,e,a,o)=>({x:(t-i)/s,y:(e-n)/r,width:a/s,height:o/r})}const o=[];for(let l=0,c=e.rangeCount;l<c;l++){const t=e.getRangeAt(l);if(!t.collapsed)for(const{x:e,y:i,width:n,height:s}of t.getClientRects())0!==n&&0!==s&&o.push(a(e,i,n,s))}return 0===o.length?null:o}addChangedExistingAnnotation(t){let{annotationElementId:e,id:i}=t;((0,St.A)(os,this)||(0,Mt.A)(os,this,new Map)).set(e,i)}removeChangedExistingAnnotation(t){var e;let{annotationElementId:i}=t;null===(e=(0,St.A)(os,this))||void 0===e||e.delete(i)}renderAnnotationElement(t){var e;const i=null===(e=(0,St.A)(os,this))||void 0===e?void 0:e.get(t.data.id);if(!i)return;const n=(0,St.A)(as,this).getRawValue(i);n&&((0,St.A)(Cs,this)!==ie.NONE||n.hasBeenModified)&&n.renderAnnotationElement(t)}}function Ks(t){let{anchorNode:e}=t;return e.nodeType===Node.TEXT_NODE?e.parentElement:e}function Qs(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=(0,xt.A)(Xs,this,Ks).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&((0,St.A)(bs,this)||(0,Mt.A)(bs,this,new Fn(this)),(0,St.A)(bs,this).show(e,i,"ltr"===this.direction))}function Zs(){var t;const e=document.getSelection();if(!e||e.isCollapsed){var i;if((0,St.A)(Ms,this))null===(i=(0,St.A)(bs,this))||void 0===i||i.hide(),(0,Mt.A)(Ms,this,null),(0,xt.A)(Xs,this,or).call(this,{hasSelectedText:!1});return}const{anchorNode:n}=e;if(n===(0,St.A)(Ms,this))return;var s;if((0,xt.A)(Xs,this,Ks).call(this,e).closest(".textLayer")){if(null===(t=(0,St.A)(bs,this))||void 0===t||t.hide(),(0,Mt.A)(Ms,this,n),(0,xt.A)(Xs,this,or).call(this,{hasSelectedText:!0}),((0,St.A)(Cs,this)===ie.HIGHLIGHT||(0,St.A)(Cs,this)===ie.NONE)&&((0,St.A)(Cs,this)===ie.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),(0,Mt.A)(vs,this,this.isShiftKeyDown),!this.isShiftKeyDown)){const t=this._signal,e=t=>{"pointerup"===t.type&&0!==t.button||(window.removeEventListener("pointerup",e),window.removeEventListener("blur",e),"pointerup"===t.type&&(0,xt.A)(Xs,this,Js).call(this,"main_toolbar"))};window.addEventListener("pointerup",e,{signal:t}),window.addEventListener("blur",e,{signal:t})}}else(0,St.A)(Ms,this)&&(null===(s=(0,St.A)(bs,this))||void 0===s||s.hide(),(0,Mt.A)(Ms,this,null),(0,xt.A)(Xs,this,or).call(this,{hasSelectedText:!1}))}function Js(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";(0,St.A)(Cs,this)===ie.HIGHLIGHT?this.highlightSelection(t):(0,St.A)(fs,this)&&(0,xt.A)(Xs,this,Qs).call(this)}function $s(){document.addEventListener("selectionchange",(0,xt.A)(Xs,this,Zs).bind(this),{signal:this._signal})}function tr(){const t=this._signal;window.addEventListener("focus",(0,St.A)(Ps,this),{signal:t}),window.addEventListener("blur",(0,St.A)(Rs,this),{signal:t})}function er(){window.removeEventListener("focus",(0,St.A)(Ps,this)),window.removeEventListener("blur",(0,St.A)(Rs,this))}function ir(){const t=this._signal;window.addEventListener("keydown",(0,St.A)(Os,this),{signal:t}),window.addEventListener("keyup",(0,St.A)(Ns,this),{signal:t})}function nr(){window.removeEventListener("keydown",(0,St.A)(Os,this)),window.removeEventListener("keyup",(0,St.A)(Ns,this))}function sr(){const t=this._signal;document.addEventListener("copy",(0,St.A)(Fs,this),{signal:t}),document.addEventListener("cut",(0,St.A)(Is,this),{signal:t}),document.addEventListener("paste",(0,St.A)(Ds,this),{signal:t})}function rr(){document.removeEventListener("copy",(0,St.A)(Fs,this)),document.removeEventListener("cut",(0,St.A)(Is,this)),document.removeEventListener("paste",(0,St.A)(Ds,this))}function ar(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}function or(t){Object.entries(t).some(t=>{let[e,i]=t;return(0,St.A)(zs,this)[e]!==i})&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign((0,St.A)(zs,this),t)}),(0,St.A)(Cs,this)===ie.HIGHLIGHT&&!1===t.hasSelectedEditor&&(0,xt.A)(Xs,this,lr).call(this,[[ne.HIGHLIGHT_FREE,!0]]))}function lr(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}function cr(){if(!(0,St.A)(ys,this)){(0,Mt.A)(ys,this,!0);for(const t of(0,St.A)(ss,this).values())t.enable();for(const t of(0,St.A)(ns,this).values())t.enable()}}function hr(){if(this.unselectAll(),(0,St.A)(ys,this)){(0,Mt.A)(ys,this,!1);for(const t of(0,St.A)(ss,this).values())t.disable();for(const t of(0,St.A)(ns,this).values())t.disable()}}function dr(t){const e=(0,St.A)(ss,this).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}function ur(t){let e=null;for(e of(0,St.A)(Ss,t));return e}function pr(){if(0===(0,St.A)(ns,this).size)return!0;if(1===(0,St.A)(ns,this).size)for(const t of(0,St.A)(ns,this).values())return t.isEmpty();return!1}function fr(t){for(const e of(0,St.A)(Ss,this))e.unselect();(0,St.A)(Ss,this).clear();for(const e of t)e.isEmpty()||((0,St.A)(Ss,this).add(e),e.select());(0,xt.A)(Xs,this,or).call(this,{hasSelectedEditor:this.hasSelection})}(0,kt.A)(Ys,"TRANSLATE_SMALL",1),(0,kt.A)(Ys,"TRANSLATE_BIG",10);var gr=new WeakMap,Ar=new WeakMap,mr=new WeakMap,vr=new WeakMap,br=new WeakMap,wr=new WeakMap,yr=new WeakMap,_r=new WeakSet;class xr{constructor(t){(0,_t.A)(this,_r),(0,Ct.A)(this,gr,""),(0,Ct.A)(this,Ar,!1),(0,Ct.A)(this,mr,null),(0,Ct.A)(this,vr,null),(0,Ct.A)(this,br,null),(0,Ct.A)(this,wr,!1),(0,Ct.A)(this,yr,null),(0,Mt.A)(yr,this,t)}static initialize(t){xr._l10nPromise||(xr._l10nPromise=t)}async render(){const t=(0,Mt.A)(mr,this,document.createElement("button"));t.className="altText";const e=await xr._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0";const i=(0,St.A)(yr,this)._uiManager._signal;t.addEventListener("contextmenu",ln,{signal:i}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=t=>{t.preventDefault(),(0,St.A)(yr,this)._uiManager.editAltText((0,St.A)(yr,this))};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&((0,Mt.A)(wr,this,!0),n(e))},{signal:i}),await(0,xt.A)(_r,this,Er).call(this),t}finish(){(0,St.A)(mr,this)&&((0,St.A)(mr,this).focus({focusVisible:(0,St.A)(wr,this)}),(0,Mt.A)(wr,this,!1))}isEmpty(){return!(0,St.A)(gr,this)&&!(0,St.A)(Ar,this)}get data(){return{altText:(0,St.A)(gr,this),decorative:(0,St.A)(Ar,this)}}set data(t){let{altText:e,decorative:i}=t;(0,St.A)(gr,this)===e&&(0,St.A)(Ar,this)===i||((0,Mt.A)(gr,this,e),(0,Mt.A)(Ar,this,i),(0,xt.A)(_r,this,Er).call(this))}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,St.A)(mr,this)&&(!t&&(0,St.A)(br,this)&&(clearTimeout((0,St.A)(br,this)),(0,Mt.A)(br,this,null)),(0,St.A)(mr,this).disabled=!t)}destroy(){var t;null===(t=(0,St.A)(mr,this))||void 0===t||t.remove(),(0,Mt.A)(mr,this,null),(0,Mt.A)(vr,this,null)}}async function Er(){const t=(0,St.A)(mr,this);if(!t)return;var e;if(!(0,St.A)(gr,this)&&!(0,St.A)(Ar,this))return t.classList.remove("done"),void(null===(e=(0,St.A)(vr,this))||void 0===e||e.remove());t.classList.add("done"),Ft._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(e=>{t.setAttribute("aria-label",e)});let i=(0,St.A)(vr,this);if(!i){(0,Mt.A)(vr,this,i=document.createElement("span")),i.className="tooltip",i.setAttribute("role","tooltip");const e=i.id="alt-text-tooltip-".concat((0,St.A)(yr,this).id);t.setAttribute("aria-describedby",e);const n=100,s=(0,St.A)(yr,this)._uiManager._signal;s.addEventListener("abort",()=>{clearTimeout((0,St.A)(br,this)),(0,Mt.A)(br,this,null)},{once:!0}),t.addEventListener("mouseenter",()=>{(0,Mt.A)(br,this,setTimeout(()=>{(0,Mt.A)(br,this,null),(0,St.A)(vr,this).classList.add("show"),(0,St.A)(yr,this)._reportTelemetry({action:"alt_text_tooltip"})},n))},{signal:s}),t.addEventListener("mouseleave",()=>{var t;(0,St.A)(br,this)&&(clearTimeout((0,St.A)(br,this)),(0,Mt.A)(br,this,null)),null===(t=(0,St.A)(vr,this))||void 0===t||t.classList.remove("show")},{signal:s})}i.innerText=(0,St.A)(Ar,this)?await Ft._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):(0,St.A)(gr,this),i.parentNode||t.append(i);const n=(0,St.A)(yr,this).getImageForAltText();null===n||void 0===n||n.setAttribute("aria-describedby",i.id)}Ft=xr,(0,kt.A)(xr,"_l10nPromise",null);var kr=new WeakMap,Cr=new WeakMap,Sr=new WeakMap,Mr=new WeakMap,Lr=new WeakMap,Tr=new WeakMap,Rr=new WeakMap,Pr=new WeakMap,Fr=new WeakMap,Ir=new WeakMap,Dr=new WeakMap,Or=new WeakMap,Nr=new WeakMap,Wr=new WeakMap,jr=new WeakMap,Br=new WeakMap,Hr=new WeakMap,zr=new WeakMap,Ur=new WeakMap,Vr=new WeakMap,Gr=new WeakMap,qr=new WeakMap,Xr=new WeakSet;class Yr{static get _resizerKeyboardManager(){const t=Yr.prototype._resizeWithKeyboard,e=Ys.TRANSLATE_SMALL,i=Ys.TRANSLATE_BIG;return Xe(this,"_resizerKeyboardManager",new Jn([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],Yr.prototype._stopResizingWithKeyboard]]))}constructor(t){(0,_t.A)(this,Xr),(0,Ct.A)(this,kr,null),(0,Ct.A)(this,Cr,null),(0,Ct.A)(this,Sr,null),(0,Ct.A)(this,Mr,!1),(0,Ct.A)(this,Lr,!1),(0,Ct.A)(this,Tr,null),(0,Ct.A)(this,Rr,null),(0,Ct.A)(this,Pr,this.focusin.bind(this)),(0,Ct.A)(this,Fr,this.focusout.bind(this)),(0,Ct.A)(this,Ir,null),(0,Ct.A)(this,Dr,""),(0,Ct.A)(this,Or,!1),(0,Ct.A)(this,Nr,null),(0,Ct.A)(this,Wr,!1),(0,Ct.A)(this,jr,!1),(0,Ct.A)(this,Br,!1),(0,Ct.A)(this,Hr,null),(0,Ct.A)(this,zr,0),(0,Ct.A)(this,Ur,0),(0,Ct.A)(this,Vr,null),(0,kt.A)(this,"_initialOptions",Object.create(null)),(0,kt.A)(this,"_isVisible",!0),(0,kt.A)(this,"_uiManager",null),(0,kt.A)(this,"_focusEventsAllowed",!0),(0,kt.A)(this,"_l10nPromise",null),(0,Ct.A)(this,Gr,!1),(0,Ct.A)(this,qr,Yr._zIndex++),this.constructor===Yr&&Ve("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,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:r}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[s,r];const[a,o]=this.parentDimensions;this.x=t.x/a,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return Xe(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new ca({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e,i){if(Yr._l10nPromise||(Yr._l10nPromise=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(e=>[e,t.get(e.replaceAll(/([A-Z])/g,t=>"-".concat(t.toLowerCase())))]))),null!==i&&void 0!==i&&i.strings)for(const s of i.strings)Yr._l10nPromise.set(s,t.get(s));if(-1!==Yr._borderLineWidth)return;const n=getComputedStyle(document.documentElement);Yr._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Ve("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return(0,St.A)(Gr,this)}set _isDraggable(t){var e;(0,Mt.A)(Gr,this,t),null===(e=this.div)||void 0===e||e.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=(0,St.A)(qr,this)}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(0,xt.A)(Xr,this,la).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&((0,St.A)(Or,this)?(0,Mt.A)(Or,this,!1):this.parent.setSelected(this))}focusout(t){var e;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const i=t.relatedTarget;null!==i&&void 0!==i&&i.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)}setAt(t,e,i,n){const[s,r]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/s,this.y=(e+n)/r,this.fixAndSetPosition()}translate(t,e){(0,xt.A)(Xr,this,Kr).call(this,this.parentDimensions,t,e)}translateInPage(t,e){(0,St.A)(Nr,this)||(0,Mt.A)(Nr,this,[this.x,this.y]),(0,xt.A)(Xr,this,Kr).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){(0,St.A)(Nr,this)||(0,Mt.A)(Nr,this,[this.x,this.y]);const[i,n]=this.parentDimensions;if(this.x+=t/i,this.y+=e/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:r}=this;const[a,o]=this.getBaseTranslation();s+=a,r+=o,this.div.style.left="".concat((100*s).toFixed(2),"%"),this.div.style.top="".concat((100*r).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!(0,St.A)(Nr,this)&&((0,St.A)(Nr,this)[0]!==this.x||(0,St.A)(Nr,this)[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=Yr,n=i/t,s=i/e;switch(this.rotation){case 90:return[-n,s];case 180:return[n,s];case 270:return[n,-s];default:return[-n,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rotation;const[e,i]=this.pageDimensions;let{x:n,y:s,width:r,height:a}=this;if(r*=e,a*=i,n*=e,s*=i,this._mustFixPosition)switch(t){case 0:n=Math.max(0,Math.min(e-r,n)),s=Math.max(0,Math.min(i-a,s));break;case 90:n=Math.max(0,Math.min(e-a,n)),s=Math.min(i,Math.max(r,s));break;case 180:n=Math.min(e,Math.max(r,n)),s=Math.min(i,Math.max(a,s));break;case 270:n=Math.min(e,Math.max(a,n)),s=Math.max(0,Math.min(i-r,s))}this.x=n/=e,this.y=s/=i;const[o,l]=this.getBaseTranslation();n+=o,s+=l;const{style:c}=this.div;c.left="".concat((100*n).toFixed(2),"%"),c.top="".concat((100*s).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(t,e){return Qr.call(Yr,t,e,this.parentRotation)}pageTranslationToScreen(t,e){return Qr.call(Yr,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this,n=e*t,s=i*t;return ri.isCSSRoundSupported?[Math.round(n),Math.round(s)]:[n,s]}setDims(t,e){const[i,n]=this.parentDimensions;this.div.style.width="".concat((100*t/i).toFixed(2),"%"),(0,St.A)(Lr,this)||(this.div.style.height="".concat((100*e/n).toFixed(2),"%"))}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,n=i.endsWith("%"),s=!(0,St.A)(Lr,this)&&e.endsWith("%");if(n&&s)return;const[r,a]=this.parentDimensions;n||(t.width="".concat((100*parseFloat(i)/r).toFixed(2),"%")),(0,St.A)(Lr,this)||s||(t.height="".concat((100*parseFloat(e)/a).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}altTextFinish(){var t;null===(t=(0,St.A)(Sr,this))||void 0===t||t.finish()}async addEditToolbar(){return(0,St.A)(Ir,this)||(0,St.A)(jr,this)||((0,Mt.A)(Ir,this,new _n(this)),this.div.append((0,St.A)(Ir,this).render()),(0,St.A)(Sr,this)&&(0,St.A)(Ir,this).addAltTextButton(await(0,St.A)(Sr,this).render())),(0,St.A)(Ir,this)}removeEditToolbar(){var t;(0,St.A)(Ir,this)&&((0,St.A)(Ir,this).remove(),(0,Mt.A)(Ir,this,null),null===(t=(0,St.A)(Sr,this))||void 0===t||t.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){(0,St.A)(Sr,this)||(xr.initialize(Yr._l10nPromise),(0,Mt.A)(Sr,this,new xr(this)),(0,St.A)(kr,this)&&((0,St.A)(Sr,this).data=(0,St.A)(kr,this),(0,Mt.A)(kr,this,null)),await this.addEditToolbar())}get altTextData(){var t;return null===(t=(0,St.A)(Sr,this))||void 0===t?void 0:t.data}set altTextData(t){(0,St.A)(Sr,this)&&((0,St.A)(Sr,this).data=t)}hasAltText(){var t;return!(null!==(t=(0,St.A)(Sr,this))&&void 0!==t&&t.isEmpty())}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.tabIndex=(0,St.A)(Mr,this)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",(0,St.A)(Pr,this),{signal:t}),this.div.addEventListener("focusout",(0,St.A)(Fr,this),{signal:t});const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*i/e).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*e/i).toFixed(2),"%"));const[n,s]=this.getInitialTranslation();return this.translate(n,s),Nn(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=ri.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():((0,Mt.A)(Or,this,!0),this._isDraggable?(0,xt.A)(Xr,this,na).call(this,t):(0,xt.A)(Xr,this,ia).call(this,t))}moveInDOM(){(0,St.A)(Hr,this)&&clearTimeout((0,St.A)(Hr,this)),(0,Mt.A)(Hr,this,setTimeout(()=>{var t;(0,Mt.A)(Hr,this,null),null===(t=this.parent)||void 0===t||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}getRect(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rotation;const n=this.parentScale,[s,r]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/n,c=e/n,h=this.x*s,d=this.y*r,u=this.width*s,p=this.height*r;switch(i){case 0:return[h+l+a,r-d-c-p+o,h+l+u+a,r-d-c+o];case 90:return[h+c+a,r-d+l+o,h+c+p+a,r-d+l+u+o];case 180:return[h-l-u+a,r-d+c+o,h-l+a,r-d+c+p+o];case 270:return[h-c-p+a,r-d-l-u+o,h-c+a,r-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,s,r]=t,a=s-i,o=r-n;switch(this.rotation){case 0:return[i,e-r,a,o];case 90:return[i,e-n,o,a];case 180:return[s,e-n,a,o];case 270:return[s,e-r,o,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){(0,Mt.A)(jr,this,!0)}disableEditMode(){(0,Mt.A)(jr,this,!1)}isInEditMode(){return(0,St.A)(jr,this)}shouldGetKeyboardEvents(){return(0,St.A)(Br,this)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t,e;const i=this._uiManager._signal;null===(t=this.div)||void 0===t||t.addEventListener("focusin",(0,St.A)(Pr,this),{signal:i}),null===(e=this.div)||void 0===e||e.addEventListener("focusout",(0,St.A)(Fr,this),{signal:i})}rotate(t){}serialize(){Ve("An editor must be serializable")}static deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});n.rotation=t.rotation,(0,Mt.A)(kr,n,t.accessibilityData);const[s,r]=n.pageDimensions,[a,o,l,c]=n.getRectInCurrentCoords(t.rect,r);return n.x=a/s,n.y=o/r,n.width=l/s,n.height=c/r,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",(0,St.A)(Pr,this)),this.div.removeEventListener("focusout",(0,St.A)(Fr,this)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(0,St.A)(Hr,this)&&(clearTimeout((0,St.A)(Hr,this)),(0,Mt.A)(Hr,this,null)),(0,xt.A)(Xr,this,la).call(this),this.removeEditToolbar(),(0,St.A)(Vr,this)){for(const t of(0,St.A)(Vr,this).values())clearTimeout(t);(0,Mt.A)(Vr,this,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&((0,xt.A)(Xr,this,Jr).call(this),(0,St.A)(Tr,this).classList.remove("hidden"),Nn(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),(0,Mt.A)(Rr,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=(0,St.A)(Tr,this).children;if(!(0,St.A)(Cr,this)){(0,Mt.A)(Cr,this,Array.from(e));const t=(0,xt.A)(Xr,this,sa).bind(this),i=(0,xt.A)(Xr,this,ra).bind(this),n=this._uiManager._signal;for(const e of(0,St.A)(Cr,this)){const s=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:n}),e.addEventListener("blur",i,{signal:n}),e.addEventListener("focus",(0,xt.A)(Xr,this,aa).bind(this,s),{signal:n}),Yr._l10nPromise.get("pdfjs-editor-resizer-label-".concat(s)).then(t=>e.setAttribute("aria-label",t))}}const i=(0,St.A)(Cr,this)[0];let n=0;for(const r of e){if(r===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*((0,St.A)(Cr,this).length/4);if(s!==n){if(s<n)for(let e=0;e<n-s;e++)(0,St.A)(Tr,this).append((0,St.A)(Tr,this).firstChild);else if(s>n)for(let e=0;e<s-n;e++)(0,St.A)(Tr,this).firstChild.before((0,St.A)(Tr,this).lastChild);let t=0;for(const i of e){const e=(0,St.A)(Cr,this)[t++].getAttribute("data-resizer-name");Yr._l10nPromise.get("pdfjs-editor-resizer-label-".concat(e)).then(t=>i.setAttribute("aria-label",t))}}(0,xt.A)(Xr,this,oa).call(this,0),(0,Mt.A)(Br,this,!0),(0,St.A)(Tr,this).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){(0,St.A)(Br,this)&&(0,xt.A)(Xr,this,ea).call(this,(0,St.A)(Dr,this),{movementX:t,movementY:e})}_stopResizingWithKeyboard(){(0,xt.A)(Xr,this,la).call(this),this.div.focus()}select(){var t,e;this.makeResizable(),null===(t=this.div)||void 0===t||t.classList.add("selectedEditor"),(0,St.A)(Ir,this)?null===(e=(0,St.A)(Ir,this))||void 0===e||e.show():this.addEditToolbar().then(()=>{var t,e;null!==(t=this.div)&&void 0!==t&&t.classList.contains("selectedEditor")&&(null===(e=(0,St.A)(Ir,this))||void 0===e||e.show())})}unselect(){var t,e,i,n;null===(t=(0,St.A)(Tr,this))||void 0===t||t.classList.add("hidden"),null===(e=this.div)||void 0===e||e.classList.remove("selectedEditor"),null!==(i=this.div)&&void 0!==i&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null===(n=(0,St.A)(Ir,this))||void 0===n||n.hide()}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return(0,St.A)(Wr,this)}set isEditing(t){(0,Mt.A)(Wr,this,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){(0,Mt.A)(Lr,this,!0);const i=t/e,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){(0,St.A)(Vr,this)||(0,Mt.A)(Vr,this,new Map);const{action:e}=t;let i=(0,St.A)(Vr,this).get(e);return i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),(0,St.A)(Vr,this).delete(e),0===(0,St.A)(Vr,this).size&&(0,Mt.A)(Vr,this,null)},Yr._telemetryTimeout),void(0,St.A)(Vr,this).set(e,i)}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),(0,Mt.A)(Mr,this,!1)}disable(){this.div&&(this.div.tabIndex=-1),(0,Mt.A)(Mr,this,!0)}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===e.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}function Kr(t,e,i){let[n,s]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/s,this.fixAndSetPosition()}function Qr(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}function Zr(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}function Jr(){if((0,St.A)(Tr,this))return;(0,Mt.A)(Tr,this,document.createElement("div")),(0,St.A)(Tr,this).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const t=document.createElement("div");(0,St.A)(Tr,this).append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",(0,xt.A)(Xr,this,$r).bind(this,i),{signal:e}),t.addEventListener("contextmenu",ln,{signal:e}),t.tabIndex=-1}this.div.prepend((0,St.A)(Tr,this))}function $r(t,e){var i;e.preventDefault();const{isMac:n}=ri.platform;if(0!==e.button||e.ctrlKey&&n)return;null===(i=(0,St.A)(Sr,this))||void 0===i||i.toggle(!1);const s=(0,xt.A)(Xr,this,ea).bind(this,t),r=this._isDraggable;this._isDraggable=!1;const a=this._uiManager._signal,o={passive:!0,capture:!0,signal:a};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",s,o),window.addEventListener("contextmenu",ln,{signal:a});const l=this.x,c=this.y,h=this.width,d=this.height,u=this.parent.div.style.cursor,p=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const f=()=>{var t;this.parent.togglePointerEvents(!0),null===(t=(0,St.A)(Sr,this))||void 0===t||t.toggle(!0),this._isDraggable=r,window.removeEventListener("pointerup",f),window.removeEventListener("blur",f),window.removeEventListener("pointermove",s,o),window.removeEventListener("contextmenu",ln),this.parent.div.style.cursor=u,this.div.style.cursor=p,(0,xt.A)(Xr,this,ta).call(this,l,c,h,d)};window.addEventListener("pointerup",f,{signal:a}),window.addEventListener("blur",f,{signal:a})}function ta(t,e,i,n){const s=this.x,r=this.y,a=this.width,o=this.height;s===t&&r===e&&a===i&&o===n||this.addCommands({cmd:()=>{this.width=a,this.height=o,this.x=s,this.y=r;const[t,e]=this.parentDimensions;this.setDims(t*a,e*o),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=n,this.x=t,this.y=e;const[s,r]=this.parentDimensions;this.setDims(s*i,r*n),this.fixAndSetPosition()},mustExec:!0})}function ea(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,o=this.height,l=It.MIN_SIZE/i,c=It.MIN_SIZE/n,h=t=>Math.round(1e4*t)/1e4,d=(0,xt.A)(Xr,this,Zr).call(this,this.rotation),u=(t,e)=>[d[0]*t+d[2]*e,d[1]*t+d[3]*e],p=(0,xt.A)(Xr,this,Zr).call(this,360-this.rotation);let f,g,A=!1,m=!1;switch(t){case"topLeft":A=!0,f=(t,e)=>[0,0],g=(t,e)=>[t,e];break;case"topMiddle":f=(t,e)=>[t/2,0],g=(t,e)=>[t/2,e];break;case"topRight":A=!0,f=(t,e)=>[t,0],g=(t,e)=>[0,e];break;case"middleRight":m=!0,f=(t,e)=>[t,e/2],g=(t,e)=>[0,e/2];break;case"bottomRight":A=!0,f=(t,e)=>[t,e],g=(t,e)=>[0,0];break;case"bottomMiddle":f=(t,e)=>[t/2,e],g=(t,e)=>[t/2,0];break;case"bottomLeft":A=!0,f=(t,e)=>[0,e],g=(t,e)=>[t,0];break;case"middleLeft":m=!0,f=(t,e)=>[0,e/2],g=(t,e)=>[t,e/2]}const v=f(a,o),b=g(a,o);let w=u(...b);const y=h(s+w[0]),_=h(r+w[1]);let x=1,E=1,[k,C]=this.screenToPageTranslation(e.movementX,e.movementY);var S,M;if([k,C]=(S=k/i,M=C/n,[p[0]*S+p[2]*M,p[1]*S+p[3]*M]),A){const t=Math.hypot(a,o);x=E=Math.max(Math.min(Math.hypot(b[0]-v[0]-k,b[1]-v[1]-C)/t,1/a,1/o),l/a,c/o)}else m?x=Math.max(l,Math.min(1,Math.abs(b[0]-v[0]-k)))/a:E=Math.max(c,Math.min(1,Math.abs(b[1]-v[1]-C)))/o;const L=h(a*x),T=h(o*E);w=u(...g(L,T));const R=y-w[0],P=_-w[1];this.width=L,this.height=T,this.x=R,this.y=P,this.setDims(i*L,n*T),this.fixAndSetPosition()}function ia(t){const{isMac:e}=ri.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}function na(t){const e=this._uiManager.isSelected(this);let i,n;this._uiManager.setUpDragSession();const s=this._uiManager._signal;e&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:s},(0,Mt.A)(zr,this,t.clientX),(0,Mt.A)(Ur,this,t.clientY),n=t=>{const{clientX:e,clientY:i}=t,[n,s]=this.screenToPageTranslation(e-(0,St.A)(zr,this),i-(0,St.A)(Ur,this));(0,Mt.A)(zr,this,e),(0,Mt.A)(Ur,this,i),this._uiManager.dragSelectedEditors(n,s)},window.addEventListener("pointermove",n,i));const r=()=>{window.removeEventListener("pointerup",r),window.removeEventListener("blur",r),e&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",n,i)),(0,Mt.A)(Or,this,!1),this._uiManager.endDragSession()||(0,xt.A)(Xr,this,ia).call(this,t)};window.addEventListener("pointerup",r,{signal:s}),window.addEventListener("blur",r,{signal:s})}function sa(t){It._resizerKeyboardManager.exec(this,t)}function ra(t){var e;(0,St.A)(Br,this)&&(null===(e=t.relatedTarget)||void 0===e?void 0:e.parentNode)!==(0,St.A)(Tr,this)&&(0,xt.A)(Xr,this,la).call(this)}function aa(t){(0,Mt.A)(Dr,this,(0,St.A)(Br,this)?t:"")}function oa(t){if((0,St.A)(Cr,this))for(const e of(0,St.A)(Cr,this))e.tabIndex=t}function la(){if((0,Mt.A)(Br,this,!1),(0,xt.A)(Xr,this,oa).call(this,-1),(0,St.A)(Rr,this)){const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=(0,St.A)(Rr,this);(0,xt.A)(Xr,this,ta).call(this,t,e,i,n),(0,Mt.A)(Rr,this,null)}}It=Yr,(0,kt.A)(Yr,"_borderLineWidth",-1),(0,kt.A)(Yr,"_colorManager",new ts),(0,kt.A)(Yr,"_zIndex",1),(0,kt.A)(Yr,"_telemetryTimeout",1e3);class ca extends Yr{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const ha=3285377520,da=4294901760,ua=65535;class pa{constructor(t){this.h1=t?4294967295&t:ha,this.h2=t?4294967295&t:ha}update(t){let e,i;if("string"===typeof t){e=new Uint8Array(2*t.length),i=0;for(let n=0,s=t.length;n<s;n++){const s=t.charCodeAt(n);s<=255?e[i++]=s:(e[i++]=s>>>8,e[i++]=255&s)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),i=e.byteLength}const n=i>>2,s=i-4*n,r=new Uint32Array(e.buffer,0,n);let a=0,o=0,l=this.h1,c=this.h2;const h=3432918353,d=461845907,u=11601,p=13715;for(let f=0;f<n;f++)1&f?(a=r[f],a=a*h&da|a*u&ua,a=a<<15|a>>>17,a=a*d&da|a*p&ua,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=r[f],o=o*h&da|o*u&ua,o=o<<15|o>>>17,o=o*d&da|o*p&ua,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(a=0,s){case 3:a^=e[4*n+2]<<16;case 2:a^=e[4*n+1]<<8;case 1:a^=e[4*n],a=a*h&da|a*u&ua,a=a<<15|a>>>17,a=a*d&da|a*p&ua,1&n?l^=a:c^=a}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&da|36045*t&ua,e=4283543511*e&da|(2950163797*(e<<16|t>>>16)&da)>>>16,t^=e>>>1,t=444984403*t&da|60499*t&ua,e=3301882366*e&da|(3120437893*(e<<16|t>>>16)&da)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const fa=Object.freeze({map:null,hash:"",transfer:void 0});var ga=new WeakMap,Aa=new WeakMap,ma=new WeakSet;class va{constructor(){(0,_t.A)(this,ma),(0,Ct.A)(this,ga,!1),(0,Ct.A)(this,Aa,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=(0,St.A)(Aa,this).get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return(0,St.A)(Aa,this).get(t)}remove(t){if((0,St.A)(Aa,this).delete(t),0===(0,St.A)(Aa,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const t of(0,St.A)(Aa,this).values())if(t instanceof Yr)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=(0,St.A)(Aa,this).get(t);let n=!1;if(void 0!==i)for(const[s,r]of Object.entries(e))i[s]!==r&&(n=!0,i[s]=r);else n=!0,(0,St.A)(Aa,this).set(t,e);n&&(0,xt.A)(ma,this,ba).call(this),e instanceof Yr&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return(0,St.A)(Aa,this).has(t)}getAll(){return(0,St.A)(Aa,this).size>0?si((0,St.A)(Aa,this)):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return(0,St.A)(Aa,this).size}resetModified(){(0,St.A)(ga,this)&&((0,Mt.A)(ga,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new ya(this)}get serializable(){if(0===(0,St.A)(Aa,this).size)return fa;const t=new Map,e=new pa,i=[],n=Object.create(null);let s=!1;for(const[r,a]of(0,St.A)(Aa,this)){const i=a instanceof Yr?a.serialize(!1,n):a;i&&(t.set(r,i),e.update("".concat(r,":").concat(JSON.stringify(i))),s||(s=!!i.bitmap))}if(s)for(const r of t.values())r.bitmap&&i.push(r.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:fa}get editorStats(){let t=null;const e=new Map;for(const s of(0,St.A)(Aa,this).values()){var i;if(!(s instanceof Yr))continue;const r=s.telemetryFinalData;if(!r)continue;const{type:a}=r;e.has(a)||e.set(a,Object.getPrototypeOf(s).constructor),t||(t=Object.create(null));const o=(i=t)[a]||(i[a]=new Map);for(const[t,e]of Object.entries(r)){var n;if("type"===t)continue;let i=o.get(t);i||(i=new Map,o.set(t,i));const s=null!==(n=i.get(e))&&void 0!==n?n:0;i.set(e,s+1)}}for(const[s,r]of e)t[s]=r.computeTelemetryFinalData(t[s]);return t}}function ba(){(0,St.A)(ga,this)||((0,Mt.A)(ga,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}var wa=new WeakMap;class ya extends va{constructor(t){super(),(0,Ct.A)(this,wa,void 0);const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);(0,Mt.A)(wa,this,{map:s,hash:i,transfer:n})}get print(){Ve("Should not call PrintAnnotationStorage.print")}get serializable(){return(0,St.A)(wa,this)}}var _a=new WeakMap;class xa{constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;(0,Ct.A)(this,_a,new Set),this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),(0,St.A)(_a,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){let{systemFontInfo:e,_inspectFont:i}=t;if(e&&!(0,St.A)(_a,this).has(e.loadedName)){if(Ge(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:s,style:r}=e,a=new FontFace(t,s,r);this.addNativeFontFace(a);try{await a.load(),(0,St.A)(_a,this).add(t),null===i||void 0===i||i(e)}catch(n){Ue("Cannot load system font: ".concat(e.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(a)}return}Ve("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw Ue("Failed to load font '".concat(e.family,"': '").concat(i,"'.")),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(e=>{const i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)})}}get isFontLoadingAPISupported(){var t;return Xe(this,"isFontLoadingAPISupported",!(null===(t=this._document)||void 0===t||!t.fonts))}get isSyncFontLoadingSupported(){var t;let e=!1;return(Vt||"undefined"!==typeof navigator&&"string"===typeof(null===(t=navigator)||void 0===t?void 0:t.userAgent)&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),Xe(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(Ge(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(i),i}get _loadTestFont(){return Xe(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){function i(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,i,n){return t.substring(0,e)+n+t.substring(e+i)}let s,r;const a=this._document.createElement("canvas");a.width=1,a.height=1;const o=a.getContext("2d");let l=0;const c="lt".concat(Date.now()).concat(this.loadTestFontId++);let h=this._loadTestFont;h=n(h,976,c.length,c);const d=1482184792;let u=i(h,16);for(s=0,r=c.length-3;s<r;s+=4)u=u-d+i(c,s)|0;var p;s<c.length&&(u=u-d+i(c+"XXX",s)|0),h=n(h,16,4,(p=u,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const f="url(data:font/opentype;base64,".concat(btoa(h),");"),g='@font-face {font-family:"'.concat(c,'";src:').concat(f,"}");this.insertRule(g);const A=this._document.createElement("div");A.style.visibility="hidden",A.style.width=A.style.height="10px",A.style.position="absolute",A.style.top=A.style.left="0px";for(const m of[t.loadedName,c]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=m,A.append(t)}this._document.body.append(A),function t(e,i){if(++l>30)return Ue("Load test font never loaded."),void i();o.font="30px "+e,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?i():setTimeout(t.bind(null,e,i))}(c,()=>{A.remove(),e.complete()})}}class Ea{constructor(t,e){let{disableFontFace:i=!1,inspectFont:n=null}=e;this.compiledGlyphs=Object.create(null);for(const s in t)this[s]=t[s];this.disableFontFace=!0===i,this._inspectFont=n}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=ii(this.data),i="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(i,"}")}else n='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(i,"}");return null===(t=this._inspectFont)||void 0===t||t.call(this,this,i),n}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(s){Ue('getPathGenerator - ignoring character: "'.concat(s,'".'))}if(!Array.isArray(i)||0===i.length)return this.compiledGlyphs[e]=function(t,e){};const n=[];for(let r=0,a=i.length;r<a;)switch(i[r++]){case fi:{const[t,e,s,a,o,l]=i.slice(r,r+6);n.push(i=>i.bezierCurveTo(t,e,s,a,o,l)),r+=6}break;case gi:{const[t,e]=i.slice(r,r+2);n.push(i=>i.moveTo(t,e)),r+=2}break;case Ai:{const[t,e]=i.slice(r,r+2);n.push(i=>i.lineTo(t,e)),r+=2}break;case mi:{const[t,e,s,a]=i.slice(r,r+4);n.push(i=>i.quadraticCurveTo(t,e,s,a)),r+=4}break;case vi:n.push(t=>t.restore());break;case bi:n.push(t=>t.save());break;case wi:Ge(2===n.length,"Scale command is only valid at the third position.");break;case yi:{const[t,e,s,a,o,l]=i.slice(r,r+6);n.push(i=>i.transform(t,e,s,a,o,l)),r+=6}break;case _i:{const[t,e]=i.slice(r,r+2);n.push(i=>i.translate(t,e)),r+=2}}return this.compiledGlyphs[e]=function(t,e){n[0](t),n[1](t),t.scale(e,-e);for(let i=2,s=n.length;i<s;i++)n[i](t)}}}if(Vt){var ka=Promise.withResolvers(),Ca=null;(async()=>{const t=await i.e(3237).then(i.t.bind(i,23237,19)),e=await i.e(7492).then(i.t.bind(i,97492,19)),n=await i.e(1815).then(i.t.bind(i,31815,19)),s=await i.e(6671).then(i.t.bind(i,66671,19));return new Map(Object.entries({fs:t,http:e,https:n,url:s,canvas:undefined,path2d:undefined}))})().then(t=>{Ca=t,ka.resolve()},t=>{Ue("loadPackages: ".concat(t)),Ca=new Map,ka.resolve()})}class Sa{static get promise(){return ka.promise}static get(t){var e;return null===(e=Ca)||void 0===e?void 0:e.get(t)}}const Ma=function(t){return Sa.get("fs").promises.readFile(t).then(t=>new Uint8Array(t))};const La="Fill",Ta="Stroke",Ra="Shading";function Pa(t,e){if(!e)return;const i=e[2]-e[0],n=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],i,n),t.clip(s)}class Fa{constructor(){this.constructor===Fa&&Ve("Cannot initialize BaseShadingPattern.")}getPattern(){Ve("Abstract method `getPattern` called.")}}class Ia extends Fa{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 i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,n){let s;if(n===Ta||n===La){const r=e.current.getClippedPathBoundingBox(n,fn(t))||[0,0,0,0],a=Math.ceil(r[2]-r[0])||1,o=Math.ceil(r[3]-r[1])||1,l=e.cachedCanvases.getCanvas("pattern",a,o,!0),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-r[0],-r[1]),i=oi.transform(i,[1,0,0,1,r[0],r[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),Pa(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),s=t.createPattern(l.canvas,"no-repeat");const h=new DOMMatrix(i);s.setTransform(h)}else Pa(t,this._bbox),s=this._createGradient(t);return s}}function Da(t,e,i,n,s,r,a,o){const l=e.coords,c=e.colors,h=t.data,d=4*t.width;let u;l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u),l[n+1]>l[s+1]&&(u=n,n=s,s=u,u=a,a=o,o=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u);const p=(l[i]+e.offsetX)*e.scaleX,f=(l[i+1]+e.offsetY)*e.scaleY,g=(l[n]+e.offsetX)*e.scaleX,A=(l[n+1]+e.offsetY)*e.scaleY,m=(l[s]+e.offsetX)*e.scaleX,v=(l[s+1]+e.offsetY)*e.scaleY;if(f>=v)return;const b=c[r],w=c[r+1],y=c[r+2],_=c[a],x=c[a+1],E=c[a+2],k=c[o],C=c[o+1],S=c[o+2],M=Math.round(f),L=Math.round(v);let T,R,P,F,I,D,O,N;for(let W=M;W<=L;W++){if(W<A){const t=W<f?0:(f-W)/(f-A);T=p-(p-g)*t,R=b-(b-_)*t,P=w-(w-x)*t,F=y-(y-E)*t}else{let t;t=W>v?1:A===v?0:(A-W)/(A-v),T=g-(g-m)*t,R=_-(_-k)*t,P=x-(x-C)*t,F=E-(E-S)*t}let t;t=W<f?0:W>v?1:(f-W)/(f-v),I=p-(p-m)*t,D=b-(b-k)*t,O=w-(w-C)*t,N=y-(y-S)*t;const e=Math.round(Math.min(T,I)),i=Math.round(Math.max(T,I));let n=d*W+4*e;for(let s=e;s<=i;s++)t=(T-s)/(T-I),t<0?t=0:t>1&&(t=1),h[n++]=R-(R-D)*t|0,h[n++]=P-(P-O)*t|0,h[n++]=F-(F-N)*t|0,h[n++]=255}}function Oa(t,e,i){const n=e.coords,s=e.colors;let r,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<c;r++,e++)Da(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),Da(t,i,n[e+o+1],n[e+1],n[e+o],s[e+o+1],s[e+1],s[e+o])}break;case"triangles":for(r=0,a=n.length;r<a;r+=3)Da(t,i,n[r],n[r+1],n[r+2],s[r],s[r+1],s[r+2]);break;default:throw new Error("illegal figure")}}class Na extends Fa{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,i){const n=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),r=Math.ceil(this._bounds[2])-n,a=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(r*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*t[1]*1.1)),3e3),c=r/o,h=a/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/c,scaleY:1/h},u=o+4,p=l+4,f=i.getCanvas("mesh",u,p,!1),g=f.context,A=g.createImageData(o,l);if(e){const t=A.data;for(let i=0,n=t.length;i<n;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(const m of this._figures)Oa(A,m,d);g.putImageData(A,2,2);return{canvas:f.canvas,offsetX:n-2*c,offsetY:s-2*h,scaleX:c,scaleY:h}}getPattern(t,e,i,n){let s;if(Pa(t,this._bbox),n===Ra)s=oi.singularValueDecompose2dScale(fn(t));else if(s=oi.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=oi.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}const r=this._createMeshCanvas(s,n===Ra?null:this._background,e.cachedCanvases);return n!==Ra&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY),t.createPattern(r.canvas,"no-repeat")}}class Wa extends Fa{getPattern(){return"hotpink"}}const ja=1,Ba=2;class Ha{constructor(t,e,i,n,s){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=i,this.canvasGraphicsFactory=n,this.baseTransform=s}createPatternCanvas(t){const e=this.operatorList,i=this.bbox,n=this.xstep,s=this.ystep,r=this.paintType,a=this.tilingType,o=this.color,l=this.canvasGraphicsFactory;ze("TilingType: "+a);const c=i[0],h=i[1],d=i[2],u=i[3],p=oi.singularValueDecompose2dScale(this.matrix),f=oi.singularValueDecompose2dScale(this.baseTransform),g=[p[0]*f[0],p[1]*f[1]],A=this.getSizeAndScale(n,this.ctx.canvas.width,g[0]),m=this.getSizeAndScale(s,this.ctx.canvas.height,g[1]),v=t.cachedCanvases.getCanvas("pattern",A.size,m.size,!0),b=v.context,w=l.createCanvasGraphics(b);w.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(w,r,o);let y=c,_=h,x=d,E=u;return c<0&&(y=0,x+=Math.abs(c)),h<0&&(_=0,E+=Math.abs(h)),b.translate(-A.scale*y,-m.scale*_),w.transform(A.scale,0,0,m.scale,0,0),b.save(),this.clipBbox(w,y,_,x,E),w.baseTransform=fn(w.ctx),w.executeOperatorList(e),w.endDrawing(),{canvas:v.canvas,scaleX:A.scale,scaleY:m.scale,offsetX:y,offsetY:_}}getSizeAndScale(t,e,i){t=Math.abs(t);const n=Math.max(Ha.MAX_PATTERN_SIZE,e);let s=Math.ceil(t*i);return s>=n?s=n:i=s/t,{scale:i,size:s}}clipBbox(t,e,i,n,s){const r=n-e,a=s-i;t.ctx.rect(e,i,r,a),t.current.updateRectMinMax(fn(t.ctx),[e,i,n,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case ja:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case Ba:const r=oi.makeHexColor(i[0],i[1],i[2]);n.fillStyle=r,n.strokeStyle=r,s.fillColor=r,s.strokeColor=r;break;default:throw new ti("Unsupported paint type: ".concat(e))}}getPattern(t,e,i,n){let s=i;n!==Ra&&(s=oi.transform(s,e.baseTransform),this.matrix&&(s=oi.transform(s,this.matrix)));const r=this.createPatternCanvas(e);let a=new DOMMatrix(s);a=a.translate(r.offsetX,r.offsetY),a=a.scale(1/r.scaleX,1/r.scaleY);const o=t.createPattern(r.canvas,"repeat");return o.setTransform(a),o}}function za(t){let{src:e,srcPos:i=0,dest:n,width:s,height:r,nonBlackColor:a=4294967295,inverseDecode:o=!1}=t;const l=ri.isLittleEndian?4278190080:255,[c,h]=o?[a,l]:[l,a],d=s>>3,u=7&s,p=e.length;n=new Uint32Array(n.buffer);let f=0;for(let g=0;g<r;g++){for(const s=i+d;i<s;i++){const t=i<p?e[i]:255;n[f++]=128&t?h:c,n[f++]=64&t?h:c,n[f++]=32&t?h:c,n[f++]=16&t?h:c,n[f++]=8&t?h:c,n[f++]=4&t?h:c,n[f++]=2&t?h:c,n[f++]=1&t?h:c}if(0===u)continue;const t=i<p?e[i++]:255;for(let e=0;e<u;e++)n[f++]=t&1<<7-e?h:c}return{srcPos:i,destPos:f}}(0,kt.A)(Ha,"MAX_PATTERN_SIZE",3e3);const Ua=16;class Va{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let n;return void 0!==this.cache[t]?(n=this.cache[t],this.canvasFactory.reset(n,e,i)):(n=this.canvasFactory.create(e,i),this.cache[t]=n),n}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 Ga(t,e,i,n,s,r,a,o,l,c){const[h,d,u,p,f,g]=fn(t);if(0===d&&0===u){const A=a*h+f,m=Math.round(A),v=o*p+g,b=Math.round(v),w=(a+l)*h+f,y=Math.abs(Math.round(w)-m)||1,_=(o+c)*p+g,x=Math.abs(Math.round(_)-b)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(p),m,b),t.drawImage(e,i,n,s,r,0,0,y,x),t.setTransform(h,d,u,p,f,g),[y,x]}if(0===h&&0===p){const A=o*u+f,m=Math.round(A),v=a*d+g,b=Math.round(v),w=(o+c)*u+f,y=Math.abs(Math.round(w)-m)||1,_=(a+l)*d+g,x=Math.abs(Math.round(_)-b)||1;return t.setTransform(0,Math.sign(d),Math.sign(u),0,m,b),t.drawImage(e,i,n,s,r,0,0,x,y),t.setTransform(h,d,u,p,f,g),[x,y]}t.drawImage(e,i,n,s,r,a,o,l,c);return[Math.hypot(h,d)*l,Math.hypot(u,p)*c]}class qa{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Gt,this.textMatrixScale=1,this.fontMatrix=qt,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=re,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,i){[e,i]=oi.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){const i=oi.applyTransform(e,t),n=oi.applyTransform(e.slice(2),t),s=oi.applyTransform([e[0],e[3]],t),r=oi.applyTransform([e[2],e[1]],t);this.minX=Math.min(this.minX,i[0],n[0],s[0],r[0]),this.minY=Math.min(this.minY,i[1],n[1],s[1],r[1]),this.maxX=Math.max(this.maxX,i[0],n[0],s[0],r[0]),this.maxY=Math.max(this.maxY,i[1],n[1],s[1],r[1])}updateScalingPathMinMax(t,e){oi.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.minY=Math.min(this.minY,e[1]),this.maxX=Math.max(this.maxX,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,n,s,r,a,o,l,c){const h=oi.bezierBoundingBox(e,i,n,s,r,a,o,l,c);c||this.updateRectMinMax(t,h)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:La,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===Ta){e||Ve("Stroke bounding box must include transform.");const t=oi.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;i[0]-=n,i[1]-=s,i[2]+=n,i[3]+=s}return i}updateClipFromPath(){const t=oi.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]:La,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return oi.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function Xa(t,e){if("undefined"!==typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%Ua,r=(i-s)/Ua,a=0===s?r:r+1,o=t.createImageData(n,Ua);let l,c=0;const h=e.data,d=o.data;let u,p,f,g;if(e.kind===de.GRAYSCALE_1BPP){const e=h.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),g=i.length,A=n+7>>3,m=4294967295,v=ri.isLittleEndian?4278190080:255;for(u=0;u<a;u++){for(f=u<r?Ua:s,l=0,p=0;p<f;p++){const t=e-c;let s=0;const r=t>A?n:8*t-7,a=-8&r;let o=0,d=0;for(;s<a;s+=8)d=h[c++],i[l++]=128&d?m:v,i[l++]=64&d?m:v,i[l++]=32&d?m:v,i[l++]=16&d?m:v,i[l++]=8&d?m:v,i[l++]=4&d?m:v,i[l++]=2&d?m:v,i[l++]=1&d?m:v;for(;s<r;s++)0===o&&(d=h[c++],o=128),i[l++]=d&o?m:v,o>>=1}for(;l<g;)i[l++]=0;t.putImageData(o,0,u*Ua)}}else if(e.kind===de.RGBA_32BPP){for(p=0,g=n*Ua*4,u=0;u<r;u++)d.set(h.subarray(c,c+g)),c+=g,t.putImageData(o,0,p),p+=Ua;u<a&&(g=n*s*4,d.set(h.subarray(c,c+g)),t.putImageData(o,0,p))}else{if(e.kind!==de.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));for(f=Ua,g=n*f,u=0;u<a;u++){for(u>=r&&(f=s,g=n*f),l=0,p=g;p--;)d[l++]=h[c++],d[l++]=h[c++],d[l++]=h[c++],d[l++]=255;t.putImageData(o,0,u*Ua)}}}function Ya(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%Ua,r=(i-s)/Ua,a=0===s?r:r+1,o=t.createImageData(n,Ua);let l=0;const c=e.data,h=o.data;for(let d=0;d<a;d++){const e=d<r?Ua:s;({srcPos:l}=za({src:c,srcPos:l,dest:h,width:n,height:e,nonBlackColor:0})),t.putImageData(o,0,d*Ua)}}function Ka(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of i)void 0!==t[n]&&(e[n]=t[n]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function Qa(t){if(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),!Vt){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function Za(t,e){if(e)return!0;const i=oi.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*Ti.PDF_TO_CSS_UNITS);return i[0]<=n&&i[1]<=n}const Ja=["butt","round","square"],$a=["miter","round","bevel"],to={},eo={};var io=new WeakSet;class no{constructor(t,e,i,n,s,r,a,o){let{optionalContentConfig:l,markedContentStack:c=null}=r;(0,_t.A)(this,io),this.ctx=t,this.current=new qa(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=n,this.filterFactory=s,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 Va(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=a,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],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:i,transparency:n=!1,background:s=null}=t;const r=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,r,a),this.ctx.fillStyle=o,n){const t=this.cachedCanvases.getCanvas("transparent",r,a);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...fn(this.compositeCtx))}this.ctx.save(),Qa(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=fn(this.ctx)}executeOperatorList(t,e,i,n){const s=t.argsArray,r=t.fnArray;let a=e||0;const o=s.length;if(o===a)return a;const l=o-a>10&&"function"===typeof i,c=l?Date.now()+15:0;let h=0;const d=this.commonObjs,u=this.objs;let p;for(;;){if(void 0!==n&&a===n.nextBreakPoint)return n.breakIt(a,i),a;if(p=r[a],p!==Ne.dependency)this[p].apply(this,s[a]);else for(const t of s[a]){const e=t.startsWith("g_")?d:u;if(!e.has(t))return e.get(t,i),a}if(a++,a===o)return a;if(l&&++h>10){if(Date.now()>c)return i(),a;h=0}}}endDrawing(){(0,xt.A)(io,this,so).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(),(0,xt.A)(io,this,ro).call(this)}_scaleImage(t,e){const i=t.width,n=t.height;let s,r,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,c=n,h="prescale1";for(;a>2&&l>1||o>2&&c>1;){let e=l,i=c;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&c>1&&(i=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/i),s=this.cachedCanvases.getCanvas(h,e,i),r=s.context,r.clearRect(0,0,e,i),r.drawImage(t,0,0,l,c,0,0,e,i),t=s.canvas,l=e,c=i,h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,r=this.current.patternFill,a=fn(e);let o,l,c,h;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;l=JSON.stringify(r?a:[a.slice(0,4),s]),o=this._cachedBitmapsMap.get(e),o||(o=new Map,this._cachedBitmapsMap.set(e,o));const i=o.get(l);if(i&&!r){return{canvas:i,offsetX:Math.round(Math.min(a[0],a[2])+a[4]),offsetY:Math.round(Math.min(a[1],a[3])+a[5])}}c=i}c||(h=this.cachedCanvases.getCanvas("maskCanvas",i,n),Ya(h.context,t));let d=oi.transform(a,[1/i,0,0,-1/n,0,0]);d=oi.transform(d,[1,0,0,1,0,-n]);const[u,p,f,g]=oi.getAxialAlignedBoundingBox([0,0,i,n],d),A=Math.round(f-u)||1,m=Math.round(g-p)||1,v=this.cachedCanvases.getCanvas("fillCanvas",A,m),b=v.context,w=u,y=p;b.translate(-w,-y),b.transform(...d),c||(c=this._scaleImage(h.canvas,gn(b)),c=c.img,o&&r&&o.set(l,c)),b.imageSmoothingEnabled=Za(fn(b),t.interpolate),Ga(b,c,0,0,c.width,c.height,0,0,i,n),b.globalCompositeOperation="source-in";const _=oi.transform(gn(b),[1,0,0,1,-w,-y]);return b.fillStyle=r?s.getPattern(e,this,_,La):s,b.fillRect(0,0,i,n),o&&!r&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,v.canvas)),{canvas:v.canvas,offsetX:Math.round(w),offsetY:Math.round(y)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Ja[t]}setLineJoin(t){this.ctx.lineJoin=$a[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=n.context;const s=this.ctx;s.setTransform(...fn(this.suspendedCtx)),Ka(this.suspendedCtx,s),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,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,n,s,r,a){e.transform(t,i,n,s,r,a),this.__originalTransform(t,i,n,s,r,a)},t.setTransform=function(t,i,n,s,r,a){e.setTransform(t,i,n,s,r,a),this.__originalSetTransform(t,i,n,s,r,a)},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,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,n,s,r,a){e.bezierCurveTo(t,i,n,s,r,a),this.__originalBezierCurveTo(t,i,n,s,r,a)},t.rect=function(t,i,n,s){e.rect(t,i,n,s),this.__originalRect(t,i,n,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(s,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(),Ka(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,i,n){const s=n[0],r=n[1],a=n[2]-s,o=n[3]-r;0!==a&&0!==o&&(this.genericComposeSMask(e.context,i,a,o,e.subtype,e.backdrop,e.transferMap,s,r,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,n,s,r,a,o,l,c,h){let d=t.canvas,u=o-c,p=l-h;if(r)if(u<0||p<0||u+i>d.width||p+n>d.height){const t=this.cachedCanvases.getCanvas("maskExtension",i,n),e=t.context;e.drawImage(d,-u,-p),r.some(t=>0!==t)&&(e.globalCompositeOperation="destination-atop",e.fillStyle=oi.makeHexColor(...r),e.fillRect(0,0,i,n),e.globalCompositeOperation="source-over"),d=t.canvas,u=p=0}else if(r.some(t=>0!==t)){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const e=new Path2D;e.rect(u,p,i,n),t.clip(e),t.globalCompositeOperation="destination-atop",t.fillStyle=oi.makeHexColor(...r),t.fillRect(u,p,i,n),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===s&&a?e.filter=this.filterFactory.addAlphaFilter(a):"Luminosity"===s&&(e.filter=this.filterFactory.addLuminosityFilter(a));const f=new Path2D;f.rect(o,l,i,n),e.clip(f),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(){this.inSMaskMode?(Ka(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(),Ka(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,n,s,r){this.ctx.transform(t,e,i,n,s,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const n=this.ctx,s=this.current;let r,a,o=s.x,l=s.y;const c=fn(n),h=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],d=h?i.slice(0):null;for(let u=0,p=0,f=t.length;u<f;u++)switch(0|t[u]){case Ne.rectangle:o=e[p++],l=e[p++];const t=e[p++],i=e[p++],u=o+t,f=l+i;n.moveTo(o,l),0===t||0===i?n.lineTo(u,f):(n.lineTo(u,l),n.lineTo(u,f),n.lineTo(o,f)),h||s.updateRectMinMax(c,[o,l,u,f]),n.closePath();break;case Ne.moveTo:o=e[p++],l=e[p++],n.moveTo(o,l),h||s.updatePathMinMax(c,o,l);break;case Ne.lineTo:o=e[p++],l=e[p++],n.lineTo(o,l),h||s.updatePathMinMax(c,o,l);break;case Ne.curveTo:r=o,a=l,o=e[p+4],l=e[p+5],n.bezierCurveTo(e[p],e[p+1],e[p+2],e[p+3],o,l),s.updateCurvePathMinMax(c,r,a,e[p],e[p+1],e[p+2],e[p+3],o,l,d),p+=6;break;case Ne.curveTo2:r=o,a=l,n.bezierCurveTo(o,l,e[p],e[p+1],e[p+2],e[p+3]),s.updateCurvePathMinMax(c,r,a,o,l,e[p],e[p+1],e[p+2],e[p+3],d),o=e[p+2],l=e[p+3],p+=4;break;case Ne.curveTo3:r=o,a=l,o=e[p+2],l=e[p+3],n.bezierCurveTo(e[p],e[p+1],o,l,o,l),s.updateCurvePathMinMax(c,r,a,e[p],e[p+1],o,l,o,l,d),p+=4;break;case Ne.closePath:n.closePath()}h&&s.updateScalingPathMinMax(c,d),s.setCurrentPoint(o,l)}closePath(){this.ctx.closePath()}stroke(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof i&&null!==i&&void 0!==i&&i.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,gn(e),Ta),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,i=this.current.fillColor;let n=!1;this.current.patternFill&&(e.save(),e.fillStyle=i.getPattern(e,this,gn(e),La),n=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),n&&e.restore(),t&&this.consumePath(s)}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=to}eoClip(){this.pendingClip=eo}beginText(){this.current.textMatrix=Gt,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 i of t)e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.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){var i;const n=this.commonObjs.get(t),s=this.current;if(!n)throw new Error("Can't find font for ".concat(t));if(s.fontMatrix=n.fontMatrix||qt,0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||Ue("Invalid font matrix for font "+t),e<0?(e=-e,s.fontDirection=-1):s.fontDirection=1,this.current.font=n,this.current.fontSize=e,n.isType3Font)return;const r=n.loadedName||"sans-serif",a=(null===(i=n.systemFontInfo)||void 0===i?void 0:i.css)||'"'.concat(r,'", ').concat(n.fallbackName);let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let c=e;e<16?c=16:e>100&&(c=100),this.current.fontSizeScale=e/c,this.ctx.font="".concat(l," ").concat(o," ").concat(c,"px ").concat(a)}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,n,s,r){this.current.textMatrix=[t,e,i,n,s,r],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,i,n){const s=this.ctx,r=this.current,a=r.font,o=r.textRenderingMode,l=r.fontSize/r.fontSizeScale,c=o&ce,h=!!(o&he),d=r.patternFill&&!a.missingFile;let u;if((a.disableFontFace||h||d)&&(u=a.getPathGenerator(this.commonObjs,t)),a.disableFontFace||d?(s.save(),s.translate(e,i),s.beginPath(),u(s,l),n&&s.setTransform(...n),c!==re&&c!==oe||s.fill(),c!==ae&&c!==oe||s.stroke(),s.restore()):(c!==re&&c!==oe||s.fillText(t,e,i),c!==ae&&c!==oe||s.strokeText(t,e,i)),h){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:fn(s),x:e,y:i,fontSize:l,addToPath:u})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let n=3;n<e.length;n+=4)if(e[n]>0&&e[n]<255){i=!0;break}return Xe(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const s=this.ctx,r=e.fontSizeScale,a=e.charSpacing,o=e.wordSpacing,l=e.fontDirection,c=e.textHScale*l,h=t.length,d=i.vertical,u=d?1:-1,p=i.defaultVMetrics,f=n*e.fontMatrix[0],g=e.textRenderingMode===re&&!i.disableFontFace&&!e.patternFill;let A;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),l>0?s.scale(c,-1):s.scale(c,1),e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,gn(s),La);A=fn(s),s.restore(),s.fillStyle=t}let m=e.lineWidth;const v=e.textMatrixScale;if(0===v||0===m){const t=e.textRenderingMode&ce;t!==ae&&t!==oe||(m=this.getSinglePixelWidth())}else m/=v;if(1!==r&&(s.scale(r,r),m/=r),s.lineWidth=m,i.isInvalidPDFjsFont){const i=[];let n=0;for(const e of t)i.push(e.unicode),n+=e.width;return s.fillText(i.join(""),0,0),e.x+=n*f*c,s.restore(),void this.compose()}let b,w=0;for(b=0;b<h;++b){const e=t[b];if("number"===typeof e){w+=u*e*n/1e3;continue}let c=!1;const h=(e.isSpace?o:0)+a,m=e.fontChar,v=e.accent;let y,_,x=e.width;if(d){const t=e.vmetric||p,i=-(e.vmetric?t[1]:.5*x)*f,n=t[2]*f;x=t?-t[0]:x,y=i/r,_=(w+n)/r}else y=w/r,_=0;if(i.remeasure&&x>0){const t=1e3*s.measureText(m).width/n*r;if(x<t&&this.isFontSubpixelAAEnabled){const e=x/t;c=!0,s.save(),s.scale(e,1),y/=e}else x!==t&&(y+=(x-t)/2e3*n/r)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(g&&!v)s.fillText(m,y,_);else if(this.paintChar(m,y,_,A),v){const t=y+n*v.offset.x/r,e=_-n*v.offset.y/r;this.paintChar(v.fontChar,t,e,A)}w+=d?x*f-h*l:x*f+h*l,c&&s.restore()}d?e.y-=w:e.x+=w*c,s.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,n=i.font,s=i.fontSize,r=i.fontDirection,a=n.vertical?1:-1,o=i.charSpacing,l=i.wordSpacing,c=i.textHScale*r,h=i.fontMatrix||qt,d=t.length;let u,p,f,g;if(!(i.textRenderingMode===le)&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...i.textMatrix),e.translate(i.x,i.y),e.scale(c,r),u=0;u<d;++u){if(p=t[u],"number"===typeof p){g=a*p*s/1e3,this.ctx.translate(g,0),i.x+=g*c;continue}const r=(p.isSpace?l:0)+o,d=n.charProcOperatorList[p.operatorListId];if(!d){Ue('Type3 character "'.concat(p.operatorListId,'" is not available.'));continue}this.contentVisible&&(this.processingType3=p,this.save(),e.scale(s,s),e.transform(...h),this.executeOperatorList(d),this.restore());f=oi.applyTransform([p.width,0],h)[0]*s+r,e.translate(f,0),i.x+=f*c}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,n,s,r){this.ctx.rect(i,n,s-i,r-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],n=this.baseTransform||fn(this.ctx),s={createCanvasGraphics:t=>new no(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new Ha(t,i,this.ctx,s,n)}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,i){const n=oi.makeHexColor(t,e,i);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,i){const n=oi.makeHexColor(t,e,i);this.ctx.fillStyle=n,this.current.fillColor=n,this.current.patternFill=!1}_getPattern(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=function(t){switch(t[0]){case"RadialAxial":return new Ia(t);case"Mesh":return new Na(t);case"Dummy":return new Wa}throw new Error("Unknown IR type: ".concat(t[0]))}(this.getObject(t)),this.cachedPatterns.set(t,e)),i&&(e.matrix=i),e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,gn(e),Ra);const n=gn(e);if(n){const{width:t,height:i}=e.canvas,[s,r,a,o]=oi.getAxialAlignedBoundingBox([0,0,t,i],n);this.ctx.fillRect(s,r,a-s,o-r)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Ve("Should not call beginInlineImage")}beginImageData(){Ve("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=fn(this.ctx),e)){const t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i),this.current.updateRectMinMax(fn(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||ze("TODO: Support non-isolated groups."),t.knockout&&Ue("Knockout groups not supported.");const i=fn(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=oi.getAxialAlignedBoundingBox(t.bbox,fn(e));const s=[0,0,e.canvas.width,e.canvas.height];n=oi.intersect(n,s)||[0,0,0,0];const r=Math.floor(n[0]),a=Math.floor(n[1]),o=Math.max(Math.ceil(n[2])-r,1),l=Math.max(Math.ceil(n[3])-a,1);this.current.startNewPathAndClipBox([0,0,o,l]);let c="groupAt"+this.groupLevel;t.smask&&(c+="_smask_"+this.smaskCounter++%2);const h=this.cachedCanvases.getCanvas(c,o,l),d=h.context;d.translate(-r,-a),d.transform(...i),t.smask?this.smaskStack.push({canvas:h.canvas,context:d,offsetX:r,offsetY:a,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(r,a),e.save()),Ka(e,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=fn(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=oi.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s){if((0,xt.A)(io,this,so).call(this),Qa(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const n=e[2]-e[0],r=e[3]-e[1];if(s&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=r;const[s,a]=oi.singularValueDecompose2dScale(fn(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),c=Math.ceil(r*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,c);const{canvas:h,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(s,0,0,-a,0,r*a),Qa(this.ctx)}else Qa(this.ctx),this.ctx.rect(e[0],e[1],n,r),this.ctx.clip(),this.endPath()}this.current=new qa(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),(0,xt.A)(io,this,ro).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 i=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function(t){const{width:e,height:i}=t;if(e>1e3||i>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let r,a,o,l=new Uint8Array(s*(i+1));const c=e+7&-8;let h=new Uint8Array(c*i),d=0;for(const g of t.data){let t=128;for(;t>0;)h[d++]=g&t?0:255,t>>=1}let u=0;for(d=0,0!==h[d]&&(l[0]=1,++u),a=1;a<e;a++)h[d]!==h[d+1]&&(l[a]=h[d]?2:1,++u),d++;for(0!==h[d]&&(l[a]=2,++u),r=1;r<i;r++){d=r*c,o=r*s,h[d-c]!==h[d]&&(l[o]=h[d]?1:8,++u);let t=(h[d]?4:0)+(h[d-c]?8:0);for(a=1;a<e;a++)t=(t>>2)+(h[d+1]?4:0)+(h[d-c+1]?8:0),n[t]&&(l[o+a]=n[t],++u),d++;if(h[d-c]!==h[d]&&(l[o+a]=h[d]?2:4,++u),u>1e3)return null}for(d=c*(i-1),o=r*s,0!==h[d]&&(l[o]=8,++u),a=1;a<e;a++)h[d]!==h[d+1]&&(l[o+a]=h[d]?4:8,++u),d++;if(0!==h[d]&&(l[o+a]=4,++u),u>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=new Path2D;for(r=0;u&&r<=i;r++){let t=r*s;const i=t+e;for(;t<i&&!l[t];)t++;if(t===i)continue;f.moveTo(t%s,r);const n=t;let a=l[t];do{const e=p[a];do{t+=e}while(!l[t]);const i=l[t];5!==i&&10!==i?(a=i,l[t]=0):(a=i&51*a>>4,l[t]&=a>>2|a<<2),f.lineTo(t%s,t/s|0),l[t]||--u}while(n!==t);--r}return h=null,l=null,function(t){t.save(),t.scale(1/e,-1/i),t.translate(0,-i),t.fill(f),t.beginPath(),t.restore()}}(t)),n.compiled))return void n.compiled(i);const s=this._createMaskCanvas(t),r=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(r,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const a=this.ctx;a.save();const o=fn(a);a.transform(e,i,n,s,0,0);const l=this._createMaskCanvas(t);a.setTransform(1,0,0,1,l.offsetX-o[4],l.offsetY-o[5]);for(let c=0,h=r.length;c<h;c+=2){const t=oi.transform(o,[e,i,n,s,r[c],r[c+1]]),[h,d]=oi.applyTransform([0,0],t);a.drawImage(l.canvas,h,d)}a.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const s of t){const{data:t,width:r,height:a,transform:o}=s,l=this.cachedCanvases.getCanvas("maskCanvas",r,a),c=l.context;c.save();Ya(c,this.getObject(t,s)),c.globalCompositeOperation="source-in",c.fillStyle=n?i.getPattern(c,this,gn(e),La):i,c.fillRect(0,0,r,a),c.restore(),e.save(),e.transform(...o),e.scale(1,-1),Ga(e,l.canvas,0,0,r,a,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):Ue("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const s=this.getObject(t);if(!s)return void Ue("Dependent image isn't ready yet");const r=s.width,a=s.height,o=[];for(let l=0,c=n.length;l<c;l+=2)o.push({transform:[e,0,0,i,n[l],n[l+1]],x:0,y:0,w:r,h:a});this.paintInlineImageXObjectGroup(s,o)}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:i,height:n}=t,s=this.cachedCanvases.getCanvas("inlineImage",i,n),r=s.context;return r.filter=this.current.transferMaps,r.drawImage(e,0,0),r.filter="none",s.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,n=this.ctx;if(this.save(),!Vt){const{filter:t}=n;"none"!==t&&""!==t&&(n.filter="none")}let s;if(n.scale(1/e,-1/i),t.bitmap)s=this.applyTransferMapsToBitmap(t);else if("function"===typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const n=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Xa(n,t),s=this.applyTransferMapsToCanvas(n)}const r=this._scaleImage(s,gn(n));n.imageSmoothingEnabled=Za(fn(n),t.interpolate),Ga(n,r.img,0,0,r.paintWidth,r.paintHeight,0,-i,e,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let n;if(t.bitmap)n=t.bitmap;else{const e=t.width,i=t.height,s=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Xa(s,t),n=this.applyTransferMapsToCanvas(s)}for(const s of e)i.save(),i.transform(...s.transform),i.scale(1,-1),Ga(i,n,s.x,s.y,s.w,s.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"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 i=this.ctx;this.pendingClip&&(e||(this.pendingClip===eo?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=fn(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]),i=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:i,c:n,d:s}=this.ctx.getTransform();let r,a;if(0===i&&0===n){const i=Math.abs(e),n=Math.abs(s);if(i===n)if(0===t)r=a=1/i;else{const e=i*t;r=a=e<1?1/e:1}else if(0===t)r=1/i,a=1/n;else{const e=i*t,s=n*t;r=e<1?1/e:1,a=s<1?1/s:1}}else{const o=Math.abs(e*s-i*n),l=Math.hypot(e,i),c=Math.hypot(n,s);if(0===t)r=c/o,a=l/o;else{const e=t*o;r=c>e?c/e:1,a=l>e?l/e:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[n,s]=this.getScaleForStroking();if(e.lineWidth=i||1,1===n&&1===s)return void e.stroke();const r=e.getLineDash();if(t&&e.save(),e.scale(n,s),r.length>0){const t=Math.max(n,s);e.setLineDash(r.map(e=>e/t)),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}function so(){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 ro(){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}}}for(const Qv in Ne)void 0!==no.prototype[Qv]&&(no.prototype[Ne[Qv]]=no.prototype[Qv]);class ao{static get workerPort(){return(0,xt.A)(ao,this,oo)._}static set workerPort(t){if(!("undefined"!==typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");oo._=(0,xt.A)(ao,this,t)}static get workerSrc(){return(0,xt.A)(ao,this,lo)._}static set workerSrc(t){if("string"!==typeof t)throw new Error("Invalid `workerSrc` type.");lo._=(0,xt.A)(ao,this,t)}}var oo={_:null},lo={_:""};const co=1,ho=2,uo=1,po=2,fo=3,go=4,Ao=5,mo=6,vo=7,bo=8;function wo(t){switch(t instanceof Error||"object"===typeof t&&null!==t||Ve('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new ei(t.message);case"MissingPDFException":return new Je(t.message);case"PasswordException":return new Ke(t.message,t.code);case"UnexpectedResponseException":return new $e(t.message,t.status);case"UnknownErrorException":return new Qe(t.message,t.details);default:return new Qe(t.message,t.toString())}}var yo=new WeakSet;class _o{constructor(t,e,i){(0,_t.A)(this,yo),this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream)return void(0,xt.A)(yo,this,Eo).call(this,e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error("Cannot resolve callback ".concat(t));if(delete this.callbackCapabilities[t],e.callback===co)i.resolve(e.data);else{if(e.callback!==ho)throw new Error("Unexpected callback case");i.reject(wo(e.reason))}return}const n=this.actionHandler[e.action];if(!n)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){const t=this.sourceName,s=e.sourceName;return void new Promise(function(t){t(n(e.data))}).then(function(n){i.postMessage({sourceName:t,targetName:s,callback:co,callbackId:e.callbackId,data:n})},function(n){i.postMessage({sourceName:t,targetName:s,callback:ho,callbackId:e.callbackId,reason:wo(n)})})}e.streamId?(0,xt.A)(yo,this,xo).call(this,e):n(e.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error('There is already an actionName called "'.concat(t,'"'));i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(r){s.reject(r)}return s.promise}sendWithStream(t,e,i,n){const s=this.streamId++,r=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{const l=Promise.withResolvers();return this.streamControllers[s]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:r,targetName:a,action:t,streamId:s,data:e,desiredSize:i.desiredSize},n),l.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[s].pullCall=e,o.postMessage({sourceName:r,targetName:a,stream:mo,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{Ge(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[s].cancelCall=e,this.streamControllers[s].isClosed=!0,o.postMessage({sourceName:r,targetName:a,stream:uo,streamId:s,reason:wo(t)}),e.promise}},i)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}function xo(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this,a=this.actionHandler[t.action],o={enqueue(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=r,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:n,stream:go,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:fo,streamId:e}),delete r.streamSinks[e])},error(t){Ge(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:Ao,streamId:e,reason:wo(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,new Promise(function(e){e(a(t.data,o))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:bo,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:bo,streamId:e,reason:wo(t)})})}function Eo(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case bo:t.success?r.startCall.resolve():r.startCall.reject(wo(t.reason));break;case vo:t.success?r.pullCall.resolve():r.pullCall.reject(wo(t.reason));break;case mo:if(!a){s.postMessage({sourceName:i,targetName:n,stream:vo,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,new Promise(function(t){var e;t(null===(e=a.onPull)||void 0===e?void 0:e.call(a))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:vo,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:vo,streamId:e,reason:wo(t)})});break;case go:if(Ge(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case fo:if(Ge(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),(0,xt.A)(yo,this,ko).call(this,r,e);break;case Ao:Ge(r,"error should have stream controller"),r.controller.error(wo(t.reason)),(0,xt.A)(yo,this,ko).call(this,r,e);break;case po:t.success?r.cancelCall.resolve():r.cancelCall.reject(wo(t.reason)),(0,xt.A)(yo,this,ko).call(this,r,e);break;case uo:if(!a)break;new Promise(function(e){var i;e(null===(i=a.onCancel)||void 0===i?void 0:i.call(a,wo(t.reason)))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:po,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:po,streamId:e,reason:wo(t)})}),a.sinkCapability.reject(wo(t.reason)),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async function ko(t,e){var i,n,s;await Promise.allSettled([null===(i=t.startCall)||void 0===i?void 0:i.promise,null===(n=t.pullCall)||void 0===n?void 0:n.promise,null===(s=t.cancelCall)||void 0===s?void 0:s.promise]),delete this.streamControllers[e]}var Co=new WeakMap,So=new WeakMap;class Mo{constructor(t){let{parsedData:e,rawData:i}=t;(0,Ct.A)(this,Co,void 0),(0,Ct.A)(this,So,void 0),(0,Mt.A)(Co,this,e),(0,Mt.A)(So,this,i)}getRaw(){return(0,St.A)(So,this)}get(t){var e;return null!==(e=(0,St.A)(Co,this).get(t))&&void 0!==e?e:null}getAll(){return si((0,St.A)(Co,this))}has(t){return(0,St.A)(Co,this).has(t)}}const Lo=Symbol("INTERNAL");var To=new WeakMap,Ro=new WeakMap,Po=new WeakMap,Fo=new WeakMap;class Io{constructor(t,e){let{name:i,intent:n,usage:s}=e;(0,Ct.A)(this,To,!1),(0,Ct.A)(this,Ro,!1),(0,Ct.A)(this,Po,!1),(0,Ct.A)(this,Fo,!0),(0,Mt.A)(To,this,!!(t&Kt)),(0,Mt.A)(Ro,this,!!(t&Qt)),this.name=i,this.intent=n,this.usage=s}get visible(){if((0,St.A)(Po,this))return(0,St.A)(Fo,this);if(!(0,St.A)(Fo,this))return!1;const{print:t,view:e}=this.usage;return(0,St.A)(To,this)?"OFF"!==(null===e||void 0===e?void 0:e.viewState):!(0,St.A)(Ro,this)||"OFF"!==(null===t||void 0===t?void 0:t.printState)}_setVisible(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t!==Lo&&Ve("Internal method `_setVisible` called."),(0,Mt.A)(Po,this,i),(0,Mt.A)(Fo,this,e)}}var Do=new WeakMap,Oo=new WeakMap,No=new WeakMap,Wo=new WeakMap,jo=new WeakSet;class Bo{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kt;if((0,_t.A)(this,jo),(0,Ct.A)(this,Do,null),(0,Ct.A)(this,Oo,new Map),(0,Ct.A)(this,No,null),(0,Ct.A)(this,Wo,null),this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,(0,Mt.A)(Wo,this,t.order);for(const i of t.groups)(0,St.A)(Oo,this).set(i.id,new Io(e,i));if("OFF"===t.baseState)for(const t of(0,St.A)(Oo,this).values())t._setVisible(Lo,!1);for(const e of t.on)(0,St.A)(Oo,this).get(e)._setVisible(Lo,!0);for(const e of t.off)(0,St.A)(Oo,this).get(e)._setVisible(Lo,!1);(0,Mt.A)(No,this,this.getHash())}}isVisible(t){if(0===(0,St.A)(Oo,this).size)return!0;if(!t)return ze("Optional content group not defined."),!0;if("OCG"===t.type)return(0,St.A)(Oo,this).has(t.id)?(0,St.A)(Oo,this).get(t.id).visible:(Ue("Optional content group not found: ".concat(t.id)),!0);if("OCMD"===t.type){if(t.expression)return(0,xt.A)(jo,this,Ho).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!(0,St.A)(Oo,this).has(e))return Ue("Optional content group not found: ".concat(e)),!0;if((0,St.A)(Oo,this).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!(0,St.A)(Oo,this).has(e))return Ue("Optional content group not found: ".concat(e)),!0;if(!(0,St.A)(Oo,this).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!(0,St.A)(Oo,this).has(e))return Ue("Optional content group not found: ".concat(e)),!0;if(!(0,St.A)(Oo,this).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!(0,St.A)(Oo,this).has(e))return Ue("Optional content group not found: ".concat(e)),!0;if((0,St.A)(Oo,this).get(e).visible)return!1}return!0}return Ue("Unknown optional content policy ".concat(t.policy,".")),!0}return Ue("Unknown group type ".concat(t.type,".")),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=(0,St.A)(Oo,this).get(t);i?(i._setVisible(Lo,!!e,!0),(0,Mt.A)(Do,this,null)):Ue("Optional content group not found: ".concat(t))}setOCGState(t){let e,{state:i,preserveRB:n}=t;for(const s of i){switch(s){case"ON":case"OFF":case"Toggle":e=s;continue}const t=(0,St.A)(Oo,this).get(s);if(t)switch(e){case"ON":t._setVisible(Lo,!0);break;case"OFF":t._setVisible(Lo,!1);break;case"Toggle":t._setVisible(Lo,!t.visible)}}(0,Mt.A)(Do,this,null)}get hasInitialVisibility(){return null===(0,St.A)(No,this)||this.getHash()===(0,St.A)(No,this)}getOrder(){return(0,St.A)(Oo,this).size?(0,St.A)(Wo,this)?(0,St.A)(Wo,this).slice():[...(0,St.A)(Oo,this).keys()]:null}getGroups(){return(0,St.A)(Oo,this).size>0?si((0,St.A)(Oo,this)):null}getGroup(t){return(0,St.A)(Oo,this).get(t)||null}getHash(){if(null!==(0,St.A)(Do,this))return(0,St.A)(Do,this);const t=new pa;for(const[e,i]of(0,St.A)(Oo,this))t.update("".concat(e,":").concat(i.visible));return(0,Mt.A)(Do,this,t.hexdigest())}}function Ho(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n<e;n++){const e=t[n];let s;if(Array.isArray(e))s=(0,xt.A)(jo,this,Ho).call(this,e);else{if(!(0,St.A)(Oo,this).has(e))return Ue("Optional content group not found: ".concat(e)),!0;s=(0,St.A)(Oo,this).get(e).visible}switch(i){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return"And"===i}class zo{constructor(t,e){let{disableRange:i=!1,disableStream:n=!1}=e;Ge(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:r,progressiveDone:a,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,(null===r||void 0===r?void 0:r.length)>0){const t=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!n,this._isRangeSupported=!i,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((t,e)=>{this._onReceiveData({begin:t,chunk:e})}),t.addProgressListener((t,e)=>{this._onProgress({loaded:t,total:e})}),t.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData(t){let{begin:e,chunk:i}=t;const n=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{Ge(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)}),"_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,i,n,s;void 0===t.total?null===(e=this._rangeReaders[0])||void 0===e||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded}):null===(n=this._fullRequestReader)||void 0===n||null===(s=n.onProgress)||void 0===s||s.call(n,{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(){Ge(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Uo(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Vo(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class Uo{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=i||!1,this._filename=nn(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Vo{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(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=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Go(t){let{getResponseHeader:e,isHttp:i,rangeChunkSize:n,disableRange:s}=t;const r={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e("Content-Length"),10);if(!Number.isInteger(a))return r;if(r.suggestedLength=a,a<=2*n)return r;if(s||!i)return r;if("bytes"!==e("Accept-Ranges"))return r;return"identity"!==(e("Content-Encoding")||"identity")||(r.allowRangeRequests=!0),r}function qo(t){const e=t("Content-Disposition");if(e){let t=function(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){i=i[1];let t=a(i);return t=unescape(t),t=o(t),t=l(t),r(t)}if(i=function(t){const e=[];let i;const s=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=s.exec(t));){let[,t,n,s]=i;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[n,s]}const r=[];for(let n=0;n<e.length&&n in e;++n){let[t,i]=e[n];i=a(i),t&&(i=unescape(i),0===n&&(i=o(i))),r.push(i)}return r.join("")}(t),i)return r(l(i));if(i=n("filename","i").exec(t),i){i=i[1];let t=a(i);return t=l(t),r(t)}function n(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function s(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const n=new TextDecoder(t,{fatal:!0}),s=ni(i);i=n.decode(s),e=!1}catch(n){}}return i}function r(t){return e&&/[\x80-\xff]/.test(t)&&(t=s("utf-8",t),e&&(t=s("iso-8859-1",t))),t}function a(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const i=e[t].indexOf('"');-1!==i&&(e[t]=e[t].slice(0,i),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function o(t){const e=t.indexOf("'");return-1===e?t:s(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function l(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,i,n){if("q"===i||"Q"===i)return s(e,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{n=atob(n)}catch(r){}return s(e,n)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(i){}if(nn(t))return t}return null}function Xo(t,e){return 404===t||0===t&&e.startsWith("file:")?new Je('Missing PDF "'+e+'".'):new $e("Unexpected server response (".concat(t,') while retrieving PDF "').concat(e,'".'),t)}function Yo(t){return 200===t||206===t}function Ko(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Qo(t){const e=new Headers;for(const i in t){const n=t[i];void 0!==n&&e.append(i,n)}return e}function Zo(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(Ue("getArrayBuffer - unexpected data format: ".concat(t)),new Uint8Array(t).buffer)}class Jo{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 Ge(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new $o(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new tl(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class $o{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=Qo(this._stream.httpHeaders);const i=e.url;fetch(i,Ko(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!Yo(t.status))throw Xo(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:n,suggestedLength:s}=Go({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=qo(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new ei("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:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Zo(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class tl{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController,this._headers=Qo(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(e,"-").concat(i-1));const s=n.url;fetch(s,Ko(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!Yo(t.status))throw Xo(t.status,s);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),{value:Zo(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class el{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,i){const n={begin:t,end:e};for(const s in i)n[s]=i[s];return this.request(n)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const s in this.httpHeaders){const t=this.httpHeaders[s];void 0!==t&&e.setRequestHeader(s,t)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1)),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(i){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){var i;const n=this.pendingRequests[t];n&&(null===(i=n.onProgress)||void 0===i||i.call(n,e))}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;var s;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void(null===(s=i.onError)||void 0===s||s.call(i,n.status));const r=n.status||200;var a;if(!(200===r&&206===i.expectedStatus)&&r!==i.expectedStatus)return void(null===(a=i.onError)||void 0===a||a.call(i,n.status));const o=function(t){const e=t.response;return"string"!==typeof e?e:ni(e).buffer}(n);if(206===r){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:o})}else if(o)i.onDone({begin:0,chunk:o});else{var l;null===(l=i.onError)||void 0===l||l.call(i,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()}}class il{constructor(t){this._source=t,this._manager=new el(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 Ge(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new nl(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new sl(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class nl{constructor(t,e){this._manager=t;const i={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(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=t=>e.getResponseHeader(t),{allowRangeRequests:n,suggestedLength:s}=Go({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=qo(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);if(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=Xo(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=Promise.withResolvers();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 sl{constructor(t,e,i){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,n),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;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=Xo(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=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const rl=/^file:\/\/\/[a-zA-Z]:\//;class al{constructor(t){this.source=t,this.url=function(t){const e=Sa.get("url"),i=e.parse(t);return"file:"===i.protocol||i.host?i:/^[a-z]:[/\\]/i.test(t)?e.parse("file:///".concat(t)):(i.host||(i.protocol="file:"),i)}(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 Ge(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new ul(this):new hl(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new pl(this,t,e):new dl(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class ol{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}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();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{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 ei("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class ll{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();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();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{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 cl(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class hl extends ol{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new Je('Missing PDF "'.concat(this._url,'".'));return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const i=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:n,suggestedLength:s}=Go({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=qo(i)};if(this._request=null,"http:"===this._url.protocol){const i=Sa.get("http");this._request=i.request(cl(this._url,t.httpHeaders),e)}else{const i=Sa.get("https");this._request=i.request(cl(this._url,t.httpHeaders),e)}this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class dl extends ll{constructor(t,e,i){super(t),this._httpHeaders={};for(const s in t.httpHeaders){const e=t.httpHeaders[s];void 0!==e&&(this._httpHeaders[s]=e)}this._httpHeaders.Range="bytes=".concat(e,"-").concat(i-1);const n=t=>{if(404===t.statusCode){const t=new Je('Missing PDF "'.concat(this._url,'".'));return void(this._storedError=t)}this._setReadableStream(t)};if(this._request=null,"http:"===this._url.protocol){const t=Sa.get("http");this._request=t.request(cl(this._url,this._httpHeaders),n)}else{const t=Sa.get("https");this._request=t.request(cl(this._url,this._httpHeaders),n)}this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class ul extends ol{constructor(t){super(t);let e=decodeURIComponent(this._url.path);rl.test(this._url.href)&&(e=e.replace(/^\//,""));const i=Sa.get("fs");i.promises.lstat(e).then(t=>{this._contentLength=t.size,this._setReadableStream(i.createReadStream(e)),this._headersCapability.resolve()},t=>{"ENOENT"===t.code&&(t=new Je('Missing PDF "'.concat(e,'".'))),this._storedError=t,this._headersCapability.reject(t)})}}class pl extends ll{constructor(t,e,i){super(t);let n=decodeURIComponent(this._url.path);rl.test(this._url.href)&&(n=n.replace(/^\//,""));const s=Sa.get("fs");this._setReadableStream(s.createReadStream(n,{start:e,end:i-1}))}}const fl=30;var gl=new WeakMap,Al=new WeakMap,ml=new WeakMap,vl=new WeakMap,bl=new WeakMap,wl=new WeakMap,yl=new WeakMap,_l=new WeakMap,xl=new WeakMap,El=new WeakMap,kl=new WeakMap,Cl=new WeakMap,Sl=new WeakMap,Ml=new WeakMap,Ll=new WeakMap,Tl=new WeakMap,Rl=new WeakMap,Pl=new WeakMap,Fl=new WeakSet;class Il{constructor(t){var e;let{textContentSource:i,container:n,viewport:s}=t;if((0,_t.A)(this,Fl),(0,Ct.A)(this,gl,Promise.withResolvers()),(0,Ct.A)(this,Al,null),(0,Ct.A)(this,ml,!1),(0,Ct.A)(this,vl,!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled)),(0,Ct.A)(this,bl,null),(0,Ct.A)(this,wl,null),(0,Ct.A)(this,yl,0),(0,Ct.A)(this,_l,0),(0,Ct.A)(this,xl,null),(0,Ct.A)(this,El,null),(0,Ct.A)(this,kl,0),(0,Ct.A)(this,Cl,0),(0,Ct.A)(this,Sl,Object.create(null)),(0,Ct.A)(this,Ml,[]),(0,Ct.A)(this,Ll,null),(0,Ct.A)(this,Tl,[]),(0,Ct.A)(this,Rl,new WeakMap),(0,Ct.A)(this,Pl,null),i instanceof ReadableStream)(0,Mt.A)(Ll,this,i);else{if("object"!==typeof i)throw new Error('No "textContentSource" parameter specified.');(0,Mt.A)(Ll,this,new ReadableStream({start(t){t.enqueue(i),t.close()}}))}(0,Mt.A)(Al,this,(0,Mt.A)(El,this,n)),(0,Mt.A)(Cl,this,s.scale*(globalThis.devicePixelRatio||1)),(0,Mt.A)(kl,this,s.rotation),(0,Mt.A)(wl,this,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:r,pageHeight:a,pageX:o,pageY:l}=s.rawDims;(0,Mt.A)(Pl,this,[1,0,0,-1,-o,l+a]),(0,Mt.A)(_l,this,r),(0,Mt.A)(yl,this,a),jl.call(Il),An(n,s),(0,St.A)(gl,this).promise.catch(()=>{}).then(()=>{Vl._.delete(this),(0,Mt.A)(wl,this,null),(0,Mt.A)(Sl,this,null)})}render(){const t=()=>{(0,St.A)(xl,this).read().then(e=>{var i;let{value:n,done:s}=e;s?(0,St.A)(gl,this).resolve():(null!==(i=(0,St.A)(bl,this))&&void 0!==i||(0,Mt.A)(bl,this,n.lang),Object.assign((0,St.A)(Sl,this),n.styles),(0,xt.A)(Fl,this,Dl).call(this,n.items),t())},(0,St.A)(gl,this).reject)};return(0,Mt.A)(xl,this,(0,St.A)(Ll,this).getReader()),Vl._.add(this),t(),(0,St.A)(gl,this).promise}update(t){let{viewport:e,onBefore:i=null}=t;const n=e.scale*(globalThis.devicePixelRatio||1),s=e.rotation;if(s!==(0,St.A)(kl,this)&&(null===i||void 0===i||i(),(0,Mt.A)(kl,this,s),An((0,St.A)(El,this),{rotation:s})),n!==(0,St.A)(Cl,this)){null===i||void 0===i||i(),(0,Mt.A)(Cl,this,n);const t={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:Wl.call(Il,(0,St.A)(bl,this))};for(const e of(0,St.A)(Tl,this))t.properties=(0,St.A)(Rl,this).get(e),t.div=e,(0,xt.A)(Fl,this,Nl).call(this,t)}}cancel(){var t;const e=new ei("TextLayer task cancelled.");null===(t=(0,St.A)(xl,this))||void 0===t||t.cancel(e).catch(()=>{}),(0,Mt.A)(xl,this,null),(0,St.A)(gl,this).reject(e)}get textDivs(){return(0,St.A)(Tl,this)}get textContentItemsStr(){return(0,St.A)(Ml,this)}static cleanup(){if(!((0,xt.A)(Il,this,Vl)._.size>0)){(0,xt.A)(Il,this,Hl)._.clear();for(const{canvas:t}of(0,xt.A)(Il,this,zl)._.values())t.remove();(0,xt.A)(Il,this,zl)._.clear()}}}function Dl(t){var e,i;if((0,St.A)(ml,this))return;null!==(i=(e=(0,St.A)(wl,this)).ctx)&&void 0!==i||(e.ctx=Wl.call(Dt,(0,St.A)(bl,this)));const n=(0,St.A)(Tl,this),s=(0,St.A)(Ml,this);for(const r of t){if(n.length>1e5)return Ue("Ignoring additional textDivs for performance reasons."),void(0,Mt.A)(ml,this,!0);if(void 0!==r.str)s.push(r.str),(0,xt.A)(Fl,this,Ol).call(this,r);else if("beginMarkedContentProps"===r.type||"beginMarkedContent"===r.type){const t=(0,St.A)(Al,this);(0,Mt.A)(Al,this,document.createElement("span")),(0,St.A)(Al,this).classList.add("markedContent"),null!==r.id&&(0,St.A)(Al,this).setAttribute("id","".concat(r.id)),t.append((0,St.A)(Al,this))}else"endMarkedContent"===r.type&&(0,Mt.A)(Al,this,(0,St.A)(Al,this).parentNode)}}function Ol(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};(0,St.A)(Tl,this).push(e);const n=oi.transform((0,St.A)(Pl,this),t.transform);let s=Math.atan2(n[1],n[0]);const r=(0,St.A)(Sl,this)[t.fontName];r.vertical&&(s+=Math.PI/2);const a=(0,St.A)(vl,this)&&r.fontSubstitution||r.fontFamily,o=Math.hypot(n[2],n[3]),l=o*Bl.call(Dt,a,(0,St.A)(bl,this));let c,h;0===s?(c=n[4],h=n[5]-l):(c=n[4]+l*Math.sin(s),h=n[5]-l*Math.cos(s));const d="calc(var(--scale-factor)*",u=e.style;(0,St.A)(Al,this)===(0,St.A)(El,this)?(u.left="".concat((100*c/(0,St.A)(_l,this)).toFixed(2),"%"),u.top="".concat((100*h/(0,St.A)(yl,this)).toFixed(2),"%")):(u.left="".concat(d).concat(c.toFixed(2),"px)"),u.top="".concat(d).concat(h.toFixed(2),"px)")),u.fontSize="".concat(d).concat((Ul._*o).toFixed(2),"px)"),u.fontFamily=a,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,(0,St.A)(vl,this)&&(e.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),0!==s&&(i.angle=s*(180/Math.PI));let p=!1;if(t.str.length>1)p=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),i=Math.abs(t.transform[3]);e!==i&&Math.max(e,i)/Math.min(e,i)>1.5&&(p=!0)}if(p&&(i.canvasWidth=r.vertical?t.height:t.width),(0,St.A)(Rl,this).set(e,i),(0,St.A)(wl,this).div=e,(0,St.A)(wl,this).properties=i,(0,xt.A)(Fl,this,Nl).call(this,(0,St.A)(wl,this)),i.hasText&&(0,St.A)(Al,this).append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),(0,St.A)(Al,this).append(t)}}function Nl(t){const{div:e,properties:i,ctx:n,prevFontSize:s,prevFontFamily:r}=t,{style:a}=e;let o="";if(Ul._>1&&(o="scale(".concat(1/Ul._,")")),0!==i.canvasWidth&&i.hasText){const{fontFamily:l}=a,{canvasWidth:c,fontSize:h}=i;s===h&&r===l||(n.font="".concat(h*(0,St.A)(Cl,this),"px ").concat(l),t.prevFontSize=h,t.prevFontFamily=l);const{width:d}=n.measureText(e.textContent);d>0&&(o="scaleX(".concat(c*(0,St.A)(Cl,this)/d,") ").concat(o))}0!==i.angle&&(o="rotate(".concat(i.angle,"deg) ").concat(o)),o.length>0&&(a.transform=o)}function Wl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=(0,xt.A)(Dt,this,zl)._.get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),(0,xt.A)(Dt,this,zl)._.set(t,e)}return e}function jl(){if(null!==(0,xt.A)(Dt,this,Ul)._)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),Ul._=(0,xt.A)(Dt,this,t.getBoundingClientRect().height),t.remove()}function Bl(t,e){const i=(0,xt.A)(Dt,this,Hl)._.get(t);if(i)return i;const n=(0,xt.A)(Dt,this,Wl).call(this,e),s=n.font;n.canvas.width=n.canvas.height=fl,n.font="".concat(fl,"px ").concat(t);const r=n.measureText("");let a=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);if(a){const e=a/(a+o);return(0,xt.A)(Dt,this,Hl)._.set(t,e),n.canvas.width=n.canvas.height=0,n.font=s,e}n.strokeStyle="red",n.clearRect(0,0,fl,fl),n.strokeText("g",0,0);let l=n.getImageData(0,0,fl,fl).data;o=0;for(let h=l.length-1-3;h>=0;h-=4)if(l[h]>0){o=Math.ceil(h/4/fl);break}n.clearRect(0,0,fl,fl),n.strokeText("A",0,fl),l=n.getImageData(0,0,fl,fl).data,a=0;for(let h=0,d=l.length;h<d;h+=4)if(l[h]>0){a=fl-Math.floor(h/4/fl);break}n.canvas.width=n.canvas.height=0,n.font=s;const c=a?a/(a+o):.8;return(0,xt.A)(Dt,this,Hl)._.set(t,c),c}Dt=Il;var Hl={_:new Map},zl={_:new Map},Ul={_:null},Vl={_:new Set};function Gl(){cn("`renderTextLayer`, please use `TextLayer` instead.");const t=arguments[0],{textContentSource:e,container:i,viewport:n}=t,s=(0,yt.A)(t,Lt),r=Object.keys(s);r.length>0&&Ue("Ignoring `renderTextLayer` parameters: "+r.join(", "));const a=new Il({textContentSource:e,container:i,viewport:n}),{textDivs:o,textContentItemsStr:l}=a;return{promise:a.render(),textDivs:o,textContentItemsStr:l}}function ql(){cn("`updateTextLayer`, please use `TextLayer` instead.")}class Xl{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){var n;if(!i)return;let s=null;const r=i.name;if("#text"===r)s=i.value;else{if(!Xl.shouldBuildText(r))return;null!==i&&void 0!==i&&null!==(n=i.attributes)&&void 0!==n&&n.textContent?s=i.attributes.textContent:i.value&&(s=i.value)}if(null!==s&&e.push({str:s}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}const Yl=65536,Kl=Vt?class extends ki{_createCanvas(t,e){return Sa.get("canvas").createCanvas(t,e)}}:class extends ki{constructor(){let{ownerDocument:t=globalThis.document,enableHWA:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}},Ql=Vt?class extends Ci{_fetchData(t,e){return Ma(t).then(t=>({cMapData:t,compressionType:e}))}}:Qi,Zl=Vt?class extends xi{}:class extends xi{constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),(0,_t.A)(this,Ni),(0,Ct.A)(this,Ri,void 0),(0,Ct.A)(this,Pi,void 0),(0,Ct.A)(this,Fi,void 0),(0,Ct.A)(this,Ii,void 0),(0,Ct.A)(this,Di,void 0),(0,Ct.A)(this,Oi,0),(0,Mt.A)(Fi,this,t),(0,Mt.A)(Ii,this,e)}addFilter(t){var e,i;if(!t)return"none";let n=Et(Ni,this,Wi).get(t);if(n)return n;const[s,r,a]=(0,xt.A)(Ni,this,Hi).call(this,t),o=1===t.length?s:"".concat(s).concat(r).concat(a);if(n=Et(Ni,this,Wi).get(o),n)return Et(Ni,this,Wi).set(t,n),n;const l="g_".concat((0,St.A)(Fi,this),"_transfer_map_").concat(((0,Mt.A)(Oi,this,(e=(0,St.A)(Oi,this),i=e++,e)),i)),c="url(#".concat(l,")");Et(Ni,this,Wi).set(t,c),Et(Ni,this,Wi).set(o,c);const h=(0,xt.A)(Ni,this,Vi).call(this,l);return(0,xt.A)(Ni,this,qi).call(this,s,r,a,h),c}addHCMFilter(t,e){var i;const n="".concat(t,"-").concat(e),s="base";let r=Et(Ni,this,ji).get(s);if((null===(i=r)||void 0===i?void 0:i.key)===n)return r.url;var a;r?(null===(a=r.filter)||void 0===a||a.remove(),r.key=n,r.url="none",r.filter=null):(r={key:n,url:"none",filter:null},Et(Ni,this,ji).set(s,r));if(!t||!e)return r.url;const o=(0,xt.A)(Ni,this,Yi).call(this,t);t=oi.makeHexColor(...o);const l=(0,xt.A)(Ni,this,Yi).call(this,e);if(e=oi.makeHexColor(...l),Et(Ni,this,Bi).style.color="","#000000"===t&&"#ffffff"===e||t===e)return r.url;const c=new Array(256);for(let f=0;f<=255;f++){const t=f/255;c[f]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const h=c.join(","),d="g_".concat((0,St.A)(Fi,this),"_hcm_filter"),u=r.filter=(0,xt.A)(Ni,this,Vi).call(this,d);(0,xt.A)(Ni,this,qi).call(this,h,h,h,u),(0,xt.A)(Ni,this,Ui).call(this,u);const p=(t,e)=>{const i=o[t]/255,n=l[t]/255,s=new Array(e+1);for(let r=0;r<=e;r++)s[r]=i+r/e*(n-i);return s.join(",")};return(0,xt.A)(Ni,this,qi).call(this,p(0,5),p(1,5),p(2,5),u),r.url="url(#".concat(d,")"),r.url}addAlphaFilter(t){var e,i;let n=Et(Ni,this,Wi).get(t);if(n)return n;const[s]=(0,xt.A)(Ni,this,Hi).call(this,[t]),r="alpha_".concat(s);if(n=Et(Ni,this,Wi).get(r),n)return Et(Ni,this,Wi).set(t,n),n;const a="g_".concat((0,St.A)(Fi,this),"_alpha_map_").concat(((0,Mt.A)(Oi,this,(e=(0,St.A)(Oi,this),i=e++,e)),i)),o="url(#".concat(a,")");Et(Ni,this,Wi).set(t,o),Et(Ni,this,Wi).set(r,o);const l=(0,xt.A)(Ni,this,Vi).call(this,a);return(0,xt.A)(Ni,this,Xi).call(this,s,l),o}addLuminosityFilter(t){var e,i;let n,s,r=Et(Ni,this,Wi).get(t||"luminosity");if(r)return r;if(t?([n]=(0,xt.A)(Ni,this,Hi).call(this,[t]),s="luminosity_".concat(n)):s="luminosity",r=Et(Ni,this,Wi).get(s),r)return Et(Ni,this,Wi).set(t,r),r;const a="g_".concat((0,St.A)(Fi,this),"_luminosity_map_").concat(((0,Mt.A)(Oi,this,(e=(0,St.A)(Oi,this),i=e++,e)),i)),o="url(#".concat(a,")");Et(Ni,this,Wi).set(t,o),Et(Ni,this,Wi).set(s,o);const l=(0,xt.A)(Ni,this,Vi).call(this,a);return(0,xt.A)(Ni,this,zi).call(this,l),t&&(0,xt.A)(Ni,this,Xi).call(this,n,l),o}addHighlightHCMFilter(t,e,i,n,s){var r;const a="".concat(e,"-").concat(i,"-").concat(n,"-").concat(s);let o=Et(Ni,this,ji).get(t);if((null===(r=o)||void 0===r?void 0:r.key)===a)return o.url;var l;o?(null===(l=o.filter)||void 0===l||l.remove(),o.key=a,o.url="none",o.filter=null):(o={key:a,url:"none",filter:null},Et(Ni,this,ji).set(t,o));if(!e||!i)return o.url;const[c,h]=[e,i].map((0,xt.A)(Ni,this,Yi).bind(this));let d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),u=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[p,f]=[n,s].map((0,xt.A)(Ni,this,Yi).bind(this));u<d&&([d,u,p,f]=[u,d,f,p]),Et(Ni,this,Bi).style.color="";const g=(t,e,i)=>{const n=new Array(256),s=(u-d)/i,r=t/255,a=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(d+l*s),e=r+l*a;for(let i=o;i<=t;i++)n[i]=e;o=t+1}for(let l=o;l<256;l++)n[l]=n[o-1];return n.join(",")},A="g_".concat((0,St.A)(Fi,this),"_hcm_").concat(t,"_filter"),m=o.filter=(0,xt.A)(Ni,this,Vi).call(this,A);return(0,xt.A)(Ni,this,Ui).call(this,m),(0,xt.A)(Ni,this,qi).call(this,g(p[0],f[0],5),g(p[1],f[1],5),g(p[2],f[2],5),m),o.url="url(#".concat(A,")"),o.url}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&0!==Et(Ni,this,ji).size||((0,St.A)(Pi,this)&&((0,St.A)(Pi,this).parentNode.parentNode.remove(),(0,Mt.A)(Pi,this,null)),(0,St.A)(Ri,this)&&((0,St.A)(Ri,this).clear(),(0,Mt.A)(Ri,this,null)),(0,Mt.A)(Oi,this,0))}},Jl=Vt?class extends Si{_fetchData(t){return Ma(t)}}:Zi;function $l(){var t,e;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"===typeof i||i instanceof URL?i={url:i}:(i instanceof ArrayBuffer||ArrayBuffer.isView(i))&&(i={data:i});const n=new ec,{docId:s}=n,r=i.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch(e){if(Vt&&"string"===typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(i.url):null,a=i.data?function(t){if(Vt&&"undefined"!==typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"===typeof t)return ni(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===typeof t&&!isNaN(null===t||void 0===t?void 0:t.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(i.data):null,o=i.httpHeaders||null,l=!0===i.withCredentials,c=null!==(t=i.password)&&void 0!==t?t:null,h=i.range instanceof nc?i.range:null,d=Number.isInteger(i.rangeChunkSize)&&i.rangeChunkSize>0?i.rangeChunkSize:Yl;let u=i.worker instanceof Ac?i.worker:null;const p=i.verbosity,f="string"!==typeof i.docBaseUrl||en(i.docBaseUrl)?null:i.docBaseUrl,g="string"===typeof i.cMapUrl?i.cMapUrl:null,A=!1!==i.cMapPacked,m=i.CMapReaderFactory||Ql,v="string"===typeof i.standardFontDataUrl?i.standardFontDataUrl:null,b=i.StandardFontDataFactory||Jl,w=!0!==i.stopAtErrors,y=Number.isInteger(i.maxImageSize)&&i.maxImageSize>-1?i.maxImageSize:-1,_=!1!==i.isEvalSupported,x="boolean"===typeof i.isOffscreenCanvasSupported?i.isOffscreenCanvasSupported:!Vt,E=Number.isInteger(i.canvasMaxAreaInBytes)?i.canvasMaxAreaInBytes:-1,k="boolean"===typeof i.disableFontFace?i.disableFontFace:Vt,C=!0===i.fontExtraProperties,S=!0===i.enableXfa,M=i.ownerDocument||globalThis.document,L=!0===i.disableRange,T=!0===i.disableStream,R=!0===i.disableAutoFetch,P=!0===i.pdfBug,F=!0===i.enableHWA,I=h?h.length:null!==(e=i.length)&&void 0!==e?e:NaN,D="boolean"===typeof i.useSystemFonts?i.useSystemFonts:!Vt&&!k,O="boolean"===typeof i.useWorkerFetch?i.useWorkerFetch:m===Qi&&b===Zi&&g&&v&&on(g,document.baseURI)&&on(v,document.baseURI),N=i.canvasFactory||new Kl({ownerDocument:M,enableHWA:F}),W=i.filterFactory||new Zl({docId:s,ownerDocument:M});Be(p);const j={canvasFactory:N,filterFactory:W};if(O||(j.cMapReaderFactory=new m({baseUrl:g,isCompressed:A}),j.standardFontDataFactory=new b({baseUrl:v})),!u){const t={verbosity:p,port:ao.workerPort};u=t.port?Ac.fromPort(t):new Ac(t),n._worker=u}const B={docId:s,apiVersion:"4.4.168",data:a,password:c,disableAutoFetch:R,rangeChunkSize:d,length:I,docBaseUrl:f,enableXfa:S,evaluatorOptions:{maxImageSize:y,disableFontFace:k,ignoreErrors:w,isEvalSupported:_,isOffscreenCanvasSupported:x,canvasMaxAreaInBytes:E,fontExtraProperties:C,useSystemFonts:D,cMapUrl:O?g:null,standardFontDataUrl:O?v:null}},H={disableFontFace:k,fontExtraProperties:C,ownerDocument:M,pdfBug:P,styleElement:null,loadingParams:{disableAutoFetch:R,enableXfa:S}};return u.promise.then(function(){if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const t=u.messageHandler.sendWithPromise("GetDocRequest",B,a?[a.buffer]:null);let e;if(h)e=new zo(h,{disableRange:L,disableStream:T});else if(!a){if(!r)throw new Error("getDocument - no `url` parameter provided.");e=(t=>{if(Vt){return function(){return"undefined"!==typeof fetch&&"undefined"!==typeof Response&&"body"in Response.prototype}()&&on(t.url)?new Jo(t):new al(t)}return on(t.url)?new Jo(t):new il(t)})({url:r,length:I,httpHeaders:o,withCredentials:l,rangeChunkSize:d,disableRange:L,disableStream:T})}return t.then(t=>{if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const i=new _o(s,t,u.port),r=new Cc(i,n,e,H,j);n._transport=r,i.send("Ready",null)})}).catch(n._capability.reject),n}function tc(t){return"object"===typeof t&&Number.isInteger(null===t||void 0===t?void 0:t.num)&&t.num>=0&&Number.isInteger(null===t||void 0===t?void 0:t.gen)&&t.gen>=0}class ec{constructor(){var t,e;this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d".concat((ic._=(t=ic._,e=t++,t),e)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{var t,e;null!==(t=this._worker)&&void 0!==t&&t.port&&(this._worker._pendingDestroy=!0),await(null===(e=this._transport)||void 0===e?void 0:e.destroy())}catch(n){var i;throw null!==(i=this._worker)&&void 0!==i&&i.port&&delete this._worker._pendingDestroy,n}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}var ic={_:0};class nc{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}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 i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then(()=>{for(const i of this._progressListeners)i(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){Ve("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class sc{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 Xe(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var rc=new WeakMap,ac=new WeakMap,oc=new WeakSet;class lc{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,_t.A)(this,oc),(0,Ct.A)(this,rc,null),(0,Ct.A)(this,ac,!1),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new an:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new Rc,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:i=0,offsetY:n=0,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new $i({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Xe(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,i;let{canvasContext:n,viewport:s,intent:r="display",annotationMode:a=ee.ENABLE,transform:o=null,background:l=null,optionalContentConfigPromise:c=null,annotationCanvasMap:h=null,pageColors:d=null,printAnnotationStorage:u=null}=t;null===(e=this._stats)||void 0===e||e.time("Overall");const p=this._transport.getRenderingIntent(r,a,u),{renderingIntent:f,cacheKey:g}=p;(0,Mt.A)(ac,this,!1),(0,xt.A)(oc,this,hc).call(this),c||(c=this._transport.getOptionalContentConfig(f));let A=this._intentStates.get(g);A||(A=Object.create(null),this._intentStates.set(g,A)),A.streamReaderCancelTimeout&&(clearTimeout(A.streamReaderCancelTimeout),A.streamReaderCancelTimeout=null);const m=!!(f&Qt);var v;A.displayReadyCapability||(A.displayReadyCapability=Promise.withResolvers(),A.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(v=this._stats)||void 0===v||v.time("Page Request"),this._pumpOperatorList(p));const b=t=>{var e;(A.renderTasks.delete(w),(this._maybeCleanupAfterRender||m)&&(0,Mt.A)(ac,this,!0),(0,xt.A)(oc,this,cc).call(this,!m),t?(w.capability.reject(t),this._abortOperatorList({intentState:A,reason:t instanceof Error?t:new Error(t)})):w.capability.resolve(),this._stats)&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!==(e=globalThis.Stats)&&void 0!==e&&e.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},w=new Oc({callback:b,params:{canvasContext:n,viewport:s,transform:o,background:l},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:A.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!m,pdfBug:this._pdfBug,pageColors:d});((i=A).renderTasks||(i.renderTasks=new Set)).add(w);const y=w.task;return Promise.all([A.displayReadyCapability.promise,c]).then(t=>{var e;let[i,n]=t;if(this.destroyed)b();else{if(null===(e=this._stats)||void 0===e||e.time("Rendering"),!(n.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");w.initializeGraphics({transparency:i,optionalContentConfig:n}),w.operatorListChanged()}}).catch(b),y}getOperatorList(){let{intent:t="display",annotationMode:e=ee.ENABLE,printAnnotationStorage:i=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=this._transport.getRenderingIntent(t,e,i,!0);let s,r=this._intentStates.get(n.cacheKey);var a,o;(r||(r=Object.create(null),this._intentStates.set(n.cacheKey,r)),r.opListReadCapability)||(s=Object.create(null),s.operatorListChanged=function(){r.operatorList.lastChunk&&(r.opListReadCapability.resolve(r.operatorList),r.renderTasks.delete(s))},r.opListReadCapability=Promise.withResolvers(),((a=r).renderTasks||(a.renderTasks=new Set)).add(s),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(o=this._stats)||void 0===o||o.time("Page Request"),this._pumpOperatorList(n));return r.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=>Xl.textContent(t));const e=this.streamTextContent(t);return new Promise(function(t,i){const n=e.getReader(),s={items:[],styles:Object.create(null),lang:null};!function e(){n.read().then(function(i){var n;let{value:r,done:a}=i;a?t(s):(null!==(n=s.lang)&&void 0!==n||(s.lang=r.lang),Object.assign(s.styles,r.styles),s.items.push(...r.items),e())},i)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),(0,Mt.A)(ac,this,!1),(0,xt.A)(oc,this,hc).call(this),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,Mt.A)(ac,this,!0);const e=(0,xt.A)(oc,this,cc).call(this,!1);return t&&e&&this._stats&&(this._stats=new an),e}_startRenderPage(t,e){var i,n;const s=this._intentStates.get(e);s&&(null===(i=this._stats)||void 0===i||i.timeEnd("Page Request"),null===(n=s.displayReadyCapability)||void 0===n||n.resolve(t))}_renderPageChunk(t,e){for(let i=0,n=t.length;i<n;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const i of e.renderTasks)i.operatorListChanged();t.lastChunk&&(0,xt.A)(oc,this,cc).call(this,!0)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:i,annotationStorageSerializable:n}=t;const{map:s,transfer:r}=n,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:s},r).getReader(),o=this._intentStates.get(i);o.streamReader=a;const l=()=>{a.read().then(t=>{let{value:e,done:i}=t;i?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,o),l())},t=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();(0,xt.A)(oc,this,cc).call(this,!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}})};l()}_abortOperatorList(t){let{intentState:e,reason:i,force:n=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(i instanceof tn){let t=100;return i.extraDelay>0&&i.extraDelay<1e3&&(t+=i.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})},t))}}if(e.streamReader.cancel(new ei(i.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[t,i]of this._intentStates)if(i===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}function cc(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if((0,xt.A)(oc,this,hc).call(this),!(0,St.A)(ac,this)||this.destroyed)return!1;if(t)return(0,Mt.A)(rc,this,setTimeout(()=>{(0,Mt.A)(rc,this,null),(0,xt.A)(oc,this,cc).call(this,!1)},5e3)),!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),(0,Mt.A)(ac,this,!1),!0}function hc(){(0,St.A)(rc,this)&&(clearTimeout((0,St.A)(rc,this)),(0,Mt.A)(rc,this,null))}var dc=new WeakMap,uc=new WeakMap;class pc{constructor(){(0,Ct.A)(this,dc,new Set),(0,Ct.A)(this,uc,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};(0,St.A)(uc,this).then(()=>{for(const t of(0,St.A)(dc,this))t.call(this,i)})}addEventListener(t,e){(0,St.A)(dc,this).add(e)}removeEventListener(t,e){(0,St.A)(dc,this).delete(e)}terminate(){(0,St.A)(dc,this).clear()}}const fc={isWorkerDisabled:!1,fakeWorkerId:0};Vt&&(fc.isWorkerDisabled=!0,ao.workerSrc||(ao.workerSrc="./pdf.worker.mjs")),fc.isSameOrigin=function(t,e){let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch(s){return!1}const n=new URL(e,i);return i.origin===n.origin},fc.createCDNWrapper=function(t){const e='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};var gc=new WeakSet;class Ac{constructor(){let{name:t=null,port:e=null,verbosity:i=He()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,_t.A)(this,gc),this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){var n;if(null!==(n=bc._)&&void 0!==n&&n.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(bc._||(bc._=new WeakMap)).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return Vt?Promise.all([Sa.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new _o("main","worker",t),this._messageHandler.on("ready",function(){}),(0,xt.A)(gc,this,mc).call(this)}_initialize(){if(fc.isWorkerDisabled||vc(Ac))return void this._setupFakeWorker();let{workerSrc:t}=Ac;try{fc.isSameOrigin(window.location.href,t)||(t=fc.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new _o("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;e.addEventListener("error",()=>{this._webWorker||n()},{signal:s.signal}),i.on("test",t=>{s.abort(),!this.destroyed&&t?(this._messageHandler=i,this._port=e,this._webWorker=e,(0,xt.A)(gc,this,mc).call(this)):n()}),i.on("ready",t=>{if(s.abort(),this.destroyed)n();else try{r()}catch(e){this._setupFakeWorker()}});const r=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void r()}catch(e){ze("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){fc.isWorkerDisabled||(Ue("Setting up fake worker."),fc.isWorkerDisabled=!0),Ac._setupFakeWorkerGlobal.then(t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new pc;this._port=e;const i="fake".concat(fc.fakeWorkerId++),n=new _o(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new _o(i,i+"_worker",e),(0,xt.A)(gc,this,mc).call(this)}).catch(t=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))})}destroy(){var t;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null===(t=bc._)||void 0===t||t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){var e;if(null===t||void 0===t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const i=null===(e=(0,xt.A)(Ac,this,bc)._)||void 0===e?void 0:e.get(t.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new Ac(t)}static get workerSrc(){if(ao.workerSrc)return ao.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Xe(this,"_setupFakeWorkerGlobal",(async()=>{if(Et(Ac,this,vc))return Et(Ac,this,vc);return(await i(50789)(this.workerSrc)).WorkerMessageHandler})())}}function mc(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}function vc(t){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch(i){return null}}var bc={_:void 0},wc=new WeakMap,yc=new WeakMap,_c=new WeakMap,xc=new WeakMap,Ec=new WeakMap,kc=new WeakSet;class Cc{constructor(t,e,i,n,s){(0,_t.A)(this,kc),(0,Ct.A)(this,wc,new Map),(0,Ct.A)(this,yc,new Map),(0,Ct.A)(this,_c,new Map),(0,Ct.A)(this,xc,new Map),(0,Ct.A)(this,Ec,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Rc,this.fontLoader=new xa({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return Xe(this,"annotationStorage",new va)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ee.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=Kt,r=fa;switch(t){case"any":s=Yt;break;case"display":break;case"print":s=Qt;break;default:Ue("getRenderingIntent - invalid intent: ".concat(t))}switch(e){case ee.DISABLE:s+=$t;break;case ee.ENABLE:break;case ee.ENABLE_FORMS:s+=Zt;break;case ee.ENABLE_STORAGE:s+=Jt;r=(s&Qt&&i instanceof ya?i:this.annotationStorage).serializable;break;default:Ue("getRenderingIntent - invalid annotationMode: ".concat(e))}return n&&(s+=te),{renderingIntent:s,cacheKey:"".concat(s,"_").concat(r.hash),annotationStorageSerializable:r}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null===(t=(0,St.A)(Ec,this))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of(0,St.A)(yc,this).values())e.push(n._destroy());(0,St.A)(yc,this).clear(),(0,St.A)(_c,this).clear(),(0,St.A)(xc,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return e.push(i),Promise.all(e).then(()=>{var t;this.commonObjs.clear(),this.fontLoader.clear(),(0,St.A)(wc,this).clear(),this.filterFactory.destroy(),Il.cleanup(),null===(t=this._networkStream)||void 0===t||t.cancelAllRequests(new ei("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)=>{Ge(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:i,done:n}=t;n?e.close():(Ge(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))}).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 i=Promise.withResolvers(),n=this._fullReader;return n.headersReady.then(()=>{if(!n.isStreamingSupported||!n.isRangeSupported){var t;if(this._lastProgress)null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress);n.onProgress=t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}}i.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})},i.reject),i.promise}),t.on("GetRangeReader",(t,e)=>{Ge(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then(function(t){let{value:i,done:n}=t;n?e.close():(Ge(i instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{i.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}):e.close()}),t.on("GetDoc",t=>{let{pdfInfo:i}=t;this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new sc(i,this))}),t.on("DocException",function(t){let i;switch(t.name){case"PasswordException":i=new Ke(t.message,t.code);break;case"InvalidPDFException":i=new Ze(t.message);break;case"MissingPDFException":i=new Je(t.message);break;case"UnexpectedResponseException":i=new $e(t.message,t.status);break;case"UnknownErrorException":i=new Qe(t.message,t.details);break;default:Ve("DocException - expected a valid Error.")}e._capability.reject(i)}),t.on("PasswordRequest",t=>{if((0,Mt.A)(Ec,this,Promise.withResolvers()),e.onPassword){const n=t=>{t instanceof Error?(0,St.A)(Ec,this).reject(t):(0,St.A)(Ec,this).resolve({password:t})};try{e.onPassword(n,t.code)}catch(i){(0,St.A)(Ec,this).reject(i)}}else(0,St.A)(Ec,this).reject(new Ke(t.message,t.code));return(0,St.A)(Ec,this).promise}),t.on("DataLoaded",t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{if(this.destroyed)return;(0,St.A)(yc,this).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",e=>{var i;let[n,s,r]=e;if(this.destroyed)return null;if(this.commonObjs.has(n))return null;switch(s){case"Font":const{disableFontFace:e,fontExtraProperties:a,pdfBug:o}=this._params;if("error"in r){const t=r.error;Ue("Error during font loading: ".concat(t)),this.commonObjs.resolve(n,t);break}const l=o&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,c=new Ea(r,{disableFontFace:e,inspectFont:l});this.fontLoader.bind(c).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!a&&c.data&&(c.data=null),this.commonObjs.resolve(n,c)});break;case"CopyLocalImage":const{imageRef:h}=r;Ge(h,"The imageRef must be defined.");for(const t of(0,St.A)(yc,this).values())for(const[,e]of t.objs)if((null===e||void 0===e?void 0:e.ref)===h)return e.dataLen?(this.commonObjs.resolve(n,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,r);break;default:throw new Error("Got unknown common object type ".concat(s))}return null}),t.on("obj",t=>{let[e,i,n,s]=t;if(this.destroyed)return;const r=(0,St.A)(yc,this).get(i);var a;if(!r.objs.has(e))if(0!==r._intentStates.size)switch(n){case"Image":r.objs.resolve(e,s),(null===s||void 0===s?void 0:s.dataLen)>1e7&&(r._maybeCleanupAfterRender=!0);break;case"Pattern":r.objs.resolve(e,s);break;default:throw new Error("Got unknown object type ".concat(n))}else null===s||void 0===s||null===(a=s.bitmap)||void 0===a||a.close()}),t.on("DocProgress",t=>{var i;this.destroyed||null===(i=e.onProgress)||void 0===i||i.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;this.annotationStorage.size<=0&&Ue("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null},n).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=(0,St.A)(_c,this).get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&(0,St.A)(xc,this).set(i.refStr,t);const n=new lc(e,i,this,this._params.pdfBug);return(0,St.A)(yc,this).set(e,n),n});return(0,St.A)(_c,this).set(e,n),n}getPageIndex(t){return tc(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return(0,xt.A)(kc,this,Sc).call(this,"GetFieldObjects")}hasJSActions(){return(0,xt.A)(kc,this,Sc).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)}getDocJSActions(){return(0,xt.A)(kc,this,Sc).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return(0,xt.A)(kc,this,Sc).call(this,"GetOptionalContentConfig").then(e=>new Bo(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=(0,St.A)(wc,this).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(t=>{var e,i,n,s;return{info:t[0],metadata:t[1]?new Mo(t[1]):null,contentDispositionFilename:null!==(e=null===(i=this._fullReader)||void 0===i?void 0:i.filename)&&void 0!==e?e:null,contentLength:null!==(n=null===(s=this._fullReader)||void 0===s?void 0:s.contentLength)&&void 0!==n?n:null}});return(0,St.A)(wc,this).set(t,i),i}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(0,St.A)(yc,this).values()){if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."))}this.commonObjs.clear(),t||this.fontLoader.clear(),(0,St.A)(wc,this).clear(),this.filterFactory.destroy(!0),Il.cleanup()}}cachedPageNumber(t){var e;if(!tc(t))return null;const i=0===t.gen?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return null!==(e=(0,St.A)(xc,this).get(i))&&void 0!==e?e:null}}function Sc(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=(0,St.A)(wc,this).get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return(0,St.A)(wc,this).set(t,n),n}const Mc=Symbol("INITIAL_DATA");var Lc=new WeakMap,Tc=new WeakSet;class Rc{constructor(){(0,_t.A)(this,Tc),(0,Ct.A)(this,Lc,Object.create(null))}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=(0,xt.A)(Tc,this,Pc).call(this,t);return i.promise.then(()=>e(i.data)),null}const i=(0,St.A)(Lc,this)[t];if(!i||i.data===Mc)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}has(t){const e=(0,St.A)(Lc,this)[t];return!!e&&e.data!==Mc}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=(0,xt.A)(Tc,this,Pc).call(this,t);i.data=e,i.resolve()}clear(){for(const e in(0,St.A)(Lc,this)){var t;const{data:i}=(0,St.A)(Lc,this)[e];null===i||void 0===i||null===(t=i.bitmap)||void 0===t||t.close()}(0,Mt.A)(Lc,this,Object.create(null))}*[Symbol.iterator](){for(const t in(0,St.A)(Lc,this)){const{data:e}=(0,St.A)(Lc,this)[t];e!==Mc&&(yield[t,e])}}}function Pc(t){var e;return(e=(0,St.A)(Lc,this))[t]||(e[t]=(0,bt.A)((0,bt.A)({},Promise.withResolvers()),{},{data:Mc}))}var Fc=new WeakMap;class Ic{constructor(t){(0,Ct.A)(this,Fc,null),(0,Mt.A)(Fc,this,t),this.onContinue=null}get promise(){return(0,St.A)(Fc,this).capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,St.A)(Fc,this).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=(0,St.A)(Fc,this).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=(0,St.A)(Fc,this);return t.form||t.canvas&&(null===e||void 0===e?void 0:e.size)>0}}var Dc=new WeakMap;class Oc{constructor(t){let{callback:e,params:i,objs:n,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:u=null}=t;(0,Ct.A)(this,Dc,null),this.callback=e,this.params=i,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Ic(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=i.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(t){var e,i;let{transparency:n=!1,optionalContentConfig:s}=t;if(this.cancelled)return;if(this._canvas){if(Nc._.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.");Nc._.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:r,viewport:a,transform:o,background:l}=this.params;this.gfx=new no(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:s},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:a,transparency:n,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null===(i=this.graphicsReadyCallback)||void 0===i||i.call(this)}cancel(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=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(),(0,St.A)(Dc,this)&&(window.cancelAnimationFrame((0,St.A)(Dc,this)),(0,Mt.A)(Dc,this,null)),Nc._.delete(this._canvas),this.callback(e||new tn("Rendering cancelled, page ".concat(this._pageIndex+1),i))}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?(0,Mt.A)(Dc,this,window.requestAnimationFrame(()=>{(0,Mt.A)(Dc,this,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Nc._.delete(this._canvas),this.callback())))}}var Nc={_:new WeakSet};const Wc="4.4.168",jc="19fbc8998";function Bc(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Hc(t){return Math.max(0,Math.min(255,255*t))}class zc{static CMYK_G(t){let[e,i,n,s]=t;return["G",1-Math.min(1,.3*e+.59*n+.11*i+s)]}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_rgb(t){let[e]=t;return e=Hc(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=Bc(e);return"#".concat(i).concat(i).concat(i)}static RGB_G(t){let[e,i,n]=t;return["G",.3*e+.59*i+.11*n]}static RGB_rgb(t){return t.map(Hc)}static RGB_HTML(t){return"#".concat(t.map(Bc).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){let[e,i,n,s]=t;return["RGB",1-Math.min(1,e+s),1-Math.min(1,n+s),1-Math.min(1,i+s)]}static CMYK_rgb(t){let[e,i,n,s]=t;return[Hc(1-Math.min(1,e+s)),Hc(1-Math.min(1,n+s)),Hc(1-Math.min(1,i+s))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,i,n]=t;const s=1-e,r=1-i,a=1-n;return["CMYK",s,r,a,Math.min(s,r,a)]}}class Uc{static setupStorage(t,e,i,n,s){const r=n.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==r.value&&(t.textContent=r.value),"print"===s)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(r.value===i.attributes.xfaOn?t.setAttribute("checked",!0):r.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==r.value&&t.setAttribute("value",r.value),"print"===s)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})})}break;case"select":if(null!==r.value){t.setAttribute("value",r.value);for(const t of i.children)t.attributes.value===r.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",t=>{const i=t.target.options,s=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(e,{value:s})})}}static setAttributes(t){let{html:e,element:i,storage:n=null,intent:s,linkService:r}=t;const{attributes:a}=i,o=e instanceof HTMLAnchorElement;"radio"===a.type&&(a.name="".concat(a.name,"-").concat(s));for(const[l,c]of Object.entries(a))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&&r.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,i,n)}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,s=t.intent||"display",r=document.createElement(n.name);n.attributes&&this.setAttributes({html:r,element:n,intent:s,linkService:i});const a="richText"!==s,o=t.div;if(o.append(r),t.viewport){const e="matrix(".concat(t.viewport.transform.join(","),")");o.style.transform=e}a&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);r.append(t),a&&Xl.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const c=[[n,-1,r]];for(;c.length>0;){var h,d;const[t,n,r]=c.at(-1);if(n+1===t.children.length){c.pop();continue}const o=t.children[++c.at(-1)[1]];if(null===o)continue;const{name:u}=o;if("#text"===u){const t=document.createTextNode(o.value);l.push(t),r.append(t);continue}const p=null!==o&&void 0!==o&&null!==(h=o.attributes)&&void 0!==h&&h.xmlns?document.createElementNS(o.attributes.xmlns,u):document.createElement(u);if(r.append(p),o.attributes&&this.setAttributes({html:p,element:o,storage:e,intent:s,linkService:i}),(null===(d=o.children)||void 0===d?void 0:d.length)>0)c.push([o,-1,p]);else if(o.value){const t=document.createTextNode(o.value);a&&Xl.shouldBuildText(u)&&l.push(t),p.append(t)}}for(const u of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=e,t.div.hidden=!1}}const Vc=1e3,Gc=new WeakSet;function qc(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class Xc{static create(t){switch(t.data.annotationType){case pe:return new eh(t);case ue:return new rh(t);case Le:switch(t.data.fieldType){case"Tx":return new oh(t);case"Btn":return t.data.radioButton?new hh(t):t.data.checkBox?new ch(t):new dh(t);case"Ch":return new uh(t);case"Sig":return new lh(t)}return new ah(t);case Se:return new ph(t);case fe:return new Vh(t);case ge:return new qh(t);case Ae:return new Yh(t);case me:return new Qh(t);case be:return new Jh(t);case ke:return new td(t);case Ce:return new id(t);case ve:return new $h(t);case we:return new nd(t);case ye:return new sd(t);case _e:return new rd(t);case xe:return new ad(t);case Ee:return new od(t);case Me:return new hd(t);default:return new Jc(t)}}}var Yc=new WeakMap,Kc=new WeakMap,Qc=new WeakMap,Zc=new WeakSet;class Jc{constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,_t.A)(this,Zc),(0,Ct.A)(this,Yc,null),(0,Ct.A)(this,Kc,!1),(0,Ct.A)(this,Qc,null),this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData(t){let{titleObj:e,contentsObj:i,richText:n}=t;return!!(null!==e&&void 0!==e&&e.str||null!==i&&void 0!==i&&i.str||null!==n&&void 0!==n&&n.str)}get hasPopupData(){return Jc._hasPopupData(this.data)}updateEdited(t){var e;if(!this.container)return;(0,St.A)(Yc,this)||(0,Mt.A)(Yc,this,{rect:this.data.rect.slice(0)});const{rect:i}=t;i&&(0,xt.A)(Zc,this,$c).call(this,i),null===(e=(0,St.A)(Qc,this))||void 0===e||e.popup.updateEdited(t)}resetEdited(){var t;(0,St.A)(Yc,this)&&((0,xt.A)(Zc,this,$c).call(this,(0,St.A)(Yc,this).rect),null===(t=(0,St.A)(Qc,this))||void 0===t||t.popup.resetEdited(),(0,Mt.A)(Yc,this,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof ah||(s.tabIndex=Vc);const{style:r}=s;if(r.zIndex=this.parent.zIndex++,e.popupRef&&s.setAttribute("aria-haspopup","dialog"),e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof ph){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:a,height:o}=qc(e.rect);if(!t&&e.borderStyle.width>0){r.borderWidth="".concat(e.borderStyle.width,"px");const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e="calc(".concat(t,"px * var(--scale-factor)) / calc(").concat(i,"px * var(--scale-factor))");r.borderRadius=e}else if(this instanceof hh){const t="calc(".concat(a,"px * var(--scale-factor)) / calc(").concat(o,"px * var(--scale-factor))");r.borderRadius=t}switch(e.borderStyle.style){case Te:r.borderStyle="solid";break;case Re:r.borderStyle="dashed";break;case Pe:Ue("Unimplemented border style: beveled");break;case Fe:Ue("Unimplemented border style: inset");break;case Ie:r.borderBottomStyle="solid"}const n=e.borderColor||null;n?((0,Mt.A)(Kc,this,!0),r.borderColor=oi.makeHexColor(0|n[0],0|n[1],0|n[2])):r.borderWidth=0}const l=oi.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:c,pageHeight:h,pageX:d,pageY:u}=n.rawDims;r.left="".concat(100*(l[0]-d)/c,"%"),r.top="".concat(100*(l[1]-u)/h,"%");const{rotation:p}=e;return e.hasOwnCanvas||0===p?(r.width="".concat(100*a/c,"%"),r.height="".concat(100*o/h,"%")):this.setRotation(p,s),s}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims,{width:s,height:r}=qc(this.data.rect);let a,o;t%180===0?(a=100*s/i,o=100*r/n):(a=100*r/i,o=100*s/n),e.style.width="".concat(a,"%"),e.style.height="".concat(o,"%"),e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,i)=>{const n=i.detail[t],s=n[0],r=n.slice(1);i.target.style[e]=zc["".concat(s,"_HTML")](r),this.annotationStorage.setValue(this.data.id,{[e]:zc["".concat(s,"_rgb")](r)})};return Xe(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.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 i=this._commonActions;for(const n of Object.keys(e.detail)){const s=t[n]||i[n];null===s||void 0===s||s(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,s]of Object.entries(e)){const r=i[n];if(r){r({detail:{[n]:s},target:t}),delete e[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,n,s]=this.data.rect.map(t=>Math.fround(t));if(8===t.length){const[r,a,o,l]=t.subarray(2,6);if(n===r&&s===a&&e===o&&i===l)return}const{style:r}=this.container;let a;if((0,St.A)(Kc,this)){const{borderColor:t,borderWidth:e}=r;r.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">','<g fill="transparent" stroke="'.concat(t,'" stroke-width="').concat(e,'">')],this.container.classList.add("hasBorder")}const o=n-e,l=s-i,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0);const d=c.createElement("defs");h.append(d);const u=c.createElement("clipPath"),p="clippath_".concat(this.data.id);u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(let g=2,A=t.length;g<A;g+=8){var f;const i=t[g],n=t[g+1],r=t[g+2],h=t[g+3],d=c.createElement("rect"),p=(r-e)/o,A=(s-n)/l,m=(i-r)/o,v=(n-h)/l;d.setAttribute("x",p),d.setAttribute("y",A),d.setAttribute("width",m),d.setAttribute("height",v),u.append(d),null===(f=a)||void 0===f||f.push('<rect vector-effect="non-scaling-stroke" x="'.concat(p,'" y="').concat(A,'" width="').concat(m,'" height="').concat(v,'"/>'))}(0,St.A)(Kc,this)&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(h),this.container.style.clipPath="url(#".concat(p,")")}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const i=(0,Mt.A)(Qc,this,new ph({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_".concat(e.id),rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}render(){Ve("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:s,exportValues:r}of n){if(-1===t)continue;if(s===e)continue;const n="string"===typeof r?r:null,a=document.querySelector('[data-element-id="'.concat(s,'"]'));!a||Gc.has(a)?i.push({id:s,exportValue:n,domElement:a}):Ue("_getElementsByName - element not allowed: ".concat(s))}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&(Gc.has(n)&&i.push({id:s,exportValue:t,domElement:n}))}return i}show(){var t;this.container&&(this.container.hidden=!1),null===(t=this.popup)||void 0===t||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null===(t=this.popup)||void 0===t||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{var i;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}function $c(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:o}}}}=this;null===i||void 0===i||i.splice(0,4,...t);const{width:l,height:c}=qc(t);e.left="".concat(100*(t[0]-a)/s,"%"),e.top="".concat(100*(r-t[3]+o)/r,"%"),0===n?(e.width="".concat(100*l/s,"%"),e.height="".concat(100*c/r,"%")):this.setRotation(n)}var th=new WeakSet;class eh extends Jc{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}),(0,_t.A)(this,th),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),n=!0):t.action?(this._bindNamedAction(i,t.action),n=!0):t.attachment?((0,xt.A)(th,this,nh).call(this,i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?((0,xt.A)(th,this,sh).call(this,i,t.setOCGState),n=!0):t.dest?(this._bindLink(i,t.dest),n=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),n=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&(0,xt.A)(th,this,ih).call(this)}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),(0,xt.A)(th,this,ih).call(this)}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const s=i.get(n);s&&(t[s]=()=>{var t;return null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1})}t.onclick||(t.onclick=()=>!1),(0,xt.A)(th,this,ih).call(this)}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),(0,xt.A)(th,this,ih).call(this),!this._fieldObjects)return Ue('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{null===i||void 0===i||i();const{fields:t,refs:n,include:s}=e,r=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===s&&r.push(i)}else for(const e of Object.values(this._fieldObjects))r.push(...e);const a=this.annotationStorage,o=[];for(const e of r){const{id:t}=e;switch(o.push(t),e.type){case"text":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;a.setValue(t,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}default:continue}const i=document.querySelector('[data-element-id="'.concat(t,'"]'));i&&(Gc.has(i)?i.dispatchEvent(new Event("resetform")):Ue("_bindResetFormAction - element not allowed: ".concat(t)))}var l;this.enableScripting&&(null===(l=this.linkService.eventBus)||void 0===l||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}));return!1}}}function ih(){this.container.setAttribute("data-internal-link","")}function nh(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(e.content,e.filename,i),!1},(0,xt.A)(th,this,ih).call(this)}function sh(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),(0,xt.A)(th,this,ih).call(this)}class rh extends Jc{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class ah extends Jc{render(){return 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){return ri.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(i,t=>{var r;if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&(null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}}))})}_setEventListeners(t,e,i,n){for(const[o,l]of i){var s,r,a;if("Action"===l||null!==(s=this.data.actions)&&void 0!==s&&s[l])"Focus"!==l&&"Blur"!==l||e||(e={focused:!1}),this._setEventListener(t,e,o,l,n),"Focus"!==l||null!==(r=this.data.actions)&&void 0!==r&&r.Blur?"Blur"!==l||null!==(a=this.data.actions)&&void 0!==a&&a.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null)}}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":oi.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,s=t.style;let r;const a=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/(Xt*n))||1);r=Math.min(n,a(e/Xt))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,a(t/Xt))}s.fontSize="calc(".concat(r,"px * var(--scale-factor))"),s.color=oi.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class oh extends ah{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const s=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[e]=i),s.setValue(r.id,{[n]:i})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){var n;const r=t.getValue(e,{value:this.data.fieldValue});let a=r.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let l=r.formattedValue||(null===(n=this.data.textContent)||void 0===n?void 0:n.join("\n"))||null;l&&this.data.comb&&(l=l.replaceAll(/\s+/g,""));const c={userValue:a,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=null!==l&&void 0!==l?l:a,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",null!==l&&void 0!==l?l:a),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Gc.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Vc,this._setRequired(i,this.data.required),o&&(i.maxLength=o),i.addEventListener("input",n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),c.formattedValue=null}),i.addEventListener("resetform",t=>{var e;const n=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";i.value=c.userValue=n,c.formattedValue=null});let h=t=>{const{formattedValue:e}=c;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var s;i.addEventListener("focus",t=>{var e;if(c.focused)return;const{target:i}=t;c.userValue&&(i.value=c.userValue),c.lastCommittedValue=i.value,c.commitKey=1,null!==(e=this.data.actions)&&void 0!==e&&e.Focus||(c.focused=!0)}),i.addEventListener("updatefromsandbox",i=>{this.showElementAndHideCanvas(i.target);const n={value(i){var n;c.userValue=null!==(n=i.detail.value)&&void 0!==n?n:"",t.setValue(e,{value:c.userValue.toString()}),i.target.value=c.userValue},formattedValue(i){const{formattedValue:n}=i.detail;c.formattedValue=n,null!==n&&void 0!==n&&i.target!==document.activeElement&&(i.target.value=n),t.setValue(e,{formattedValue:n})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{var n;const{charLimit:s}=i.detail,{target:r}=i;if(0===s)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",s);let a=c.userValue;!a||a.length<=s||(a=a.slice(0,s),r.value=c.userValue=a,t.setValue(e,{value:a}),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)}),i.addEventListener("keydown",t=>{var i;c.commitKey=1;let n=-1;if("Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(c.commitKey=3):n=2,-1===n)return;const{value:s}=t.target;c.lastCommittedValue!==s&&(c.lastCommittedValue=s,c.userValue=s,null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const n=h;h=null,i.addEventListener("blur",t=>{var i;if(!c.focused||!t.relatedTarget)return;null!==(i=this.data.actions)&&void 0!==i&&i.Blur||(c.focused=!1);const{value:s}=t.target;var r;(c.userValue=s,c.lastCommittedValue!==s)&&(null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:c.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}));n(t)}),null!==(s=this.data.actions)&&void 0!==s&&s.Keystroke&&i.addEventListener("beforeinput",t=>{var i;c.lastCommittedValue=null;const{data:n,target:s}=t,{value:r,selectionStart:a,selectionEnd:o}=s;let l=a,h=o;switch(t.inputType){case"deleteWordBackward":{const t=r.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=r.substring(a).match(/^[^\w]*\w*/);t&&(h+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(h+=1)}t.preventDefault(),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:n||"",willCommit:!1,selStart:l,selEnd:h}})}),this._setEventListeners(i,c,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(h&&i.addEventListener("blur",h),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/o;i.classList.add("comb"),i.style.letterSpacing="calc(".concat(t,"px * var(--scale-factor) - 1ch)")}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class lh extends ah{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class ch extends ah{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"===typeof n&&(n="Off"!==n,t.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return Gc.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=Vc,s.addEventListener("change",n=>{const{name:s,checked:r}=n.target;for(const a of this._getElementsByName(s,i)){const i=r&&a.exportValue===e.exportValue;a.domElement&&(a.domElement.checked=i),t.setValue(a.id,{value:i})}t.setValue(i,{value:r})}),s.addEventListener("resetform",t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",e=>{const n={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)}),this._setEventListeners(s,null,[["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(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class hh extends ah{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"===typeof n&&(n=n!==e.buttonValue,t.setValue(i,{value:n})),n)for(const r of this._getElementsByName(e.fieldName,i))t.setValue(r.id,{value:!1});const s=document.createElement("input");if(Gc.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.tabIndex=Vc,s.addEventListener("change",e=>{const{name:n,checked:s}=e.target;for(const r of this._getElementsByName(n,i))t.setValue(r.id,{value:!1});t.setValue(i,{value:s})}),s.addEventListener("resetform",t=>{const i=e.defaultFieldValue;t.target.checked=null!==i&&void 0!==i&&i===e.buttonValue}),this.enableScripting&&this.hasJSActions){const n=e.buttonValue;s.addEventListener("updatefromsandbox",e=>{const s={value:e=>{const s=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=s&&n.id===i;n.domElement&&(n.domElement.checked=e),t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(s,e)}),this._setEventListeners(s,null,[["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(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class dh extends eh{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class uh extends ah{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");Gc.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=Vc;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue;for(const i of n.options)i.selected=i.value===e});for(const c of this.data.options){const t=document.createElement("option");t.textContent=c.displayValue,t.value=c.exportValue,i.value.includes(c.exportValue)&&(t.setAttribute("selected",!0),s=!1),n.append(t)}let r=null;if(s){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),n.prepend(t),r=()=>{t.remove(),n.removeEventListener("input",r),r=null},n.addEventListener("input",r)}const a=t=>{const e=t?"value":"textContent",{options:i,multiple:s}=n;return s?Array.prototype.filter.call(i,t=>t.selected).map(t=>t[e]):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let o=a(!1);const l=t=>{const e=t.target.options;return Array.prototype.map.call(e,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",i=>{const s={value(i){var s;null===(s=r)||void 0===s||s();const l=i.detail.value,c=new Set(Array.isArray(l)?l:[l]);for(const t of n.options)t.selected=c.has(t.value);t.setValue(e,{value:a(!0)}),o=a(!1)},multipleSelection(t){n.multiple=!0},remove(i){const s=n.options,r=i.detail.remove;if(s[r].selected=!1,n.remove(r),s.length>0){-1===Array.prototype.findIndex.call(s,t=>t.selected)&&(s[0].selected=!0)}t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]}),o=a(!1)},insert(i){const{index:s,displayValue:r,exportValue:c}=i.detail.insert,h=n.children[s],d=document.createElement("option");d.textContent=r,d.value=c,h?h.before(d):n.append(d),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},items(i){const{items:s}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of s){const{displayValue:e,exportValue:i}=t,s=document.createElement("option");s.textContent=e,s.value=i,n.append(s)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},indices(i){const n=new Set(i.detail.indices);for(const t of i.target.options)t.selected=n.has(t.index);t.setValue(e,{value:a(!0)}),o=a(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,i)}),n.addEventListener("input",i=>{var n;const s=a(!0),r=a(!1);t.setValue(e,{value:s}),i.preventDefault(),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:r,changeEx:s,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)):n.addEventListener("input",function(i){t.setValue(e,{value:a(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class ph extends Jc{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:Jc._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new Ih({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const i of this.elements)i.popup=t,e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map(t=>"".concat(pi).concat(t)).join(",")),this.container}}var fh=new WeakMap,gh=new WeakMap,Ah=new WeakMap,mh=new WeakMap,vh=new WeakMap,bh=new WeakMap,wh=new WeakMap,yh=new WeakMap,_h=new WeakMap,xh=new WeakMap,Eh=new WeakMap,kh=new WeakMap,Ch=new WeakMap,Sh=new WeakMap,Mh=new WeakMap,Lh=new WeakMap,Th=new WeakMap,Rh=new WeakMap,Ph=new WeakMap,Fh=new WeakSet;class Ih{constructor(t){let{container:e,color:i,elements:n,titleObj:s,modificationDate:r,contentsObj:a,richText:o,parent:l,rect:c,parentRect:h,open:d}=t;(0,_t.A)(this,Fh),(0,Ct.A)(this,fh,(0,xt.A)(Fh,this,jh).bind(this)),(0,Ct.A)(this,gh,(0,xt.A)(Fh,this,Uh).bind(this)),(0,Ct.A)(this,Ah,(0,xt.A)(Fh,this,zh).bind(this)),(0,Ct.A)(this,mh,(0,xt.A)(Fh,this,Hh).bind(this)),(0,Ct.A)(this,vh,null),(0,Ct.A)(this,bh,null),(0,Ct.A)(this,wh,null),(0,Ct.A)(this,yh,null),(0,Ct.A)(this,_h,null),(0,Ct.A)(this,xh,null),(0,Ct.A)(this,Eh,null),(0,Ct.A)(this,kh,!1),(0,Ct.A)(this,Ch,null),(0,Ct.A)(this,Sh,null),(0,Ct.A)(this,Mh,null),(0,Ct.A)(this,Lh,null),(0,Ct.A)(this,Th,null),(0,Ct.A)(this,Rh,null),(0,Ct.A)(this,Ph,!1),(0,Mt.A)(bh,this,e),(0,Mt.A)(Th,this,s),(0,Mt.A)(wh,this,a),(0,Mt.A)(Lh,this,o),(0,Mt.A)(xh,this,l),(0,Mt.A)(vh,this,i),(0,Mt.A)(Mh,this,c),(0,Mt.A)(Eh,this,h),(0,Mt.A)(_h,this,n),(0,Mt.A)(yh,this,dn.toDateObject(r)),this.trigger=n.flatMap(t=>t.getElementsToTriggerPopup());for(const p of this.trigger)p.addEventListener("click",(0,St.A)(mh,this)),p.addEventListener("mouseenter",(0,St.A)(Ah,this)),p.addEventListener("mouseleave",(0,St.A)(gh,this)),p.classList.add("popupTriggerArea");for(const p of n){var u;null===(u=p.container)||void 0===u||u.addEventListener("keydown",(0,St.A)(fh,this))}(0,St.A)(bh,this).hidden=!0,d&&(0,xt.A)(Fh,this,Hh).call(this)}render(){if((0,St.A)(Ch,this))return;const t=(0,Mt.A)(Ch,this,document.createElement("div"));if(t.className="popup",(0,St.A)(vh,this)){const e=t.style.outlineColor=oi.makeHexColor(...(0,St.A)(vh,this));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))t.style.backgroundColor="color-mix(in srgb, ".concat(e," 30%, white)");else{const e=.7;t.style.backgroundColor=oi.makeHexColor(...(0,St.A)(vh,this).map(t=>Math.floor(e*(255-t)+t)))}}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=(0,St.A)(Th,this)),t.append(e),(0,St.A)(yh,this)){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),t.setAttribute("data-l10n-args",JSON.stringify({date:(0,St.A)(yh,this).toLocaleDateString(),time:(0,St.A)(yh,this).toLocaleTimeString()})),e.append(t)}const n=Et(Fh,this,Dh);if(n)Uc.render({xfaHtml:n,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents((0,St.A)(wh,this));t.append(e)}(0,St.A)(bh,this).append(t)}_formatContents(t){let{str:e,dir:i}=t;const n=document.createElement("p");n.classList.add("popupContent"),n.dir=i;const s=e.split(/(?:\r\n?|\n)/);for(let r=0,a=s.length;r<a;++r){const t=s[r];n.append(document.createTextNode(t)),r<a-1&&n.append(document.createElement("br"))}return n}updateEdited(t){var e;let{rect:i,popupContent:n}=t;(0,St.A)(Rh,this)||(0,Mt.A)(Rh,this,{contentsObj:(0,St.A)(wh,this),richText:(0,St.A)(Lh,this)}),i&&(0,Mt.A)(Sh,this,null),n&&((0,Mt.A)(Lh,this,(0,xt.A)(Fh,this,Wh).call(this,n)),(0,Mt.A)(wh,this,null)),null===(e=(0,St.A)(Ch,this))||void 0===e||e.remove(),(0,Mt.A)(Ch,this,null)}resetEdited(){var t;(0,St.A)(Rh,this)&&(({contentsObj:wt(Mt.A,[wh,this])._,richText:wt(Mt.A,[Lh,this])._}=(0,St.A)(Rh,this)),(0,Mt.A)(Rh,this,null),null===(t=(0,St.A)(Ch,this))||void 0===t||t.remove(),(0,Mt.A)(Ch,this,null),(0,Mt.A)(Sh,this,null))}forceHide(){(0,Mt.A)(Ph,this,this.isVisible),(0,St.A)(Ph,this)&&((0,St.A)(bh,this).hidden=!0)}maybeShow(){(0,St.A)(Ph,this)&&((0,St.A)(Ch,this)||(0,xt.A)(Fh,this,zh).call(this),(0,Mt.A)(Ph,this,!1),(0,St.A)(bh,this).hidden=!1)}get isVisible(){return!1===(0,St.A)(bh,this).hidden}}function Dh(t){const e=(0,St.A)(Lh,t),i=(0,St.A)(wh,t);return null===e||void 0===e||!e.str||null!==i&&void 0!==i&&i.str&&i.str!==e.str?null:(0,St.A)(Lh,t).html||null}function Oh(t){var e;return(null===(e=Et(Fh,t,Dh))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.fontSize)||0}function Nh(t){var e;return(null===(e=Et(Fh,t,Dh))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.color)||null}function Wh(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:Et(Fh,this,Nh),fontSize:Et(Fh,this,Oh)?"calc(".concat(Et(Fh,this,Oh),"px * var(--scale-factor))"):""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}function jh(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&(0,St.A)(kh,this))&&(0,xt.A)(Fh,this,Hh).call(this)}function Bh(){if(null!==(0,St.A)(Sh,this))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=(0,St.A)(xh,this);let r=!!(0,St.A)(Eh,this),a=r?(0,St.A)(Eh,this):(0,St.A)(Mh,this);for(const u of(0,St.A)(_h,this))if(!a||null!==oi.intersect(u.data.rect,a)){a=u.data.rect,r=!0;break}const o=oi.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),l=r?a[2]-a[0]+5:0,c=o[0]+l,h=o[1];(0,Mt.A)(Sh,this,[100*(c-n)/e,100*(h-s)/i]);const{style:d}=(0,St.A)(bh,this);d.left="".concat((0,St.A)(Sh,this)[0],"%"),d.top="".concat((0,St.A)(Sh,this)[1],"%")}function Hh(){(0,Mt.A)(kh,this,!(0,St.A)(kh,this)),(0,St.A)(kh,this)?((0,xt.A)(Fh,this,zh).call(this),(0,St.A)(bh,this).addEventListener("click",(0,St.A)(mh,this)),(0,St.A)(bh,this).addEventListener("keydown",(0,St.A)(fh,this))):((0,xt.A)(Fh,this,Uh).call(this),(0,St.A)(bh,this).removeEventListener("click",(0,St.A)(mh,this)),(0,St.A)(bh,this).removeEventListener("keydown",(0,St.A)(fh,this)))}function zh(){(0,St.A)(Ch,this)||this.render(),this.isVisible?(0,St.A)(kh,this)&&(0,St.A)(bh,this).classList.add("focused"):((0,xt.A)(Fh,this,Bh).call(this),(0,St.A)(bh,this).hidden=!1,(0,St.A)(bh,this).style.zIndex=parseInt((0,St.A)(bh,this).style.zIndex)+1e3)}function Uh(){(0,St.A)(bh,this).classList.remove("focused"),!(0,St.A)(kh,this)&&this.isVisible&&((0,St.A)(bh,this).hidden=!0,(0,St.A)(bh,this).style.zIndex=parseInt((0,St.A)(bh,this).style.zIndex)-1e3)}class Vh extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=ie.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}var Gh=new WeakMap;class qh extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,Ct.A)(this,Gh,null)}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=qc(t.rect),n=this.svgFactory.create(e,i,!0),s=(0,Mt.A)(Gh,this,this.svgFactory.createElement("svg:line"));return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return(0,St.A)(Gh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Xh=new WeakMap;class Yh extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,Ct.A)(this,Xh,null)}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=qc(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=(0,Mt.A)(Xh,this,this.svgFactory.createElement("svg:rect"));return r.setAttribute("x",s/2),r.setAttribute("y",s/2),r.setAttribute("width",e-s),r.setAttribute("height",i-s),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return(0,St.A)(Xh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Kh=new WeakMap;class Qh extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,Ct.A)(this,Kh,null)}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=qc(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=(0,Mt.A)(Kh,this,this.svgFactory.createElement("svg:ellipse"));return r.setAttribute("cx",e/2),r.setAttribute("cy",i/2),r.setAttribute("rx",e/2-s/2),r.setAttribute("ry",i/2-s/2),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return(0,St.A)(Kh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Zh=new WeakMap;class Jh extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,Ct.A)(this,Zh,null),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n}}=this;if(!e)return this.container;const{width:s,height:r}=qc(t),a=this.svgFactory.create(s,r,!0);let o=[];for(let c=0,h=e.length;c<h;c+=2){const i=e[c]-t[0],n=t[3]-e[c+1];o.push("".concat(i,",").concat(n))}o=o.join(" ");const l=(0,Mt.A)(Zh,this,this.svgFactory.createElement(this.svgElementName));return l.setAttribute("points",o),l.setAttribute("stroke-width",i.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),a.append(l),this.container.append(a),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return(0,St.A)(Zh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class $h extends Jh{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class td extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var ed=new WeakMap;class id extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,Ct.A)(this,ed,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=ie.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:e,borderStyle:i,popupRef:n}}=this,{width:s,height:r}=qc(t),a=this.svgFactory.create(s,r,!0);for(const o of e){let e=[];for(let i=0,n=o.length;i<n;i+=2){const n=o[i]-t[0],s=t[3]-o[i+1];e.push("".concat(n,",").concat(s))}e=e.join(" ");const s=this.svgFactory.createElement(this.svgElementName);(0,St.A)(ed,this).push(s),s.setAttribute("points",e),s.setAttribute("stroke-width",i.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),!n&&this.hasPopupData&&this._createPopup(),a.append(s)}return this.container.append(a),this.container}getElementsToTriggerPopup(){return(0,St.A)(ed,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class nd extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class sd extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class rd extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class ad extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class od extends Jc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var ld=new WeakMap,cd=new WeakSet;class hd extends Jc{constructor(t){var e;super(t,{isRenderable:!0}),(0,_t.A)(this,cd),(0,Ct.A)(this,ld,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",(0,bt.A)({source:this},i))}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let i;e.hasAppearance||0===e.fillAlpha?i=document.createElement("div"):(i=document.createElement("img"),i.src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(e.name)?"paperclip":"pushpin",".svg"),e.fillAlpha&&e.fillAlpha<1&&(i.style="filter: opacity(".concat(Math.round(100*e.fillAlpha),"%);"))),i.addEventListener("dblclick",(0,xt.A)(cd,this,dd).bind(this)),(0,Mt.A)(ld,this,i);const{isMac:n}=ri.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&(0,xt.A)(cd,this,dd).call(this)}),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return(0,St.A)(ld,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function dd(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.content,this.filename)}var ud=new WeakMap,pd=new WeakMap,fd=new WeakMap,gd=new WeakSet;class Ad{constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:n,annotationEditorUIManager:s,page:r,viewport:a}=t;(0,_t.A)(this,gd),(0,Ct.A)(this,ud,null),(0,Ct.A)(this,pd,null),(0,Ct.A)(this,fd,new Map),this.div=e,(0,Mt.A)(ud,this,i),(0,Mt.A)(pd,this,n),this.page=r,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=s}async render(t){const{annotations:e}=t,i=this.div;An(i,this.viewport);const n=new Map,s={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new Ji,annotationStorage:t.annotationStorage||new va,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const a of e){if(a.noHTML)continue;const t=a.annotationType===Se;if(t){const t=n.get(a.id);if(!t)continue;s.elements=t}else{const{width:t,height:e}=qc(a.rect);if(t<=0||e<=0)continue}s.data=a;const e=Xc.create(s);if(!e.isRenderable)continue;if(!t&&a.popupRef){const t=n.get(a.popupRef);t?t.push(e):n.set(a.popupRef,[e])}const i=e.render();var r;if(a.hidden&&(i.style.visibility="hidden"),(0,xt.A)(gd,this,md).call(this,i,a.id),e.annotationEditorType>0)(0,St.A)(fd,this).set(e.data.id,e),null===(r=this._annotationEditorUIManager)||void 0===r||r.renderAnnotationElement(e)}(0,xt.A)(gd,this,vd).call(this)}update(t){let{viewport:e}=t;const i=this.div;this.viewport=e,An(i,{rotation:e.rotation}),(0,xt.A)(gd,this,vd).call(this),i.hidden=!1}getEditableAnnotations(){return Array.from((0,St.A)(fd,this).values())}getEditableAnnotation(t){return(0,St.A)(fd,this).get(t)}}function md(t,e){var i;const n=t.firstChild||t;n.id="".concat(pi).concat(e),this.div.append(t),null===(i=(0,St.A)(ud,this))||void 0===i||i.moveElementInDOM(this.div,t,n,!1)}function vd(){if(!(0,St.A)(pd,this))return;const t=this.div;for(const[e,i]of(0,St.A)(pd,this)){const n=t.querySelector('[data-annotation-id="'.concat(e,'"]'));if(!n)continue;i.className="annotationContent";const{firstChild:s}=n;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):n.append(i)}(0,St.A)(pd,this).clear()}const bd=/\r\n?|\n/g;var wd=new WeakMap,yd=new WeakMap,_d=new WeakMap,xd=new WeakMap,Ed=new WeakMap,kd=new WeakMap,Cd=new WeakMap,Sd=new WeakMap,Md=new WeakMap,Ld=new WeakMap,Td=new WeakSet;class Rd extends Yr{static get _keyboardManager(){const t=Rd.prototype,e=t=>t.isEmpty(),i=Ys.TRANSLATE_SMALL,n=Ys.TRANSLATE_BIG;return Xe(this,"_keyboardManager",new Jn([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:e}]]))}constructor(t){super((0,bt.A)((0,bt.A)({},t),{},{name:"freeTextEditor"})),(0,_t.A)(this,Td),(0,Ct.A)(this,wd,this.editorDivBlur.bind(this)),(0,Ct.A)(this,yd,this.editorDivFocus.bind(this)),(0,Ct.A)(this,_d,this.editorDivInput.bind(this)),(0,Ct.A)(this,xd,this.editorDivKeydown.bind(this)),(0,Ct.A)(this,Ed,this.editorDivPaste.bind(this)),(0,Ct.A)(this,kd,void 0),(0,Ct.A)(this,Cd,""),(0,Ct.A)(this,Sd,"".concat(this.id,"-editor")),(0,Ct.A)(this,Md,void 0),(0,Ct.A)(this,Ld,null),(0,Mt.A)(kd,this,t.color||Rd._defaultColor||Yr._defaultLineColor),(0,Mt.A)(Md,this,t.fontSize||Rd._defaultFontSize)}static initialize(t,e){Yr.initialize(t,e,{strings:["pdfjs-free-text-default-content"]});const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case ne.FREETEXT_SIZE:Rd._defaultFontSize=e;break;case ne.FREETEXT_COLOR:Rd._defaultColor=e}}updateParams(t,e){switch(t){case ne.FREETEXT_SIZE:(0,xt.A)(Td,this,Pd).call(this,e);break;case ne.FREETEXT_COLOR:(0,xt.A)(Td,this,Fd).call(this,e)}}static get defaultPropertiesToUpdate(){return[[ne.FREETEXT_SIZE,Rd._defaultFontSize],[ne.FREETEXT_COLOR,Rd._defaultColor||Yr._defaultLineColor]]}get propertiesToUpdate(){return[[ne.FREETEXT_SIZE,(0,St.A)(Md,this)],[ne.FREETEXT_COLOR,(0,St.A)(kd,this)]]}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-Rd._internalPadding*t,-(Rd._internalPadding+(0,St.A)(Md,this))*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(ie.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant");const t=this._uiManager._signal;this.editorDiv.addEventListener("keydown",(0,St.A)(xd,this),{signal:t}),this.editorDiv.addEventListener("focus",(0,St.A)(yd,this),{signal:t}),this.editorDiv.addEventListener("blur",(0,St.A)(wd,this),{signal:t}),this.editorDiv.addEventListener("input",(0,St.A)(_d,this),{signal:t}),this.editorDiv.addEventListener("paste",(0,St.A)(Ed,this),{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",(0,St.A)(Sd,this)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",(0,St.A)(xd,this)),this.editorDiv.removeEventListener("focus",(0,St.A)(yd,this)),this.editorDiv.removeEventListener("blur",(0,St.A)(wd,this)),this.editorDiv.removeEventListener("input",(0,St.A)(_d,this)),this.editorDiv.removeEventListener("paste",(0,St.A)(Ed,this)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var t;this.width||(this.enableEditMode(),this.editorDiv.focus(),null!==(t=this._initialOptions)&&void 0!==t&&t.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=(0,St.A)(Cd,this),e=(0,Mt.A)(Cd,this,(0,xt.A)(Td,this,Id).call(this).trimEnd());if(t===e)return;const i=t=>{(0,Mt.A)(Cd,this,t),t?((0,xt.A)(Td,this,Nd).call(this),this._uiManager.rebuild(this),(0,xt.A)(Td,this,Dd).call(this)):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),(0,xt.A)(Td,this,Dd).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Rd._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",(0,St.A)(Sd,this)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),Yr._l10nPromise.get("pdfjs-free-text-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:i}=this.editorDiv;if(i.fontSize="calc(".concat((0,St.A)(Md,this),"px * var(--scale-factor))"),i.color=(0,St.A)(kd,this),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),Nn(this,this.div,["dblclick","keydown"]),this.width){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=(0,St.A)(Ld,this);let[r,a]=this.getInitialTranslation();[r,a]=this.pageTranslationToScreen(r,a);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(s[0]-c)/o,u=e+this.height-(s[1]-h)/l;break;case 90:d=t+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[a,-r];break;case 180:d=t-this.width+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[-r,-a];break;case 270:d=t+(s[0]-c-this.height*l)/o,u=e+(s[1]-h-this.width*o)/l,[r,a]=[-a,r]}this.setAt(d*i,u*n,r,a)}else this.setAt(t*i,e*n,this.width*i,this.height*n);(0,xt.A)(Td,this,Nd).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=jd.call(Rd,e.getData("text")||"").replaceAll(bd,"\n");if(!n)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const r=s.getRangeAt(0);if(!n.includes("\n"))return r.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void s.collapseToStart();const{startContainer:a,startOffset:o}=r,l=[],c=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;if(c.push(a.nodeValue.slice(o).replaceAll(bd,"")),t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(Od.call(Rd,i)):e=c}l.push(a.nodeValue.slice(0,o).replaceAll(bd,""))}else if(a===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=c),t.push(Od.call(Rd,i))}(0,Mt.A)(Cd,this,"".concat(l.join("\n")).concat(n).concat(c.join("\n"))),(0,xt.A)(Td,this,Nd).call(this);const h=new Range;let d=l.reduce((t,e)=>t+e.length,0);for(const{firstChild:u}of this.editorDiv.childNodes)if(u.nodeType===Node.TEXT_NODE){const t=u.nodeValue.length;if(d<=t){h.setStart(u,d),h.setEnd(u,d);break}d-=t}s.removeAllRanges(),s.addRange(h)}get contentDiv(){return this.editorDiv}static deserialize(t,e,i){let n=null;if(t instanceof Vh){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:r,id:a},textContent:o,textPosition:l,parent:{page:{pageNumber:c}}}=t;if(!o||0===o.length)return null;n=t={annotationType:ie.FREETEXT,color:Array.from(i),fontSize:e,value:o.join("\n"),position:l,pageIndex:c-1,rect:s.slice(0),rotation:r,id:a,deleted:!1}}const s=super.deserialize(t,e,i);return(0,Mt.A)(Md,s,t.fontSize),(0,Mt.A)(kd,s,oi.makeHexColor(...t.color)),(0,Mt.A)(Cd,s,jd.call(Rd,t.value)),s.annotationElementId=t.id||null,(0,Mt.A)(Ld,s,n),s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const e=Rd._internalPadding*this.parentScale,i=this.getRect(e,e),n=Yr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:(0,St.A)(kd,this)),s={annotationType:ie.FREETEXT,color:n,fontSize:(0,St.A)(Md,this),value:(0,xt.A)(Td,this,Wd).call(this),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?s:this.annotationElementId&&!(0,xt.A)(Td,this,Bd).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize="calc(".concat((0,St.A)(Md,this),"px * var(--scale-factor))"),i.color=(0,St.A)(kd,this),e.replaceChildren();for(const s of(0,St.A)(Cd,this).split("\n")){const t=document.createElement("div");t.append(s?document.createTextNode(s):document.createElement("br")),e.append(t)}const n=Rd._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(n,n),popupContent:(0,St.A)(Cd,this)}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}function Pd(t){const e=t=>{this.editorDiv.style.fontSize="calc(".concat(t,"px * var(--scale-factor))"),this.translate(0,-(t-(0,St.A)(Md,this))*this.parentScale),(0,Mt.A)(Md,this,t),(0,xt.A)(Td,this,Dd).call(this)},i=(0,St.A)(Md,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ne.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function Fd(t){const e=t=>{(0,Mt.A)(kd,this,this.editorDiv.style.color=t)},i=(0,St.A)(kd,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ne.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function Id(){const t=[];this.editorDiv.normalize();for(const e of this.editorDiv.childNodes)t.push(Od.call(Ot,e));return t.join("\n")}function Dd(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display,s=e.classList.contains("hidden");e.classList.remove("hidden"),e.style.display="hidden",t.div.append(this.div),i=e.getBoundingClientRect(),e.remove(),e.style.display=n,e.classList.toggle("hidden",s)}this.rotation%180===this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()}function Od(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(bd,"")}function Nd(){if(this.editorDiv.replaceChildren(),(0,St.A)(Cd,this))for(const t of(0,St.A)(Cd,this).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}function Wd(){return(0,St.A)(Cd,this).replaceAll("\xa0"," ")}function jd(t){return t.replaceAll(" ","\xa0")}function Bd(t){const{value:e,fontSize:i,color:n,pageIndex:s}=(0,St.A)(Ld,this);return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==n[e])||t.pageIndex!==s}Ot=Rd,(0,kt.A)(Rd,"_freeTextDefaultContent",""),(0,kt.A)(Rd,"_internalPadding",0),(0,kt.A)(Rd,"_defaultColor",null),(0,kt.A)(Rd,"_defaultFontSize",10),(0,kt.A)(Rd,"_type","freetext"),(0,kt.A)(Rd,"_editorType",ie.FREETEXT);var Hd=new WeakMap,zd=new WeakMap,Ud=new WeakMap,Vd=new WeakSet;class Gd{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];(0,_t.A)(this,Vd),(0,Ct.A)(this,Hd,void 0),(0,Ct.A)(this,zd,[]),(0,Ct.A)(this,Ud,[]);let s=1/0,r=-1/0,a=1/0,o=-1/0;const l=10**-4;for(const{x:g,y:A,width:m,height:v}of t){const t=Math.floor((g-e)/l)*l,i=Math.ceil((g+m+e)/l)*l,n=Math.floor((A-e)/l)*l,c=Math.ceil((A+v+e)/l)*l,h=[t,n,c,!0],d=[i,n,c,!1];(0,St.A)(zd,this).push(h,d),s=Math.min(s,t),r=Math.max(r,i),a=Math.min(a,n),o=Math.max(o,c)}const c=r-s+2*i,h=o-a+2*i,d=s-i,u=a-i,p=(0,St.A)(zd,this).at(n?-1:-2),f=[p[0],p[2]];for(const g of(0,St.A)(zd,this)){const[t,e,i]=g;g[0]=(t-d)/c,g[1]=(e-u)/h,g[2]=(i-u)/h}(0,Mt.A)(Hd,this,{x:d,y:u,width:c,height:h,lastPoint:f})}getOutlines(){(0,St.A)(zd,this).sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of(0,St.A)(zd,this))e[3]?(t.push(...(0,xt.A)(Vd,this,Qd).call(this,e)),(0,xt.A)(Vd,this,Yd).call(this,e)):((0,xt.A)(Vd,this,Kd).call(this,e),t.push(...(0,xt.A)(Vd,this,Qd).call(this,e)));return(0,xt.A)(Vd,this,qd).call(this,t)}}function qd(t){const e=[],i=new Set;for(const r of t){const[t,i,n]=r;e.push([t,i,r],[t,n,r])}e.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let r=0,a=e.length;r<a;r+=2){const t=e[r][2],n=e[r+1][2];t.push(n),n.push(t),i.add(t),i.add(n)}const n=[];let s;for(;i.size>0;){const t=i.values().next().value;let[e,r,a,o,l]=t;i.delete(t);let c=e,h=r;for(s=[e,a],n.push(s);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,r,a,o,l]=t,c!==e&&(s.push(c,h,e,h===r?r:a),c=e),h=h===r?a:r}s.push(c,h)}return new tu(n,(0,St.A)(Hd,this))}function Xd(t){const e=(0,St.A)(Ud,this);let i=0,n=e.length-1;for(;i<=n;){const s=i+n>>1,r=e[s][0];if(r===t)return s;r<t?i=s+1:n=s-1}return n+1}function Yd(t){let[,e,i]=t;const n=(0,xt.A)(Vd,this,Xd).call(this,e);(0,St.A)(Ud,this).splice(n,0,[e,i])}function Kd(t){let[,e,i]=t;const n=(0,xt.A)(Vd,this,Xd).call(this,e);for(let s=n;s<(0,St.A)(Ud,this).length;s++){const[t,n]=(0,St.A)(Ud,this)[s];if(t!==e)break;if(t===e&&n===i)return void(0,St.A)(Ud,this).splice(s,1)}for(let s=n-1;s>=0;s--){const[t,n]=(0,St.A)(Ud,this)[s];if(t!==e)break;if(t===e&&n===i)return void(0,St.A)(Ud,this).splice(s,1)}}function Qd(t){const[e,i,n]=t,s=[[e,i,n]],r=(0,xt.A)(Vd,this,Xd).call(this,n);for(let a=0;a<r;a++){const[t,i]=(0,St.A)(Ud,this)[a];for(let n=0,r=s.length;n<r;n++){const[,a,o]=s[n];if(!(i<=a||o<=t))if(a>=t)if(o>i)s[n][1]=i;else{if(1===r)return[];s.splice(n,1),n--,r--}else s[n][2]=t,o>i&&s.push([e,i,o])}}return s}class Zd{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(t,e){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof Su}}var Jd=new WeakMap,$d=new WeakMap;class tu extends Zd{constructor(t,e){super(),(0,Ct.A)(this,Jd,void 0),(0,Ct.A)(this,$d,void 0),(0,Mt.A)($d,this,t),(0,Mt.A)(Jd,this,e)}toSVGPath(){const t=[];for(const e of(0,St.A)($d,this)){let[i,n]=e;t.push("M".concat(i," ").concat(n));for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push("V".concat(a)),n=a):a===n&&(t.push("H".concat(r)),i=r)}t.push("Z")}return t.join(" ")}serialize(t,e){let[i,n,s,r]=t;const a=[],o=s-i,l=r-n;for(const c of(0,St.A)($d,this)){const t=new Array(c.length);for(let e=0;e<c.length;e+=2)t[e]=i+c[e]*o,t[e+1]=r-c[e+1]*l;a.push(t)}return a}get box(){return(0,St.A)(Jd,this)}}var eu=new WeakMap,iu=new WeakMap,nu=new WeakMap,su=new WeakMap,ru=new WeakMap,au=new WeakMap,ou=new WeakMap,lu=new WeakMap,cu=new WeakMap,hu=new WeakMap,du=new WeakMap,uu=new WeakMap,pu=new WeakMap,fu=new WeakSet;class gu{constructor(t,e,i,n,s){let{x:r,y:a}=t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(0,_t.A)(this,fu),(0,Ct.A)(this,eu,void 0),(0,Ct.A)(this,iu,[]),(0,Ct.A)(this,nu,void 0),(0,Ct.A)(this,su,void 0),(0,Ct.A)(this,ru,[]),(0,Ct.A)(this,au,new Float64Array(18)),(0,Ct.A)(this,ou,void 0),(0,Ct.A)(this,lu,void 0),(0,Ct.A)(this,cu,void 0),(0,Ct.A)(this,hu,void 0),(0,Ct.A)(this,du,void 0),(0,Ct.A)(this,uu,void 0),(0,Ct.A)(this,pu,[]),(0,Mt.A)(eu,this,e),(0,Mt.A)(uu,this,n*i),(0,Mt.A)(su,this,s),(0,St.A)(au,this).set([NaN,NaN,NaN,NaN,r,a],6),(0,Mt.A)(nu,this,o),(0,Mt.A)(hu,this,mu._*i),(0,Mt.A)(cu,this,vu._*i),(0,Mt.A)(du,this,i),(0,St.A)(pu,this).push(r,a)}get free(){return!0}isEmpty(){return isNaN((0,St.A)(au,this)[8])}add(t){var e;let{x:i,y:n}=t;(0,Mt.A)(ou,this,i),(0,Mt.A)(lu,this,n);const[s,r,a,o]=(0,St.A)(eu,this);let[l,c,h,d]=(0,St.A)(au,this).subarray(8,12);const u=i-h,p=n-d,f=Math.hypot(u,p);if(f<(0,St.A)(cu,this))return!1;const g=f-(0,St.A)(hu,this),A=g/f,m=A*u,v=A*p;let b=l,w=c;l=h,c=d,h+=m,d+=v,null===(e=(0,St.A)(pu,this))||void 0===e||e.push(i,n);const y=m/g,_=-v/g*(0,St.A)(uu,this),x=y*(0,St.A)(uu,this);if((0,St.A)(au,this).set((0,St.A)(au,this).subarray(2,8),0),(0,St.A)(au,this).set([h+_,d+x],4),(0,St.A)(au,this).set((0,St.A)(au,this).subarray(14,18),12),(0,St.A)(au,this).set([h-_,d-x],16),isNaN((0,St.A)(au,this)[6]))return 0===(0,St.A)(ru,this).length&&((0,St.A)(au,this).set([l+_,c+x],2),(0,St.A)(ru,this).push(NaN,NaN,NaN,NaN,(l+_-s)/a,(c+x-r)/o),(0,St.A)(au,this).set([l-_,c-x],14),(0,St.A)(iu,this).push(NaN,NaN,NaN,NaN,(l-_-s)/a,(c-x-r)/o)),(0,St.A)(au,this).set([b,w,l,c,h,d],6),!this.isEmpty();(0,St.A)(au,this).set([b,w,l,c,h,d],6);return Math.abs(Math.atan2(w-c,b-l)-Math.atan2(v,m))<Math.PI/2?([l,c,h,d]=(0,St.A)(au,this).subarray(2,6),(0,St.A)(ru,this).push(NaN,NaN,NaN,NaN,((l+h)/2-s)/a,((c+d)/2-r)/o),[l,c,b,w]=(0,St.A)(au,this).subarray(14,18),(0,St.A)(iu,this).push(NaN,NaN,NaN,NaN,((b+l)/2-s)/a,((w+c)/2-r)/o),!0):([b,w,l,c,h,d]=(0,St.A)(au,this).subarray(0,6),(0,St.A)(ru,this).push(((b+5*l)/6-s)/a,((w+5*c)/6-r)/o,((5*l+h)/6-s)/a,((5*c+d)/6-r)/o,((l+h)/2-s)/a,((c+d)/2-r)/o),[h,d,l,c,b,w]=(0,St.A)(au,this).subarray(12,18),(0,St.A)(iu,this).push(((b+5*l)/6-s)/a,((w+5*c)/6-r)/o,((5*l+h)/6-s)/a,((5*c+d)/6-r)/o,((l+h)/2-s)/a,((c+d)/2-r)/o),!0)}toSVGPath(){if(this.isEmpty())return"";const t=(0,St.A)(ru,this),e=(0,St.A)(iu,this),i=(0,St.A)(au,this).subarray(4,6),n=(0,St.A)(au,this).subarray(16,18),[s,r,a,o]=(0,St.A)(eu,this),[l,c,h,d]=(0,xt.A)(fu,this,Au).call(this);if(isNaN((0,St.A)(au,this)[6])&&!this.isEmpty())return"M".concat(((0,St.A)(au,this)[2]-s)/a," ").concat(((0,St.A)(au,this)[3]-r)/o," L").concat(((0,St.A)(au,this)[4]-s)/a," ").concat(((0,St.A)(au,this)[5]-r)/o," L").concat(l," ").concat(c," L").concat(h," ").concat(d," L").concat(((0,St.A)(au,this)[16]-s)/a," ").concat(((0,St.A)(au,this)[17]-r)/o," L").concat(((0,St.A)(au,this)[14]-s)/a," ").concat(((0,St.A)(au,this)[15]-r)/o," Z");const u=[];u.push("M".concat(t[4]," ").concat(t[5]));for(let p=6;p<t.length;p+=6)isNaN(t[p])?u.push("L".concat(t[p+4]," ").concat(t[p+5])):u.push("C".concat(t[p]," ").concat(t[p+1]," ").concat(t[p+2]," ").concat(t[p+3]," ").concat(t[p+4]," ").concat(t[p+5]));u.push("L".concat((i[0]-s)/a," ").concat((i[1]-r)/o," L").concat(l," ").concat(c," L").concat(h," ").concat(d," L").concat((n[0]-s)/a," ").concat((n[1]-r)/o));for(let p=e.length-6;p>=6;p-=6)isNaN(e[p])?u.push("L".concat(e[p+4]," ").concat(e[p+5])):u.push("C".concat(e[p]," ").concat(e[p+1]," ").concat(e[p+2]," ").concat(e[p+3]," ").concat(e[p+4]," ").concat(e[p+5]));return u.push("L".concat(e[4]," ").concat(e[5]," Z")),u.join(" ")}getOutlines(){var t,e;const i=(0,St.A)(ru,this),n=(0,St.A)(iu,this),s=(0,St.A)(au,this),r=s.subarray(4,6),a=s.subarray(16,18),[o,l,c,h]=(0,St.A)(eu,this),d=new Float64Array((null!==(t=null===(e=(0,St.A)(pu,this))||void 0===e?void 0:e.length)&&void 0!==t?t:0)+2);for(let v=0,b=d.length-2;v<b;v+=2)d[v]=((0,St.A)(pu,this)[v]-o)/c,d[v+1]=((0,St.A)(pu,this)[v+1]-l)/h;d[d.length-2]=((0,St.A)(ou,this)-o)/c,d[d.length-1]=((0,St.A)(lu,this)-l)/h;const[u,p,f,g]=(0,xt.A)(fu,this,Au).call(this);if(isNaN(s[6])&&!this.isEmpty()){const t=new Float64Array(36);return t.set([NaN,NaN,NaN,NaN,(s[2]-o)/c,(s[3]-l)/h,NaN,NaN,NaN,NaN,(s[4]-o)/c,(s[5]-l)/h,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,f,g,NaN,NaN,NaN,NaN,(s[16]-o)/c,(s[17]-l)/h,NaN,NaN,NaN,NaN,(s[14]-o)/c,(s[15]-l)/h],0),new Su(t,d,(0,St.A)(eu,this),(0,St.A)(du,this),(0,St.A)(nu,this),(0,St.A)(su,this))}const A=new Float64Array((0,St.A)(ru,this).length+24+(0,St.A)(iu,this).length);let m=i.length;for(let v=0;v<m;v+=2)isNaN(i[v])?A[v]=A[v+1]=NaN:(A[v]=i[v],A[v+1]=i[v+1]);A.set([NaN,NaN,NaN,NaN,(r[0]-o)/c,(r[1]-l)/h,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,f,g,NaN,NaN,NaN,NaN,(a[0]-o)/c,(a[1]-l)/h],m),m+=24;for(let v=n.length-6;v>=6;v-=6)for(let t=0;t<6;t+=2)isNaN(n[v+t])?(A[m]=A[m+1]=NaN,m+=2):(A[m]=n[v+t],A[m+1]=n[v+t+1],m+=2);return A.set([NaN,NaN,NaN,NaN,n[4],n[5]],m),new Su(A,d,(0,St.A)(eu,this),(0,St.A)(du,this),(0,St.A)(nu,this),(0,St.A)(su,this))}}function Au(){const t=(0,St.A)(au,this).subarray(4,6),e=(0,St.A)(au,this).subarray(16,18),[i,n,s,r]=(0,St.A)(eu,this);return[((0,St.A)(ou,this)+(t[0]-e[0])/2-i)/s,((0,St.A)(lu,this)+(t[1]-e[1])/2-n)/r,((0,St.A)(ou,this)+(e[0]-t[0])/2-i)/s,((0,St.A)(lu,this)+(e[1]-t[1])/2-n)/r]}var mu={_:8},vu={_:mu._+2},bu=new WeakMap,wu=new WeakMap,yu=new WeakMap,_u=new WeakMap,xu=new WeakMap,Eu=new WeakMap,ku=new WeakMap,Cu=new WeakSet;class Su extends Zd{constructor(t,e,i,n,s,r){super(),(0,_t.A)(this,Cu),(0,Ct.A)(this,bu,void 0),(0,Ct.A)(this,wu,null),(0,Ct.A)(this,yu,void 0),(0,Ct.A)(this,_u,void 0),(0,Ct.A)(this,xu,void 0),(0,Ct.A)(this,Eu,void 0),(0,Ct.A)(this,ku,void 0),(0,Mt.A)(ku,this,t),(0,Mt.A)(xu,this,e),(0,Mt.A)(bu,this,i),(0,Mt.A)(Eu,this,n),(0,Mt.A)(yu,this,s),(0,Mt.A)(_u,this,r),(0,xt.A)(Cu,this,Tu).call(this,r);const{x:a,y:o,width:l,height:c}=(0,St.A)(wu,this);for(let h=0,d=t.length;h<d;h+=2)t[h]=(t[h]-a)/l,t[h+1]=(t[h+1]-o)/c;for(let h=0,d=e.length;h<d;h+=2)e[h]=(e[h]-a)/l,e[h+1]=(e[h+1]-o)/c}toSVGPath(){const t=["M".concat((0,St.A)(ku,this)[4]," ").concat((0,St.A)(ku,this)[5])];for(let e=6,i=(0,St.A)(ku,this).length;e<i;e+=6)isNaN((0,St.A)(ku,this)[e])?t.push("L".concat((0,St.A)(ku,this)[e+4]," ").concat((0,St.A)(ku,this)[e+5])):t.push("C".concat((0,St.A)(ku,this)[e]," ").concat((0,St.A)(ku,this)[e+1]," ").concat((0,St.A)(ku,this)[e+2]," ").concat((0,St.A)(ku,this)[e+3]," ").concat((0,St.A)(ku,this)[e+4]," ").concat((0,St.A)(ku,this)[e+5]));return t.push("Z"),t.join(" ")}serialize(t,e){let[i,n,s,r]=t;const a=s-i,o=r-n;let l,c;switch(e){case 0:l=(0,xt.A)(Cu,this,Mu).call(this,(0,St.A)(ku,this),i,r,a,-o),c=(0,xt.A)(Cu,this,Mu).call(this,(0,St.A)(xu,this),i,r,a,-o);break;case 90:l=(0,xt.A)(Cu,this,Lu).call(this,(0,St.A)(ku,this),i,n,a,o),c=(0,xt.A)(Cu,this,Lu).call(this,(0,St.A)(xu,this),i,n,a,o);break;case 180:l=(0,xt.A)(Cu,this,Mu).call(this,(0,St.A)(ku,this),s,n,-a,o),c=(0,xt.A)(Cu,this,Mu).call(this,(0,St.A)(xu,this),s,n,-a,o);break;case 270:l=(0,xt.A)(Cu,this,Lu).call(this,(0,St.A)(ku,this),s,r,-a,-o),c=(0,xt.A)(Cu,this,Lu).call(this,(0,St.A)(xu,this),s,r,-a,-o)}return{outline:Array.from(l),points:[Array.from(c)]}}get box(){return(0,St.A)(wu,this)}getNewOutline(t,e){const{x:i,y:n,width:s,height:r}=(0,St.A)(wu,this),[a,o,l,c]=(0,St.A)(bu,this),h=s*l,d=r*c,u=i*l+a,p=n*c+o,f=new gu({x:(0,St.A)(xu,this)[0]*h+u,y:(0,St.A)(xu,this)[1]*d+p},(0,St.A)(bu,this),(0,St.A)(Eu,this),t,(0,St.A)(_u,this),null!==e&&void 0!==e?e:(0,St.A)(yu,this));for(let g=2;g<(0,St.A)(xu,this).length;g+=2)f.add({x:(0,St.A)(xu,this)[g]*h+u,y:(0,St.A)(xu,this)[g+1]*d+p});return f.getOutlines()}}function Mu(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a]*n,r[a+1]=i+t[a+1]*s;return r}function Lu(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a+1]*n,r[a+1]=i+t[a]*s;return r}function Tu(t){const e=(0,St.A)(ku,this);let i=e[4],n=e[5],s=i,r=n,a=i,o=n,l=i,c=n;const h=t?Math.max:Math.min;for(let g=6,A=e.length;g<A;g+=6){if(isNaN(e[g]))s=Math.min(s,e[g+4]),r=Math.min(r,e[g+5]),a=Math.max(a,e[g+4]),o=Math.max(o,e[g+5]),c<e[g+5]?(l=e[g+4],c=e[g+5]):c===e[g+5]&&(l=h(l,e[g+4]));else{const t=oi.bezierBoundingBox(i,n,...e.slice(g,g+6));s=Math.min(s,t[0]),r=Math.min(r,t[1]),a=Math.max(a,t[2]),o=Math.max(o,t[3]),c<t[3]?(l=t[2],c=t[3]):c===t[3]&&(l=h(l,t[2]))}i=e[g+4],n=e[g+5]}const d=s-(0,St.A)(yu,this),u=r-(0,St.A)(yu,this),p=a-s+2*(0,St.A)(yu,this),f=o-r+2*(0,St.A)(yu,this);(0,Mt.A)(wu,this,{x:d,y:u,width:p,height:f,lastPoint:[l,c]})}var Ru=new WeakMap,Pu=new WeakMap,Fu=new WeakMap,Iu=new WeakMap,Du=new WeakMap,Ou=new WeakMap,Nu=new WeakMap,Wu=new WeakMap,ju=new WeakMap,Bu=new WeakMap,Hu=new WeakMap,zu=new WeakMap,Uu=new WeakSet;class Vu{static get _keyboardManager(){return Xe(this,"_keyboardManager",new Jn([[["Escape","mac+Escape"],Vu.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Vu.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Vu.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Vu.prototype._moveToPrevious],[["Home","mac+Home"],Vu.prototype._moveToBeginning],[["End","mac+End"],Vu.prototype._moveToEnd]]))}constructor(t){var e;let{editor:i=null,uiManager:n=null}=t;(0,_t.A)(this,Uu),(0,Ct.A)(this,Ru,(0,xt.A)(Uu,this,Xu).bind(this)),(0,Ct.A)(this,Pu,(0,xt.A)(Uu,this,Ku).bind(this)),(0,Ct.A)(this,Fu,null),(0,Ct.A)(this,Iu,null),(0,Ct.A)(this,Du,void 0),(0,Ct.A)(this,Ou,null),(0,Ct.A)(this,Nu,!1),(0,Ct.A)(this,Wu,!1),(0,Ct.A)(this,ju,null),(0,Ct.A)(this,Bu,void 0),(0,Ct.A)(this,Hu,null),(0,Ct.A)(this,zu,void 0),i?((0,Mt.A)(Wu,this,!1),(0,Mt.A)(zu,this,ne.HIGHLIGHT_COLOR),(0,Mt.A)(ju,this,i)):((0,Mt.A)(Wu,this,!0),(0,Mt.A)(zu,this,ne.HIGHLIGHT_DEFAULT_COLOR)),(0,Mt.A)(Hu,this,(null===i||void 0===i?void 0:i._uiManager)||n),(0,Mt.A)(Bu,this,(0,St.A)(Hu,this)._eventBus),(0,Mt.A)(Du,this,(null===i||void 0===i?void 0:i.color)||(null===(e=(0,St.A)(Hu,this))||void 0===e?void 0:e.highlightColors.values().next().value)||"#FFFF98")}renderButton(){const t=(0,Mt.A)(Fu,this,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const e=(0,St.A)(Hu,this)._signal;t.addEventListener("click",(0,xt.A)(Uu,this,Yu).bind(this),{signal:e}),t.addEventListener("keydown",(0,St.A)(Ru,this),{signal:e});const i=(0,Mt.A)(Iu,this,document.createElement("span"));return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=(0,St.A)(Du,this),t.append(i),t}renderMainDropdown(){const t=(0,Mt.A)(Ou,this,(0,xt.A)(Uu,this,Gu).call(this));return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}_colorSelectFromKeyboard(t){if(t.target===(0,St.A)(Fu,this))return void(0,xt.A)(Uu,this,Yu).call(this,t);const e=t.target.getAttribute("data-color");e&&(0,xt.A)(Uu,this,qu).call(this,e,t)}_moveToNext(t){var e,i;Et(Uu,this,Qu)?t.target!==(0,St.A)(Fu,this)?null===(e=t.target.nextSibling)||void 0===e||e.focus():null===(i=(0,St.A)(Ou,this).firstChild)||void 0===i||i.focus():(0,xt.A)(Uu,this,Yu).call(this,t)}_moveToPrevious(t){var e,i;t.target!==(null===(e=(0,St.A)(Ou,this))||void 0===e?void 0:e.firstChild)&&t.target!==(0,St.A)(Fu,this)?(Et(Uu,this,Qu)||(0,xt.A)(Uu,this,Yu).call(this,t),null===(i=t.target.previousSibling)||void 0===i||i.focus()):Et(Uu,this,Qu)&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){var e;Et(Uu,this,Qu)?null===(e=(0,St.A)(Ou,this).firstChild)||void 0===e||e.focus():(0,xt.A)(Uu,this,Yu).call(this,t)}_moveToEnd(t){var e;Et(Uu,this,Qu)?null===(e=(0,St.A)(Ou,this).lastChild)||void 0===e||e.focus():(0,xt.A)(Uu,this,Yu).call(this,t)}hideDropdown(){var t;null===(t=(0,St.A)(Ou,this))||void 0===t||t.classList.add("hidden"),window.removeEventListener("pointerdown",(0,St.A)(Pu,this))}_hideDropdownFromKeyboard(){var t;(0,St.A)(Wu,this)||(Et(Uu,this,Qu)?(this.hideDropdown(),(0,St.A)(Fu,this).focus({preventScroll:!0,focusVisible:(0,St.A)(Nu,this)})):null===(t=(0,St.A)(ju,this))||void 0===t||t.unselect())}updateColor(t){if((0,St.A)(Iu,this)&&((0,St.A)(Iu,this).style.backgroundColor=t),!(0,St.A)(Ou,this))return;const e=(0,St.A)(Hu,this).highlightColors.values();for(const i of(0,St.A)(Ou,this).children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){var t,e;null===(t=(0,St.A)(Fu,this))||void 0===t||t.remove(),(0,Mt.A)(Fu,this,null),(0,Mt.A)(Iu,this,null),null===(e=(0,St.A)(Ou,this))||void 0===e||e.remove(),(0,Mt.A)(Ou,this,null)}}function Gu(){const t=document.createElement("div"),e=(0,St.A)(Hu,this)._signal;t.addEventListener("contextmenu",ln,{signal:e}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[i,n]of(0,St.A)(Hu,this).highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",n),s.title=i,s.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-".concat(i));const r=document.createElement("span");s.append(r),r.className="swatch",r.style.backgroundColor=n,s.setAttribute("aria-selected",n===(0,St.A)(Du,this)),s.addEventListener("click",(0,xt.A)(Uu,this,qu).bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",(0,St.A)(Ru,this),{signal:e}),t}function qu(t,e){e.stopPropagation(),(0,St.A)(Bu,this).dispatch("switchannotationeditorparams",{source:this,type:(0,St.A)(zu,this),value:t})}function Xu(t){Nt._keyboardManager.exec(this,t)}function Yu(t){if(Et(Uu,this,Qu))return void this.hideDropdown();if((0,Mt.A)(Nu,this,0===t.detail),window.addEventListener("pointerdown",(0,St.A)(Pu,this),{signal:(0,St.A)(Hu,this)._signal}),(0,St.A)(Ou,this))return void(0,St.A)(Ou,this).classList.remove("hidden");const e=(0,Mt.A)(Ou,this,(0,xt.A)(Uu,this,Gu).call(this));(0,St.A)(Fu,this).append(e)}function Ku(t){var e;null!==(e=(0,St.A)(Ou,this))&&void 0!==e&&e.contains(t.target)||this.hideDropdown()}function Qu(t){return(0,St.A)(Ou,t)&&!(0,St.A)(Ou,t).classList.contains("hidden")}Nt=Vu;var Zu=new WeakMap,Ju=new WeakMap,$u=new WeakMap,tp=new WeakMap,ep=new WeakMap,ip=new WeakMap,np=new WeakMap,sp=new WeakMap,rp=new WeakMap,ap=new WeakMap,op=new WeakMap,lp=new WeakMap,cp=new WeakMap,hp=new WeakMap,dp=new WeakMap,up=new WeakMap,pp=new WeakMap,fp=new WeakMap,gp=new WeakMap,Ap=new WeakSet;class mp extends Yr{static get _keyboardManager(){const t=mp.prototype;return Xe(this,"_keyboardManager",new Jn([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super((0,bt.A)((0,bt.A)({},t),{},{name:"highlightEditor"})),(0,_t.A)(this,Ap),(0,Ct.A)(this,Zu,null),(0,Ct.A)(this,Ju,0),(0,Ct.A)(this,$u,void 0),(0,Ct.A)(this,tp,null),(0,Ct.A)(this,ep,null),(0,Ct.A)(this,ip,null),(0,Ct.A)(this,np,null),(0,Ct.A)(this,sp,0),(0,Ct.A)(this,rp,null),(0,Ct.A)(this,ap,null),(0,Ct.A)(this,op,null),(0,Ct.A)(this,lp,!1),(0,Ct.A)(this,cp,(0,xt.A)(Ap,this,Cp).bind(this)),(0,Ct.A)(this,hp,null),(0,Ct.A)(this,dp,void 0),(0,Ct.A)(this,up,null),(0,Ct.A)(this,pp,""),(0,Ct.A)(this,fp,void 0),(0,Ct.A)(this,gp,""),this.color=t.color||mp._defaultColor,(0,Mt.A)(fp,this,t.thickness||mp._defaultThickness),(0,Mt.A)(dp,this,t.opacity||mp._defaultOpacity),(0,Mt.A)($u,this,t.boxes||null),(0,Mt.A)(gp,this,t.methodOfCreation||""),(0,Mt.A)(pp,this,t.text||""),this._isDraggable=!1,t.highlightId>-1?((0,Mt.A)(lp,this,!0),(0,xt.A)(Ap,this,bp).call(this,t),(0,xt.A)(Ap,this,Ep).call(this)):((0,Mt.A)(Zu,this,t.anchorNode),(0,Mt.A)(Ju,this,t.anchorOffset),(0,Mt.A)(np,this,t.focusNode),(0,Mt.A)(sp,this,t.focusOffset),(0,xt.A)(Ap,this,vp).call(this),(0,xt.A)(Ap,this,Ep).call(this),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:(0,St.A)(lp,this)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:(0,St.A)(fp,this),methodOfCreation:(0,St.A)(gp,this)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,e){var i;Yr.initialize(t,e),mp._defaultColor||(mp._defaultColor=(null===(i=e.highlightColors)||void 0===i?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,e){switch(t){case ne.HIGHLIGHT_DEFAULT_COLOR:mp._defaultColor=e;break;case ne.HIGHLIGHT_THICKNESS:mp._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return(0,St.A)(hp,this)}updateParams(t,e){switch(t){case ne.HIGHLIGHT_COLOR:(0,xt.A)(Ap,this,wp).call(this,e);break;case ne.HIGHLIGHT_THICKNESS:(0,xt.A)(Ap,this,yp).call(this,e)}}static get defaultPropertiesToUpdate(){return[[ne.HIGHLIGHT_DEFAULT_COLOR,mp._defaultColor],[ne.HIGHLIGHT_THICKNESS,mp._defaultThickness]]}get propertiesToUpdate(){return[[ne.HIGHLIGHT_COLOR,this.color||mp._defaultColor],[ne.HIGHLIGHT_THICKNESS,(0,St.A)(fp,this)||mp._defaultThickness],[ne.HIGHLIGHT_FREE,(0,St.A)(lp,this)]]}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&((0,Mt.A)(ep,this,new Vu({editor:this})),t.addColorPicker((0,St.A)(ep,this))),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition((0,xt.A)(Ap,this,Mp).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,(0,xt.A)(Ap,this,Mp).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){(0,xt.A)(Ap,this,xp).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&((0,xt.A)(Ap,this,Ep).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;if(this.parent&&!t)(0,xt.A)(Ap,this,xp).call(this);else if(t){var i;(0,xt.A)(Ap,this,Ep).call(this,t),e=!this.parent&&(null===(i=this.div)||void 0===i?void 0:i.classList.contains("selectedEditor"))}super.setParent(t),this.show(this._isVisible),e&&this.select()}rotate(t){const{drawLayer:e}=this.parent;let i;(0,St.A)(lp,this)?(t=(t-this.rotation+360)%360,i=kp.call(mp,(0,St.A)(ap,this).box,t)):i=kp.call(mp,this,t),e.rotate((0,St.A)(op,this),t),e.rotate((0,St.A)(up,this),t),e.updateBox((0,St.A)(op,this),i),e.updateBox((0,St.A)(up,this),kp.call(mp,(0,St.A)(ip,this).box,t))}render(){if(this.div)return this.div;const t=super.render();(0,St.A)(pp,this)&&(t.setAttribute("aria-label",(0,St.A)(pp,this)),t.setAttribute("role","mark")),(0,St.A)(lp,this)?t.classList.add("free"):this.div.addEventListener("keydown",(0,St.A)(cp,this),{signal:this._uiManager._signal});const e=(0,Mt.A)(rp,this,document.createElement("div"));t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=(0,St.A)(tp,this);const[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),Nn(this,(0,St.A)(rp,this),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass((0,St.A)(up,this),"hovered")}pointerleave(){this.parent.drawLayer.removeClass((0,St.A)(up,this),"hovered")}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:(0,xt.A)(Ap,this,Sp).call(this,!0);break;case 1:case 3:(0,xt.A)(Ap,this,Sp).call(this,!1)}}select(){var t,e;super.select(),(0,St.A)(up,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.removeClass((0,St.A)(up,this),"hovered"),null===(e=this.parent)||void 0===e||e.drawLayer.addClass((0,St.A)(up,this),"selected"))}unselect(){var t;super.unselect(),(0,St.A)(up,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.removeClass((0,St.A)(up,this),"selected"),(0,St.A)(lp,this)||(0,xt.A)(Ap,this,Sp).call(this,!1))}get _mustFixPosition(){return!(0,St.A)(lp,this)}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(t),this.parent&&(this.parent.drawLayer.show((0,St.A)(op,this),t),this.parent.drawLayer.show((0,St.A)(up,this),t))}static startHighlighting(t,e,i){let{target:n,x:s,y:r}=i;const{x:a,y:o,width:l,height:c}=n.getBoundingClientRect(),h=e=>{(0,xt.A)(mp,this,Rp).call(this,t,e)},d=t._signal,u={capture:!0,passive:!1,signal:d},p=t=>{t.preventDefault(),t.stopPropagation()},f=e=>{n.removeEventListener("pointermove",h),window.removeEventListener("blur",f),window.removeEventListener("pointerup",f),window.removeEventListener("pointerdown",p,u),window.removeEventListener("contextmenu",ln),(0,xt.A)(mp,this,Pp).call(this,t,e)};window.addEventListener("blur",f,{signal:d}),window.addEventListener("pointerup",f,{signal:d}),window.addEventListener("pointerdown",p,u),window.addEventListener("contextmenu",ln,{signal:d}),n.addEventListener("pointermove",h,{signal:d}),this._freeHighlight=new gu({x:s,y:r},[a,o,l,c],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static deserialize(t,e,i){const n=super.deserialize(t,e,i),{rect:[s,r,a,o],color:l,quadPoints:c}=t;n.color=oi.makeHexColor(...l),(0,Mt.A)(dp,n,t.opacity);const[h,d]=n.pageDimensions;n.width=(a-s)/h,n.height=(o-r)/d;const u=(0,Mt.A)($u,n,[]);for(let p=0;p<c.length;p+=8)u.push({x:(c[4]-a)/h,y:(o-(1-c[p+5]))/d,width:(c[p+2]-c[p])/h,height:(c[p+5]-c[p+1])/d});return(0,xt.A)(Ap,n,vp).call(n),n}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||t)return null;const e=this.getRect(0,0),i=Yr._colorManager.convert(this.color);return{annotationType:ie.HIGHLIGHT,color:i,opacity:(0,St.A)(dp,this),thickness:(0,St.A)(fp,this),quadPoints:(0,xt.A)(Ap,this,Lp).call(this),outlines:(0,xt.A)(Ap,this,Tp).call(this,e),pageIndex:this.pageIndex,rect:e,rotation:(0,xt.A)(Ap,this,Mp).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}}function vp(){const t=new Gd((0,St.A)($u,this),.001);(0,Mt.A)(ap,this,t.getOutlines()),({x:this.x,y:this.y,width:this.width,height:this.height}=(0,St.A)(ap,this).box);const e=new Gd((0,St.A)($u,this),.0025,.001,"ltr"===this._uiManager.direction);(0,Mt.A)(ip,this,e.getOutlines());const{lastPoint:i}=(0,St.A)(ip,this).box;(0,Mt.A)(hp,this,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])}function bp(t){let{highlightOutlines:e,highlightId:i,clipPathId:n}=t;(0,Mt.A)(ap,this,e);if((0,Mt.A)(ip,this,e.getNewOutline((0,St.A)(fp,this)/2+1.5,.0025)),i>=0)(0,Mt.A)(op,this,i),(0,Mt.A)(tp,this,n),this.parent.drawLayer.finalizeLine(i,e),(0,Mt.A)(up,this,this.parent.drawLayer.highlightOutline((0,St.A)(ip,this)));else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateLine((0,St.A)(op,this),e),this.parent.drawLayer.updateBox((0,St.A)(op,this),kp.call(Wt,(0,St.A)(ap,this).box,(t-this.rotation+360)%360)),this.parent.drawLayer.updateLine((0,St.A)(up,this),(0,St.A)(ip,this)),this.parent.drawLayer.updateBox((0,St.A)(up,this),kp.call(Wt,(0,St.A)(ip,this).box,t))}const{x:s,y:r,width:a,height:o}=e.box;switch(this.rotation){case 0:this.x=s,this.y=r,this.width=a,this.height=o;break;case 90:{const[t,e]=this.parentDimensions;this.x=r,this.y=1-s,this.width=a*e/t,this.height=o*t/e;break}case 180:this.x=1-s,this.y=1-r,this.width=a,this.height=o;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-r,this.y=s,this.width=a*e/t,this.height=o*t/e;break}}const{lastPoint:l}=(0,St.A)(ip,this).box;(0,Mt.A)(hp,this,[(l[0]-s)/a,(l[1]-r)/o])}function wp(t){const e=t=>{var e,i;this.color=t,null===(e=this.parent)||void 0===e||e.drawLayer.changeColor((0,St.A)(op,this),t),null===(i=(0,St.A)(ep,this))||void 0===i||i.updateColor(t)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ne.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}function yp(t){const e=(0,St.A)(fp,this),i=t=>{(0,Mt.A)(fp,this,t),(0,xt.A)(Ap,this,_p).call(this,t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ne.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}function _p(t){if(!(0,St.A)(lp,this))return;(0,xt.A)(Ap,this,bp).call(this,{highlightOutlines:(0,St.A)(ap,this).getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}function xp(){null!==(0,St.A)(op,this)&&this.parent&&(this.parent.drawLayer.remove((0,St.A)(op,this)),(0,Mt.A)(op,this,null),this.parent.drawLayer.remove((0,St.A)(up,this)),(0,Mt.A)(up,this,null))}function Ep(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===(0,St.A)(op,this)&&(({id:wt(Mt.A,[op,this])._,clipPathId:wt(Mt.A,[tp,this])._}=t.drawLayer.highlight((0,St.A)(ap,this),this.color,(0,St.A)(dp,this))),(0,Mt.A)(up,this,t.drawLayer.highlightOutline((0,St.A)(ip,this))),(0,St.A)(rp,this)&&((0,St.A)(rp,this).style.clipPath=(0,St.A)(tp,this)))}function kp(t,e){let{x:i,y:n,width:s,height:r}=t;switch(e){case 90:return{x:1-n-r,y:i,width:r,height:s};case 180:return{x:1-i-s,y:1-n-r,width:s,height:r};case 270:return{x:n,y:1-i-s,width:r,height:s}}return{x:i,y:n,width:s,height:r}}function Cp(t){Wt._keyboardManager.exec(this,t)}function Sp(t){if(!(0,St.A)(Zu,this))return;const e=window.getSelection();t?e.setPosition((0,St.A)(Zu,this),(0,St.A)(Ju,this)):e.setPosition((0,St.A)(np,this),(0,St.A)(sp,this))}function Mp(){return(0,St.A)(lp,this)?this.rotation:0}function Lp(){if((0,St.A)(lp,this))return null;const[t,e]=this.pageDimensions,i=(0,St.A)($u,this),n=new Float32Array(8*i.length);let s=0;for(const{x:r,y:a,width:o,height:l}of i){const i=r*t,c=(1-a-l)*e;n[s]=n[s+4]=i,n[s+1]=n[s+3]=c,n[s+2]=n[s+6]=i+o*t,n[s+5]=n[s+7]=c+l*e,s+=8}return n}function Tp(t){return(0,St.A)(ap,this).serialize(t,(0,xt.A)(Ap,this,Mp).call(this))}function Rp(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}function Pp(t,e){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}Wt=mp,(0,kt.A)(mp,"_defaultColor",null),(0,kt.A)(mp,"_defaultOpacity",1),(0,kt.A)(mp,"_defaultThickness",12),(0,kt.A)(mp,"_l10nPromise",void 0),(0,kt.A)(mp,"_type","highlight"),(0,kt.A)(mp,"_editorType",ie.HIGHLIGHT),(0,kt.A)(mp,"_freeHighlightId",-1),(0,kt.A)(mp,"_freeHighlight",null),(0,kt.A)(mp,"_freeHighlightClipId","");var Fp=new WeakMap,Ip=new WeakMap,Dp=new WeakMap,Op=new WeakMap,Np=new WeakMap,Wp=new WeakMap,jp=new WeakMap,Bp=new WeakMap,Hp=new WeakMap,zp=new WeakMap,Up=new WeakMap,Vp=new WeakMap,Gp=new WeakMap,qp=new WeakMap,Xp=new WeakMap,Yp=new WeakSet;class Kp extends Yr{constructor(t){super((0,bt.A)((0,bt.A)({},t),{},{name:"inkEditor"})),(0,_t.A)(this,Yp),(0,Ct.A)(this,Fp,0),(0,Ct.A)(this,Ip,0),(0,Ct.A)(this,Dp,this.canvasPointermove.bind(this)),(0,Ct.A)(this,Op,this.canvasPointerleave.bind(this)),(0,Ct.A)(this,Np,this.canvasPointerup.bind(this)),(0,Ct.A)(this,Wp,this.canvasPointerdown.bind(this)),(0,Ct.A)(this,jp,null),(0,Ct.A)(this,Bp,new Path2D),(0,Ct.A)(this,Hp,!1),(0,Ct.A)(this,zp,!1),(0,Ct.A)(this,Up,!1),(0,Ct.A)(this,Vp,null),(0,Ct.A)(this,Gp,0),(0,Ct.A)(this,qp,0),(0,Ct.A)(this,Xp,null),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,e){Yr.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case ne.INK_THICKNESS:Kp._defaultThickness=e;break;case ne.INK_COLOR:Kp._defaultColor=e;break;case ne.INK_OPACITY:Kp._defaultOpacity=e/100}}updateParams(t,e){switch(t){case ne.INK_THICKNESS:(0,xt.A)(Yp,this,Qp).call(this,e);break;case ne.INK_COLOR:(0,xt.A)(Yp,this,Zp).call(this,e);break;case ne.INK_OPACITY:(0,xt.A)(Yp,this,Jp).call(this,e)}}static get defaultPropertiesToUpdate(){return[[ne.INK_THICKNESS,Kp._defaultThickness],[ne.INK_COLOR,Kp._defaultColor||Yr._defaultLineColor],[ne.INK_OPACITY,Math.round(100*Kp._defaultOpacity)]]}get propertiesToUpdate(){var t;return[[ne.INK_THICKNESS,this.thickness||Kp._defaultThickness],[ne.INK_COLOR,this.color||Kp._defaultColor||Yr._defaultLineColor],[ne.INK_OPACITY,Math.round(100*(null!==(t=this.opacity)&&void 0!==t?t:Kp._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||((0,xt.A)(Yp,this,df).call(this),(0,xt.A)(Yp,this,uf).call(this)),this.isAttachedToDOM||(this.parent.add(this),(0,xt.A)(Yp,this,pf).call(this)),(0,xt.A)(Yp,this,_f).call(this)))}remove(){var t;null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,(0,St.A)(jp,this)&&(clearTimeout((0,St.A)(jp,this)),(0,Mt.A)(jp,this,null)),null===(t=(0,St.A)(Vp,this))||void 0===t||t.disconnect(),(0,Mt.A)(Vp,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,i=this.width*t,n=this.height*e;this.setDimensions(i,n)}enableEditMode(){(0,St.A)(Hp,this)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",(0,St.A)(Wp,this),{signal:this._uiManager._signal}))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",(0,St.A)(Wp,this)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){(0,St.A)(Hp,this)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),(0,Mt.A)(Hp,this,!0),this.div.classList.add("disabled"),(0,xt.A)(Yp,this,_f).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!(0,St.A)(Hp,this)&&(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),(0,xt.A)(Yp,this,ef).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),(0,xt.A)(Yp,this,nf).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),(0,xt.A)(Yp,this,hf).call(this,t)}canvasPointerleave(t){(0,xt.A)(Yp,this,hf).call(this,t)}get isResizable(){return!this.isEmpty()&&(0,St.A)(Hp,this)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,n,s,r]=(0,xt.A)(Yp,this,$p).call(this);if(this.setAt(i,n,0,0),this.setDims(s,r),(0,xt.A)(Yp,this,df).call(this),this.width){const[i,n]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*n),this.setAt(t*i,e*n,this.width*i,this.height*n),(0,Mt.A)(Up,this,!0),(0,xt.A)(Yp,this,pf).call(this),this.setDims(this.width*i,this.height*n),(0,xt.A)(Yp,this,cf).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return(0,xt.A)(Yp,this,uf).call(this),this.div}setDimensions(t,e){const i=Math.round(t),n=Math.round(e);if((0,St.A)(Gp,this)===i&&(0,St.A)(qp,this)===n)return;(0,Mt.A)(Gp,this,i),(0,Mt.A)(qp,this,n),this.canvas.style.visibility="hidden";const[s,r]=this.parentDimensions;this.width=t/s,this.height=e/r,this.fixAndSetPosition(),(0,St.A)(Hp,this)&&(0,xt.A)(Yp,this,ff).call(this,t,e),(0,xt.A)(Yp,this,pf).call(this),(0,xt.A)(Yp,this,cf).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(t,e,i){if(t instanceof id)return null;const n=super.deserialize(t,e,i);n.thickness=t.thickness,n.color=oi.makeHexColor(...t.color),n.opacity=t.opacity;const[s,r]=n.pageDimensions,a=n.width*s,o=n.height*r,l=n.parentScale,c=t.thickness/2;(0,Mt.A)(Hp,n,!0),(0,Mt.A)(Gp,n,Math.round(a)),(0,Mt.A)(qp,n,Math.round(o));const{paths:h,rect:d,rotation:u}=t;for(let{bezier:f}of h){f=vf.call(Kp,f,d,u);const t=[];n.paths.push(t);let e=l*(f[0]-c),i=l*(f[1]-c);for(let n=2,r=f.length;n<r;n+=6){const s=l*(f[n]-c),r=l*(f[n+1]-c),a=l*(f[n+2]-c),o=l*(f[n+3]-c),h=l*(f[n+4]-c),d=l*(f[n+5]-c);t.push([[e,i],[s,r],[a,o],[h,d]]),e=h,i=d}const s=(0,xt.A)(Kp,this,Af).call(this,t);n.bezierPath2D.push(s)}const p=(0,xt.A)(Yp,n,wf).call(n);return(0,Mt.A)(Ip,n,Math.max(Yr.MIN_SIZE,p[2]-p[0])),(0,Mt.A)(Fp,n,Math.max(Yr.MIN_SIZE,p[3]-p[1])),(0,xt.A)(Yp,n,ff).call(n,a,o),n}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=Yr._colorManager.convert(this.ctx.strokeStyle);return{annotationType:ie.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:(0,xt.A)(Yp,this,bf).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}function Qp(t){const e=t=>{this.thickness=t,(0,xt.A)(Yp,this,_f).call(this)},i=this.thickness;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ne.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function Zp(t){const e=t=>{this.color=t,(0,xt.A)(Yp,this,cf).call(this)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ne.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function Jp(t){const e=t=>{this.opacity=t,(0,xt.A)(Yp,this,cf).call(this)};t/=100;const i=this.opacity;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ne.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function $p(){const{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}}function tf(){const{ctx:t,color:e,opacity:i,thickness:n,parentScale:s,scaleFactor:r}=this;t.lineWidth=n*s/r,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle="".concat(e).concat(function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}(i))}function ef(t,e){const i=this._uiManager._signal;var n;(this.canvas.addEventListener("contextmenu",ln,{signal:i}),this.canvas.addEventListener("pointerleave",(0,St.A)(Op,this),{signal:i}),this.canvas.addEventListener("pointermove",(0,St.A)(Dp,this),{signal:i}),this.canvas.addEventListener("pointerup",(0,St.A)(Np,this),{signal:i}),this.canvas.removeEventListener("pointerdown",(0,St.A)(Wp,this)),this.isEditing=!0,(0,St.A)(Up,this))||((0,Mt.A)(Up,this,!0),(0,xt.A)(Yp,this,pf).call(this),this.thickness||(this.thickness=jt._defaultThickness),this.color||(this.color=jt._defaultColor||Yr._defaultLineColor),null!==(n=this.opacity)&&void 0!==n||(this.opacity=jt._defaultOpacity));this.currentPath.push([t,e]),(0,Mt.A)(zp,this,!1),(0,xt.A)(Yp,this,tf).call(this),(0,Mt.A)(Xp,this,()=>{(0,xt.A)(Yp,this,af).call(this),(0,St.A)(Xp,this)&&window.requestAnimationFrame((0,St.A)(Xp,this))}),window.requestAnimationFrame((0,St.A)(Xp,this))}function nf(t,e){const[i,n]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===n)return;const s=this.currentPath;let r=(0,St.A)(Bp,this);if(s.push([t,e]),(0,Mt.A)(zp,this,!0),s.length<=2)return r.moveTo(...s[0]),void r.lineTo(t,e);3===s.length&&((0,Mt.A)(Bp,this,r=new Path2D),r.moveTo(...s[0])),(0,xt.A)(Yp,this,of).call(this,r,...s.at(-3),...s.at(-2),t,e)}function sf(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);(0,St.A)(Bp,this).lineTo(...t)}function rf(t,e){let i;if((0,Mt.A)(Xp,this,null),t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),(0,xt.A)(Yp,this,nf).call(this,t,e),(0,xt.A)(Yp,this,sf).call(this),1!==this.currentPath.length)i=(0,xt.A)(Yp,this,lf).call(this);else{const n=[t,e];i=[[n,n.slice(),n.slice(),n]]}const n=(0,St.A)(Bp,this),s=this.currentPath;this.currentPath=[],(0,Mt.A)(Bp,this,new Path2D);this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(n),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||((0,xt.A)(Yp,this,df).call(this),(0,xt.A)(Yp,this,uf).call(this)),(0,xt.A)(Yp,this,_f).call(this))},mustExec:!0})}function af(){if(!(0,St.A)(zp,this))return;(0,Mt.A)(zp,this,!1);const t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),i=e.map(t=>t[0]),n=e.map(t=>t[1]),{ctx:s}=(Math.min(...i),Math.max(...i),Math.min(...n),Math.max(...n),this);s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(const r of this.bezierPath2D)s.stroke(r);s.stroke((0,St.A)(Bp,this)),s.restore()}function of(t,e,i,n,s,r,a){const o=(e+n)/2,l=(i+s)/2,c=(n+r)/2,h=(s+a)/2;t.bezierCurveTo(o+2*(n-o)/3,l+2*(s-l)/3,c+2*(n-c)/3,h+2*(s-h)/3,c,h)}function lf(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let i,[n,s]=t[0];for(i=1;i<t.length-2;i++){const[r,a]=t[i],[o,l]=t[i+1],c=(r+o)/2,h=(a+l)/2,d=[n+2*(r-n)/3,s+2*(a-s)/3],u=[c+2*(r-c)/3,h+2*(a-h)/3];e.push([[n,s],d,u,[c,h]]),[n,s]=[c,h]}const[r,a]=t[i],[o,l]=t[i+1],c=[n+2*(r-n)/3,s+2*(a-s)/3],h=[o+2*(r-o)/3,l+2*(a-l)/3];return e.push([[n,s],c,h,[o,l]]),e}function cf(){if(this.isEmpty())return void(0,xt.A)(Yp,this,gf).call(this);(0,xt.A)(Yp,this,tf).call(this);const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),(0,xt.A)(Yp,this,gf).call(this);for(const i of this.bezierPath2D)e.stroke(i)}function hf(t){this.canvas.removeEventListener("pointerleave",(0,St.A)(Op,this)),this.canvas.removeEventListener("pointermove",(0,St.A)(Dp,this)),this.canvas.removeEventListener("pointerup",(0,St.A)(Np,this)),this.canvas.addEventListener("pointerdown",(0,St.A)(Wp,this),{signal:this._uiManager._signal}),(0,St.A)(jp,this)&&clearTimeout((0,St.A)(jp,this)),(0,Mt.A)(jp,this,setTimeout(()=>{(0,Mt.A)(jp,this,null),this.canvas.removeEventListener("contextmenu",ln)},10)),(0,xt.A)(Yp,this,rf).call(this,t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}function df(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function uf(){(0,Mt.A)(Vp,this,new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)})),(0,St.A)(Vp,this).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;null===(t=(0,St.A)(Vp,this))||void 0===t||t.disconnect(),(0,Mt.A)(Vp,this,null)},{once:!0})}function pf(){if(!(0,St.A)(Up,this))return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),(0,xt.A)(Yp,this,gf).call(this)}function ff(t,e){const i=(0,xt.A)(Yp,this,yf).call(this),n=(t-i)/(0,St.A)(Ip,this),s=(e-i)/(0,St.A)(Fp,this);this.scaleFactor=Math.min(n,s)}function gf(){const t=(0,xt.A)(Yp,this,yf).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function Af(t){const e=new Path2D;for(let i=0,n=t.length;i<n;i++){const[n,s,r,a]=t[i];0===i&&e.moveTo(...n),e.bezierCurveTo(s[0],s[1],r[0],r[1],a[0],a[1])}return e}function mf(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]+=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]+n,t[e+1]=i+s}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]+=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=r-t[e+1],t[e+1]=a-i}break;default:throw new Error("Invalid rotation")}return t}function vf(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]-=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]-s,t[e+1]=i-n}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]-=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=a-t[e+1],t[e+1]=r-i}break;default:throw new Error("Invalid rotation")}return t}function bf(t,e,i,n){const s=[],r=this.thickness/2,a=t*e+r,o=t*i+r;for(const l of this.paths){const e=[],i=[];for(let n=0,s=l.length;n<s;n++){const[r,c,h,d]=l[n];if(r[0]===d[0]&&r[1]===d[1]&&1===s){const n=t*r[0]+a,s=t*r[1]+o;e.push(n,s),i.push(n,s);break}const u=t*r[0]+a,p=t*r[1]+o,f=t*c[0]+a,g=t*c[1]+o,A=t*h[0]+a,m=t*h[1]+o,v=t*d[0]+a,b=t*d[1]+o;0===n&&(e.push(u,p),i.push(u,p)),e.push(f,g,A,m,v,b),i.push(f,g),n===s-1&&i.push(v,b)}s.push({bezier:mf.call(jt,e,n,this.rotation),points:mf.call(jt,i,n,this.rotation)})}return s}function wf(){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(const s of this.paths)for(const[r,a,o,l]of s){const s=oi.bezierBoundingBox(...r,...a,...o,...l);t=Math.min(t,s[0]),i=Math.min(i,s[1]),e=Math.max(e,s[2]),n=Math.max(n,s[3])}return[t,i,e,n]}function yf(){return(0,St.A)(Hp,this)?Math.ceil(this.thickness*this.parentScale):0}function _f(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!(0,St.A)(Hp,this))return void(0,xt.A)(Yp,this,cf).call(this);const e=(0,xt.A)(Yp,this,wf).call(this),i=(0,xt.A)(Yp,this,yf).call(this);(0,Mt.A)(Ip,this,Math.max(Yr.MIN_SIZE,e[2]-e[0])),(0,Mt.A)(Fp,this,Math.max(Yr.MIN_SIZE,e[3]-e[1]));const n=Math.ceil(i+(0,St.A)(Ip,this)*this.scaleFactor),s=Math.ceil(i+(0,St.A)(Fp,this)*this.scaleFactor),[r,a]=this.parentDimensions;this.width=n/r,this.height=s/a,this.setAspectRatio(n,s);const o=this.translationX,l=this.translationY;this.translationX=-e[0],this.translationY=-e[1],(0,xt.A)(Yp,this,pf).call(this),(0,xt.A)(Yp,this,cf).call(this),(0,Mt.A)(Gp,this,n),(0,Mt.A)(qp,this,s),this.setDims(n,s);const c=t?i/this.scaleFactor/2:0;this.translate(o-this.translationX-c,l-this.translationY-c)}jt=Kp,(0,kt.A)(Kp,"_defaultColor",null),(0,kt.A)(Kp,"_defaultOpacity",1),(0,kt.A)(Kp,"_defaultThickness",1),(0,kt.A)(Kp,"_type","ink"),(0,kt.A)(Kp,"_editorType",ie.INK);var xf=new WeakMap,Ef=new WeakMap,kf=new WeakMap,Cf=new WeakMap,Sf=new WeakMap,Mf=new WeakMap,Lf=new WeakMap,Tf=new WeakMap,Rf=new WeakMap,Pf=new WeakMap,Ff=new WeakMap,If=new WeakSet;class Df extends Yr{constructor(t){super((0,bt.A)((0,bt.A)({},t),{},{name:"stampEditor"})),(0,_t.A)(this,If),(0,Ct.A)(this,xf,null),(0,Ct.A)(this,Ef,null),(0,Ct.A)(this,kf,null),(0,Ct.A)(this,Cf,null),(0,Ct.A)(this,Sf,null),(0,Ct.A)(this,Mf,""),(0,Ct.A)(this,Lf,null),(0,Ct.A)(this,Tf,null),(0,Ct.A)(this,Rf,null),(0,Ct.A)(this,Pf,!1),(0,Ct.A)(this,Ff,!1),(0,Mt.A)(Cf,this,t.bitmapUrl),(0,Mt.A)(Sf,this,t.bitmapFile)}static initialize(t,e){Yr.initialize(t,e)}static get supportedTypes(){return Xe(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>"image/".concat(t)))}static get supportedTypesStr(){return Xe(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(ie.STAMP,{bitmapFile:t.getAsFile()})}remove(){var t,e;(0,St.A)(Ef,this)&&((0,Mt.A)(xf,this,null),this._uiManager.imageManager.deleteId((0,St.A)(Ef,this)),null===(t=(0,St.A)(Lf,this))||void 0===t||t.remove(),(0,Mt.A)(Lf,this,null),null===(e=(0,St.A)(Tf,this))||void 0===e||e.disconnect(),(0,Mt.A)(Tf,this,null),(0,St.A)(Rf,this)&&(clearTimeout((0,St.A)(Rf,this)),(0,Mt.A)(Rf,this,null)));super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&((0,St.A)(Ef,this)&&null===(0,St.A)(Lf,this)&&(0,xt.A)(If,this,Wf).call(this),this.isAttachedToDOM||this.parent.add(this))):(0,St.A)(Ef,this)&&(0,xt.A)(If,this,Wf).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!((0,St.A)(kf,this)||(0,St.A)(xf,this)||(0,St.A)(Cf,this)||(0,St.A)(Sf,this)||(0,St.A)(Ef,this))}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),(0,St.A)(xf,this)?(0,xt.A)(If,this,jf).call(this):(0,xt.A)(If,this,Wf).call(this),this.width){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}getImageForAltText(){return(0,St.A)(Lf,this)}static deserialize(t,e,i){if(t instanceof od)return null;const n=super.deserialize(t,e,i),{rect:s,bitmapUrl:r,bitmapId:a,isSvg:o,accessibilityData:l}=t;a&&i.imageManager.isValidId(a)?(0,Mt.A)(Ef,n,a):(0,Mt.A)(Cf,n,r),(0,Mt.A)(Pf,n,o);const[c,h]=n.pageDimensions;return n.width=(s[2]-s[0])/c,n.height=(s[3]-s[1])/h,l&&(n.altTextData=l),n}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;const i={annotationType:ie.STAMP,bitmapId:(0,St.A)(Ef,this),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:(0,St.A)(Pf,this),structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=(0,xt.A)(If,this,Uf).call(this,!0),i.accessibilityData=this.altTextData,i;const{decorative:n,altText:s}=this.altTextData;if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}),null===e)return i;e.stamps||(e.stamps=new Map);const r=(0,St.A)(Pf,this)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has((0,St.A)(Ef,this))){if((0,St.A)(Pf,this)){const t=e.stamps.get((0,St.A)(Ef,this));r>t.area&&(t.area=r,t.serialized.bitmap.close(),t.serialized.bitmap=(0,xt.A)(If,this,Uf).call(this,!1))}}else e.stamps.set((0,St.A)(Ef,this),{area:r,serialized:i}),i.bitmap=(0,xt.A)(If,this,Uf).call(this,!1);return i}}function Of(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?((0,Mt.A)(xf,this,t.bitmap),e||((0,Mt.A)(Ef,this,t.id),(0,Mt.A)(Pf,this,t.isSvg)),t.file&&(0,Mt.A)(Mf,this,t.file.name),(0,xt.A)(If,this,jf).call(this)):this.remove()}function Nf(){(0,Mt.A)(kf,this,null),this._uiManager.enableWaiting(!1),(0,St.A)(Lf,this)&&this.div.focus()}function Wf(){if((0,St.A)(Ef,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId((0,St.A)(Ef,this)).then(t=>(0,xt.A)(If,this,Of).call(this,t,!0)).finally(()=>(0,xt.A)(If,this,Nf).call(this));if((0,St.A)(Cf,this)){const t=(0,St.A)(Cf,this);return(0,Mt.A)(Cf,this,null),this._uiManager.enableWaiting(!0),void(0,Mt.A)(kf,this,this._uiManager.imageManager.getFromUrl(t).then(t=>(0,xt.A)(If,this,Of).call(this,t)).finally(()=>(0,xt.A)(If,this,Nf).call(this)))}if((0,St.A)(Sf,this)){const t=(0,St.A)(Sf,this);return(0,Mt.A)(Sf,this,null),this._uiManager.enableWaiting(!0),void(0,Mt.A)(kf,this,this._uiManager.imageManager.getFromFile(t).then(t=>(0,xt.A)(If,this,Of).call(this,t)).finally(()=>(0,xt.A)(If,this,Nf).call(this)))}const t=document.createElement("input");t.type="file",t.accept=Bt.supportedTypesStr;const e=this._uiManager._signal;(0,Mt.A)(kf,this,new Promise(i=>{t.addEventListener("change",async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);(0,xt.A)(If,this,Of).call(this,e)}else this.remove();i()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:e})}).finally(()=>(0,xt.A)(If,this,Nf).call(this))),t.click()}function jf(){const{div:t}=this;let{width:e,height:i}=(0,St.A)(xf,this);const[n,s]=this.pageDimensions,r=.75;if(this.width)e=this.width*n,i=this.height*s;else if(e>r*n||i>r*s){const t=Math.min(r*n/e,r*s/i);e*=t,i*=t}const[a,o]=this.parentDimensions;this.setDims(e*a/n,i*o/s),this._uiManager.enableWaiting(!1);const l=(0,Mt.A)(Lf,this,document.createElement("canvas"));t.append(l),t.hidden=!1,(0,xt.A)(If,this,zf).call(this,e,i),(0,xt.A)(If,this,Vf).call(this),(0,St.A)(Ff,this)||(this.parent.addUndoableEditor(this),(0,Mt.A)(Ff,this,!0)),this._reportTelemetry({action:"inserted_image"}),(0,St.A)(Mf,this)&&l.setAttribute("aria-label",(0,St.A)(Mf,this))}function Bf(t,e){var i;const[n,s]=this.parentDimensions;this.width=t/n,this.height=e/s,this.setDims(t,e),null!==(i=this._initialOptions)&&void 0!==i&&i.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==(0,St.A)(Rf,this)&&clearTimeout((0,St.A)(Rf,this));(0,Mt.A)(Rf,this,setTimeout(()=>{(0,Mt.A)(Rf,this,null),(0,xt.A)(If,this,zf).call(this,t,e)},200))}function Hf(t,e){const{width:i,height:n}=(0,St.A)(xf,this);let s=i,r=n,a=(0,St.A)(xf,this);for(;s>2*t||r>2*e;){const i=s,n=r;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const o=new OffscreenCanvas(s,r);o.getContext("2d").drawImage(a,0,0,i,n,0,0,s,r),a=o.transferToImageBitmap()}return a}function zf(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=(0,St.A)(Lf,this);if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;const n=(0,St.A)(Pf,this)?(0,St.A)(xf,this):(0,xt.A)(If,this,Hf).call(this,t,e);if(this._uiManager.hasMLManager&&!this.hasAltText()){const i=new OffscreenCanvas(t,e).getContext("2d");i.drawImage(n,0,0,n.width,n.height,0,0,t,e),this._uiManager.mlGuess({service:"image-to-text",request:{data:i.getImageData(0,0,t,e).data,width:t,height:e,channels:4}}).then(t=>{const e=(null===t||void 0===t?void 0:t.output)||"";this.parent&&e&&!this.hasAltText()&&(this.altTextData={altText:e,decorative:!1})})}const s=i.getContext("2d");s.filter=this._uiManager.hcmFilter,s.drawImage(n,0,0,n.width,n.height,0,0,t,e)}function Uf(t){if(t){if((0,St.A)(Pf,this)){const t=this._uiManager.imageManager.getSvgUrl((0,St.A)(Ef,this));if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=(0,St.A)(xf,this));return t.getContext("2d").drawImage((0,St.A)(xf,this),0,0),t.toDataURL()}if((0,St.A)(Pf,this)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*Ti.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*Ti.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage((0,St.A)(xf,this),0,0,(0,St.A)(xf,this).width,(0,St.A)(xf,this).height,0,0,i,n),s.transferToImageBitmap()}return structuredClone((0,St.A)(xf,this))}function Vf(){this._uiManager._signal&&((0,Mt.A)(Tf,this,new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&(0,xt.A)(If,this,Bf).call(this,e.width,e.height)})),(0,St.A)(Tf,this).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;null===(t=(0,St.A)(Tf,this))||void 0===t||t.disconnect(),(0,Mt.A)(Tf,this,null)},{once:!0}))}Bt=Df,(0,kt.A)(Df,"_type","stamp"),(0,kt.A)(Df,"_editorType",ie.STAMP);var Gf=new WeakMap,qf=new WeakMap,Xf=new WeakMap,Yf=new WeakMap,Kf=new WeakMap,Qf=new WeakMap,Zf=new WeakMap,Jf=new WeakMap,$f=new WeakMap,tg=new WeakMap,eg=new WeakMap,ig=new WeakMap,ng=new WeakMap,sg=new WeakSet;class rg{constructor(t){let{uiManager:e,pageIndex:i,div:n,accessibilityManager:s,annotationLayer:r,drawLayer:a,textLayer:o,viewport:l,l10n:c}=t;(0,_t.A)(this,sg),(0,Ct.A)(this,Gf,void 0),(0,Ct.A)(this,qf,!1),(0,Ct.A)(this,Xf,null),(0,Ct.A)(this,Yf,null),(0,Ct.A)(this,Kf,null),(0,Ct.A)(this,Qf,null),(0,Ct.A)(this,Zf,null),(0,Ct.A)(this,Jf,new Map),(0,Ct.A)(this,$f,!1),(0,Ct.A)(this,tg,!1),(0,Ct.A)(this,eg,!1),(0,Ct.A)(this,ig,null),(0,Ct.A)(this,ng,void 0);const h=[...dg._.values()];if(!rg._initialized){rg._initialized=!0;for(const t of h)t.initialize(c,e)}e.registerEditorTypes(h),(0,Mt.A)(ng,this,e),this.pageIndex=i,this.div=n,(0,Mt.A)(Gf,this,s),(0,Mt.A)(Xf,this,r),this.viewport=l,(0,Mt.A)(ig,this,o),this.drawLayer=a,(0,St.A)(ng,this).addLayer(this)}get isEmpty(){return 0===(0,St.A)(Jf,this).size}get isInvisible(){return this.isEmpty&&(0,St.A)(ng,this).getMode()===ie.NONE}updateToolbar(t){(0,St.A)(ng,this).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,St.A)(ng,this).getMode();switch((0,xt.A)(sg,this,hg).call(this),t){case ie.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case ie.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case ie.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of dg._.values())e.toggle("".concat(i._type,"Editing"),t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===(null===(e=(0,St.A)(ig,this))||void 0===e?void 0:e.div)}addInkEditorIfNeeded(t){if((0,St.A)(ng,this).getMode()!==ie.INK)return;if(!t)for(const e of(0,St.A)(Jf,this).values())if(e.isEmpty())return void e.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){(0,St.A)(ng,this).setEditingState(t)}addCommands(t){(0,St.A)(ng,this).addCommands(t)}togglePointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(){var t;let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=(0,St.A)(Xf,this))||void 0===t||t.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of(0,St.A)(Jf,this).values())i.enableEditing(),i.show(!0),i.annotationElementId&&((0,St.A)(ng,this).removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!(0,St.A)(Xf,this))return;const e=(0,St.A)(Xf,this).getEditableAnnotations();for(const i of e){if(i.hide(),(0,St.A)(ng,this).isDeletedAnnotationElement(i.data.id))continue;if(t.has(i.data.id))continue;const e=this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){(0,Mt.A)(eg,this,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,e=new Map;for(const s of(0,St.A)(Jf,this).values()){var i;s.disableEditing(),s.annotationElementId&&(null===s.serialize()?(e.set(s.annotationElementId,s),null===(i=this.getEditableAnnotation(s.annotationElementId))||void 0===i||i.show(),s.remove()):t.set(s.annotationElementId,s))}if((0,St.A)(Xf,this)){const i=(0,St.A)(Xf,this).getEditableAnnotations();for(const n of i){const{id:i}=n.data;if((0,St.A)(ng,this).isDeletedAnnotationElement(i))continue;let s=e.get(i);s?(s.resetAnnotationElement(n),s.show(!1),n.show()):(s=t.get(i),s&&((0,St.A)(ng,this).addChangedExistingAnnotation(s),s.renderAnnotationElement(n),s.show(!1)),n.show())}}(0,xt.A)(sg,this,hg).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const s of dg._.values())n.remove("".concat(s._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),(0,Mt.A)(eg,this,!1)}getEditableAnnotation(t){var e;return(null===(e=(0,St.A)(Xf,this))||void 0===e?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){(0,St.A)(ng,this).getActive()!==t&&(0,St.A)(ng,this).setActiveEditor(t)}enableTextSelection(){var t;this.div.tabIndex=-1,null!==(t=(0,St.A)(ig,this))&&void 0!==t&&t.div&&!(0,St.A)(Qf,this)&&((0,Mt.A)(Qf,this,(0,xt.A)(sg,this,ag).bind(this)),(0,St.A)(ig,this).div.addEventListener("pointerdown",(0,St.A)(Qf,this),{signal:(0,St.A)(ng,this)._signal}),(0,St.A)(ig,this).div.classList.add("highlighting"))}disableTextSelection(){var t;this.div.tabIndex=0,null!==(t=(0,St.A)(ig,this))&&void 0!==t&&t.div&&(0,St.A)(Qf,this)&&((0,St.A)(ig,this).div.removeEventListener("pointerdown",(0,St.A)(Qf,this)),(0,Mt.A)(Qf,this,null),(0,St.A)(ig,this).div.classList.remove("highlighting"))}enableClick(){if((0,St.A)(Kf,this))return;const t=(0,St.A)(ng,this)._signal;(0,Mt.A)(Kf,this,this.pointerdown.bind(this)),(0,Mt.A)(Yf,this,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",(0,St.A)(Kf,this),{signal:t}),this.div.addEventListener("pointerup",(0,St.A)(Yf,this),{signal:t})}disableClick(){(0,St.A)(Kf,this)&&(this.div.removeEventListener("pointerdown",(0,St.A)(Kf,this)),this.div.removeEventListener("pointerup",(0,St.A)(Yf,this)),(0,Mt.A)(Kf,this,null),(0,Mt.A)(Yf,this,null))}attach(t){(0,St.A)(Jf,this).set(t.id,t);const{annotationElementId:e}=t;e&&(0,St.A)(ng,this).isDeletedAnnotationElement(e)&&(0,St.A)(ng,this).removeDeletedAnnotationElement(t)}detach(t){var e;(0,St.A)(Jf,this).delete(t.id),null===(e=(0,St.A)(Gf,this))||void 0===e||e.removePointerInTextLayer(t.contentDiv),!(0,St.A)(eg,this)&&t.annotationElementId&&(0,St.A)(ng,this).addDeletedAnnotationElement(t)}remove(t){this.detach(t),(0,St.A)(ng,this).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,(0,St.A)(tg,this)||this.addInkEditorIfNeeded(!1)}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&((0,St.A)(ng,this).addDeletedAnnotationElement(t.annotationElementId),Yr.deleteAnnotationElement(t),t.annotationElementId=null),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)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),(0,St.A)(ng,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),(0,St.A)(ng,this).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!(0,St.A)(Zf,this)&&(t._focusEventsAllowed=!1,(0,Mt.A)(Zf,this,setTimeout(()=>{(0,Mt.A)(Zf,this,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:(0,St.A)(ng,this)._signal}),i.focus())},0))),t._structTreeParentId=null===(e=(0,St.A)(Gf,this))||void 0===e?void 0:e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return(0,St.A)(ng,this).getId()}get _signal(){return(0,St.A)(ng,this)._signal}canCreateNewEmptyEditor(){var t;return null===(t=Et(sg,this,og))||void 0===t?void 0:t.canCreateNewEmptyEditor()}pasteEditor(t,e){(0,St.A)(ng,this).updateToolbar(t),(0,St.A)(ng,this).updateMode(t);const{offsetX:i,offsetY:n}=(0,xt.A)(sg,this,cg).call(this),s=this.getNextId(),r=(0,xt.A)(sg,this,lg).call(this,(0,bt.A)({parent:this,id:s,x:i,y:n,uiManager:(0,St.A)(ng,this),isCentered:!0},e));r&&this.add(r)}deserialize(t){var e,i;return(null===(e=dg._.get(null!==(i=t.annotationType)&&void 0!==i?i:t.annotationEditorType))||void 0===e?void 0:e.deserialize(t,this,(0,St.A)(ng,this)))||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getNextId(),s=(0,xt.A)(sg,this,lg).call(this,(0,bt.A)({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:(0,St.A)(ng,this),isCentered:e},i));return s&&this.add(s),s}addNewEditor(){this.createAndAddNewEditor((0,xt.A)(sg,this,cg).call(this),!0)}setSelected(t){(0,St.A)(ng,this).setSelected(t)}toggleSelected(t){(0,St.A)(ng,this).toggleSelected(t)}isSelected(t){return(0,St.A)(ng,this).isSelected(t)}unselect(t){(0,St.A)(ng,this).unselect(t)}pointerup(t){const{isMac:e}=ri.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&(0,St.A)($f,this)&&((0,Mt.A)($f,this,!1),(0,St.A)(qf,this)?(0,St.A)(ng,this).getMode()!==ie.STAMP?this.createAndAddNewEditor(t,!1):(0,St.A)(ng,this).unselectAll():(0,Mt.A)(qf,this,!0))}pointerdown(t){if((0,St.A)(ng,this).getMode()===ie.HIGHLIGHT&&this.enableTextSelection(),(0,St.A)($f,this))return void(0,Mt.A)($f,this,!1);const{isMac:e}=ri.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;(0,Mt.A)($f,this,!0);const i=(0,St.A)(ng,this).getActive();(0,Mt.A)(qf,this,!i||i.isEmpty())}findNewParent(t,e,i){const n=(0,St.A)(ng,this).findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}destroy(){var t;(null===(t=(0,St.A)(ng,this).getActive())||void 0===t?void 0:t.parent)===this&&((0,St.A)(ng,this).commitOrRemove(),(0,St.A)(ng,this).setActiveEditor(null)),(0,St.A)(Zf,this)&&(clearTimeout((0,St.A)(Zf,this)),(0,Mt.A)(Zf,this,null));for(const i of(0,St.A)(Jf,this).values()){var e;null===(e=(0,St.A)(Gf,this))||void 0===e||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove()}this.div=null,(0,St.A)(Jf,this).clear(),(0,St.A)(ng,this).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e,An(this.div,e);for(const i of(0,St.A)(ng,this).getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;(0,St.A)(ng,this).commitOrRemove(),(0,xt.A)(sg,this,hg).call(this);const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,An(this.div,{rotation:n}),i!==n)for(const s of(0,St.A)(Jf,this).values())s.rotate(n);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return(0,St.A)(ng,this).viewParameters.realScale}}function ag(t){if((0,St.A)(ng,this).unselectAll(),t.target===(0,St.A)(ig,this).div){const{isMac:e}=ri.platform;if(0!==t.button||t.ctrlKey&&e)return;(0,St.A)(ng,this).showAllEditors("highlight",!0,!0),(0,St.A)(ig,this).div.classList.add("free"),mp.startHighlighting(this,"ltr"===(0,St.A)(ng,this).direction,t),(0,St.A)(ig,this).div.addEventListener("pointerup",()=>{(0,St.A)(ig,this).div.classList.remove("free")},{once:!0,signal:(0,St.A)(ng,this)._signal}),t.preventDefault()}}function og(t){return dg._.get((0,St.A)(ng,t).getMode())}function lg(t){const e=Et(sg,this,og);return e?new e.prototype.constructor(t):null}function cg(){const{x:t,y:e,width:i,height:n}=this.div.getBoundingClientRect(),s=Math.max(0,t),r=Math.max(0,e),a=(s+Math.min(window.innerWidth,t+i))/2-t,o=(r+Math.min(window.innerHeight,e+n))/2-e,[l,c]=this.viewport.rotation%180===0?[a,o]:[o,a];return{offsetX:l,offsetY:c}}function hg(){(0,Mt.A)(tg,this,!0);for(const t of(0,St.A)(Jf,this).values())t.isEmpty()&&t.remove();(0,Mt.A)(tg,this,!1)}(0,kt.A)(rg,"_initialized",!1);var dg={_:new Map([Rd,Kp,Df,mp].map(t=>[t._editorType,t]))},ug=new WeakMap,pg=new WeakMap,fg=new WeakMap,gg=new WeakMap,Ag=new WeakSet;class mg{constructor(t){let{pageIndex:e}=t;(0,_t.A)(this,Ag),(0,Ct.A)(this,ug,null),(0,Ct.A)(this,pg,0),(0,Ct.A)(this,fg,new Map),(0,Ct.A)(this,gg,new Map),this.pageIndex=e}setParent(t){if((0,St.A)(ug,this)){if((0,St.A)(ug,this)!==t){if((0,St.A)(fg,this).size>0)for(const e of(0,St.A)(fg,this).values())e.remove(),t.append(e);(0,Mt.A)(ug,this,t)}}else(0,Mt.A)(ug,this,t)}static get _svgFactory(){return Xe(this,"_svgFactory",new Ji)}highlight(t,e,i){var n,s;let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=((0,Mt.A)(pg,this,(n=(0,St.A)(pg,this),s=n++,n)),s),o=(0,xt.A)(Ag,this,bg).call(this,t.box);o.classList.add("highlight"),t.free&&o.classList.add("free");const l=mg._svgFactory.createElement("defs");o.append(l);const c=mg._svgFactory.createElement("path");l.append(c);const h="path_p".concat(this.pageIndex,"_").concat(a);c.setAttribute("id",h),c.setAttribute("d",t.toSVGPath()),r&&(0,St.A)(gg,this).set(a,c);const d=(0,xt.A)(Ag,this,wg).call(this,l,h),u=mg._svgFactory.createElement("use");return o.append(u),o.setAttribute("fill",e),o.setAttribute("fill-opacity",i),u.setAttribute("href","#".concat(h)),(0,St.A)(fg,this).set(a,o),{id:a,clipPathId:"url(#".concat(d,")")}}highlightOutline(t){var e,i;const n=((0,Mt.A)(pg,this,(e=(0,St.A)(pg,this),i=e++,e)),i),s=(0,xt.A)(Ag,this,bg).call(this,t.box);s.classList.add("highlightOutline");const r=mg._svgFactory.createElement("defs");s.append(r);const a=mg._svgFactory.createElement("path");r.append(a);const o="path_p".concat(this.pageIndex,"_").concat(n);let l;if(a.setAttribute("id",o),a.setAttribute("d",t.toSVGPath()),a.setAttribute("vector-effect","non-scaling-stroke"),t.free){s.classList.add("free");const t=mg._svgFactory.createElement("mask");r.append(t),l="mask_p".concat(this.pageIndex,"_").concat(n),t.setAttribute("id",l),t.setAttribute("maskUnits","objectBoundingBox");const e=mg._svgFactory.createElement("rect");t.append(e),e.setAttribute("width","1"),e.setAttribute("height","1"),e.setAttribute("fill","white");const i=mg._svgFactory.createElement("use");t.append(i),i.setAttribute("href","#".concat(o)),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const c=mg._svgFactory.createElement("use");s.append(c),c.setAttribute("href","#".concat(o)),l&&c.setAttribute("mask","url(#".concat(l,")"));const h=c.cloneNode();return s.append(h),c.classList.add("mainOutline"),h.classList.add("secondaryOutline"),(0,St.A)(fg,this).set(n,s),n}finalizeLine(t,e){const i=(0,St.A)(gg,this).get(t);(0,St.A)(gg,this).delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){(0,St.A)(fg,this).get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}removeFreeHighlight(t){this.remove(t),(0,St.A)(gg,this).delete(t)}updatePath(t,e){(0,St.A)(gg,this).get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){vg.call(mg,(0,St.A)(fg,this).get(t),e)}show(t,e){(0,St.A)(fg,this).get(t).classList.toggle("hidden",!e)}rotate(t,e){(0,St.A)(fg,this).get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){(0,St.A)(fg,this).get(t).setAttribute("fill",e)}changeOpacity(t,e){(0,St.A)(fg,this).get(t).setAttribute("fill-opacity",e)}addClass(t,e){(0,St.A)(fg,this).get(t).classList.add(e)}removeClass(t,e){(0,St.A)(fg,this).get(t).classList.remove(e)}remove(t){null!==(0,St.A)(ug,this)&&((0,St.A)(fg,this).get(t).remove(),(0,St.A)(fg,this).delete(t))}destroy(){(0,Mt.A)(ug,this,null);for(const t of(0,St.A)(fg,this).values())t.remove();(0,St.A)(fg,this).clear()}}function vg(t){let{x:e=0,y:i=0,width:n=1,height:s=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{style:r}=t;r.top="".concat(100*i,"%"),r.left="".concat(100*e,"%"),r.width="".concat(100*n,"%"),r.height="".concat(100*s,"%")}function bg(t){const e=Ht._svgFactory.create(1,1,!0);return(0,St.A)(ug,this).append(e),e.setAttribute("aria-hidden",!0),vg.call(Ht,e,t),e}function wg(t,e){const i=Ht._svgFactory.createElement("clipPath");t.append(i);const n="clip_".concat(e);i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=Ht._svgFactory.createElement("use");return i.append(s),s.setAttribute("href","#".concat(e)),s.classList.add("clip"),n}Ht=mg;var yg=Ut.AnnotationLayer,_g=Ut.AnnotationMode,xg=Ut.GlobalWorkerOptions,Eg=Ut.PDFDataRangeTransport,kg=Ut.TextLayer,Cg=Ut.getDocument,Sg=i(70579),Mg=function(t,e,i){if(i||2===arguments.length)for(var n,s=0,r=e.length;s<r;s++)!n&&s in e||(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))},Lg=Mg(Mg(Mg(Mg(Mg(Mg(Mg(Mg(Mg(Mg(Mg(Mg(Mg(Mg(Mg(Mg(Mg(Mg([],["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 Tg(t,e){var i={};return Lg.forEach(function(n){var s=t[n];s&&(i[n]=e?function(t){return s(t,e(n))}:s)}),i}function Rg(t){var e=!1;return{promise:new Promise(function(i,n){t.then(function(t){return!e&&i(t)}).catch(function(t){return!e&&n(t)})}),cancel:function(){e=!0}}}var Pg=i(58387),Fg="Invariant failed";function Ig(t,e){if(!t)throw new Error(Fg)}var Dg=i(96440),Og=Object.prototype.hasOwnProperty;function Ng(t,e,i){for(i of t.keys())if(Wg(i,e))return i}function Wg(t,e){var i,n,s;if(t===e)return!0;if(t&&e&&(i=t.constructor)===e.constructor){if(i===Date)return t.getTime()===e.getTime();if(i===RegExp)return t.toString()===e.toString();if(i===Array){if((n=t.length)===e.length)for(;n--&&Wg(t[n],e[n]););return-1===n}if(i===Set){if(t.size!==e.size)return!1;for(n of t){if((s=n)&&"object"===typeof s&&!(s=Ng(e,s)))return!1;if(!e.has(s))return!1}return!0}if(i===Map){if(t.size!==e.size)return!1;for(n of t){if((s=n[0])&&"object"===typeof s&&!(s=Ng(e,s)))return!1;if(!Wg(n[1],e.get(s)))return!1}return!0}if(i===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(i===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return-1===n}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return-1===n}if(!i||"object"===typeof t){for(i in n=0,t){if(Og.call(t,i)&&++n&&!Og.call(e,i))return!1;if(!(i in e)||!Wg(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!==t&&e!==e}const jg=(0,s.createContext)(null);function Bg(t){let{children:e,type:i}=t;return(0,Sg.jsx)("div",{className:"react-pdf__message react-pdf__message--".concat(i),children:e})}class Hg{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 Ig(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(t){Ig(this.pdfViewer),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise(e=>{Ig(this.pdfDocument),Ig(t),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)}).then(t=>{Ig(Array.isArray(t),'"'.concat(t,'" is not a valid destination array.'));const e=t[0];new Promise(t=>{Ig(this.pdfDocument),e instanceof Object?this.pdfDocument.getPageIndex(e).then(e=>{t(e)}).catch(()=>{Ig(!1,'"'.concat(e,'" is not a valid page reference.'))}):"number"===typeof e?t(e):Ig(!1,'"'.concat(e,'" is not a valid destination reference.'))}).then(e=>{const i=e+1;Ig(this.pdfViewer),Ig(i>=1&&i<=this.pagesCount,'"'.concat(i,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})})})}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;Ig(this.pdfViewer),Ig(t>=1&&t<=this.pagesCount,'"'.concat(t,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const zg={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},Ug="undefined"!==typeof window,Vg=Ug&&"file:"===window.location.protocol;function Gg(t){return function(t){return"undefined"!==typeof t}(t)&&null!==t}function qg(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function Xg(t){Ig(qg(t));const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function Yg(){return Ug&&window.devicePixelRatio||1}const Kg="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function Qg(){Dg(!Vg,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(Kg))}function Zg(t){(null===t||void 0===t?void 0:t.cancel)&&t.cancel()}function Jg(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 $g(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 tA(){return(0,s.useReducer)($g,{value:void 0,error:void 0})}var eA=function(t,e,i,n){return new(i||(i=Promise))(function(s,r){function a(t){try{l(n.next(t))}catch(e){r(e)}}function o(t){try{l(n.throw(t))}catch(e){r(e)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(a,o)}l((n=n.apply(t,e||[])).next())})},iA=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const{Tm:nA}=n,sA=(t,e)=>{switch(e){case zg.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case zg.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function rA(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const aA=(0,s.forwardRef)(function(t,e){var{children:i,className:n,error:r="Failed to load PDF file.",externalLinkRel:a,externalLinkTarget:o,file:l,inputRef:c,imageResourcesPath:h,loading:d="Loading PDF\u2026",noData:u="No PDF file specified.",onItemClick:p,onLoadError:f,onLoadProgress:g,onLoadSuccess:A,onPassword:m=sA,onSourceError:v,onSourceSuccess:b,options:w,renderMode:y,rotate:_}=t,x=iA(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[E,k]=tA(),{value:C,error:S}=E,[M,L]=tA(),{value:T,error:R}=M,P=(0,s.useRef)(new Hg),F=(0,s.useRef)([]),I=(0,s.useRef)(void 0),D=(0,s.useRef)(void 0);l&&l!==I.current&&rA(l)&&(Dg(!Wg(l,I.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),I.current=l),w&&w!==D.current&&(Dg(!Wg(w,D.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),D.current=w);const O=(0,s.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(p)return void p({dest:e,pageIndex:n,pageNumber:i});const s=F.current[n];s?s.scrollIntoView():Dg(!1,"An internal link leading to page ".concat(i," 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,s.useImperativeHandle)(e,()=>({linkService:P,pages:F,viewer:O}),[]),(0,s.useEffect)(function(){k({type:"RESET"})},[l,k]);const N=(0,s.useCallback)(()=>eA(this,void 0,void 0,function*(){if(!l)return null;if("string"===typeof l){if(qg(l)){return{data:Xg(l)}}return Qg(),{url:l}}if(l instanceof nA)return{range:l};if(l instanceof ArrayBuffer)return{data:l};if(Ug&&function(t){return Ig(Ug),t instanceof Blob}(l)){const t=yield function(t){return new Promise((e,i)=>{const n=new FileReader;n.onload=()=>{if(!n.result)return i(new Error("Error while reading a file."));e(n.result)},n.onerror=t=>{if(!t.target)return i(new Error("Error while reading a file."));const{error:e}=t.target;if(!e)return i(new Error("Error while reading a file."));switch(e.code){case e.NOT_FOUND_ERR:return i(new Error("Error while reading a file: File not found."));case e.SECURITY_ERR:return i(new Error("Error while reading a file: Security error."));case e.ABORT_ERR:return i(new Error("Error while reading a file: Aborted."));default:return i(new Error("Error while reading a file."))}},n.readAsArrayBuffer(t)})}(l);return{data:t}}if(Ig("object"===typeof l),Ig(rA(l)),"url"in l&&"string"===typeof l.url){if(qg(l.url)){const{url:t}=l,e=iA(l,["url"]),i=Xg(t);return Object.assign({data:i},e)}Qg()}return l}),[l]);(0,s.useEffect)(()=>{const t=Rg(N());return t.promise.then(t=>{k({type:"RESOLVE",value:t})}).catch(t=>{k({type:"REJECT",error:t})}),()=>{Zg(t)}},[N,k]),(0,s.useEffect)(()=>{"undefined"!==typeof C&&(!1!==C?b&&b():S&&(Dg(!1,S.toString()),v&&v(S)))},[C]),(0,s.useEffect)(function(){L({type:"RESET"})},[L,C]),(0,s.useEffect)(function(){if(!C)return;const t=w?Object.assign(Object.assign({},C),w):C,e=Cg(t);g&&(e.onProgress=g),m&&(e.onPassword=m);const i=e,n=i.promise.then(t=>{L({type:"RESOLVE",value:t})}).catch(t=>{i.destroyed||L({type:"REJECT",error:t})});return()=>{n.finally(()=>i.destroy())}},[w,L,C]),(0,s.useEffect)(()=>{"undefined"!==typeof T&&(!1!==T?T&&(A&&A(T),F.current=new Array(T.numPages),P.current.setDocument(T)):R&&(Dg(!1,R.toString()),f&&f(R)))},[T]),(0,s.useEffect)(function(){P.current.setViewer(O.current),P.current.setExternalLinkRel(a),P.current.setExternalLinkTarget(o)},[a,o]);const W=(0,s.useCallback)((t,e)=>{F.current[t]=e},[]),j=(0,s.useCallback)(t=>{delete F.current[t]},[]),B=(0,s.useMemo)(()=>({imageResourcesPath:h,linkService:P.current,onItemClick:p,pdf:T,registerPage:W,renderMode:y,rotate:_,unregisterPage:j}),[h,p,T,W,y,_,j]),H=(0,s.useMemo)(()=>Tg(x,()=>T),[x,T]);return(0,Sg.jsx)("div",Object.assign({className:(0,Pg.A)("react-pdf__Document",n),ref:c,style:{"--scale-factor":"1"}},H,{children:l?void 0===T||null===T?(0,Sg.jsx)(Bg,{type:"loading",children:"function"===typeof d?d():d}):!1===T?(0,Sg.jsx)(Bg,{type:"error",children:"function"===typeof r?r():r}):(0,Sg.jsx)(jg.Provider,{value:B,children:i}):(0,Sg.jsx)(Bg,{type:"no-data",children:"function"===typeof u?u():u})}))});function oA(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t.filter(Boolean);return i.length<=1?i[0]||null:function(t){i.forEach(function(e){"function"===typeof e?e(t):e&&(e.current=t)})}}const lA=(0,s.createContext)(null),cA={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},hA=/^H(\d+)$/;function dA(t){return"children"in t}function uA(t){return!!dA(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function pA(t){const e={};if(dA(t)){const{role:i}=t,n=i.match(hA);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in cA}(i)){const t=cA[i];t&&(e.role=t)}}return e}function fA(t){const e={};if(dA(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),uA(t)){const[i]=t.children;if(i){const t=fA(i);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function gA(t){return t?Object.assign(Object.assign({},pA(t)),fA(t)):null}function AA(t){let{className:e,node:i}=t;const n=(0,s.useMemo)(()=>gA(i),[i]),r=(0,s.useMemo)(()=>dA(i)?uA(i)?null:i.children.map((t,e)=>(0,Sg.jsx)(AA,{node:t},e)):null,[i]);return(0,Sg.jsx)("span",Object.assign({className:e},n,{children:r}))}function mA(){return(0,s.useContext)(lA)}function vA(){const t=mA();Ig(t);const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[n,r]=tA(),{value:a,error:o}=n,{customTextRenderer:l,page:c}=t;return(0,s.useEffect)(function(){r({type:"RESET"})},[r,c]),(0,s.useEffect)(function(){if(l)return;if(!c)return;const t=Rg(c.getStructTree()),e=t;return t.promise.then(t=>{r({type:"RESOLVE",value:t})}).catch(t=>{r({type:"REJECT",error:t})}),()=>Zg(e)},[l,c,r]),(0,s.useEffect)(()=>{void 0!==a&&(!1!==a?a&&i&&i(a):o&&(Dg(!1,o.toString()),e&&e(o)))},[a]),a?(0,Sg.jsx)(AA,{className:"react-pdf__Page__structTree structTree",node:a}):null}const bA=_g;function wA(t){const e=mA();Ig(e);const i=Object.assign(Object.assign({},e),t),{_className:n,canvasBackground:r,devicePixelRatio:a=Yg(),onRenderError:o,onRenderSuccess:l,page:c,renderForms:h,renderTextLayer:d,rotate:u,scale:p}=i,{canvasRef:f}=t;Ig(c);const g=(0,s.useRef)(null);function A(t){(function(t){return"RenderingCancelledException"===t.name})(t)||(Dg(!1,t.toString()),o&&o(t))}const m=(0,s.useMemo)(()=>c.getViewport({scale:p*a,rotation:u}),[a,c,u,p]),v=(0,s.useMemo)(()=>c.getViewport({scale:p,rotation:u}),[c,u,p]);(0,s.useEffect)(function(){if(!c)return;c.cleanup();const{current:t}=g;if(!t)return;t.width=m.width,t.height=m.height,t.style.width="".concat(Math.floor(v.width),"px"),t.style.height="".concat(Math.floor(v.height),"px"),t.style.visibility="hidden";const e={annotationMode:h?bA.ENABLE_FORMS:bA.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:m};r&&(e.background=r);const i=c.render(e),n=i;return i.promise.then(()=>{t.style.visibility="",c&&l&&l(Jg(c,p))}).catch(A),()=>Zg(n)},[r,c,h,m,v]);const b=(0,s.useCallback)(()=>{const{current:t}=g;t&&(t.width=0,t.height=0)},[]);return(0,s.useEffect)(()=>b,[b]),(0,Sg.jsx)("canvas",{className:"".concat(n,"__canvas"),dir:"ltr",ref:oA(f,g),style:{display:"block",userSelect:"none"},children:d?(0,Sg.jsx)(vA,{}):null})}function yA(){const t=mA();Ig(t);const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:n,onRenderTextLayerError:r,onRenderTextLayerSuccess:a,page:o,pageIndex:l,pageNumber:c,rotate:h,scale:d}=t;Ig(o);const[u,p]=tA(),{value:f,error:g}=u,A=(0,s.useRef)(null),m=(0,s.useRef)(void 0);Dg(1===Number.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,s.useEffect)(function(){p({type:"RESET"})},[o,p]),(0,s.useEffect)(function(){if(!o)return;const t=Rg(o.getTextContent()),e=t;return t.promise.then(t=>{p({type:"RESOLVE",value:t})}).catch(t=>{p({type:"REJECT",error:t})}),()=>Zg(e)},[o,p]),(0,s.useEffect)(()=>{void 0!==f&&(!1!==f?f&&n&&n(f):g&&(Dg(!1,g.toString()),i&&i(g)))},[f]);const v=(0,s.useCallback)(()=>{a&&a()},[a]),b=(0,s.useCallback)(t=>{Dg(!1,t.toString()),r&&r(t)},[r]);const w=(0,s.useMemo)(()=>o.getViewport({scale:d,rotation:h}),[o,h,d]);return(0,s.useLayoutEffect)(function(){if(!o||!f)return;const{current:t}=A;if(!t)return;t.innerHTML="";const i=o.streamTextContent({includeMarkedContent:!0}),n=new kg({container:t,textContentSource:i,viewport:w}),s=n;return n.render().then(()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i),m.current=i;const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;f.items.forEach((i,s)=>{if(!function(t){return"str"in t}(i))return;const r=n[t];if(!r)return;const a=e(Object.assign({pageIndex:l,pageNumber:c,itemIndex:s},i));r.innerHTML=a,t+=i.str&&i.hasEOL?2:1})}v()}).catch(b),()=>Zg(s)},[e,b,v,o,l,c,f,w]),(0,Sg.jsx)("div",{className:(0,Pg.A)("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=m.current;t&&t.classList.remove("active")},onMouseDown:function(){const t=m.current;t&&t.classList.add("active")},ref:A})}function _A(){return(0,s.useContext)(jg)}function xA(){const t=_A(),e=mA();Ig(e);const i=Object.assign(Object.assign({},t),e),{imageResourcesPath:n,linkService:r,onGetAnnotationsError:a,onGetAnnotationsSuccess:o,onRenderAnnotationLayerError:l,onRenderAnnotationLayerSuccess:c,page:h,pdf:d,renderForms:u,rotate:p,scale:f=1}=i;Ig(d),Ig(h),Ig(r);const[g,A]=tA(),{value:m,error:v}=g,b=(0,s.useRef)(null);Dg(1===Number.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,s.useEffect)(function(){A({type:"RESET"})},[A,h]),(0,s.useEffect)(function(){if(!h)return;const t=Rg(h.getAnnotations()),e=t;return t.promise.then(t=>{A({type:"RESOLVE",value:t})}).catch(t=>{A({type:"REJECT",error:t})}),()=>{Zg(e)}},[A,h]),(0,s.useEffect)(()=>{void 0!==m&&(!1!==m?m&&o&&o(m):v&&(Dg(!1,v.toString()),a&&a(v)))},[m]);const w=(0,s.useMemo)(()=>h.getViewport({scale:f,rotation:p}),[h,p,f]);return(0,s.useEffect)(function(){if(!d||!h||!r||!m)return;const{current:t}=b;if(!t)return;const e=w.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:t,l10n:null,page:h,viewport:e},s={annotations:m,annotationStorage:d.annotationStorage,div:t,imageResourcesPath:n,linkService:r,page:h,renderForms:u,viewport:e};t.innerHTML="";try{new yg(i).render(s),c&&c()}catch(a){!function(t){Dg(!1,"".concat(t)),l&&l(t)}(a)}return()=>{}},[m,n,r,h,d,u,w]),(0,Sg.jsx)("div",{className:(0,Pg.A)("react-pdf__Page__annotations","annotationLayer"),ref:b})}var EA=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const kA=1;function CA(t){const e=_A(),i=Object.assign(Object.assign({},e),t),{_className:n="react-pdf__Page",_enableRegisterUnregisterPage:r=!0,canvasBackground:a,canvasRef:o,children:l,className:c,customRenderer:h,customTextRenderer:d,devicePixelRatio:u,error:p="Failed to load the page.",height:f,inputRef:g,loading:A="Loading page\u2026",noData:m="No page specified.",onGetAnnotationsError:v,onGetAnnotationsSuccess:b,onGetStructTreeError:w,onGetStructTreeSuccess:y,onGetTextError:_,onGetTextSuccess:x,onLoadError:E,onLoadSuccess:k,onRenderAnnotationLayerError:C,onRenderAnnotationLayerSuccess:S,onRenderError:M,onRenderSuccess:L,onRenderTextLayerError:T,onRenderTextLayerSuccess:R,pageIndex:P,pageNumber:F,pdf:I,registerPage:D,renderAnnotationLayer:O=!0,renderForms:N=!1,renderMode:W="canvas",renderTextLayer:j=!0,rotate:B,scale:H=kA,unregisterPage:z,width:U}=i,V=EA(i,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","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"]),[G,q]=tA(),{value:X,error:Y}=G,K=(0,s.useRef)(null);Ig(I);const Q=Gg(F)?F-1:null!==P&&void 0!==P?P:null,Z=null!==F&&void 0!==F?F:Gg(P)?P+1:null,J=null!==B&&void 0!==B?B:X?X.rotate:null,$=(0,s.useMemo)(()=>{if(!X)return null;let t=1;const e=null!==H&&void 0!==H?H:kA;if(U||f){const e=X.getViewport({scale:1,rotation:J});U?t=U/e.width:f&&(t=f/e.height)}return e*t},[f,X,J,H,U]);(0,s.useEffect)(function(){return()=>{Gg(Q)&&r&&z&&z(Q)}},[r,I,Q,z]),(0,s.useEffect)(function(){q({type:"RESET"})},[q,I,Q]),(0,s.useEffect)(function(){if(!I||!Z)return;const t=Rg(I.getPage(Z)),e=t;return t.promise.then(t=>{q({type:"RESOLVE",value:t})}).catch(t=>{q({type:"REJECT",error:t})}),()=>Zg(e)},[q,I,Z]),(0,s.useEffect)(()=>{void 0!==X&&(!1!==X?function(){if(k){if(!X||!$)return;k(Jg(X,$))}if(r&&D){if(!Gg(Q)||!K.current)return;D(Q,K.current)}}():Y&&(Dg(!1,Y.toString()),E&&E(Y)))},[X,$]);const tt=(0,s.useMemo)(()=>X&&Gg(Q)&&Z&&Gg(J)&&Gg($)?{_className:n,canvasBackground:a,customTextRenderer:d,devicePixelRatio:u,onGetAnnotationsError:v,onGetAnnotationsSuccess:b,onGetStructTreeError:w,onGetStructTreeSuccess:y,onGetTextError:_,onGetTextSuccess:x,onRenderAnnotationLayerError:C,onRenderAnnotationLayerSuccess:S,onRenderError:M,onRenderSuccess:L,onRenderTextLayerError:T,onRenderTextLayerSuccess:R,page:X,pageIndex:Q,pageNumber:Z,renderForms:N,renderTextLayer:j,rotate:J,scale:$}:null,[n,a,d,u,v,b,w,y,_,x,C,S,M,L,T,R,X,Q,Z,N,j,J,$]),et=(0,s.useMemo)(()=>Tg(V,()=>X?$?Jg(X,$):void 0:X),[V,X,$]),it="".concat(Q,"@").concat($,"/").concat(J);function nt(){switch(W){case"custom":return Ig(h),(0,Sg.jsx)(h,{},"".concat(it,"_custom"));case"none":return null;default:return(0,Sg.jsx)(wA,{canvasRef:o},"".concat(it,"_canvas"))}}return(0,Sg.jsx)("div",Object.assign({className:(0,Pg.A)(n,c),"data-page-number":Z,ref:oA(g,K),style:{"--scale-factor":"".concat($),backgroundColor:a||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},et,{children:Z?null===I||void 0===X||null===X?(0,Sg.jsx)(Bg,{type:"loading",children:"function"===typeof A?A():A}):!1===I||!1===X?(0,Sg.jsx)(Bg,{type:"error",children:"function"===typeof p?p():p}):(0,Sg.jsxs)(lA.Provider,{value:tt,children:[nt(),j?(0,Sg.jsx)(yA,{},"".concat(it,"_text")):null,O?(0,Sg.jsx)(xA,{},"".concat(it,"_annotations")):null,l]}):(0,Sg.jsx)(Bg,{type:"no-data",children:"function"===typeof m?m():m})}))}var SA,MA=i(19155),LA=i(93141),TA=i(10986),RA=i.n(TA);const PA=["title","titleId"];function FA(){return FA=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},FA.apply(null,arguments)}function IA(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,PA);return s.createElement("svg",FA({t:1731465967110,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1541,xmlnsXlink:"http://www.w3.org/1999/xlink",width:200,height:200,ref:e,"aria-labelledby":n},r),i?s.createElement("title",{id:n},i):null,SA||(SA=s.createElement("path",{d:"M112 166h-7q-21 3-35 18.5T56 222v562q3 20 18.5 34.5T112 833h388l56-167-119-179-103 123-72-71-5-5q-17-13-38-11.5T183 539l-71 71V222h259l18-56H112z m388 0l-18 56h407v379L654 327l-4-5q-18-16-41.5-14.5T570 328l-72 85 169 253-55 167h277l7-1q21-2 35-18t14-37V215q-3-21-18.5-35T889 166H500zM306 277q-34 0-58.5 24.5t-24.5 59q0 34.5 24.5 59T306 444q23 0 42.5-12t30.5-31l-45-68 14-44q-19-12-42-12z",fill:"#E0E0E0","p-id":1542})))}const DA=s.forwardRef(IA);i.p;var OA,NA;const WA=["title","titleId"];function jA(){return jA=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},jA.apply(null,arguments)}function BA(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,WA);return s.createElement("svg",jA({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u7f16\u7ec4 10"):i?s.createElement("title",{id:n},i):null,OA||(OA=s.createElement("defs",null,s.createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"linearGradient-1"},s.createElement("stop",{stopColor:"#F5F5F5",offset:"0%"}),s.createElement("stop",{stopColor:"#E0E0E0",offset:"100%"})))),NA||(NA=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807Icon",transform:"translate(-760.000000, -2364.000000)"},s.createElement("g",{id:"\\u7F16\\u7EC4-10",transform:"translate(760.000000, 2364.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u65E0\\u6027\\u522B",fill:"url(#linearGradient-1)"},s.createElement("rect",{id:"Mask\\u5907\\u4EFD",x:0,y:0,width:56,height:56})),s.createElement("g",{id:"\\u5934\\u50CF_avatar-(1)\\u5907\\u4EFD",transform:"translate(8.000000, 12.000000)",fill:"#FFFFFF",fillRule:"nonzero"},s.createElement("path",{d:"M40,41.3851428 C40,40.9828571 40,35.6022857 39,33.792 C38.4,32.5851428 37.4,31.7805714 36.2,30.976 C34.8,30.1714285 33,29.3668572 30.8,28.9645714 C30.6,28.9645714 29.2,28.7634285 28,28.3611428 C26.6,27.9588571 26,27.7577143 25.8,27.5565714 L25.8,26.3497143 C26,23.7348571 27.4,22.3268572 28.6,21.12 C29,20.7177143 29.4,20.3154285 29.8,19.712 C31.2,17.7005714 31.4,15.6891429 31.4,15.2868571 C31.4,14.8845714 31.4,14.6834286 31.2,14.2811429 C31,13.8788572 30.8,13.4765714 30.6,13.2754286 C30.6,12.672 30.8,12.0685714 30.8,11.6662857 C30.8,10.6605715 31,9.05142856 30.6,7.44228572 C30.6,7.24114285 30.6,6.83885715 30.4,6.43657145 C30,5.22971431 29.6,4.22400004 28.8,3.4194286 C28.4,3.4194286 25.6,0.603428618 18,0 L15,0 C14.6,0 14.2,0 13.8,0.201142873 C12.4,0.603428571 12.2,1.60914289 12,2.01142859 L12,3.21828573 L11.8,3.4194286 C11.6,3.62057147 9.60000004,5.43085719 9.40000002,7.84457142 C9.20000001,9.45371426 9.20000001,11.8674285 9.40000002,13.6777143 C9.20000001,14.08 8.80000002,14.4822858 8.80000002,15.488 C8.80000002,15.8902857 9,17.9017143 10.4,19.712 C10.8,20.1142857 11,20.5165715 11.6,21.12 C12.8,22.528 14.2,23.936 14.4,26.3497143 L14.4,27.5565714 C14,27.7577143 13.4,28.16 12,28.5622857 C10.6,28.9645714 9.20000001,29.1657143 9,29.1657143 C7,29.568 5.19999998,30.1714285 3.80000001,30.976 C2.60000001,31.7805714 1.60000003,32.7862857 1,33.792 C0,35.6022857 0,40.9828571 0,41.3851428 L0,42.3908571 C0,43.1954286 0.800000015,44 1.8,44 L38.2,44 C39.2,44 40,43.1954286 40,42.1897143 L40,41.3851428 Z",id:"\\u8DEF\\u5F84"})))))))}const HA=s.forwardRef(BA);i.p;var zA;const UA=["title","titleId"];function VA(){return VA=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},VA.apply(null,arguments)}function GA(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,UA);return s.createElement("svg",VA({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u5973"):i?s.createElement("title",{id:n},i):null,zA||(zA=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-792.000000, -230.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u5973",transform:"translate(792.000000, 230.000000)"},s.createElement("rect",{id:"Mask\\u5907\\u4EFD",fill:"#F1F1F1",x:0,y:0,width:56,height:56}),s.createElement("g",{id:"\\u5973",transform:"translate(9.000000, 13.000000)",fillRule:"nonzero"},s.createElement("path",{d:"M19.1219936,0 C26.9032378,0 28.9014356,5.58612362 28.7427755,11.9244473 C28.5841154,18.262771 25.3419303,30.1526079 25.3419303,30.1526079 L19.1334908,30.1526079 L19.1219936,0 Z",id:"\\u8DEF\\u5F84",fill:"#370B00"}),s.createElement("path",{d:"M18.5011497,0 C10.7291032,0 8.7217078,5.58612362 8.88726615,11.9244473 C9.05282451,18.262771 12.2881114,30.1526079 12.2881114,30.1526079 L18.4965509,30.1526079 L18.5011497,0 Z",id:"\\u8DEF\\u5F84",fill:"#420E04"}),s.createElement("path",{d:"M14.2564166,26.7815518 C11.9891865,29.1996673 7.8778199,30.5010196 3.9780001,31.1309294 C0.0781803048,31.7608392 0,35.9948487 0,37.2177506 L0,43 L18.5011497,43 L18.5011497,26.7815518 L14.2564166,26.7815518 Z",id:"\\u8DEF\\u5F84",fill:"#EAE9E8"}),s.createElement("path",{d:"M18.5011497,21.5807577 L14.1736374,21.5807577 L14.1736374,27.196877 C14.1736374,28.0298347 15.5532906,30.6740717 18.5011497,30.6740717 L18.5011497,21.5807577 Z",id:"\\u8DEF\\u5F84",fill:"#EAC1A4"}),s.createElement("path",{d:"M18.5011497,3.92251556 C12.1202536,3.92251556 11.1751911,8.53723974 11.1751911,14.2502683 C11.1751911,20.0948165 16.693804,24.5872505 18.5011497,24.5872505 L18.5011497,3.92251556 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("path",{d:"M11.0372258,13.419618 C10.5888385,11.7352436 9.97489279,11.7352436 9.71505809,12.1621056 C9.45522339,12.5889676 10.351998,14.2387315 10.3749922,15.6000751 C10.3979864,16.9614187 10.7980859,17.1552372 11.294761,16.663769 C11.7914362,16.1723009 11.0372258,13.419618 11.0372258,13.419618 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#DDDCDB",points:"14.247219 27.1368856 11.4603194 28.8327967 15.6199739 36.09868 18.5011497 30.6740717"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#F4F2F2",points:"14.247219 26.7815518 11.4603194 28.8327967 15.6199739 35.7433462 18.5011497 30.6740717"}),s.createElement("path",{d:"M22.7642782,26.7815518 C25.0338077,29.1996673 29.1451744,30.5010196 33.0426947,31.1309294 C36.940215,31.7608392 37,35.9948487 37,37.2177506 L37,43 L18.5011497,43 L18.5011497,26.7815518 L22.7642782,26.7815518 Z",id:"\\u8DEF\\u5F84",fill:"#DDDCDB"}),s.createElement("path",{d:"M18.5011497,21.5807577 L22.8263626,21.5807577 L22.8263626,27.196877 C22.8263626,28.0298347 21.4467094,30.6740717 18.5011497,30.6740717 L18.5011497,21.5807577 Z",id:"\\u8DEF\\u5F84",fill:"#DDB597"}),s.createElement("path",{d:"M18.5011497,3.92251556 C24.8797464,3.92251556 25.8248089,8.53723974 25.8248089,14.2502683 C25.8248089,20.0948165 20.306196,24.5872505 18.5011497,24.5872505 L18.5011497,3.92251556 Z",id:"\\u8DEF\\u5F84",fill:"#EDC19C"}),s.createElement("path",{d:"M25.9673731,13.419618 C26.4272575,11.7352436 27.0320055,11.7352436 27.2918402,12.1621056 C27.5516748,12.5889676 26.6526008,14.2387315 26.6296066,15.6000751 C26.6066124,16.9614187 26.206513,17.1552372 25.7098378,16.663769 C25.2131626,16.1723009 25.967373,13.4196179 25.9673731,13.419618 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#DDDCDB",points:"22.752781 27.1368856 25.5396806 28.8327967 21.3800261 36.09868 18.5011497 30.6740717"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#EFEEED",points:"22.752781 26.7815518 25.5396806 28.8327967 21.3800261 35.7433462 18.5011497 30.6740717"}),s.createElement("path",{d:"M9.10801068,29.8549582 C7.43626653,30.4331409 5.71634854,30.860165 3.96880244,31.1309294 C0.0712820906,31.7608392 0,35.9948487 0,37.2177506 L0,43 L16.3373936,43 L9.10801068,29.848036 L9.10801068,29.8549582 Z",id:"\\u8DEF\\u5F84",fill:"#1D1D1D"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#303030",points:"9.10801068 29.8549582 7.32595862 30.4110324 7.10061524 34.8896222 10.4393761 36.7216678 10.4393761 42.9976927 16.3373936 42.9976927 9.10801068 29.8549582"}),s.createElement("path",{d:"M27.8942887,29.8549582 C29.5652485,30.433138 31.2844029,30.8601635 33.0311976,31.1309294 C36.940215,31.7608392 37,35.9902339 37,37.2177506 L37,43 L20.6741036,43 L27.9034864,29.848036 L27.8942887,29.8549582 Z",id:"\\u8DEF\\u5F84",fill:"#1D1D1D"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#303030",points:"27.8942887 29.8549582 29.6763408 30.4110324 29.8993848 34.8896222 26.5629234 36.7216678 26.5629234 42.9976927 20.6626064 42.9976927"}),s.createElement("path",{d:"M10.8072836,5.07619661 C9.67366851,9.80398152 11.1062085,14.2871861 11.267168,14.7163554 C11.267168,14.7163554 12.1248524,14.8524898 13.3366478,12.6581885 C14.9140514,9.79936683 16.8041763,8.32265508 18.4459636,7.55661088 L18.4459636,0 C14.334597,0 11.6005842,1.79974245 10.8072836,5.07619661 Z",id:"\\u8DEF\\u5F84",fill:"#471207"}),s.createElement("path",{d:"M25.6224598,14.7140481 C25.7742216,14.2871861 27.2067616,9.80398157 26.0823442,5.07388927 C25.2936424,1.80204979 22.5573302,0 18.4459636,0 L18.4459636,7.55661088 C19.5462153,7.03397245 20.7468113,6.75837793 21.9640793,6.74903414 C24.4014667,8.41494958 25.6155615,11.7513952 25.6224598,14.7140481 Z",id:"\\u8DEF\\u5F84",fill:"#370B00"})))))))}const qA=s.forwardRef(GA);i.p;var XA;const YA=["title","titleId"];function KA(){return KA=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},KA.apply(null,arguments)}function QA(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,YA);return s.createElement("svg",KA({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u7537"):i?s.createElement("title",{id:n},i):null,XA||(XA=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-792.000000, -166.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u7537",transform:"translate(792.000000, 166.000000)"},s.createElement("rect",{id:"Mask",fill:"#F1F1F1",x:0,y:0,width:56,height:56}),s.createElement("g",{id:"Group-46",transform:"translate(7.671233, 12.041096)"},s.createElement("path",{d:"M20.3287113,17.7016171 L14.8261307,17.7016171 L14.8261307,21.8854179 L14.8261307,24.6737429 C14.8261307,25.7091313 16.5713146,28.9930418 20.3287113,28.9930418 L20.3287113,17.7016171 Z",id:"Fill-2",fill:"#DDB597"}),s.createElement("path",{d:"M18.1163052,33.9077874 C18.1163052,33.9077874 16.9107652,32.9969521 15.601989,31.3099039 C14.2932128,29.6230745 12.4333964,25.9116559 12.4333964,25.9116559 C11.796773,26.003812 11.1961258,26.0999083 10.6276562,26.2001637 L19.059062,43.7260274 L20.3287336,43.7260274 L20.3287336,29.2137349 L18.1163052,33.9077874 Z",id:"Fill-4",fill:"#EFEEED"}),s.createElement("path",{d:"M12.4334858,31.7147341 L8.64391162,30.0953254 L10.2679829,26.2654829 C4.85701892,27.2599373 2.57978853,28.6396525 1.7219446,30.5000682 C0.757736068,32.592078 0,43.7258961 0,43.7258961 L18.0757257,43.7258961 L10.3430638,38.5075824 L12.4334858,31.7147341 Z",id:"Fill-6",fill:"#1D1D1D"}),s.createElement("path",{d:"M20.3287113,17.7016171 L25.8312918,17.7016171 L25.8312918,21.8854179 L25.8312918,24.6737429 C25.8312918,25.7091313 24.0861079,28.9930418 20.3287113,28.9930418 L20.3287113,17.7016171 Z",id:"Fill-8",fill:"#D1AC93"}),s.createElement("path",{d:"M22.5412291,33.9077874 C22.5412291,33.9077874 23.7467691,32.9969521 25.0553218,31.3099039 C26.364098,29.6230745 28.2241379,25.9116559 28.2241379,25.9116559 C28.8607613,26.003812 29.4614085,26.0999083 30.0296546,26.2001637 L21.5984722,43.7260274 L20.3288006,43.7260274 L20.3288006,29.2137349 L22.5412291,33.9077874 Z",id:"Fill-10",fill:"#DDDCDB"}),s.createElement("path",{d:"M28.2240485,31.7147341 L32.0133992,30.0953254 L30.3895513,26.2654829 C35.8005153,27.2599373 38.0777457,28.6396525 38.9353662,30.5000682 C39.8997982,32.592078 40.6575342,43.7258961 40.6575342,43.7258961 L22.5815851,43.7258961 L30.314247,38.5075824 L28.2240485,31.7147341 Z",id:"Fill-12",fill:"#0F0F0F"}),s.createElement("path",{d:"M20.3287113,3.71115593 C14.1291744,3.71115593 13.2107742,8.10203448 13.2107742,13.5180132 C13.2107742,19.5112264 15.9664218,23.3250894 20.3287113,23.3250894 L20.3287113,3.71115593 Z",id:"Fill-14",fill:"#EBCFB7"}),s.createElement("path",{d:"M20.3287113,3.71115593 C26.5282481,3.71115593 27.4466484,8.10203448 27.4466484,13.5180132 C27.4466484,19.5112264 24.6910007,23.3250894 20.3287113,23.3250894 L20.3287113,3.71115593 Z",id:"Fill-16",fill:"#EFC7A6"}),s.createElement("path",{d:"M13.0715617,12.7308772 C12.6353774,11.1337961 12.0383055,11.1337961 11.7858013,11.5387578 C11.5330737,11.9435005 12.4056656,13.5180351 12.4286815,14.8001217 C12.4516974,16.0824272 12.8398388,16.2752765 13.3231721,15.80771 C13.8062819,15.3399246 13.0715617,12.7308772 13.0715617,12.7308772",id:"Fill-18",fill:"#EBCFB7"}),s.createElement("path",{d:"M27.5859726,12.7308772 C28.0221568,11.1337961 28.6192287,11.1337961 28.8717329,11.5387578 C29.1242371,11.9435005 28.2516452,13.5180351 28.2288528,14.8001217 C28.2058369,16.0824272 27.817472,16.2752765 27.3343622,15.80771 C26.8510289,15.3399246 27.5859726,12.7308772 27.5859726,12.7308772",id:"Fill-20",fill:"#EBCFB7"}),s.createElement("path",{d:"M12.3795884,25.9199302 C11.7632994,26.0094596 11.1796348,26.1029291 10.6277008,26.2001199 C10.5054709,26.2217908 10.3870398,26.2436806 10.2679382,26.2655705 L8.64386693,30.0951941 L12.4334411,31.7148217 L10.3430191,38.50767 L18.075681,43.7259836 L19.0591067,43.7259836 L12.3795884,25.9199302 Z",id:"Fill-22",fill:"#3A3939"}),s.createElement("path",{d:"M32.0133992,30.0952379 L30.3895513,26.2656142 C30.2834102,26.2459134 30.1768221,26.2264315 30.0686699,26.2071684 L30.0686699,26.2069495 C30.0628601,26.205855 30.0566033,26.2051983 30.0510169,26.2041039 C30.0438664,26.2027905 29.1706041,26.0423381 28.2939899,25.9223819 L21.6763687,43.5636049 L21.6765921,43.5633861 L21.5986063,43.7260274 L22.5815851,43.7260274 L30.314247,38.5077137 L28.2240485,31.7146466 L32.0133992,30.0952379 Z",id:"Fill-24",fill:"#2D2D2D"}),s.createElement("path",{d:"M20.3287113,6.64640537 L20.3287113,0 C16.3335585,0 13.6766779,1.70762469 12.9146962,4.81335203 C11.8139567,9.29901349 13.0521211,13.3967874 13.2000483,13.8032813 C13.8612518,13.932869 14.0167765,11.6642083 14.0167765,9.24144327 C14.0167765,3.89113401 16.7697427,6.64640537 20.3287113,6.64640537",id:"Fill-26",fill:"#370B00"}),s.createElement("path",{d:"M20.3287113,6.64640537 L20.3287113,0 C24.3238641,0 26.9807446,1.70762469 27.7427263,4.81335203 C28.8434659,9.29901349 27.605078,13.3967874 27.4573742,13.8032813 C26.7961707,13.932869 26.640646,11.6642083 26.640646,9.24144327 C26.640646,3.89113401 23.8876798,6.64640537 20.3287113,6.64640537",id:"Fill-28",fill:"#230600"}),s.createElement("polygon",{id:"Fill-30",fill:"#2A798C",points:"20.3287113 33.2162443 18.6501169 33.2162443 19.425506 43.7259836 20.3287113 43.7259836"}),s.createElement("polygon",{id:"Fill-32",fill:"#266C77",points:"21.23214 43.7259179 22.0073056 33.2161786 20.3287113 33.2161786 20.3287113 43.7259179"}),s.createElement("polygon",{id:"Fill-34",fill:"#3691AD",points:"18.2760532 31.4385503 19.1256293 33.2162224 20.3287113 33.2162224 20.3287113 28.9930199"}),s.createElement("polygon",{id:"Fill-36",fill:"#266C77",points:"22.3812799 31.4385503 20.3286219 28.9930199 20.3286219 33.2162224 21.5317039 33.2162224"}),s.createElement("path",{d:"M23.9005061,25.9844833 L25.8313812,24.1571213 C26.8119019,24.7194707 28.2241379,25.9115902 28.2241379,25.9115902 C28.2241379,25.9115902 26.4673343,29.8497873 25.1587815,31.6071019 C23.8497818,33.3639787 22.4846949,34.4026505 22.4846949,34.4026505 L20.3288006,29.2136692 L20.4320369,29.1004989 L23.9005061,25.9844833 Z",id:"Fill-38",fill:"#CCCCCC"}),s.createElement("path",{d:"M23.7972922,25.9115902 L25.8314035,24.1571213 C26.8119243,24.6969242 28.2241602,25.9115902 28.2241602,25.9115902 C28.2241602,25.9115902 26.3641204,29.6230088 25.0553442,31.3098382 C23.7465679,32.9968864 22.5412514,33.9077218 22.5412514,33.9077218 L20.328823,29.2136692 L20.328823,28.9034905 L23.7972922,25.9115902 Z",id:"Fill-40",fill:"#F4F2F2"}),s.createElement("path",{d:"M16.7568047,25.9844833 L14.826153,24.1571213 C13.8456323,24.7194707 12.4333964,25.9115902 12.4333964,25.9115902 C12.4333964,25.9115902 14.1899765,29.8497873 15.4987527,31.6071019 C16.807529,33.3639787 18.1726158,34.4026505 18.1726158,34.4026505 L20.3287336,29.2136692 L20.2252739,29.1004989 L16.7568047,25.9844833 Z",id:"Fill-42",fill:"#CCCCCC"}),s.createElement("path",{d:"M16.8601303,25.9115902 L14.826019,24.1571213 C13.8454982,24.6969242 12.4334858,25.9115902 12.4334858,25.9115902 C12.4334858,25.9115902 14.2933021,29.6230088 15.6020784,31.3098382 C16.9108546,32.9968864 18.1163946,33.9077218 18.1163946,33.9077218 L20.3285995,29.2136692 L20.3285995,28.9034905 L16.8601303,25.9115902 Z",id:"Fill-44",fill:"#FFFFFF"})))))))}const ZA=s.forwardRef(QA);i.p;var JA=i(75087),$A=i.n(JA),tm=i(61186),em=(i(9056),i(74065)),im=i.n(em),nm=i(57469),sm=i.n(nm),rm=i(1582),am=i.n(rm),om=i(80111),lm=i.n(om);function cm(){return cm=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},cm.apply(null,arguments)}function hm(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}const dm=["id","url","error","apis","loading","ttl","cacheName"],um=["paramsType","paramsName"],pm=["data"],fm=t=>e=>{var i;const n=Object.assign({},{loading:null,ttl:6e6,cacheName:"file-cache"},e),{id:s,error:o,apis:c,loading:d,ttl:u,cacheName:p}=n,f=hm(n,dm),{apis:g}=(0,a.usePreset)(),A=h()({},g,c);if(!s)return null;if(null==A||null==(i=A.file)||!i.getUrl)return console.warn("\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.file.getUrl\u53c2\u6570"),null;const m=Object.assign({paramsType:"params",paramsName:"id"},A.file.getUrl),{paramsType:v,paramsName:b}=m,w=hm(m,um),y={},_=s.split("?")[0];return y[v]={[b]:_},r().createElement(l(),cm({},Object.assign({},w,y),{updateType:"refresh",error:o,loading:d,cache:p,ttl:u,render:e=>{let{data:i}=e,n=hm(e,pm);return r().createElement(t,cm({},f,{id:_,data:i,fetchApi:n}))}}))},gm=["data","children"],Am=fm(t=>{let{data:e,children:i}=t;return i(cm({url:e},hm(t,gm)))}),mm=(t,e)=>{const i=document.createElement("a"),n=new MouseEvent("click");i.download=e,i.target="_blank",i.href=t,i.dispatchEvent(n)},vm=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file",i=arguments.length>2?arguments[2]:void 0;if(!t)throw new Error((null==i?void 0:i.notFoundFile)||"\u672a\u83b7\u53d6\u5230\u4e0b\u8f7d\u7684\u6587\u4ef6\u4fe1\u606f");if("string"===typeof t&&/blob:http(s)?:/.test(t))return void mm(t,e);if("[object Blob]"===Object.prototype.toString.call(t)){const i=new Blob([t],{type:t.type});return void mm(URL.createObjectURL(i),e)}const n=(0,o.getAjax)(),{data:s,headers:r}=await n({url:t,responseType:"blob"}),a=null==r?void 0:r["content-disposition"];if(a){const t=a.match(/filename\*?=(?:UTF-8'')?([^;]+)/i);if(t&&t[1])e=decodeURIComponent(t[1].replace(/['"]/g,""));else{const t=a.match(/filename="?([^"]+)"?/i);t&&(e=t[1])}}mm(URL.createObjectURL(new Blob([s],{type:null==s?void 0:s.type})),e)},bm=t=>{let{url:e,staticUrl:i}=t;return/^(blob:)?https?:\/\//.test(e)?e:i+e},wm=t=>{let{url:e,staticUrl:i}=t;var n;const{apis:s}=(0,a.usePreset)(),r=i||(null==(n=s.file)?void 0:n.staticUrl)||"";return bm({staticUrl:r,url:e})},ym=["paramsType","paramsName"],_m=["isLoading","data","error","refresh"],xm=t=>{let{id:e,src:i,filename:n,staticUrl:r,apis:l,onError:c,onSuccess:h}=t;var u,p;const{message:f}=d.App.useApp(),{apis:g}=(0,a.usePreset)(),A=Object.assign({},g,l),m=r||(null==(u=A.file)?void 0:u.staticUrl)||"",[v,b]=(0,s.useState)(!1),w=Object.assign({paramsType:"params",paramsName:"id"},null==(p=A.file)?void 0:p.getUrl),{paramsType:y,paramsName:_}=w,x=hm(w,ym),E={};E[y]={[_]:e};const k=(0,o.useFetch)(Object.assign({},x,E,{auto:!1})),{isLoading:C,data:S,error:M,refresh:L}=k,R=hm(k,_m),P=T()(c||f.error),F=T()(h),I=T()(t=>vm(bm({staticUrl:m,url:t}),n).then(F).catch(t=>{P(t.message)}));return(0,s.useEffect)(()=>{C||(M?P(M):S&&(b(!0),I(S).then(()=>{b(!1)})))},[C,M,S,P]),cm({},R,{isLoading:C||v,download:()=>i?I(i):L(e?E:{})})},Em={unnamedDownloadFile:"\u672a\u547d\u540d\u4e0b\u8f7d\u6587\u4ef6",fileUpload:"\u4e0a\u4f20\u6587\u4ef6",uploadTips:"\u652f\u6301\u6269\u5c55\u540d{accept}\uff0c\u5355\u4e2a\u6587\u4ef6\u5927\u5c0f\u4e0d\u8d85\u8fc7{fileSize}M\uff0c\u6700\u591a\u4e0a\u4f20{maxLength}\u4e2a\u9644\u4ef6",maxLengthError:"\u4e0a\u4f20\u6587\u4ef6\u4e0d\u80fd\u8d85\u8fc7\u6700\u5927\u5141\u8bb8\u6570\u91cf{maxLength}",fileSizeError:"\u6587\u4ef6{filename}\u4e0d\u80fd\u8d85\u8fc7{fileSize}MB!",uploadError:"\u6587\u4ef6{filename}\u4e0a\u4f20\u9519\u8bef{error}",uploadAnomaly:"\u6587\u4ef6{filename}\u4e0a\u4f20\u5f02\u5e38{error}",fileLoadedError:"\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25",fileNotFoundError:"\u672a\u6307\u5b9a\u6587\u4ef6",pageNotFoundError:"\u672a\u6307\u5b9a\u9875\u9762",unSupportFileType:"\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b",unSupportFileTypeDescription:"\u7cfb\u7edf\u4e0d\u652f\u6301\u8be5\u6587\u4ef6\u7c7b\u578b\u9884\u89c8\uff0c\u8bf7\u4e0b\u8f7d\u5230\u672c\u5730\u540e\u8fdb\u884c\u9884\u89c8",uploading:"\u6b63\u5728\u4e0a\u4f20",unNamedDownloadFile:"\u672a\u547d\u540d\u4e0b\u8f7d\u6587\u4ef6",notFoundFile:"\u672a\u83b7\u53d6\u5230\u4e0b\u8f7d\u7684\u6587\u4ef6\u4fe1\u606f",downloadSuccess:"\u4e0b\u8f7d\u6210\u529f",pleaseSetApi:"\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.file.getUrl\u53c2\u6570",filePreview:"\u6587\u4ef6\u9884\u89c8"},km=["id","src","filename","api","onSuccess","onError","onClick"],Cm=(0,F.createWithIntlProvider)("zh-CN",Em,"react-file")(t=>{const{formatMessage:e}=(0,F.useIntl)(),i=Object.assign({},{filename:e({id:"unnamedDownloadFile"})},t),{id:n,src:s,filename:a,api:o,onSuccess:l,onError:c,onClick:h}=i,u=hm(i,km),{isLoading:p,download:f}=xm({id:n,src:s,filename:a,api:o,onError:c,onSuccess:l});return r().createElement(d.Button,cm({icon:r().createElement(g,null)},P()(u,["locale"]),{loading:p,onClick:function(){h&&h(...arguments),f()}}))});Cm.useDownload=xm,Cm.download=mm,Cm.downloadBlobFile=vm;var Sm="_Cmp6z",Mm="_lmC4r",Lm="_-jyU7",Tm="_lN9hC",Rm="_yaqrz",Pm="_SXsiw",Fm="_15U-a",Im="_tpRpL";const Dm=["className","url","maxWidth","ignoreContent"],Om=(0,F.createWithIntlProvider)("zh-CN",Em,"react-file")(t=>{let{data:e,apis:i,contentWindowUrl:n}=t;var o;const l=(0,s.useRef)(null),{apis:c}=(0,a.usePreset)(),{formatMessage:h}=(0,F.useIntl)(),d=Object.assign({},c,i),u=n||(null==(o=d.file)?void 0:o.contentWindowUrl)||"https://cdn.jsdelivr.net/npm/@kne/iframe-resizer@0.1.3/dist/contentWindow.js";return(0,s.useEffect)(()=>{const t=(new DOMParser).parseFromString(e,"text/html");t.querySelectorAll("script").forEach(t=>{t.parentElement.removeChild(t)});const i=document.createElement("script");i.src=u,t.head.appendChild(i);const n=document.createElement("style");n.innerText="html,body{height:auto!important;}body{pointer-events: none;background: #FFFFFF;}",t.head.appendChild(n),l.current.srcdoc=t.documentElement.outerHTML},[e]),(0,s.useEffect)(()=>{At({checkOrigin:!1},l.current)},[]),r().createElement("iframe",{title:h({id:"filePreview"}),frameBorder:"0",width:"100%",ref:l})}),Nm=(0,F.createWithIntlProvider)("zh-CN",Em,"react-file")(t=>{const{formatMessage:e}=(0,F.useIntl)(),i=Object.assign({},t),{className:n,url:s,maxWidth:a,ignoreContent:o}=i,c=hm(i,Dm),h=r().createElement("iframe",{title:e({id:"filePreview"}),src:s,width:"100%",className:Im});return r().createElement("div",{className:vt()(n,Sm),style:{maxWidth:a}},o?h:r().createElement(l(),{url:s,transformResponse:t=>{let{data:e}=t;return{data:{code:200,results:e}}},showError:!1,error:h,render:t=>{let{data:e}=t;return r().createElement(Om,cm({},c,{url:s,data:e}))}}))}),Wm=["url","filename","type"],jm=t=>{var e;let{url:i,filename:n,type:s}=t,o=hm(t,Wm);const{apis:l}=(0,a.usePreset)(),c=Object.assign({},l,o.apis),h=wm({staticUrl:o.staticUrl||(null==(e=c.file)?void 0:e.staticUrl),url:i}),d=s&&Jm[s]||$m(n||h);return r().createElement(d,cm({},o,{url:h}))},Bm=["url","apis","className"],Hm=t=>{var e;let{url:i,apis:n,className:s}=t,o=hm(t,Bm);const{apis:c}=(0,a.usePreset)(),h=Object.assign({},c,n);return r().createElement(l(),cm({},(null==(e=h.file)?void 0:e.previewOffice)||{loader:async()=>({data:[{url:"https://view.officeapps.live.com/op/embed.aspx?src=".concat(encodeURIComponent(i)),type:"html"}]})},{render:t=>{let{data:e}=t;const{data:i}=e;return i.map(t=>{let{url:e,type:i}=t;return r().createElement(jm,cm({},o,{type:i,ignoreContent:!0,url:e,className:s,key:e}))})}}))},zm=(0,s.memo)((0,F.createWithIntlProvider)("zh-CN",Em,"react-file")(t=>{var e;const{formatMessage:i}=(0,F.useIntl)(),{url:n,apis:o,maxWidth:l,scale:c,rotate:h,className:u,pdfjsUrl:p}=Object.assign({},{autoSize:!0,renderTextLayer:!1,scale:100,rotate:0,maxWidth:1200},t),[f,g]=(0,s.useState)(0),{apis:A}=(0,a.usePreset)(),m=Object.assign({},A,o),v=p||(null==(e=m.file)?void 0:e.pdfjsUrl)||"https://cdn.jsdelivr.net/npm/pdfjs-dist@4.4.168";xg.workerSrc=v+"/build/pdf.worker.min.mjs";const b=(0,s.useMemo)(()=>({file:n,options:{standardFontDataUrl:v+"/standard_fonts/",cMapUrl:v+"/cmaps/",cMapPacked:!0}}),[v,n]),[w,y]=(0,s.useState)(l),_=(0,MA.A)(()=>{_.current&&_.current.clientWidth&&y(Math.min(_.current.clientWidth,l))});return r().createElement("div",{ref:_,className:vt()(u,Sm),style:{maxWidth:l}},r().createElement(aA,cm({},b,{error:i({id:"fileLoadedError"}),loading:r().createElement("div",{className:Mm},r().createElement(d.Spin,null)),noData:i({id:"fileNotFoundError"}),onLoadSuccess:t=>{let{numPages:e}=t;g(e)}}),r().createElement(d.Flex,{vertical:!0,gap:8},f>=1&&Array.from(new Array(f),(t,e)=>r().createElement(CA,{key:"page_".concat(e),className:"preview-item",scale:c/100,rotate:h,pageNumber:e+1,width:w,loading:null,renderAnnotationLayer:!1,renderTextLayer:!0,noData:i({id:"pageNotFoundError"})})))))})),Um=(0,F.createWithIntlProvider)("zh-CN",Em,"react-file")(t=>{let{url:e,className:i,maxWidth:n}=t;const{formatMessage:a}=(0,F.useIntl)(),[l,c]=(0,s.useState)(""),[h,u]=(0,s.useState)(!0),[p,f]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(0,o.getAjax)()({url:e,method:"GET"}).then(t=>{let{data:e}=t;c(e),u(!1)},()=>{u(!1),f(!0)})},[e]),r().createElement("div",{className:vt()(i,Sm),style:{maxWidth:n}},h?r().createElement("div",{className:Mm},r().createElement(d.Spin,null)):null,r().createElement("div",{className:Lm},p?r().createElement("div",{className:Tm},a({id:"fileLoadedError"})):r().createElement("div",{className:Rm},l)))}),Vm=(0,F.createWithIntlProvider)("zh-CN",Em,"react-file")(t=>{let{maxWidth:e}=t;const{formatMessage:i}=(0,F.useIntl)();return r().createElement("div",{className:Sm,style:{maxWidth:e}},r().createElement("div",{className:Lm},r().createElement(d.Result,{status:"500",title:i({id:"unSupportFileType"}),subTitle:i({id:"unSupportFileTypeDescription"})})))}),Gm=["url","scale","rotate","className","maxWidth","origin"],qm=(0,F.createWithIntlProvider)("zh-CN",Em,"react-file")(t=>{let{url:e,scale:i,rotate:n,className:a,maxWidth:o,origin:l}=t,c=hm(t,Gm);const[h,u]=(0,s.useState)(!0),[p,f]=(0,s.useState)(!1),{formatMessage:g}=(0,F.useIntl)();return(0,s.useEffect)(()=>{const t=new Image;t.src=e;const i=()=>{u(!1)},n=()=>{u(!1),f(!0)};return t.addEventListener("load",i),t.addEventListener("error",n),()=>{t.removeEventListener("load",i),t.removeEventListener("error",n)}},[e,i,n]),l?r().createElement("img",cm({alt:g({id:"filePreview"})},c,{className:a,src:e})):r().createElement("div",{className:vt()(a,Sm),style:{maxWidth:o}},h?r().createElement("div",{className:Mm},r().createElement(d.Spin,null)):null,p?r().createElement("div",{className:Tm},g({id:"fileLoadedError"})):r().createElement("img",cm({alt:g({id:"filePreview"})},c,{src:e})))}),Xm=["url","maxWidth"],Ym=t=>{let{url:e,maxWidth:i}=t,n=hm(t,Xm);return r().createElement("div",{className:Sm,style:{maxWidth:i}},r().createElement("div",{className:Pm},r().createElement("audio",cm({},n,{src:e,controls:!0}))))},Km=["url","maxWidth","origin","controls","getElement"],Qm=t=>{let{url:e,maxWidth:i,origin:n,controls:a=!0,getElement:o}=t,l=hm(t,Km);const c=(0,s.useRef)(null),h=T()(o);return(0,s.useEffect)(()=>{h(c.current)},[h]),n?r().createElement("video",cm({controls:a},l,{src:e,ref:c})):r().createElement("div",{className:Sm,style:{maxWidth:i}},r().createElement("div",{className:Fm},r().createElement("video",cm({controls:a},l,{src:e,ref:c}))))},Zm=t=>{const e=(t||"").split("?")[0].toLowerCase();return/.txt$/.test(e)?"txt":/.pdf$/.test(e)?"pdf":/.(png|jpg|jpeg)$/.test(e)?"image":/.(html|htm)$/.test(e)?"html":/.(doc|docx|xls|xlsx|ppt|pptx|csv)$/.test(e)?"office":/.(mp3|wav|ogg|aac)$/.test(e)?"audio":/.(mp4|avi|mov|mkv|flv)$/.test(e)?"video":"unknown"},Jm={txt:Um,pdf:zm,image:qm,html:Nm,office:Hm,audio:Ym,video:Qm,unknown:Vm},$m=t=>Jm[Zm(t)],tv=["data","id","staticUrl","className","fetchApi","filename","render"],ev=fm(t=>{let{data:e,id:i,staticUrl:n,className:s,fetchApi:a,filename:o,render:l}=t,c=hm(t,tv);const h=wm({staticUrl:n,url:e}),d=e&&$m(e)||o&&$m(o);return"function"===typeof l?l({data:e,id:i,staticUrl:n,className:s,fetchApi:a,filename:o,url:h,component:d}):r().createElement(d,cm({},c,{className:s,url:h}))}),iv=["id","src","originName","filename"],nv=t=>{let{id:e,src:i,originName:n,filename:s}=t,a=hm(t,iv);return i?r().createElement(jm,cm({},a,{url:i,filename:s||n})):r().createElement(ev,cm({},a,{id:e,filename:s||n}))},sv=["content","onSuccess","onError","onBeforePrint","printProps","contentRef"],rv=t=>{let{onSuccess:e,onError:i,onBeforePrint:n,printProps:a,contentRef:o}=t,l=hm(t,sv);const[c,h]=(0,s.useState)(!1),u=(0,LA.useReactToPrint)(cm({contentRef:o,bodyClass:document.body.getAttribute("class"),onBeforePrint:async function(){h(!0),n&&await n(...arguments)},onPrintError:function(){h(!1),i&&i(...arguments)},onAfterPrint:function(){h(!1),e&&e(...arguments)}},a));return r().createElement(d.Button,cm({},l,{onClick:()=>{h(!0),u()},loading:c}))};var av=".file-modal-outer {\n min-height: 100px;\n}\n\n.file-title {\n margin-right: 30px;\n}\n\n.ellipse {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n word-break: break-all;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLm1vZHVsZXMuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGlCQUFpQjtBQUNuQjs7QUFFQTtFQUNFLGtCQUFrQjtBQUNwQjs7QUFFQTtFQUNFLGdCQUFnQjtFQUNoQix1QkFBdUI7RUFDdkIsb0JBQW9CO0VBQ3BCLHFCQUFxQjtFQUNyQiw0QkFBNEI7RUFDNUIscUJBQXFCO0FBQ3ZCIiwiZmlsZSI6InN0eWxlLm1vZHVsZXMuc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5maWxlLW1vZGFsLW91dGVyIHtcbiAgbWluLWhlaWdodDogMTAwcHg7XG59XG5cbi5maWxlLXRpdGxlIHtcbiAgbWFyZ2luLXJpZ2h0OiAzMHB4O1xufVxuXG4uZWxsaXBzZSB7XG4gIG92ZXJmbG93OiBoaWRkZW47XG4gIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICBkaXNwbGF5OiAtd2Via2l0LWJveDtcbiAgLXdlYmtpdC1saW5lLWNsYW1wOiAxO1xuICAtd2Via2l0LWJveC1vcmllbnQ6IHZlcnRpY2FsO1xuICB3b3JkLWJyZWFrOiBicmVhay1hbGw7XG59Il19 */";const ov=["title","filename","originName","openDownload","openPrint","id","src","apis"],lv=["renderModal"],cv=(0,F.createIntlProvider)("zh-CN",Em,"react-file"),hv=t=>{const e=Object.assign({},{footer:null,openDownload:!1,openPrint:!1},t),{title:i,filename:n,originName:a,openDownload:o,openPrint:l,id:c,src:h,apis:u}=e,p=hm(e,ov),[f,g]=RA()(p,{value:"open",default:"defaultOpen",onChange:"onOpenChange"}),{message:A}=d.App.useApp(),v=(0,s.useRef)();return cm({},p,{open:f,onOpenChange:g,onCancel:()=>{g(!1)},title:r().createElement(d.Space,{size:10,className:av["file-title"]},r().createElement("span",{className:av.ellipse},i||n||a),r().createElement("span",null,o&&r().createElement(cv,null,t=>{let{formatMessage:e}=t;return r().createElement(Cm,{className:"btn-no-padding",type:"link",id:c,src:h,apis:u,filename:n||a,onSuccess:()=>{A.success(e({id:"downloadSuccess"}))}})}),l&&["txt","pdf","image","html"].indexOf(Zm(n||a))>-1&&r().createElement(rv,{contentRef:v,type:"link",icon:r().createElement(m,null)}))),children:r().createElement("div",{ref:v,className:av["file-modal-outer"]},r().createElement(nv,{id:c,src:h,filename:n||a,apis:u}))})},dv=t=>{const e=Object.assign({},{renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{renderModal:i}=e,n=hm(e,lv),s=hv(n);return Object.assign({},s,{renderModal:t=>i(Object.assign({},s,t))})},uv=t=>{const{renderModal:e}=dv(t);return e()},pv=["filename","originName","id","src","title","modalProps","openDownload","openPrint","children"],fv=t=>{const[e,i]=(0,s.useState)(!1),n=Object.assign({},{icon:r().createElement(b,null)},t),{filename:a,originName:o,id:l,src:c,title:h,modalProps:u,openDownload:p,openPrint:f,children:g}=n,A=hm(n,pv),m=Object.assign({},u,{filename:a||o,id:l,src:c,title:h,open:e,openPrint:f,openDownload:p,onCancel:()=>{i(!1)}});return r().createElement(r().Fragment,null,r().createElement(d.Button,cm({},A,{onClick:()=>{i(!0)}}),"function"===typeof g?g(a||o):g||a||o),r().createElement(uv,cm({},m,{open:e,onOpenChange:i})))},gv=t=>{let{params:e}=t;const{data:i}=e;return new Promise((t,e)=>{const n=new window.Image;n.src=i,n.addEventListener("load",()=>{t(i)}),n.addEventListener("error",t=>{e(t)})})};var Av="_H1zfc",mv="_BAe2W",vv="_9kK1I",bv="_Wwi2N";const wv=["id","src","alt","onClick","loading","error","className","apis","staticUrl"],yv=["id","src","alt","gender","loading","error","className","gap","icon","children","shape","size","width","height","defaultAvatar","apis","staticUrl"],_v=r().createElement(d.Skeleton.Avatar,{shape:"square",active:!0}),xv=r().createElement(DA,null),Ev=r().createElement(HA,null),kv=r().createElement(qA,null),Cv=r().createElement(ZA,null),Sv=t=>{let{data:e,className:i,alt:n,innerLoading:s,loading:o,error:c,innerError:h,children:d,onClick:u,staticUrl:p}=t;var f;const{apis:g}=(0,a.usePreset)(),A=Object.assign({},g),m=wm({staticUrl:p||(null==(f=A.file)?void 0:f.staticUrl),url:e});return r().createElement(l(),{loader:gv,params:{data:m},error:h||c,loading:s||o,render:t=>{let{data:e}=t;return"function"===typeof d?d({alt:n,className:vt()(i,mv),src:e}):r().createElement("img",{alt:n,className:vt()(i,mv),src:e,onClick:u})}})},Mv=fm(Sv),Lv=t=>{let{loading:e,error:i,src:n,id:s,alt:a,className:o,children:l,apis:c,onClick:h,staticUrl:d}=t;const u=(t,e)=>{const i=t.type;return!i&&t.render?t.render(Object.assign({},t.props,e)):r().createElement(i,Object.assign({},t.props,e))},p=e&&u(e,{className:vv}),f=i&&u(i,{className:bv});return n?r().createElement(Sv,{alt:a,className:o,staticUrl:d,data:n,loading:p,error:f,onClick:h},l):s?r().createElement(Mv,{alt:a,className:o,id:s,loading:p,innerLoading:p,error:f,innerError:f,apis:c,onClick:h},l):f},Tv=t=>{const e=Object.assign({},{loading:_v,error:xv},t),{id:i,src:n,alt:s,onClick:a,loading:o,error:l,className:c,apis:h,staticUrl:d}=e,u=hm(e,wv);return r().createElement("div",cm({},u,{className:vt()(c,Av)}),Lv({loading:o,error:l,src:n,id:i,alt:s,className:c,apis:h,onClick:a,staticUrl:d}))};Tv.Avatar=t=>{const e=Object.assign({},{size:100,defaultAvatar:Ev,error:xv,shape:"circle"},t),{id:i,src:n,alt:s,gender:a,loading:o,error:l,className:c,gap:h,icon:u,children:p,shape:f,size:g,width:A,height:m,defaultAvatar:v,apis:b,staticUrl:w}=e,y=hm(e,yv),_=(()=>{const t=A&&m?{style:{width:A,height:m}}:{size:g};let e=f;if(A&&A!==m&&(e="square"),i||n)return Lv({loading:o||r().createElement(d.Skeleton.Avatar,{shape:e,active:!0}),staticUrl:w,error:l,src:n,defaultAvatar:v,id:i,alt:s,className:c,apis:b,children:i=>r().createElement(d.Avatar,cm({},i,{gap:h,shape:e},t))});if(a){const i=["F","female","f"].indexOf(a)>-1?kv:["M","male","m"].indexOf(a)>-1?Cv:Ev;return r().createElement(d.Avatar,cm({},y,{src:i,gap:h,shape:e},t))}return r().createElement(d.Avatar,cm({},y,{gap:h,icon:u,shape:e,size:g,src:v},t),p)})();return r().createElement("div",cm({},y,{className:vt()(c,Av),style:{width:A&&m?A:g,height:A&&m?m:g}}),_)};const Rv=t=>{const{item:e,hasPreview:i,getPermission:n,apis:s,onEdit:a,onDelete:o,onPreview:l,renderModal:c}=Object.assign({},{hasPreview:!0,apis:{},getPermission:()=>!0,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{filename:h,id:u,src:p}=e,{onOpenChange:f,renderModal:g}=dv({apis:s,id:u,src:p,filename:h,renderModal:c});return r().createElement(d.Flex,{justify:"end"},i&&n("preview",e)&&r().createElement(r().Fragment,null,r().createElement(d.Button,{type:"text",icon:r().createElement(y,null),onClick:()=>{l?l(e):f(!0)}}),g()),n("edit",e)&&r().createElement(tm.LoadingButton,{type:"text",icon:r().createElement(x,null),onClick:()=>a&&a(e)}),n("download",e)&&r().createElement(Cm,{type:"text",id:u,src:p,filename:h}),n("delete",e)&&r().createElement(tm.ConfirmButton,{type:"text",icon:r().createElement(k,null),onClick:()=>o&&o(e)}))};var Pv="_yRMtw",Fv="_OivOI",Iv="_doPR9",Dv="_bLeUP",Ov="_mZdoa";const Nv=(0,F.createWithIntlProvider)("zh-CN",Em,"react-file")(t=>{const{formatMessage:e}=(0,F.useIntl)(),{className:i,dataSource:n,getPermission:s,infoItemRenders:a,onDelete:o,onEdit:l,apis:c,renderModal:h}=Object.assign({},{infoItemRenders:[t=>t.userName?r().createElement(d.Typography.Text,null,t.userName):null,t=>t.date?r().createElement(d.Typography.Text,null,sm()(t.date).format("YYYY-MM-DD HH:mm:ss")):null],getPermission:()=>!0,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t);return r().createElement(d.List,{className:i,dataSource:n.map((t,e)=>(t.index=e,t)),rowKey:t=>"item_".concat(t.uuid&&"uuid_".concat(t.uuid)||t.id&&"id_".concat(t.id)||t.src&&"src_".concat(t.src)),renderItem:t=>{const{type:i,filename:n}=t;return r().createElement(d.List.Item,{className:Pv},r().createElement(d.Row,{justify:"space-between",wrap:!1,className:Fv},r().createElement(d.Col,{flex:1},r().createElement("div",{className:Iv}),r().createElement(d.Space,{className:"is-block",align:"start",size:4},r().createElement($A(),{type:im()(null==n?void 0:n.split(".")),size:14}),n||"")),a&&a.map((e,n)=>r().createElement(d.Col,{span:e.span||4,key:n},"uploading"!==i&&("function"===typeof e?e:e.render)(t),r().createElement("div",{className:Iv}))),r().createElement(d.Col,{className:Ov},"uploading"!==i?r().createElement(Rv,{getPermission:s,item:t,apis:c,onDelete:o,renderModal:h,onEdit:l}):r().createElement(d.Space,{className:Dv},r().createElement(d.Spin,{size:"small"}),r().createElement(d.Typography.Link,null,e({id:"uploading"}))))))},bordered:!0})}),Wv=t=>{const{locale:e}=(0,a.useContext)(),{formatMessage:i}=(0,F.createIntl)({locale:e,namespace:"react-file"}),{multiple:n,fileSize:r,maxLength:o,value:l,concurrentCount:c,onAdd:h,onError:u,onSave:p,onChange:f,onUpload:g}=Object.assign({},{concurrentCount:1,value:[]},t),{apis:A}=(0,a.usePreset)(),{message:m}=d.App.useApp(),[v,b]=(0,s.useState)([]),w=(0,s.useRef)(c),y=(0,s.useMemo)(()=>am()(w.current),[]),_=T()(async t=>{const e=o-l.length;1!==o&&!0===n&&t.length>e?m.error(i({id:"maxLengthError"},{maxLength:o})):await Promise.allSettled(t.map(async t=>{if(t.size>1024*r*1024)return void m.error(i({id:"fileSizeError"},{filename:t.name,fileSize:r}));const e=lm()(),s=n=>{const s=n.message||i({id:"uploadError"},{filename:t.name,error:n.message?":"+n.message:""});m.error(s),u&&u({file:t,error:n,errMsg:s}),b(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i})};try{var a;b(1===o||!0!==n?[{uuid:e,type:"uploading",filename:t.name}]:i=>{const n=i.slice(0);return n.unshift({uuid:e,type:"uploading",filename:t.name}),n}),h&&await Promise.resolve(h(t));const r=g||(null==(a=A.file)?void 0:a.upload),{data:l}=await y(()=>r({file:t}));if(0!==l.code)return void s(new Error(i({id:"uploadError"},{filename:t.name,error:l.msg?":"+l.msg:""})));const c=p?await Promise.resolve(p(l,t,e)):Object.assign({},l.data,{filename:l.data.filename||l.data.originName||t.name,id:l.data.id,uuid:e});b(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i}),f(1===o||!0!==n?[c]:t=>{const e=(t||[]).slice(0);return e.push(c),e})}catch(l){s(l)}}))});return{fileList:v,onFileSelected:_}};var jv="_-hhpT",Bv="_FyygJ",Hv="_hBEXs",zv="_BMSEY";const Uv=[".pdf",".jpg",".png",".jpeg",".doc",".docx",".xls",".xlsx",".html",".msg",".eml",".zip"],Vv=["children","className","buttonText","accept","multiple","onChange"],Gv=["children"],qv=(0,F.createWithIntlProvider)("zh-CN",Em,"react-file")(t=>{const{formatMessage:e}=(0,F.useIntl)(),i=(0,s.useRef)(null),n=Object.assign({},{accept:Uv,buttonText:e({id:"fileUpload"}),children:t=>{let{children:e}=t,i=hm(t,Gv);return r().createElement(d.Button,cm({icon:r().createElement(S,null)},i),l,e)}},t),{children:a,className:o,buttonText:l,accept:c,multiple:h,onChange:u}=n,p=hm(n,Vv);return a(cm({},p,{className:vt()(o,jv),children:!p.disabled&&r().createElement("input",{ref:i,type:"file",accept:c,multiple:h,className:Bv,onChange:t=>{const e=[].slice.call(t.target.files,0);0!==e.length&&(i.current.setAttribute("type","text"),i.current.setAttribute("type","file"),u(e))}})}))}),Xv=["className","fileSize","maxLength","multiple","size","accept","children","renderTips","showUploadList","onSave","ossUpload","getPermission","concurrentCount","apis","renderModal"],Yv=(0,F.createWithIntlProvider)("zh-CN",Em,"react-file")(t=>{const{formatMessage:e}=(0,F.useIntl)(),i=Object.assign({},{defaultValue:[],accept:Uv,renderTips:t=>t,children:e({id:"fileUpload"}),multiple:!0,showUploadList:!0,maxLength:10,fileSize:30,concurrentCount:10,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{className:n,fileSize:s,maxLength:a,multiple:o,size:l,accept:c,children:h,renderTips:u,showUploadList:p,onSave:f,ossUpload:g,getPermission:A,concurrentCount:m,apis:v,renderModal:b}=i,w=hm(i,Xv),[y,_]=RA()(w),x=y||[],{fileList:E,onFileSelected:k}=Wv({multiple:o,onSave:f,ossUpload:g,fileSize:s,maxLength:a,value:x,onChange:_,concurrentCount:m});c.map(t=>t.replace(/^\./,"")).join("\u3001");const C=[...x,...E],S=u(e({id:"uploadTips"},{fileSize:s,maxLength:a,accept:c.map(t=>t.replace(/^\./,"")).join(",")}),{fileSize:s,maxLength:a,accept:c});return r().createElement(d.Flex,{vertical:!0,gap:8},r().createElement(d.Flex,{gap:8},r().createElement(qv,cm({},P()(w,["value","onChange"]),{size:l,multiple:o,accept:c,className:n,buttonText:h,onChange:k})),S&&r().createElement("div",{className:zv},S)),p&&C.length>0&&r().createElement(Nv,{className:Hv,dataSource:C,infoItemRenders:[],getPermission:A||(t=>["delete","preview"].indexOf(t)>-1),onDelete:t=>{const e=x.slice(0),i=e.indexOf(t);i>-1&&e.splice(i,1),_(e)},apis:v,renderModal:b}))}),Kv=(t,e)=>{if(t&&e){const i=Array.isArray(e)?e:e.split(","),n=t.name||"",s=(t.type||"").toLowerCase(),r=s.replace(/\/.*$/,"");return i.some(t=>{const e=t.trim().toLowerCase();return"."===e.charAt(0)?n.toLowerCase().endsWith(e):e.endsWith("/*")?r===e.replace(/\/.*$/,""):s===e})}return!0}},50149:t=>{t.exports=function(t,e){for(var i=-1,n=null==t?0:t.length,s=Array(n);++i<n;)s[i]=e(t[i],i,t);return s}},51104:(t,e,i)=>{var n=i(96614),s=i(28673);t.exports=function(t,e){return t&&n(e,s(e),t)}},51153:(t,e,i)=>{"use strict";var n=i(73884),s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(t,e,i){var n,r={},c=null,h=null;for(n in void 0!==i&&(c=""+i),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(h=e.ref),e)a.call(e,n)&&!l.hasOwnProperty(n)&&(r[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps)void 0===r[n]&&(r[n]=e[n]);return{$$typeof:s,type:t,key:c,ref:h,props:r,_owner:o.current}}e.Fragment=r,e.jsx=c,e.jsxs=c},51268:(t,e,i)=>{var n=i(35428),s=i(47574),r=i(56832),a=r&&r.isTypedArray,o=a?s(a):n;t.exports=o},51946:(t,e,i)=>{var n=i(61340);t.exports=function(t){return n(this.__data__,t)>-1}},52969:(t,e,i)=>{var n=i(35324),s=i(70914);t.exports=function(t,e){for(var i=0,r=(e=n(e,t)).length;null!=t&&i<r;)t=t[s(e[i++])];return i&&i==r?t:void 0}},53737:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}},53871:t=>{t.exports=function(t,e,i){var n=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(i=i>s?s:i)<0&&(i+=s),s=e>i?0:i-e>>>0,e>>>=0;for(var r=Array(s);++n<s;)r[n]=t[n+e];return r}},53986:(t,e,i)=>{"use strict";function n(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}i.d(e,{A:()=>n})},54052:t=>{var e=Array.isArray;t.exports=e},55119:(t,e,i)=>{var n=i(96614),s=i(30474);t.exports=function(t,e){return t&&n(e,s(e),t)}},55149:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(8195);function s(t,e,i){(0,n.A)(t,e),e.set(t,i)}},55636:(t,e,i)=>{var n=i(31170),s=Math.max;t.exports=function(t,e,i){return e=s(void 0===e?t.length-1:e,0),function(){for(var r=arguments,a=-1,o=s(r.length-e,0),l=Array(o);++a<o;)l[a]=r[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=r[a];return c[e]=i(l),n(t,this,c)}}},55647:(t,e,i)=>{var n=i(33279),s=i(55636),r=i(46350);t.exports=function(t,e){return r(s(t,e,n),t+"")}},55906:t=>{t.exports=function(t){return function(e,i,n){for(var s=-1,r=Object(e),a=n(e),o=a.length;o--;){var l=a[t?o:++s];if(!1===i(r[l],l,r))break}return e}}},56173:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},56326:(t,e,i)=>{var n=i(48895),s=i(85990),r=i(69621),a=i(57828),o=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)n(e,r(t)),t=s(t);return e}:a;t.exports=o},56552:(t,e,i)=>{var n=i(37105),s="object"==typeof self&&self&&self.Object===Object&&self,r=n||s||Function("return this")();t.exports=r},56760:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"}},56832:(t,e,i)=>{t=i.nmd(t);var n=i(37105),s=e&&!e.nodeType&&e,r=s&&t&&!t.nodeType&&t,a=r&&r.exports===s&&n.process,o=function(){try{var t=r&&r.require&&r.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(e){}}();t.exports=o},56874:(t,e,i)=>{var n=i(12622);t.exports=function(t,e){var i=n(this,t),s=i.size;return i.set(t,e),this.size+=i.size==s?0:1,this}},57828:t=>{t.exports=function(){return[]}},57887:(t,e,i)=>{var n=i(5791),s=i(47574),r=i(56832),a=r&&r.isMap,o=a?s(a):n;t.exports=o},58122:(t,e,i)=>{var n=i(46686),s=i(36140),r=i(43516),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return r(t);var e=s(t),i=[];for(var o in t)("constructor"!=o||!e&&a.call(t,o))&&i.push(o);return i}},58387:(t,e,i)=>{"use strict";function n(t){var e,i,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(i=n(t[e]))&&(s&&(s+=" "),s+=i)}else for(i in t)t[i]&&(s&&(s+=" "),s+=i);return s}function s(){for(var t,e,i=0,s="",r=arguments.length;i<r;i++)(t=arguments[i])&&(e=n(t))&&(s&&(s+=" "),s+=e);return s}i.d(e,{$:()=>s,A:()=>r});const r=s},59395:(t,e,i)=>{var n=i(4262),s=i(69621),r=i(28673);t.exports=function(t){return n(t,r,s)}},60014:t=>{t.exports=function(){return!1}},60929:(t,e,i)=>{var n=i(93211),s=i(6571),r=i(69194),a=i(46686);t.exports=function(t,e,i){if(!a(i))return!1;var o=typeof e;return!!("number"==o?s(i)&&r(e,i.length):"string"==o&&e in i)&&n(i[e],t)}},61141:(t,e,i)=>{var n=i(10143),s=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(s,""):t}},61143:(t,e,i)=>{var n=i(13028)(Object.keys,Object);t.exports=n},61340:(t,e,i)=>{var n=i(93211);t.exports=function(t,e){for(var i=t.length;i--;)if(n(t[i][0],e))return i;return-1}},61516:(t,e,i)=>{var n=i(22929);t.exports=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}},61714:(t,e,i)=>{var n=i(61340);t.exports=function(t,e){var i=this.__data__,s=n(i,t);return s<0?(++this.size,i.push([t,e])):i[s][1]=e,this}},62597:(t,e,i)=>{var n=i(54052),s=i(19841),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!s(t))||(a.test(t)||!r.test(t)||null!=e&&t in Object(e))}},63868:(t,e,i)=>{var n=i(71775),s=i(93211);t.exports=function(t,e,i){(void 0!==i&&!s(t[e],i)||void 0===i&&!(e in t))&&n(t,e,i)}},64467:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(20816);function s(t,e,i){return(e=(0,n.A)(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}},64816:(t,e,i)=>{var n=i(47251),s=i(37159),r=i(80438),a=i(69394),o=i(56874);function l(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,t.exports=l},65387:(t,e,i)=>{var n=i(87937)(i(56552),"Promise");t.exports=n},68592:(t,e,i)=>{var n=i(4262),s=i(56326),r=i(30474);t.exports=function(t){return n(t,r,s)}},69194:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,i){var n=typeof t;return!!(i=null==i?9007199254740991:i)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<i}},69394:(t,e,i)=>{var n=i(12622);t.exports=function(t){return n(this,t).has(t)}},69621:(t,e,i)=>{var n=i(17529),s=i(57828),r=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,o=a?function(t){return null==t?[]:(t=Object(t),n(a(t),function(e){return r.call(t,e)}))}:s;t.exports=o},70579:(t,e,i)=>{"use strict";t.exports=i(51153)},70705:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},70914:(t,e,i)=>{var n=i(19841);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},71360:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"}},71775:(t,e,i)=>{var n=i(5654);t.exports=function(t,e,i){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}},72070:(t,e,i)=>{var n=i(87937)(i(56552),"Set");t.exports=n},72154:(t,e,i)=>{var n=i(95575),s=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return s.call(e,t)?e[t]:void 0}},73204:(t,e,i)=>{var n=i(3343),s=i(22777),r=i(54052),a=i(44543),o=i(69194),l=i(51268),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var i=r(t),h=!i&&s(t),d=!i&&!h&&a(t),u=!i&&!h&&!d&&l(t),p=i||h||d||u,f=p?n(t.length,String):[],g=f.length;for(var A in t)!e&&!c.call(t,A)||p&&("length"==A||d&&("offset"==A||"parent"==A)||u&&("buffer"==A||"byteLength"==A||"byteOffset"==A)||o(A,g))||f.push(A);return f}},74065:t=>{t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},76272:(t,e,i)=>{var n=i(6571),s=i(22761);t.exports=function(t){return s(t)&&n(t)}},76788:(t,e,i)=>{var n=i(97160),s=i(85204),r=i(64816);t.exports=function(t,e){var i=this.__data__;if(i instanceof n){var a=i.__data__;if(!s||a.length<199)return a.push([t,e]),this.size=++i.size,this;i=this.__data__=new r(a)}return i.set(t,e),this.size=i.size,this}},77116:(t,e,i)=>{var n=i(9812),s=i(22777),r=i(54052),a=n?n.isConcatSpreadable:void 0;t.exports=function(t){return r(t)||s(t)||!!(a&&t&&t[a])}},78420:(t,e,i)=>{var n=i(71775),s=i(93211),r=Object.prototype.hasOwnProperty;t.exports=function(t,e,i){var a=t[e];r.call(t,e)&&s(a,i)&&(void 0!==i||e in t)||n(t,e,i)}},79889:(t,e,i)=>{var n=i(93950),s=i(46686);t.exports=function(t,e,i){var r=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(i)&&(r="leading"in i?!!i.leading:r,a="trailing"in i?!!i.trailing:a),n(t,e,{leading:r,maxWait:e,trailing:a})}},80111:(t,e,i)=>{var n=i(41069),s=0;t.exports=function(t){var e=++s;return n(t)+e}},80438:(t,e,i)=>{var n=i(12622);t.exports=function(t){return n(this,t).get(t)}},80726:t=>{t.exports=function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t}},80755:(t,e,i)=>{var n=i(48895),s=i(77116);t.exports=function t(e,i,r,a,o){var l=-1,c=e.length;for(r||(r=s),o||(o=[]);++l<c;){var h=e[l];i>0&&r(h)?i>1?t(h,i-1,r,a,o):n(o,h):a||(o[o.length]=h)}return o}},82211:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"}},82284:(t,e,i)=>{"use strict";function n(t){return n="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},n(t)}i.d(e,{A:()=>n})},83223:(t,e,i)=>{var n=i(63868),s=i(44353),r=i(38710),a=i(91980),o=i(20310),l=i(22777),c=i(54052),h=i(76272),d=i(44543),u=i(11629),p=i(46686),f=i(12322),g=i(51268),A=i(53737),m=i(91609);t.exports=function(t,e,i,v,b,w,y){var _=A(t,i),x=A(e,i),E=y.get(x);if(E)n(t,i,E);else{var k=w?w(_,x,i+"",t,e,y):void 0,C=void 0===k;if(C){var S=c(x),M=!S&&d(x),L=!S&&!M&&g(x);k=x,S||M||L?c(_)?k=_:h(_)?k=a(_):M?(C=!1,k=s(x,!0)):L?(C=!1,k=r(x,!0)):k=[]:f(x)||l(x)?(k=_,l(_)?k=m(_):p(_)&&!u(_)||(k=o(x))):C=!1}C&&(y.set(x,k),b(k,x,v,w,y),y.delete(x)),n(t,i,k)}}},83713:(t,e,i)=>{var n=i(36140),s=i(61143),r=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return s(t);var e=[];for(var i in Object(t))r.call(t,i)&&"constructor"!=i&&e.push(i);return e}},84545:(t,e,i)=>{var n=i(97160);t.exports=function(){this.__data__=new n,this.size=0}},84570:(t,e,i)=>{var n=i(55647),s=i(60929);t.exports=function(t){return n(function(e,i){var n=-1,r=i.length,a=r>1?i[r-1]:void 0,o=r>2?i[2]:void 0;for(a=t.length>3&&"function"==typeof a?(r--,a):void 0,o&&s(i[0],i[1],o)&&(a=r<3?void 0:a,r=1),e=Object(e);++n<r;){var l=i[n];l&&t(e,l,n,a)}return e})}},85204:(t,e,i)=>{var n=i(87937)(i(56552),"Map");t.exports=n},85990:(t,e,i)=>{var n=i(13028)(Object.getPrototypeOf,Object);t.exports=n},86578:t=>{var e=Date.now;t.exports=function(t){var i=0,n=0;return function(){var s=e(),r=16-(s-n);if(n=s,r>0){if(++i>=800)return arguments[0]}else i=0;return t.apply(void 0,arguments)}}},87563:t=>{t.exports=function(){this.__data__=[],this.size=0}},87937:(t,e,i)=>{var n=i(36954),s=i(14657);t.exports=function(t,e){var i=s(t,e);return n(i)?i:void 0}},88140:(t,e,i)=>{var n=i(35324),s=i(74065),r=i(21676),a=i(70914);t.exports=function(t,e){return e=n(e,t),null==(t=r(t,e))||delete t[a(s(e))]}},88259:(t,e,i)=>{var n=i(15797);t.exports=function(t){var e=n(t,function(t){return 500===i.size&&i.clear(),t}),i=e.cache;return e}},89379:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(64467);function s(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function r(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach(function(e){(0,n.A)(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}},91609:(t,e,i)=>{var n=i(96614),s=i(30474);t.exports=function(t){return n(t,s(t))}},91980:t=>{t.exports=function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e}},93141:function(t,e,i){var n;"undefined"!=typeof self&&self,t.exports=(n=i(73884),function(){"use strict";var t={155:function(t){t.exports=n}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,i),r.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{useReactToPrint:function(){return g}});var r=i(155);const a="printWindow";function o(t){let{level:e="error",messages:i,suppressErrors:n=!1}=t;n||("error"===e?console.error(i):"warning"===e?console.warn(i):console.debug(i))}function l(t,e){if(e||!t){const t=document.getElementById(a);t&&document.body.removeChild(t)}}function c(t){return t instanceof Error?t:new Error("Unknown Error")}function h(t,e){const{documentTitle:i,onAfterPrint:n,onPrintError:s,preserveAfterPrint:r,print:a,suppressErrors:h}=e;setTimeout(()=>{var e,d;if(t.contentWindow){function u(){null==n||n(),l(r)}if(t.contentWindow.focus(),a)a(t).then(u).catch(t=>{s?s("print",c(t)):o({messages:["An error was thrown by the specified `print` function"],suppressErrors:h})});else{if(t.contentWindow.print){const p=null!==(d=null===(e=t.contentDocument)||void 0===e?void 0:e.title)&&void 0!==d?d:"",f=t.ownerDocument.title;i&&(t.ownerDocument.title=i,t.contentDocument&&(t.contentDocument.title=i)),t.contentWindow.print(),i&&(t.ownerDocument.title=f,t.contentDocument&&(t.contentDocument.title=p))}else o({messages:["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."],suppressErrors:h});[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(t=>{var e,i;return(null!==(i=null!==(e=navigator.userAgent)&&void 0!==e?e:navigator.vendor)&&void 0!==i?i:"opera"in window&&window.opera).match(t)})?setTimeout(u,500):u()}}else o({messages:["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/MatthewHerbst/react-to-print/issues/"],suppressErrors:h})},500)}function d(t){const e=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null);let n=i.nextNode();for(;n;)e.push(n),n=i.nextNode();return e}function u(t,e,i){const n=d(t),s=d(e);if(n.length===s.length)for(let r=0;r<n.length;r++){const t=n[r],e=s[r],a=t.shadowRoot;if(null!==a){const t=e.attachShadow({mode:a.mode});t.innerHTML=a.innerHTML,u(a,t,i)}}else o({messages:["When cloning shadow root content, source and target elements have different size. `onBeforePrint` likely resolved too early.",t,e],suppressErrors:i})}const p='\n @page {\n /* Remove browser default header (title) and footer (url) */\n margin: 0;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n color-adjust: exact; /* Firefox. This is an older version of "print-color-adjust" */\n print-color-adjust: exact; /* Firefox/Safari */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n }\n }\n';function f(t,e,i,n){var s,r,a,l,d;const{contentNode:f,clonedContentNode:g,clonedImgNodes:A,clonedVideoNodes:m,numResourcesToLoad:v,originalCanvasNodes:b}=i,{bodyClass:w,fonts:y,ignoreGlobalStyles:_,pageStyle:x,nonce:E,suppressErrors:k,copyShadowRoots:C}=n;t.onload=null;const S=null!==(s=t.contentDocument)&&void 0!==s?s:null===(r=t.contentWindow)||void 0===r?void 0:r.document;if(S){const i=S.body.appendChild(g);C&&u(f,i,!!k),y&&((null===(a=t.contentDocument)||void 0===a?void 0:a.fonts)&&(null===(l=t.contentWindow)||void 0===l?void 0:l.FontFace)?y.forEach(i=>{const n=new FontFace(i.family,i.source,{weight:i.weight,style:i.style});t.contentDocument.fonts.add(n),n.loaded.then(()=>{e(n)}).catch(t=>{e(n,["Failed loading the font:",n,"Load error:",c(t)])})}):(y.forEach(t=>{e(t)}),o({messages:['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'],suppressErrors:k})));const n=null!=x?x:p,s=S.createElement("style");E&&(s.setAttribute("nonce",E),S.head.setAttribute("nonce",E)),s.appendChild(S.createTextNode(n)),S.head.appendChild(s),w&&S.body.classList.add(...w.split(" "));const r=S.querySelectorAll("canvas");for(let t=0;t<b.length;++t){const e=b[t],i=r[t];if(void 0===i){o({messages:["A canvas element could not be copied for printing, has it loaded? `onBeforePrint` likely resolved too early.",e],suppressErrors:k});continue}const n=i.getContext("2d");n&&n.drawImage(e,0,0)}for(let t=0;t<A.length;t++){const i=A[t],n=i.getAttribute("src");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,n,s,r,a)=>{e(i,["Error loading <img>",i,"Error",a])},t.src=n}else e(i,['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it.',i])}for(let t=0;t<m.length;t++){const i=m[t];i.preload="auto";const n=i.getAttribute("poster");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,s,r,a,o)=>{e(i,["Error loading video poster",n,"for video",i,"Error:",o])},t.src=n}else i.readyState>=2?e(i):i.src?(i.onloadeddata=()=>{e(i)},i.onerror=(t,n,s,r,a)=>{e(i,["Error loading video",i,"Error",a])},i.onstalled=()=>{e(i,["Loading video stalled, skipping",i])}):e(i,["Error loading video, `src` is empty",i])}const h="select",v=f.querySelectorAll(h),M=S.querySelectorAll(h);for(let t=0;t<v.length;t++)M[t].value=v[t].value;if(!_){const i=document.querySelectorAll("style, link[rel~='stylesheet'], link[as='style']");for(let n=0,s=i.length;n<s;++n){const s=i[n];if("style"===s.tagName.toLowerCase()){const e=S.createElement(s.tagName),i=s.sheet;if(i){let r="";try{const t=i.cssRules.length;for(let e=0;e<t;++e)"string"==typeof i.cssRules[e].cssText&&(r+="".concat(i.cssRules[e].cssText,"\r\n"))}catch(t){o({messages:["A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/MatthewHerbst/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",s,"Original error: ".concat(c(t).message)],level:"warning"})}e.setAttribute("id","react-to-print-".concat(n)),E&&e.setAttribute("nonce",E),e.appendChild(S.createTextNode(r)),S.head.appendChild(e)}}else if(s.getAttribute("href"))if(s.hasAttribute("disabled"))o({messages:["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",s],level:"warning"}),e(s);else{const t=S.createElement(s.tagName);for(let e=0,i=s.attributes.length;e<i;++e){const i=s.attributes[e];i&&t.setAttribute(i.nodeName,null!==(d=i.nodeValue)&&void 0!==d?d:"")}t.onload=()=>{e(t)},t.onerror=(i,n,s,r,a)=>{e(t,["Failed to load",t,"Error:",a])},E&&t.setAttribute("nonce",E),S.head.appendChild(t)}else o({messages:["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",s],level:"warning"}),e(s)}}}0===v&&h(t,n)}function g(t){let{bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:g,onBeforePrint:A,onPrintError:m,pageStyle:v,preserveAfterPrint:b,print:w,printIframeProps:y,suppressErrors:_}=t;const x=(0,r.useCallback)(t=>{function r(){const r={bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:g,onBeforePrint:A,onPrintError:m,pageStyle:v,preserveAfterPrint:b,print:w,printIframeProps:y,suppressErrors:_},l=function(t){const e=document.createElement("iframe");return e.width="".concat(document.documentElement.clientWidth,"px"),e.height="".concat(document.documentElement.clientHeight,"px"),e.style.position="absolute",e.style.top="-".concat(document.documentElement.clientHeight+100,"px"),e.style.left="-".concat(document.documentElement.clientWidth+100,"px"),e.id=a,e.srcdoc="<!DOCTYPE html>",t&&(t.allow&&(e.allow=t.allow),void 0!==t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),void 0!==t.sandbox&&(e.sandbox=t.sandbox)),e}(y),c=function(t,e){const{contentRef:i,fonts:n,ignoreGlobalStyles:s,suppressErrors:r}=e,a=function(t){let{contentRef:e,optionalContent:i,suppressErrors:n}=t;return i&&"function"==typeof i?(e&&o({level:"warning",messages:['"react-to-print" received a `contentRef` option and an optional-content param passed to its callback. The `contentRef` option will be ignored.']}),i()):e?e.current:void o({messages:['"react-to-print" did not receive a `contentRef` option or a optional-content param pass to its callback.'],suppressErrors:n})}({contentRef:i,optionalContent:t,suppressErrors:r});if(!a)return;const l=a.cloneNode(!0),c=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),h=l.querySelectorAll("img"),d=l.querySelectorAll("video"),u=n?n.length:0;return{contentNode:a,clonedContentNode:l,clonedImgNodes:h,clonedVideoNodes:d,numResourcesToLoad:(s?0:c.length)+h.length+d.length+u,originalCanvasNodes:a.querySelectorAll("canvas")}}(t,r);if(!c)return void o({messages:["There is nothing to print"],suppressErrors:_});const x=function(t,e,i){const{suppressErrors:n}=t,s=[],r=[];return function(a,l){s.includes(a)?o({level:"debug",messages:["Tried to mark a resource that has already been handled",a],suppressErrors:n}):(l?(o({messages:['"react-to-print" was unable to load a resource but will continue attempting to print the page',...l],suppressErrors:n}),r.push(a)):s.push(a),s.length+r.length===e&&h(i,t))}}(r,c.numResourcesToLoad,l);!function(t,e,i,n){t.onload=()=>{f(t,e,i,n)},document.body.appendChild(t)}(l,x,c,r)}l(b,!0),A?A().then(()=>{r()}).catch(t=>{null==m||m("onBeforePrint",c(t))}):r()},[e,i,n,s,d,u,p,g,A,m,v,b,w,_]);return x}return s}())},93211:t=>{t.exports=function(t,e){return t===e||t!==t&&e!==e}},93950:(t,e,i)=>{var n=i(46686),s=i(4757),r=i(40801),a=Math.max,o=Math.min;t.exports=function(t,e,i){var l,c,h,d,u,p,f=0,g=!1,A=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function v(e){var i=l,n=c;return l=c=void 0,f=e,d=t.apply(n,i)}function b(t){var i=t-p;return void 0===p||i>=e||i<0||A&&t-f>=h}function w(){var t=s();if(b(t))return y(t);u=setTimeout(w,function(t){var i=e-(t-p);return A?o(i,h-(t-f)):i}(t))}function y(t){return u=void 0,m&&l?v(t):(l=c=void 0,d)}function _(){var t=s(),i=b(t);if(l=arguments,c=this,p=t,i){if(void 0===u)return function(t){return f=t,u=setTimeout(w,e),g?v(t):d}(p);if(A)return clearTimeout(u),u=setTimeout(w,e),v(p)}return void 0===u&&(u=setTimeout(w,e)),d}return e=r(e)||0,n(i)&&(g=!!i.leading,h=(A="maxWait"in i)?a(r(i.maxWait)||0,e):h,m="trailing"in i?!!i.trailing:m),_.cancel=function(){void 0!==u&&clearTimeout(u),f=0,l=p=c=u=void 0},_.flush=function(){return void 0===u?d:y(s())},_}},94258:(t,e,i)=>{var n=i(55906)();t.exports=n},95575:(t,e,i)=>{var n=i(87937)(Object,"create");t.exports=n},96440:t=>{"use strict";var e=function(){};t.exports=e},96614:(t,e,i)=>{var n=i(78420),s=i(71775);t.exports=function(t,e,i,r){var a=!i;i||(i={});for(var o=-1,l=e.length;++o<l;){var c=e[o],h=r?r(i[c],t[c],c,i,t):void 0;void 0===h&&(h=t[c]),a?s(i,c,h):n(i,c,h)}return i}},96761:(t,e,i)=>{var n=i(12322);t.exports=function(t){return n(t)?void 0:t}},96996:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(i){}try{return t+""}catch(i){}}return""}},97132:(t,e,i)=>{var n=i(5538),s=i(80726),r=i(78420),a=i(51104),o=i(55119),l=i(44353),c=i(91980),h=i(98124),d=i(29075),u=i(59395),p=i(68592),f=i(26924),g=i(38268),A=i(18630),m=i(20310),v=i(54052),b=i(44543),w=i(57887),y=i(46686),_=i(45921),x=i(28673),E=i(30474),k="[object Arguments]",C="[object Function]",S="[object Object]",M={};M[k]=M["[object Array]"]=M["[object ArrayBuffer]"]=M["[object DataView]"]=M["[object Boolean]"]=M["[object Date]"]=M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Map]"]=M["[object Number]"]=M[S]=M["[object RegExp]"]=M["[object Set]"]=M["[object String]"]=M["[object Symbol]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M["[object Error]"]=M[C]=M["[object WeakMap]"]=!1,t.exports=function t(e,i,L,T,R,P){var F,I=1&i,D=2&i,O=4&i;if(L&&(F=R?L(e,T,R,P):L(e)),void 0!==F)return F;if(!y(e))return e;var N=v(e);if(N){if(F=g(e),!I)return c(e,F)}else{var W=f(e),j=W==C||"[object GeneratorFunction]"==W;if(b(e))return l(e,I);if(W==S||W==k||j&&!R){if(F=D||j?{}:m(e),!I)return D?d(e,o(F,e)):h(e,a(F,e))}else{if(!M[W])return R?e:{};F=A(e,W,I)}}P||(P=new n);var B=P.get(e);if(B)return B;P.set(e,F),_(e)?e.forEach(function(n){F.add(t(n,i,L,n,e,P))}):w(e)&&e.forEach(function(n,s){F.set(s,t(n,i,L,s,e,P))});var H=N?void 0:(O?D?p:u:D?E:x)(e);return s(H||e,function(n,s){H&&(n=e[s=n]),r(F,s,t(n,i,L,s,e,P))}),F}},97160:(t,e,i)=>{var n=i(87563),s=i(29935),r=i(24190),a=i(51946),o=i(61714);function l(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,t.exports=l},97685:(t,e,i)=>{var n=i(87937)(i(56552),"DataView");t.exports=n},98124:(t,e,i)=>{var n=i(96614),s=i(69621);t.exports=function(t,e){return n(t,s(t),e)}},98724:(t,e,i)=>{var n=i(27615),s=i(25051),r=i(72154),a=i(48734),o=i(22662);function l(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,t.exports=l}}]);
|
|
3
|
-
//# sourceMappingURL=8970.4a7ef88e.chunk.js.map
|