ngx-extended-pdf-viewer 19.2.1 → 19.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/bleeding-edge/{pdf-4.1.612-es5.min.mjs → pdf-4.1.656-es5.min.mjs} +1 -1
  2. package/bleeding-edge/{pdf-4.1.612-es5.mjs → pdf-4.1.656-es5.mjs} +2 -2
  3. package/bleeding-edge/{pdf-4.1.612.min.mjs → pdf-4.1.656.min.mjs} +1 -1
  4. package/bleeding-edge/{pdf-4.1.612.mjs → pdf-4.1.656.mjs} +6 -6
  5. package/bleeding-edge/{pdf.sandbox-4.1.612-es5.min.mjs → pdf.sandbox-4.1.656-es5.min.mjs} +1 -1
  6. package/bleeding-edge/{pdf.sandbox-4.1.612-es5.mjs → pdf.sandbox-4.1.656-es5.mjs} +1 -1
  7. package/bleeding-edge/{pdf.sandbox-4.1.612.min.mjs → pdf.sandbox-4.1.656.min.mjs} +1 -1
  8. package/bleeding-edge/{pdf.sandbox-4.1.612.mjs → pdf.sandbox-4.1.656.mjs} +3 -3
  9. package/bleeding-edge/{pdf.worker-4.1.612-es5.min.mjs → pdf.worker-4.1.656-es5.min.mjs} +1 -1
  10. package/bleeding-edge/{pdf.worker-4.1.612-es5.mjs → pdf.worker-4.1.656-es5.mjs} +3 -3
  11. package/bleeding-edge/{pdf.worker-4.1.612.min.mjs → pdf.worker-4.1.656.min.mjs} +1 -1
  12. package/bleeding-edge/{pdf.worker-4.1.612.mjs → pdf.worker-4.1.656.mjs} +7 -3
  13. package/bleeding-edge/{viewer-4.1.612-es5.min.mjs → viewer-4.1.656-es5.min.mjs} +1 -1
  14. package/bleeding-edge/{viewer-4.1.612-es5.mjs → viewer-4.1.656-es5.mjs} +4 -4
  15. package/bleeding-edge/{viewer-4.1.612.min.mjs → viewer-4.1.656.min.mjs} +1 -1
  16. package/bleeding-edge/{viewer-4.1.612.mjs → viewer-4.1.656.mjs} +5 -5
  17. package/changelog.md +1 -0
  18. package/esm2022/lib/dynamic-css/dynamic-css.component.mjs +3 -3
  19. package/esm2022/lib/ngx-extended-pdf-viewer.component.mjs +3 -3
  20. package/esm2022/lib/ngx-extended-pdf-viewer.module.mjs +4 -4
  21. package/esm2022/lib/options/pdf-default-options.mjs +2 -2
  22. package/esm2022/lib/pdf-dialog/pdf-alt-text-dialog/pdf-alt-text-dialog.component.mjs +3 -3
  23. package/esm2022/lib/pdf-dialog/pdf-document-properties-dialog/pdf-document-properties-dialog.component.mjs +3 -3
  24. package/esm2022/lib/pdf-dialog/pdf-error-message/pdf-error-message.component.mjs +3 -3
  25. package/esm2022/lib/pdf-dialog/pdf-password-dialog/pdf-password-dialog.component.mjs +3 -3
  26. package/esm2022/lib/pdf-dialog/pdf-prepare-printing-dialog/pdf-prepare-printing-dialog.component.mjs +3 -3
  27. package/esm2022/lib/pdf-dummy-components/pdf-dummy-components.component.mjs +3 -3
  28. package/esm2022/lib/pdf-notification-service.mjs +3 -3
  29. package/esm2022/lib/responsive-visibility.mjs +6 -6
  30. package/esm2022/lib/secondary-toolbar/pdf-secondary-toolbar/pdf-secondary-toolbar.component.mjs +3 -3
  31. package/esm2022/lib/sidebar/pdf-sidebar/pdf-sidebar-content/pdf-sidebar-content.component.mjs +3 -3
  32. package/esm2022/lib/sidebar/pdf-sidebar/pdf-sidebar-toolbar/pdf-sidebar-toolbar.component.mjs +3 -3
  33. package/esm2022/lib/sidebar/pdf-sidebar/pdf-sidebar.component.mjs +3 -3
  34. package/esm2022/lib/theme/acroform-default-theme/pdf-acroform-default-theme.component.mjs +3 -3
  35. package/esm2022/lib/theme/pdf-dark-theme/pdf-dark-theme.component.mjs +3 -3
  36. package/esm2022/lib/theme/pdf-light-theme/pdf-light-theme.component.mjs +3 -3
  37. package/esm2022/lib/toolbar/pdf-book-mode/pdf-book-mode.component.mjs +3 -3
  38. package/esm2022/lib/toolbar/pdf-context-menu/pdf-context-menu.component.mjs +3 -3
  39. package/esm2022/lib/toolbar/pdf-document-properties/pdf-document-properties.component.mjs +3 -3
  40. package/esm2022/lib/toolbar/pdf-download/pdf-download.component.mjs +3 -3
  41. package/esm2022/lib/toolbar/pdf-draw-editor/pdf-draw-editor.component.mjs +3 -3
  42. package/esm2022/lib/toolbar/pdf-editor/pdf-editor.component.mjs +3 -3
  43. package/esm2022/lib/toolbar/pdf-even-spread/pdf-even-spread.component.mjs +3 -3
  44. package/esm2022/lib/toolbar/pdf-find-button/pdf-find-button.component.mjs +3 -3
  45. package/esm2022/lib/toolbar/pdf-findbar/pdf-find-input-area/pdf-find-input-area.component.mjs +3 -3
  46. package/esm2022/lib/toolbar/pdf-findbar/pdf-find-next/pdf-find-next.component.mjs +3 -3
  47. package/esm2022/lib/toolbar/pdf-findbar/pdf-find-previous/pdf-find-previous.component.mjs +3 -3
  48. package/esm2022/lib/toolbar/pdf-findbar/pdf-findbar-message-container/pdf-findbar-message-container.component.mjs +3 -3
  49. package/esm2022/lib/toolbar/pdf-findbar/pdf-findbar-options-one-container/pdf-find-highlight-all/pdf-find-highlight-all.component.mjs +3 -3
  50. package/esm2022/lib/toolbar/pdf-findbar/pdf-findbar-options-one-container/pdf-find-match-case/pdf-find-match-case.component.mjs +3 -3
  51. package/esm2022/lib/toolbar/pdf-findbar/pdf-findbar-options-three-container/pdf-find-results-count/pdf-find-results-count.component.mjs +3 -3
  52. package/esm2022/lib/toolbar/pdf-findbar/pdf-findbar-options-two-container/pdf-find-entire-word/pdf-find-entire-word.component.mjs +3 -3
  53. package/esm2022/lib/toolbar/pdf-findbar/pdf-findbar-options-two-container/pdf-match-diacritics/pdf-match-diacritics.component.mjs +3 -3
  54. package/esm2022/lib/toolbar/pdf-findbar/pdf-findbar.component.mjs +3 -3
  55. package/esm2022/lib/toolbar/pdf-findbar/pdf-search-input-field/pdf-search-input-field.component.mjs +3 -3
  56. package/esm2022/lib/toolbar/pdf-hand-tool/pdf-hand-tool.component.mjs +3 -3
  57. package/esm2022/lib/toolbar/pdf-highlight-editor/pdf-highlight-editor.component.mjs +3 -3
  58. package/esm2022/lib/toolbar/pdf-horizontal-scroll/pdf-horizontal-scroll.component.mjs +3 -3
  59. package/esm2022/lib/toolbar/pdf-infinite-scroll/pdf-infinite-scroll.component.mjs +3 -3
  60. package/esm2022/lib/toolbar/pdf-no-spread/pdf-no-spread.component.mjs +3 -3
  61. package/esm2022/lib/toolbar/pdf-odd-spread/pdf-odd-spread.component.mjs +3 -3
  62. package/esm2022/lib/toolbar/pdf-open-file/pdf-open-file.component.mjs +3 -3
  63. package/esm2022/lib/toolbar/pdf-paging-area/pdf-first-page/pdf-first-page.component.mjs +3 -3
  64. package/esm2022/lib/toolbar/pdf-paging-area/pdf-last-page/pdf-last-page.component.mjs +3 -3
  65. package/esm2022/lib/toolbar/pdf-paging-area/pdf-next-page/pdf-next-page.component.mjs +3 -3
  66. package/esm2022/lib/toolbar/pdf-paging-area/pdf-page-number/pdf-page-number.component.mjs +3 -3
  67. package/esm2022/lib/toolbar/pdf-paging-area/pdf-paging-area.component.mjs +3 -3
  68. package/esm2022/lib/toolbar/pdf-paging-area/pdf-previous-page/pdf-previous-page.component.mjs +3 -3
  69. package/esm2022/lib/toolbar/pdf-presentation-mode/pdf-presentation-mode.component.mjs +3 -3
  70. package/esm2022/lib/toolbar/pdf-print/pdf-print.component.mjs +3 -3
  71. package/esm2022/lib/toolbar/pdf-rotate-page/pdf-rotate-page.component.mjs +3 -3
  72. package/esm2022/lib/toolbar/pdf-select-tool/pdf-select-tool.component.mjs +3 -3
  73. package/esm2022/lib/toolbar/pdf-shy-button/pdf-shy-button-service.mjs +3 -3
  74. package/esm2022/lib/toolbar/pdf-shy-button/pdf-shy-button.component.mjs +3 -3
  75. package/esm2022/lib/toolbar/pdf-single-page-mode/pdf-single-page-mode.component.mjs +3 -3
  76. package/esm2022/lib/toolbar/pdf-stamp-editor/pdf-stamp-editor.component.mjs +13 -6
  77. package/esm2022/lib/toolbar/pdf-text-editor/pdf-text-editor.component.mjs +3 -3
  78. package/esm2022/lib/toolbar/pdf-toggle-secondary-toolbar/pdf-toggle-secondary-toolbar.component.mjs +3 -3
  79. package/esm2022/lib/toolbar/pdf-toggle-sidebar/pdf-toggle-sidebar.component.mjs +3 -3
  80. package/esm2022/lib/toolbar/pdf-toolbar/pdf-toolbar.component.mjs +3 -3
  81. package/esm2022/lib/toolbar/pdf-vertical-scroll-button/pdf-vertical-scroll-mode.component.mjs +3 -3
  82. package/esm2022/lib/toolbar/pdf-wrapped-scroll-mode/pdf-wrapped-scroll-mode.component.mjs +3 -3
  83. package/esm2022/lib/toolbar/pdf-zoom-toolbar/pdf-zoom-dropdown/pdf-zoom-dropdown.component.mjs +3 -3
  84. package/esm2022/lib/toolbar/pdf-zoom-toolbar/pdf-zoom-in/pdf-zoom-in.component.mjs +3 -3
  85. package/esm2022/lib/toolbar/pdf-zoom-toolbar/pdf-zoom-out/pdf-zoom-out.component.mjs +3 -3
  86. package/esm2022/lib/toolbar/pdf-zoom-toolbar/pdf-zoom-toolbar.component.mjs +3 -3
  87. package/esm2022/lib/translate.pipe.mjs +3 -3
  88. package/fesm2022/ngx-extended-pdf-viewer.mjs +221 -214
  89. package/fesm2022/ngx-extended-pdf-viewer.mjs.map +1 -1
  90. package/lib/options/pdf-default-options.d.ts +1 -1
  91. package/package.json +1 -1
@@ -18,4 +18,4 @@
18
18
  *
19
19
  * @licend The above is the entire license notice for the
20
20
  * JavaScript code in this page
21
- */var t={509:(t,r,a)=>{var i=a(9985),o=a(3691),l=TypeError;t.exports=function(t){if(i(t))return t;throw new l(o(t)+" is not a function")}},2655:(t,r,a)=>{var i=a(9429),o=a(3691),l=TypeError;t.exports=function(t){if(i(t))return t;throw new l(o(t)+" is not a constructor")}},3550:(t,r,a)=>{var i=a(598),o=String,l=TypeError;t.exports=function(t){if(i(t))return t;throw new l("Can't set "+o(t)+" as a prototype")}},29:(t,r,a)=>{var i=a(1034).has;t.exports=function(t){i(t);return t}},7370:(t,r,a)=>{var i=a(4201),o=a(5391),l=a(2560).f,c=i("unscopables"),u=Array.prototype;void 0===u[c]&&l(u,c,{configurable:!0,value:o(null)});t.exports=function(t){u[c][t]=!0}},1514:(t,r,a)=>{var i=a(730).charAt;t.exports=function(t,r,a){return r+(a?i(t,r).length:1)}},767:(t,r,a)=>{var i=a(3622),o=TypeError;t.exports=function(t,r){if(i(r,t))return t;throw new o("Incorrect invocation")}},5027:(t,r,a)=>{var i=a(8999),o=String,l=TypeError;t.exports=function(t){if(i(t))return t;throw new l(o(t)+" is not an object")}},7075:t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},3050:(t,r,a)=>{var i=a(2743),o=a(6648),l=TypeError;t.exports=i(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==o(t))throw new l("ArrayBuffer expected");return t.byteLength}},2961:(t,r,a)=>{var i=a(8844),o=a(3050),l=i(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==o(t))return!1;try{l(t,0,0);return!1}catch(t){return!0}}},1655:(t,r,a)=>{var i=a(3689);t.exports=i((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},9195:(t,r,a)=>{var i=a(9037),o=a(8844),l=a(2743),c=a(9842),u=a(2961),h=a(3050),d=a(1420),p=a(3514),v=i.structuredClone,_=i.ArrayBuffer,y=i.DataView,g=i.TypeError,m=Math.min,b=_.prototype,w=y.prototype,P=o(b.slice),k=l(b,"resizable","get"),S=l(b,"maxByteLength","get"),A=o(w.getInt8),x=o(w.setInt8);t.exports=(p||d)&&function(t,r,a){var i,o=h(t),l=void 0===r?o:c(r),b=!k||!k(t);if(u(t))throw new g("ArrayBuffer is detached");if(p){t=v(t,{transfer:[t]});if(o===l&&(a||b))return t}if(o>=l&&(!a||b))i=P(t,0,l);else{var w=a&&!b&&S?{maxByteLength:S(t)}:void 0;i=new _(l,w);for(var E=new y(t),I=new y(i),T=m(l,o),C=0;C<T;C++)x(I,C,A(E,C))}p||d(t);return i}},4872:(t,r,a)=>{var i,o,l,c=a(7075),u=a(7697),h=a(9037),d=a(9985),p=a(8999),v=a(6812),_=a(926),y=a(3691),g=a(5773),m=a(1880),b=a(2148),w=a(3622),P=a(1868),k=a(9385),S=a(4201),A=a(4630),x=a(618),E=x.enforce,I=x.get,T=h.Int8Array,C=T&&T.prototype,M=h.Uint8ClampedArray,G=M&&M.prototype,O=T&&P(T),R=C&&P(C),L=Object.prototype,D=h.TypeError,j=S("toStringTag"),N=A("TYPED_ARRAY_TAG"),W="TypedArrayConstructor",H=c&&!!k&&"Opera"!==_(h.opera),B=!1,z={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var r=P(t);if(p(r)){var a=I(r);return a&&v(a,W)?a[W]:getTypedArrayConstructor(r)}},isTypedArray=function(t){if(!p(t))return!1;var r=_(t);return v(z,r)||v(U,r)};for(i in z)(l=(o=h[i])&&o.prototype)?E(l)[W]=o:H=!1;for(i in U)(l=(o=h[i])&&o.prototype)&&(E(l)[W]=o);if(!H||!d(O)||O===Function.prototype){O=function TypedArray(){throw new D("Incorrect invocation")};if(H)for(i in z)h[i]&&k(h[i],O)}if(!H||!R||R===L){R=O.prototype;if(H)for(i in z)h[i]&&k(h[i].prototype,R)}H&&P(G)!==R&&k(G,R);if(u&&!v(R,j)){B=!0;b(R,j,{configurable:!0,get:function(){return p(this)?this[N]:void 0}});for(i in z)h[i]&&g(h[i],N,i)}t.exports={NATIVE_ARRAY_BUFFER_VIEWS:H,TYPED_ARRAY_TAG:B&&N,aTypedArray:function(t){if(isTypedArray(t))return t;throw new D("Target is not a typed array")},aTypedArrayConstructor:function(t){if(d(t)&&(!k||w(O,t)))return t;throw new D(y(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,r,a,i){if(u){if(a)for(var o in z){var l=h[o];if(l&&v(l.prototype,t))try{delete l.prototype[t]}catch(a){try{l.prototype[t]=r}catch(t){}}}R[t]&&!a||m(R,t,a?r:H&&C[t]||r,i)}},exportTypedArrayStaticMethod:function(t,r,a){var i,o;if(u){if(k){if(a)for(i in z)if((o=h[i])&&v(o,t))try{delete o[t]}catch(t){}if(O[t]&&!a)return;try{return m(O,t,a?r:H&&O[t]||r)}catch(t){}}for(i in z)!(o=h[i])||o[t]&&!a||m(o,t,r)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(t){if(!p(t))return!1;var r=_(t);return"DataView"===r||v(z,r)||v(U,r)},isTypedArray:isTypedArray,TypedArray:O,TypedArrayPrototype:R}},3999:(t,r,a)=>{var i=a(9037),o=a(8844),l=a(7697),c=a(7075),u=a(1236),h=a(5773),d=a(2148),p=a(6045),v=a(3689),_=a(767),y=a(8700),g=a(3126),m=a(9842),b=a(7788),w=a(5477),P=a(1868),k=a(9385),S=a(2872),A=a(6004),x=a(3457),E=a(8758),I=a(5997),T=a(618),C=u.PROPER,M=u.CONFIGURABLE,G="ArrayBuffer",O="DataView",R="prototype",L="Wrong index",D=T.getterFor(G),j=T.getterFor(O),N=T.set,W=i[G],H=W,B=H&&H[R],z=i[O],U=z&&z[R],q=Object.prototype,V=i.Array,K=i.RangeError,Y=o(S),X=o([].reverse),$=w.pack,J=w.unpack,packInt8=function(t){return[255&t]},packInt16=function(t){return[255&t,t>>8&255]},packInt32=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},unpackInt32=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},packFloat32=function(t){return $(b(t),23,4)},packFloat64=function(t){return $(t,52,8)},addGetter=function(t,r,a){d(t[R],r,{configurable:!0,get:function(){return a(this)[r]}})},get=function(t,r,a,i){var o=j(t),l=m(a),c=!!i;if(l+r>o.byteLength)throw new K(L);var u=o.bytes,h=l+o.byteOffset,d=A(u,h,h+r);return c?d:X(d)},set=function(t,r,a,i,o,l){var c=j(t),u=m(a),h=i(+o),d=!!l;if(u+r>c.byteLength)throw new K(L);for(var p=c.bytes,v=u+c.byteOffset,_=0;_<r;_++)p[v+_]=h[d?_:r-_-1]};if(c){var Q=C&&W.name!==G;if(v((function(){W(1)}))&&v((function(){new W(-1)}))&&!v((function(){new W;new W(1.5);new W(NaN);return 1!==W.length||Q&&!M})))Q&&M&&h(W,"name",G);else{(H=function ArrayBuffer(t){_(this,B);return x(new W(m(t)),this,H)})[R]=B;B.constructor=H;E(H,W)}k&&P(U)!==q&&k(U,q);var Z=new z(new H(2)),ee=o(U.setInt8);Z.setInt8(0,2147483648);Z.setInt8(1,2147483649);!Z.getInt8(0)&&Z.getInt8(1)||p(U,{setInt8:function setInt8(t,r){ee(this,t,r<<24>>24)},setUint8:function setUint8(t,r){ee(this,t,r<<24>>24)}},{unsafe:!0})}else{B=(H=function ArrayBuffer(t){_(this,B);var r=m(t);N(this,{type:G,bytes:Y(V(r),0),byteLength:r});if(!l){this.byteLength=r;this.detached=!1}})[R];U=(z=function DataView(t,r,a){_(this,U);_(t,B);var i=D(t),o=i.byteLength,c=y(r);if(c<0||c>o)throw new K("Wrong offset");if(c+(a=void 0===a?o-c:g(a))>o)throw new K("Wrong length");N(this,{type:O,buffer:t,byteLength:a,byteOffset:c,bytes:i.bytes});if(!l){this.buffer=t;this.byteLength=a;this.byteOffset=c}})[R];if(l){addGetter(H,"byteLength",D);addGetter(z,"buffer",j);addGetter(z,"byteLength",j);addGetter(z,"byteOffset",j)}p(U,{getInt8:function getInt8(t){return get(this,1,t)[0]<<24>>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var r=get(this,2,t,arguments.length>1&&arguments[1]);return(r[1]<<8|r[0])<<16>>16},getUint16:function getUint16(t){var r=get(this,2,t,arguments.length>1&&arguments[1]);return r[1]<<8|r[0]},getInt32:function getInt32(t){return unpackInt32(get(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function getUint32(t){return unpackInt32(get(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function getFloat32(t){return J(get(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function getFloat64(t){return J(get(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function setInt8(t,r){set(this,1,t,packInt8,r)},setUint8:function setUint8(t,r){set(this,1,t,packInt8,r)},setInt16:function setInt16(t,r){set(this,2,t,packInt16,r,arguments.length>2&&arguments[2])},setUint16:function setUint16(t,r){set(this,2,t,packInt16,r,arguments.length>2&&arguments[2])},setInt32:function setInt32(t,r){set(this,4,t,packInt32,r,arguments.length>2&&arguments[2])},setUint32:function setUint32(t,r){set(this,4,t,packInt32,r,arguments.length>2&&arguments[2])},setFloat32:function setFloat32(t,r){set(this,4,t,packFloat32,r,arguments.length>2&&arguments[2])},setFloat64:function setFloat64(t,r){set(this,8,t,packFloat64,r,arguments.length>2&&arguments[2])}})}I(H,G);I(z,O);t.exports={ArrayBuffer:H,DataView:z}},357:(t,r,a)=>{var i=a(690),o=a(7578),l=a(6310),c=a(8494),u=Math.min;t.exports=[].copyWithin||function copyWithin(t,r){var a=i(this),h=l(a),d=o(t,h),p=o(r,h),v=arguments.length>2?arguments[2]:void 0,_=u((void 0===v?h:o(v,h))-p,h-d),y=1;if(p<d&&d<p+_){y=-1;p+=_-1;d+=_-1}for(;_-- >0;){p in a?a[d]=a[p]:c(a,d);d+=y;p+=y}return a}},2872:(t,r,a)=>{var i=a(690),o=a(7578),l=a(6310);t.exports=function fill(t){for(var r=i(this),a=l(r),c=arguments.length,u=o(c>1?arguments[1]:void 0,a),h=c>2?arguments[2]:void 0,d=void 0===h?a:o(h,a);d>u;)r[u++]=t;return r}},7612:(t,r,a)=>{var i=a(2960).forEach,o=a(6834)("forEach");t.exports=o?[].forEach:function forEach(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}},9976:(t,r,a)=>{var i=a(6310);t.exports=function(t,r,a){for(var o=0,l=arguments.length>2?a:i(r),c=new t(l);l>o;)c[o]=r[o++];return c}},1055:(t,r,a)=>{var i=a(4071),o=a(2615),l=a(690),c=a(1228),u=a(3292),h=a(9429),d=a(6310),p=a(6522),v=a(5185),_=a(1664),y=Array;t.exports=function from(t){var r=l(t),a=h(this),g=arguments.length,m=g>1?arguments[1]:void 0,b=void 0!==m;b&&(m=i(m,g>2?arguments[2]:void 0));var w,P,k,S,A,x,E=_(r),I=0;if(!E||this===y&&u(E)){w=d(r);P=a?new this(w):y(w);for(;w>I;I++){x=b?m(r[I],I):r[I];p(P,I,x)}}else{A=(S=v(r,E)).next;P=a?new this:[];for(;!(k=o(A,S)).done;I++){x=b?c(S,m,[k.value,I],!0):k.value;p(P,I,x)}}P.length=I;return P}},4328:(t,r,a)=>{var i=a(5290),o=a(7578),l=a(6310),createMethod=function(t){return function(r,a,c){var u,h=i(r),d=l(h),p=o(c,d);if(t&&a!=a){for(;d>p;)if((u=h[p++])!=u)return!0}else for(;d>p;p++)if((t||p in h)&&h[p]===a)return t||p||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},1969:(t,r,a)=>{var i=a(4071),o=a(4413),l=a(690),c=a(6310),createMethod=function(t){var r=1===t;return function(a,u,h){for(var d,p=l(a),v=o(p),_=c(v),y=i(u,h);_-- >0;)if(y(d=v[_],_,p))switch(t){case 0:return d;case 1:return _}return r?-1:void 0}};t.exports={findLast:createMethod(0),findLastIndex:createMethod(1)}},2960:(t,r,a)=>{var i=a(4071),o=a(8844),l=a(4413),c=a(690),u=a(6310),h=a(7120),d=o([].push),createMethod=function(t){var r=1===t,a=2===t,o=3===t,p=4===t,v=6===t,_=7===t,y=5===t||v;return function(g,m,b,w){for(var P,k,S=c(g),A=l(S),x=u(A),E=i(m,b),I=0,T=w||h,C=r?T(g,x):a||_?T(g,0):void 0;x>I;I++)if(y||I in A){k=E(P=A[I],I,S);if(t)if(r)C[I]=k;else if(k)switch(t){case 3:return!0;case 5:return P;case 6:return I;case 2:d(C,P)}else switch(t){case 4:return!1;case 7:d(C,P)}}return v?-1:o||p?p:C}};t.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6),filterReject:createMethod(7)}},953:(t,r,a)=>{var i=a(1735),o=a(5290),l=a(8700),c=a(6310),u=a(6834),h=Math.min,d=[].lastIndexOf,p=!!d&&1/[1].lastIndexOf(1,-0)<0,v=u("lastIndexOf"),_=p||!v;t.exports=_?function lastIndexOf(t){if(p)return i(d,this,arguments)||0;var r=o(this),a=c(r),u=a-1;arguments.length>1&&(u=h(u,l(arguments[1])));u<0&&(u=a+u);for(;u>=0;u--)if(u in r&&r[u]===t)return u||0;return-1}:d},9042:(t,r,a)=>{var i=a(3689),o=a(4201),l=a(3615),c=o("species");t.exports=function(t){return l>=51||!i((function(){var r=[];(r.constructor={})[c]=function(){return{foo:1}};return 1!==r[t](Boolean).foo}))}},6834:(t,r,a)=>{var i=a(3689);t.exports=function(t,r){var a=[][t];return!!a&&i((function(){a.call(null,r||function(){return 1},1)}))}},8820:(t,r,a)=>{var i=a(509),o=a(690),l=a(4413),c=a(6310),u=TypeError,createMethod=function(t){return function(r,a,h,d){var p=o(r),v=l(p),_=c(p);i(a);var y=t?_-1:0,g=t?-1:1;if(h<2)for(;;){if(y in v){d=v[y];y+=g;break}y+=g;if(t?y<0:_<=y)throw new u("Reduce of empty array with no initial value")}for(;t?y>=0:_>y;y+=g)y in v&&(d=a(d,v[y],y,p));return d}};t.exports={left:createMethod(!1),right:createMethod(!0)}},5649:(t,r,a)=>{var i=a(7697),o=a(2297),l=TypeError,c=Object.getOwnPropertyDescriptor,u=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=u?function(t,r){if(o(t)&&!c(t,"length").writable)throw new l("Cannot set read only .length");return t.length=r}:function(t,r){return t.length=r}},6004:(t,r,a)=>{var i=a(8844);t.exports=i([].slice)},382:(t,r,a)=>{var i=a(6004),o=Math.floor,sort=function(t,r){var a=t.length;if(a<8)for(var l,c,u=1;u<a;){c=u;l=t[u];for(;c&&r(t[c-1],l)>0;)t[c]=t[--c];c!==u++&&(t[c]=l)}else for(var h=o(a/2),d=sort(i(t,0,h),r),p=sort(i(t,h),r),v=d.length,_=p.length,y=0,g=0;y<v||g<_;)t[y+g]=y<v&&g<_?r(d[y],p[g])<=0?d[y++]:p[g++]:y<v?d[y++]:p[g++];return t};t.exports=sort},5271:(t,r,a)=>{var i=a(2297),o=a(9429),l=a(8999),c=a(4201)("species"),u=Array;t.exports=function(t){var r;if(i(t)){r=t.constructor;(o(r)&&(r===u||i(r.prototype))||l(r)&&null===(r=r[c]))&&(r=void 0)}return void 0===r?u:r}},7120:(t,r,a)=>{var i=a(5271);t.exports=function(t,r){return new(i(t))(0===r?0:r)}},6166:(t,r,a)=>{var i=a(6310);t.exports=function(t,r){for(var a=i(t),o=new r(a),l=0;l<a;l++)o[l]=t[a-l-1];return o}},6134:(t,r,a)=>{var i=a(6310),o=a(8700),l=RangeError;t.exports=function(t,r,a,c){var u=i(t),h=o(a),d=h<0?u+h:h;if(d>=u||d<0)throw new l("Incorrect index");for(var p=new r(u),v=0;v<u;v++)p[v]=v===d?c:t[v];return p}},1228:(t,r,a)=>{var i=a(5027),o=a(2125);t.exports=function(t,r,a,l){try{return l?r(i(a)[0],a[1]):r(a)}catch(r){o(t,"throw",r)}}},6431:(t,r,a)=>{var i=a(4201)("iterator"),o=!1;try{var l=0,c={next:function(){return{done:!!l++}},return:function(){o=!0}};c[i]=function(){return this};Array.from(c,(function(){throw 2}))}catch(t){}t.exports=function(t,r){try{if(!r&&!o)return!1}catch(t){return!1}var a=!1;try{var l={};l[i]=function(){return{next:function(){return{done:a=!0}}}};t(l)}catch(t){}return a}},6648:(t,r,a)=>{var i=a(8844),o=i({}.toString),l=i("".slice);t.exports=function(t){return l(o(t),8,-1)}},926:(t,r,a)=>{var i=a(3043),o=a(9985),l=a(6648),c=a(4201)("toStringTag"),u=Object,h="Arguments"===l(function(){return arguments}());t.exports=i?l:function(t){var r,a,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(a=function(t,r){try{return t[r]}catch(t){}}(r=u(t),c))?a:h?l(r):"Object"===(i=l(r))&&o(r.callee)?"Arguments":i}},800:(t,r,a)=>{var i=a(5391),o=a(2148),l=a(6045),c=a(4071),u=a(767),h=a(981),d=a(8734),p=a(1934),v=a(7807),_=a(4241),y=a(7697),g=a(5375).fastKey,m=a(618),b=m.set,w=m.getterFor;t.exports={getConstructor:function(t,r,a,p){var v=t((function(t,o){u(t,_);b(t,{type:r,index:i(null),first:void 0,last:void 0,size:0});y||(t.size=0);h(o)||d(o,t[p],{that:t,AS_ENTRIES:a})})),_=v.prototype,m=w(r),define=function(t,r,a){var i,o,l=m(t),c=getEntry(t,r);if(c)c.value=a;else{l.last=c={index:o=g(r,!0),key:r,value:a,previous:i=l.last,next:void 0,removed:!1};l.first||(l.first=c);i&&(i.next=c);y?l.size++:t.size++;"F"!==o&&(l.index[o]=c)}return t},getEntry=function(t,r){var a,i=m(t),o=g(r);if("F"!==o)return i.index[o];for(a=i.first;a;a=a.next)if(a.key===r)return a};l(_,{clear:function clear(){for(var t=m(this),r=t.first;r;){r.removed=!0;r.previous&&(r.previous=r.previous.next=void 0);r=r.next}t.first=t.last=void 0;t.index=i(null);y?t.size=0:this.size=0},delete:function(t){var r=this,a=m(r),i=getEntry(r,t);if(i){var o=i.next,l=i.previous;delete a.index[i.index];i.removed=!0;l&&(l.next=o);o&&(o.previous=l);a.first===i&&(a.first=o);a.last===i&&(a.last=l);y?a.size--:r.size--}return!!i},forEach:function forEach(t){for(var r,a=m(this),i=c(t,arguments.length>1?arguments[1]:void 0);r=r?r.next:a.first;){i(r.value,r.key,this);for(;r&&r.removed;)r=r.previous}},has:function has(t){return!!getEntry(this,t)}});l(_,a?{get:function get(t){var r=getEntry(this,t);return r&&r.value},set:function set(t,r){return define(this,0===t?0:t,r)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}});y&&o(_,"size",{configurable:!0,get:function(){return m(this).size}});return v},setStrong:function(t,r,a){var i=r+" Iterator",o=w(r),l=w(i);p(t,r,(function(t,r){b(this,{type:i,target:t,state:o(t),kind:r,last:void 0})}),(function(){for(var t=l(this),r=t.kind,a=t.last;a&&a.removed;)a=a.previous;if(!t.target||!(t.last=a=a?a.next:t.state.first)){t.target=void 0;return v(void 0,!0)}return v("keys"===r?a.key:"values"===r?a.value:[a.key,a.value],!1)}),a?"entries":"values",!a,!0);_(r)}}},637:(t,r,a)=>{var i=a(8844),o=a(6045),l=a(5375).getWeakData,c=a(767),u=a(5027),h=a(981),d=a(8999),p=a(8734),v=a(2960),_=a(6812),y=a(618),g=y.set,m=y.getterFor,b=v.find,w=v.findIndex,P=i([].splice),k=0,uncaughtFrozenStore=function(t){return t.frozen||(t.frozen=new UncaughtFrozenStore)},UncaughtFrozenStore=function(){this.entries=[]},findUncaughtFrozen=function(t,r){return b(t.entries,(function(t){return t[0]===r}))};UncaughtFrozenStore.prototype={get:function(t){var r=findUncaughtFrozen(this,t);if(r)return r[1]},has:function(t){return!!findUncaughtFrozen(this,t)},set:function(t,r){var a=findUncaughtFrozen(this,t);a?a[1]=r:this.entries.push([t,r])},delete:function(t){var r=w(this.entries,(function(r){return r[0]===t}));~r&&P(this.entries,r,1);return!!~r}};t.exports={getConstructor:function(t,r,a,i){var v=t((function(t,o){c(t,y);g(t,{type:r,id:k++,frozen:void 0});h(o)||p(o,t[i],{that:t,AS_ENTRIES:a})})),y=v.prototype,b=m(r),define=function(t,r,a){var i=b(t),o=l(u(r),!0);!0===o?uncaughtFrozenStore(i).set(r,a):o[i.id]=a;return t};o(y,{delete:function(t){var r=b(this);if(!d(t))return!1;var a=l(t);return!0===a?uncaughtFrozenStore(r).delete(t):a&&_(a,r.id)&&delete a[r.id]},has:function has(t){var r=b(this);if(!d(t))return!1;var a=l(t);return!0===a?uncaughtFrozenStore(r).has(t):a&&_(a,r.id)}});o(y,a?{get:function get(t){var r=b(this);if(d(t)){var a=l(t);return!0===a?uncaughtFrozenStore(r).get(t):a?a[r.id]:void 0}},set:function set(t,r){return define(this,t,r)}}:{add:function add(t){return define(this,t,!0)}});return v}}},319:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(8844),c=a(5266),u=a(1880),h=a(5375),d=a(8734),p=a(767),v=a(9985),_=a(981),y=a(8999),g=a(3689),m=a(6431),b=a(5997),w=a(3457);t.exports=function(t,r,a){var P=-1!==t.indexOf("Map"),k=-1!==t.indexOf("Weak"),S=P?"set":"add",A=o[t],x=A&&A.prototype,E=A,I={},fixMethod=function(t){var r=l(x[t]);u(x,t,"add"===t?function add(t){r(this,0===t?0:t);return this}:"delete"===t?function(t){return!(k&&!y(t))&&r(this,0===t?0:t)}:"get"===t?function get(t){return k&&!y(t)?void 0:r(this,0===t?0:t)}:"has"===t?function has(t){return!(k&&!y(t))&&r(this,0===t?0:t)}:function set(t,a){r(this,0===t?0:t,a);return this})};if(c(t,!v(A)||!(k||x.forEach&&!g((function(){(new A).entries().next()}))))){E=a.getConstructor(r,t,P,S);h.enable()}else if(c(t,!0)){var T=new E,C=T[S](k?{}:-0,1)!==T,M=g((function(){T.has(1)})),G=m((function(t){new A(t)})),O=!k&&g((function(){for(var t=new A,r=5;r--;)t[S](r,r);return!t.has(-0)}));if(!G){(E=r((function(t,r){p(t,x);var a=w(new A,t,E);_(r)||d(r,a[S],{that:a,AS_ENTRIES:P});return a}))).prototype=x;x.constructor=E}if(M||O){fixMethod("delete");fixMethod("has");P&&fixMethod("get")}(O||C)&&fixMethod(S);k&&x.clear&&delete x.clear}I[t]=E;i({global:!0,constructor:!0,forced:E!==A},I);b(E,t);k||a.setStrong(E,t,P);return E}},8758:(t,r,a)=>{var i=a(6812),o=a(9152),l=a(2474),c=a(2560);t.exports=function(t,r,a){for(var u=o(r),h=c.f,d=l.f,p=0;p<u.length;p++){var v=u[p];i(t,v)||a&&i(a,v)||h(t,v,d(r,v))}}},7413:(t,r,a)=>{var i=a(4201)("match");t.exports=function(t){var r=/./;try{"/./"[t](r)}catch(a){try{r[i]=!1;return"/./"[t](r)}catch(t){}}return!1}},1748:(t,r,a)=>{var i=a(3689);t.exports=!i((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},7807:t=>{t.exports=function(t,r){return{value:t,done:r}}},5773:(t,r,a)=>{var i=a(7697),o=a(2560),l=a(5684);t.exports=i?function(t,r,a){return o.f(t,r,l(1,a))}:function(t,r,a){t[r]=a;return t}},5684:t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},6522:(t,r,a)=>{var i=a(8360),o=a(2560),l=a(5684);t.exports=function(t,r,a){var c=i(r);c in t?o.f(t,c,l(0,a)):t[c]=a}},1797:(t,r,a)=>{var i=a(5027),o=a(5899),l=TypeError;t.exports=function(t){i(this);if("string"===t||"default"===t)t="string";else if("number"!==t)throw new l("Incorrect hint");return o(this,t)}},2148:(t,r,a)=>{var i=a(8702),o=a(2560);t.exports=function(t,r,a){a.get&&i(a.get,r,{getter:!0});a.set&&i(a.set,r,{setter:!0});return o.f(t,r,a)}},1880:(t,r,a)=>{var i=a(9985),o=a(2560),l=a(8702),c=a(5014);t.exports=function(t,r,a,u){u||(u={});var h=u.enumerable,d=void 0!==u.name?u.name:r;i(a)&&l(a,d,u);if(u.global)h?t[r]=a:c(r,a);else{try{u.unsafe?t[r]&&(h=!0):delete t[r]}catch(t){}h?t[r]=a:o.f(t,r,{value:a,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},6045:(t,r,a)=>{var i=a(1880);t.exports=function(t,r,a){for(var o in r)i(t,o,r[o],a);return t}},5014:(t,r,a)=>{var i=a(9037),o=Object.defineProperty;t.exports=function(t,r){try{o(i,t,{value:r,configurable:!0,writable:!0})}catch(a){i[t]=r}return r}},8494:(t,r,a)=>{var i=a(3691),o=TypeError;t.exports=function(t,r){if(!delete t[r])throw new o("Cannot delete property "+i(r)+" of "+i(t))}},7697:(t,r,a)=>{var i=a(3689);t.exports=!i((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},1420:(t,r,a)=>{var i,o,l,c,u=a(9037),h=a(1905),d=a(3514),p=u.structuredClone,v=u.ArrayBuffer,_=u.MessageChannel,y=!1;if(d)y=function(t){p(t,{transfer:[t]})};else if(v)try{_||(i=h("worker_threads"))&&(_=i.MessageChannel);if(_){o=new _;l=new v(2);c=function(t){o.port1.postMessage(null,[t])};if(2===l.byteLength){c(l);0===l.byteLength&&(y=c)}}}catch(t){}t.exports=y},6420:(t,r,a)=>{var i=a(9037),o=a(8999),l=i.document,c=o(l)&&o(l.createElement);t.exports=function(t){return c?l.createElement(t):{}}},5565:t=>{var r=TypeError;t.exports=function(t){if(t>9007199254740991)throw r("Maximum allowed index exceeded");return t}},7136:t=>{t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},6338:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},3265:(t,r,a)=>{var i=a(6420)("span").classList,o=i&&i.constructor&&i.constructor.prototype;t.exports=o===Object.prototype?void 0:o},7365:(t,r,a)=>{var i=a(71).match(/firefox\/(\d+)/i);t.exports=!!i&&+i[1]},2532:(t,r,a)=>{var i=a(8563),o=a(806);t.exports=!i&&!o&&"object"==typeof window&&"object"==typeof document},8563:t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},7298:(t,r,a)=>{var i=a(71);t.exports=/MSIE|Trident/.test(i)},3221:(t,r,a)=>{var i=a(71);t.exports=/ipad|iphone|ipod/i.test(i)&&"undefined"!=typeof Pebble},4764:(t,r,a)=>{var i=a(71);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},806:(t,r,a)=>{var i=a(9037),o=a(6648);t.exports="process"===o(i.process)},7486:(t,r,a)=>{var i=a(71);t.exports=/web0s(?!.*chrome)/i.test(i)},71:t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},3615:(t,r,a)=>{var i,o,l=a(9037),c=a(71),u=l.process,h=l.Deno,d=u&&u.versions||h&&h.version,p=d&&d.v8;p&&(o=(i=p.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1]));!o&&c&&(!(i=c.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=c.match(/Chrome\/(\d+)/))&&(o=+i[1]);t.exports=o},7922:(t,r,a)=>{var i=a(71).match(/AppleWebKit\/(\d+)\./);t.exports=!!i&&+i[1]},2739:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6610:(t,r,a)=>{var i=a(8844),o=Error,l=i("".replace),c=String(new o("zxcasd").stack),u=/\n\s*at [^:]*:[^\n]*/,h=u.test(c);t.exports=function(t,r){if(h&&"string"==typeof t&&!o.prepareStackTrace)for(;r--;)t=l(t,u,"");return t}},5411:(t,r,a)=>{var i=a(5773),o=a(6610),l=a(9599),c=Error.captureStackTrace;t.exports=function(t,r,a,u){l&&(c?c(t,r):i(t,"stack",o(a,u)))}},9599:(t,r,a)=>{var i=a(3689),o=a(5684);t.exports=!i((function(){var t=new Error("a");if(!("stack"in t))return!0;Object.defineProperty(t,"stack",o(1,7));return 7!==t.stack}))},445:(t,r,a)=>{var i=a(7697),o=a(3689),l=a(5027),c=a(3841),u=Error.prototype.toString,h=o((function(){if(i){var t=Object.create(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==u.call(t))return!0}return"2: 1"!==u.call({message:1,name:2})||"Error"!==u.call({})}));t.exports=h?function toString(){var t=l(this),r=c(t.name,"Error"),a=c(t.message);return r?a?r+": "+a:r:a}:u},9989:(t,r,a)=>{var i=a(9037),o=a(2474).f,l=a(5773),c=a(1880),u=a(5014),h=a(8758),d=a(5266);t.exports=function(t,r){var a,p,v,_,y,g=t.target,m=t.global,b=t.stat;if(a=m?i:b?i[g]||u(g,{}):i[g]&&i[g].prototype)for(p in r){_=r[p];v=t.dontCallGetSet?(y=o(a,p))&&y.value:a[p];if(!d(m?p:g+(b?".":"#")+p,t.forced)&&void 0!==v){if(typeof _==typeof v)continue;h(_,v)}(t.sham||v&&v.sham)&&l(_,"sham",!0);c(a,p,_,t)}}},3689:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},8678:(t,r,a)=>{a(4043);var i=a(2615),o=a(1880),l=a(6308),c=a(3689),u=a(4201),h=a(5773),d=u("species"),p=RegExp.prototype;t.exports=function(t,r,a,v){var _=u(t),y=!c((function(){var r={};r[_]=function(){return 7};return 7!==""[t](r)})),g=y&&!c((function(){var r=!1,a=/a/;if("split"===t){(a={}).constructor={};a.constructor[d]=function(){return a};a.flags="";a[_]=/./[_]}a.exec=function(){r=!0;return null};a[_]("");return!r}));if(!y||!g||a){var m=/./[_],b=r(_,""[t],(function(t,r,a,o,c){var u=r.exec;return u===l||u===p.exec?y&&!c?{done:!0,value:i(m,r,a,o)}:{done:!0,value:i(t,a,r,o)}:{done:!1}}));o(String.prototype,t,b[0]);o(p,_,b[1])}v&&h(p[_],"sham",!0)}},7809:(t,r,a)=>{var i=a(2297),o=a(6310),l=a(5565),c=a(4071),flattenIntoArray=function(t,r,a,u,h,d,p,v){for(var _,y,g=h,m=0,b=!!p&&c(p,v);m<u;){if(m in a){_=b?b(a[m],m,r):a[m];if(d>0&&i(_)){y=o(_);g=flattenIntoArray(t,r,_,y,g,d-1)-1}else{l(g+1);t[g]=_}g++}m++}return g};t.exports=flattenIntoArray},1594:(t,r,a)=>{var i=a(3689);t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},1735:(t,r,a)=>{var i=a(7215),o=Function.prototype,l=o.apply,c=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?c.bind(l):function(){return c.apply(l,arguments)})},4071:(t,r,a)=>{var i=a(6576),o=a(509),l=a(7215),c=i(i.bind);t.exports=function(t,r){o(t);return void 0===r?t:l?c(t,r):function(){return t.apply(r,arguments)}}},7215:(t,r,a)=>{var i=a(3689);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6761:(t,r,a)=>{var i=a(8844),o=a(509),l=a(8999),c=a(6812),u=a(6004),h=a(7215),d=Function,p=i([].concat),v=i([].join),_={};t.exports=h?d.bind:function bind(t){var r=o(this),a=r.prototype,i=u(arguments,1),h=function bound(){var a=p(i,u(arguments));return this instanceof h?function(t,r,a){if(!c(_,r)){for(var i=[],o=0;o<r;o++)i[o]="a["+o+"]";_[r]=d("C,a","return new C("+v(i,",")+")")}return _[r](t,a)}(r,a.length,a):r.apply(t,a)};l(a)&&(h.prototype=a);return h}},2615:(t,r,a)=>{var i=a(7215),o=Function.prototype.call;t.exports=i?o.bind(o):function(){return o.apply(o,arguments)}},1236:(t,r,a)=>{var i=a(7697),o=a(6812),l=Function.prototype,c=i&&Object.getOwnPropertyDescriptor,u=o(l,"name"),h=u&&"something"===function something(){}.name,d=u&&(!i||i&&c(l,"name").configurable);t.exports={EXISTS:u,PROPER:h,CONFIGURABLE:d}},2743:(t,r,a)=>{var i=a(8844),o=a(509);t.exports=function(t,r,a){try{return i(o(Object.getOwnPropertyDescriptor(t,r)[a]))}catch(t){}}},6576:(t,r,a)=>{var i=a(6648),o=a(8844);t.exports=function(t){if("Function"===i(t))return o(t)}},8844:(t,r,a)=>{var i=a(7215),o=Function.prototype,l=o.call,c=i&&o.bind.bind(l,l);t.exports=i?c:function(t){return function(){return l.apply(t,arguments)}}},6058:(t,r,a)=>{var i=a(9037),o=a(9985);t.exports=function(t,r){return arguments.length<2?(a=i[t],o(a)?a:void 0):i[t]&&i[t][r];var a}},2302:t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},6752:(t,r,a)=>{var i=a(2615),o=a(5027),l=a(2302),c=a(1664);t.exports=function(t,r){r&&"string"==typeof t||o(t);var a=c(t);return l(o(void 0!==a?i(a,t):t))}},1664:(t,r,a)=>{var i=a(926),o=a(4849),l=a(981),c=a(9478),u=a(4201)("iterator");t.exports=function(t){if(!l(t))return o(t,u)||o(t,"@@iterator")||c[i(t)]}},5185:(t,r,a)=>{var i=a(2615),o=a(509),l=a(5027),c=a(3691),u=a(1664),h=TypeError;t.exports=function(t,r){var a=arguments.length<2?u(t):r;if(o(a))return l(i(a,t));throw new h(c(t)+" is not iterable")}},2643:(t,r,a)=>{var i=a(8844),o=a(2297),l=a(9985),c=a(6648),u=a(4327),h=i([].push);t.exports=function(t){if(l(t))return t;if(o(t)){for(var r=t.length,a=[],i=0;i<r;i++){var d=t[i];"string"==typeof d?h(a,d):"number"!=typeof d&&"Number"!==c(d)&&"String"!==c(d)||h(a,u(d))}var p=a.length,v=!0;return function(t,r){if(v){v=!1;return r}if(o(this))return r;for(var i=0;i<p;i++)if(a[i]===t)return r}}}},4849:(t,r,a)=>{var i=a(509),o=a(981);t.exports=function(t,r){var a=t[r];return o(a)?void 0:i(a)}},1074:(t,r,a)=>{var i=a(509),o=a(5027),l=a(2615),c=a(8700),u=a(2302),h="Invalid size",d=RangeError,p=TypeError,v=Math.max,SetRecord=function(t,r){this.set=t;this.size=v(r,0);this.has=i(t.has);this.keys=i(t.keys)};SetRecord.prototype={getIterator:function(){return u(o(l(this.keys,this.set)))},includes:function(t){return l(this.has,this.set,t)}};t.exports=function(t){o(t);var r=+t.size;if(r!=r)throw new p(h);var a=c(r);if(a<0)throw new d(h);return new SetRecord(t,a)}},7017:(t,r,a)=>{var i=a(8844),o=a(690),l=Math.floor,c=i("".charAt),u=i("".replace),h=i("".slice),d=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,p=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,r,a,i,v,_){var y=a+t.length,g=i.length,m=p;if(void 0!==v){v=o(v);m=d}return u(_,m,(function(o,u){var d;switch(c(u,0)){case"$":return"$";case"&":return t;case"`":return h(r,0,a);case"'":return h(r,y);case"<":d=v[h(u,1,-1)];break;default:var p=+u;if(0===p)return o;if(p>g){var _=l(p/10);return 0===_?o:_<=g?void 0===i[_-1]?c(u,1):i[_-1]+c(u,1):o}d=i[p-1]}return void 0===d?"":d}))}},9037:function(t){var check=function(t){return t&&t.Math===Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||check("object"==typeof this&&this)||function(){return this}()||Function("return this")()},6812:(t,r,a)=>{var i=a(8844),o=a(690),l=i({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,r){return l(o(t),r)}},7248:t=>{t.exports={}},920:t=>{t.exports=function(t,r){try{1===arguments.length?console.error(t):console.error(t,r)}catch(t){}}},2688:(t,r,a)=>{var i=a(6058);t.exports=i("document","documentElement")},8506:(t,r,a)=>{var i=a(7697),o=a(3689),l=a(6420);t.exports=!i&&!o((function(){return 7!==Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a}))},5477:t=>{var r=Array,a=Math.abs,i=Math.pow,o=Math.floor,l=Math.log,c=Math.LN2;t.exports={pack:function(t,u,h){var d,p,v,_=r(h),y=8*h-u-1,g=(1<<y)-1,m=g>>1,b=23===u?i(2,-24)-i(2,-77):0,w=t<0||0===t&&1/t<0?1:0,P=0;if((t=a(t))!=t||t===1/0){p=t!=t?1:0;d=g}else{d=o(l(t)/c);if(t*(v=i(2,-d))<1){d--;v*=2}if((t+=d+m>=1?b/v:b*i(2,1-m))*v>=2){d++;v/=2}if(d+m>=g){p=0;d=g}else if(d+m>=1){p=(t*v-1)*i(2,u);d+=m}else{p=t*i(2,m-1)*i(2,u);d=0}}for(;u>=8;){_[P++]=255&p;p/=256;u-=8}d=d<<u|p;y+=u;for(;y>0;){_[P++]=255&d;d/=256;y-=8}_[--P]|=128*w;return _},unpack:function(t,r){var a,o=t.length,l=8*o-r-1,c=(1<<l)-1,u=c>>1,h=l-7,d=o-1,p=t[d--],v=127&p;p>>=7;for(;h>0;){v=256*v+t[d--];h-=8}a=v&(1<<-h)-1;v>>=-h;h+=r;for(;h>0;){a=256*a+t[d--];h-=8}if(0===v)v=1-u;else{if(v===c)return a?NaN:p?-1/0:1/0;a+=i(2,r);v-=u}return(p?-1:1)*a*i(2,v-r)}}},4413:(t,r,a)=>{var i=a(8844),o=a(3689),l=a(6648),c=Object,u=i("".split);t.exports=o((function(){return!c("z").propertyIsEnumerable(0)}))?function(t){return"String"===l(t)?u(t,""):c(t)}:c},3457:(t,r,a)=>{var i=a(9985),o=a(8999),l=a(9385);t.exports=function(t,r,a){var c,u;l&&i(c=r.constructor)&&c!==a&&o(u=c.prototype)&&u!==a.prototype&&l(t,u);return t}},6738:(t,r,a)=>{var i=a(8844),o=a(9985),l=a(4091),c=i(Function.toString);o(l.inspectSource)||(l.inspectSource=function(t){return c(t)});t.exports=l.inspectSource},2570:(t,r,a)=>{var i=a(8999),o=a(5773);t.exports=function(t,r){i(r)&&"cause"in r&&o(t,"cause",r.cause)}},5375:(t,r,a)=>{var i=a(9989),o=a(8844),l=a(7248),c=a(8999),u=a(6812),h=a(2560).f,d=a(2741),p=a(6062),v=a(1129),_=a(4630),y=a(1594),g=!1,m=_("meta"),b=0,setMetadata=function(t){h(t,m,{value:{objectID:"O"+b++,weakData:{}}})},w=t.exports={enable:function(){w.enable=function(){};g=!0;var t=d.f,r=o([].splice),a={};a[m]=1;if(t(a).length){d.f=function(a){for(var i=t(a),o=0,l=i.length;o<l;o++)if(i[o]===m){r(i,o,1);break}return i};i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:p.f})}},fastKey:function(t,r){if(!c(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!u(t,m)){if(!v(t))return"F";if(!r)return"E";setMetadata(t)}return t[m].objectID},getWeakData:function(t,r){if(!u(t,m)){if(!v(t))return!0;if(!r)return!1;setMetadata(t)}return t[m].weakData},onFreeze:function(t){y&&g&&v(t)&&!u(t,m)&&setMetadata(t);return t}};l[m]=!0},618:(t,r,a)=>{var i,o,l,c=a(9834),u=a(9037),h=a(8999),d=a(5773),p=a(6812),v=a(4091),_=a(2713),y=a(7248),g="Object already initialized",m=u.TypeError,b=u.WeakMap;if(c||v.state){var w=v.state||(v.state=new b);w.get=w.get;w.has=w.has;w.set=w.set;i=function(t,r){if(w.has(t))throw new m(g);r.facade=t;w.set(t,r);return r};o=function(t){return w.get(t)||{}};l=function(t){return w.has(t)}}else{var P=_("state");y[P]=!0;i=function(t,r){if(p(t,P))throw new m(g);r.facade=t;d(t,P,r);return r};o=function(t){return p(t,P)?t[P]:{}};l=function(t){return p(t,P)}}t.exports={set:i,get:o,has:l,enforce:function(t){return l(t)?o(t):i(t,{})},getterFor:function(t){return function(r){var a;if(!h(r)||(a=o(r)).type!==t)throw new m("Incompatible receiver, "+t+" required");return a}}}},3292:(t,r,a)=>{var i=a(4201),o=a(9478),l=i("iterator"),c=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||c[l]===t)}},2297:(t,r,a)=>{var i=a(6648);t.exports=Array.isArray||function isArray(t){return"Array"===i(t)}},9401:(t,r,a)=>{var i=a(926);t.exports=function(t){var r=i(t);return"BigInt64Array"===r||"BigUint64Array"===r}},9985:t=>{var r="object"==typeof document&&document.all;t.exports=void 0===r&&void 0!==r?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}},9429:(t,r,a)=>{var i=a(8844),o=a(3689),l=a(9985),c=a(926),u=a(6058),h=a(6738),noop=function(){},d=u("Reflect","construct"),p=/^\s*(?:class|function)\b/,v=i(p.exec),_=!p.test(noop),y=function isConstructor(t){if(!l(t))return!1;try{d(noop,[],t);return!0}catch(t){return!1}},g=function isConstructor(t){if(!l(t))return!1;switch(c(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _||!!v(p,h(t))}catch(t){return!0}};g.sham=!0;t.exports=!d||o((function(){var t;return y(y.call)||!y(Object)||!y((function(){t=!0}))||t}))?g:y},6251:(t,r,a)=>{var i=a(6812);t.exports=function(t){return void 0!==t&&(i(t,"value")||i(t,"writable"))}},5266:(t,r,a)=>{var i=a(3689),o=a(9985),l=/#|\.prototype\./,isForced=function(t,r){var a=u[c(t)];return a===d||a!==h&&(o(r)?i(r):!!r)},c=isForced.normalize=function(t){return String(t).replace(l,".").toLowerCase()},u=isForced.data={},h=isForced.NATIVE="N",d=isForced.POLYFILL="P";t.exports=isForced},1973:(t,r,a)=>{var i=a(8999),o=Math.floor;t.exports=Number.isInteger||function isInteger(t){return!i(t)&&isFinite(t)&&o(t)===t}},981:t=>{t.exports=function(t){return null==t}},8999:(t,r,a)=>{var i=a(9985);t.exports=function(t){return"object"==typeof t?null!==t:i(t)}},598:(t,r,a)=>{var i=a(8999);t.exports=function(t){return i(t)||null===t}},3931:t=>{t.exports=!1},1245:(t,r,a)=>{var i=a(8999),o=a(6648),l=a(4201)("match");t.exports=function(t){var r;return i(t)&&(void 0!==(r=t[l])?!!r:"RegExp"===o(t))}},734:(t,r,a)=>{var i=a(6058),o=a(9985),l=a(3622),c=a(9525),u=Object;t.exports=c?function(t){return"symbol"==typeof t}:function(t){var r=i("Symbol");return o(r)&&l(r.prototype,u(t))}},6704:(t,r,a)=>{var i=a(2615);t.exports=function(t,r,a){for(var o,l,c=a?t:t.iterator,u=t.next;!(o=i(u,c)).done;)if(void 0!==(l=r(o.value)))return l}},8734:(t,r,a)=>{var i=a(4071),o=a(2615),l=a(5027),c=a(3691),u=a(3292),h=a(6310),d=a(3622),p=a(5185),v=a(1664),_=a(2125),y=TypeError,Result=function(t,r){this.stopped=t;this.result=r},g=Result.prototype;t.exports=function(t,r,a){var m,b,w,P,k,S,A,x=a&&a.that,E=!(!a||!a.AS_ENTRIES),I=!(!a||!a.IS_RECORD),T=!(!a||!a.IS_ITERATOR),C=!(!a||!a.INTERRUPTED),M=i(r,x),stop=function(t){m&&_(m,"normal",t);return new Result(!0,t)},callFn=function(t){if(E){l(t);return C?M(t[0],t[1],stop):M(t[0],t[1])}return C?M(t,stop):M(t)};if(I)m=t.iterator;else if(T)m=t;else{if(!(b=v(t)))throw new y(c(t)+" is not iterable");if(u(b)){for(w=0,P=h(t);P>w;w++)if((k=callFn(t[w]))&&d(g,k))return k;return new Result(!1)}m=p(t,b)}S=I?t.next:m.next;for(;!(A=o(S,m)).done;){try{k=callFn(A.value)}catch(t){_(m,"throw",t)}if("object"==typeof k&&k&&d(g,k))return k}return new Result(!1)}},2125:(t,r,a)=>{var i=a(2615),o=a(5027),l=a(4849);t.exports=function(t,r,a){var c,u;o(t);try{if(!(c=l(t,"return"))){if("throw"===r)throw a;return a}c=i(c,t)}catch(t){u=!0;c=t}if("throw"===r)throw a;if(u)throw c;o(c);return a}},974:(t,r,a)=>{var i=a(2013).IteratorPrototype,o=a(5391),l=a(5684),c=a(5997),u=a(9478),returnThis=function(){return this};t.exports=function(t,r,a,h){var d=r+" Iterator";t.prototype=o(i,{next:l(+!h,a)});c(t,d,!1,!0);u[d]=returnThis;return t}},5419:(t,r,a)=>{var i=a(2615),o=a(5391),l=a(5773),c=a(6045),u=a(4201),h=a(618),d=a(4849),p=a(2013).IteratorPrototype,v=a(7807),_=a(2125),y=u("toStringTag"),g="IteratorHelper",m="WrapForValidIterator",b=h.set,createIteratorProxyPrototype=function(t){var r=h.getterFor(t?m:g);return c(o(p),{next:function next(){var a=r(this);if(t)return a.nextHandler();try{var i=a.done?void 0:a.nextHandler();return v(i,a.done)}catch(t){a.done=!0;throw t}},return:function(){var a=r(this),o=a.iterator;a.done=!0;if(t){var l=d(o,"return");return l?i(l,o):v(void 0,!0)}if(a.inner)try{_(a.inner.iterator,"normal")}catch(t){return _(o,"throw",t)}_(o,"normal");return v(void 0,!0)}})},w=createIteratorProxyPrototype(!0),P=createIteratorProxyPrototype(!1);l(P,y,"Iterator Helper");t.exports=function(t,r){var a=function Iterator(a,i){if(i){i.iterator=a.iterator;i.next=a.next}else i=a;i.type=r?m:g;i.nextHandler=t;i.counter=0;i.done=!1;b(this,i)};a.prototype=r?w:P;return a}},1934:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(3931),c=a(1236),u=a(9985),h=a(974),d=a(1868),p=a(9385),v=a(5997),_=a(5773),y=a(1880),g=a(4201),m=a(9478),b=a(2013),w=c.PROPER,P=c.CONFIGURABLE,k=b.IteratorPrototype,S=b.BUGGY_SAFARI_ITERATORS,A=g("iterator"),x="keys",E="values",I="entries",returnThis=function(){return this};t.exports=function(t,r,a,c,g,b,T){h(a,r,c);var C,M,G,getIterationMethod=function(t){if(t===g&&j)return j;if(!S&&t&&t in L)return L[t];switch(t){case x:return function keys(){return new a(this,t)};case E:return function values(){return new a(this,t)};case I:return function entries(){return new a(this,t)}}return function(){return new a(this)}},O=r+" Iterator",R=!1,L=t.prototype,D=L[A]||L["@@iterator"]||g&&L[g],j=!S&&D||getIterationMethod(g),N="Array"===r&&L.entries||D;if(N&&(C=d(N.call(new t)))!==Object.prototype&&C.next){l||d(C)===k||(p?p(C,k):u(C[A])||y(C,A,returnThis));v(C,O,!0,!0);l&&(m[O]=returnThis)}if(w&&g===E&&D&&D.name!==E)if(!l&&P)_(L,"name",E);else{R=!0;j=function values(){return o(D,this)}}if(g){M={values:getIterationMethod(E),keys:b?j:getIterationMethod(x),entries:getIterationMethod(I)};if(T)for(G in M)(S||R||!(G in L))&&y(L,G,M[G]);else i({target:r,proto:!0,forced:S||R},M)}l&&!T||L[A]===j||y(L,A,j,{name:g});m[r]=j;return M}},8983:(t,r,a)=>{var i=a(2615),o=a(509),l=a(5027),c=a(2302),u=a(5419),h=a(1228),d=u((function(){var t=this.iterator,r=l(i(this.next,t));if(!(this.done=!!r.done))return h(t,this.mapper,[r.value,this.counter++],!0)}));t.exports=function map(t){l(this);o(t);return new d(c(this),{mapper:t})}},2013:(t,r,a)=>{var i,o,l,c=a(3689),u=a(9985),h=a(8999),d=a(5391),p=a(1868),v=a(1880),_=a(4201),y=a(3931),g=_("iterator"),m=!1;[].keys&&("next"in(l=[].keys())?(o=p(p(l)))!==Object.prototype&&(i=o):m=!0);!h(i)||c((function(){var t={};return i[g].call(t)!==t}))?i={}:y&&(i=d(i));u(i[g])||v(i,g,(function(){return this}));t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:m}},9478:t=>{t.exports={}},6310:(t,r,a)=>{var i=a(3126);t.exports=function(t){return i(t.length)}},8702:(t,r,a)=>{var i=a(8844),o=a(3689),l=a(9985),c=a(6812),u=a(7697),h=a(1236).CONFIGURABLE,d=a(6738),p=a(618),v=p.enforce,_=p.get,y=String,g=Object.defineProperty,m=i("".slice),b=i("".replace),w=i([].join),P=u&&!o((function(){return 8!==g((function(){}),"length",{value:8}).length})),k=String(String).split("String"),S=t.exports=function(t,r,a){"Symbol("===m(y(r),0,7)&&(r="["+b(y(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]");a&&a.getter&&(r="get "+r);a&&a.setter&&(r="set "+r);(!c(t,"name")||h&&t.name!==r)&&(u?g(t,"name",{value:r,configurable:!0}):t.name=r);P&&a&&c(a,"arity")&&t.length!==a.arity&&g(t,"length",{value:a.arity});try{a&&c(a,"constructor")&&a.constructor?u&&g(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=v(t);c(i,"source")||(i.source=w(k,"string"==typeof r?r:""));return t};Function.prototype.toString=S((function toString(){return l(this)&&_(this).source||d(this)}),"toString")},134:(t,r,a)=>{var i=a(5680),o=Math.abs,l=2220446049250313e-31,c=1/l;t.exports=function(t,r,a,u){var h=+t,d=o(h),p=i(h);if(d<u)return p*function(t){return t+c-c}(d/u/r)*u*r;var v=(1+r/l)*d,_=v-(v-d);return _>a||_!=_?p*(1/0):p*_}},7788:(t,r,a)=>{var i=a(134);t.exports=Math.fround||function fround(t){return i(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},5680:t=>{t.exports=Math.sign||function sign(t){var r=+t;return 0===r||r!=r?r:r<0?-1:1}},8828:t=>{var r=Math.ceil,a=Math.floor;t.exports=Math.trunc||function trunc(t){var i=+t;return(i>0?a:r)(i)}},231:(t,r,a)=>{var i,o,l,c,u,h=a(9037),d=a(517),p=a(4071),v=a(9886).set,_=a(4410),y=a(4764),g=a(3221),m=a(7486),b=a(806),w=h.MutationObserver||h.WebKitMutationObserver,P=h.document,k=h.process,S=h.Promise,A=d("queueMicrotask");if(!A){var x=new _,flush=function(){var t,r;b&&(t=k.domain)&&t.exit();for(;r=x.get();)try{r()}catch(t){x.head&&i();throw t}t&&t.enter()};if(y||b||m||!w||!P)if(!g&&S&&S.resolve){(c=S.resolve(void 0)).constructor=S;u=p(c.then,c);i=function(){u(flush)}}else if(b)i=function(){k.nextTick(flush)};else{v=p(v,h);i=function(){v(flush)}}else{o=!0;l=P.createTextNode("");new w(flush).observe(l,{characterData:!0});i=function(){l.data=o=!o}}A=function(t){x.head||i();x.add(t)}}t.exports=A},8742:(t,r,a)=>{var i=a(509),o=TypeError,PromiseCapability=function(t){var r,a;this.promise=new t((function(t,i){if(void 0!==r||void 0!==a)throw new o("Bad Promise constructor");r=t;a=i}));this.resolve=i(r);this.reject=i(a)};t.exports.f=function(t){return new PromiseCapability(t)}},3841:(t,r,a)=>{var i=a(4327);t.exports=function(t,r){return void 0===t?arguments.length<2?"":r:i(t)}},2124:(t,r,a)=>{var i=a(1245),o=TypeError;t.exports=function(t){if(i(t))throw new o("The method doesn't accept regular expressions");return t}},5394:(t,r,a)=>{var i=a(7697),o=a(8844),l=a(2615),c=a(3689),u=a(300),h=a(7518),d=a(9556),p=a(690),v=a(4413),_=Object.assign,y=Object.defineProperty,g=o([].concat);t.exports=!_||c((function(){if(i&&1!==_({b:1},_(y({},"a",{enumerable:!0,get:function(){y(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},r={},a=Symbol("assign detection"),o="abcdefghijklmnopqrst";t[a]=7;o.split("").forEach((function(t){r[t]=t}));return 7!==_({},t)[a]||u(_({},r)).join("")!==o}))?function assign(t,r){for(var a=p(t),o=arguments.length,c=1,_=h.f,y=d.f;o>c;)for(var m,b=v(arguments[c++]),w=_?g(u(b),_(b)):u(b),P=w.length,k=0;P>k;){m=w[k++];i&&!l(y,b,m)||(a[m]=b[m])}return a}:_},5391:(t,r,a)=>{var i,o=a(5027),l=a(8920),c=a(2739),u=a(7248),h=a(2688),d=a(6420),p=a(2713),v="prototype",_="script",y=p("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<"+_+">"+t+"</"+_+">"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var r=t.parentWindow.Object;t=null;return r},NullProtoObject=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&i?NullProtoObjectViaActiveX(i):function(){var t,r=d("iframe"),a="java"+_+":";r.style.display="none";h.appendChild(r);r.src=String(a);(t=r.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(i);for(var t=c.length;t--;)delete NullProtoObject[v][c[t]];return NullProtoObject()};u[y]=!0;t.exports=Object.create||function create(t,r){var a;if(null!==t){EmptyConstructor[v]=o(t);a=new EmptyConstructor;EmptyConstructor[v]=null;a[y]=t}else a=NullProtoObject();return void 0===r?a:l.f(a,r)}},8920:(t,r,a)=>{var i=a(7697),o=a(5648),l=a(2560),c=a(5027),u=a(5290),h=a(300);r.f=i&&!o?Object.defineProperties:function defineProperties(t,r){c(t);for(var a,i=u(r),o=h(r),d=o.length,p=0;d>p;)l.f(t,a=o[p++],i[a]);return t}},2560:(t,r,a)=>{var i=a(7697),o=a(8506),l=a(5648),c=a(5027),u=a(8360),h=TypeError,d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,v="enumerable",_="configurable",y="writable";r.f=i?l?function defineProperty(t,r,a){c(t);r=u(r);c(a);if("function"==typeof t&&"prototype"===r&&"value"in a&&y in a&&!a[y]){var i=p(t,r);if(i&&i[y]){t[r]=a.value;a={configurable:_ in a?a[_]:i[_],enumerable:v in a?a[v]:i[v],writable:!1}}}return d(t,r,a)}:d:function defineProperty(t,r,a){c(t);r=u(r);c(a);if(o)try{return d(t,r,a)}catch(t){}if("get"in a||"set"in a)throw new h("Accessors not supported");"value"in a&&(t[r]=a.value);return t}},2474:(t,r,a)=>{var i=a(7697),o=a(2615),l=a(9556),c=a(5684),u=a(5290),h=a(8360),d=a(6812),p=a(8506),v=Object.getOwnPropertyDescriptor;r.f=i?v:function getOwnPropertyDescriptor(t,r){t=u(t);r=h(r);if(p)try{return v(t,r)}catch(t){}if(d(t,r))return c(!o(l.f,t,r),t[r])}},6062:(t,r,a)=>{var i=a(6648),o=a(5290),l=a(2741).f,c=a(6004),u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function getOwnPropertyNames(t){return u&&"Window"===i(t)?function(t){try{return l(t)}catch(t){return c(u)}}(t):l(o(t))}},2741:(t,r,a)=>{var i=a(4948),o=a(2739).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return i(t,o)}},7518:(t,r)=>{r.f=Object.getOwnPropertySymbols},1868:(t,r,a)=>{var i=a(6812),o=a(9985),l=a(690),c=a(2713),u=a(1748),h=c("IE_PROTO"),d=Object,p=d.prototype;t.exports=u?d.getPrototypeOf:function(t){var r=l(t);if(i(r,h))return r[h];var a=r.constructor;return o(a)&&r instanceof a?a.prototype:r instanceof d?p:null}},1129:(t,r,a)=>{var i=a(3689),o=a(8999),l=a(6648),c=a(1655),u=Object.isExtensible,h=i((function(){u(1)}));t.exports=h||c?function isExtensible(t){return!!o(t)&&((!c||"ArrayBuffer"!==l(t))&&(!u||u(t)))}:u},3622:(t,r,a)=>{var i=a(8844);t.exports=i({}.isPrototypeOf)},4948:(t,r,a)=>{var i=a(8844),o=a(6812),l=a(5290),c=a(4328).indexOf,u=a(7248),h=i([].push);t.exports=function(t,r){var a,i=l(t),d=0,p=[];for(a in i)!o(u,a)&&o(i,a)&&h(p,a);for(;r.length>d;)o(i,a=r[d++])&&(~c(p,a)||h(p,a));return p}},300:(t,r,a)=>{var i=a(4948),o=a(2739);t.exports=Object.keys||function keys(t){return i(t,o)}},9556:(t,r)=>{var a={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!a.call({1:2},1);r.f=o?function propertyIsEnumerable(t){var r=i(this,t);return!!r&&r.enumerable}:a},9385:(t,r,a)=>{var i=a(2743),o=a(5027),l=a(3550);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,a={};try{(t=i(Object.prototype,"__proto__","set"))(a,[]);r=a instanceof Array}catch(t){}return function setPrototypeOf(a,i){o(a);l(i);r?t(a,i):a.__proto__=i;return a}}():void 0)},9419:(t,r,a)=>{var i=a(7697),o=a(3689),l=a(8844),c=a(1868),u=a(300),h=a(5290),d=l(a(9556).f),p=l([].push),v=i&&o((function(){var t=Object.create(null);t[2]=2;return!d(t,2)})),createMethod=function(t){return function(r){for(var a,o=h(r),l=u(o),_=v&&null===c(o),y=l.length,g=0,m=[];y>g;){a=l[g++];i&&!(_?a in o:d(o,a))||p(m,t?[a,o[a]]:o[a])}return m}};t.exports={entries:createMethod(!0),values:createMethod(!1)}},5073:(t,r,a)=>{var i=a(3043),o=a(926);t.exports=i?{}.toString:function toString(){return"[object "+o(this)+"]"}},5899:(t,r,a)=>{var i=a(2615),o=a(9985),l=a(8999),c=TypeError;t.exports=function(t,r){var a,u;if("string"===r&&o(a=t.toString)&&!l(u=i(a,t)))return u;if(o(a=t.valueOf)&&!l(u=i(a,t)))return u;if("string"!==r&&o(a=t.toString)&&!l(u=i(a,t)))return u;throw new c("Can't convert object to primitive value")}},9152:(t,r,a)=>{var i=a(6058),o=a(8844),l=a(2741),c=a(7518),u=a(5027),h=o([].concat);t.exports=i("Reflect","ownKeys")||function ownKeys(t){var r=l.f(u(t)),a=c.f;return a?h(r,a(t)):r}},6675:(t,r,a)=>{var i=a(8844),o=a(6812),l=SyntaxError,c=parseInt,u=String.fromCharCode,h=i("".charAt),d=i("".slice),p=i(/./.exec),v={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},_=/^[\da-f]{4}$/i,y=/^[\u0000-\u001F]$/;t.exports=function(t,r){for(var a=!0,i="";r<t.length;){var g=h(t,r);if("\\"===g){var m=d(t,r,r+2);if(o(v,m)){i+=v[m];r+=2}else{if("\\u"!==m)throw new l('Unknown escape sequence: "'+m+'"');var b=d(t,r+=2,r+4);if(!p(_,b))throw new l("Bad Unicode escape at: "+r);i+=u(c(b,16));r+=4}}else{if('"'===g){a=!1;r++;break}if(p(y,g))throw new l("Bad control character in string literal at: "+r);i+=g;r++}}if(a)throw new l("Unterminated string at: "+r);return{value:i,end:r}}},496:(t,r,a)=>{var i=a(9037);t.exports=i},9302:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},7073:(t,r,a)=>{var i=a(9037),o=a(7919),l=a(9985),c=a(5266),u=a(6738),h=a(4201),d=a(2532),p=a(8563),v=a(3931),_=a(3615),y=o&&o.prototype,g=h("species"),m=!1,b=l(i.PromiseRejectionEvent),w=c("Promise",(function(){var t=u(o),r=t!==String(o);if(!r&&66===_)return!0;if(v&&(!y.catch||!y.finally))return!0;if(!_||_<51||!/native code/.test(t)){var a=new o((function(t){t(1)})),FakePromise=function(t){t((function(){}),(function(){}))};(a.constructor={})[g]=FakePromise;if(!(m=a.then((function(){}))instanceof FakePromise))return!0}return!r&&(d||p)&&!b}));t.exports={CONSTRUCTOR:w,REJECTION_EVENT:b,SUBCLASSING:m}},7919:(t,r,a)=>{var i=a(9037);t.exports=i.Promise},2945:(t,r,a)=>{var i=a(5027),o=a(8999),l=a(8742);t.exports=function(t,r){i(t);if(o(r)&&r.constructor===t)return r;var a=l.f(t);(0,a.resolve)(r);return a.promise}},562:(t,r,a)=>{var i=a(7919),o=a(6431),l=a(7073).CONSTRUCTOR;t.exports=l||!o((function(t){i.all(t).then(void 0,(function(){}))}))},8055:(t,r,a)=>{var i=a(2560).f;t.exports=function(t,r,a){a in t||i(t,a,{configurable:!0,get:function(){return r[a]},set:function(t){r[a]=t}})}},4410:t=>{var Queue=function(){this.head=null;this.tail=null};Queue.prototype={add:function(t){var r={item:t,next:null},a=this.tail;a?a.next=r:this.head=r;this.tail=r},get:function(){var t=this.head;if(t){null===(this.head=t.next)&&(this.tail=null);return t.item}}};t.exports=Queue},6100:(t,r,a)=>{var i=a(2615),o=a(5027),l=a(9985),c=a(6648),u=a(6308),h=TypeError;t.exports=function(t,r){var a=t.exec;if(l(a)){var d=i(a,t,r);null!==d&&o(d);return d}if("RegExp"===c(t))return i(u,t,r);throw new h("RegExp#exec called on incompatible receiver")}},6308:(t,r,a)=>{var i=a(2615),o=a(8844),l=a(4327),c=a(9633),u=a(7901),h=a(3430),d=a(5391),p=a(618).get,v=a(2100),_=a(6422),y=h("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,m=g,b=o("".charAt),w=o("".indexOf),P=o("".replace),k=o("".slice),S=function(){var t=/a/,r=/b*/g;i(g,t,"a");i(g,r,"a");return 0!==t.lastIndex||0!==r.lastIndex}(),A=u.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];(S||x||A||v||_)&&(m=function exec(t){var r,a,o,u,h,v,_,E=this,I=p(E),T=l(t),C=I.raw;if(C){C.lastIndex=E.lastIndex;r=i(m,C,T);E.lastIndex=C.lastIndex;return r}var M=I.groups,G=A&&E.sticky,O=i(c,E),R=E.source,L=0,D=T;if(G){O=P(O,"y","");-1===w(O,"g")&&(O+="g");D=k(T,E.lastIndex);if(E.lastIndex>0&&(!E.multiline||E.multiline&&"\n"!==b(T,E.lastIndex-1))){R="(?: "+R+")";D=" "+D;L++}a=new RegExp("^(?:"+R+")",O)}x&&(a=new RegExp("^"+R+"$(?!\\s)",O));S&&(o=E.lastIndex);u=i(g,G?a:E,D);if(G)if(u){u.input=k(u.input,L);u[0]=k(u[0],L);u.index=E.lastIndex;E.lastIndex+=u[0].length}else E.lastIndex=0;else S&&u&&(E.lastIndex=E.global?u.index+u[0].length:o);x&&u&&u.length>1&&i(y,u[0],a,(function(){for(h=1;h<arguments.length-2;h++)void 0===arguments[h]&&(u[h]=void 0)}));if(u&&M){u.groups=v=d(null);for(h=0;h<M.length;h++)v[(_=M[h])[0]]=u[_[1]]}return u});t.exports=m},9633:(t,r,a)=>{var i=a(5027);t.exports=function(){var t=i(this),r="";t.hasIndices&&(r+="d");t.global&&(r+="g");t.ignoreCase&&(r+="i");t.multiline&&(r+="m");t.dotAll&&(r+="s");t.unicode&&(r+="u");t.unicodeSets&&(r+="v");t.sticky&&(r+="y");return r}},3477:(t,r,a)=>{var i=a(2615),o=a(6812),l=a(3622),c=a(9633),u=RegExp.prototype;t.exports=function(t){var r=t.flags;return void 0!==r||"flags"in u||o(t,"flags")||!l(u,t)?r:i(c,t)}},7901:(t,r,a)=>{var i=a(3689),o=a(9037).RegExp,l=i((function(){var t=o("a","y");t.lastIndex=2;return null!==t.exec("abcd")})),c=l||i((function(){return!o("a","y").sticky})),u=l||i((function(){var t=o("^r","gy");t.lastIndex=2;return null!==t.exec("str")}));t.exports={BROKEN_CARET:u,MISSED_STICKY:c,UNSUPPORTED_Y:l}},2100:(t,r,a)=>{var i=a(3689),o=a(9037).RegExp;t.exports=i((function(){var t=o(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))},6422:(t,r,a)=>{var i=a(3689),o=a(9037).RegExp;t.exports=i((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},4684:(t,r,a)=>{var i=a(981),o=TypeError;t.exports=function(t){if(i(t))throw new o("Can't call method on "+t);return t}},517:(t,r,a)=>{var i=a(9037),o=a(7697),l=Object.getOwnPropertyDescriptor;t.exports=function(t){if(!o)return i[t];var r=l(i,t);return r&&r.value}},7610:(t,r,a)=>{var i=a(1034),o=a(8774),l=i.Set,c=i.add;t.exports=function(t){var r=new l;o(t,(function(t){c(r,t)}));return r}},7748:(t,r,a)=>{var i=a(29),o=a(1034),l=a(7610),c=a(7026),u=a(1074),h=a(8774),d=a(6704),p=o.has,v=o.remove;t.exports=function difference(t){var r=i(this),a=u(t),o=l(r);c(r)<=a.size?h(r,(function(t){a.includes(t)&&v(o,t)})):d(a.getIterator(),(function(t){p(r,t)&&v(o,t)}));return o}},1034:(t,r,a)=>{var i=a(8844),o=Set.prototype;t.exports={Set:Set,add:i(o.add),has:i(o.has),remove:i(o.delete),proto:o}},2948:(t,r,a)=>{var i=a(29),o=a(1034),l=a(7026),c=a(1074),u=a(8774),h=a(6704),d=o.Set,p=o.add,v=o.has;t.exports=function intersection(t){var r=i(this),a=c(t),o=new d;l(r)>a.size?h(a.getIterator(),(function(t){v(r,t)&&p(o,t)})):u(r,(function(t){a.includes(t)&&p(o,t)}));return o}},7795:(t,r,a)=>{var i=a(29),o=a(1034).has,l=a(7026),c=a(1074),u=a(8774),h=a(6704),d=a(2125);t.exports=function isDisjointFrom(t){var r=i(this),a=c(t);if(l(r)<=a.size)return!1!==u(r,(function(t){if(a.includes(t))return!1}),!0);var p=a.getIterator();return!1!==h(p,(function(t){if(o(r,t))return d(p,"normal",!1)}))}},6951:(t,r,a)=>{var i=a(29),o=a(7026),l=a(8774),c=a(1074);t.exports=function isSubsetOf(t){var r=i(this),a=c(t);return!(o(r)>a.size)&&!1!==l(r,(function(t){if(!a.includes(t))return!1}),!0)}},3894:(t,r,a)=>{var i=a(29),o=a(1034).has,l=a(7026),c=a(1074),u=a(6704),h=a(2125);t.exports=function isSupersetOf(t){var r=i(this),a=c(t);if(l(r)<a.size)return!1;var d=a.getIterator();return!1!==u(d,(function(t){if(!o(r,t))return h(d,"normal",!1)}))}},8774:(t,r,a)=>{var i=a(8844),o=a(6704),l=a(1034),c=l.Set,u=l.proto,h=i(u.forEach),d=i(u.keys),p=d(new c).next;t.exports=function(t,r,a){return a?o({iterator:d(t),next:p},r):h(t,r)}},3234:(t,r,a)=>{var i=a(6058),createSetLike=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};t.exports=function(t){var r=i("Set");try{(new r)[t](createSetLike(0));try{(new r)[t](createSetLike(-1));return!1}catch(t){return!0}}catch(t){return!1}}},7026:(t,r,a)=>{var i=a(2743),o=a(1034);t.exports=i(o.proto,"size","get")||function(t){return t.size}},4241:(t,r,a)=>{var i=a(6058),o=a(2148),l=a(4201),c=a(7697),u=l("species");t.exports=function(t){var r=i(t);c&&r&&!r[u]&&o(r,u,{configurable:!0,get:function(){return this}})}},2289:(t,r,a)=>{var i=a(29),o=a(1034),l=a(7610),c=a(1074),u=a(6704),h=o.add,d=o.has,p=o.remove;t.exports=function symmetricDifference(t){var r=i(this),a=c(t).getIterator(),o=l(r);u(a,(function(t){d(r,t)?p(o,t):h(o,t)}));return o}},5997:(t,r,a)=>{var i=a(2560).f,o=a(6812),l=a(4201)("toStringTag");t.exports=function(t,r,a){t&&!a&&(t=t.prototype);t&&!o(t,l)&&i(t,l,{configurable:!0,value:r})}},5674:(t,r,a)=>{var i=a(29),o=a(1034).add,l=a(7610),c=a(1074),u=a(6704);t.exports=function union(t){var r=i(this),a=c(t).getIterator(),h=l(r);u(a,(function(t){o(h,t)}));return h}},2713:(t,r,a)=>{var i=a(3430),o=a(4630),l=i("keys");t.exports=function(t){return l[t]||(l[t]=o(t))}},4091:(t,r,a)=>{var i=a(9037),o=a(5014),l="__core-js_shared__",c=i[l]||o(l,{});t.exports=c},3430:(t,r,a)=>{var i=a(3931),o=a(4091);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.35.1",mode:i?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE",source:"https://github.com/zloirock/core-js"})},6373:(t,r,a)=>{var i=a(5027),o=a(2655),l=a(981),c=a(4201)("species");t.exports=function(t,r){var a,u=i(t).constructor;return void 0===u||l(a=i(u)[c])?r:o(a)}},730:(t,r,a)=>{var i=a(8844),o=a(8700),l=a(4327),c=a(4684),u=i("".charAt),h=i("".charCodeAt),d=i("".slice),createMethod=function(t){return function(r,a){var i,p,v=l(c(r)),_=o(a),y=v.length;return _<0||_>=y?t?"":void 0:(i=h(v,_))<55296||i>56319||_+1===y||(p=h(v,_+1))<56320||p>57343?t?u(v,_):i:t?d(v,_,_+2):p-56320+(i-55296<<10)+65536}};t.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},5947:(t,r,a)=>{var i=a(71);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(i)},7254:(t,r,a)=>{var i=a(8844),o=a(3126),l=a(4327),c=a(534),u=a(4684),h=i(c),d=i("".slice),p=Math.ceil,createMethod=function(t){return function(r,a,i){var c,v,_=l(u(r)),y=o(a),g=_.length,m=void 0===i?" ":l(i);if(y<=g||""===m)return _;(v=h(m,p((c=y-g)/m.length))).length>c&&(v=d(v,0,c));return t?_+v:v+_}};t.exports={start:createMethod(!1),end:createMethod(!0)}},6430:(t,r,a)=>{var i=a(8844),o=2147483647,l=/[^\0-\u007E]/,c=/[.\u3002\uFF0E\uFF61]/g,u="Overflow: input needs wider integers to process",h=RangeError,d=i(c.exec),p=Math.floor,v=String.fromCharCode,_=i("".charCodeAt),y=i([].join),g=i([].push),m=i("".replace),b=i("".split),w=i("".toLowerCase),digitToBasic=function(t){return t+22+75*(t<26)},adapt=function(t,r,a){var i=0;t=a?p(t/700):t>>1;t+=p(t/r);for(;t>455;){t=p(t/35);i+=36}return p(i+36*t/(t+38))},encode=function(t){var r=[];t=function(t){for(var r=[],a=0,i=t.length;a<i;){var o=_(t,a++);if(o>=55296&&o<=56319&&a<i){var l=_(t,a++);if(56320==(64512&l))g(r,((1023&o)<<10)+(1023&l)+65536);else{g(r,o);a--}}else g(r,o)}return r}(t);var a,i,l=t.length,c=128,d=0,m=72;for(a=0;a<t.length;a++)(i=t[a])<128&&g(r,v(i));var b=r.length,w=b;b&&g(r,"-");for(;w<l;){var P=o;for(a=0;a<t.length;a++)(i=t[a])>=c&&i<P&&(P=i);var k=w+1;if(P-c>p((o-d)/k))throw new h(u);d+=(P-c)*k;c=P;for(a=0;a<t.length;a++){if((i=t[a])<c&&++d>o)throw new h(u);if(i===c){for(var S=d,A=36;;){var x=A<=m?1:A>=m+26?26:A-m;if(S<x)break;var E=S-x,I=36-x;g(r,v(digitToBasic(x+E%I)));S=p(E/I);A+=36}g(r,v(digitToBasic(S)));m=adapt(d,k,w===b);d=0;w++}}d++;c++}return y(r,"")};t.exports=function(t){var r,a,i=[],o=b(m(w(t),c,"."),".");for(r=0;r<o.length;r++){a=o[r];g(i,d(l,a)?"xn--"+encode(a):a)}return y(i,".")}},534:(t,r,a)=>{var i=a(8700),o=a(4327),l=a(4684),c=RangeError;t.exports=function repeat(t){var r=o(l(this)),a="",u=i(t);if(u<0||u===1/0)throw new c("Wrong number of repetitions");for(;u>0;(u>>>=1)&&(r+=r))1&u&&(a+=r);return a}},9558:(t,r,a)=>{var i=a(1435).end,o=a(5984);t.exports=o("trimEnd")?function trimEnd(){return i(this)}:"".trimEnd},5984:(t,r,a)=>{var i=a(1236).PROPER,o=a(3689),l=a(6350);t.exports=function(t){return o((function(){return!!l[t]()||"​…᠎"!=="​…᠎"[t]()||i&&l[t].name!==t}))}},1435:(t,r,a)=>{var i=a(8844),o=a(4684),l=a(4327),c=a(6350),u=i("".replace),h=RegExp("^["+c+"]+"),d=RegExp("(^|[^"+c+"])["+c+"]+$"),createMethod=function(t){return function(r){var a=l(o(r));1&t&&(a=u(a,h,""));2&t&&(a=u(a,d,"$1"));return a}};t.exports={start:createMethod(1),end:createMethod(2),trim:createMethod(3)}},3514:(t,r,a)=>{var i=a(9037),o=a(3689),l=a(3615),c=a(2532),u=a(8563),h=a(806),d=i.structuredClone;t.exports=!!d&&!o((function(){if(u&&l>92||h&&l>94||c&&l>97)return!1;var t=new ArrayBuffer(8),r=d(t,{transfer:[t]});return 0!==t.byteLength||8!==r.byteLength}))},146:(t,r,a)=>{var i=a(3615),o=a(3689),l=a(9037).String;t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol("symbol detection");return!l(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},3032:(t,r,a)=>{var i=a(2615),o=a(6058),l=a(4201),c=a(1880);t.exports=function(){var t=o("Symbol"),r=t&&t.prototype,a=r&&r.valueOf,u=l("toPrimitive");r&&!r[u]&&c(r,u,(function(t){return i(a,this)}),{arity:1})}},6549:(t,r,a)=>{var i=a(146);t.exports=i&&!!Symbol.for&&!!Symbol.keyFor},9886:(t,r,a)=>{var i,o,l,c,u=a(9037),h=a(1735),d=a(4071),p=a(9985),v=a(6812),_=a(3689),y=a(2688),g=a(6004),m=a(6420),b=a(1500),w=a(4764),P=a(806),k=u.setImmediate,S=u.clearImmediate,A=u.process,x=u.Dispatch,E=u.Function,I=u.MessageChannel,T=u.String,C=0,M={},G="onreadystatechange";_((function(){i=u.location}));var run=function(t){if(v(M,t)){var r=M[t];delete M[t];r()}},runner=function(t){return function(){run(t)}},eventListener=function(t){run(t.data)},globalPostMessageDefer=function(t){u.postMessage(T(t),i.protocol+"//"+i.host)};if(!k||!S){k=function setImmediate(t){b(arguments.length,1);var r=p(t)?t:E(t),a=g(arguments,1);M[++C]=function(){h(r,void 0,a)};o(C);return C};S=function clearImmediate(t){delete M[t]};if(P)o=function(t){A.nextTick(runner(t))};else if(x&&x.now)o=function(t){x.now(runner(t))};else if(I&&!w){c=(l=new I).port2;l.port1.onmessage=eventListener;o=d(c.postMessage,c)}else if(u.addEventListener&&p(u.postMessage)&&!u.importScripts&&i&&"file:"!==i.protocol&&!_(globalPostMessageDefer)){o=globalPostMessageDefer;u.addEventListener("message",eventListener,!1)}else o=G in m("script")?function(t){y.appendChild(m("script"))[G]=function(){y.removeChild(this);run(t)}}:function(t){setTimeout(runner(t),0)}}t.exports={set:k,clear:S}},3648:(t,r,a)=>{var i=a(8844);t.exports=i(1..valueOf)},7578:(t,r,a)=>{var i=a(8700),o=Math.max,l=Math.min;t.exports=function(t,r){var a=i(t);return a<0?o(a+r,0):l(a,r)}},1530:(t,r,a)=>{var i=a(8732),o=TypeError;t.exports=function(t){var r=i(t,"number");if("number"==typeof r)throw new o("Can't convert number to bigint");return BigInt(r)}},9842:(t,r,a)=>{var i=a(8700),o=a(3126),l=RangeError;t.exports=function(t){if(void 0===t)return 0;var r=i(t),a=o(r);if(r!==a)throw new l("Wrong length or index");return a}},5290:(t,r,a)=>{var i=a(4413),o=a(4684);t.exports=function(t){return i(o(t))}},8700:(t,r,a)=>{var i=a(8828);t.exports=function(t){var r=+t;return r!=r||0===r?0:i(r)}},3126:(t,r,a)=>{var i=a(8700),o=Math.min;t.exports=function(t){var r=i(t);return r>0?o(r,9007199254740991):0}},690:(t,r,a)=>{var i=a(4684),o=Object;t.exports=function(t){return o(i(t))}},3250:(t,r,a)=>{var i=a(5904),o=RangeError;t.exports=function(t,r){var a=i(t);if(a%r)throw new o("Wrong offset");return a}},5904:(t,r,a)=>{var i=a(8700),o=RangeError;t.exports=function(t){var r=i(t);if(r<0)throw new o("The argument can't be less than 0");return r}},8732:(t,r,a)=>{var i=a(2615),o=a(8999),l=a(734),c=a(4849),u=a(5899),h=a(4201),d=TypeError,p=h("toPrimitive");t.exports=function(t,r){if(!o(t)||l(t))return t;var a,h=c(t,p);if(h){void 0===r&&(r="default");a=i(h,t,r);if(!o(a)||l(a))return a;throw new d("Can't convert object to primitive value")}void 0===r&&(r="number");return u(t,r)}},8360:(t,r,a)=>{var i=a(8732),o=a(734);t.exports=function(t){var r=i(t,"string");return o(r)?r:r+""}},3043:(t,r,a)=>{var i={};i[a(4201)("toStringTag")]="z";t.exports="[object z]"===String(i)},4327:(t,r,a)=>{var i=a(926),o=String;t.exports=function(t){if("Symbol"===i(t))throw new TypeError("Cannot convert a Symbol value to a string");return o(t)}},7191:t=>{var r=Math.round;t.exports=function(t){var a=r(t);return a<0?0:a>255?255:255&a}},1905:(t,r,a)=>{var i=a(806);t.exports=function(t){try{if(i)return Function('return require("'+t+'")')()}catch(t){}}},3691:t=>{var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},1158:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(2615),c=a(7697),u=a(9800),h=a(4872),d=a(3999),p=a(767),v=a(5684),_=a(5773),y=a(1973),g=a(3126),m=a(9842),b=a(3250),w=a(7191),P=a(8360),k=a(6812),S=a(926),A=a(8999),x=a(734),E=a(5391),I=a(3622),T=a(9385),C=a(2741).f,M=a(1304),G=a(2960).forEach,O=a(4241),R=a(2148),L=a(2560),D=a(2474),j=a(9976),N=a(618),W=a(3457),H=N.get,B=N.set,z=N.enforce,U=L.f,q=D.f,V=o.RangeError,K=d.ArrayBuffer,Y=K.prototype,X=d.DataView,$=h.NATIVE_ARRAY_BUFFER_VIEWS,J=h.TYPED_ARRAY_TAG,Q=h.TypedArray,Z=h.TypedArrayPrototype,ee=h.isTypedArray,te="BYTES_PER_ELEMENT",re="Wrong length",addGetter=function(t,r){R(t,r,{configurable:!0,get:function(){return H(this)[r]}})},isArrayBuffer=function(t){var r;return I(Y,t)||"ArrayBuffer"===(r=S(t))||"SharedArrayBuffer"===r},isTypedArrayIndex=function(t,r){return ee(t)&&!x(r)&&r in t&&y(+r)&&r>=0},ne=function getOwnPropertyDescriptor(t,r){r=P(r);return isTypedArrayIndex(t,r)?v(2,t[r]):q(t,r)},ae=function defineProperty(t,r,a){r=P(r);if(isTypedArrayIndex(t,r)&&A(a)&&k(a,"value")&&!k(a,"get")&&!k(a,"set")&&!a.configurable&&(!k(a,"writable")||a.writable)&&(!k(a,"enumerable")||a.enumerable)){t[r]=a.value;return t}return U(t,r,a)};if(c){if(!$){D.f=ne;L.f=ae;addGetter(Z,"buffer");addGetter(Z,"byteOffset");addGetter(Z,"byteLength");addGetter(Z,"length")}i({target:"Object",stat:!0,forced:!$},{getOwnPropertyDescriptor:ne,defineProperty:ae});t.exports=function(t,r,a){var c=t.match(/\d+/)[0]/8,h=t+(a?"Clamped":"")+"Array",d="get"+t,v="set"+t,y=o[h],P=y,k=P&&P.prototype,S={},addElement=function(t,r){U(t,r,{get:function(){return function(t,r){var a=H(t);return a.view[d](r*c+a.byteOffset,!0)}(this,r)},set:function(t){return function(t,r,i){var o=H(t);o.view[v](r*c+o.byteOffset,a?w(i):i,!0)}(this,r,t)},enumerable:!0})};if($){if(u){P=r((function(t,r,a,i){p(t,k);return W(A(r)?isArrayBuffer(r)?void 0!==i?new y(r,b(a,c),i):void 0!==a?new y(r,b(a,c)):new y(r):ee(r)?j(P,r):l(M,P,r):new y(m(r)),t,P)}));T&&T(P,Q);G(C(y),(function(t){t in P||_(P,t,y[t])}));P.prototype=k}}else{P=r((function(t,r,a,i){p(t,k);var o,u,h,d=0,v=0;if(A(r)){if(!isArrayBuffer(r))return ee(r)?j(P,r):l(M,P,r);o=r;v=b(a,c);var _=r.byteLength;if(void 0===i){if(_%c)throw new V(re);if((u=_-v)<0)throw new V(re)}else if((u=g(i)*c)+v>_)throw new V(re);h=u/c}else{h=m(r);o=new K(u=h*c)}B(t,{buffer:o,byteOffset:v,byteLength:u,length:h,view:new X(o)});for(;d<h;)addElement(t,d++)}));T&&T(P,Q);k=P.prototype=E(Z)}k.constructor!==P&&_(k,"constructor",P);z(k).TypedArrayConstructor=P;J&&_(k,J,h);var x=P!==y;S[h]=P;i({global:!0,constructor:!0,forced:x,sham:!$},S);te in P||_(P,te,c);te in k||_(k,te,c);O(h)}}else t.exports=function(){}},9800:(t,r,a)=>{var i=a(9037),o=a(3689),l=a(6431),c=a(4872).NATIVE_ARRAY_BUFFER_VIEWS,u=i.ArrayBuffer,h=i.Int8Array;t.exports=!c||!o((function(){h(1)}))||!o((function(){new h(-1)}))||!l((function(t){new h;new h(null);new h(1.5);new h(t)}),!0)||o((function(){return 1!==new h(new u(2),1,void 0).length}))},716:(t,r,a)=>{var i=a(9976),o=a(7338);t.exports=function(t,r){return i(o(t),r)}},1304:(t,r,a)=>{var i=a(4071),o=a(2615),l=a(2655),c=a(690),u=a(6310),h=a(5185),d=a(1664),p=a(3292),v=a(9401),_=a(4872).aTypedArrayConstructor,y=a(1530);t.exports=function from(t){var r,a,g,m,b,w,P,k,S=l(this),A=c(t),x=arguments.length,E=x>1?arguments[1]:void 0,I=void 0!==E,T=d(A);if(T&&!p(T)){k=(P=h(A,T)).next;A=[];for(;!(w=o(k,P)).done;)A.push(w.value)}I&&x>2&&(E=i(E,arguments[2]));a=u(A);g=new(_(S))(a);m=v(g);for(r=0;a>r;r++){b=I?E(A[r],r):A[r];g[r]=m?y(b):+b}return g}},7338:(t,r,a)=>{var i=a(4872),o=a(6373),l=i.aTypedArrayConstructor,c=i.getTypedArrayConstructor;t.exports=function(t){return l(o(t,c(t)))}},4630:(t,r,a)=>{var i=a(8844),o=0,l=Math.random(),c=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+c(++o+l,36)}},6837:(t,r,a)=>{var i=a(3689),o=a(4201),l=a(7697),c=a(3931),u=o("iterator");t.exports=!i((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),r=t.searchParams,a=new URLSearchParams("a=1&a=2&b=3"),i="";t.pathname="c%20d";r.forEach((function(t,a){r.delete("b");i+=a+t}));a.delete("a",2);a.delete("b",void 0);return c&&(!t.toJSON||!a.has("a",1)||a.has("a",2)||!a.has("a",void 0)||a.has("b"))||!r.size&&(c||!l)||!r.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[u]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host}))},9525:(t,r,a)=>{var i=a(146);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5648:(t,r,a)=>{var i=a(7697),o=a(3689);t.exports=i&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1500:t=>{var r=TypeError;t.exports=function(t,a){if(t<a)throw new r("Not enough arguments");return t}},9834:(t,r,a)=>{var i=a(9037),o=a(9985),l=i.WeakMap;t.exports=o(l)&&/native code/.test(String(l))},5405:(t,r,a)=>{var i=a(496),o=a(6812),l=a(6145),c=a(2560).f;t.exports=function(t){var r=i.Symbol||(i.Symbol={});o(r,t)||c(r,t,{value:l.f(t)})}},6145:(t,r,a)=>{var i=a(4201);r.f=i},4201:(t,r,a)=>{var i=a(9037),o=a(3430),l=a(6812),c=a(4630),u=a(146),h=a(9525),d=i.Symbol,p=o("wks"),v=h?d.for||d:d&&d.withoutSetter||c;t.exports=function(t){l(p,t)||(p[t]=u&&l(d,t)?d[t]:v("Symbol."+t));return p[t]}},6350:t=>{t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},1064:(t,r,a)=>{var i=a(6058),o=a(6812),l=a(5773),c=a(3622),u=a(9385),h=a(8758),d=a(8055),p=a(3457),v=a(3841),_=a(2570),y=a(5411),g=a(7697),m=a(3931);t.exports=function(t,r,a,b){var w="stackTraceLimit",P=b?2:1,k=t.split("."),S=k[k.length-1],A=i.apply(null,k);if(A){var x=A.prototype;!m&&o(x,"cause")&&delete x.cause;if(!a)return A;var E=i("Error"),I=r((function(t,r){var a=v(b?r:t,void 0),i=b?new A(t):new A;void 0!==a&&l(i,"message",a);y(i,I,i.stack,2);this&&c(x,this)&&p(i,this,I);arguments.length>P&&_(i,arguments[P]);return i}));I.prototype=x;if("Error"!==S)u?u(I,E):h(I,E,{name:!0});else if(g&&w in A){d(I,A,w);d(I,A,"prepareStackTrace")}h(I,A);if(!m)try{x.name!==S&&l(x,"name",S);x.constructor=I}catch(t){}return I}}},2176:(t,r,a)=>{var i=a(9989),o=a(690),l=a(6310),c=a(8700),u=a(7370);i({target:"Array",proto:!0},{at:function at(t){var r=o(this),a=l(r),i=c(t),u=i>=0?i:a+i;return u<0||u>=a?void 0:r[u]}});u("at")},4338:(t,r,a)=>{var i=a(9989),o=a(3689),l=a(2297),c=a(8999),u=a(690),h=a(6310),d=a(5565),p=a(6522),v=a(7120),_=a(9042),y=a(4201),g=a(3615),m=y("isConcatSpreadable"),b=g>=51||!o((function(){var t=[];t[m]=!1;return t.concat()[0]!==t})),isConcatSpreadable=function(t){if(!c(t))return!1;var r=t[m];return void 0!==r?!!r:l(t)};i({target:"Array",proto:!0,arity:1,forced:!b||!_("concat")},{concat:function concat(t){var r,a,i,o,l,c=u(this),_=v(c,0),y=0;for(r=-1,i=arguments.length;r<i;r++)if(isConcatSpreadable(l=-1===r?c:arguments[r])){o=h(l);d(y+o);for(a=0;a<o;a++,y++)a in l&&p(_,y,l[a])}else{d(y+1);p(_,y++,l)}_.length=y;return _}})},1419:(t,r,a)=>{var i=a(9989),o=a(2872),l=a(7370);i({target:"Array",proto:!0},{fill:o});l("fill")},8077:(t,r,a)=>{var i=a(9989),o=a(2960).filter;i({target:"Array",proto:!0,forced:!a(9042)("filter")},{filter:function filter(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},9772:(t,r,a)=>{var i=a(9989),o=a(2960).findIndex,l=a(7370),c="findIndex",u=!0;c in[]&&Array(1)[c]((function(){u=!1}));i({target:"Array",proto:!0,forced:u},{findIndex:function findIndex(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}});l(c)},4564:(t,r,a)=>{var i=a(9989),o=a(7809),l=a(509),c=a(690),u=a(6310),h=a(7120);i({target:"Array",proto:!0},{flatMap:function flatMap(t){var r,a=c(this),i=u(a);l(t);(r=h(a,0)).length=o(r,a,a,i,0,1,t,arguments.length>1?arguments[1]:void 0);return r}})},7049:(t,r,a)=>{var i=a(9989),o=a(1055);i({target:"Array",stat:!0,forced:!a(6431)((function(t){Array.from(t)}))},{from:o})},6801:(t,r,a)=>{var i=a(9989),o=a(4328).includes,l=a(3689),c=a(7370);i({target:"Array",proto:!0,forced:l((function(){return!Array(1).includes()}))},{includes:function includes(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}});c("includes")},7195:(t,r,a)=>{var i=a(9989),o=a(6576),l=a(4328).indexOf,c=a(6834),u=o([].indexOf),h=!!u&&1/u([1],1,-0)<0;i({target:"Array",proto:!0,forced:h||!c("indexOf")},{indexOf:function indexOf(t){var r=arguments.length>1?arguments[1]:void 0;return h?u(this,t,r)||0:l(this,t,r)}})},752:(t,r,a)=>{var i=a(5290),o=a(7370),l=a(9478),c=a(618),u=a(2560).f,h=a(1934),d=a(7807),p=a(3931),v=a(7697),_="Array Iterator",y=c.set,g=c.getterFor(_);t.exports=h(Array,"Array",(function(t,r){y(this,{type:_,target:i(t),index:0,kind:r})}),(function(){var t=g(this),r=t.target,a=t.index++;if(!r||a>=r.length){t.target=void 0;return d(void 0,!0)}switch(t.kind){case"keys":return d(a,!1);case"values":return d(r[a],!1)}return d([a,r[a]],!1)}),"values");var m=l.Arguments=l.Array;o("keys");o("values");o("entries");if(!p&&v&&"values"!==m.name)try{u(m,"name",{value:"values"})}catch(t){}},2410:(t,r,a)=>{var i=a(9989),o=a(953);i({target:"Array",proto:!0,forced:o!==[].lastIndexOf},{lastIndexOf:o})},886:(t,r,a)=>{var i=a(9989),o=a(2960).map;i({target:"Array",proto:!0,forced:!a(9042)("map")},{map:function map(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},560:(t,r,a)=>{var i=a(9989),o=a(690),l=a(6310),c=a(5649),u=a(5565);i({target:"Array",proto:!0,arity:1,forced:a(3689)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function push(t){var r=o(this),a=l(r),i=arguments.length;u(a+i);for(var h=0;h<i;h++){r[a]=arguments[h];a++}c(r,a);return a}})},9730:(t,r,a)=>{var i=a(9989),o=a(2297),l=a(9429),c=a(8999),u=a(7578),h=a(6310),d=a(5290),p=a(6522),v=a(4201),_=a(9042),y=a(6004),g=_("slice"),m=v("species"),b=Array,w=Math.max;i({target:"Array",proto:!0,forced:!g},{slice:function slice(t,r){var a,i,v,_=d(this),g=h(_),P=u(t,g),k=u(void 0===r?g:r,g);if(o(_)){a=_.constructor;(l(a)&&(a===b||o(a.prototype))||c(a)&&null===(a=a[m]))&&(a=void 0);if(a===b||void 0===a)return y(_,P,k)}i=new(void 0===a?b:a)(w(k-P,0));for(v=0;P<k;P++,v++)P in _&&p(i,v,_[P]);i.length=v;return i}})},5137:(t,r,a)=>{var i=a(9989),o=a(8844),l=a(509),c=a(690),u=a(6310),h=a(8494),d=a(4327),p=a(3689),v=a(382),_=a(6834),y=a(7365),g=a(7298),m=a(3615),b=a(7922),w=[],P=o(w.sort),k=o(w.push),S=p((function(){w.sort(void 0)})),A=p((function(){w.sort(null)})),x=_("sort"),E=!p((function(){if(m)return m<70;if(!(y&&y>3)){if(g)return!0;if(b)return b<603;var t,r,a,i,o="";for(t=65;t<76;t++){r=String.fromCharCode(t);switch(t){case 66:case 69:case 70:case 72:a=3;break;case 68:case 71:a=4;break;default:a=2}for(i=0;i<47;i++)w.push({k:r+i,v:a})}w.sort((function(t,r){return r.v-t.v}));for(i=0;i<w.length;i++){r=w[i].k.charAt(0);o.charAt(o.length-1)!==r&&(o+=r)}return"DGBEFHACIJK"!==o}}));i({target:"Array",proto:!0,forced:S||!A||!x||!E},{sort:function sort(t){void 0!==t&&l(t);var r=c(this);if(E)return void 0===t?P(r):P(r,t);var a,i,o=[],p=u(r);for(i=0;i<p;i++)i in r&&k(o,r[i]);v(o,function(t){return function(r,a){return void 0===a?-1:void 0===r?1:void 0!==t?+t(r,a)||0:d(r)>d(a)?1:-1}}(t));a=u(o);i=0;for(;i<a;)r[i]=o[i++];for(;i<p;)h(r,i++);return r}})},2506:(t,r,a)=>{var i=a(9989),o=a(690),l=a(7578),c=a(8700),u=a(6310),h=a(5649),d=a(5565),p=a(7120),v=a(6522),_=a(8494),y=a(9042)("splice"),g=Math.max,m=Math.min;i({target:"Array",proto:!0,forced:!y},{splice:function splice(t,r){var a,i,y,b,w,P,k=o(this),S=u(k),A=l(t,S),x=arguments.length;if(0===x)a=i=0;else if(1===x){a=0;i=S-A}else{a=x-2;i=m(g(c(r),0),S-A)}d(S+a-i);y=p(k,i);for(b=0;b<i;b++)(w=A+b)in k&&v(y,b,k[w]);y.length=i;if(a<i){for(b=A;b<S-i;b++){P=b+a;(w=b+i)in k?k[P]=k[w]:_(k,P)}for(b=S;b>S-i+a;b--)_(k,b-1)}else if(a>i)for(b=S-i;b>A;b--){P=b+a-1;(w=b+i-1)in k?k[P]=k[w]:_(k,P)}for(b=0;b<a;b++)k[b+A]=arguments[b+2];h(k,S-i+a);return y}})},385:(t,r,a)=>{a(7370)("flatMap")},9903:(t,r,a)=>{var i=a(6812),o=a(1880),l=a(1797),c=a(4201)("toPrimitive"),u=Date.prototype;i(u,c)||o(u,c,l)},1057:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(1735),c=a(1064),u="WebAssembly",h=o[u],d=7!==new Error("e",{cause:7}).cause,exportGlobalErrorCauseWrapper=function(t,r){var a={};a[t]=c(t,r,d);i({global:!0,constructor:!0,arity:1,forced:d},a)},exportWebAssemblyErrorCauseWrapper=function(t,r){if(h&&h[t]){var a={};a[t]=c(u+"."+t,r,d);i({target:u,stat:!0,constructor:!0,arity:1,forced:d},a)}};exportGlobalErrorCauseWrapper("Error",(function(t){return function Error(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("EvalError",(function(t){return function EvalError(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("RangeError",(function(t){return function RangeError(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("ReferenceError",(function(t){return function ReferenceError(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("SyntaxError",(function(t){return function SyntaxError(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("TypeError",(function(t){return function TypeError(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("URIError",(function(t){return function URIError(r){return l(t,this,arguments)}}));exportWebAssemblyErrorCauseWrapper("CompileError",(function(t){return function CompileError(r){return l(t,this,arguments)}}));exportWebAssemblyErrorCauseWrapper("LinkError",(function(t){return function LinkError(r){return l(t,this,arguments)}}));exportWebAssemblyErrorCauseWrapper("RuntimeError",(function(t){return function RuntimeError(r){return l(t,this,arguments)}}))},5398:(t,r,a)=>{var i=a(9989),o=a(9037);i({global:!0,forced:o.globalThis!==o},{globalThis:o})},8324:(t,r,a)=>{var i=a(9989),o=a(6058),l=a(1735),c=a(2615),u=a(8844),h=a(3689),d=a(9985),p=a(734),v=a(6004),_=a(2643),y=a(146),g=String,m=o("JSON","stringify"),b=u(/./.exec),w=u("".charAt),P=u("".charCodeAt),k=u("".replace),S=u(1..toString),A=/[\uD800-\uDFFF]/g,x=/^[\uD800-\uDBFF]$/,E=/^[\uDC00-\uDFFF]$/,I=!y||h((function(){var t=o("Symbol")("stringify detection");return"[null]"!==m([t])||"{}"!==m({a:t})||"{}"!==m(Object(t))})),T=h((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),stringifyWithSymbolsFix=function(t,r){var a=v(arguments),i=_(r);if(d(i)||void 0!==t&&!p(t)){a[1]=function(t,r){d(i)&&(r=c(i,this,g(t),r));if(!p(r))return r};return l(m,null,a)}},fixIllFormed=function(t,r,a){var i=w(a,r-1),o=w(a,r+1);return b(x,t)&&!b(E,o)||b(E,t)&&!b(x,i)?"\\u"+S(P(t,0),16):t};m&&i({target:"JSON",stat:!0,arity:3,forced:I||T},{stringify:function stringify(t,r,a){var i=v(arguments),o=l(I?stringifyWithSymbolsFix:m,null,i);return T&&"string"==typeof o?k(o,A,fixIllFormed):o}})},7629:(t,r,a)=>{var i=a(9037);a(5997)(i.JSON,"JSON",!0)},9322:(t,r,a)=>{a(319)("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),a(800))},6646:(t,r,a)=>{a(9322)},5499:(t,r,a)=>{a(9989)({target:"Math",stat:!0},{fround:a(7788)})},9944:(t,r,a)=>{var i=a(9989),o=Math.hypot,l=Math.abs,c=Math.sqrt;i({target:"Math",stat:!0,arity:2,forced:!!o&&o(1/0,NaN)!==1/0},{hypot:function hypot(t,r){for(var a,i,o=0,u=0,h=arguments.length,d=0;u<h;)if(d<(a=l(arguments[u++]))){o=o*(i=d/a)*i+1;d=a}else o+=a>0?(i=a/d)*i:a;return d===1/0?1/0:d*c(o)}})},6976:(t,r,a)=>{a(9989)({target:"Math",stat:!0},{sign:a(5680)})},7509:(t,r,a)=>{a(5997)(Math,"Math",!0)},9288:(t,r,a)=>{var i=a(9989),o=a(3931),l=a(7697),c=a(9037),u=a(496),h=a(8844),d=a(5266),p=a(6812),v=a(3457),_=a(3622),y=a(734),g=a(8732),m=a(3689),b=a(2741).f,w=a(2474).f,P=a(2560).f,k=a(3648),S=a(1435).trim,A="Number",x=c[A],E=u[A],I=x.prototype,T=c.TypeError,C=h("".slice),M=h("".charCodeAt),toNumber=function(t){var r,a,i,o,l,c,u,h,d=g(t,"number");if(y(d))throw new T("Cannot convert a Symbol value to a number");if("string"==typeof d&&d.length>2){d=S(d);if(43===(r=M(d,0))||45===r){if(88===(a=M(d,2))||120===a)return NaN}else if(48===r){switch(M(d,1)){case 66:case 98:i=2;o=49;break;case 79:case 111:i=8;o=55;break;default:return+d}c=(l=C(d,2)).length;for(u=0;u<c;u++)if((h=M(l,u))<48||h>o)return NaN;return parseInt(l,i)}}return+d},G=d(A,!x(" 0o1")||!x("0b1")||x("+0x1")),O=function Number(t){var r,a=arguments.length<1?0:x(function(t){var r=g(t,"number");return"bigint"==typeof r?r:toNumber(r)}(t));return _(I,r=this)&&m((function(){k(r)}))?v(Object(a),this,O):a};O.prototype=I;G&&!o&&(I.constructor=O);i({global:!0,constructor:!0,wrap:!0,forced:G},{Number:O});var copyConstructorProperties=function(t,r){for(var a,i=l?b(r):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;i.length>o;o++)p(r,a=i[o])&&!p(t,a)&&P(t,a,w(r,a))};o&&E&&copyConstructorProperties(u[A],E);(G||o)&&copyConstructorProperties(u[A],x)},429:(t,r,a)=>{var i=a(9989),o=a(5394);i({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},6585:(t,r,a)=>{var i=a(9989),o=a(9419).entries;i({target:"Object",stat:!0},{entries:function entries(t){return o(t)}})},1830:(t,r,a)=>{var i=a(9989),o=a(1594),l=a(3689),c=a(8999),u=a(5375).onFreeze,h=Object.freeze;i({target:"Object",stat:!0,forced:l((function(){h(1)})),sham:!o},{freeze:function freeze(t){return h&&c(t)?h(u(t)):t}})},1919:(t,r,a)=>{var i=a(9989),o=a(3689),l=a(5290),c=a(2474).f,u=a(7697);i({target:"Object",stat:!0,forced:!u||o((function(){c(1)})),sham:!u},{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(t,r){return c(l(t),r)}})},9474:(t,r,a)=>{var i=a(9989),o=a(7697),l=a(9152),c=a(5290),u=a(2474),h=a(6522);i({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(t){for(var r,a,i=c(t),o=u.f,d=l(i),p={},v=0;d.length>v;)void 0!==(a=o(i,r=d[v++]))&&h(p,r,a);return p}})},9434:(t,r,a)=>{var i=a(9989),o=a(146),l=a(3689),c=a(7518),u=a(690);i({target:"Object",stat:!0,forced:!o||l((function(){c.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(t){var r=c.f;return r?r(u(t)):[]}})},8052:(t,r,a)=>{var i=a(9989),o=a(3689),l=a(690),c=a(1868),u=a(1748);i({target:"Object",stat:!0,forced:o((function(){c(1)})),sham:!u},{getPrototypeOf:function getPrototypeOf(t){return c(l(t))}})},9358:(t,r,a)=>{var i=a(9989),o=a(690),l=a(300);i({target:"Object",stat:!0,forced:a(3689)((function(){l(1)}))},{keys:function keys(t){return l(o(t))}})},228:(t,r,a)=>{var i=a(3043),o=a(1880),l=a(5073);i||o(Object.prototype,"toString",l,{unsafe:!0})},6466:(t,r,a)=>{var i=a(9989),o=a(9419).values;i({target:"Object",stat:!0},{values:function values(t){return o(t)}})},1195:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(509),c=a(8742),u=a(9302),h=a(8734);i({target:"Promise",stat:!0,forced:a(562)},{allSettled:function allSettled(t){var r=this,a=c.f(r),i=a.resolve,d=a.reject,p=u((function(){var a=l(r.resolve),c=[],u=0,d=1;h(t,(function(t){var l=u++,h=!1;d++;o(a,r,t).then((function(t){if(!h){h=!0;c[l]={status:"fulfilled",value:t};--d||i(c)}}),(function(t){if(!h){h=!0;c[l]={status:"rejected",reason:t};--d||i(c)}}))}));--d||i(c)}));p.error&&d(p.value);return a.promise}})},1692:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(509),c=a(8742),u=a(9302),h=a(8734);i({target:"Promise",stat:!0,forced:a(562)},{all:function all(t){var r=this,a=c.f(r),i=a.resolve,d=a.reject,p=u((function(){var a=l(r.resolve),c=[],u=0,p=1;h(t,(function(t){var l=u++,h=!1;p++;o(a,r,t).then((function(t){if(!h){h=!0;c[l]=t;--p||i(c)}}),d)}));--p||i(c)}));p.error&&d(p.value);return a.promise}})},5089:(t,r,a)=>{var i=a(9989),o=a(3931),l=a(7073).CONSTRUCTOR,c=a(7919),u=a(6058),h=a(9985),d=a(1880),p=c&&c.prototype;i({target:"Promise",proto:!0,forced:l,real:!0},{catch:function(t){return this.then(void 0,t)}});if(!o&&h(c)){var v=u("Promise").prototype.catch;p.catch!==v&&d(p,"catch",v,{unsafe:!0})}},6697:(t,r,a)=>{var i,o,l,c=a(9989),u=a(3931),h=a(806),d=a(9037),p=a(2615),v=a(1880),_=a(9385),y=a(5997),g=a(4241),m=a(509),b=a(9985),w=a(8999),P=a(767),k=a(6373),S=a(9886).set,A=a(231),x=a(920),E=a(9302),I=a(4410),T=a(618),C=a(7919),M=a(7073),G=a(8742),O="Promise",R=M.CONSTRUCTOR,L=M.REJECTION_EVENT,D=M.SUBCLASSING,j=T.getterFor(O),N=T.set,W=C&&C.prototype,H=C,B=W,z=d.TypeError,U=d.document,q=d.process,V=G.f,K=V,Y=!!(U&&U.createEvent&&d.dispatchEvent),X="unhandledrejection",isThenable=function(t){var r;return!(!w(t)||!b(r=t.then))&&r},callReaction=function(t,r){var a,i,o,l=r.value,c=1===r.state,u=c?t.ok:t.fail,h=t.resolve,d=t.reject,v=t.domain;try{if(u){if(!c){2===r.rejection&&onHandleUnhandled(r);r.rejection=1}if(!0===u)a=l;else{v&&v.enter();a=u(l);if(v){v.exit();o=!0}}a===t.promise?d(new z("Promise-chain cycle")):(i=isThenable(a))?p(i,a,h,d):h(a)}else d(l)}catch(t){v&&!o&&v.exit();d(t)}},notify=function(t,r){if(!t.notified){t.notified=!0;A((function(){for(var a,i=t.reactions;a=i.get();)callReaction(a,t);t.notified=!1;r&&!t.rejection&&onUnhandled(t)}))}},dispatchEvent=function(t,r,a){var i,o;if(Y){(i=U.createEvent("Event")).promise=r;i.reason=a;i.initEvent(t,!1,!0);d.dispatchEvent(i)}else i={promise:r,reason:a};!L&&(o=d["on"+t])?o(i):t===X&&x("Unhandled promise rejection",a)},onUnhandled=function(t){p(S,d,(function(){var r,a=t.facade,i=t.value;if(isUnhandled(t)){r=E((function(){h?q.emit("unhandledRejection",i,a):dispatchEvent(X,a,i)}));t.rejection=h||isUnhandled(t)?2:1;if(r.error)throw r.value}}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){p(S,d,(function(){var r=t.facade;h?q.emit("rejectionHandled",r):dispatchEvent("rejectionhandled",r,t.value)}))},bind=function(t,r,a){return function(i){t(r,i,a)}},internalReject=function(t,r,a){if(!t.done){t.done=!0;a&&(t=a);t.value=r;t.state=2;notify(t,!0)}},internalResolve=function(t,r,a){if(!t.done){t.done=!0;a&&(t=a);try{if(t.facade===r)throw new z("Promise can't be resolved itself");var i=isThenable(r);if(i)A((function(){var a={done:!1};try{p(i,r,bind(internalResolve,a,t),bind(internalReject,a,t))}catch(r){internalReject(a,r,t)}}));else{t.value=r;t.state=1;notify(t,!1)}}catch(r){internalReject({done:!1},r,t)}}};if(R){B=(H=function Promise(t){P(this,B);m(t);p(i,this);var r=j(this);try{t(bind(internalResolve,r),bind(internalReject,r))}catch(t){internalReject(r,t)}}).prototype;(i=function Promise(t){N(this,{type:O,done:!1,notified:!1,parent:!1,reactions:new I,rejection:!1,state:0,value:void 0})}).prototype=v(B,"then",(function then(t,r){var a=j(this),i=V(k(this,H));a.parent=!0;i.ok=!b(t)||t;i.fail=b(r)&&r;i.domain=h?q.domain:void 0;0===a.state?a.reactions.add(i):A((function(){callReaction(i,a)}));return i.promise}));o=function(){var t=new i,r=j(t);this.promise=t;this.resolve=bind(internalResolve,r);this.reject=bind(internalReject,r)};G.f=V=function(t){return t===H||undefined===t?new o(t):K(t)};if(!u&&b(C)&&W!==Object.prototype){l=W.then;D||v(W,"then",(function then(t,r){var a=this;return new H((function(t,r){p(l,a,t,r)})).then(t,r)}),{unsafe:!0});try{delete W.constructor}catch(t){}_&&_(W,B)}}c({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:H});y(H,O,!1,!0);g(O)},6409:(t,r,a)=>{var i=a(9989),o=a(3931),l=a(7919),c=a(3689),u=a(6058),h=a(9985),d=a(6373),p=a(2945),v=a(1880),_=l&&l.prototype;i({target:"Promise",proto:!0,real:!0,forced:!!l&&c((function(){_.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var r=d(this,u("Promise")),a=h(t);return this.then(a?function(a){return p(r,t()).then((function(){return a}))}:t,a?function(a){return p(r,t()).then((function(){throw a}))}:t)}});if(!o&&h(l)){var y=u("Promise").prototype.finally;_.finally!==y&&v(_,"finally",y,{unsafe:!0})}},3964:(t,r,a)=>{a(6697);a(1692);a(5089);a(8829);a(2092);a(7905)},8829:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(509),c=a(8742),u=a(9302),h=a(8734);i({target:"Promise",stat:!0,forced:a(562)},{race:function race(t){var r=this,a=c.f(r),i=a.reject,d=u((function(){var c=l(r.resolve);h(t,(function(t){o(c,r,t).then(a.resolve,i)}))}));d.error&&i(d.value);return a.promise}})},2092:(t,r,a)=>{var i=a(9989),o=a(8742);i({target:"Promise",stat:!0,forced:a(7073).CONSTRUCTOR},{reject:function reject(t){var r=o.f(this);(0,r.reject)(t);return r.promise}})},7905:(t,r,a)=>{var i=a(9989),o=a(6058),l=a(3931),c=a(7919),u=a(7073).CONSTRUCTOR,h=a(2945),d=o("Promise"),p=l&&!u;i({target:"Promise",stat:!0,forced:l||u},{resolve:function resolve(t){return h(p&&this===d?c:this,t)}})},50:(t,r,a)=>{var i=a(9989),o=a(6058),l=a(1735),c=a(6761),u=a(2655),h=a(5027),d=a(8999),p=a(5391),v=a(3689),_=o("Reflect","construct"),y=Object.prototype,g=[].push,m=v((function(){function F(){}return!(_((function(){}),[],F)instanceof F)})),b=!v((function(){_((function(){}))})),w=m||b;i({target:"Reflect",stat:!0,forced:w,sham:w},{construct:function construct(t,r){u(t);h(r);var a=arguments.length<3?t:u(arguments[2]);if(b&&!m)return _(t,r,a);if(t===a){switch(r.length){case 0:return new t;case 1:return new t(r[0]);case 2:return new t(r[0],r[1]);case 3:return new t(r[0],r[1],r[2]);case 4:return new t(r[0],r[1],r[2],r[3])}var i=[null];l(g,i,r);return new(l(c,t,i))}var o=a.prototype,v=p(d(o)?o:y),w=l(t,v,r);return d(w)?w:v}})},2349:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(8999),c=a(5027),u=a(6251),h=a(2474),d=a(1868);i({target:"Reflect",stat:!0},{get:function get(t,r){var a,i,p=arguments.length<3?t:arguments[2];return c(t)===p?t[r]:(a=h.f(t,r))?u(a)?a.value:void 0===a.get?void 0:o(a.get,p):l(i=d(t))?get(i,r,p):void 0}})},6034:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(5997);i({global:!0},{Reflect:{}});l(o.Reflect,"Reflect",!0)},2003:(t,r,a)=>{var i=a(7697),o=a(9037),l=a(8844),c=a(5266),u=a(3457),h=a(5773),d=a(5391),p=a(2741).f,v=a(3622),_=a(1245),y=a(4327),g=a(3477),m=a(7901),b=a(8055),w=a(1880),P=a(3689),k=a(6812),S=a(618).enforce,A=a(4241),x=a(4201),E=a(2100),I=a(6422),T=x("match"),C=o.RegExp,M=C.prototype,G=o.SyntaxError,O=l(M.exec),R=l("".charAt),L=l("".replace),D=l("".indexOf),j=l("".slice),N=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,W=/a/g,H=/a/g,B=new C(W)!==W,z=m.MISSED_STICKY,U=m.UNSUPPORTED_Y,q=i&&(!B||z||E||I||P((function(){H[T]=!1;return C(W)!==W||C(H)===H||"/a/i"!==String(C(W,"i"))})));if(c("RegExp",q)){for(var V=function RegExp(t,r){var a,i,o,l,c,p,m=v(M,this),b=_(t),w=void 0===r,P=[],A=t;if(!m&&b&&w&&t.constructor===V)return t;if(b||v(M,t)){t=t.source;w&&(r=g(A))}t=void 0===t?"":y(t);r=void 0===r?"":y(r);A=t;E&&"dotAll"in W&&(i=!!r&&D(r,"s")>-1)&&(r=L(r,/s/g,""));a=r;z&&"sticky"in W&&(o=!!r&&D(r,"y")>-1)&&U&&(r=L(r,/y/g,""));if(I){l=function(t){for(var r,a=t.length,i=0,o="",l=[],c=d(null),u=!1,h=!1,p=0,v="";i<=a;i++){if("\\"===(r=R(t,i)))r+=R(t,++i);else if("]"===r)u=!1;else if(!u)switch(!0){case"["===r:u=!0;break;case"("===r:if(O(N,j(t,i+1))){i+=2;h=!0}o+=r;p++;continue;case">"===r&&h:if(""===v||k(c,v))throw new G("Invalid capture group name");c[v]=!0;l[l.length]=[v,p];h=!1;v="";continue}h?v+=r:o+=r}return[o,l]}(t);t=l[0];P=l[1]}c=u(C(t,r),m?this:M,V);if(i||o||P.length){p=S(c);if(i){p.dotAll=!0;p.raw=V(function(t){for(var r,a=t.length,i=0,o="",l=!1;i<=a;i++)if("\\"!==(r=R(t,i)))if(l||"."!==r){"["===r?l=!0:"]"===r&&(l=!1);o+=r}else o+="[\\s\\S]";else o+=r+R(t,++i);return o}(t),a)}o&&(p.sticky=!0);P.length&&(p.groups=P)}if(t!==A)try{h(c,"source",""===A?"(?:)":A)}catch(t){}return c},K=p(C),Y=0;K.length>Y;)b(V,C,K[Y++]);M.constructor=V;V.prototype=M;w(o,"RegExp",V,{constructor:!0})}A("RegExp")},8518:(t,r,a)=>{var i=a(7697),o=a(2100),l=a(6648),c=a(2148),u=a(618).get,h=RegExp.prototype,d=TypeError;i&&o&&c(h,"dotAll",{configurable:!0,get:function dotAll(){if(this!==h){if("RegExp"===l(this))return!!u(this).dotAll;throw new d("Incompatible receiver, RegExp required")}}})},4043:(t,r,a)=>{var i=a(9989),o=a(6308);i({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},3440:(t,r,a)=>{var i=a(7697),o=a(7901).MISSED_STICKY,l=a(6648),c=a(2148),u=a(618).get,h=RegExp.prototype,d=TypeError;i&&o&&c(h,"sticky",{configurable:!0,get:function sticky(){if(this!==h){if("RegExp"===l(this))return!!u(this).sticky;throw new d("Incompatible receiver, RegExp required")}}})},7409:(t,r,a)=>{a(4043);var i=a(9989),o=a(2615),l=a(9985),c=a(5027),u=a(4327),h=function(){var t=!1,r=/[ac]/;r.exec=function(){t=!0;return/./.exec.apply(this,arguments)};return!0===r.test("abc")&&t}(),d=/./.test;i({target:"RegExp",proto:!0,forced:!h},{test:function(t){var r=c(this),a=u(t),i=r.exec;if(!l(i))return o(d,r,a);var h=o(i,r,a);if(null===h)return!1;c(h);return!0}})},2826:(t,r,a)=>{var i=a(1236).PROPER,o=a(1880),l=a(5027),c=a(4327),u=a(3689),h=a(3477),d="toString",p=RegExp.prototype,v=p[d],_=u((function(){return"/a/b"!==v.call({source:"a",flags:"b"})})),y=i&&v.name!==d;(_||y)&&o(p,d,(function toString(){var t=l(this);return"/"+c(t.source)+"/"+c(h(t))}),{unsafe:!0})},7985:(t,r,a)=>{a(319)("Set",(function(t){return function Set(){return t(this,arguments.length?arguments[0]:void 0)}}),a(800))},9649:(t,r,a)=>{a(7985)},7961:(t,r,a)=>{var i=a(9989),o=a(8844),l=a(4684),c=a(8700),u=a(4327),h=a(3689),d=o("".charAt);i({target:"String",proto:!0,forced:h((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function at(t){var r=u(l(this)),a=r.length,i=c(t),o=i>=0?i:a+i;return o<0||o>=a?void 0:d(r,o)}})},2918:(t,r,a)=>{var i,o=a(9989),l=a(6576),c=a(2474).f,u=a(3126),h=a(4327),d=a(2124),p=a(4684),v=a(7413),_=a(3931),y=l("".slice),g=Math.min,m=v("endsWith");o({target:"String",proto:!0,forced:!(!_&&!m&&!!(i=c(String.prototype,"endsWith"),i&&!i.writable))&&!m},{endsWith:function endsWith(t){var r=h(p(this));d(t);var a=arguments.length>1?arguments[1]:void 0,i=r.length,o=void 0===a?i:g(u(a),i),l=h(t);return y(r,o-l.length,o)===l}})},3843:(t,r,a)=>{var i=a(9989),o=a(8844),l=a(2124),c=a(4684),u=a(4327),h=a(7413),d=o("".indexOf);i({target:"String",proto:!0,forced:!h("includes")},{includes:function includes(t){return!!~d(u(c(this)),u(l(t)),arguments.length>1?arguments[1]:void 0)}})},1694:(t,r,a)=>{var i=a(730).charAt,o=a(4327),l=a(618),c=a(1934),u=a(7807),h="String Iterator",d=l.set,p=l.getterFor(h);c(String,"String",(function(t){d(this,{type:h,string:o(t),index:0})}),(function next(){var t,r=p(this),a=r.string,o=r.index;if(o>=a.length)return u(void 0,!0);t=i(a,o);r.index+=t.length;return u(t,!1)}))},2462:(t,r,a)=>{var i=a(2615),o=a(8678),l=a(5027),c=a(981),u=a(3126),h=a(4327),d=a(4684),p=a(4849),v=a(1514),_=a(6100);o("match",(function(t,r,a){return[function match(r){var a=d(this),o=c(r)?void 0:p(r,t);return o?i(o,r,a):new RegExp(r)[t](h(a))},function(t){var i=l(this),o=h(t),c=a(r,i,o);if(c.done)return c.value;if(!i.global)return _(i,o);var d=i.unicode;i.lastIndex=0;for(var p,y=[],g=0;null!==(p=_(i,o));){var m=h(p[0]);y[g]=m;""===m&&(i.lastIndex=v(o,u(i.lastIndex),d));g++}return 0===g?null:y}]}))},2940:(t,r,a)=>{var i=a(9989),o=a(7254).end;i({target:"String",proto:!0,forced:a(5947)},{padEnd:function padEnd(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},8472:(t,r,a)=>{var i=a(9989),o=a(7254).start;i({target:"String",proto:!0,forced:a(5947)},{padStart:function padStart(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},6532:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(8844),c=a(4684),u=a(9985),h=a(981),d=a(1245),p=a(4327),v=a(4849),_=a(3477),y=a(7017),g=a(4201),m=a(3931),b=g("replace"),w=TypeError,P=l("".indexOf),k=l("".replace),S=l("".slice),A=Math.max;i({target:"String",proto:!0},{replaceAll:function replaceAll(t,r){var a,i,l,g,x,E,I,T,C,M=c(this),G=0,O=0,R="";if(!h(t)){if(a=d(t)){i=p(c(_(t)));if(!~P(i,"g"))throw new w("`.replaceAll` does not allow non-global regexes")}if(l=v(t,b))return o(l,t,M,r);if(m&&a)return k(p(M),t,r)}g=p(M);x=p(t);(E=u(r))||(r=p(r));I=x.length;T=A(1,I);G=P(g,x);for(;-1!==G;){C=E?p(r(x,G,g)):y(x,g,G,[],void 0,r);R+=S(g,O,G)+C;O=G+I;G=G+T>g.length?-1:P(g,x,G+T)}O<g.length&&(R+=S(g,O));return R}})},7267:(t,r,a)=>{var i=a(1735),o=a(2615),l=a(8844),c=a(8678),u=a(3689),h=a(5027),d=a(9985),p=a(981),v=a(8700),_=a(3126),y=a(4327),g=a(4684),m=a(1514),b=a(4849),w=a(7017),P=a(6100),k=a(4201)("replace"),S=Math.max,A=Math.min,x=l([].concat),E=l([].push),I=l("".indexOf),T=l("".slice),C="$0"==="a".replace(/./,"$0"),M=!!/./[k]&&""===/./[k]("a","$0");c("replace",(function(t,r,a){var l=M?"$":"$0";return[function replace(t,a){var i=g(this),l=p(t)?void 0:b(t,k);return l?o(l,t,i,a):o(r,y(i),t,a)},function(t,o){var c=h(this),u=y(t);if("string"==typeof o&&-1===I(o,l)&&-1===I(o,"$<")){var p=a(r,c,u,o);if(p.done)return p.value}var g=d(o);g||(o=y(o));var b,k=c.global;if(k){b=c.unicode;c.lastIndex=0}for(var C,M=[];null!==(C=P(c,u));){E(M,C);if(!k)break;""===y(C[0])&&(c.lastIndex=m(u,_(c.lastIndex),b))}for(var G,O="",R=0,L=0;L<M.length;L++){for(var D,j=y((C=M[L])[0]),N=S(A(v(C.index),u.length),0),W=[],H=1;H<C.length;H++)E(W,void 0===(G=C[H])?G:String(G));var B=C.groups;if(g){var z=x([j],W,N,u);void 0!==B&&E(z,B);D=y(i(o,void 0,z))}else D=w(j,u,N,W,B,o);if(N>=R){O+=T(u,R,N)+D;R=N+j.length}}return O+T(u,R)}]}),!!u((function(){var t=/./;t.exec=function(){var t=[];t.groups={a:"7"};return t};return"7"!=="".replace(t,"$<a>")}))||!C||M)},9873:(t,r,a)=>{var i=a(2615),o=a(8844),l=a(8678),c=a(5027),u=a(981),h=a(4684),d=a(6373),p=a(1514),v=a(3126),_=a(4327),y=a(4849),g=a(6100),m=a(7901),b=a(3689),w=m.UNSUPPORTED_Y,P=Math.min,k=o([].push),S=o("".slice),A=!b((function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var a="ab".split(t);return 2!==a.length||"a"!==a[0]||"b"!==a[1]})),x="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;l("split",(function(t,r,a){var o="0".split(void 0,0).length?function(t,a){return void 0===t&&0===a?[]:i(r,this,t,a)}:r;return[function split(r,a){var l=h(this),c=u(r)?void 0:y(r,t);return c?i(c,r,l,a):i(o,_(l),r,a)},function(t,i){var l=c(this),u=_(t);if(!x){var h=a(o,l,u,i,o!==r);if(h.done)return h.value}var y=d(l,RegExp),m=l.unicode,b=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(w?"g":"y"),A=new y(w?"^(?:"+l.source+")":l,b),E=void 0===i?4294967295:i>>>0;if(0===E)return[];if(0===u.length)return null===g(A,u)?[u]:[];for(var I=0,T=0,C=[];T<u.length;){A.lastIndex=w?0:T;var M,G=g(A,w?S(u,T):u);if(null===G||(M=P(v(A.lastIndex+(w?T:0)),u.length))===I)T=p(u,T,m);else{k(C,S(u,I,T));if(C.length===E)return C;for(var O=1;O<=G.length-1;O++){k(C,G[O]);if(C.length===E)return C}T=I=M}}k(C,S(u,I));return C}]}),x||!A,w)},268:(t,r,a)=>{var i,o=a(9989),l=a(6576),c=a(2474).f,u=a(3126),h=a(4327),d=a(2124),p=a(4684),v=a(7413),_=a(3931),y=l("".slice),g=Math.min,m=v("startsWith");o({target:"String",proto:!0,forced:!(!_&&!m&&!!(i=c(String.prototype,"startsWith"),i&&!i.writable))&&!m},{startsWith:function startsWith(t){var r=h(p(this));d(t);var a=u(g(arguments.length>1?arguments[1]:void 0,r.length)),i=h(t);return y(r,a,a+i.length)===i}})},6386:(t,r,a)=>{a(1313);var i=a(9989),o=a(9558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==o},{trimEnd:o})},1313:(t,r,a)=>{var i=a(9989),o=a(9558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==o},{trimRight:o})},8436:(t,r,a)=>{var i=a(9989),o=a(1435).trim;i({target:"String",proto:!0,forced:a(5984)("trim")},{trim:function trim(){return o(this)}})},8373:(t,r,a)=>{a(5405)("asyncIterator")},7855:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(2615),c=a(8844),u=a(3931),h=a(7697),d=a(146),p=a(3689),v=a(6812),_=a(3622),y=a(5027),g=a(5290),m=a(8360),b=a(4327),w=a(5684),P=a(5391),k=a(300),S=a(2741),A=a(6062),x=a(7518),E=a(2474),I=a(2560),T=a(8920),C=a(9556),M=a(1880),G=a(2148),O=a(3430),R=a(2713),L=a(7248),D=a(4630),j=a(4201),N=a(6145),W=a(5405),H=a(3032),B=a(5997),z=a(618),U=a(2960).forEach,q=R("hidden"),V="Symbol",K="prototype",Y=z.set,X=z.getterFor(V),$=Object[K],J=o.Symbol,Q=J&&J[K],Z=o.RangeError,ee=o.TypeError,te=o.QObject,re=E.f,ne=I.f,ae=A.f,ie=C.f,oe=c([].push),se=O("symbols"),le=O("op-symbols"),ce=O("wks"),ue=!te||!te[K]||!te[K].findChild,fallbackDefineProperty=function(t,r,a){var i=re($,r);i&&delete $[r];ne(t,r,a);i&&t!==$&&ne($,r,i)},he=h&&p((function(){return 7!==P(ne({},"a",{get:function(){return ne(this,"a",{value:7}).a}})).a}))?fallbackDefineProperty:ne,wrap=function(t,r){var a=se[t]=P(Q);Y(a,{type:V,tag:t,description:r});h||(a.description=r);return a},de=function defineProperty(t,r,a){t===$&&de(le,r,a);y(t);var i=m(r);y(a);if(v(se,i)){if(a.enumerable){v(t,q)&&t[q][i]&&(t[q][i]=!1);a=P(a,{enumerable:w(0,!1)})}else{v(t,q)||ne(t,q,w(1,P(null)));t[q][i]=!0}return he(t,i,a)}return ne(t,i,a)},fe=function defineProperties(t,r){y(t);var a=g(r),i=k(a).concat($getOwnPropertySymbols(a));U(i,(function(r){h&&!l(pe,a,r)||de(t,r,a[r])}));return t},pe=function propertyIsEnumerable(t){var r=m(t),a=l(ie,this,r);return!(this===$&&v(se,r)&&!v(le,r))&&(!(a||!v(this,r)||!v(se,r)||v(this,q)&&this[q][r])||a)},ve=function getOwnPropertyDescriptor(t,r){var a=g(t),i=m(r);if(a!==$||!v(se,i)||v(le,i)){var o=re(a,i);!o||!v(se,i)||v(a,q)&&a[q][i]||(o.enumerable=!0);return o}},_e=function getOwnPropertyNames(t){var r=ae(g(t)),a=[];U(r,(function(t){v(se,t)||v(L,t)||oe(a,t)}));return a},$getOwnPropertySymbols=function(t){var r=t===$,a=ae(r?le:g(t)),i=[];U(a,(function(t){!v(se,t)||r&&!v($,t)||oe(i,se[t])}));return i};if(!d){M(Q=(J=function Symbol(){if(_(Q,this))throw new ee("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?b(arguments[0]):void 0,r=D(t),setter=function(t){var a=void 0===this?o:this;a===$&&l(setter,le,t);v(a,q)&&v(a[q],r)&&(a[q][r]=!1);var i=w(1,t);try{he(a,r,i)}catch(t){if(!(t instanceof Z))throw t;fallbackDefineProperty(a,r,i)}};h&&ue&&he($,r,{configurable:!0,set:setter});return wrap(r,t)})[K],"toString",(function toString(){return X(this).tag}));M(J,"withoutSetter",(function(t){return wrap(D(t),t)}));C.f=pe;I.f=de;T.f=fe;E.f=ve;S.f=A.f=_e;x.f=$getOwnPropertySymbols;N.f=function(t){return wrap(j(t),t)};if(h){G(Q,"description",{configurable:!0,get:function description(){return X(this).description}});u||M($,"propertyIsEnumerable",pe,{unsafe:!0})}}i({global:!0,constructor:!0,wrap:!0,forced:!d,sham:!d},{Symbol:J});U(k(ce),(function(t){W(t)}));i({target:V,stat:!0,forced:!d},{useSetter:function(){ue=!0},useSimple:function(){ue=!1}});i({target:"Object",stat:!0,forced:!d,sham:!h},{create:function create(t,r){return void 0===r?P(t):fe(P(t),r)},defineProperty:de,defineProperties:fe,getOwnPropertyDescriptor:ve});i({target:"Object",stat:!0,forced:!d},{getOwnPropertyNames:_e});H();B(J,V);L[q]=!0},6544:(t,r,a)=>{var i=a(9989),o=a(7697),l=a(9037),c=a(8844),u=a(6812),h=a(9985),d=a(3622),p=a(4327),v=a(2148),_=a(8758),y=l.Symbol,g=y&&y.prototype;if(o&&h(y)&&(!("description"in g)||void 0!==y().description)){var m={},b=function Symbol(){var t=arguments.length<1||void 0===arguments[0]?void 0:p(arguments[0]),r=d(g,this)?new y(t):void 0===t?y():y(t);""===t&&(m[r]=!0);return r};_(b,y);b.prototype=g;g.constructor=b;var w="Symbol(description detection)"===String(y("description detection")),P=c(g.valueOf),k=c(g.toString),S=/^Symbol\((.*)\)[^)]+$/,A=c("".replace),x=c("".slice);v(g,"description",{configurable:!0,get:function description(){var t=P(this);if(u(m,t))return"";var r=k(t),a=w?x(r,7,-1):A(r,S,"$1");return""===a?void 0:a}});i({global:!0,constructor:!0,forced:!0},{Symbol:b})}},3975:(t,r,a)=>{var i=a(9989),o=a(6058),l=a(6812),c=a(4327),u=a(3430),h=a(6549),d=u("string-to-symbol-registry"),p=u("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!h},{for:function(t){var r=c(t);if(l(d,r))return d[r];var a=o("Symbol")(r);d[r]=a;p[a]=r;return a}})},4254:(t,r,a)=>{a(5405)("iterator")},9749:(t,r,a)=>{a(7855);a(3975);a(1445);a(8324);a(9434)},1445:(t,r,a)=>{var i=a(9989),o=a(6812),l=a(734),c=a(3691),u=a(3430),h=a(6549),d=u("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!h},{keyFor:function keyFor(t){if(!l(t))throw new TypeError(c(t)+" is not a symbol");if(o(d,t))return d[t]}})},9373:(t,r,a)=>{var i=a(5405),o=a(3032);i("toPrimitive");o()},6793:(t,r,a)=>{var i=a(6058),o=a(5405),l=a(5997);o("toStringTag");l(i("Symbol"),"Symbol")},5194:(t,r,a)=>{var i=a(4872),o=a(6310),l=a(8700),c=i.aTypedArray;(0,i.exportTypedArrayMethod)("at",(function at(t){var r=c(this),a=o(r),i=l(t),u=i>=0?i:a+i;return u<0||u>=a?void 0:r[u]}))},6664:(t,r,a)=>{var i=a(8844),o=a(4872),l=i(a(357)),c=o.aTypedArray;(0,o.exportTypedArrayMethod)("copyWithin",(function copyWithin(t,r){return l(c(this),t,r,arguments.length>2?arguments[2]:void 0)}))},5980:(t,r,a)=>{var i=a(4872),o=a(2960).every,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("every",(function every(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},9943:(t,r,a)=>{var i=a(4872),o=a(2872),l=a(1530),c=a(926),u=a(2615),h=a(8844),d=a(3689),p=i.aTypedArray,v=i.exportTypedArrayMethod,_=h("".slice);v("fill",(function fill(t){var r=arguments.length;p(this);var a="Big"===_(c(this),0,3)?l(t):+t;return u(o,this,a,r>1?arguments[1]:void 0,r>2?arguments[2]:void 0)}),d((function(){var t=0;new Int8Array(2).fill({valueOf:function(){return t++}});return 1!==t})))},6089:(t,r,a)=>{var i=a(4872),o=a(2960).filter,l=a(716),c=i.aTypedArray;(0,i.exportTypedArrayMethod)("filter",(function filter(t){var r=o(c(this),t,arguments.length>1?arguments[1]:void 0);return l(this,r)}))},8690:(t,r,a)=>{var i=a(4872),o=a(2960).findIndex,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("findIndex",(function findIndex(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},82:(t,r,a)=>{var i=a(4872),o=a(1969).findLastIndex,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLastIndex",(function findLastIndex(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},522:(t,r,a)=>{var i=a(4872),o=a(1969).findLast,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLast",(function findLast(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},8539:(t,r,a)=>{var i=a(4872),o=a(2960).find,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("find",(function find(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},292:(t,r,a)=>{a(1158)("Float64",(function(t){return function Float64Array(r,a,i){return t(this,r,a,i)}}))},5385:(t,r,a)=>{var i=a(4872),o=a(2960).forEach,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("forEach",(function forEach(t){o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},5552:(t,r,a)=>{var i=a(4872),o=a(4328).includes,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("includes",(function includes(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},1803:(t,r,a)=>{var i=a(4872),o=a(4328).indexOf,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("indexOf",(function indexOf(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},854:(t,r,a)=>{a(1158)("Int32",(function(t){return function Int32Array(r,a,i){return t(this,r,a,i)}}))},1565:(t,r,a)=>{var i=a(9037),o=a(3689),l=a(8844),c=a(4872),u=a(752),h=a(4201)("iterator"),d=i.Uint8Array,p=l(u.values),v=l(u.keys),_=l(u.entries),y=c.aTypedArray,g=c.exportTypedArrayMethod,m=d&&d.prototype,b=!o((function(){m[h].call([1])})),w=!!m&&m.values&&m[h]===m.values&&"values"===m.values.name,P=function values(){return p(y(this))};g("entries",(function entries(){return _(y(this))}),b);g("keys",(function keys(){return v(y(this))}),b);g("values",P,b||!w,{name:"values"});g(h,P,b||!w,{name:"values"})},7987:(t,r,a)=>{var i=a(4872),o=a(8844),l=i.aTypedArray,c=i.exportTypedArrayMethod,u=o([].join);c("join",(function join(t){return u(l(this),t)}))},9365:(t,r,a)=>{var i=a(4872),o=a(1735),l=a(953),c=i.aTypedArray;(0,i.exportTypedArrayMethod)("lastIndexOf",(function lastIndexOf(t){var r=arguments.length;return o(l,c(this),r>1?[t,arguments[1]]:[t])}))},677:(t,r,a)=>{var i=a(4872),o=a(2960).map,l=a(7338),c=i.aTypedArray;(0,i.exportTypedArrayMethod)("map",(function map(t){return o(c(this),t,arguments.length>1?arguments[1]:void 0,(function(t,r){return new(l(t))(r)}))}))},1165:(t,r,a)=>{var i=a(4872),o=a(8820).right,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduceRight",(function reduceRight(t){var r=arguments.length;return o(l(this),t,r,r>1?arguments[1]:void 0)}))},8118:(t,r,a)=>{var i=a(4872),o=a(8820).left,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduce",(function reduce(t){var r=arguments.length;return o(l(this),t,r,r>1?arguments[1]:void 0)}))},1522:(t,r,a)=>{var i=a(4872),o=i.aTypedArray,l=i.exportTypedArrayMethod,c=Math.floor;l("reverse",(function reverse(){for(var t,r=this,a=o(r).length,i=c(a/2),l=0;l<i;){t=r[l];r[l++]=r[--a];r[a]=t}return r}))},1638:(t,r,a)=>{var i=a(9037),o=a(2615),l=a(4872),c=a(6310),u=a(3250),h=a(690),d=a(3689),p=i.RangeError,v=i.Int8Array,_=v&&v.prototype,y=_&&_.set,g=l.aTypedArray,m=l.exportTypedArrayMethod,b=!d((function(){var t=new Uint8ClampedArray(2);o(y,t,{length:1,0:3},1);return 3!==t[1]})),w=b&&l.NATIVE_ARRAY_BUFFER_VIEWS&&d((function(){var t=new v(2);t.set(1);t.set("2",1);return 0!==t[0]||2!==t[1]}));m("set",(function set(t){g(this);var r=u(arguments.length>1?arguments[1]:void 0,1),a=h(t);if(b)return o(y,this,a,r);var i=this.length,l=c(a),d=0;if(l+r>i)throw new p("Wrong length");for(;d<l;)this[r+d]=a[d++]}),!b||w)},4797:(t,r,a)=>{var i=a(4872),o=a(7338),l=a(3689),c=a(6004),u=i.aTypedArray;(0,i.exportTypedArrayMethod)("slice",(function slice(t,r){for(var a=c(u(this),t,r),i=o(this),l=0,h=a.length,d=new i(h);h>l;)d[l]=a[l++];return d}),l((function(){new Int8Array(1).slice()})))},7300:(t,r,a)=>{var i=a(4872),o=a(2960).some,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("some",(function some(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},3356:(t,r,a)=>{var i=a(9037),o=a(6576),l=a(3689),c=a(509),u=a(382),h=a(4872),d=a(7365),p=a(7298),v=a(3615),_=a(7922),y=h.aTypedArray,g=h.exportTypedArrayMethod,m=i.Uint16Array,b=m&&o(m.prototype.sort),w=!(!b||l((function(){b(new m(2),null)}))&&l((function(){b(new m(2),{})}))),P=!!b&&!l((function(){if(v)return v<74;if(d)return d<67;if(p)return!0;if(_)return _<602;var t,r,a=new m(516),i=Array(516);for(t=0;t<516;t++){r=t%4;a[t]=515-t;i[t]=t-2*r+3}b(a,(function(t,r){return(t/4|0)-(r/4|0)}));for(t=0;t<516;t++)if(a[t]!==i[t])return!0}));g("sort",(function sort(t){void 0!==t&&c(t);return P?b(this,t):u(y(this),function(t){return function(r,a){return void 0!==t?+t(r,a)||0:a!=a?-1:r!=r?1:0===r&&0===a?1/r>0&&1/a<0?1:-1:r>a}}(t))}),!P||w)},9724:(t,r,a)=>{var i=a(9037),o=a(1735),l=a(4872),c=a(3689),u=a(6004),h=i.Int8Array,d=l.aTypedArray,p=l.exportTypedArrayMethod,v=[].toLocaleString,_=!!h&&c((function(){v.call(new h(1))}));p("toLocaleString",(function toLocaleString(){return o(v,_?u(d(this)):d(this),u(arguments))}),c((function(){return[1,2].toLocaleString()!==new h([1,2]).toLocaleString()}))||!c((function(){h.prototype.toLocaleString.call([1,2])})))},4224:(t,r,a)=>{var i=a(6166),o=a(4872),l=o.aTypedArray,c=o.exportTypedArrayMethod,u=o.getTypedArrayConstructor;c("toReversed",(function toReversed(){return i(l(this),u(this))}))},1121:(t,r,a)=>{var i=a(4872),o=a(8844),l=a(509),c=a(9976),u=i.aTypedArray,h=i.getTypedArrayConstructor,d=i.exportTypedArrayMethod,p=o(i.TypedArrayPrototype.sort);d("toSorted",(function toSorted(t){void 0!==t&&l(t);var r=u(this),a=c(h(r),r);return p(a,t)}))},9901:(t,r,a)=>{var i=a(4872).exportTypedArrayMethod,o=a(3689),l=a(9037),c=a(8844),u=l.Uint8Array,h=u&&u.prototype||{},d=[].toString,p=c([].join);o((function(){d.call({})}))&&(d=function toString(){return p(this)});var v=h.toString!==d;i("toString",d,v)},8557:(t,r,a)=>{a(1158)("Uint32",(function(t){return function Uint32Array(r,a,i){return t(this,r,a,i)}}))},8607:(t,r,a)=>{a(1158)("Uint8",(function(t){return function Uint8Array(r,a,i){return t(this,r,a,i)}}))},7133:(t,r,a)=>{var i=a(6134),o=a(4872),l=a(9401),c=a(8700),u=a(1530),h=o.aTypedArray,d=o.getTypedArrayConstructor,p=o.exportTypedArrayMethod,v=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}();p("with",{with:function(t,r){var a=h(this),o=c(t),p=l(a)?u(r):+r;return i(a,d(a),o,p)}}.with,!v)},5164:(t,r,a)=>{var i,o=a(1594),l=a(9037),c=a(8844),u=a(6045),h=a(5375),d=a(319),p=a(637),v=a(8999),_=a(618).enforce,y=a(3689),g=a(9834),m=Object,b=Array.isArray,w=m.isExtensible,P=m.isFrozen,k=m.isSealed,S=m.freeze,A=m.seal,x=!l.ActiveXObject&&"ActiveXObject"in l,wrapper=function(t){return function WeakMap(){return t(this,arguments.length?arguments[0]:void 0)}},E=d("WeakMap",wrapper,p),I=E.prototype,T=c(I.set);if(g)if(x){i=p.getConstructor(wrapper,"WeakMap",!0);h.enable();var C=c(I.delete),M=c(I.has),G=c(I.get);u(I,{delete:function(t){if(v(t)&&!w(t)){var r=_(this);r.frozen||(r.frozen=new i);return C(this,t)||r.frozen.delete(t)}return C(this,t)},has:function has(t){if(v(t)&&!w(t)){var r=_(this);r.frozen||(r.frozen=new i);return M(this,t)||r.frozen.has(t)}return M(this,t)},get:function get(t){if(v(t)&&!w(t)){var r=_(this);r.frozen||(r.frozen=new i);return M(this,t)?G(this,t):r.frozen.get(t)}return G(this,t)},set:function set(t,r){if(v(t)&&!w(t)){var a=_(this);a.frozen||(a.frozen=new i);M(this,t)?T(this,t,r):a.frozen.set(t,r)}else T(this,t,r);return this}})}else o&&y((function(){var t=S([]);T(new E,t,1);return!P(t)}))&&u(I,{set:function set(t,r){var a;b(t)&&(P(t)?a=S:k(t)&&(a=A));T(this,t,r);a&&a(t);return this}})},1090:(t,r,a)=>{a(5164)},7884:(t,r,a)=>{a(319)("WeakSet",(function(t){return function WeakSet(){return t(this,arguments.length?arguments[0]:void 0)}}),a(637))},414:(t,r,a)=>{a(7884)},6247:(t,r,a)=>{var i=a(7697),o=a(2148),l=a(2961),c=ArrayBuffer.prototype;i&&!("detached"in c)&&o(c,"detached",{configurable:!0,get:function detached(){return l(this)}})},3097:(t,r,a)=>{var i=a(9989),o=a(9195);o&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function transferToFixedLength(){return o(this,arguments.length?arguments[0]:void 0,!1)}})},1412:(t,r,a)=>{var i=a(9989),o=a(9195);o&&i({target:"ArrayBuffer",proto:!0},{transfer:function transfer(){return o(this,arguments.length?arguments[0]:void 0,!0)}})},7602:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(767),c=a(5027),u=a(9985),h=a(1868),d=a(2148),p=a(6522),v=a(3689),_=a(6812),y=a(4201),g=a(2013).IteratorPrototype,m=a(7697),b=a(3931),w="constructor",P="Iterator",k=y("toStringTag"),S=TypeError,A=o[P],x=b||!u(A)||A.prototype!==g||!v((function(){A({})})),E=function Iterator(){l(this,g);if(h(this)===g)throw new S("Abstract class Iterator not directly constructable")},defineIteratorPrototypeAccessor=function(t,r){m?d(g,t,{configurable:!0,get:function(){return r},set:function(r){c(this);if(this===g)throw new S("You can't redefine this property");_(this,t)?this[t]=r:p(this,t,r)}}):g[t]=r};_(g,k)||defineIteratorPrototypeAccessor(k,P);!x&&_(g,w)&&g[w]!==Object||defineIteratorPrototypeAccessor(w,E);E.prototype=g;i({global:!0,constructor:!0,forced:x},{Iterator:E})},6054:(t,r,a)=>{var i=a(9989),o=a(8734),l=a(509),c=a(5027),u=a(2302);i({target:"Iterator",proto:!0,real:!0},{every:function every(t){c(this);l(t);var r=u(this),a=0;return!o(r,(function(r,i){if(!t(r,a++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3476:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(509),c=a(5027),u=a(2302),h=a(5419),d=a(1228),p=a(3931),v=h((function(){for(var t,r,a=this.iterator,i=this.predicate,l=this.next;;){t=c(o(l,a));if(this.done=!!t.done)return;r=t.value;if(d(a,i,[r,this.counter++],!0))return r}}));i({target:"Iterator",proto:!0,real:!0,forced:p},{filter:function filter(t){c(this);l(t);return new v(u(this),{predicate:t})}})},9411:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(509),c=a(5027),u=a(2302),h=a(6752),d=a(5419),p=a(2125),v=a(3931),_=d((function(){for(var t,r,a=this.iterator,i=this.mapper;;){if(r=this.inner)try{if(!(t=c(o(r.next,r.iterator))).done)return t.value;this.inner=null}catch(t){p(a,"throw",t)}t=c(o(this.next,a));if(this.done=!!t.done)return;try{this.inner=h(i(t.value,this.counter++),!1)}catch(t){p(a,"throw",t)}}}));i({target:"Iterator",proto:!0,real:!0,forced:v},{flatMap:function flatMap(t){c(this);l(t);return new _(u(this),{mapper:t,inner:null})}})},5:(t,r,a)=>{var i=a(9989),o=a(8734),l=a(509),c=a(5027),u=a(2302);i({target:"Iterator",proto:!0,real:!0},{forEach:function forEach(t){c(this);l(t);var r=u(this),a=0;o(r,(function(r){t(r,a++)}),{IS_RECORD:!0})}})},1792:(t,r,a)=>{var i=a(9989),o=a(8983);i({target:"Iterator",proto:!0,real:!0,forced:a(3931)},{map:o})},8244:(t,r,a)=>{var i=a(9989),o=a(8734),l=a(509),c=a(5027),u=a(2302);i({target:"Iterator",proto:!0,real:!0},{some:function some(t){c(this);l(t);var r=u(this),a=0;return o(r,(function(r,i){if(t(r,a++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},691:(t,r,a)=>{var i=a(9989),o=a(7697),l=a(9037),c=a(6058),u=a(8844),h=a(2615),d=a(9985),p=a(8999),v=a(2297),_=a(6812),y=a(4327),g=a(6310),m=a(6522),b=a(3689),w=a(6675),P=a(146),k=l.JSON,S=l.Number,A=l.SyntaxError,x=k&&k.parse,E=c("Object","keys"),I=Object.getOwnPropertyDescriptor,T=u("".charAt),C=u("".slice),M=u(/./.exec),G=u([].push),O=/^\d$/,R=/^[1-9]$/,L=/^(?:-|\d)$/,D=/^[\t\n\r ]$/,internalize=function(t,r,a,i){var o,l,c,u,d,y=t[r],m=i&&y===i.value,b=m&&"string"==typeof i.source?{source:i.source}:{};if(p(y)){var w=v(y),P=m?i.nodes:w?[]:{};if(w){o=P.length;c=g(y);for(u=0;u<c;u++)internalizeProperty(y,u,internalize(y,""+u,a,u<o?P[u]:void 0))}else{l=E(y);c=g(l);for(u=0;u<c;u++){d=l[u];internalizeProperty(y,d,internalize(y,d,a,_(P,d)?P[d]:void 0))}}}return h(a,t,r,y,b)},internalizeProperty=function(t,r,a){if(o){var i=I(t,r);if(i&&!i.configurable)return}void 0===a?delete t[r]:m(t,r,a)},Node=function(t,r,a,i){this.value=t;this.end=r;this.source=a;this.nodes=i},Context=function(t,r){this.source=t;this.index=r};Context.prototype={fork:function(t){return new Context(this.source,t)},parse:function(){var t=this.source,r=this.skip(D,this.index),a=this.fork(r),i=T(t,r);if(M(L,i))return a.number();switch(i){case"{":return a.object();case"[":return a.array();case'"':return a.string();case"t":return a.keyword(!0);case"f":return a.keyword(!1);case"n":return a.keyword(null)}throw new A('Unexpected character: "'+i+'" at: '+r)},node:function(t,r,a,i,o){return new Node(r,i,t?null:C(this.source,a,i),o)},object:function(){for(var t=this.source,r=this.index+1,a=!1,i={},o={};r<t.length;){r=this.until(['"',"}"],r);if("}"===T(t,r)&&!a){r++;break}var l=this.fork(r).string(),c=l.value;r=l.end;r=this.until([":"],r)+1;r=this.skip(D,r);l=this.fork(r).parse();m(o,c,l);m(i,c,l.value);r=this.until([",","}"],l.end);var u=T(t,r);if(","===u){a=!0;r++}else if("}"===u){r++;break}}return this.node(1,i,this.index,r,o)},array:function(){for(var t=this.source,r=this.index+1,a=!1,i=[],o=[];r<t.length;){r=this.skip(D,r);if("]"===T(t,r)&&!a){r++;break}var l=this.fork(r).parse();G(o,l);G(i,l.value);r=this.until([",","]"],l.end);if(","===T(t,r)){a=!0;r++}else if("]"===T(t,r)){r++;break}}return this.node(1,i,this.index,r,o)},string:function(){var t=this.index,r=w(this.source,this.index+1);return this.node(0,r.value,t,r.end)},number:function(){var t=this.source,r=this.index,a=r;"-"===T(t,a)&&a++;if("0"===T(t,a))a++;else{if(!M(R,T(t,a)))throw new A("Failed to parse number at: "+a);a=this.skip(O,++a)}"."===T(t,a)&&(a=this.skip(O,++a));if("e"===T(t,a)||"E"===T(t,a)){a++;"+"!==T(t,a)&&"-"!==T(t,a)||a++;if(a===(a=this.skip(O,a)))throw new A("Failed to parse number's exponent value at: "+a)}return this.node(0,S(C(t,r,a)),r,a)},keyword:function(t){var r=""+t,a=this.index,i=a+r.length;if(C(this.source,a,i)!==r)throw new A("Failed to parse value at: "+a);return this.node(0,t,a,i)},skip:function(t,r){for(var a=this.source;r<a.length&&M(t,T(a,r));r++);return r},until:function(t,r){r=this.skip(D,r);for(var a=T(this.source,r),i=0;i<t.length;i++)if(t[i]===a)return r;throw new A('Unexpected character: "'+a+'" at: '+r)}};var j=b((function(){var t,r="9007199254740993";x(r,(function(r,a,i){t=i.source}));return t!==r})),N=P&&!b((function(){return 1/x("-0 \t")!=-1/0}));i({target:"JSON",stat:!0,forced:j},{parse:function parse(t,r){return N&&!d(r)?x(t):function(t,r){t=y(t);var a=new Context(t,0,""),i=a.parse(),o=i.value,l=a.skip(D,i.end);if(l<t.length)throw new A('Unexpected extra character: "'+T(t,l)+'" after the parsed data at: '+l);return d(r)?internalize({"":o},"",r,i):o}(t,r)}})},5716:(t,r,a)=>{var i=a(9989),o=a(7748);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("difference")},{difference:o})},3442:(t,r,a)=>{var i=a(9989),o=a(3689),l=a(2948);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("intersection")||o((function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))}))},{intersection:l})},1964:(t,r,a)=>{var i=a(9989),o=a(7795);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("isDisjointFrom")},{isDisjointFrom:o})},9878:(t,r,a)=>{var i=a(9989),o=a(6951);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("isSubsetOf")},{isSubsetOf:o})},2915:(t,r,a)=>{var i=a(9989),o=a(3894);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("isSupersetOf")},{isSupersetOf:o})},7895:(t,r,a)=>{var i=a(9989),o=a(2289);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("symmetricDifference")},{symmetricDifference:o})},2275:(t,r,a)=>{var i=a(9989),o=a(5674);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("union")},{union:o})},7522:(t,r,a)=>{var i=a(9037),o=a(6338),l=a(3265),c=a(7612),u=a(5773),handlePrototype=function(t){if(t&&t.forEach!==c)try{u(t,"forEach",c)}catch(r){t.forEach=c}};for(var h in o)o[h]&&handlePrototype(i[h]&&i[h].prototype);handlePrototype(l)},6265:(t,r,a)=>{var i=a(9037),o=a(6338),l=a(3265),c=a(752),u=a(5773),h=a(5997),d=a(4201)("iterator"),p=c.values,handlePrototype=function(t,r){if(t){if(t[d]!==p)try{u(t,d,p)}catch(r){t[d]=p}h(t,r,!0);if(o[r])for(var a in c)if(t[a]!==c[a])try{u(t,a,c[a])}catch(r){t[a]=c[a]}}};for(var v in o)handlePrototype(i[v]&&i[v].prototype,v);handlePrototype(l,"DOMTokenList")},7337:(t,r,a)=>{var i=a(9989),o=a(1905),l=a(6058),c=a(3689),u=a(5391),h=a(5684),d=a(2560).f,p=a(1880),v=a(2148),_=a(6812),y=a(767),g=a(5027),m=a(445),b=a(3841),w=a(7136),P=a(6610),k=a(618),S=a(7697),A=a(3931),x="DOMException",E="DATA_CLONE_ERR",I=l("Error"),T=l(x)||function(){try{(new(l("MessageChannel")||o("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(t){if(t.name===E&&25===t.code)return t.constructor}}(),C=T&&T.prototype,M=I.prototype,G=k.set,O=k.getterFor(x),R="stack"in new I(x),codeFor=function(t){return _(w,t)&&w[t].m?w[t].c:0},L=function DOMException(){y(this,D);var t=arguments.length,r=b(t<1?void 0:arguments[0]),a=b(t<2?void 0:arguments[1],"Error"),i=codeFor(a);G(this,{type:x,name:a,message:r,code:i});if(!S){this.name=a;this.message=r;this.code=i}if(R){var o=new I(r);o.name=x;d(this,"stack",h(1,P(o.stack,1)))}},D=L.prototype=u(M),createGetterDescriptor=function(t){return{enumerable:!0,configurable:!0,get:t}},getterFor=function(t){return createGetterDescriptor((function(){return O(this)[t]}))};if(S){v(D,"code",getterFor("code"));v(D,"message",getterFor("message"));v(D,"name",getterFor("name"))}d(D,"constructor",h(1,L));var j=c((function(){return!(new T instanceof I)})),N=j||c((function(){return M.toString!==m||"2: 1"!==String(new T(1,2))})),W=j||c((function(){return 25!==new T(1,"DataCloneError").code})),H=j||25!==T[E]||25!==C[E],B=A?N||W||H:j;i({global:!0,constructor:!0,forced:B},{DOMException:B?L:T});var z=l(x),U=z.prototype;N&&(A||T===z)&&p(U,"toString",m);W&&S&&T===z&&v(U,"code",createGetterDescriptor((function(){return codeFor(g(this).name)})));for(var q in w)if(_(w,q)){var V=w[q],K=V.s,Y=h(6,V.c);_(z,K)||d(z,K,Y);_(U,K)||d(U,K,Y)}},3429:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(6058),c=a(5684),u=a(2560).f,h=a(6812),d=a(767),p=a(3457),v=a(3841),_=a(7136),y=a(6610),g=a(7697),m=a(3931),b="DOMException",w=l("Error"),P=l(b),k=function DOMException(){d(this,S);var t=arguments.length,r=v(t<1?void 0:arguments[0]),a=v(t<2?void 0:arguments[1],"Error"),i=new P(r,a),o=new w(r);o.name=b;u(i,"stack",c(1,y(o.stack,1)));p(i,this,k);return i},S=k.prototype=P.prototype,A="stack"in new w(b),x="stack"in new P(1,2),E=P&&g&&Object.getOwnPropertyDescriptor(o,b),I=!(!E||E.writable&&E.configurable),T=A&&!I&&!x;i({global:!0,constructor:!0,forced:m||T},{DOMException:T?k:P});var C=l(b),M=C.prototype;if(M.constructor!==C){m||u(M,"constructor",c(1,C));for(var G in _)if(h(_,G)){var O=_[G],R=O.s;h(C,R)||u(C,R,c(6,O.c))}}},7462:(t,r,a)=>{var i=a(6058),o="DOMException";a(5997)(i(o),o)},3650:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(2148),c=a(7697),u=TypeError,h=Object.defineProperty,d=o.self!==o;try{if(c){var p=Object.getOwnPropertyDescriptor(o,"self");!d&&p&&p.get&&p.enumerable||l(o,"self",{get:function self(){return o},set:function self(t){if(this!==o)throw new u("Illegal invocation");h(o,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else i({global:!0,simple:!0,forced:d},{self:o})}catch(t){}},2625:(t,r,a)=>{a(752);var i=a(9989),o=a(9037),l=a(517),c=a(2615),u=a(8844),h=a(7697),d=a(6837),p=a(1880),v=a(2148),_=a(6045),y=a(5997),g=a(974),m=a(618),b=a(767),w=a(9985),P=a(6812),k=a(4071),S=a(926),A=a(5027),x=a(8999),E=a(4327),I=a(5391),T=a(5684),C=a(5185),M=a(1664),G=a(7807),O=a(1500),R=a(4201),L=a(382),D=R("iterator"),j="URLSearchParams",N=j+"Iterator",W=m.set,H=m.getterFor(j),B=m.getterFor(N),z=l("fetch"),U=l("Request"),q=l("Headers"),V=U&&U.prototype,K=q&&q.prototype,Y=o.RegExp,X=o.TypeError,$=o.decodeURIComponent,J=o.encodeURIComponent,Q=u("".charAt),Z=u([].join),ee=u([].push),te=u("".replace),re=u([].shift),ne=u([].splice),ae=u("".split),ie=u("".slice),oe=/\+/g,se=Array(4),percentSequence=function(t){return se[t-1]||(se[t-1]=Y("((?:%[\\da-f]{2}){"+t+"})","gi"))},percentDecode=function(t){try{return $(t)}catch(r){return t}},deserialize=function(t){var r=te(t,oe," "),a=4;try{return $(r)}catch(t){for(;a;)r=te(r,percentSequence(a--),percentDecode);return r}},le=/[!'()~]|%20/g,ce={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(t){return ce[t]},serialize=function(t){return te(J(t),le,replacer)},ue=g((function Iterator(t,r){W(this,{type:N,target:H(t).entries,index:0,kind:r})}),j,(function next(){var t=B(this),r=t.target,a=t.index++;if(!r||a>=r.length){t.target=void 0;return G(void 0,!0)}var i=r[a];switch(t.kind){case"keys":return G(i.key,!1);case"values":return G(i.value,!1)}return G([i.key,i.value],!1)}),!0),URLSearchParamsState=function(t){this.entries=[];this.url=null;void 0!==t&&(x(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===Q(t,0)?ie(t,1):t:E(t)))};URLSearchParamsState.prototype={type:j,bindURL:function(t){this.url=t;this.update()},parseObject:function(t){var r,a,i,o,l,u,h,d=this.entries,p=M(t);if(p){a=(r=C(t,p)).next;for(;!(i=c(a,r)).done;){l=(o=C(A(i.value))).next;if((u=c(l,o)).done||(h=c(l,o)).done||!c(l,o).done)throw new X("Expected sequence with length 2");ee(d,{key:E(u.value),value:E(h.value)})}}else for(var v in t)P(t,v)&&ee(d,{key:v,value:E(t[v])})},parseQuery:function(t){if(t)for(var r,a,i=this.entries,o=ae(t,"&"),l=0;l<o.length;)if((r=o[l++]).length){a=ae(r,"=");ee(i,{key:deserialize(re(a)),value:deserialize(Z(a,"="))})}},serialize:function(){for(var t,r=this.entries,a=[],i=0;i<r.length;){t=r[i++];ee(a,serialize(t.key)+"="+serialize(t.value))}return Z(a,"&")},update:function(){this.entries.length=0;this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var he=function URLSearchParams(){b(this,de);var t=W(this,new URLSearchParamsState(arguments.length>0?arguments[0]:void 0));h||(this.size=t.entries.length)},de=he.prototype;_(de,{append:function append(t,r){var a=H(this);O(arguments.length,2);ee(a.entries,{key:E(t),value:E(r)});h||this.length++;a.updateURL()},delete:function(t){for(var r=H(this),a=O(arguments.length,1),i=r.entries,o=E(t),l=a<2?void 0:arguments[1],c=void 0===l?l:E(l),u=0;u<i.length;){var d=i[u];if(d.key!==o||void 0!==c&&d.value!==c)u++;else{ne(i,u,1);if(void 0!==c)break}}h||(this.size=i.length);r.updateURL()},get:function get(t){var r=H(this).entries;O(arguments.length,1);for(var a=E(t),i=0;i<r.length;i++)if(r[i].key===a)return r[i].value;return null},getAll:function getAll(t){var r=H(this).entries;O(arguments.length,1);for(var a=E(t),i=[],o=0;o<r.length;o++)r[o].key===a&&ee(i,r[o].value);return i},has:function has(t){for(var r=H(this).entries,a=O(arguments.length,1),i=E(t),o=a<2?void 0:arguments[1],l=void 0===o?o:E(o),c=0;c<r.length;){var u=r[c++];if(u.key===i&&(void 0===l||u.value===l))return!0}return!1},set:function set(t,r){var a=H(this);O(arguments.length,1);for(var i,o=a.entries,l=!1,c=E(t),u=E(r),d=0;d<o.length;d++)if((i=o[d]).key===c)if(l)ne(o,d--,1);else{l=!0;i.value=u}l||ee(o,{key:c,value:u});h||(this.size=o.length);a.updateURL()},sort:function sort(){var t=H(this);L(t.entries,(function(t,r){return t.key>r.key?1:-1}));t.updateURL()},forEach:function forEach(t){for(var r,a=H(this).entries,i=k(t,arguments.length>1?arguments[1]:void 0),o=0;o<a.length;)i((r=a[o++]).value,r.key,this)},keys:function keys(){return new ue(this,"keys")},values:function values(){return new ue(this,"values")},entries:function entries(){return new ue(this,"entries")}},{enumerable:!0});p(de,D,de.entries,{name:"entries"});p(de,"toString",(function toString(){return H(this).serialize()}),{enumerable:!0});h&&v(de,"size",{get:function size(){return H(this).entries.length},configurable:!0,enumerable:!0});y(he,j);i({global:!0,constructor:!0,forced:!d},{URLSearchParams:he});if(!d&&w(q)){var fe=u(K.has),pe=u(K.set),wrapRequestOptions=function(t){if(x(t)){var r,a=t.body;if(S(a)===j){r=t.headers?new q(t.headers):new q;fe(r,"content-type")||pe(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8");return I(t,{body:T(0,E(a)),headers:T(0,r)})}}return t};w(z)&&i({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function fetch(t){return z(t,arguments.length>1?wrapRequestOptions(arguments[1]):{})}});if(w(U)){var ve=function Request(t){b(this,V);return new U(t,arguments.length>1?wrapRequestOptions(arguments[1]):{})};V.constructor=ve;ve.prototype=V;i({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ve})}}t.exports={URLSearchParams:he,getState:H}},8858:(t,r,a)=>{var i=a(1880),o=a(8844),l=a(4327),c=a(1500),u=URLSearchParams,h=u.prototype,d=o(h.append),p=o(h.delete),v=o(h.forEach),_=o([].push),y=new u("a=1&a=2&b=3");y.delete("a",1);y.delete("b",void 0);y+""!="a=2"&&i(h,"delete",(function(t){var r=arguments.length,a=r<2?void 0:arguments[1];if(r&&void 0===a)return p(this,t);var i=[];v(this,(function(t,r){_(i,{key:r,value:t})}));c(r,1);for(var o,u=l(t),h=l(a),y=0,g=0,m=!1,b=i.length;y<b;){o=i[y++];if(m||o.key===u){m=!0;p(this,o.key)}else g++}for(;g<b;)(o=i[g++]).key===u&&o.value===h||d(this,o.key,o.value)}),{enumerable:!0,unsafe:!0})},1318:(t,r,a)=>{var i=a(1880),o=a(8844),l=a(4327),c=a(1500),u=URLSearchParams,h=u.prototype,d=o(h.getAll),p=o(h.has),v=new u("a=1");!v.has("a",2)&&v.has("a",void 0)||i(h,"has",(function has(t){var r=arguments.length,a=r<2?void 0:arguments[1];if(r&&void 0===a)return p(this,t);var i=d(this,t);c(r,1);for(var o=l(a),u=0;u<i.length;)if(i[u++]===o)return!0;return!1}),{enumerable:!0,unsafe:!0})},9307:(t,r,a)=>{a(2625)},3228:(t,r,a)=>{var i=a(7697),o=a(8844),l=a(2148),c=URLSearchParams.prototype,u=o(c.forEach);i&&!("size"in c)&&l(c,"size",{get:function size(){var t=0;u(this,(function(){t++}));return t},configurable:!0,enumerable:!0})},9391:(t,r,a)=>{a(1694);var i,o=a(9989),l=a(7697),c=a(6837),u=a(9037),h=a(4071),d=a(8844),p=a(1880),v=a(2148),_=a(767),y=a(6812),g=a(5394),m=a(1055),b=a(6004),w=a(730).codeAt,P=a(6430),k=a(4327),S=a(5997),A=a(1500),x=a(2625),E=a(618),I=E.set,T=E.getterFor("URL"),C=x.URLSearchParams,M=x.getState,G=u.URL,O=u.TypeError,R=u.parseInt,L=Math.floor,D=Math.pow,j=d("".charAt),N=d(/./.exec),W=d([].join),H=d(1..toString),B=d([].pop),z=d([].push),U=d("".replace),q=d([].shift),V=d("".split),K=d("".slice),Y=d("".toLowerCase),X=d([].unshift),$="Invalid scheme",J="Invalid host",Q="Invalid port",Z=/[a-z]/i,ee=/[\d+-.a-z]/i,te=/\d/,re=/^0x/i,ne=/^[0-7]+$/,ae=/^\d+$/,ie=/^[\da-f]+$/i,oe=/[\0\t\n\r #%/:<>?@[\\\]^|]/,se=/[\0\t\n\r #/:<>?@[\\\]^|]/,le=/^[\u0000-\u0020]+/,ce=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ue=/[\t\n\r]/g,serializeHost=function(t){var r,a,i,o;if("number"==typeof t){r=[];for(a=0;a<4;a++){X(r,t%256);t=L(t/256)}return W(r,".")}if("object"==typeof t){r="";i=function(t){for(var r=null,a=1,i=null,o=0,l=0;l<8;l++)if(0!==t[l]){if(o>a){r=i;a=o}i=null;o=0}else{null===i&&(i=l);++o}if(o>a){r=i;a=o}return r}(t);for(a=0;a<8;a++)if(!o||0!==t[a]){o&&(o=!1);if(i===a){r+=a?":":"::";o=!0}else{r+=H(t[a],16);a<7&&(r+=":")}}return"["+r+"]"}return t},he={},de=g({},he,{" ":1,'"':1,"<":1,">":1,"`":1}),fe=g({},de,{"#":1,"?":1,"{":1,"}":1}),pe=g({},fe,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(t,r){var a=w(t,0);return a>32&&a<127&&!y(r,t)?t:encodeURIComponent(t)},ve={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(t,r){var a;return 2===t.length&&N(Z,j(t,0))&&(":"===(a=j(t,1))||!r&&"|"===a)},startsWithWindowsDriveLetter=function(t){var r;return t.length>1&&isWindowsDriveLetter(K(t,0,2))&&(2===t.length||"/"===(r=j(t,2))||"\\"===r||"?"===r||"#"===r)},isSingleDot=function(t){return"."===t||"%2e"===Y(t)},_e={},ye={},ge={},me={},be={},we={},Pe={},ke={},Se={},Fe={},Ae={},xe={},Ee={},Ie={},Te={},Ce={},Me={},Ge={},Oe={},Re={},Le={},URLState=function(t,r,a){var i,o,l,c=k(t);if(r){if(o=this.parse(c))throw new O(o);this.searchParams=null}else{void 0!==a&&(i=new URLState(a,!0));if(o=this.parse(c,null,i))throw new O(o);(l=M(new C)).bindURL(this);this.searchParams=l}};URLState.prototype={type:"URL",parse:function(t,r,a){var o,l,c,u,h,d=this,p=r||_e,v=0,_="",g=!1,w=!1,P=!1;t=k(t);if(!r){d.scheme="";d.username="";d.password="";d.host=null;d.port=null;d.path=[];d.query=null;d.fragment=null;d.cannotBeABaseURL=!1;t=U(t,le,"");t=U(t,ce,"$1")}t=U(t,ue,"");o=m(t);for(;v<=o.length;){l=o[v];switch(p){case _e:if(!l||!N(Z,l)){if(r)return $;p=ge;continue}_+=Y(l);p=ye;break;case ye:if(l&&(N(ee,l)||"+"===l||"-"===l||"."===l))_+=Y(l);else{if(":"!==l){if(r)return $;_="";p=ge;v=0;continue}if(r&&(d.isSpecial()!==y(ve,_)||"file"===_&&(d.includesCredentials()||null!==d.port)||"file"===d.scheme&&!d.host))return;d.scheme=_;if(r){d.isSpecial()&&ve[d.scheme]===d.port&&(d.port=null);return}_="";if("file"===d.scheme)p=Ie;else if(d.isSpecial()&&a&&a.scheme===d.scheme)p=me;else if(d.isSpecial())p=ke;else if("/"===o[v+1]){p=be;v++}else{d.cannotBeABaseURL=!0;z(d.path,"");p=Oe}}break;case ge:if(!a||a.cannotBeABaseURL&&"#"!==l)return $;if(a.cannotBeABaseURL&&"#"===l){d.scheme=a.scheme;d.path=b(a.path);d.query=a.query;d.fragment="";d.cannotBeABaseURL=!0;p=Le;break}p="file"===a.scheme?Ie:we;continue;case me:if("/"!==l||"/"!==o[v+1]){p=we;continue}p=Se;v++;break;case be:if("/"===l){p=Fe;break}p=Ge;continue;case we:d.scheme=a.scheme;if(l===i){d.username=a.username;d.password=a.password;d.host=a.host;d.port=a.port;d.path=b(a.path);d.query=a.query}else if("/"===l||"\\"===l&&d.isSpecial())p=Pe;else if("?"===l){d.username=a.username;d.password=a.password;d.host=a.host;d.port=a.port;d.path=b(a.path);d.query="";p=Re}else{if("#"!==l){d.username=a.username;d.password=a.password;d.host=a.host;d.port=a.port;d.path=b(a.path);d.path.length--;p=Ge;continue}d.username=a.username;d.password=a.password;d.host=a.host;d.port=a.port;d.path=b(a.path);d.query=a.query;d.fragment="";p=Le}break;case Pe:if(!d.isSpecial()||"/"!==l&&"\\"!==l){if("/"!==l){d.username=a.username;d.password=a.password;d.host=a.host;d.port=a.port;p=Ge;continue}p=Fe}else p=Se;break;case ke:p=Se;if("/"!==l||"/"!==j(_,v+1))continue;v++;break;case Se:if("/"!==l&&"\\"!==l){p=Fe;continue}break;case Fe:if("@"===l){g&&(_="%40"+_);g=!0;c=m(_);for(var S=0;S<c.length;S++){var A=c[S];if(":"!==A||P){var x=percentEncode(A,pe);P?d.password+=x:d.username+=x}else P=!0}_=""}else if(l===i||"/"===l||"?"===l||"#"===l||"\\"===l&&d.isSpecial()){if(g&&""===_)return"Invalid authority";v-=m(_).length+1;_="";p=Ae}else _+=l;break;case Ae:case xe:if(r&&"file"===d.scheme){p=Ce;continue}if(":"!==l||w){if(l===i||"/"===l||"?"===l||"#"===l||"\\"===l&&d.isSpecial()){if(d.isSpecial()&&""===_)return J;if(r&&""===_&&(d.includesCredentials()||null!==d.port))return;if(u=d.parseHost(_))return u;_="";p=Me;if(r)return;continue}"["===l?w=!0:"]"===l&&(w=!1);_+=l}else{if(""===_)return J;if(u=d.parseHost(_))return u;_="";p=Ee;if(r===xe)return}break;case Ee:if(!N(te,l)){if(l===i||"/"===l||"?"===l||"#"===l||"\\"===l&&d.isSpecial()||r){if(""!==_){var E=R(_,10);if(E>65535)return Q;d.port=d.isSpecial()&&E===ve[d.scheme]?null:E;_=""}if(r)return;p=Me;continue}return Q}_+=l;break;case Ie:d.scheme="file";if("/"===l||"\\"===l)p=Te;else{if(!a||"file"!==a.scheme){p=Ge;continue}switch(l){case i:d.host=a.host;d.path=b(a.path);d.query=a.query;break;case"?":d.host=a.host;d.path=b(a.path);d.query="";p=Re;break;case"#":d.host=a.host;d.path=b(a.path);d.query=a.query;d.fragment="";p=Le;break;default:if(!startsWithWindowsDriveLetter(W(b(o,v),""))){d.host=a.host;d.path=b(a.path);d.shortenPath()}p=Ge;continue}}break;case Te:if("/"===l||"\\"===l){p=Ce;break}a&&"file"===a.scheme&&!startsWithWindowsDriveLetter(W(b(o,v),""))&&(isWindowsDriveLetter(a.path[0],!0)?z(d.path,a.path[0]):d.host=a.host);p=Ge;continue;case Ce:if(l===i||"/"===l||"\\"===l||"?"===l||"#"===l){if(!r&&isWindowsDriveLetter(_))p=Ge;else if(""===_){d.host="";if(r)return;p=Me}else{if(u=d.parseHost(_))return u;"localhost"===d.host&&(d.host="");if(r)return;_="";p=Me}continue}_+=l;break;case Me:if(d.isSpecial()){p=Ge;if("/"!==l&&"\\"!==l)continue}else if(r||"?"!==l)if(r||"#"!==l){if(l!==i){p=Ge;if("/"!==l)continue}}else{d.fragment="";p=Le}else{d.query="";p=Re}break;case Ge:if(l===i||"/"===l||"\\"===l&&d.isSpecial()||!r&&("?"===l||"#"===l)){if(".."===(h=Y(h=_))||"%2e."===h||".%2e"===h||"%2e%2e"===h){d.shortenPath();"/"===l||"\\"===l&&d.isSpecial()||z(d.path,"")}else if(isSingleDot(_))"/"===l||"\\"===l&&d.isSpecial()||z(d.path,"");else{if("file"===d.scheme&&!d.path.length&&isWindowsDriveLetter(_)){d.host&&(d.host="");_=j(_,0)+":"}z(d.path,_)}_="";if("file"===d.scheme&&(l===i||"?"===l||"#"===l))for(;d.path.length>1&&""===d.path[0];)q(d.path);if("?"===l){d.query="";p=Re}else if("#"===l){d.fragment="";p=Le}}else _+=percentEncode(l,fe);break;case Oe:if("?"===l){d.query="";p=Re}else if("#"===l){d.fragment="";p=Le}else l!==i&&(d.path[0]+=percentEncode(l,he));break;case Re:if(r||"#"!==l)l!==i&&("'"===l&&d.isSpecial()?d.query+="%27":d.query+="#"===l?"%23":percentEncode(l,he));else{d.fragment="";p=Le}break;case Le:l!==i&&(d.fragment+=percentEncode(l,de))}v++}},parseHost:function(t){var r,a,i;if("["===j(t,0)){if("]"!==j(t,t.length-1))return J;r=function(t){var r,a,i,o,l,c,u,h=[0,0,0,0,0,0,0,0],d=0,p=null,v=0,chr=function(){return j(t,v)};if(":"===chr()){if(":"!==j(t,1))return;v+=2;p=++d}for(;chr();){if(8===d)return;if(":"!==chr()){r=a=0;for(;a<4&&N(ie,chr());){r=16*r+R(chr(),16);v++;a++}if("."===chr()){if(0===a)return;v-=a;if(d>6)return;i=0;for(;chr();){o=null;if(i>0){if(!("."===chr()&&i<4))return;v++}if(!N(te,chr()))return;for(;N(te,chr());){l=R(chr(),10);if(null===o)o=l;else{if(0===o)return;o=10*o+l}if(o>255)return;v++}h[d]=256*h[d]+o;2!=++i&&4!==i||d++}if(4!==i)return;break}if(":"===chr()){v++;if(!chr())return}else if(chr())return;h[d++]=r}else{if(null!==p)return;v++;p=++d}}if(null!==p){c=d-p;d=7;for(;0!==d&&c>0;){u=h[d];h[d--]=h[p+c-1];h[p+--c]=u}}else if(8!==d)return;return h}(K(t,1,-1));if(!r)return J;this.host=r}else if(this.isSpecial()){t=P(t);if(N(oe,t))return J;r=function(t){var r,a,i,o,l,c,u,h=V(t,".");h.length&&""===h[h.length-1]&&h.length--;if((r=h.length)>4)return t;a=[];for(i=0;i<r;i++){if(""===(o=h[i]))return t;l=10;if(o.length>1&&"0"===j(o,0)){l=N(re,o)?16:8;o=K(o,8===l?1:2)}if(""===o)c=0;else{if(!N(10===l?ae:8===l?ne:ie,o))return t;c=R(o,l)}z(a,c)}for(i=0;i<r;i++){c=a[i];if(i===r-1){if(c>=D(256,5-r))return null}else if(c>255)return null}u=B(a);for(i=0;i<a.length;i++)u+=a[i]*D(256,3-i);return u}(t);if(null===r)return J;this.host=r}else{if(N(se,t))return J;r="";a=m(t);for(i=0;i<a.length;i++)r+=percentEncode(a[i],he);this.host=r}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return y(ve,this.scheme)},shortenPath:function(){var t=this.path,r=t.length;!r||"file"===this.scheme&&1===r&&isWindowsDriveLetter(t[0],!0)||t.length--},serialize:function(){var t=this,r=t.scheme,a=t.username,i=t.password,o=t.host,l=t.port,c=t.path,u=t.query,h=t.fragment,d=r+":";if(null!==o){d+="//";t.includesCredentials()&&(d+=a+(i?":"+i:"")+"@");d+=serializeHost(o);null!==l&&(d+=":"+l)}else"file"===r&&(d+="//");d+=t.cannotBeABaseURL?c[0]:c.length?"/"+W(c,"/"):"";null!==u&&(d+="?"+u);null!==h&&(d+="#"+h);return d},setHref:function(t){var r=this.parse(t);if(r)throw new O(r);this.searchParams.update()},getOrigin:function(){var t=this.scheme,r=this.port;if("blob"===t)try{return new De(t.path[0]).origin}catch(t){return"null"}return"file"!==t&&this.isSpecial()?t+"://"+serializeHost(this.host)+(null!==r?":"+r:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(k(t)+":",_e)},getUsername:function(){return this.username},setUsername:function(t){var r=m(k(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var a=0;a<r.length;a++)this.username+=percentEncode(r[a],pe)}},getPassword:function(){return this.password},setPassword:function(t){var r=m(k(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var a=0;a<r.length;a++)this.password+=percentEncode(r[a],pe)}},getHost:function(){var t=this.host,r=this.port;return null===t?"":null===r?serializeHost(t):serializeHost(t)+":"+r},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Ae)},getHostname:function(){var t=this.host;return null===t?"":serializeHost(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,xe)},getPort:function(){var t=this.port;return null===t?"":k(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""===(t=k(t))?this.port=null:this.parse(t,Ee))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+W(t,"/"):""},setPathname:function(t){if(!this.cannotBeABaseURL){this.path=[];this.parse(t,Me)}},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){if(""===(t=k(t)))this.query=null;else{"?"===j(t,0)&&(t=K(t,1));this.query="";this.parse(t,Re)}this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){if(""!==(t=k(t))){"#"===j(t,0)&&(t=K(t,1));this.fragment="";this.parse(t,Le)}else this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var De=function URL(t){var r=_(this,je),a=A(arguments.length,1)>1?arguments[1]:void 0,i=I(r,new URLState(t,!1,a));if(!l){r.href=i.serialize();r.origin=i.getOrigin();r.protocol=i.getProtocol();r.username=i.getUsername();r.password=i.getPassword();r.host=i.getHost();r.hostname=i.getHostname();r.port=i.getPort();r.pathname=i.getPathname();r.search=i.getSearch();r.searchParams=i.getSearchParams();r.hash=i.getHash()}},je=De.prototype,accessorDescriptor=function(t,r){return{get:function(){return T(this)[t]()},set:r&&function(t){return T(this)[r](t)},configurable:!0,enumerable:!0}};if(l){v(je,"href",accessorDescriptor("serialize","setHref"));v(je,"origin",accessorDescriptor("getOrigin"));v(je,"protocol",accessorDescriptor("getProtocol","setProtocol"));v(je,"username",accessorDescriptor("getUsername","setUsername"));v(je,"password",accessorDescriptor("getPassword","setPassword"));v(je,"host",accessorDescriptor("getHost","setHost"));v(je,"hostname",accessorDescriptor("getHostname","setHostname"));v(je,"port",accessorDescriptor("getPort","setPort"));v(je,"pathname",accessorDescriptor("getPathname","setPathname"));v(je,"search",accessorDescriptor("getSearch","setSearch"));v(je,"searchParams",accessorDescriptor("getSearchParams"));v(je,"hash",accessorDescriptor("getHash","setHash"))}p(je,"toJSON",(function toJSON(){return T(this).serialize()}),{enumerable:!0});p(je,"toString",(function toString(){return T(this).serialize()}),{enumerable:!0});if(G){var Ne=G.createObjectURL,We=G.revokeObjectURL;Ne&&p(De,"createObjectURL",h(Ne,G));We&&p(De,"revokeObjectURL",h(We,G))}S(De,"URL");o({global:!0,constructor:!0,forced:!c,sham:!l},{URL:De})},8730:(t,r,a)=>{a(9391)}},r={};function __webpack_require__(a){var i=r[a];if(void 0!==i)return i.exports;var o=r[a]={exports:{}};t[a].call(o.exports,o,o.exports,__webpack_require__);return o.exports}__webpack_require__.d=(t,r)=>{for(var a in r)__webpack_require__.o(r,a)&&!__webpack_require__.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})};__webpack_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r);var a=globalThis.pdfjsLib={};(()=>{__webpack_require__.d(a,{AbortException:()=>ue,AnnotationEditorLayer:()=>Cu,AnnotationEditorParamsType:()=>m,AnnotationEditorType:()=>g,AnnotationEditorUIManager:()=>fr,AnnotationLayer:()=>os,AnnotationMode:()=>y,CMapCompressionType:()=>Z,ColorPicker:()=>Ml,DOMSVGFactory:()=>qe,DrawLayer:()=>Wu,FeatureTest:()=>he,GlobalWorkerOptions:()=>la,ImageKind:()=>E,InvalidPDFException:()=>oe,MissingPDFException:()=>se,OPS:()=>ee,Outliner:()=>Os,PDFDataRangeTransport:()=>pi,PDFDateString:()=>Je,PDFWorker:()=>Ai,PasswordResponses:()=>te,PermissionFlag:()=>b,PixelsPerInch:()=>Ae,PromiseCapability:()=>ve,RenderingCancelledException:()=>Ke,UnexpectedResponseException:()=>le,Util:()=>fe,VerbosityLevel:()=>Q,XfaLayer:()=>qi,build:()=>zi,createValidAbsoluteUrl:()=>createValidAbsoluteUrl,fetchData:()=>fetchData,getDocument:()=>getDocument,getFilenameFromUrl:()=>getFilenameFromUrl,getPdfFilenameFromUrl:()=>getPdfFilenameFromUrl,getXfaPageViewport:()=>getXfaPageViewport,isDataScheme:()=>isDataScheme,isPdfFile:()=>isPdfFile,noContextMenu:()=>noContextMenu,normalizeUnicode:()=>normalizeUnicode,renderTextLayer:()=>renderTextLayer,setLayerDimensions:()=>setLayerDimensions,shadow:()=>shadow,updateTextLayer:()=>updateTextLayer,version:()=>Bi});var t;__webpack_require__(9749),__webpack_require__(6544),__webpack_require__(4254),__webpack_require__(9373),__webpack_require__(1057),__webpack_require__(4338),__webpack_require__(6801),__webpack_require__(7049),__webpack_require__(752),__webpack_require__(886),__webpack_require__(560),__webpack_require__(9730),__webpack_require__(9903),__webpack_require__(5398),__webpack_require__(6646),__webpack_require__(9288),__webpack_require__(9358),__webpack_require__(8052),__webpack_require__(228),__webpack_require__(3964),__webpack_require__(50),__webpack_require__(6034),__webpack_require__(4043),__webpack_require__(7409),__webpack_require__(2826),__webpack_require__(3843),__webpack_require__(1694),__webpack_require__(2462),__webpack_require__(8472),__webpack_require__(7267),__webpack_require__(6532),__webpack_require__(268),__webpack_require__(8607),__webpack_require__(8557),__webpack_require__(5194),__webpack_require__(6664),__webpack_require__(5980),__webpack_require__(9943),__webpack_require__(6089),__webpack_require__(8539),__webpack_require__(8690),__webpack_require__(522),__webpack_require__(82),__webpack_require__(5385),__webpack_require__(5552),__webpack_require__(1803),__webpack_require__(1565),__webpack_require__(7987),__webpack_require__(9365),__webpack_require__(677),__webpack_require__(8118),__webpack_require__(1165),__webpack_require__(1522),__webpack_require__(1638),__webpack_require__(4797),__webpack_require__(7300),__webpack_require__(3356),__webpack_require__(9724),__webpack_require__(4224),__webpack_require__(1121),__webpack_require__(9901),__webpack_require__(7133),__webpack_require__(1090),__webpack_require__(6247),__webpack_require__(1412),__webpack_require__(3097),__webpack_require__(1792),__webpack_require__(6265),__webpack_require__(3650),__webpack_require__(8730),__webpack_require__(9307),__webpack_require__(8858),__webpack_require__(1318),__webpack_require__(3228);function _classPrivateFieldInitSpec(t,r,a){!function _checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,r);r.set(t,a)}function _classPrivateFieldSet(t,r,a){!function _classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,_classExtractFieldDescriptor(t,r,"set"),a);return a}function _classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function _classStaticPrivateMethodGet(t,r,a){!function _classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,_toPropertyKey(i.key),i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function _toPropertyKey(t){var r=function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==_typeof(r)?r:String(r)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,r,a){return r=_getPrototypeOf(r),function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,_isNativeReflectConstruct()?Reflect.construct(r,a||[],_getPrototypeOf(t).constructor):r.apply(t,a))}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _typeof(t){return _typeof="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},_typeof(t)}var r=!("object"!==("undefined"==typeof process?"undefined":_typeof(process))||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),i=[1,0,0,1,0,0],o=[.001,0,0,.001,0,0],l=1.35,c=1,u=2,h=4,d=16,p=32,v=64,_=256,y={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},g={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},m={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},b={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},w=0,P=1,k=2,S=3,A=3,x=4,E={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},I=1,T=2,C=3,M=4,G=5,O=6,R=7,L=8,D=9,j=10,N=11,W=12,H=13,B=14,z=15,U=16,q=17,V=20,K=1,Y=2,X=3,$=4,J=5,Q={ERRORS:0,WARNINGS:1,INFOS:5},Z={NONE:0,BINARY:1},ee={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},te={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},re=Q.WARNINGS;function setVerbosityLevel(t){Number.isInteger(t)&&(re=t)}function getVerbosityLevel(){return re}function info(t){re>=Q.INFOS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log("Info: ".concat(t)):Window&&globalThis.ngxConsole?globalThis.ngxConsole.log("Info: ".concat(t)):console.log("Info: ".concat(t)))}function warn(t){re>=Q.WARNINGS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log("Warning: ".concat(t)):Window&&globalThis.ngxConsole?globalThis.ngxConsole.log("Warning: ".concat(t)):console.log("Warning: ".concat(t)))}function unreachable(t){throw new Error(t)}function assert(t,r){t||unreachable(r)}function createValidAbsoluteUrl(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(a&&"string"==typeof t){if(a.addDefaultProtocol&&t.startsWith("www.")){var i=t.match(/\./g);(null==i?void 0:i.length)>=2&&(t="http://".concat(t))}if(a.tryConvertEncoding)try{t=function stringToUTF8String(t){return decodeURIComponent(escape(t))}(t)}catch(t){}}var o=r?new URL(t,r):new URL(t);if(function _isValidProtocol(t){switch(null==t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":case"capacitor":return!0;default:return!1}}(o))return o}catch(t){}return null}function shadow(t,r,a){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.defineProperty(t,r,{value:a,enumerable:!i,configurable:!0,writable:!1});return a}var ne=function BaseExceptionClosure(){function BaseException(t,r){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=r}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}(),ae=function(t){_inherits(PasswordException,t);function PasswordException(t,r){var a;_classCallCheck(this,PasswordException);(a=_callSuper(this,PasswordException,[t,"PasswordException"])).code=r;return a}return _createClass(PasswordException)}(ne),ie=function(t){_inherits(UnknownErrorException,t);function UnknownErrorException(t,r){var a;_classCallCheck(this,UnknownErrorException);(a=_callSuper(this,UnknownErrorException,[t,"UnknownErrorException"])).details=r;return a}return _createClass(UnknownErrorException)}(ne),oe=function(t){_inherits(InvalidPDFException,t);function InvalidPDFException(t){_classCallCheck(this,InvalidPDFException);return _callSuper(this,InvalidPDFException,[t,"InvalidPDFException"])}return _createClass(InvalidPDFException)}(ne),se=function(t){_inherits(MissingPDFException,t);function MissingPDFException(t){_classCallCheck(this,MissingPDFException);return _callSuper(this,MissingPDFException,[t,"MissingPDFException"])}return _createClass(MissingPDFException)}(ne),le=function(t){_inherits(UnexpectedResponseException,t);function UnexpectedResponseException(t,r){var a;_classCallCheck(this,UnexpectedResponseException);(a=_callSuper(this,UnexpectedResponseException,[t,"UnexpectedResponseException"])).status=r;return a}return _createClass(UnexpectedResponseException)}(ne),ce=function(t){_inherits(FormatError,t);function FormatError(t){_classCallCheck(this,FormatError);return _callSuper(this,FormatError,[t,"FormatError"])}return _createClass(FormatError)}(ne),ue=function(t){_inherits(AbortException,t);function AbortException(t){_classCallCheck(this,AbortException);return _callSuper(this,AbortException,[t,"AbortException"])}return _createClass(AbortException)}(ne);function bytesToString(t){"object"===_typeof(t)&&void 0!==(null==t?void 0:t.length)||unreachable("Invalid argument for bytesToString");var r=t.length,a=8192;if(r<a)return String.fromCharCode.apply(null,t);for(var i=[],o=0;o<r;o+=a){var l=Math.min(o+a,r),c=t.subarray(o,l);i.push(String.fromCharCode.apply(null,c))}return i.join("")}function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");for(var r=t.length,a=new Uint8Array(r),i=0;i<r;++i)a[i]=255&t.charCodeAt(i);return a}function objectFromMap(t){var r,a=Object.create(null),i=function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}(t);try{for(i.s();!(r=i.n()).done;){var o=_slicedToArray(r.value,2),l=o[0],c=o[1];a[l]=c}}catch(t){i.e(t)}finally{i.f()}return a}var he=function(){function FeatureTest(){_classCallCheck(this,FeatureTest)}_createClass(FeatureTest,null,[{key:"isLittleEndian",get:function get(){return shadow(this,"isLittleEndian",function isLittleEndian(){var t=new Uint8Array(4);t[0]=1;return 1===new Uint32Array(t.buffer,0,1)[0]}())}},{key:"isEvalSupported",get:function get(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(t){return!1}}())}},{key:"isOffscreenCanvasSupported",get:function get(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}},{key:"platform",get:function get(){var t;return"undefined"!=typeof navigator&&"string"==typeof(null===(t=navigator)||void 0===t?void 0:t.platform)?shadow(this,"platform",{isMac:navigator.platform.includes("Mac")}):shadow(this,"platform",{isMac:!1})}},{key:"isCSSRoundSupported",get:function get(){var t,r;return shadow(this,"isCSSRoundSupported",null===(t=globalThis.CSS)||void 0===t||null===(r=t.supports)||void 0===r?void 0:r.call(t,"width: round(1.5px, 1px)"))}}]);return FeatureTest}(),de=function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Array(256).keys()).map((function(t){return t.toString(16).padStart(2,"0")})),fe=function(){function Util(){_classCallCheck(this,Util)}_createClass(Util,null,[{key:"makeHexColor",value:function makeHexColor(t,r,a){return"#".concat(de[t]).concat(de[r]).concat(de[a])}},{key:"scaleMinMax",value:function scaleMinMax(t,r){var a;if(t[0]){if(t[0]<0){a=r[0];r[0]=r[2];r[2]=a}r[0]*=t[0];r[2]*=t[0];if(t[3]<0){a=r[1];r[1]=r[3];r[3]=a}r[1]*=t[3];r[3]*=t[3]}else{a=r[0];r[0]=r[1];r[1]=a;a=r[2];r[2]=r[3];r[3]=a;if(t[1]<0){a=r[1];r[1]=r[3];r[3]=a}r[1]*=t[1];r[3]*=t[1];if(t[2]<0){a=r[0];r[0]=r[2];r[2]=a}r[0]*=t[2];r[2]*=t[2]}r[0]+=t[4];r[1]+=t[5];r[2]+=t[4];r[3]+=t[5]}},{key:"transform",value:function transform(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}},{key:"applyTransform",value:function applyTransform(t,r){return[t[0]*r[0]+t[1]*r[2]+r[4],t[0]*r[1]+t[1]*r[3]+r[5]]}},{key:"applyInverseTransform",value:function applyInverseTransform(t,r){var a=r[0]*r[3]-r[1]*r[2];return[(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/a,(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/a]}},{key:"getAxialAlignedBoundingBox",value:function getAxialAlignedBoundingBox(t,r){var a=this.applyTransform(t,r),i=this.applyTransform(t.slice(2,4),r),o=this.applyTransform([t[0],t[3]],r),l=this.applyTransform([t[2],t[1]],r);return[Math.min(a[0],i[0],o[0],l[0]),Math.min(a[1],i[1],o[1],l[1]),Math.max(a[0],i[0],o[0],l[0]),Math.max(a[1],i[1],o[1],l[1])]}},{key:"inverseTransform",value:function inverseTransform(t){var r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]}},{key:"singularValueDecompose2dScale",value:function singularValueDecompose2dScale(t){var r=[t[0],t[2],t[1],t[3]],a=t[0]*r[0]+t[1]*r[2],i=t[0]*r[1]+t[1]*r[3],o=t[2]*r[0]+t[3]*r[2],l=t[2]*r[1]+t[3]*r[3],c=(a+l)/2,u=Math.sqrt(Math.pow(a+l,2)-4*(a*l-o*i))/2,h=c+u||1,d=c-u||1;return[Math.sqrt(h),Math.sqrt(d)]}},{key:"normalizeRect",value:function normalizeRect(t){var r=t.slice(0);if(t[0]>t[2]){r[0]=t[2];r[2]=t[0]}if(t[1]>t[3]){r[1]=t[3];r[3]=t[1]}return r}},{key:"intersect",value:function intersect(t,r){var a=Math.max(Math.min(t[0],t[2]),Math.min(r[0],r[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(r[0],r[2]));if(a>i)return null;var o=Math.max(Math.min(t[1],t[3]),Math.min(r[1],r[3])),l=Math.min(Math.max(t[1],t[3]),Math.max(r[1],r[3]));return o>l?null:[a,o,i,l]}},{key:"bezierBoundingBox",value:function bezierBoundingBox(t,r,a,i,o,l,c,u,h){if(h){h[0]=Math.min(h[0],t,c);h[1]=Math.min(h[1],r,u);h[2]=Math.max(h[2],t,c);h[3]=Math.max(h[3],r,u)}else h=[Math.min(t,c),Math.min(r,u),Math.max(t,c),Math.max(r,u)];_classStaticPrivateMethodGet(this,Util,_getExtremum).call(this,t,a,o,c,r,i,l,u,3*(3*(a-o)-t+c),6*(t-2*a+o),3*(a-t),h);_classStaticPrivateMethodGet(this,Util,_getExtremum).call(this,t,a,o,c,r,i,l,u,3*(3*(i-l)-r+u),6*(r-2*i+l),3*(i-r),h);return h}}]);return Util}();t=fe;function _getExtremumOnCurve(t,r,a,i,o,l,c,u,h,d){if(!(h<=0||h>=1)){var p=1-h,v=h*h,_=v*h,y=p*(p*(p*t+3*h*r)+3*v*a)+_*i,g=p*(p*(p*o+3*h*l)+3*v*c)+_*u;d[0]=Math.min(d[0],y);d[1]=Math.min(d[1],g);d[2]=Math.max(d[2],y);d[3]=Math.max(d[3],g)}}function _getExtremum(r,a,i,o,l,c,u,h,d,p,v,_){if(Math.abs(d)<1e-12)Math.abs(p)>=1e-12&&_classStaticPrivateMethodGet(this,t,_getExtremumOnCurve).call(this,r,a,i,o,l,c,u,h,-v/p,_);else{var y=Math.pow(p,2)-4*v*d;if(!(y<0)){var g=Math.sqrt(y),m=2*d;_classStaticPrivateMethodGet(this,t,_getExtremumOnCurve).call(this,r,a,i,o,l,c,u,h,(-p+g)/m,_);_classStaticPrivateMethodGet(this,t,_getExtremumOnCurve).call(this,r,a,i,o,l,c,u,h,(-p-g)/m,_)}}}var pe=new WeakMap,ve=function(){function PromiseCapability(){var t=this;_classCallCheck(this,PromiseCapability);_classPrivateFieldInitSpec(this,pe,{writable:!0,value:!1});this.promise=new Promise((function(r,a){t.resolve=function(a){_classPrivateFieldSet(t,pe,!0);r(a)};t.reject=function(r){_classPrivateFieldSet(t,pe,!0);a(r)}}))}_createClass(PromiseCapability,[{key:"settled",get:function get(){return function _classPrivateFieldGet(t,r){return function _classApplyDescriptorGet(t,r){return r.get?r.get.call(t):r.value}(t,_classExtractFieldDescriptor(t,r,"get"))}(this,pe)}}]);return PromiseCapability}(),_e=null,ye=null;function normalizeUnicode(t){if(!_e){_e=/([\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;ye=new Map([["ſt","ſt"]])}return t.replaceAll(_e,(function(t,r,a){return r?r.normalize("NFKC"):ye.get(a)}))}function getUuid(){var t,r;if("undefined"!=typeof crypto&&"function"==typeof(null===(t=crypto)||void 0===t?void 0:t.randomUUID))return crypto.randomUUID();var a=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof(null===(r=crypto)||void 0===r?void 0:r.getRandomValues))crypto.getRandomValues(a);else for(var i=0;i<32;i++)a[i]=Math.floor(255*Math.random());return bytesToString(a)}var ge="pdfjs_internal_id_";__webpack_require__(8373),__webpack_require__(6793),__webpack_require__(7629),__webpack_require__(7509),__webpack_require__(429),__webpack_require__(6409),__webpack_require__(9649),__webpack_require__(414),__webpack_require__(7602),__webpack_require__(5),__webpack_require__(5716),__webpack_require__(3442),__webpack_require__(1964),__webpack_require__(9878),__webpack_require__(2915),__webpack_require__(7895),__webpack_require__(2275),__webpack_require__(7522),__webpack_require__(7337),__webpack_require__(3429),__webpack_require__(7462),__webpack_require__(8324),__webpack_require__(6585),__webpack_require__(1830),__webpack_require__(9944),__webpack_require__(2918),__webpack_require__(2176),__webpack_require__(2506),__webpack_require__(7961),__webpack_require__(8436),__webpack_require__(6054),__webpack_require__(8244),__webpack_require__(691),__webpack_require__(8077),__webpack_require__(2410),__webpack_require__(2003),__webpack_require__(8518),__webpack_require__(3440),__webpack_require__(2940),__webpack_require__(9873),__webpack_require__(3476);function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==base_factory_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(base_factory_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function base_factory_typeof(t){return base_factory_typeof="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},base_factory_typeof(t)}function base_factory_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function base_factory_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,base_factory_toPropertyKey(i.key),i)}}function base_factory_createClass(t,r,a){r&&base_factory_defineProperties(t.prototype,r);a&&base_factory_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function base_factory_toPropertyKey(t){var r=function base_factory_toPrimitive(t,r){if("object"!=base_factory_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=base_factory_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==base_factory_typeof(r)?r:String(r)}var me,be=function(){function BaseFilterFactory(){base_factory_classCallCheck(this,BaseFilterFactory);this.constructor===BaseFilterFactory&&unreachable("Cannot initialize BaseFilterFactory.")}base_factory_createClass(BaseFilterFactory,[{key:"addFilter",value:function addFilter(t){return"none"}},{key:"addHCMFilter",value:function addHCMFilter(t,r){return"none"}},{key:"addHighlightHCMFilter",value:function addHighlightHCMFilter(t,r,a,i,o){return"none"}},{key:"destroy",value:function destroy(){}}]);return BaseFilterFactory}(),we=function(){function BaseCanvasFactory(){base_factory_classCallCheck(this,BaseCanvasFactory);this.constructor===BaseCanvasFactory&&unreachable("Cannot initialize BaseCanvasFactory.")}base_factory_createClass(BaseCanvasFactory,[{key:"create",value:function create(t,r){if(t<=0||r<=0)throw new Error("Invalid canvas size");var a=this._createCanvas(t,r),i=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,o=a.getContext("2d",i);return{canvas:a,context:o}}},{key:"reset",value:function reset(t,r,a){if(!t.canvas)throw new Error("Canvas is not specified");if(r<=0||a<=0)throw new Error("Invalid canvas size");t.canvas.width=r;t.canvas.height=a}},{key:"destroy",value:function 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}},{key:"_createCanvas",value:function _createCanvas(t,r){unreachable("Abstract method `_createCanvas` called.")}}]);return BaseCanvasFactory}(),Pe=function(){function BaseCMapReaderFactory(t){var r=t.baseUrl,a=void 0===r?null:r,i=t.isCompressed,o=void 0===i||i;base_factory_classCallCheck(this,BaseCMapReaderFactory);this.constructor===BaseCMapReaderFactory&&unreachable("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=a;this.isCompressed=o}base_factory_createClass(BaseCMapReaderFactory,[{key:"fetch",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(t){var r,a,i,o=this;return _regeneratorRuntime().wrap((function _callee$(l){for(;;)switch(l.prev=l.next){case 0:r=t.name;if(this.baseUrl){l.next=3;break}throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');case 3:if(r){l.next=5;break}throw new Error("CMap name must be specified.");case 5:a=this.baseUrl+r+(this.isCompressed?".bcmap":"");i=this.isCompressed?Z.BINARY:Z.NONE;return l.abrupt("return",this._fetchData(a,i).catch((function(t){throw new Error("Unable to load ".concat(o.isCompressed?"binary ":"","CMap at: ").concat(a))})));case 8:case"end":return l.stop()}}),_callee,this)}))),function fetch(r){return t.apply(this,arguments)})},{key:"_fetchData",value:function _fetchData(t,r){unreachable("Abstract method `_fetchData` called.")}}]);var t;return BaseCMapReaderFactory}(),ke=function(){function BaseStandardFontDataFactory(t){var r=t.baseUrl,a=void 0===r?null:r;base_factory_classCallCheck(this,BaseStandardFontDataFactory);this.constructor===BaseStandardFontDataFactory&&unreachable("Cannot initialize BaseStandardFontDataFactory.");this.baseUrl=a}base_factory_createClass(BaseStandardFontDataFactory,[{key:"fetch",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(t){var r,a;return _regeneratorRuntime().wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:r=t.filename;if(this.baseUrl){i.next=3;break}throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');case 3:if(r){i.next=5;break}throw new Error("Font filename must be specified.");case 5:a="".concat(this.baseUrl).concat(r);return i.abrupt("return",this._fetchData(a).catch((function(t){throw new Error("Unable to load font data at: ".concat(a))})));case 7:case"end":return i.stop()}}),_callee2,this)}))),function fetch(r){return t.apply(this,arguments)})},{key:"_fetchData",value:function _fetchData(t){unreachable("Abstract method `_fetchData` called.")}}]);var t;return BaseStandardFontDataFactory}(),Se=function(){function BaseSVGFactory(){base_factory_classCallCheck(this,BaseSVGFactory);this.constructor===BaseSVGFactory&&unreachable("Cannot initialize BaseSVGFactory.")}base_factory_createClass(BaseSVGFactory,[{key:"create",value:function create(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||r<=0)throw new Error("Invalid SVG dimensions");var i=this._createSVG("svg:svg");i.setAttribute("version","1.1");if(!a){i.setAttribute("width","".concat(t,"px"));i.setAttribute("height","".concat(r,"px"))}i.setAttribute("preserveAspectRatio","none");i.setAttribute("viewBox","0 0 ".concat(t," ").concat(r));return i}},{key:"createElement",value:function createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}},{key:"_createSVG",value:function _createSVG(t){unreachable("Abstract method `_createSVG` called.")}}]);return BaseSVGFactory}();function display_utils_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */display_utils_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==display_utils_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(display_utils_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function display_utils_typeof(t){return display_utils_typeof="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},display_utils_typeof(t)}function display_utils_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=display_utils_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function display_utils_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function display_utils_toConsumableArray(t){return function display_utils_arrayWithoutHoles(t){if(Array.isArray(t))return display_utils_arrayLikeToArray(t)}(t)||function display_utils_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||display_utils_unsupportedIterableToArray(t)||function display_utils_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function display_utils_slicedToArray(t,r){return function display_utils_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function display_utils_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||display_utils_unsupportedIterableToArray(t,r)||function display_utils_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function display_utils_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return display_utils_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?display_utils_arrayLikeToArray(t,r):void 0}}function display_utils_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function display_utils_callSuper(t,r,a){return r=display_utils_getPrototypeOf(r),function display_utils_possibleConstructorReturn(t,r){if(r&&("object"===display_utils_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return display_utils_assertThisInitialized(t)}(t,display_utils_isNativeReflectConstruct()?Reflect.construct(r,a||[],display_utils_getPrototypeOf(t).constructor):r.apply(t,a))}function display_utils_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(display_utils_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function display_utils_getPrototypeOf(t){display_utils_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return display_utils_getPrototypeOf(t)}function display_utils_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function display_utils_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&display_utils_setPrototypeOf(t,r)}function display_utils_setPrototypeOf(t,r){display_utils_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return display_utils_setPrototypeOf(t,r)}function _classPrivateMethodInitSpec(t,r){display_utils_checkPrivateRedeclaration(t,r);r.add(t)}function display_utils_classPrivateFieldInitSpec(t,r,a){display_utils_checkPrivateRedeclaration(t,r);r.set(t,a)}function display_utils_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function display_utils_classPrivateFieldGet(t,r){return function display_utils_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,display_utils_classExtractFieldDescriptor(t,r,"get"))}function display_utils_classPrivateFieldSet(t,r,a){!function display_utils_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,display_utils_classExtractFieldDescriptor(t,r,"set"),a);return a}function display_utils_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function display_utils_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,display_utils_toPropertyKey(i.key),i)}}function display_utils_createClass(t,r,a){r&&display_utils_defineProperties(t.prototype,r);a&&display_utils_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function display_utils_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperty(t,r,a){(r=display_utils_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function display_utils_toPropertyKey(t){var r=function display_utils_toPrimitive(t,r){if("object"!=display_utils_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=display_utils_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==display_utils_typeof(r)?r:String(r)}var Fe="http://www.w3.org/2000/svg",Ae=display_utils_createClass((function PixelsPerInch(){display_utils_classCallCheck(this,PixelsPerInch)}));me=Ae;_defineProperty(Ae,"CSS",96);_defineProperty(Ae,"PDF",72);_defineProperty(Ae,"PDF_TO_CSS_UNITS",me.CSS/me.PDF);var xe=new WeakMap,Ee=new WeakMap,Ie=new WeakMap,Te=new WeakMap,Ce=new WeakMap,Me=new WeakMap,Ge=new WeakMap,Oe=new WeakMap,Re=new WeakMap,Le=new WeakSet,De=new WeakSet,je=new WeakSet,Ne=new WeakSet,We=new WeakSet,He=function(t){display_utils_inherits(DOMFilterFactory,t);function DOMFilterFactory(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=r.docId,i=r.ownerDocument,o=void 0===i?globalThis.document:i;display_utils_classCallCheck(this,DOMFilterFactory);_classPrivateMethodInitSpec(display_utils_assertThisInitialized(t=display_utils_callSuper(this,DOMFilterFactory)),We);_classPrivateMethodInitSpec(display_utils_assertThisInitialized(t),Ne);_classPrivateMethodInitSpec(display_utils_assertThisInitialized(t),je);_classPrivateMethodInitSpec(display_utils_assertThisInitialized(t),De);_classPrivateMethodInitSpec(display_utils_assertThisInitialized(t),Le);display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Re,{get:_get_defs,set:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Oe,{get:_get_hcmCache,set:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Ge,{get:_get_cache,set:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),xe,{writable:!0,value:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Ee,{writable:!0,value:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Ie,{writable:!0,value:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Te,{writable:!0,value:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Ce,{writable:!0,value:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Me,{writable:!0,value:0});display_utils_classPrivateFieldSet(display_utils_assertThisInitialized(t),Ie,a);display_utils_classPrivateFieldSet(display_utils_assertThisInitialized(t),Te,o);return t}display_utils_createClass(DOMFilterFactory,[{key:"addFilter",value:function addFilter(t){var r,a;if(!t)return"none";var i,o,l,c,u=display_utils_classPrivateFieldGet(this,Ge).get(t);if(u)return u;if(1===t.length){for(var h=t[0],d=new Array(256),p=0;p<256;p++)d[p]=h[p]/255;c=i=o=l=d.join(",")}else{for(var v=display_utils_slicedToArray(t,3),_=v[0],y=v[1],g=v[2],m=new Array(256),b=new Array(256),w=new Array(256),P=0;P<256;P++){m[P]=_[P]/255;b[P]=y[P]/255;w[P]=g[P]/255}i=m.join(",");o=b.join(",");l=w.join(",");c="".concat(i).concat(o).concat(l)}if(u=display_utils_classPrivateFieldGet(this,Ge).get(c)){display_utils_classPrivateFieldGet(this,Ge).set(t,u);return u}var k="g_".concat(display_utils_classPrivateFieldGet(this,Ie),"_transfer_map_").concat((display_utils_classPrivateFieldSet(this,Me,(r=display_utils_classPrivateFieldGet(this,Me),a=r++,r)),a)),S="url(#".concat(k,")");display_utils_classPrivateFieldGet(this,Ge).set(t,S);display_utils_classPrivateFieldGet(this,Ge).set(c,S);var A=_classPrivateMethodGet(this,De,_createFilter2).call(this,k);_classPrivateMethodGet(this,Ne,_addTransferMapConversion2).call(this,i,o,l,A);return S}},{key:"addHCMFilter",value:function addHCMFilter(t,r){var a,i="".concat(t,"-").concat(r),o="base",l=display_utils_classPrivateFieldGet(this,Oe).get(o);if((null===(a=l)||void 0===a?void 0:a.key)===i)return l.url;if(l){var c;null===(c=l.filter)||void 0===c||c.remove();l.key=i;l.url="none";l.filter=null}else{l={key:i,url:"none",filter:null};display_utils_classPrivateFieldGet(this,Oe).set(o,l)}if(!t||!r)return l.url;var u=_classPrivateMethodGet(this,We,_getRGB2).call(this,t);t=fe.makeHexColor.apply(fe,display_utils_toConsumableArray(u));var h=_classPrivateMethodGet(this,We,_getRGB2).call(this,r);r=fe.makeHexColor.apply(fe,display_utils_toConsumableArray(h));display_utils_classPrivateFieldGet(this,Re).style.color="";if("#000000"===t&&"#ffffff"===r||t===r)return l.url;for(var d=new Array(256),p=0;p<=255;p++){var v=p/255;d[p]=v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4)}var _=d.join(","),y="g_".concat(display_utils_classPrivateFieldGet(this,Ie),"_hcm_filter"),g=l.filter=_classPrivateMethodGet(this,De,_createFilter2).call(this,y);_classPrivateMethodGet(this,Ne,_addTransferMapConversion2).call(this,_,_,_,g);_classPrivateMethodGet(this,Le,_addGrayConversion2).call(this,g);var m=function getSteps(t,r){for(var a=u[t]/255,i=h[t]/255,o=new Array(r+1),l=0;l<=r;l++)o[l]=a+l/r*(i-a);return o.join(",")};_classPrivateMethodGet(this,Ne,_addTransferMapConversion2).call(this,m(0,5),m(1,5),m(2,5),g);l.url="url(#".concat(y,")");return l.url}},{key:"addHighlightHCMFilter",value:function addHighlightHCMFilter(t,r,a,i,o){var l,c="".concat(r,"-").concat(a,"-").concat(i,"-").concat(o),u=display_utils_classPrivateFieldGet(this,Oe).get(t);if((null===(l=u)||void 0===l?void 0:l.key)===c)return u.url;if(u){var h;null===(h=u.filter)||void 0===h||h.remove();u.key=c;u.url="none";u.filter=null}else{u={key:c,url:"none",filter:null};display_utils_classPrivateFieldGet(this,Oe).set(t,u)}if(!r||!a)return u.url;var d=display_utils_slicedToArray([r,a].map(_classPrivateMethodGet(this,We,_getRGB2).bind(this)),2),p=d[0],v=d[1],_=Math.round(.2126*p[0]+.7152*p[1]+.0722*p[2]),y=Math.round(.2126*v[0]+.7152*v[1]+.0722*v[2]),g=display_utils_slicedToArray([i,o].map(_classPrivateMethodGet(this,We,_getRGB2).bind(this)),2),m=g[0],b=g[1];if(y<_){var w=[y,_,b,m];_=w[0];y=w[1];m=w[2];b=w[3]}display_utils_classPrivateFieldGet(this,Re).style.color="";var P=function getSteps(t,r,a){for(var i=new Array(256),o=(y-_)/a,l=t/255,c=(r-t)/(255*a),u=0,h=0;h<=a;h++){for(var d=Math.round(_+h*o),p=l+h*c,v=u;v<=d;v++)i[v]=p;u=d+1}for(var g=u;g<256;g++)i[g]=i[u-1];return i.join(",")},k="g_".concat(display_utils_classPrivateFieldGet(this,Ie),"_hcm_").concat(t,"_filter"),S=u.filter=_classPrivateMethodGet(this,De,_createFilter2).call(this,k);_classPrivateMethodGet(this,Le,_addGrayConversion2).call(this,S);_classPrivateMethodGet(this,Ne,_addTransferMapConversion2).call(this,P(m[0],b[0],5),P(m[1],b[1],5),P(m[2],b[2],5),S);u.url="url(#".concat(k,")");return u.url}},{key:"destroy",value:function destroy(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])||0===display_utils_classPrivateFieldGet(this,Oe).size){if(display_utils_classPrivateFieldGet(this,Ee)){display_utils_classPrivateFieldGet(this,Ee).parentNode.parentNode.remove();display_utils_classPrivateFieldSet(this,Ee,null)}if(display_utils_classPrivateFieldGet(this,xe)){display_utils_classPrivateFieldGet(this,xe).clear();display_utils_classPrivateFieldSet(this,xe,null)}display_utils_classPrivateFieldSet(this,Me,0)}}}]);return DOMFilterFactory}(be);function _get_cache(){return display_utils_classPrivateFieldGet(this,xe)||display_utils_classPrivateFieldSet(this,xe,new Map)}function _get_hcmCache(){return display_utils_classPrivateFieldGet(this,Ce)||display_utils_classPrivateFieldSet(this,Ce,new Map)}function _get_defs(){if(!display_utils_classPrivateFieldGet(this,Ee)){var t=display_utils_classPrivateFieldGet(this,Te).createElement("div"),r=t.style;r.visibility="hidden";r.contain="strict";r.width=r.height=0;r.position="absolute";r.top=r.left=0;r.zIndex=-1;var a=display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,"svg");a.setAttribute("width",0);a.setAttribute("height",0);display_utils_classPrivateFieldSet(this,Ee,display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,"defs"));t.append(a);a.append(display_utils_classPrivateFieldGet(this,Ee));display_utils_classPrivateFieldGet(this,Te).body.append(t)}return display_utils_classPrivateFieldGet(this,Ee)}function _addGrayConversion2(t){var r=display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,"feColorMatrix");r.setAttribute("type","matrix");r.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(r)}function _createFilter2(t){var r=display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,"filter");r.setAttribute("color-interpolation-filters","sRGB");r.setAttribute("id",t);display_utils_classPrivateFieldGet(this,Re).append(r);return r}function _appendFeFunc2(t,r,a){var i=display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,r);i.setAttribute("type","discrete");i.setAttribute("tableValues",a);t.append(i)}function _addTransferMapConversion2(t,r,a,i){var o=display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,"feComponentTransfer");i.append(o);_classPrivateMethodGet(this,je,_appendFeFunc2).call(this,o,"feFuncR",t);_classPrivateMethodGet(this,je,_appendFeFunc2).call(this,o,"feFuncG",r);_classPrivateMethodGet(this,je,_appendFeFunc2).call(this,o,"feFuncB",a)}function _getRGB2(t){display_utils_classPrivateFieldGet(this,Re).style.color=t;return getRGB(getComputedStyle(display_utils_classPrivateFieldGet(this,Re)).getPropertyValue("color"))}var Be=function(t){display_utils_inherits(DOMCanvasFactory,t);function DOMCanvasFactory(){var t,r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ownerDocument,a=void 0===r?globalThis.document:r;display_utils_classCallCheck(this,DOMCanvasFactory);(t=display_utils_callSuper(this,DOMCanvasFactory))._document=a;return t}display_utils_createClass(DOMCanvasFactory,[{key:"_createCanvas",value:function _createCanvas(t,r){var a=this._document.createElement("canvas");a.width=t;a.height=r;return a}}]);return DOMCanvasFactory}(we);function fetchData(t){return _fetchData.apply(this,arguments)}function _fetchData(){_fetchData=function display_utils_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){display_utils_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){display_utils_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}(display_utils_regeneratorRuntime().mark((function _callee(t){var r,a,i=arguments;return display_utils_regeneratorRuntime().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:r=i.length>1&&void 0!==i[1]?i[1]:"text";if(!isValidFetchUrl(t,document.baseURI)){o.next=14;break}o.next=4;return fetch(t);case 4:if((a=o.sent).ok){o.next=7;break}throw new Error(a.statusText);case 7:o.t0=r;o.next="arraybuffer"===o.t0?10:"blob"===o.t0?11:"json"===o.t0?12:13;break;case 10:return o.abrupt("return",a.arrayBuffer());case 11:return o.abrupt("return",a.blob());case 12:return o.abrupt("return",a.json());case 13:return o.abrupt("return",a.text());case 14:return o.abrupt("return",new Promise((function(a,i){var o=new XMLHttpRequest;o.open("GET",t,!0);o.responseType=r;o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE){if(200===o.status||0===o.status){var t;switch(r){case"arraybuffer":case"blob":case"json":t=o.response;break;default:t=o.responseText}if(t){a(t);return}}i(new Error(o.statusText))}};o.send(null)})));case 15:case"end":return o.stop()}}),_callee)})));return _fetchData.apply(this,arguments)}var ze=function(t){display_utils_inherits(DOMCMapReaderFactory,t);function DOMCMapReaderFactory(){display_utils_classCallCheck(this,DOMCMapReaderFactory);return display_utils_callSuper(this,DOMCMapReaderFactory,arguments)}display_utils_createClass(DOMCMapReaderFactory,[{key:"_fetchData",value:function _fetchData(t,r){return fetchData(t,this.isCompressed?"arraybuffer":"text").then((function(t){return{cMapData:t instanceof ArrayBuffer?new Uint8Array(t):stringToBytes(t),compressionType:r}}))}}]);return DOMCMapReaderFactory}(Pe),Ue=function(t){display_utils_inherits(DOMStandardFontDataFactory,t);function DOMStandardFontDataFactory(){display_utils_classCallCheck(this,DOMStandardFontDataFactory);return display_utils_callSuper(this,DOMStandardFontDataFactory,arguments)}display_utils_createClass(DOMStandardFontDataFactory,[{key:"_fetchData",value:function _fetchData(t){return fetchData(t,"arraybuffer").then((function(t){return new Uint8Array(t)}))}}]);return DOMStandardFontDataFactory}(ke),qe=function(t){display_utils_inherits(DOMSVGFactory,t);function DOMSVGFactory(){display_utils_classCallCheck(this,DOMSVGFactory);return display_utils_callSuper(this,DOMSVGFactory,arguments)}display_utils_createClass(DOMSVGFactory,[{key:"_createSVG",value:function _createSVG(t){return document.createElementNS(Fe,t)}}]);return DOMSVGFactory}(Se),Ve=function(){function PageViewport(t){var r=t.viewBox,a=t.scale,i=t.rotation,o=t.offsetX,l=void 0===o?0:o,c=t.offsetY,u=void 0===c?0:c,h=t.dontFlip,d=void 0!==h&&h;display_utils_classCallCheck(this,PageViewport);this.viewBox=r;this.scale=a;this.rotation=i;this.offsetX=l;this.offsetY=u;var p,v,_,y,g,m,b,w,P=(r[2]+r[0])/2,k=(r[3]+r[1])/2;(i%=360)<0&&(i+=360);switch(i){case 180:p=-1;v=0;_=0;y=1;break;case 90:p=0;v=1;_=1;y=0;break;case 270:p=0;v=-1;_=-1;y=0;break;case 0:p=1;v=0;_=0;y=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(d){_=-_;y=-y}if(0===p){g=Math.abs(k-r[1])*a+l;m=Math.abs(P-r[0])*a+u;b=(r[3]-r[1])*a;w=(r[2]-r[0])*a}else{g=Math.abs(P-r[0])*a+l;m=Math.abs(k-r[1])*a+u;b=(r[2]-r[0])*a;w=(r[3]-r[1])*a}this.transform=[p*a,v*a,_*a,y*a,g-p*a*P-_*a*k,m-v*a*P-y*a*k];this.width=b;this.height=w}display_utils_createClass(PageViewport,[{key:"rawDims",get:function get(){var t=this.viewBox;return shadow(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}},{key:"clone",value:function clone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.scale,a=void 0===r?this.scale:r,i=t.rotation,o=void 0===i?this.rotation:i,l=t.offsetX,c=void 0===l?this.offsetX:l,u=t.offsetY,h=void 0===u?this.offsetY:u,d=t.dontFlip,p=void 0!==d&&d;return new PageViewport({viewBox:this.viewBox.slice(),scale:a,rotation:o,offsetX:c,offsetY:h,dontFlip:p})}},{key:"convertToViewportPoint",value:function convertToViewportPoint(t,r){return fe.applyTransform([t,r],this.transform)}},{key:"convertToViewportRectangle",value:function convertToViewportRectangle(t){var r=fe.applyTransform([t[0],t[1]],this.transform),a=fe.applyTransform([t[2],t[3]],this.transform);return[r[0],r[1],a[0],a[1]]}},{key:"convertToPdfPoint",value:function convertToPdfPoint(t,r){return fe.applyInverseTransform([t,r],this.transform)}}]);return PageViewport}(),Ke=function(t){display_utils_inherits(RenderingCancelledException,t);function RenderingCancelledException(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;display_utils_classCallCheck(this,RenderingCancelledException);(r=display_utils_callSuper(this,RenderingCancelledException,[t,"RenderingCancelledException"])).extraDelay=a;return r}return display_utils_createClass(RenderingCancelledException)}(ne);function isDataScheme(t){for(var r=t.length,a=0;a<r&&""===t[a].trim();)a++;return"data:"===t.substring(a,a+5).toLowerCase()}function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function getFilenameFromUrl(t){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])){var r=t.split(/[#?]/,1);t=display_utils_slicedToArray(r,1)[0]}return t.substring(t.lastIndexOf("/")+1)}function getPdfFilenameFromUrl(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if(window.PDFViewerApplication.appConfig.filenameForDownload)return window.PDFViewerApplication.appConfig.filenameForDownload;if("string"!=typeof t)return r;if(isDataScheme(t)){warn('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return r}var a=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t),o=a.exec(i[1])||a.exec(i[2])||a.exec(i[3]);if(o&&(o=o[0]).includes("%"))try{o=a.exec(decodeURIComponent(o))[0]}catch(t){}return o||r}var Ye,Xe=function(){function StatTimer(){display_utils_classCallCheck(this,StatTimer);_defineProperty(this,"started",Object.create(null));_defineProperty(this,"times",[])}display_utils_createClass(StatTimer,[{key:"time",value:function time(t){t in this.started&&warn("Timer is already running for ".concat(t));this.started[t]=Date.now()}},{key:"timeEnd",value:function timeEnd(t){t in this.started||warn("Timer has not been started for ".concat(t));this.times.push({name:t,start:this.started[t],end:Date.now()});delete this.started[t]}},{key:"toString",value:function toString(){var t,r=[],a=0,i=display_utils_createForOfIteratorHelper(this.times);try{for(i.s();!(t=i.n()).done;){var o=t.value.name;a=Math.max(o.length,a)}}catch(t){i.e(t)}finally{i.f()}var l,c=display_utils_createForOfIteratorHelper(this.times);try{for(c.s();!(l=c.n()).done;){var u=l.value,h=u.name,d=u.start,p=u.end;r.push("".concat(h.padEnd(a)," ").concat(p-d,"ms\n"))}}catch(t){c.e(t)}finally{c.f()}return r.join("")}}]);return StatTimer}();function isValidFetchUrl(t,r){try{var a=(r?new URL(t,r):new URL(t)).protocol;return"http:"===a||"https:"===a||"capacitor:"===a}catch(t){return!1}}function noContextMenu(t){t.preventDefault()}var $e,Je=function(){function PDFDateString(){display_utils_classCallCheck(this,PDFDateString)}display_utils_createClass(PDFDateString,null,[{key:"toDateObject",value:function toDateObject(t){if(!t||"string"!=typeof t)return null;Ye||(Ye=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));var r=Ye.exec(t);if(!r)return null;var a=parseInt(r[1],10),i=parseInt(r[2],10);i=i>=1&&i<=12?i-1:0;var o=parseInt(r[3],10);o=o>=1&&o<=31?o:1;var l=parseInt(r[4],10);l=l>=0&&l<=23?l:0;var c=parseInt(r[5],10);c=c>=0&&c<=59?c:0;var u=parseInt(r[6],10);u=u>=0&&u<=59?u:0;var h=r[7]||"Z",d=parseInt(r[8],10);d=d>=0&&d<=23?d:0;var p=parseInt(r[9],10)||0;p=p>=0&&p<=59?p:0;if("-"===h){l+=d;c+=p}else if("+"===h){l-=d;c-=p}return new Date(Date.UTC(a,i,o,l,c,u))}}]);return PDFDateString}();function getXfaPageViewport(t,r){var a=r.scale,i=void 0===a?1:a,o=r.rotation,l=void 0===o?0:o,c=t.attributes.style,u=c.width,h=c.height,d=[0,0,parseInt(u),parseInt(h)];return new Ve({viewBox:d,scale:i,rotation:l})}function getRGB(t){if(t.startsWith("#")){var r=parseInt(t.slice(1),16);return[(16711680&r)>>16,(65280&r)>>8,255&r]}if(t.startsWith("rgb("))return t.slice(4,-1).split(",").map((function(t){return parseInt(t)}));if(t.startsWith("rgba("))return t.slice(5,-1).split(",").map((function(t){return parseInt(t)})).slice(0,3);warn('Not a valid color format: "'.concat(t,'"'));return[0,0,0]}function getCurrentTransform(t){var r=t.getTransform();return[r.a,r.b,r.c,r.d,r.e,r.f]}function getCurrentTransformInverse(t){var r=t.getTransform().invertSelf();return[r.a,r.b,r.c,r.d,r.e,r.f]}function setLayerDimensions(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(r instanceof Ve){var o=r.rawDims,l=o.pageWidth,c=o.pageHeight,u=t.style,h=he.isCSSRoundSupported,d="var(--scale-factor) * ".concat(l,"px"),p="var(--scale-factor) * ".concat(c,"px"),v=h?"round(".concat(d,", 1px)"):"calc(".concat(d,")"),_=h?"round(".concat(p,", 1px)"):"calc(".concat(p,")");if(a&&r.rotation%180!=0){u.width=_;u.height=v}else{u.width=v;u.height=_}}i&&t.setAttribute("data-main-rotation",r.rotation)}function tools_typeof(t){return tools_typeof="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},tools_typeof(t)}function tools_defineProperty(t,r,a){(r=tools_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function tools_toConsumableArray(t){return function tools_arrayWithoutHoles(t){if(Array.isArray(t))return tools_arrayLikeToArray(t)}(t)||function tools_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||tools_unsupportedIterableToArray(t)||function tools_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tools_slicedToArray(t,r){return function tools_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function tools_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||tools_unsupportedIterableToArray(t,r)||function tools_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tools_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */tools_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==tools_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(tools_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function tools_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function tools_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){tools_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){tools_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function tools_classPrivateMethodInitSpec(t,r){tools_checkPrivateRedeclaration(t,r);r.add(t)}function tools_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function tools_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function tools_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,tools_toPropertyKey(i.key),i)}}function tools_createClass(t,r,a){r&&tools_defineProperties(t.prototype,r);a&&tools_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function tools_toPropertyKey(t){var r=function tools_toPrimitive(t,r){if("object"!=tools_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=tools_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==tools_typeof(r)?r:String(r)}function tools_classPrivateFieldInitSpec(t,r,a){tools_checkPrivateRedeclaration(t,r);r.set(t,a)}function tools_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tools_classPrivateFieldSet(t,r,a){!function tools_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,tools_classExtractFieldDescriptor(t,r,"set"),a);return a}function tools_classPrivateFieldGet(t,r){return function tools_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,tools_classExtractFieldDescriptor(t,r,"get"))}function tools_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function tools_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=tools_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function tools_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return tools_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?tools_arrayLikeToArray(t,r):void 0}}function tools_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function bindEvents(t,r,a){var i,o=tools_createForOfIteratorHelper(a);try{for(o.s();!(i=o.n()).done;){var l=i.value;r.addEventListener(l,t[l].bind(t))}}catch(t){o.e(t)}finally{o.f()}}var Qe=new WeakMap,Ze=function(){function IdManager(){tools_classCallCheck(this,IdManager);tools_classPrivateFieldInitSpec(this,Qe,{writable:!0,value:0})}tools_createClass(IdManager,[{key:"getId",value:function getId(){var t,r;return"".concat("pdfjs_internal_editor_").concat((tools_classPrivateFieldSet(this,Qe,(t=tools_classPrivateFieldGet(this,Qe),r=t++,t)),r))}}]);return IdManager}(),et=new WeakMap,tt=new WeakMap,rt=new WeakMap,nt=new WeakSet,it=function(){function ImageManager(){tools_classCallCheck(this,ImageManager);tools_classPrivateMethodInitSpec(this,nt);tools_classPrivateFieldInitSpec(this,et,{writable:!0,value:getUuid()});tools_classPrivateFieldInitSpec(this,tt,{writable:!0,value:0});tools_classPrivateFieldInitSpec(this,rt,{writable:!0,value:null})}tools_createClass(ImageManager,[{key:"getFromFile",value:(a=tools_asyncToGenerator(tools_regeneratorRuntime().mark((function _callee(t){var r,a,i,o;return tools_regeneratorRuntime().wrap((function _callee$(l){for(;;)switch(l.prev=l.next){case 0:r=t.lastModified,a=t.name,i=t.size,o=t.type;return l.abrupt("return",tools_classPrivateMethodGet(this,nt,_get2).call(this,"".concat(r,"_").concat(a,"_").concat(i,"_").concat(o),t));case 2:case"end":return l.stop()}}),_callee,this)}))),function getFromFile(t){return a.apply(this,arguments)})},{key:"getFromUrl",value:(r=tools_asyncToGenerator(tools_regeneratorRuntime().mark((function _callee2(t){return tools_regeneratorRuntime().wrap((function _callee2$(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",tools_classPrivateMethodGet(this,nt,_get2).call(this,t,t));case 1:case"end":return r.stop()}}),_callee2,this)}))),function getFromUrl(t){return r.apply(this,arguments)})},{key:"getFromId",value:(t=tools_asyncToGenerator(tools_regeneratorRuntime().mark((function _callee3(t){var r;return tools_regeneratorRuntime().wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:tools_classPrivateFieldGet(this,rt)||tools_classPrivateFieldSet(this,rt,new Map);if(r=tools_classPrivateFieldGet(this,rt).get(t)){a.next=4;break}return a.abrupt("return",null);case 4:if(!r.bitmap){a.next=7;break}r.refCounter+=1;return a.abrupt("return",r);case 7:if(!r.file){a.next=9;break}return a.abrupt("return",this.getFromFile(r.file));case 9:return a.abrupt("return",this.getFromUrl(r.url));case 10:case"end":return a.stop()}}),_callee3,this)}))),function getFromId(r){return t.apply(this,arguments)})},{key:"getSvgUrl",value:function getSvgUrl(t){var r=tools_classPrivateFieldGet(this,rt).get(t);return null!=r&&r.isSvg?r.svgUrl:null}},{key:"deleteId",value:function deleteId(t){tools_classPrivateFieldGet(this,rt)||tools_classPrivateFieldSet(this,rt,new Map);var r=tools_classPrivateFieldGet(this,rt).get(t);if(r){r.refCounter-=1;0===r.refCounter&&(r.bitmap=null)}}},{key:"isValidId",value:function isValidId(t){return t.startsWith("image_".concat(tools_classPrivateFieldGet(this,et),"_"))}}],[{key:"_isSVGFittingCanvas",get:function get(){var t=new OffscreenCanvas(1,3).getContext("2d"),r=new Image;r.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 shadow(this,"_isSVGFittingCanvas",r.decode().then((function(){t.drawImage(r,0,0,1,1,0,0,1,3);return 0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]})))}}]);var t,r,a;return ImageManager}();$e=it;function _get2(t,r){return _get3.apply(this,arguments)}function _get3(){_get3=tools_asyncToGenerator(tools_regeneratorRuntime().mark((function _callee5(t,r){var a,i,o,l,c,u,h,d,p;return tools_regeneratorRuntime().wrap((function _callee5$(v){for(;;)switch(v.prev=v.next){case 0:tools_classPrivateFieldGet(this,rt)||tools_classPrivateFieldSet(this,rt,new Map);if(null!==(i=tools_classPrivateFieldGet(this,rt).get(t))){v.next=4;break}return v.abrupt("return",null);case 4:if(null===(a=i)||void 0===a||!a.bitmap){v.next=7;break}i.refCounter+=1;return v.abrupt("return",i);case 7:v.prev=7;i||(i={bitmap:null,id:"image_".concat(tools_classPrivateFieldGet(this,et),"_").concat((tools_classPrivateFieldSet(this,tt,(o=tools_classPrivateFieldGet(this,tt),l=o++,o)),l)),refCounter:0,isSvg:!1});if("string"!=typeof r){v.next=16;break}i.url=r;v.next=13;return fetchData(r,"blob");case 13:c=v.sent;v.next=17;break;case 16:c=i.file=r;case 17:if("image/svg+xml"!==c.type){v.next=27;break}u=$e._isSVGFittingCanvas;h=new FileReader;d=new Image;p=new Promise((function(t,r){d.onload=function(){i.bitmap=d;i.isSvg=!0;t()};h.onload=tools_asyncToGenerator(tools_regeneratorRuntime().mark((function _callee4(){var t;return tools_regeneratorRuntime().wrap((function _callee4$(r){for(;;)switch(r.prev=r.next){case 0:t=i.svgUrl=h.result;r.next=3;return u;case 3:if(!r.sent){r.next=7;break}r.t0="".concat(t,"#svgView(preserveAspectRatio(none))");r.next=8;break;case 7:r.t0=t;case 8:d.src=r.t0;case 9:case"end":return r.stop()}}),_callee4)})));d.onerror=h.onerror=r}));h.readAsDataURL(c);v.next=25;return p;case 25:v.next=30;break;case 27:v.next=29;return createImageBitmap(c);case 29:i.bitmap=v.sent;case 30:i.refCounter=1;v.next=37;break;case 33:v.prev=33;v.t0=v.catch(7);console.error(v.t0);i=null;case 37:tools_classPrivateFieldGet(this,rt).set(t,i);i&&tools_classPrivateFieldGet(this,rt).set(i.id,i);return v.abrupt("return",i);case 40:case"end":return v.stop()}}),_callee5,this,[[7,33]])})));return _get3.apply(this,arguments)}var ot=new WeakMap,st=new WeakMap,lt=new WeakMap,ct=new WeakMap,ut=function(){function CommandManager(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;tools_classCallCheck(this,CommandManager);tools_classPrivateFieldInitSpec(this,ot,{writable:!0,value:[]});tools_classPrivateFieldInitSpec(this,st,{writable:!0,value:!1});tools_classPrivateFieldInitSpec(this,lt,{writable:!0,value:void 0});tools_classPrivateFieldInitSpec(this,ct,{writable:!0,value:-1});tools_classPrivateFieldSet(this,lt,t)}tools_createClass(CommandManager,[{key:"add",value:function add(t){var r=t.cmd,a=t.undo,i=t.post,o=t.mustExec,l=t.type,c=void 0===l?NaN:l,u=t.overwriteIfSameType,h=void 0!==u&&u,d=t.keepUndo,p=void 0!==d&&d;o&&r();if(!tools_classPrivateFieldGet(this,st)){var v={cmd:r,undo:a,post:i,type:c};if(-1!==tools_classPrivateFieldGet(this,ct))if(h&&tools_classPrivateFieldGet(this,ot)[tools_classPrivateFieldGet(this,ct)].type===c){p&&(v.undo=tools_classPrivateFieldGet(this,ot)[tools_classPrivateFieldGet(this,ct)].undo);tools_classPrivateFieldGet(this,ot)[tools_classPrivateFieldGet(this,ct)]=v}else{var _=tools_classPrivateFieldGet(this,ct)+1;if(_===tools_classPrivateFieldGet(this,lt))tools_classPrivateFieldGet(this,ot).splice(0,1);else{tools_classPrivateFieldSet(this,ct,_);_<tools_classPrivateFieldGet(this,ot).length&&tools_classPrivateFieldGet(this,ot).splice(_)}tools_classPrivateFieldGet(this,ot).push(v)}else{tools_classPrivateFieldGet(this,ot).length>0&&(tools_classPrivateFieldGet(this,ot).length=0);tools_classPrivateFieldSet(this,ct,0);tools_classPrivateFieldGet(this,ot).push(v)}}}},{key:"undo",value:function undo(){if(-1!==tools_classPrivateFieldGet(this,ct)){tools_classPrivateFieldSet(this,st,!0);var t=tools_classPrivateFieldGet(this,ot)[tools_classPrivateFieldGet(this,ct)],undo=t.undo,r=t.post;undo();null==r||r();tools_classPrivateFieldSet(this,st,!1);tools_classPrivateFieldSet(this,ct,tools_classPrivateFieldGet(this,ct)-1)}}},{key:"redo",value:function redo(){if(tools_classPrivateFieldGet(this,ct)<tools_classPrivateFieldGet(this,ot).length-1){tools_classPrivateFieldSet(this,ct,tools_classPrivateFieldGet(this,ct)+1);tools_classPrivateFieldSet(this,st,!0);var t=tools_classPrivateFieldGet(this,ot)[tools_classPrivateFieldGet(this,ct)],r=t.cmd,a=t.post;r();null==a||a();tools_classPrivateFieldSet(this,st,!1)}}},{key:"hasSomethingToUndo",value:function hasSomethingToUndo(){return-1!==tools_classPrivateFieldGet(this,ct)}},{key:"hasSomethingToRedo",value:function hasSomethingToRedo(){return tools_classPrivateFieldGet(this,ct)<tools_classPrivateFieldGet(this,ot).length-1}},{key:"destroy",value:function destroy(){tools_classPrivateFieldSet(this,ot,null)}},{key:"reset",value:function reset(){tools_classPrivateFieldSet(this,ot,[]);tools_classPrivateFieldSet(this,ct,-1);tools_classPrivateFieldSet(this,st,!1)}}]);return CommandManager}(),ht=new WeakSet,dt=function(){function KeyboardManager(t){tools_classCallCheck(this,KeyboardManager);tools_classPrivateMethodInitSpec(this,ht);this.buffer=[];this.callbacks=new Map;this.allKeys=new Set;var r,a=he.platform.isMac,i=tools_createForOfIteratorHelper(t);try{for(i.s();!(r=i.n()).done;){var o,l=tools_slicedToArray(r.value,3),c=l[0],u=l[1],h=l[2],d=void 0===h?{}:h,p=tools_createForOfIteratorHelper(c);try{for(p.s();!(o=p.n()).done;){var v=o.value,_=v.startsWith("mac+");if(a&&_){this.callbacks.set(v.slice(4),{callback:u,options:d});this.allKeys.add(v.split("+").at(-1))}else if(!a&&!_){this.callbacks.set(v,{callback:u,options:d});this.allKeys.add(v.split("+").at(-1))}}}catch(t){p.e(t)}finally{p.f()}}}catch(t){i.e(t)}finally{i.f()}}tools_createClass(KeyboardManager,[{key:"exec",value:function exec(t,r){if(this.allKeys.has(r.key)){var a=this.callbacks.get(tools_classPrivateMethodGet(this,ht,_serialize2).call(this,r));if(a){var i=a.callback,o=a.options,l=o.bubbles,c=void 0!==l&&l,u=o.args,h=void 0===u?[]:u,d=o.checker,p=void 0===d?null:d;if(!p||p(t,r)){i.bind.apply(i,[t].concat(tools_toConsumableArray(h),[r]))();if(!c){r.stopPropagation();r.preventDefault()}}}}}}]);return KeyboardManager}();function _serialize2(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);var r=this.buffer.join("+");this.buffer.length=0;return r}var ft=function(){function ColorManager(){tools_classCallCheck(this,ColorManager)}tools_createClass(ColorManager,[{key:"_colors",get:function get(){var t=new Map([["CanvasText",null],["Canvas",null]]);!function getColorValues(t){var r=document.createElement("span");r.style.visibility="hidden";document.body.append(r);var a,i=display_utils_createForOfIteratorHelper(t.keys());try{for(i.s();!(a=i.n()).done;){var o=a.value;r.style.color=o;var l=window.getComputedStyle(r).color;t.set(o,getRGB(l))}}catch(t){i.e(t)}finally{i.f()}r.remove()}(t);return shadow(this,"_colors",t)}},{key:"convert",value:function convert(t){var r=getRGB(t);if(!window.matchMedia("(forced-colors: active)").matches)return r;var a,i=tools_createForOfIteratorHelper(this._colors);try{for(i.s();!(a=i.n()).done;){var o=tools_slicedToArray(a.value,2),l=o[0];if(o[1].every((function(t,a){return t===r[a]})))return ColorManager._colorsMapping.get(l)}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"getHexCode",value:function getHexCode(t){var r=this._colors.get(t);return r?fe.makeHexColor.apply(fe,tools_toConsumableArray(r)):t}}]);return ColorManager}();tools_defineProperty(ft,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var pt,vt=new WeakMap,_t=new WeakMap,yt=new WeakMap,gt=new WeakMap,mt=new WeakMap,bt=new WeakMap,wt=new WeakMap,Pt=new WeakMap,kt=new WeakMap,St=new WeakMap,Ft=new WeakMap,At=new WeakMap,xt=new WeakMap,Et=new WeakMap,It=new WeakMap,Tt=new WeakMap,Ct=new WeakMap,Mt=new WeakMap,Gt=new WeakMap,Ot=new WeakMap,Rt=new WeakMap,Lt=new WeakMap,Dt=new WeakMap,jt=new WeakMap,Nt=new WeakMap,Wt=new WeakMap,Ht=new WeakMap,Bt=new WeakMap,zt=new WeakMap,Ut=new WeakMap,qt=new WeakMap,Vt=new WeakMap,Kt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,$t=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,Zt=new WeakSet,er=new WeakSet,tr=new WeakSet,rr=new WeakSet,nr=new WeakSet,ar=new WeakSet,ir=new WeakSet,or=new WeakSet,sr=new WeakSet,lr=new WeakSet,cr=new WeakSet,ur=new WeakMap,hr=new WeakSet,dr=new WeakSet,fr=function(){function AnnotationEditorUIManager(t,r,a,i,o,l,c){tools_classCallCheck(this,AnnotationEditorUIManager);tools_classPrivateMethodInitSpec(this,dr);tools_classPrivateMethodInitSpec(this,hr);tools_classPrivateFieldInitSpec(this,ur,{get:_get_lastSelectedEditor,set:void 0});tools_classPrivateMethodInitSpec(this,cr);tools_classPrivateMethodInitSpec(this,lr);tools_classPrivateMethodInitSpec(this,sr);tools_classPrivateMethodInitSpec(this,or);tools_classPrivateMethodInitSpec(this,ir);tools_classPrivateMethodInitSpec(this,ar);tools_classPrivateMethodInitSpec(this,nr);tools_classPrivateMethodInitSpec(this,rr);tools_classPrivateMethodInitSpec(this,tr);tools_classPrivateMethodInitSpec(this,er);tools_classPrivateMethodInitSpec(this,Zt);tools_classPrivateFieldInitSpec(this,vt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,_t,{writable:!0,value:new Map});tools_classPrivateFieldInitSpec(this,yt,{writable:!0,value:new Map});tools_classPrivateFieldInitSpec(this,gt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,mt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,bt,{writable:!0,value:new ut});tools_classPrivateFieldInitSpec(this,wt,{writable:!0,value:0});tools_classPrivateFieldInitSpec(this,Pt,{writable:!0,value:new Set});tools_classPrivateFieldInitSpec(this,kt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,St,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Ft,{writable:!0,value:new Set});tools_classPrivateFieldInitSpec(this,At,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,xt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Et,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,It,{writable:!0,value:new Ze});tools_classPrivateFieldInitSpec(this,Tt,{writable:!0,value:!1});tools_classPrivateFieldInitSpec(this,Ct,{writable:!0,value:!1});tools_classPrivateFieldInitSpec(this,Mt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Gt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Ot,{writable:!0,value:g.NONE});tools_classPrivateFieldInitSpec(this,Rt,{writable:!0,value:new Set});tools_classPrivateFieldInitSpec(this,Lt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Dt,{writable:!0,value:this.blur.bind(this)});tools_classPrivateFieldInitSpec(this,jt,{writable:!0,value:this.focus.bind(this)});tools_classPrivateFieldInitSpec(this,Nt,{writable:!0,value:this.copy.bind(this)});tools_classPrivateFieldInitSpec(this,Wt,{writable:!0,value:this.cut.bind(this)});tools_classPrivateFieldInitSpec(this,Ht,{writable:!0,value:this.paste.bind(this)});tools_classPrivateFieldInitSpec(this,Bt,{writable:!0,value:this.keydown.bind(this)});tools_classPrivateFieldInitSpec(this,zt,{writable:!0,value:this.keyup.bind(this)});tools_classPrivateFieldInitSpec(this,Ut,{writable:!0,value:this.onEditingAction.bind(this)});tools_classPrivateFieldInitSpec(this,qt,{writable:!0,value:this.onPageChanging.bind(this)});tools_classPrivateFieldInitSpec(this,Vt,{writable:!0,value:this.onScaleChanging.bind(this)});tools_classPrivateFieldInitSpec(this,Kt,{writable:!0,value:this.onRotationChanging.bind(this)});tools_classPrivateFieldInitSpec(this,Yt,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}});tools_classPrivateFieldInitSpec(this,Xt,{writable:!0,value:[0,0]});tools_classPrivateFieldInitSpec(this,$t,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Jt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Qt,{writable:!0,value:null});tools_classPrivateFieldSet(this,Jt,t);tools_classPrivateFieldSet(this,Qt,r);tools_classPrivateFieldSet(this,gt,a);this._eventBus=i;this._eventBus._on("editingaction",tools_classPrivateFieldGet(this,Ut));this._eventBus._on("pagechanging",tools_classPrivateFieldGet(this,qt));this._eventBus._on("scalechanging",tools_classPrivateFieldGet(this,Vt));this._eventBus._on("rotationchanging",tools_classPrivateFieldGet(this,Kt));tools_classPrivateFieldSet(this,mt,o.annotationStorage);tools_classPrivateFieldSet(this,At,o.filterFactory);tools_classPrivateFieldSet(this,Lt,l);tools_classPrivateFieldSet(this,Et,c||null);this.viewParameters={realScale:Ae.PDF_TO_CSS_UNITS,rotation:0};this.isShiftKeyDown=!1}tools_createClass(AnnotationEditorUIManager,[{key:"destroy",value:function destroy(){var t;tools_classPrivateMethodGet(this,rr,_removeKeyboardManager2).call(this);tools_classPrivateMethodGet(this,er,_removeFocusManager2).call(this);this._eventBus._off("editingaction",tools_classPrivateFieldGet(this,Ut));this._eventBus._off("pagechanging",tools_classPrivateFieldGet(this,qt));this._eventBus._off("scalechanging",tools_classPrivateFieldGet(this,Vt));this._eventBus._off("rotationchanging",tools_classPrivateFieldGet(this,Kt));var r,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(a.s();!(r=a.n()).done;){r.value.destroy()}}catch(t){a.e(t)}finally{a.f()}tools_classPrivateFieldGet(this,yt).clear();tools_classPrivateFieldGet(this,_t).clear();tools_classPrivateFieldGet(this,Ft).clear();tools_classPrivateFieldSet(this,vt,null);tools_classPrivateFieldGet(this,Rt).clear();tools_classPrivateFieldGet(this,bt).destroy();null===(t=tools_classPrivateFieldGet(this,gt))||void 0===t||t.destroy();if(tools_classPrivateFieldGet(this,xt)){clearTimeout(tools_classPrivateFieldGet(this,xt));tools_classPrivateFieldSet(this,xt,null)}if(tools_classPrivateFieldGet(this,$t)){clearTimeout(tools_classPrivateFieldGet(this,$t));tools_classPrivateFieldSet(this,$t,null)}}},{key:"hcmFilter",get:function get(){return shadow(this,"hcmFilter",tools_classPrivateFieldGet(this,Lt)?tools_classPrivateFieldGet(this,At).addHCMFilter(tools_classPrivateFieldGet(this,Lt).foreground,tools_classPrivateFieldGet(this,Lt).background):"none")}},{key:"direction",get:function get(){return shadow(this,"direction",getComputedStyle(tools_classPrivateFieldGet(this,Jt)).direction)}},{key:"highlightColors",get:function get(){return shadow(this,"highlightColors",tools_classPrivateFieldGet(this,Et)?new Map(tools_classPrivateFieldGet(this,Et).split(",").map((function(t){return t.split("=").map((function(t){return t.trim()}))}))):null)}},{key:"setMainHighlightColorPicker",value:function setMainHighlightColorPicker(t){tools_classPrivateFieldSet(this,Gt,t)}},{key:"editAltText",value:function editAltText(t){var r;null===(r=tools_classPrivateFieldGet(this,gt))||void 0===r||r.editAltText(this,t)}},{key:"onPageChanging",value:function onPageChanging(t){var r=t.pageNumber;tools_classPrivateFieldSet(this,wt,r-1)}},{key:"focusMainContainer",value:function focusMainContainer(){tools_classPrivateFieldGet(this,Jt).focus()}},{key:"findParent",value:function findParent(t,r){var a,i=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(i.s();!(a=i.n()).done;){var o=a.value,l=o.div.getBoundingClientRect(),c=l.x,u=l.y,h=l.width,d=l.height;if(t>=c&&t<=c+h&&r>=u&&r<=u+d)return o}}catch(t){i.e(t)}finally{i.f()}return null}},{key:"disableUserSelect",value:function disableUserSelect(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];tools_classPrivateFieldGet(this,Qt).classList.toggle("noUserSelect",t)}},{key:"addShouldRescale",value:function addShouldRescale(t){tools_classPrivateFieldGet(this,Ft).add(t)}},{key:"removeShouldRescale",value:function removeShouldRescale(t){tools_classPrivateFieldGet(this,Ft).delete(t)}},{key:"onScaleChanging",value:function onScaleChanging(t){var r=t.scale;this.commitOrRemove();this.viewParameters.realScale=r*Ae.PDF_TO_CSS_UNITS;var a,i=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Ft));try{for(i.s();!(a=i.n()).done;){a.value.onScaleChanging()}}catch(t){i.e(t)}finally{i.f()}}},{key:"onRotationChanging",value:function onRotationChanging(t){var r=t.pagesRotation;this.commitOrRemove();this.viewParameters.rotation=r}},{key:"addToAnnotationStorage",value:function addToAnnotationStorage(t){t.isEmpty()||!tools_classPrivateFieldGet(this,mt)||tools_classPrivateFieldGet(this,mt).has(t.id)||tools_classPrivateFieldGet(this,mt).setValue(t.id,t)}},{key:"blur",value:function blur(){this.isShiftKeyDown=!1;if(this.hasSelection){var t,r=document.activeElement,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(a.s();!(t=a.n()).done;){var i=t.value;if(i.div.contains(r)){tools_classPrivateFieldSet(this,Mt,[i,r]);i._focusEventsAllowed=!1;break}}}catch(t){a.e(t)}finally{a.f()}}}},{key:"focus",value:function focus(){if(tools_classPrivateFieldGet(this,Mt)){var t=tools_slicedToArray(tools_classPrivateFieldGet(this,Mt),2),r=t[0],a=t[1];tools_classPrivateFieldSet(this,Mt,null);a.addEventListener("focusin",(function(){r._focusEventsAllowed=!0}),{once:!0});a.focus()}}},{key:"addEditListeners",value:function addEditListeners(){tools_classPrivateMethodGet(this,tr,_addKeyboardManager2).call(this);tools_classPrivateMethodGet(this,nr,_addCopyPasteListeners2).call(this)}},{key:"removeEditListeners",value:function removeEditListeners(){tools_classPrivateMethodGet(this,rr,_removeKeyboardManager2).call(this);tools_classPrivateMethodGet(this,ar,_removeCopyPasteListeners2).call(this)}},{key:"copy",value:function copy(t){var r;t.preventDefault();null===(r=tools_classPrivateFieldGet(this,vt))||void 0===r||r.commitOrRemove();if(this.hasSelection){var a,i=[],o=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(o.s();!(a=o.n()).done;){var l=a.value.serialize(!0);l&&i.push(l)}}catch(t){o.e(t)}finally{o.f()}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}}},{key:"cut",value:function cut(t){this.copy(t);this.delete()}},{key:"paste",value:function paste(t){t.preventDefault();var r,a=t.clipboardData,i=tools_createForOfIteratorHelper(a.items);try{for(i.s();!(r=i.n()).done;){var o,l=r.value,c=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,St));try{for(c.s();!(o=c.n()).done;){var u=o.value;if(u.isHandlingMimeForPasting(l.type)){u.paste(l,this.currentLayer);return}}}catch(t){c.e(t)}finally{c.f()}}}catch(t){i.e(t)}finally{i.f()}var h=a.getData("application/pdfjs");this.addSerializedEditor(h)}},{key:"addSerializedEditor",value:function addSerializedEditor(t){var r=this,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(t){try{"string"==typeof t&&(t=JSON.parse(t))}catch(t){warn('paste: "'.concat(t.message,'".'));return}if(Array.isArray(t)){var l=tools_classPrivateFieldGet(this,Ot);a&&l===g.NONE&&this.updateMode(g.FREETEXT);this.unselectAll();try{var c,u=[],h=tools_createForOfIteratorHelper(t);try{for(h.s();!(c=h.n()).done;){var d=c.value,p=void 0===d.pageIndex,v=(o||p?this.currentLayer:this.getLayer(d.pageIndex)).deserialize(d);if(!v)return;v.doNotMove=i;u.push(v)}}catch(t){h.e(t)}finally{h.f()}this.addCommands({cmd:function cmd(){for(var t=0,a=u;t<a.length;t++){var i=a[t];tools_classPrivateMethodGet(r,cr,_addEditorToLayer2).call(r,i)}tools_classPrivateMethodGet(r,dr,_selectEditors2).call(r,u)},undo:function undo(){for(var t=0,r=u;t<r.length;t++){r[t].remove()}},mustExec:!0})}catch(t){warn('paste: "'.concat(t.message,'".'))}a&&l!==tools_classPrivateFieldGet(this,Ot)&&this.updateMode(l)}}}},{key:"keydown",value:function keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0);this.isEditorHandlingKeyboard||AnnotationEditorUIManager._keyboardManager.exec(this,t)}},{key:"keyup",value:function keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1)}},{key:"onEditingAction",value:function onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}},{key:"setEditingState",value:function setEditingState(t){if(t){tools_classPrivateMethodGet(this,Zt,_addFocusManager2).call(this);tools_classPrivateMethodGet(this,tr,_addKeyboardManager2).call(this);tools_classPrivateMethodGet(this,nr,_addCopyPasteListeners2).call(this);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{isEditing:tools_classPrivateFieldGet(this,Ot)!==g.NONE,isEmpty:tools_classPrivateMethodGet(this,hr,_isEmpty2).call(this),hasSomethingToUndo:tools_classPrivateFieldGet(this,bt).hasSomethingToUndo(),hasSomethingToRedo:tools_classPrivateFieldGet(this,bt).hasSomethingToRedo(),hasSelectedEditor:!1})}else{tools_classPrivateMethodGet(this,er,_removeFocusManager2).call(this);tools_classPrivateMethodGet(this,rr,_removeKeyboardManager2).call(this);tools_classPrivateMethodGet(this,ar,_removeCopyPasteListeners2).call(this);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{isEditing:!1});this.disableUserSelect(!1)}}},{key:"registerEditorTypes",value:function registerEditorTypes(t){if(!tools_classPrivateFieldGet(this,St)){tools_classPrivateFieldSet(this,St,t);var r,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,St));try{for(a.s();!(r=a.n()).done;){var i=r.value;tools_classPrivateMethodGet(this,or,_dispatchUpdateUI2).call(this,i.defaultPropertiesToUpdate)}}catch(t){a.e(t)}finally{a.f()}}}},{key:"getId",value:function getId(){return tools_classPrivateFieldGet(this,It).getId()}},{key:"currentLayer",get:function get(){return tools_classPrivateFieldGet(this,yt).get(tools_classPrivateFieldGet(this,wt))}},{key:"getLayer",value:function getLayer(t){return tools_classPrivateFieldGet(this,yt).get(t)}},{key:"currentPageIndex",get:function get(){return tools_classPrivateFieldGet(this,wt)}},{key:"addLayer",value:function addLayer(t){tools_classPrivateFieldGet(this,yt).set(t.pageIndex,t);tools_classPrivateFieldGet(this,Tt)?t.enable():t.disable()}},{key:"removeLayer",value:function removeLayer(t){tools_classPrivateFieldGet(this,yt).delete(t.pageIndex)}},{key:"updateMode",value:function updateMode(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(tools_classPrivateFieldGet(this,Ot)!==t){tools_classPrivateFieldSet(this,Ot,t);if(t!==g.NONE){this.setEditingState(!0);tools_classPrivateMethodGet(this,sr,_enableAll2).call(this);this.unselectAll();var i,o=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(o.s();!(i=o.n()).done;){i.value.updateMode(t)}}catch(t){o.e(t)}finally{o.f()}if(r||!a){if(r){var l,c=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,_t).values());try{for(c.s();!(l=c.n()).done;){var u=l.value;if(u.annotationElementId===r){this.setSelected(u);u.enterInEditMode();break}}}catch(t){c.e(t)}finally{c.f()}}}else this.addNewEditorFromKeyboard()}else{this.setEditingState(!1);tools_classPrivateMethodGet(this,lr,_disableAll2).call(this)}}}},{key:"addNewEditorFromKeyboard",value:function addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}},{key:"updateToolbar",value:function updateToolbar(t){t!==tools_classPrivateFieldGet(this,Ot)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}},{key:"updateParams",value:function updateParams(t,r){var a;if(tools_classPrivateFieldGet(this,St)){switch(t){case m.CREATE:this.currentLayer.addNewEditor();return;case m.HIGHLIGHT_DEFAULT_COLOR:null===(a=tools_classPrivateFieldGet(this,Gt))||void 0===a||a.updateColor(r)}var i,o=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(o.s();!(i=o.n()).done;){i.value.updateParams(t,r)}}catch(t){o.e(t)}finally{o.f()}var l,c=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,St));try{for(c.s();!(l=c.n()).done;){l.value.updateDefaultParams(t,r)}}catch(t){c.e(t)}finally{c.f()}}}},{key:"enableWaiting",value:function enableWaiting(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(tools_classPrivateFieldGet(this,Ct)!==t){tools_classPrivateFieldSet(this,Ct,t);var r,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(a.s();!(r=a.n()).done;){var i=r.value;t?i.disableClick():i.enableClick();i.div.classList.toggle("waiting",t)}}catch(t){a.e(t)}finally{a.f()}}}},{key:"getEditors",value:function getEditors(t){var r,a=[],i=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,_t).values());try{for(i.s();!(r=i.n()).done;){var o=r.value;o.pageIndex===t&&a.push(o)}}catch(t){i.e(t)}finally{i.f()}return a}},{key:"getEditor",value:function getEditor(t){return tools_classPrivateFieldGet(this,_t).get(t)}},{key:"addEditor",value:function addEditor(t){tools_classPrivateFieldGet(this,_t).set(t.id,t)}},{key:"removeEditor",value:function removeEditor(t){var r=this;if(t.div.contains(document.activeElement)){tools_classPrivateFieldGet(this,xt)&&clearTimeout(tools_classPrivateFieldGet(this,xt));tools_classPrivateFieldSet(this,xt,setTimeout((function(){r.focusMainContainer();tools_classPrivateFieldSet(r,xt,null)}),0))}tools_classPrivateFieldGet(this,_t).delete(t.id);this.unselect(t);if(!t.annotationElementId||!tools_classPrivateFieldGet(this,Pt).has(t.annotationElementId)){var a;null===(a=tools_classPrivateFieldGet(this,mt))||void 0===a||a.remove(t.id)}}},{key:"addDeletedAnnotationElement",value:function addDeletedAnnotationElement(t){tools_classPrivateFieldGet(this,Pt).add(t.annotationElementId);t.deleted=!0}},{key:"isDeletedAnnotationElement",value:function isDeletedAnnotationElement(t){return tools_classPrivateFieldGet(this,Pt).has(t)}},{key:"removeDeletedAnnotationElement",value:function removeDeletedAnnotationElement(t){tools_classPrivateFieldGet(this,Pt).delete(t.annotationElementId);t.deleted=!1}},{key:"setActiveEditor",value:function setActiveEditor(t){if(tools_classPrivateFieldGet(this,vt)!==t){tools_classPrivateFieldSet(this,vt,t);t&&tools_classPrivateMethodGet(this,or,_dispatchUpdateUI2).call(this,t.propertiesToUpdate)}}},{key:"updateUI",value:function updateUI(t){tools_classPrivateFieldGet(this,ur)===t&&tools_classPrivateMethodGet(this,or,_dispatchUpdateUI2).call(this,t.propertiesToUpdate)}},{key:"toggleSelected",value:function toggleSelected(t){if(tools_classPrivateFieldGet(this,Rt).has(t)){tools_classPrivateFieldGet(this,Rt).delete(t);t.unselect();tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}else{tools_classPrivateFieldGet(this,Rt).add(t);t.select();tools_classPrivateMethodGet(this,or,_dispatchUpdateUI2).call(this,t.propertiesToUpdate);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}}},{key:"setSelected",value:function setSelected(t){var r,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(a.s();!(r=a.n()).done;){var i=r.value;i!==t&&i.unselect()}}catch(t){a.e(t)}finally{a.f()}tools_classPrivateFieldGet(this,Rt).clear();tools_classPrivateFieldGet(this,Rt).add(t);t.select();tools_classPrivateMethodGet(this,or,_dispatchUpdateUI2).call(this,t.propertiesToUpdate);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}},{key:"isSelected",value:function isSelected(t){return tools_classPrivateFieldGet(this,Rt).has(t)}},{key:"firstSelectedEditor",get:function get(){return tools_classPrivateFieldGet(this,Rt).values().next().value}},{key:"unselect",value:function unselect(t){t.unselect();tools_classPrivateFieldGet(this,Rt).delete(t);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}},{key:"hasSelection",get:function get(){return 0!==tools_classPrivateFieldGet(this,Rt).size}},{key:"isEnterHandled",get:function get(){return 1===tools_classPrivateFieldGet(this,Rt).size&&this.firstSelectedEditor.isEnterHandled}},{key:"undo",value:function undo(){tools_classPrivateFieldGet(this,bt).undo();tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:tools_classPrivateFieldGet(this,bt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:tools_classPrivateMethodGet(this,hr,_isEmpty2).call(this)})}},{key:"redo",value:function redo(){tools_classPrivateFieldGet(this,bt).redo();tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:tools_classPrivateFieldGet(this,bt).hasSomethingToRedo(),isEmpty:tools_classPrivateMethodGet(this,hr,_isEmpty2).call(this)})}},{key:"addCommands",value:function addCommands(t){tools_classPrivateFieldGet(this,bt).add(t);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:tools_classPrivateMethodGet(this,hr,_isEmpty2).call(this)})}},{key:"delete",value:function _delete(){var t=this;this.commitOrRemove();if(this.hasSelection){var r=tools_toConsumableArray(tools_classPrivateFieldGet(this,Rt));this.addCommands({cmd:function cmd(){var t,a=tools_createForOfIteratorHelper(r);try{for(a.s();!(t=a.n()).done;){t.value.remove()}}catch(t){a.e(t)}finally{a.f()}},undo:function undo(){var a,i=tools_createForOfIteratorHelper(r);try{for(i.s();!(a=i.n()).done;){var o=a.value;tools_classPrivateMethodGet(t,cr,_addEditorToLayer2).call(t,o)}}catch(t){i.e(t)}finally{i.f()}},mustExec:!0})}}},{key:"commitOrRemove",value:function commitOrRemove(){var t;null===(t=tools_classPrivateFieldGet(this,vt))||void 0===t||t.commitOrRemove()}},{key:"hasSomethingToControl",value:function hasSomethingToControl(){return tools_classPrivateFieldGet(this,vt)||this.hasSelection}},{key:"selectAll",value:function selectAll(){var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(r.s();!(t=r.n()).done;){t.value.commit()}}catch(t){r.e(t)}finally{r.f()}tools_classPrivateMethodGet(this,dr,_selectEditors2).call(this,tools_classPrivateFieldGet(this,_t).values())}},{key:"unselectAll",value:function unselectAll(){if(tools_classPrivateFieldGet(this,vt)){tools_classPrivateFieldGet(this,vt).commitOrRemove();if(tools_classPrivateFieldGet(this,Ot)!==g.NONE)return}if(this.hasSelection){var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(r.s();!(t=r.n()).done;){t.value.unselect()}}catch(t){r.e(t)}finally{r.f()}tools_classPrivateFieldGet(this,Rt).clear();tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!1})}}},{key:"translateSelectedEditors",value:function translateSelectedEditors(t,r){var a=this;arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove();if(this.hasSelection){tools_classPrivateFieldGet(this,Xt)[0]+=t;tools_classPrivateFieldGet(this,Xt)[1]+=r;var i=tools_slicedToArray(tools_classPrivateFieldGet(this,Xt),2),o=i[0],l=i[1],c=tools_toConsumableArray(tools_classPrivateFieldGet(this,Rt));tools_classPrivateFieldGet(this,$t)&&clearTimeout(tools_classPrivateFieldGet(this,$t));tools_classPrivateFieldSet(this,$t,setTimeout((function(){tools_classPrivateFieldSet(a,$t,null);tools_classPrivateFieldGet(a,Xt)[0]=tools_classPrivateFieldGet(a,Xt)[1]=0;a.addCommands({cmd:function cmd(){var t,r=tools_createForOfIteratorHelper(c);try{for(r.s();!(t=r.n()).done;){var i=t.value;tools_classPrivateFieldGet(a,_t).has(i.id)&&i.translateInPage(o,l)}}catch(t){r.e(t)}finally{r.f()}},undo:function undo(){var t,r=tools_createForOfIteratorHelper(c);try{for(r.s();!(t=r.n()).done;){var i=t.value;tools_classPrivateFieldGet(a,_t).has(i.id)&&i.translateInPage(-o,-l)}}catch(t){r.e(t)}finally{r.f()}},mustExec:!1})}),1e3));var u,h=tools_createForOfIteratorHelper(c);try{for(h.s();!(u=h.n()).done;){u.value.translateInPage(t,r)}}catch(t){h.e(t)}finally{h.f()}}}},{key:"setUpDragSession",value:function setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0);tools_classPrivateFieldSet(this,kt,new Map);var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(r.s();!(t=r.n()).done;){var a=t.value;tools_classPrivateFieldGet(this,kt).set(a,{savedX:a.x,savedY:a.y,savedPageIndex:a.pageIndex,newX:0,newY:0,newPageIndex:-1})}}catch(t){r.e(t)}finally{r.f()}}}},{key:"endDragSession",value:function endDragSession(){var t=this;if(!tools_classPrivateFieldGet(this,kt))return!1;this.disableUserSelect(!1);var r=tools_classPrivateFieldGet(this,kt);tools_classPrivateFieldSet(this,kt,null);var a,i=!1,o=tools_createForOfIteratorHelper(r);try{for(o.s();!(a=o.n()).done;){var l=tools_slicedToArray(a.value,2),c=l[0],u=c.x,h=c.y,d=c.pageIndex,p=l[1];p.newX=u;p.newY=h;p.newPageIndex=d;i||(i=u!==p.savedX||h!==p.savedY||d!==p.savedPageIndex)}}catch(t){o.e(t)}finally{o.f()}if(!i)return!1;var v=function move(r,a,i,o){if(tools_classPrivateFieldGet(t,_t).has(r.id)){var l=tools_classPrivateFieldGet(t,yt).get(o);if(l)r._setParentAndPosition(l,a,i);else{r.pageIndex=o;r.x=a;r.y=i}}};this.addCommands({cmd:function cmd(){var t,a=tools_createForOfIteratorHelper(r);try{for(a.s();!(t=a.n()).done;){var i=tools_slicedToArray(t.value,2),o=i[0],l=i[1],c=l.newX,u=l.newY,h=l.newPageIndex;v(o,c,u,h)}}catch(t){a.e(t)}finally{a.f()}},undo:function undo(){var t,a=tools_createForOfIteratorHelper(r);try{for(a.s();!(t=a.n()).done;){var i=tools_slicedToArray(t.value,2),o=i[0],l=i[1],c=l.savedX,u=l.savedY,h=l.savedPageIndex;v(o,c,u,h)}}catch(t){a.e(t)}finally{a.f()}},mustExec:!0});return!0}},{key:"dragSelectedEditors",value:function dragSelectedEditors(t,r){if(tools_classPrivateFieldGet(this,kt)){var a,i=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,kt).keys());try{for(i.s();!(a=i.n()).done;){a.value.drag(t,r)}}catch(t){i.e(t)}finally{i.f()}}}},{key:"rebuild",value:function rebuild(t){if(null===t.parent){var r=this.getLayer(t.pageIndex);if(r){r.changeParent(t);r.addOrRebuild(t)}else{this.addEditor(t);this.addToAnnotationStorage(t);t.rebuild()}}else t.parent.addOrRebuild(t)}},{key:"isEditorHandlingKeyboard",get:function get(){var t;return(null===(t=this.getActive())||void 0===t?void 0:t.shouldGetKeyboardEvents())||1===tools_classPrivateFieldGet(this,Rt).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}},{key:"isActive",value:function isActive(t){return tools_classPrivateFieldGet(this,vt)===t}},{key:"getActive",value:function getActive(){return tools_classPrivateFieldGet(this,vt)}},{key:"getMode",value:function getMode(){return tools_classPrivateFieldGet(this,Ot)}},{key:"imageManager",get:function get(){return shadow(this,"imageManager",new it)}},{key:"removeEditors",value:function removeEditors(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0},r=!1;tools_classPrivateFieldGet(this,yt).forEach((function(t){return t.setCleaningUp(!0)}));tools_classPrivateFieldGet(this,_t).forEach((function(a){if(t(a.serialize())){a.remove();r=!0}}));tools_classPrivateFieldGet(this,yt).forEach((function(t){return t.setCleaningUp(!1)}));if(r){tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!1,hasSomethingToRedo:!1,isEmpty:tools_classPrivateMethodGet(this,hr,_isEmpty2).call(this)});tools_classPrivateFieldGet(this,bt).reset()}}}],[{key:"_keyboardManager",get:function get(){var t=AnnotationEditorUIManager.prototype,r=function arrowChecker(t){return tools_classPrivateFieldGet(t,Jt).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl()},a=function textInputChecker(t,r){var a=r.target;if(a instanceof HTMLInputElement){var i=a.type;return"text"!==i&&"number"!==i}return!0},i=this.TRANSLATE_SMALL,o=this.TRANSLATE_BIG;return shadow(this,"_keyboardManager",new dt([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:a}],[["ctrl+z","mac+meta+z"],t.undo,{checker:a}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:a}],[["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:a}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:function checker(t,r){var a=r.target;return!(a instanceof HTMLButtonElement)&&tools_classPrivateFieldGet(t,Jt).contains(a)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:function checker(t){return tools_classPrivateFieldGet(t,Jt).contains(document.activeElement)}}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-o,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[o,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-o],checker:r}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,o],checker:r}]]))}}]);return AnnotationEditorUIManager}();function _addFocusManager2(){window.addEventListener("focus",tools_classPrivateFieldGet(this,jt));window.addEventListener("blur",tools_classPrivateFieldGet(this,Dt))}function _removeFocusManager2(){window.removeEventListener("focus",tools_classPrivateFieldGet(this,jt));window.removeEventListener("blur",tools_classPrivateFieldGet(this,Dt))}function _addKeyboardManager2(){window.addEventListener("keydown",tools_classPrivateFieldGet(this,Bt));window.addEventListener("keyup",tools_classPrivateFieldGet(this,zt))}function _removeKeyboardManager2(){window.removeEventListener("keydown",tools_classPrivateFieldGet(this,Bt));window.removeEventListener("keyup",tools_classPrivateFieldGet(this,zt))}function _addCopyPasteListeners2(){document.addEventListener("copy",tools_classPrivateFieldGet(this,Nt));document.addEventListener("cut",tools_classPrivateFieldGet(this,Wt));document.addEventListener("paste",tools_classPrivateFieldGet(this,Ht))}function _removeCopyPasteListeners2(){document.removeEventListener("copy",tools_classPrivateFieldGet(this,Nt));document.removeEventListener("cut",tools_classPrivateFieldGet(this,Wt));document.removeEventListener("paste",tools_classPrivateFieldGet(this,Ht))}function _dispatchUpdateStates2(t){var r=this;Object.entries(t).some((function(t){var a=tools_slicedToArray(t,2),i=a[0],o=a[1];return tools_classPrivateFieldGet(r,Yt)[i]!==o}))&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(tools_classPrivateFieldGet(this,Yt),t)})}function _dispatchUpdateUI2(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}function _enableAll2(){if(!tools_classPrivateFieldGet(this,Tt)){tools_classPrivateFieldSet(this,Tt,!0);var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(r.s();!(t=r.n()).done;){t.value.enable()}}catch(t){r.e(t)}finally{r.f()}}}function _disableAll2(){this.unselectAll();if(tools_classPrivateFieldGet(this,Tt)){tools_classPrivateFieldSet(this,Tt,!1);var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(r.s();!(t=r.n()).done;){t.value.disable()}}catch(t){r.e(t)}finally{r.f()}}}function _addEditorToLayer2(t){var r=tools_classPrivateFieldGet(this,yt).get(t.pageIndex);r?r.addOrRebuild(t):this.addEditor(t)}function _get_lastSelectedEditor(){var t,r=null,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(a.s();!(t=a.n()).done;)r=t.value}catch(t){a.e(t)}finally{a.f()}return r}function _isEmpty2(){if(0===tools_classPrivateFieldGet(this,_t).size)return!0;if(1===tools_classPrivateFieldGet(this,_t).size){var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,_t).values());try{for(r.s();!(t=r.n()).done;){return t.value.isEmpty()}}catch(t){r.e(t)}finally{r.f()}}return!1}function _selectEditors2(t){var r,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(a.s();!(r=a.n()).done;){r.value.unselect()}}catch(t){a.e(t)}finally{a.f()}tools_classPrivateFieldGet(this,Rt).clear();var i,o=tools_createForOfIteratorHelper(t);try{for(o.s();!(i=o.n()).done;){var l=i.value;if(!l.isEmpty()){tools_classPrivateFieldGet(this,Rt).add(l);l.select()}}}catch(t){o.e(t)}finally{o.f()}tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}tools_defineProperty(fr,"TRANSLATE_SMALL",1);tools_defineProperty(fr,"TRANSLATE_BIG",10);function alt_text_typeof(t){return alt_text_typeof="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},alt_text_typeof(t)}function alt_text_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */alt_text_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==alt_text_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(alt_text_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function alt_text_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function alt_text_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){alt_text_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){alt_text_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function alt_text_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,alt_text_toPropertyKey(i.key),i)}}function alt_text_toPropertyKey(t){var r=function alt_text_toPrimitive(t,r){if("object"!=alt_text_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=alt_text_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==alt_text_typeof(r)?r:String(r)}function alt_text_classPrivateFieldInitSpec(t,r,a){alt_text_checkPrivateRedeclaration(t,r);r.set(t,a)}function alt_text_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function alt_text_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function alt_text_classPrivateFieldGet(t,r){return function alt_text_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,alt_text_classExtractFieldDescriptor(t,r,"get"))}function alt_text_classPrivateFieldSet(t,r,a){!function alt_text_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,alt_text_classExtractFieldDescriptor(t,r,"set"),a);return a}function alt_text_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var pr=new WeakMap,vr=new WeakMap,_r=new WeakMap,yr=new WeakMap,gr=new WeakMap,mr=new WeakMap,br=new WeakMap,wr=new WeakSet,Pr=function(){function AltText(t){!function alt_text_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,AltText);!function alt_text_classPrivateMethodInitSpec(t,r){alt_text_checkPrivateRedeclaration(t,r);r.add(t)}(this,wr);alt_text_classPrivateFieldInitSpec(this,pr,{writable:!0,value:""});alt_text_classPrivateFieldInitSpec(this,vr,{writable:!0,value:!1});alt_text_classPrivateFieldInitSpec(this,_r,{writable:!0,value:null});alt_text_classPrivateFieldInitSpec(this,yr,{writable:!0,value:null});alt_text_classPrivateFieldInitSpec(this,gr,{writable:!0,value:null});alt_text_classPrivateFieldInitSpec(this,mr,{writable:!0,value:!1});alt_text_classPrivateFieldInitSpec(this,br,{writable:!0,value:null});alt_text_classPrivateFieldSet(this,br,t)}!function alt_text_createClass(t,r,a){r&&alt_text_defineProperties(t.prototype,r);a&&alt_text_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(AltText,[{key:"render",value:(t=alt_text_asyncToGenerator(alt_text_regeneratorRuntime().mark((function _callee(){var t,r,a,i=this;return alt_text_regeneratorRuntime().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:(t=alt_text_classPrivateFieldSet(this,_r,document.createElement("button"))).className="altText";o.next=4;return AltText._l10nPromise.get("pdfjs-editor-alt-text-button-label");case 4:r=o.sent;t.textContent=r;t.setAttribute("aria-label",r);t.tabIndex="0";t.addEventListener("contextmenu",noContextMenu);t.addEventListener("pointerdown",(function(t){return t.stopPropagation()}));a=function onClick(t){t.preventDefault();alt_text_classPrivateFieldGet(i,br)._uiManager.editAltText(alt_text_classPrivateFieldGet(i,br))};t.addEventListener("click",a,{capture:!0});t.addEventListener("keydown",(function(r){if(r.target===t&&"Enter"===r.key){alt_text_classPrivateFieldSet(i,mr,!0);a(r)}}));o.next=15;return alt_text_classPrivateMethodGet(this,wr,_setState2).call(this);case 15:return o.abrupt("return",t);case 16:case"end":return o.stop()}}),_callee,this)}))),function render(){return t.apply(this,arguments)})},{key:"finish",value:function finish(){if(alt_text_classPrivateFieldGet(this,_r)){alt_text_classPrivateFieldGet(this,_r).focus({focusVisible:alt_text_classPrivateFieldGet(this,mr)});alt_text_classPrivateFieldSet(this,mr,!1)}}},{key:"data",get:function get(){return{altText:alt_text_classPrivateFieldGet(this,pr),decorative:alt_text_classPrivateFieldGet(this,vr)}},set:function set(t){var r=t.altText,a=t.decorative;if(alt_text_classPrivateFieldGet(this,pr)!==r||alt_text_classPrivateFieldGet(this,vr)!==a){alt_text_classPrivateFieldSet(this,pr,r);alt_text_classPrivateFieldSet(this,vr,a);alt_text_classPrivateMethodGet(this,wr,_setState2).call(this)}}},{key:"toggle",value:function toggle(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(alt_text_classPrivateFieldGet(this,_r)){if(!t&&alt_text_classPrivateFieldGet(this,gr)){clearTimeout(alt_text_classPrivateFieldGet(this,gr));alt_text_classPrivateFieldSet(this,gr,null)}alt_text_classPrivateFieldGet(this,_r).disabled=!t}}},{key:"destroy",value:function destroy(){var t;null===(t=alt_text_classPrivateFieldGet(this,_r))||void 0===t||t.remove();alt_text_classPrivateFieldSet(this,_r,null);alt_text_classPrivateFieldSet(this,yr,null)}}],[{key:"initialize",value:function initialize(t){AltText._l10nPromise||(AltText._l10nPromise=t)}}]);var t;return AltText}();pt=Pr;function _setState2(){return _setState3.apply(this,arguments)}function _setState3(){return(_setState3=alt_text_asyncToGenerator(alt_text_regeneratorRuntime().mark((function _callee2(){var t,r,a,i,o,l=this;return alt_text_regeneratorRuntime().wrap((function _callee2$(c){for(;;)switch(c.prev=c.next){case 0:if(t=alt_text_classPrivateFieldGet(this,_r)){c.next=3;break}return c.abrupt("return");case 3:if(alt_text_classPrivateFieldGet(this,pr)||alt_text_classPrivateFieldGet(this,vr)){c.next=7;break}t.classList.remove("done");null===(r=alt_text_classPrivateFieldGet(this,yr))||void 0===r||r.remove();return c.abrupt("return");case 7:t.classList.add("done");pt._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then((function(r){t.setAttribute("aria-label",r)}));if(!(a=alt_text_classPrivateFieldGet(this,yr))){alt_text_classPrivateFieldSet(this,yr,a=document.createElement("span"));a.className="tooltip";a.setAttribute("role","tooltip");i=a.id="alt-text-tooltip-".concat(alt_text_classPrivateFieldGet(this,br).id);t.setAttribute("aria-describedby",i);100;t.addEventListener("mouseenter",(function(){alt_text_classPrivateFieldSet(l,gr,setTimeout((function(){alt_text_classPrivateFieldSet(l,gr,null);alt_text_classPrivateFieldGet(l,yr).classList.add("show");alt_text_classPrivateFieldGet(l,br)._uiManager._eventBus.dispatch("reporttelemetry",{source:l,details:{type:"editing",subtype:alt_text_classPrivateFieldGet(l,br).editorType,data:{action:"alt_text_tooltip"}}})}),100))}));t.addEventListener("mouseleave",(function(){var t;if(alt_text_classPrivateFieldGet(l,gr)){clearTimeout(alt_text_classPrivateFieldGet(l,gr));alt_text_classPrivateFieldSet(l,gr,null)}null===(t=alt_text_classPrivateFieldGet(l,yr))||void 0===t||t.classList.remove("show")}))}if(!alt_text_classPrivateFieldGet(this,vr)){c.next=17;break}c.next=14;return pt._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip");case 14:c.t0=c.sent;c.next=18;break;case 17:c.t0=alt_text_classPrivateFieldGet(this,pr);case 18:a.innerText=c.t0;a.parentNode||t.append(a);null==(o=alt_text_classPrivateFieldGet(this,br).getImageForAltText())||o.setAttribute("aria-describedby",a.id);case 22:case"end":return c.stop()}}),_callee2,this)})))).apply(this,arguments)}!function alt_text_defineProperty(t,r,a){(r=alt_text_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}(Pr,"_l10nPromise",null);function toolbar_typeof(t){return toolbar_typeof="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},toolbar_typeof(t)}function toolbar_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,toolbar_toPropertyKey(i.key),i)}}function toolbar_toPropertyKey(t){var r=function toolbar_toPrimitive(t,r){if("object"!=toolbar_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=toolbar_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==toolbar_typeof(r)?r:String(r)}function toolbar_classPrivateMethodInitSpec(t,r){toolbar_checkPrivateRedeclaration(t,r);r.add(t)}function toolbar_classPrivateFieldInitSpec(t,r,a){toolbar_checkPrivateRedeclaration(t,r);r.set(t,a)}function toolbar_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function toolbar_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function toolbar_classPrivateFieldGet(t,r){return function toolbar_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,toolbar_classExtractFieldDescriptor(t,r,"get"))}function toolbar_classStaticPrivateMethodGet(t,r,a){!function toolbar_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function toolbar_classPrivateFieldSet(t,r,a){!function toolbar_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,toolbar_classExtractFieldDescriptor(t,r,"set"),a);return a}function toolbar_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var kr,Sr=new WeakMap,Fr=new WeakMap,Ar=new WeakMap,xr=new WeakMap,Er=new WeakSet,Ir=new WeakSet,Tr=new WeakSet,Cr=new WeakSet,Mr=new WeakMap,Gr=function(){function EditorToolbar(t){!function toolbar_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,EditorToolbar);toolbar_classPrivateFieldInitSpec(this,Mr,{get:_get_divider,set:void 0});toolbar_classPrivateMethodInitSpec(this,Cr);toolbar_classPrivateMethodInitSpec(this,Tr);toolbar_classPrivateMethodInitSpec(this,Ir);toolbar_classPrivateMethodInitSpec(this,Er);toolbar_classPrivateFieldInitSpec(this,Sr,{writable:!0,value:null});toolbar_classPrivateFieldInitSpec(this,Fr,{writable:!0,value:null});toolbar_classPrivateFieldInitSpec(this,Ar,{writable:!0,value:void 0});toolbar_classPrivateFieldInitSpec(this,xr,{writable:!0,value:null});toolbar_classPrivateFieldSet(this,Ar,t)}!function toolbar_createClass(t,r,a){r&&toolbar_defineProperties(t.prototype,r);a&&toolbar_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(EditorToolbar,[{key:"render",value:function render(){var t=toolbar_classPrivateFieldSet(this,Sr,document.createElement("div"));t.className="editToolbar";t.addEventListener("contextmenu",noContextMenu);t.addEventListener("pointerdown",toolbar_classStaticPrivateMethodGet(EditorToolbar,EditorToolbar,_pointerDown));var r=toolbar_classPrivateFieldSet(this,xr,document.createElement("div"));r.className="buttons";t.append(r);var a=toolbar_classPrivateFieldGet(this,Ar).toolbarPosition;if(a){var i=t.style,o="ltr"===toolbar_classPrivateFieldGet(this,Ar)._uiManager.direction?1-a[0]:a[0];i.insetInlineEnd="".concat(100*o,"%");i.top="calc(".concat(100*a[1],"% + var(--editor-toolbar-vert-offset))")}toolbar_classPrivateMethodGet(this,Cr,_addDeleteButton2).call(this);return t}},{key:"hide",value:function hide(){var t;toolbar_classPrivateFieldGet(this,Sr).classList.add("hidden");null===(t=toolbar_classPrivateFieldGet(this,Fr))||void 0===t||t.hideDropdown()}},{key:"show",value:function show(){toolbar_classPrivateFieldGet(this,Sr).classList.remove("hidden")}},{key:"addAltTextButton",value:function addAltTextButton(t){toolbar_classPrivateMethodGet(this,Tr,_addListenersToElement2).call(this,t);toolbar_classPrivateFieldGet(this,xr).prepend(t,toolbar_classPrivateFieldGet(this,Mr))}},{key:"addColorPicker",value:function addColorPicker(t){toolbar_classPrivateFieldSet(this,Fr,t);var r=t.renderButton();toolbar_classPrivateMethodGet(this,Tr,_addListenersToElement2).call(this,r);toolbar_classPrivateFieldGet(this,xr).prepend(r,toolbar_classPrivateFieldGet(this,Mr))}},{key:"remove",value:function remove(){var t;toolbar_classPrivateFieldGet(this,Sr).remove();null===(t=toolbar_classPrivateFieldGet(this,Fr))||void 0===t||t.destroy();toolbar_classPrivateFieldSet(this,Fr,null)}}]);return EditorToolbar}();function _pointerDown(t){t.stopPropagation()}function _focusIn2(t){toolbar_classPrivateFieldGet(this,Ar)._focusEventsAllowed=!1;t.preventDefault();t.stopPropagation()}function _focusOut2(t){toolbar_classPrivateFieldGet(this,Ar)._focusEventsAllowed=!0;t.preventDefault();t.stopPropagation()}function _addListenersToElement2(t){t.addEventListener("focusin",toolbar_classPrivateMethodGet(this,Er,_focusIn2).bind(this),{capture:!0});t.addEventListener("focusout",toolbar_classPrivateMethodGet(this,Ir,_focusOut2).bind(this),{capture:!0});t.addEventListener("contextmenu",noContextMenu)}function _addDeleteButton2(){var t=this,r=document.createElement("button");r.className="delete";r.tabIndex=0;r.setAttribute("data-l10n-id","pdfjs-editor-remove-".concat(toolbar_classPrivateFieldGet(this,Ar).editorType,"-button"));toolbar_classPrivateMethodGet(this,Tr,_addListenersToElement2).call(this,r);r.addEventListener("click",(function(r){toolbar_classPrivateFieldGet(t,Ar)._uiManager.delete()}));toolbar_classPrivateFieldGet(this,xr).append(r)}function _get_divider(){var t=document.createElement("div");t.className="divider";return t}function editor_typeof(t){return editor_typeof="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},editor_typeof(t)}function editor_toConsumableArray(t){return function editor_arrayWithoutHoles(t){if(Array.isArray(t))return editor_arrayLikeToArray(t)}(t)||function editor_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||editor_unsupportedIterableToArray(t)||function editor_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function editor_callSuper(t,r,a){return r=editor_getPrototypeOf(r),function editor_possibleConstructorReturn(t,r){if(r&&("object"===editor_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function editor_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,editor_isNativeReflectConstruct()?Reflect.construct(r,a||[],editor_getPrototypeOf(t).constructor):r.apply(t,a))}function editor_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(editor_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function editor_getPrototypeOf(t){editor_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return editor_getPrototypeOf(t)}function editor_setPrototypeOf(t,r){editor_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return editor_setPrototypeOf(t,r)}function editor_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=editor_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function editor_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */editor_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==editor_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(editor_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function editor_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function editor_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){editor_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){editor_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function editor_slicedToArray(t,r){return function editor_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function editor_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||editor_unsupportedIterableToArray(t,r)||function editor_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function editor_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return editor_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?editor_arrayLikeToArray(t,r):void 0}}function editor_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function editor_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function editor_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,editor_toPropertyKey(i.key),i)}}function editor_createClass(t,r,a){r&&editor_defineProperties(t.prototype,r);a&&editor_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function editor_classPrivateMethodInitSpec(t,r){editor_checkPrivateRedeclaration(t,r);r.add(t)}function editor_defineProperty(t,r,a){(r=editor_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function editor_toPropertyKey(t){var r=function editor_toPrimitive(t,r){if("object"!=editor_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=editor_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==editor_typeof(r)?r:String(r)}function editor_classPrivateFieldInitSpec(t,r,a){editor_checkPrivateRedeclaration(t,r);r.set(t,a)}function editor_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function editor_classStaticPrivateMethodGet(t,r,a){!function editor_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function editor_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function editor_classPrivateFieldSet(t,r,a){!function editor_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,editor_classExtractFieldDescriptor(t,r,"set"),a);return a}function editor_classPrivateFieldGet(t,r){return function editor_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,editor_classExtractFieldDescriptor(t,r,"get"))}function editor_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var Or=new WeakMap,Rr=new WeakMap,Lr=new WeakMap,Dr=new WeakMap,jr=new WeakMap,Nr=new WeakMap,Wr=new WeakMap,Hr=new WeakMap,Br=new WeakMap,zr=new WeakMap,Ur=new WeakMap,qr=new WeakMap,Vr=new WeakMap,Kr=new WeakMap,Yr=new WeakMap,Xr=new WeakMap,$r=new WeakMap,Jr=new WeakMap,Qr=new WeakSet,Zr=new WeakSet,en=new WeakSet,tn=new WeakSet,rn=new WeakSet,nn=new WeakSet,an=new WeakSet,sn=new WeakSet,ln=new WeakSet,cn=new WeakSet,un=new WeakSet,hn=new WeakSet,dn=new WeakSet,fn=function(){function AnnotationEditor(t){editor_classCallCheck(this,AnnotationEditor);editor_classPrivateMethodInitSpec(this,dn);editor_classPrivateMethodInitSpec(this,hn);editor_classPrivateMethodInitSpec(this,un);editor_classPrivateMethodInitSpec(this,cn);editor_classPrivateMethodInitSpec(this,ln);editor_classPrivateMethodInitSpec(this,sn);editor_classPrivateMethodInitSpec(this,an);editor_classPrivateMethodInitSpec(this,nn);editor_classPrivateMethodInitSpec(this,rn);editor_classPrivateMethodInitSpec(this,tn);editor_classPrivateMethodInitSpec(this,en);editor_classPrivateMethodInitSpec(this,Zr);editor_classPrivateMethodInitSpec(this,Qr);editor_classPrivateFieldInitSpec(this,Or,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,Rr,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,Lr,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,Dr,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,jr,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,Nr,{writable:!0,value:this.focusin.bind(this)});editor_classPrivateFieldInitSpec(this,Wr,{writable:!0,value:this.focusout.bind(this)});editor_classPrivateFieldInitSpec(this,Hr,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,Br,{writable:!0,value:""});editor_classPrivateFieldInitSpec(this,zr,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,Ur,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,qr,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,Vr,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,Kr,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,Yr,{writable:!0,value:0});editor_classPrivateFieldInitSpec(this,Xr,{writable:!0,value:0});editor_defineProperty(this,"_initialOptions",Object.create(null));editor_defineProperty(this,"_uiManager",null);editor_defineProperty(this,"_focusEventsAllowed",!0);editor_defineProperty(this,"_l10nPromise",null);editor_classPrivateFieldInitSpec(this,$r,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,Jr,{writable:!0,value:AnnotationEditor._zIndex++});editor_defineProperty(this,"doNotMove",!1);this.constructor===AnnotationEditor&&unreachable("Cannot initialize AnnotationEditor.");this.parent=t.parent;this.id=t.id;this.width=this.height=null;this.pageIndex=t.parent.pageIndex;this.name=t.name;this.div=null;this._uiManager=t.uiManager;this.annotationElementId=null;this._willKeepAspectRatio=!1;this._initialOptions.isCentered=t.isCentered;this._structTreeParentId=null;var r=this.parent.viewport,a=r.rotation,i=r.rawDims,o=i.pageWidth,l=i.pageHeight,c=i.pageX,u=i.pageY;this.rotation=a;this.pageRotation=(360+a-this._uiManager.viewParameters.rotation)%360;this.pageDimensions=[o,l];this.pageTranslation=[c,u];var h=editor_slicedToArray(this.parentDimensions,2),d=h[0],p=h[1];this.x=t.x/d;this.y=t.y/p;this.isAttachedToDOM=!1;this.deleted=!1}editor_createClass(AnnotationEditor,[{key:"editorType",get:function get(){return Object.getPrototypeOf(this).constructor._type}},{key:"propertiesToUpdate",get:function get(){return[]}},{key:"_isDraggable",get:function get(){return editor_classPrivateFieldGet(this,$r)},set:function set(t){var r;editor_classPrivateFieldSet(this,$r,t);null===(r=this.div)||void 0===r||r.classList.toggle("draggable",t)}},{key:"isEnterHandled",get:function get(){return!0}},{key:"center",value:function center(){var t=editor_slicedToArray(this.pageDimensions,2),r=t[0],a=t[1];switch(this.parentRotation){case 90:this.x-=this.height*a/(2*r);this.y+=this.width*r/(2*a);break;case 180:this.x+=this.width/2;this.y+=this.height/2;break;case 270:this.x+=this.height*a/(2*r);this.y-=this.width*r/(2*a);break;default:this.x-=this.width/2;this.y-=this.height/2}this.fixAndSetPosition()}},{key:"addCommands",value:function addCommands(t){this._uiManager.addCommands(t)}},{key:"currentLayer",get:function get(){return this._uiManager.currentLayer}},{key:"setInBackground",value:function setInBackground(){this.div.style.zIndex=0}},{key:"setInForeground",value:function setInForeground(){this.div.style.zIndex=editor_classPrivateFieldGet(this,Jr)}},{key:"setParent",value:function setParent(t){if(null!==t){this.pageIndex=t.pageIndex;this.pageDimensions=t.pageDimensions}else editor_classPrivateMethodGet(this,dn,_stopResizing2).call(this);this.parent=t}},{key:"focusin",value:function focusin(t){this._focusEventsAllowed&&(editor_classPrivateFieldGet(this,zr)?editor_classPrivateFieldSet(this,zr,!1):this.parent.setSelected(this))}},{key:"focusout",value:function focusout(t){var r;if(this._focusEventsAllowed&&this.isAttachedToDOM){var a=t.relatedTarget;if(null==a||!a.closest("#".concat(this.id))){t.preventDefault();null!==(r=this.parent)&&void 0!==r&&r.isMultipleSelection||this.commitOrRemove()}}}},{key:"commitOrRemove",value:function commitOrRemove(){this.isEmpty()?this.remove():this.commit()}},{key:"commit",value:function commit(){this.addToAnnotationStorage()}},{key:"addToAnnotationStorage",value:function addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}},{key:"setAt",value:function setAt(t,r,a,i){var o=editor_slicedToArray(this.parentDimensions,2),l=o[0],c=o[1],u=editor_slicedToArray(this.screenToPageTranslation(a,i),2);a=u[0];i=u[1];if(this.doNotMove){a=0;i=0}this.x=(t+a)/l;this.y=(r+i)/c;this.fixAndSetPosition()}},{key:"translate",value:function translate(t,r){editor_classPrivateMethodGet(this,Qr,_translate2).call(this,this.parentDimensions,t,r)}},{key:"translateInPage",value:function translateInPage(t,r){editor_classPrivateMethodGet(this,Qr,_translate2).call(this,this.pageDimensions,t,r);this.div.scrollIntoView({block:"nearest"})}},{key:"drag",value:function drag(t,r){var a=editor_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1];this.x+=t/i;this.y+=r/o;if(this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){var l=this.div.getBoundingClientRect(),c=l.x,u=l.y;if(this.parent.findNewParent(this,c,u)){this.x-=Math.floor(this.x);this.y-=Math.floor(this.y)}}var h=this.x,d=this.y,p=editor_slicedToArray(this.getBaseTranslation(),2);h+=p[0];d+=p[1];this.div.style.left="".concat((100*h).toFixed(2),"%");this.div.style.top="".concat((100*d).toFixed(2),"%");this.div.scrollIntoView({block:"nearest"})}},{key:"getBaseTranslation",value:function getBaseTranslation(){var t=editor_slicedToArray(this.parentDimensions,2),r=t[0],a=t[1],i=AnnotationEditor._borderLineWidth,o=i/r,l=i/a;switch(this.rotation){case 90:return[-o,l];case 180:return[o,l];case 270:return[o,-l];default:return[-o,-l]}}},{key:"fixAndSetPosition",value:function fixAndSetPosition(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rotation,r=editor_slicedToArray(this.pageDimensions,2),a=r[0],i=r[1],o=this.x,l=this.y,c=this.width,u=this.height;c*=a;u*=i;o*=a;l*=i;switch(t){case 0:o=Math.max(0,Math.min(a-c,o));l=Math.max(0,Math.min(i-u,l));break;case 90:o=Math.max(0,Math.min(a-u,o));l=Math.min(i,Math.max(c,l));break;case 180:o=Math.min(a,Math.max(c,o));l=Math.min(i,Math.max(u,l));break;case 270:o=Math.min(a,Math.max(u,o));l=Math.max(0,Math.min(i-c,l))}this.x=o/=a;this.y=l/=i;var h=editor_slicedToArray(this.getBaseTranslation(),2);o+=h[0];l+=h[1];var d=this.div.style;d.left="".concat((100*o).toFixed(2),"%");d.top="".concat((100*l).toFixed(2),"%");this.moveInDOM()}},{key:"screenToPageTranslation",value:function screenToPageTranslation(t,r){return editor_classStaticPrivateMethodGet(AnnotationEditor,AnnotationEditor,_rotatePoint).call(AnnotationEditor,t,r,this.parentRotation)}},{key:"pageTranslationToScreen",value:function pageTranslationToScreen(t,r){return editor_classStaticPrivateMethodGet(AnnotationEditor,AnnotationEditor,_rotatePoint).call(AnnotationEditor,t,r,360-this.parentRotation)}},{key:"parentScale",get:function get(){return this._uiManager.viewParameters.realScale}},{key:"parentRotation",get:function get(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}},{key:"parentDimensions",get:function get(){var t=this.parentScale,r=editor_slicedToArray(this.pageDimensions,2),a=r[0]*t,i=r[1]*t;return he.isCSSRoundSupported?[Math.round(a),Math.round(i)]:[a,i]}},{key:"setDims",value:function setDims(t,r){var a=editor_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1];this.div.style.width="".concat((100*t/i).toFixed(2),"%");editor_classPrivateFieldGet(this,Lr)||(this.div.style.height="".concat((100*r/o).toFixed(2),"%"))}},{key:"fixDims",value:function fixDims(){var t=this.div.style,r=t.height,a=t.width,i=a.endsWith("%"),o=!editor_classPrivateFieldGet(this,Lr)&&r.endsWith("%");if(!i||!o){var l=editor_slicedToArray(this.parentDimensions,2),c=l[0],u=l[1];i||(t.width="".concat((100*parseFloat(a)/c).toFixed(2),"%"));editor_classPrivateFieldGet(this,Lr)||o||(t.height="".concat((100*parseFloat(r)/u).toFixed(2),"%"))}}},{key:"getInitialTranslation",value:function getInitialTranslation(){return[0,0]}},{key:"altTextFinish",value:function altTextFinish(){var t;null===(t=editor_classPrivateFieldGet(this,Rr))||void 0===t||t.finish()}},{key:"addEditToolbar",value:(r=editor_asyncToGenerator(editor_regeneratorRuntime().mark((function _callee(){return editor_regeneratorRuntime().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(!editor_classPrivateFieldGet(this,Hr)&&!editor_classPrivateFieldGet(this,qr)){t.next=2;break}return t.abrupt("return",editor_classPrivateFieldGet(this,Hr));case 2:editor_classPrivateFieldSet(this,Hr,new Gr(this));this.div.append(editor_classPrivateFieldGet(this,Hr).render());if(!editor_classPrivateFieldGet(this,Rr)){t.next=10;break}t.t0=editor_classPrivateFieldGet(this,Hr);t.next=8;return editor_classPrivateFieldGet(this,Rr).render();case 8:t.t1=t.sent;t.t0.addAltTextButton.call(t.t0,t.t1);case 10:return t.abrupt("return",editor_classPrivateFieldGet(this,Hr));case 11:case"end":return t.stop()}}),_callee,this)}))),function addEditToolbar(){return r.apply(this,arguments)})},{key:"removeEditToolbar",value:function removeEditToolbar(){var t;if(editor_classPrivateFieldGet(this,Hr)){editor_classPrivateFieldGet(this,Hr).remove();editor_classPrivateFieldSet(this,Hr,null);null===(t=editor_classPrivateFieldGet(this,Rr))||void 0===t||t.destroy()}}},{key:"getClientDimensions",value:function getClientDimensions(){return this.div.getBoundingClientRect()}},{key:"addAltTextButton",value:(t=editor_asyncToGenerator(editor_regeneratorRuntime().mark((function _callee2(){return editor_regeneratorRuntime().wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:if(!editor_classPrivateFieldGet(this,Rr)){t.next=2;break}return t.abrupt("return");case 2:Pr.initialize(AnnotationEditor._l10nPromise);editor_classPrivateFieldSet(this,Rr,new Pr(this));t.next=6;return this.addEditToolbar();case 6:case"end":return t.stop()}}),_callee2,this)}))),function addAltTextButton(){return t.apply(this,arguments)})},{key:"altTextData",get:function get(){var t;return null===(t=editor_classPrivateFieldGet(this,Rr))||void 0===t?void 0:t.data},set:function set(t){editor_classPrivateFieldGet(this,Rr)&&(editor_classPrivateFieldGet(this,Rr).data=t)}},{key:"render",value:function render(){this.div=document.createElement("div");this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360);this.div.className=this.name;this.div.setAttribute("id",this.id);this.div.setAttribute("tabIndex",0);this.setInForeground();this.div.addEventListener("focusin",editor_classPrivateFieldGet(this,Nr));this.div.addEventListener("focusout",editor_classPrivateFieldGet(this,Wr));var t=editor_slicedToArray(this.parentDimensions,2),r=t[0],a=t[1];if(this.parentRotation%180!=0){this.div.style.maxWidth="".concat((100*a/r).toFixed(2),"%");this.div.style.maxHeight="".concat((100*r/a).toFixed(2),"%")}var i=editor_slicedToArray(this.getInitialTranslation(),2),o=i[0],l=i[1];this.translate(o,l);bindEvents(this,this.div,["pointerdown"]);return this.div}},{key:"pointerdown",value:function pointerdown(t){var r=he.platform.isMac;if(0!==t.button||t.ctrlKey&&r)t.preventDefault();else{editor_classPrivateFieldSet(this,zr,!0);this._isDraggable?editor_classPrivateMethodGet(this,sn,_setUpDragSession2).call(this,t):editor_classPrivateMethodGet(this,an,_selectOnPointerEvent2).call(this,t)}}},{key:"moveInDOM",value:function moveInDOM(){var t=this;editor_classPrivateFieldGet(this,Kr)&&clearTimeout(editor_classPrivateFieldGet(this,Kr));editor_classPrivateFieldSet(this,Kr,setTimeout((function(){var r;editor_classPrivateFieldSet(t,Kr,null);null===(r=t.parent)||void 0===r||r.moveEditorInDOM(t)}),0))}},{key:"_setParentAndPosition",value:function _setParentAndPosition(t,r,a){t.changeParent(this);this.x=r;this.y=a;this.fixAndSetPosition()}},{key:"getRect",value:function getRect(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rotation,i=this.parentScale,o=editor_slicedToArray(this.pageDimensions,2),l=o[0],c=o[1],u=editor_slicedToArray(this.pageTranslation,2),h=u[0],d=u[1],p=t/i,v=r/i,_=this.x*l,y=this.y*c,g=this.width*l,m=this.height*c;switch(a){case 0:return[_+p+h,c-y-v-m+d,_+p+g+h,c-y-v+d];case 90:return[_+v+h,c-y+p+d,_+v+m+h,c-y+p+g+d];case 180:return[_-p-g+h,c-y+v+d,_-p+h,c-y+v+m+d];case 270:return[_-v-m+h,c-y-p-g+d,_-v+h,c-y-p+d];default:throw new Error("Invalid rotation")}}},{key:"getRectInCurrentCoords",value:function getRectInCurrentCoords(t,r){var a=editor_slicedToArray(t,4),i=a[0],o=a[1],l=a[2],c=a[3],u=l-i,h=c-o;switch(this.rotation){case 0:return[i,r-c,u,h];case 90:return[i,r-o,h,u];case 180:return[l,r-o,u,h];case 270:return[l,r-c,h,u];default:throw new Error("Invalid rotation")}}},{key:"onceAdded",value:function onceAdded(){}},{key:"isEmpty",value:function isEmpty(){return!1}},{key:"enableEditMode",value:function enableEditMode(){editor_classPrivateFieldSet(this,qr,!0)}},{key:"disableEditMode",value:function disableEditMode(){editor_classPrivateFieldSet(this,qr,!1)}},{key:"isInEditMode",value:function isInEditMode(){return editor_classPrivateFieldGet(this,qr)}},{key:"shouldGetKeyboardEvents",value:function shouldGetKeyboardEvents(){return editor_classPrivateFieldGet(this,Vr)}},{key:"needsToBeRebuilt",value:function needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}},{key:"rebuild",value:function rebuild(){var t,r;null===(t=this.div)||void 0===t||t.addEventListener("focusin",editor_classPrivateFieldGet(this,Nr));null===(r=this.div)||void 0===r||r.addEventListener("focusout",editor_classPrivateFieldGet(this,Wr))}},{key:"rotate",value:function rotate(t){}},{key:"serialize",value:function serialize(){unreachable("An editor must be serializable")}},{key:"remove",value:function remove(){this.div.removeEventListener("focusin",editor_classPrivateFieldGet(this,Nr));this.div.removeEventListener("focusout",editor_classPrivateFieldGet(this,Wr));this.isEmpty()||this.commit();this.parent?this.parent.remove(this):this._uiManager.removeEditor(this);if(editor_classPrivateFieldGet(this,Kr)){clearTimeout(editor_classPrivateFieldGet(this,Kr));editor_classPrivateFieldSet(this,Kr,null)}editor_classPrivateMethodGet(this,dn,_stopResizing2).call(this);this.removeEditToolbar()}},{key:"isResizable",get:function get(){return!1}},{key:"makeResizable",value:function makeResizable(){if(this.isResizable){editor_classPrivateMethodGet(this,en,_createResizers2).call(this);editor_classPrivateFieldGet(this,Dr).classList.remove("hidden");bindEvents(this,this.div,["keydown"])}}},{key:"toolbarPosition",get:function get(){return null}},{key:"keydown",value:function keydown(t){var r=this;if(this.isResizable&&t.target===this.div&&"Enter"===t.key){this._uiManager.setSelected(this);editor_classPrivateFieldSet(this,jr,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});var a=editor_classPrivateFieldGet(this,Dr).children;if(!editor_classPrivateFieldGet(this,Or)){editor_classPrivateFieldSet(this,Or,Array.from(a));var i,o=editor_classPrivateMethodGet(this,ln,_resizerKeydown2).bind(this),l=editor_classPrivateMethodGet(this,cn,_resizerBlur2).bind(this),c=editor_createForOfIteratorHelper(editor_classPrivateFieldGet(this,Or));try{var u=function _loop(){var t=i.value,a=t.getAttribute("data-resizer-name");t.setAttribute("role","spinbutton");t.addEventListener("keydown",o);t.addEventListener("blur",l);t.addEventListener("focus",editor_classPrivateMethodGet(r,un,_resizerFocus2).bind(r,a));AnnotationEditor._l10nPromise.get("pdfjs-editor-resizer-label-".concat(a)).then((function(r){return t.setAttribute("aria-label",r)}))};for(c.s();!(i=c.n()).done;)u()}catch(t){c.e(t)}finally{c.f()}}var h,d=editor_classPrivateFieldGet(this,Or)[0],p=0,v=editor_createForOfIteratorHelper(a);try{for(v.s();!(h=v.n()).done;){if(h.value===d)break;p++}}catch(t){v.e(t)}finally{v.f()}var _=(360-this.rotation+this.parentRotation)%360/90*(editor_classPrivateFieldGet(this,Or).length/4);if(_!==p){if(_<p)for(var y=0;y<p-_;y++)editor_classPrivateFieldGet(this,Dr).append(editor_classPrivateFieldGet(this,Dr).firstChild);else if(_>p)for(var g=0;g<_-p;g++)editor_classPrivateFieldGet(this,Dr).firstChild.before(editor_classPrivateFieldGet(this,Dr).lastChild);var m,b=0,w=editor_createForOfIteratorHelper(a);try{var P=function _loop2(){var t=m.value,a=editor_classPrivateFieldGet(r,Or)[b++].getAttribute("data-resizer-name");AnnotationEditor._l10nPromise.get("pdfjs-editor-resizer-label-".concat(a)).then((function(r){return t.setAttribute("aria-label",r)}))};for(w.s();!(m=w.n()).done;)P()}catch(t){w.e(t)}finally{w.f()}}editor_classPrivateMethodGet(this,hn,_setResizerTabIndex2).call(this,0);editor_classPrivateFieldSet(this,Vr,!0);editor_classPrivateFieldGet(this,Dr).firstChild.focus({focusVisible:!0});t.preventDefault();t.stopImmediatePropagation()}}},{key:"_resizeWithKeyboard",value:function _resizeWithKeyboard(t,r){editor_classPrivateFieldGet(this,Vr)&&editor_classPrivateMethodGet(this,nn,_resizerPointermove2).call(this,editor_classPrivateFieldGet(this,Br),{movementX:t,movementY:r})}},{key:"_stopResizingWithKeyboard",value:function _stopResizingWithKeyboard(){editor_classPrivateMethodGet(this,dn,_stopResizing2).call(this);this.div.focus()}},{key:"select",value:function select(){var t,r,a=this;this.makeResizable();null===(t=this.div)||void 0===t||t.classList.add("selectedEditor");editor_classPrivateFieldGet(this,Hr)?null===(r=editor_classPrivateFieldGet(this,Hr))||void 0===r||r.show():this.addEditToolbar().then((function(){var t;if(null!==(t=a.div)&&void 0!==t&&t.classList.contains("selectedEditor")){var r;null===(r=editor_classPrivateFieldGet(a,Hr))||void 0===r||r.show()}}))}},{key:"unselect",value:function unselect(){var t,r,a,i;null===(t=editor_classPrivateFieldGet(this,Dr))||void 0===t||t.classList.add("hidden");null===(r=this.div)||void 0===r||r.classList.remove("selectedEditor");null!==(a=this.div)&&void 0!==a&&a.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus();null===(i=editor_classPrivateFieldGet(this,Hr))||void 0===i||i.hide()}},{key:"updateParams",value:function updateParams(t,r){}},{key:"disableEditing",value:function disableEditing(){}},{key:"enableEditing",value:function enableEditing(){}},{key:"enterInEditMode",value:function enterInEditMode(){}},{key:"getImageForAltText",value:function getImageForAltText(){return null}},{key:"contentDiv",get:function get(){return this.div}},{key:"isEditing",get:function get(){return editor_classPrivateFieldGet(this,Ur)},set:function set(t){editor_classPrivateFieldSet(this,Ur,t);if(this.parent)if(t){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}},{key:"setAspectRatio",value:function setAspectRatio(t,r){editor_classPrivateFieldSet(this,Lr,!0);var a=t/r,i=this.div.style;i.aspectRatio=a;i.height="auto"}}],[{key:"_resizerKeyboardManager",get:function get(){var t=AnnotationEditor.prototype._resizeWithKeyboard,r=fr.TRANSLATE_SMALL,a=fr.TRANSLATE_BIG;return shadow(this,"_resizerKeyboardManager",new dt([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-r,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-a,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[r,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[a,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-r]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-a]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,r]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,a]}],[["Escape","mac+Escape"],AnnotationEditor.prototype._stopResizingWithKeyboard]]))}},{key:"_defaultLineColor",get:function get(){return shadow(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}},{key:"deleteAnnotationElement",value:function deleteAnnotationElement(t){var r=new pn({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});r.annotationElementId=t.annotationElementId;r.deleted=!0;r._uiManager.addToAnnotationStorage(r)}},{key:"initialize",value:function initialize(t,r,a){AnnotationEditor._l10nPromise||(AnnotationEditor._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((function(r){return[r,t.get(r.replaceAll(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())})))]}))));if(null!=a&&a.strings){var i,o=editor_createForOfIteratorHelper(a.strings);try{for(o.s();!(i=o.n()).done;){var l=i.value;AnnotationEditor._l10nPromise.set(l,t.get(l))}}catch(t){o.e(t)}finally{o.f()}}if(-1===AnnotationEditor._borderLineWidth){var c=getComputedStyle(document.documentElement);AnnotationEditor._borderLineWidth=parseFloat(c.getPropertyValue("--outline-width"))||0}}},{key:"updateDefaultParams",value:function updateDefaultParams(t,r){}},{key:"defaultPropertiesToUpdate",get:function get(){return[]}},{key:"isHandlingMimeForPasting",value:function isHandlingMimeForPasting(t){return!1}},{key:"paste",value:function paste(t,r){unreachable("Not implemented")}},{key:"deserialize",value:function deserialize(t,r,a){var i=new this.prototype.constructor({parent:r,id:r.getNextId(),uiManager:a});i.rotation=t.rotation;var o=editor_slicedToArray(i.pageDimensions,2),l=o[0],c=o[1],u=editor_slicedToArray(i.getRectInCurrentCoords(t.rect,c),4),h=u[0],d=u[1],p=u[2],v=u[3];i.x=h/l;i.y=d/c;i.width=p/l;i.height=v/c;return i}},{key:"MIN_SIZE",get:function get(){return 16}},{key:"canCreateNewEmptyEditor",value:function canCreateNewEmptyEditor(){return!0}}]);var t,r;return AnnotationEditor}();kr=fn;function _translate2(t,r,a){var i=editor_slicedToArray(t,2),o=i[0],l=i[1],c=editor_slicedToArray(this.screenToPageTranslation(r,a),2);r=c[0];a=c[1];this.x+=r/o;this.y+=a/l;this.fixAndSetPosition()}function _rotatePoint(t,r,a){switch(a){case 90:return[r,-t];case 180:return[-t,-r];case 270:return[-r,t];default:return[t,r]}}function _getRotationMatrix2(t){switch(t){case 90:var r=editor_slicedToArray(this.pageDimensions,2),a=r[0],i=r[1];return[0,-a/i,i/a,0];case 180:return[-1,0,0,-1];case 270:var o=editor_slicedToArray(this.pageDimensions,2),l=o[0],c=o[1];return[0,l/c,-c/l,0];default:return[1,0,0,1]}}function _createResizers2(){if(!editor_classPrivateFieldGet(this,Dr)){editor_classPrivateFieldSet(this,Dr,document.createElement("div"));editor_classPrivateFieldGet(this,Dr).classList.add("resizers");for(var t=0,r=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"];t<r.length;t++){var a=r[t],i=document.createElement("div");editor_classPrivateFieldGet(this,Dr).append(i);i.classList.add("resizer",a);i.setAttribute("data-resizer-name",a);i.addEventListener("pointerdown",editor_classPrivateMethodGet(this,tn,_resizerPointerdown2).bind(this,a));i.addEventListener("contextmenu",noContextMenu);i.tabIndex=-1}this.div.prepend(editor_classPrivateFieldGet(this,Dr))}}function _resizerPointerdown2(t,r){var a,i=this;r.preventDefault();var o=he.platform.isMac;if(!(0!==r.button||r.ctrlKey&&o)){null===(a=editor_classPrivateFieldGet(this,Rr))||void 0===a||a.toggle(!1);var l=editor_classPrivateMethodGet(this,nn,_resizerPointermove2).bind(this,t),c=this._isDraggable;this._isDraggable=!1;var u={passive:!0,capture:!0};this.parent.togglePointerEvents(!1);window.addEventListener("pointermove",l,u);var h=this.x,d=this.y,p=this.width,v=this.height,_=this.parent.div.style.cursor,y=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(r.target).cursor;var g=function pointerUpCallback(){var t;i.parent.togglePointerEvents(!0);null===(t=editor_classPrivateFieldGet(i,Rr))||void 0===t||t.toggle(!0);i._isDraggable=c;window.removeEventListener("pointerup",pointerUpCallback);window.removeEventListener("blur",pointerUpCallback);window.removeEventListener("pointermove",l,u);i.parent.div.style.cursor=_;i.div.style.cursor=y;editor_classPrivateMethodGet(i,rn,_addResizeToUndoStack2).call(i,h,d,p,v)};window.addEventListener("pointerup",g);window.addEventListener("blur",g)}}function _addResizeToUndoStack2(t,r,a,i){var o=this,l=this.x,c=this.y,u=this.width,h=this.height;l===t&&c===r&&u===a&&h===i||this.addCommands({cmd:function cmd(){o.width=u;o.height=h;o.x=l;o.y=c;var t=editor_slicedToArray(o.parentDimensions,2),r=t[0],a=t[1];o.setDims(r*u,a*h);o.fixAndSetPosition()},undo:function undo(){o.width=a;o.height=i;o.x=t;o.y=r;var l=editor_slicedToArray(o.parentDimensions,2),c=l[0],u=l[1];o.setDims(c*a,u*i);o.fixAndSetPosition()},mustExec:!0})}function _resizerPointermove2(t,r){var a,i,o=editor_slicedToArray(this.parentDimensions,2),l=o[0],c=o[1],u=this.x,h=this.y,d=this.width,p=this.height,v=kr.MIN_SIZE/l,_=kr.MIN_SIZE/c,y=function round(t){return Math.round(1e4*t)/1e4},g=editor_classPrivateMethodGet(this,Zr,_getRotationMatrix2).call(this,this.rotation),m=function transf(t,r){return[g[0]*t+g[2]*r,g[1]*t+g[3]*r]},b=editor_classPrivateMethodGet(this,Zr,_getRotationMatrix2).call(this,360-this.rotation),w=!1,P=!1;switch(t){case"topLeft":w=!0;a=function getPoint(t,r){return[0,0]};i=function getOpposite(t,r){return[t,r]};break;case"topMiddle":a=function getPoint(t,r){return[t/2,0]};i=function getOpposite(t,r){return[t/2,r]};break;case"topRight":w=!0;a=function getPoint(t,r){return[t,0]};i=function getOpposite(t,r){return[0,r]};break;case"middleRight":P=!0;a=function getPoint(t,r){return[t,r/2]};i=function getOpposite(t,r){return[0,r/2]};break;case"bottomRight":w=!0;a=function getPoint(t,r){return[t,r]};i=function getOpposite(t,r){return[0,0]};break;case"bottomMiddle":a=function getPoint(t,r){return[t/2,r]};i=function getOpposite(t,r){return[t/2,0]};break;case"bottomLeft":w=!0;a=function getPoint(t,r){return[0,r]};i=function getOpposite(t,r){return[t,0]};break;case"middleLeft":P=!0;a=function getPoint(t,r){return[0,r/2]};i=function getOpposite(t,r){return[t,r/2]}}var k=a(d,p),S=i(d,p),A=m.apply(void 0,editor_toConsumableArray(S)),x=y(u+A[0]),E=y(h+A[1]),I=1,T=1,C=editor_slicedToArray(this.screenToPageTranslation(r.movementX,r.movementY),2),M=C[0],G=C[1],O=editor_slicedToArray(function invTransf(t,r){return[b[0]*t+b[2]*r,b[1]*t+b[3]*r]}(M/l,G/c),2);M=O[0];G=O[1];if(w){var R=Math.hypot(d,p);I=T=Math.max(Math.min(Math.hypot(S[0]-k[0]-M,S[1]-k[1]-G)/R,1/d,1/p),v/d,_/p)}else P?I=Math.max(v,Math.min(1,Math.abs(S[0]-k[0]-M)))/d:T=Math.max(_,Math.min(1,Math.abs(S[1]-k[1]-G)))/p;var L=y(d*I),D=y(p*T),j=x-(A=m.apply(void 0,editor_toConsumableArray(i(L,D))))[0],N=E-A[1];this.width=L;this.height=D;this.x=j;this.y=N;this.setDims(l*L,c*D);this.fixAndSetPosition()}function _selectOnPointerEvent2(t){var r=he.platform.isMac;t.ctrlKey&&!r||t.shiftKey||t.metaKey&&r?this.parent.toggleSelected(this):this.parent.setSelected(this)}function _setUpDragSession2(t){var r,a,i=this,o=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();if(o){this.div.classList.add("moving");r={passive:!0,capture:!0};editor_classPrivateFieldSet(this,Yr,t.clientX);editor_classPrivateFieldSet(this,Xr,t.clientY);a=function pointerMoveCallback(t){var r=t.clientX,a=t.clientY,o=editor_slicedToArray(i.screenToPageTranslation(r-editor_classPrivateFieldGet(i,Yr),a-editor_classPrivateFieldGet(i,Xr)),2),l=o[0],c=o[1];editor_classPrivateFieldSet(i,Yr,r);editor_classPrivateFieldSet(i,Xr,a);i._uiManager.dragSelectedEditors(l,c)};window.addEventListener("pointermove",a,r)}var l=function pointerUpCallback(){window.removeEventListener("pointerup",pointerUpCallback);window.removeEventListener("blur",pointerUpCallback);if(o){i.div.classList.remove("moving");window.removeEventListener("pointermove",a,r)}editor_classPrivateFieldSet(i,zr,!1);i._uiManager.endDragSession()||editor_classPrivateMethodGet(i,an,_selectOnPointerEvent2).call(i,t)};window.addEventListener("pointerup",l);window.addEventListener("blur",l)}function _resizerKeydown2(t){kr._resizerKeyboardManager.exec(this,t)}function _resizerBlur2(t){var r;editor_classPrivateFieldGet(this,Vr)&&(null===(r=t.relatedTarget)||void 0===r?void 0:r.parentNode)!==editor_classPrivateFieldGet(this,Dr)&&editor_classPrivateMethodGet(this,dn,_stopResizing2).call(this)}function _resizerFocus2(t){editor_classPrivateFieldSet(this,Br,editor_classPrivateFieldGet(this,Vr)?t:"")}function _setResizerTabIndex2(t){if(editor_classPrivateFieldGet(this,Or)){var r,a=editor_createForOfIteratorHelper(editor_classPrivateFieldGet(this,Or));try{for(a.s();!(r=a.n()).done;){r.value.tabIndex=t}}catch(t){a.e(t)}finally{a.f()}}}function _stopResizing2(){editor_classPrivateFieldSet(this,Vr,!1);editor_classPrivateMethodGet(this,hn,_setResizerTabIndex2).call(this,-1);if(editor_classPrivateFieldGet(this,jr)){var t=editor_classPrivateFieldGet(this,jr),r=t.savedX,a=t.savedY,i=t.savedWidth,o=t.savedHeight;editor_classPrivateMethodGet(this,rn,_addResizeToUndoStack2).call(this,r,a,i,o);editor_classPrivateFieldSet(this,jr,null)}}editor_defineProperty(fn,"_borderLineWidth",-1);editor_defineProperty(fn,"_colorManager",new ft);editor_defineProperty(fn,"_zIndex",1);var pn=function(t){!function editor_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&editor_setPrototypeOf(t,r)}(FakeEditor,t);function FakeEditor(t){var r;editor_classCallCheck(this,FakeEditor);(r=editor_callSuper(this,FakeEditor,[t])).annotationElementId=t.annotationElementId;r.deleted=!0;return r}editor_createClass(FakeEditor,[{key:"serialize",value:function serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}]);return FakeEditor}(fn);function murmurhash3_typeof(t){return murmurhash3_typeof="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},murmurhash3_typeof(t)}function murmurhash3_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,murmurhash3_toPropertyKey(i.key),i)}}function murmurhash3_toPropertyKey(t){var r=function murmurhash3_toPrimitive(t,r){if("object"!=murmurhash3_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=murmurhash3_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==murmurhash3_typeof(r)?r:String(r)}var vn=3285377520,_n=4294901760,yn=65535,gn=function(){function MurmurHash3_64(t){!function murmurhash3_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,MurmurHash3_64);this.h1=t?4294967295&t:vn;this.h2=t?4294967295&t:vn}!function murmurhash3_createClass(t,r,a){r&&murmurhash3_defineProperties(t.prototype,r);a&&murmurhash3_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(MurmurHash3_64,[{key:"update",value:function update(t){var r,a;if("string"==typeof t){r=new Uint8Array(2*t.length);a=0;for(var i=0,o=t.length;i<o;i++){var l=t.charCodeAt(i);if(l<=255)r[a++]=l;else{r[a++]=l>>>8;r[a++]=255&l}}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");a=(r=t.slice()).byteLength}for(var c=a>>2,u=a-4*c,h=new Uint32Array(r.buffer,0,c),d=0,p=0,v=this.h1,_=this.h2,y=3432918353,g=461845907,m=11601,b=13715,w=0;w<c;w++)1&w?v=5*(v=(v^=d=(d=(d=(d=h[w])*y&_n|d*m&yn)<<15|d>>>17)*g&_n|d*b&yn)<<13|v>>>19)+3864292196:_=5*(_=(_^=p=(p=(p=(p=h[w])*y&_n|p*m&yn)<<15|p>>>17)*g&_n|p*b&yn)<<13|_>>>19)+3864292196;d=0;switch(u){case 3:d^=r[4*c+2]<<16;case 2:d^=r[4*c+1]<<8;case 1:d=(d=(d=(d^=r[4*c])*y&_n|d*m&yn)<<15|d>>>17)*g&_n|d*b&yn;1&c?v^=d:_^=d}this.h1=v;this.h2=_}},{key:"hexdigest",value:function hexdigest(){var t=this.h1,r=this.h2;t=3981806797*(t^=r>>>1)&_n|36045*t&yn;t=444984403*(t^=(r=4283543511*r&_n|(2950163797*(r<<16|t>>>16)&_n)>>>16)>>>1)&_n|60499*t&yn;return((t^=(r=3301882366*r&_n|(3120437893*(r<<16|t>>>16)&_n)>>>16)>>>1)>>>0).toString(16).padStart(8,"0")+(r>>>0).toString(16).padStart(8,"0")}}]);return MurmurHash3_64}();function annotation_storage_typeof(t){return annotation_storage_typeof="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},annotation_storage_typeof(t)}function annotation_storage_callSuper(t,r,a){return r=annotation_storage_getPrototypeOf(r),function annotation_storage_possibleConstructorReturn(t,r){if(r&&("object"===annotation_storage_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return annotation_storage_assertThisInitialized(t)}(t,annotation_storage_isNativeReflectConstruct()?Reflect.construct(r,a||[],annotation_storage_getPrototypeOf(t).constructor):r.apply(t,a))}function annotation_storage_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(annotation_storage_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function annotation_storage_getPrototypeOf(t){annotation_storage_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return annotation_storage_getPrototypeOf(t)}function annotation_storage_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function annotation_storage_setPrototypeOf(t,r){annotation_storage_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return annotation_storage_setPrototypeOf(t,r)}function annotation_storage_slicedToArray(t,r){return function annotation_storage_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function annotation_storage_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||annotation_storage_unsupportedIterableToArray(t,r)||function annotation_storage_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function annotation_storage_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=annotation_storage_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function annotation_storage_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return annotation_storage_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?annotation_storage_arrayLikeToArray(t,r):void 0}}function annotation_storage_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function annotation_storage_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function annotation_storage_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,annotation_storage_toPropertyKey(i.key),i)}}function annotation_storage_createClass(t,r,a){r&&annotation_storage_defineProperties(t.prototype,r);a&&annotation_storage_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function annotation_storage_toPropertyKey(t){var r=function annotation_storage_toPrimitive(t,r){if("object"!=annotation_storage_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=annotation_storage_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==annotation_storage_typeof(r)?r:String(r)}function annotation_storage_classPrivateFieldInitSpec(t,r,a){annotation_storage_checkPrivateRedeclaration(t,r);r.set(t,a)}function annotation_storage_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function annotation_storage_classPrivateFieldSet(t,r,a){!function annotation_storage_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,annotation_storage_classExtractFieldDescriptor(t,r,"set"),a);return a}function annotation_storage_classPrivateFieldGet(t,r){return function annotation_storage_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,annotation_storage_classExtractFieldDescriptor(t,r,"get"))}function annotation_storage_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var mn=Object.freeze({map:null,hash:"",transfer:void 0}),bn=new WeakMap,wn=new WeakMap,Pn=new WeakSet,kn=function(){function AnnotationStorage(){annotation_storage_classCallCheck(this,AnnotationStorage);!function annotation_storage_classPrivateMethodInitSpec(t,r){annotation_storage_checkPrivateRedeclaration(t,r);r.add(t)}(this,Pn);annotation_storage_classPrivateFieldInitSpec(this,bn,{writable:!0,value:!1});annotation_storage_classPrivateFieldInitSpec(this,wn,{writable:!0,value:new Map});this.onSetModified=null;this.onResetModified=null;this.onAnnotationEditor=null}annotation_storage_createClass(AnnotationStorage,[{key:"getValue",value:function getValue(t,r){var a=annotation_storage_classPrivateFieldGet(this,wn).get(t);return void 0===a?r:Object.assign(r,a)}},{key:"getRawValue",value:function getRawValue(t){return annotation_storage_classPrivateFieldGet(this,wn).get(t)}},{key:"remove",value:function remove(t){annotation_storage_classPrivateFieldGet(this,wn).delete(t);0===annotation_storage_classPrivateFieldGet(this,wn).size&&this.resetModified();if("function"==typeof this.onAnnotationEditor){var r,a=annotation_storage_createForOfIteratorHelper(annotation_storage_classPrivateFieldGet(this,wn).values());try{for(a.s();!(r=a.n()).done;){if(r.value instanceof fn)return}}catch(t){a.e(t)}finally{a.f()}this.onAnnotationEditor(null)}}},{key:"setValue",value:function setValue(t,r){var a=annotation_storage_classPrivateFieldGet(this,wn).get(t),i=!1;if(void 0!==a)for(var o=0,l=Object.entries(r);o<l.length;o++){var c=annotation_storage_slicedToArray(l[o],2),u=c[0],h=c[1];if(a[u]!==h){i=!0;a[u]=h}}else{i=!0;annotation_storage_classPrivateFieldGet(this,wn).set(t,r)}i&&function annotation_storage_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}(this,Pn,_setModified2).call(this);r instanceof fn&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(r.constructor._type)}},{key:"has",value:function has(t){return annotation_storage_classPrivateFieldGet(this,wn).has(t)}},{key:"getAll",value:function getAll(){return annotation_storage_classPrivateFieldGet(this,wn).size>0?objectFromMap(annotation_storage_classPrivateFieldGet(this,wn)):null}},{key:"setAll",value:function setAll(t){for(var r=0,a=Object.entries(t);r<a.length;r++){var i=annotation_storage_slicedToArray(a[r],2),o=i[0],l=i[1];this.setValue(o,l)}}},{key:"size",get:function get(){return annotation_storage_classPrivateFieldGet(this,wn).size}},{key:"resetModified",value:function resetModified(){if(annotation_storage_classPrivateFieldGet(this,bn)){annotation_storage_classPrivateFieldSet(this,bn,!1);"function"==typeof this.onResetModified&&this.onResetModified()}}},{key:"print",get:function get(){return new Fn(this)}},{key:"serializable",get:function get(){if(0===annotation_storage_classPrivateFieldGet(this,wn).size)return mn;var t,r=new Map,a=new gn,i=[],o=Object.create(null),l=!1,c=annotation_storage_createForOfIteratorHelper(annotation_storage_classPrivateFieldGet(this,wn));try{for(c.s();!(t=c.n()).done;){var u=annotation_storage_slicedToArray(t.value,2),h=u[0],d=u[1],p=d instanceof fn?d.serialize(!1,o):d;if(p){r.set(h,p);a.update("".concat(h,":").concat(JSON.stringify(p)));l||(l=!!p.bitmap)}}}catch(t){c.e(t)}finally{c.f()}if(l){var v,_=annotation_storage_createForOfIteratorHelper(r.values());try{for(_.s();!(v=_.n()).done;){var y=v.value;y.bitmap&&i.push(y.bitmap)}}catch(t){_.e(t)}finally{_.f()}}return r.size>0?{map:r,hash:a.hexdigest(),transfer:i}:mn}}]);return AnnotationStorage}();function _setModified2(){if(!annotation_storage_classPrivateFieldGet(this,bn)){annotation_storage_classPrivateFieldSet(this,bn,!0);"function"==typeof this.onSetModified&&this.onSetModified()}}var Sn=new WeakMap,Fn=function(t){!function annotation_storage_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&annotation_storage_setPrototypeOf(t,r)}(PrintAnnotationStorage,t);function PrintAnnotationStorage(t){var r;annotation_storage_classCallCheck(this,PrintAnnotationStorage);annotation_storage_classPrivateFieldInitSpec(annotation_storage_assertThisInitialized(r=annotation_storage_callSuper(this,PrintAnnotationStorage)),Sn,{writable:!0,value:void 0});var a=t.serializable,i=a.map,o=a.hash,l=a.transfer,c=structuredClone(i,l?{transfer:l}:null);annotation_storage_classPrivateFieldSet(annotation_storage_assertThisInitialized(r),Sn,{map:c,hash:o,transfer:l});return r}annotation_storage_createClass(PrintAnnotationStorage,[{key:"print",get:function get(){unreachable("Should not call PrintAnnotationStorage.print")}},{key:"serializable",get:function get(){return annotation_storage_classPrivateFieldGet(this,Sn)}}]);return PrintAnnotationStorage}(kn);function font_loader_typeof(t){return font_loader_typeof="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},font_loader_typeof(t)}function font_loader_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */font_loader_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==font_loader_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(font_loader_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function font_loader_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function font_loader_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){font_loader_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){font_loader_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function font_loader_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function font_loader_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return font_loader_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return font_loader_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function font_loader_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function font_loader_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function font_loader_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,font_loader_toPropertyKey(i.key),i)}}function font_loader_createClass(t,r,a){r&&font_loader_defineProperties(t.prototype,r);a&&font_loader_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function font_loader_toPropertyKey(t){var r=function font_loader_toPrimitive(t,r){if("object"!=font_loader_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=font_loader_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==font_loader_typeof(r)?r:String(r)}function font_loader_classPrivateFieldInitSpec(t,r,a){!function font_loader_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,r);r.set(t,a)}function font_loader_classPrivateFieldGet(t,r){var a=function font_loader_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}(t,r,"get");return function font_loader_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,a)}var An,xn=new WeakMap,En=function(){function FontLoader(t){var r=t.ownerDocument,a=void 0===r?globalThis.document:r;t.styleElement;font_loader_classCallCheck(this,FontLoader);font_loader_classPrivateFieldInitSpec(this,xn,{writable:!0,value:new Set});this._document=a;this.nativeFontFaces=new Set;this.styleElement=null;this.loadingRequests=[];this.loadTestFontId=0}font_loader_createClass(FontLoader,[{key:"addNativeFontFace",value:function addNativeFontFace(t){this.nativeFontFaces.add(t);this._document.fonts.add(t)}},{key:"removeNativeFontFace",value:function removeNativeFontFace(t){this.nativeFontFaces.delete(t);this._document.fonts.delete(t)}},{key:"insertRule",value:function insertRule(t){if(!this.styleElement){this.styleElement=this._document.createElement("style");this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement)}var r=this.styleElement.sheet;r.insertRule(t,r.cssRules.length)}},{key:"clear",value:function clear(){var t,r=font_loader_createForOfIteratorHelper(this.nativeFontFaces);try{for(r.s();!(t=r.n()).done;){var a=t.value;this._document.fonts.delete(a)}}catch(t){r.e(t)}finally{r.f()}this.nativeFontFaces.clear();font_loader_classPrivateFieldGet(this,xn).clear();if(this.styleElement){this.styleElement.remove();this.styleElement=null}}},{key:"loadSystemFont",value:(a=font_loader_asyncToGenerator(font_loader_regeneratorRuntime().mark((function _callee(t){var r,a,i,o,l,c;return font_loader_regeneratorRuntime().wrap((function _callee$(u){for(;;)switch(u.prev=u.next){case 0:r=t.systemFontInfo,a=t._inspectFont;if(r&&!font_loader_classPrivateFieldGet(this,xn).has(r.loadedName)){u.next=3;break}return u.abrupt("return");case 3:assert(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set.");if(!this.isFontLoadingAPISupported){u.next=20;break}i=r.loadedName,o=r.src,l=r.style;c=new FontFace(i,o,l);this.addNativeFontFace(c);u.prev=8;u.next=11;return c.load();case 11:font_loader_classPrivateFieldGet(this,xn).add(i);null==a||a(r);u.next=19;break;case 15:u.prev=15;u.t0=u.catch(8);warn("Cannot load system font: ".concat(r.baseFontName,", installing it could help to improve PDF rendering."));this.removeNativeFontFace(c);case 19:return u.abrupt("return");case 20:unreachable("Not implemented: loadSystemFont without the Font Loading API.");case 21:case"end":return u.stop()}}),_callee,this,[[8,15]])}))),function loadSystemFont(t){return a.apply(this,arguments)})},{key:"bind",value:(t=font_loader_asyncToGenerator(font_loader_regeneratorRuntime().mark((function _callee2(t){var r,a,i=this;return font_loader_regeneratorRuntime().wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:if(!(t.attached||t.missingFile&&!t.systemFontInfo)){o.next=2;break}return o.abrupt("return");case 2:t.attached=!0;if(!t.systemFontInfo){o.next=7;break}o.next=6;return this.loadSystemFont(t);case 6:case 21:return o.abrupt("return");case 7:if(!this.isFontLoadingAPISupported){o.next=22;break}if(!(r=t.createNativeFontFace())){o.next=21;break}this.addNativeFontFace(r);o.prev=11;o.next=14;return r.loaded;case 14:o.next=21;break;case 16:o.prev=16;o.t0=o.catch(11);warn("Failed to load font '".concat(r.family,"': '").concat(o.t0,"'."));t.disableFontFace=!0;throw o.t0;case 22:if(!(a=t.createFontFaceRule())){o.next=29;break}this.insertRule(a);if(!this.isSyncFontLoadingSupported){o.next=27;break}return o.abrupt("return");case 27:o.next=29;return new Promise((function(r){var a=i._queueLoadingCallback(r);i._prepareFontLoadEvent(t,a)}));case 29:case"end":return o.stop()}}),_callee2,this,[[11,16]])}))),function bind(r){return t.apply(this,arguments)})},{key:"isFontLoadingAPISupported",get:function get(){var t;return shadow(this,"isFontLoadingAPISupported",!(null===(t=this._document)||void 0===t||!t.fonts))}},{key:"isSyncFontLoadingSupported",get:function get(){var t,a=!1;(r||"undefined"!=typeof navigator&&"string"==typeof(null===(t=navigator)||void 0===t?void 0:t.userAgent)&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(a=!0);return shadow(this,"isSyncFontLoadingSupported",a)}},{key:"_queueLoadingCallback",value:function _queueLoadingCallback(t){var r=this.loadingRequests,a={done:!1,complete:function completeRequest(){assert(!a.done,"completeRequest() cannot be called twice.");a.done=!0;for(;r.length>0&&r[0].done;){var t=r.shift();setTimeout(t.callback,0)}},callback:t};r.push(a);return a}},{key:"_loadTestFont",get:function get(){return shadow(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}},{key:"_prepareFontLoadEvent",value:function _prepareFontLoadEvent(t,r){function int32(t,r){return t.charCodeAt(r)<<24|t.charCodeAt(r+1)<<16|t.charCodeAt(r+2)<<8|255&t.charCodeAt(r+3)}function spliceString(t,r,a,i){return t.substring(0,r)+i+t.substring(r+a)}var a,i,o=this._document.createElement("canvas");o.width=1;o.height=1;var l=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,c=o.getContext("2d",l),u=0;var h="lt".concat(Date.now()).concat(this.loadTestFontId++),d=this._loadTestFont,p=1482184792,v=int32(d=spliceString(d,976,h.length,h),16);for(a=0,i=h.length-3;a<i;a+=4)v=v-p+int32(h,a)|0;a<h.length&&(v=v-p+int32(h+"XXX",a)|0);d=spliceString(d,16,4,function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}(v));var _="url(data:font/opentype;base64,".concat(btoa(d),");"),y='@font-face {font-family:"'.concat(h,'";src:').concat(_,"}");this.insertRule(y);var g=this._document.createElement("div");g.style.visibility="hidden";g.style.width=g.style.height="10px";g.style.position="absolute";g.style.top=g.style.left="0px";for(var m=0,b=[t.loadedName,h];m<b.length;m++){var w=b[m],P=this._document.createElement("span");P.textContent="Hi";P.style.fontFamily=w;g.append(P)}this._document.body.append(g);!function isFontReady(t,r){if(++u>30){warn("Load test font never loaded.");r()}else{c.font="30px "+t;c.fillText(".",0,20);c.getImageData(0,0,1,1).data[3]>0?r():setTimeout(isFontReady.bind(null,t,r))}}(h,(function(){g.remove();r.complete()}))}}]);var t,a;return FontLoader}(),In=function(){function FontFaceObject(t,r){var a=r.isEvalSupported,i=void 0===a||a,o=r.disableFontFace,l=void 0!==o&&o,c=r.ignoreErrors,u=void 0!==c&&c,h=r.inspectFont,d=void 0===h?null:h;font_loader_classCallCheck(this,FontFaceObject);this.compiledGlyphs=Object.create(null);for(var p in t)this[p]=t[p];this.isEvalSupported=!1!==i;this.disableFontFace=!0===l;this.ignoreErrors=!0===u;this._inspectFont=d}font_loader_createClass(FontFaceObject,[{key:"createNativeFontFace",value:function createNativeFontFace(){var t,r;if(!this.data||this.disableFontFace)return null;if(this.cssFontInfo){var a={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(a.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg"));r=new FontFace(this.cssFontInfo.fontFamily,this.data,a)}else r=new FontFace(this.loadedName,this.data,{});null===(t=this._inspectFont)||void 0===t||t.call(this,this);return r}},{key:"createFontFaceRule",value:function createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;var r,a=bytesToString(this.data),i="url(data:".concat(this.mimetype,";base64,").concat(btoa(a),");");if(this.cssFontInfo){var o="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(o+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;"));r='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(o,"src:").concat(i,"}")}else r='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(i,"}");null===(t=this._inspectFont)||void 0===t||t.call(this,this,i);return r}},{key:"getPathGenerator",value:function getPathGenerator(t,r){if(void 0!==this.compiledGlyphs[r])return this.compiledGlyphs[r];var a;try{a=t.get(this.loadedName+"_path_"+r)}catch(t){if(!this.ignoreErrors)throw t;warn('getPathGenerator - ignoring character: "'.concat(t,'".'));return this.compiledGlyphs[r]=function(t,r){}}if(this.isEvalSupported&&he.isEvalSupported){var i,o=[],l=font_loader_createForOfIteratorHelper(a);try{for(l.s();!(i=l.n()).done;){var c=i.value,u=void 0!==c.args?c.args.join(","):"";o.push("c.",c.cmd,"(",u,");\n")}}catch(t){l.e(t)}finally{l.f()}return this.compiledGlyphs[r]=new Function("c","size",o.join(""))}return this.compiledGlyphs[r]=function(t,r){var i,o=font_loader_createForOfIteratorHelper(a);try{for(o.s();!(i=o.n()).done;){var l=i.value;"scale"===l.cmd&&(l.args=[r,-r]);t[l.cmd].apply(t,l.args)}}catch(t){o.e(t)}finally{o.f()}}}}]);return FontFaceObject}();function node_utils_typeof(t){return node_utils_typeof="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},node_utils_typeof(t)}function node_utils_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,node_utils_toPropertyKey(i.key),i)}}function node_utils_createClass(t,r,a){r&&node_utils_defineProperties(t.prototype,r);a&&node_utils_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function node_utils_toPropertyKey(t){var r=function node_utils_toPrimitive(t,r){if("object"!=node_utils_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=node_utils_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==node_utils_typeof(r)?r:String(r)}function node_utils_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function node_utils_callSuper(t,r,a){return r=node_utils_getPrototypeOf(r),function node_utils_possibleConstructorReturn(t,r){if(r&&("object"===node_utils_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function node_utils_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,node_utils_isNativeReflectConstruct()?Reflect.construct(r,a||[],node_utils_getPrototypeOf(t).constructor):r.apply(t,a))}function node_utils_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(node_utils_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function node_utils_getPrototypeOf(t){node_utils_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return node_utils_getPrototypeOf(t)}function node_utils_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&node_utils_setPrototypeOf(t,r)}function node_utils_setPrototypeOf(t,r){node_utils_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return node_utils_setPrototypeOf(t,r)}!function checkDOMMatrix(){if(!globalThis.DOMMatrix&&r){warn("Cannot polyfill `DOMMatrix`, rendering may be broken.")}}();!function checkPath2D(){if(!globalThis.Path2D&&r){warn("Cannot polyfill `Path2D`, rendering may be broken.")}}();var Tn=function fetchData(t){return new Promise((function(r,a){undefined.readFile(t,(function(t,i){!t&&i?r(new Uint8Array(i)):a(new Error(t))}))}))},Cn=function(t){node_utils_inherits(NodeFilterFactory,t);function NodeFilterFactory(){node_utils_classCallCheck(this,NodeFilterFactory);return node_utils_callSuper(this,NodeFilterFactory,arguments)}return node_utils_createClass(NodeFilterFactory)}(be),Mn=function(t){node_utils_inherits(NodeCanvasFactory,t);function NodeCanvasFactory(){node_utils_classCallCheck(this,NodeCanvasFactory);return node_utils_callSuper(this,NodeCanvasFactory,arguments)}node_utils_createClass(NodeCanvasFactory,[{key:"_createCanvas",value:function _createCanvas(t,r){return An.createCanvas(t,r)}}]);return NodeCanvasFactory}(we),Gn=function(t){node_utils_inherits(NodeCMapReaderFactory,t);function NodeCMapReaderFactory(){node_utils_classCallCheck(this,NodeCMapReaderFactory);return node_utils_callSuper(this,NodeCMapReaderFactory,arguments)}node_utils_createClass(NodeCMapReaderFactory,[{key:"_fetchData",value:function _fetchData(t,r){return Tn(t).then((function(t){return{cMapData:t,compressionType:r}}))}}]);return NodeCMapReaderFactory}(Pe),On=function(t){node_utils_inherits(NodeStandardFontDataFactory,t);function NodeStandardFontDataFactory(){node_utils_classCallCheck(this,NodeStandardFontDataFactory);return node_utils_callSuper(this,NodeStandardFontDataFactory,arguments)}node_utils_createClass(NodeStandardFontDataFactory,[{key:"_fetchData",value:function _fetchData(t){return Tn(t)}}]);return NodeStandardFontDataFactory}(ke);__webpack_require__(1419),__webpack_require__(5499),__webpack_require__(6976),__webpack_require__(854);function pattern_helper_toConsumableArray(t){return function pattern_helper_arrayWithoutHoles(t){if(Array.isArray(t))return pattern_helper_arrayLikeToArray(t)}(t)||function pattern_helper_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||pattern_helper_unsupportedIterableToArray(t)||function pattern_helper_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pattern_helper_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=pattern_helper_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function pattern_helper_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return pattern_helper_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?pattern_helper_arrayLikeToArray(t,r):void 0}}function pattern_helper_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function pattern_helper_callSuper(t,r,a){return r=pattern_helper_getPrototypeOf(r),function pattern_helper_possibleConstructorReturn(t,r){if(r&&("object"===pattern_helper_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function pattern_helper_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,pattern_helper_isNativeReflectConstruct()?Reflect.construct(r,a||[],pattern_helper_getPrototypeOf(t).constructor):r.apply(t,a))}function pattern_helper_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(pattern_helper_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function pattern_helper_getPrototypeOf(t){pattern_helper_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return pattern_helper_getPrototypeOf(t)}function pattern_helper_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&pattern_helper_setPrototypeOf(t,r)}function pattern_helper_setPrototypeOf(t,r){pattern_helper_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return pattern_helper_setPrototypeOf(t,r)}function pattern_helper_typeof(t){return pattern_helper_typeof="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},pattern_helper_typeof(t)}function pattern_helper_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function pattern_helper_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,pattern_helper_toPropertyKey(i.key),i)}}function pattern_helper_createClass(t,r,a){r&&pattern_helper_defineProperties(t.prototype,r);a&&pattern_helper_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function pattern_helper_toPropertyKey(t){var r=function pattern_helper_toPrimitive(t,r){if("object"!=pattern_helper_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=pattern_helper_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==pattern_helper_typeof(r)?r:String(r)}var Rn="Fill",Ln="Stroke",Dn="Shading";function applyBoundingBox(t,r){if(r){var a=r[2]-r[0],i=r[3]-r[1],o=new Path2D;o.rect(r[0],r[1],a,i);t.clip(o)}}var jn=function(){function BaseShadingPattern(){pattern_helper_classCallCheck(this,BaseShadingPattern);this.constructor===BaseShadingPattern&&unreachable("Cannot initialize BaseShadingPattern.")}pattern_helper_createClass(BaseShadingPattern,[{key:"getPattern",value:function getPattern(){unreachable("Abstract method `getPattern` called.")}}]);return BaseShadingPattern}(),Nn=function(t){pattern_helper_inherits(RadialAxialShadingPattern,t);function RadialAxialShadingPattern(t){var r;pattern_helper_classCallCheck(this,RadialAxialShadingPattern);(r=pattern_helper_callSuper(this,RadialAxialShadingPattern))._type=t[1];r._bbox=t[2];r._colorStops=t[3];r._p0=t[4];r._p1=t[5];r._r0=t[6];r._r1=t[7];r.matrix=null;return r}pattern_helper_createClass(RadialAxialShadingPattern,[{key:"_createGradient",value:function _createGradient(t){var r;"axial"===this._type?r=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(r=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));var a,i=pattern_helper_createForOfIteratorHelper(this._colorStops);try{for(i.s();!(a=i.n()).done;){var o=a.value;r.addColorStop(o[0],o[1])}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"getPattern",value:function getPattern(t,r,a,i){var o;if(i===Ln||i===Rn){var l=r.current.getClippedPathBoundingBox(i,getCurrentTransform(t))||[0,0,0,0],c=Math.ceil(l[2]-l[0])||1,u=Math.ceil(l[3]-l[1])||1,h=r.cachedCanvases.getCanvas("pattern",c,u,!0),d=h.context;d.clearRect(0,0,d.canvas.width,d.canvas.height);d.beginPath();d.rect(0,0,d.canvas.width,d.canvas.height);d.translate(-l[0],-l[1]);a=fe.transform(a,[1,0,0,1,l[0],l[1]]);d.transform.apply(d,pattern_helper_toConsumableArray(r.baseTransform));this.matrix&&d.transform.apply(d,pattern_helper_toConsumableArray(this.matrix));applyBoundingBox(d,this._bbox);d.fillStyle=this._createGradient(d);d.fill();o=t.createPattern(h.canvas,"no-repeat");var p=new DOMMatrix(a);o.setTransform(p)}else{applyBoundingBox(t,this._bbox);o=this._createGradient(t)}return o}}]);return RadialAxialShadingPattern}(jn);function drawTriangle(t,r,a,i,o,l,c,u){var h,d=r.coords,p=r.colors,v=t.data,_=4*t.width;if(d[a+1]>d[i+1]){h=a;a=i;i=h;h=l;l=c;c=h}if(d[i+1]>d[o+1]){h=i;i=o;o=h;h=c;c=u;u=h}if(d[a+1]>d[i+1]){h=a;a=i;i=h;h=l;l=c;c=h}var y=(d[a]+r.offsetX)*r.scaleX,g=(d[a+1]+r.offsetY)*r.scaleY,m=(d[i]+r.offsetX)*r.scaleX,b=(d[i+1]+r.offsetY)*r.scaleY,w=(d[o]+r.offsetX)*r.scaleX,P=(d[o+1]+r.offsetY)*r.scaleY;if(!(g>=P))for(var k,S,A,x,E,I,T,C,M=p[l],G=p[l+1],O=p[l+2],R=p[c],L=p[c+1],D=p[c+2],j=p[u],N=p[u+1],W=p[u+2],H=Math.round(g),B=Math.round(P),z=H;z<=B;z++){if(z<b){var U=z<g?0:(g-z)/(g-b);k=y-(y-m)*U;S=M-(M-R)*U;A=G-(G-L)*U;x=O-(O-D)*U}else{var q=void 0;k=m-(m-w)*(q=z>P?1:b===P?0:(b-z)/(b-P));S=R-(R-j)*q;A=L-(L-N)*q;x=D-(D-W)*q}var V=void 0;E=y-(y-w)*(V=z<g?0:z>P?1:(g-z)/(g-P));I=M-(M-j)*V;T=G-(G-N)*V;C=O-(O-W)*V;for(var K=Math.round(Math.min(k,E)),Y=Math.round(Math.max(k,E)),X=_*z+4*K,$=K;$<=Y;$++){(V=(k-$)/(k-E))<0?V=0:V>1&&(V=1);v[X++]=S-(S-I)*V|0;v[X++]=A-(A-T)*V|0;v[X++]=x-(x-C)*V|0;v[X++]=255}}}function drawFigure(t,r,a){var i,o,l=r.coords,c=r.colors;switch(r.type){case"lattice":var u=r.verticesPerRow,h=Math.floor(l.length/u)-1,d=u-1;for(i=0;i<h;i++)for(var p=i*u,v=0;v<d;v++,p++){drawTriangle(t,a,l[p],l[p+1],l[p+u],c[p],c[p+1],c[p+u]);drawTriangle(t,a,l[p+u+1],l[p+1],l[p+u],c[p+u+1],c[p+1],c[p+u])}break;case"triangles":for(i=0,o=l.length;i<o;i+=3)drawTriangle(t,a,l[i],l[i+1],l[i+2],c[i],c[i+1],c[i+2]);break;default:throw new Error("illegal figure")}}var Wn=function(t){pattern_helper_inherits(MeshShadingPattern,t);function MeshShadingPattern(t){var r;pattern_helper_classCallCheck(this,MeshShadingPattern);(r=pattern_helper_callSuper(this,MeshShadingPattern))._coords=t[2];r._colors=t[3];r._figures=t[4];r._bounds=t[5];r._bbox=t[7];r._background=t[8];r.matrix=null;return r}pattern_helper_createClass(MeshShadingPattern,[{key:"_createMeshCanvas",value:function _createMeshCanvas(t,r,a){var i=Math.floor(this._bounds[0]),o=Math.floor(this._bounds[1]),l=Math.ceil(this._bounds[2])-i,c=Math.ceil(this._bounds[3])-o,u=Math.min(Math.ceil(Math.abs(l*t[0]*1.1)),3e3),h=Math.min(Math.ceil(Math.abs(c*t[1]*1.1)),3e3),d=l/u,p=c/h,v={coords:this._coords,colors:this._colors,offsetX:-i,offsetY:-o,scaleX:1/d,scaleY:1/p},_=u+4,y=h+4,g=a.getCanvas("mesh",_,y,!1),m=g.context,b=m.createImageData(u,h);if(r)for(var w=b.data,P=0,k=w.length;P<k;P+=4){w[P]=r[0];w[P+1]=r[1];w[P+2]=r[2];w[P+3]=255}var S,A=pattern_helper_createForOfIteratorHelper(this._figures);try{for(A.s();!(S=A.n()).done;){drawFigure(b,S.value,v)}}catch(t){A.e(t)}finally{A.f()}m.putImageData(b,2,2);return{canvas:g.canvas,offsetX:i-2*d,offsetY:o-2*p,scaleX:d,scaleY:p}}},{key:"getPattern",value:function getPattern(t,r,a,i){applyBoundingBox(t,this._bbox);var o;if(i===Dn)o=fe.singularValueDecompose2dScale(getCurrentTransform(t));else{o=fe.singularValueDecompose2dScale(r.baseTransform);if(this.matrix){var l=fe.singularValueDecompose2dScale(this.matrix);o=[o[0]*l[0],o[1]*l[1]]}}var c=this._createMeshCanvas(o,i===Dn?null:this._background,r.cachedCanvases);if(i!==Dn){t.setTransform.apply(t,pattern_helper_toConsumableArray(r.baseTransform));this.matrix&&t.transform.apply(t,pattern_helper_toConsumableArray(this.matrix))}t.translate(c.offsetX,c.offsetY);t.scale(c.scaleX,c.scaleY);return t.createPattern(c.canvas,"no-repeat")}}]);return MeshShadingPattern}(jn),Hn=function(t){pattern_helper_inherits(DummyShadingPattern,t);function DummyShadingPattern(){pattern_helper_classCallCheck(this,DummyShadingPattern);return pattern_helper_callSuper(this,DummyShadingPattern,arguments)}pattern_helper_createClass(DummyShadingPattern,[{key:"getPattern",value:function getPattern(){return"hotpink"}}]);return DummyShadingPattern}(jn);var Bn=1,zn=2,Un=function(){function TilingPattern(t,r,a,i,o){pattern_helper_classCallCheck(this,TilingPattern);this.operatorList=t[2];this.matrix=t[3]||[1,0,0,1,0,0];this.bbox=t[4];this.xstep=t[5];this.ystep=t[6];this.paintType=t[7];this.tilingType=t[8];this.color=r;this.ctx=a;this.canvasGraphicsFactory=i;this.baseTransform=o}pattern_helper_createClass(TilingPattern,[{key:"createPatternCanvas",value:function createPatternCanvas(t){var r=this.operatorList,a=this.bbox,i=this.xstep,o=this.ystep,l=this.paintType,c=this.tilingType,u=this.color,h=this.canvasGraphicsFactory;info("TilingType: "+c);var d=a[0],p=a[1],v=a[2],_=a[3],y=fe.singularValueDecompose2dScale(this.matrix),g=fe.singularValueDecompose2dScale(this.baseTransform),m=[y[0]*g[0],y[1]*g[1]],b=this.getSizeAndScale(i,this.ctx.canvas.width,m[0]),w=this.getSizeAndScale(o,this.ctx.canvas.height,m[1]),P=t.cachedCanvases.getCanvas("pattern",b.size,w.size,!0),k=P.context,S=h.createCanvasGraphics(k);S.groupLevel=t.groupLevel;this.setFillAndStrokeStyleToContext(S,l,u);var A=d,x=p,E=v,I=_;if(d<0){A=0;E+=Math.abs(d)}if(p<0){x=0;I+=Math.abs(p)}k.translate(-b.scale*A,-w.scale*x);S.transform(b.scale,0,0,w.scale,0,0);k.save();this.clipBbox(S,A,x,E,I);S.baseTransform=getCurrentTransform(S.ctx);S.executeOperatorList(r);S.endDrawing();return{canvas:P.canvas,scaleX:b.scale,scaleY:w.scale,offsetX:A,offsetY:x}}},{key:"getSizeAndScale",value:function getSizeAndScale(t,r,a){t=Math.abs(t);var i=Math.max(TilingPattern.MAX_PATTERN_SIZE,r),o=Math.ceil(t*a);o>=i?o=i:a=o/t;return{scale:a,size:o}}},{key:"clipBbox",value:function clipBbox(t,r,a,i,o){var l=i-r,c=o-a;t.ctx.rect(r,a,l,c);t.current.updateRectMinMax(getCurrentTransform(t.ctx),[r,a,i,o]);t.clip();t.endPath()}},{key:"setFillAndStrokeStyleToContext",value:function setFillAndStrokeStyleToContext(t,r,a){var i=t.ctx,o=t.current;switch(r){case Bn:var l=this.ctx;i.fillStyle=l.fillStyle;i.strokeStyle=l.strokeStyle;o.fillColor=l.fillStyle;o.strokeColor=l.strokeStyle;break;case zn:var c=fe.makeHexColor(a[0],a[1],a[2]);i.fillStyle=c;i.strokeStyle=c;o.fillColor=c;o.strokeColor=c;break;default:throw new ce("Unsupported paint type: ".concat(r))}}},{key:"getPattern",value:function getPattern(t,r,a,i){var o=a;if(i!==Dn){o=fe.transform(o,r.baseTransform);this.matrix&&(o=fe.transform(o,this.matrix))}var l=this.createPatternCanvas(r),c=new DOMMatrix(o);c=(c=c.translate(l.offsetX,l.offsetY)).scale(1/l.scaleX,1/l.scaleY);var u=t.createPattern(l.canvas,"repeat");u.setTransform(c);return u}}]);return TilingPattern}();!function pattern_helper_defineProperty(t,r,a){(r=pattern_helper_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}(Un,"MAX_PATTERN_SIZE",3e3);function image_utils_slicedToArray(t,r){return function image_utils_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function image_utils_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||function image_utils_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return image_utils_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return image_utils_arrayLikeToArray(t,r)}(t,r)||function image_utils_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function image_utils_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function convertBlackAndWhiteToRGBA(t){var r=t.src,a=t.srcPos,i=void 0===a?0:a,o=t.dest,l=t.width,c=t.height,u=t.nonBlackColor,h=void 0===u?4294967295:u,d=t.inverseDecode,p=void 0!==d&&d,v=he.isLittleEndian?4278190080:255,_=image_utils_slicedToArray(p?[h,v]:[v,h],2),y=_[0],g=_[1],m=l>>3,b=7&l,w=r.length;o=new Uint32Array(o.buffer);for(var P=0,k=0;k<c;k++){for(var S=i+m;i<S;i++){var A=i<w?r[i]:255;o[P++]=128&A?g:y;o[P++]=64&A?g:y;o[P++]=32&A?g:y;o[P++]=16&A?g:y;o[P++]=8&A?g:y;o[P++]=4&A?g:y;o[P++]=2&A?g:y;o[P++]=1&A?g:y}if(0!==b)for(var x=i<w?r[i++]:255,E=0;E<b;E++)o[P++]=x&1<<7-E?g:y}return{srcPos:i,destPos:P}}function canvas_typeof(t){return canvas_typeof="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},canvas_typeof(t)}function canvas_toConsumableArray(t){return function canvas_arrayWithoutHoles(t){if(Array.isArray(t))return canvas_arrayLikeToArray(t)}(t)||function canvas_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||canvas_unsupportedIterableToArray(t)||function canvas_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function canvas_classPrivateMethodInitSpec(t,r){!function canvas_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,r);r.add(t)}function canvas_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function canvas_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=canvas_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function canvas_slicedToArray(t,r){return function canvas_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function canvas_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||canvas_unsupportedIterableToArray(t,r)||function canvas_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function canvas_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return canvas_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?canvas_arrayLikeToArray(t,r):void 0}}function canvas_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function canvas_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function canvas_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,canvas_toPropertyKey(i.key),i)}}function canvas_createClass(t,r,a){r&&canvas_defineProperties(t.prototype,r);a&&canvas_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function canvas_toPropertyKey(t){var r=function canvas_toPrimitive(t,r){if("object"!=canvas_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=canvas_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==canvas_typeof(r)?r:String(r)}var qn=4096,Vn=16;var Kn=function(){function CachedCanvases(t){canvas_classCallCheck(this,CachedCanvases);this.canvasFactory=t;this.cache=Object.create(null)}canvas_createClass(CachedCanvases,[{key:"getCanvas",value:function getCanvas(t,r,a){var i;if(void 0!==this.cache[t]){i=this.cache[t];this.canvasFactory.reset(i,r,a)}else{i=this.canvasFactory.create(r,a);this.cache[t]=i}return i}},{key:"delete",value:function _delete(t){delete this.cache[t]}},{key:"clear",value:function clear(){for(var t in this.cache){var r=this.cache[t];this.canvasFactory.destroy(r);delete this.cache[t]}}}]);return CachedCanvases}();function drawImageAtIntegerCoords(t,r,a,i,o,l,c,u,h,d){var p=canvas_slicedToArray(getCurrentTransform(t),6),v=p[0],_=p[1],y=p[2],g=p[3],m=p[4],b=p[5];if(0===_&&0===y){var w=c*v+m,P=Math.round(w),k=u*g+b,S=Math.round(k),A=(c+h)*v+m,x=Math.abs(Math.round(A)-P)||1,E=(u+d)*g+b,I=Math.abs(Math.round(E)-S)||1;t.setTransform(Math.sign(v),0,0,Math.sign(g),P,S);t.drawImage(r,a,i,o,l,0,0,x,I);t.setTransform(v,_,y,g,m,b);return[x,I]}if(0===v&&0===g){var T=u*y+m,C=Math.round(T),M=c*_+b,G=Math.round(M),O=(u+d)*y+m,R=Math.abs(Math.round(O)-C)||1,L=(c+h)*_+b,D=Math.abs(Math.round(L)-G)||1;t.setTransform(0,Math.sign(_),Math.sign(y),0,C,G);t.drawImage(r,a,i,o,l,0,0,D,R);t.setTransform(v,_,y,g,m,b);return[D,R]}t.drawImage(r,a,i,o,l,c,u,h,d);return[Math.hypot(v,_)*h,Math.hypot(y,g)*d]}var Yn=function(){function CanvasExtraState(t,r){canvas_classCallCheck(this,CanvasExtraState);this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=i;this.textMatrixScale=1;this.fontMatrix=o;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=w;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,r])}canvas_createClass(CanvasExtraState,[{key:"clone",value:function clone(){var clone=Object.create(this);clone.clipBox=this.clipBox.slice();return clone}},{key:"setCurrentPoint",value:function setCurrentPoint(t,r){this.x=t;this.y=r}},{key:"updatePathMinMax",value:function updatePathMinMax(t,r,a){var i=canvas_slicedToArray(fe.applyTransform([r,a],t),2);r=i[0];a=i[1];this.minX=Math.min(this.minX,r);this.minY=Math.min(this.minY,a);this.maxX=Math.max(this.maxX,r);this.maxY=Math.max(this.maxY,a)}},{key:"updateRectMinMax",value:function updateRectMinMax(t,r){var a=fe.applyTransform(r,t),i=fe.applyTransform(r.slice(2),t),o=fe.applyTransform([r[0],r[3]],t),l=fe.applyTransform([r[2],r[1]],t);this.minX=Math.min(this.minX,a[0],i[0],o[0],l[0]);this.minY=Math.min(this.minY,a[1],i[1],o[1],l[1]);this.maxX=Math.max(this.maxX,a[0],i[0],o[0],l[0]);this.maxY=Math.max(this.maxY,a[1],i[1],o[1],l[1])}},{key:"updateScalingPathMinMax",value:function updateScalingPathMinMax(t,r){fe.scaleMinMax(t,r);this.minX=Math.min(this.minX,r[0]);this.minY=Math.min(this.minY,r[1]);this.maxX=Math.max(this.maxX,r[2]);this.maxY=Math.max(this.maxY,r[3])}},{key:"updateCurvePathMinMax",value:function updateCurvePathMinMax(t,r,a,i,o,l,c,u,h,d){var p=fe.bezierBoundingBox(r,a,i,o,l,c,u,h,d);d||this.updateRectMinMax(t,p)}},{key:"getPathBoundingBox",value:function getPathBoundingBox(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rn,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=[this.minX,this.minY,this.maxX,this.maxY];if(t===Ln){r||unreachable("Stroke bounding box must include transform.");var i=fe.singularValueDecompose2dScale(r),o=i[0]*this.lineWidth/2,l=i[1]*this.lineWidth/2;a[0]-=o;a[1]-=l;a[2]+=o;a[3]+=l}return a}},{key:"updateClipFromPath",value:function updateClipFromPath(){var t=fe.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}},{key:"isEmptyClip",value:function isEmptyClip(){return this.minX===1/0}},{key:"startNewPathAndClipBox",value:function startNewPathAndClipBox(t){this.clipBox=t;this.minX=1/0;this.minY=1/0;this.maxX=0;this.maxY=0}},{key:"getClippedPathBoundingBox",value:function getClippedPathBoundingBox(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rn,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return fe.intersect(this.clipBox,this.getPathBoundingBox(t,r))}}]);return CanvasExtraState}();function putBinaryImageData(t,r){if("undefined"!=typeof ImageData&&r instanceof ImageData)t.putImageData(r,0,0);else{var a,i,o,l,c,u=r.height,h=r.width,d=u%Vn,p=(u-d)/Vn,v=0===d?p:p+1,_=t.createImageData(h,Vn),y=0,g=r.data,m=_.data;if(r.kind===E.GRAYSCALE_1BPP){var b=g.byteLength,w=new Uint32Array(m.buffer,0,m.byteLength>>2),P=w.length,k=h+7>>3,S=4294967295,A=he.isLittleEndian?4278190080:255;for(i=0;i<v;i++){l=i<p?Vn:d;a=0;for(o=0;o<l;o++){for(var x=b-y,I=0,T=x>k?h:8*x-7,C=-8&T,M=0,G=0;I<C;I+=8){G=g[y++];w[a++]=128&G?S:A;w[a++]=64&G?S:A;w[a++]=32&G?S:A;w[a++]=16&G?S:A;w[a++]=8&G?S:A;w[a++]=4&G?S:A;w[a++]=2&G?S:A;w[a++]=1&G?S:A}for(;I<T;I++){if(0===M){G=g[y++];M=128}w[a++]=G&M?S:A;M>>=1}}for(;a<P;)w[a++]=0;t.putImageData(_,0,i*Vn)}}else if(r.kind===E.RGBA_32BPP){o=0;c=h*Vn*4;for(i=0;i<p;i++){m.set(g.subarray(y,y+c));y+=c;t.putImageData(_,0,o);o+=Vn}if(i<v){c=h*d*4;m.set(g.subarray(y,y+c));t.putImageData(_,0,o)}}else{if(r.kind!==E.RGB_24BPP)throw new Error("bad image kind: ".concat(r.kind));c=h*(l=Vn);for(i=0;i<v;i++){i>=p&&(c=h*(l=d));a=0;for(o=c;o--;){m[a++]=g[y++];m[a++]=g[y++];m[a++]=g[y++];m[a++]=255}t.putImageData(_,0,i*Vn)}}}}function putBinaryImageMask(t,r){if(r.bitmap)t.drawImage(r.bitmap,0,0);else for(var a=r.height,i=r.width,o=a%Vn,l=(a-o)/Vn,c=0===o?l:l+1,u=t.createImageData(i,Vn),h=0,d=r.data,p=u.data,v=0;v<c;v++){h=convertBlackAndWhiteToRGBA({src:d,srcPos:h,dest:p,width:i,height:v<l?Vn:o,nonBlackColor:0}).srcPos;t.putImageData(u,0,v*Vn)}}function copyCtxState(t,r){for(var a=0,i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];a<i.length;a++){var o=i[a];void 0!==t[o]&&(r[o]=t[o])}if(void 0!==t.setLineDash){r.setLineDash(t.getLineDash());r.lineDashOffset=t.lineDashOffset}}function resetCtxToDefault(t){t.strokeStyle=t.fillStyle="#000000";t.fillRule="nonzero";t.globalAlpha=1;t.lineWidth=1;t.lineCap="butt";t.lineJoin="miter";t.miterLimit=10;t.globalCompositeOperation="source-over";t.font="10px sans-serif";if(void 0!==t.setLineDash){t.setLineDash([]);t.lineDashOffset=0}if(!r){var a=t.filter;"none"!==a&&""!==a&&(t.filter="none")}}function composeSMaskBackdrop(t,r,a,i){for(var o=t.length,l=3;l<o;l+=4){var c=t[l];if(0===c){t[l-3]=r;t[l-2]=a;t[l-1]=i}else if(c<255){var u=255-c;t[l-3]=t[l-3]*c+r*u>>8;t[l-2]=t[l-2]*c+a*u>>8;t[l-1]=t[l-1]*c+i*u>>8}}}function composeSMaskAlpha(t,r,a){for(var i=t.length,o=3;o<i;o+=4){var l=a?a[t[o]]:t[o];r[o]=r[o]*l*.00392156862745098|0}}function composeSMaskLuminosity(t,r,a){for(var i=t.length,o=3;o<i;o+=4){var l=77*t[o-3]+152*t[o-2]+28*t[o-1];r[o]=a?r[o]*a[l>>8]>>8:r[o]*l>>16}}function composeSMask(t,r,a,i){var o=i[0],l=i[1],c=i[2]-o,u=i[3]-l;if(0!==c&&0!==u){!function genericComposeSMask(t,r,a,i,o,l,c,u,h,d,p){for(var v=!!l,_=v?l[0]:0,y=v?l[1]:0,g=v?l[2]:0,m="Luminosity"===o?composeSMaskLuminosity:composeSMaskAlpha,b=Math.min(i,Math.ceil(1048576/a)),w=0;w<i;w+=b){var P=Math.min(b,i-w),k=t.getImageData(u-d,w+(h-p),a,P),S=r.getImageData(u,w+h,a,P);v&&composeSMaskBackdrop(k.data,_,y,g);m(k.data,S.data,c);r.putImageData(S,u,w+h)}}(r.context,a,c,u,r.subtype,r.backdrop,r.transferMap,o,l,r.offsetX,r.offsetY);t.save();t.globalAlpha=1;t.globalCompositeOperation="source-over";t.setTransform(1,0,0,1,0,0);t.drawImage(a.canvas,0,0);t.restore()}}function getImageSmoothingEnabled(t,r){var a=fe.singularValueDecompose2dScale(t);a[0]=Math.fround(a[0]);a[1]=Math.fround(a[1]);var i=Math.fround((globalThis.devicePixelRatio||1)*Ae.PDF_TO_CSS_UNITS);return void 0!==r?r:a[0]<=i||a[1]<=i}var Xn=["butt","round","square"],$n=["miter","round","bevel"],Jn={},Qn={},Zn=new WeakSet,ea=new WeakSet,ta=function(){function CanvasGraphics(t,r,a,i,o,l,c,u){var h=l.optionalContentConfig,d=l.markedContentStack,p=void 0===d?null:d;canvas_classCallCheck(this,CanvasGraphics);canvas_classPrivateMethodInitSpec(this,ea);canvas_classPrivateMethodInitSpec(this,Zn);this.ctx=t;this.current=new Yn(this.ctx.canvas.width,this.ctx.canvas.height);this.stateStack=[];this.pendingClip=null;this.pendingEOFill=!1;this.res=null;this.xobjs=null;this.commonObjs=r;this.objs=a;this.canvasFactory=i;this.filterFactory=o;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=p||[];this.optionalContentConfig=h;this.cachedCanvases=new Kn(this.canvasFactory);this.cachedPatterns=new Map;this.annotationCanvasMap=c;this.viewportScale=1;this.outputScaleX=1;this.outputScaleY=1;this.pageColors=u;this._cachedScaleForStroking=[-1,0];this._cachedGetSinglePixelWidth=null;this._cachedBitmapsMap=new Map}canvas_createClass(CanvasGraphics,[{key:"getObject",value:function getObject(t){var r=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):r}},{key:"beginDrawing",value:function beginDrawing(t){var r,a=t.transform,i=t.viewport,o=t.transparency,l=void 0!==o&&o,c=t.background,u=void 0===c?null:c,h=this.ctx.canvas.width,d=this.ctx.canvas.height,p=this.ctx.fillStyle;this.ctx.fillStyle=u||"#ffffff";this.ctx.fillRect(0,0,h,d);this.ctx.fillStyle=p;if(l){var v,_=this.cachedCanvases.getCanvas("transparent",h,d);this.compositeCtx=this.ctx;this.transparentCanvas=_.canvas;this.ctx=_.context;this.ctx.save();(v=this.ctx).transform.apply(v,canvas_toConsumableArray(getCurrentTransform(this.compositeCtx)))}this.ctx.save();resetCtxToDefault(this.ctx);if(a){var y;(y=this.ctx).transform.apply(y,canvas_toConsumableArray(a));this.outputScaleX=a[0];this.outputScaleY=a[0]}(r=this.ctx).transform.apply(r,canvas_toConsumableArray(i.transform));this.viewportScale=i.scale;this.baseTransform=getCurrentTransform(this.ctx)}},{key:"executeOperatorList",value:function executeOperatorList(t,r,a,i){var o=t.argsArray,l=t.fnArray,c=r||0,u=o.length;if(u===c)return c;for(var h,d=u-c>10&&"function"==typeof a,p=d?Date.now()+15:0,v=0,_=this.commonObjs,y=this.objs;;){if(void 0!==i&&c===i.nextBreakPoint){i.breakIt(c,a);return c}if((h=l[c])!==ee.dependency)this[h].apply(this,o[c]);else{var g,m=canvas_createForOfIteratorHelper(o[c]);try{for(m.s();!(g=m.n()).done;){var b=g.value,w=b.startsWith("g_")?_:y;if(!w.has(b)){w.get(b,a);return c}}}catch(t){m.e(t)}finally{m.f()}}if(++c===u)return c;if(d&&++v>10){if(Date.now()>p){a();return c}v=0}}}},{key:"endDrawing",value:function endDrawing(){canvas_classPrivateMethodGet(this,Zn,_restoreInitialState2).call(this);this.cachedCanvases.clear();this.cachedPatterns.clear();var t,r=canvas_createForOfIteratorHelper(this._cachedBitmapsMap.values());try{for(r.s();!(t=r.n()).done;){var a,i=t.value,o=canvas_createForOfIteratorHelper(i.values());try{for(o.s();!(a=o.n()).done;){var l=a.value;"undefined"!=typeof HTMLCanvasElement&&l instanceof HTMLCanvasElement&&(l.width=l.height=0)}}catch(t){o.e(t)}finally{o.f()}i.clear()}}catch(t){r.e(t)}finally{r.f()}this._cachedBitmapsMap.clear();canvas_classPrivateMethodGet(this,ea,_drawFilter2).call(this)}},{key:"_scaleImage",value:function _scaleImage(t,r){for(var a,i,o=t.width,l=t.height,c=Math.max(Math.hypot(r[0],r[1]),1),u=Math.max(Math.hypot(r[2],r[3]),1),h=o,d=l,p="prescale1";c>2&&h>1||u>2&&d>1;){var v=h,_=d;c>2&&h>1&&(c/=h/(v=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h/2)));u>2&&d>1&&(u/=d/(_=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d)/2));(i=(a=this.cachedCanvases.getCanvas(p,v,_)).context).clearRect(0,0,v,_);i.drawImage(t,0,0,h,d,0,0,v,_);t=a.canvas;h=v;d=_;p="prescale1"===p?"prescale2":"prescale1"}return{img:t,paintWidth:h,paintHeight:d}}},{key:"_createMaskCanvas",value:function _createMaskCanvas(t){var r,a,i,o,l=this.ctx,c=t.width,u=t.height,h=this.current.fillColor,d=this.current.patternFill,p=getCurrentTransform(l);if((t.bitmap||t.data)&&t.count>1){var v=t.bitmap||t.data.buffer;a=JSON.stringify(d?p:[p.slice(0,4),h]);if(!(r=this._cachedBitmapsMap.get(v))){r=new Map;this._cachedBitmapsMap.set(v,r)}var _=r.get(a);if(_&&!d){return{canvas:_,offsetX:Math.round(Math.min(p[0],p[2])+p[4]),offsetY:Math.round(Math.min(p[1],p[3])+p[5])}}i=_}i||putBinaryImageMask((o=this.cachedCanvases.getCanvas("maskCanvas",c,u)).context,t);var y=fe.transform(p,[1/c,0,0,-1/u,0,0]);y=fe.transform(y,[1,0,0,1,0,-u]);var g=canvas_slicedToArray(fe.getAxialAlignedBoundingBox([0,0,c,u],y),4),m=g[0],b=g[1],w=g[2],P=g[3],k=Math.round(w-m)||1,S=Math.round(P-b)||1,A=this.cachedCanvases.getCanvas("fillCanvas",k,S),x=A.context,E=m,I=b;x.translate(-E,-I);x.transform.apply(x,canvas_toConsumableArray(y));if(!i){i=(i=this._scaleImage(o.canvas,getCurrentTransformInverse(x))).img;r&&d&&r.set(a,i)}x.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(x),t.interpolate);drawImageAtIntegerCoords(x,i,0,0,i.width,i.height,0,0,c,u);x.globalCompositeOperation="source-in";var T=fe.transform(getCurrentTransformInverse(x),[1,0,0,1,-E,-I]);x.fillStyle=d?h.getPattern(l,this,T,Rn):h;x.fillRect(0,0,c,u);if(r&&!d){this.cachedCanvases.delete("fillCanvas");r.set(a,A.canvas)}return{canvas:A.canvas,offsetX:Math.round(E),offsetY:Math.round(I)}}},{key:"setLineWidth",value:function setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1);this.current.lineWidth=t;this.ctx.lineWidth=t}},{key:"setLineCap",value:function setLineCap(t){this.ctx.lineCap=Xn[t]}},{key:"setLineJoin",value:function setLineJoin(t){this.ctx.lineJoin=$n[t]}},{key:"setMiterLimit",value:function setMiterLimit(t){this.ctx.miterLimit=t}},{key:"setDash",value:function setDash(t,r){var a=this.ctx;if(void 0!==a.setLineDash){a.setLineDash(t);a.lineDashOffset=r}}},{key:"setRenderingIntent",value:function setRenderingIntent(t){}},{key:"setFlatness",value:function setFlatness(t){}},{key:"setGState",value:function setGState(t){var r,a=canvas_createForOfIteratorHelper(t);try{for(a.s();!(r=a.n()).done;){var i=canvas_slicedToArray(r.value,2),o=i[0],l=i[1];switch(o){case"LW":this.setLineWidth(l);break;case"LC":this.setLineCap(l);break;case"LJ":this.setLineJoin(l);break;case"ML":this.setMiterLimit(l);break;case"D":this.setDash(l[0],l[1]);break;case"RI":this.setRenderingIntent(l);break;case"FL":this.setFlatness(l);break;case"Font":this.setFont(l[0],l[1]);break;case"CA":this.current.strokeAlpha=l;break;case"ca":this.current.fillAlpha=l;this.ctx.globalAlpha=l;break;case"BM":this.ctx.globalCompositeOperation=l;break;case"SMask":this.current.activeSMask=l?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(l)}}}catch(t){a.e(t)}finally{a.f()}}},{key:"inSMaskMode",get:function get(){return!!this.suspendedCtx}},{key:"checkSMaskState",value:function checkSMaskState(){var t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}},{key:"beginSMaskMode",value:function beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");var t=this.ctx.canvas.width,r=this.ctx.canvas.height,a="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(a,t,r);this.suspendedCtx=this.ctx;this.ctx=i.context;var o=this.ctx;o.setTransform.apply(o,canvas_toConsumableArray(getCurrentTransform(this.suspendedCtx)));copyCtxState(this.suspendedCtx,o);!function mirrorContextOperations(t,r){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=function(){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 ctxSave(){r.save();this.__originalSave()};t.restore=function ctxRestore(){r.restore();this.__originalRestore()};t.translate=function ctxTranslate(t,a){r.translate(t,a);this.__originalTranslate(t,a)};t.scale=function ctxScale(t,a){r.scale(t,a);this.__originalScale(t,a)};t.transform=function ctxTransform(t,a,i,o,l,c){r.transform(t,a,i,o,l,c);this.__originalTransform(t,a,i,o,l,c)};t.setTransform=function ctxSetTransform(t,a,i,o,l,c){r.setTransform(t,a,i,o,l,c);this.__originalSetTransform(t,a,i,o,l,c)};t.resetTransform=function ctxResetTransform(){r.resetTransform();this.__originalResetTransform()};t.rotate=function ctxRotate(t){r.rotate(t);this.__originalRotate(t)};t.clip=function ctxRotate(t){r.clip(t);this.__originalClip(t)};t.moveTo=function(t,a){r.moveTo(t,a);this.__originalMoveTo(t,a)};t.lineTo=function(t,a){r.lineTo(t,a);this.__originalLineTo(t,a)};t.bezierCurveTo=function(t,a,i,o,l,c){r.bezierCurveTo(t,a,i,o,l,c);this.__originalBezierCurveTo(t,a,i,o,l,c)};t.rect=function(t,a,i,o){r.rect(t,a,i,o);this.__originalRect(t,a,i,o)};t.closePath=function(){r.closePath();this.__originalClosePath()};t.beginPath=function(){r.beginPath();this.__originalBeginPath()}}(o,this.suspendedCtx);this.setGState([["BM","source-over"],["ca",1],["CA",1]])}},{key:"endSMaskMode",value:function endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring();copyCtxState(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.suspendedCtx=null}},{key:"compose",value:function compose(t){if(this.current.activeSMask){if(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])}else t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];var r=this.current.activeSMask;composeSMask(this.suspendedCtx,r,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()}}},{key:"save",value:function save(){if(this.inSMaskMode){copyCtxState(this.ctx,this.suspendedCtx);this.suspendedCtx.save()}else this.ctx.save();var t=this.current;this.stateStack.push(t);this.current=t.clone()}},{key:"restore",value:function restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode();if(0!==this.stateStack.length){this.current=this.stateStack.pop();if(this.inSMaskMode){this.suspendedCtx.restore();copyCtxState(this.suspendedCtx,this.ctx)}else this.ctx.restore();this.checkSMaskState();this.pendingClip=null;this._cachedScaleForStroking[0]=-1;this._cachedGetSinglePixelWidth=null}}},{key:"transform",value:function transform(t,r,a,i,o,l){this.ctx.transform(t,r,a,i,o,l);this._cachedScaleForStroking[0]=-1;this._cachedGetSinglePixelWidth=null}},{key:"constructPath",value:function constructPath(t,r,a){for(var i,o,l=this.ctx,c=this.current,u=c.x,h=c.y,d=getCurrentTransform(l),p=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],v=p?a.slice(0):null,_=0,y=0,g=t.length;_<g;_++)switch(0|t[_]){case ee.rectangle:u=r[y++];h=r[y++];var m=r[y++],b=r[y++],w=u+m,P=h+b;l.moveTo(u,h);if(0===m||0===b)l.lineTo(w,P);else{l.lineTo(w,h);l.lineTo(w,P);l.lineTo(u,P)}p||c.updateRectMinMax(d,[u,h,w,P]);l.closePath();break;case ee.moveTo:u=r[y++];h=r[y++];l.moveTo(u,h);p||c.updatePathMinMax(d,u,h);break;case ee.lineTo:u=r[y++];h=r[y++];l.lineTo(u,h);p||c.updatePathMinMax(d,u,h);break;case ee.curveTo:i=u;o=h;u=r[y+4];h=r[y+5];l.bezierCurveTo(r[y],r[y+1],r[y+2],r[y+3],u,h);c.updateCurvePathMinMax(d,i,o,r[y],r[y+1],r[y+2],r[y+3],u,h,v);y+=6;break;case ee.curveTo2:i=u;o=h;l.bezierCurveTo(u,h,r[y],r[y+1],r[y+2],r[y+3]);c.updateCurvePathMinMax(d,i,o,u,h,r[y],r[y+1],r[y+2],r[y+3],v);u=r[y+2];h=r[y+3];y+=4;break;case ee.curveTo3:i=u;o=h;u=r[y+2];h=r[y+3];l.bezierCurveTo(r[y],r[y+1],u,h,u,h);c.updateCurvePathMinMax(d,i,o,r[y],r[y+1],u,h,u,h,v);y+=4;break;case ee.closePath:l.closePath()}p&&c.updateScalingPathMinMax(d,v);c.setCurrentPoint(u,h)}},{key:"closePath",value:function closePath(){this.ctx.closePath()}},{key:"stroke",value:function stroke(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.ctx,a=this.current.strokeColor;r.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"===canvas_typeof(a)&&null!=a&&a.getPattern){r.save();r.strokeStyle=a.getPattern(r,this,getCurrentTransformInverse(r),Ln);this.rescaleAndStroke(!1);r.restore()}else this.rescaleAndStroke(!0);t&&this.consumePath(this.current.getClippedPathBoundingBox());r.globalAlpha=this.current.fillAlpha}},{key:"closeStroke",value:function closeStroke(){this.closePath();this.stroke()}},{key:"fill",value:function fill(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.ctx,a=this.current.fillColor,i=!1;if(this.current.patternFill){r.save();r.fillStyle=a.getPattern(r,this,getCurrentTransformInverse(r),Rn);i=!0}var o=this.current.getClippedPathBoundingBox();if(this.contentVisible&&null!==o)if(this.pendingEOFill){r.fill("evenodd");this.pendingEOFill=!1}else r.fill();i&&r.restore();t&&this.consumePath(o)}},{key:"eoFill",value:function eoFill(){this.pendingEOFill=!0;this.fill()}},{key:"fillStroke",value:function fillStroke(){this.fill(!1);this.stroke(!1);this.consumePath()}},{key:"eoFillStroke",value:function eoFillStroke(){this.pendingEOFill=!0;this.fillStroke()}},{key:"closeFillStroke",value:function closeFillStroke(){this.closePath();this.fillStroke()}},{key:"closeEOFillStroke",value:function closeEOFillStroke(){this.pendingEOFill=!0;this.closePath();this.fillStroke()}},{key:"endPath",value:function endPath(){this.consumePath()}},{key:"clip",value:function clip(){this.pendingClip=Jn}},{key:"eoClip",value:function eoClip(){this.pendingClip=Qn}},{key:"beginText",value:function beginText(){this.current.textMatrix=i;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}},{key:"endText",value:function endText(){var t=this.pendingTextPaths,r=this.ctx;if(void 0!==t){r.save();r.beginPath();var a,i=canvas_createForOfIteratorHelper(t);try{for(i.s();!(a=i.n()).done;){var o=a.value;r.setTransform.apply(r,canvas_toConsumableArray(o.transform));r.translate(o.x,o.y);o.addToPath(r,o.fontSize)}}catch(t){i.e(t)}finally{i.f()}r.restore();r.clip();r.beginPath();delete this.pendingTextPaths}else r.beginPath()}},{key:"setCharSpacing",value:function setCharSpacing(t){this.current.charSpacing=t}},{key:"setWordSpacing",value:function setWordSpacing(t){this.current.wordSpacing=t}},{key:"setHScale",value:function setHScale(t){this.current.textHScale=t/100}},{key:"setLeading",value:function setLeading(t){this.current.leading=-t}},{key:"setFont",value:function setFont(t,r){var a,i=this.commonObjs.get(t),l=this.current;if(!i)throw new Error("Can't find font for ".concat(t));l.fontMatrix=i.fontMatrix||o;0!==l.fontMatrix[0]&&0!==l.fontMatrix[3]||warn("Invalid font matrix for font "+t);if(r<0){r=-r;l.fontDirection=-1}else l.fontDirection=1;this.current.font=i;this.current.fontSize=r;if(!i.isType3Font){var c=i.loadedName||"sans-serif",u=(null===(a=i.systemFontInfo)||void 0===a?void 0:a.css)||'"'.concat(c,'", ').concat(i.fallbackName),h="normal";i.black?h="900":i.bold&&(h="bold");var d=i.italic?"italic":"normal",p=r;r<16?p=16:r>100&&(p=100);this.current.fontSizeScale=r/p;this.ctx.font="".concat(d," ").concat(h," ").concat(p,"px ").concat(u)}}},{key:"setTextRenderingMode",value:function setTextRenderingMode(t){this.current.textRenderingMode=t}},{key:"setTextRise",value:function setTextRise(t){this.current.textRise=t}},{key:"moveText",value:function moveText(t,r){this.current.x=this.current.lineX+=t;this.current.y=this.current.lineY+=r}},{key:"setLeadingMoveText",value:function setLeadingMoveText(t,r){this.setLeading(-r);this.moveText(t,r)}},{key:"setTextMatrix",value:function setTextMatrix(t,r,a,i,o,l){this.current.textMatrix=[t,r,a,i,o,l];this.current.textMatrixScale=Math.hypot(t,r);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}},{key:"nextLine",value:function nextLine(){this.moveText(0,this.current.leading)}},{key:"paintChar",value:function paintChar(t,r,a,i){var o,l=this.ctx,c=this.current,u=c.font,h=c.textRenderingMode,d=c.fontSize/c.fontSizeScale,p=h&A,v=!!(h&x),_=c.patternFill&&!u.missingFile;(u.disableFontFace||v||_)&&(o=u.getPathGenerator(this.commonObjs,t));if(u.disableFontFace||_){l.save();l.translate(r,a);l.beginPath();o(l,d);i&&l.setTransform.apply(l,canvas_toConsumableArray(i));p!==w&&p!==k||l.fill();p!==P&&p!==k||l.stroke();l.restore()}else{p!==w&&p!==k||l.fillText(t,r,a);p!==P&&p!==k||l.strokeText(t,r,a)}if(v){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:getCurrentTransform(l),x:r,y:a,fontSize:d,addToPath:o})}}},{key:"isFontSubpixelAAEnabled",get:function get(){var t=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10).context;t.scale(1.5,1);t.fillText("I",0,10);for(var r=t.getImageData(0,0,10,10).data,a=!1,i=3;i<r.length;i+=4)if(r[i]>0&&r[i]<255){a=!0;break}return shadow(this,"isFontSubpixelAAEnabled",a)}},{key:"showText",value:function showText(t){var r=this.current,a=r.font;if(a.isType3Font)return this.showType3Text(t);var i=r.fontSize;if(0!==i){var o,l=this.ctx,c=r.fontSizeScale,u=r.charSpacing,h=r.wordSpacing,d=r.fontDirection,p=r.textHScale*d,v=t.length,_=a.vertical,y=_?1:-1,g=a.defaultVMetrics,m=i*r.fontMatrix[0],b=r.textRenderingMode===w&&!a.disableFontFace&&!r.patternFill;l.save();l.transform.apply(l,canvas_toConsumableArray(r.textMatrix));l.translate(r.x,r.y+r.textRise);d>0?l.scale(p,-1):l.scale(p,1);if(r.patternFill){l.save();var S=r.fillColor.getPattern(l,this,getCurrentTransformInverse(l),Rn);o=getCurrentTransform(l);l.restore();l.fillStyle=S}var x=r.lineWidth,E=r.textMatrixScale;if(0===E||0===x){var I=r.textRenderingMode&A;I!==P&&I!==k||(x=this.getSinglePixelWidth())}else x/=E;if(1!==c){l.scale(c,c);x/=c}l.lineWidth=x;if(a.isInvalidPDFjsFont){var T,C=[],M=0,G=canvas_createForOfIteratorHelper(t);try{for(G.s();!(T=G.n()).done;){var O=T.value;C.push(O.unicode);M+=O.width}}catch(t){G.e(t)}finally{G.f()}l.fillText(C.join(""),0,0);r.x+=M*m*p;l.restore();this.compose()}else{var R,L=0;for(R=0;R<v;++R){var D=t[R];if("number"!=typeof D){var j=!1,N=(D.isSpace?h:0)+u,W=D.fontChar,H=D.accent,B=void 0,z=void 0,U=D.width;if(_){var q=D.vmetric||g,V=-(D.vmetric?q[1]:.5*U)*m,K=q[2]*m;U=q?-q[0]:U;B=V/c;z=(L+K)/c}else{B=L/c;z=0}if(a.remeasure&&U>0){var Y=1e3*l.measureText(W).width/i*c;if(U<Y&&this.isFontSubpixelAAEnabled){var X=U/Y;j=!0;l.save();l.scale(X,1);B/=X}else U!==Y&&(B+=(U-Y)/2e3*i/c)}if(this.contentVisible&&(D.isInFont||a.missingFile))if(b&&!H)l.fillText(W,B,z);else{this.paintChar(W,B,z,o);if(H){var $=B+i*H.offset.x/c,J=z-i*H.offset.y/c;this.paintChar(H.fontChar,$,J,o)}}L+=_?U*m-N*d:U*m+N*d;j&&l.restore()}else L+=y*D*i/1e3}_?r.y-=L:r.x+=L*p;l.restore();this.compose()}}}},{key:"showType3Text",value:function showType3Text(t){var r,a,i,l,c=this.ctx,u=this.current,h=u.font,d=u.fontSize,p=u.fontDirection,v=h.vertical?1:-1,_=u.charSpacing,y=u.wordSpacing,g=u.textHScale*p,m=u.fontMatrix||o,b=t.length;if(!(u.textRenderingMode===S)&&0!==d){this._cachedScaleForStroking[0]=-1;this._cachedGetSinglePixelWidth=null;c.save();c.transform.apply(c,canvas_toConsumableArray(u.textMatrix));c.translate(u.x,u.y);c.scale(g,p);for(r=0;r<b;++r)if("number"!=typeof(a=t[r])){var w=(a.isSpace?y:0)+_,P=h.charProcOperatorList[a.operatorListId];if(P){if(this.contentVisible){this.processingType3=a;this.save();c.scale(d,d);c.transform.apply(c,canvas_toConsumableArray(m));this.executeOperatorList(P);this.restore()}i=fe.applyTransform([a.width,0],m)[0]*d+w;c.translate(i,0);u.x+=i*g}else warn('Type3 character "'.concat(a.operatorListId,'" is not available.'))}else{l=v*a*d/1e3;this.ctx.translate(l,0);u.x+=l*g}c.restore();this.processingType3=null}}},{key:"setCharWidth",value:function setCharWidth(t,r){}},{key:"setCharWidthAndBounds",value:function setCharWidthAndBounds(t,r,a,i,o,l){this.ctx.rect(a,i,o-a,l-i);this.ctx.clip();this.endPath()}},{key:"getColorN_Pattern",value:function getColorN_Pattern(t){var r,a=this;if("TilingPattern"===t[0]){var i=t[1],o=this.baseTransform||getCurrentTransform(this.ctx),l={createCanvasGraphics:function createCanvasGraphics(t){return new CanvasGraphics(t,a.commonObjs,a.objs,a.canvasFactory,a.filterFactory,{optionalContentConfig:a.optionalContentConfig,markedContentStack:a.markedContentStack})}};r=new Un(t,i,this.ctx,l,o)}else r=this._getPattern(t[1],t[2]);return r}},{key:"setStrokeColorN",value:function setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}},{key:"setFillColorN",value:function setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments);this.current.patternFill=!0}},{key:"setStrokeRGBColor",value:function setStrokeRGBColor(t,r,a){var i=fe.makeHexColor(t,r,a);this.ctx.strokeStyle=i;this.current.strokeColor=i}},{key:"setFillRGBColor",value:function setFillRGBColor(t,r,a){var i=fe.makeHexColor(t,r,a);this.ctx.fillStyle=i;this.current.fillColor=i;this.current.patternFill=!1}},{key:"_getPattern",value:function _getPattern(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.cachedPatterns.has(t))r=this.cachedPatterns.get(t);else{r=function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new Nn(t);case"Mesh":return new Wn(t);case"Dummy":return new Hn}throw new Error("Unknown IR type: ".concat(t[0]))}(this.getObject(t));this.cachedPatterns.set(t,r)}a&&(r.matrix=a);return r}},{key:"shadingFill",value:function shadingFill(t){if(this.contentVisible){var r=this.ctx;this.save();var a=this._getPattern(t);r.fillStyle=a.getPattern(r,this,getCurrentTransformInverse(r),Dn);var i=getCurrentTransformInverse(r);if(i){var o=r.canvas,l=o.width,c=o.height,u=canvas_slicedToArray(fe.getAxialAlignedBoundingBox([0,0,l,c],i),4),h=u[0],d=u[1],p=u[2],v=u[3];this.ctx.fillRect(h,d,p-h,v-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox());this.restore()}}},{key:"beginInlineImage",value:function beginInlineImage(){unreachable("Should not call beginInlineImage")}},{key:"beginImageData",value:function beginImageData(){unreachable("Should not call beginImageData")}},{key:"paintFormXObjectBegin",value:function paintFormXObjectBegin(t,r){if(this.contentVisible){this.save();this.baseTransformStack.push(this.baseTransform);Array.isArray(t)&&6===t.length&&this.transform.apply(this,canvas_toConsumableArray(t));this.baseTransform=getCurrentTransform(this.ctx);if(r){var a=r[2]-r[0],i=r[3]-r[1];this.ctx.rect(r[0],r[1],a,i);this.current.updateRectMinMax(getCurrentTransform(this.ctx),r);this.clip();this.endPath()}}}},{key:"paintFormXObjectEnd",value:function paintFormXObjectEnd(){if(this.contentVisible){this.restore();this.baseTransform=this.baseTransformStack.pop()}}},{key:"beginGroup",value:function beginGroup(t){if(this.contentVisible){this.save();if(this.inSMaskMode){this.endSMaskMode();this.current.activeSMask=null}var r=this.ctx;t.isolated||info("TODO: Support non-isolated groups.");t.knockout&&warn("Knockout groups not supported.");var a=getCurrentTransform(r);t.matrix&&r.transform.apply(r,canvas_toConsumableArray(t.matrix));if(!t.bbox)throw new Error("Bounding box is required.");var i=fe.getAxialAlignedBoundingBox(t.bbox,getCurrentTransform(r)),o=[0,0,r.canvas.width,r.canvas.height];i=fe.intersect(i,o)||[0,0,0,0];var l=Math.floor(i[0]),c=Math.floor(i[1]),u=Math.max(Math.ceil(i[2])-l,1),h=Math.max(Math.ceil(i[3])-c,1),d=1,p=1;if(u>qn){d=u/qn;u=qn}if(h>qn){p=h/qn;h=qn}this.current.startNewPathAndClipBox([0,0,u,h]);var v="groupAt"+this.groupLevel;t.smask&&(v+="_smask_"+this.smaskCounter++%2);var _=this.cachedCanvases.getCanvas(v,u,h),y=_.context;y.scale(1/d,1/p);y.translate(-l,-c);y.transform.apply(y,canvas_toConsumableArray(a));if(t.smask)this.smaskStack.push({canvas:_.canvas,context:y,offsetX:l,offsetY:c,scaleX:d,scaleY:p,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null});else{r.setTransform(1,0,0,1,0,0);r.translate(l,c);r.scale(d,p);r.save()}copyCtxState(r,y);this.ctx=y;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(r);this.groupLevel++}}},{key:"endGroup",value:function endGroup(t){if(this.contentVisible){this.groupLevel--;var r=this.ctx,a=this.groupStack.pop();this.ctx=a;this.ctx.imageSmoothingEnabled=!1;if(t.smask){this.tempSMask=this.smaskStack.pop();this.restore()}else{var i;this.ctx.restore();var o=getCurrentTransform(this.ctx);this.restore();this.ctx.save();(i=this.ctx).setTransform.apply(i,canvas_toConsumableArray(o));var l=fe.getAxialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],o);this.ctx.drawImage(r.canvas,0,0);this.ctx.restore();this.compose(l)}}}},{key:"beginAnnotation",value:function beginAnnotation(t,r,a,i,o){canvas_classPrivateMethodGet(this,Zn,_restoreInitialState2).call(this);resetCtxToDefault(this.ctx);this.ctx.save();this.save();if(this.baseTransform){var l;(l=this.ctx).setTransform.apply(l,canvas_toConsumableArray(this.baseTransform))}if(Array.isArray(r)&&4===r.length){var c=r[2]-r[0],u=r[3]-r[1];if(o&&this.annotationCanvasMap){(a=a.slice())[4]-=r[0];a[5]-=r[1];(r=r.slice())[0]=r[1]=0;r[2]=c;r[3]=u;var h=canvas_slicedToArray(fe.singularValueDecompose2dScale(getCurrentTransform(this.ctx)),2),d=h[0],p=h[1],v=this.viewportScale,_=Math.ceil(c*this.outputScaleX*v),y=Math.ceil(u*this.outputScaleY*v);this.annotationCanvas=this.canvasFactory.create(_,y);var g=this.annotationCanvas,m=g.canvas,b=g.context;this.annotationCanvasMap.set(t,m);this.annotationCanvas.savedCtx=this.ctx;this.ctx=b;this.ctx.save();this.ctx.setTransform(d,0,0,-p,0,u*p);resetCtxToDefault(this.ctx)}else{resetCtxToDefault(this.ctx);this.ctx.rect(r[0],r[1],c,u);this.ctx.clip();this.endPath()}}this.current=new Yn(this.ctx.canvas.width,this.ctx.canvas.height);this.transform.apply(this,canvas_toConsumableArray(a));this.transform.apply(this,canvas_toConsumableArray(i))}},{key:"endAnnotation",value:function endAnnotation(){if(this.annotationCanvas){this.ctx.restore();canvas_classPrivateMethodGet(this,ea,_drawFilter2).call(this);this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}}},{key:"paintImageMaskXObject",value:function paintImageMaskXObject(t){if(this.contentVisible){var r=t.count;(t=this.getObject(t.data,t)).count=r;var a=this.ctx,i=this.processingType3;if(i){void 0===i.compiled&&(i.compiled=function compileType3Glyph(t){var r=t.width,a=t.height;if(r>1e3||a>1e3)return null;var i,o,l,c,u=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),h=r+1,d=new Uint8Array(h*(a+1)),p=r+7&-8,v=new Uint8Array(p*a),_=0,y=canvas_createForOfIteratorHelper(t.data);try{for(y.s();!(c=y.n()).done;)for(var g=c.value,m=128;m>0;){v[_++]=g&m?0:255;m>>=1}}catch(t){y.e(t)}finally{y.f()}var b=0;if(0!==v[_=0]){d[0]=1;++b}for(o=1;o<r;o++){if(v[_]!==v[_+1]){d[o]=v[_]?2:1;++b}_++}if(0!==v[_]){d[o]=2;++b}for(i=1;i<a;i++){l=i*h;if(v[(_=i*p)-p]!==v[_]){d[l]=v[_]?1:8;++b}var w=(v[_]?4:0)+(v[_-p]?8:0);for(o=1;o<r;o++){if(u[w=(w>>2)+(v[_+1]?4:0)+(v[_-p+1]?8:0)]){d[l+o]=u[w];++b}_++}if(v[_-p]!==v[_]){d[l+o]=v[_]?2:4;++b}if(b>1e3)return null}l=i*h;if(0!==v[_=p*(a-1)]){d[l]=8;++b}for(o=1;o<r;o++){if(v[_]!==v[_+1]){d[l+o]=v[_]?4:8;++b}_++}if(0!==v[_]){d[l+o]=4;++b}if(b>1e3)return null;var P=new Int32Array([0,h,-1,0,-h,0,0,0,1]),k=new Path2D;for(i=0;b&&i<=a;i++){for(var S=i*h,A=S+r;S<A&&!d[S];)S++;if(S!==A){k.moveTo(S%h,i);var x=S,E=d[S];do{var I=P[E];do{S+=I}while(!d[S]);var T=d[S];if(5!==T&&10!==T){E=T;d[S]=0}else{E=T&51*E>>4;d[S]&=E>>2|E<<2}k.lineTo(S%h,S/h|0);d[S]||--b}while(x!==S);--i}}v=null;d=null;return function drawOutline(t){t.save();t.scale(1/r,-1/a);t.translate(0,-a);t.fill(k);t.beginPath();t.restore()}}(t));if(i.compiled){i.compiled(a);return}}var o=this._createMaskCanvas(t),l=o.canvas;a.save();a.setTransform(1,0,0,1,0,0);a.drawImage(l,o.offsetX,o.offsetY);a.restore();this.compose()}}},{key:"paintImageMaskXObjectRepeat",value:function paintImageMaskXObjectRepeat(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,l=arguments.length>5?arguments[5]:void 0;if(this.contentVisible){t=this.getObject(t.data,t);var c=this.ctx;c.save();var u=getCurrentTransform(c);c.transform(r,a,i,o,0,0);var h=this._createMaskCanvas(t);c.setTransform(1,0,0,1,h.offsetX-u[4],h.offsetY-u[5]);for(var d=0,p=l.length;d<p;d+=2){var v=fe.transform(u,[r,a,i,o,l[d],l[d+1]]),_=canvas_slicedToArray(fe.applyTransform([0,0],v),2),y=_[0],g=_[1];c.drawImage(h.canvas,y,g)}c.restore();this.compose()}}},{key:"paintImageMaskXObjectGroup",value:function paintImageMaskXObjectGroup(t){if(this.contentVisible){var r,a=this.ctx,i=this.current.fillColor,o=this.current.patternFill,l=canvas_createForOfIteratorHelper(t);try{for(l.s();!(r=l.n()).done;){var c=r.value,u=c.data,h=c.width,d=c.height,p=c.transform,v=this.cachedCanvases.getCanvas("maskCanvas",h,d),_=v.context;_.save();putBinaryImageMask(_,this.getObject(u,c));_.globalCompositeOperation="source-in";_.fillStyle=o?i.getPattern(_,this,getCurrentTransformInverse(a),Rn):i;_.fillRect(0,0,h,d);_.restore();a.save();a.transform.apply(a,canvas_toConsumableArray(p));a.scale(1,-1);drawImageAtIntegerCoords(a,v.canvas,0,0,h,d,0,-1,1,1);a.restore()}}catch(t){l.e(t)}finally{l.f()}this.compose()}}},{key:"paintImageXObject",value:function paintImageXObject(t){if(this.contentVisible){var r=this.getObject(t);r?this.paintInlineImageXObject(r):warn("Dependent image isn't ready yet")}}},{key:"paintImageXObjectRepeat",value:function paintImageXObjectRepeat(t,r,a,i){if(this.contentVisible){var o=this.getObject(t);if(o){for(var l=o.width,c=o.height,u=[],h=0,d=i.length;h<d;h+=2)u.push({transform:[r,0,0,a,i[h],i[h+1]],x:0,y:0,w:l,h:c});this.paintInlineImageXObjectGroup(o,u)}else warn("Dependent image isn't ready yet")}}},{key:"applyTransferMapsToCanvas",value:function applyTransferMapsToCanvas(t){if("none"!==this.current.transferMaps){t.filter=this.current.transferMaps;t.drawImage(t.canvas,0,0);t.filter="none"}return t.canvas}},{key:"applyTransferMapsToBitmap",value:function applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;var r=t.bitmap,a=t.width,i=t.height,o=this.cachedCanvases.getCanvas("inlineImage",a,i),l=o.context;l.filter=this.current.transferMaps;l.drawImage(r,0,0);l.filter="none";return o.canvas}},{key:"paintInlineImageXObject",value:function paintInlineImageXObject(t){if(this.contentVisible){var a,i=t.width,o=t.height,l=this.ctx;this.save();if(!r){var c=l.filter;"none"!==c&&""!==c&&(l.filter="none")}l.scale(1/i,-1/o);if(t.bitmap)a=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)a=t;else{var u=this.cachedCanvases.getCanvas("inlineImage",i,o).context;putBinaryImageData(u,t);a=this.applyTransferMapsToCanvas(u)}var h=this._scaleImage(a,getCurrentTransformInverse(l));l.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(l),t.interpolate);drawImageAtIntegerCoords(l,h.img,0,0,h.paintWidth,h.paintHeight,0,-o,i,o);this.compose();this.restore()}}},{key:"paintInlineImageXObjectGroup",value:function paintInlineImageXObjectGroup(t,r){if(this.contentVisible){var a,i=this.ctx;if(t.bitmap)a=t.bitmap;else{var o=t.width,l=t.height,c=this.cachedCanvases.getCanvas("inlineImage",o,l).context;putBinaryImageData(c,t);a=this.applyTransferMapsToCanvas(c)}var u,h=canvas_createForOfIteratorHelper(r);try{for(h.s();!(u=h.n()).done;){var d=u.value;i.save();i.transform.apply(i,canvas_toConsumableArray(d.transform));i.scale(1,-1);drawImageAtIntegerCoords(i,a,d.x,d.y,d.w,d.h,0,-1,1,1);i.restore()}}catch(t){h.e(t)}finally{h.f()}this.compose()}}},{key:"paintSolidColorImageMask",value:function paintSolidColorImageMask(){if(this.contentVisible){this.ctx.fillRect(0,0,1,1);this.compose()}}},{key:"markPoint",value:function markPoint(t){}},{key:"markPointProps",value:function markPointProps(t,r){}},{key:"beginMarkedContent",value:function beginMarkedContent(t){this.markedContentStack.push({visible:!0})}},{key:"beginMarkedContentProps",value:function beginMarkedContentProps(t,r){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0});this.contentVisible=this.isContentVisible()}},{key:"endMarkedContent",value:function endMarkedContent(){this.markedContentStack.pop();this.contentVisible=this.isContentVisible()}},{key:"beginCompat",value:function beginCompat(){}},{key:"endCompat",value:function endCompat(){}},{key:"consumePath",value:function consumePath(t){var r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath();this.pendingClip||this.compose(t);var a=this.ctx;if(this.pendingClip){r||(this.pendingClip===Qn?a.clip("evenodd"):a.clip());this.pendingClip=null}this.current.startNewPathAndClipBox(this.current.clipBox);a.beginPath()}},{key:"getSinglePixelWidth",value:function getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){var t=getCurrentTransform(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{var r=Math.abs(t[0]*t[3]-t[2]*t[1]),a=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(a,i)/r}}return this._cachedGetSinglePixelWidth}},{key:"getScaleForStroking",value:function getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){var t,r,a=this.current.lineWidth,i=this.ctx.getTransform(),o=i.a,l=i.b,c=i.c,u=i.d;if(0===l&&0===c){var h=Math.abs(o),d=Math.abs(u);if(h===d)if(0===a)t=r=1/h;else{var p=h*a;t=r=p<1?1/p:1}else if(0===a){t=1/h;r=1/d}else{var v=h*a,_=d*a;t=v<1?1/v:1;r=_<1?1/_:1}}else{var y=Math.abs(o*u-l*c),g=Math.hypot(o,l),m=Math.hypot(c,u);if(0===a){t=m/y;r=g/y}else{var b=a*y;t=m>b?m/b:1;r=g>b?g/b:1}}this._cachedScaleForStroking[0]=t;this._cachedScaleForStroking[1]=r}return this._cachedScaleForStroking}},{key:"rescaleAndStroke",value:function rescaleAndStroke(t){var r=this.ctx,a=this.current.lineWidth,i=canvas_slicedToArray(this.getScaleForStroking(),2),o=i[0],l=i[1];r.lineWidth=a||1;if(1!==o||1!==l){var c=r.getLineDash();t&&r.save();r.scale(o,l);if(c.length>0){var u=Math.max(o,l);r.setLineDash(c.map((function(t){return t/u})));r.lineDashOffset/=u}r.stroke();t&&r.restore()}else r.stroke()}},{key:"isContentVisible",value:function isContentVisible(){for(var t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}]);return CanvasGraphics}();function _restoreInitialState2(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore();if(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 _drawFilter2(){if(this.pageColors){var t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){var r=this.ctx.filter;this.ctx.filter=t;this.ctx.drawImage(this.ctx.canvas,0,0);this.ctx.filter=r}}}for(var ra in ee)void 0!==ta.prototype[ra]&&(ta.prototype[ee[ra]]=ta.prototype[ra]);function text_layer_typeof(t){return text_layer_typeof="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},text_layer_typeof(t)}function text_layer_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,text_layer_toPropertyKey(i.key),i)}}function text_layer_toPropertyKey(t){var r=function text_layer_toPrimitive(t,r){if("object"!=text_layer_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=text_layer_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==text_layer_typeof(r)?r:String(r)}function text_layer_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function text_layer_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return text_layer_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return text_layer_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function text_layer_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}var na=30,aa=.8,ia=new Map,oa=null;function getCtx(){if(!oa){var t=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0,alpha:!1}:{alpha:!1},r=document.createElement("canvas");r.className="hiddenCanvasElement";document.body.append(r);oa=r.getContext("2d",t)}return oa}function cleanupTextLayer(){var t;null===(t=oa)||void 0===t||t.canvas.remove();oa=null}function appendText(t,r,a){var i=document.createElement("span"),o={angle:0,canvasWidth:0,hasText:""!==r.str,hasEOL:r.hasEOL,fontSize:0};t._textDivs.push(i);var l=fe.transform(t._transform,r.transform),c=Math.atan2(l[1],l[0]),u=a[r.fontName];u.vertical&&(c+=Math.PI/2);var h,d,p=t._fontInspectorEnabled&&u.fontSubstitution||u.fontFamily,v=Math.hypot(l[2],l[3]),_=v*function getAscent(t){var r=ia.get(t);if(r)return r;var a=getCtx(),i=a.font;a.canvas.width=a.canvas.height=na;a.font="".concat(na,"px ").concat(t);var o=a.measureText(""),l=null==o?void 0:o.fontBoundingBoxAscent,c=Math.abs(null==o?void 0:o.fontBoundingBoxDescent);if(l){var u=l/(l+c);ia.set(t,u);a.canvas.width=a.canvas.height=0;a.font=i;return u}a.strokeStyle="red";a.clearRect(0,0,na,na);a.strokeText("g",0,0);var h=a.getImageData(0,0,na,na).data;c=0;for(var d=h.length-1-3;d>=0;d-=4)if(h[d]>0){c=Math.ceil(d/4/na);break}a.clearRect(0,0,na,na);a.strokeText("A",0,na);l=0;for(var p=0,v=(h=a.getImageData(0,0,na,na).data).length;p<v;p+=4)if(h[p]>0){l=na-Math.floor(p/4/na);break}a.canvas.width=a.canvas.height=0;a.font=i;if(l){var _=l/(l+c);ia.set(t,_);return _}ia.set(t,aa);return aa}(p);if(0===c){h=l[4];d=l[5]-_}else{h=l[4]+_*Math.sin(c);d=l[5]-_*Math.cos(c)}var y="calc(var(--scale-factor)*",g=i.style;if(t._container===t._rootContainer){g.left="".concat((100*h/t._pageWidth).toFixed(2),"%");g.top="".concat((100*d/t._pageHeight).toFixed(2),"%")}else{g.left="".concat(y).concat(h.toFixed(2),"px)");g.top="".concat(y).concat(d.toFixed(2),"px)")}g.fontSize="".concat(y).concat(v.toFixed(2),"px)");g.fontFamily=p;o.fontSize=v;i.setAttribute("role","presentation");i.textContent=r.str;i.dir=r.dir;t._fontInspectorEnabled&&(i.dataset.fontName=u.fontSubstitutionLoadedName||r.fontName);0!==c&&(o.angle=c*(180/Math.PI));var m=!1;if(r.str.length>1)m=!0;else if(" "!==r.str&&r.transform[0]!==r.transform[3]){var b=Math.abs(r.transform[0]),w=Math.abs(r.transform[3]);b!==w&&Math.max(b,w)/Math.min(b,w)>1.5&&(m=!0)}m&&(o.canvasWidth=u.vertical?r.height:r.width);t._textDivProperties.set(i,o);t._isReadableStream&&t._layoutText(i)}function layout(t){var r=t.div,a=t.scale,i=t.properties,o=t.ctx,l=t.prevFontSize,c=t.prevFontFamily,u=r.style,h="";if(0!==i.canvasWidth&&i.hasText){var d=u.fontFamily,p=i.canvasWidth,v=i.fontSize;if(l!==v||c!==d){o.font="".concat(v*a,"px ").concat(d);t.prevFontSize=v;t.prevFontFamily=d}try{var _=o.measureText(r.textContent).width;_>0&&(h="scaleX(".concat(p*a/_,")"))}catch(t){}}0!==i.angle&&(h="rotate(".concat(i.angle,"deg) ").concat(h));h.length>0&&(u.transform=h)}var sa=function(){function TextLayerRenderTask(t){var r,a=this,i=t.textContentSource,o=t.container,l=t.viewport,c=t.textDivs,u=t.textDivProperties,h=t.textContentItemsStr;!function text_layer_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,TextLayerRenderTask);this._textContentSource=i;this._isReadableStream=i instanceof ReadableStream;this._container=this._rootContainer=o;this._textDivs=c||[];this._textContentItemsStr=h||[];this._fontInspectorEnabled=!(null===(r=globalThis.FontInspector)||void 0===r||!r.enabled);this._reader=null;this._textDivProperties=u||new WeakMap;this._canceled=!1;this._capability=new ve;this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:l.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:getCtx()};var d=l.rawDims,p=d.pageWidth,v=d.pageHeight,_=d.pageX,y=d.pageY;this._transform=[1,0,0,-1,-_,y+v];this._pageWidth=p;this._pageHeight=v;setLayerDimensions(o,l);this._capability.promise.finally((function(){a._layoutTextParams=null})).catch((function(){}))}!function text_layer_createClass(t,r,a){r&&text_layer_defineProperties(t.prototype,r);a&&text_layer_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(TextLayerRenderTask,[{key:"promise",get:function get(){return this._capability.promise}},{key:"cancel",value:function cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new ue("TextLayer task cancelled.")).catch((function(){}));this._reader=null}this._capability.reject(new ue("TextLayer task cancelled."))}},{key:"_processItems",value:function _processItems(t,r){var a,i=text_layer_createForOfIteratorHelper(t);try{for(i.s();!(a=i.n()).done;){var o=a.value;if(void 0!==o.str){this._textContentItemsStr.push(o.str);appendText(this,o,r)}else if("beginMarkedContentProps"===o.type||"beginMarkedContent"===o.type){var l=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");null!==o.id&&this._container.setAttribute("id","".concat(o.id));l.append(this._container)}else"endMarkedContent"===o.type&&(this._container=this._container.parentNode)}}catch(t){i.e(t)}finally{i.f()}}},{key:"_layoutText",value:function _layoutText(t){var r=this._layoutTextParams.properties=this._textDivProperties.get(t);this._layoutTextParams.div=t;layout(this._layoutTextParams);r.hasText&&this._container.append(t);if(r.hasEOL){var a=document.createElement("br");a.setAttribute("role","presentation");this._container.append(a)}}},{key:"_render",value:function _render(){var t=this,r=new ve,a=Object.create(null);if(this._isReadableStream){this._reader=this._textContentSource.getReader();!function pump(){t._reader.read().then((function(i){var o=i.value;if(i.done)r.resolve();else{Object.assign(a,o.styles);t._processItems(o.items,a);pump()}}),r.reject)}()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');var i=this._textContentSource,o=i.items,l=i.styles;this._processItems(o,l);r.resolve()}r.promise.then((function(){a=null;!function render(t){if(!t._canceled){var r=t._textDivs,a=t._capability;if(r.length>1e5)a.resolve();else{if(!t._isReadableStream){var i,o=text_layer_createForOfIteratorHelper(r);try{for(o.s();!(i=o.n()).done;){var l=i.value;t._layoutText(l)}}catch(t){o.e(t)}finally{o.f()}}a.resolve()}}}(t)}),this._capability.reject)}}]);return TextLayerRenderTask}();function renderTextLayer(t){var r=new sa(t);r._render();return r}function updateTextLayer(t){var r=t.container,a=t.viewport,i=t.textDivs,o=t.textDivProperties,l=t.mustRotate,c=void 0===l||l,u=t.mustRescale,h=void 0===u||u;c&&setLayerDimensions(r,{rotation:a.rotation});if(h){var d,p=getCtx(),v={prevFontSize:null,prevFontFamily:null,div:null,scale:a.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:p},_=text_layer_createForOfIteratorHelper(i);try{for(_.s();!(d=_.n()).done;){var y=d.value;v.properties=o.get(y);v.div=y;layout(v)}}catch(t){_.e(t)}finally{_.f()}}}function worker_options_typeof(t){return worker_options_typeof="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},worker_options_typeof(t)}function worker_options_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,worker_options_toPropertyKey(i.key),i)}}function worker_options_toPropertyKey(t){var r=function worker_options_toPrimitive(t,r){if("object"!=worker_options_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=worker_options_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==worker_options_typeof(r)?r:String(r)}function _classStaticPrivateFieldSpecSet(t,r,a,i){worker_options_classCheckPrivateStaticAccess(t,r);_classCheckPrivateStaticFieldDescriptor(a,"set");!function worker_options_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,a,i);return i}function _classStaticPrivateFieldSpecGet(t,r,a){worker_options_classCheckPrivateStaticAccess(t,r);_classCheckPrivateStaticFieldDescriptor(a,"get");return function worker_options_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,a)}function _classCheckPrivateStaticFieldDescriptor(t,r){if(void 0===t)throw new TypeError("attempted to "+r+" private static field before its declaration")}function worker_options_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}var la=function(){function GlobalWorkerOptions(){!function worker_options_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,GlobalWorkerOptions)}!function worker_options_createClass(t,r,a){r&&worker_options_defineProperties(t.prototype,r);a&&worker_options_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(GlobalWorkerOptions,null,[{key:"workerPort",get:function get(){return _classStaticPrivateFieldSpecGet(this,GlobalWorkerOptions,ca)},set:function set(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");_classStaticPrivateFieldSpecSet(this,GlobalWorkerOptions,ca,t)}},{key:"workerSrc",get:function get(){return _classStaticPrivateFieldSpecGet(this,GlobalWorkerOptions,ua)},set:function set(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");_classStaticPrivateFieldSpecSet(this,GlobalWorkerOptions,ua,t)}}]);return GlobalWorkerOptions}(),ca={writable:!0,value:null},ua={writable:!0,value:""};__webpack_require__(1195);function message_handler_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */message_handler_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==message_handler_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(message_handler_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function message_handler_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function message_handler_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,message_handler_toPropertyKey(i.key),i)}}function message_handler_toPropertyKey(t){var r=function message_handler_toPrimitive(t,r){if("object"!=message_handler_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=message_handler_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==message_handler_typeof(r)?r:String(r)}function message_handler_classPrivateMethodInitSpec(t,r){!function message_handler_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,r);r.add(t)}function message_handler_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function message_handler_typeof(t){return message_handler_typeof="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},message_handler_typeof(t)}var ha=1,da=2,fa=1,pa=2,va=3,_a=4,ya=5,ga=6,ma=7,ba=8;function wrapReason(t){t instanceof Error||"object"===message_handler_typeof(t)&&null!==t||unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new ue(t.message);case"MissingPDFException":return new se(t.message);case"PasswordException":return new ae(t.message,t.code);case"UnexpectedResponseException":return new le(t.message,t.status);case"UnknownErrorException":return new ie(t.message,t.details);default:return new ie(t.message,t.toString())}}var wa=new WeakSet,Pa=new WeakSet,ka=new WeakSet,Sa=function(){function MessageHandler(t,r,a){var i=this;!function message_handler_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,MessageHandler);message_handler_classPrivateMethodInitSpec(this,ka);message_handler_classPrivateMethodInitSpec(this,Pa);message_handler_classPrivateMethodInitSpec(this,wa);this.sourceName=t;this.targetName=r;this.comObj=a;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=function(t){var r=t.data;if(r.targetName===i.sourceName)if(r.stream)message_handler_classPrivateMethodGet(i,Pa,_processStreamMessage2).call(i,r);else if(r.callback){var o=r.callbackId,l=i.callbackCapabilities[o];if(!l)throw new Error("Cannot resolve callback ".concat(o));delete i.callbackCapabilities[o];if(r.callback===ha)l.resolve(r.data);else{if(r.callback!==da)throw new Error("Unexpected callback case");l.reject(wrapReason(r.reason))}}else{var c=i.actionHandler[r.action];if(!c)throw new Error("Unknown action from worker: ".concat(r.action));if(r.callbackId){var u=i.sourceName,h=r.sourceName;new Promise((function(t){t(c(r.data))})).then((function(t){a.postMessage({sourceName:u,targetName:h,callback:ha,callbackId:r.callbackId,data:t})}),(function(t){a.postMessage({sourceName:u,targetName:h,callback:da,callbackId:r.callbackId,reason:wrapReason(t)})}))}else r.streamId?message_handler_classPrivateMethodGet(i,wa,_createStreamSink2).call(i,r):c(r.data)}};a.addEventListener("message",this._onComObjOnMessage)}!function message_handler_createClass(t,r,a){r&&message_handler_defineProperties(t.prototype,r);a&&message_handler_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(MessageHandler,[{key:"on",value:function on(t,r){var a=this.actionHandler;if(a[t])throw new Error('There is already an actionName called "'.concat(t,'"'));a[t]=r}},{key:"send",value:function send(t,r,a){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:r},a)}},{key:"sendWithPromise",value:function sendWithPromise(t,r,a){var i=this.callbackId++,o=new ve;this.callbackCapabilities[i]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:r},a)}catch(t){o.reject(t)}return o.promise}},{key:"sendWithStream",value:function sendWithStream(t,r,a,i){var o=this,l=this.streamId++,c=this.sourceName,u=this.targetName,h=this.comObj;return new ReadableStream({start:function start(a){var d=new ve;o.streamControllers[l]={controller:a,startCall:d,pullCall:null,cancelCall:null,isClosed:!1};h.postMessage({sourceName:c,targetName:u,action:t,streamId:l,data:r,desiredSize:a.desiredSize},i);return d.promise},pull:function pull(t){var r=new ve;o.streamControllers[l].pullCall=r;h.postMessage({sourceName:c,targetName:u,stream:ga,streamId:l,desiredSize:t.desiredSize});return r.promise},cancel:function cancel(t){assert(t instanceof Error,"cancel must have a valid reason");var r=new ve;o.streamControllers[l].cancelCall=r;o.streamControllers[l].isClosed=!0;h.postMessage({sourceName:c,targetName:u,stream:fa,streamId:l,reason:wrapReason(t)});return r.promise}},a)}},{key:"destroy",value:function destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}]);return MessageHandler}();function _createStreamSink2(t){var r=t.streamId,a=this.sourceName,i=t.sourceName,o=this.comObj,l=this,c=this.actionHandler[t.action],u={enqueue:function enqueue(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,c=arguments.length>2?arguments[2]:void 0;if(!this.isCancelled){var u=this.desiredSize;this.desiredSize-=l;if(u>0&&this.desiredSize<=0){this.sinkCapability=new ve;this.ready=this.sinkCapability.promise}o.postMessage({sourceName:a,targetName:i,stream:_a,streamId:r,chunk:t},c)}},close:function close(){if(!this.isCancelled){this.isCancelled=!0;o.postMessage({sourceName:a,targetName:i,stream:va,streamId:r});delete l.streamSinks[r]}},error:function error(t){assert(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;o.postMessage({sourceName:a,targetName:i,stream:ya,streamId:r,reason:wrapReason(t)})}},sinkCapability:new ve,onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};u.sinkCapability.resolve();u.ready=u.sinkCapability.promise;this.streamSinks[r]=u;new Promise((function(r){r(c(t.data,u))})).then((function(){o.postMessage({sourceName:a,targetName:i,stream:ba,streamId:r,success:!0})}),(function(t){o.postMessage({sourceName:a,targetName:i,stream:ba,streamId:r,reason:wrapReason(t)})}))}function _processStreamMessage2(t){var r=t.streamId,a=this.sourceName,i=t.sourceName,o=this.comObj,l=this.streamControllers[r],c=this.streamSinks[r];switch(t.stream){case ba:t.success?l.startCall.resolve():l.startCall.reject(wrapReason(t.reason));break;case ma:t.success?l.pullCall.resolve():l.pullCall.reject(wrapReason(t.reason));break;case ga:if(!c){o.postMessage({sourceName:a,targetName:i,stream:ma,streamId:r,success:!0});break}c.desiredSize<=0&&t.desiredSize>0&&c.sinkCapability.resolve();c.desiredSize=t.desiredSize;new Promise((function(t){var r;t(null===(r=c.onPull)||void 0===r?void 0:r.call(c))})).then((function(){o.postMessage({sourceName:a,targetName:i,stream:ma,streamId:r,success:!0})}),(function(t){o.postMessage({sourceName:a,targetName:i,stream:ma,streamId:r,reason:wrapReason(t)})}));break;case _a:assert(l,"enqueue should have stream controller");if(l.isClosed)break;l.controller.enqueue(t.chunk);break;case va:assert(l,"close should have stream controller");if(l.isClosed)break;l.isClosed=!0;l.controller.close();message_handler_classPrivateMethodGet(this,ka,_deleteStreamController2).call(this,l,r);break;case ya:assert(l,"error should have stream controller");l.controller.error(wrapReason(t.reason));message_handler_classPrivateMethodGet(this,ka,_deleteStreamController2).call(this,l,r);break;case pa:t.success?l.cancelCall.resolve():l.cancelCall.reject(wrapReason(t.reason));message_handler_classPrivateMethodGet(this,ka,_deleteStreamController2).call(this,l,r);break;case fa:if(!c)break;new Promise((function(r){var a;r(null===(a=c.onCancel)||void 0===a?void 0:a.call(c,wrapReason(t.reason)))})).then((function(){o.postMessage({sourceName:a,targetName:i,stream:pa,streamId:r,success:!0})}),(function(t){o.postMessage({sourceName:a,targetName:i,stream:pa,streamId:r,reason:wrapReason(t)})}));c.sinkCapability.reject(wrapReason(t.reason));c.isCancelled=!0;delete this.streamSinks[r];break;default:throw new Error("Unexpected stream case")}}function _deleteStreamController2(t,r){return _deleteStreamController3.apply(this,arguments)}function _deleteStreamController3(){_deleteStreamController3=function message_handler_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){message_handler_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){message_handler_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}(message_handler_regeneratorRuntime().mark((function _callee(t,r){var a,i,o;return message_handler_regeneratorRuntime().wrap((function _callee$(l){for(;;)switch(l.prev=l.next){case 0:l.next=2;return Promise.allSettled([null===(a=t.startCall)||void 0===a?void 0:a.promise,null===(i=t.pullCall)||void 0===i?void 0:i.promise,null===(o=t.cancelCall)||void 0===o?void 0:o.promise]);case 2:delete this.streamControllers[r];case 3:case"end":return l.stop()}}),_callee,this)})));return _deleteStreamController3.apply(this,arguments)}function metadata_typeof(t){return metadata_typeof="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},metadata_typeof(t)}function metadata_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,metadata_toPropertyKey(i.key),i)}}function metadata_toPropertyKey(t){var r=function metadata_toPrimitive(t,r){if("object"!=metadata_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=metadata_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==metadata_typeof(r)?r:String(r)}function metadata_classPrivateFieldInitSpec(t,r,a){!function metadata_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,r);r.set(t,a)}function metadata_classPrivateFieldGet(t,r){return function metadata_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,metadata_classExtractFieldDescriptor(t,r,"get"))}function metadata_classPrivateFieldSet(t,r,a){!function metadata_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,metadata_classExtractFieldDescriptor(t,r,"set"),a);return a}function metadata_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var Fa=new WeakMap,Aa=new WeakMap,xa=function(){function Metadata(t){var r=t.parsedData,a=t.rawData;!function metadata_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,Metadata);metadata_classPrivateFieldInitSpec(this,Fa,{writable:!0,value:void 0});metadata_classPrivateFieldInitSpec(this,Aa,{writable:!0,value:void 0});metadata_classPrivateFieldSet(this,Fa,r);metadata_classPrivateFieldSet(this,Aa,a)}!function metadata_createClass(t,r,a){r&&metadata_defineProperties(t.prototype,r);a&&metadata_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(Metadata,[{key:"getRaw",value:function getRaw(){return metadata_classPrivateFieldGet(this,Aa)}},{key:"get",value:function get(t){var r;return null!==(r=metadata_classPrivateFieldGet(this,Fa).get(t))&&void 0!==r?r:null}},{key:"getAll",value:function getAll(){return objectFromMap(metadata_classPrivateFieldGet(this,Fa))}},{key:"has",value:function has(t){return metadata_classPrivateFieldGet(this,Fa).has(t)}}]);return Metadata}();function optional_content_config_typeof(t){return optional_content_config_typeof="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},optional_content_config_typeof(t)}function optional_content_config_slicedToArray(t,r){return function optional_content_config_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function optional_content_config_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||optional_content_config_unsupportedIterableToArray(t,r)||function optional_content_config_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function optional_content_config_toConsumableArray(t){return function optional_content_config_arrayWithoutHoles(t){if(Array.isArray(t))return optional_content_config_arrayLikeToArray(t)}(t)||function optional_content_config_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||optional_content_config_unsupportedIterableToArray(t)||function optional_content_config_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function optional_content_config_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=optional_content_config_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function optional_content_config_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return optional_content_config_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?optional_content_config_arrayLikeToArray(t,r):void 0}}function optional_content_config_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function optional_content_config_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function optional_content_config_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function optional_content_config_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,optional_content_config_toPropertyKey(i.key),i)}}function optional_content_config_createClass(t,r,a){r&&optional_content_config_defineProperties(t.prototype,r);a&&optional_content_config_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function optional_content_config_toPropertyKey(t){var r=function optional_content_config_toPrimitive(t,r){if("object"!=optional_content_config_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=optional_content_config_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==optional_content_config_typeof(r)?r:String(r)}function optional_content_config_classPrivateFieldInitSpec(t,r,a){optional_content_config_checkPrivateRedeclaration(t,r);r.set(t,a)}function optional_content_config_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function optional_content_config_classPrivateFieldSet(t,r,a){!function optional_content_config_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,optional_content_config_classExtractFieldDescriptor(t,r,"set"),a);return a}function optional_content_config_classPrivateFieldGet(t,r){return function optional_content_config_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,optional_content_config_classExtractFieldDescriptor(t,r,"get"))}function optional_content_config_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var Ea=Symbol("INTERNAL"),Ia=new WeakMap,Ta=function(){function OptionalContentGroup(t,r){optional_content_config_classCallCheck(this,OptionalContentGroup);optional_content_config_classPrivateFieldInitSpec(this,Ia,{writable:!0,value:!0});this.name=t;this.intent=r}optional_content_config_createClass(OptionalContentGroup,[{key:"visible",get:function get(){return optional_content_config_classPrivateFieldGet(this,Ia)}},{key:"_setVisible",value:function _setVisible(t,r){t!==Ea&&unreachable("Internal method `_setVisible` called.");optional_content_config_classPrivateFieldSet(this,Ia,r)}}]);return OptionalContentGroup}(),Ca=new WeakMap,Ma=new WeakMap,Ga=new WeakMap,Oa=new WeakMap,Ra=new WeakSet,La=function(){function OptionalContentConfig(t){optional_content_config_classCallCheck(this,OptionalContentConfig);!function optional_content_config_classPrivateMethodInitSpec(t,r){optional_content_config_checkPrivateRedeclaration(t,r);r.add(t)}(this,Ra);optional_content_config_classPrivateFieldInitSpec(this,Ca,{writable:!0,value:null});optional_content_config_classPrivateFieldInitSpec(this,Ma,{writable:!0,value:new Map});optional_content_config_classPrivateFieldInitSpec(this,Ga,{writable:!0,value:null});optional_content_config_classPrivateFieldInitSpec(this,Oa,{writable:!0,value:null});this.name=null;this.creator=null;if(null!==t){this.name=t.name;this.creator=t.creator;optional_content_config_classPrivateFieldSet(this,Oa,t.order);var r,a=optional_content_config_createForOfIteratorHelper(t.groups);try{for(a.s();!(r=a.n()).done;){var i=r.value;optional_content_config_classPrivateFieldGet(this,Ma).set(i.id,new Ta(i.name,i.intent))}}catch(t){a.e(t)}finally{a.f()}if("OFF"===t.baseState){var o,l=optional_content_config_createForOfIteratorHelper(optional_content_config_classPrivateFieldGet(this,Ma).values());try{for(l.s();!(o=l.n()).done;){o.value._setVisible(Ea,!1)}}catch(t){l.e(t)}finally{l.f()}}var c,u=optional_content_config_createForOfIteratorHelper(t.on);try{for(u.s();!(c=u.n()).done;){var h=c.value;optional_content_config_classPrivateFieldGet(this,Ma).get(h)._setVisible(Ea,!0)}}catch(t){u.e(t)}finally{u.f()}var d,p=optional_content_config_createForOfIteratorHelper(t.off);try{for(p.s();!(d=p.n()).done;){var v=d.value;optional_content_config_classPrivateFieldGet(this,Ma).get(v)._setVisible(Ea,!1)}}catch(t){p.e(t)}finally{p.f()}optional_content_config_classPrivateFieldSet(this,Ga,this.getHash())}}optional_content_config_createClass(OptionalContentConfig,[{key:"isVisible",value:function isVisible(t){if(0===optional_content_config_classPrivateFieldGet(this,Ma).size)return!0;if(!t){warn("Optional content group not defined.");return!0}if("OCG"===t.type){if(!optional_content_config_classPrivateFieldGet(this,Ma).has(t.id)){warn("Optional content group not found: ".concat(t.id));return!0}return optional_content_config_classPrivateFieldGet(this,Ma).get(t.id).visible}if("OCMD"===t.type){if(t.expression)return optional_content_config_classPrivateMethodGet(this,Ra,_evaluateVisibilityExpression2).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){var r,a=optional_content_config_createForOfIteratorHelper(t.ids);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(!optional_content_config_classPrivateFieldGet(this,Ma).has(i)){warn("Optional content group not found: ".concat(i));return!0}if(optional_content_config_classPrivateFieldGet(this,Ma).get(i).visible)return!0}}catch(t){a.e(t)}finally{a.f()}return!1}if("AllOn"===t.policy){var o,l=optional_content_config_createForOfIteratorHelper(t.ids);try{for(l.s();!(o=l.n()).done;){var c=o.value;if(!optional_content_config_classPrivateFieldGet(this,Ma).has(c)){warn("Optional content group not found: ".concat(c));return!0}if(!optional_content_config_classPrivateFieldGet(this,Ma).get(c).visible)return!1}}catch(t){l.e(t)}finally{l.f()}return!0}if("AnyOff"===t.policy){var u,h=optional_content_config_createForOfIteratorHelper(t.ids);try{for(h.s();!(u=h.n()).done;){var d=u.value;if(!optional_content_config_classPrivateFieldGet(this,Ma).has(d)){warn("Optional content group not found: ".concat(d));return!0}if(!optional_content_config_classPrivateFieldGet(this,Ma).get(d).visible)return!0}}catch(t){h.e(t)}finally{h.f()}return!1}if("AllOff"===t.policy){var p,v=optional_content_config_createForOfIteratorHelper(t.ids);try{for(v.s();!(p=v.n()).done;){var _=p.value;if(!optional_content_config_classPrivateFieldGet(this,Ma).has(_)){warn("Optional content group not found: ".concat(_));return!0}if(optional_content_config_classPrivateFieldGet(this,Ma).get(_).visible)return!1}}catch(t){v.e(t)}finally{v.f()}return!0}warn("Unknown optional content policy ".concat(t.policy,"."));return!0}warn("Unknown group type ".concat(t.type,"."));return!0}},{key:"setVisibility",value:function setVisibility(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(optional_content_config_classPrivateFieldGet(this,Ma).has(t)){optional_content_config_classPrivateFieldGet(this,Ma).get(t)._setVisible(Ea,!!r);optional_content_config_classPrivateFieldSet(this,Ca,null)}else warn("Optional content group not found: ".concat(t))}},{key:"hasInitialVisibility",get:function get(){return null===optional_content_config_classPrivateFieldGet(this,Ga)||this.getHash()===optional_content_config_classPrivateFieldGet(this,Ga)}},{key:"getOrder",value:function getOrder(){return optional_content_config_classPrivateFieldGet(this,Ma).size?optional_content_config_classPrivateFieldGet(this,Oa)?optional_content_config_classPrivateFieldGet(this,Oa).slice():optional_content_config_toConsumableArray(optional_content_config_classPrivateFieldGet(this,Ma).keys()):null}},{key:"getGroups",value:function getGroups(){return optional_content_config_classPrivateFieldGet(this,Ma).size>0?objectFromMap(optional_content_config_classPrivateFieldGet(this,Ma)):null}},{key:"getGroup",value:function getGroup(t){return optional_content_config_classPrivateFieldGet(this,Ma).get(t)||null}},{key:"getHash",value:function getHash(){if(null!==optional_content_config_classPrivateFieldGet(this,Ca))return optional_content_config_classPrivateFieldGet(this,Ca);var t,r=new gn,a=optional_content_config_createForOfIteratorHelper(optional_content_config_classPrivateFieldGet(this,Ma));try{for(a.s();!(t=a.n()).done;){var i=optional_content_config_slicedToArray(t.value,2),o=i[0],l=i[1];r.update("".concat(o,":").concat(l.visible))}}catch(t){a.e(t)}finally{a.f()}return optional_content_config_classPrivateFieldSet(this,Ca,r.hexdigest())}}]);return OptionalContentConfig}();function _evaluateVisibilityExpression2(t){var r=t.length;if(r<2)return!0;for(var a=t[0],i=1;i<r;i++){var o=t[i],l=void 0;if(Array.isArray(o))l=optional_content_config_classPrivateMethodGet(this,Ra,_evaluateVisibilityExpression2).call(this,o);else{if(!optional_content_config_classPrivateFieldGet(this,Ma).has(o)){warn("Optional content group not found: ".concat(o));return!0}l=optional_content_config_classPrivateFieldGet(this,Ma).get(o).visible}switch(a){case"And":if(!l)return!1;break;case"Or":if(l)return!0;break;case"Not":return!l;default:return!0}}return"And"===a}__webpack_require__(7195);function transport_stream_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */transport_stream_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==transport_stream_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(transport_stream_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function transport_stream_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function transport_stream_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){transport_stream_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){transport_stream_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function transport_stream_typeof(t){return transport_stream_typeof="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},transport_stream_typeof(t)}function transport_stream_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function transport_stream_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return transport_stream_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return transport_stream_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function transport_stream_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function transport_stream_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function transport_stream_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,transport_stream_toPropertyKey(i.key),i)}}function transport_stream_createClass(t,r,a){r&&transport_stream_defineProperties(t.prototype,r);a&&transport_stream_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function transport_stream_toPropertyKey(t){var r=function transport_stream_toPrimitive(t,r){if("object"!=transport_stream_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=transport_stream_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==transport_stream_typeof(r)?r:String(r)}var Da=function(){function PDFDataTransportStream(t,r){var a=this,i=r.disableRange,o=void 0!==i&&i,l=r.disableStream,c=void 0!==l&&l;transport_stream_classCallCheck(this,PDFDataTransportStream);assert(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');var u=t.length,h=t.initialData,d=t.progressiveDone,p=t.contentDispositionFilename;this._queuedChunks=[];this._progressiveDone=d;this._contentDispositionFilename=p;if((null==h?void 0:h.length)>0){var v=h instanceof Uint8Array&&h.byteLength===h.buffer.byteLength?h.buffer:new Uint8Array(h).buffer;this._queuedChunks.push(v)}this._pdfDataRangeTransport=t;this._isStreamingSupported=!c;this._isRangeSupported=!o;this._contentLength=u;this._fullRequestReader=null;this._rangeReaders=[];t.addRangeListener((function(t,r){a._onReceiveData({begin:t,chunk:r})}));t.addProgressListener((function(t,r){a._onProgress({loaded:t,total:r})}));t.addProgressiveReadListener((function(t){a._onReceiveData({chunk:t})}));t.addProgressiveDoneListener((function(){a._onProgressiveDone()}));t.transportReady()}transport_stream_createClass(PDFDataTransportStream,[{key:"_onReceiveData",value:function _onReceiveData(t){var r=t.begin,a=t.chunk,i=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;if(void 0===r)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{assert(this._rangeReaders.some((function(t){if(t._begin!==r)return!1;t._enqueue(i);return!0})),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}},{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}},{key:"_onProgress",value:function _onProgress(t){if(void 0===t.total){var r,a;null===(r=this._rangeReaders[0])||void 0===r||null===(a=r.onProgress)||void 0===a||a.call(r,{loaded:t.loaded})}else{var i,o;null===(i=this._fullRequestReader)||void 0===i||null===(o=i.onProgress)||void 0===o||o.call(i,{loaded:t.loaded,total:t.total})}}},{key:"_onProgressiveDone",value:function _onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone();this._progressiveDone=!0}},{key:"_removeRangeReader",value:function _removeRangeReader(t){var r=this._rangeReaders.indexOf(t);r>=0&&this._rangeReaders.splice(r,1)}},{key:"getFullReader",value:function getFullReader(){assert(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var t=this._queuedChunks;this._queuedChunks=null;return new ja(this,t,this._progressiveDone,this._contentDispositionFilename)}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=new Na(this,t,r);this._pdfDataRangeTransport.requestDataRange(t,r);this._rangeReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){var r;null===(r=this._fullRequestReader)||void 0===r||r.cancel(t);var a,i=transport_stream_createForOfIteratorHelper(this._rangeReaders.slice(0));try{for(i.s();!(a=i.n()).done;){a.value.cancel(t)}}catch(t){i.e(t)}finally{i.f()}this._pdfDataRangeTransport.abort()}}]);return PDFDataTransportStream}(),ja=function(){function PDFDataTransportStreamReader(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;transport_stream_classCallCheck(this,PDFDataTransportStreamReader);this._stream=t;this._done=a||!1;this._filename=isPdfFile(i)?i:null;this._queuedChunks=r||[];this._loaded=0;var o,l=transport_stream_createForOfIteratorHelper(this._queuedChunks);try{for(l.s();!(o=l.n()).done;){var c=o.value;this._loaded+=c.byteLength}}catch(t){l.e(t)}finally{l.f()}this._requests=[];this._headersReady=Promise.resolve();t._fullRequestReader=this;this.onProgress=null}transport_stream_createClass(PDFDataTransportStreamReader,[{key:"_enqueue",value:function _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}}},{key:"headersReady",get:function get(){return this._headersReady}},{key:"filename",get:function get(){return this._filename}},{key:"isRangeSupported",get:function get(){return this._stream._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._stream._isStreamingSupported}},{key:"contentLength",get:function get(){return this._stream._contentLength}},{key:"read",value:(t=transport_stream_asyncToGenerator(transport_stream_regeneratorRuntime().mark((function _callee(){var t,r;return transport_stream_regeneratorRuntime().wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:if(!(this._queuedChunks.length>0)){a.next=3;break}t=this._queuedChunks.shift();return a.abrupt("return",{value:t,done:!1});case 3:if(!this._done){a.next=5;break}return a.abrupt("return",{value:void 0,done:!0});case 5:r=new ve;this._requests.push(r);return a.abrupt("return",r.promise);case 8:case"end":return a.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;var r,a=transport_stream_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0}},{key:"progressiveDone",value:function progressiveDone(){this._done||(this._done=!0)}}]);var t;return PDFDataTransportStreamReader}(),Na=function(){function PDFDataTransportStreamRangeReader(t,r,a){transport_stream_classCallCheck(this,PDFDataTransportStreamRangeReader);this._stream=t;this._begin=r;this._end=a;this._queuedChunk=null;this._requests=[];this._done=!1;this.onProgress=null}transport_stream_createClass(PDFDataTransportStreamRangeReader,[{key:"_enqueue",value:function _enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});var r,a=transport_stream_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0}this._done=!0;this._stream._removeRangeReader(this)}}},{key:"isStreamingSupported",get:function get(){return!1}},{key:"read",value:(t=transport_stream_asyncToGenerator(transport_stream_regeneratorRuntime().mark((function _callee2(){var t,r;return transport_stream_regeneratorRuntime().wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._queuedChunk){a.next=4;break}t=this._queuedChunk;this._queuedChunk=null;return a.abrupt("return",{value:t,done:!1});case 4:if(!this._done){a.next=6;break}return a.abrupt("return",{value:void 0,done:!0});case 6:r=new ve;this._requests.push(r);return a.abrupt("return",r.promise);case 9:case"end":return a.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;var r,a=transport_stream_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._stream._removeRangeReader(this)}}]);var t;return PDFDataTransportStreamRangeReader}();function content_disposition_slicedToArray(t,r){return function content_disposition_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function content_disposition_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||function content_disposition_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return content_disposition_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return content_disposition_arrayLikeToArray(t,r)}(t,r)||function content_disposition_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function content_disposition_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function validateRangeRequestCapabilities(t){var r=t.getResponseHeader,a=t.isHttp,i=t.rangeChunkSize,o=t.disableRange,l={allowRangeRequests:!1,suggestedLength:void 0},c=parseInt(r("Content-Length"),10);if(!Number.isInteger(c))return l;l.suggestedLength=c;if(c<=2*i)return l;if(o||!a)return l;if("bytes"!==r("Accept-Ranges"))return l;if("identity"!==(r("Content-Encoding")||"identity"))return l;l.allowRangeRequests=!0;return l}function extractFilenameFromHeader(t){var r=t("Content-Disposition");if(r){var a=function getFilenameFromContentDispositionHeader(t){var r=!0,a=toParamRegExp("filename\\*","i").exec(t);if(a){var i=rfc2616unquote(a=a[1]);return fixupEncoding(i=rfc2047decode(i=rfc5987decode(i=unescape(i))))}if(a=function rfc2231getparam(t){for(var r,a=[],i=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");null!==(r=i.exec(t));){var o=content_disposition_slicedToArray(r,4),l=o[1],c=o[2],u=o[3];if((l=parseInt(l,10))in a){if(0===l)break}else a[l]=[c,u]}for(var h=[],d=0;d<a.length&&d in a;++d){var p=content_disposition_slicedToArray(a[d],2),v=p[0],_=p[1];_=rfc2616unquote(_);if(v){_=unescape(_);0===d&&(_=rfc5987decode(_))}h.push(_)}return h.join("")}(t))return fixupEncoding(rfc2047decode(a));if(a=toParamRegExp("filename","i").exec(t)){var o=rfc2616unquote(a=a[1]);return fixupEncoding(o=rfc2047decode(o))}function toParamRegExp(t,r){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',r)}function textdecode(t,a){if(t){if(!/^[\x00-\xFF]+$/.test(a))return a;try{var i=new TextDecoder(t,{fatal:!0}),o=stringToBytes(a);a=i.decode(o);r=!1}catch(t){}}return a}function fixupEncoding(t){if(r&&/[\x80-\xff]/.test(t)){t=textdecode("utf-8",t);r&&(t=textdecode("iso-8859-1",t))}return t}function rfc2616unquote(t){if(t.startsWith('"')){for(var r=t.slice(1).split('\\"'),a=0;a<r.length;++a){var i=r[a].indexOf('"');if(-1!==i){r[a]=r[a].slice(0,i);r.length=a+1}r[a]=r[a].replaceAll(/\\(.)/g,"$1")}t=r.join('"')}return t}function rfc5987decode(t){var r=t.indexOf("'");return-1===r?t:textdecode(t.slice(0,r),t.slice(r+1).replace(/^[^']*'/,""))}function rfc2047decode(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,r,a,i){if("q"===a||"Q"===a)return textdecode(r,i=(i=i.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,r){return String.fromCharCode(parseInt(r,16))})));try{i=atob(i)}catch(t){}return textdecode(r,i)}))}return""}(r);if(a.includes("%"))try{a=decodeURIComponent(a)}catch(t){}if(isPdfFile(a))return a}return null}function createResponseStatusError(t,r){return 404===t||0===t&&r.startsWith("file:")?new se('Missing PDF "'+r+'".'):new le("Unexpected server response (".concat(t,') while retrieving PDF "').concat(r,'".'),t)}function validateResponseStatus(t){return 200===t||206===t}function fetch_stream_typeof(t){return fetch_stream_typeof="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},fetch_stream_typeof(t)}function fetch_stream_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */fetch_stream_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==fetch_stream_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(fetch_stream_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function fetch_stream_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function fetch_stream_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){fetch_stream_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){fetch_stream_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function fetch_stream_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function fetch_stream_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return fetch_stream_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return fetch_stream_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function fetch_stream_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function fetch_stream_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function fetch_stream_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,fetch_stream_toPropertyKey(i.key),i)}}function fetch_stream_createClass(t,r,a){r&&fetch_stream_defineProperties(t.prototype,r);a&&fetch_stream_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function fetch_stream_toPropertyKey(t){var r=function fetch_stream_toPrimitive(t,r){if("object"!=fetch_stream_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=fetch_stream_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==fetch_stream_typeof(r)?r:String(r)}function createFetchOptions(t,r,a){return{method:"GET",headers:t,signal:a.signal,mode:"cors",credentials:r?"include":"same-origin",redirect:"follow"}}function createHeaders(t){var r=new Headers;for(var a in t){var i=t[a];void 0!==i&&r.append(a,i)}return r}function getArrayBuffer(t){if(t instanceof Uint8Array)return t.buffer;if(t instanceof ArrayBuffer)return t;warn("getArrayBuffer - unexpected data format: ".concat(t));return new Uint8Array(t).buffer}var Wa=function(){function PDFFetchStream(t){fetch_stream_classCallCheck(this,PDFFetchStream);this.source=t;this.isHttp=/^https?:/i.test(t.url);this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}fetch_stream_createClass(PDFFetchStream,[{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}},{key:"getFullReader",value:function getFullReader(){assert(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new Ha(this);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=new Ba(this,t,r);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){var r;null===(r=this._fullRequestReader)||void 0===r||r.cancel(t);var a,i=fetch_stream_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(i.s();!(a=i.n()).done;){a.value.cancel(t)}}catch(t){i.e(t)}finally{i.f()}}}]);return PDFFetchStream}(),Ha=function(){function PDFFetchStreamReader(t){var r=this;fetch_stream_classCallCheck(this,PDFFetchStreamReader);this._stream=t;this._reader=null;this._loaded=0;this._filename=null;var a=t.source;this._withCredentials=a.withCredentials||!1;this._contentLength=a.length;this._headersCapability=new ve;this._disableRange=a.disableRange||!1;this._rangeChunkSize=a.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._abortController=new AbortController;this._isStreamingSupported=!a.disableStream;this._isRangeSupported=!a.disableRange;this._headers=createHeaders(this._stream.httpHeaders);var i=a.url;fetch(i,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((function(t){if(!validateResponseStatus(t.status))throw createResponseStatusError(t.status,i);r._reader=t.body.getReader();r._headersCapability.resolve();var a=function getResponseHeader(r){return t.headers.get(r)},o=validateRangeRequestCapabilities({getResponseHeader:a,isHttp:r._stream.isHttp,rangeChunkSize:r._rangeChunkSize,disableRange:r._disableRange}),l=o.allowRangeRequests,c=o.suggestedLength;r._isRangeSupported=l;r._contentLength=c||r._contentLength;r._filename=extractFilenameFromHeader(a);!r._isStreamingSupported&&r._isRangeSupported&&r.cancel(new ue("Streaming is disabled."))})).catch(this._headersCapability.reject);this.onProgress=null}fetch_stream_createClass(PDFFetchStreamReader,[{key:"headersReady",get:function get(){return this._headersCapability.promise}},{key:"filename",get:function get(){return this._filename}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=fetch_stream_asyncToGenerator(fetch_stream_regeneratorRuntime().mark((function _callee(){var t,r,a,i;return fetch_stream_regeneratorRuntime().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:o.next=2;return this._headersCapability.promise;case 2:o.next=4;return this._reader.read();case 4:r=o.sent;a=r.value;if(!(i=r.done)){o.next=9;break}return o.abrupt("return",{value:a,done:i});case 9:this._loaded+=a.byteLength;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return o.abrupt("return",{value:getArrayBuffer(a),done:!1});case 12:case"end":return o.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){var r;null===(r=this._reader)||void 0===r||r.cancel(t);this._abortController.abort()}}]);var t;return PDFFetchStreamReader}(),Ba=function(){function PDFFetchStreamRangeReader(t,r,a){var i=this;fetch_stream_classCallCheck(this,PDFFetchStreamRangeReader);this._stream=t;this._reader=null;this._loaded=0;var o=t.source;this._withCredentials=o.withCredentials||!1;this._readCapability=new ve;this._isStreamingSupported=!o.disableStream;this._abortController=new AbortController;this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range","bytes=".concat(r,"-").concat(a-1));var l=o.url;fetch(l,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((function(t){if(!validateResponseStatus(t.status))throw createResponseStatusError(t.status,l);i._readCapability.resolve();i._reader=t.body.getReader()})).catch(this._readCapability.reject);this.onProgress=null}fetch_stream_createClass(PDFFetchStreamRangeReader,[{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=fetch_stream_asyncToGenerator(fetch_stream_regeneratorRuntime().mark((function _callee2(){var t,r,a,i;return fetch_stream_regeneratorRuntime().wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:o.next=2;return this._readCapability.promise;case 2:o.next=4;return this._reader.read();case 4:r=o.sent;a=r.value;if(!(i=r.done)){o.next=9;break}return o.abrupt("return",{value:a,done:i});case 9:this._loaded+=a.byteLength;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return o.abrupt("return",{value:getArrayBuffer(a),done:!1});case 12:case"end":return o.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){var r;null===(r=this._reader)||void 0===r||r.cancel(t);this._abortController.abort()}}]);var t;return PDFFetchStreamRangeReader}();function network_typeof(t){return network_typeof="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},network_typeof(t)}function network_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */network_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==network_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(network_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function network_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function network_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){network_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){network_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function network_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function network_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return network_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return network_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function network_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function network_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function network_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,network_toPropertyKey(i.key),i)}}function network_createClass(t,r,a){r&&network_defineProperties(t.prototype,r);a&&network_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function network_toPropertyKey(t){var r=function network_toPrimitive(t,r){if("object"!=network_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=network_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==network_typeof(r)?r:String(r)}var za,Ua,qa,Va,Ka=function(){function NetworkManager(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};network_classCallCheck(this,NetworkManager);this.url=t;this.isHttp=/^https?:/i.test(t);this.httpHeaders=this.isHttp&&r.httpHeaders||Object.create(null);this.withCredentials=r.withCredentials||!1;this.currXhrId=0;this.pendingRequests=Object.create(null)}network_createClass(NetworkManager,[{key:"requestRange",value:function requestRange(t,r,a){var i={begin:t,end:r};for(var o in a)i[o]=a[o];return this.request(i)}},{key:"requestFull",value:function requestFull(t){return this.request(t)}},{key:"request",value:function request(t){var r=new XMLHttpRequest,a=this.currXhrId++,i=this.pendingRequests[a]={xhr:r};r.open("GET",this.url);r.withCredentials=this.withCredentials;for(var o in this.httpHeaders){var l=this.httpHeaders[o];void 0!==l&&r.setRequestHeader(o,l)}if(this.isHttp&&"begin"in t&&"end"in t){r.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1));i.expectedStatus=206}else i.expectedStatus=200;r.responseType="arraybuffer";t.onError&&(r.onerror=function(a){t.onError(r.status)});r.onreadystatechange=this.onStateChange.bind(this,a);r.onprogress=this.onProgress.bind(this,a);i.onHeadersReceived=t.onHeadersReceived;i.onDone=t.onDone;i.onError=t.onError;i.onProgress=t.onProgress;r.send(null);return a}},{key:"onProgress",value:function onProgress(t,r){var a,i=this.pendingRequests[t];i&&(null===(a=i.onProgress)||void 0===a||a.call(i,r))}},{key:"onStateChange",value:function onStateChange(t,r){var a=this.pendingRequests[t];if(a){var i=a.xhr;if(i.readyState>=2&&a.onHeadersReceived){a.onHeadersReceived();delete a.onHeadersReceived}if(4===i.readyState&&t in this.pendingRequests){delete this.pendingRequests[t];if(0===i.status&&this.isHttp){var o;null===(o=a.onError)||void 0===o||o.call(a,i.status)}else{var l=i.status||200;if(200===l&&206===a.expectedStatus||l===a.expectedStatus){var c=function network_getArrayBuffer(t){var r=t.response;return"string"!=typeof r?r:stringToBytes(r).buffer}(i);if(206===l){var u=i.getResponseHeader("Content-Range"),h=/bytes (\d+)-(\d+)\/(\d+)/.exec(u);a.onDone({begin:parseInt(h[1],10),chunk:c})}else if(c)a.onDone({begin:0,chunk:c});else{var d;null===(d=a.onError)||void 0===d||d.call(a,i.status)}}else{var p;null===(p=a.onError)||void 0===p||p.call(a,i.status)}}}}}},{key:"getRequestXhr",value:function getRequestXhr(t){return this.pendingRequests[t].xhr}},{key:"isPendingRequest",value:function isPendingRequest(t){return t in this.pendingRequests}},{key:"abortRequest",value:function abortRequest(t){var r=this.pendingRequests[t].xhr;delete this.pendingRequests[t];r.abort()}}]);return NetworkManager}(),Ya=function(){function PDFNetworkStream(t){network_classCallCheck(this,PDFNetworkStream);this._source=t;this._manager=new Ka(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials});this._rangeChunkSize=t.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}network_createClass(PDFNetworkStream,[{key:"_onRangeRequestReaderClosed",value:function _onRangeRequestReaderClosed(t){var r=this._rangeRequestReaders.indexOf(t);r>=0&&this._rangeRequestReaders.splice(r,1)}},{key:"getFullReader",value:function getFullReader(){assert(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new Xa(this._manager,this._source);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){var a=new $a(this._manager,t,r);a.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){var r;null===(r=this._fullRequestReader)||void 0===r||r.cancel(t);var a,i=network_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(i.s();!(a=i.n()).done;){a.value.cancel(t)}}catch(t){i.e(t)}finally{i.f()}}}]);return PDFNetworkStream}(),Xa=function(){function PDFNetworkStreamFullRequestReader(t,r){network_classCallCheck(this,PDFNetworkStreamFullRequestReader);this._manager=t;var a={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url;this._fullRequestId=t.requestFull(a);this._headersReceivedCapability=new ve;this._disableRange=r.disableRange||!1;this._contentLength=r.length;this._rangeChunkSize=r.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}network_createClass(PDFNetworkStreamFullRequestReader,[{key:"_onHeadersReceived",value:function _onHeadersReceived(){var t=this._fullRequestId,r=this._manager.getRequestXhr(t),a=function getResponseHeader(t){return r.getResponseHeader(t)},i=validateRangeRequestCapabilities({getResponseHeader:a,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),o=i.allowRangeRequests,l=i.suggestedLength;o&&(this._isRangeSupported=!0);this._contentLength=l||this._contentLength;this._filename=extractFilenameFromHeader(a);this._isRangeSupported&&this._manager.abortRequest(t);this._headersReceivedCapability.resolve()}},{key:"_onDone",value:function _onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);this._done=!0;if(!(this._cachedChunks.length>0)){var r,a=network_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0}}},{key:"_onError",value:function _onError(t){this._storedError=createResponseStatusError(t,this._url);this._headersReceivedCapability.reject(this._storedError);var r,a=network_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.reject(this._storedError)}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._cachedChunks.length=0}},{key:"_onProgress",value:function _onProgress(t){var r;null===(r=this.onProgress)||void 0===r||r.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}},{key:"filename",get:function get(){return this._filename}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"headersReady",get:function get(){return this._headersReceivedCapability.promise}},{key:"read",value:(t=network_asyncToGenerator(network_regeneratorRuntime().mark((function _callee(){var t,r;return network_regeneratorRuntime().wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._storedError){a.next=2;break}throw this._storedError;case 2:if(!(this._cachedChunks.length>0)){a.next=5;break}t=this._cachedChunks.shift();return a.abrupt("return",{value:t,done:!1});case 5:if(!this._done){a.next=7;break}return a.abrupt("return",{value:void 0,done:!0});case 7:r=new ve;this._requests.push(r);return a.abrupt("return",r.promise);case 10:case"end":return a.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;this._headersReceivedCapability.reject(t);var r,a=network_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId);this._fullRequestReader=null}}]);var t;return PDFNetworkStreamFullRequestReader}(),$a=function(){function PDFNetworkStreamRangeRequestReader(t,r,a){network_classCallCheck(this,PDFNetworkStreamRangeRequestReader);this._manager=t;var i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._requestId=t.requestRange(r,a,i);this._requests=[];this._queuedChunk=null;this._done=!1;this._storedError=void 0;this.onProgress=null;this.onClosed=null}network_createClass(PDFNetworkStreamRangeRequestReader,[{key:"_close",value:function _close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}},{key:"_onDone",value:function _onDone(t){var r=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:r,done:!1})}else this._queuedChunk=r;this._done=!0;var a,i=network_createForOfIteratorHelper(this._requests);try{for(i.s();!(a=i.n()).done;){a.value.resolve({value:void 0,done:!0})}}catch(t){i.e(t)}finally{i.f()}this._requests.length=0;this._close()}},{key:"_onError",value:function _onError(t){this._storedError=createResponseStatusError(t,this._url);var r,a=network_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.reject(this._storedError)}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._queuedChunk=null}},{key:"_onProgress",value:function _onProgress(t){if(!this.isStreamingSupported){var r;null===(r=this.onProgress)||void 0===r||r.call(this,{loaded:t.loaded})}}},{key:"isStreamingSupported",get:function get(){return!1}},{key:"read",value:(t=network_asyncToGenerator(network_regeneratorRuntime().mark((function _callee2(){var t,r;return network_regeneratorRuntime().wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._storedError){a.next=2;break}throw this._storedError;case 2:if(null===this._queuedChunk){a.next=6;break}t=this._queuedChunk;this._queuedChunk=null;return a.abrupt("return",{value:t,done:!1});case 6:if(!this._done){a.next=8;break}return a.abrupt("return",{value:void 0,done:!0});case 8:r=new ve;this._requests.push(r);return a.abrupt("return",r.promise);case 11:case"end":return a.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;var r,a=network_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId);this._close()}}]);var t;return PDFNetworkStreamRangeRequestReader}();function node_stream_typeof(t){return node_stream_typeof="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},node_stream_typeof(t)}function node_stream_callSuper(t,r,a){return r=node_stream_getPrototypeOf(r),function node_stream_possibleConstructorReturn(t,r){if(r&&("object"===node_stream_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function node_stream_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,node_stream_isNativeReflectConstruct()?Reflect.construct(r,a||[],node_stream_getPrototypeOf(t).constructor):r.apply(t,a))}function node_stream_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(node_stream_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function node_stream_getPrototypeOf(t){node_stream_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return node_stream_getPrototypeOf(t)}function node_stream_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&node_stream_setPrototypeOf(t,r)}function node_stream_setPrototypeOf(t,r){node_stream_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return node_stream_setPrototypeOf(t,r)}function node_stream_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */node_stream_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==node_stream_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(node_stream_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function node_stream_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function node_stream_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){node_stream_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){node_stream_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function node_stream_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function node_stream_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return node_stream_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return node_stream_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function node_stream_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function node_stream_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function node_stream_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,node_stream_toPropertyKey(i.key),i)}}function node_stream_createClass(t,r,a){r&&node_stream_defineProperties(t.prototype,r);a&&node_stream_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function node_stream_toPropertyKey(t){var r=function node_stream_toPrimitive(t,r){if("object"!=node_stream_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=node_stream_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==node_stream_typeof(r)?r:String(r)}var Ja=/^file:\/\/\/[a-zA-Z]:\//;var Qa=function(){function PDFNodeStream(t){node_stream_classCallCheck(this,PDFNodeStream);this.source=t;this.url=function parseUrl(t){var r=Va.parse(t);if("file:"===r.protocol||r.host)return r;if(/^[a-z]:[/\\]/i.test(t))return Va.parse("file:///".concat(t));r.host||(r.protocol="file:");return r}(t.url);this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol||"capacitor:"===this.url.protocol;this.isFsUrl="file:"===this.url.protocol;this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}node_stream_createClass(PDFNodeStream,[{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}},{key:"getFullReader",value:function getFullReader(){assert(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new ni(this):new ti(this);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=this.isFsUrl?new ai(this,t,r):new ri(this,t,r);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){var r;null===(r=this._fullRequestReader)||void 0===r||r.cancel(t);var a,i=node_stream_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(i.s();!(a=i.n()).done;){a.value.cancel(t)}}catch(t){i.e(t)}finally{i.f()}}}]);return PDFNodeStream}(),Za=function(){function BaseFullReader(t){node_stream_classCallCheck(this,BaseFullReader);this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;var r=t.source;this._contentLength=r.length;this._loaded=0;this._filename=null;this._disableRange=r.disableRange||!1;this._rangeChunkSize=r.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!r.disableStream;this._isRangeSupported=!r.disableRange;this._readableStream=null;this._readCapability=new ve;this._headersCapability=new ve}node_stream_createClass(BaseFullReader,[{key:"headersReady",get:function get(){return this._headersCapability.promise}},{key:"filename",get:function get(){return this._filename}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=node_stream_asyncToGenerator(node_stream_regeneratorRuntime().mark((function _callee(){var t,r,a;return node_stream_regeneratorRuntime().wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:i.next=2;return this._readCapability.promise;case 2:if(!this._done){i.next=4;break}return i.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){i.next=6;break}throw this._storedError;case 6:if(null!==(r=this._readableStream.read())){i.next=10;break}this._readCapability=new ve;return i.abrupt("return",this.read());case 10:this._loaded+=r.length;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});a=new Uint8Array(r).buffer;return i.abrupt("return",{value:a,done:!1});case 14:case"end":return i.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}},{key:"_error",value:function _error(t){this._storedError=t;this._readCapability.resolve()}},{key:"_setReadableStream",value:function _setReadableStream(t){var r=this;this._readableStream=t;t.on("readable",(function(){r._readCapability.resolve()}));t.on("end",(function(){t.destroy();r._done=!0;r._readCapability.resolve()}));t.on("error",(function(t){r._error(t)}));!this._isStreamingSupported&&this._isRangeSupported&&this._error(new ue("streaming is disabled"));this._storedError&&this._readableStream.destroy(this._storedError)}}]);var t;return BaseFullReader}(),ei=function(){function BaseRangeReader(t){node_stream_classCallCheck(this,BaseRangeReader);this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=new ve;var r=t.source;this._isStreamingSupported=!r.disableStream}node_stream_createClass(BaseRangeReader,[{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=node_stream_asyncToGenerator(node_stream_regeneratorRuntime().mark((function _callee2(){var t,r,a;return node_stream_regeneratorRuntime().wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:i.next=2;return this._readCapability.promise;case 2:if(!this._done){i.next=4;break}return i.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){i.next=6;break}throw this._storedError;case 6:if(null!==(r=this._readableStream.read())){i.next=10;break}this._readCapability=new ve;return i.abrupt("return",this.read());case 10:this._loaded+=r.length;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});a=new Uint8Array(r).buffer;return i.abrupt("return",{value:a,done:!1});case 14:case"end":return i.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}},{key:"_error",value:function _error(t){this._storedError=t;this._readCapability.resolve()}},{key:"_setReadableStream",value:function _setReadableStream(t){var r=this;this._readableStream=t;t.on("readable",(function(){r._readCapability.resolve()}));t.on("end",(function(){t.destroy();r._done=!0;r._readCapability.resolve()}));t.on("error",(function(t){r._error(t)}));this._storedError&&this._readableStream.destroy(this._storedError)}}]);var t;return BaseRangeReader}();function createRequestOptions(t,r){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:r}}var ti=function(t){node_stream_inherits(PDFNodeStreamFullReader,t);function PDFNodeStreamFullReader(t){var r;node_stream_classCallCheck(this,PDFNodeStreamFullReader);var a=function handleResponse(a){if(404!==a.statusCode){r._headersCapability.resolve();r._setReadableStream(a);var i=function getResponseHeader(t){return r._readableStream.headers[t.toLowerCase()]},o=validateRangeRequestCapabilities({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:r._rangeChunkSize,disableRange:r._disableRange}),l=o.allowRangeRequests,c=o.suggestedLength;r._isRangeSupported=l;r._contentLength=c||r._contentLength;r._filename=extractFilenameFromHeader(i)}else{var u=new se('Missing PDF "'.concat(r._url,'".'));r._storedError=u;r._headersCapability.reject(u)}};(r=node_stream_callSuper(this,PDFNodeStreamFullReader,[t]))._request=null;"http:"===r._url.protocol?r._request=Ua.request(createRequestOptions(r._url,t.httpHeaders),a):r._request=qa.request(createRequestOptions(r._url,t.httpHeaders),a);r._request.on("error",(function(t){r._storedError=t;r._headersCapability.reject(t)}));r._request.end();return r}return node_stream_createClass(PDFNodeStreamFullReader)}(Za),ri=function(t){node_stream_inherits(PDFNodeStreamRangeReader,t);function PDFNodeStreamRangeReader(t,r,a){var i;node_stream_classCallCheck(this,PDFNodeStreamRangeReader);(i=node_stream_callSuper(this,PDFNodeStreamRangeReader,[t]))._httpHeaders={};for(var o in t.httpHeaders){var l=t.httpHeaders[o];void 0!==l&&(i._httpHeaders[o]=l)}i._httpHeaders.Range="bytes=".concat(r,"-").concat(a-1);var c=function handleResponse(t){if(404!==t.statusCode)i._setReadableStream(t);else{var r=new se('Missing PDF "'.concat(i._url,'".'));i._storedError=r}};i._request=null;"http:"===i._url.protocol?i._request=Ua.request(createRequestOptions(i._url,i._httpHeaders),c):i._request=qa.request(createRequestOptions(i._url,i._httpHeaders),c);i._request.on("error",(function(t){i._storedError=t}));i._request.end();return i}return node_stream_createClass(PDFNodeStreamRangeReader)}(ei),ni=function(t){node_stream_inherits(PDFNodeStreamFsFullReader,t);function PDFNodeStreamFsFullReader(t){var r;node_stream_classCallCheck(this,PDFNodeStreamFsFullReader);r=node_stream_callSuper(this,PDFNodeStreamFsFullReader,[t]);var a=decodeURIComponent(r._url.path);Ja.test(r._url.href)&&(a=a.replace(/^\//,""));za.lstat(a,(function(t,i){if(t){"ENOENT"===t.code&&(t=new se('Missing PDF "'.concat(a,'".')));r._storedError=t;r._headersCapability.reject(t)}else{r._contentLength=i.size;r._setReadableStream(za.createReadStream(a));r._headersCapability.resolve()}}));return r}return node_stream_createClass(PDFNodeStreamFsFullReader)}(Za),ai=function(t){node_stream_inherits(PDFNodeStreamFsRangeReader,t);function PDFNodeStreamFsRangeReader(t,r,a){var i;node_stream_classCallCheck(this,PDFNodeStreamFsRangeReader);i=node_stream_callSuper(this,PDFNodeStreamFsRangeReader,[t]);var o=decodeURIComponent(i._url.path);Ja.test(i._url.href)&&(o=o.replace(/^\//,""));i._setReadableStream(za.createReadStream(o,{start:r,end:a-1}));return i}return node_stream_createClass(PDFNodeStreamFsRangeReader)}(ei);function xfa_text_typeof(t){return xfa_text_typeof="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},xfa_text_typeof(t)}function xfa_text_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function xfa_text_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return xfa_text_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return xfa_text_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function xfa_text_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function xfa_text_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,xfa_text_toPropertyKey(i.key),i)}}function xfa_text_toPropertyKey(t){var r=function xfa_text_toPrimitive(t,r){if("object"!=xfa_text_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=xfa_text_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==xfa_text_typeof(r)?r:String(r)}var ii,oi=function(){function XfaText(){!function xfa_text_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,XfaText)}!function xfa_text_createClass(t,r,a){r&&xfa_text_defineProperties(t.prototype,r);a&&xfa_text_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(XfaText,null,[{key:"textContent",value:function textContent(t){var r=[],a={items:r,styles:Object.create(null)};!function walk(t){var a;if(t){var i=null,o=t.name;if("#text"===o)i=t.value;else{if(!XfaText.shouldBuildText(o))return;null!=t&&null!==(a=t.attributes)&&void 0!==a&&a.textContent?i=t.attributes.textContent:t.value&&(i=t.value)}null!==i&&r.push({str:i});if(t.children){var l,c=xfa_text_createForOfIteratorHelper(t.children);try{for(c.s();!(l=c.n()).done;){walk(l.value)}}catch(t){c.e(t)}finally{c.f()}}}}(t);return a}},{key:"shouldBuildText",value:function shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}]);return XfaText}();function api_toConsumableArray(t){return function api_arrayWithoutHoles(t){if(Array.isArray(t))return api_arrayLikeToArray(t)}(t)||function api_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||api_unsupportedIterableToArray(t)||function api_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function api_classPrivateMethodInitSpec(t,r){api_checkPrivateRedeclaration(t,r);r.add(t)}function api_classPrivateFieldInitSpec(t,r,a){api_checkPrivateRedeclaration(t,r);r.set(t,a)}function api_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function api_classPrivateFieldGet(t,r){return api_classApplyDescriptorGet(t,api_classExtractFieldDescriptor(t,r,"get"))}function api_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function api_classPrivateFieldSet(t,r,a){api_classApplyDescriptorSet(t,api_classExtractFieldDescriptor(t,r,"set"),a);return a}function api_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function api_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=api_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function api_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */api_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==api_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(api_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function api_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function api_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,api_toPropertyKey(i.key),i)}}function api_createClass(t,r,a){r&&api_defineProperties(t.prototype,r);a&&api_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function api_toPropertyKey(t){var r=function api_toPrimitive(t,r){if("object"!=api_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=api_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==api_typeof(r)?r:String(r)}function api_classStaticPrivateFieldSpecSet(t,r,a,i){api_classCheckPrivateStaticAccess(t,r);api_classCheckPrivateStaticFieldDescriptor(a,"set");api_classApplyDescriptorSet(t,a,i);return i}function api_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}function api_classStaticPrivateFieldSpecGet(t,r,a){api_classCheckPrivateStaticAccess(t,r);api_classCheckPrivateStaticFieldDescriptor(a,"get");return api_classApplyDescriptorGet(t,a)}function api_classCheckPrivateStaticFieldDescriptor(t,r){if(void 0===t)throw new TypeError("attempted to "+r+" private static field before its declaration")}function api_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}function api_classApplyDescriptorGet(t,r){return r.get?r.get.call(t):r.value}function api_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function api_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){api_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){api_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function api_slicedToArray(t,r){return function api_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function api_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||api_unsupportedIterableToArray(t,r)||function api_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function api_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return api_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?api_arrayLikeToArray(t,r):void 0}}function api_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function api_typeof(t){return api_typeof="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},api_typeof(t)}var si=65536;window.ServiceWorkerOptions={showUnverifiedSignatures:!1};var li=r?Mn:Be,ci=r?Gn:ze,ui=r?Cn:He,hi=r?On:Ue;function getDocument(t){var a,i;"string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});if("object"!==api_typeof(t))throw new Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");var o=new di,l=o.docId,c=t.url?function getUrlProp(t,a){if(t instanceof URL)return t.href;try{return a?new URL(t,window.location.origin+a).href:new URL(t,window.location).href}catch(a){if(r&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url,t.baseHref):null,u=t.data?function getDataProp(t){if(r&&"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 stringToBytes(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===api_typeof(t)&&!isNaN(null==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.")}(t.data):null,h=t.httpHeaders||null,d=!0===t.withCredentials,p=null!==(a=t.password)&&void 0!==a?a:null,v=t.range instanceof pi?t.range:null,_=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:si,y=t.worker instanceof Ai?t.worker:null,g=t.verbosity,m="string"!=typeof t.docBaseUrl||isDataScheme(t.docBaseUrl)?null:t.docBaseUrl,b="function"==typeof t.cMapUrl?t.cMapUrl():"string"==typeof t.cMapUrl?t.cMapUrl:null,w=!1!==t.cMapPacked,P=t.CMapReaderFactory||ci,k="function"==typeof t.standardFontDataUrl?t.standardFontDataUrl():"string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,S=t.StandardFontDataFactory||hi,A=!0!==t.stopAtErrors,x=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,E=!1!==t.isEvalSupported,I="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!r,T=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,C="boolean"==typeof t.disableFontFace?t.disableFontFace:r,M=!0===t.fontExtraProperties,G=!0===t.enableXfa,O=t.ownerDocument||globalThis.document,R=!0===t.disableRange,L=!0===t.disableStream,D=!0===t.disableAutoFetch,j=!0===t.pdfBug,N=v?v.length:null!==(i=t.length)&&void 0!==i?i:NaN,W="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!r&&!C,H="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:P===ze&&S===Ue&&b&&k&&isValidFetchUrl(b,document.baseURI)&&isValidFetchUrl(k,document.baseURI),B=t.canvasFactory||new li({ownerDocument:O}),z=t.filterFactory||new ui({docId:l,ownerDocument:O});setVerbosityLevel(g);var U={canvasFactory:B,filterFactory:z};if(!H){U.cMapReaderFactory=new P({baseUrl:b,isCompressed:w});U.standardFontDataFactory=new S({baseUrl:k})}if(!y){var q={verbosity:g,port:la.workerPort};y=q.port?Ai.fromPort(q):new Ai(q);o._worker=y}var V={docId:l,apiVersion:"4.1.612",data:u,password:p,disableAutoFetch:D,rangeChunkSize:_,length:N,docBaseUrl:m,enableXfa:G,evaluatorOptions:{maxImageSize:x,disableFontFace:C,ignoreErrors:A,isEvalSupported:E,isOffscreenCanvasSupported:I,canvasMaxAreaInBytes:T,fontExtraProperties:M,useSystemFonts:W,cMapUrl:H?b:null,standardFontDataUrl:H?k:null}},K={ignoreErrors:A,isEvalSupported:E,disableFontFace:C,fontExtraProperties:M,enableXfa:G,ownerDocument:O,disableAutoFetch:D,pdfBug:j,styleElement:null};y.promise.then((function(){if(o.destroyed)throw new Error("Loading aborted");var t=function _fetchDocument(t,r){return _fetchDocument2.apply(this,arguments)}(y,V),a=new Promise((function(t){var a;if(v)a=new Da(v,{disableRange:R,disableStream:L});else if(!u){a=function createPDFNetworkStream(t){return r?new Qa(t):isValidFetchUrl(t.url)?new Wa(t):new Ya(t)}({url:c,length:N,httpHeaders:h,withCredentials:d,rangeChunkSize:_,disableRange:R,disableStream:L})}t(a)}));return Promise.all([t,a]).then((function(t){var r=api_slicedToArray(t,2),a=r[0],i=r[1];if(o.destroyed)throw new Error("Loading aborted");var c=new Sa(l,a,y.port),u=new Oi(c,o,i,K,U);o._transport=u;c.send("showUnverifiedSignatures",window.ServiceWorkerOptions.showUnverifiedSignatures);c.send("Ready",null)}))})).catch(o._capability.reject);return o}function _fetchDocument2(){return(_fetchDocument2=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee6(t,r){var a;return api_regeneratorRuntime().wrap((function _callee6$(i){for(;;)switch(i.prev=i.next){case 0:if(!t.destroyed){i.next=2;break}throw new Error("Worker was destroyed");case 2:i.next=4;return t.messageHandler.sendWithPromise("GetDocRequest",r,r.data?[r.data.buffer]:null);case 4:a=i.sent;if(!t.destroyed){i.next=7;break}throw new Error("Worker was destroyed");case 7:return i.abrupt("return",a);case 8:case"end":return i.stop()}}),_callee6)})))).apply(this,arguments)}var di=function(){function PDFDocumentLoadingTask(){var t,r;api_classCallCheck(this,PDFDocumentLoadingTask);this._capability=new ve;this._transport=null;this._worker=null;this.docId="d".concat((api_classStaticPrivateFieldSpecSet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,fi,(t=api_classStaticPrivateFieldSpecGet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,fi),r=t++,t)),r));this.destroyed=!1;this.onPassword=null;this.onProgress=null}api_createClass(PDFDocumentLoadingTask,[{key:"promise",get:function get(){return this._capability.promise}},{key:"destroy",value:(t=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee(){var t,r,a;return api_regeneratorRuntime().wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:this.destroyed=!0;i.prev=1;null!==(t=this._worker)&&void 0!==t&&t.port&&(this._worker._pendingDestroy=!0);i.next=5;return null===(r=this._transport)||void 0===r?void 0:r.destroy();case 5:i.next=11;break;case 7:i.prev=7;i.t0=i.catch(1);null!==(a=this._worker)&&void 0!==a&&a.port&&delete this._worker._pendingDestroy;throw i.t0;case 11:this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}case 13:case"end":return i.stop()}}),_callee,this,[[1,7]])}))),function destroy(){return t.apply(this,arguments)})}]);var t;return PDFDocumentLoadingTask}(),fi={writable:!0,value:0},pi=function(){function PDFDataRangeTransport(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;api_classCallCheck(this,PDFDataRangeTransport);this.length=t;this.initialData=r;this.progressiveDone=a;this.contentDispositionFilename=i;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._progressiveDoneListeners=[];this._readyCapability=new ve}api_createClass(PDFDataRangeTransport,[{key:"addRangeListener",value:function addRangeListener(t){this._rangeListeners.push(t)}},{key:"addProgressListener",value:function addProgressListener(t){this._progressListeners.push(t)}},{key:"addProgressiveReadListener",value:function addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}},{key:"addProgressiveDoneListener",value:function addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}},{key:"onDataRange",value:function onDataRange(t,r){var a,i=api_createForOfIteratorHelper(this._rangeListeners);try{for(i.s();!(a=i.n()).done;){(0,a.value)(t,r)}}catch(t){i.e(t)}finally{i.f()}}},{key:"onDataProgress",value:function onDataProgress(t,r){var a=this;this._readyCapability.promise.then((function(){var i,o=api_createForOfIteratorHelper(a._progressListeners);try{for(o.s();!(i=o.n()).done;){(0,i.value)(t,r)}}catch(t){o.e(t)}finally{o.f()}}))}},{key:"onDataProgressiveRead",value:function onDataProgressiveRead(t){var r=this;this._readyCapability.promise.then((function(){var a,i=api_createForOfIteratorHelper(r._progressiveReadListeners);try{for(i.s();!(a=i.n()).done;){(0,a.value)(t)}}catch(t){i.e(t)}finally{i.f()}}))}},{key:"onDataProgressiveDone",value:function onDataProgressiveDone(){var t=this;this._readyCapability.promise.then((function(){var r,a=api_createForOfIteratorHelper(t._progressiveDoneListeners);try{for(a.s();!(r=a.n()).done;){(0,r.value)()}}catch(t){a.e(t)}finally{a.f()}}))}},{key:"transportReady",value:function transportReady(){this._readyCapability.resolve()}},{key:"requestDataRange",value:function requestDataRange(t,r){unreachable("Abstract method PDFDataRangeTransport.requestDataRange")}},{key:"abort",value:function abort(){}}]);return PDFDataRangeTransport}(),vi=function(){function PDFDocumentProxy(t,r){api_classCallCheck(this,PDFDocumentProxy);this._pdfInfo=t;this._transport=r}api_createClass(PDFDocumentProxy,[{key:"annotationStorage",get:function get(){return this._transport.annotationStorage}},{key:"filterFactory",get:function get(){return this._transport.filterFactory}},{key:"numPages",get:function get(){return this._pdfInfo.numPages}},{key:"fingerprints",get:function get(){return this._pdfInfo.fingerprints}},{key:"isPureXfa",get:function get(){return shadow(this,"isPureXfa",!!this._transport._htmlForXfa)}},{key:"allXfaHtml",get:function get(){return this._transport._htmlForXfa}},{key:"getPage",value:function getPage(t){return this._transport.getPage(t)}},{key:"getPageIndex",value:function getPageIndex(t){return this._transport.getPageIndex(t)}},{key:"getDestinations",value:function getDestinations(){return this._transport.getDestinations()}},{key:"getDestination",value:function getDestination(t){return this._transport.getDestination(t)}},{key:"getPageLabels",value:function getPageLabels(){return this._transport.getPageLabels()}},{key:"getPageLayout",value:function getPageLayout(){return this._transport.getPageLayout()}},{key:"getPageMode",value:function getPageMode(){return this._transport.getPageMode()}},{key:"getViewerPreferences",value:function getViewerPreferences(){return this._transport.getViewerPreferences()}},{key:"getOpenAction",value:function getOpenAction(){return this._transport.getOpenAction()}},{key:"getAttachments",value:function getAttachments(){return this._transport.getAttachments()}},{key:"getJSActions",value:function getJSActions(){return this._transport.getDocJSActions()}},{key:"getOutline",value:function getOutline(){return this._transport.getOutline()}},{key:"getOptionalContentConfig",value:function getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}},{key:"getPermissions",value:function getPermissions(){return this._transport.getPermissions()}},{key:"getMetadata",value:function getMetadata(){return this._transport.getMetadata()}},{key:"getMarkInfo",value:function getMarkInfo(){return this._transport.getMarkInfo()}},{key:"getData",value:function getData(){return this._transport.getData()}},{key:"saveDocument",value:function saveDocument(){return this._transport.saveDocument()}},{key:"getDownloadInfo",value:function getDownloadInfo(){return this._transport.downloadInfoCapability.promise}},{key:"cleanup",value:function cleanup(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}},{key:"destroy",value:function destroy(){return this.loadingTask.destroy()}},{key:"loadingParams",get:function get(){return this._transport.loadingParams}},{key:"loadingTask",get:function get(){return this._transport.loadingTask}},{key:"getFieldObjects",value:function getFieldObjects(){return this._transport.getFieldObjects()}},{key:"hasJSActions",value:function hasJSActions(){return this._transport.hasJSActions()}},{key:"getCalculationOrderIds",value:function getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}]);return PDFDocumentProxy}(),_i=new WeakMap,yi=new WeakMap,gi=new WeakSet,mi=new WeakSet,bi=function(){function PDFPageProxy(t,r,a){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];api_classCallCheck(this,PDFPageProxy);api_classPrivateMethodInitSpec(this,mi);api_classPrivateMethodInitSpec(this,gi);api_classPrivateFieldInitSpec(this,_i,{writable:!0,value:null});api_classPrivateFieldInitSpec(this,yi,{writable:!0,value:!1});this._pageIndex=t;this._pageInfo=r;this._transport=a;this._stats=i?new Xe:null;this._pdfBug=i;this.commonObjs=a.commonObjs;this.objs=new Di;this._maybeCleanupAfterRender=!1;this._intentStates=new Map;this.destroyed=!1}api_createClass(PDFPageProxy,[{key:"pageNumber",get:function get(){return this._pageIndex+1}},{key:"rotate",get:function get(){return this._pageInfo.rotate}},{key:"ref",get:function get(){return this._pageInfo.ref}},{key:"userUnit",get:function get(){return this._pageInfo.userUnit}},{key:"view",get:function get(){return this._pageInfo.view}},{key:"getViewport",value:function getViewport(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.scale,a=t.rotation,i=void 0===a?this.rotate:a,o=t.offsetX,l=void 0===o?0:o,c=t.offsetY,u=void 0===c?0:c,h=t.dontFlip,d=void 0!==h&&h;return new Ve({viewBox:this.view,scale:r,rotation:i,offsetX:l,offsetY:u,dontFlip:d})}},{key:"getAnnotations",value:function getAnnotations(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).intent,r=void 0===t?"display":t,a=this._transport.getRenderingIntent(r);return this._transport.getAnnotations(this._pageIndex,a.renderingIntent)}},{key:"getJSActions",value:function getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}},{key:"filterFactory",get:function get(){return this._transport.filterFactory}},{key:"isPureXfa",get:function get(){return shadow(this,"isPureXfa",!!this._transport._htmlForXfa)}},{key:"getXfa",value:(t=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee2(){var t;return api_regeneratorRuntime().wrap((function _callee2$(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null);case 1:case"end":return r.stop()}}),_callee2,this)}))),function getXfa(){return t.apply(this,arguments)})},{key:"render",value:function render(t){var r,a,i=this,o=t.canvasContext,l=t.viewport,c=t.intent,u=void 0===c?"display":c,d=t.annotationMode,p=void 0===d?y.ENABLE:d,v=t.transform,_=void 0===v?null:v,g=t.background,m=void 0===g?null:g,b=t.optionalContentConfigPromise,w=void 0===b?null:b,P=t.annotationCanvasMap,k=void 0===P?null:P,S=t.pageColors,A=void 0===S?null:S,x=t.printAnnotationStorage,E=void 0===x?null:x;null===(r=this._stats)||void 0===r||r.time("Overall");var I=this._transport.getRenderingIntent(u,p,E);api_classPrivateFieldSet(this,yi,!1);api_classPrivateMethodGet(this,mi,_abortDelayedCleanup2).call(this);w||(w=this._transport.getOptionalContentConfig());var T=this._intentStates.get(I.cacheKey);if(!T){T=Object.create(null);this._intentStates.set(I.cacheKey,T)}if(T.streamReaderCancelTimeout){clearTimeout(T.streamReaderCancelTimeout);T.streamReaderCancelTimeout=null}var C=!!(I.renderingIntent&h);if(!T.displayReadyCapability){var M;T.displayReadyCapability=new ve;T.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};null===(M=this._stats)||void 0===M||M.time("Page Request");this._pumpOperatorList(I)}var G=function complete(t){var r,a;T.renderTasks.delete(O);(i._maybeCleanupAfterRender||C)&&api_classPrivateFieldSet(i,yi,!0);api_classPrivateMethodGet(i,gi,_tryCleanup2).call(i,!C);if(t){O.capability.reject(t);i._abortOperatorList({intentState:T,reason:t instanceof Error?t:new Error(t)})}else O.capability.resolve();null===(r=i._stats)||void 0===r||r.timeEnd("Rendering");null===(a=i._stats)||void 0===a||a.timeEnd("Overall")},O=new Wi({callback:G,params:{canvasContext:o,viewport:l,transform:_,background:m},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:k,operatorList:T.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!C,pdfBug:this._pdfBug,pageColors:A});((a=T).renderTasks||(a.renderTasks=new Set)).add(O);var R=O.task;Promise.all([T.displayReadyCapability.promise,w]).then((function(t){var r,a=api_slicedToArray(t,2),o=a[0],l=a[1];if(i.destroyed)G();else{null===(r=i._stats)||void 0===r||r.time("Rendering");O.initializeGraphics({transparency:o,optionalContentConfig:l});O.operatorListChanged()}})).catch(G);return R}},{key:"getOperatorList",value:function getOperatorList(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.intent,a=void 0===r?"display":r,i=t.annotationMode,o=void 0===i?y.ENABLE:i,l=t.printAnnotationStorage,c=void 0===l?null:l;var u,h=this._transport.getRenderingIntent(a,o,c,!0),d=this._intentStates.get(h.cacheKey);if(!d){d=Object.create(null);this._intentStates.set(h.cacheKey,d)}if(!d.opListReadCapability){var p,v;(u=Object.create(null)).operatorListChanged=function operatorListChanged(){if(d.operatorList.lastChunk){d.opListReadCapability.resolve(d.operatorList);d.renderTasks.delete(u)}};d.opListReadCapability=new ve;((p=d).renderTasks||(p.renderTasks=new Set)).add(u);d.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};null===(v=this._stats)||void 0===v||v.time("Page Request");this._pumpOperatorList(h)}return d.opListReadCapability.promise}},{key:"streamTextContent",value:function streamTextContent(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.includeMarkedContent,a=void 0!==r&&r,i=t.disableNormalization,o=void 0!==i&&i;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===a,disableNormalization:!0===o},{highWaterMark:100,size:function size(t){return t.items.length}})}},{key:"getTextContent",value:function getTextContent(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((function(t){return oi.textContent(t)}));var r=this.streamTextContent(t);return new Promise((function(t,a){var i=r.getReader(),o={items:[],styles:Object.create(null)};!function pump(){i.read().then((function(r){var a,i=r.value;if(r.done)t(o);else{Object.assign(o.styles,i.styles);(a=o.items).push.apply(a,api_toConsumableArray(i.items));pump()}}),a)}()}))}},{key:"getStructTree",value:function getStructTree(){return this._transport.getStructTree(this._pageIndex)}},{key:"_destroy",value:function _destroy(){this.destroyed=!0;var t,r=[],a=api_createForOfIteratorHelper(this._intentStates.values());try{for(a.s();!(t=a.n()).done;){var i=t.value;this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0});if(!i.opListReadCapability){var o,l=api_createForOfIteratorHelper(i.renderTasks);try{for(l.s();!(o=l.n()).done;){var c=o.value;r.push(c.completed);c.cancel()}}catch(t){l.e(t)}finally{l.f()}}}}catch(t){a.e(t)}finally{a.f()}this.objs.clear();api_classPrivateFieldSet(this,yi,!1);api_classPrivateMethodGet(this,mi,_abortDelayedCleanup2).call(this);return Promise.all(r)}},{key:"cleanup",value:function cleanup(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];api_classPrivateFieldSet(this,yi,!0);var r=api_classPrivateMethodGet(this,gi,_tryCleanup2).call(this,!1);t&&r&&this._stats&&(this._stats=new Xe);return r}},{key:"_startRenderPage",value:function _startRenderPage(t,r){var a,i,o=this._intentStates.get(r);if(o){null===(a=this._stats)||void 0===a||a.timeEnd("Page Request");null===(i=o.displayReadyCapability)||void 0===i||i.resolve(t)}}},{key:"_renderPageChunk",value:function _renderPageChunk(t,r){for(var a=0,i=t.length;a<i;a++){r.operatorList.fnArray.push(t.fnArray[a]);r.operatorList.argsArray.push(t.argsArray[a])}r.operatorList.lastChunk=t.lastChunk;r.operatorList.separateAnnots=t.separateAnnots;var o,l=api_createForOfIteratorHelper(r.renderTasks);try{for(l.s();!(o=l.n()).done;){o.value.operatorListChanged()}}catch(t){l.e(t)}finally{l.f()}t.lastChunk&&api_classPrivateMethodGet(this,gi,_tryCleanup2).call(this,!0)}},{key:"_pumpOperatorList",value:function _pumpOperatorList(t){var r=this,a=t.renderingIntent,i=t.cacheKey,o=t.annotationStorageSerializable,l=o.map,c=o.transfer,u=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:a,cacheKey:i,annotationStorage:l},c).getReader(),h=this._intentStates.get(i);h.streamReader=u;!function pump(){u.read().then((function(t){var a=t.value;if(t.done)h.streamReader=null;else if(!r._transport.destroyed){r._renderPageChunk(a,h);pump()}}),(function(t){h.streamReader=null;if(!r._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;var a,i=api_createForOfIteratorHelper(h.renderTasks);try{for(i.s();!(a=i.n()).done;){a.value.operatorListChanged()}}catch(t){i.e(t)}finally{i.f()}api_classPrivateMethodGet(r,gi,_tryCleanup2).call(r,!0)}if(h.displayReadyCapability)h.displayReadyCapability.reject(t);else{if(!h.opListReadCapability)throw t;h.opListReadCapability.reject(t)}}}))}()}},{key:"_abortOperatorList",value:function _abortOperatorList(t){var r=this,a=t.intentState,i=t.reason,o=t.force,l=void 0!==o&&o;if(a.streamReader){if(a.streamReaderCancelTimeout){clearTimeout(a.streamReaderCancelTimeout);a.streamReaderCancelTimeout=null}if(!l){if(a.renderTasks.size>0)return;if(i instanceof Ke){var c=100;i.extraDelay>0&&i.extraDelay<1e3&&(c+=i.extraDelay);a.streamReaderCancelTimeout=setTimeout((function(){a.streamReaderCancelTimeout=null;r._abortOperatorList({intentState:a,reason:i,force:!0})}),c);return}}a.streamReader.cancel(new ue(i.message)).catch((function(){}));a.streamReader=null;if(!this._transport.destroyed){var u,h=api_createForOfIteratorHelper(this._intentStates);try{for(h.s();!(u=h.n()).done;){var d=api_slicedToArray(u.value,2),p=d[0];if(d[1]===a){this._intentStates.delete(p);break}}}catch(t){h.e(t)}finally{h.f()}this.cleanup()}}}},{key:"stats",get:function get(){return this._stats}}]);var t;return PDFPageProxy}();function _tryCleanup2(){var t=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];api_classPrivateMethodGet(this,mi,_abortDelayedCleanup2).call(this);if(!api_classPrivateFieldGet(this,yi)||this.destroyed)return!1;if(r){api_classPrivateFieldSet(this,_i,setTimeout((function(){api_classPrivateFieldSet(t,_i,null);api_classPrivateMethodGet(t,gi,_tryCleanup2).call(t,!1)}),5e3));return!1}var a,i=api_createForOfIteratorHelper(this._intentStates.values());try{for(i.s();!(a=i.n()).done;){var o=a.value,l=o.renderTasks,c=o.operatorList;if(l.size>0||!c.lastChunk)return!1}}catch(t){i.e(t)}finally{i.f()}this._intentStates.clear();this.objs.clear();api_classPrivateFieldSet(this,yi,!1);return!0}function _abortDelayedCleanup2(){if(api_classPrivateFieldGet(this,_i)){clearTimeout(api_classPrivateFieldGet(this,_i));api_classPrivateFieldSet(this,_i,null)}}var wi=new WeakMap,Pi=new WeakMap,ki=function(){function LoopbackPort(){api_classCallCheck(this,LoopbackPort);api_classPrivateFieldInitSpec(this,wi,{writable:!0,value:new Set});api_classPrivateFieldInitSpec(this,Pi,{writable:!0,value:Promise.resolve()})}api_createClass(LoopbackPort,[{key:"postMessage",value:function postMessage(t,r){var a=this,i={data:structuredClone(t,r?{transfer:r}:null)};api_classPrivateFieldGet(this,Pi).then((function(){var t,r=api_createForOfIteratorHelper(api_classPrivateFieldGet(a,wi));try{for(r.s();!(t=r.n()).done;){t.value.call(a,i)}}catch(t){r.e(t)}finally{r.f()}}))}},{key:"addEventListener",value:function addEventListener(t,r){api_classPrivateFieldGet(this,wi).add(r)}},{key:"removeEventListener",value:function removeEventListener(t,r){api_classPrivateFieldGet(this,wi).delete(r)}},{key:"terminate",value:function terminate(){api_classPrivateFieldGet(this,wi).clear()}}]);return LoopbackPort}(),Si={isWorkerDisabled:!1,fakeWorkerId:0};if(r){Si.isWorkerDisabled=!0;la.workerSrc||(la.workerSrc="./pdf.worker.mjs")}Si.isSameOrigin=function(t,r){var a;try{if(!(a=new URL(t)).origin||"null"===a.origin)return!1}catch(t){return!1}var i=new URL(r,a);return a.origin===i.origin};Si.createCDNWrapper=function(t){var r='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([r],{type:"text/javascript"}))};var Fi=new WeakSet,Ai=function(){function PDFWorker(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.name,a=void 0===r?null:r,i=t.port,o=void 0===i?null:i,l=t.verbosity,c=void 0===l?getVerbosityLevel():l;api_classCallCheck(this,PDFWorker);api_classPrivateMethodInitSpec(this,Fi);this.name=a;this.destroyed=!1;this.verbosity=c;this._readyCapability=new ve;this._port=null;this._webWorker=null;this._messageHandler=null;if(o){var u;if(null!==(u=api_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,Ei))&&void 0!==u&&u.has(o))throw new Error("Cannot use more than one PDFWorker per port.");(api_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,Ei)||api_classStaticPrivateFieldSpecSet(PDFWorker,PDFWorker,Ei,new WeakMap)).set(o,this);this._initializeFromPort(o)}else this._initialize()}api_createClass(PDFWorker,[{key:"promise",get:function get(){return this._readyCapability.promise}},{key:"port",get:function get(){return this._port}},{key:"messageHandler",get:function get(){return this._messageHandler}},{key:"_initializeFromPort",value:function _initializeFromPort(t){this._port=t;this._messageHandler=new Sa("main","worker",t);this._messageHandler.on("ready",(function(){}));this._readyCapability.resolve();this._messageHandler.send("configure",{verbosity:this.verbosity})}},{key:"_initialize",value:function _initialize(){var t=this;if(!Si.isWorkerDisabled&&!api_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,xi)){var r=PDFWorker.workerSrc;try{Si.isSameOrigin(window.location.href,r)||(r=Si.createCDNWrapper(new URL(r,window.location).href));var a=new Worker(api_classPrivateMethodGet(this,Fi,_generateTrustedURL2).call(this,r),{type:"module"}),i=new Sa("main","worker",a),o=function terminateEarly(){a.removeEventListener("error",l);i.destroy();a.terminate();t.destroyed?t._readyCapability.reject(new Error("Worker was destroyed")):t._setupFakeWorker()},l=function onWorkerError(){t._webWorker||o()};a.addEventListener("error",l);i.on("test",(function(r){a.removeEventListener("error",l);if(t.destroyed)o();else if(r){t._messageHandler=i;t._port=a;t._webWorker=a;t._readyCapability.resolve();i.send("configure",{verbosity:t.verbosity})}else{t._setupFakeWorker();i.destroy();a.terminate()}}));i.on("ready",(function(r){a.removeEventListener("error",l);if(t.destroyed)o();else try{c()}catch(r){t._setupFakeWorker()}}));var c=function sendTest(){var t=new Uint8Array;i.send("test",t,[t.buffer])};c();return}catch(t){info("The worker has been disabled.")}}this._setupFakeWorker()}},{key:"_setupFakeWorker",value:function _setupFakeWorker(){var t=this;if(!Si.isWorkerDisabled){warn("Setting up fake worker.");Si.isWorkerDisabled=!0}PDFWorker._setupFakeWorkerGlobal.then((function(r){if(t.destroyed)t._readyCapability.reject(new Error("Worker was destroyed"));else{var a=new ki;t._port=a;var i="fake".concat(Si.fakeWorkerId++),o=new Sa(i+"_worker",i,a);r.setup(o,a);var l=new Sa(i,i+"_worker",a);t._messageHandler=l;t._readyCapability.resolve();l.send("configure",{verbosity:t.verbosity})}})).catch((function(r){t._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(r.message,'".')))}))}},{key:"destroy",value:function destroy(){var t;this.destroyed=!0;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}null===(t=api_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,Ei))||void 0===t||t.delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}}],[{key:"fromPort",value:function fromPort(t){var r;if(null==t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");var a=null===(r=api_classStaticPrivateFieldSpecGet(this,PDFWorker,Ei))||void 0===r?void 0:r.get(t.port);if(a){if(a._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return a}return new PDFWorker(t)}},{key:"workerSrc",get:function get(){if(la.workerSrc)return"Function"===la.workerSrc.constructor.name?la.workerSrc():la.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}},{key:"_setupFakeWorkerGlobal",get:function get(){var t=this,r=function(){var r=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee3(){var r;return api_regeneratorRuntime().wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:if(!api_classStaticPrivateFieldSpecGet(t,PDFWorker,xi)){a.next=2;break}return a.abrupt("return",api_classStaticPrivateFieldSpecGet(t,PDFWorker,xi));case 2:a.next=4;return import(t.workerSrc);case 4:r=a.sent;return a.abrupt("return",r.WorkerMessageHandler);case 6:case"end":return a.stop()}}),_callee3)})));return function loader(){return r.apply(this,arguments)}}();return shadow(this,"_setupFakeWorkerGlobal",r())}}]);return PDFWorker}();function _generateTrustedURL2(t){if(window.trustedTypes){var r=window.trustedTypes.createPolicy("foo",{createScriptURL:function createScriptURL(t){return t}});return r.createScriptURL(t)}return t}var xi={get:function _get_mainThreadWorkerMessageHandler(){try{var t;return(null===(t=globalThis.pdfjsWorker)||void 0===t?void 0:t.WorkerMessageHandler)||null}catch(t){return null}},set:void 0},Ei={writable:!0,value:void 0},Ii=new WeakMap,Ti=new WeakMap,Ci=new WeakMap,Mi=new WeakMap,Gi=new WeakSet,Oi=function(){function WorkerTransport(t,r,a,i,o){api_classCallCheck(this,WorkerTransport);api_classPrivateMethodInitSpec(this,Gi);api_classPrivateFieldInitSpec(this,Ii,{writable:!0,value:new Map});api_classPrivateFieldInitSpec(this,Ti,{writable:!0,value:new Map});api_classPrivateFieldInitSpec(this,Ci,{writable:!0,value:new Map});api_classPrivateFieldInitSpec(this,Mi,{writable:!0,value:null});this.messageHandler=t;this.loadingTask=r;this.commonObjs=new Di;this.fontLoader=new En({ownerDocument:i.ownerDocument,styleElement:i.styleElement});this._params=i;this.canvasFactory=o.canvasFactory;this.filterFactory=o.filterFactory;this.cMapReaderFactory=o.cMapReaderFactory;this.standardFontDataFactory=o.standardFontDataFactory;this.destroyed=!1;this.destroyCapability=null;this._networkStream=a;this._fullReader=null;this._lastProgress=null;this.downloadInfoCapability=new ve;this.setupMessageHandler()}api_createClass(WorkerTransport,[{key:"annotationStorage",get:function get(){return shadow(this,"annotationStorage",new kn)}},{key:"getRenderingIntent",value:function getRenderingIntent(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.ENABLE,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=u,l=mn;switch(t){case"any":o=c;break;case"display":break;case"print":o=h;break;default:warn("getRenderingIntent - invalid intent: ".concat(t))}switch(r){case y.DISABLE:o+=v;break;case y.ENABLE:break;case y.ENABLE_FORMS:o+=d;break;case y.ENABLE_STORAGE:l=((o+=p)&h&&a instanceof Fn?a:this.annotationStorage).serializable;break;default:warn("getRenderingIntent - invalid annotationMode: ".concat(r))}i&&(o+=_);return{renderingIntent:o,cacheKey:"".concat(o,"_").concat(l.hash),annotationStorageSerializable:l}}},{key:"destroy",value:function destroy(){var t,r=this;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=new ve;null===(t=api_classPrivateFieldGet(this,Mi))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));var a,i=[],o=api_createForOfIteratorHelper(api_classPrivateFieldGet(this,Ti).values());try{for(o.s();!(a=o.n()).done;){var l=a.value;i.push(l._destroy())}}catch(t){o.e(t)}finally{o.f()}api_classPrivateFieldGet(this,Ti).clear();api_classPrivateFieldGet(this,Ci).clear();this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();var c=this.messageHandler.sendWithPromise("Terminate",null);i.push(c);Promise.all(i).then((function(){var t;r.commonObjs.clear();r.fontLoader.clear();api_classPrivateFieldGet(r,Ii).clear();r.filterFactory.destroy();cleanupTextLayer();null===(t=r._networkStream)||void 0===t||t.cancelAllRequests(new ue("Worker was terminated."));if(r.messageHandler){r.messageHandler.destroy();r.messageHandler=null}r.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise}},{key:"setupMessageHandler",value:function setupMessageHandler(){var t=this,r=this.messageHandler,a=this.loadingTask;r.on("GetReader",(function(r,a){assert(t._networkStream,"GetReader - no `IPDFStream` instance available.");t._fullReader=t._networkStream.getFullReader();t._fullReader.onProgress=function(r){t._lastProgress={loaded:r.loaded,total:r.total}};a.onPull=function(){t._fullReader.read().then((function(t){var r=t.value;if(t.done)a.close();else{assert(r instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer.");a.enqueue(new Uint8Array(r),1,[r])}})).catch((function(t){a.error(t)}))};a.onCancel=function(r){t._fullReader.cancel(r);a.ready.catch((function(r){if(!t.destroyed)throw r}))}}));r.on("ReaderHeadersReady",(function(r){var i=new ve,o=t._fullReader;o.headersReady.then((function(){if(!o.isStreamingSupported||!o.isRangeSupported){if(t._lastProgress){var r;null===(r=a.onProgress)||void 0===r||r.call(a,t._lastProgress)}o.onProgress=function(t){var r;null===(r=a.onProgress)||void 0===r||r.call(a,{loaded:t.loaded,total:t.total})}}i.resolve({isStreamingSupported:o.isStreamingSupported,isRangeSupported:o.isRangeSupported,contentLength:o.contentLength})}),i.reject);return i.promise}));r.on("GetRangeReader",(function(r,a){assert(t._networkStream,"GetRangeReader - no `IPDFStream` instance available.");var i=t._networkStream.getRangeReader(r.begin,r.end);if(i){a.onPull=function(){i.read().then((function(t){var r=t.value;if(t.done)a.close();else{assert(r instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer.");a.enqueue(new Uint8Array(r),1,[r])}})).catch((function(t){a.error(t)}))};a.onCancel=function(r){i.cancel(r);a.ready.catch((function(r){if(!t.destroyed)throw r}))}}else a.close()}));r.on("GetDoc",(function(r){var i=r.pdfInfo;t._numPages=i.numPages;t._htmlForXfa=i.htmlForXfa;delete i.htmlForXfa;a._capability.resolve(new vi(i,t))}));r.on("DocException",(function(t){var r;switch(t.name){case"PasswordException":r=new ae(t.message,t.code);break;case"InvalidPDFException":r=new oe(t.message);break;case"MissingPDFException":r=new se(t.message);break;case"UnexpectedResponseException":r=new le(t.message,t.status);break;case"UnknownErrorException":r=new ie(t.message,t.details);break;default:unreachable("DocException - expected a valid Error.")}a._capability.reject(r)}));r.on("PasswordRequest",(function(r){api_classPrivateFieldSet(t,Mi,new ve);if(a.onPassword){try{a.onPassword((function updatePassword(r){r instanceof Error?api_classPrivateFieldGet(t,Mi).reject(r):api_classPrivateFieldGet(t,Mi).resolve({password:r})}),r.code)}catch(r){api_classPrivateFieldGet(t,Mi).reject(r)}}else api_classPrivateFieldGet(t,Mi).reject(new ae(r.message,r.code));return api_classPrivateFieldGet(t,Mi).promise}));r.on("DataLoaded",(function(r){var i;null===(i=a.onProgress)||void 0===i||i.call(a,{loaded:r.length,total:r.length});t.downloadInfoCapability.resolve(r)}));r.on("StartRenderPage",(function(r){if(!t.destroyed){api_classPrivateFieldGet(t,Ti).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}}));r.on("commonobj",(function(a){var i,o=api_slicedToArray(a,3),l=o[0],c=o[1],u=o[2];if(t.destroyed)return null;if(t.commonObjs.has(l))return null;switch(c){case"Font":var h=t._params;if("error"in u){var d=u.error;warn("Error during font loading: ".concat(d));t.commonObjs.resolve(l,d);break}var p=h.pdfBug&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?function(t,r){return globalThis.FontInspector.fontAdded(t,r)}:null,v=new In(u,{isEvalSupported:h.isEvalSupported,disableFontFace:h.disableFontFace,ignoreErrors:h.ignoreErrors,inspectFont:p});t.fontLoader.bind(v).catch((function(){return r.sendWithPromise("FontFallback",{id:l})})).finally((function(){!h.fontExtraProperties&&v.data&&(v.data=null);t.commonObjs.resolve(l,v)}));break;case"CopyLocalImage":var _=u.imageRef;assert(_,"The imageRef must be defined.");var y,g=api_createForOfIteratorHelper(api_classPrivateFieldGet(t,Ti).values());try{for(g.s();!(y=g.n()).done;){var m,b=api_createForOfIteratorHelper(y.value.objs);try{for(b.s();!(m=b.n()).done;){var w=api_slicedToArray(m.value,2)[1];if(w.ref===_){if(!w.dataLen)return null;t.commonObjs.resolve(l,structuredClone(w));return w.dataLen}}}catch(t){b.e(t)}finally{b.f()}}}catch(t){g.e(t)}finally{g.f()}break;case"FontPath":case"Image":case"Pattern":t.commonObjs.resolve(l,u);break;default:throw new Error("Got unknown common object type ".concat(c))}return null}));r.on("obj",(function(r){var a=api_slicedToArray(r,4),i=a[0],o=a[1],l=a[2],c=a[3];if(!t.destroyed){var u=api_classPrivateFieldGet(t,Ti).get(o);if(!u.objs.has(i))if(0!==u._intentStates.size)switch(l){case"Image":u.objs.resolve(i,c);(null==c?void 0:c.dataLen)>1e7&&(u._maybeCleanupAfterRender=!0);break;case"Pattern":u.objs.resolve(i,c);break;default:throw new Error("Got unknown object type ".concat(l))}else{var h;null==c||null===(h=c.bitmap)||void 0===h||h.close()}}}));r.on("DocProgress",(function(r){var i;t.destroyed||null===(i=a.onProgress)||void 0===i||i.call(a,{loaded:r.loaded,total:r.total})}));r.on("FetchBuiltInCMap",(function(r){return t.destroyed?Promise.reject(new Error("Worker was destroyed.")):t.cMapReaderFactory?t.cMapReaderFactory.fetch(r):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))}));r.on("FetchStandardFontData",(function(r){return t.destroyed?Promise.reject(new Error("Worker was destroyed.")):t.standardFontDataFactory?t.standardFontDataFactory.fetch(r):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))}))}},{key:"getData",value:function getData(){return this.messageHandler.sendWithPromise("GetData",null)}},{key:"saveDocument",value:function saveDocument(){var t,r,a=this;this.annotationStorage.size<=0&&warn("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");var i=this.annotationStorage.serializable,o=i.map,l=i.transfer;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:o,filename:null!==(t=null===(r=this._fullReader)||void 0===r?void 0:r.filename)&&void 0!==t?t:null},l).finally((function(){a.annotationStorage.resetModified()}))}},{key:"getPage",value:function getPage(t){var r=this;if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));var a=t-1,i=api_classPrivateFieldGet(this,Ci).get(a);if(i)return i;var o=this.messageHandler.sendWithPromise("GetPage",{pageIndex:a}).then((function(t){if(r.destroyed)throw new Error("Transport destroyed");var i=new bi(a,t,r,r._params.pdfBug);api_classPrivateFieldGet(r,Ti).set(a,i);return i}));api_classPrivateFieldGet(this,Ci).set(a,o);return o}},{key:"getPageIndex",value:function getPageIndex(t){return"object"!==api_typeof(t)||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}},{key:"getAnnotations",value:function getAnnotations(t,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:r})}},{key:"getFieldObjects",value:function getFieldObjects(){return api_classPrivateMethodGet(this,Gi,_cacheSimpleMethod2).call(this,"GetFieldObjects")}},{key:"hasJSActions",value:function hasJSActions(){return api_classPrivateMethodGet(this,Gi,_cacheSimpleMethod2).call(this,"HasJSActions")}},{key:"getCalculationOrderIds",value:function getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}},{key:"getDestinations",value:function getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}},{key:"getDestination",value:function getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}},{key:"getPageLabels",value:function getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}},{key:"getPageLayout",value:function getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}},{key:"getPageMode",value:function getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}},{key:"getViewerPreferences",value:function getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}},{key:"getOpenAction",value:function getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}},{key:"getAttachments",value:function getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}},{key:"getDocJSActions",value:function getDocJSActions(){return api_classPrivateMethodGet(this,Gi,_cacheSimpleMethod2).call(this,"GetDocJSActions")}},{key:"getPageJSActions",value:function getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}},{key:"getStructTree",value:function getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}},{key:"getOutline",value:function getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}},{key:"getOptionalContentConfig",value:function getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((function(t){return new La(t)}))}},{key:"getPermissions",value:function getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}},{key:"getMetadata",value:function getMetadata(){var t=this,r="GetMetadata",a=api_classPrivateFieldGet(this,Ii).get(r);if(a)return a;var i=this.messageHandler.sendWithPromise(r,null).then((function(r){var a,i,o,l;return{info:r[0],metadata:r[1]?new xa(r[1]):null,contentDispositionFilename:null!==(a=null===(i=t._fullReader)||void 0===i?void 0:i.filename)&&void 0!==a?a:null,contentLength:null!==(o=null===(l=t._fullReader)||void 0===l?void 0:l.contentLength)&&void 0!==o?o:null}}));api_classPrivateFieldGet(this,Ii).set(r,i);return i}},{key:"getMarkInfo",value:function getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}},{key:"startCleanup",value:(t=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee4(){var t,r,a,i,o=arguments;return api_regeneratorRuntime().wrap((function _callee4$(l){for(;;)switch(l.prev=l.next){case 0:t=o.length>0&&void 0!==o[0]&&o[0];if(!this.destroyed){l.next=3;break}return l.abrupt("return");case 3:l.next=5;return this.messageHandler.sendWithPromise("Cleanup",null);case 5:r=api_createForOfIteratorHelper(api_classPrivateFieldGet(this,Ti).values());l.prev=6;r.s();case 8:if((a=r.n()).done){l.next=15;break}if((i=a.value).cleanup()){l.next=13;break}throw new Error("startCleanup: Page ".concat(i.pageNumber," is currently rendering."));case 13:l.next=8;break;case 15:l.next=20;break;case 17:l.prev=17;l.t0=l.catch(6);r.e(l.t0);case 20:l.prev=20;r.f();return l.finish(20);case 23:this.commonObjs.clear();t||this.fontLoader.clear();api_classPrivateFieldGet(this,Ii).clear();this.filterFactory.destroy(!0);cleanupTextLayer();case 28:case"end":return l.stop()}}),_callee4,this,[[6,17,20,23]])}))),function startCleanup(){return t.apply(this,arguments)})},{key:"loadingParams",get:function get(){var t=this._params;return shadow(this,"loadingParams",{disableAutoFetch:t.disableAutoFetch,enableXfa:t.enableXfa})}}]);var t;return WorkerTransport}();function _cacheSimpleMethod2(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=api_classPrivateFieldGet(this,Ii).get(t);if(a)return a;var i=this.messageHandler.sendWithPromise(t,r);api_classPrivateFieldGet(this,Ii).set(t,i);return i}var Ri=new WeakMap,Li=new WeakSet;ii=Symbol.iterator;var Di=function(){function PDFObjects(){api_classCallCheck(this,PDFObjects);api_classPrivateMethodInitSpec(this,Li);api_classPrivateFieldInitSpec(this,Ri,{writable:!0,value:Object.create(null)})}api_createClass(PDFObjects,[{key:"get",value:function get(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(r){var a=api_classPrivateMethodGet(this,Li,_ensureObj2).call(this,t);a.capability.promise.then((function(){return r(a.data)}));return null}var i=api_classPrivateFieldGet(this,Ri)[t];if(null==i||!i.capability.settled)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}},{key:"has",value:function has(t){var r,a=api_classPrivateFieldGet(this,Ri)[t];return null!==(r=null==a?void 0:a.capability.settled)&&void 0!==r&&r}},{key:"resolve",value:function resolve(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=api_classPrivateMethodGet(this,Li,_ensureObj2).call(this,t);a.data=r;a.capability.resolve()}},{key:"clear",value:function clear(){for(var t in api_classPrivateFieldGet(this,Ri)){var r,a=api_classPrivateFieldGet(this,Ri)[t].data;null==a||null===(r=a.bitmap)||void 0===r||r.close()}api_classPrivateFieldSet(this,Ri,Object.create(null))}},{key:ii,value:api_regeneratorRuntime().mark((function value(){var t,r,a,i;return api_regeneratorRuntime().wrap((function value$(o){for(;;)switch(o.prev=o.next){case 0:o.t0=api_regeneratorRuntime().keys(api_classPrivateFieldGet(this,Ri));case 1:if((o.t1=o.t0()).done){o.next=10;break}t=o.t1.value;r=api_classPrivateFieldGet(this,Ri)[t],a=r.capability,i=r.data;if(a.settled){o.next=6;break}return o.abrupt("continue",1);case 6:o.next=8;return[t,i];case 8:o.next=1;break;case 10:case"end":return o.stop()}}),value,this)}))}]);return PDFObjects}();function _ensureObj2(t){var r;return(r=api_classPrivateFieldGet(this,Ri))[t]||(r[t]={capability:new ve,data:null})}var ji=new WeakMap,Ni=function(){function RenderTask(t){api_classCallCheck(this,RenderTask);api_classPrivateFieldInitSpec(this,ji,{writable:!0,value:null});api_classPrivateFieldSet(this,ji,t);this.onContinue=null}api_createClass(RenderTask,[{key:"promise",get:function get(){return api_classPrivateFieldGet(this,ji).capability.promise}},{key:"cancel",value:function cancel(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;api_classPrivateFieldGet(this,ji).cancel(null,t)}},{key:"separateAnnots",get:function get(){var t=api_classPrivateFieldGet(this,ji).operatorList.separateAnnots;if(!t)return!1;var r=api_classPrivateFieldGet(this,ji).annotationCanvasMap;return t.form||t.canvas&&(null==r?void 0:r.size)>0}}]);return RenderTask}(),Wi=function(){function InternalRenderTask(t){var r=t.callback,a=t.params,i=t.objs,o=t.commonObjs,l=t.annotationCanvasMap,c=t.operatorList,u=t.pageIndex,h=t.canvasFactory,d=t.filterFactory,p=t.useRequestAnimationFrame,v=void 0!==p&&p,_=t.pdfBug,y=void 0!==_&&_,g=t.pageColors,m=void 0===g?null:g;api_classCallCheck(this,InternalRenderTask);this.callback=r;this.params=a;this.objs=i;this.commonObjs=o;this.annotationCanvasMap=l;this.operatorListIdx=null;this.operatorList=c;this._pageIndex=u;this.canvasFactory=h;this.filterFactory=d;this._pdfBug=y;this.pageColors=m;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===v&&"undefined"!=typeof window;this.cancelled=!1;this.capability=new ve;this.task=new Ni(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=a.canvasContext.canvas}api_createClass(InternalRenderTask,[{key:"completed",get:function get(){return this.capability.promise.catch((function(){}))}},{key:"initializeGraphics",value:function initializeGraphics(t){var r,a,i=t.transparency,o=void 0!==i&&i,l=t.optionalContentConfig;if(!this.cancelled){if(this._canvas){if(api_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,Hi).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.");api_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,Hi).add(this._canvas)}if(this._pdfBug&&null!==(r=globalThis.StepperManager)&&void 0!==r&&r.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}var c=this.params,u=c.canvasContext,h=c.viewport,d=c.transform,p=c.background;this.gfx=new ta(u,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:l},this.annotationCanvasMap,this.pageColors);this.gfx.beginDrawing({transform:d,viewport:h,transparency:o,background:p});this.operatorListIdx=0;this.graphicsReady=!0;null===(a=this.graphicsReadyCallback)||void 0===a||a.call(this)}}},{key:"cancel",value:function cancel(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=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();api_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,Hi).delete(this._canvas);this.callback(r||new Ke("Rendering cancelled, page ".concat(this._pageIndex+1),a))}},{key:"operatorListChanged",value:function operatorListChanged(){var t;if(this.graphicsReady){null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}},{key:"_continue",value:function _continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}},{key:"_scheduleNext",value:function _scheduleNext(){var t=this;window.ngxZone.runOutsideAngular((function(){t._useRequestAnimationFrame?window.requestAnimationFrame((function(){t._nextBound().catch(t._cancelBound)})):Promise.resolve().then(t._nextBound).catch(t._cancelBound)}))}},{key:"_next",value:(t=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee5(){return api_regeneratorRuntime().wrap((function _callee5$(t){for(;;)switch(t.prev=t.next){case 0:if(!this.cancelled){t.next=2;break}return t.abrupt("return");case 2:this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing();api_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,Hi).delete(this._canvas);this.callback()}}case 4:case"end":return t.stop()}}),_callee5,this)}))),function _next(){return t.apply(this,arguments)})}]);var t;return InternalRenderTask}(),Hi={writable:!0,value:new WeakSet},Bi="4.1.612",zi="7cae81d9f";__webpack_require__(1919),__webpack_require__(9474),__webpack_require__(2349),__webpack_require__(6386),__webpack_require__(9772),__webpack_require__(4564),__webpack_require__(385),__webpack_require__(6466),__webpack_require__(9411);function scripting_utils_typeof(t){return scripting_utils_typeof="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},scripting_utils_typeof(t)}function scripting_utils_slicedToArray(t,r){return function scripting_utils_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function scripting_utils_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||function scripting_utils_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return scripting_utils_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return scripting_utils_arrayLikeToArray(t,r)}(t,r)||function scripting_utils_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function scripting_utils_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function scripting_utils_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,scripting_utils_toPropertyKey(i.key),i)}}function scripting_utils_toPropertyKey(t){var r=function scripting_utils_toPrimitive(t,r){if("object"!=scripting_utils_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=scripting_utils_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==scripting_utils_typeof(r)?r:String(r)}function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function scaleAndClamp(t){return Math.max(0,Math.min(255,255*t))}var Ui=function(){function ColorConverters(){!function scripting_utils_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,ColorConverters)}!function scripting_utils_createClass(t,r,a){r&&scripting_utils_defineProperties(t.prototype,r);a&&scripting_utils_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(ColorConverters,null,[{key:"CMYK_G",value:function CMYK_G(t){var r=scripting_utils_slicedToArray(t,4),a=r[0],i=r[1],o=r[2],l=r[3];return["G",1-Math.min(1,.3*a+.59*o+.11*i+l)]}},{key:"G_CMYK",value:function G_CMYK(t){return["CMYK",0,0,0,1-scripting_utils_slicedToArray(t,1)[0]]}},{key:"G_RGB",value:function G_RGB(t){var r=scripting_utils_slicedToArray(t,1)[0];return["RGB",r,r,r]}},{key:"G_rgb",value:function G_rgb(t){var r=scripting_utils_slicedToArray(t,1)[0];return[r=scaleAndClamp(r),r,r]}},{key:"G_HTML",value:function G_HTML(t){var r=makeColorComp(scripting_utils_slicedToArray(t,1)[0]);return"#".concat(r).concat(r).concat(r)}},{key:"RGB_G",value:function RGB_G(t){var r=scripting_utils_slicedToArray(t,3);return["G",.3*r[0]+.59*r[1]+.11*r[2]]}},{key:"RGB_rgb",value:function RGB_rgb(t){return t.map(scaleAndClamp)}},{key:"RGB_HTML",value:function RGB_HTML(t){return"#".concat(t.map(makeColorComp).join(""))}},{key:"T_HTML",value:function T_HTML(){return"#00000000"}},{key:"T_rgb",value:function T_rgb(){return[null]}},{key:"CMYK_RGB",value:function CMYK_RGB(t){var r=scripting_utils_slicedToArray(t,4),a=r[0],i=r[1],o=r[2],l=r[3];return["RGB",1-Math.min(1,a+l),1-Math.min(1,o+l),1-Math.min(1,i+l)]}},{key:"CMYK_rgb",value:function CMYK_rgb(t){var r=scripting_utils_slicedToArray(t,4),a=r[0],i=r[1],o=r[2],l=r[3];return[scaleAndClamp(1-Math.min(1,a+l)),scaleAndClamp(1-Math.min(1,o+l)),scaleAndClamp(1-Math.min(1,i+l))]}},{key:"CMYK_HTML",value:function CMYK_HTML(t){var r=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(r)}},{key:"RGB_CMYK",value:function RGB_CMYK(t){var r=scripting_utils_slicedToArray(t,3),a=1-r[0],i=1-r[1],o=1-r[2];return["CMYK",a,i,o,Math.min(a,i,o)]}}]);return ColorConverters}();function xfa_layer_typeof(t){return xfa_layer_typeof="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},xfa_layer_typeof(t)}function xfa_layer_slicedToArray(t,r){return function xfa_layer_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function xfa_layer_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||xfa_layer_unsupportedIterableToArray(t,r)||function xfa_layer_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xfa_layer_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=xfa_layer_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function xfa_layer_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return xfa_layer_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?xfa_layer_arrayLikeToArray(t,r):void 0}}function xfa_layer_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function xfa_layer_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,xfa_layer_toPropertyKey(i.key),i)}}function xfa_layer_toPropertyKey(t){var r=function xfa_layer_toPrimitive(t,r){if("object"!=xfa_layer_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=xfa_layer_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==xfa_layer_typeof(r)?r:String(r)}var qi=function(){function XfaLayer(){!function xfa_layer_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,XfaLayer)}!function xfa_layer_createClass(t,r,a){r&&xfa_layer_defineProperties(t.prototype,r);a&&xfa_layer_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(XfaLayer,null,[{key:"setupStorage",value:function setupStorage(t,r,a,i,o){var l=window.getFormValueFromAngular(t);l.value&&i.setValue(r,l);var c=l.value?l:i.getValue(r,{value:null});window.registerXFAField(t,c);t.addEventListener("updateFromAngular",(function(t){return i.setValue(r,{value:t.detail})}));switch(a.name){case"textarea":null!==c.value&&(t.textContent=c.value);if("print"===o)break;t.addEventListener("input",(function(a){window.updateAngularFormValue(t,{value:a.target.value});i.setValue(r,{value:a.target.value})}));break;case"input":if("radio"===a.attributes.type||"checkbox"===a.attributes.type){c.value===a.attributes.xfaOn?t.setAttribute("checked",!0):t.removeAttribute("checked");if("print"===o)break;t.addEventListener("change",(function(a){window.updateAngularFormValue(t,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")});i.setValue(r,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})}))}else{null!==c.value&&t.setAttribute("value",c.value);if("print"===o)break;t.addEventListener("input",(function(a){window.updateAngularFormValue(t,{value:a.target.value});i.setValue(r,{value:a.target.value})}))}break;case"select":if(null!==c.value){t.setAttribute("value",c.value);var u,h=xfa_layer_createForOfIteratorHelper(a.children);try{for(h.s();!(u=h.n()).done;){var d=u.value;d.attributes.value===c.value?d.attributes.selected=!0:d.attributes.hasOwnProperty("selected")&&delete d.attributes.selected}}catch(t){h.e(t)}finally{h.f()}}t.addEventListener("input",(function(a){var o=a.target.options,l=-1===o.selectedIndex?"":o[o.selectedIndex].value;window.updateAngularFormValue(t,{value:l});i.setValue(r,{value:l})}))}}},{key:"setAttributes",value:function setAttributes(t){var r=t.html,a=t.element,i=t.storage,o=void 0===i?null:i,l=t.intent,c=t.linkService,u=a.attributes,h=r instanceof HTMLAnchorElement;"radio"===u.type&&(u.name="".concat(u.name,"-").concat(l));for(var d=0,p=Object.entries(u);d<p.length;d++){var v=xfa_layer_slicedToArray(p[d],2),_=v[0],y=v[1];if(null!=y)switch(_){case"class":y.length&&r.setAttribute(_,y.join(" "));break;case"dataId":break;case"id":r.setAttribute("data-element-id",y);break;case"style":Object.assign(r.style,y);break;case"textContent":r.textContent=y;break;default:(!h||"href"!==_&&"newWindow"!==_)&&r.setAttribute(_,y)}}h&&c.addLinkAttributes(r,u.href,u.newWindow);o&&u.dataId&&this.setupStorage(r,u.dataId,a,o)}},{key:"render",value:function render(t){var r=t.annotationStorage,a=t.linkService,i=t.xfaHtml,o=t.intent||"display",l=document.createElement(i.name);i.attributes&&this.setAttributes({html:l,element:i,intent:o,linkService:a});var c="richText"!==o,u=t.div;u.append(l);if(t.viewport){var h="matrix(".concat(t.viewport.transform.join(","),")");u.style.transform=h}c&&u.setAttribute("class","xfaLayer xfaFont");var d=[];if(0===i.children.length){if(i.value){var p=document.createTextNode(i.value);l.append(p);c&&oi.shouldBuildText(i.name)&&d.push(p)}return{textDivs:d}}for(var v=[[i,-1,l]];v.length>0;){var _,y,g=xfa_layer_slicedToArray(v.at(-1),3),m=g[0],b=g[1],w=g[2];if(b+1!==m.children.length){var P=m.children[++v.at(-1)[1]];if(null!==P){var k=P.name;if("#text"!==k){var S=null!=P&&null!==(_=P.attributes)&&void 0!==_&&_.xmlns?document.createElementNS(P.attributes.xmlns,k):document.createElement(k);w.append(S);P.attributes&&this.setAttributes({html:S,element:P,storage:r,intent:o,linkService:a});if((null===(y=P.children)||void 0===y?void 0:y.length)>0)v.push([P,-1,S]);else if(P.value){var A=document.createTextNode(P.value);c&&oi.shouldBuildText(k)&&d.push(A);S.append(A)}}else{var x=document.createTextNode(P.value);d.push(x);w.append(x)}}}else v.pop()}var E,I=xfa_layer_createForOfIteratorHelper(u.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"));try{for(I.s();!(E=I.n()).done;){E.value.setAttribute("readOnly",!0)}}catch(t){I.e(t)}finally{I.f()}return{textDivs:d}}},{key:"update",value:function update(t){var r="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=r;t.div.hidden=!1}}]);return XfaLayer}();function annotation_layer_typeof(t){return annotation_layer_typeof="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},annotation_layer_typeof(t)}function annotation_layer_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */annotation_layer_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==annotation_layer_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(annotation_layer_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function annotation_layer_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function annotation_layer_get(){annotation_layer_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=annotation_layer_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}};return annotation_layer_get.apply(this,arguments)}function annotation_layer_toConsumableArray(t){return function annotation_layer_arrayWithoutHoles(t){if(Array.isArray(t))return annotation_layer_arrayLikeToArray(t)}(t)||function annotation_layer_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||annotation_layer_unsupportedIterableToArray(t)||function annotation_layer_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function annotation_layer_callSuper(t,r,a){return r=annotation_layer_getPrototypeOf(r),function annotation_layer_possibleConstructorReturn(t,r){if(r&&("object"===annotation_layer_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return annotation_layer_assertThisInitialized(t)}(t,annotation_layer_isNativeReflectConstruct()?Reflect.construct(r,a||[],annotation_layer_getPrototypeOf(t).constructor):r.apply(t,a))}function annotation_layer_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(annotation_layer_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function annotation_layer_getPrototypeOf(t){annotation_layer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return annotation_layer_getPrototypeOf(t)}function annotation_layer_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function annotation_layer_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&annotation_layer_setPrototypeOf(t,r)}function annotation_layer_setPrototypeOf(t,r){annotation_layer_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return annotation_layer_setPrototypeOf(t,r)}function annotation_layer_classPrivateMethodInitSpec(t,r){annotation_layer_checkPrivateRedeclaration(t,r);r.add(t)}function annotation_layer_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function annotation_layer_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=annotation_layer_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function annotation_layer_slicedToArray(t,r){return function annotation_layer_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function annotation_layer_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||annotation_layer_unsupportedIterableToArray(t,r)||function annotation_layer_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function annotation_layer_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return annotation_layer_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?annotation_layer_arrayLikeToArray(t,r):void 0}}function annotation_layer_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function annotation_layer_defineProperty(t,r,a){(r=annotation_layer_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function annotation_layer_classPrivateFieldInitSpec(t,r,a){annotation_layer_checkPrivateRedeclaration(t,r);r.set(t,a)}function annotation_layer_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function annotation_layer_classPrivateFieldGet(t,r){return function annotation_layer_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,annotation_layer_classExtractFieldDescriptor(t,r,"get"))}function annotation_layer_classPrivateFieldSet(t,r,a){!function annotation_layer_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,annotation_layer_classExtractFieldDescriptor(t,r,"set"),a);return a}function annotation_layer_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function annotation_layer_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function annotation_layer_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,annotation_layer_toPropertyKey(i.key),i)}}function annotation_layer_createClass(t,r,a){r&&annotation_layer_defineProperties(t.prototype,r);a&&annotation_layer_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function annotation_layer_toPropertyKey(t){var r=function annotation_layer_toPrimitive(t,r){if("object"!=annotation_layer_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=annotation_layer_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==annotation_layer_typeof(r)?r:String(r)}var Vi=1e3,Ki=new WeakSet;function getRectDims(t){return{width:t[2]-t[0],height:t[3]-t[1]}}var Yi=function(){function AnnotationElementFactory(){annotation_layer_classCallCheck(this,AnnotationElementFactory)}annotation_layer_createClass(AnnotationElementFactory,null,[{key:"create",value:function create(t){switch(t.data.annotationType){case T:return new eo(t);case I:return new to(t);case V:switch(t.data.fieldType){case"Tx":return new no(t);case"Btn":return t.data.radioButton?new oo(t):t.data.checkBox?new io(t):new so(t);case"Ch":return new lo(t);case"Sig":return new ao(t)}return new ro(t);case U:return new co(t);case C:return new Go(t);case M:return new Ro(t);case G:return new Do(t);case O:return new No(t);case L:return new Ho(t);case B:return new zo(t);case z:return new qo(t);case R:return new Bo(t);case D:return new Vo(t);case j:return new Ko(t);case N:return new Yo(t);case W:return new Xo(t);case H:return new $o(t);case q:return new Zo(t);default:return new $i(t)}}}]);return AnnotationElementFactory}(),Xi=new WeakMap,$i=function(){function AnnotationElement(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.isRenderable,i=void 0!==a&&a,o=r.ignoreBorder,l=void 0!==o&&o,c=r.createQuadrilaterals,u=void 0!==c&&c;annotation_layer_classCallCheck(this,AnnotationElement);annotation_layer_classPrivateFieldInitSpec(this,Xi,{writable:!0,value:!1});this.isRenderable=i;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;i&&(this.container=this._createContainer(l));u&&this._createQuadrilaterals()}annotation_layer_createClass(AnnotationElement,[{key:"hasPopupData",get:function get(){return AnnotationElement._hasPopupData(this.data)}},{key:"_createContainer",value:function _createContainer(t){var r=this.data,a=this.parent,i=a.page,o=a.viewport,l=document.createElement("section");l.setAttribute("data-annotation-id",r.id);this instanceof ro||(l.tabIndex=Vi);l.style.zIndex=this.parent.zIndex++;this.data.popupRef&&l.setAttribute("aria-haspopup","dialog");r.noRotate&&l.classList.add("norotate");var c=o.rawDims,u=c.pageWidth,h=c.pageHeight,d=c.pageX,p=c.pageY;if(!r.rect||this instanceof co){var v=r.rotation;r.hasOwnCanvas||0===v||this.setRotation(v,l);return l}var _=getRectDims(r.rect),y=_.width,g=_.height,m=fe.normalizeRect([r.rect[0],i.view[3]-r.rect[1]+i.view[1],r.rect[2],i.view[3]-r.rect[3]+i.view[1]]);if(!t&&r.borderStyle.width>0){l.style.borderWidth="".concat(r.borderStyle.width,"px");var b=r.borderStyle.horizontalCornerRadius,w=r.borderStyle.verticalCornerRadius;if(b>0||w>0){var P="calc(".concat(b,"px * var(--scale-factor)) / calc(").concat(w,"px * var(--scale-factor))");l.style.borderRadius=P}else if(this instanceof oo){var k="calc(".concat(y,"px * var(--scale-factor)) / calc(").concat(g,"px * var(--scale-factor))");l.style.borderRadius=k}switch(r.borderStyle.style){case K:l.style.borderStyle="solid";break;case Y:l.style.borderStyle="dashed";break;case X:warn("Unimplemented border style: beveled");break;case $:warn("Unimplemented border style: inset");break;case J:l.style.borderBottomStyle="solid"}var S=r.borderColor||null;if(S){annotation_layer_classPrivateFieldSet(this,Xi,!0);l.style.borderColor=fe.makeHexColor(0|S[0],0|S[1],0|S[2])}else l.style.borderWidth=0}l.style.left="".concat(100*(m[0]-d)/u,"%");l.style.top="".concat(100*(m[1]-p)/h,"%");var A=r.rotation;if(r.hasOwnCanvas||0===A){l.style.width="".concat(100*y/u,"%");l.style.height="".concat(100*g/h,"%")}else this.setRotation(A,l);return l}},{key:"setRotation",value:function setRotation(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(this.data.rect){var a,i,o=this.parent.viewport.rawDims,l=o.pageWidth,c=o.pageHeight,u=getRectDims(this.data.rect),h=u.width,d=u.height;if(t%180==0){a=100*h/l;i=100*d/c}else{a=100*d/l;i=100*h/c}r.style.width="".concat(a,"%");r.style.height="".concat(i,"%");r.setAttribute("data-main-rotation",(360-t)%360)}}},{key:"_commonActions",get:function get(){var t=this,r=function setColor(r,a,i){var o=i.detail[r],l=o[0],c=o.slice(1);i.target.style[a]=Ui["".concat(l,"_HTML")](c);t.annotationStorage.setValue(t.data.id,annotation_layer_defineProperty({},a,Ui["".concat(l,"_rgb")](c)))};return shadow(this,"_commonActions",{display:function display(r){var display=r.detail.display,a=display%2==1;t.container.style.visibility=a?"hidden":"visible";t.annotationStorage.setValue(t.data.id,{noView:a,noPrint:1===display||2===display})},print:function print(r){t.annotationStorage.setValue(t.data.id,{noPrint:!r.detail.print})},hidden:function hidden(r){var hidden=r.detail.hidden;t.container.style.visibility=hidden?"hidden":"visible";t.annotationStorage.setValue(t.data.id,{noPrint:hidden,noView:hidden})},focus:function focus(t){setTimeout((function(){return t.target.focus({preventScroll:!1})}),0)},userName:function userName(t){t.target.title=t.detail.userName},readonly:function readonly(t){t.target.disabled=t.detail.readonly},required:function required(r){t._setRequired(r.target,r.detail.required)},bgColor:function bgColor(t){r("bgColor","backgroundColor",t)},fillColor:function fillColor(t){r("fillColor","backgroundColor",t)},fgColor:function fgColor(t){r("fgColor","color",t)},textColor:function textColor(t){r("textColor","color",t)},borderColor:function borderColor(t){r("borderColor","borderColor",t)},strokeColor:function strokeColor(t){r("strokeColor","borderColor",t)},rotation:function rotation(r){var a=r.detail.rotation;t.setRotation(a);t.annotationStorage.setValue(t.data.id,{rotation:a})}})}},{key:"_dispatchEventFromSandbox",value:function _dispatchEventFromSandbox(t,r){for(var a=this._commonActions,i=0,o=Object.keys(r.detail);i<o.length;i++){var l=o[i],c=t[l]||a[l];null==c||c(r)}}},{key:"_setDefaultPropertiesFromJS",value:function _setDefaultPropertiesFromJS(t){if(this.enableScripting){var r=this.annotationStorage.getRawValue(this.data.id);if(r)for(var a=this._commonActions,i=0,o=Object.entries(r);i<o.length;i++){var l=annotation_layer_slicedToArray(o[i],2),c=l[0],u=l[1],h=a[c];if(h){h({detail:annotation_layer_defineProperty({},c,u),target:t});delete r[c]}}}}},{key:"_createQuadrilaterals",value:function _createQuadrilaterals(){if(this.container){var t=this.data.quadPoints;if(t){var r=annotation_layer_slicedToArray(this.data.rect,4),a=r[0],i=r[1],o=r[2],l=r[3];if(1===t.length){var c=annotation_layer_slicedToArray(t[0],3),u=c[1],h=u.x,d=u.y,p=c[2],v=p.x,_=p.y;if(o===h&&l===d&&a===v&&i===_)return}var y,g=this.container.style;if(annotation_layer_classPrivateFieldGet(this,Xi)){var m=g.borderColor,b=g.borderWidth;g.borderWidth=0;y=["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(m,'" stroke-width="').concat(b,'">')];this.container.classList.add("hasBorder")}var w=o-a,P=l-i,k=this.svgFactory,S=k.createElement("svg");S.classList.add("quadrilateralsContainer");S.setAttribute("width",0);S.setAttribute("height",0);var A=k.createElement("defs");S.append(A);var x=k.createElement("clipPath"),E="clippath_".concat(this.data.id);x.setAttribute("id",E);x.setAttribute("clipPathUnits","objectBoundingBox");A.append(x);var I,T=annotation_layer_createForOfIteratorHelper(t);try{for(T.s();!(I=T.n()).done;){var C,M=annotation_layer_slicedToArray(I.value,3),G=M[1],O=G.x,R=G.y,L=M[2],D=L.x,j=L.y,N=k.createElement("rect"),W=(D-a)/w,H=(l-R)/P,B=(O-D)/w,z=(R-j)/P;N.setAttribute("x",W);N.setAttribute("y",H);N.setAttribute("width",B);N.setAttribute("height",z);x.append(N);null===(C=y)||void 0===C||C.push('<rect vector-effect="non-scaling-stroke" x="'.concat(W,'" y="').concat(H,'" width="').concat(B,'" height="').concat(z,'"/>'))}}catch(t){T.e(t)}finally{T.f()}if(annotation_layer_classPrivateFieldGet(this,Xi)){y.push("</g></svg>')");g.backgroundImage=y.join("")}this.container.append(S);this.container.style.clipPath="url(#".concat(E,")")}}}},{key:"_createPopup",value:function _createPopup(){var t=this.container,r=this.data;t.setAttribute("aria-haspopup","dialog");var a=new co({data:{color:r.color,titleObj:r.titleObj,modificationDate:r.modificationDate,contentsObj:r.contentsObj,richText:r.richText,parentRect:r.rect,borderStyle:0,id:"popup_".concat(r.id),rotation:r.rotation},parent:this.parent,elements:[this]});this.parent.div.append(a.render())}},{key:"render",value:function render(){unreachable("Abstract method `AnnotationElement.render` called")}},{key:"_getElementsByName",value:function _getElementsByName(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=[];if(this._fieldObjects){var i=this._fieldObjects[t];if(i){var o,l=annotation_layer_createForOfIteratorHelper(i);try{for(l.s();!(o=l.n()).done;){var c=o.value,u=c.page,h=c.id,d=c.exportValues;if(-1!==u&&h!==r){var p="string"==typeof d?d:null,v=document.querySelector('[data-element-id="'.concat(h,'"]'));!v||Ki.has(v)?a.push({id:h,exportValue:p,domElement:v}):warn("_getElementsByName - element not allowed: ".concat(h))}}}catch(t){l.e(t)}finally{l.f()}}return a}var _,y=annotation_layer_createForOfIteratorHelper(document.getElementsByName(t));try{for(y.s();!(_=y.n()).done;){var g=_.value,m=g.exportValue,b=g.getAttribute("data-element-id");b!==r&&(Ki.has(g)&&a.push({id:b,exportValue:m,domElement:g}))}}catch(t){y.e(t)}finally{y.f()}return a}},{key:"show",value:function show(){var t;this.container&&(this.container.hidden=!1);null===(t=this.popup)||void 0===t||t.maybeShow()}},{key:"hide",value:function hide(){var t;this.container&&(this.container.hidden=!0);null===(t=this.popup)||void 0===t||t.forceHide()}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return this.container}},{key:"addHighlightArea",value:function addHighlightArea(){var t=this.getElementsToTriggerPopup();if(Array.isArray(t)){var r,a=annotation_layer_createForOfIteratorHelper(t);try{for(a.s();!(r=a.n()).done;){r.value.classList.add("highlightArea")}}catch(t){a.e(t)}finally{a.f()}}else t.classList.add("highlightArea")}},{key:"_isEditable",get:function get(){return!1}},{key:"_editOnDoubleClick",value:function _editOnDoubleClick(){var t=this;if(this._isEditable){var r=this.annotationEditorType,a=this.data.id;this.container.addEventListener("dblclick",(function(){var i;null===(i=t.linkService.eventBus)||void 0===i||i.dispatch("switchannotationeditormode",{source:t,mode:r,editId:a})}))}}}],[{key:"_hasPopupData",value:function _hasPopupData(t){var r=t.titleObj,a=t.contentsObj,i=t.richText;return!!(null!=r&&r.str||null!=a&&a.str||null!=i&&i.str)}}]);return AnnotationElement}(),Ji=new WeakSet,Qi=new WeakSet,Zi=new WeakSet,eo=function(t){annotation_layer_inherits(LinkAnnotationElement,t);function LinkAnnotationElement(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;annotation_layer_classCallCheck(this,LinkAnnotationElement);annotation_layer_classPrivateMethodInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,LinkAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!(null==a||!a.ignoreBorder),createQuadrilaterals:!0}])),Zi);annotation_layer_classPrivateMethodInitSpec(annotation_layer_assertThisInitialized(r),Qi);annotation_layer_classPrivateMethodInitSpec(annotation_layer_assertThisInitialized(r),Ji);r.isTooltipOnly=t.data.isTooltipOnly;return r}annotation_layer_createClass(LinkAnnotationElement,[{key:"render",value:function render(){var t=this.data,r=this.linkService,a=document.createElement("a");a.setAttribute("data-element-id",t.id);var i=!1;if(t.url){r.addLinkAttributes(a,t.url,t.newWindow);i=!0}else if(t.action){this._bindNamedAction(a,t.action);i=!0}else if(t.attachment){annotation_layer_classPrivateMethodGet(this,Qi,_bindAttachment2).call(this,a,t.attachment,t.attachmentDest);i=!0}else if(t.setOCGState){annotation_layer_classPrivateMethodGet(this,Zi,_bindSetOCGState2).call(this,a,t.setOCGState);i=!0}else if(t.dest){this._bindLink(a,t.dest);i=!0}else{if(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){this._bindJSAction(a,t);i=!0}if(t.resetForm){this._bindResetFormAction(a,t.resetForm);i=!0}else if(this.isTooltipOnly&&!i){this._bindLink(a,"");i=!0}}this.container.classList.add("linkAnnotation");i&&this.container.append(a);return this.container}},{key:"_bindLink",value:function _bindLink(t,r){var a=this;t.href=this.linkService.getDestinationHash(r);t.onclick=function(){r&&a.linkService.goToDestination(r);return!1};(r||""===r)&&annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this)}},{key:"_bindNamedAction",value:function _bindNamedAction(t,r){var a=this;t.href=this.linkService.getAnchorUrl("");t.onclick=function(){a.linkService.executeNamedAction(r);return!1};annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this)}},{key:"_bindJSAction",value:function _bindJSAction(t,r){var a=this;t.href=this.linkService.getAnchorUrl("");for(var i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]),o=function _loop(){var o=c[l],u=i.get(o);if(!u)return 1;t[u]=function(){var t;null===(t=a.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:a,detail:{id:r.id,name:o}});return!1}},l=0,c=Object.keys(r.actions);l<c.length;l++)o();t.onclick||(t.onclick=function(){return!1});annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this)}},{key:"_bindResetFormAction",value:function _bindResetFormAction(t,r){var a=this,i=t.onclick;i||(t.href=this.linkService.getAnchorUrl(""));annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this);if(this._fieldObjects)t.onclick=function(){null==i||i();var t=r.fields,o=r.refs,l=r.include,c=[];if(0!==t.length||0!==o.length){var u,h=new Set(o),d=annotation_layer_createForOfIteratorHelper(t);try{for(d.s();!(u=d.n()).done;){var p,v=u.value,_=annotation_layer_createForOfIteratorHelper(a._fieldObjects[v]||[]);try{for(_.s();!(p=_.n()).done;){var y=p.value.id;h.add(y)}}catch(t){_.e(t)}finally{_.f()}}}catch(t){d.e(t)}finally{d.f()}for(var g=0,m=Object.values(a._fieldObjects);g<m.length;g++){var b,w=annotation_layer_createForOfIteratorHelper(m[g]);try{for(w.s();!(b=w.n()).done;){var P=b.value;h.has(P.id)===l&&c.push(P)}}catch(t){w.e(t)}finally{w.f()}}}else for(var k=0,S=Object.values(a._fieldObjects);k<S.length;k++){var A=S[k];c.push.apply(c,annotation_layer_toConsumableArray(A))}for(var x=a.annotationStorage,E=[],I=0,T=c;I<T.length;I++){var C=T[I],M=C.id;E.push(M);switch(C.type){case"text":var G=C.defaultValue||"";x.setValue(M,{value:G});window.updateAngularFormValue(M,{value:G});break;case"checkbox":case"radiobutton":var O=C.defaultValue===C.exportValues;x.setValue(M,{value:O});window.updateAngularFormValue(M,{value:O});break;case"combobox":case"listbox":var R=C.defaultValue||"";x.setValue(M,{value:R});window.updateAngularFormValue(M,{value:R});break;default:continue}var L=document.querySelector('[data-element-id="'.concat(M,'"]'));L&&(Ki.has(L)?L.dispatchEvent(new Event("resetform")):warn("_bindResetFormAction - element not allowed: ".concat(M)))}if(a.enableScripting){var D;null===(D=a.linkService.eventBus)||void 0===D||D.dispatch("dispatcheventinsandbox",{source:a,detail:{id:"app",ids:E,name:"ResetForm"}})}return!1};else{warn('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');i||(t.onclick=function(){return!1})}}}]);return LinkAnnotationElement}($i);function _setInternalLink2(){this.container.setAttribute("data-internal-link","")}function _bindAttachment2(t,r){var a=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t.href=this.linkService.getAnchorUrl("");t.onclick=function(){var t;null===(t=a.downloadManager)||void 0===t||t.openOrDownloadData(r.content,r.filename,i);return!1};annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this)}function _bindSetOCGState2(t,r){var a=this;t.href=this.linkService.getAnchorUrl("");t.onclick=function(){a.linkService.executeSetOCGState(r);return!1};annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this)}var to=function(t){annotation_layer_inherits(TextAnnotationElement,t);function TextAnnotationElement(t){annotation_layer_classCallCheck(this,TextAnnotationElement);return annotation_layer_callSuper(this,TextAnnotationElement,[t,{isRenderable:!0}])}annotation_layer_createClass(TextAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("textAnnotation");var t=document.createElement("img");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);return this.container}}]);return TextAnnotationElement}($i),ro=function(t){annotation_layer_inherits(WidgetAnnotationElement,t);function WidgetAnnotationElement(){annotation_layer_classCallCheck(this,WidgetAnnotationElement);return annotation_layer_callSuper(this,WidgetAnnotationElement,arguments)}annotation_layer_createClass(WidgetAnnotationElement,[{key:"render",value:function render(){this.data.alternativeText&&(this.container.title=this.data.alternativeText);return this.container}},{key:"showElementAndHideCanvas",value:function showElementAndHideCanvas(t){if(this.data.hasOwnCanvas){var r;"CANVAS"===(null===(r=t.previousSibling)||void 0===r?void 0:r.nodeName)&&(t.previousSibling.hidden=!0);t.hidden=!1}}},{key:"_getKeyModifier",value:function _getKeyModifier(t){return he.platform.isMac?t.metaKey:t.ctrlKey}},{key:"_setEventListener",value:function _setEventListener(t,r,a,i,o){var l=this;a.includes("mouse")?t.addEventListener(a,(function(t){var r;null===(r=l.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:l,detail:{id:l.data.id,name:i,value:o(t),shift:t.shiftKey,modifier:l._getKeyModifier(t)}})})):t.addEventListener(a,(function(t){var c;if("blur"===a){if(!r.focused||!t.relatedTarget)return;r.focused=!1}else if("focus"===a){if(r.focused)return;r.focused=!0}o&&(null===(c=l.linkService.eventBus)||void 0===c||c.dispatch("dispatcheventinsandbox",{source:l,detail:{id:l.data.id,name:i,value:o(t)}}))}))}},{key:"_setEventListeners",value:function _setEventListeners(t,r,a,i){var o,l=annotation_layer_createForOfIteratorHelper(a);try{for(l.s();!(o=l.n()).done;){var c,u=annotation_layer_slicedToArray(o.value,2),h=u[0],d=u[1];if("Action"===d||null!==(c=this.data.actions)&&void 0!==c&&c[d]){var p,v;"Focus"!==d&&"Blur"!==d||r||(r={focused:!1});this._setEventListener(t,r,h,d,i);"Focus"!==d||null!==(p=this.data.actions)&&void 0!==p&&p.Blur?"Blur"!==d||null!==(v=this.data.actions)&&void 0!==v&&v.Focus||this._setEventListener(t,r,"focus","Focus",null):this._setEventListener(t,r,"blur","Blur",null)}}}catch(t){l.e(t)}finally{l.f()}}},{key:"_setBackgroundColor",value:function _setBackgroundColor(t){var r=this.data.backgroundColor||null;t.style.backgroundColor=null===r?"transparent":fe.makeHexColor(r[0],r[1],r[2])}},{key:"_setTextStyle",value:function _setTextStyle(t){var r,a=this.data.defaultAppearanceData.fontColor,i=this.data.defaultAppearanceData.fontSize||9,o=t.style,c=function roundToOneDecimal(t){return Math.round(10*t)/10};if(this.data.multiLine){var u=Math.abs(this.data.rect[3]-this.data.rect[1]-2),h=u/(Math.round(u/(l*i))||1);r=Math.min(i,c(h/l))}else{var d=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(i,c(d/l))}o.fontSize="calc(".concat(r,"px * var(--scale-factor))");o.color=fe.makeHexColor(a[0],a[1],a[2]);null!==this.data.textAlignment&&(o.textAlign=["left","center","right"][this.data.textAlignment])}},{key:"_setRequired",value:function _setRequired(t,r){r?t.setAttribute("required",!0):t.removeAttribute("required");t.setAttribute("aria-required",r)}}]);return WidgetAnnotationElement}($i),no=function(t){annotation_layer_inherits(TextWidgetAnnotationElement,t);function TextWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,TextWidgetAnnotationElement);return annotation_layer_callSuper(this,TextWidgetAnnotationElement,[t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue}])}annotation_layer_createClass(TextWidgetAnnotationElement,[{key:"setPropertyOnSiblings",value:function setPropertyOnSiblings(t,r,a,i){var o,l=this.annotationStorage,c=annotation_layer_createForOfIteratorHelper(this._getElementsByName(t.name,t.id));try{for(c.s();!(o=c.n()).done;){var u=o.value;u.domElement&&(u.domElement[r]=a);l.setValue(u.id,annotation_layer_defineProperty({},i,a))}}catch(t){c.e(t)}finally{c.f()}}},{key:"render",value:function render(){var t=this,r=this.annotationStorage,a=this.data.id;this.container.classList.add("textWidgetAnnotation");var i=null;if(this.renderForms){var o,l=window.getFormValueFromAngular(this.data.fieldName),c=r.getValue(a,{value:this.data.fieldValue}),u=l.value?l:c;l!==c&&r.setValue(a,{value:l.value});var h=u.value||"",d=r.getValue(a,{charLimit:this.data.maxLen}).charLimit;d&&h.length>d&&(h=h.slice(0,d));var p=u.formattedValue||(null===(o=this.data.textContent)||void 0===o?void 0:o.join("\n"))||null;p&&this.data.comb&&(p=p.replaceAll(/\s+/g,""));var v={userValue:h,formattedValue:p,lastCommittedValue:null,commitKey:1,focused:!1};if(this.data.multiLine){var _;(i=document.createElement("textarea")).textContent=null!==(_=p)&&void 0!==_?_:h;this.data.doNotScroll&&(i.style.overflowY="hidden")}else{var y;(i=document.createElement("input")).type="text";i.setAttribute("value",null!==(y=p)&&void 0!==y?y:h);this.data.doNotScroll&&(i.style.overflowX="hidden")}this.data.hasOwnCanvas&&(i.hidden=!0);Ki.add(i);i.setAttribute("data-element-id",a);i.disabled=this.data.readOnly;i.name=this.data.fieldName;i.tabIndex=Vi;this._setRequired(i,this.data.required);d&&(i.maxLength=d);i.addEventListener("input",(function(o){r.setValue(a,{value:o.target.value});window.updateAngularFormValue(a,{value:o.target.value});t.setPropertyOnSiblings(i,"value",o.target.value,"value");v.formattedValue=null}));i.addEventListener("resetform",(function(r){var a,o=null!==(a=t.data.defaultFieldValue)&&void 0!==a?a:"";i.value=v.userValue=o;v.formattedValue=null}));var g=function blurListener(t){var r=v.formattedValue;null!=r&&(t.target.value=r);t.target.scrollLeft=0};window.registerAcroformField(a,i,u.value);i.addEventListener("updateFromAngular",(function(t){return r.setValue(a,{value:t.detail})}));if(this.enableScripting&&this.hasJSActions){var m;i.addEventListener("focus",(function(r){var a;if(!v.focused){var i=r.target;v.userValue&&(i.value=v.userValue);v.lastCommittedValue=i.value;v.commitKey=1;null!==(a=t.data.actions)&&void 0!==a&&a.Focus||(v.focused=!0)}}));i.addEventListener("updatefromsandbox",(function(i){t.showElementAndHideCanvas(i.target);var o={value:function value(t){var i;v.userValue=null!==(i=t.detail.value)&&void 0!==i?i:"";r.setValue(a,{value:v.userValue.toString()});window.updateAngularFormValue(a,{value:v.userValue.toString()});t.target.value=v.userValue},formattedValue:function formattedValue(t){var formattedValue=t.detail.formattedValue;v.formattedValue=formattedValue;null!=formattedValue&&t.target!==document.activeElement&&(t.target.value=formattedValue);r.setValue(a,{formattedValue:formattedValue});window.updateAngularFormValue(a,{formattedValue:formattedValue})},selRange:function selRange(t){var r;(r=t.target).setSelectionRange.apply(r,annotation_layer_toConsumableArray(t.detail.selRange))},charLimit:function charLimit(i){var o,charLimit=i.detail.charLimit,l=i.target;if(0!==charLimit){l.setAttribute("maxLength",charLimit);var c=v.userValue;if(c&&!(c.length<=charLimit)){c=c.slice(0,charLimit);l.value=v.userValue=c;r.setValue(a,{value:c});window.updateAngularFormValue(a,{value:c});null===(o=t.linkService.eventBus)||void 0===o||o.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:c,willCommit:!0,commitKey:1,selStart:l.selectionStart,selEnd:l.selectionEnd}})}}else l.removeAttribute("maxLength")}};t._dispatchEventFromSandbox(o,i)}));i.addEventListener("keydown",(function(r){var i;v.commitKey=1;var o=-1;"Escape"===r.key?o=0:"Enter"!==r.key||t.data.multiLine?"Tab"===r.key&&(v.commitKey=3):o=2;if(-1!==o){var l=r.target.value;if(v.lastCommittedValue!==l){v.lastCommittedValue=l;v.userValue=l;null===(i=t.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:l,willCommit:!0,commitKey:o,selStart:r.target.selectionStart,selEnd:r.target.selectionEnd}})}}}));var b=g;g=null;i.addEventListener("blur",(function(r){var i;if(v.focused&&r.relatedTarget){null!==(i=t.data.actions)&&void 0!==i&&i.Blur||(v.focused=!1);var o=r.target.value;v.userValue=o;if(v.lastCommittedValue!==o){var l;null===(l=t.linkService.eventBus)||void 0===l||l.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:o,willCommit:!0,commitKey:v.commitKey,selStart:r.target.selectionStart,selEnd:r.target.selectionEnd}})}b(r)}}));null!==(m=this.data.actions)&&void 0!==m&&m.Keystroke&&i.addEventListener("beforeinput",(function(r){var i;v.lastCommittedValue=null;var o=r.data,l=r.target,c=l.value,u=l.selectionStart,h=l.selectionEnd,d=u,p=h;switch(r.inputType){case"deleteWordBackward":var _=c.substring(0,u).match(/\w*[^\w]*$/);_&&(d-=_[0].length);break;case"deleteWordForward":var y=c.substring(u).match(/^[^\w]*\w*/);y&&(p+=y[0].length);break;case"deleteContentBackward":u===h&&(d-=1);break;case"deleteContentForward":u===h&&(p+=1)}r.preventDefault();null===(i=t.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:c,change:o||"",willCommit:!1,selStart:d,selEnd:p}})}));this._setEventListeners(i,v,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.value}))}g&&i.addEventListener("blur",g);if(this.data.comb){var w=(this.data.rect[2]-this.data.rect[0])/d;i.classList.add("comb");i.style.letterSpacing="calc(".concat(w,"px * var(--scale-factor) - 1ch)")}}else{(i=document.createElement("div")).textContent=this.data.fieldValue;i.style.verticalAlign="middle";i.style.display="table-cell";this.data.hasOwnCanvas&&(i.hidden=!0)}this._setTextStyle(i);this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}]);return TextWidgetAnnotationElement}(ro),ao=function(t){annotation_layer_inherits(SignatureWidgetAnnotationElement,t);function SignatureWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,SignatureWidgetAnnotationElement);return annotation_layer_callSuper(this,SignatureWidgetAnnotationElement,[t,{isRenderable:!!t.data.hasOwnCanvas}])}return annotation_layer_createClass(SignatureWidgetAnnotationElement)}(ro),io=function(t){annotation_layer_inherits(CheckboxWidgetAnnotationElement,t);function CheckboxWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,CheckboxWidgetAnnotationElement);return annotation_layer_callSuper(this,CheckboxWidgetAnnotationElement,[t,{isRenderable:t.renderForms}])}annotation_layer_createClass(CheckboxWidgetAnnotationElement,[{key:"render",value:function render(){var t=this,r=this.annotationStorage,a=this.data,i=a.id,o=window.getFormValueFromAngular(this.data.fieldName),l=r.getValue(i,{value:a.exportValue===a.fieldValue}).value,c=void 0;o.value&&(c=!0===o.value||o.value===a.exportValue);var u=void 0!==c?c:l,h=!1;if("string"==typeof u){u=u===a.exportValue;r.setValue(i,{value:u});h=!0}else if(void 0!==(null==o?void 0:o.value)&&o.value!==l){u=o.value===a.exportValue;r.setValue(i,{value:u})}this.container.classList.add("buttonWidgetAnnotation","checkBox");var d=document.createElement("input");Ki.add(d);d.setAttribute("data-element-id",i);d.disabled=a.readOnly;this._setRequired(d,this.data.required);d.type="checkbox";d.name=a.fieldName;u&&d.setAttribute("checked",!0);d.setAttribute("exportValue",a.exportValue);d.tabIndex=Vi;d.addEventListener("change",(function(o){var l,c=o.target,u=c.name,h=c.checked,d=annotation_layer_createForOfIteratorHelper(t._getElementsByName(u,i));try{for(d.s();!(l=d.n()).done;){var p=l.value,v=h&&p.exportValue===a.exportValue;p.domElement&&(p.domElement.checked=v);r.setValue(p.id,{value:v});window.updateAngularFormValue(i,{value:v})}}catch(t){d.e(t)}finally{d.f()}r.setValue(i,{value:h});window.updateAngularFormValue(i,{value:h})}));d.addEventListener("resetform",(function(t){var r=a.defaultFieldValue||"Off";t.target.checked=r===a.exportValue}));window.registerAcroformField(i,d,!!u&&a.exportValue);d.addEventListener("updateFromAngular",(function(t){return r.setValue(i,{value:t.detail})}));h&&window.updateAngularFormValue(i,{value:u});if(this.enableScripting&&this.hasJSActions){d.addEventListener("updatefromsandbox",(function(a){var o={value:function value(t){t.target.checked="Off"!==t.detail.value;r.setValue(i,{value:t.target.checked});window.updateAngularFormValue(i,{value:t.target.value})}};t._dispatchEventFromSandbox(o,a)}));this._setEventListeners(d,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.checked}))}this._setBackgroundColor(d);this._setDefaultPropertiesFromJS(d);this.container.append(d);return this.container}}]);return CheckboxWidgetAnnotationElement}(ro),oo=function(t){annotation_layer_inherits(RadioButtonWidgetAnnotationElement,t);function RadioButtonWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,RadioButtonWidgetAnnotationElement);return annotation_layer_callSuper(this,RadioButtonWidgetAnnotationElement,[t,{isRenderable:t.renderForms}])}annotation_layer_createClass(RadioButtonWidgetAnnotationElement,[{key:"render",value:function render(){var t,r=this;this.container.classList.add("buttonWidgetAnnotation","radioButton");var a=this.annotationStorage,i=this.data,o=i.id,l=window.getFormValueFromAngular(this.data.fieldName),c=a.getValue(o,{value:i.fieldValue===i.buttonValue}).value,u=null!==(t=l.value)&&void 0!==t?t:c;if("string"==typeof u||l!==c){u=u===i.buttonValue;a.setValue(o,{value:u})}else u&&window.updateAngularFormValue(o,{value:i.buttonValue});if(u){var h,d=annotation_layer_createForOfIteratorHelper(this._getElementsByName(i.fieldName,o));try{for(d.s();!(h=d.n()).done;){var p=h.value;a.setValue(p.id,{value:!1})}}catch(t){d.e(t)}finally{d.f()}}var v=document.createElement("input");Ki.add(v);v.setAttribute("data-element-id",o);v.disabled=i.readOnly;this._setRequired(v,this.data.required);v.type="radio";v.name=i.fieldName;u&&v.setAttribute("checked",!0);v.tabIndex=Vi;v.addEventListener("change",(function(t){var i,l=t.target,c=l.name,u=l.checked,h=annotation_layer_createForOfIteratorHelper(r._getElementsByName(c,o));try{for(h.s();!(i=h.n()).done;){var d=i.value;a.setValue(d.id,{value:!1});window.updateAngularFormValue(d.id,{value:!1})}}catch(t){h.e(t)}finally{h.f()}a.setValue(o,{value:u});window.updateAngularFormValue(o,{value:u})}));v.addEventListener("resetform",(function(t){var r=i.defaultFieldValue;t.target.checked=null!=r&&r===i.buttonValue}));window.registerAcroformField(o,v,u?i.buttonValue:void 0,i.buttonValue);v.addEventListener("updateFromAngular",(function(t){return a.setValue(o,{value:t.detail})}));if(this.enableScripting&&this.hasJSActions){var _=i.buttonValue;v.addEventListener("updatefromsandbox",(function(t){var i={value:function value(t){var i,l=_===t.detail.value,c=annotation_layer_createForOfIteratorHelper(r._getElementsByName(t.target.name));try{for(c.s();!(i=c.n()).done;){var u=i.value,h=l&&u.id===o;u.domElement&&(u.domElement.checked=h);a.setValue(u.id,{value:h});window.updateAngularFormValue(o,{value:h})}}catch(t){c.e(t)}finally{c.f()}}};r._dispatchEventFromSandbox(i,t)}));this._setEventListeners(v,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.checked}))}this._setBackgroundColor(v);this._setDefaultPropertiesFromJS(v);this.container.append(v);return this.container}}]);return RadioButtonWidgetAnnotationElement}(ro),so=function(t){annotation_layer_inherits(PushButtonWidgetAnnotationElement,t);function PushButtonWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,PushButtonWidgetAnnotationElement);return annotation_layer_callSuper(this,PushButtonWidgetAnnotationElement,[t,{ignoreBorder:t.data.hasAppearance}])}annotation_layer_createClass(PushButtonWidgetAnnotationElement,[{key:"render",value:function render(){var t=this,r=annotation_layer_get(annotation_layer_getPrototypeOf(PushButtonWidgetAnnotationElement.prototype),"render",this).call(this);r.classList.add("buttonWidgetAnnotation","pushButton");this.data.alternativeText&&(r.title=this.data.alternativeText);var a=r.lastChild;if(this.enableScripting&&this.hasJSActions&&a){this._setDefaultPropertiesFromJS(a);a.addEventListener("updatefromsandbox",(function(r){t._dispatchEventFromSandbox({},r)}))}return r}}]);return PushButtonWidgetAnnotationElement}(eo),lo=function(t){annotation_layer_inherits(ChoiceWidgetAnnotationElement,t);function ChoiceWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,ChoiceWidgetAnnotationElement);return annotation_layer_callSuper(this,ChoiceWidgetAnnotationElement,[t,{isRenderable:t.renderForms}])}annotation_layer_createClass(ChoiceWidgetAnnotationElement,[{key:"render",value:function render(){var t=this;this.container.classList.add("choiceWidgetAnnotation");var r=this.annotationStorage,a=this.data.id,i=window.getFormValueFromAngular(this.data.fieldName),o=r.getValue(a,{value:this.data.fieldValue}),l=i.value?i:o;i!==o&&r.setValue(a,{value:i.value});var c=document.createElement("select");Ki.add(c);c.setAttribute("data-element-id",a);c.disabled=this.data.readOnly;this._setRequired(c,this.data.required);c.name=this.data.fieldName;c.tabIndex=Vi;var u=this.data.combo&&this.data.options.length>0;if(!this.data.combo){c.size=this.data.options.length;this.data.multiSelect&&(c.multiple=!0)}c.addEventListener("resetform",(function(r){var a,i=t.data.defaultFieldValue,o=annotation_layer_createForOfIteratorHelper(c.options);try{for(o.s();!(a=o.n()).done;){var l=a.value;l.selected=l.value===i}}catch(t){o.e(t)}finally{o.f()}}));var h,d=annotation_layer_createForOfIteratorHelper(this.data.options);try{for(d.s();!(h=d.n()).done;){var p=h.value,v=document.createElement("option");v.textContent=p.displayValue;v.value=p.exportValue;if(l.value.includes(p.exportValue)){v.setAttribute("selected",!0);u=!1}c.append(v)}}catch(t){d.e(t)}finally{d.f()}var _=null;if(u){var y=document.createElement("option");y.value=" ";y.setAttribute("hidden",!0);y.setAttribute("selected",!0);c.prepend(y);_=function removeEmptyEntry(){y.remove();c.removeEventListener("input",_);_=null};c.addEventListener("input",_)}var g=function getValue(t){var r=t?"value":"textContent",a=c.options;return c.multiple?Array.prototype.filter.call(a,(function(t){return t.selected})).map((function(t){return t[r]})):-1===a.selectedIndex?null:a[a.selectedIndex][r]},m=g(!1),b=function getItems(t){var r=t.target.options;return Array.prototype.map.call(r,(function(t){return{displayValue:t.textContent,exportValue:t.value}}))};window.registerAcroformField(a,c,m);c.addEventListener("updateFromAngular",(function(t){return r.setValue(a,{value:t.detail})}));if(this.enableScripting&&this.hasJSActions){c.addEventListener("updatefromsandbox",(function(i){var o={value:function value(t){var i;null===(i=_)||void 0===i||i();var o,value=t.detail.value,l=new Set(Array.isArray(value)?value:[value]),u=annotation_layer_createForOfIteratorHelper(c.options);try{for(u.s();!(o=u.n()).done;){var h=o.value;h.selected=l.has(h.value)}}catch(t){u.e(t)}finally{u.f()}r.setValue(a,{value:g(!0)});m=g(!1);window.updateAngularFormValue(a,{value:m})},multipleSelection:function multipleSelection(t){c.multiple=!0},remove:function remove(t){var i=c.options,o=t.detail.remove;i[o].selected=!1;c.remove(o);if(i.length>0){var l=Array.prototype.findIndex.call(i,(function(t){return t.selected}));-1===l&&(i[0].selected=!0)}r.setValue(a,{value:g(!0),items:b(t)});m=g(!1)},clear:function clear(t){for(;0!==c.length;)c.remove(0);r.setValue(a,{value:null,items:[]});m=g(!1);window.updateAngularFormValue(a,{value:m})},insert:function insert(t){var i=t.detail.insert,o=i.index,l=i.displayValue,u=i.exportValue,h=c.children[o],d=document.createElement("option");d.textContent=l;d.value=u;h?h.before(d):c.append(d);r.setValue(a,{value:g(!0),items:b(t)});m=g(!1);window.updateAngularFormValue(a,{value:m})},items:function items(t){for(var items=t.detail.items;0!==c.length;)c.remove(0);var i,o=annotation_layer_createForOfIteratorHelper(items);try{for(o.s();!(i=o.n()).done;){var l=i.value,u=l.displayValue,h=l.exportValue,d=document.createElement("option");d.textContent=u;d.value=h;c.append(d)}}catch(t){o.e(t)}finally{o.f()}c.options.length>0&&(c.options[0].selected=!0);r.setValue(a,{value:g(!0),items:b(t)});m=g(!1);window.updateAngularFormValue(a,{value:m})},indices:function indices(t){var i,indices=new Set(t.detail.indices),o=annotation_layer_createForOfIteratorHelper(t.target.options);try{for(o.s();!(i=o.n()).done;){var l=i.value;l.selected=indices.has(l.index)}}catch(t){o.e(t)}finally{o.f()}r.setValue(a,{value:g(!0)});m=g(!1);window.updateAngularFormValue(a,{value:m})},editable:function editable(t){t.target.disabled=!t.detail.editable}};t._dispatchEventFromSandbox(o,i)}));c.addEventListener("input",(function(i){var o,l=g(!0);r.setValue(a,{value:l});window.updateAngularFormValue(a,{value:l});i.preventDefault();null===(o=t.linkService.eventBus)||void 0===o||o.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:m,changeEx:l,willCommit:!1,commitKey:1,keyDown:!1}})}));this._setEventListeners(c,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(function(t){return t.target.value}))}else c.addEventListener("input",(function(t){r.setValue(a,{value:g(!0)});window.updateAngularFormValue(a,{value:g(!0)})}));this.data.combo&&this._setTextStyle(c);this._setBackgroundColor(c);this._setDefaultPropertiesFromJS(c);this.container.append(c);return this.container}}]);return ChoiceWidgetAnnotationElement}(ro),co=function(t){annotation_layer_inherits(PopupAnnotationElement,t);function PopupAnnotationElement(t){var r;annotation_layer_classCallCheck(this,PopupAnnotationElement);var a=t.data,i=t.elements;(r=annotation_layer_callSuper(this,PopupAnnotationElement,[t,{isRenderable:$i._hasPopupData(a)}])).elements=i;return r}annotation_layer_createClass(PopupAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("popupAnnotation");var t,r=new Mo({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}),a=[],i=annotation_layer_createForOfIteratorHelper(this.elements);try{for(i.s();!(t=i.n()).done;){var o=t.value;o.popup=r;a.push(o.data.id);o.addHighlightArea()}}catch(t){i.e(t)}finally{i.f()}this.container.setAttribute("aria-controls",a.map((function(t){return"".concat(ge).concat(t)})).join(","));return this.container}}]);return PopupAnnotationElement}($i),uo=new WeakMap,ho=new WeakMap,fo=new WeakMap,po=new WeakMap,vo=new WeakMap,_o=new WeakMap,yo=new WeakMap,go=new WeakMap,mo=new WeakMap,bo=new WeakMap,wo=new WeakMap,Po=new WeakMap,ko=new WeakMap,So=new WeakMap,Fo=new WeakMap,Ao=new WeakMap,xo=new WeakMap,Eo=new WeakSet,Io=new WeakSet,To=new WeakSet,Co=new WeakSet,Mo=function(){function PopupElement(t){var r=t.container,a=t.color,i=t.elements,o=t.titleObj,l=t.modificationDate,c=t.contentsObj,u=t.richText,h=t.parent,d=t.rect,p=t.parentRect,v=t.open;annotation_layer_classCallCheck(this,PopupElement);annotation_layer_classPrivateMethodInitSpec(this,Co);annotation_layer_classPrivateMethodInitSpec(this,To);annotation_layer_classPrivateMethodInitSpec(this,Io);annotation_layer_classPrivateMethodInitSpec(this,Eo);annotation_layer_classPrivateFieldInitSpec(this,uo,{writable:!0,value:annotation_layer_classPrivateMethodGet(this,Eo,_keyDown2).bind(this)});annotation_layer_classPrivateFieldInitSpec(this,ho,{writable:!0,value:annotation_layer_classPrivateMethodGet(this,Co,_hide2).bind(this)});annotation_layer_classPrivateFieldInitSpec(this,fo,{writable:!0,value:annotation_layer_classPrivateMethodGet(this,To,_show2).bind(this)});annotation_layer_classPrivateFieldInitSpec(this,po,{writable:!0,value:annotation_layer_classPrivateMethodGet(this,Io,_toggle2).bind(this)});annotation_layer_classPrivateFieldInitSpec(this,vo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,_o,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,yo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,go,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,mo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,bo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,wo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,Po,{writable:!0,value:!1});annotation_layer_classPrivateFieldInitSpec(this,ko,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,So,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,Fo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,Ao,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,xo,{writable:!0,value:!1});annotation_layer_classPrivateFieldSet(this,_o,r);annotation_layer_classPrivateFieldSet(this,Ao,o);annotation_layer_classPrivateFieldSet(this,yo,c);annotation_layer_classPrivateFieldSet(this,Fo,u);annotation_layer_classPrivateFieldSet(this,bo,h);annotation_layer_classPrivateFieldSet(this,vo,a);annotation_layer_classPrivateFieldSet(this,So,d);annotation_layer_classPrivateFieldSet(this,wo,p);annotation_layer_classPrivateFieldSet(this,mo,i);annotation_layer_classPrivateFieldSet(this,go,Je.toDateObject(l));this.trigger=i.flatMap((function(t){return t.getElementsToTriggerPopup()}));var _,y=annotation_layer_createForOfIteratorHelper(this.trigger);try{for(y.s();!(_=y.n()).done;){var g=_.value;g.addEventListener("click",annotation_layer_classPrivateFieldGet(this,po));g.addEventListener("mouseenter",annotation_layer_classPrivateFieldGet(this,fo));g.addEventListener("mouseleave",annotation_layer_classPrivateFieldGet(this,ho));g.classList.add("popupTriggerArea")}}catch(t){y.e(t)}finally{y.f()}var m,b=annotation_layer_createForOfIteratorHelper(i);try{for(b.s();!(m=b.n()).done;){var w;null===(w=m.value.container)||void 0===w||w.addEventListener("keydown",annotation_layer_classPrivateFieldGet(this,uo))}}catch(t){b.e(t)}finally{b.f()}annotation_layer_classPrivateFieldGet(this,_o).hidden=!0;v&&annotation_layer_classPrivateMethodGet(this,Io,_toggle2).call(this)}annotation_layer_createClass(PopupElement,[{key:"render",value:function render(){if(!annotation_layer_classPrivateFieldGet(this,ko)){var t=annotation_layer_classPrivateFieldGet(this,bo),r=t.page.view,a=t.viewport.rawDims,i=a.pageWidth,o=a.pageHeight,l=a.pageX,c=a.pageY,u=annotation_layer_classPrivateFieldSet(this,ko,document.createElement("div"));u.className="popup";if(annotation_layer_classPrivateFieldGet(this,vo)){var h=u.style.outlineColor=fe.makeHexColor.apply(fe,annotation_layer_toConsumableArray(annotation_layer_classPrivateFieldGet(this,vo)));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))u.style.backgroundColor="color-mix(in srgb, ".concat(h," 30%, white)");else{u.style.backgroundColor=fe.makeHexColor.apply(fe,annotation_layer_toConsumableArray(annotation_layer_classPrivateFieldGet(this,vo).map((function(t){return Math.floor(.7*(255-t)+t)}))))}}var d=document.createElement("span");d.className="header";var p=document.createElement("h1");d.append(p);var v=annotation_layer_classPrivateFieldGet(this,Ao);p.dir=v.dir;p.textContent=v.str;u.append(d);if(annotation_layer_classPrivateFieldGet(this,go)){var _=document.createElement("span");_.classList.add("popupDate");_.setAttribute("data-l10n-id","pdfjs-annotation-date-string");_.setAttribute("data-l10n-args",JSON.stringify({date:annotation_layer_classPrivateFieldGet(this,go).toLocaleDateString(),time:annotation_layer_classPrivateFieldGet(this,go).toLocaleTimeString()}));d.append(_)}var y=annotation_layer_classPrivateFieldGet(this,yo),g=annotation_layer_classPrivateFieldGet(this,Fo);if(null==g||!g.str||null!=y&&y.str&&y.str!==g.str){var m=this._formatContents(y);u.append(m)}else{qi.render({xfaHtml:g.html,intent:"richText",div:u});u.lastChild.classList.add("richText","popupContent")}var b,w=!!annotation_layer_classPrivateFieldGet(this,wo),P=annotation_layer_classPrivateFieldGet(this,w?wo:So),k=annotation_layer_createForOfIteratorHelper(annotation_layer_classPrivateFieldGet(this,mo));try{for(k.s();!(b=k.n()).done;){var S=b.value;if(!P||null!==fe.intersect(S.data.rect,P)){P=S.data.rect;w=!0;break}}}catch(t){k.e(t)}finally{k.f()}var A=fe.normalizeRect([P[0],r[3]-P[1]+r[1],P[2],r[3]-P[3]+r[1]]),x=w?P[2]-P[0]+5:0,E=A[0]+x,I=A[1],T=annotation_layer_classPrivateFieldGet(this,_o).style;T.left="".concat(100*(E-l)/i,"%");T.top="".concat(100*(I-c)/o,"%");annotation_layer_classPrivateFieldGet(this,_o).append(u)}}},{key:"_formatContents",value:function _formatContents(t){var r=t.str,a=t.dir,i=document.createElement("p");i.classList.add("popupContent");i.dir=a;for(var o=r.split(/(?:\r\n?|\n)/),l=0,c=o.length;l<c;++l){var u=o[l];i.append(document.createTextNode(u));l<c-1&&i.append(document.createElement("br"))}return i}},{key:"forceHide",value:function forceHide(){annotation_layer_classPrivateFieldSet(this,xo,this.isVisible);annotation_layer_classPrivateFieldGet(this,xo)&&(annotation_layer_classPrivateFieldGet(this,_o).hidden=!0)}},{key:"maybeShow",value:function maybeShow(){if(annotation_layer_classPrivateFieldGet(this,xo)){annotation_layer_classPrivateFieldSet(this,xo,!1);annotation_layer_classPrivateFieldGet(this,_o).hidden=!1}}},{key:"isVisible",get:function get(){return!1===annotation_layer_classPrivateFieldGet(this,_o).hidden}}]);return PopupElement}();function _keyDown2(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&annotation_layer_classPrivateFieldGet(this,Po))&&annotation_layer_classPrivateMethodGet(this,Io,_toggle2).call(this)}function _toggle2(){annotation_layer_classPrivateFieldSet(this,Po,!annotation_layer_classPrivateFieldGet(this,Po));if(annotation_layer_classPrivateFieldGet(this,Po)){annotation_layer_classPrivateMethodGet(this,To,_show2).call(this);annotation_layer_classPrivateFieldGet(this,_o).addEventListener("click",annotation_layer_classPrivateFieldGet(this,po));annotation_layer_classPrivateFieldGet(this,_o).addEventListener("keydown",annotation_layer_classPrivateFieldGet(this,uo))}else{annotation_layer_classPrivateMethodGet(this,Co,_hide2).call(this);annotation_layer_classPrivateFieldGet(this,_o).removeEventListener("click",annotation_layer_classPrivateFieldGet(this,po));annotation_layer_classPrivateFieldGet(this,_o).removeEventListener("keydown",annotation_layer_classPrivateFieldGet(this,uo))}}function _show2(){annotation_layer_classPrivateFieldGet(this,ko)||this.render();if(this.isVisible)annotation_layer_classPrivateFieldGet(this,Po)&&annotation_layer_classPrivateFieldGet(this,_o).classList.add("focused");else{annotation_layer_classPrivateFieldGet(this,_o).hidden=!1;annotation_layer_classPrivateFieldGet(this,_o).style.zIndex=parseInt(annotation_layer_classPrivateFieldGet(this,_o).style.zIndex)+1e3}}function _hide2(){annotation_layer_classPrivateFieldGet(this,_o).classList.remove("focused");if(!annotation_layer_classPrivateFieldGet(this,Po)&&this.isVisible){annotation_layer_classPrivateFieldGet(this,_o).hidden=!0;annotation_layer_classPrivateFieldGet(this,_o).style.zIndex=parseInt(annotation_layer_classPrivateFieldGet(this,_o).style.zIndex)-1e3}}var Go=function(t){annotation_layer_inherits(FreeTextAnnotationElement,t);function FreeTextAnnotationElement(t){var r;annotation_layer_classCallCheck(this,FreeTextAnnotationElement);(r=annotation_layer_callSuper(this,FreeTextAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])).textContent=t.data.textContent;r.textPosition=t.data.textPosition;r.annotationEditorType=g.FREETEXT;return r}annotation_layer_createClass(FreeTextAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("freeTextAnnotation");if(this.textContent){var t=document.createElement("div");t.classList.add("annotationTextContent");t.setAttribute("role","comment");var r,a=annotation_layer_createForOfIteratorHelper(this.textContent);try{for(a.s();!(r=a.n()).done;){var i=r.value,o=document.createElement("span");o.textContent=i;t.append(o)}}catch(t){a.e(t)}finally{a.f()}this.container.append(t)}!this.data.popupRef&&this.hasPopupData&&this._createPopup();this._editOnDoubleClick();return this.container}},{key:"_isEditable",get:function get(){return this.data.hasOwnCanvas}}]);return FreeTextAnnotationElement}($i),Oo=new WeakMap,Ro=function(t){annotation_layer_inherits(LineAnnotationElement,t);function LineAnnotationElement(t){var r;annotation_layer_classCallCheck(this,LineAnnotationElement);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,LineAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])),Oo,{writable:!0,value:null});return r}annotation_layer_createClass(LineAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("lineAnnotation");var t=this.data,r=getRectDims(t.rect),a=r.width,i=r.height,o=this.svgFactory.create(a,i,!0),l=annotation_layer_classPrivateFieldSet(this,Oo,this.svgFactory.createElement("svg:line"));l.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]);l.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]);l.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]);l.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]);l.setAttribute("stroke-width",t.borderStyle.width||1);l.setAttribute("stroke","transparent");l.setAttribute("fill","transparent");o.append(l);this.container.append(o);!t.popupRef&&this.hasPopupData&&this._createPopup();return this.container}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,Oo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return LineAnnotationElement}($i),Lo=new WeakMap,Do=function(t){annotation_layer_inherits(SquareAnnotationElement,t);function SquareAnnotationElement(t){var r;annotation_layer_classCallCheck(this,SquareAnnotationElement);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,SquareAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])),Lo,{writable:!0,value:null});return r}annotation_layer_createClass(SquareAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("squareAnnotation");var t=this.data,r=getRectDims(t.rect),a=r.width,i=r.height,o=this.svgFactory.create(a,i,!0),l=t.borderStyle.width,c=annotation_layer_classPrivateFieldSet(this,Lo,this.svgFactory.createElement("svg:rect"));c.setAttribute("x",l/2);c.setAttribute("y",l/2);c.setAttribute("width",a-l);c.setAttribute("height",i-l);c.setAttribute("stroke-width",l||1);c.setAttribute("stroke","transparent");c.setAttribute("fill","transparent");o.append(c);this.container.append(o);!t.popupRef&&this.hasPopupData&&this._createPopup();return this.container}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,Lo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return SquareAnnotationElement}($i),jo=new WeakMap,No=function(t){annotation_layer_inherits(CircleAnnotationElement,t);function CircleAnnotationElement(t){var r;annotation_layer_classCallCheck(this,CircleAnnotationElement);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,CircleAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])),jo,{writable:!0,value:null});return r}annotation_layer_createClass(CircleAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("circleAnnotation");var t=this.data,r=getRectDims(t.rect),a=r.width,i=r.height,o=this.svgFactory.create(a,i,!0),l=t.borderStyle.width,c=annotation_layer_classPrivateFieldSet(this,jo,this.svgFactory.createElement("svg:ellipse"));c.setAttribute("cx",a/2);c.setAttribute("cy",i/2);c.setAttribute("rx",a/2-l/2);c.setAttribute("ry",i/2-l/2);c.setAttribute("stroke-width",l||1);c.setAttribute("stroke","transparent");c.setAttribute("fill","transparent");o.append(c);this.container.append(o);!t.popupRef&&this.hasPopupData&&this._createPopup();return this.container}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,jo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return CircleAnnotationElement}($i),Wo=new WeakMap,Ho=function(t){annotation_layer_inherits(PolylineAnnotationElement,t);function PolylineAnnotationElement(t){var r;annotation_layer_classCallCheck(this,PolylineAnnotationElement);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,PolylineAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])),Wo,{writable:!0,value:null});r.containerClassName="polylineAnnotation";r.svgElementName="svg:polyline";return r}annotation_layer_createClass(PolylineAnnotationElement,[{key:"render",value:function render(){this.container.classList.add(this.containerClassName);var t,r=this.data,a=getRectDims(r.rect),i=a.width,o=a.height,l=this.svgFactory.create(i,o,!0),c=[],u=annotation_layer_createForOfIteratorHelper(r.vertices);try{for(u.s();!(t=u.n()).done;){var h=t.value,d=h.x-r.rect[0],p=r.rect[3]-h.y;c.push(d+","+p)}}catch(t){u.e(t)}finally{u.f()}c=c.join(" ");var v=annotation_layer_classPrivateFieldSet(this,Wo,this.svgFactory.createElement(this.svgElementName));v.setAttribute("points",c);v.setAttribute("stroke-width",r.borderStyle.width||1);v.setAttribute("stroke","transparent");v.setAttribute("fill","transparent");l.append(v);this.container.append(l);!r.popupRef&&this.hasPopupData&&this._createPopup();return this.container}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,Wo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return PolylineAnnotationElement}($i),Bo=function(t){annotation_layer_inherits(PolygonAnnotationElement,t);function PolygonAnnotationElement(t){var r;annotation_layer_classCallCheck(this,PolygonAnnotationElement);(r=annotation_layer_callSuper(this,PolygonAnnotationElement,[t])).containerClassName="polygonAnnotation";r.svgElementName="svg:polygon";return r}return annotation_layer_createClass(PolygonAnnotationElement)}(Ho),zo=function(t){annotation_layer_inherits(CaretAnnotationElement,t);function CaretAnnotationElement(t){annotation_layer_classCallCheck(this,CaretAnnotationElement);return annotation_layer_callSuper(this,CaretAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])}annotation_layer_createClass(CaretAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("caretAnnotation");!this.data.popupRef&&this.hasPopupData&&this._createPopup();return this.container}}]);return CaretAnnotationElement}($i),Uo=new WeakMap,qo=function(t){annotation_layer_inherits(InkAnnotationElement,t);function InkAnnotationElement(t){var r;annotation_layer_classCallCheck(this,InkAnnotationElement);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,InkAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])),Uo,{writable:!0,value:[]});r.containerClassName="inkAnnotation";r.svgElementName="svg:polyline";r.annotationEditorType=g.INK;return r}annotation_layer_createClass(InkAnnotationElement,[{key:"render",value:function render(){this.container.classList.add(this.containerClassName);var t,r=this.data,a=getRectDims(r.rect),i=a.width,o=a.height,l=this.svgFactory.create(i,o,!0),c=annotation_layer_createForOfIteratorHelper(r.inkLists);try{for(c.s();!(t=c.n()).done;){var u,h=t.value,d=[],p=annotation_layer_createForOfIteratorHelper(h);try{for(p.s();!(u=p.n()).done;){var v=u.value,_=v.x-r.rect[0],y=r.rect[3]-v.y;d.push("".concat(_,",").concat(y))}}catch(t){p.e(t)}finally{p.f()}d=d.join(" ");var g=this.svgFactory.createElement(this.svgElementName);annotation_layer_classPrivateFieldGet(this,Uo).push(g);g.setAttribute("points",d);g.setAttribute("stroke-width",r.borderStyle.width||1);g.setAttribute("stroke","transparent");g.setAttribute("fill","transparent");!r.popupRef&&this.hasPopupData&&this._createPopup();l.append(g)}}catch(t){c.e(t)}finally{c.f()}this.container.append(l);return this.container}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,Uo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return InkAnnotationElement}($i),Vo=function(t){annotation_layer_inherits(HighlightAnnotationElement,t);function HighlightAnnotationElement(t){annotation_layer_classCallCheck(this,HighlightAnnotationElement);return annotation_layer_callSuper(this,HighlightAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}])}annotation_layer_createClass(HighlightAnnotationElement,[{key:"render",value:function render(){!this.data.popupRef&&this.hasPopupData&&this._createPopup();this.container.classList.add("highlightAnnotation");return this.container}}]);return HighlightAnnotationElement}($i),Ko=function(t){annotation_layer_inherits(UnderlineAnnotationElement,t);function UnderlineAnnotationElement(t){annotation_layer_classCallCheck(this,UnderlineAnnotationElement);return annotation_layer_callSuper(this,UnderlineAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}])}annotation_layer_createClass(UnderlineAnnotationElement,[{key:"render",value:function render(){!this.data.popupRef&&this.hasPopupData&&this._createPopup();this.container.classList.add("underlineAnnotation");return this.container}}]);return UnderlineAnnotationElement}($i),Yo=function(t){annotation_layer_inherits(SquigglyAnnotationElement,t);function SquigglyAnnotationElement(t){annotation_layer_classCallCheck(this,SquigglyAnnotationElement);return annotation_layer_callSuper(this,SquigglyAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}])}annotation_layer_createClass(SquigglyAnnotationElement,[{key:"render",value:function render(){!this.data.popupRef&&this.hasPopupData&&this._createPopup();this.container.classList.add("squigglyAnnotation");return this.container}}]);return SquigglyAnnotationElement}($i),Xo=function(t){annotation_layer_inherits(StrikeOutAnnotationElement,t);function StrikeOutAnnotationElement(t){annotation_layer_classCallCheck(this,StrikeOutAnnotationElement);return annotation_layer_callSuper(this,StrikeOutAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}])}annotation_layer_createClass(StrikeOutAnnotationElement,[{key:"render",value:function render(){!this.data.popupRef&&this.hasPopupData&&this._createPopup();this.container.classList.add("strikeoutAnnotation");return this.container}}]);return StrikeOutAnnotationElement}($i),$o=function(t){annotation_layer_inherits(StampAnnotationElement,t);function StampAnnotationElement(t){annotation_layer_classCallCheck(this,StampAnnotationElement);return annotation_layer_callSuper(this,StampAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])}annotation_layer_createClass(StampAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("stampAnnotation");!this.data.popupRef&&this.hasPopupData&&this._createPopup();return this.container}}]);return StampAnnotationElement}($i),Jo=new WeakMap,Qo=new WeakSet,Zo=function(t){annotation_layer_inherits(FileAttachmentAnnotationElement,t);function FileAttachmentAnnotationElement(t){var r,a;annotation_layer_classCallCheck(this,FileAttachmentAnnotationElement);annotation_layer_classPrivateMethodInitSpec(annotation_layer_assertThisInitialized(a=annotation_layer_callSuper(this,FileAttachmentAnnotationElement,[t,{isRenderable:!0}])),Qo);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(a),Jo,{writable:!0,value:null});var i=a.data.file,o=i.filename,l=i.content;a.filename=getFilenameFromUrl(o,!0);a.content=l;null===(r=a.linkService.eventBus)||void 0===r||r.dispatch("fileattachmentannotation",{source:annotation_layer_assertThisInitialized(a),filename:o,content:l});return a}annotation_layer_createClass(FileAttachmentAnnotationElement,[{key:"render",value:function render(){var t=this;this.container.classList.add("fileAttachmentAnnotation");var r,a=this.container,i=this.data;if(i.hasAppearance||0===i.fillAlpha)r=document.createElement("div");else{(r=document.createElement("img")).src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(i.name)?"paperclip":"pushpin",".svg");i.fillAlpha&&i.fillAlpha<1&&(r.style="filter: opacity(".concat(Math.round(100*i.fillAlpha),"%);"))}r.addEventListener("dblclick",annotation_layer_classPrivateMethodGet(this,Qo,_download2).bind(this));annotation_layer_classPrivateFieldSet(this,Jo,r);var o=he.platform.isMac;a.addEventListener("keydown",(function(r){"Enter"===r.key&&(o?r.metaKey:r.ctrlKey)&&annotation_layer_classPrivateMethodGet(t,Qo,_download2).call(t)}));!i.popupRef&&this.hasPopupData?this._createPopup():r.classList.add("popupTriggerArea");a.append(r);return a}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,Jo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return FileAttachmentAnnotationElement}($i);function _download2(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.content,this.filename)}var es,ts=new WeakMap,rs=new WeakMap,ns=new WeakMap,as=new WeakSet,is=new WeakSet,os=function(){function AnnotationLayer(t){var r=t.div,a=t.accessibilityManager,i=t.annotationCanvasMap,o=t.page,l=t.viewport;annotation_layer_classCallCheck(this,AnnotationLayer);annotation_layer_classPrivateMethodInitSpec(this,is);annotation_layer_classPrivateMethodInitSpec(this,as);annotation_layer_classPrivateFieldInitSpec(this,ts,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,rs,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,ns,{writable:!0,value:new Map});this.div=r;annotation_layer_classPrivateFieldSet(this,ts,a);annotation_layer_classPrivateFieldSet(this,rs,i);this.page=o;this.viewport=l;this.zIndex=0}annotation_layer_createClass(AnnotationLayer,[{key:"render",value:(t=function annotation_layer_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){annotation_layer_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){annotation_layer_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}(annotation_layer_regeneratorRuntime().mark((function _callee3(t){var r,a,i,o,l,c,u,h,d,p,v,_,y,g,m;return annotation_layer_regeneratorRuntime().wrap((function _callee3$(b){for(;;)switch(b.prev=b.next){case 0:r=t.annotations;setLayerDimensions(a=this.div,this.viewport);i=new Map;o={data:null,layer:a,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new qe,annotationStorage:t.annotationStorage||new kn,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};l=annotation_layer_createForOfIteratorHelper(r);b.prev=6;l.s();case 8:if((c=l.n()).done){b.next=34;break}if(!(u=c.value).noHTML){b.next=12;break}return b.abrupt("continue",32);case 12:if(h=u.annotationType===U){b.next=19;break}d=getRectDims(u.rect),p=d.width,v=d.height;if(!(p<=0||v<=0)){b.next=17;break}return b.abrupt("continue",32);case 17:b.next=23;break;case 19:if(_=i.get(u.id)){b.next=22;break}return b.abrupt("continue",32);case 22:o.elements=_;case 23:o.data=u;if((y=Yi.create(o)).isRenderable){b.next=27;break}return b.abrupt("continue",32);case 27:!h&&u.popupRef&&((g=i.get(u.popupRef))?g.push(y):i.set(u.popupRef,[y]));y.annotationEditorType>0&&annotation_layer_classPrivateFieldGet(this,ns).set(y.data.id,y);m=y.render();u.hidden&&(m.style.visibility="hidden");annotation_layer_classPrivateMethodGet(this,as,_appendElement2).call(this,m,u.id);case 32:b.next=8;break;case 34:b.next=39;break;case 36:b.prev=36;b.t0=b.catch(6);l.e(b.t0);case 39:b.prev=39;l.f();return b.finish(39);case 42:annotation_layer_classPrivateMethodGet(this,is,_setAnnotationCanvasMap2).call(this);case 43:case"end":return b.stop()}}),_callee3,this,[[6,36,39,42]])}))),function render(r){return t.apply(this,arguments)})},{key:"update",value:function update(t){var r=t.viewport,a=this.div;this.viewport=r;setLayerDimensions(a,{rotation:r.rotation});annotation_layer_classPrivateMethodGet(this,is,_setAnnotationCanvasMap2).call(this);a.hidden=!1}},{key:"getEditableAnnotations",value:function getEditableAnnotations(){return Array.from(annotation_layer_classPrivateFieldGet(this,ns).values())}},{key:"getEditableAnnotation",value:function getEditableAnnotation(t){return annotation_layer_classPrivateFieldGet(this,ns).get(t)}}]);var t;return AnnotationLayer}();function _appendElement2(t,r){var a,i=t.firstChild||t;i.id="".concat(ge).concat(r);this.div.append(t);null===(a=annotation_layer_classPrivateFieldGet(this,ts))||void 0===a||a.moveElementInDOM(this.div,t,i,!1)}function _setAnnotationCanvasMap2(){if(annotation_layer_classPrivateFieldGet(this,rs)){var t,r=this.div,a=annotation_layer_createForOfIteratorHelper(annotation_layer_classPrivateFieldGet(this,rs));try{for(a.s();!(t=a.n()).done;){var i=annotation_layer_slicedToArray(t.value,2),o=i[0],l=i[1],c=r.querySelector('[data-annotation-id="'.concat(o,'"]'));if(c){var u=c.firstChild;u?"CANVAS"===u.nodeName?u.replaceWith(l):u.before(l):c.append(l)}}}catch(t){a.e(t)}finally{a.f()}annotation_layer_classPrivateFieldGet(this,rs).clear()}}function freetext_typeof(t){return freetext_typeof="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},freetext_typeof(t)}function freetext_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=freetext_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function freetext_toConsumableArray(t){return function freetext_arrayWithoutHoles(t){if(Array.isArray(t))return freetext_arrayLikeToArray(t)}(t)||function freetext_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||freetext_unsupportedIterableToArray(t)||function freetext_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function freetext_slicedToArray(t,r){return function freetext_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function freetext_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||freetext_unsupportedIterableToArray(t,r)||function freetext_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function freetext_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return freetext_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?freetext_arrayLikeToArray(t,r):void 0}}function freetext_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function ownKeys(t,r){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,i)}return a}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(a),!0).forEach((function(r){freetext_defineProperty(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}function freetext_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,freetext_toPropertyKey(i.key),i)}}function freetext_callSuper(t,r,a){return r=freetext_getPrototypeOf(r),function freetext_possibleConstructorReturn(t,r){if(r&&("object"===freetext_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return freetext_assertThisInitialized(t)}(t,freetext_isNativeReflectConstruct()?Reflect.construct(r,a||[],freetext_getPrototypeOf(t).constructor):r.apply(t,a))}function freetext_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(freetext_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function freetext_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function freetext_get(){freetext_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function freetext_superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=freetext_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}};return freetext_get.apply(this,arguments)}function freetext_getPrototypeOf(t){freetext_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return freetext_getPrototypeOf(t)}function freetext_setPrototypeOf(t,r){freetext_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return freetext_setPrototypeOf(t,r)}function freetext_classPrivateMethodInitSpec(t,r){freetext_checkPrivateRedeclaration(t,r);r.add(t)}function freetext_defineProperty(t,r,a){(r=freetext_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function freetext_toPropertyKey(t){var r=function freetext_toPrimitive(t,r){if("object"!=freetext_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=freetext_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==freetext_typeof(r)?r:String(r)}function freetext_classPrivateFieldInitSpec(t,r,a){freetext_checkPrivateRedeclaration(t,r);r.set(t,a)}function freetext_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function freetext_classStaticPrivateMethodGet(t,r,a){!function freetext_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function freetext_classPrivateFieldGet(t,r){return function freetext_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,freetext_classExtractFieldDescriptor(t,r,"get"))}function freetext_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function freetext_classPrivateFieldSet(t,r,a){!function freetext_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,freetext_classExtractFieldDescriptor(t,r,"set"),a);return a}function freetext_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var ss=new WeakMap,ls=new WeakMap,cs=new WeakMap,us=new WeakMap,hs=new WeakMap,ds=new WeakMap,fs=new WeakMap,ps=new WeakMap,vs=new WeakMap,_s=new WeakSet,ys=new WeakSet,gs=new WeakSet,ms=new WeakSet,bs=new WeakSet,ws=new WeakSet,Ps=new WeakSet,ks=new WeakSet,Ss=function(t){!function freetext_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&freetext_setPrototypeOf(t,r)}(FreeTextEditor,t);function FreeTextEditor(t){var r;!function freetext_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,FreeTextEditor);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r=freetext_callSuper(this,FreeTextEditor,[_objectSpread(_objectSpread({},t),{},{name:"freeTextEditor"})])),ks);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),Ps);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),ws);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),bs);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),ms);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),gs);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),ys);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),_s);freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),ss,{writable:!0,value:r.editorDivBlur.bind(freetext_assertThisInitialized(r))});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),ls,{writable:!0,value:r.editorDivFocus.bind(freetext_assertThisInitialized(r))});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),cs,{writable:!0,value:r.editorDivInput.bind(freetext_assertThisInitialized(r))});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),us,{writable:!0,value:r.editorDivKeydown.bind(freetext_assertThisInitialized(r))});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),hs,{writable:!0,value:void 0});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),ds,{writable:!0,value:""});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),fs,{writable:!0,value:"".concat(r.id,"-editor")});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),ps,{writable:!0,value:void 0});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),vs,{writable:!0,value:null});freetext_classPrivateFieldSet(freetext_assertThisInitialized(r),hs,t.color||FreeTextEditor._defaultColor||fn._defaultLineColor);freetext_classPrivateFieldSet(freetext_assertThisInitialized(r),ps,t.fontSize||FreeTextEditor._defaultFontSize);return r}!function freetext_createClass(t,r,a){r&&freetext_defineProperties(t.prototype,r);a&&freetext_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(FreeTextEditor,[{key:"updateParams",value:function updateParams(t,r){switch(t){case m.FREETEXT_SIZE:freetext_classPrivateMethodGet(this,_s,_updateFontSize2).call(this,r);break;case m.FREETEXT_COLOR:freetext_classPrivateMethodGet(this,ys,_updateColor2).call(this,r)}}},{key:"propertiesToUpdate",get:function get(){return[[m.FREETEXT_SIZE,freetext_classPrivateFieldGet(this,ps)],[m.FREETEXT_COLOR,freetext_classPrivateFieldGet(this,hs)]]}},{key:"_translateEmpty",value:function _translateEmpty(t,r){this._uiManager.translateSelectedEditors(t,r,!0)}},{key:"getInitialTranslation",value:function getInitialTranslation(){var t=this.parentScale;return[-FreeTextEditor._internalPadding*t,-(FreeTextEditor._internalPadding+freetext_classPrivateFieldGet(this,ps))*t]}},{key:"rebuild",value:function rebuild(){if(this.parent){freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"rebuild",this).call(this);null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}}},{key:"enableEditMode",value:function enableEditMode(){if(!this.isInEditMode()){this.parent.setEditingState(!1);this.parent.updateToolbar(g.FREETEXT);freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"enableEditMode",this).call(this);this.overlayDiv.classList.remove("enabled");this.editorDiv.contentEditable=!0;this._isDraggable=!1;this.div.removeAttribute("aria-activedescendant");this.editorDiv.addEventListener("keydown",freetext_classPrivateFieldGet(this,us));this.editorDiv.addEventListener("focus",freetext_classPrivateFieldGet(this,ls));this.editorDiv.addEventListener("blur",freetext_classPrivateFieldGet(this,ss));this.editorDiv.addEventListener("input",freetext_classPrivateFieldGet(this,cs))}}},{key:"disableEditMode",value:function disableEditMode(){if(this.isInEditMode()){this.parent.setEditingState(!0);freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"disableEditMode",this).call(this);this.overlayDiv.classList.add("enabled");this.editorDiv.contentEditable=!1;this.div.setAttribute("aria-activedescendant",freetext_classPrivateFieldGet(this,fs));this._isDraggable=!0;this.editorDiv.removeEventListener("keydown",freetext_classPrivateFieldGet(this,us));this.editorDiv.removeEventListener("focus",freetext_classPrivateFieldGet(this,ls));this.editorDiv.removeEventListener("blur",freetext_classPrivateFieldGet(this,ss));this.editorDiv.removeEventListener("input",freetext_classPrivateFieldGet(this,cs));this.div.focus({preventScroll:!0});this.isEditing=!1;this.parent.div.classList.add("freetextEditing")}}},{key:"focusin",value:function focusin(t){if(this._focusEventsAllowed){freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"focusin",this).call(this,t);t.target!==this.editorDiv&&this.editorDiv.focus()}}},{key:"onceAdded",value:function onceAdded(){var t;if(this.width)freetext_classPrivateMethodGet(this,ks,_cheatInitialRect2).call(this);else{this.enableEditMode();this.editorDiv.focus();null!==(t=this._initialOptions)&&void 0!==t&&t.isCentered&&this.center();this._initialOptions=null}}},{key:"isEmpty",value:function isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}},{key:"remove",value:function remove(){this.isEditing=!1;if(this.parent){this.parent.setEditingState(!0);this.parent.div.classList.add("freetextEditing")}freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"remove",this).call(this)}},{key:"commit",value:function commit(){var t=this;if(this.isInEditMode()){freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"commit",this).call(this);this.disableEditMode();var r=freetext_classPrivateFieldGet(this,ds),a=freetext_classPrivateFieldSet(this,ds,freetext_classPrivateMethodGet(this,gs,_extractText2).call(this).trimEnd());if(r!==a){var i=function setText(r){freetext_classPrivateFieldSet(t,ds,r);if(r){freetext_classPrivateMethodGet(t,bs,_setContent2).call(t);t._uiManager.rebuild(t);freetext_classPrivateMethodGet(t,ms,_setEditorDimensions2).call(t)}else t.remove()};this.addCommands({cmd:function cmd(){i(a)},undo:function undo(){i(r)},mustExec:!1});freetext_classPrivateMethodGet(this,ms,_setEditorDimensions2).call(this)}}}},{key:"shouldGetKeyboardEvents",value:function shouldGetKeyboardEvents(){return this.isInEditMode()}},{key:"enterInEditMode",value:function enterInEditMode(){this.enableEditMode();this.editorDiv.focus()}},{key:"dblclick",value:function dblclick(t){this.enterInEditMode()}},{key:"keydown",value:function keydown(t){if(t.target===this.div&&"Enter"===t.key){this.enterInEditMode();t.preventDefault()}}},{key:"editorDivKeydown",value:function editorDivKeydown(t){FreeTextEditor._keyboardManager.exec(this,t)}},{key:"editorDivFocus",value:function editorDivFocus(t){this.isEditing=!0}},{key:"editorDivBlur",value:function editorDivBlur(t){this.isEditing=!1}},{key:"editorDivInput",value:function editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}},{key:"disableEditing",value:function disableEditing(){this.editorDiv.setAttribute("role","comment");this.editorDiv.removeAttribute("aria-multiline")}},{key:"enableEditing",value:function enableEditing(){this.editorDiv.setAttribute("role","textbox");this.editorDiv.setAttribute("aria-multiline",!0)}},{key:"render",value:function render(){var t,r,a=this;if(this.div)return this.div;if(this.width){t=this.x;r=this.y}freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"render",this).call(this);this.editorDiv=document.createElement("div");this.editorDiv.className="internal";this.editorDiv.setAttribute("id",freetext_classPrivateFieldGet(this,fs));this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text");this.enableEditing();fn._l10nPromise.get("pdfjs-free-text-default-content").then((function(t){var r;return null===(r=a.editorDiv)||void 0===r?void 0:r.setAttribute("default-content",t)}));this.editorDiv.contentEditable=!0;var i=this.editorDiv.style;i.fontSize="calc(".concat(freetext_classPrivateFieldGet(this,ps),"px * var(--scale-factor))");i.color=freetext_classPrivateFieldGet(this,hs);this.div.append(this.editorDiv);this.overlayDiv=document.createElement("div");this.overlayDiv.classList.add("overlay","enabled");this.div.append(this.overlayDiv);bindEvents(this,this.div,["dblclick","keydown"]);if(this.width){var o=freetext_slicedToArray(this.parentDimensions,2),l=o[0],c=o[1];if(this.annotationElementId){var u=freetext_classPrivateFieldGet(this,vs).position,h=freetext_slicedToArray(this.getInitialTranslation(),2),d=h[0],p=h[1],v=freetext_slicedToArray(this.pageTranslationToScreen(d,p),2);d=v[0];p=v[1];var _,y,g=freetext_slicedToArray(this.pageDimensions,2),m=g[0],b=g[1],w=freetext_slicedToArray(this.pageTranslation,2),P=w[0],k=w[1];switch(this.rotation){case 0:_=t+(u[0]-P)/m;y=r+this.height-(u[1]-k)/b;break;case 90:_=t+(u[0]-P)/m;y=r-(u[1]-k)/b;var S=[p,-d];d=S[0];p=S[1];break;case 180:_=t-this.width+(u[0]-P)/m;y=r-(u[1]-k)/b;var A=[-d,-p];d=A[0];p=A[1];break;case 270:_=t+(u[0]-P-this.height*b)/m;y=r+(u[1]-k-this.width*m)/b;var x=[-p,d];d=x[0];p=x[1]}this.setAt(_*l,y*c,d,p)}else this.setAt(t*l,r*c,this.width*l,this.height*c);freetext_classPrivateMethodGet(this,bs,_setContent2).call(this);this._isDraggable=!0;this.editorDiv.contentEditable=!1}else{this._isDraggable=!1;this.editorDiv.contentEditable=!0}return this.div}},{key:"contentDiv",get:function get(){return this.editorDiv}},{key:"serialize",value:function serialize(){var 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};var r=FreeTextEditor._internalPadding*this.parentScale,a=this.getRect(r,r),i=fn._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:freetext_classPrivateFieldGet(this,hs)),o={annotationType:g.FREETEXT,color:i,fontSize:freetext_classPrivateFieldGet(this,ps),value:freetext_classPrivateMethodGet(this,ws,_serializeContent2).call(this),pageIndex:this.pageIndex,rect:a,rotation:this.rotation,structTreeParentId:this._structTreeParentId};if(t)return o;if(this.annotationElementId&&!freetext_classPrivateMethodGet(this,Ps,_hasElementChanged2).call(this,o))return null;o.id=this.annotationElementId;return o}}],[{key:"_keyboardManager",get:function get(){var t=FreeTextEditor.prototype,r=function arrowChecker(t){return t.isEmpty()},a=fr.TRANSLATE_SMALL,i=fr.TRANSLATE_BIG;return shadow(this,"_keyboardManager",new dt([[["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:[-a,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[a,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[i,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-a],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:r}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,a],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,i],checker:r}]]))}},{key:"initialize",value:function initialize(t,r){fn.initialize(t,r,{strings:["pdfjs-free-text-default-content"]});var a=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(a.getPropertyValue("--freetext-padding"))}},{key:"updateDefaultParams",value:function updateDefaultParams(t,r){switch(t){case m.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=r;break;case m.FREETEXT_COLOR:FreeTextEditor._defaultColor=r}}},{key:"defaultPropertiesToUpdate",get:function get(){return[[m.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[m.FREETEXT_COLOR,FreeTextEditor._defaultColor||fn._defaultLineColor]]}},{key:"deserialize",value:function deserialize(t,r,a){var i=null;if(t instanceof Go){var o=t,l=o.data,c=l.defaultAppearanceData,u=c.fontSize,h=c.fontColor,d=l.rect,p=l.rotation,v=l.id,_=o.textContent,y=o.textPosition,m=o.parent.page.pageNumber;if(!_||0===_.length)return null;i=t={annotationType:g.FREETEXT,color:Array.from(h),fontSize:u,value:_.join("\n"),position:y,pageIndex:m-1,rect:d,rotation:p,id:v,deleted:!1}}var b=freetext_get(freetext_getPrototypeOf(FreeTextEditor),"deserialize",this).call(this,t,r,a);freetext_classPrivateFieldSet(b,ps,t.fontSize);freetext_classPrivateFieldSet(b,hs,fe.makeHexColor.apply(fe,freetext_toConsumableArray(t.color)));freetext_classPrivateFieldSet(b,ds,freetext_classStaticPrivateMethodGet(FreeTextEditor,FreeTextEditor,_deserializeContent).call(FreeTextEditor,t.value));b.annotationElementId=t.id||null;freetext_classPrivateFieldSet(b,vs,i);return b}}]);return FreeTextEditor}(fn);es=Ss;function _updateFontSize2(t){var r=this,a=function setFontsize(t){r.editorDiv.style.fontSize="calc(".concat(t,"px * var(--scale-factor))");r.translate(0,-(t-freetext_classPrivateFieldGet(r,ps))*r.parentScale);freetext_classPrivateFieldSet(r,ps,t);freetext_classPrivateMethodGet(r,ms,_setEditorDimensions2).call(r)},i=freetext_classPrivateFieldGet(this,ps);this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function _updateColor2(t){var r=this,a=function setColor(t){freetext_classPrivateFieldSet(r,hs,r.editorDiv.style.color=t)},i=freetext_classPrivateFieldGet(this,hs);this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _extractText2(){var t=[];this.editorDiv.normalize();var r,a=/\r\n?|\n/g,i=freetext_createForOfIteratorHelper(this.editorDiv.childNodes);try{for(i.s();!(r=i.n()).done;){var o=r.value,l=o.nodeType===Node.TEXT_NODE?o.nodeValue:o.innerText;t.push(l.replaceAll(a,""))}}catch(t){i.e(t)}finally{i.f()}return t.join("\n")}function _setEditorDimensions2(){var t,r=freetext_slicedToArray(this.parentDimensions,2),a=r[0],i=r[1];if(this.isAttachedToDOM)t=this.div.getBoundingClientRect();else{var o=this.currentLayer,l=this.div,c=l.style.display;l.style.display="hidden";o.div.append(this.div);t=l.getBoundingClientRect();l.remove();l.style.display=c}if(this.rotation%180==this.parentRotation%180){this.width=t.width/a;this.height=t.height/i}else{this.width=t.height/a;this.height=t.width/i}this.fixAndSetPosition()}function _setContent2(){this.editorDiv.replaceChildren();if(freetext_classPrivateFieldGet(this,ds)){var t,r=freetext_createForOfIteratorHelper(freetext_classPrivateFieldGet(this,ds).split("\n"));try{for(r.s();!(t=r.n()).done;){var a=t.value,i=document.createElement("div");i.append(a?document.createTextNode(a):document.createElement("br"));this.editorDiv.append(i)}}catch(t){r.e(t)}finally{r.f()}}}function _serializeContent2(){return freetext_classPrivateFieldGet(this,ds).replaceAll(" "," ")}function _deserializeContent(t){return t.replaceAll(" "," ")}function _hasElementChanged2(t){var r=freetext_classPrivateFieldGet(this,vs),a=r.value,i=r.fontSize,o=r.color,l=r.rect,c=r.pageIndex;return t.value!==a||t.fontSize!==i||t.rect.some((function(t,r){return Math.abs(t-l[r])>=1}))||t.color.some((function(t,r){return t!==o[r]}))||t.pageIndex!==c}function _cheatInitialRect2(){var t=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.annotationElementId){freetext_classPrivateMethodGet(this,ms,_setEditorDimensions2).call(this);if(r||0!==this.width&&0!==this.height){var a=es._internalPadding*this.parentScale;freetext_classPrivateFieldGet(this,vs).rect=this.getRect(a,a)}else setTimeout((function(){return freetext_classPrivateMethodGet(t,ks,_cheatInitialRect2).call(t,!0)}),0)}}freetext_defineProperty(Ss,"_freeTextDefaultContent","");freetext_defineProperty(Ss,"_internalPadding",0);freetext_defineProperty(Ss,"_defaultColor",null);freetext_defineProperty(Ss,"_defaultFontSize",10);freetext_defineProperty(Ss,"_type","freetext");freetext_defineProperty(Ss,"_editorType",g.FREETEXT);var Fs;__webpack_require__(5137),__webpack_require__(292);function outliner_typeof(t){return outliner_typeof="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},outliner_typeof(t)}function outliner_classStaticPrivateFieldSpecGet(t,r,a){!function outliner_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);!function outliner_classCheckPrivateStaticFieldDescriptor(t,r){if(void 0===t)throw new TypeError("attempted to "+r+" private static field before its declaration")}(a,"get");return outliner_classApplyDescriptorGet(t,a)}function outliner_callSuper(t,r,a){return r=outliner_getPrototypeOf(r),function outliner_possibleConstructorReturn(t,r){if(r&&("object"===outliner_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return outliner_assertThisInitialized(t)}(t,outliner_isNativeReflectConstruct()?Reflect.construct(r,a||[],outliner_getPrototypeOf(t).constructor):r.apply(t,a))}function outliner_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(outliner_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function outliner_getPrototypeOf(t){outliner_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return outliner_getPrototypeOf(t)}function outliner_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function outliner_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&outliner_setPrototypeOf(t,r)}function outliner_setPrototypeOf(t,r){outliner_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return outliner_setPrototypeOf(t,r)}function outliner_toConsumableArray(t){return function outliner_arrayWithoutHoles(t){if(Array.isArray(t))return outliner_arrayLikeToArray(t)}(t)||function outliner_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||outliner_unsupportedIterableToArray(t)||function outliner_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function outliner_slicedToArray(t,r){return function outliner_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function outliner_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||outliner_unsupportedIterableToArray(t,r)||function outliner_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function outliner_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=outliner_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function outliner_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return outliner_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?outliner_arrayLikeToArray(t,r):void 0}}function outliner_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function outliner_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function outliner_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,outliner_toPropertyKey(i.key),i)}}function outliner_createClass(t,r,a){r&&outliner_defineProperties(t.prototype,r);a&&outliner_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function outliner_toPropertyKey(t){var r=function outliner_toPrimitive(t,r){if("object"!=outliner_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=outliner_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==outliner_typeof(r)?r:String(r)}function outliner_classPrivateMethodInitSpec(t,r){outliner_checkPrivateRedeclaration(t,r);r.add(t)}function outliner_classPrivateFieldInitSpec(t,r,a){outliner_checkPrivateRedeclaration(t,r);r.set(t,a)}function outliner_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function outliner_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function outliner_classPrivateFieldSet(t,r,a){!function outliner_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,outliner_classExtractFieldDescriptor(t,r,"set"),a);return a}function outliner_classPrivateFieldGet(t,r){return outliner_classApplyDescriptorGet(t,outliner_classExtractFieldDescriptor(t,r,"get"))}function outliner_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function outliner_classApplyDescriptorGet(t,r){return r.get?r.get.call(t):r.value}var As=new WeakMap,xs=new WeakMap,Es=new WeakMap,Is=new WeakSet,Ts=new WeakSet,Cs=new WeakSet,Ms=new WeakSet,Gs=new WeakSet,Os=function(){function Outliner(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];outliner_classCallCheck(this,Outliner);outliner_classPrivateMethodInitSpec(this,Gs);outliner_classPrivateMethodInitSpec(this,Ms);outliner_classPrivateMethodInitSpec(this,Cs);outliner_classPrivateMethodInitSpec(this,Ts);outliner_classPrivateMethodInitSpec(this,Is);outliner_classPrivateFieldInitSpec(this,As,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,xs,{writable:!0,value:[]});outliner_classPrivateFieldInitSpec(this,Es,{writable:!0,value:[]});var o,l=1/0,c=-1/0,u=1/0,h=-1/0,d=Math.pow(10,-4),p=outliner_createForOfIteratorHelper(t);try{for(p.s();!(o=p.n()).done;){var v=o.value,_=v.x,y=v.y,g=v.width,m=v.height,b=Math.floor((_-r)/d)*d,w=Math.ceil((_+g+r)/d)*d,P=Math.floor((y-r)/d)*d,k=Math.ceil((y+m+r)/d)*d,S=[b,P,k,!0],A=[w,P,k,!1];outliner_classPrivateFieldGet(this,xs).push(S,A);l=Math.min(l,b);c=Math.max(c,w);u=Math.min(u,P);h=Math.max(h,k)}}catch(t){p.e(t)}finally{p.f()}var x,E=c-l+2*a,I=h-u+2*a,T=l-a,C=u-a,M=outliner_classPrivateFieldGet(this,xs).at(i?-1:-2),G=[M[0],M[2]],O=outliner_createForOfIteratorHelper(outliner_classPrivateFieldGet(this,xs));try{for(O.s();!(x=O.n()).done;){var R=x.value,L=outliner_slicedToArray(R,3),D=L[0],j=L[1],N=L[2];R[0]=(D-T)/E;R[1]=(j-C)/I;R[2]=(N-C)/I}}catch(t){O.e(t)}finally{O.f()}outliner_classPrivateFieldSet(this,As,{x:T,y:C,width:E,height:I,lastPoint:G})}outliner_createClass(Outliner,[{key:"getOutlines",value:function getOutlines(){outliner_classPrivateFieldGet(this,xs).sort((function(t,r){return t[0]-r[0]||t[1]-r[1]||t[2]-r[2]}));var t,r=[],a=outliner_createForOfIteratorHelper(outliner_classPrivateFieldGet(this,xs));try{for(a.s();!(t=a.n()).done;){var i=t.value;if(i[3]){r.push.apply(r,outliner_toConsumableArray(outliner_classPrivateMethodGet(this,Gs,_breakEdge2).call(this,i)));outliner_classPrivateMethodGet(this,Cs,_insert2).call(this,i)}else{outliner_classPrivateMethodGet(this,Ms,_remove2).call(this,i);r.push.apply(r,outliner_toConsumableArray(outliner_classPrivateMethodGet(this,Gs,_breakEdge2).call(this,i)))}}}catch(t){a.e(t)}finally{a.f()}return outliner_classPrivateMethodGet(this,Is,_getOutlines2).call(this,r)}}]);return Outliner}();function _getOutlines2(t){var r,a=[],i=new Set,o=outliner_createForOfIteratorHelper(t);try{for(o.s();!(r=o.n()).done;){var l=r.value,c=outliner_slicedToArray(l,3),u=c[0],h=c[1],d=c[2];a.push([u,h,l],[u,d,l])}}catch(t){o.e(t)}finally{o.f()}a.sort((function(t,r){return t[1]-r[1]||t[0]-r[0]}));for(var p=0,v=a.length;p<v;p+=2){var _=a[p][2],y=a[p+1][2];_.push(y);y.push(_);i.add(_);i.add(y)}for(var g,m=[];i.size>0;){var b=i.values().next().value,w=outliner_slicedToArray(b,5),P=w[0],k=w[1],S=w[2],A=w[3],x=w[4];i.delete(b);var E=P,I=k;g=[P,S];m.push(g);for(;;){var T=void 0;if(i.has(A))T=A;else{if(!i.has(x))break;T=x}i.delete(T);var C=outliner_slicedToArray(T,5);P=C[0];k=C[1];S=C[2];A=C[3];x=C[4];if(E!==P){g.push(E,I,P,I===k?k:S);E=P}I=I===k?S:k}g.push(E,I)}return new js(m,outliner_classPrivateFieldGet(this,As))}function _binarySearch2(t){for(var r=outliner_classPrivateFieldGet(this,Es),a=0,i=r.length-1;a<=i;){var o=a+i>>1,l=r[o][0];if(l===t)return o;l<t?a=o+1:i=o-1}return i+1}function _insert2(t){var r=outliner_slicedToArray(t,3),a=r[1],i=r[2],o=outliner_classPrivateMethodGet(this,Ts,_binarySearch2).call(this,a);outliner_classPrivateFieldGet(this,Es).splice(o,0,[a,i])}function _remove2(t){for(var r=outliner_slicedToArray(t,3),a=r[1],i=r[2],o=outliner_classPrivateMethodGet(this,Ts,_binarySearch2).call(this,a),l=o;l<outliner_classPrivateFieldGet(this,Es).length;l++){var c=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Es)[l],2),u=c[0],h=c[1];if(u!==a)break;if(u===a&&h===i){outliner_classPrivateFieldGet(this,Es).splice(l,1);return}}for(var d=o-1;d>=0;d--){var p=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Es)[d],2),v=p[0],_=p[1];if(v!==a)break;if(v===a&&_===i){outliner_classPrivateFieldGet(this,Es).splice(d,1);return}}}function _breakEdge2(t){for(var r=outliner_slicedToArray(t,3),a=r[0],i=r[1],o=r[2],l=[[a,i,o]],c=outliner_classPrivateMethodGet(this,Ts,_binarySearch2).call(this,o),u=0;u<c;u++)for(var h=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Es)[u],2),d=h[0],p=h[1],v=0,_=l.length;v<_;v++){var y=outliner_slicedToArray(l[v],3),g=y[1],m=y[2];if(!(p<=g||m<=d))if(g>=d)if(m>p)l[v][1]=p;else{if(1===_)return[];l.splice(v,1);v--;_--}else{l[v][2]=d;m>p&&l.push([a,p,m])}}return l}var Rs=function(){function Outline(){outliner_classCallCheck(this,Outline)}outliner_createClass(Outline,[{key:"toSVGPath",value:function toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}},{key:"box",get:function get(){throw new Error("Abstract getter `box` must be implemented.")}},{key:"serialize",value:function serialize(t,r){throw new Error("Abstract method `serialize` must be implemented.")}},{key:"free",get:function get(){return this instanceof fl}}]);return Outline}(),Ls=new WeakMap,Ds=new WeakMap,js=function(t){outliner_inherits(HighlightOutline,t);function HighlightOutline(t,r){var a;outliner_classCallCheck(this,HighlightOutline);outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(a=outliner_callSuper(this,HighlightOutline)),Ls,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(a),Ds,{writable:!0,value:void 0});outliner_classPrivateFieldSet(outliner_assertThisInitialized(a),Ds,t);outliner_classPrivateFieldSet(outliner_assertThisInitialized(a),Ls,r);return a}outliner_createClass(HighlightOutline,[{key:"toSVGPath",value:function toSVGPath(){var t,r=[],a=outliner_createForOfIteratorHelper(outliner_classPrivateFieldGet(this,Ds));try{for(a.s();!(t=a.n()).done;){var i=t.value,o=outliner_slicedToArray(i,2),l=o[0],c=o[1];r.push("M".concat(l," ").concat(c));for(var u=2;u<i.length;u+=2){var h=i[u],d=i[u+1];if(h===l){r.push("V".concat(d));c=d}else if(d===c){r.push("H".concat(h));l=h}}r.push("Z")}}catch(t){a.e(t)}finally{a.f()}return r.join(" ")}},{key:"serialize",value:function serialize(t,r){var a,i=outliner_slicedToArray(t,4),o=i[0],l=i[1],c=i[2],u=i[3],h=[],d=c-o,p=u-l,v=outliner_createForOfIteratorHelper(outliner_classPrivateFieldGet(this,Ds));try{for(v.s();!(a=v.n()).done;){for(var _=a.value,y=new Array(_.length),g=0;g<_.length;g+=2){y[g]=o+_[g]*d;y[g+1]=u-_[g+1]*p}h.push(y)}}catch(t){v.e(t)}finally{v.f()}return h}},{key:"box",get:function get(){return outliner_classPrivateFieldGet(this,Ls)}}]);return HighlightOutline}(Rs),Ns=new WeakMap,Ws=new WeakMap,Hs=new WeakMap,Bs=new WeakMap,zs=new WeakMap,Us=new WeakMap,qs=new WeakMap,Vs=new WeakMap,Ks=new WeakMap,Ys=new WeakMap,Xs=new WeakMap,$s=new WeakMap,Js=new WeakMap,Qs=new WeakSet,Zs=function(){function FreeOutliner(t,r,a,i,o){var l=t.x,c=t.y,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;outliner_classCallCheck(this,FreeOutliner);outliner_classPrivateMethodInitSpec(this,Qs);outliner_classPrivateFieldInitSpec(this,Ns,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Ws,{writable:!0,value:[]});outliner_classPrivateFieldInitSpec(this,Hs,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Bs,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,zs,{writable:!0,value:[]});outliner_classPrivateFieldInitSpec(this,Us,{writable:!0,value:new Float64Array(18)});outliner_classPrivateFieldInitSpec(this,qs,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Vs,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Ks,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Ys,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Xs,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,$s,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Js,{writable:!0,value:[]});outliner_classPrivateFieldSet(this,Ns,r);outliner_classPrivateFieldSet(this,$s,i*a);outliner_classPrivateFieldSet(this,Bs,o);outliner_classPrivateFieldGet(this,Us).set([NaN,NaN,NaN,NaN,l,c],6);outliner_classPrivateFieldSet(this,Hs,u);outliner_classPrivateFieldSet(this,Ys,outliner_classStaticPrivateFieldSpecGet(FreeOutliner,FreeOutliner,tl)*a);outliner_classPrivateFieldSet(this,Ks,outliner_classStaticPrivateFieldSpecGet(FreeOutliner,FreeOutliner,rl)*a);outliner_classPrivateFieldSet(this,Xs,a);outliner_classPrivateFieldGet(this,Js).push(l,c)}outliner_createClass(FreeOutliner,[{key:"free",get:function get(){return!0}},{key:"isEmpty",value:function isEmpty(){return isNaN(outliner_classPrivateFieldGet(this,Us)[8])}},{key:"add",value:function add(t){var r,a=t.x,i=t.y;outliner_classPrivateFieldSet(this,qs,a);outliner_classPrivateFieldSet(this,Vs,i);var o=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Ns),4),l=o[0],c=o[1],u=o[2],h=o[3],d=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Us).subarray(8,12),4),p=d[0],v=d[1],_=d[2],y=d[3],g=a-_,m=i-y,b=Math.hypot(g,m);if(b<outliner_classPrivateFieldGet(this,Ks))return!1;var w=b-outliner_classPrivateFieldGet(this,Ys),P=w/b,k=P*g,S=P*m,A=p,x=v;p=_;v=y;_+=k;y+=S;null===(r=outliner_classPrivateFieldGet(this,Js))||void 0===r||r.push(a,i);var E=k/w,I=-S/w*outliner_classPrivateFieldGet(this,$s),T=E*outliner_classPrivateFieldGet(this,$s);outliner_classPrivateFieldGet(this,Us).set(outliner_classPrivateFieldGet(this,Us).subarray(2,8),0);outliner_classPrivateFieldGet(this,Us).set([_+I,y+T],4);outliner_classPrivateFieldGet(this,Us).set(outliner_classPrivateFieldGet(this,Us).subarray(14,18),12);outliner_classPrivateFieldGet(this,Us).set([_-I,y-T],16);if(isNaN(outliner_classPrivateFieldGet(this,Us)[6])){if(0===outliner_classPrivateFieldGet(this,zs).length){outliner_classPrivateFieldGet(this,Us).set([p+I,v+T],2);outliner_classPrivateFieldGet(this,zs).push(NaN,NaN,NaN,NaN,(p+I-l)/u,(v+T-c)/h);outliner_classPrivateFieldGet(this,Us).set([p-I,v-T],14);outliner_classPrivateFieldGet(this,Ws).push(NaN,NaN,NaN,NaN,(p-I-l)/u,(v-T-c)/h)}outliner_classPrivateFieldGet(this,Us).set([A,x,p,v,_,y],6);return!this.isEmpty()}outliner_classPrivateFieldGet(this,Us).set([A,x,p,v,_,y],6);if(Math.abs(Math.atan2(x-v,A-p)-Math.atan2(S,k))<Math.PI/2){var C=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Us).subarray(2,6),4);p=C[0];v=C[1];_=C[2];y=C[3];outliner_classPrivateFieldGet(this,zs).push(NaN,NaN,NaN,NaN,((p+_)/2-l)/u,((v+y)/2-c)/h);var M=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Us).subarray(14,18),4);p=M[0];v=M[1];A=M[2];x=M[3];outliner_classPrivateFieldGet(this,Ws).push(NaN,NaN,NaN,NaN,((A+p)/2-l)/u,((x+v)/2-c)/h);return!0}var G=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Us).subarray(0,6),6);A=G[0];x=G[1];p=G[2];v=G[3];_=G[4];y=G[5];outliner_classPrivateFieldGet(this,zs).push(((A+5*p)/6-l)/u,((x+5*v)/6-c)/h,((5*p+_)/6-l)/u,((5*v+y)/6-c)/h,((p+_)/2-l)/u,((v+y)/2-c)/h);var O=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Us).subarray(12,18),6);_=O[0];y=O[1];p=O[2];v=O[3];A=O[4];x=O[5];outliner_classPrivateFieldGet(this,Ws).push(((A+5*p)/6-l)/u,((x+5*v)/6-c)/h,((5*p+_)/6-l)/u,((5*v+y)/6-c)/h,((p+_)/2-l)/u,((v+y)/2-c)/h);return!0}},{key:"toSVGPath",value:function toSVGPath(){if(this.isEmpty())return"";var t=outliner_classPrivateFieldGet(this,zs),r=outliner_classPrivateFieldGet(this,Ws),a=outliner_classPrivateFieldGet(this,Us).subarray(4,6),i=outliner_classPrivateFieldGet(this,Us).subarray(16,18),o=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Ns),4),l=o[0],c=o[1],u=o[2],h=o[3],d=outliner_slicedToArray(outliner_classPrivateMethodGet(this,Qs,_getLastCoords2).call(this),4),p=d[0],v=d[1],_=d[2],y=d[3];if(isNaN(outliner_classPrivateFieldGet(this,Us)[6])&&!this.isEmpty())return"M".concat((outliner_classPrivateFieldGet(this,Us)[2]-l)/u," ").concat((outliner_classPrivateFieldGet(this,Us)[3]-c)/h," L").concat((outliner_classPrivateFieldGet(this,Us)[4]-l)/u," ").concat((outliner_classPrivateFieldGet(this,Us)[5]-c)/h," L").concat(p," ").concat(v," L").concat(_," ").concat(y," L").concat((outliner_classPrivateFieldGet(this,Us)[16]-l)/u," ").concat((outliner_classPrivateFieldGet(this,Us)[17]-c)/h," L").concat((outliner_classPrivateFieldGet(this,Us)[14]-l)/u," ").concat((outliner_classPrivateFieldGet(this,Us)[15]-c)/h," Z");var g=[];g.push("M".concat(t[4]," ").concat(t[5]));for(var m=6;m<t.length;m+=6)isNaN(t[m])?g.push("L".concat(t[m+4]," ").concat(t[m+5])):g.push("C".concat(t[m]," ").concat(t[m+1]," ").concat(t[m+2]," ").concat(t[m+3]," ").concat(t[m+4]," ").concat(t[m+5]));g.push("L".concat((a[0]-l)/u," ").concat((a[1]-c)/h," L").concat(p," ").concat(v," L").concat(_," ").concat(y," L").concat((i[0]-l)/u," ").concat((i[1]-c)/h));for(var b=r.length-6;b>=6;b-=6)isNaN(r[b])?g.push("L".concat(r[b+4]," ").concat(r[b+5])):g.push("C".concat(r[b]," ").concat(r[b+1]," ").concat(r[b+2]," ").concat(r[b+3]," ").concat(r[b+4]," ").concat(r[b+5]));g.push("L".concat(r[4]," ").concat(r[5]," Z"));return g.join(" ")}},{key:"getOutlines",value:function getOutlines(){for(var t,r,a=outliner_classPrivateFieldGet(this,zs),i=outliner_classPrivateFieldGet(this,Ws),o=outliner_classPrivateFieldGet(this,Us),l=o.subarray(4,6),c=o.subarray(16,18),u=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Ns),4),h=u[0],d=u[1],p=u[2],v=u[3],_=new Float64Array((null!==(t=null===(r=outliner_classPrivateFieldGet(this,Js))||void 0===r?void 0:r.length)&&void 0!==t?t:0)+2),y=0,g=_.length-2;y<g;y+=2){_[y]=(outliner_classPrivateFieldGet(this,Js)[y]-h)/p;_[y+1]=(outliner_classPrivateFieldGet(this,Js)[y+1]-d)/v}_[_.length-2]=(outliner_classPrivateFieldGet(this,qs)-h)/p;_[_.length-1]=(outliner_classPrivateFieldGet(this,Vs)-d)/v;var m=outliner_slicedToArray(outliner_classPrivateMethodGet(this,Qs,_getLastCoords2).call(this),4),b=m[0],w=m[1],P=m[2],k=m[3];if(isNaN(o[6])&&!this.isEmpty()){var S=new Float64Array(36);S.set([NaN,NaN,NaN,NaN,(o[2]-h)/p,(o[3]-d)/v,NaN,NaN,NaN,NaN,(o[4]-h)/p,(o[5]-d)/v,NaN,NaN,NaN,NaN,b,w,NaN,NaN,NaN,NaN,P,k,NaN,NaN,NaN,NaN,(o[16]-h)/p,(o[17]-d)/v,NaN,NaN,NaN,NaN,(o[14]-h)/p,(o[15]-d)/v],0);return new fl(S,_,outliner_classPrivateFieldGet(this,Ns),outliner_classPrivateFieldGet(this,Xs),outliner_classPrivateFieldGet(this,Hs),outliner_classPrivateFieldGet(this,Bs))}for(var A=new Float64Array(outliner_classPrivateFieldGet(this,zs).length+24+outliner_classPrivateFieldGet(this,Ws).length),x=a.length,E=0;E<x;E+=2)if(isNaN(a[E]))A[E]=A[E+1]=NaN;else{A[E]=a[E];A[E+1]=a[E+1]}A.set([NaN,NaN,NaN,NaN,(l[0]-h)/p,(l[1]-d)/v,NaN,NaN,NaN,NaN,b,w,NaN,NaN,NaN,NaN,P,k,NaN,NaN,NaN,NaN,(c[0]-h)/p,(c[1]-d)/v],x);x+=24;for(var I=i.length-6;I>=6;I-=6)for(var T=0;T<6;T+=2)if(isNaN(i[I+T])){A[x]=A[x+1]=NaN;x+=2}else{A[x]=i[I+T];A[x+1]=i[I+T+1];x+=2}A.set([NaN,NaN,NaN,NaN,i[4],i[5]],x);return new fl(A,_,outliner_classPrivateFieldGet(this,Ns),outliner_classPrivateFieldGet(this,Xs),outliner_classPrivateFieldGet(this,Hs),outliner_classPrivateFieldGet(this,Bs))}}]);return FreeOutliner}();function _getLastCoords2(){var t=outliner_classPrivateFieldGet(this,Us).subarray(4,6),r=outliner_classPrivateFieldGet(this,Us).subarray(16,18),a=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Ns),4),i=a[0],o=a[1],l=a[2],c=a[3];return[(outliner_classPrivateFieldGet(this,qs)+(t[0]-r[0])/2-i)/l,(outliner_classPrivateFieldGet(this,Vs)+(t[1]-r[1])/2-o)/c,(outliner_classPrivateFieldGet(this,qs)+(r[0]-t[0])/2-i)/l,(outliner_classPrivateFieldGet(this,Vs)+(r[1]-t[1])/2-o)/c]}var el,tl={writable:!0,value:8},rl={writable:!0,value:outliner_classStaticPrivateFieldSpecGet(Fs=Zs,Fs,tl)+outliner_classStaticPrivateFieldSpecGet(Fs,Fs,{writable:!0,value:2})},nl=new WeakMap,al=new WeakMap,il=new WeakMap,ol=new WeakMap,sl=new WeakMap,ll=new WeakMap,cl=new WeakMap,ul=new WeakSet,hl=new WeakSet,dl=new WeakSet,fl=function(t){outliner_inherits(FreeHighlightOutline,t);function FreeHighlightOutline(t,r,a,i,o,l){var c;outliner_classCallCheck(this,FreeHighlightOutline);outliner_classPrivateMethodInitSpec(outliner_assertThisInitialized(c=outliner_callSuper(this,FreeHighlightOutline)),dl);outliner_classPrivateMethodInitSpec(outliner_assertThisInitialized(c),hl);outliner_classPrivateMethodInitSpec(outliner_assertThisInitialized(c),ul);outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),nl,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),al,{writable:!0,value:null});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),il,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),ol,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),sl,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),ll,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),cl,{writable:!0,value:void 0});outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),cl,t);outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),sl,r);outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),nl,a);outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),ll,i);outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),il,o);outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),ol,l);outliner_classPrivateMethodGet(outliner_assertThisInitialized(c),dl,_computeMinMax2).call(outliner_assertThisInitialized(c),l);for(var u=outliner_classPrivateFieldGet(outliner_assertThisInitialized(c),al),h=u.x,d=u.y,p=u.width,v=u.height,_=0,y=t.length;_<y;_+=2){t[_]=(t[_]-h)/p;t[_+1]=(t[_+1]-d)/v}for(var g=0,m=r.length;g<m;g+=2){r[g]=(r[g]-h)/p;r[g+1]=(r[g+1]-d)/v}return c}outliner_createClass(FreeHighlightOutline,[{key:"toSVGPath",value:function toSVGPath(){for(var t=["M".concat(outliner_classPrivateFieldGet(this,cl)[4]," ").concat(outliner_classPrivateFieldGet(this,cl)[5])],r=6,a=outliner_classPrivateFieldGet(this,cl).length;r<a;r+=6)isNaN(outliner_classPrivateFieldGet(this,cl)[r])?t.push("L".concat(outliner_classPrivateFieldGet(this,cl)[r+4]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+5])):t.push("C".concat(outliner_classPrivateFieldGet(this,cl)[r]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+1]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+2]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+3]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+4]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+5]));t.push("Z");return t.join(" ")}},{key:"serialize",value:function serialize(t,r){var a,i,o=outliner_slicedToArray(t,4),l=o[0],c=o[1],u=o[2],h=o[3],d=u-l,p=h-c;switch(r){case 0:a=outliner_classPrivateMethodGet(this,ul,_rescale2).call(this,outliner_classPrivateFieldGet(this,cl),l,h,d,-p);i=outliner_classPrivateMethodGet(this,ul,_rescale2).call(this,outliner_classPrivateFieldGet(this,sl),l,h,d,-p);break;case 90:a=outliner_classPrivateMethodGet(this,hl,_rescaleAndSwap2).call(this,outliner_classPrivateFieldGet(this,cl),l,c,d,p);i=outliner_classPrivateMethodGet(this,hl,_rescaleAndSwap2).call(this,outliner_classPrivateFieldGet(this,sl),l,c,d,p);break;case 180:a=outliner_classPrivateMethodGet(this,ul,_rescale2).call(this,outliner_classPrivateFieldGet(this,cl),u,c,-d,p);i=outliner_classPrivateMethodGet(this,ul,_rescale2).call(this,outliner_classPrivateFieldGet(this,sl),u,c,-d,p);break;case 270:a=outliner_classPrivateMethodGet(this,hl,_rescaleAndSwap2).call(this,outliner_classPrivateFieldGet(this,cl),u,h,-d,-p);i=outliner_classPrivateMethodGet(this,hl,_rescaleAndSwap2).call(this,outliner_classPrivateFieldGet(this,sl),u,h,-d,-p)}return{outline:Array.from(a),points:[Array.from(i)]}}},{key:"box",get:function get(){return outliner_classPrivateFieldGet(this,al)}},{key:"getNewOutline",value:function getNewOutline(t,r){for(var a=outliner_classPrivateFieldGet(this,al),i=a.x,o=a.y,l=a.width,c=a.height,u=outliner_slicedToArray(outliner_classPrivateFieldGet(this,nl),4),h=u[0],d=u[1],p=u[2],v=u[3],_=l*p,y=c*v,g=i*p+h,m=o*v+d,b=new Zs({x:outliner_classPrivateFieldGet(this,sl)[0]*_+g,y:outliner_classPrivateFieldGet(this,sl)[1]*y+m},outliner_classPrivateFieldGet(this,nl),outliner_classPrivateFieldGet(this,ll),t,outliner_classPrivateFieldGet(this,ol),null!=r?r:outliner_classPrivateFieldGet(this,il)),w=2;w<outliner_classPrivateFieldGet(this,sl).length;w+=2)b.add({x:outliner_classPrivateFieldGet(this,sl)[w]*_+g,y:outliner_classPrivateFieldGet(this,sl)[w+1]*y+m});return b.getOutlines()}}]);return FreeHighlightOutline}(Rs);function _rescale2(t,r,a,i,o){for(var l=new Float64Array(t.length),c=0,u=t.length;c<u;c+=2){l[c]=r+t[c]*i;l[c+1]=a+t[c+1]*o}return l}function _rescaleAndSwap2(t,r,a,i,o){for(var l=new Float64Array(t.length),c=0,u=t.length;c<u;c+=2){l[c]=r+t[c+1]*i;l[c+1]=a+t[c]*o}return l}function _computeMinMax2(t){for(var r=outliner_classPrivateFieldGet(this,cl),a=r[4],i=r[5],o=a,l=i,c=a,u=i,h=a,d=i,p=t?Math.max:Math.min,v=6,_=r.length;v<_;v+=6){if(isNaN(r[v])){o=Math.min(o,r[v+4]);l=Math.min(l,r[v+5]);c=Math.max(c,r[v+4]);u=Math.max(u,r[v+5]);if(d<r[v+5]){h=r[v+4];d=r[v+5]}else d===r[v+5]&&(h=p(h,r[v+4]))}else{var y=fe.bezierBoundingBox.apply(fe,[a,i].concat(outliner_toConsumableArray(r.slice(v,v+6))));o=Math.min(o,y[0]);l=Math.min(l,y[1]);c=Math.max(c,y[2]);u=Math.max(u,y[3]);if(d<y[3]){h=y[2];d=y[3]}else d===y[3]&&(h=p(h,y[2]))}a=r[v+4];i=r[v+5]}var g=o-outliner_classPrivateFieldGet(this,il),m=l-outliner_classPrivateFieldGet(this,il),b=c-o+2*outliner_classPrivateFieldGet(this,il),w=u-l+2*outliner_classPrivateFieldGet(this,il);outliner_classPrivateFieldSet(this,al,{x:g,y:m,width:b,height:w,lastPoint:[h,d]})}function color_picker_typeof(t){return color_picker_typeof="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},color_picker_typeof(t)}function color_picker_slicedToArray(t,r){return function color_picker_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function color_picker_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||color_picker_unsupportedIterableToArray(t,r)||function color_picker_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function color_picker_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=color_picker_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function color_picker_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return color_picker_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?color_picker_arrayLikeToArray(t,r):void 0}}function color_picker_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function color_picker_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,color_picker_toPropertyKey(i.key),i)}}function color_picker_toPropertyKey(t){var r=function color_picker_toPrimitive(t,r){if("object"!=color_picker_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=color_picker_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==color_picker_typeof(r)?r:String(r)}function color_picker_classPrivateMethodInitSpec(t,r){color_picker_checkPrivateRedeclaration(t,r);r.add(t)}function color_picker_classPrivateFieldInitSpec(t,r,a){color_picker_checkPrivateRedeclaration(t,r);r.set(t,a)}function color_picker_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function color_picker_classPrivateFieldGet(t,r){return function color_picker_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,color_picker_classExtractFieldDescriptor(t,r,"get"))}function color_picker_classPrivateFieldSet(t,r,a){!function color_picker_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,color_picker_classExtractFieldDescriptor(t,r,"set"),a);return a}function color_picker_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function color_picker_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}var pl,vl=new WeakMap,_l=new WeakMap,yl=new WeakMap,gl=new WeakMap,ml=new WeakMap,bl=new WeakMap,wl=new WeakMap,Pl=new WeakMap,kl=new WeakMap,Sl=new WeakMap,Fl=new WeakMap,Al=new WeakSet,xl=new WeakSet,El=new WeakSet,Il=new WeakSet,Tl=new WeakSet,Cl=new WeakMap,Ml=function(){function ColorPicker(t){var r,a=t.editor,i=void 0===a?null:a,o=t.uiManager,l=void 0===o?null:o;!function color_picker_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,ColorPicker);color_picker_classPrivateFieldInitSpec(this,Cl,{get:_get_isDropdownVisible,set:void 0});color_picker_classPrivateMethodInitSpec(this,Tl);color_picker_classPrivateMethodInitSpec(this,Il);color_picker_classPrivateMethodInitSpec(this,El);color_picker_classPrivateMethodInitSpec(this,xl);color_picker_classPrivateMethodInitSpec(this,Al);color_picker_classPrivateFieldInitSpec(this,vl,{writable:!0,value:color_picker_classPrivateMethodGet(this,El,color_picker_keyDown2).bind(this)});color_picker_classPrivateFieldInitSpec(this,_l,{writable:!0,value:color_picker_classPrivateMethodGet(this,Tl,_pointerDown2).bind(this)});color_picker_classPrivateFieldInitSpec(this,yl,{writable:!0,value:null});color_picker_classPrivateFieldInitSpec(this,gl,{writable:!0,value:null});color_picker_classPrivateFieldInitSpec(this,ml,{writable:!0,value:void 0});color_picker_classPrivateFieldInitSpec(this,bl,{writable:!0,value:null});color_picker_classPrivateFieldInitSpec(this,wl,{writable:!0,value:!1});color_picker_classPrivateFieldInitSpec(this,Pl,{writable:!0,value:!1});color_picker_classPrivateFieldInitSpec(this,kl,{writable:!0,value:void 0});color_picker_classPrivateFieldInitSpec(this,Sl,{writable:!0,value:null});color_picker_classPrivateFieldInitSpec(this,Fl,{writable:!0,value:void 0});if(i){color_picker_classPrivateFieldSet(this,Pl,!1);color_picker_classPrivateFieldSet(this,Fl,m.HIGHLIGHT_COLOR)}else{color_picker_classPrivateFieldSet(this,Pl,!0);color_picker_classPrivateFieldSet(this,Fl,m.HIGHLIGHT_DEFAULT_COLOR)}color_picker_classPrivateFieldSet(this,Sl,(null==i?void 0:i._uiManager)||l);color_picker_classPrivateFieldSet(this,kl,color_picker_classPrivateFieldGet(this,Sl)._eventBus);color_picker_classPrivateFieldSet(this,ml,(null==i?void 0:i.color)||(null===(r=color_picker_classPrivateFieldGet(this,Sl))||void 0===r?void 0:r.highlightColors.values().next().value)||"#FFFF98")}!function color_picker_createClass(t,r,a){r&&color_picker_defineProperties(t.prototype,r);a&&color_picker_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(ColorPicker,[{key:"renderButton",value:function renderButton(){var t=color_picker_classPrivateFieldSet(this,yl,document.createElement("button"));t.className="colorPicker";t.tabIndex="0";t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button");t.setAttribute("aria-haspopup",!0);t.addEventListener("click",color_picker_classPrivateMethodGet(this,Il,_openDropdown2).bind(this));t.addEventListener("keydown",color_picker_classPrivateFieldGet(this,vl));var r=color_picker_classPrivateFieldSet(this,gl,document.createElement("span"));r.className="swatch";r.style.backgroundColor=color_picker_classPrivateFieldGet(this,ml);t.append(r);return t}},{key:"renderMainDropdown",value:function renderMainDropdown(){var t=color_picker_classPrivateFieldSet(this,bl,color_picker_classPrivateMethodGet(this,Al,_getDropdownRoot2).call(this));t.setAttribute("aria-orientation","horizontal");t.setAttribute("aria-labelledby","highlightColorPickerLabel");return t}},{key:"_colorSelectFromKeyboard",value:function _colorSelectFromKeyboard(t){if(t.target!==color_picker_classPrivateFieldGet(this,yl)){var r=t.target.getAttribute("data-color");r&&color_picker_classPrivateMethodGet(this,xl,_colorSelect2).call(this,r,t)}else color_picker_classPrivateMethodGet(this,Il,_openDropdown2).call(this,t)}},{key:"_moveToNext",value:function _moveToNext(t){var r;if(color_picker_classPrivateFieldGet(this,Cl))if(t.target!==color_picker_classPrivateFieldGet(this,yl))null===(r=t.target.nextSibling)||void 0===r||r.focus();else{var a;null===(a=color_picker_classPrivateFieldGet(this,bl).firstChild)||void 0===a||a.focus()}else color_picker_classPrivateMethodGet(this,Il,_openDropdown2).call(this,t)}},{key:"_moveToPrevious",value:function _moveToPrevious(t){var r,a;if(t.target!==(null===(r=color_picker_classPrivateFieldGet(this,bl))||void 0===r?void 0:r.firstChild)&&t.target!==color_picker_classPrivateFieldGet(this,yl)){color_picker_classPrivateFieldGet(this,Cl)||color_picker_classPrivateMethodGet(this,Il,_openDropdown2).call(this,t);null===(a=t.target.previousSibling)||void 0===a||a.focus()}else color_picker_classPrivateFieldGet(this,Cl)&&this._hideDropdownFromKeyboard()}},{key:"_moveToBeginning",value:function _moveToBeginning(t){var r;color_picker_classPrivateFieldGet(this,Cl)?null===(r=color_picker_classPrivateFieldGet(this,bl).firstChild)||void 0===r||r.focus():color_picker_classPrivateMethodGet(this,Il,_openDropdown2).call(this,t)}},{key:"_moveToEnd",value:function _moveToEnd(t){var r;color_picker_classPrivateFieldGet(this,Cl)?null===(r=color_picker_classPrivateFieldGet(this,bl).lastChild)||void 0===r||r.focus():color_picker_classPrivateMethodGet(this,Il,_openDropdown2).call(this,t)}},{key:"hideDropdown",value:function hideDropdown(){var t;null===(t=color_picker_classPrivateFieldGet(this,bl))||void 0===t||t.classList.add("hidden");window.removeEventListener("pointerdown",color_picker_classPrivateFieldGet(this,_l))}},{key:"_hideDropdownFromKeyboard",value:function _hideDropdownFromKeyboard(){if(!color_picker_classPrivateFieldGet(this,Pl)&&color_picker_classPrivateFieldGet(this,Cl)){this.hideDropdown();color_picker_classPrivateFieldGet(this,yl).focus({preventScroll:!0,focusVisible:color_picker_classPrivateFieldGet(this,wl)})}}},{key:"updateColor",value:function updateColor(t){color_picker_classPrivateFieldGet(this,gl)&&(color_picker_classPrivateFieldGet(this,gl).style.backgroundColor=t);if(color_picker_classPrivateFieldGet(this,bl)){var r,a=color_picker_classPrivateFieldGet(this,Sl).highlightColors.values(),i=color_picker_createForOfIteratorHelper(color_picker_classPrivateFieldGet(this,bl).children);try{for(i.s();!(r=i.n()).done;){r.value.setAttribute("aria-selected",a.next().value===t)}}catch(t){i.e(t)}finally{i.f()}}}},{key:"destroy",value:function destroy(){var t,r;null===(t=color_picker_classPrivateFieldGet(this,yl))||void 0===t||t.remove();color_picker_classPrivateFieldSet(this,yl,null);color_picker_classPrivateFieldSet(this,gl,null);null===(r=color_picker_classPrivateFieldGet(this,bl))||void 0===r||r.remove();color_picker_classPrivateFieldSet(this,bl,null)}}],[{key:"_keyboardManager",get:function get(){return shadow(this,"_keyboardManager",new dt([[["Escape","mac+Escape"],ColorPicker.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ColorPicker.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ColorPicker.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ColorPicker.prototype._moveToPrevious],[["Home","mac+Home"],ColorPicker.prototype._moveToBeginning],[["End","mac+End"],ColorPicker.prototype._moveToEnd]]))}}]);return ColorPicker}();el=Ml;function _getDropdownRoot2(){var t=document.createElement("div");t.addEventListener("contextmenu",noContextMenu);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");var r,a=color_picker_createForOfIteratorHelper(color_picker_classPrivateFieldGet(this,Sl).highlightColors);try{for(a.s();!(r=a.n()).done;){var i=color_picker_slicedToArray(r.value,2),o=i[0],l=i[1],c=document.createElement("button");c.tabIndex="0";c.role="option";c.setAttribute("data-color",l);c.title=o;c.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-".concat(o));var u=document.createElement("span");c.append(u);u.className="swatch";u.style.backgroundColor=l;c.setAttribute("aria-selected",l===color_picker_classPrivateFieldGet(this,ml));c.addEventListener("click",color_picker_classPrivateMethodGet(this,xl,_colorSelect2).bind(this,l));t.append(c)}}catch(t){a.e(t)}finally{a.f()}t.addEventListener("keydown",color_picker_classPrivateFieldGet(this,vl));return t}function _colorSelect2(t,r){r.stopPropagation();color_picker_classPrivateFieldGet(this,kl).dispatch("switchannotationeditorparams",{source:this,type:color_picker_classPrivateFieldGet(this,Fl),value:t})}function color_picker_keyDown2(t){el._keyboardManager.exec(this,t)}function _openDropdown2(t){if(color_picker_classPrivateFieldGet(this,Cl))this.hideDropdown();else{color_picker_classPrivateFieldSet(this,wl,0===t.detail);window.addEventListener("pointerdown",color_picker_classPrivateFieldGet(this,_l));if(color_picker_classPrivateFieldGet(this,bl))color_picker_classPrivateFieldGet(this,bl).classList.remove("hidden");else{var r=color_picker_classPrivateFieldSet(this,bl,color_picker_classPrivateMethodGet(this,Al,_getDropdownRoot2).call(this));color_picker_classPrivateFieldGet(this,yl).append(r)}}}function _pointerDown2(t){var r;null!==(r=color_picker_classPrivateFieldGet(this,bl))&&void 0!==r&&r.contains(t.target)||this.hideDropdown()}function _get_isDropdownVisible(){return color_picker_classPrivateFieldGet(this,bl)&&!color_picker_classPrivateFieldGet(this,bl).classList.contains("hidden")}function highlight_typeof(t){return highlight_typeof="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},highlight_typeof(t)}function highlight_toConsumableArray(t){return function highlight_arrayWithoutHoles(t){if(Array.isArray(t))return highlight_arrayLikeToArray(t)}(t)||function highlight_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||highlight_unsupportedIterableToArray(t)||function highlight_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function highlight_slicedToArray(t,r){return function highlight_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function highlight_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||highlight_unsupportedIterableToArray(t,r)||function highlight_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function highlight_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return highlight_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?highlight_arrayLikeToArray(t,r):void 0}}function highlight_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function highlight_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */highlight_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==highlight_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(highlight_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function highlight_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function highlight_ownKeys(t,r){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,i)}return a}function highlight_objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?highlight_ownKeys(Object(a),!0).forEach((function(r){highlight_defineProperty(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):highlight_ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}function highlight_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,highlight_toPropertyKey(i.key),i)}}function highlight_callSuper(t,r,a){return r=highlight_getPrototypeOf(r),function highlight_possibleConstructorReturn(t,r){if(r&&("object"===highlight_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return highlight_assertThisInitialized(t)}(t,highlight_isNativeReflectConstruct()?Reflect.construct(r,a||[],highlight_getPrototypeOf(t).constructor):r.apply(t,a))}function highlight_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(highlight_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function highlight_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function highlight_get(){highlight_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function highlight_superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=highlight_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}};return highlight_get.apply(this,arguments)}function highlight_getPrototypeOf(t){highlight_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return highlight_getPrototypeOf(t)}function highlight_setPrototypeOf(t,r){highlight_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return highlight_setPrototypeOf(t,r)}function highlight_classPrivateMethodInitSpec(t,r){highlight_checkPrivateRedeclaration(t,r);r.add(t)}function highlight_defineProperty(t,r,a){(r=highlight_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function highlight_toPropertyKey(t){var r=function highlight_toPrimitive(t,r){if("object"!=highlight_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=highlight_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==highlight_typeof(r)?r:String(r)}function highlight_classPrivateFieldInitSpec(t,r,a){highlight_checkPrivateRedeclaration(t,r);r.set(t,a)}function highlight_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldDestructureSet(t,r){return function _classApplyDescriptorDestructureSet(t,r){if(r.set){"__destrObj"in r||(r.__destrObj={set value(a){r.set.call(t,a)}});return r.__destrObj}if(!r.writable)throw new TypeError("attempted to set read only private field");return r}(t,highlight_classExtractFieldDescriptor(t,r,"set"))}function highlight_classStaticPrivateMethodGet(t,r,a){!function highlight_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function highlight_classPrivateFieldGet(t,r){return function highlight_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,highlight_classExtractFieldDescriptor(t,r,"get"))}function highlight_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function highlight_classPrivateFieldSet(t,r,a){!function highlight_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,highlight_classExtractFieldDescriptor(t,r,"set"),a);return a}function highlight_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var Gl,Ol=new WeakMap,Rl=new WeakMap,Ll=new WeakMap,Dl=new WeakMap,jl=new WeakMap,Nl=new WeakMap,Wl=new WeakMap,Hl=new WeakMap,Bl=new WeakMap,zl=new WeakMap,Ul=new WeakMap,ql=new WeakMap,Vl=new WeakSet,Kl=new WeakSet,Yl=new WeakSet,Xl=new WeakSet,$l=new WeakSet,Jl=new WeakSet,Ql=new WeakSet,Zl=new WeakSet,ec=new WeakSet,tc=new WeakSet,rc=function(t){!function highlight_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&highlight_setPrototypeOf(t,r)}(HighlightEditor,t);function HighlightEditor(t){var r;!function highlight_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,HighlightEditor);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r=highlight_callSuper(this,HighlightEditor,[highlight_objectSpread(highlight_objectSpread({},t),{},{name:"highlightEditor"})])),tc);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),ec);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Zl);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Ql);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Jl);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),$l);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Xl);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Yl);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Kl);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Vl);highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Ol,{writable:!0,value:void 0});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Rl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Ll,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Dl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),jl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Nl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Wl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Hl,{writable:!0,value:!1});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Bl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),zl,{writable:!0,value:void 0});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Ul,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),ql,{writable:!0,value:void 0});r.color=t.color||HighlightEditor._defaultColor;highlight_classPrivateFieldSet(highlight_assertThisInitialized(r),ql,t.thickness||HighlightEditor._defaultThickness);highlight_classPrivateFieldSet(highlight_assertThisInitialized(r),zl,t.opacity||HighlightEditor._defaultOpacity);highlight_classPrivateFieldSet(highlight_assertThisInitialized(r),Ol,t.boxes||null);r._isDraggable=!1;if(t.highlightId>-1){highlight_classPrivateFieldSet(highlight_assertThisInitialized(r),Hl,!0);highlight_classPrivateMethodGet(highlight_assertThisInitialized(r),Kl,_createFreeOutlines2).call(highlight_assertThisInitialized(r),t);highlight_classPrivateMethodGet(highlight_assertThisInitialized(r),Ql,_addToDrawLayer2).call(highlight_assertThisInitialized(r))}else{highlight_classPrivateMethodGet(highlight_assertThisInitialized(r),Vl,_createOutlines2).call(highlight_assertThisInitialized(r));highlight_classPrivateMethodGet(highlight_assertThisInitialized(r),Ql,_addToDrawLayer2).call(highlight_assertThisInitialized(r));r.rotate(r.rotation)}return r}!function highlight_createClass(t,r,a){r&&highlight_defineProperties(t.prototype,r);a&&highlight_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(HighlightEditor,[{key:"translateInPage",value:function translateInPage(t,r){}},{key:"toolbarPosition",get:function get(){return highlight_classPrivateFieldGet(this,Bl)}},{key:"updateParams",value:function updateParams(t,r){switch(t){case m.HIGHLIGHT_COLOR:highlight_classPrivateMethodGet(this,Yl,highlight_updateColor2).call(this,r);break;case m.HIGHLIGHT_THICKNESS:highlight_classPrivateMethodGet(this,Xl,_updateThickness2).call(this,r)}}},{key:"propertiesToUpdate",get:function get(){return[[m.HIGHLIGHT_COLOR,this.color||HighlightEditor._defaultColor],[m.HIGHLIGHT_THICKNESS,highlight_classPrivateFieldGet(this,ql)||HighlightEditor._defaultThickness],[m.HIGHLIGHT_FREE,highlight_classPrivateFieldGet(this,Hl)]]}},{key:"addEditToolbar",value:(r=function highlight_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){highlight_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){highlight_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}(highlight_regeneratorRuntime().mark((function _callee(){var t;return highlight_regeneratorRuntime().wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:r.next=2;return highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"addEditToolbar",this).call(this);case 2:if(t=r.sent){r.next=5;break}return r.abrupt("return",null);case 5:if(this._uiManager.highlightColors){highlight_classPrivateFieldSet(this,Ll,new Ml({editor:this}));t.addColorPicker(highlight_classPrivateFieldGet(this,Ll))}return r.abrupt("return",t);case 7:case"end":return r.stop()}}),_callee,this)}))),function addEditToolbar(){return r.apply(this,arguments)})},{key:"disableEditing",value:function disableEditing(){highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"disableEditing",this).call(this);this.div.classList.toggle("disabled",!0)}},{key:"enableEditing",value:function enableEditing(){highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"enableEditing",this).call(this);this.div.classList.toggle("disabled",!1)}},{key:"fixAndSetPosition",value:function fixAndSetPosition(){return highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"fixAndSetPosition",this).call(this,highlight_classPrivateMethodGet(this,Zl,_getRotation2).call(this))}},{key:"getBaseTranslation",value:function getBaseTranslation(){return[0,0]}},{key:"getRect",value:function getRect(t,r){return highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"getRect",this).call(this,t,r,highlight_classPrivateMethodGet(this,Zl,_getRotation2).call(this))}},{key:"onceAdded",value:function onceAdded(){this.parent.addUndoableEditor(this);this.div.focus()}},{key:"remove",value:function remove(){highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"remove",this).call(this);highlight_classPrivateMethodGet(this,Jl,_cleanDrawLayer2).call(this)}},{key:"rebuild",value:function rebuild(){if(this.parent){highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"rebuild",this).call(this);if(null!==this.div){highlight_classPrivateMethodGet(this,Ql,_addToDrawLayer2).call(this);this.isAttachedToDOM||this.parent.add(this)}}}},{key:"setParent",value:function setParent(t){var r=!1;if(this.parent&&!t)highlight_classPrivateMethodGet(this,Jl,_cleanDrawLayer2).call(this);else if(t){var a;highlight_classPrivateMethodGet(this,Ql,_addToDrawLayer2).call(this,t);r=!this.parent&&(null===(a=this.div)||void 0===a?void 0:a.classList.contains("selectedEditor"))}highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"setParent",this).call(this,t);r&&this.select()}},{key:"rotate",value:function rotate(t){var r,a=this.parent.drawLayer;if(highlight_classPrivateFieldGet(this,Hl)){t=(t-this.rotation+360)%360;r=highlight_classStaticPrivateMethodGet(HighlightEditor,HighlightEditor,_rotateBbox).call(HighlightEditor,highlight_classPrivateFieldGet(this,Nl).box,t)}else r=highlight_classStaticPrivateMethodGet(HighlightEditor,HighlightEditor,_rotateBbox).call(HighlightEditor,this,t);a.rotate(highlight_classPrivateFieldGet(this,Wl),t);a.rotate(highlight_classPrivateFieldGet(this,Ul),t);a.updateBox(highlight_classPrivateFieldGet(this,Wl),r);a.updateBox(highlight_classPrivateFieldGet(this,Ul),highlight_classStaticPrivateMethodGet(HighlightEditor,HighlightEditor,_rotateBbox).call(HighlightEditor,highlight_classPrivateFieldGet(this,Dl).box,t))}},{key:"render",value:function render(){if(this.div)return this.div;var t=highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"render",this).call(this);highlight_classPrivateFieldGet(this,Hl)&&t.classList.add("free");var r=highlight_classPrivateFieldSet(this,jl,document.createElement("div"));t.append(r);r.className="internal";r.style.clipPath=highlight_classPrivateFieldGet(this,Rl);var a=highlight_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1];this.setDims(this.width*i,this.height*o);bindEvents(this,highlight_classPrivateFieldGet(this,jl),["pointerover","pointerleave"]);this.enableEditing();return t}},{key:"pointerover",value:function pointerover(){this.parent.drawLayer.addClass(highlight_classPrivateFieldGet(this,Ul),"hovered")}},{key:"pointerleave",value:function pointerleave(){this.parent.drawLayer.removeClass(highlight_classPrivateFieldGet(this,Ul),"hovered")}},{key:"select",value:function select(){var t,r;highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"select",this).call(this);null===(t=this.parent)||void 0===t||t.drawLayer.removeClass(highlight_classPrivateFieldGet(this,Ul),"hovered");null===(r=this.parent)||void 0===r||r.drawLayer.addClass(highlight_classPrivateFieldGet(this,Ul),"selected")}},{key:"unselect",value:function unselect(){var t;highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"unselect",this).call(this);null===(t=this.parent)||void 0===t||t.drawLayer.removeClass(highlight_classPrivateFieldGet(this,Ul),"selected")}},{key:"serialize",value:function serialize(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||t)return null;var r=this.getRect(0,0),a=fn._colorManager.convert(this.color);return{annotationType:g.HIGHLIGHT,color:a,opacity:highlight_classPrivateFieldGet(this,zl),thickness:highlight_classPrivateFieldGet(this,ql),quadPoints:highlight_classPrivateMethodGet(this,ec,_serializeBoxes2).call(this,r),outlines:highlight_classPrivateMethodGet(this,tc,_serializeOutlines2).call(this,r),pageIndex:this.pageIndex,rect:r,rotation:highlight_classPrivateMethodGet(this,Zl,_getRotation2).call(this),structTreeParentId:this._structTreeParentId}}}],[{key:"initialize",value:function initialize(t,r){var a;fn.initialize(t,r);HighlightEditor._defaultColor||(HighlightEditor._defaultColor=(null===(a=r.highlightColors)||void 0===a?void 0:a.values().next().value)||"#fff066")}},{key:"updateDefaultParams",value:function updateDefaultParams(t,r){switch(t){case m.HIGHLIGHT_DEFAULT_COLOR:HighlightEditor._defaultColor=r;break;case m.HIGHLIGHT_THICKNESS:HighlightEditor._defaultThickness=r}}},{key:"defaultPropertiesToUpdate",get:function get(){return[[m.HIGHLIGHT_DEFAULT_COLOR,HighlightEditor._defaultColor],[m.HIGHLIGHT_THICKNESS,HighlightEditor._defaultThickness]]}},{key:"startHighlighting",value:function startHighlighting(t,r,a){var i=this,o=a.target,l=a.x,c=a.y,u=o.getBoundingClientRect(),h=u.x,d=u.y,p=u.width,v=u.height,_=function pointerMove(r){highlight_classStaticPrivateMethodGet(i,HighlightEditor,_highlightMove).call(i,t,r)},y={capture:!0,passive:!1},g=function pointerDown(t){t.preventDefault();t.stopPropagation()},m=function pointerUpCallback(r){o.removeEventListener("pointermove",_);window.removeEventListener("blur",pointerUpCallback);window.removeEventListener("pointerup",pointerUpCallback);window.removeEventListener("pointerdown",g,y);window.removeEventListener("contextmenu",noContextMenu);highlight_classStaticPrivateMethodGet(i,HighlightEditor,_endHighlight).call(i,t,r)};window.addEventListener("blur",m);window.addEventListener("pointerup",m);window.addEventListener("pointerdown",g,y);window.addEventListener("contextmenu",noContextMenu);o.addEventListener("pointermove",_);this._freeHighlight=new Zs({x:l,y:c},[h,d,p,v],t.scale,this._defaultThickness/2,r,.001);var b=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0);this._freeHighlightId=b.id;this._freeHighlightClipId=b.clipPathId}},{key:"deserialize",value:function deserialize(t,r,a){var i=highlight_get(highlight_getPrototypeOf(HighlightEditor),"deserialize",this).call(this,t,r,a),o=highlight_slicedToArray(t.rect,4),l=o[0],c=o[1],u=o[2],h=o[3],d=t.color,p=t.quadPoints;i.color=fe.makeHexColor.apply(fe,highlight_toConsumableArray(d));highlight_classPrivateFieldSet(i,zl,t.opacity);var v=highlight_slicedToArray(i.pageDimensions,2),_=v[0],y=v[1];i.width=(u-l)/_;i.height=(h-c)/y;for(var g=highlight_classPrivateFieldSet(i,Ol,[]),m=0;m<p.length;m+=8)g.push({x:(p[4]-u)/_,y:(h-(1-p[m+5]))/y,width:(p[m+2]-p[m])/_,height:(p[m+5]-p[m+1])/y});highlight_classPrivateMethodGet(i,Vl,_createOutlines2).call(i);return i}},{key:"canCreateNewEmptyEditor",value:function canCreateNewEmptyEditor(){return!1}}]);var r;return HighlightEditor}(fn);pl=rc;function _createOutlines2(){var t=new Os(highlight_classPrivateFieldGet(this,Ol),.001);highlight_classPrivateFieldSet(this,Nl,t.getOutlines());var r=highlight_classPrivateFieldGet(this,Nl).box;this.x=r.x;this.y=r.y;this.width=r.width;this.height=r.height;var a=new Os(highlight_classPrivateFieldGet(this,Ol),.0025,.001,"ltr"===this._uiManager.direction);highlight_classPrivateFieldSet(this,Dl,a.getOutlines());var i=highlight_classPrivateFieldGet(this,Dl).box.lastPoint;highlight_classPrivateFieldSet(this,Bl,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])}function _createFreeOutlines2(t){var r=t.highlightOutlines,a=t.highlightId,i=t.clipPathId;highlight_classPrivateFieldSet(this,Nl,r);highlight_classPrivateFieldSet(this,Dl,r.getNewOutline(highlight_classPrivateFieldGet(this,ql)/2+1.5,.0025));if(a>=0){highlight_classPrivateFieldSet(this,Wl,a);highlight_classPrivateFieldSet(this,Rl,i);this.parent.drawLayer.finalizeLine(a,r);highlight_classPrivateFieldSet(this,Ul,this.parent.drawLayer.highlightOutline(highlight_classPrivateFieldGet(this,Dl)))}else if(this.parent){var o=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(highlight_classPrivateFieldGet(this,Wl),r);this.parent.drawLayer.updateBox(highlight_classPrivateFieldGet(this,Wl),highlight_classStaticPrivateMethodGet(pl,pl,_rotateBbox).call(pl,highlight_classPrivateFieldGet(this,Nl).box,(o-this.rotation+360)%360));this.parent.drawLayer.updateLine(highlight_classPrivateFieldGet(this,Ul),highlight_classPrivateFieldGet(this,Dl));this.parent.drawLayer.updateBox(highlight_classPrivateFieldGet(this,Ul),highlight_classStaticPrivateMethodGet(pl,pl,_rotateBbox).call(pl,highlight_classPrivateFieldGet(this,Dl).box,o))}var l=r.box,c=l.x,u=l.y,h=l.width,d=l.height;switch(this.rotation){case 0:this.x=c;this.y=u;this.width=h;this.height=d;break;case 90:var p=highlight_slicedToArray(this.parentDimensions,2),v=p[0],_=p[1];this.x=u;this.y=1-c;this.width=h*_/v;this.height=d*v/_;break;case 180:this.x=1-c;this.y=1-u;this.width=h;this.height=d;break;case 270:var y=highlight_slicedToArray(this.parentDimensions,2),g=y[0],m=y[1];this.x=1-u;this.y=c;this.width=h*m/g;this.height=d*g/m}var b=highlight_classPrivateFieldGet(this,Dl).box.lastPoint;highlight_classPrivateFieldSet(this,Bl,[(b[0]-c)/h,(b[1]-u)/d])}function highlight_updateColor2(t){var r=this,a=function setColor(t){var a,i;r.color=t;null===(a=r.parent)||void 0===a||a.drawLayer.changeColor(highlight_classPrivateFieldGet(r,Wl),t);null===(i=highlight_classPrivateFieldGet(r,Ll))||void 0===i||i.updateColor(t)},i=this.color;this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _updateThickness2(t){var r=this,a=highlight_classPrivateFieldGet(this,ql),i=function setThickness(t){highlight_classPrivateFieldSet(r,ql,t);highlight_classPrivateMethodGet(r,$l,_changeThickness2).call(r,t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function _changeThickness2(t){if(highlight_classPrivateFieldGet(this,Hl)){highlight_classPrivateMethodGet(this,Kl,_createFreeOutlines2).call(this,{highlightOutlines:highlight_classPrivateFieldGet(this,Nl).getNewOutline(t/2)});this.fixAndSetPosition();var r=highlight_slicedToArray(this.parentDimensions,2),a=r[0],i=r[1];this.setDims(this.width*a,this.height*i)}}function _cleanDrawLayer2(){if(null!==highlight_classPrivateFieldGet(this,Wl)&&this.parent){this.parent.drawLayer.remove(highlight_classPrivateFieldGet(this,Wl));highlight_classPrivateFieldSet(this,Wl,null);this.parent.drawLayer.remove(highlight_classPrivateFieldGet(this,Ul));highlight_classPrivateFieldSet(this,Ul,null)}}function _addToDrawLayer2(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;if(null===highlight_classPrivateFieldGet(this,Wl)){var r=t.drawLayer.highlight(highlight_classPrivateFieldGet(this,Nl),this.color,highlight_classPrivateFieldGet(this,zl));_classPrivateFieldDestructureSet(this,Wl).value=r.id;_classPrivateFieldDestructureSet(this,Rl).value=r.clipPathId;highlight_classPrivateFieldSet(this,Ul,t.drawLayer.highlightOutline(highlight_classPrivateFieldGet(this,Dl)));highlight_classPrivateFieldGet(this,jl)&&(highlight_classPrivateFieldGet(this,jl).style.clipPath=highlight_classPrivateFieldGet(this,Rl))}}function _rotateBbox(t,r){var a=t.x,i=t.y,o=t.width,l=t.height;switch(r){case 90:return{x:1-i-l,y:a,width:l,height:o};case 180:return{x:1-a-o,y:1-i-l,width:o,height:l};case 270:return{x:i,y:1-a-o,width:l,height:o}}return{x:a,y:i,width:o,height:l}}function _getRotation2(){return highlight_classPrivateFieldGet(this,Hl)?this.rotation:0}function _serializeBoxes2(t){if(highlight_classPrivateFieldGet(this,Hl))return null;var r,a=highlight_slicedToArray(this.pageDimensions,2),i=a[0],o=a[1],l=highlight_classPrivateFieldGet(this,Ol),c=new Array(8*l.length),u=highlight_slicedToArray(t,2),h=u[0],d=u[1],p=0,v=function highlight_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=highlight_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}(l);try{for(v.s();!(r=v.n()).done;){var _=r.value,y=_.x,g=_.y,m=_.width,b=_.height,w=h+y*i,P=d+(1-g-b)*o;c[p]=c[p+4]=w;c[p+1]=c[p+3]=P;c[p+2]=c[p+6]=w+m*i;c[p+5]=c[p+7]=P+b*o;p+=8}}catch(t){v.e(t)}finally{v.f()}return c}function _serializeOutlines2(t){return highlight_classPrivateFieldGet(this,Nl).serialize(t,highlight_classPrivateMethodGet(this,Zl,_getRotation2).call(this))}function _highlightMove(t,r){this._freeHighlight.add(r)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}function _endHighlight(t,r){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(this._freeHighlightId):t.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId});this._freeHighlightId=-1;this._freeHighlight=null;this._freeHighlightClipId=""}highlight_defineProperty(rc,"_defaultColor",null);highlight_defineProperty(rc,"_defaultOpacity",1);highlight_defineProperty(rc,"_defaultThickness",12);highlight_defineProperty(rc,"_l10nPromise",void 0);highlight_defineProperty(rc,"_type","highlight");highlight_defineProperty(rc,"_editorType",g.HIGHLIGHT);highlight_defineProperty(rc,"_freeHighlightId",-1);highlight_defineProperty(rc,"_freeHighlight",null);highlight_defineProperty(rc,"_freeHighlightClipId","");function ink_typeof(t){return ink_typeof="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},ink_typeof(t)}function ink_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=ink_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function ink_toConsumableArray(t){return function ink_arrayWithoutHoles(t){if(Array.isArray(t))return ink_arrayLikeToArray(t)}(t)||function ink_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ink_unsupportedIterableToArray(t)||function ink_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ink_slicedToArray(t,r){return function ink_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function ink_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||ink_unsupportedIterableToArray(t,r)||function ink_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ink_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return ink_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?ink_arrayLikeToArray(t,r):void 0}}function ink_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function ink_ownKeys(t,r){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,i)}return a}function ink_objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?ink_ownKeys(Object(a),!0).forEach((function(r){ink_defineProperty(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ink_ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}function ink_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,ink_toPropertyKey(i.key),i)}}function ink_callSuper(t,r,a){return r=ink_getPrototypeOf(r),function ink_possibleConstructorReturn(t,r){if(r&&("object"===ink_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return ink_assertThisInitialized(t)}(t,ink_isNativeReflectConstruct()?Reflect.construct(r,a||[],ink_getPrototypeOf(t).constructor):r.apply(t,a))}function ink_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ink_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function ink_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ink_get(){ink_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function ink_superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=ink_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}};return ink_get.apply(this,arguments)}function ink_getPrototypeOf(t){ink_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return ink_getPrototypeOf(t)}function ink_setPrototypeOf(t,r){ink_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return ink_setPrototypeOf(t,r)}function ink_classPrivateMethodInitSpec(t,r){ink_checkPrivateRedeclaration(t,r);r.add(t)}function ink_defineProperty(t,r,a){(r=ink_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function ink_toPropertyKey(t){var r=function ink_toPrimitive(t,r){if("object"!=ink_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=ink_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==ink_typeof(r)?r:String(r)}function ink_classPrivateFieldInitSpec(t,r,a){ink_checkPrivateRedeclaration(t,r);r.set(t,a)}function ink_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ink_classStaticPrivateMethodGet(t,r,a){!function ink_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function ink_classPrivateFieldSet(t,r,a){!function ink_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,ink_classExtractFieldDescriptor(t,r,"set"),a);return a}function ink_classPrivateFieldGet(t,r){return function ink_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,ink_classExtractFieldDescriptor(t,r,"get"))}function ink_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function ink_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}var nc,ac=new WeakMap,ic=new WeakMap,oc=new WeakMap,sc=new WeakMap,lc=new WeakMap,cc=new WeakMap,uc=new WeakMap,hc=new WeakMap,dc=new WeakMap,fc=new WeakMap,pc=new WeakMap,vc=new WeakMap,_c=new WeakMap,yc=new WeakMap,gc=new WeakMap,mc=new WeakSet,bc=new WeakSet,wc=new WeakSet,Pc=new WeakSet,kc=new WeakSet,Sc=new WeakSet,Fc=new WeakSet,Ac=new WeakSet,xc=new WeakSet,Ec=new WeakSet,Ic=new WeakSet,Tc=new WeakSet,Cc=new WeakSet,Mc=new WeakSet,Gc=new WeakSet,Oc=new WeakSet,Rc=new WeakSet,Lc=new WeakSet,Dc=new WeakSet,jc=new WeakSet,Nc=new WeakSet,Wc=new WeakSet,Hc=new WeakSet,Bc=function(t){!function ink_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&ink_setPrototypeOf(t,r)}(InkEditor,t);function InkEditor(t){var r;!function ink_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,InkEditor);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r=ink_callSuper(this,InkEditor,[ink_objectSpread(ink_objectSpread({},t),{},{name:"inkEditor"})])),Hc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Wc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Nc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),jc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Dc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Lc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Rc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Oc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Gc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Mc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Cc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Tc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Ic);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Ec);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),xc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Ac);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Fc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Sc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),kc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Pc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),wc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),bc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),mc);ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),ac,{writable:!0,value:0});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),ic,{writable:!0,value:0});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),oc,{writable:!0,value:r.canvasPointermove.bind(ink_assertThisInitialized(r))});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),sc,{writable:!0,value:r.canvasPointerleave.bind(ink_assertThisInitialized(r))});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),lc,{writable:!0,value:r.canvasPointerup.bind(ink_assertThisInitialized(r))});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),cc,{writable:!0,value:r.canvasPointerdown.bind(ink_assertThisInitialized(r))});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),uc,{writable:!0,value:null});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),hc,{writable:!0,value:new Path2D});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),dc,{writable:!0,value:!1});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),fc,{writable:!0,value:!1});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),pc,{writable:!0,value:!1});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),vc,{writable:!0,value:null});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),_c,{writable:!0,value:0});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),yc,{writable:!0,value:0});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),gc,{writable:!0,value:null});r.color=t.color||null;r.thickness=t.thickness||null;r.opacity=t.opacity||null;r.paths=[];r.bezierPath2D=[];r.allRawPaths=[];r.currentPath=[];r.scaleFactor=1;r.translationX=r.translationY=0;r.x=0;r.y=0;r._willKeepAspectRatio=!0;return r}!function ink_createClass(t,r,a){r&&ink_defineProperties(t.prototype,r);a&&ink_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(InkEditor,[{key:"updateParams",value:function updateParams(t,r){switch(t){case m.INK_THICKNESS:ink_classPrivateMethodGet(this,mc,ink_updateThickness2).call(this,r);break;case m.INK_COLOR:ink_classPrivateMethodGet(this,bc,ink_updateColor2).call(this,r);break;case m.INK_OPACITY:ink_classPrivateMethodGet(this,wc,_updateOpacity2).call(this,r)}}},{key:"propertiesToUpdate",get:function get(){var t;return[[m.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[m.INK_COLOR,this.color||InkEditor._defaultColor||fn._defaultLineColor],[m.INK_OPACITY,Math.round(100*(null!==(t=this.opacity)&&void 0!==t?t:InkEditor._defaultOpacity))]]}},{key:"rebuild",value:function rebuild(){if(this.parent){ink_get(ink_getPrototypeOf(InkEditor.prototype),"rebuild",this).call(this);if(null!==this.div){if(!this.canvas){ink_classPrivateMethodGet(this,Gc,_createCanvas2).call(this);ink_classPrivateMethodGet(this,Oc,_createObserver2).call(this)}if(!this.isAttachedToDOM){this.parent.add(this);ink_classPrivateMethodGet(this,Rc,_setCanvasDims2).call(this)}ink_classPrivateMethodGet(this,Hc,_fitToContent2).call(this)}}}},{key:"remove",value:function remove(){if(null!==this.canvas){this.isEmpty()||this.commit();this.canvas.width=this.canvas.height=0;this.canvas.remove();this.canvas=null;if(ink_classPrivateFieldGet(this,uc)){clearTimeout(ink_classPrivateFieldGet(this,uc));ink_classPrivateFieldSet(this,uc,null)}ink_classPrivateFieldGet(this,vc).disconnect();ink_classPrivateFieldSet(this,vc,null);ink_get(ink_getPrototypeOf(InkEditor.prototype),"remove",this).call(this)}}},{key:"setParent",value:function setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this);ink_get(ink_getPrototypeOf(InkEditor.prototype),"setParent",this).call(this,t)}},{key:"onScaleChanging",value:function onScaleChanging(){var t=ink_slicedToArray(this.parentDimensions,2),r=t[0],a=t[1],i=this.width*r,o=this.height*a;this.setDimensions(i,o)}},{key:"enableEditMode",value:function enableEditMode(){if(!ink_classPrivateFieldGet(this,dc)&&null!==this.canvas){ink_get(ink_getPrototypeOf(InkEditor.prototype),"enableEditMode",this).call(this);this._isDraggable=!1;this.canvas.addEventListener("pointerdown",ink_classPrivateFieldGet(this,cc))}}},{key:"disableEditMode",value:function disableEditMode(){if(this.isInEditMode()&&null!==this.canvas){ink_get(ink_getPrototypeOf(InkEditor.prototype),"disableEditMode",this).call(this);this._isDraggable=!this.isEmpty();this.div.classList.remove("editing");this.canvas.removeEventListener("pointerdown",ink_classPrivateFieldGet(this,cc))}}},{key:"onceAdded",value:function onceAdded(){this._isDraggable=!this.isEmpty()}},{key:"isEmpty",value:function isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}},{key:"commit",value:function commit(){if(!ink_classPrivateFieldGet(this,dc)){ink_get(ink_getPrototypeOf(InkEditor.prototype),"commit",this).call(this);this.isEditing=!1;this.disableEditMode();this.setInForeground();ink_classPrivateFieldSet(this,dc,!0);this.div.classList.add("disabled");ink_classPrivateMethodGet(this,Hc,_fitToContent2).call(this,!0);this.select();this.parent.addInkEditorIfNeeded(!0);this.moveInDOM();this.div.focus({preventScroll:!0})}}},{key:"focusin",value:function focusin(t){if(this._focusEventsAllowed){ink_get(ink_getPrototypeOf(InkEditor.prototype),"focusin",this).call(this,t);this.enableEditMode()}}},{key:"canvasPointerdown",value:function canvasPointerdown(t){if(0===t.button&&this.isInEditMode()&&!ink_classPrivateFieldGet(this,dc)){this.setInForeground();t.preventDefault();this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0});ink_classPrivateMethodGet(this,Sc,_startDrawing2).call(this,t.offsetX,t.offsetY)}}},{key:"canvasPointermove",value:function canvasPointermove(t){t.preventDefault();ink_classPrivateMethodGet(this,Fc,_draw2).call(this,t.offsetX,t.offsetY)}},{key:"canvasPointerup",value:function canvasPointerup(t){t.preventDefault();ink_classPrivateMethodGet(this,Mc,_endDrawing2).call(this,t)}},{key:"canvasPointerleave",value:function canvasPointerleave(t){ink_classPrivateMethodGet(this,Mc,_endDrawing2).call(this,t)}},{key:"isResizable",get:function get(){return!this.isEmpty()&&ink_classPrivateFieldGet(this,dc)}},{key:"render",value:function render(){if(this.div)return this.div;var t,r;if(this.width){t=this.x;r=this.y}ink_get(ink_getPrototypeOf(InkEditor.prototype),"render",this).call(this);this.div.setAttribute("data-l10n-id","pdfjs-ink");var a=ink_slicedToArray(ink_classPrivateMethodGet(this,Pc,_getInitialBBox2).call(this),4),i=a[0],o=a[1],l=a[2],c=a[3];this.setAt(i,o,0,0);this.setDims(l,c);ink_classPrivateMethodGet(this,Gc,_createCanvas2).call(this);if(this.width){var u=ink_slicedToArray(this.parentDimensions,2),h=u[0],d=u[1];this.setAspectRatio(this.width*h,this.height*d);this.setAt(t*h,r*d,this.width*h,this.height*d);ink_classPrivateFieldSet(this,pc,!0);ink_classPrivateMethodGet(this,Rc,_setCanvasDims2).call(this);this.setDims(this.width*h,this.height*d);ink_classPrivateMethodGet(this,Cc,_redraw2).call(this);this.div.classList.add("disabled")}else{this.div.classList.add("editing");this.enableEditMode()}ink_classPrivateMethodGet(this,Oc,_createObserver2).call(this);return this.div}},{key:"setDimensions",value:function setDimensions(t,r){var a=Math.round(t),i=Math.round(r);if(ink_classPrivateFieldGet(this,_c)!==a||ink_classPrivateFieldGet(this,yc)!==i){ink_classPrivateFieldSet(this,_c,a);ink_classPrivateFieldSet(this,yc,i);this.canvas.style.visibility="hidden";var o=ink_slicedToArray(this.parentDimensions,2),l=o[0],c=o[1];this.width=t/l;this.height=r/c;this.fixAndSetPosition();ink_classPrivateFieldGet(this,dc)&&ink_classPrivateMethodGet(this,Lc,_setScaleFactor2).call(this,t,r);ink_classPrivateMethodGet(this,Rc,_setCanvasDims2).call(this);ink_classPrivateMethodGet(this,Cc,_redraw2).call(this);this.canvas.style.visibility="visible";this.fixDims()}}},{key:"serialize",value:function serialize(){if(this.isEmpty())return null;var t=this.getRect(0,0),r=fn._colorManager.convert(this.ctx.strokeStyle);return{annotationType:g.INK,color:r,thickness:this.thickness,opacity:this.opacity,paths:ink_classPrivateMethodGet(this,jc,_serializePaths2).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}],[{key:"initialize",value:function initialize(t,r){fn.initialize(t,r)}},{key:"updateDefaultParams",value:function updateDefaultParams(t,r){switch(t){case m.INK_THICKNESS:InkEditor._defaultThickness=r;break;case m.INK_COLOR:InkEditor._defaultColor=r;break;case m.INK_OPACITY:InkEditor._defaultOpacity=r/100}}},{key:"defaultPropertiesToUpdate",get:function get(){return[[m.INK_THICKNESS,InkEditor._defaultThickness],[m.INK_COLOR,InkEditor._defaultColor||fn._defaultLineColor],[m.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}},{key:"deserialize",value:function deserialize(t,r,a){if(t instanceof qo)return null;var i=ink_get(ink_getPrototypeOf(InkEditor),"deserialize",this).call(this,t,r,a);i.thickness=t.thickness;i.color=fe.makeHexColor.apply(fe,ink_toConsumableArray(t.color));i.opacity=t.opacity;var o=ink_slicedToArray(i.pageDimensions,2),l=o[0],c=o[1],u=i.width*l,h=i.height*c,d=i.parentScale,p=t.thickness/2;ink_classPrivateFieldSet(i,dc,!0);ink_classPrivateFieldSet(i,_c,Math.round(u));ink_classPrivateFieldSet(i,yc,Math.round(h));var v,_=t.paths,y=t.rect,g=t.rotation,m=ink_createForOfIteratorHelper(_);try{for(m.s();!(v=m.n()).done;){var b=v.value.bezier;b=ink_classStaticPrivateMethodGet(InkEditor,InkEditor,_fromPDFCoordinates).call(InkEditor,b,y,g);var w=[];i.paths.push(w);for(var P=d*(b[0]-p),k=d*(b[1]-p),S=2,A=b.length;S<A;S+=6){var x=d*(b[S]-p),E=d*(b[S+1]-p),I=d*(b[S+2]-p),T=d*(b[S+3]-p),C=d*(b[S+4]-p),M=d*(b[S+5]-p);w.push([[P,k],[x,E],[I,T],[C,M]]);P=C;k=M}var G=ink_classStaticPrivateMethodGet(this,InkEditor,_buildPath2D).call(this,w);i.bezierPath2D.push(G)}}catch(t){m.e(t)}finally{m.f()}var O=ink_classPrivateMethodGet(i,Nc,_getBbox2).call(i);ink_classPrivateFieldSet(i,ic,Math.max(fn.MIN_SIZE,O[2]-O[0]));ink_classPrivateFieldSet(i,ac,Math.max(fn.MIN_SIZE,O[3]-O[1]));ink_classPrivateMethodGet(i,Lc,_setScaleFactor2).call(i,u,h);return i}}]);return InkEditor}(fn);Gl=Bc;function ink_updateThickness2(t){var r=this,a=function setThickness(t){r.thickness=t;ink_classPrivateMethodGet(r,Hc,_fitToContent2).call(r)},i=this.thickness;this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function ink_updateColor2(t){var r=this,a=function setColor(t){r.color=t;ink_classPrivateMethodGet(r,Cc,_redraw2).call(r)},i=this.color;this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _updateOpacity2(t){var r=this,a=function setOpacity(t){r.opacity=t;ink_classPrivateMethodGet(r,Cc,_redraw2).call(r)};t/=100;var i=this.opacity;this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function _getInitialBBox2(){var t=this.parentRotation,r=ink_slicedToArray(this.parentDimensions,2),a=r[0],i=r[1];switch(t){case 90:return[0,i,i,a];case 180:return[a,i,a,i];case 270:return[a,0,i,a];default:return[0,0,a,i]}}function _setStroke2(){var t=this.ctx,r=this.color,a=this.opacity,i=this.thickness,o=this.parentScale,l=this.scaleFactor;t.lineWidth=i*o/l;t.lineCap="round";t.lineJoin="round";t.miterLimit=10;t.strokeStyle="".concat(r).concat(function opacityToHex(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}(a))}function _startDrawing2(t,r){var a=this;this.canvas.addEventListener("contextmenu",noContextMenu);this.canvas.addEventListener("pointerleave",ink_classPrivateFieldGet(this,sc));this.canvas.addEventListener("pointermove",ink_classPrivateFieldGet(this,oc));this.canvas.addEventListener("pointerup",ink_classPrivateFieldGet(this,lc));this.canvas.removeEventListener("pointerdown",ink_classPrivateFieldGet(this,cc));this.isEditing=!0;if(!ink_classPrivateFieldGet(this,pc)){var i;ink_classPrivateFieldSet(this,pc,!0);ink_classPrivateMethodGet(this,Rc,_setCanvasDims2).call(this);this.thickness||(this.thickness=Gl._defaultThickness);this.color||(this.color=Gl._defaultColor||fn._defaultLineColor);null!==(i=this.opacity)&&void 0!==i||(this.opacity=Gl._defaultOpacity)}this.currentPath.push([t,r]);ink_classPrivateFieldSet(this,fc,!1);ink_classPrivateMethodGet(this,kc,_setStroke2).call(this);ink_classPrivateFieldSet(this,gc,(function(){ink_classPrivateMethodGet(a,Ec,_drawPoints2).call(a);ink_classPrivateFieldGet(a,gc)&&window.requestAnimationFrame(ink_classPrivateFieldGet(a,gc))}));window.requestAnimationFrame(ink_classPrivateFieldGet(this,gc))}function _draw2(t,r){var a,i=ink_slicedToArray(this.currentPath.at(-1),2),o=i[0],l=i[1];if(!(this.currentPath.length>1&&t===o&&r===l)){var c=this.currentPath,u=ink_classPrivateFieldGet(this,hc);c.push([t,r]);ink_classPrivateFieldSet(this,fc,!0);if(c.length<=2){var h;(h=u).moveTo.apply(h,ink_toConsumableArray(c[0]));u.lineTo(t,r)}else{if(3===c.length){var d;ink_classPrivateFieldSet(this,hc,u=new Path2D);(d=u).moveTo.apply(d,ink_toConsumableArray(c[0]))}(a=ink_classPrivateMethodGet(this,Ic,_makeBezierCurve2)).call.apply(a,[this,u].concat(ink_toConsumableArray(c.at(-3)),ink_toConsumableArray(c.at(-2)),[t,r]))}}}function _endPath2(){var t;if(0!==this.currentPath.length){var r=this.currentPath.at(-1);(t=ink_classPrivateFieldGet(this,hc)).lineTo.apply(t,ink_toConsumableArray(r))}}function _stopDrawing2(t,r){var a,i=this;ink_classPrivateFieldSet(this,gc,null);t=Math.min(Math.max(t,0),this.canvas.width);r=Math.min(Math.max(r,0),this.canvas.height);ink_classPrivateMethodGet(this,Fc,_draw2).call(this,t,r);ink_classPrivateMethodGet(this,Ac,_endPath2).call(this);if(1!==this.currentPath.length)a=ink_classPrivateMethodGet(this,Tc,_generateBezierPoints2).call(this);else{var o=[t,r];a=[[o,o.slice(),o.slice(),o]]}var l=ink_classPrivateFieldGet(this,hc),c=this.currentPath;this.currentPath=[];ink_classPrivateFieldSet(this,hc,new Path2D);this.addCommands({cmd:function cmd(){i.allRawPaths.push(c);i.paths.push(a);i.bezierPath2D.push(l);i.rebuild()},undo:function undo(){i.allRawPaths.pop();i.paths.pop();i.bezierPath2D.pop();if(0===i.paths.length)i.remove();else{if(!i.canvas){ink_classPrivateMethodGet(i,Gc,_createCanvas2).call(i);ink_classPrivateMethodGet(i,Oc,_createObserver2).call(i)}ink_classPrivateMethodGet(i,Hc,_fitToContent2).call(i)}},mustExec:!0})}function _drawPoints2(){if(ink_classPrivateFieldGet(this,fc)){ink_classPrivateFieldSet(this,fc,!1);var t=Math.ceil(this.thickness*this.parentScale),r=this.currentPath.slice(-3),a=r.map((function(t){return t[0]})),i=r.map((function(t){return t[1]})),o=(Math.min.apply(Math,ink_toConsumableArray(a)),Math.max.apply(Math,ink_toConsumableArray(a)),Math.min.apply(Math,ink_toConsumableArray(i)),Math.max.apply(Math,ink_toConsumableArray(i)),this.ctx);o.save();o.clearRect(0,0,this.canvas.width,this.canvas.height);var l,c=ink_createForOfIteratorHelper(this.bezierPath2D);try{for(c.s();!(l=c.n()).done;){var u=l.value;o.stroke(u)}}catch(t){c.e(t)}finally{c.f()}o.stroke(ink_classPrivateFieldGet(this,hc));o.restore()}}function _makeBezierCurve2(t,r,a,i,o,l,c){var u=(r+i)/2,h=(a+o)/2,d=(i+l)/2,p=(o+c)/2;t.bezierCurveTo(u+2*(i-u)/3,h+2*(o-h)/3,d+2*(i-d)/3,p+2*(o-p)/3,d,p)}function _generateBezierPoints2(){var t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];var r,a=[],i=ink_slicedToArray(t[0],2),o=i[0],l=i[1];for(r=1;r<t.length-2;r++){var c=ink_slicedToArray(t[r],2),u=c[0],h=c[1],d=ink_slicedToArray(t[r+1],2),p=(u+d[0])/2,v=(h+d[1])/2,_=[o+2*(u-o)/3,l+2*(h-l)/3],y=[p+2*(u-p)/3,v+2*(h-v)/3];a.push([[o,l],_,y,[p,v]]);o=p;l=v}var g=ink_slicedToArray(t[r],2),m=g[0],b=g[1],w=ink_slicedToArray(t[r+1],2),P=w[0],k=w[1],S=[o+2*(m-o)/3,l+2*(b-l)/3],A=[P+2*(m-P)/3,k+2*(b-k)/3];a.push([[o,l],S,A,[P,k]]);return a}function _redraw2(){if(this.isEmpty())ink_classPrivateMethodGet(this,Dc,_updateTransform2).call(this);else{ink_classPrivateMethodGet(this,kc,_setStroke2).call(this);var t=this.canvas,r=this.ctx;r.setTransform(1,0,0,1,0,0);r.clearRect(0,0,t.width,t.height);ink_classPrivateMethodGet(this,Dc,_updateTransform2).call(this);var a,i=ink_createForOfIteratorHelper(this.bezierPath2D);try{for(i.s();!(a=i.n()).done;){var o=a.value;r.stroke(o)}}catch(t){i.e(t)}finally{i.f()}}}function _endDrawing2(t){var r=this;this.canvas.removeEventListener("pointerleave",ink_classPrivateFieldGet(this,sc));this.canvas.removeEventListener("pointermove",ink_classPrivateFieldGet(this,oc));this.canvas.removeEventListener("pointerup",ink_classPrivateFieldGet(this,lc));this.canvas.addEventListener("pointerdown",ink_classPrivateFieldGet(this,cc));ink_classPrivateFieldGet(this,uc)&&clearTimeout(ink_classPrivateFieldGet(this,uc));ink_classPrivateFieldSet(this,uc,setTimeout((function(){ink_classPrivateFieldSet(r,uc,null);r.canvas.removeEventListener("contextmenu",noContextMenu)}),10));ink_classPrivateMethodGet(this,xc,_stopDrawing2).call(this,t.offsetX,t.offsetY);this.addToAnnotationStorage();this.setInBackground()}function _createCanvas2(){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);var t=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0;this.ctx=this.canvas.getContext("2d",t)}function _createObserver2(){var t=this;ink_classPrivateFieldSet(this,vc,new ResizeObserver((function(r){var a=r[0].contentRect;a.width&&a.height&&t.setDimensions(a.width,a.height)})));ink_classPrivateFieldGet(this,vc).observe(this.div)}function _setCanvasDims2(){if(ink_classPrivateFieldGet(this,pc)){var t=ink_slicedToArray(this.parentDimensions,2),r=t[0],a=t[1];this.canvas.width=Math.ceil(this.width*r);this.canvas.height=Math.ceil(this.height*a);ink_classPrivateMethodGet(this,Dc,_updateTransform2).call(this)}}function _setScaleFactor2(t,r){var a=ink_classPrivateMethodGet(this,Wc,_getPadding2).call(this),i=(t-a)/ink_classPrivateFieldGet(this,ic),o=(r-a)/ink_classPrivateFieldGet(this,ac);this.scaleFactor=Math.min(i,o)}function _updateTransform2(){var t=ink_classPrivateMethodGet(this,Wc,_getPadding2).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function _buildPath2D(t){for(var r=new Path2D,a=0,i=t.length;a<i;a++){var o=ink_slicedToArray(t[a],4),l=o[0],c=o[1],u=o[2],h=o[3];0===a&&r.moveTo.apply(r,ink_toConsumableArray(l));r.bezierCurveTo(c[0],c[1],u[0],u[1],h[0],h[1])}return r}function _toPDFCoordinates(t,r,a){var i=ink_slicedToArray(r,4),o=i[0],l=i[1],c=i[2],u=i[3];switch(a){case 0:for(var h=0,d=t.length;h<d;h+=2){t[h]+=o;t[h+1]=u-t[h+1]}break;case 90:for(var p=0,v=t.length;p<v;p+=2){var _=t[p];t[p]=t[p+1]+o;t[p+1]=_+l}break;case 180:for(var y=0,g=t.length;y<g;y+=2){t[y]=c-t[y];t[y+1]+=l}break;case 270:for(var m=0,b=t.length;m<b;m+=2){var w=t[m];t[m]=c-t[m+1];t[m+1]=u-w}break;default:throw new Error("Invalid rotation")}return t}function _fromPDFCoordinates(t,r,a){var i=ink_slicedToArray(r,4),o=i[0],l=i[1],c=i[2],u=i[3];switch(a){case 0:for(var h=0,d=t.length;h<d;h+=2){t[h]-=o;t[h+1]=u-t[h+1]}break;case 90:for(var p=0,v=t.length;p<v;p+=2){var _=t[p];t[p]=t[p+1]-l;t[p+1]=_-o}break;case 180:for(var y=0,g=t.length;y<g;y+=2){t[y]=c-t[y];t[y+1]-=l}break;case 270:for(var m=0,b=t.length;m<b;m+=2){var w=t[m];t[m]=u-t[m+1];t[m+1]=c-w}break;default:throw new Error("Invalid rotation")}return t}function _serializePaths2(t,r,a,i){var o,l=[],c=this.thickness/2,u=t*r+c,h=t*a+c,d=ink_createForOfIteratorHelper(this.paths);try{for(d.s();!(o=d.n()).done;){for(var p=o.value,v=[],_=[],y=0,g=p.length;y<g;y++){var m=ink_slicedToArray(p[y],4),b=m[0],w=m[1],P=m[2],k=m[3];if(b[0]===k[0]&&b[1]===k[1]&&1===g){var S=t*b[0]+u,A=t*b[1]+h;v.push(S,A);_.push(S,A);break}var x=t*b[0]+u,E=t*b[1]+h,I=t*w[0]+u,T=t*w[1]+h,C=t*P[0]+u,M=t*P[1]+h,G=t*k[0]+u,O=t*k[1]+h;if(0===y){v.push(x,E);_.push(x,E)}v.push(I,T,C,M,G,O);_.push(I,T);y===g-1&&_.push(G,O)}l.push({bezier:ink_classStaticPrivateMethodGet(Gl,Gl,_toPDFCoordinates).call(Gl,v,i,this.rotation),points:ink_classStaticPrivateMethodGet(Gl,Gl,_toPDFCoordinates).call(Gl,_,i,this.rotation)})}}catch(t){d.e(t)}finally{d.f()}return l}function _getBbox2(){var t,r=1/0,a=-1/0,i=1/0,o=-1/0,l=ink_createForOfIteratorHelper(this.paths);try{for(l.s();!(t=l.n()).done;){var c,u=ink_createForOfIteratorHelper(t.value);try{for(u.s();!(c=u.n()).done;){var h=ink_slicedToArray(c.value,4),d=h[0],p=h[1],v=h[2],_=h[3],y=fe.bezierBoundingBox.apply(fe,ink_toConsumableArray(d).concat(ink_toConsumableArray(p),ink_toConsumableArray(v),ink_toConsumableArray(_)));r=Math.min(r,y[0]);i=Math.min(i,y[1]);a=Math.max(a,y[2]);o=Math.max(o,y[3])}}catch(t){u.e(t)}finally{u.f()}}}catch(t){l.e(t)}finally{l.f()}return[r,i,a,o]}function _getPadding2(){return ink_classPrivateFieldGet(this,dc)?Math.ceil(this.thickness*this.parentScale):0}function _fitToContent2(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isEmpty())if(ink_classPrivateFieldGet(this,dc)){var r=ink_classPrivateMethodGet(this,Nc,_getBbox2).call(this),a=ink_classPrivateMethodGet(this,Wc,_getPadding2).call(this);ink_classPrivateFieldSet(this,ic,Math.max(fn.MIN_SIZE,r[2]-r[0]));ink_classPrivateFieldSet(this,ac,Math.max(fn.MIN_SIZE,r[3]-r[1]));var i=Math.ceil(a+ink_classPrivateFieldGet(this,ic)*this.scaleFactor),o=Math.ceil(a+ink_classPrivateFieldGet(this,ac)*this.scaleFactor),l=ink_slicedToArray(this.parentDimensions,2),c=l[0],u=l[1];this.width=i/c;this.height=o/u;this.setAspectRatio(i,o);var h=this.translationX,d=this.translationY;this.translationX=-r[0];this.translationY=-r[1];ink_classPrivateMethodGet(this,Rc,_setCanvasDims2).call(this);ink_classPrivateMethodGet(this,Cc,_redraw2).call(this);ink_classPrivateFieldSet(this,_c,i);ink_classPrivateFieldSet(this,yc,o);this.setDims(i,o);var p=t?a/this.scaleFactor/2:0;this.translate(h-this.translationX-p,d-this.translationY-p)}else ink_classPrivateMethodGet(this,Cc,_redraw2).call(this)}ink_defineProperty(Bc,"_defaultColor",null);ink_defineProperty(Bc,"_defaultOpacity",1);ink_defineProperty(Bc,"_defaultThickness",1);ink_defineProperty(Bc,"_type","ink");ink_defineProperty(Bc,"_editorType",g.INK);function stamp_typeof(t){return stamp_typeof="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},stamp_typeof(t)}function stamp_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */stamp_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==stamp_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(stamp_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function stamp_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function stamp_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){stamp_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){stamp_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function stamp_slicedToArray(t,r){return function stamp_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function stamp_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||function stamp_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return stamp_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return stamp_arrayLikeToArray(t,r)}(t,r)||function stamp_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function stamp_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function stamp_ownKeys(t,r){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,i)}return a}function stamp_objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?stamp_ownKeys(Object(a),!0).forEach((function(r){stamp_defineProperty(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):stamp_ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}function stamp_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,stamp_toPropertyKey(i.key),i)}}function stamp_callSuper(t,r,a){return r=stamp_getPrototypeOf(r),function stamp_possibleConstructorReturn(t,r){if(r&&("object"===stamp_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return stamp_assertThisInitialized(t)}(t,stamp_isNativeReflectConstruct()?Reflect.construct(r,a||[],stamp_getPrototypeOf(t).constructor):r.apply(t,a))}function stamp_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(stamp_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function stamp_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function stamp_get(){stamp_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function stamp_superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=stamp_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}};return stamp_get.apply(this,arguments)}function stamp_getPrototypeOf(t){stamp_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return stamp_getPrototypeOf(t)}function stamp_setPrototypeOf(t,r){stamp_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return stamp_setPrototypeOf(t,r)}function stamp_classPrivateMethodInitSpec(t,r){stamp_checkPrivateRedeclaration(t,r);r.add(t)}function stamp_defineProperty(t,r,a){(r=stamp_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function stamp_toPropertyKey(t){var r=function stamp_toPrimitive(t,r){if("object"!=stamp_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=stamp_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==stamp_typeof(r)?r:String(r)}function stamp_classPrivateFieldInitSpec(t,r,a){stamp_checkPrivateRedeclaration(t,r);r.set(t,a)}function stamp_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function stamp_classPrivateFieldGet(t,r){return function stamp_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,stamp_classExtractFieldDescriptor(t,r,"get"))}function stamp_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function stamp_classPrivateFieldSet(t,r,a){!function stamp_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,stamp_classExtractFieldDescriptor(t,r,"set"),a);return a}function stamp_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var zc,Uc=new WeakMap,qc=new WeakMap,Vc=new WeakMap,Kc=new WeakMap,Yc=new WeakMap,Xc=new WeakMap,$c=new WeakMap,Jc=new WeakMap,Qc=new WeakMap,Zc=new WeakMap,eu=new WeakMap,tu=new WeakSet,ru=new WeakSet,nu=new WeakSet,au=new WeakSet,iu=new WeakSet,ou=new WeakSet,su=new WeakSet,lu=new WeakSet,cu=new WeakSet,uu=function(t){!function stamp_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&stamp_setPrototypeOf(t,r)}(StampEditor,t);function StampEditor(t){var r;!function stamp_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,StampEditor);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r=stamp_callSuper(this,StampEditor,[stamp_objectSpread(stamp_objectSpread({},t),{},{name:"stampEditor"})])),cu);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),lu);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),su);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),ou);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),iu);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),au);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),nu);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),ru);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),tu);stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Uc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),qc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Vc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Kc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Yc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Xc,{writable:!0,value:""});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),$c,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Jc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Qc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Zc,{writable:!0,value:!1});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),eu,{writable:!0,value:!1});stamp_classPrivateFieldSet(stamp_assertThisInitialized(r),Kc,t.bitmapUrl);stamp_classPrivateFieldSet(stamp_assertThisInitialized(r),Yc,t.bitmapFile);return r}!function stamp_createClass(t,r,a){r&&stamp_defineProperties(t.prototype,r);a&&stamp_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(StampEditor,[{key:"remove",value:function remove(){if(stamp_classPrivateFieldGet(this,qc)){var t,r;stamp_classPrivateFieldSet(this,Uc,null);this._uiManager.imageManager.deleteId(stamp_classPrivateFieldGet(this,qc));null===(t=stamp_classPrivateFieldGet(this,$c))||void 0===t||t.remove();stamp_classPrivateFieldSet(this,$c,null);null===(r=stamp_classPrivateFieldGet(this,Jc))||void 0===r||r.disconnect();stamp_classPrivateFieldSet(this,Jc,null);if(stamp_classPrivateFieldGet(this,Qc)){clearTimeout(stamp_classPrivateFieldGet(this,Qc));stamp_classPrivateFieldSet(this,Qc,null)}}stamp_get(stamp_getPrototypeOf(StampEditor.prototype),"remove",this).call(this)}},{key:"rebuild",value:function rebuild(){if(this.parent){stamp_get(stamp_getPrototypeOf(StampEditor.prototype),"rebuild",this).call(this);if(null!==this.div){stamp_classPrivateFieldGet(this,qc)&&stamp_classPrivateMethodGet(this,nu,_getBitmap2).call(this);this.isAttachedToDOM||this.parent.add(this)}}else stamp_classPrivateFieldGet(this,qc)&&stamp_classPrivateMethodGet(this,nu,_getBitmap2).call(this)}},{key:"onceAdded",value:function onceAdded(){this._isDraggable=!0;this.div.focus()}},{key:"isEmpty",value:function isEmpty(){return!(stamp_classPrivateFieldGet(this,Vc)||stamp_classPrivateFieldGet(this,Uc)||stamp_classPrivateFieldGet(this,Kc)||stamp_classPrivateFieldGet(this,Yc))}},{key:"isResizable",get:function get(){return!0}},{key:"render",value:function render(){if(this.div)return this.div;var t,r;if(this.width){t=this.x;r=this.y}stamp_get(stamp_getPrototypeOf(StampEditor.prototype),"render",this).call(this);this.div.hidden=!0;stamp_classPrivateFieldGet(this,Uc)?stamp_classPrivateMethodGet(this,au,stamp_createCanvas2).call(this):stamp_classPrivateMethodGet(this,nu,_getBitmap2).call(this);if(this.width){var a=stamp_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1];this.setAt(t*i,r*o,this.width*i,this.height*o)}return this.div}},{key:"getImageForAltText",value:function getImageForAltText(){return stamp_classPrivateFieldGet(this,$c)}},{key:"serialize",value:function serialize(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;var a={annotationType:g.STAMP,bitmapId:stamp_classPrivateFieldGet(this,qc),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:stamp_classPrivateFieldGet(this,Zc),structTreeParentId:this._structTreeParentId};if(t){a.bitmapUrl=stamp_classPrivateMethodGet(this,lu,_serializeBitmap2).call(this,!0);a.accessibilityData=this.altTextData;return a}var i=this.altTextData,o=i.decorative,l=i.altText;!o&&l&&(a.accessibilityData={type:"Figure",alt:l});if(null===r)return a;r.stamps||(r.stamps=new Map);var c=stamp_classPrivateFieldGet(this,Zc)?(a.rect[2]-a.rect[0])*(a.rect[3]-a.rect[1]):null;if(r.stamps.has(stamp_classPrivateFieldGet(this,qc))){if(stamp_classPrivateFieldGet(this,Zc)){var u=r.stamps.get(stamp_classPrivateFieldGet(this,qc));if(c>u.area){u.area=c;u.serialized.bitmap.close();u.serialized.bitmap=stamp_classPrivateMethodGet(this,lu,_serializeBitmap2).call(this,!1)}}}else{r.stamps.set(stamp_classPrivateFieldGet(this,qc),{area:c,serialized:a});a.bitmap=stamp_classPrivateMethodGet(this,lu,_serializeBitmap2).call(this,!1)}return a}}],[{key:"initialize",value:function initialize(t,r){fn.initialize(t,r)}},{key:"supportedTypes",get:function get(){return shadow(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((function(t){return"image/".concat(t)})))}},{key:"supportedTypesStr",get:function get(){return shadow(this,"supportedTypesStr",this.supportedTypes.join(","))}},{key:"isHandlingMimeForPasting",value:function isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}},{key:"paste",value:function paste(t,r){r.pasteEditor(g.STAMP,{bitmapFile:t.getAsFile()})}},{key:"deserialize",value:function deserialize(t,r,a){if(t instanceof $o)return null;var i=stamp_get(stamp_getPrototypeOf(StampEditor),"deserialize",this).call(this,t,r,a),o=t.rect,l=t.bitmapUrl,c=t.bitmapId,u=t.isSvg,h=t.accessibilityData;c&&a.imageManager.isValidId(c)?stamp_classPrivateFieldSet(i,qc,c):stamp_classPrivateFieldSet(i,Kc,l);stamp_classPrivateFieldSet(i,Zc,u);var d=stamp_slicedToArray(i.pageDimensions,2),p=d[0],v=d[1];i.width=(o[2]-o[0])/p;i.height=(o[3]-o[1])/v;h&&(i.altTextData=h);return i}}]);return StampEditor}(fn);nc=uu;function _getBitmapFetched2(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){stamp_classPrivateFieldSet(this,Uc,t.bitmap);if(!r){stamp_classPrivateFieldSet(this,qc,t.id);stamp_classPrivateFieldSet(this,Zc,t.isSvg)}t.file&&stamp_classPrivateFieldSet(this,Xc,t.file.name);stamp_classPrivateMethodGet(this,au,stamp_createCanvas2).call(this)}else this.remove()}function _getBitmapDone2(){stamp_classPrivateFieldSet(this,Vc,null);this._uiManager.enableWaiting(!1);stamp_classPrivateFieldGet(this,$c)&&this.div.focus()}function _getBitmap2(){var t=this;if(stamp_classPrivateFieldGet(this,qc)){this._uiManager.enableWaiting(!0);this._uiManager.imageManager.getFromId(stamp_classPrivateFieldGet(this,qc)).then((function(r){return stamp_classPrivateMethodGet(t,tu,_getBitmapFetched2).call(t,r,!0)})).finally((function(){return stamp_classPrivateMethodGet(t,ru,_getBitmapDone2).call(t)}))}else if(stamp_classPrivateFieldGet(this,Kc)){var r=stamp_classPrivateFieldGet(this,Kc);stamp_classPrivateFieldSet(this,Kc,null);this._uiManager.enableWaiting(!0);stamp_classPrivateFieldSet(this,Vc,this._uiManager.imageManager.getFromUrl(r).then((function(r){return stamp_classPrivateMethodGet(t,tu,_getBitmapFetched2).call(t,r)})).finally((function(){return stamp_classPrivateMethodGet(t,ru,_getBitmapDone2).call(t)})))}else if(stamp_classPrivateFieldGet(this,Yc)){var a=stamp_classPrivateFieldGet(this,Yc);stamp_classPrivateFieldSet(this,Yc,null);this._uiManager.enableWaiting(!0);stamp_classPrivateFieldSet(this,Vc,this._uiManager.imageManager.getFromFile(a).then((function(r){return stamp_classPrivateMethodGet(t,tu,_getBitmapFetched2).call(t,r)})).finally((function(){return stamp_classPrivateMethodGet(t,ru,_getBitmapDone2).call(t)})))}else{var i=document.createElement("input");i.type="file";i.accept=nc.supportedTypesStr;stamp_classPrivateFieldSet(this,Vc,new Promise((function(r){i.addEventListener("change",stamp_asyncToGenerator(stamp_regeneratorRuntime().mark((function _callee(){var a;return stamp_regeneratorRuntime().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:if(i.files&&0!==i.files.length){o.next=4;break}t.remove();o.next=9;break;case 4:t._uiManager.enableWaiting(!0);o.next=7;return t._uiManager.imageManager.getFromFile(i.files[0]);case 7:a=o.sent;stamp_classPrivateMethodGet(t,tu,_getBitmapFetched2).call(t,a);case 9:r();case 10:case"end":return o.stop()}}),_callee)}))));i.addEventListener("cancel",(function(){t.remove();r()}))})).finally((function(){return stamp_classPrivateMethodGet(t,ru,_getBitmapDone2).call(t)})));i.click()}}function stamp_createCanvas2(){var t=this.div,r=stamp_classPrivateFieldGet(this,Uc),a=r.width,i=r.height,o=stamp_slicedToArray(this.pageDimensions,2),l=o[0],c=o[1],u=.75;if(this.width){a=this.width*l;i=this.height*c}else if(a>u*l||i>u*c){var h=Math.min(u*l/a,u*c/i);a*=h;i*=h}var d=stamp_slicedToArray(this.parentDimensions,2),p=d[0],v=d[1];this.setDims(a*p/l,i*v/c);this._uiManager.enableWaiting(!1);var _=stamp_classPrivateFieldSet(this,$c,document.createElement("canvas"));t.append(_);t.hidden=!1;stamp_classPrivateMethodGet(this,su,_drawBitmap2).call(this,a,i);stamp_classPrivateMethodGet(this,cu,stamp_createObserver2).call(this);if(!stamp_classPrivateFieldGet(this,eu)){this.parent.addUndoableEditor(this);stamp_classPrivateFieldSet(this,eu,!0)}this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}});this.addAltTextButton();stamp_classPrivateFieldGet(this,Xc)&&_.setAttribute("aria-label",stamp_classPrivateFieldGet(this,Xc))}function _setDimensions2(t,r){var a,i=this,o=stamp_slicedToArray(this.parentDimensions,2),l=o[0],c=o[1];this.width=t/l;this.height=r/c;this.setDims(t,r);null!==(a=this._initialOptions)&&void 0!==a&&a.isCentered?this.center():this.fixAndSetPosition();this._initialOptions=null;null!==stamp_classPrivateFieldGet(this,Qc)&&clearTimeout(stamp_classPrivateFieldGet(this,Qc));stamp_classPrivateFieldSet(this,Qc,setTimeout((function(){stamp_classPrivateFieldSet(i,Qc,null);stamp_classPrivateMethodGet(i,su,_drawBitmap2).call(i,t,r)}),200))}function _scaleBitmap2(t,r){for(var a=stamp_classPrivateFieldGet(this,Uc),i=a.width,o=a.height,l=stamp_classPrivateFieldGet(this,Uc);i>2*t||o>2*r;){var c=i,u=o;i>2*t&&(i=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2));o>2*r&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));var h=new OffscreenCanvas(i,o);h.getContext("2d").drawImage(l,0,0,c,u,0,0,i,o);l=h.transferToImageBitmap()}return l}function _drawBitmap2(t,r){t=Math.ceil(t);r=Math.ceil(r);var a=stamp_classPrivateFieldGet(this,$c);if(a&&(a.width!==t||a.height!==r)){a.width=t;a.height=r;var i=stamp_classPrivateFieldGet(this,Zc)?stamp_classPrivateFieldGet(this,Uc):stamp_classPrivateMethodGet(this,ou,_scaleBitmap2).call(this,t,r),o=a.getContext("2d");o.filter=this._uiManager.hcmFilter;o.drawImage(i,0,0,i.width,i.height,0,0,t,r)}}function _serializeBitmap2(t){if(t){if(stamp_classPrivateFieldGet(this,Zc)){var r=this._uiManager.imageManager.getSvgUrl(stamp_classPrivateFieldGet(this,qc));if(r)return r}var a=document.createElement("canvas"),i=stamp_classPrivateFieldGet(this,Uc);a.width=i.width;a.height=i.height;a.getContext("2d").drawImage(stamp_classPrivateFieldGet(this,Uc),0,0);return a.toDataURL()}if(stamp_classPrivateFieldGet(this,Zc)){var o=stamp_slicedToArray(this.pageDimensions,2),l=o[0],c=o[1],u=Math.round(this.width*l*Ae.PDF_TO_CSS_UNITS),h=Math.round(this.height*c*Ae.PDF_TO_CSS_UNITS),d=new OffscreenCanvas(u,h);d.getContext("2d").drawImage(stamp_classPrivateFieldGet(this,Uc),0,0,stamp_classPrivateFieldGet(this,Uc).width,stamp_classPrivateFieldGet(this,Uc).height,0,0,u,h);return d.transferToImageBitmap()}return structuredClone(stamp_classPrivateFieldGet(this,Uc))}function stamp_createObserver2(){var t=this;stamp_classPrivateFieldSet(this,Jc,new ResizeObserver((function(r){var a=r[0].contentRect;a.width&&a.height&&stamp_classPrivateMethodGet(t,iu,_setDimensions2).call(t,a.width,a.height)})));stamp_classPrivateFieldGet(this,Jc).observe(this.div)}stamp_defineProperty(uu,"_type","stamp");stamp_defineProperty(uu,"_editorType",g.STAMP);function annotation_editor_layer_typeof(t){return annotation_editor_layer_typeof="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},annotation_editor_layer_typeof(t)}function annotation_editor_layer_slicedToArray(t,r){return function annotation_editor_layer_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function annotation_editor_layer_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||annotation_editor_layer_unsupportedIterableToArray(t,r)||function annotation_editor_layer_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function annotation_editor_layer_ownKeys(t,r){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,i)}return a}function annotation_editor_layer_objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?annotation_editor_layer_ownKeys(Object(a),!0).forEach((function(r){annotation_editor_layer_defineProperty(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):annotation_editor_layer_ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}function annotation_editor_layer_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=annotation_editor_layer_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function annotation_editor_layer_toConsumableArray(t){return function annotation_editor_layer_arrayWithoutHoles(t){if(Array.isArray(t))return annotation_editor_layer_arrayLikeToArray(t)}(t)||function annotation_editor_layer_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||annotation_editor_layer_unsupportedIterableToArray(t)||function annotation_editor_layer_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function annotation_editor_layer_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return annotation_editor_layer_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?annotation_editor_layer_arrayLikeToArray(t,r):void 0}}function annotation_editor_layer_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function annotation_editor_layer_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,annotation_editor_layer_toPropertyKey(i.key),i)}}function annotation_editor_layer_classPrivateMethodInitSpec(t,r){annotation_editor_layer_checkPrivateRedeclaration(t,r);r.add(t)}function annotation_editor_layer_defineProperty(t,r,a){(r=annotation_editor_layer_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function annotation_editor_layer_toPropertyKey(t){var r=function annotation_editor_layer_toPrimitive(t,r){if("object"!=annotation_editor_layer_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=annotation_editor_layer_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==annotation_editor_layer_typeof(r)?r:String(r)}function annotation_editor_layer_classPrivateFieldInitSpec(t,r,a){annotation_editor_layer_checkPrivateRedeclaration(t,r);r.set(t,a)}function annotation_editor_layer_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function annotation_editor_layer_classPrivateFieldGet(t,r){return annotation_editor_layer_classApplyDescriptorGet(t,annotation_editor_layer_classExtractFieldDescriptor(t,r,"get"))}function annotation_editor_layer_classPrivateFieldSet(t,r,a){!function annotation_editor_layer_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,annotation_editor_layer_classExtractFieldDescriptor(t,r,"set"),a);return a}function annotation_editor_layer_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function annotation_editor_layer_classStaticPrivateFieldSpecGet(t,r,a){!function annotation_editor_layer_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);!function annotation_editor_layer_classCheckPrivateStaticFieldDescriptor(t,r){if(void 0===t)throw new TypeError("attempted to "+r+" private static field before its declaration")}(a,"get");return annotation_editor_layer_classApplyDescriptorGet(t,a)}function annotation_editor_layer_classApplyDescriptorGet(t,r){return r.get?r.get.call(t):r.value}function annotation_editor_layer_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}var hu=new WeakMap,du=new WeakMap,fu=new WeakMap,pu=new WeakMap,vu=new WeakMap,_u=new WeakMap,yu=new WeakMap,gu=new WeakMap,mu=new WeakMap,bu=new WeakMap,wu=new WeakMap,Pu=new WeakMap,ku=new WeakMap,Su=new WeakMap,Fu=new WeakMap,Au=new WeakSet,xu=new WeakMap,Eu=new WeakSet,Iu=new WeakSet,Tu=new WeakSet,Cu=function(){function AnnotationEditorLayer(t){var r=t.uiManager,a=t.pageIndex,i=t.div,o=t.accessibilityManager,l=t.annotationLayer,c=t.drawLayer,u=t.textLayer,h=t.viewport,d=t.l10n;!function annotation_editor_layer_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,AnnotationEditorLayer);annotation_editor_layer_classPrivateMethodInitSpec(this,Tu);annotation_editor_layer_classPrivateMethodInitSpec(this,Iu);annotation_editor_layer_classPrivateMethodInitSpec(this,Eu);annotation_editor_layer_classPrivateFieldInitSpec(this,xu,{get:_get_currentEditorType,set:void 0});annotation_editor_layer_classPrivateMethodInitSpec(this,Au);annotation_editor_layer_classPrivateFieldInitSpec(this,hu,{writable:!0,value:void 0});annotation_editor_layer_classPrivateFieldInitSpec(this,du,{writable:!0,value:!1});annotation_editor_layer_classPrivateFieldInitSpec(this,fu,{writable:!0,value:null});annotation_editor_layer_classPrivateFieldInitSpec(this,pu,{writable:!0,value:this.pointerup.bind(this)});annotation_editor_layer_classPrivateFieldInitSpec(this,vu,{writable:!0,value:this.pointerUpAfterSelection.bind(this)});annotation_editor_layer_classPrivateFieldInitSpec(this,_u,{writable:!0,value:this.pointerdown.bind(this)});annotation_editor_layer_classPrivateFieldInitSpec(this,yu,{writable:!0,value:annotation_editor_layer_classPrivateMethodGet(this,Au,_textLayerPointerDown2).bind(this)});annotation_editor_layer_classPrivateFieldInitSpec(this,gu,{writable:!0,value:null});annotation_editor_layer_classPrivateFieldInitSpec(this,mu,{writable:!0,value:this.selectionStart.bind(this)});annotation_editor_layer_classPrivateFieldInitSpec(this,bu,{writable:!0,value:new Map});annotation_editor_layer_classPrivateFieldInitSpec(this,wu,{writable:!0,value:!1});annotation_editor_layer_classPrivateFieldInitSpec(this,Pu,{writable:!0,value:!1});annotation_editor_layer_classPrivateFieldInitSpec(this,ku,{writable:!0,value:!1});annotation_editor_layer_classPrivateFieldInitSpec(this,Su,{writable:!0,value:null});annotation_editor_layer_classPrivateFieldInitSpec(this,Fu,{writable:!0,value:void 0});var p=annotation_editor_layer_toConsumableArray(annotation_editor_layer_classStaticPrivateFieldSpecGet(AnnotationEditorLayer,AnnotationEditorLayer,Gu).values());if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;var v,_=annotation_editor_layer_createForOfIteratorHelper(p);try{for(_.s();!(v=_.n()).done;){v.value.initialize(d,r)}}catch(t){_.e(t)}finally{_.f()}}r.registerEditorTypes(p);annotation_editor_layer_classPrivateFieldSet(this,Fu,r);this.pageIndex=a;this.div=i;annotation_editor_layer_classPrivateFieldSet(this,hu,o);annotation_editor_layer_classPrivateFieldSet(this,fu,l);this.viewport=h;annotation_editor_layer_classPrivateFieldSet(this,Su,u);this.drawLayer=c;annotation_editor_layer_classPrivateFieldGet(this,Fu).addLayer(this)}!function annotation_editor_layer_createClass(t,r,a){r&&annotation_editor_layer_defineProperties(t.prototype,r);a&&annotation_editor_layer_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(AnnotationEditorLayer,[{key:"isEmpty",get:function get(){return 0===annotation_editor_layer_classPrivateFieldGet(this,bu).size}},{key:"updateToolbar",value:function updateToolbar(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).updateToolbar(t)}},{key:"updateMode",value:function updateMode(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:annotation_editor_layer_classPrivateFieldGet(this,Fu).getMode();annotation_editor_layer_classPrivateMethodGet(this,Tu,_cleanup2).call(this);switch(t){case g.NONE:this.disableTextSelection();this.togglePointerEvents(!1);this.disableClick();break;case g.INK:this.addInkEditorIfNeeded(!1);this.disableTextSelection();this.togglePointerEvents(!0);this.disableClick();break;case g.HIGHLIGHT:this.enableTextSelection();this.togglePointerEvents(!1);this.disableClick();break;default:this.disableTextSelection();this.togglePointerEvents(!0);this.enableClick()}if(t!==g.NONE){var r,a=this.div.classList,i=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classStaticPrivateFieldSpecGet(AnnotationEditorLayer,AnnotationEditorLayer,Gu).values());try{for(i.s();!(r=i.n()).done;){var o=r.value;a.toggle("".concat(o._type,"Editing"),t===o._editorType)}}catch(t){i.e(t)}finally{i.f()}this.div.hidden=!1}}},{key:"addInkEditorIfNeeded",value:function addInkEditorIfNeeded(t){if(annotation_editor_layer_classPrivateFieldGet(this,Fu).getMode()===g.INK){if(!t){var r,a=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(a.s();!(r=a.n()).done;){var i=r.value;if(i.isEmpty()){i.setInBackground();return}}}catch(t){a.e(t)}finally{a.f()}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}}},{key:"setEditingState",value:function setEditingState(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).setEditingState(t)}},{key:"addCommands",value:function addCommands(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).addCommands(t)}},{key:"togglePointerEvents",value:function togglePointerEvents(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}},{key:"enable",value:function enable(){this.togglePointerEvents(!0);var t,r=new Set,a=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(a.s();!(t=a.n()).done;){var i=t.value;i.enableEditing();i.annotationElementId&&r.add(i.annotationElementId)}}catch(t){a.e(t)}finally{a.f()}if(annotation_editor_layer_classPrivateFieldGet(this,fu)){var o,l=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,fu).getEditableAnnotations());try{for(l.s();!(o=l.n()).done;){var c=o.value;c.hide();if(!annotation_editor_layer_classPrivateFieldGet(this,Fu).isDeletedAnnotationElement(c.data.id)&&!r.has(c.data.id)){var u=this.deserialize(c);if(u){this.addOrRebuild(u);u.enableEditing()}}}}catch(t){l.e(t)}finally{l.f()}}}},{key:"disable",value:function disable(){annotation_editor_layer_classPrivateFieldSet(this,ku,!0);this.togglePointerEvents(!1);var t,r=new Set,a=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(a.s();!(t=a.n()).done;){var i,o=t.value;o.disableEditing();if(o.annotationElementId&&null===o.serialize()){null===(i=this.getEditableAnnotation(o.annotationElementId))||void 0===i||i.show();o.remove()}else r.add(o.annotationElementId)}}catch(t){a.e(t)}finally{a.f()}if(annotation_editor_layer_classPrivateFieldGet(this,fu)){var l,c=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,fu).getEditableAnnotations());try{for(c.s();!(l=c.n()).done;){var u=l.value,h=u.data.id;r.has(h)||annotation_editor_layer_classPrivateFieldGet(this,Fu).isDeletedAnnotationElement(h)||u.show()}}catch(t){c.e(t)}finally{c.f()}}annotation_editor_layer_classPrivateMethodGet(this,Tu,_cleanup2).call(this);this.isEmpty&&(this.div.hidden=!0);var d,p=this.div.classList,v=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classStaticPrivateFieldSpecGet(AnnotationEditorLayer,AnnotationEditorLayer,Gu).values());try{for(v.s();!(d=v.n()).done;){var _=d.value;p.remove("".concat(_._type,"Editing"))}}catch(t){v.e(t)}finally{v.f()}this.disableTextSelection();annotation_editor_layer_classPrivateFieldSet(this,ku,!1)}},{key:"getEditableAnnotation",value:function getEditableAnnotation(t){var r;return(null===(r=annotation_editor_layer_classPrivateFieldGet(this,fu))||void 0===r?void 0:r.getEditableAnnotation(t))||null}},{key:"setActiveEditor",value:function setActiveEditor(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).getActive()!==t&&annotation_editor_layer_classPrivateFieldGet(this,Fu).setActiveEditor(t)}},{key:"enableTextSelection",value:function enableTextSelection(){var t;if(null!==(t=annotation_editor_layer_classPrivateFieldGet(this,Su))&&void 0!==t&&t.div){document.addEventListener("selectstart",annotation_editor_layer_classPrivateFieldGet(this,mu));annotation_editor_layer_classPrivateFieldGet(this,Su).div.addEventListener("pointerdown",annotation_editor_layer_classPrivateFieldGet(this,yu));annotation_editor_layer_classPrivateFieldGet(this,Su).div.classList.add("highlighting")}}},{key:"disableTextSelection",value:function disableTextSelection(){var t;if(null!==(t=annotation_editor_layer_classPrivateFieldGet(this,Su))&&void 0!==t&&t.div){document.removeEventListener("selectstart",annotation_editor_layer_classPrivateFieldGet(this,mu));annotation_editor_layer_classPrivateFieldGet(this,Su).div.removeEventListener("pointerdown",annotation_editor_layer_classPrivateFieldGet(this,yu));annotation_editor_layer_classPrivateFieldGet(this,Su).div.classList.remove("highlighting")}}},{key:"enableClick",value:function enableClick(){this.div.addEventListener("pointerdown",annotation_editor_layer_classPrivateFieldGet(this,_u));this.div.addEventListener("pointerup",annotation_editor_layer_classPrivateFieldGet(this,pu))}},{key:"disableClick",value:function disableClick(){this.div.removeEventListener("pointerdown",annotation_editor_layer_classPrivateFieldGet(this,_u));this.div.removeEventListener("pointerup",annotation_editor_layer_classPrivateFieldGet(this,pu))}},{key:"attach",value:function attach(t){annotation_editor_layer_classPrivateFieldGet(this,bu).set(t.id,t);var r=t.annotationElementId;r&&annotation_editor_layer_classPrivateFieldGet(this,Fu).isDeletedAnnotationElement(r)&&annotation_editor_layer_classPrivateFieldGet(this,Fu).removeDeletedAnnotationElement(t)}},{key:"detach",value:function detach(t){var r;annotation_editor_layer_classPrivateFieldGet(this,bu).delete(t.id);null===(r=annotation_editor_layer_classPrivateFieldGet(this,hu))||void 0===r||r.removePointerInTextLayer(t.contentDiv);!annotation_editor_layer_classPrivateFieldGet(this,ku)&&t.annotationElementId&&annotation_editor_layer_classPrivateFieldGet(this,Fu).addDeletedAnnotationElement(t)}},{key:"remove",value:function remove(t){this.detach(t);annotation_editor_layer_classPrivateFieldGet(this,Fu).removeEditor(t);t.div.remove();t.isAttachedToDOM=!1;annotation_editor_layer_classPrivateFieldGet(this,Pu)||this.addInkEditorIfNeeded(!1)}},{key:"changeParent",value:function changeParent(t){var r;if(t.parent!==this){if(t.annotationElementId){annotation_editor_layer_classPrivateFieldGet(this,Fu).addDeletedAnnotationElement(t.annotationElementId);fn.deleteAnnotationElement(t);t.annotationElementId=null}this.attach(t);null===(r=t.parent)||void 0===r||r.detach(t);t.setParent(this);if(t.div&&t.isAttachedToDOM){t.div.remove();this.div.append(t.div)}}}},{key:"add",value:function add(t){this.changeParent(t);annotation_editor_layer_classPrivateFieldGet(this,Fu).addEditor(t);this.attach(t);if(!t.isAttachedToDOM){var r=t.render();this.div.append(r);t.isAttachedToDOM=!0}t.fixAndSetPosition();t.onceAdded();annotation_editor_layer_classPrivateFieldGet(this,Fu).addToAnnotationStorage(t)}},{key:"moveEditorInDOM",value:function moveEditorInDOM(t){var r,a=this;if(t.isAttachedToDOM){var i=document.activeElement;if(t.div.contains(i)&&!annotation_editor_layer_classPrivateFieldGet(this,gu)){t._focusEventsAllowed=!1;annotation_editor_layer_classPrivateFieldSet(this,gu,setTimeout((function(){annotation_editor_layer_classPrivateFieldSet(a,gu,null);if(t.div.contains(document.activeElement))t._focusEventsAllowed=!0;else{t.div.addEventListener("focusin",(function(){t._focusEventsAllowed=!0}),{once:!0});i.focus()}}),0))}t._structTreeParentId=null===(r=annotation_editor_layer_classPrivateFieldGet(this,hu))||void 0===r?void 0:r.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}}},{key:"addOrRebuild",value:function addOrRebuild(t){if(t.needsToBeRebuilt()){t.parent||(t.parent=this);t.rebuild()}else this.add(t)}},{key:"addUndoableEditor",value:function addUndoableEditor(t){this.addCommands({cmd:function cmd(){return t._uiManager.rebuild(t)},undo:function undo(){t.remove()},mustExec:!1})}},{key:"getNextId",value:function getNextId(){return annotation_editor_layer_classPrivateFieldGet(this,Fu).getId()}},{key:"canCreateNewEmptyEditor",value:function canCreateNewEmptyEditor(){var t;return null===(t=annotation_editor_layer_classPrivateFieldGet(this,xu))||void 0===t?void 0:t.canCreateNewEmptyEditor()}},{key:"pasteEditor",value:function pasteEditor(t,r){annotation_editor_layer_classPrivateFieldGet(this,Fu).updateToolbar(t);annotation_editor_layer_classPrivateFieldGet(this,Fu).updateMode(t);var a=annotation_editor_layer_classPrivateMethodGet(this,Iu,_getCenterPoint2).call(this),i=a.offsetX,o=a.offsetY,l=this.getNextId(),c=annotation_editor_layer_classPrivateMethodGet(this,Eu,_createNewEditor2).call(this,annotation_editor_layer_objectSpread({parent:this,id:l,x:i,y:o,uiManager:annotation_editor_layer_classPrivateFieldGet(this,Fu),isCentered:!0},r));c&&this.add(c)}},{key:"deserialize",value:function deserialize(t){var r,a;return(null===(r=annotation_editor_layer_classStaticPrivateFieldSpecGet(AnnotationEditorLayer,AnnotationEditorLayer,Gu).get(null!==(a=t.annotationType)&&void 0!==a?a:t.annotationEditorType))||void 0===r?void 0:r.deserialize(t,this,annotation_editor_layer_classPrivateFieldGet(this,Fu)))||null}},{key:"createAndAddNewEditor",value:function createAndAddNewEditor(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.getNextId(),o=annotation_editor_layer_classPrivateMethodGet(this,Eu,_createNewEditor2).call(this,annotation_editor_layer_objectSpread({parent:this,id:i,x:t.offsetX,y:t.offsetY,uiManager:annotation_editor_layer_classPrivateFieldGet(this,Fu),isCentered:r},a));o&&this.add(o);return o}},{key:"addNewEditor",value:function addNewEditor(){this.createAndAddNewEditor(annotation_editor_layer_classPrivateMethodGet(this,Iu,_getCenterPoint2).call(this),!0)}},{key:"setSelected",value:function setSelected(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).setSelected(t)}},{key:"toggleSelected",value:function toggleSelected(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).toggleSelected(t)}},{key:"isSelected",value:function isSelected(t){return annotation_editor_layer_classPrivateFieldGet(this,Fu).isSelected(t)}},{key:"unselect",value:function unselect(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).unselect(t)}},{key:"selectionStart",value:function selectionStart(t){var r=this;if(annotation_editor_layer_classPrivateFieldGet(this,Su)&&t.target.parentElement.closest(".textLayer")===annotation_editor_layer_classPrivateFieldGet(this,Su).div)if(annotation_editor_layer_classPrivateFieldGet(this,Fu).isShiftKeyDown){var a=function keyup(){if(!annotation_editor_layer_classPrivateFieldGet(r,Fu).isShiftKeyDown){window.removeEventListener("keyup",keyup);window.removeEventListener("blur",keyup);r.pointerUpAfterSelection({})}};window.addEventListener("keyup",a);window.addEventListener("blur",a)}else annotation_editor_layer_classPrivateFieldGet(this,Su).div.addEventListener("pointerup",annotation_editor_layer_classPrivateFieldGet(this,vu),{once:!0})}},{key:"pointerUpAfterSelection",value:function pointerUpAfterSelection(t){var r,a=document.getSelection();if(0!==a.rangeCount){var i=a.getRangeAt(0);if(!i.collapsed&&null!==(r=annotation_editor_layer_classPrivateFieldGet(this,Su))&&void 0!==r&&r.div.contains(i.commonAncestorContainer)){var o,l=annotation_editor_layer_classPrivateFieldGet(this,Su).div.getBoundingClientRect(),c=l.x,u=l.y,h=l.width,d=l.height,p=i.getClientRects();switch(this.viewport.rotation){case 90:o=function rotator(t,r,a,i){return{x:(r-u)/d,y:1-(t+a-c)/h,width:i/d,height:a/h}};break;case 180:o=function rotator(t,r,a,i){return{x:1-(t+a-c)/h,y:1-(r+i-u)/d,width:a/h,height:i/d}};break;case 270:o=function rotator(t,r,a,i){return{x:1-(r+i-u)/d,y:(t-c)/h,width:i/d,height:a/h}};break;default:o=function rotator(t,r,a,i){return{x:(t-c)/h,y:(r-u)/d,width:a/h,height:i/d}}}var v,_=[],y=annotation_editor_layer_createForOfIteratorHelper(p);try{for(y.s();!(v=y.n()).done;){var g=v.value,m=g.x,b=g.y,w=g.width,P=g.height;0!==w&&0!==P&&_.push(o(m,b,w,P))}}catch(t){y.e(t)}finally{y.f()}0!==_.length&&this.createAndAddNewEditor(t,!1,{boxes:_});a.empty()}}}},{key:"pointerup",value:function pointerup(t){var r=he.platform.isMac;if(!(0!==t.button||t.ctrlKey&&r)&&t.target===this.div&&annotation_editor_layer_classPrivateFieldGet(this,wu)){annotation_editor_layer_classPrivateFieldSet(this,wu,!1);annotation_editor_layer_classPrivateFieldGet(this,du)?annotation_editor_layer_classPrivateFieldGet(this,Fu).getMode()!==g.STAMP?this.createAndAddNewEditor(t,!1):annotation_editor_layer_classPrivateFieldGet(this,Fu).unselectAll():annotation_editor_layer_classPrivateFieldSet(this,du,!0)}}},{key:"pointerdown",value:function pointerdown(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).getMode()===g.HIGHLIGHT&&this.enableTextSelection();if(annotation_editor_layer_classPrivateFieldGet(this,wu))annotation_editor_layer_classPrivateFieldSet(this,wu,!1);else{var r=he.platform.isMac;if(!(0!==t.button||t.ctrlKey&&r)&&t.target===this.div){annotation_editor_layer_classPrivateFieldSet(this,wu,!0);var a=annotation_editor_layer_classPrivateFieldGet(this,Fu).getActive();annotation_editor_layer_classPrivateFieldSet(this,du,!a||a.isEmpty())}}}},{key:"findNewParent",value:function findNewParent(t,r,a){var i=annotation_editor_layer_classPrivateFieldGet(this,Fu).findParent(r,a);if(null===i||i===this)return!1;i.changeParent(t);return!0}},{key:"destroy",value:function destroy(){var t;if((null===(t=annotation_editor_layer_classPrivateFieldGet(this,Fu).getActive())||void 0===t?void 0:t.parent)===this){annotation_editor_layer_classPrivateFieldGet(this,Fu).commitOrRemove();annotation_editor_layer_classPrivateFieldGet(this,Fu).setActiveEditor(null)}if(annotation_editor_layer_classPrivateFieldGet(this,gu)){clearTimeout(annotation_editor_layer_classPrivateFieldGet(this,gu));annotation_editor_layer_classPrivateFieldSet(this,gu,null)}var r,a=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(a.s();!(r=a.n()).done;){var i,o=r.value;null===(i=annotation_editor_layer_classPrivateFieldGet(this,hu))||void 0===i||i.removePointerInTextLayer(o.contentDiv);o.setParent(null);o.isAttachedToDOM=!1;o.div.remove()}}catch(t){a.e(t)}finally{a.f()}this.div=null;annotation_editor_layer_classPrivateFieldGet(this,bu).clear();annotation_editor_layer_classPrivateFieldGet(this,Fu).removeLayer(this)}},{key:"render",value:function render(t){var r=t.viewport;this.viewport=r;setLayerDimensions(this.div,r);var a,i=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,Fu).getEditors(this.pageIndex));try{for(i.s();!(a=i.n()).done;){var o=a.value;this.add(o)}}catch(t){i.e(t)}finally{i.f()}this.updateMode()}},{key:"update",value:function update(t){var r=t.viewport;annotation_editor_layer_classPrivateFieldGet(this,Fu).commitOrRemove();var a=this.viewport.rotation,i=r.rotation;this.viewport=r;setLayerDimensions(this.div,{rotation:i});if(a!==i){var o,l=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(l.s();!(o=l.n()).done;){o.value.rotate(i)}}catch(t){l.e(t)}finally{l.f()}}this.updateMode()}},{key:"pageDimensions",get:function get(){var t=this.viewport.rawDims;return[t.pageWidth,t.pageHeight]}},{key:"scale",get:function get(){return annotation_editor_layer_classPrivateFieldGet(this,Fu).viewParameters.realScale}},{key:"setCleaningUp",value:function setCleaningUp(t){annotation_editor_layer_classPrivateFieldSet(this,Pu,t)}}]);return AnnotationEditorLayer}();zc=Cu;function _textLayerPointerDown2(t){var r=this;annotation_editor_layer_classPrivateFieldGet(this,Fu).unselectAll();if(t.target===annotation_editor_layer_classPrivateFieldGet(this,Su).div){var a=he.platform.isMac;if(0!==t.button||t.ctrlKey&&a)return;annotation_editor_layer_classPrivateFieldGet(this,Su).div.classList.add("free");rc.startHighlighting(this,"ltr"===annotation_editor_layer_classPrivateFieldGet(this,Fu).direction,t);annotation_editor_layer_classPrivateFieldGet(this,Su).div.addEventListener("pointerup",(function(){annotation_editor_layer_classPrivateFieldGet(r,Su).div.classList.remove("free")}),{once:!0});t.preventDefault()}}function _get_currentEditorType(){return annotation_editor_layer_classStaticPrivateFieldSpecGet(zc,zc,Gu).get(annotation_editor_layer_classPrivateFieldGet(this,Fu).getMode())}function _createNewEditor2(t){var r=annotation_editor_layer_classPrivateFieldGet(this,xu);return r?new r.prototype.constructor(t):null}function _getCenterPoint2(){var t=this.div.getBoundingClientRect(),r=t.x,a=t.y,i=t.width,o=t.height,l=Math.max(0,r),c=Math.max(0,a),u=(l+Math.min(window.innerWidth,r+i))/2-r,h=(c+Math.min(window.innerHeight,a+o))/2-a,d=annotation_editor_layer_slicedToArray(this.viewport.rotation%180==0?[u,h]:[h,u],2);return{offsetX:d[0],offsetY:d[1]}}function _cleanup2(){annotation_editor_layer_classPrivateFieldSet(this,Pu,!0);var t,r=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(r.s();!(t=r.n()).done;){var a=t.value;a.isEmpty()&&a.remove()}}catch(t){r.e(t)}finally{r.f()}annotation_editor_layer_classPrivateFieldSet(this,Pu,!1)}annotation_editor_layer_defineProperty(Cu,"_initialized",!1);var Mu,Gu={writable:!0,value:new Map([Ss,Bc,uu,rc].map((function(t){return[t._editorType,t]})))};function draw_layer_typeof(t){return draw_layer_typeof="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},draw_layer_typeof(t)}function draw_layer_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function draw_layer_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return draw_layer_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return draw_layer_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function draw_layer_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function draw_layer_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,draw_layer_toPropertyKey(i.key),i)}}function draw_layer_toPropertyKey(t){var r=function draw_layer_toPrimitive(t,r){if("object"!=draw_layer_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=draw_layer_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==draw_layer_typeof(r)?r:String(r)}function draw_layer_classPrivateMethodInitSpec(t,r){draw_layer_checkPrivateRedeclaration(t,r);r.add(t)}function draw_layer_classPrivateFieldInitSpec(t,r,a){draw_layer_checkPrivateRedeclaration(t,r);r.set(t,a)}function draw_layer_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function draw_layer_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function draw_layer_classStaticPrivateMethodGet(t,r,a){!function draw_layer_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function draw_layer_classPrivateFieldSet(t,r,a){!function draw_layer_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,draw_layer_classExtractFieldDescriptor(t,r,"set"),a);return a}function draw_layer_classPrivateFieldGet(t,r){return function draw_layer_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,draw_layer_classExtractFieldDescriptor(t,r,"get"))}function draw_layer_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var Ou=new WeakMap,Ru=new WeakMap,Lu=new WeakMap,Du=new WeakMap,ju=new WeakSet,Nu=new WeakSet,Wu=function(){function DrawLayer(t){var r=t.pageIndex;!function draw_layer_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,DrawLayer);draw_layer_classPrivateMethodInitSpec(this,Nu);draw_layer_classPrivateMethodInitSpec(this,ju);draw_layer_classPrivateFieldInitSpec(this,Ou,{writable:!0,value:null});draw_layer_classPrivateFieldInitSpec(this,Ru,{writable:!0,value:0});draw_layer_classPrivateFieldInitSpec(this,Lu,{writable:!0,value:new Map});draw_layer_classPrivateFieldInitSpec(this,Du,{writable:!0,value:new Map});this.pageIndex=r}!function draw_layer_createClass(t,r,a){r&&draw_layer_defineProperties(t.prototype,r);a&&draw_layer_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(DrawLayer,[{key:"setParent",value:function setParent(t){if(draw_layer_classPrivateFieldGet(this,Ou)){if(draw_layer_classPrivateFieldGet(this,Ou)!==t){if(draw_layer_classPrivateFieldGet(this,Lu).size>0){var r,a=draw_layer_createForOfIteratorHelper(draw_layer_classPrivateFieldGet(this,Lu).values());try{for(a.s();!(r=a.n()).done;){var i=r.value;i.remove();t.append(i)}}catch(t){a.e(t)}finally{a.f()}}draw_layer_classPrivateFieldSet(this,Ou,t)}}else draw_layer_classPrivateFieldSet(this,Ou,t)}},{key:"highlight",value:function highlight(t,r,a){var i,o,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=(draw_layer_classPrivateFieldSet(this,Ru,(i=draw_layer_classPrivateFieldGet(this,Ru),o=i++,i)),o),u=draw_layer_classPrivateMethodGet(this,ju,_createSVG2).call(this,t.box);u.classList.add("highlight");t.free&&u.classList.add("free");var h=DrawLayer._svgFactory.createElement("defs");u.append(h);var d=DrawLayer._svgFactory.createElement("path");h.append(d);var p="path_p".concat(this.pageIndex,"_").concat(c);d.setAttribute("id",p);d.setAttribute("d",t.toSVGPath());l&&draw_layer_classPrivateFieldGet(this,Du).set(c,d);var v=draw_layer_classPrivateMethodGet(this,Nu,_createClipPath2).call(this,h,p),_=DrawLayer._svgFactory.createElement("use");u.append(_);u.setAttribute("fill",r);u.setAttribute("fill-opacity",a);_.setAttribute("href","#".concat(p));draw_layer_classPrivateFieldGet(this,Lu).set(c,u);return{id:c,clipPathId:"url(#".concat(v,")")}}},{key:"highlightOutline",value:function highlightOutline(t){var r,a,i=(draw_layer_classPrivateFieldSet(this,Ru,(r=draw_layer_classPrivateFieldGet(this,Ru),a=r++,r)),a),o=draw_layer_classPrivateMethodGet(this,ju,_createSVG2).call(this,t.box);o.classList.add("highlightOutline");var l=DrawLayer._svgFactory.createElement("defs");o.append(l);var c=DrawLayer._svgFactory.createElement("path");l.append(c);var u,h="path_p".concat(this.pageIndex,"_").concat(i);c.setAttribute("id",h);c.setAttribute("d",t.toSVGPath());c.setAttribute("vector-effect","non-scaling-stroke");if(t.free){o.classList.add("free");var d=DrawLayer._svgFactory.createElement("mask");l.append(d);u="mask_p".concat(this.pageIndex,"_").concat(i);d.setAttribute("id",u);d.setAttribute("maskUnits","objectBoundingBox");var p=DrawLayer._svgFactory.createElement("rect");d.append(p);p.setAttribute("width","1");p.setAttribute("height","1");p.setAttribute("fill","white");var v=DrawLayer._svgFactory.createElement("use");d.append(v);v.setAttribute("href","#".concat(h));v.setAttribute("stroke","none");v.setAttribute("fill","black");v.setAttribute("fill-rule","nonzero");v.classList.add("mask")}var _=DrawLayer._svgFactory.createElement("use");o.append(_);_.setAttribute("href","#".concat(h));u&&_.setAttribute("mask","url(#".concat(u,")"));var y=_.cloneNode();o.append(y);_.classList.add("mainOutline");y.classList.add("secondaryOutline");draw_layer_classPrivateFieldGet(this,Lu).set(i,o);return i}},{key:"finalizeLine",value:function finalizeLine(t,r){var a=draw_layer_classPrivateFieldGet(this,Du).get(t);draw_layer_classPrivateFieldGet(this,Du).delete(t);this.updateBox(t,r.box);a.setAttribute("d",r.toSVGPath())}},{key:"updateLine",value:function updateLine(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).firstChild.firstChild.setAttribute("d",r.toSVGPath())}},{key:"removeFreeHighlight",value:function removeFreeHighlight(t){this.remove(t);draw_layer_classPrivateFieldGet(this,Du).delete(t)}},{key:"updatePath",value:function updatePath(t,r){draw_layer_classPrivateFieldGet(this,Du).get(t).setAttribute("d",r.toSVGPath())}},{key:"updateBox",value:function updateBox(t,r){draw_layer_classStaticPrivateMethodGet(DrawLayer,DrawLayer,_setBox).call(DrawLayer,draw_layer_classPrivateFieldGet(this,Lu).get(t),r)}},{key:"rotate",value:function rotate(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).setAttribute("data-main-rotation",r)}},{key:"changeColor",value:function changeColor(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).setAttribute("fill",r)}},{key:"changeOpacity",value:function changeOpacity(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).setAttribute("fill-opacity",r)}},{key:"addClass",value:function addClass(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).classList.add(r)}},{key:"removeClass",value:function removeClass(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).classList.remove(r)}},{key:"remove",value:function remove(t){if(null!==draw_layer_classPrivateFieldGet(this,Ou)){draw_layer_classPrivateFieldGet(this,Lu).get(t).remove();draw_layer_classPrivateFieldGet(this,Lu).delete(t)}}},{key:"destroy",value:function destroy(){draw_layer_classPrivateFieldSet(this,Ou,null);var t,r=draw_layer_createForOfIteratorHelper(draw_layer_classPrivateFieldGet(this,Lu).values());try{for(r.s();!(t=r.n()).done;){t.value.remove()}}catch(t){r.e(t)}finally{r.f()}draw_layer_classPrivateFieldGet(this,Lu).clear()}}],[{key:"_svgFactory",get:function get(){return shadow(this,"_svgFactory",new qe)}}]);return DrawLayer}();Mu=Wu;function _setBox(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.x,i=void 0===a?0:a,o=r.y,l=void 0===o?0:o,c=r.width,u=void 0===c?1:c,h=r.height,d=void 0===h?1:h,p=t.style;p.top="".concat(100*l,"%");p.left="".concat(100*i,"%");p.width="".concat(100*u,"%");p.height="".concat(100*d,"%")}function _createSVG2(t){var r=Mu._svgFactory.create(1,1,!0);draw_layer_classPrivateFieldGet(this,Ou).append(r);draw_layer_classStaticPrivateMethodGet(Mu,Mu,_setBox).call(Mu,r,t);return r}function _createClipPath2(t,r){var a=Mu._svgFactory.createElement("clipPath");t.append(a);var i="clip_".concat(r);a.setAttribute("id",i);a.setAttribute("clipPathUnits","objectBoundingBox");var o=Mu._svgFactory.createElement("use");a.append(o);o.setAttribute("href","#".concat(r));o.classList.add("clip");return i}})();var i=a.AbortException,o=a.AnnotationEditorLayer,l=a.AnnotationEditorParamsType,c=a.AnnotationEditorType,u=a.AnnotationEditorUIManager,h=a.AnnotationLayer,d=a.AnnotationMode,p=a.CMapCompressionType,v=a.ColorPicker,_=a.DOMSVGFactory,y=a.DrawLayer,g=a.FeatureTest,m=a.GlobalWorkerOptions,b=a.ImageKind,w=a.InvalidPDFException,P=a.MissingPDFException,k=a.OPS,S=a.Outliner,A=a.PDFDataRangeTransport,x=a.PDFDateString,E=a.PDFWorker,I=a.PasswordResponses,T=a.PermissionFlag,C=a.PixelsPerInch,M=a.PromiseCapability,G=a.RenderingCancelledException,O=a.UnexpectedResponseException,R=a.Util,L=a.VerbosityLevel,D=a.XfaLayer,j=a.build,N=a.createValidAbsoluteUrl,W=a.fetchData,H=a.getDocument,B=a.getFilenameFromUrl,z=a.getPdfFilenameFromUrl,U=a.getXfaPageViewport,q=a.isDataScheme,V=a.isPdfFile,K=a.noContextMenu,Y=a.normalizeUnicode,X=a.renderTextLayer,$=a.setLayerDimensions,J=a.shadow,Q=a.updateTextLayer,Z=a.version;export{i as AbortException,o as AnnotationEditorLayer,l as AnnotationEditorParamsType,c as AnnotationEditorType,u as AnnotationEditorUIManager,h as AnnotationLayer,d as AnnotationMode,p as CMapCompressionType,v as ColorPicker,_ as DOMSVGFactory,y as DrawLayer,g as FeatureTest,m as GlobalWorkerOptions,b as ImageKind,w as InvalidPDFException,P as MissingPDFException,k as OPS,S as Outliner,A as PDFDataRangeTransport,x as PDFDateString,E as PDFWorker,I as PasswordResponses,T as PermissionFlag,C as PixelsPerInch,M as PromiseCapability,G as RenderingCancelledException,O as UnexpectedResponseException,R as Util,L as VerbosityLevel,D as XfaLayer,j as build,N as createValidAbsoluteUrl,W as fetchData,H as getDocument,B as getFilenameFromUrl,z as getPdfFilenameFromUrl,U as getXfaPageViewport,q as isDataScheme,V as isPdfFile,K as noContextMenu,Y as normalizeUnicode,X as renderTextLayer,$ as setLayerDimensions,J as shadow,Q as updateTextLayer,Z as version};
21
+ */var t={509:(t,r,a)=>{var i=a(9985),o=a(3691),l=TypeError;t.exports=function(t){if(i(t))return t;throw new l(o(t)+" is not a function")}},2655:(t,r,a)=>{var i=a(9429),o=a(3691),l=TypeError;t.exports=function(t){if(i(t))return t;throw new l(o(t)+" is not a constructor")}},3550:(t,r,a)=>{var i=a(598),o=String,l=TypeError;t.exports=function(t){if(i(t))return t;throw new l("Can't set "+o(t)+" as a prototype")}},29:(t,r,a)=>{var i=a(1034).has;t.exports=function(t){i(t);return t}},7370:(t,r,a)=>{var i=a(4201),o=a(5391),l=a(2560).f,c=i("unscopables"),u=Array.prototype;void 0===u[c]&&l(u,c,{configurable:!0,value:o(null)});t.exports=function(t){u[c][t]=!0}},1514:(t,r,a)=>{var i=a(730).charAt;t.exports=function(t,r,a){return r+(a?i(t,r).length:1)}},767:(t,r,a)=>{var i=a(3622),o=TypeError;t.exports=function(t,r){if(i(r,t))return t;throw new o("Incorrect invocation")}},5027:(t,r,a)=>{var i=a(8999),o=String,l=TypeError;t.exports=function(t){if(i(t))return t;throw new l(o(t)+" is not an object")}},7075:t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},3050:(t,r,a)=>{var i=a(2743),o=a(6648),l=TypeError;t.exports=i(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==o(t))throw new l("ArrayBuffer expected");return t.byteLength}},2961:(t,r,a)=>{var i=a(8844),o=a(3050),l=i(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==o(t))return!1;try{l(t,0,0);return!1}catch(t){return!0}}},1655:(t,r,a)=>{var i=a(3689);t.exports=i((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},9195:(t,r,a)=>{var i=a(9037),o=a(8844),l=a(2743),c=a(9842),u=a(2961),h=a(3050),d=a(1420),p=a(3514),v=i.structuredClone,_=i.ArrayBuffer,y=i.DataView,g=i.TypeError,m=Math.min,b=_.prototype,w=y.prototype,P=o(b.slice),k=l(b,"resizable","get"),S=l(b,"maxByteLength","get"),A=o(w.getInt8),x=o(w.setInt8);t.exports=(p||d)&&function(t,r,a){var i,o=h(t),l=void 0===r?o:c(r),b=!k||!k(t);if(u(t))throw new g("ArrayBuffer is detached");if(p){t=v(t,{transfer:[t]});if(o===l&&(a||b))return t}if(o>=l&&(!a||b))i=P(t,0,l);else{var w=a&&!b&&S?{maxByteLength:S(t)}:void 0;i=new _(l,w);for(var E=new y(t),I=new y(i),T=m(l,o),C=0;C<T;C++)x(I,C,A(E,C))}p||d(t);return i}},4872:(t,r,a)=>{var i,o,l,c=a(7075),u=a(7697),h=a(9037),d=a(9985),p=a(8999),v=a(6812),_=a(926),y=a(3691),g=a(5773),m=a(1880),b=a(2148),w=a(3622),P=a(1868),k=a(9385),S=a(4201),A=a(4630),x=a(618),E=x.enforce,I=x.get,T=h.Int8Array,C=T&&T.prototype,M=h.Uint8ClampedArray,G=M&&M.prototype,O=T&&P(T),R=C&&P(C),L=Object.prototype,D=h.TypeError,j=S("toStringTag"),N=A("TYPED_ARRAY_TAG"),W="TypedArrayConstructor",H=c&&!!k&&"Opera"!==_(h.opera),B=!1,z={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var r=P(t);if(p(r)){var a=I(r);return a&&v(a,W)?a[W]:getTypedArrayConstructor(r)}},isTypedArray=function(t){if(!p(t))return!1;var r=_(t);return v(z,r)||v(U,r)};for(i in z)(l=(o=h[i])&&o.prototype)?E(l)[W]=o:H=!1;for(i in U)(l=(o=h[i])&&o.prototype)&&(E(l)[W]=o);if(!H||!d(O)||O===Function.prototype){O=function TypedArray(){throw new D("Incorrect invocation")};if(H)for(i in z)h[i]&&k(h[i],O)}if(!H||!R||R===L){R=O.prototype;if(H)for(i in z)h[i]&&k(h[i].prototype,R)}H&&P(G)!==R&&k(G,R);if(u&&!v(R,j)){B=!0;b(R,j,{configurable:!0,get:function(){return p(this)?this[N]:void 0}});for(i in z)h[i]&&g(h[i],N,i)}t.exports={NATIVE_ARRAY_BUFFER_VIEWS:H,TYPED_ARRAY_TAG:B&&N,aTypedArray:function(t){if(isTypedArray(t))return t;throw new D("Target is not a typed array")},aTypedArrayConstructor:function(t){if(d(t)&&(!k||w(O,t)))return t;throw new D(y(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,r,a,i){if(u){if(a)for(var o in z){var l=h[o];if(l&&v(l.prototype,t))try{delete l.prototype[t]}catch(a){try{l.prototype[t]=r}catch(t){}}}R[t]&&!a||m(R,t,a?r:H&&C[t]||r,i)}},exportTypedArrayStaticMethod:function(t,r,a){var i,o;if(u){if(k){if(a)for(i in z)if((o=h[i])&&v(o,t))try{delete o[t]}catch(t){}if(O[t]&&!a)return;try{return m(O,t,a?r:H&&O[t]||r)}catch(t){}}for(i in z)!(o=h[i])||o[t]&&!a||m(o,t,r)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(t){if(!p(t))return!1;var r=_(t);return"DataView"===r||v(z,r)||v(U,r)},isTypedArray:isTypedArray,TypedArray:O,TypedArrayPrototype:R}},3999:(t,r,a)=>{var i=a(9037),o=a(8844),l=a(7697),c=a(7075),u=a(1236),h=a(5773),d=a(2148),p=a(6045),v=a(3689),_=a(767),y=a(8700),g=a(3126),m=a(9842),b=a(7788),w=a(5477),P=a(1868),k=a(9385),S=a(2872),A=a(6004),x=a(3457),E=a(8758),I=a(5997),T=a(618),C=u.PROPER,M=u.CONFIGURABLE,G="ArrayBuffer",O="DataView",R="prototype",L="Wrong index",D=T.getterFor(G),j=T.getterFor(O),N=T.set,W=i[G],H=W,B=H&&H[R],z=i[O],U=z&&z[R],q=Object.prototype,V=i.Array,K=i.RangeError,Y=o(S),X=o([].reverse),$=w.pack,J=w.unpack,packInt8=function(t){return[255&t]},packInt16=function(t){return[255&t,t>>8&255]},packInt32=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},unpackInt32=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},packFloat32=function(t){return $(b(t),23,4)},packFloat64=function(t){return $(t,52,8)},addGetter=function(t,r,a){d(t[R],r,{configurable:!0,get:function(){return a(this)[r]}})},get=function(t,r,a,i){var o=j(t),l=m(a),c=!!i;if(l+r>o.byteLength)throw new K(L);var u=o.bytes,h=l+o.byteOffset,d=A(u,h,h+r);return c?d:X(d)},set=function(t,r,a,i,o,l){var c=j(t),u=m(a),h=i(+o),d=!!l;if(u+r>c.byteLength)throw new K(L);for(var p=c.bytes,v=u+c.byteOffset,_=0;_<r;_++)p[v+_]=h[d?_:r-_-1]};if(c){var Q=C&&W.name!==G;if(v((function(){W(1)}))&&v((function(){new W(-1)}))&&!v((function(){new W;new W(1.5);new W(NaN);return 1!==W.length||Q&&!M})))Q&&M&&h(W,"name",G);else{(H=function ArrayBuffer(t){_(this,B);return x(new W(m(t)),this,H)})[R]=B;B.constructor=H;E(H,W)}k&&P(U)!==q&&k(U,q);var Z=new z(new H(2)),ee=o(U.setInt8);Z.setInt8(0,2147483648);Z.setInt8(1,2147483649);!Z.getInt8(0)&&Z.getInt8(1)||p(U,{setInt8:function setInt8(t,r){ee(this,t,r<<24>>24)},setUint8:function setUint8(t,r){ee(this,t,r<<24>>24)}},{unsafe:!0})}else{B=(H=function ArrayBuffer(t){_(this,B);var r=m(t);N(this,{type:G,bytes:Y(V(r),0),byteLength:r});if(!l){this.byteLength=r;this.detached=!1}})[R];U=(z=function DataView(t,r,a){_(this,U);_(t,B);var i=D(t),o=i.byteLength,c=y(r);if(c<0||c>o)throw new K("Wrong offset");if(c+(a=void 0===a?o-c:g(a))>o)throw new K("Wrong length");N(this,{type:O,buffer:t,byteLength:a,byteOffset:c,bytes:i.bytes});if(!l){this.buffer=t;this.byteLength=a;this.byteOffset=c}})[R];if(l){addGetter(H,"byteLength",D);addGetter(z,"buffer",j);addGetter(z,"byteLength",j);addGetter(z,"byteOffset",j)}p(U,{getInt8:function getInt8(t){return get(this,1,t)[0]<<24>>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var r=get(this,2,t,arguments.length>1&&arguments[1]);return(r[1]<<8|r[0])<<16>>16},getUint16:function getUint16(t){var r=get(this,2,t,arguments.length>1&&arguments[1]);return r[1]<<8|r[0]},getInt32:function getInt32(t){return unpackInt32(get(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function getUint32(t){return unpackInt32(get(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function getFloat32(t){return J(get(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function getFloat64(t){return J(get(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function setInt8(t,r){set(this,1,t,packInt8,r)},setUint8:function setUint8(t,r){set(this,1,t,packInt8,r)},setInt16:function setInt16(t,r){set(this,2,t,packInt16,r,arguments.length>2&&arguments[2])},setUint16:function setUint16(t,r){set(this,2,t,packInt16,r,arguments.length>2&&arguments[2])},setInt32:function setInt32(t,r){set(this,4,t,packInt32,r,arguments.length>2&&arguments[2])},setUint32:function setUint32(t,r){set(this,4,t,packInt32,r,arguments.length>2&&arguments[2])},setFloat32:function setFloat32(t,r){set(this,4,t,packFloat32,r,arguments.length>2&&arguments[2])},setFloat64:function setFloat64(t,r){set(this,8,t,packFloat64,r,arguments.length>2&&arguments[2])}})}I(H,G);I(z,O);t.exports={ArrayBuffer:H,DataView:z}},357:(t,r,a)=>{var i=a(690),o=a(7578),l=a(6310),c=a(8494),u=Math.min;t.exports=[].copyWithin||function copyWithin(t,r){var a=i(this),h=l(a),d=o(t,h),p=o(r,h),v=arguments.length>2?arguments[2]:void 0,_=u((void 0===v?h:o(v,h))-p,h-d),y=1;if(p<d&&d<p+_){y=-1;p+=_-1;d+=_-1}for(;_-- >0;){p in a?a[d]=a[p]:c(a,d);d+=y;p+=y}return a}},2872:(t,r,a)=>{var i=a(690),o=a(7578),l=a(6310);t.exports=function fill(t){for(var r=i(this),a=l(r),c=arguments.length,u=o(c>1?arguments[1]:void 0,a),h=c>2?arguments[2]:void 0,d=void 0===h?a:o(h,a);d>u;)r[u++]=t;return r}},7612:(t,r,a)=>{var i=a(2960).forEach,o=a(6834)("forEach");t.exports=o?[].forEach:function forEach(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}},9976:(t,r,a)=>{var i=a(6310);t.exports=function(t,r,a){for(var o=0,l=arguments.length>2?a:i(r),c=new t(l);l>o;)c[o]=r[o++];return c}},1055:(t,r,a)=>{var i=a(4071),o=a(2615),l=a(690),c=a(1228),u=a(3292),h=a(9429),d=a(6310),p=a(6522),v=a(5185),_=a(1664),y=Array;t.exports=function from(t){var r=l(t),a=h(this),g=arguments.length,m=g>1?arguments[1]:void 0,b=void 0!==m;b&&(m=i(m,g>2?arguments[2]:void 0));var w,P,k,S,A,x,E=_(r),I=0;if(!E||this===y&&u(E)){w=d(r);P=a?new this(w):y(w);for(;w>I;I++){x=b?m(r[I],I):r[I];p(P,I,x)}}else{A=(S=v(r,E)).next;P=a?new this:[];for(;!(k=o(A,S)).done;I++){x=b?c(S,m,[k.value,I],!0):k.value;p(P,I,x)}}P.length=I;return P}},4328:(t,r,a)=>{var i=a(5290),o=a(7578),l=a(6310),createMethod=function(t){return function(r,a,c){var u,h=i(r),d=l(h),p=o(c,d);if(t&&a!=a){for(;d>p;)if((u=h[p++])!=u)return!0}else for(;d>p;p++)if((t||p in h)&&h[p]===a)return t||p||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},1969:(t,r,a)=>{var i=a(4071),o=a(4413),l=a(690),c=a(6310),createMethod=function(t){var r=1===t;return function(a,u,h){for(var d,p=l(a),v=o(p),_=c(v),y=i(u,h);_-- >0;)if(y(d=v[_],_,p))switch(t){case 0:return d;case 1:return _}return r?-1:void 0}};t.exports={findLast:createMethod(0),findLastIndex:createMethod(1)}},2960:(t,r,a)=>{var i=a(4071),o=a(8844),l=a(4413),c=a(690),u=a(6310),h=a(7120),d=o([].push),createMethod=function(t){var r=1===t,a=2===t,o=3===t,p=4===t,v=6===t,_=7===t,y=5===t||v;return function(g,m,b,w){for(var P,k,S=c(g),A=l(S),x=u(A),E=i(m,b),I=0,T=w||h,C=r?T(g,x):a||_?T(g,0):void 0;x>I;I++)if(y||I in A){k=E(P=A[I],I,S);if(t)if(r)C[I]=k;else if(k)switch(t){case 3:return!0;case 5:return P;case 6:return I;case 2:d(C,P)}else switch(t){case 4:return!1;case 7:d(C,P)}}return v?-1:o||p?p:C}};t.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6),filterReject:createMethod(7)}},953:(t,r,a)=>{var i=a(1735),o=a(5290),l=a(8700),c=a(6310),u=a(6834),h=Math.min,d=[].lastIndexOf,p=!!d&&1/[1].lastIndexOf(1,-0)<0,v=u("lastIndexOf"),_=p||!v;t.exports=_?function lastIndexOf(t){if(p)return i(d,this,arguments)||0;var r=o(this),a=c(r),u=a-1;arguments.length>1&&(u=h(u,l(arguments[1])));u<0&&(u=a+u);for(;u>=0;u--)if(u in r&&r[u]===t)return u||0;return-1}:d},9042:(t,r,a)=>{var i=a(3689),o=a(4201),l=a(3615),c=o("species");t.exports=function(t){return l>=51||!i((function(){var r=[];(r.constructor={})[c]=function(){return{foo:1}};return 1!==r[t](Boolean).foo}))}},6834:(t,r,a)=>{var i=a(3689);t.exports=function(t,r){var a=[][t];return!!a&&i((function(){a.call(null,r||function(){return 1},1)}))}},8820:(t,r,a)=>{var i=a(509),o=a(690),l=a(4413),c=a(6310),u=TypeError,createMethod=function(t){return function(r,a,h,d){var p=o(r),v=l(p),_=c(p);i(a);var y=t?_-1:0,g=t?-1:1;if(h<2)for(;;){if(y in v){d=v[y];y+=g;break}y+=g;if(t?y<0:_<=y)throw new u("Reduce of empty array with no initial value")}for(;t?y>=0:_>y;y+=g)y in v&&(d=a(d,v[y],y,p));return d}};t.exports={left:createMethod(!1),right:createMethod(!0)}},5649:(t,r,a)=>{var i=a(7697),o=a(2297),l=TypeError,c=Object.getOwnPropertyDescriptor,u=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=u?function(t,r){if(o(t)&&!c(t,"length").writable)throw new l("Cannot set read only .length");return t.length=r}:function(t,r){return t.length=r}},6004:(t,r,a)=>{var i=a(8844);t.exports=i([].slice)},382:(t,r,a)=>{var i=a(6004),o=Math.floor,sort=function(t,r){var a=t.length;if(a<8)for(var l,c,u=1;u<a;){c=u;l=t[u];for(;c&&r(t[c-1],l)>0;)t[c]=t[--c];c!==u++&&(t[c]=l)}else for(var h=o(a/2),d=sort(i(t,0,h),r),p=sort(i(t,h),r),v=d.length,_=p.length,y=0,g=0;y<v||g<_;)t[y+g]=y<v&&g<_?r(d[y],p[g])<=0?d[y++]:p[g++]:y<v?d[y++]:p[g++];return t};t.exports=sort},5271:(t,r,a)=>{var i=a(2297),o=a(9429),l=a(8999),c=a(4201)("species"),u=Array;t.exports=function(t){var r;if(i(t)){r=t.constructor;(o(r)&&(r===u||i(r.prototype))||l(r)&&null===(r=r[c]))&&(r=void 0)}return void 0===r?u:r}},7120:(t,r,a)=>{var i=a(5271);t.exports=function(t,r){return new(i(t))(0===r?0:r)}},6166:(t,r,a)=>{var i=a(6310);t.exports=function(t,r){for(var a=i(t),o=new r(a),l=0;l<a;l++)o[l]=t[a-l-1];return o}},6134:(t,r,a)=>{var i=a(6310),o=a(8700),l=RangeError;t.exports=function(t,r,a,c){var u=i(t),h=o(a),d=h<0?u+h:h;if(d>=u||d<0)throw new l("Incorrect index");for(var p=new r(u),v=0;v<u;v++)p[v]=v===d?c:t[v];return p}},1228:(t,r,a)=>{var i=a(5027),o=a(2125);t.exports=function(t,r,a,l){try{return l?r(i(a)[0],a[1]):r(a)}catch(r){o(t,"throw",r)}}},6431:(t,r,a)=>{var i=a(4201)("iterator"),o=!1;try{var l=0,c={next:function(){return{done:!!l++}},return:function(){o=!0}};c[i]=function(){return this};Array.from(c,(function(){throw 2}))}catch(t){}t.exports=function(t,r){try{if(!r&&!o)return!1}catch(t){return!1}var a=!1;try{var l={};l[i]=function(){return{next:function(){return{done:a=!0}}}};t(l)}catch(t){}return a}},6648:(t,r,a)=>{var i=a(8844),o=i({}.toString),l=i("".slice);t.exports=function(t){return l(o(t),8,-1)}},926:(t,r,a)=>{var i=a(3043),o=a(9985),l=a(6648),c=a(4201)("toStringTag"),u=Object,h="Arguments"===l(function(){return arguments}());t.exports=i?l:function(t){var r,a,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(a=function(t,r){try{return t[r]}catch(t){}}(r=u(t),c))?a:h?l(r):"Object"===(i=l(r))&&o(r.callee)?"Arguments":i}},800:(t,r,a)=>{var i=a(5391),o=a(2148),l=a(6045),c=a(4071),u=a(767),h=a(981),d=a(8734),p=a(1934),v=a(7807),_=a(4241),y=a(7697),g=a(5375).fastKey,m=a(618),b=m.set,w=m.getterFor;t.exports={getConstructor:function(t,r,a,p){var v=t((function(t,o){u(t,_);b(t,{type:r,index:i(null),first:void 0,last:void 0,size:0});y||(t.size=0);h(o)||d(o,t[p],{that:t,AS_ENTRIES:a})})),_=v.prototype,m=w(r),define=function(t,r,a){var i,o,l=m(t),c=getEntry(t,r);if(c)c.value=a;else{l.last=c={index:o=g(r,!0),key:r,value:a,previous:i=l.last,next:void 0,removed:!1};l.first||(l.first=c);i&&(i.next=c);y?l.size++:t.size++;"F"!==o&&(l.index[o]=c)}return t},getEntry=function(t,r){var a,i=m(t),o=g(r);if("F"!==o)return i.index[o];for(a=i.first;a;a=a.next)if(a.key===r)return a};l(_,{clear:function clear(){for(var t=m(this),r=t.first;r;){r.removed=!0;r.previous&&(r.previous=r.previous.next=void 0);r=r.next}t.first=t.last=void 0;t.index=i(null);y?t.size=0:this.size=0},delete:function(t){var r=this,a=m(r),i=getEntry(r,t);if(i){var o=i.next,l=i.previous;delete a.index[i.index];i.removed=!0;l&&(l.next=o);o&&(o.previous=l);a.first===i&&(a.first=o);a.last===i&&(a.last=l);y?a.size--:r.size--}return!!i},forEach:function forEach(t){for(var r,a=m(this),i=c(t,arguments.length>1?arguments[1]:void 0);r=r?r.next:a.first;){i(r.value,r.key,this);for(;r&&r.removed;)r=r.previous}},has:function has(t){return!!getEntry(this,t)}});l(_,a?{get:function get(t){var r=getEntry(this,t);return r&&r.value},set:function set(t,r){return define(this,0===t?0:t,r)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}});y&&o(_,"size",{configurable:!0,get:function(){return m(this).size}});return v},setStrong:function(t,r,a){var i=r+" Iterator",o=w(r),l=w(i);p(t,r,(function(t,r){b(this,{type:i,target:t,state:o(t),kind:r,last:void 0})}),(function(){for(var t=l(this),r=t.kind,a=t.last;a&&a.removed;)a=a.previous;if(!t.target||!(t.last=a=a?a.next:t.state.first)){t.target=void 0;return v(void 0,!0)}return v("keys"===r?a.key:"values"===r?a.value:[a.key,a.value],!1)}),a?"entries":"values",!a,!0);_(r)}}},637:(t,r,a)=>{var i=a(8844),o=a(6045),l=a(5375).getWeakData,c=a(767),u=a(5027),h=a(981),d=a(8999),p=a(8734),v=a(2960),_=a(6812),y=a(618),g=y.set,m=y.getterFor,b=v.find,w=v.findIndex,P=i([].splice),k=0,uncaughtFrozenStore=function(t){return t.frozen||(t.frozen=new UncaughtFrozenStore)},UncaughtFrozenStore=function(){this.entries=[]},findUncaughtFrozen=function(t,r){return b(t.entries,(function(t){return t[0]===r}))};UncaughtFrozenStore.prototype={get:function(t){var r=findUncaughtFrozen(this,t);if(r)return r[1]},has:function(t){return!!findUncaughtFrozen(this,t)},set:function(t,r){var a=findUncaughtFrozen(this,t);a?a[1]=r:this.entries.push([t,r])},delete:function(t){var r=w(this.entries,(function(r){return r[0]===t}));~r&&P(this.entries,r,1);return!!~r}};t.exports={getConstructor:function(t,r,a,i){var v=t((function(t,o){c(t,y);g(t,{type:r,id:k++,frozen:void 0});h(o)||p(o,t[i],{that:t,AS_ENTRIES:a})})),y=v.prototype,b=m(r),define=function(t,r,a){var i=b(t),o=l(u(r),!0);!0===o?uncaughtFrozenStore(i).set(r,a):o[i.id]=a;return t};o(y,{delete:function(t){var r=b(this);if(!d(t))return!1;var a=l(t);return!0===a?uncaughtFrozenStore(r).delete(t):a&&_(a,r.id)&&delete a[r.id]},has:function has(t){var r=b(this);if(!d(t))return!1;var a=l(t);return!0===a?uncaughtFrozenStore(r).has(t):a&&_(a,r.id)}});o(y,a?{get:function get(t){var r=b(this);if(d(t)){var a=l(t);return!0===a?uncaughtFrozenStore(r).get(t):a?a[r.id]:void 0}},set:function set(t,r){return define(this,t,r)}}:{add:function add(t){return define(this,t,!0)}});return v}}},319:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(8844),c=a(5266),u=a(1880),h=a(5375),d=a(8734),p=a(767),v=a(9985),_=a(981),y=a(8999),g=a(3689),m=a(6431),b=a(5997),w=a(3457);t.exports=function(t,r,a){var P=-1!==t.indexOf("Map"),k=-1!==t.indexOf("Weak"),S=P?"set":"add",A=o[t],x=A&&A.prototype,E=A,I={},fixMethod=function(t){var r=l(x[t]);u(x,t,"add"===t?function add(t){r(this,0===t?0:t);return this}:"delete"===t?function(t){return!(k&&!y(t))&&r(this,0===t?0:t)}:"get"===t?function get(t){return k&&!y(t)?void 0:r(this,0===t?0:t)}:"has"===t?function has(t){return!(k&&!y(t))&&r(this,0===t?0:t)}:function set(t,a){r(this,0===t?0:t,a);return this})};if(c(t,!v(A)||!(k||x.forEach&&!g((function(){(new A).entries().next()}))))){E=a.getConstructor(r,t,P,S);h.enable()}else if(c(t,!0)){var T=new E,C=T[S](k?{}:-0,1)!==T,M=g((function(){T.has(1)})),G=m((function(t){new A(t)})),O=!k&&g((function(){for(var t=new A,r=5;r--;)t[S](r,r);return!t.has(-0)}));if(!G){(E=r((function(t,r){p(t,x);var a=w(new A,t,E);_(r)||d(r,a[S],{that:a,AS_ENTRIES:P});return a}))).prototype=x;x.constructor=E}if(M||O){fixMethod("delete");fixMethod("has");P&&fixMethod("get")}(O||C)&&fixMethod(S);k&&x.clear&&delete x.clear}I[t]=E;i({global:!0,constructor:!0,forced:E!==A},I);b(E,t);k||a.setStrong(E,t,P);return E}},8758:(t,r,a)=>{var i=a(6812),o=a(9152),l=a(2474),c=a(2560);t.exports=function(t,r,a){for(var u=o(r),h=c.f,d=l.f,p=0;p<u.length;p++){var v=u[p];i(t,v)||a&&i(a,v)||h(t,v,d(r,v))}}},7413:(t,r,a)=>{var i=a(4201)("match");t.exports=function(t){var r=/./;try{"/./"[t](r)}catch(a){try{r[i]=!1;return"/./"[t](r)}catch(t){}}return!1}},1748:(t,r,a)=>{var i=a(3689);t.exports=!i((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},7807:t=>{t.exports=function(t,r){return{value:t,done:r}}},5773:(t,r,a)=>{var i=a(7697),o=a(2560),l=a(5684);t.exports=i?function(t,r,a){return o.f(t,r,l(1,a))}:function(t,r,a){t[r]=a;return t}},5684:t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},6522:(t,r,a)=>{var i=a(8360),o=a(2560),l=a(5684);t.exports=function(t,r,a){var c=i(r);c in t?o.f(t,c,l(0,a)):t[c]=a}},1797:(t,r,a)=>{var i=a(5027),o=a(5899),l=TypeError;t.exports=function(t){i(this);if("string"===t||"default"===t)t="string";else if("number"!==t)throw new l("Incorrect hint");return o(this,t)}},2148:(t,r,a)=>{var i=a(8702),o=a(2560);t.exports=function(t,r,a){a.get&&i(a.get,r,{getter:!0});a.set&&i(a.set,r,{setter:!0});return o.f(t,r,a)}},1880:(t,r,a)=>{var i=a(9985),o=a(2560),l=a(8702),c=a(5014);t.exports=function(t,r,a,u){u||(u={});var h=u.enumerable,d=void 0!==u.name?u.name:r;i(a)&&l(a,d,u);if(u.global)h?t[r]=a:c(r,a);else{try{u.unsafe?t[r]&&(h=!0):delete t[r]}catch(t){}h?t[r]=a:o.f(t,r,{value:a,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},6045:(t,r,a)=>{var i=a(1880);t.exports=function(t,r,a){for(var o in r)i(t,o,r[o],a);return t}},5014:(t,r,a)=>{var i=a(9037),o=Object.defineProperty;t.exports=function(t,r){try{o(i,t,{value:r,configurable:!0,writable:!0})}catch(a){i[t]=r}return r}},8494:(t,r,a)=>{var i=a(3691),o=TypeError;t.exports=function(t,r){if(!delete t[r])throw new o("Cannot delete property "+i(r)+" of "+i(t))}},7697:(t,r,a)=>{var i=a(3689);t.exports=!i((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},1420:(t,r,a)=>{var i,o,l,c,u=a(9037),h=a(1905),d=a(3514),p=u.structuredClone,v=u.ArrayBuffer,_=u.MessageChannel,y=!1;if(d)y=function(t){p(t,{transfer:[t]})};else if(v)try{_||(i=h("worker_threads"))&&(_=i.MessageChannel);if(_){o=new _;l=new v(2);c=function(t){o.port1.postMessage(null,[t])};if(2===l.byteLength){c(l);0===l.byteLength&&(y=c)}}}catch(t){}t.exports=y},6420:(t,r,a)=>{var i=a(9037),o=a(8999),l=i.document,c=o(l)&&o(l.createElement);t.exports=function(t){return c?l.createElement(t):{}}},5565:t=>{var r=TypeError;t.exports=function(t){if(t>9007199254740991)throw r("Maximum allowed index exceeded");return t}},7136:t=>{t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},6338:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},3265:(t,r,a)=>{var i=a(6420)("span").classList,o=i&&i.constructor&&i.constructor.prototype;t.exports=o===Object.prototype?void 0:o},7365:(t,r,a)=>{var i=a(71).match(/firefox\/(\d+)/i);t.exports=!!i&&+i[1]},2532:(t,r,a)=>{var i=a(8563),o=a(806);t.exports=!i&&!o&&"object"==typeof window&&"object"==typeof document},8563:t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},7298:(t,r,a)=>{var i=a(71);t.exports=/MSIE|Trident/.test(i)},3221:(t,r,a)=>{var i=a(71);t.exports=/ipad|iphone|ipod/i.test(i)&&"undefined"!=typeof Pebble},4764:(t,r,a)=>{var i=a(71);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},806:(t,r,a)=>{var i=a(9037),o=a(6648);t.exports="process"===o(i.process)},7486:(t,r,a)=>{var i=a(71);t.exports=/web0s(?!.*chrome)/i.test(i)},71:t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},3615:(t,r,a)=>{var i,o,l=a(9037),c=a(71),u=l.process,h=l.Deno,d=u&&u.versions||h&&h.version,p=d&&d.v8;p&&(o=(i=p.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1]));!o&&c&&(!(i=c.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=c.match(/Chrome\/(\d+)/))&&(o=+i[1]);t.exports=o},7922:(t,r,a)=>{var i=a(71).match(/AppleWebKit\/(\d+)\./);t.exports=!!i&&+i[1]},2739:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6610:(t,r,a)=>{var i=a(8844),o=Error,l=i("".replace),c=String(new o("zxcasd").stack),u=/\n\s*at [^:]*:[^\n]*/,h=u.test(c);t.exports=function(t,r){if(h&&"string"==typeof t&&!o.prepareStackTrace)for(;r--;)t=l(t,u,"");return t}},5411:(t,r,a)=>{var i=a(5773),o=a(6610),l=a(9599),c=Error.captureStackTrace;t.exports=function(t,r,a,u){l&&(c?c(t,r):i(t,"stack",o(a,u)))}},9599:(t,r,a)=>{var i=a(3689),o=a(5684);t.exports=!i((function(){var t=new Error("a");if(!("stack"in t))return!0;Object.defineProperty(t,"stack",o(1,7));return 7!==t.stack}))},445:(t,r,a)=>{var i=a(7697),o=a(3689),l=a(5027),c=a(3841),u=Error.prototype.toString,h=o((function(){if(i){var t=Object.create(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==u.call(t))return!0}return"2: 1"!==u.call({message:1,name:2})||"Error"!==u.call({})}));t.exports=h?function toString(){var t=l(this),r=c(t.name,"Error"),a=c(t.message);return r?a?r+": "+a:r:a}:u},9989:(t,r,a)=>{var i=a(9037),o=a(2474).f,l=a(5773),c=a(1880),u=a(5014),h=a(8758),d=a(5266);t.exports=function(t,r){var a,p,v,_,y,g=t.target,m=t.global,b=t.stat;if(a=m?i:b?i[g]||u(g,{}):i[g]&&i[g].prototype)for(p in r){_=r[p];v=t.dontCallGetSet?(y=o(a,p))&&y.value:a[p];if(!d(m?p:g+(b?".":"#")+p,t.forced)&&void 0!==v){if(typeof _==typeof v)continue;h(_,v)}(t.sham||v&&v.sham)&&l(_,"sham",!0);c(a,p,_,t)}}},3689:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},8678:(t,r,a)=>{a(4043);var i=a(2615),o=a(1880),l=a(6308),c=a(3689),u=a(4201),h=a(5773),d=u("species"),p=RegExp.prototype;t.exports=function(t,r,a,v){var _=u(t),y=!c((function(){var r={};r[_]=function(){return 7};return 7!==""[t](r)})),g=y&&!c((function(){var r=!1,a=/a/;if("split"===t){(a={}).constructor={};a.constructor[d]=function(){return a};a.flags="";a[_]=/./[_]}a.exec=function(){r=!0;return null};a[_]("");return!r}));if(!y||!g||a){var m=/./[_],b=r(_,""[t],(function(t,r,a,o,c){var u=r.exec;return u===l||u===p.exec?y&&!c?{done:!0,value:i(m,r,a,o)}:{done:!0,value:i(t,a,r,o)}:{done:!1}}));o(String.prototype,t,b[0]);o(p,_,b[1])}v&&h(p[_],"sham",!0)}},7809:(t,r,a)=>{var i=a(2297),o=a(6310),l=a(5565),c=a(4071),flattenIntoArray=function(t,r,a,u,h,d,p,v){for(var _,y,g=h,m=0,b=!!p&&c(p,v);m<u;){if(m in a){_=b?b(a[m],m,r):a[m];if(d>0&&i(_)){y=o(_);g=flattenIntoArray(t,r,_,y,g,d-1)-1}else{l(g+1);t[g]=_}g++}m++}return g};t.exports=flattenIntoArray},1594:(t,r,a)=>{var i=a(3689);t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},1735:(t,r,a)=>{var i=a(7215),o=Function.prototype,l=o.apply,c=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?c.bind(l):function(){return c.apply(l,arguments)})},4071:(t,r,a)=>{var i=a(6576),o=a(509),l=a(7215),c=i(i.bind);t.exports=function(t,r){o(t);return void 0===r?t:l?c(t,r):function(){return t.apply(r,arguments)}}},7215:(t,r,a)=>{var i=a(3689);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6761:(t,r,a)=>{var i=a(8844),o=a(509),l=a(8999),c=a(6812),u=a(6004),h=a(7215),d=Function,p=i([].concat),v=i([].join),_={};t.exports=h?d.bind:function bind(t){var r=o(this),a=r.prototype,i=u(arguments,1),h=function bound(){var a=p(i,u(arguments));return this instanceof h?function(t,r,a){if(!c(_,r)){for(var i=[],o=0;o<r;o++)i[o]="a["+o+"]";_[r]=d("C,a","return new C("+v(i,",")+")")}return _[r](t,a)}(r,a.length,a):r.apply(t,a)};l(a)&&(h.prototype=a);return h}},2615:(t,r,a)=>{var i=a(7215),o=Function.prototype.call;t.exports=i?o.bind(o):function(){return o.apply(o,arguments)}},1236:(t,r,a)=>{var i=a(7697),o=a(6812),l=Function.prototype,c=i&&Object.getOwnPropertyDescriptor,u=o(l,"name"),h=u&&"something"===function something(){}.name,d=u&&(!i||i&&c(l,"name").configurable);t.exports={EXISTS:u,PROPER:h,CONFIGURABLE:d}},2743:(t,r,a)=>{var i=a(8844),o=a(509);t.exports=function(t,r,a){try{return i(o(Object.getOwnPropertyDescriptor(t,r)[a]))}catch(t){}}},6576:(t,r,a)=>{var i=a(6648),o=a(8844);t.exports=function(t){if("Function"===i(t))return o(t)}},8844:(t,r,a)=>{var i=a(7215),o=Function.prototype,l=o.call,c=i&&o.bind.bind(l,l);t.exports=i?c:function(t){return function(){return l.apply(t,arguments)}}},6058:(t,r,a)=>{var i=a(9037),o=a(9985);t.exports=function(t,r){return arguments.length<2?(a=i[t],o(a)?a:void 0):i[t]&&i[t][r];var a}},2302:t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},6752:(t,r,a)=>{var i=a(2615),o=a(5027),l=a(2302),c=a(1664);t.exports=function(t,r){r&&"string"==typeof t||o(t);var a=c(t);return l(o(void 0!==a?i(a,t):t))}},1664:(t,r,a)=>{var i=a(926),o=a(4849),l=a(981),c=a(9478),u=a(4201)("iterator");t.exports=function(t){if(!l(t))return o(t,u)||o(t,"@@iterator")||c[i(t)]}},5185:(t,r,a)=>{var i=a(2615),o=a(509),l=a(5027),c=a(3691),u=a(1664),h=TypeError;t.exports=function(t,r){var a=arguments.length<2?u(t):r;if(o(a))return l(i(a,t));throw new h(c(t)+" is not iterable")}},2643:(t,r,a)=>{var i=a(8844),o=a(2297),l=a(9985),c=a(6648),u=a(4327),h=i([].push);t.exports=function(t){if(l(t))return t;if(o(t)){for(var r=t.length,a=[],i=0;i<r;i++){var d=t[i];"string"==typeof d?h(a,d):"number"!=typeof d&&"Number"!==c(d)&&"String"!==c(d)||h(a,u(d))}var p=a.length,v=!0;return function(t,r){if(v){v=!1;return r}if(o(this))return r;for(var i=0;i<p;i++)if(a[i]===t)return r}}}},4849:(t,r,a)=>{var i=a(509),o=a(981);t.exports=function(t,r){var a=t[r];return o(a)?void 0:i(a)}},1074:(t,r,a)=>{var i=a(509),o=a(5027),l=a(2615),c=a(8700),u=a(2302),h="Invalid size",d=RangeError,p=TypeError,v=Math.max,SetRecord=function(t,r){this.set=t;this.size=v(r,0);this.has=i(t.has);this.keys=i(t.keys)};SetRecord.prototype={getIterator:function(){return u(o(l(this.keys,this.set)))},includes:function(t){return l(this.has,this.set,t)}};t.exports=function(t){o(t);var r=+t.size;if(r!=r)throw new p(h);var a=c(r);if(a<0)throw new d(h);return new SetRecord(t,a)}},7017:(t,r,a)=>{var i=a(8844),o=a(690),l=Math.floor,c=i("".charAt),u=i("".replace),h=i("".slice),d=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,p=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,r,a,i,v,_){var y=a+t.length,g=i.length,m=p;if(void 0!==v){v=o(v);m=d}return u(_,m,(function(o,u){var d;switch(c(u,0)){case"$":return"$";case"&":return t;case"`":return h(r,0,a);case"'":return h(r,y);case"<":d=v[h(u,1,-1)];break;default:var p=+u;if(0===p)return o;if(p>g){var _=l(p/10);return 0===_?o:_<=g?void 0===i[_-1]?c(u,1):i[_-1]+c(u,1):o}d=i[p-1]}return void 0===d?"":d}))}},9037:function(t){var check=function(t){return t&&t.Math===Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||check("object"==typeof this&&this)||function(){return this}()||Function("return this")()},6812:(t,r,a)=>{var i=a(8844),o=a(690),l=i({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,r){return l(o(t),r)}},7248:t=>{t.exports={}},920:t=>{t.exports=function(t,r){try{1===arguments.length?console.error(t):console.error(t,r)}catch(t){}}},2688:(t,r,a)=>{var i=a(6058);t.exports=i("document","documentElement")},8506:(t,r,a)=>{var i=a(7697),o=a(3689),l=a(6420);t.exports=!i&&!o((function(){return 7!==Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a}))},5477:t=>{var r=Array,a=Math.abs,i=Math.pow,o=Math.floor,l=Math.log,c=Math.LN2;t.exports={pack:function(t,u,h){var d,p,v,_=r(h),y=8*h-u-1,g=(1<<y)-1,m=g>>1,b=23===u?i(2,-24)-i(2,-77):0,w=t<0||0===t&&1/t<0?1:0,P=0;if((t=a(t))!=t||t===1/0){p=t!=t?1:0;d=g}else{d=o(l(t)/c);if(t*(v=i(2,-d))<1){d--;v*=2}if((t+=d+m>=1?b/v:b*i(2,1-m))*v>=2){d++;v/=2}if(d+m>=g){p=0;d=g}else if(d+m>=1){p=(t*v-1)*i(2,u);d+=m}else{p=t*i(2,m-1)*i(2,u);d=0}}for(;u>=8;){_[P++]=255&p;p/=256;u-=8}d=d<<u|p;y+=u;for(;y>0;){_[P++]=255&d;d/=256;y-=8}_[--P]|=128*w;return _},unpack:function(t,r){var a,o=t.length,l=8*o-r-1,c=(1<<l)-1,u=c>>1,h=l-7,d=o-1,p=t[d--],v=127&p;p>>=7;for(;h>0;){v=256*v+t[d--];h-=8}a=v&(1<<-h)-1;v>>=-h;h+=r;for(;h>0;){a=256*a+t[d--];h-=8}if(0===v)v=1-u;else{if(v===c)return a?NaN:p?-1/0:1/0;a+=i(2,r);v-=u}return(p?-1:1)*a*i(2,v-r)}}},4413:(t,r,a)=>{var i=a(8844),o=a(3689),l=a(6648),c=Object,u=i("".split);t.exports=o((function(){return!c("z").propertyIsEnumerable(0)}))?function(t){return"String"===l(t)?u(t,""):c(t)}:c},3457:(t,r,a)=>{var i=a(9985),o=a(8999),l=a(9385);t.exports=function(t,r,a){var c,u;l&&i(c=r.constructor)&&c!==a&&o(u=c.prototype)&&u!==a.prototype&&l(t,u);return t}},6738:(t,r,a)=>{var i=a(8844),o=a(9985),l=a(4091),c=i(Function.toString);o(l.inspectSource)||(l.inspectSource=function(t){return c(t)});t.exports=l.inspectSource},2570:(t,r,a)=>{var i=a(8999),o=a(5773);t.exports=function(t,r){i(r)&&"cause"in r&&o(t,"cause",r.cause)}},5375:(t,r,a)=>{var i=a(9989),o=a(8844),l=a(7248),c=a(8999),u=a(6812),h=a(2560).f,d=a(2741),p=a(6062),v=a(1129),_=a(4630),y=a(1594),g=!1,m=_("meta"),b=0,setMetadata=function(t){h(t,m,{value:{objectID:"O"+b++,weakData:{}}})},w=t.exports={enable:function(){w.enable=function(){};g=!0;var t=d.f,r=o([].splice),a={};a[m]=1;if(t(a).length){d.f=function(a){for(var i=t(a),o=0,l=i.length;o<l;o++)if(i[o]===m){r(i,o,1);break}return i};i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:p.f})}},fastKey:function(t,r){if(!c(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!u(t,m)){if(!v(t))return"F";if(!r)return"E";setMetadata(t)}return t[m].objectID},getWeakData:function(t,r){if(!u(t,m)){if(!v(t))return!0;if(!r)return!1;setMetadata(t)}return t[m].weakData},onFreeze:function(t){y&&g&&v(t)&&!u(t,m)&&setMetadata(t);return t}};l[m]=!0},618:(t,r,a)=>{var i,o,l,c=a(9834),u=a(9037),h=a(8999),d=a(5773),p=a(6812),v=a(4091),_=a(2713),y=a(7248),g="Object already initialized",m=u.TypeError,b=u.WeakMap;if(c||v.state){var w=v.state||(v.state=new b);w.get=w.get;w.has=w.has;w.set=w.set;i=function(t,r){if(w.has(t))throw new m(g);r.facade=t;w.set(t,r);return r};o=function(t){return w.get(t)||{}};l=function(t){return w.has(t)}}else{var P=_("state");y[P]=!0;i=function(t,r){if(p(t,P))throw new m(g);r.facade=t;d(t,P,r);return r};o=function(t){return p(t,P)?t[P]:{}};l=function(t){return p(t,P)}}t.exports={set:i,get:o,has:l,enforce:function(t){return l(t)?o(t):i(t,{})},getterFor:function(t){return function(r){var a;if(!h(r)||(a=o(r)).type!==t)throw new m("Incompatible receiver, "+t+" required");return a}}}},3292:(t,r,a)=>{var i=a(4201),o=a(9478),l=i("iterator"),c=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||c[l]===t)}},2297:(t,r,a)=>{var i=a(6648);t.exports=Array.isArray||function isArray(t){return"Array"===i(t)}},9401:(t,r,a)=>{var i=a(926);t.exports=function(t){var r=i(t);return"BigInt64Array"===r||"BigUint64Array"===r}},9985:t=>{var r="object"==typeof document&&document.all;t.exports=void 0===r&&void 0!==r?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}},9429:(t,r,a)=>{var i=a(8844),o=a(3689),l=a(9985),c=a(926),u=a(6058),h=a(6738),noop=function(){},d=u("Reflect","construct"),p=/^\s*(?:class|function)\b/,v=i(p.exec),_=!p.test(noop),y=function isConstructor(t){if(!l(t))return!1;try{d(noop,[],t);return!0}catch(t){return!1}},g=function isConstructor(t){if(!l(t))return!1;switch(c(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _||!!v(p,h(t))}catch(t){return!0}};g.sham=!0;t.exports=!d||o((function(){var t;return y(y.call)||!y(Object)||!y((function(){t=!0}))||t}))?g:y},6251:(t,r,a)=>{var i=a(6812);t.exports=function(t){return void 0!==t&&(i(t,"value")||i(t,"writable"))}},5266:(t,r,a)=>{var i=a(3689),o=a(9985),l=/#|\.prototype\./,isForced=function(t,r){var a=u[c(t)];return a===d||a!==h&&(o(r)?i(r):!!r)},c=isForced.normalize=function(t){return String(t).replace(l,".").toLowerCase()},u=isForced.data={},h=isForced.NATIVE="N",d=isForced.POLYFILL="P";t.exports=isForced},1973:(t,r,a)=>{var i=a(8999),o=Math.floor;t.exports=Number.isInteger||function isInteger(t){return!i(t)&&isFinite(t)&&o(t)===t}},981:t=>{t.exports=function(t){return null==t}},8999:(t,r,a)=>{var i=a(9985);t.exports=function(t){return"object"==typeof t?null!==t:i(t)}},598:(t,r,a)=>{var i=a(8999);t.exports=function(t){return i(t)||null===t}},3931:t=>{t.exports=!1},1245:(t,r,a)=>{var i=a(8999),o=a(6648),l=a(4201)("match");t.exports=function(t){var r;return i(t)&&(void 0!==(r=t[l])?!!r:"RegExp"===o(t))}},734:(t,r,a)=>{var i=a(6058),o=a(9985),l=a(3622),c=a(9525),u=Object;t.exports=c?function(t){return"symbol"==typeof t}:function(t){var r=i("Symbol");return o(r)&&l(r.prototype,u(t))}},6704:(t,r,a)=>{var i=a(2615);t.exports=function(t,r,a){for(var o,l,c=a?t:t.iterator,u=t.next;!(o=i(u,c)).done;)if(void 0!==(l=r(o.value)))return l}},8734:(t,r,a)=>{var i=a(4071),o=a(2615),l=a(5027),c=a(3691),u=a(3292),h=a(6310),d=a(3622),p=a(5185),v=a(1664),_=a(2125),y=TypeError,Result=function(t,r){this.stopped=t;this.result=r},g=Result.prototype;t.exports=function(t,r,a){var m,b,w,P,k,S,A,x=a&&a.that,E=!(!a||!a.AS_ENTRIES),I=!(!a||!a.IS_RECORD),T=!(!a||!a.IS_ITERATOR),C=!(!a||!a.INTERRUPTED),M=i(r,x),stop=function(t){m&&_(m,"normal",t);return new Result(!0,t)},callFn=function(t){if(E){l(t);return C?M(t[0],t[1],stop):M(t[0],t[1])}return C?M(t,stop):M(t)};if(I)m=t.iterator;else if(T)m=t;else{if(!(b=v(t)))throw new y(c(t)+" is not iterable");if(u(b)){for(w=0,P=h(t);P>w;w++)if((k=callFn(t[w]))&&d(g,k))return k;return new Result(!1)}m=p(t,b)}S=I?t.next:m.next;for(;!(A=o(S,m)).done;){try{k=callFn(A.value)}catch(t){_(m,"throw",t)}if("object"==typeof k&&k&&d(g,k))return k}return new Result(!1)}},2125:(t,r,a)=>{var i=a(2615),o=a(5027),l=a(4849);t.exports=function(t,r,a){var c,u;o(t);try{if(!(c=l(t,"return"))){if("throw"===r)throw a;return a}c=i(c,t)}catch(t){u=!0;c=t}if("throw"===r)throw a;if(u)throw c;o(c);return a}},974:(t,r,a)=>{var i=a(2013).IteratorPrototype,o=a(5391),l=a(5684),c=a(5997),u=a(9478),returnThis=function(){return this};t.exports=function(t,r,a,h){var d=r+" Iterator";t.prototype=o(i,{next:l(+!h,a)});c(t,d,!1,!0);u[d]=returnThis;return t}},5419:(t,r,a)=>{var i=a(2615),o=a(5391),l=a(5773),c=a(6045),u=a(4201),h=a(618),d=a(4849),p=a(2013).IteratorPrototype,v=a(7807),_=a(2125),y=u("toStringTag"),g="IteratorHelper",m="WrapForValidIterator",b=h.set,createIteratorProxyPrototype=function(t){var r=h.getterFor(t?m:g);return c(o(p),{next:function next(){var a=r(this);if(t)return a.nextHandler();try{var i=a.done?void 0:a.nextHandler();return v(i,a.done)}catch(t){a.done=!0;throw t}},return:function(){var a=r(this),o=a.iterator;a.done=!0;if(t){var l=d(o,"return");return l?i(l,o):v(void 0,!0)}if(a.inner)try{_(a.inner.iterator,"normal")}catch(t){return _(o,"throw",t)}_(o,"normal");return v(void 0,!0)}})},w=createIteratorProxyPrototype(!0),P=createIteratorProxyPrototype(!1);l(P,y,"Iterator Helper");t.exports=function(t,r){var a=function Iterator(a,i){if(i){i.iterator=a.iterator;i.next=a.next}else i=a;i.type=r?m:g;i.nextHandler=t;i.counter=0;i.done=!1;b(this,i)};a.prototype=r?w:P;return a}},1934:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(3931),c=a(1236),u=a(9985),h=a(974),d=a(1868),p=a(9385),v=a(5997),_=a(5773),y=a(1880),g=a(4201),m=a(9478),b=a(2013),w=c.PROPER,P=c.CONFIGURABLE,k=b.IteratorPrototype,S=b.BUGGY_SAFARI_ITERATORS,A=g("iterator"),x="keys",E="values",I="entries",returnThis=function(){return this};t.exports=function(t,r,a,c,g,b,T){h(a,r,c);var C,M,G,getIterationMethod=function(t){if(t===g&&j)return j;if(!S&&t&&t in L)return L[t];switch(t){case x:return function keys(){return new a(this,t)};case E:return function values(){return new a(this,t)};case I:return function entries(){return new a(this,t)}}return function(){return new a(this)}},O=r+" Iterator",R=!1,L=t.prototype,D=L[A]||L["@@iterator"]||g&&L[g],j=!S&&D||getIterationMethod(g),N="Array"===r&&L.entries||D;if(N&&(C=d(N.call(new t)))!==Object.prototype&&C.next){l||d(C)===k||(p?p(C,k):u(C[A])||y(C,A,returnThis));v(C,O,!0,!0);l&&(m[O]=returnThis)}if(w&&g===E&&D&&D.name!==E)if(!l&&P)_(L,"name",E);else{R=!0;j=function values(){return o(D,this)}}if(g){M={values:getIterationMethod(E),keys:b?j:getIterationMethod(x),entries:getIterationMethod(I)};if(T)for(G in M)(S||R||!(G in L))&&y(L,G,M[G]);else i({target:r,proto:!0,forced:S||R},M)}l&&!T||L[A]===j||y(L,A,j,{name:g});m[r]=j;return M}},8983:(t,r,a)=>{var i=a(2615),o=a(509),l=a(5027),c=a(2302),u=a(5419),h=a(1228),d=u((function(){var t=this.iterator,r=l(i(this.next,t));if(!(this.done=!!r.done))return h(t,this.mapper,[r.value,this.counter++],!0)}));t.exports=function map(t){l(this);o(t);return new d(c(this),{mapper:t})}},2013:(t,r,a)=>{var i,o,l,c=a(3689),u=a(9985),h=a(8999),d=a(5391),p=a(1868),v=a(1880),_=a(4201),y=a(3931),g=_("iterator"),m=!1;[].keys&&("next"in(l=[].keys())?(o=p(p(l)))!==Object.prototype&&(i=o):m=!0);!h(i)||c((function(){var t={};return i[g].call(t)!==t}))?i={}:y&&(i=d(i));u(i[g])||v(i,g,(function(){return this}));t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:m}},9478:t=>{t.exports={}},6310:(t,r,a)=>{var i=a(3126);t.exports=function(t){return i(t.length)}},8702:(t,r,a)=>{var i=a(8844),o=a(3689),l=a(9985),c=a(6812),u=a(7697),h=a(1236).CONFIGURABLE,d=a(6738),p=a(618),v=p.enforce,_=p.get,y=String,g=Object.defineProperty,m=i("".slice),b=i("".replace),w=i([].join),P=u&&!o((function(){return 8!==g((function(){}),"length",{value:8}).length})),k=String(String).split("String"),S=t.exports=function(t,r,a){"Symbol("===m(y(r),0,7)&&(r="["+b(y(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]");a&&a.getter&&(r="get "+r);a&&a.setter&&(r="set "+r);(!c(t,"name")||h&&t.name!==r)&&(u?g(t,"name",{value:r,configurable:!0}):t.name=r);P&&a&&c(a,"arity")&&t.length!==a.arity&&g(t,"length",{value:a.arity});try{a&&c(a,"constructor")&&a.constructor?u&&g(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=v(t);c(i,"source")||(i.source=w(k,"string"==typeof r?r:""));return t};Function.prototype.toString=S((function toString(){return l(this)&&_(this).source||d(this)}),"toString")},134:(t,r,a)=>{var i=a(5680),o=Math.abs,l=2220446049250313e-31,c=1/l;t.exports=function(t,r,a,u){var h=+t,d=o(h),p=i(h);if(d<u)return p*function(t){return t+c-c}(d/u/r)*u*r;var v=(1+r/l)*d,_=v-(v-d);return _>a||_!=_?p*(1/0):p*_}},7788:(t,r,a)=>{var i=a(134);t.exports=Math.fround||function fround(t){return i(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},5680:t=>{t.exports=Math.sign||function sign(t){var r=+t;return 0===r||r!=r?r:r<0?-1:1}},8828:t=>{var r=Math.ceil,a=Math.floor;t.exports=Math.trunc||function trunc(t){var i=+t;return(i>0?a:r)(i)}},231:(t,r,a)=>{var i,o,l,c,u,h=a(9037),d=a(517),p=a(4071),v=a(9886).set,_=a(4410),y=a(4764),g=a(3221),m=a(7486),b=a(806),w=h.MutationObserver||h.WebKitMutationObserver,P=h.document,k=h.process,S=h.Promise,A=d("queueMicrotask");if(!A){var x=new _,flush=function(){var t,r;b&&(t=k.domain)&&t.exit();for(;r=x.get();)try{r()}catch(t){x.head&&i();throw t}t&&t.enter()};if(y||b||m||!w||!P)if(!g&&S&&S.resolve){(c=S.resolve(void 0)).constructor=S;u=p(c.then,c);i=function(){u(flush)}}else if(b)i=function(){k.nextTick(flush)};else{v=p(v,h);i=function(){v(flush)}}else{o=!0;l=P.createTextNode("");new w(flush).observe(l,{characterData:!0});i=function(){l.data=o=!o}}A=function(t){x.head||i();x.add(t)}}t.exports=A},8742:(t,r,a)=>{var i=a(509),o=TypeError,PromiseCapability=function(t){var r,a;this.promise=new t((function(t,i){if(void 0!==r||void 0!==a)throw new o("Bad Promise constructor");r=t;a=i}));this.resolve=i(r);this.reject=i(a)};t.exports.f=function(t){return new PromiseCapability(t)}},3841:(t,r,a)=>{var i=a(4327);t.exports=function(t,r){return void 0===t?arguments.length<2?"":r:i(t)}},2124:(t,r,a)=>{var i=a(1245),o=TypeError;t.exports=function(t){if(i(t))throw new o("The method doesn't accept regular expressions");return t}},5394:(t,r,a)=>{var i=a(7697),o=a(8844),l=a(2615),c=a(3689),u=a(300),h=a(7518),d=a(9556),p=a(690),v=a(4413),_=Object.assign,y=Object.defineProperty,g=o([].concat);t.exports=!_||c((function(){if(i&&1!==_({b:1},_(y({},"a",{enumerable:!0,get:function(){y(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},r={},a=Symbol("assign detection"),o="abcdefghijklmnopqrst";t[a]=7;o.split("").forEach((function(t){r[t]=t}));return 7!==_({},t)[a]||u(_({},r)).join("")!==o}))?function assign(t,r){for(var a=p(t),o=arguments.length,c=1,_=h.f,y=d.f;o>c;)for(var m,b=v(arguments[c++]),w=_?g(u(b),_(b)):u(b),P=w.length,k=0;P>k;){m=w[k++];i&&!l(y,b,m)||(a[m]=b[m])}return a}:_},5391:(t,r,a)=>{var i,o=a(5027),l=a(8920),c=a(2739),u=a(7248),h=a(2688),d=a(6420),p=a(2713),v="prototype",_="script",y=p("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<"+_+">"+t+"</"+_+">"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var r=t.parentWindow.Object;t=null;return r},NullProtoObject=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&i?NullProtoObjectViaActiveX(i):function(){var t,r=d("iframe"),a="java"+_+":";r.style.display="none";h.appendChild(r);r.src=String(a);(t=r.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(i);for(var t=c.length;t--;)delete NullProtoObject[v][c[t]];return NullProtoObject()};u[y]=!0;t.exports=Object.create||function create(t,r){var a;if(null!==t){EmptyConstructor[v]=o(t);a=new EmptyConstructor;EmptyConstructor[v]=null;a[y]=t}else a=NullProtoObject();return void 0===r?a:l.f(a,r)}},8920:(t,r,a)=>{var i=a(7697),o=a(5648),l=a(2560),c=a(5027),u=a(5290),h=a(300);r.f=i&&!o?Object.defineProperties:function defineProperties(t,r){c(t);for(var a,i=u(r),o=h(r),d=o.length,p=0;d>p;)l.f(t,a=o[p++],i[a]);return t}},2560:(t,r,a)=>{var i=a(7697),o=a(8506),l=a(5648),c=a(5027),u=a(8360),h=TypeError,d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,v="enumerable",_="configurable",y="writable";r.f=i?l?function defineProperty(t,r,a){c(t);r=u(r);c(a);if("function"==typeof t&&"prototype"===r&&"value"in a&&y in a&&!a[y]){var i=p(t,r);if(i&&i[y]){t[r]=a.value;a={configurable:_ in a?a[_]:i[_],enumerable:v in a?a[v]:i[v],writable:!1}}}return d(t,r,a)}:d:function defineProperty(t,r,a){c(t);r=u(r);c(a);if(o)try{return d(t,r,a)}catch(t){}if("get"in a||"set"in a)throw new h("Accessors not supported");"value"in a&&(t[r]=a.value);return t}},2474:(t,r,a)=>{var i=a(7697),o=a(2615),l=a(9556),c=a(5684),u=a(5290),h=a(8360),d=a(6812),p=a(8506),v=Object.getOwnPropertyDescriptor;r.f=i?v:function getOwnPropertyDescriptor(t,r){t=u(t);r=h(r);if(p)try{return v(t,r)}catch(t){}if(d(t,r))return c(!o(l.f,t,r),t[r])}},6062:(t,r,a)=>{var i=a(6648),o=a(5290),l=a(2741).f,c=a(6004),u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function getOwnPropertyNames(t){return u&&"Window"===i(t)?function(t){try{return l(t)}catch(t){return c(u)}}(t):l(o(t))}},2741:(t,r,a)=>{var i=a(4948),o=a(2739).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return i(t,o)}},7518:(t,r)=>{r.f=Object.getOwnPropertySymbols},1868:(t,r,a)=>{var i=a(6812),o=a(9985),l=a(690),c=a(2713),u=a(1748),h=c("IE_PROTO"),d=Object,p=d.prototype;t.exports=u?d.getPrototypeOf:function(t){var r=l(t);if(i(r,h))return r[h];var a=r.constructor;return o(a)&&r instanceof a?a.prototype:r instanceof d?p:null}},1129:(t,r,a)=>{var i=a(3689),o=a(8999),l=a(6648),c=a(1655),u=Object.isExtensible,h=i((function(){u(1)}));t.exports=h||c?function isExtensible(t){return!!o(t)&&((!c||"ArrayBuffer"!==l(t))&&(!u||u(t)))}:u},3622:(t,r,a)=>{var i=a(8844);t.exports=i({}.isPrototypeOf)},4948:(t,r,a)=>{var i=a(8844),o=a(6812),l=a(5290),c=a(4328).indexOf,u=a(7248),h=i([].push);t.exports=function(t,r){var a,i=l(t),d=0,p=[];for(a in i)!o(u,a)&&o(i,a)&&h(p,a);for(;r.length>d;)o(i,a=r[d++])&&(~c(p,a)||h(p,a));return p}},300:(t,r,a)=>{var i=a(4948),o=a(2739);t.exports=Object.keys||function keys(t){return i(t,o)}},9556:(t,r)=>{var a={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!a.call({1:2},1);r.f=o?function propertyIsEnumerable(t){var r=i(this,t);return!!r&&r.enumerable}:a},9385:(t,r,a)=>{var i=a(2743),o=a(5027),l=a(3550);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,a={};try{(t=i(Object.prototype,"__proto__","set"))(a,[]);r=a instanceof Array}catch(t){}return function setPrototypeOf(a,i){o(a);l(i);r?t(a,i):a.__proto__=i;return a}}():void 0)},9419:(t,r,a)=>{var i=a(7697),o=a(3689),l=a(8844),c=a(1868),u=a(300),h=a(5290),d=l(a(9556).f),p=l([].push),v=i&&o((function(){var t=Object.create(null);t[2]=2;return!d(t,2)})),createMethod=function(t){return function(r){for(var a,o=h(r),l=u(o),_=v&&null===c(o),y=l.length,g=0,m=[];y>g;){a=l[g++];i&&!(_?a in o:d(o,a))||p(m,t?[a,o[a]]:o[a])}return m}};t.exports={entries:createMethod(!0),values:createMethod(!1)}},5073:(t,r,a)=>{var i=a(3043),o=a(926);t.exports=i?{}.toString:function toString(){return"[object "+o(this)+"]"}},5899:(t,r,a)=>{var i=a(2615),o=a(9985),l=a(8999),c=TypeError;t.exports=function(t,r){var a,u;if("string"===r&&o(a=t.toString)&&!l(u=i(a,t)))return u;if(o(a=t.valueOf)&&!l(u=i(a,t)))return u;if("string"!==r&&o(a=t.toString)&&!l(u=i(a,t)))return u;throw new c("Can't convert object to primitive value")}},9152:(t,r,a)=>{var i=a(6058),o=a(8844),l=a(2741),c=a(7518),u=a(5027),h=o([].concat);t.exports=i("Reflect","ownKeys")||function ownKeys(t){var r=l.f(u(t)),a=c.f;return a?h(r,a(t)):r}},6675:(t,r,a)=>{var i=a(8844),o=a(6812),l=SyntaxError,c=parseInt,u=String.fromCharCode,h=i("".charAt),d=i("".slice),p=i(/./.exec),v={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},_=/^[\da-f]{4}$/i,y=/^[\u0000-\u001F]$/;t.exports=function(t,r){for(var a=!0,i="";r<t.length;){var g=h(t,r);if("\\"===g){var m=d(t,r,r+2);if(o(v,m)){i+=v[m];r+=2}else{if("\\u"!==m)throw new l('Unknown escape sequence: "'+m+'"');var b=d(t,r+=2,r+4);if(!p(_,b))throw new l("Bad Unicode escape at: "+r);i+=u(c(b,16));r+=4}}else{if('"'===g){a=!1;r++;break}if(p(y,g))throw new l("Bad control character in string literal at: "+r);i+=g;r++}}if(a)throw new l("Unterminated string at: "+r);return{value:i,end:r}}},496:(t,r,a)=>{var i=a(9037);t.exports=i},9302:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},7073:(t,r,a)=>{var i=a(9037),o=a(7919),l=a(9985),c=a(5266),u=a(6738),h=a(4201),d=a(2532),p=a(8563),v=a(3931),_=a(3615),y=o&&o.prototype,g=h("species"),m=!1,b=l(i.PromiseRejectionEvent),w=c("Promise",(function(){var t=u(o),r=t!==String(o);if(!r&&66===_)return!0;if(v&&(!y.catch||!y.finally))return!0;if(!_||_<51||!/native code/.test(t)){var a=new o((function(t){t(1)})),FakePromise=function(t){t((function(){}),(function(){}))};(a.constructor={})[g]=FakePromise;if(!(m=a.then((function(){}))instanceof FakePromise))return!0}return!r&&(d||p)&&!b}));t.exports={CONSTRUCTOR:w,REJECTION_EVENT:b,SUBCLASSING:m}},7919:(t,r,a)=>{var i=a(9037);t.exports=i.Promise},2945:(t,r,a)=>{var i=a(5027),o=a(8999),l=a(8742);t.exports=function(t,r){i(t);if(o(r)&&r.constructor===t)return r;var a=l.f(t);(0,a.resolve)(r);return a.promise}},562:(t,r,a)=>{var i=a(7919),o=a(6431),l=a(7073).CONSTRUCTOR;t.exports=l||!o((function(t){i.all(t).then(void 0,(function(){}))}))},8055:(t,r,a)=>{var i=a(2560).f;t.exports=function(t,r,a){a in t||i(t,a,{configurable:!0,get:function(){return r[a]},set:function(t){r[a]=t}})}},4410:t=>{var Queue=function(){this.head=null;this.tail=null};Queue.prototype={add:function(t){var r={item:t,next:null},a=this.tail;a?a.next=r:this.head=r;this.tail=r},get:function(){var t=this.head;if(t){null===(this.head=t.next)&&(this.tail=null);return t.item}}};t.exports=Queue},6100:(t,r,a)=>{var i=a(2615),o=a(5027),l=a(9985),c=a(6648),u=a(6308),h=TypeError;t.exports=function(t,r){var a=t.exec;if(l(a)){var d=i(a,t,r);null!==d&&o(d);return d}if("RegExp"===c(t))return i(u,t,r);throw new h("RegExp#exec called on incompatible receiver")}},6308:(t,r,a)=>{var i=a(2615),o=a(8844),l=a(4327),c=a(9633),u=a(7901),h=a(3430),d=a(5391),p=a(618).get,v=a(2100),_=a(6422),y=h("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,m=g,b=o("".charAt),w=o("".indexOf),P=o("".replace),k=o("".slice),S=function(){var t=/a/,r=/b*/g;i(g,t,"a");i(g,r,"a");return 0!==t.lastIndex||0!==r.lastIndex}(),A=u.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];(S||x||A||v||_)&&(m=function exec(t){var r,a,o,u,h,v,_,E=this,I=p(E),T=l(t),C=I.raw;if(C){C.lastIndex=E.lastIndex;r=i(m,C,T);E.lastIndex=C.lastIndex;return r}var M=I.groups,G=A&&E.sticky,O=i(c,E),R=E.source,L=0,D=T;if(G){O=P(O,"y","");-1===w(O,"g")&&(O+="g");D=k(T,E.lastIndex);if(E.lastIndex>0&&(!E.multiline||E.multiline&&"\n"!==b(T,E.lastIndex-1))){R="(?: "+R+")";D=" "+D;L++}a=new RegExp("^(?:"+R+")",O)}x&&(a=new RegExp("^"+R+"$(?!\\s)",O));S&&(o=E.lastIndex);u=i(g,G?a:E,D);if(G)if(u){u.input=k(u.input,L);u[0]=k(u[0],L);u.index=E.lastIndex;E.lastIndex+=u[0].length}else E.lastIndex=0;else S&&u&&(E.lastIndex=E.global?u.index+u[0].length:o);x&&u&&u.length>1&&i(y,u[0],a,(function(){for(h=1;h<arguments.length-2;h++)void 0===arguments[h]&&(u[h]=void 0)}));if(u&&M){u.groups=v=d(null);for(h=0;h<M.length;h++)v[(_=M[h])[0]]=u[_[1]]}return u});t.exports=m},9633:(t,r,a)=>{var i=a(5027);t.exports=function(){var t=i(this),r="";t.hasIndices&&(r+="d");t.global&&(r+="g");t.ignoreCase&&(r+="i");t.multiline&&(r+="m");t.dotAll&&(r+="s");t.unicode&&(r+="u");t.unicodeSets&&(r+="v");t.sticky&&(r+="y");return r}},3477:(t,r,a)=>{var i=a(2615),o=a(6812),l=a(3622),c=a(9633),u=RegExp.prototype;t.exports=function(t){var r=t.flags;return void 0!==r||"flags"in u||o(t,"flags")||!l(u,t)?r:i(c,t)}},7901:(t,r,a)=>{var i=a(3689),o=a(9037).RegExp,l=i((function(){var t=o("a","y");t.lastIndex=2;return null!==t.exec("abcd")})),c=l||i((function(){return!o("a","y").sticky})),u=l||i((function(){var t=o("^r","gy");t.lastIndex=2;return null!==t.exec("str")}));t.exports={BROKEN_CARET:u,MISSED_STICKY:c,UNSUPPORTED_Y:l}},2100:(t,r,a)=>{var i=a(3689),o=a(9037).RegExp;t.exports=i((function(){var t=o(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))},6422:(t,r,a)=>{var i=a(3689),o=a(9037).RegExp;t.exports=i((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},4684:(t,r,a)=>{var i=a(981),o=TypeError;t.exports=function(t){if(i(t))throw new o("Can't call method on "+t);return t}},517:(t,r,a)=>{var i=a(9037),o=a(7697),l=Object.getOwnPropertyDescriptor;t.exports=function(t){if(!o)return i[t];var r=l(i,t);return r&&r.value}},7610:(t,r,a)=>{var i=a(1034),o=a(8774),l=i.Set,c=i.add;t.exports=function(t){var r=new l;o(t,(function(t){c(r,t)}));return r}},7748:(t,r,a)=>{var i=a(29),o=a(1034),l=a(7610),c=a(7026),u=a(1074),h=a(8774),d=a(6704),p=o.has,v=o.remove;t.exports=function difference(t){var r=i(this),a=u(t),o=l(r);c(r)<=a.size?h(r,(function(t){a.includes(t)&&v(o,t)})):d(a.getIterator(),(function(t){p(r,t)&&v(o,t)}));return o}},1034:(t,r,a)=>{var i=a(8844),o=Set.prototype;t.exports={Set:Set,add:i(o.add),has:i(o.has),remove:i(o.delete),proto:o}},2948:(t,r,a)=>{var i=a(29),o=a(1034),l=a(7026),c=a(1074),u=a(8774),h=a(6704),d=o.Set,p=o.add,v=o.has;t.exports=function intersection(t){var r=i(this),a=c(t),o=new d;l(r)>a.size?h(a.getIterator(),(function(t){v(r,t)&&p(o,t)})):u(r,(function(t){a.includes(t)&&p(o,t)}));return o}},7795:(t,r,a)=>{var i=a(29),o=a(1034).has,l=a(7026),c=a(1074),u=a(8774),h=a(6704),d=a(2125);t.exports=function isDisjointFrom(t){var r=i(this),a=c(t);if(l(r)<=a.size)return!1!==u(r,(function(t){if(a.includes(t))return!1}),!0);var p=a.getIterator();return!1!==h(p,(function(t){if(o(r,t))return d(p,"normal",!1)}))}},6951:(t,r,a)=>{var i=a(29),o=a(7026),l=a(8774),c=a(1074);t.exports=function isSubsetOf(t){var r=i(this),a=c(t);return!(o(r)>a.size)&&!1!==l(r,(function(t){if(!a.includes(t))return!1}),!0)}},3894:(t,r,a)=>{var i=a(29),o=a(1034).has,l=a(7026),c=a(1074),u=a(6704),h=a(2125);t.exports=function isSupersetOf(t){var r=i(this),a=c(t);if(l(r)<a.size)return!1;var d=a.getIterator();return!1!==u(d,(function(t){if(!o(r,t))return h(d,"normal",!1)}))}},8774:(t,r,a)=>{var i=a(8844),o=a(6704),l=a(1034),c=l.Set,u=l.proto,h=i(u.forEach),d=i(u.keys),p=d(new c).next;t.exports=function(t,r,a){return a?o({iterator:d(t),next:p},r):h(t,r)}},3234:(t,r,a)=>{var i=a(6058),createSetLike=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};t.exports=function(t){var r=i("Set");try{(new r)[t](createSetLike(0));try{(new r)[t](createSetLike(-1));return!1}catch(t){return!0}}catch(t){return!1}}},7026:(t,r,a)=>{var i=a(2743),o=a(1034);t.exports=i(o.proto,"size","get")||function(t){return t.size}},4241:(t,r,a)=>{var i=a(6058),o=a(2148),l=a(4201),c=a(7697),u=l("species");t.exports=function(t){var r=i(t);c&&r&&!r[u]&&o(r,u,{configurable:!0,get:function(){return this}})}},2289:(t,r,a)=>{var i=a(29),o=a(1034),l=a(7610),c=a(1074),u=a(6704),h=o.add,d=o.has,p=o.remove;t.exports=function symmetricDifference(t){var r=i(this),a=c(t).getIterator(),o=l(r);u(a,(function(t){d(r,t)?p(o,t):h(o,t)}));return o}},5997:(t,r,a)=>{var i=a(2560).f,o=a(6812),l=a(4201)("toStringTag");t.exports=function(t,r,a){t&&!a&&(t=t.prototype);t&&!o(t,l)&&i(t,l,{configurable:!0,value:r})}},5674:(t,r,a)=>{var i=a(29),o=a(1034).add,l=a(7610),c=a(1074),u=a(6704);t.exports=function union(t){var r=i(this),a=c(t).getIterator(),h=l(r);u(a,(function(t){o(h,t)}));return h}},2713:(t,r,a)=>{var i=a(3430),o=a(4630),l=i("keys");t.exports=function(t){return l[t]||(l[t]=o(t))}},4091:(t,r,a)=>{var i=a(9037),o=a(5014),l="__core-js_shared__",c=i[l]||o(l,{});t.exports=c},3430:(t,r,a)=>{var i=a(3931),o=a(4091);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.35.1",mode:i?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE",source:"https://github.com/zloirock/core-js"})},6373:(t,r,a)=>{var i=a(5027),o=a(2655),l=a(981),c=a(4201)("species");t.exports=function(t,r){var a,u=i(t).constructor;return void 0===u||l(a=i(u)[c])?r:o(a)}},730:(t,r,a)=>{var i=a(8844),o=a(8700),l=a(4327),c=a(4684),u=i("".charAt),h=i("".charCodeAt),d=i("".slice),createMethod=function(t){return function(r,a){var i,p,v=l(c(r)),_=o(a),y=v.length;return _<0||_>=y?t?"":void 0:(i=h(v,_))<55296||i>56319||_+1===y||(p=h(v,_+1))<56320||p>57343?t?u(v,_):i:t?d(v,_,_+2):p-56320+(i-55296<<10)+65536}};t.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},5947:(t,r,a)=>{var i=a(71);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(i)},7254:(t,r,a)=>{var i=a(8844),o=a(3126),l=a(4327),c=a(534),u=a(4684),h=i(c),d=i("".slice),p=Math.ceil,createMethod=function(t){return function(r,a,i){var c,v,_=l(u(r)),y=o(a),g=_.length,m=void 0===i?" ":l(i);if(y<=g||""===m)return _;(v=h(m,p((c=y-g)/m.length))).length>c&&(v=d(v,0,c));return t?_+v:v+_}};t.exports={start:createMethod(!1),end:createMethod(!0)}},6430:(t,r,a)=>{var i=a(8844),o=2147483647,l=/[^\0-\u007E]/,c=/[.\u3002\uFF0E\uFF61]/g,u="Overflow: input needs wider integers to process",h=RangeError,d=i(c.exec),p=Math.floor,v=String.fromCharCode,_=i("".charCodeAt),y=i([].join),g=i([].push),m=i("".replace),b=i("".split),w=i("".toLowerCase),digitToBasic=function(t){return t+22+75*(t<26)},adapt=function(t,r,a){var i=0;t=a?p(t/700):t>>1;t+=p(t/r);for(;t>455;){t=p(t/35);i+=36}return p(i+36*t/(t+38))},encode=function(t){var r=[];t=function(t){for(var r=[],a=0,i=t.length;a<i;){var o=_(t,a++);if(o>=55296&&o<=56319&&a<i){var l=_(t,a++);if(56320==(64512&l))g(r,((1023&o)<<10)+(1023&l)+65536);else{g(r,o);a--}}else g(r,o)}return r}(t);var a,i,l=t.length,c=128,d=0,m=72;for(a=0;a<t.length;a++)(i=t[a])<128&&g(r,v(i));var b=r.length,w=b;b&&g(r,"-");for(;w<l;){var P=o;for(a=0;a<t.length;a++)(i=t[a])>=c&&i<P&&(P=i);var k=w+1;if(P-c>p((o-d)/k))throw new h(u);d+=(P-c)*k;c=P;for(a=0;a<t.length;a++){if((i=t[a])<c&&++d>o)throw new h(u);if(i===c){for(var S=d,A=36;;){var x=A<=m?1:A>=m+26?26:A-m;if(S<x)break;var E=S-x,I=36-x;g(r,v(digitToBasic(x+E%I)));S=p(E/I);A+=36}g(r,v(digitToBasic(S)));m=adapt(d,k,w===b);d=0;w++}}d++;c++}return y(r,"")};t.exports=function(t){var r,a,i=[],o=b(m(w(t),c,"."),".");for(r=0;r<o.length;r++){a=o[r];g(i,d(l,a)?"xn--"+encode(a):a)}return y(i,".")}},534:(t,r,a)=>{var i=a(8700),o=a(4327),l=a(4684),c=RangeError;t.exports=function repeat(t){var r=o(l(this)),a="",u=i(t);if(u<0||u===1/0)throw new c("Wrong number of repetitions");for(;u>0;(u>>>=1)&&(r+=r))1&u&&(a+=r);return a}},9558:(t,r,a)=>{var i=a(1435).end,o=a(5984);t.exports=o("trimEnd")?function trimEnd(){return i(this)}:"".trimEnd},5984:(t,r,a)=>{var i=a(1236).PROPER,o=a(3689),l=a(6350);t.exports=function(t){return o((function(){return!!l[t]()||"​…᠎"!=="​…᠎"[t]()||i&&l[t].name!==t}))}},1435:(t,r,a)=>{var i=a(8844),o=a(4684),l=a(4327),c=a(6350),u=i("".replace),h=RegExp("^["+c+"]+"),d=RegExp("(^|[^"+c+"])["+c+"]+$"),createMethod=function(t){return function(r){var a=l(o(r));1&t&&(a=u(a,h,""));2&t&&(a=u(a,d,"$1"));return a}};t.exports={start:createMethod(1),end:createMethod(2),trim:createMethod(3)}},3514:(t,r,a)=>{var i=a(9037),o=a(3689),l=a(3615),c=a(2532),u=a(8563),h=a(806),d=i.structuredClone;t.exports=!!d&&!o((function(){if(u&&l>92||h&&l>94||c&&l>97)return!1;var t=new ArrayBuffer(8),r=d(t,{transfer:[t]});return 0!==t.byteLength||8!==r.byteLength}))},146:(t,r,a)=>{var i=a(3615),o=a(3689),l=a(9037).String;t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol("symbol detection");return!l(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},3032:(t,r,a)=>{var i=a(2615),o=a(6058),l=a(4201),c=a(1880);t.exports=function(){var t=o("Symbol"),r=t&&t.prototype,a=r&&r.valueOf,u=l("toPrimitive");r&&!r[u]&&c(r,u,(function(t){return i(a,this)}),{arity:1})}},6549:(t,r,a)=>{var i=a(146);t.exports=i&&!!Symbol.for&&!!Symbol.keyFor},9886:(t,r,a)=>{var i,o,l,c,u=a(9037),h=a(1735),d=a(4071),p=a(9985),v=a(6812),_=a(3689),y=a(2688),g=a(6004),m=a(6420),b=a(1500),w=a(4764),P=a(806),k=u.setImmediate,S=u.clearImmediate,A=u.process,x=u.Dispatch,E=u.Function,I=u.MessageChannel,T=u.String,C=0,M={},G="onreadystatechange";_((function(){i=u.location}));var run=function(t){if(v(M,t)){var r=M[t];delete M[t];r()}},runner=function(t){return function(){run(t)}},eventListener=function(t){run(t.data)},globalPostMessageDefer=function(t){u.postMessage(T(t),i.protocol+"//"+i.host)};if(!k||!S){k=function setImmediate(t){b(arguments.length,1);var r=p(t)?t:E(t),a=g(arguments,1);M[++C]=function(){h(r,void 0,a)};o(C);return C};S=function clearImmediate(t){delete M[t]};if(P)o=function(t){A.nextTick(runner(t))};else if(x&&x.now)o=function(t){x.now(runner(t))};else if(I&&!w){c=(l=new I).port2;l.port1.onmessage=eventListener;o=d(c.postMessage,c)}else if(u.addEventListener&&p(u.postMessage)&&!u.importScripts&&i&&"file:"!==i.protocol&&!_(globalPostMessageDefer)){o=globalPostMessageDefer;u.addEventListener("message",eventListener,!1)}else o=G in m("script")?function(t){y.appendChild(m("script"))[G]=function(){y.removeChild(this);run(t)}}:function(t){setTimeout(runner(t),0)}}t.exports={set:k,clear:S}},3648:(t,r,a)=>{var i=a(8844);t.exports=i(1..valueOf)},7578:(t,r,a)=>{var i=a(8700),o=Math.max,l=Math.min;t.exports=function(t,r){var a=i(t);return a<0?o(a+r,0):l(a,r)}},1530:(t,r,a)=>{var i=a(8732),o=TypeError;t.exports=function(t){var r=i(t,"number");if("number"==typeof r)throw new o("Can't convert number to bigint");return BigInt(r)}},9842:(t,r,a)=>{var i=a(8700),o=a(3126),l=RangeError;t.exports=function(t){if(void 0===t)return 0;var r=i(t),a=o(r);if(r!==a)throw new l("Wrong length or index");return a}},5290:(t,r,a)=>{var i=a(4413),o=a(4684);t.exports=function(t){return i(o(t))}},8700:(t,r,a)=>{var i=a(8828);t.exports=function(t){var r=+t;return r!=r||0===r?0:i(r)}},3126:(t,r,a)=>{var i=a(8700),o=Math.min;t.exports=function(t){var r=i(t);return r>0?o(r,9007199254740991):0}},690:(t,r,a)=>{var i=a(4684),o=Object;t.exports=function(t){return o(i(t))}},3250:(t,r,a)=>{var i=a(5904),o=RangeError;t.exports=function(t,r){var a=i(t);if(a%r)throw new o("Wrong offset");return a}},5904:(t,r,a)=>{var i=a(8700),o=RangeError;t.exports=function(t){var r=i(t);if(r<0)throw new o("The argument can't be less than 0");return r}},8732:(t,r,a)=>{var i=a(2615),o=a(8999),l=a(734),c=a(4849),u=a(5899),h=a(4201),d=TypeError,p=h("toPrimitive");t.exports=function(t,r){if(!o(t)||l(t))return t;var a,h=c(t,p);if(h){void 0===r&&(r="default");a=i(h,t,r);if(!o(a)||l(a))return a;throw new d("Can't convert object to primitive value")}void 0===r&&(r="number");return u(t,r)}},8360:(t,r,a)=>{var i=a(8732),o=a(734);t.exports=function(t){var r=i(t,"string");return o(r)?r:r+""}},3043:(t,r,a)=>{var i={};i[a(4201)("toStringTag")]="z";t.exports="[object z]"===String(i)},4327:(t,r,a)=>{var i=a(926),o=String;t.exports=function(t){if("Symbol"===i(t))throw new TypeError("Cannot convert a Symbol value to a string");return o(t)}},7191:t=>{var r=Math.round;t.exports=function(t){var a=r(t);return a<0?0:a>255?255:255&a}},1905:(t,r,a)=>{var i=a(806);t.exports=function(t){try{if(i)return Function('return require("'+t+'")')()}catch(t){}}},3691:t=>{var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},1158:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(2615),c=a(7697),u=a(9800),h=a(4872),d=a(3999),p=a(767),v=a(5684),_=a(5773),y=a(1973),g=a(3126),m=a(9842),b=a(3250),w=a(7191),P=a(8360),k=a(6812),S=a(926),A=a(8999),x=a(734),E=a(5391),I=a(3622),T=a(9385),C=a(2741).f,M=a(1304),G=a(2960).forEach,O=a(4241),R=a(2148),L=a(2560),D=a(2474),j=a(9976),N=a(618),W=a(3457),H=N.get,B=N.set,z=N.enforce,U=L.f,q=D.f,V=o.RangeError,K=d.ArrayBuffer,Y=K.prototype,X=d.DataView,$=h.NATIVE_ARRAY_BUFFER_VIEWS,J=h.TYPED_ARRAY_TAG,Q=h.TypedArray,Z=h.TypedArrayPrototype,ee=h.isTypedArray,te="BYTES_PER_ELEMENT",re="Wrong length",addGetter=function(t,r){R(t,r,{configurable:!0,get:function(){return H(this)[r]}})},isArrayBuffer=function(t){var r;return I(Y,t)||"ArrayBuffer"===(r=S(t))||"SharedArrayBuffer"===r},isTypedArrayIndex=function(t,r){return ee(t)&&!x(r)&&r in t&&y(+r)&&r>=0},ne=function getOwnPropertyDescriptor(t,r){r=P(r);return isTypedArrayIndex(t,r)?v(2,t[r]):q(t,r)},ae=function defineProperty(t,r,a){r=P(r);if(isTypedArrayIndex(t,r)&&A(a)&&k(a,"value")&&!k(a,"get")&&!k(a,"set")&&!a.configurable&&(!k(a,"writable")||a.writable)&&(!k(a,"enumerable")||a.enumerable)){t[r]=a.value;return t}return U(t,r,a)};if(c){if(!$){D.f=ne;L.f=ae;addGetter(Z,"buffer");addGetter(Z,"byteOffset");addGetter(Z,"byteLength");addGetter(Z,"length")}i({target:"Object",stat:!0,forced:!$},{getOwnPropertyDescriptor:ne,defineProperty:ae});t.exports=function(t,r,a){var c=t.match(/\d+/)[0]/8,h=t+(a?"Clamped":"")+"Array",d="get"+t,v="set"+t,y=o[h],P=y,k=P&&P.prototype,S={},addElement=function(t,r){U(t,r,{get:function(){return function(t,r){var a=H(t);return a.view[d](r*c+a.byteOffset,!0)}(this,r)},set:function(t){return function(t,r,i){var o=H(t);o.view[v](r*c+o.byteOffset,a?w(i):i,!0)}(this,r,t)},enumerable:!0})};if($){if(u){P=r((function(t,r,a,i){p(t,k);return W(A(r)?isArrayBuffer(r)?void 0!==i?new y(r,b(a,c),i):void 0!==a?new y(r,b(a,c)):new y(r):ee(r)?j(P,r):l(M,P,r):new y(m(r)),t,P)}));T&&T(P,Q);G(C(y),(function(t){t in P||_(P,t,y[t])}));P.prototype=k}}else{P=r((function(t,r,a,i){p(t,k);var o,u,h,d=0,v=0;if(A(r)){if(!isArrayBuffer(r))return ee(r)?j(P,r):l(M,P,r);o=r;v=b(a,c);var _=r.byteLength;if(void 0===i){if(_%c)throw new V(re);if((u=_-v)<0)throw new V(re)}else if((u=g(i)*c)+v>_)throw new V(re);h=u/c}else{h=m(r);o=new K(u=h*c)}B(t,{buffer:o,byteOffset:v,byteLength:u,length:h,view:new X(o)});for(;d<h;)addElement(t,d++)}));T&&T(P,Q);k=P.prototype=E(Z)}k.constructor!==P&&_(k,"constructor",P);z(k).TypedArrayConstructor=P;J&&_(k,J,h);var x=P!==y;S[h]=P;i({global:!0,constructor:!0,forced:x,sham:!$},S);te in P||_(P,te,c);te in k||_(k,te,c);O(h)}}else t.exports=function(){}},9800:(t,r,a)=>{var i=a(9037),o=a(3689),l=a(6431),c=a(4872).NATIVE_ARRAY_BUFFER_VIEWS,u=i.ArrayBuffer,h=i.Int8Array;t.exports=!c||!o((function(){h(1)}))||!o((function(){new h(-1)}))||!l((function(t){new h;new h(null);new h(1.5);new h(t)}),!0)||o((function(){return 1!==new h(new u(2),1,void 0).length}))},716:(t,r,a)=>{var i=a(9976),o=a(7338);t.exports=function(t,r){return i(o(t),r)}},1304:(t,r,a)=>{var i=a(4071),o=a(2615),l=a(2655),c=a(690),u=a(6310),h=a(5185),d=a(1664),p=a(3292),v=a(9401),_=a(4872).aTypedArrayConstructor,y=a(1530);t.exports=function from(t){var r,a,g,m,b,w,P,k,S=l(this),A=c(t),x=arguments.length,E=x>1?arguments[1]:void 0,I=void 0!==E,T=d(A);if(T&&!p(T)){k=(P=h(A,T)).next;A=[];for(;!(w=o(k,P)).done;)A.push(w.value)}I&&x>2&&(E=i(E,arguments[2]));a=u(A);g=new(_(S))(a);m=v(g);for(r=0;a>r;r++){b=I?E(A[r],r):A[r];g[r]=m?y(b):+b}return g}},7338:(t,r,a)=>{var i=a(4872),o=a(6373),l=i.aTypedArrayConstructor,c=i.getTypedArrayConstructor;t.exports=function(t){return l(o(t,c(t)))}},4630:(t,r,a)=>{var i=a(8844),o=0,l=Math.random(),c=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+c(++o+l,36)}},6837:(t,r,a)=>{var i=a(3689),o=a(4201),l=a(7697),c=a(3931),u=o("iterator");t.exports=!i((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),r=t.searchParams,a=new URLSearchParams("a=1&a=2&b=3"),i="";t.pathname="c%20d";r.forEach((function(t,a){r.delete("b");i+=a+t}));a.delete("a",2);a.delete("b",void 0);return c&&(!t.toJSON||!a.has("a",1)||a.has("a",2)||!a.has("a",void 0)||a.has("b"))||!r.size&&(c||!l)||!r.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[u]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host}))},9525:(t,r,a)=>{var i=a(146);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5648:(t,r,a)=>{var i=a(7697),o=a(3689);t.exports=i&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1500:t=>{var r=TypeError;t.exports=function(t,a){if(t<a)throw new r("Not enough arguments");return t}},9834:(t,r,a)=>{var i=a(9037),o=a(9985),l=i.WeakMap;t.exports=o(l)&&/native code/.test(String(l))},5405:(t,r,a)=>{var i=a(496),o=a(6812),l=a(6145),c=a(2560).f;t.exports=function(t){var r=i.Symbol||(i.Symbol={});o(r,t)||c(r,t,{value:l.f(t)})}},6145:(t,r,a)=>{var i=a(4201);r.f=i},4201:(t,r,a)=>{var i=a(9037),o=a(3430),l=a(6812),c=a(4630),u=a(146),h=a(9525),d=i.Symbol,p=o("wks"),v=h?d.for||d:d&&d.withoutSetter||c;t.exports=function(t){l(p,t)||(p[t]=u&&l(d,t)?d[t]:v("Symbol."+t));return p[t]}},6350:t=>{t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},1064:(t,r,a)=>{var i=a(6058),o=a(6812),l=a(5773),c=a(3622),u=a(9385),h=a(8758),d=a(8055),p=a(3457),v=a(3841),_=a(2570),y=a(5411),g=a(7697),m=a(3931);t.exports=function(t,r,a,b){var w="stackTraceLimit",P=b?2:1,k=t.split("."),S=k[k.length-1],A=i.apply(null,k);if(A){var x=A.prototype;!m&&o(x,"cause")&&delete x.cause;if(!a)return A;var E=i("Error"),I=r((function(t,r){var a=v(b?r:t,void 0),i=b?new A(t):new A;void 0!==a&&l(i,"message",a);y(i,I,i.stack,2);this&&c(x,this)&&p(i,this,I);arguments.length>P&&_(i,arguments[P]);return i}));I.prototype=x;if("Error"!==S)u?u(I,E):h(I,E,{name:!0});else if(g&&w in A){d(I,A,w);d(I,A,"prepareStackTrace")}h(I,A);if(!m)try{x.name!==S&&l(x,"name",S);x.constructor=I}catch(t){}return I}}},2176:(t,r,a)=>{var i=a(9989),o=a(690),l=a(6310),c=a(8700),u=a(7370);i({target:"Array",proto:!0},{at:function at(t){var r=o(this),a=l(r),i=c(t),u=i>=0?i:a+i;return u<0||u>=a?void 0:r[u]}});u("at")},4338:(t,r,a)=>{var i=a(9989),o=a(3689),l=a(2297),c=a(8999),u=a(690),h=a(6310),d=a(5565),p=a(6522),v=a(7120),_=a(9042),y=a(4201),g=a(3615),m=y("isConcatSpreadable"),b=g>=51||!o((function(){var t=[];t[m]=!1;return t.concat()[0]!==t})),isConcatSpreadable=function(t){if(!c(t))return!1;var r=t[m];return void 0!==r?!!r:l(t)};i({target:"Array",proto:!0,arity:1,forced:!b||!_("concat")},{concat:function concat(t){var r,a,i,o,l,c=u(this),_=v(c,0),y=0;for(r=-1,i=arguments.length;r<i;r++)if(isConcatSpreadable(l=-1===r?c:arguments[r])){o=h(l);d(y+o);for(a=0;a<o;a++,y++)a in l&&p(_,y,l[a])}else{d(y+1);p(_,y++,l)}_.length=y;return _}})},1419:(t,r,a)=>{var i=a(9989),o=a(2872),l=a(7370);i({target:"Array",proto:!0},{fill:o});l("fill")},8077:(t,r,a)=>{var i=a(9989),o=a(2960).filter;i({target:"Array",proto:!0,forced:!a(9042)("filter")},{filter:function filter(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},9772:(t,r,a)=>{var i=a(9989),o=a(2960).findIndex,l=a(7370),c="findIndex",u=!0;c in[]&&Array(1)[c]((function(){u=!1}));i({target:"Array",proto:!0,forced:u},{findIndex:function findIndex(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}});l(c)},4564:(t,r,a)=>{var i=a(9989),o=a(7809),l=a(509),c=a(690),u=a(6310),h=a(7120);i({target:"Array",proto:!0},{flatMap:function flatMap(t){var r,a=c(this),i=u(a);l(t);(r=h(a,0)).length=o(r,a,a,i,0,1,t,arguments.length>1?arguments[1]:void 0);return r}})},7049:(t,r,a)=>{var i=a(9989),o=a(1055);i({target:"Array",stat:!0,forced:!a(6431)((function(t){Array.from(t)}))},{from:o})},6801:(t,r,a)=>{var i=a(9989),o=a(4328).includes,l=a(3689),c=a(7370);i({target:"Array",proto:!0,forced:l((function(){return!Array(1).includes()}))},{includes:function includes(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}});c("includes")},7195:(t,r,a)=>{var i=a(9989),o=a(6576),l=a(4328).indexOf,c=a(6834),u=o([].indexOf),h=!!u&&1/u([1],1,-0)<0;i({target:"Array",proto:!0,forced:h||!c("indexOf")},{indexOf:function indexOf(t){var r=arguments.length>1?arguments[1]:void 0;return h?u(this,t,r)||0:l(this,t,r)}})},752:(t,r,a)=>{var i=a(5290),o=a(7370),l=a(9478),c=a(618),u=a(2560).f,h=a(1934),d=a(7807),p=a(3931),v=a(7697),_="Array Iterator",y=c.set,g=c.getterFor(_);t.exports=h(Array,"Array",(function(t,r){y(this,{type:_,target:i(t),index:0,kind:r})}),(function(){var t=g(this),r=t.target,a=t.index++;if(!r||a>=r.length){t.target=void 0;return d(void 0,!0)}switch(t.kind){case"keys":return d(a,!1);case"values":return d(r[a],!1)}return d([a,r[a]],!1)}),"values");var m=l.Arguments=l.Array;o("keys");o("values");o("entries");if(!p&&v&&"values"!==m.name)try{u(m,"name",{value:"values"})}catch(t){}},2410:(t,r,a)=>{var i=a(9989),o=a(953);i({target:"Array",proto:!0,forced:o!==[].lastIndexOf},{lastIndexOf:o})},886:(t,r,a)=>{var i=a(9989),o=a(2960).map;i({target:"Array",proto:!0,forced:!a(9042)("map")},{map:function map(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},560:(t,r,a)=>{var i=a(9989),o=a(690),l=a(6310),c=a(5649),u=a(5565);i({target:"Array",proto:!0,arity:1,forced:a(3689)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function push(t){var r=o(this),a=l(r),i=arguments.length;u(a+i);for(var h=0;h<i;h++){r[a]=arguments[h];a++}c(r,a);return a}})},9730:(t,r,a)=>{var i=a(9989),o=a(2297),l=a(9429),c=a(8999),u=a(7578),h=a(6310),d=a(5290),p=a(6522),v=a(4201),_=a(9042),y=a(6004),g=_("slice"),m=v("species"),b=Array,w=Math.max;i({target:"Array",proto:!0,forced:!g},{slice:function slice(t,r){var a,i,v,_=d(this),g=h(_),P=u(t,g),k=u(void 0===r?g:r,g);if(o(_)){a=_.constructor;(l(a)&&(a===b||o(a.prototype))||c(a)&&null===(a=a[m]))&&(a=void 0);if(a===b||void 0===a)return y(_,P,k)}i=new(void 0===a?b:a)(w(k-P,0));for(v=0;P<k;P++,v++)P in _&&p(i,v,_[P]);i.length=v;return i}})},5137:(t,r,a)=>{var i=a(9989),o=a(8844),l=a(509),c=a(690),u=a(6310),h=a(8494),d=a(4327),p=a(3689),v=a(382),_=a(6834),y=a(7365),g=a(7298),m=a(3615),b=a(7922),w=[],P=o(w.sort),k=o(w.push),S=p((function(){w.sort(void 0)})),A=p((function(){w.sort(null)})),x=_("sort"),E=!p((function(){if(m)return m<70;if(!(y&&y>3)){if(g)return!0;if(b)return b<603;var t,r,a,i,o="";for(t=65;t<76;t++){r=String.fromCharCode(t);switch(t){case 66:case 69:case 70:case 72:a=3;break;case 68:case 71:a=4;break;default:a=2}for(i=0;i<47;i++)w.push({k:r+i,v:a})}w.sort((function(t,r){return r.v-t.v}));for(i=0;i<w.length;i++){r=w[i].k.charAt(0);o.charAt(o.length-1)!==r&&(o+=r)}return"DGBEFHACIJK"!==o}}));i({target:"Array",proto:!0,forced:S||!A||!x||!E},{sort:function sort(t){void 0!==t&&l(t);var r=c(this);if(E)return void 0===t?P(r):P(r,t);var a,i,o=[],p=u(r);for(i=0;i<p;i++)i in r&&k(o,r[i]);v(o,function(t){return function(r,a){return void 0===a?-1:void 0===r?1:void 0!==t?+t(r,a)||0:d(r)>d(a)?1:-1}}(t));a=u(o);i=0;for(;i<a;)r[i]=o[i++];for(;i<p;)h(r,i++);return r}})},2506:(t,r,a)=>{var i=a(9989),o=a(690),l=a(7578),c=a(8700),u=a(6310),h=a(5649),d=a(5565),p=a(7120),v=a(6522),_=a(8494),y=a(9042)("splice"),g=Math.max,m=Math.min;i({target:"Array",proto:!0,forced:!y},{splice:function splice(t,r){var a,i,y,b,w,P,k=o(this),S=u(k),A=l(t,S),x=arguments.length;if(0===x)a=i=0;else if(1===x){a=0;i=S-A}else{a=x-2;i=m(g(c(r),0),S-A)}d(S+a-i);y=p(k,i);for(b=0;b<i;b++)(w=A+b)in k&&v(y,b,k[w]);y.length=i;if(a<i){for(b=A;b<S-i;b++){P=b+a;(w=b+i)in k?k[P]=k[w]:_(k,P)}for(b=S;b>S-i+a;b--)_(k,b-1)}else if(a>i)for(b=S-i;b>A;b--){P=b+a-1;(w=b+i-1)in k?k[P]=k[w]:_(k,P)}for(b=0;b<a;b++)k[b+A]=arguments[b+2];h(k,S-i+a);return y}})},385:(t,r,a)=>{a(7370)("flatMap")},9903:(t,r,a)=>{var i=a(6812),o=a(1880),l=a(1797),c=a(4201)("toPrimitive"),u=Date.prototype;i(u,c)||o(u,c,l)},1057:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(1735),c=a(1064),u="WebAssembly",h=o[u],d=7!==new Error("e",{cause:7}).cause,exportGlobalErrorCauseWrapper=function(t,r){var a={};a[t]=c(t,r,d);i({global:!0,constructor:!0,arity:1,forced:d},a)},exportWebAssemblyErrorCauseWrapper=function(t,r){if(h&&h[t]){var a={};a[t]=c(u+"."+t,r,d);i({target:u,stat:!0,constructor:!0,arity:1,forced:d},a)}};exportGlobalErrorCauseWrapper("Error",(function(t){return function Error(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("EvalError",(function(t){return function EvalError(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("RangeError",(function(t){return function RangeError(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("ReferenceError",(function(t){return function ReferenceError(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("SyntaxError",(function(t){return function SyntaxError(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("TypeError",(function(t){return function TypeError(r){return l(t,this,arguments)}}));exportGlobalErrorCauseWrapper("URIError",(function(t){return function URIError(r){return l(t,this,arguments)}}));exportWebAssemblyErrorCauseWrapper("CompileError",(function(t){return function CompileError(r){return l(t,this,arguments)}}));exportWebAssemblyErrorCauseWrapper("LinkError",(function(t){return function LinkError(r){return l(t,this,arguments)}}));exportWebAssemblyErrorCauseWrapper("RuntimeError",(function(t){return function RuntimeError(r){return l(t,this,arguments)}}))},5398:(t,r,a)=>{var i=a(9989),o=a(9037);i({global:!0,forced:o.globalThis!==o},{globalThis:o})},8324:(t,r,a)=>{var i=a(9989),o=a(6058),l=a(1735),c=a(2615),u=a(8844),h=a(3689),d=a(9985),p=a(734),v=a(6004),_=a(2643),y=a(146),g=String,m=o("JSON","stringify"),b=u(/./.exec),w=u("".charAt),P=u("".charCodeAt),k=u("".replace),S=u(1..toString),A=/[\uD800-\uDFFF]/g,x=/^[\uD800-\uDBFF]$/,E=/^[\uDC00-\uDFFF]$/,I=!y||h((function(){var t=o("Symbol")("stringify detection");return"[null]"!==m([t])||"{}"!==m({a:t})||"{}"!==m(Object(t))})),T=h((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),stringifyWithSymbolsFix=function(t,r){var a=v(arguments),i=_(r);if(d(i)||void 0!==t&&!p(t)){a[1]=function(t,r){d(i)&&(r=c(i,this,g(t),r));if(!p(r))return r};return l(m,null,a)}},fixIllFormed=function(t,r,a){var i=w(a,r-1),o=w(a,r+1);return b(x,t)&&!b(E,o)||b(E,t)&&!b(x,i)?"\\u"+S(P(t,0),16):t};m&&i({target:"JSON",stat:!0,arity:3,forced:I||T},{stringify:function stringify(t,r,a){var i=v(arguments),o=l(I?stringifyWithSymbolsFix:m,null,i);return T&&"string"==typeof o?k(o,A,fixIllFormed):o}})},7629:(t,r,a)=>{var i=a(9037);a(5997)(i.JSON,"JSON",!0)},9322:(t,r,a)=>{a(319)("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),a(800))},6646:(t,r,a)=>{a(9322)},5499:(t,r,a)=>{a(9989)({target:"Math",stat:!0},{fround:a(7788)})},9944:(t,r,a)=>{var i=a(9989),o=Math.hypot,l=Math.abs,c=Math.sqrt;i({target:"Math",stat:!0,arity:2,forced:!!o&&o(1/0,NaN)!==1/0},{hypot:function hypot(t,r){for(var a,i,o=0,u=0,h=arguments.length,d=0;u<h;)if(d<(a=l(arguments[u++]))){o=o*(i=d/a)*i+1;d=a}else o+=a>0?(i=a/d)*i:a;return d===1/0?1/0:d*c(o)}})},6976:(t,r,a)=>{a(9989)({target:"Math",stat:!0},{sign:a(5680)})},7509:(t,r,a)=>{a(5997)(Math,"Math",!0)},9288:(t,r,a)=>{var i=a(9989),o=a(3931),l=a(7697),c=a(9037),u=a(496),h=a(8844),d=a(5266),p=a(6812),v=a(3457),_=a(3622),y=a(734),g=a(8732),m=a(3689),b=a(2741).f,w=a(2474).f,P=a(2560).f,k=a(3648),S=a(1435).trim,A="Number",x=c[A],E=u[A],I=x.prototype,T=c.TypeError,C=h("".slice),M=h("".charCodeAt),toNumber=function(t){var r,a,i,o,l,c,u,h,d=g(t,"number");if(y(d))throw new T("Cannot convert a Symbol value to a number");if("string"==typeof d&&d.length>2){d=S(d);if(43===(r=M(d,0))||45===r){if(88===(a=M(d,2))||120===a)return NaN}else if(48===r){switch(M(d,1)){case 66:case 98:i=2;o=49;break;case 79:case 111:i=8;o=55;break;default:return+d}c=(l=C(d,2)).length;for(u=0;u<c;u++)if((h=M(l,u))<48||h>o)return NaN;return parseInt(l,i)}}return+d},G=d(A,!x(" 0o1")||!x("0b1")||x("+0x1")),O=function Number(t){var r,a=arguments.length<1?0:x(function(t){var r=g(t,"number");return"bigint"==typeof r?r:toNumber(r)}(t));return _(I,r=this)&&m((function(){k(r)}))?v(Object(a),this,O):a};O.prototype=I;G&&!o&&(I.constructor=O);i({global:!0,constructor:!0,wrap:!0,forced:G},{Number:O});var copyConstructorProperties=function(t,r){for(var a,i=l?b(r):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;i.length>o;o++)p(r,a=i[o])&&!p(t,a)&&P(t,a,w(r,a))};o&&E&&copyConstructorProperties(u[A],E);(G||o)&&copyConstructorProperties(u[A],x)},429:(t,r,a)=>{var i=a(9989),o=a(5394);i({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},6585:(t,r,a)=>{var i=a(9989),o=a(9419).entries;i({target:"Object",stat:!0},{entries:function entries(t){return o(t)}})},1830:(t,r,a)=>{var i=a(9989),o=a(1594),l=a(3689),c=a(8999),u=a(5375).onFreeze,h=Object.freeze;i({target:"Object",stat:!0,forced:l((function(){h(1)})),sham:!o},{freeze:function freeze(t){return h&&c(t)?h(u(t)):t}})},1919:(t,r,a)=>{var i=a(9989),o=a(3689),l=a(5290),c=a(2474).f,u=a(7697);i({target:"Object",stat:!0,forced:!u||o((function(){c(1)})),sham:!u},{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(t,r){return c(l(t),r)}})},9474:(t,r,a)=>{var i=a(9989),o=a(7697),l=a(9152),c=a(5290),u=a(2474),h=a(6522);i({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(t){for(var r,a,i=c(t),o=u.f,d=l(i),p={},v=0;d.length>v;)void 0!==(a=o(i,r=d[v++]))&&h(p,r,a);return p}})},9434:(t,r,a)=>{var i=a(9989),o=a(146),l=a(3689),c=a(7518),u=a(690);i({target:"Object",stat:!0,forced:!o||l((function(){c.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(t){var r=c.f;return r?r(u(t)):[]}})},8052:(t,r,a)=>{var i=a(9989),o=a(3689),l=a(690),c=a(1868),u=a(1748);i({target:"Object",stat:!0,forced:o((function(){c(1)})),sham:!u},{getPrototypeOf:function getPrototypeOf(t){return c(l(t))}})},9358:(t,r,a)=>{var i=a(9989),o=a(690),l=a(300);i({target:"Object",stat:!0,forced:a(3689)((function(){l(1)}))},{keys:function keys(t){return l(o(t))}})},228:(t,r,a)=>{var i=a(3043),o=a(1880),l=a(5073);i||o(Object.prototype,"toString",l,{unsafe:!0})},6466:(t,r,a)=>{var i=a(9989),o=a(9419).values;i({target:"Object",stat:!0},{values:function values(t){return o(t)}})},1195:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(509),c=a(8742),u=a(9302),h=a(8734);i({target:"Promise",stat:!0,forced:a(562)},{allSettled:function allSettled(t){var r=this,a=c.f(r),i=a.resolve,d=a.reject,p=u((function(){var a=l(r.resolve),c=[],u=0,d=1;h(t,(function(t){var l=u++,h=!1;d++;o(a,r,t).then((function(t){if(!h){h=!0;c[l]={status:"fulfilled",value:t};--d||i(c)}}),(function(t){if(!h){h=!0;c[l]={status:"rejected",reason:t};--d||i(c)}}))}));--d||i(c)}));p.error&&d(p.value);return a.promise}})},1692:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(509),c=a(8742),u=a(9302),h=a(8734);i({target:"Promise",stat:!0,forced:a(562)},{all:function all(t){var r=this,a=c.f(r),i=a.resolve,d=a.reject,p=u((function(){var a=l(r.resolve),c=[],u=0,p=1;h(t,(function(t){var l=u++,h=!1;p++;o(a,r,t).then((function(t){if(!h){h=!0;c[l]=t;--p||i(c)}}),d)}));--p||i(c)}));p.error&&d(p.value);return a.promise}})},5089:(t,r,a)=>{var i=a(9989),o=a(3931),l=a(7073).CONSTRUCTOR,c=a(7919),u=a(6058),h=a(9985),d=a(1880),p=c&&c.prototype;i({target:"Promise",proto:!0,forced:l,real:!0},{catch:function(t){return this.then(void 0,t)}});if(!o&&h(c)){var v=u("Promise").prototype.catch;p.catch!==v&&d(p,"catch",v,{unsafe:!0})}},6697:(t,r,a)=>{var i,o,l,c=a(9989),u=a(3931),h=a(806),d=a(9037),p=a(2615),v=a(1880),_=a(9385),y=a(5997),g=a(4241),m=a(509),b=a(9985),w=a(8999),P=a(767),k=a(6373),S=a(9886).set,A=a(231),x=a(920),E=a(9302),I=a(4410),T=a(618),C=a(7919),M=a(7073),G=a(8742),O="Promise",R=M.CONSTRUCTOR,L=M.REJECTION_EVENT,D=M.SUBCLASSING,j=T.getterFor(O),N=T.set,W=C&&C.prototype,H=C,B=W,z=d.TypeError,U=d.document,q=d.process,V=G.f,K=V,Y=!!(U&&U.createEvent&&d.dispatchEvent),X="unhandledrejection",isThenable=function(t){var r;return!(!w(t)||!b(r=t.then))&&r},callReaction=function(t,r){var a,i,o,l=r.value,c=1===r.state,u=c?t.ok:t.fail,h=t.resolve,d=t.reject,v=t.domain;try{if(u){if(!c){2===r.rejection&&onHandleUnhandled(r);r.rejection=1}if(!0===u)a=l;else{v&&v.enter();a=u(l);if(v){v.exit();o=!0}}a===t.promise?d(new z("Promise-chain cycle")):(i=isThenable(a))?p(i,a,h,d):h(a)}else d(l)}catch(t){v&&!o&&v.exit();d(t)}},notify=function(t,r){if(!t.notified){t.notified=!0;A((function(){for(var a,i=t.reactions;a=i.get();)callReaction(a,t);t.notified=!1;r&&!t.rejection&&onUnhandled(t)}))}},dispatchEvent=function(t,r,a){var i,o;if(Y){(i=U.createEvent("Event")).promise=r;i.reason=a;i.initEvent(t,!1,!0);d.dispatchEvent(i)}else i={promise:r,reason:a};!L&&(o=d["on"+t])?o(i):t===X&&x("Unhandled promise rejection",a)},onUnhandled=function(t){p(S,d,(function(){var r,a=t.facade,i=t.value;if(isUnhandled(t)){r=E((function(){h?q.emit("unhandledRejection",i,a):dispatchEvent(X,a,i)}));t.rejection=h||isUnhandled(t)?2:1;if(r.error)throw r.value}}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){p(S,d,(function(){var r=t.facade;h?q.emit("rejectionHandled",r):dispatchEvent("rejectionhandled",r,t.value)}))},bind=function(t,r,a){return function(i){t(r,i,a)}},internalReject=function(t,r,a){if(!t.done){t.done=!0;a&&(t=a);t.value=r;t.state=2;notify(t,!0)}},internalResolve=function(t,r,a){if(!t.done){t.done=!0;a&&(t=a);try{if(t.facade===r)throw new z("Promise can't be resolved itself");var i=isThenable(r);if(i)A((function(){var a={done:!1};try{p(i,r,bind(internalResolve,a,t),bind(internalReject,a,t))}catch(r){internalReject(a,r,t)}}));else{t.value=r;t.state=1;notify(t,!1)}}catch(r){internalReject({done:!1},r,t)}}};if(R){B=(H=function Promise(t){P(this,B);m(t);p(i,this);var r=j(this);try{t(bind(internalResolve,r),bind(internalReject,r))}catch(t){internalReject(r,t)}}).prototype;(i=function Promise(t){N(this,{type:O,done:!1,notified:!1,parent:!1,reactions:new I,rejection:!1,state:0,value:void 0})}).prototype=v(B,"then",(function then(t,r){var a=j(this),i=V(k(this,H));a.parent=!0;i.ok=!b(t)||t;i.fail=b(r)&&r;i.domain=h?q.domain:void 0;0===a.state?a.reactions.add(i):A((function(){callReaction(i,a)}));return i.promise}));o=function(){var t=new i,r=j(t);this.promise=t;this.resolve=bind(internalResolve,r);this.reject=bind(internalReject,r)};G.f=V=function(t){return t===H||undefined===t?new o(t):K(t)};if(!u&&b(C)&&W!==Object.prototype){l=W.then;D||v(W,"then",(function then(t,r){var a=this;return new H((function(t,r){p(l,a,t,r)})).then(t,r)}),{unsafe:!0});try{delete W.constructor}catch(t){}_&&_(W,B)}}c({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:H});y(H,O,!1,!0);g(O)},6409:(t,r,a)=>{var i=a(9989),o=a(3931),l=a(7919),c=a(3689),u=a(6058),h=a(9985),d=a(6373),p=a(2945),v=a(1880),_=l&&l.prototype;i({target:"Promise",proto:!0,real:!0,forced:!!l&&c((function(){_.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var r=d(this,u("Promise")),a=h(t);return this.then(a?function(a){return p(r,t()).then((function(){return a}))}:t,a?function(a){return p(r,t()).then((function(){throw a}))}:t)}});if(!o&&h(l)){var y=u("Promise").prototype.finally;_.finally!==y&&v(_,"finally",y,{unsafe:!0})}},3964:(t,r,a)=>{a(6697);a(1692);a(5089);a(8829);a(2092);a(7905)},8829:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(509),c=a(8742),u=a(9302),h=a(8734);i({target:"Promise",stat:!0,forced:a(562)},{race:function race(t){var r=this,a=c.f(r),i=a.reject,d=u((function(){var c=l(r.resolve);h(t,(function(t){o(c,r,t).then(a.resolve,i)}))}));d.error&&i(d.value);return a.promise}})},2092:(t,r,a)=>{var i=a(9989),o=a(8742);i({target:"Promise",stat:!0,forced:a(7073).CONSTRUCTOR},{reject:function reject(t){var r=o.f(this);(0,r.reject)(t);return r.promise}})},7905:(t,r,a)=>{var i=a(9989),o=a(6058),l=a(3931),c=a(7919),u=a(7073).CONSTRUCTOR,h=a(2945),d=o("Promise"),p=l&&!u;i({target:"Promise",stat:!0,forced:l||u},{resolve:function resolve(t){return h(p&&this===d?c:this,t)}})},50:(t,r,a)=>{var i=a(9989),o=a(6058),l=a(1735),c=a(6761),u=a(2655),h=a(5027),d=a(8999),p=a(5391),v=a(3689),_=o("Reflect","construct"),y=Object.prototype,g=[].push,m=v((function(){function F(){}return!(_((function(){}),[],F)instanceof F)})),b=!v((function(){_((function(){}))})),w=m||b;i({target:"Reflect",stat:!0,forced:w,sham:w},{construct:function construct(t,r){u(t);h(r);var a=arguments.length<3?t:u(arguments[2]);if(b&&!m)return _(t,r,a);if(t===a){switch(r.length){case 0:return new t;case 1:return new t(r[0]);case 2:return new t(r[0],r[1]);case 3:return new t(r[0],r[1],r[2]);case 4:return new t(r[0],r[1],r[2],r[3])}var i=[null];l(g,i,r);return new(l(c,t,i))}var o=a.prototype,v=p(d(o)?o:y),w=l(t,v,r);return d(w)?w:v}})},2349:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(8999),c=a(5027),u=a(6251),h=a(2474),d=a(1868);i({target:"Reflect",stat:!0},{get:function get(t,r){var a,i,p=arguments.length<3?t:arguments[2];return c(t)===p?t[r]:(a=h.f(t,r))?u(a)?a.value:void 0===a.get?void 0:o(a.get,p):l(i=d(t))?get(i,r,p):void 0}})},6034:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(5997);i({global:!0},{Reflect:{}});l(o.Reflect,"Reflect",!0)},2003:(t,r,a)=>{var i=a(7697),o=a(9037),l=a(8844),c=a(5266),u=a(3457),h=a(5773),d=a(5391),p=a(2741).f,v=a(3622),_=a(1245),y=a(4327),g=a(3477),m=a(7901),b=a(8055),w=a(1880),P=a(3689),k=a(6812),S=a(618).enforce,A=a(4241),x=a(4201),E=a(2100),I=a(6422),T=x("match"),C=o.RegExp,M=C.prototype,G=o.SyntaxError,O=l(M.exec),R=l("".charAt),L=l("".replace),D=l("".indexOf),j=l("".slice),N=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,W=/a/g,H=/a/g,B=new C(W)!==W,z=m.MISSED_STICKY,U=m.UNSUPPORTED_Y,q=i&&(!B||z||E||I||P((function(){H[T]=!1;return C(W)!==W||C(H)===H||"/a/i"!==String(C(W,"i"))})));if(c("RegExp",q)){for(var V=function RegExp(t,r){var a,i,o,l,c,p,m=v(M,this),b=_(t),w=void 0===r,P=[],A=t;if(!m&&b&&w&&t.constructor===V)return t;if(b||v(M,t)){t=t.source;w&&(r=g(A))}t=void 0===t?"":y(t);r=void 0===r?"":y(r);A=t;E&&"dotAll"in W&&(i=!!r&&D(r,"s")>-1)&&(r=L(r,/s/g,""));a=r;z&&"sticky"in W&&(o=!!r&&D(r,"y")>-1)&&U&&(r=L(r,/y/g,""));if(I){l=function(t){for(var r,a=t.length,i=0,o="",l=[],c=d(null),u=!1,h=!1,p=0,v="";i<=a;i++){if("\\"===(r=R(t,i)))r+=R(t,++i);else if("]"===r)u=!1;else if(!u)switch(!0){case"["===r:u=!0;break;case"("===r:if(O(N,j(t,i+1))){i+=2;h=!0}o+=r;p++;continue;case">"===r&&h:if(""===v||k(c,v))throw new G("Invalid capture group name");c[v]=!0;l[l.length]=[v,p];h=!1;v="";continue}h?v+=r:o+=r}return[o,l]}(t);t=l[0];P=l[1]}c=u(C(t,r),m?this:M,V);if(i||o||P.length){p=S(c);if(i){p.dotAll=!0;p.raw=V(function(t){for(var r,a=t.length,i=0,o="",l=!1;i<=a;i++)if("\\"!==(r=R(t,i)))if(l||"."!==r){"["===r?l=!0:"]"===r&&(l=!1);o+=r}else o+="[\\s\\S]";else o+=r+R(t,++i);return o}(t),a)}o&&(p.sticky=!0);P.length&&(p.groups=P)}if(t!==A)try{h(c,"source",""===A?"(?:)":A)}catch(t){}return c},K=p(C),Y=0;K.length>Y;)b(V,C,K[Y++]);M.constructor=V;V.prototype=M;w(o,"RegExp",V,{constructor:!0})}A("RegExp")},8518:(t,r,a)=>{var i=a(7697),o=a(2100),l=a(6648),c=a(2148),u=a(618).get,h=RegExp.prototype,d=TypeError;i&&o&&c(h,"dotAll",{configurable:!0,get:function dotAll(){if(this!==h){if("RegExp"===l(this))return!!u(this).dotAll;throw new d("Incompatible receiver, RegExp required")}}})},4043:(t,r,a)=>{var i=a(9989),o=a(6308);i({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},3440:(t,r,a)=>{var i=a(7697),o=a(7901).MISSED_STICKY,l=a(6648),c=a(2148),u=a(618).get,h=RegExp.prototype,d=TypeError;i&&o&&c(h,"sticky",{configurable:!0,get:function sticky(){if(this!==h){if("RegExp"===l(this))return!!u(this).sticky;throw new d("Incompatible receiver, RegExp required")}}})},7409:(t,r,a)=>{a(4043);var i=a(9989),o=a(2615),l=a(9985),c=a(5027),u=a(4327),h=function(){var t=!1,r=/[ac]/;r.exec=function(){t=!0;return/./.exec.apply(this,arguments)};return!0===r.test("abc")&&t}(),d=/./.test;i({target:"RegExp",proto:!0,forced:!h},{test:function(t){var r=c(this),a=u(t),i=r.exec;if(!l(i))return o(d,r,a);var h=o(i,r,a);if(null===h)return!1;c(h);return!0}})},2826:(t,r,a)=>{var i=a(1236).PROPER,o=a(1880),l=a(5027),c=a(4327),u=a(3689),h=a(3477),d="toString",p=RegExp.prototype,v=p[d],_=u((function(){return"/a/b"!==v.call({source:"a",flags:"b"})})),y=i&&v.name!==d;(_||y)&&o(p,d,(function toString(){var t=l(this);return"/"+c(t.source)+"/"+c(h(t))}),{unsafe:!0})},7985:(t,r,a)=>{a(319)("Set",(function(t){return function Set(){return t(this,arguments.length?arguments[0]:void 0)}}),a(800))},9649:(t,r,a)=>{a(7985)},7961:(t,r,a)=>{var i=a(9989),o=a(8844),l=a(4684),c=a(8700),u=a(4327),h=a(3689),d=o("".charAt);i({target:"String",proto:!0,forced:h((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function at(t){var r=u(l(this)),a=r.length,i=c(t),o=i>=0?i:a+i;return o<0||o>=a?void 0:d(r,o)}})},2918:(t,r,a)=>{var i,o=a(9989),l=a(6576),c=a(2474).f,u=a(3126),h=a(4327),d=a(2124),p=a(4684),v=a(7413),_=a(3931),y=l("".slice),g=Math.min,m=v("endsWith");o({target:"String",proto:!0,forced:!(!_&&!m&&!!(i=c(String.prototype,"endsWith"),i&&!i.writable))&&!m},{endsWith:function endsWith(t){var r=h(p(this));d(t);var a=arguments.length>1?arguments[1]:void 0,i=r.length,o=void 0===a?i:g(u(a),i),l=h(t);return y(r,o-l.length,o)===l}})},3843:(t,r,a)=>{var i=a(9989),o=a(8844),l=a(2124),c=a(4684),u=a(4327),h=a(7413),d=o("".indexOf);i({target:"String",proto:!0,forced:!h("includes")},{includes:function includes(t){return!!~d(u(c(this)),u(l(t)),arguments.length>1?arguments[1]:void 0)}})},1694:(t,r,a)=>{var i=a(730).charAt,o=a(4327),l=a(618),c=a(1934),u=a(7807),h="String Iterator",d=l.set,p=l.getterFor(h);c(String,"String",(function(t){d(this,{type:h,string:o(t),index:0})}),(function next(){var t,r=p(this),a=r.string,o=r.index;if(o>=a.length)return u(void 0,!0);t=i(a,o);r.index+=t.length;return u(t,!1)}))},2462:(t,r,a)=>{var i=a(2615),o=a(8678),l=a(5027),c=a(981),u=a(3126),h=a(4327),d=a(4684),p=a(4849),v=a(1514),_=a(6100);o("match",(function(t,r,a){return[function match(r){var a=d(this),o=c(r)?void 0:p(r,t);return o?i(o,r,a):new RegExp(r)[t](h(a))},function(t){var i=l(this),o=h(t),c=a(r,i,o);if(c.done)return c.value;if(!i.global)return _(i,o);var d=i.unicode;i.lastIndex=0;for(var p,y=[],g=0;null!==(p=_(i,o));){var m=h(p[0]);y[g]=m;""===m&&(i.lastIndex=v(o,u(i.lastIndex),d));g++}return 0===g?null:y}]}))},2940:(t,r,a)=>{var i=a(9989),o=a(7254).end;i({target:"String",proto:!0,forced:a(5947)},{padEnd:function padEnd(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},8472:(t,r,a)=>{var i=a(9989),o=a(7254).start;i({target:"String",proto:!0,forced:a(5947)},{padStart:function padStart(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},6532:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(8844),c=a(4684),u=a(9985),h=a(981),d=a(1245),p=a(4327),v=a(4849),_=a(3477),y=a(7017),g=a(4201),m=a(3931),b=g("replace"),w=TypeError,P=l("".indexOf),k=l("".replace),S=l("".slice),A=Math.max;i({target:"String",proto:!0},{replaceAll:function replaceAll(t,r){var a,i,l,g,x,E,I,T,C,M=c(this),G=0,O=0,R="";if(!h(t)){if(a=d(t)){i=p(c(_(t)));if(!~P(i,"g"))throw new w("`.replaceAll` does not allow non-global regexes")}if(l=v(t,b))return o(l,t,M,r);if(m&&a)return k(p(M),t,r)}g=p(M);x=p(t);(E=u(r))||(r=p(r));I=x.length;T=A(1,I);G=P(g,x);for(;-1!==G;){C=E?p(r(x,G,g)):y(x,g,G,[],void 0,r);R+=S(g,O,G)+C;O=G+I;G=G+T>g.length?-1:P(g,x,G+T)}O<g.length&&(R+=S(g,O));return R}})},7267:(t,r,a)=>{var i=a(1735),o=a(2615),l=a(8844),c=a(8678),u=a(3689),h=a(5027),d=a(9985),p=a(981),v=a(8700),_=a(3126),y=a(4327),g=a(4684),m=a(1514),b=a(4849),w=a(7017),P=a(6100),k=a(4201)("replace"),S=Math.max,A=Math.min,x=l([].concat),E=l([].push),I=l("".indexOf),T=l("".slice),C="$0"==="a".replace(/./,"$0"),M=!!/./[k]&&""===/./[k]("a","$0");c("replace",(function(t,r,a){var l=M?"$":"$0";return[function replace(t,a){var i=g(this),l=p(t)?void 0:b(t,k);return l?o(l,t,i,a):o(r,y(i),t,a)},function(t,o){var c=h(this),u=y(t);if("string"==typeof o&&-1===I(o,l)&&-1===I(o,"$<")){var p=a(r,c,u,o);if(p.done)return p.value}var g=d(o);g||(o=y(o));var b,k=c.global;if(k){b=c.unicode;c.lastIndex=0}for(var C,M=[];null!==(C=P(c,u));){E(M,C);if(!k)break;""===y(C[0])&&(c.lastIndex=m(u,_(c.lastIndex),b))}for(var G,O="",R=0,L=0;L<M.length;L++){for(var D,j=y((C=M[L])[0]),N=S(A(v(C.index),u.length),0),W=[],H=1;H<C.length;H++)E(W,void 0===(G=C[H])?G:String(G));var B=C.groups;if(g){var z=x([j],W,N,u);void 0!==B&&E(z,B);D=y(i(o,void 0,z))}else D=w(j,u,N,W,B,o);if(N>=R){O+=T(u,R,N)+D;R=N+j.length}}return O+T(u,R)}]}),!!u((function(){var t=/./;t.exec=function(){var t=[];t.groups={a:"7"};return t};return"7"!=="".replace(t,"$<a>")}))||!C||M)},9873:(t,r,a)=>{var i=a(2615),o=a(8844),l=a(8678),c=a(5027),u=a(981),h=a(4684),d=a(6373),p=a(1514),v=a(3126),_=a(4327),y=a(4849),g=a(6100),m=a(7901),b=a(3689),w=m.UNSUPPORTED_Y,P=Math.min,k=o([].push),S=o("".slice),A=!b((function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var a="ab".split(t);return 2!==a.length||"a"!==a[0]||"b"!==a[1]})),x="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;l("split",(function(t,r,a){var o="0".split(void 0,0).length?function(t,a){return void 0===t&&0===a?[]:i(r,this,t,a)}:r;return[function split(r,a){var l=h(this),c=u(r)?void 0:y(r,t);return c?i(c,r,l,a):i(o,_(l),r,a)},function(t,i){var l=c(this),u=_(t);if(!x){var h=a(o,l,u,i,o!==r);if(h.done)return h.value}var y=d(l,RegExp),m=l.unicode,b=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(w?"g":"y"),A=new y(w?"^(?:"+l.source+")":l,b),E=void 0===i?4294967295:i>>>0;if(0===E)return[];if(0===u.length)return null===g(A,u)?[u]:[];for(var I=0,T=0,C=[];T<u.length;){A.lastIndex=w?0:T;var M,G=g(A,w?S(u,T):u);if(null===G||(M=P(v(A.lastIndex+(w?T:0)),u.length))===I)T=p(u,T,m);else{k(C,S(u,I,T));if(C.length===E)return C;for(var O=1;O<=G.length-1;O++){k(C,G[O]);if(C.length===E)return C}T=I=M}}k(C,S(u,I));return C}]}),x||!A,w)},268:(t,r,a)=>{var i,o=a(9989),l=a(6576),c=a(2474).f,u=a(3126),h=a(4327),d=a(2124),p=a(4684),v=a(7413),_=a(3931),y=l("".slice),g=Math.min,m=v("startsWith");o({target:"String",proto:!0,forced:!(!_&&!m&&!!(i=c(String.prototype,"startsWith"),i&&!i.writable))&&!m},{startsWith:function startsWith(t){var r=h(p(this));d(t);var a=u(g(arguments.length>1?arguments[1]:void 0,r.length)),i=h(t);return y(r,a,a+i.length)===i}})},6386:(t,r,a)=>{a(1313);var i=a(9989),o=a(9558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==o},{trimEnd:o})},1313:(t,r,a)=>{var i=a(9989),o=a(9558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==o},{trimRight:o})},8436:(t,r,a)=>{var i=a(9989),o=a(1435).trim;i({target:"String",proto:!0,forced:a(5984)("trim")},{trim:function trim(){return o(this)}})},8373:(t,r,a)=>{a(5405)("asyncIterator")},7855:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(2615),c=a(8844),u=a(3931),h=a(7697),d=a(146),p=a(3689),v=a(6812),_=a(3622),y=a(5027),g=a(5290),m=a(8360),b=a(4327),w=a(5684),P=a(5391),k=a(300),S=a(2741),A=a(6062),x=a(7518),E=a(2474),I=a(2560),T=a(8920),C=a(9556),M=a(1880),G=a(2148),O=a(3430),R=a(2713),L=a(7248),D=a(4630),j=a(4201),N=a(6145),W=a(5405),H=a(3032),B=a(5997),z=a(618),U=a(2960).forEach,q=R("hidden"),V="Symbol",K="prototype",Y=z.set,X=z.getterFor(V),$=Object[K],J=o.Symbol,Q=J&&J[K],Z=o.RangeError,ee=o.TypeError,te=o.QObject,re=E.f,ne=I.f,ae=A.f,ie=C.f,oe=c([].push),se=O("symbols"),le=O("op-symbols"),ce=O("wks"),ue=!te||!te[K]||!te[K].findChild,fallbackDefineProperty=function(t,r,a){var i=re($,r);i&&delete $[r];ne(t,r,a);i&&t!==$&&ne($,r,i)},he=h&&p((function(){return 7!==P(ne({},"a",{get:function(){return ne(this,"a",{value:7}).a}})).a}))?fallbackDefineProperty:ne,wrap=function(t,r){var a=se[t]=P(Q);Y(a,{type:V,tag:t,description:r});h||(a.description=r);return a},de=function defineProperty(t,r,a){t===$&&de(le,r,a);y(t);var i=m(r);y(a);if(v(se,i)){if(a.enumerable){v(t,q)&&t[q][i]&&(t[q][i]=!1);a=P(a,{enumerable:w(0,!1)})}else{v(t,q)||ne(t,q,w(1,P(null)));t[q][i]=!0}return he(t,i,a)}return ne(t,i,a)},fe=function defineProperties(t,r){y(t);var a=g(r),i=k(a).concat($getOwnPropertySymbols(a));U(i,(function(r){h&&!l(pe,a,r)||de(t,r,a[r])}));return t},pe=function propertyIsEnumerable(t){var r=m(t),a=l(ie,this,r);return!(this===$&&v(se,r)&&!v(le,r))&&(!(a||!v(this,r)||!v(se,r)||v(this,q)&&this[q][r])||a)},ve=function getOwnPropertyDescriptor(t,r){var a=g(t),i=m(r);if(a!==$||!v(se,i)||v(le,i)){var o=re(a,i);!o||!v(se,i)||v(a,q)&&a[q][i]||(o.enumerable=!0);return o}},_e=function getOwnPropertyNames(t){var r=ae(g(t)),a=[];U(r,(function(t){v(se,t)||v(L,t)||oe(a,t)}));return a},$getOwnPropertySymbols=function(t){var r=t===$,a=ae(r?le:g(t)),i=[];U(a,(function(t){!v(se,t)||r&&!v($,t)||oe(i,se[t])}));return i};if(!d){M(Q=(J=function Symbol(){if(_(Q,this))throw new ee("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?b(arguments[0]):void 0,r=D(t),setter=function(t){var a=void 0===this?o:this;a===$&&l(setter,le,t);v(a,q)&&v(a[q],r)&&(a[q][r]=!1);var i=w(1,t);try{he(a,r,i)}catch(t){if(!(t instanceof Z))throw t;fallbackDefineProperty(a,r,i)}};h&&ue&&he($,r,{configurable:!0,set:setter});return wrap(r,t)})[K],"toString",(function toString(){return X(this).tag}));M(J,"withoutSetter",(function(t){return wrap(D(t),t)}));C.f=pe;I.f=de;T.f=fe;E.f=ve;S.f=A.f=_e;x.f=$getOwnPropertySymbols;N.f=function(t){return wrap(j(t),t)};if(h){G(Q,"description",{configurable:!0,get:function description(){return X(this).description}});u||M($,"propertyIsEnumerable",pe,{unsafe:!0})}}i({global:!0,constructor:!0,wrap:!0,forced:!d,sham:!d},{Symbol:J});U(k(ce),(function(t){W(t)}));i({target:V,stat:!0,forced:!d},{useSetter:function(){ue=!0},useSimple:function(){ue=!1}});i({target:"Object",stat:!0,forced:!d,sham:!h},{create:function create(t,r){return void 0===r?P(t):fe(P(t),r)},defineProperty:de,defineProperties:fe,getOwnPropertyDescriptor:ve});i({target:"Object",stat:!0,forced:!d},{getOwnPropertyNames:_e});H();B(J,V);L[q]=!0},6544:(t,r,a)=>{var i=a(9989),o=a(7697),l=a(9037),c=a(8844),u=a(6812),h=a(9985),d=a(3622),p=a(4327),v=a(2148),_=a(8758),y=l.Symbol,g=y&&y.prototype;if(o&&h(y)&&(!("description"in g)||void 0!==y().description)){var m={},b=function Symbol(){var t=arguments.length<1||void 0===arguments[0]?void 0:p(arguments[0]),r=d(g,this)?new y(t):void 0===t?y():y(t);""===t&&(m[r]=!0);return r};_(b,y);b.prototype=g;g.constructor=b;var w="Symbol(description detection)"===String(y("description detection")),P=c(g.valueOf),k=c(g.toString),S=/^Symbol\((.*)\)[^)]+$/,A=c("".replace),x=c("".slice);v(g,"description",{configurable:!0,get:function description(){var t=P(this);if(u(m,t))return"";var r=k(t),a=w?x(r,7,-1):A(r,S,"$1");return""===a?void 0:a}});i({global:!0,constructor:!0,forced:!0},{Symbol:b})}},3975:(t,r,a)=>{var i=a(9989),o=a(6058),l=a(6812),c=a(4327),u=a(3430),h=a(6549),d=u("string-to-symbol-registry"),p=u("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!h},{for:function(t){var r=c(t);if(l(d,r))return d[r];var a=o("Symbol")(r);d[r]=a;p[a]=r;return a}})},4254:(t,r,a)=>{a(5405)("iterator")},9749:(t,r,a)=>{a(7855);a(3975);a(1445);a(8324);a(9434)},1445:(t,r,a)=>{var i=a(9989),o=a(6812),l=a(734),c=a(3691),u=a(3430),h=a(6549),d=u("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!h},{keyFor:function keyFor(t){if(!l(t))throw new TypeError(c(t)+" is not a symbol");if(o(d,t))return d[t]}})},9373:(t,r,a)=>{var i=a(5405),o=a(3032);i("toPrimitive");o()},6793:(t,r,a)=>{var i=a(6058),o=a(5405),l=a(5997);o("toStringTag");l(i("Symbol"),"Symbol")},5194:(t,r,a)=>{var i=a(4872),o=a(6310),l=a(8700),c=i.aTypedArray;(0,i.exportTypedArrayMethod)("at",(function at(t){var r=c(this),a=o(r),i=l(t),u=i>=0?i:a+i;return u<0||u>=a?void 0:r[u]}))},6664:(t,r,a)=>{var i=a(8844),o=a(4872),l=i(a(357)),c=o.aTypedArray;(0,o.exportTypedArrayMethod)("copyWithin",(function copyWithin(t,r){return l(c(this),t,r,arguments.length>2?arguments[2]:void 0)}))},5980:(t,r,a)=>{var i=a(4872),o=a(2960).every,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("every",(function every(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},9943:(t,r,a)=>{var i=a(4872),o=a(2872),l=a(1530),c=a(926),u=a(2615),h=a(8844),d=a(3689),p=i.aTypedArray,v=i.exportTypedArrayMethod,_=h("".slice);v("fill",(function fill(t){var r=arguments.length;p(this);var a="Big"===_(c(this),0,3)?l(t):+t;return u(o,this,a,r>1?arguments[1]:void 0,r>2?arguments[2]:void 0)}),d((function(){var t=0;new Int8Array(2).fill({valueOf:function(){return t++}});return 1!==t})))},6089:(t,r,a)=>{var i=a(4872),o=a(2960).filter,l=a(716),c=i.aTypedArray;(0,i.exportTypedArrayMethod)("filter",(function filter(t){var r=o(c(this),t,arguments.length>1?arguments[1]:void 0);return l(this,r)}))},8690:(t,r,a)=>{var i=a(4872),o=a(2960).findIndex,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("findIndex",(function findIndex(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},82:(t,r,a)=>{var i=a(4872),o=a(1969).findLastIndex,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLastIndex",(function findLastIndex(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},522:(t,r,a)=>{var i=a(4872),o=a(1969).findLast,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLast",(function findLast(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},8539:(t,r,a)=>{var i=a(4872),o=a(2960).find,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("find",(function find(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},292:(t,r,a)=>{a(1158)("Float64",(function(t){return function Float64Array(r,a,i){return t(this,r,a,i)}}))},5385:(t,r,a)=>{var i=a(4872),o=a(2960).forEach,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("forEach",(function forEach(t){o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},5552:(t,r,a)=>{var i=a(4872),o=a(4328).includes,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("includes",(function includes(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},1803:(t,r,a)=>{var i=a(4872),o=a(4328).indexOf,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("indexOf",(function indexOf(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},854:(t,r,a)=>{a(1158)("Int32",(function(t){return function Int32Array(r,a,i){return t(this,r,a,i)}}))},1565:(t,r,a)=>{var i=a(9037),o=a(3689),l=a(8844),c=a(4872),u=a(752),h=a(4201)("iterator"),d=i.Uint8Array,p=l(u.values),v=l(u.keys),_=l(u.entries),y=c.aTypedArray,g=c.exportTypedArrayMethod,m=d&&d.prototype,b=!o((function(){m[h].call([1])})),w=!!m&&m.values&&m[h]===m.values&&"values"===m.values.name,P=function values(){return p(y(this))};g("entries",(function entries(){return _(y(this))}),b);g("keys",(function keys(){return v(y(this))}),b);g("values",P,b||!w,{name:"values"});g(h,P,b||!w,{name:"values"})},7987:(t,r,a)=>{var i=a(4872),o=a(8844),l=i.aTypedArray,c=i.exportTypedArrayMethod,u=o([].join);c("join",(function join(t){return u(l(this),t)}))},9365:(t,r,a)=>{var i=a(4872),o=a(1735),l=a(953),c=i.aTypedArray;(0,i.exportTypedArrayMethod)("lastIndexOf",(function lastIndexOf(t){var r=arguments.length;return o(l,c(this),r>1?[t,arguments[1]]:[t])}))},677:(t,r,a)=>{var i=a(4872),o=a(2960).map,l=a(7338),c=i.aTypedArray;(0,i.exportTypedArrayMethod)("map",(function map(t){return o(c(this),t,arguments.length>1?arguments[1]:void 0,(function(t,r){return new(l(t))(r)}))}))},1165:(t,r,a)=>{var i=a(4872),o=a(8820).right,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduceRight",(function reduceRight(t){var r=arguments.length;return o(l(this),t,r,r>1?arguments[1]:void 0)}))},8118:(t,r,a)=>{var i=a(4872),o=a(8820).left,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduce",(function reduce(t){var r=arguments.length;return o(l(this),t,r,r>1?arguments[1]:void 0)}))},1522:(t,r,a)=>{var i=a(4872),o=i.aTypedArray,l=i.exportTypedArrayMethod,c=Math.floor;l("reverse",(function reverse(){for(var t,r=this,a=o(r).length,i=c(a/2),l=0;l<i;){t=r[l];r[l++]=r[--a];r[a]=t}return r}))},1638:(t,r,a)=>{var i=a(9037),o=a(2615),l=a(4872),c=a(6310),u=a(3250),h=a(690),d=a(3689),p=i.RangeError,v=i.Int8Array,_=v&&v.prototype,y=_&&_.set,g=l.aTypedArray,m=l.exportTypedArrayMethod,b=!d((function(){var t=new Uint8ClampedArray(2);o(y,t,{length:1,0:3},1);return 3!==t[1]})),w=b&&l.NATIVE_ARRAY_BUFFER_VIEWS&&d((function(){var t=new v(2);t.set(1);t.set("2",1);return 0!==t[0]||2!==t[1]}));m("set",(function set(t){g(this);var r=u(arguments.length>1?arguments[1]:void 0,1),a=h(t);if(b)return o(y,this,a,r);var i=this.length,l=c(a),d=0;if(l+r>i)throw new p("Wrong length");for(;d<l;)this[r+d]=a[d++]}),!b||w)},4797:(t,r,a)=>{var i=a(4872),o=a(7338),l=a(3689),c=a(6004),u=i.aTypedArray;(0,i.exportTypedArrayMethod)("slice",(function slice(t,r){for(var a=c(u(this),t,r),i=o(this),l=0,h=a.length,d=new i(h);h>l;)d[l]=a[l++];return d}),l((function(){new Int8Array(1).slice()})))},7300:(t,r,a)=>{var i=a(4872),o=a(2960).some,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("some",(function some(t){return o(l(this),t,arguments.length>1?arguments[1]:void 0)}))},3356:(t,r,a)=>{var i=a(9037),o=a(6576),l=a(3689),c=a(509),u=a(382),h=a(4872),d=a(7365),p=a(7298),v=a(3615),_=a(7922),y=h.aTypedArray,g=h.exportTypedArrayMethod,m=i.Uint16Array,b=m&&o(m.prototype.sort),w=!(!b||l((function(){b(new m(2),null)}))&&l((function(){b(new m(2),{})}))),P=!!b&&!l((function(){if(v)return v<74;if(d)return d<67;if(p)return!0;if(_)return _<602;var t,r,a=new m(516),i=Array(516);for(t=0;t<516;t++){r=t%4;a[t]=515-t;i[t]=t-2*r+3}b(a,(function(t,r){return(t/4|0)-(r/4|0)}));for(t=0;t<516;t++)if(a[t]!==i[t])return!0}));g("sort",(function sort(t){void 0!==t&&c(t);return P?b(this,t):u(y(this),function(t){return function(r,a){return void 0!==t?+t(r,a)||0:a!=a?-1:r!=r?1:0===r&&0===a?1/r>0&&1/a<0?1:-1:r>a}}(t))}),!P||w)},9724:(t,r,a)=>{var i=a(9037),o=a(1735),l=a(4872),c=a(3689),u=a(6004),h=i.Int8Array,d=l.aTypedArray,p=l.exportTypedArrayMethod,v=[].toLocaleString,_=!!h&&c((function(){v.call(new h(1))}));p("toLocaleString",(function toLocaleString(){return o(v,_?u(d(this)):d(this),u(arguments))}),c((function(){return[1,2].toLocaleString()!==new h([1,2]).toLocaleString()}))||!c((function(){h.prototype.toLocaleString.call([1,2])})))},4224:(t,r,a)=>{var i=a(6166),o=a(4872),l=o.aTypedArray,c=o.exportTypedArrayMethod,u=o.getTypedArrayConstructor;c("toReversed",(function toReversed(){return i(l(this),u(this))}))},1121:(t,r,a)=>{var i=a(4872),o=a(8844),l=a(509),c=a(9976),u=i.aTypedArray,h=i.getTypedArrayConstructor,d=i.exportTypedArrayMethod,p=o(i.TypedArrayPrototype.sort);d("toSorted",(function toSorted(t){void 0!==t&&l(t);var r=u(this),a=c(h(r),r);return p(a,t)}))},9901:(t,r,a)=>{var i=a(4872).exportTypedArrayMethod,o=a(3689),l=a(9037),c=a(8844),u=l.Uint8Array,h=u&&u.prototype||{},d=[].toString,p=c([].join);o((function(){d.call({})}))&&(d=function toString(){return p(this)});var v=h.toString!==d;i("toString",d,v)},8557:(t,r,a)=>{a(1158)("Uint32",(function(t){return function Uint32Array(r,a,i){return t(this,r,a,i)}}))},8607:(t,r,a)=>{a(1158)("Uint8",(function(t){return function Uint8Array(r,a,i){return t(this,r,a,i)}}))},7133:(t,r,a)=>{var i=a(6134),o=a(4872),l=a(9401),c=a(8700),u=a(1530),h=o.aTypedArray,d=o.getTypedArrayConstructor,p=o.exportTypedArrayMethod,v=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}();p("with",{with:function(t,r){var a=h(this),o=c(t),p=l(a)?u(r):+r;return i(a,d(a),o,p)}}.with,!v)},5164:(t,r,a)=>{var i,o=a(1594),l=a(9037),c=a(8844),u=a(6045),h=a(5375),d=a(319),p=a(637),v=a(8999),_=a(618).enforce,y=a(3689),g=a(9834),m=Object,b=Array.isArray,w=m.isExtensible,P=m.isFrozen,k=m.isSealed,S=m.freeze,A=m.seal,x=!l.ActiveXObject&&"ActiveXObject"in l,wrapper=function(t){return function WeakMap(){return t(this,arguments.length?arguments[0]:void 0)}},E=d("WeakMap",wrapper,p),I=E.prototype,T=c(I.set);if(g)if(x){i=p.getConstructor(wrapper,"WeakMap",!0);h.enable();var C=c(I.delete),M=c(I.has),G=c(I.get);u(I,{delete:function(t){if(v(t)&&!w(t)){var r=_(this);r.frozen||(r.frozen=new i);return C(this,t)||r.frozen.delete(t)}return C(this,t)},has:function has(t){if(v(t)&&!w(t)){var r=_(this);r.frozen||(r.frozen=new i);return M(this,t)||r.frozen.has(t)}return M(this,t)},get:function get(t){if(v(t)&&!w(t)){var r=_(this);r.frozen||(r.frozen=new i);return M(this,t)?G(this,t):r.frozen.get(t)}return G(this,t)},set:function set(t,r){if(v(t)&&!w(t)){var a=_(this);a.frozen||(a.frozen=new i);M(this,t)?T(this,t,r):a.frozen.set(t,r)}else T(this,t,r);return this}})}else o&&y((function(){var t=S([]);T(new E,t,1);return!P(t)}))&&u(I,{set:function set(t,r){var a;b(t)&&(P(t)?a=S:k(t)&&(a=A));T(this,t,r);a&&a(t);return this}})},1090:(t,r,a)=>{a(5164)},7884:(t,r,a)=>{a(319)("WeakSet",(function(t){return function WeakSet(){return t(this,arguments.length?arguments[0]:void 0)}}),a(637))},414:(t,r,a)=>{a(7884)},6247:(t,r,a)=>{var i=a(7697),o=a(2148),l=a(2961),c=ArrayBuffer.prototype;i&&!("detached"in c)&&o(c,"detached",{configurable:!0,get:function detached(){return l(this)}})},3097:(t,r,a)=>{var i=a(9989),o=a(9195);o&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function transferToFixedLength(){return o(this,arguments.length?arguments[0]:void 0,!1)}})},1412:(t,r,a)=>{var i=a(9989),o=a(9195);o&&i({target:"ArrayBuffer",proto:!0},{transfer:function transfer(){return o(this,arguments.length?arguments[0]:void 0,!0)}})},7602:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(767),c=a(5027),u=a(9985),h=a(1868),d=a(2148),p=a(6522),v=a(3689),_=a(6812),y=a(4201),g=a(2013).IteratorPrototype,m=a(7697),b=a(3931),w="constructor",P="Iterator",k=y("toStringTag"),S=TypeError,A=o[P],x=b||!u(A)||A.prototype!==g||!v((function(){A({})})),E=function Iterator(){l(this,g);if(h(this)===g)throw new S("Abstract class Iterator not directly constructable")},defineIteratorPrototypeAccessor=function(t,r){m?d(g,t,{configurable:!0,get:function(){return r},set:function(r){c(this);if(this===g)throw new S("You can't redefine this property");_(this,t)?this[t]=r:p(this,t,r)}}):g[t]=r};_(g,k)||defineIteratorPrototypeAccessor(k,P);!x&&_(g,w)&&g[w]!==Object||defineIteratorPrototypeAccessor(w,E);E.prototype=g;i({global:!0,constructor:!0,forced:x},{Iterator:E})},6054:(t,r,a)=>{var i=a(9989),o=a(8734),l=a(509),c=a(5027),u=a(2302);i({target:"Iterator",proto:!0,real:!0},{every:function every(t){c(this);l(t);var r=u(this),a=0;return!o(r,(function(r,i){if(!t(r,a++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3476:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(509),c=a(5027),u=a(2302),h=a(5419),d=a(1228),p=a(3931),v=h((function(){for(var t,r,a=this.iterator,i=this.predicate,l=this.next;;){t=c(o(l,a));if(this.done=!!t.done)return;r=t.value;if(d(a,i,[r,this.counter++],!0))return r}}));i({target:"Iterator",proto:!0,real:!0,forced:p},{filter:function filter(t){c(this);l(t);return new v(u(this),{predicate:t})}})},9411:(t,r,a)=>{var i=a(9989),o=a(2615),l=a(509),c=a(5027),u=a(2302),h=a(6752),d=a(5419),p=a(2125),v=a(3931),_=d((function(){for(var t,r,a=this.iterator,i=this.mapper;;){if(r=this.inner)try{if(!(t=c(o(r.next,r.iterator))).done)return t.value;this.inner=null}catch(t){p(a,"throw",t)}t=c(o(this.next,a));if(this.done=!!t.done)return;try{this.inner=h(i(t.value,this.counter++),!1)}catch(t){p(a,"throw",t)}}}));i({target:"Iterator",proto:!0,real:!0,forced:v},{flatMap:function flatMap(t){c(this);l(t);return new _(u(this),{mapper:t,inner:null})}})},5:(t,r,a)=>{var i=a(9989),o=a(8734),l=a(509),c=a(5027),u=a(2302);i({target:"Iterator",proto:!0,real:!0},{forEach:function forEach(t){c(this);l(t);var r=u(this),a=0;o(r,(function(r){t(r,a++)}),{IS_RECORD:!0})}})},1792:(t,r,a)=>{var i=a(9989),o=a(8983);i({target:"Iterator",proto:!0,real:!0,forced:a(3931)},{map:o})},8244:(t,r,a)=>{var i=a(9989),o=a(8734),l=a(509),c=a(5027),u=a(2302);i({target:"Iterator",proto:!0,real:!0},{some:function some(t){c(this);l(t);var r=u(this),a=0;return o(r,(function(r,i){if(t(r,a++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},691:(t,r,a)=>{var i=a(9989),o=a(7697),l=a(9037),c=a(6058),u=a(8844),h=a(2615),d=a(9985),p=a(8999),v=a(2297),_=a(6812),y=a(4327),g=a(6310),m=a(6522),b=a(3689),w=a(6675),P=a(146),k=l.JSON,S=l.Number,A=l.SyntaxError,x=k&&k.parse,E=c("Object","keys"),I=Object.getOwnPropertyDescriptor,T=u("".charAt),C=u("".slice),M=u(/./.exec),G=u([].push),O=/^\d$/,R=/^[1-9]$/,L=/^(?:-|\d)$/,D=/^[\t\n\r ]$/,internalize=function(t,r,a,i){var o,l,c,u,d,y=t[r],m=i&&y===i.value,b=m&&"string"==typeof i.source?{source:i.source}:{};if(p(y)){var w=v(y),P=m?i.nodes:w?[]:{};if(w){o=P.length;c=g(y);for(u=0;u<c;u++)internalizeProperty(y,u,internalize(y,""+u,a,u<o?P[u]:void 0))}else{l=E(y);c=g(l);for(u=0;u<c;u++){d=l[u];internalizeProperty(y,d,internalize(y,d,a,_(P,d)?P[d]:void 0))}}}return h(a,t,r,y,b)},internalizeProperty=function(t,r,a){if(o){var i=I(t,r);if(i&&!i.configurable)return}void 0===a?delete t[r]:m(t,r,a)},Node=function(t,r,a,i){this.value=t;this.end=r;this.source=a;this.nodes=i},Context=function(t,r){this.source=t;this.index=r};Context.prototype={fork:function(t){return new Context(this.source,t)},parse:function(){var t=this.source,r=this.skip(D,this.index),a=this.fork(r),i=T(t,r);if(M(L,i))return a.number();switch(i){case"{":return a.object();case"[":return a.array();case'"':return a.string();case"t":return a.keyword(!0);case"f":return a.keyword(!1);case"n":return a.keyword(null)}throw new A('Unexpected character: "'+i+'" at: '+r)},node:function(t,r,a,i,o){return new Node(r,i,t?null:C(this.source,a,i),o)},object:function(){for(var t=this.source,r=this.index+1,a=!1,i={},o={};r<t.length;){r=this.until(['"',"}"],r);if("}"===T(t,r)&&!a){r++;break}var l=this.fork(r).string(),c=l.value;r=l.end;r=this.until([":"],r)+1;r=this.skip(D,r);l=this.fork(r).parse();m(o,c,l);m(i,c,l.value);r=this.until([",","}"],l.end);var u=T(t,r);if(","===u){a=!0;r++}else if("}"===u){r++;break}}return this.node(1,i,this.index,r,o)},array:function(){for(var t=this.source,r=this.index+1,a=!1,i=[],o=[];r<t.length;){r=this.skip(D,r);if("]"===T(t,r)&&!a){r++;break}var l=this.fork(r).parse();G(o,l);G(i,l.value);r=this.until([",","]"],l.end);if(","===T(t,r)){a=!0;r++}else if("]"===T(t,r)){r++;break}}return this.node(1,i,this.index,r,o)},string:function(){var t=this.index,r=w(this.source,this.index+1);return this.node(0,r.value,t,r.end)},number:function(){var t=this.source,r=this.index,a=r;"-"===T(t,a)&&a++;if("0"===T(t,a))a++;else{if(!M(R,T(t,a)))throw new A("Failed to parse number at: "+a);a=this.skip(O,++a)}"."===T(t,a)&&(a=this.skip(O,++a));if("e"===T(t,a)||"E"===T(t,a)){a++;"+"!==T(t,a)&&"-"!==T(t,a)||a++;if(a===(a=this.skip(O,a)))throw new A("Failed to parse number's exponent value at: "+a)}return this.node(0,S(C(t,r,a)),r,a)},keyword:function(t){var r=""+t,a=this.index,i=a+r.length;if(C(this.source,a,i)!==r)throw new A("Failed to parse value at: "+a);return this.node(0,t,a,i)},skip:function(t,r){for(var a=this.source;r<a.length&&M(t,T(a,r));r++);return r},until:function(t,r){r=this.skip(D,r);for(var a=T(this.source,r),i=0;i<t.length;i++)if(t[i]===a)return r;throw new A('Unexpected character: "'+a+'" at: '+r)}};var j=b((function(){var t,r="9007199254740993";x(r,(function(r,a,i){t=i.source}));return t!==r})),N=P&&!b((function(){return 1/x("-0 \t")!=-1/0}));i({target:"JSON",stat:!0,forced:j},{parse:function parse(t,r){return N&&!d(r)?x(t):function(t,r){t=y(t);var a=new Context(t,0,""),i=a.parse(),o=i.value,l=a.skip(D,i.end);if(l<t.length)throw new A('Unexpected extra character: "'+T(t,l)+'" after the parsed data at: '+l);return d(r)?internalize({"":o},"",r,i):o}(t,r)}})},5716:(t,r,a)=>{var i=a(9989),o=a(7748);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("difference")},{difference:o})},3442:(t,r,a)=>{var i=a(9989),o=a(3689),l=a(2948);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("intersection")||o((function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))}))},{intersection:l})},1964:(t,r,a)=>{var i=a(9989),o=a(7795);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("isDisjointFrom")},{isDisjointFrom:o})},9878:(t,r,a)=>{var i=a(9989),o=a(6951);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("isSubsetOf")},{isSubsetOf:o})},2915:(t,r,a)=>{var i=a(9989),o=a(3894);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("isSupersetOf")},{isSupersetOf:o})},7895:(t,r,a)=>{var i=a(9989),o=a(2289);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("symmetricDifference")},{symmetricDifference:o})},2275:(t,r,a)=>{var i=a(9989),o=a(5674);i({target:"Set",proto:!0,real:!0,forced:!a(3234)("union")},{union:o})},7522:(t,r,a)=>{var i=a(9037),o=a(6338),l=a(3265),c=a(7612),u=a(5773),handlePrototype=function(t){if(t&&t.forEach!==c)try{u(t,"forEach",c)}catch(r){t.forEach=c}};for(var h in o)o[h]&&handlePrototype(i[h]&&i[h].prototype);handlePrototype(l)},6265:(t,r,a)=>{var i=a(9037),o=a(6338),l=a(3265),c=a(752),u=a(5773),h=a(5997),d=a(4201)("iterator"),p=c.values,handlePrototype=function(t,r){if(t){if(t[d]!==p)try{u(t,d,p)}catch(r){t[d]=p}h(t,r,!0);if(o[r])for(var a in c)if(t[a]!==c[a])try{u(t,a,c[a])}catch(r){t[a]=c[a]}}};for(var v in o)handlePrototype(i[v]&&i[v].prototype,v);handlePrototype(l,"DOMTokenList")},7337:(t,r,a)=>{var i=a(9989),o=a(1905),l=a(6058),c=a(3689),u=a(5391),h=a(5684),d=a(2560).f,p=a(1880),v=a(2148),_=a(6812),y=a(767),g=a(5027),m=a(445),b=a(3841),w=a(7136),P=a(6610),k=a(618),S=a(7697),A=a(3931),x="DOMException",E="DATA_CLONE_ERR",I=l("Error"),T=l(x)||function(){try{(new(l("MessageChannel")||o("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(t){if(t.name===E&&25===t.code)return t.constructor}}(),C=T&&T.prototype,M=I.prototype,G=k.set,O=k.getterFor(x),R="stack"in new I(x),codeFor=function(t){return _(w,t)&&w[t].m?w[t].c:0},L=function DOMException(){y(this,D);var t=arguments.length,r=b(t<1?void 0:arguments[0]),a=b(t<2?void 0:arguments[1],"Error"),i=codeFor(a);G(this,{type:x,name:a,message:r,code:i});if(!S){this.name=a;this.message=r;this.code=i}if(R){var o=new I(r);o.name=x;d(this,"stack",h(1,P(o.stack,1)))}},D=L.prototype=u(M),createGetterDescriptor=function(t){return{enumerable:!0,configurable:!0,get:t}},getterFor=function(t){return createGetterDescriptor((function(){return O(this)[t]}))};if(S){v(D,"code",getterFor("code"));v(D,"message",getterFor("message"));v(D,"name",getterFor("name"))}d(D,"constructor",h(1,L));var j=c((function(){return!(new T instanceof I)})),N=j||c((function(){return M.toString!==m||"2: 1"!==String(new T(1,2))})),W=j||c((function(){return 25!==new T(1,"DataCloneError").code})),H=j||25!==T[E]||25!==C[E],B=A?N||W||H:j;i({global:!0,constructor:!0,forced:B},{DOMException:B?L:T});var z=l(x),U=z.prototype;N&&(A||T===z)&&p(U,"toString",m);W&&S&&T===z&&v(U,"code",createGetterDescriptor((function(){return codeFor(g(this).name)})));for(var q in w)if(_(w,q)){var V=w[q],K=V.s,Y=h(6,V.c);_(z,K)||d(z,K,Y);_(U,K)||d(U,K,Y)}},3429:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(6058),c=a(5684),u=a(2560).f,h=a(6812),d=a(767),p=a(3457),v=a(3841),_=a(7136),y=a(6610),g=a(7697),m=a(3931),b="DOMException",w=l("Error"),P=l(b),k=function DOMException(){d(this,S);var t=arguments.length,r=v(t<1?void 0:arguments[0]),a=v(t<2?void 0:arguments[1],"Error"),i=new P(r,a),o=new w(r);o.name=b;u(i,"stack",c(1,y(o.stack,1)));p(i,this,k);return i},S=k.prototype=P.prototype,A="stack"in new w(b),x="stack"in new P(1,2),E=P&&g&&Object.getOwnPropertyDescriptor(o,b),I=!(!E||E.writable&&E.configurable),T=A&&!I&&!x;i({global:!0,constructor:!0,forced:m||T},{DOMException:T?k:P});var C=l(b),M=C.prototype;if(M.constructor!==C){m||u(M,"constructor",c(1,C));for(var G in _)if(h(_,G)){var O=_[G],R=O.s;h(C,R)||u(C,R,c(6,O.c))}}},7462:(t,r,a)=>{var i=a(6058),o="DOMException";a(5997)(i(o),o)},3650:(t,r,a)=>{var i=a(9989),o=a(9037),l=a(2148),c=a(7697),u=TypeError,h=Object.defineProperty,d=o.self!==o;try{if(c){var p=Object.getOwnPropertyDescriptor(o,"self");!d&&p&&p.get&&p.enumerable||l(o,"self",{get:function self(){return o},set:function self(t){if(this!==o)throw new u("Illegal invocation");h(o,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else i({global:!0,simple:!0,forced:d},{self:o})}catch(t){}},2625:(t,r,a)=>{a(752);var i=a(9989),o=a(9037),l=a(517),c=a(2615),u=a(8844),h=a(7697),d=a(6837),p=a(1880),v=a(2148),_=a(6045),y=a(5997),g=a(974),m=a(618),b=a(767),w=a(9985),P=a(6812),k=a(4071),S=a(926),A=a(5027),x=a(8999),E=a(4327),I=a(5391),T=a(5684),C=a(5185),M=a(1664),G=a(7807),O=a(1500),R=a(4201),L=a(382),D=R("iterator"),j="URLSearchParams",N=j+"Iterator",W=m.set,H=m.getterFor(j),B=m.getterFor(N),z=l("fetch"),U=l("Request"),q=l("Headers"),V=U&&U.prototype,K=q&&q.prototype,Y=o.RegExp,X=o.TypeError,$=o.decodeURIComponent,J=o.encodeURIComponent,Q=u("".charAt),Z=u([].join),ee=u([].push),te=u("".replace),re=u([].shift),ne=u([].splice),ae=u("".split),ie=u("".slice),oe=/\+/g,se=Array(4),percentSequence=function(t){return se[t-1]||(se[t-1]=Y("((?:%[\\da-f]{2}){"+t+"})","gi"))},percentDecode=function(t){try{return $(t)}catch(r){return t}},deserialize=function(t){var r=te(t,oe," "),a=4;try{return $(r)}catch(t){for(;a;)r=te(r,percentSequence(a--),percentDecode);return r}},le=/[!'()~]|%20/g,ce={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(t){return ce[t]},serialize=function(t){return te(J(t),le,replacer)},ue=g((function Iterator(t,r){W(this,{type:N,target:H(t).entries,index:0,kind:r})}),j,(function next(){var t=B(this),r=t.target,a=t.index++;if(!r||a>=r.length){t.target=void 0;return G(void 0,!0)}var i=r[a];switch(t.kind){case"keys":return G(i.key,!1);case"values":return G(i.value,!1)}return G([i.key,i.value],!1)}),!0),URLSearchParamsState=function(t){this.entries=[];this.url=null;void 0!==t&&(x(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===Q(t,0)?ie(t,1):t:E(t)))};URLSearchParamsState.prototype={type:j,bindURL:function(t){this.url=t;this.update()},parseObject:function(t){var r,a,i,o,l,u,h,d=this.entries,p=M(t);if(p){a=(r=C(t,p)).next;for(;!(i=c(a,r)).done;){l=(o=C(A(i.value))).next;if((u=c(l,o)).done||(h=c(l,o)).done||!c(l,o).done)throw new X("Expected sequence with length 2");ee(d,{key:E(u.value),value:E(h.value)})}}else for(var v in t)P(t,v)&&ee(d,{key:v,value:E(t[v])})},parseQuery:function(t){if(t)for(var r,a,i=this.entries,o=ae(t,"&"),l=0;l<o.length;)if((r=o[l++]).length){a=ae(r,"=");ee(i,{key:deserialize(re(a)),value:deserialize(Z(a,"="))})}},serialize:function(){for(var t,r=this.entries,a=[],i=0;i<r.length;){t=r[i++];ee(a,serialize(t.key)+"="+serialize(t.value))}return Z(a,"&")},update:function(){this.entries.length=0;this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var he=function URLSearchParams(){b(this,de);var t=W(this,new URLSearchParamsState(arguments.length>0?arguments[0]:void 0));h||(this.size=t.entries.length)},de=he.prototype;_(de,{append:function append(t,r){var a=H(this);O(arguments.length,2);ee(a.entries,{key:E(t),value:E(r)});h||this.length++;a.updateURL()},delete:function(t){for(var r=H(this),a=O(arguments.length,1),i=r.entries,o=E(t),l=a<2?void 0:arguments[1],c=void 0===l?l:E(l),u=0;u<i.length;){var d=i[u];if(d.key!==o||void 0!==c&&d.value!==c)u++;else{ne(i,u,1);if(void 0!==c)break}}h||(this.size=i.length);r.updateURL()},get:function get(t){var r=H(this).entries;O(arguments.length,1);for(var a=E(t),i=0;i<r.length;i++)if(r[i].key===a)return r[i].value;return null},getAll:function getAll(t){var r=H(this).entries;O(arguments.length,1);for(var a=E(t),i=[],o=0;o<r.length;o++)r[o].key===a&&ee(i,r[o].value);return i},has:function has(t){for(var r=H(this).entries,a=O(arguments.length,1),i=E(t),o=a<2?void 0:arguments[1],l=void 0===o?o:E(o),c=0;c<r.length;){var u=r[c++];if(u.key===i&&(void 0===l||u.value===l))return!0}return!1},set:function set(t,r){var a=H(this);O(arguments.length,1);for(var i,o=a.entries,l=!1,c=E(t),u=E(r),d=0;d<o.length;d++)if((i=o[d]).key===c)if(l)ne(o,d--,1);else{l=!0;i.value=u}l||ee(o,{key:c,value:u});h||(this.size=o.length);a.updateURL()},sort:function sort(){var t=H(this);L(t.entries,(function(t,r){return t.key>r.key?1:-1}));t.updateURL()},forEach:function forEach(t){for(var r,a=H(this).entries,i=k(t,arguments.length>1?arguments[1]:void 0),o=0;o<a.length;)i((r=a[o++]).value,r.key,this)},keys:function keys(){return new ue(this,"keys")},values:function values(){return new ue(this,"values")},entries:function entries(){return new ue(this,"entries")}},{enumerable:!0});p(de,D,de.entries,{name:"entries"});p(de,"toString",(function toString(){return H(this).serialize()}),{enumerable:!0});h&&v(de,"size",{get:function size(){return H(this).entries.length},configurable:!0,enumerable:!0});y(he,j);i({global:!0,constructor:!0,forced:!d},{URLSearchParams:he});if(!d&&w(q)){var fe=u(K.has),pe=u(K.set),wrapRequestOptions=function(t){if(x(t)){var r,a=t.body;if(S(a)===j){r=t.headers?new q(t.headers):new q;fe(r,"content-type")||pe(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8");return I(t,{body:T(0,E(a)),headers:T(0,r)})}}return t};w(z)&&i({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function fetch(t){return z(t,arguments.length>1?wrapRequestOptions(arguments[1]):{})}});if(w(U)){var ve=function Request(t){b(this,V);return new U(t,arguments.length>1?wrapRequestOptions(arguments[1]):{})};V.constructor=ve;ve.prototype=V;i({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ve})}}t.exports={URLSearchParams:he,getState:H}},8858:(t,r,a)=>{var i=a(1880),o=a(8844),l=a(4327),c=a(1500),u=URLSearchParams,h=u.prototype,d=o(h.append),p=o(h.delete),v=o(h.forEach),_=o([].push),y=new u("a=1&a=2&b=3");y.delete("a",1);y.delete("b",void 0);y+""!="a=2"&&i(h,"delete",(function(t){var r=arguments.length,a=r<2?void 0:arguments[1];if(r&&void 0===a)return p(this,t);var i=[];v(this,(function(t,r){_(i,{key:r,value:t})}));c(r,1);for(var o,u=l(t),h=l(a),y=0,g=0,m=!1,b=i.length;y<b;){o=i[y++];if(m||o.key===u){m=!0;p(this,o.key)}else g++}for(;g<b;)(o=i[g++]).key===u&&o.value===h||d(this,o.key,o.value)}),{enumerable:!0,unsafe:!0})},1318:(t,r,a)=>{var i=a(1880),o=a(8844),l=a(4327),c=a(1500),u=URLSearchParams,h=u.prototype,d=o(h.getAll),p=o(h.has),v=new u("a=1");!v.has("a",2)&&v.has("a",void 0)||i(h,"has",(function has(t){var r=arguments.length,a=r<2?void 0:arguments[1];if(r&&void 0===a)return p(this,t);var i=d(this,t);c(r,1);for(var o=l(a),u=0;u<i.length;)if(i[u++]===o)return!0;return!1}),{enumerable:!0,unsafe:!0})},9307:(t,r,a)=>{a(2625)},3228:(t,r,a)=>{var i=a(7697),o=a(8844),l=a(2148),c=URLSearchParams.prototype,u=o(c.forEach);i&&!("size"in c)&&l(c,"size",{get:function size(){var t=0;u(this,(function(){t++}));return t},configurable:!0,enumerable:!0})},9391:(t,r,a)=>{a(1694);var i,o=a(9989),l=a(7697),c=a(6837),u=a(9037),h=a(4071),d=a(8844),p=a(1880),v=a(2148),_=a(767),y=a(6812),g=a(5394),m=a(1055),b=a(6004),w=a(730).codeAt,P=a(6430),k=a(4327),S=a(5997),A=a(1500),x=a(2625),E=a(618),I=E.set,T=E.getterFor("URL"),C=x.URLSearchParams,M=x.getState,G=u.URL,O=u.TypeError,R=u.parseInt,L=Math.floor,D=Math.pow,j=d("".charAt),N=d(/./.exec),W=d([].join),H=d(1..toString),B=d([].pop),z=d([].push),U=d("".replace),q=d([].shift),V=d("".split),K=d("".slice),Y=d("".toLowerCase),X=d([].unshift),$="Invalid scheme",J="Invalid host",Q="Invalid port",Z=/[a-z]/i,ee=/[\d+-.a-z]/i,te=/\d/,re=/^0x/i,ne=/^[0-7]+$/,ae=/^\d+$/,ie=/^[\da-f]+$/i,oe=/[\0\t\n\r #%/:<>?@[\\\]^|]/,se=/[\0\t\n\r #/:<>?@[\\\]^|]/,le=/^[\u0000-\u0020]+/,ce=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ue=/[\t\n\r]/g,serializeHost=function(t){var r,a,i,o;if("number"==typeof t){r=[];for(a=0;a<4;a++){X(r,t%256);t=L(t/256)}return W(r,".")}if("object"==typeof t){r="";i=function(t){for(var r=null,a=1,i=null,o=0,l=0;l<8;l++)if(0!==t[l]){if(o>a){r=i;a=o}i=null;o=0}else{null===i&&(i=l);++o}if(o>a){r=i;a=o}return r}(t);for(a=0;a<8;a++)if(!o||0!==t[a]){o&&(o=!1);if(i===a){r+=a?":":"::";o=!0}else{r+=H(t[a],16);a<7&&(r+=":")}}return"["+r+"]"}return t},he={},de=g({},he,{" ":1,'"':1,"<":1,">":1,"`":1}),fe=g({},de,{"#":1,"?":1,"{":1,"}":1}),pe=g({},fe,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(t,r){var a=w(t,0);return a>32&&a<127&&!y(r,t)?t:encodeURIComponent(t)},ve={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(t,r){var a;return 2===t.length&&N(Z,j(t,0))&&(":"===(a=j(t,1))||!r&&"|"===a)},startsWithWindowsDriveLetter=function(t){var r;return t.length>1&&isWindowsDriveLetter(K(t,0,2))&&(2===t.length||"/"===(r=j(t,2))||"\\"===r||"?"===r||"#"===r)},isSingleDot=function(t){return"."===t||"%2e"===Y(t)},_e={},ye={},ge={},me={},be={},we={},Pe={},ke={},Se={},Fe={},Ae={},xe={},Ee={},Ie={},Te={},Ce={},Me={},Ge={},Oe={},Re={},Le={},URLState=function(t,r,a){var i,o,l,c=k(t);if(r){if(o=this.parse(c))throw new O(o);this.searchParams=null}else{void 0!==a&&(i=new URLState(a,!0));if(o=this.parse(c,null,i))throw new O(o);(l=M(new C)).bindURL(this);this.searchParams=l}};URLState.prototype={type:"URL",parse:function(t,r,a){var o,l,c,u,h,d=this,p=r||_e,v=0,_="",g=!1,w=!1,P=!1;t=k(t);if(!r){d.scheme="";d.username="";d.password="";d.host=null;d.port=null;d.path=[];d.query=null;d.fragment=null;d.cannotBeABaseURL=!1;t=U(t,le,"");t=U(t,ce,"$1")}t=U(t,ue,"");o=m(t);for(;v<=o.length;){l=o[v];switch(p){case _e:if(!l||!N(Z,l)){if(r)return $;p=ge;continue}_+=Y(l);p=ye;break;case ye:if(l&&(N(ee,l)||"+"===l||"-"===l||"."===l))_+=Y(l);else{if(":"!==l){if(r)return $;_="";p=ge;v=0;continue}if(r&&(d.isSpecial()!==y(ve,_)||"file"===_&&(d.includesCredentials()||null!==d.port)||"file"===d.scheme&&!d.host))return;d.scheme=_;if(r){d.isSpecial()&&ve[d.scheme]===d.port&&(d.port=null);return}_="";if("file"===d.scheme)p=Ie;else if(d.isSpecial()&&a&&a.scheme===d.scheme)p=me;else if(d.isSpecial())p=ke;else if("/"===o[v+1]){p=be;v++}else{d.cannotBeABaseURL=!0;z(d.path,"");p=Oe}}break;case ge:if(!a||a.cannotBeABaseURL&&"#"!==l)return $;if(a.cannotBeABaseURL&&"#"===l){d.scheme=a.scheme;d.path=b(a.path);d.query=a.query;d.fragment="";d.cannotBeABaseURL=!0;p=Le;break}p="file"===a.scheme?Ie:we;continue;case me:if("/"!==l||"/"!==o[v+1]){p=we;continue}p=Se;v++;break;case be:if("/"===l){p=Fe;break}p=Ge;continue;case we:d.scheme=a.scheme;if(l===i){d.username=a.username;d.password=a.password;d.host=a.host;d.port=a.port;d.path=b(a.path);d.query=a.query}else if("/"===l||"\\"===l&&d.isSpecial())p=Pe;else if("?"===l){d.username=a.username;d.password=a.password;d.host=a.host;d.port=a.port;d.path=b(a.path);d.query="";p=Re}else{if("#"!==l){d.username=a.username;d.password=a.password;d.host=a.host;d.port=a.port;d.path=b(a.path);d.path.length--;p=Ge;continue}d.username=a.username;d.password=a.password;d.host=a.host;d.port=a.port;d.path=b(a.path);d.query=a.query;d.fragment="";p=Le}break;case Pe:if(!d.isSpecial()||"/"!==l&&"\\"!==l){if("/"!==l){d.username=a.username;d.password=a.password;d.host=a.host;d.port=a.port;p=Ge;continue}p=Fe}else p=Se;break;case ke:p=Se;if("/"!==l||"/"!==j(_,v+1))continue;v++;break;case Se:if("/"!==l&&"\\"!==l){p=Fe;continue}break;case Fe:if("@"===l){g&&(_="%40"+_);g=!0;c=m(_);for(var S=0;S<c.length;S++){var A=c[S];if(":"!==A||P){var x=percentEncode(A,pe);P?d.password+=x:d.username+=x}else P=!0}_=""}else if(l===i||"/"===l||"?"===l||"#"===l||"\\"===l&&d.isSpecial()){if(g&&""===_)return"Invalid authority";v-=m(_).length+1;_="";p=Ae}else _+=l;break;case Ae:case xe:if(r&&"file"===d.scheme){p=Ce;continue}if(":"!==l||w){if(l===i||"/"===l||"?"===l||"#"===l||"\\"===l&&d.isSpecial()){if(d.isSpecial()&&""===_)return J;if(r&&""===_&&(d.includesCredentials()||null!==d.port))return;if(u=d.parseHost(_))return u;_="";p=Me;if(r)return;continue}"["===l?w=!0:"]"===l&&(w=!1);_+=l}else{if(""===_)return J;if(u=d.parseHost(_))return u;_="";p=Ee;if(r===xe)return}break;case Ee:if(!N(te,l)){if(l===i||"/"===l||"?"===l||"#"===l||"\\"===l&&d.isSpecial()||r){if(""!==_){var E=R(_,10);if(E>65535)return Q;d.port=d.isSpecial()&&E===ve[d.scheme]?null:E;_=""}if(r)return;p=Me;continue}return Q}_+=l;break;case Ie:d.scheme="file";if("/"===l||"\\"===l)p=Te;else{if(!a||"file"!==a.scheme){p=Ge;continue}switch(l){case i:d.host=a.host;d.path=b(a.path);d.query=a.query;break;case"?":d.host=a.host;d.path=b(a.path);d.query="";p=Re;break;case"#":d.host=a.host;d.path=b(a.path);d.query=a.query;d.fragment="";p=Le;break;default:if(!startsWithWindowsDriveLetter(W(b(o,v),""))){d.host=a.host;d.path=b(a.path);d.shortenPath()}p=Ge;continue}}break;case Te:if("/"===l||"\\"===l){p=Ce;break}a&&"file"===a.scheme&&!startsWithWindowsDriveLetter(W(b(o,v),""))&&(isWindowsDriveLetter(a.path[0],!0)?z(d.path,a.path[0]):d.host=a.host);p=Ge;continue;case Ce:if(l===i||"/"===l||"\\"===l||"?"===l||"#"===l){if(!r&&isWindowsDriveLetter(_))p=Ge;else if(""===_){d.host="";if(r)return;p=Me}else{if(u=d.parseHost(_))return u;"localhost"===d.host&&(d.host="");if(r)return;_="";p=Me}continue}_+=l;break;case Me:if(d.isSpecial()){p=Ge;if("/"!==l&&"\\"!==l)continue}else if(r||"?"!==l)if(r||"#"!==l){if(l!==i){p=Ge;if("/"!==l)continue}}else{d.fragment="";p=Le}else{d.query="";p=Re}break;case Ge:if(l===i||"/"===l||"\\"===l&&d.isSpecial()||!r&&("?"===l||"#"===l)){if(".."===(h=Y(h=_))||"%2e."===h||".%2e"===h||"%2e%2e"===h){d.shortenPath();"/"===l||"\\"===l&&d.isSpecial()||z(d.path,"")}else if(isSingleDot(_))"/"===l||"\\"===l&&d.isSpecial()||z(d.path,"");else{if("file"===d.scheme&&!d.path.length&&isWindowsDriveLetter(_)){d.host&&(d.host="");_=j(_,0)+":"}z(d.path,_)}_="";if("file"===d.scheme&&(l===i||"?"===l||"#"===l))for(;d.path.length>1&&""===d.path[0];)q(d.path);if("?"===l){d.query="";p=Re}else if("#"===l){d.fragment="";p=Le}}else _+=percentEncode(l,fe);break;case Oe:if("?"===l){d.query="";p=Re}else if("#"===l){d.fragment="";p=Le}else l!==i&&(d.path[0]+=percentEncode(l,he));break;case Re:if(r||"#"!==l)l!==i&&("'"===l&&d.isSpecial()?d.query+="%27":d.query+="#"===l?"%23":percentEncode(l,he));else{d.fragment="";p=Le}break;case Le:l!==i&&(d.fragment+=percentEncode(l,de))}v++}},parseHost:function(t){var r,a,i;if("["===j(t,0)){if("]"!==j(t,t.length-1))return J;r=function(t){var r,a,i,o,l,c,u,h=[0,0,0,0,0,0,0,0],d=0,p=null,v=0,chr=function(){return j(t,v)};if(":"===chr()){if(":"!==j(t,1))return;v+=2;p=++d}for(;chr();){if(8===d)return;if(":"!==chr()){r=a=0;for(;a<4&&N(ie,chr());){r=16*r+R(chr(),16);v++;a++}if("."===chr()){if(0===a)return;v-=a;if(d>6)return;i=0;for(;chr();){o=null;if(i>0){if(!("."===chr()&&i<4))return;v++}if(!N(te,chr()))return;for(;N(te,chr());){l=R(chr(),10);if(null===o)o=l;else{if(0===o)return;o=10*o+l}if(o>255)return;v++}h[d]=256*h[d]+o;2!=++i&&4!==i||d++}if(4!==i)return;break}if(":"===chr()){v++;if(!chr())return}else if(chr())return;h[d++]=r}else{if(null!==p)return;v++;p=++d}}if(null!==p){c=d-p;d=7;for(;0!==d&&c>0;){u=h[d];h[d--]=h[p+c-1];h[p+--c]=u}}else if(8!==d)return;return h}(K(t,1,-1));if(!r)return J;this.host=r}else if(this.isSpecial()){t=P(t);if(N(oe,t))return J;r=function(t){var r,a,i,o,l,c,u,h=V(t,".");h.length&&""===h[h.length-1]&&h.length--;if((r=h.length)>4)return t;a=[];for(i=0;i<r;i++){if(""===(o=h[i]))return t;l=10;if(o.length>1&&"0"===j(o,0)){l=N(re,o)?16:8;o=K(o,8===l?1:2)}if(""===o)c=0;else{if(!N(10===l?ae:8===l?ne:ie,o))return t;c=R(o,l)}z(a,c)}for(i=0;i<r;i++){c=a[i];if(i===r-1){if(c>=D(256,5-r))return null}else if(c>255)return null}u=B(a);for(i=0;i<a.length;i++)u+=a[i]*D(256,3-i);return u}(t);if(null===r)return J;this.host=r}else{if(N(se,t))return J;r="";a=m(t);for(i=0;i<a.length;i++)r+=percentEncode(a[i],he);this.host=r}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return y(ve,this.scheme)},shortenPath:function(){var t=this.path,r=t.length;!r||"file"===this.scheme&&1===r&&isWindowsDriveLetter(t[0],!0)||t.length--},serialize:function(){var t=this,r=t.scheme,a=t.username,i=t.password,o=t.host,l=t.port,c=t.path,u=t.query,h=t.fragment,d=r+":";if(null!==o){d+="//";t.includesCredentials()&&(d+=a+(i?":"+i:"")+"@");d+=serializeHost(o);null!==l&&(d+=":"+l)}else"file"===r&&(d+="//");d+=t.cannotBeABaseURL?c[0]:c.length?"/"+W(c,"/"):"";null!==u&&(d+="?"+u);null!==h&&(d+="#"+h);return d},setHref:function(t){var r=this.parse(t);if(r)throw new O(r);this.searchParams.update()},getOrigin:function(){var t=this.scheme,r=this.port;if("blob"===t)try{return new De(t.path[0]).origin}catch(t){return"null"}return"file"!==t&&this.isSpecial()?t+"://"+serializeHost(this.host)+(null!==r?":"+r:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(k(t)+":",_e)},getUsername:function(){return this.username},setUsername:function(t){var r=m(k(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var a=0;a<r.length;a++)this.username+=percentEncode(r[a],pe)}},getPassword:function(){return this.password},setPassword:function(t){var r=m(k(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var a=0;a<r.length;a++)this.password+=percentEncode(r[a],pe)}},getHost:function(){var t=this.host,r=this.port;return null===t?"":null===r?serializeHost(t):serializeHost(t)+":"+r},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Ae)},getHostname:function(){var t=this.host;return null===t?"":serializeHost(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,xe)},getPort:function(){var t=this.port;return null===t?"":k(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""===(t=k(t))?this.port=null:this.parse(t,Ee))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+W(t,"/"):""},setPathname:function(t){if(!this.cannotBeABaseURL){this.path=[];this.parse(t,Me)}},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){if(""===(t=k(t)))this.query=null;else{"?"===j(t,0)&&(t=K(t,1));this.query="";this.parse(t,Re)}this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){if(""!==(t=k(t))){"#"===j(t,0)&&(t=K(t,1));this.fragment="";this.parse(t,Le)}else this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var De=function URL(t){var r=_(this,je),a=A(arguments.length,1)>1?arguments[1]:void 0,i=I(r,new URLState(t,!1,a));if(!l){r.href=i.serialize();r.origin=i.getOrigin();r.protocol=i.getProtocol();r.username=i.getUsername();r.password=i.getPassword();r.host=i.getHost();r.hostname=i.getHostname();r.port=i.getPort();r.pathname=i.getPathname();r.search=i.getSearch();r.searchParams=i.getSearchParams();r.hash=i.getHash()}},je=De.prototype,accessorDescriptor=function(t,r){return{get:function(){return T(this)[t]()},set:r&&function(t){return T(this)[r](t)},configurable:!0,enumerable:!0}};if(l){v(je,"href",accessorDescriptor("serialize","setHref"));v(je,"origin",accessorDescriptor("getOrigin"));v(je,"protocol",accessorDescriptor("getProtocol","setProtocol"));v(je,"username",accessorDescriptor("getUsername","setUsername"));v(je,"password",accessorDescriptor("getPassword","setPassword"));v(je,"host",accessorDescriptor("getHost","setHost"));v(je,"hostname",accessorDescriptor("getHostname","setHostname"));v(je,"port",accessorDescriptor("getPort","setPort"));v(je,"pathname",accessorDescriptor("getPathname","setPathname"));v(je,"search",accessorDescriptor("getSearch","setSearch"));v(je,"searchParams",accessorDescriptor("getSearchParams"));v(je,"hash",accessorDescriptor("getHash","setHash"))}p(je,"toJSON",(function toJSON(){return T(this).serialize()}),{enumerable:!0});p(je,"toString",(function toString(){return T(this).serialize()}),{enumerable:!0});if(G){var Ne=G.createObjectURL,We=G.revokeObjectURL;Ne&&p(De,"createObjectURL",h(Ne,G));We&&p(De,"revokeObjectURL",h(We,G))}S(De,"URL");o({global:!0,constructor:!0,forced:!c,sham:!l},{URL:De})},8730:(t,r,a)=>{a(9391)}},r={};function __webpack_require__(a){var i=r[a];if(void 0!==i)return i.exports;var o=r[a]={exports:{}};t[a].call(o.exports,o,o.exports,__webpack_require__);return o.exports}__webpack_require__.d=(t,r)=>{for(var a in r)__webpack_require__.o(r,a)&&!__webpack_require__.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})};__webpack_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r);var a=globalThis.pdfjsLib={};(()=>{__webpack_require__.d(a,{AbortException:()=>ue,AnnotationEditorLayer:()=>Cu,AnnotationEditorParamsType:()=>m,AnnotationEditorType:()=>g,AnnotationEditorUIManager:()=>fr,AnnotationLayer:()=>os,AnnotationMode:()=>y,CMapCompressionType:()=>Z,ColorPicker:()=>Ml,DOMSVGFactory:()=>qe,DrawLayer:()=>Wu,FeatureTest:()=>he,GlobalWorkerOptions:()=>la,ImageKind:()=>E,InvalidPDFException:()=>oe,MissingPDFException:()=>se,OPS:()=>ee,Outliner:()=>Os,PDFDataRangeTransport:()=>pi,PDFDateString:()=>Je,PDFWorker:()=>Ai,PasswordResponses:()=>te,PermissionFlag:()=>b,PixelsPerInch:()=>Ae,PromiseCapability:()=>ve,RenderingCancelledException:()=>Ke,UnexpectedResponseException:()=>le,Util:()=>fe,VerbosityLevel:()=>Q,XfaLayer:()=>qi,build:()=>zi,createValidAbsoluteUrl:()=>createValidAbsoluteUrl,fetchData:()=>fetchData,getDocument:()=>getDocument,getFilenameFromUrl:()=>getFilenameFromUrl,getPdfFilenameFromUrl:()=>getPdfFilenameFromUrl,getXfaPageViewport:()=>getXfaPageViewport,isDataScheme:()=>isDataScheme,isPdfFile:()=>isPdfFile,noContextMenu:()=>noContextMenu,normalizeUnicode:()=>normalizeUnicode,renderTextLayer:()=>renderTextLayer,setLayerDimensions:()=>setLayerDimensions,shadow:()=>shadow,updateTextLayer:()=>updateTextLayer,version:()=>Bi});var t;__webpack_require__(9749),__webpack_require__(6544),__webpack_require__(4254),__webpack_require__(9373),__webpack_require__(1057),__webpack_require__(4338),__webpack_require__(6801),__webpack_require__(7049),__webpack_require__(752),__webpack_require__(886),__webpack_require__(560),__webpack_require__(9730),__webpack_require__(9903),__webpack_require__(5398),__webpack_require__(6646),__webpack_require__(9288),__webpack_require__(9358),__webpack_require__(8052),__webpack_require__(228),__webpack_require__(3964),__webpack_require__(50),__webpack_require__(6034),__webpack_require__(4043),__webpack_require__(7409),__webpack_require__(2826),__webpack_require__(3843),__webpack_require__(1694),__webpack_require__(2462),__webpack_require__(8472),__webpack_require__(7267),__webpack_require__(6532),__webpack_require__(268),__webpack_require__(8607),__webpack_require__(8557),__webpack_require__(5194),__webpack_require__(6664),__webpack_require__(5980),__webpack_require__(9943),__webpack_require__(6089),__webpack_require__(8539),__webpack_require__(8690),__webpack_require__(522),__webpack_require__(82),__webpack_require__(5385),__webpack_require__(5552),__webpack_require__(1803),__webpack_require__(1565),__webpack_require__(7987),__webpack_require__(9365),__webpack_require__(677),__webpack_require__(8118),__webpack_require__(1165),__webpack_require__(1522),__webpack_require__(1638),__webpack_require__(4797),__webpack_require__(7300),__webpack_require__(3356),__webpack_require__(9724),__webpack_require__(4224),__webpack_require__(1121),__webpack_require__(9901),__webpack_require__(7133),__webpack_require__(1090),__webpack_require__(6247),__webpack_require__(1412),__webpack_require__(3097),__webpack_require__(1792),__webpack_require__(6265),__webpack_require__(3650),__webpack_require__(8730),__webpack_require__(9307),__webpack_require__(8858),__webpack_require__(1318),__webpack_require__(3228);function _classPrivateFieldInitSpec(t,r,a){!function _checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,r);r.set(t,a)}function _classPrivateFieldSet(t,r,a){!function _classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,_classExtractFieldDescriptor(t,r,"set"),a);return a}function _classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function _classStaticPrivateMethodGet(t,r,a){!function _classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,_toPropertyKey(i.key),i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function _toPropertyKey(t){var r=function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==_typeof(r)?r:String(r)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,r,a){return r=_getPrototypeOf(r),function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,_isNativeReflectConstruct()?Reflect.construct(r,a||[],_getPrototypeOf(t).constructor):r.apply(t,a))}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _typeof(t){return _typeof="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},_typeof(t)}var r=!("object"!==("undefined"==typeof process?"undefined":_typeof(process))||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),i=[1,0,0,1,0,0],o=[.001,0,0,.001,0,0],l=1.35,c=1,u=2,h=4,d=16,p=32,v=64,_=256,y={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},g={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},m={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},b={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},w=0,P=1,k=2,S=3,A=3,x=4,E={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},I=1,T=2,C=3,M=4,G=5,O=6,R=7,L=8,D=9,j=10,N=11,W=12,H=13,B=14,z=15,U=16,q=17,V=20,K=1,Y=2,X=3,$=4,J=5,Q={ERRORS:0,WARNINGS:1,INFOS:5},Z={NONE:0,BINARY:1},ee={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},te={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},re=Q.WARNINGS;function setVerbosityLevel(t){Number.isInteger(t)&&(re=t)}function getVerbosityLevel(){return re}function info(t){re>=Q.INFOS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log("Info: ".concat(t)):Window&&globalThis.ngxConsole?globalThis.ngxConsole.log("Info: ".concat(t)):console.log("Info: ".concat(t)))}function warn(t){re>=Q.WARNINGS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log("Warning: ".concat(t)):Window&&globalThis.ngxConsole?globalThis.ngxConsole.log("Warning: ".concat(t)):console.log("Warning: ".concat(t)))}function unreachable(t){throw new Error(t)}function assert(t,r){t||unreachable(r)}function createValidAbsoluteUrl(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(a&&"string"==typeof t){if(a.addDefaultProtocol&&t.startsWith("www.")){var i=t.match(/\./g);(null==i?void 0:i.length)>=2&&(t="http://".concat(t))}if(a.tryConvertEncoding)try{t=function stringToUTF8String(t){return decodeURIComponent(escape(t))}(t)}catch(t){}}var o=r?new URL(t,r):new URL(t);if(function _isValidProtocol(t){switch(null==t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":case"capacitor":return!0;default:return!1}}(o))return o}catch(t){}return null}function shadow(t,r,a){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.defineProperty(t,r,{value:a,enumerable:!i,configurable:!0,writable:!1});return a}var ne=function BaseExceptionClosure(){function BaseException(t,r){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=r}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}(),ae=function(t){_inherits(PasswordException,t);function PasswordException(t,r){var a;_classCallCheck(this,PasswordException);(a=_callSuper(this,PasswordException,[t,"PasswordException"])).code=r;return a}return _createClass(PasswordException)}(ne),ie=function(t){_inherits(UnknownErrorException,t);function UnknownErrorException(t,r){var a;_classCallCheck(this,UnknownErrorException);(a=_callSuper(this,UnknownErrorException,[t,"UnknownErrorException"])).details=r;return a}return _createClass(UnknownErrorException)}(ne),oe=function(t){_inherits(InvalidPDFException,t);function InvalidPDFException(t){_classCallCheck(this,InvalidPDFException);return _callSuper(this,InvalidPDFException,[t,"InvalidPDFException"])}return _createClass(InvalidPDFException)}(ne),se=function(t){_inherits(MissingPDFException,t);function MissingPDFException(t){_classCallCheck(this,MissingPDFException);return _callSuper(this,MissingPDFException,[t,"MissingPDFException"])}return _createClass(MissingPDFException)}(ne),le=function(t){_inherits(UnexpectedResponseException,t);function UnexpectedResponseException(t,r){var a;_classCallCheck(this,UnexpectedResponseException);(a=_callSuper(this,UnexpectedResponseException,[t,"UnexpectedResponseException"])).status=r;return a}return _createClass(UnexpectedResponseException)}(ne),ce=function(t){_inherits(FormatError,t);function FormatError(t){_classCallCheck(this,FormatError);return _callSuper(this,FormatError,[t,"FormatError"])}return _createClass(FormatError)}(ne),ue=function(t){_inherits(AbortException,t);function AbortException(t){_classCallCheck(this,AbortException);return _callSuper(this,AbortException,[t,"AbortException"])}return _createClass(AbortException)}(ne);function bytesToString(t){"object"===_typeof(t)&&void 0!==(null==t?void 0:t.length)||unreachable("Invalid argument for bytesToString");var r=t.length,a=8192;if(r<a)return String.fromCharCode.apply(null,t);for(var i=[],o=0;o<r;o+=a){var l=Math.min(o+a,r),c=t.subarray(o,l);i.push(String.fromCharCode.apply(null,c))}return i.join("")}function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");for(var r=t.length,a=new Uint8Array(r),i=0;i<r;++i)a[i]=255&t.charCodeAt(i);return a}function objectFromMap(t){var r,a=Object.create(null),i=function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}(t);try{for(i.s();!(r=i.n()).done;){var o=_slicedToArray(r.value,2),l=o[0],c=o[1];a[l]=c}}catch(t){i.e(t)}finally{i.f()}return a}var he=function(){function FeatureTest(){_classCallCheck(this,FeatureTest)}_createClass(FeatureTest,null,[{key:"isLittleEndian",get:function get(){return shadow(this,"isLittleEndian",function isLittleEndian(){var t=new Uint8Array(4);t[0]=1;return 1===new Uint32Array(t.buffer,0,1)[0]}())}},{key:"isEvalSupported",get:function get(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(t){return!1}}())}},{key:"isOffscreenCanvasSupported",get:function get(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}},{key:"platform",get:function get(){var t;return"undefined"!=typeof navigator&&"string"==typeof(null===(t=navigator)||void 0===t?void 0:t.platform)?shadow(this,"platform",{isMac:navigator.platform.includes("Mac")}):shadow(this,"platform",{isMac:!1})}},{key:"isCSSRoundSupported",get:function get(){var t,r;return shadow(this,"isCSSRoundSupported",null===(t=globalThis.CSS)||void 0===t||null===(r=t.supports)||void 0===r?void 0:r.call(t,"width: round(1.5px, 1px)"))}}]);return FeatureTest}(),de=function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Array(256).keys()).map((function(t){return t.toString(16).padStart(2,"0")})),fe=function(){function Util(){_classCallCheck(this,Util)}_createClass(Util,null,[{key:"makeHexColor",value:function makeHexColor(t,r,a){return"#".concat(de[t]).concat(de[r]).concat(de[a])}},{key:"scaleMinMax",value:function scaleMinMax(t,r){var a;if(t[0]){if(t[0]<0){a=r[0];r[0]=r[2];r[2]=a}r[0]*=t[0];r[2]*=t[0];if(t[3]<0){a=r[1];r[1]=r[3];r[3]=a}r[1]*=t[3];r[3]*=t[3]}else{a=r[0];r[0]=r[1];r[1]=a;a=r[2];r[2]=r[3];r[3]=a;if(t[1]<0){a=r[1];r[1]=r[3];r[3]=a}r[1]*=t[1];r[3]*=t[1];if(t[2]<0){a=r[0];r[0]=r[2];r[2]=a}r[0]*=t[2];r[2]*=t[2]}r[0]+=t[4];r[1]+=t[5];r[2]+=t[4];r[3]+=t[5]}},{key:"transform",value:function transform(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}},{key:"applyTransform",value:function applyTransform(t,r){return[t[0]*r[0]+t[1]*r[2]+r[4],t[0]*r[1]+t[1]*r[3]+r[5]]}},{key:"applyInverseTransform",value:function applyInverseTransform(t,r){var a=r[0]*r[3]-r[1]*r[2];return[(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/a,(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/a]}},{key:"getAxialAlignedBoundingBox",value:function getAxialAlignedBoundingBox(t,r){var a=this.applyTransform(t,r),i=this.applyTransform(t.slice(2,4),r),o=this.applyTransform([t[0],t[3]],r),l=this.applyTransform([t[2],t[1]],r);return[Math.min(a[0],i[0],o[0],l[0]),Math.min(a[1],i[1],o[1],l[1]),Math.max(a[0],i[0],o[0],l[0]),Math.max(a[1],i[1],o[1],l[1])]}},{key:"inverseTransform",value:function inverseTransform(t){var r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]}},{key:"singularValueDecompose2dScale",value:function singularValueDecompose2dScale(t){var r=[t[0],t[2],t[1],t[3]],a=t[0]*r[0]+t[1]*r[2],i=t[0]*r[1]+t[1]*r[3],o=t[2]*r[0]+t[3]*r[2],l=t[2]*r[1]+t[3]*r[3],c=(a+l)/2,u=Math.sqrt(Math.pow(a+l,2)-4*(a*l-o*i))/2,h=c+u||1,d=c-u||1;return[Math.sqrt(h),Math.sqrt(d)]}},{key:"normalizeRect",value:function normalizeRect(t){var r=t.slice(0);if(t[0]>t[2]){r[0]=t[2];r[2]=t[0]}if(t[1]>t[3]){r[1]=t[3];r[3]=t[1]}return r}},{key:"intersect",value:function intersect(t,r){var a=Math.max(Math.min(t[0],t[2]),Math.min(r[0],r[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(r[0],r[2]));if(a>i)return null;var o=Math.max(Math.min(t[1],t[3]),Math.min(r[1],r[3])),l=Math.min(Math.max(t[1],t[3]),Math.max(r[1],r[3]));return o>l?null:[a,o,i,l]}},{key:"bezierBoundingBox",value:function bezierBoundingBox(t,r,a,i,o,l,c,u,h){if(h){h[0]=Math.min(h[0],t,c);h[1]=Math.min(h[1],r,u);h[2]=Math.max(h[2],t,c);h[3]=Math.max(h[3],r,u)}else h=[Math.min(t,c),Math.min(r,u),Math.max(t,c),Math.max(r,u)];_classStaticPrivateMethodGet(this,Util,_getExtremum).call(this,t,a,o,c,r,i,l,u,3*(3*(a-o)-t+c),6*(t-2*a+o),3*(a-t),h);_classStaticPrivateMethodGet(this,Util,_getExtremum).call(this,t,a,o,c,r,i,l,u,3*(3*(i-l)-r+u),6*(r-2*i+l),3*(i-r),h);return h}}]);return Util}();t=fe;function _getExtremumOnCurve(t,r,a,i,o,l,c,u,h,d){if(!(h<=0||h>=1)){var p=1-h,v=h*h,_=v*h,y=p*(p*(p*t+3*h*r)+3*v*a)+_*i,g=p*(p*(p*o+3*h*l)+3*v*c)+_*u;d[0]=Math.min(d[0],y);d[1]=Math.min(d[1],g);d[2]=Math.max(d[2],y);d[3]=Math.max(d[3],g)}}function _getExtremum(r,a,i,o,l,c,u,h,d,p,v,_){if(Math.abs(d)<1e-12)Math.abs(p)>=1e-12&&_classStaticPrivateMethodGet(this,t,_getExtremumOnCurve).call(this,r,a,i,o,l,c,u,h,-v/p,_);else{var y=Math.pow(p,2)-4*v*d;if(!(y<0)){var g=Math.sqrt(y),m=2*d;_classStaticPrivateMethodGet(this,t,_getExtremumOnCurve).call(this,r,a,i,o,l,c,u,h,(-p+g)/m,_);_classStaticPrivateMethodGet(this,t,_getExtremumOnCurve).call(this,r,a,i,o,l,c,u,h,(-p-g)/m,_)}}}var pe=new WeakMap,ve=function(){function PromiseCapability(){var t=this;_classCallCheck(this,PromiseCapability);_classPrivateFieldInitSpec(this,pe,{writable:!0,value:!1});this.promise=new Promise((function(r,a){t.resolve=function(a){_classPrivateFieldSet(t,pe,!0);r(a)};t.reject=function(r){_classPrivateFieldSet(t,pe,!0);a(r)}}))}_createClass(PromiseCapability,[{key:"settled",get:function get(){return function _classPrivateFieldGet(t,r){return function _classApplyDescriptorGet(t,r){return r.get?r.get.call(t):r.value}(t,_classExtractFieldDescriptor(t,r,"get"))}(this,pe)}}]);return PromiseCapability}(),_e=null,ye=null;function normalizeUnicode(t){if(!_e){_e=/([\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;ye=new Map([["ſt","ſt"]])}return t.replaceAll(_e,(function(t,r,a){return r?r.normalize("NFKC"):ye.get(a)}))}function getUuid(){var t,r;if("undefined"!=typeof crypto&&"function"==typeof(null===(t=crypto)||void 0===t?void 0:t.randomUUID))return crypto.randomUUID();var a=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof(null===(r=crypto)||void 0===r?void 0:r.getRandomValues))crypto.getRandomValues(a);else for(var i=0;i<32;i++)a[i]=Math.floor(255*Math.random());return bytesToString(a)}var ge="pdfjs_internal_id_";__webpack_require__(8373),__webpack_require__(6793),__webpack_require__(7629),__webpack_require__(7509),__webpack_require__(429),__webpack_require__(6409),__webpack_require__(9649),__webpack_require__(414),__webpack_require__(7602),__webpack_require__(5),__webpack_require__(5716),__webpack_require__(3442),__webpack_require__(1964),__webpack_require__(9878),__webpack_require__(2915),__webpack_require__(7895),__webpack_require__(2275),__webpack_require__(7522),__webpack_require__(7337),__webpack_require__(3429),__webpack_require__(7462),__webpack_require__(8324),__webpack_require__(6585),__webpack_require__(1830),__webpack_require__(9944),__webpack_require__(2918),__webpack_require__(2176),__webpack_require__(2506),__webpack_require__(7961),__webpack_require__(8436),__webpack_require__(6054),__webpack_require__(8244),__webpack_require__(691),__webpack_require__(8077),__webpack_require__(2410),__webpack_require__(2003),__webpack_require__(8518),__webpack_require__(3440),__webpack_require__(2940),__webpack_require__(9873),__webpack_require__(3476);function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==base_factory_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(base_factory_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function base_factory_typeof(t){return base_factory_typeof="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},base_factory_typeof(t)}function base_factory_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function base_factory_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,base_factory_toPropertyKey(i.key),i)}}function base_factory_createClass(t,r,a){r&&base_factory_defineProperties(t.prototype,r);a&&base_factory_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function base_factory_toPropertyKey(t){var r=function base_factory_toPrimitive(t,r){if("object"!=base_factory_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=base_factory_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==base_factory_typeof(r)?r:String(r)}var me,be=function(){function BaseFilterFactory(){base_factory_classCallCheck(this,BaseFilterFactory);this.constructor===BaseFilterFactory&&unreachable("Cannot initialize BaseFilterFactory.")}base_factory_createClass(BaseFilterFactory,[{key:"addFilter",value:function addFilter(t){return"none"}},{key:"addHCMFilter",value:function addHCMFilter(t,r){return"none"}},{key:"addHighlightHCMFilter",value:function addHighlightHCMFilter(t,r,a,i,o){return"none"}},{key:"destroy",value:function destroy(){}}]);return BaseFilterFactory}(),we=function(){function BaseCanvasFactory(){base_factory_classCallCheck(this,BaseCanvasFactory);this.constructor===BaseCanvasFactory&&unreachable("Cannot initialize BaseCanvasFactory.")}base_factory_createClass(BaseCanvasFactory,[{key:"create",value:function create(t,r){if(t<=0||r<=0)throw new Error("Invalid canvas size");var a=this._createCanvas(t,r),i=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,o=a.getContext("2d",i);return{canvas:a,context:o}}},{key:"reset",value:function reset(t,r,a){if(!t.canvas)throw new Error("Canvas is not specified");if(r<=0||a<=0)throw new Error("Invalid canvas size");t.canvas.width=r;t.canvas.height=a}},{key:"destroy",value:function 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}},{key:"_createCanvas",value:function _createCanvas(t,r){unreachable("Abstract method `_createCanvas` called.")}}]);return BaseCanvasFactory}(),Pe=function(){function BaseCMapReaderFactory(t){var r=t.baseUrl,a=void 0===r?null:r,i=t.isCompressed,o=void 0===i||i;base_factory_classCallCheck(this,BaseCMapReaderFactory);this.constructor===BaseCMapReaderFactory&&unreachable("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=a;this.isCompressed=o}base_factory_createClass(BaseCMapReaderFactory,[{key:"fetch",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(t){var r,a,i,o=this;return _regeneratorRuntime().wrap((function _callee$(l){for(;;)switch(l.prev=l.next){case 0:r=t.name;if(this.baseUrl){l.next=3;break}throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');case 3:if(r){l.next=5;break}throw new Error("CMap name must be specified.");case 5:a=this.baseUrl+r+(this.isCompressed?".bcmap":"");i=this.isCompressed?Z.BINARY:Z.NONE;return l.abrupt("return",this._fetchData(a,i).catch((function(t){throw new Error("Unable to load ".concat(o.isCompressed?"binary ":"","CMap at: ").concat(a))})));case 8:case"end":return l.stop()}}),_callee,this)}))),function fetch(r){return t.apply(this,arguments)})},{key:"_fetchData",value:function _fetchData(t,r){unreachable("Abstract method `_fetchData` called.")}}]);var t;return BaseCMapReaderFactory}(),ke=function(){function BaseStandardFontDataFactory(t){var r=t.baseUrl,a=void 0===r?null:r;base_factory_classCallCheck(this,BaseStandardFontDataFactory);this.constructor===BaseStandardFontDataFactory&&unreachable("Cannot initialize BaseStandardFontDataFactory.");this.baseUrl=a}base_factory_createClass(BaseStandardFontDataFactory,[{key:"fetch",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(t){var r,a;return _regeneratorRuntime().wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:r=t.filename;if(this.baseUrl){i.next=3;break}throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');case 3:if(r){i.next=5;break}throw new Error("Font filename must be specified.");case 5:a="".concat(this.baseUrl).concat(r);return i.abrupt("return",this._fetchData(a).catch((function(t){throw new Error("Unable to load font data at: ".concat(a))})));case 7:case"end":return i.stop()}}),_callee2,this)}))),function fetch(r){return t.apply(this,arguments)})},{key:"_fetchData",value:function _fetchData(t){unreachable("Abstract method `_fetchData` called.")}}]);var t;return BaseStandardFontDataFactory}(),Se=function(){function BaseSVGFactory(){base_factory_classCallCheck(this,BaseSVGFactory);this.constructor===BaseSVGFactory&&unreachable("Cannot initialize BaseSVGFactory.")}base_factory_createClass(BaseSVGFactory,[{key:"create",value:function create(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||r<=0)throw new Error("Invalid SVG dimensions");var i=this._createSVG("svg:svg");i.setAttribute("version","1.1");if(!a){i.setAttribute("width","".concat(t,"px"));i.setAttribute("height","".concat(r,"px"))}i.setAttribute("preserveAspectRatio","none");i.setAttribute("viewBox","0 0 ".concat(t," ").concat(r));return i}},{key:"createElement",value:function createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}},{key:"_createSVG",value:function _createSVG(t){unreachable("Abstract method `_createSVG` called.")}}]);return BaseSVGFactory}();function display_utils_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */display_utils_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==display_utils_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(display_utils_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function display_utils_typeof(t){return display_utils_typeof="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},display_utils_typeof(t)}function display_utils_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=display_utils_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function display_utils_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function display_utils_toConsumableArray(t){return function display_utils_arrayWithoutHoles(t){if(Array.isArray(t))return display_utils_arrayLikeToArray(t)}(t)||function display_utils_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||display_utils_unsupportedIterableToArray(t)||function display_utils_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function display_utils_slicedToArray(t,r){return function display_utils_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function display_utils_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||display_utils_unsupportedIterableToArray(t,r)||function display_utils_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function display_utils_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return display_utils_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?display_utils_arrayLikeToArray(t,r):void 0}}function display_utils_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function display_utils_callSuper(t,r,a){return r=display_utils_getPrototypeOf(r),function display_utils_possibleConstructorReturn(t,r){if(r&&("object"===display_utils_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return display_utils_assertThisInitialized(t)}(t,display_utils_isNativeReflectConstruct()?Reflect.construct(r,a||[],display_utils_getPrototypeOf(t).constructor):r.apply(t,a))}function display_utils_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(display_utils_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function display_utils_getPrototypeOf(t){display_utils_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return display_utils_getPrototypeOf(t)}function display_utils_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function display_utils_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&display_utils_setPrototypeOf(t,r)}function display_utils_setPrototypeOf(t,r){display_utils_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return display_utils_setPrototypeOf(t,r)}function _classPrivateMethodInitSpec(t,r){display_utils_checkPrivateRedeclaration(t,r);r.add(t)}function display_utils_classPrivateFieldInitSpec(t,r,a){display_utils_checkPrivateRedeclaration(t,r);r.set(t,a)}function display_utils_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function display_utils_classPrivateFieldGet(t,r){return function display_utils_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,display_utils_classExtractFieldDescriptor(t,r,"get"))}function display_utils_classPrivateFieldSet(t,r,a){!function display_utils_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,display_utils_classExtractFieldDescriptor(t,r,"set"),a);return a}function display_utils_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function display_utils_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,display_utils_toPropertyKey(i.key),i)}}function display_utils_createClass(t,r,a){r&&display_utils_defineProperties(t.prototype,r);a&&display_utils_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function display_utils_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperty(t,r,a){(r=display_utils_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function display_utils_toPropertyKey(t){var r=function display_utils_toPrimitive(t,r){if("object"!=display_utils_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=display_utils_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==display_utils_typeof(r)?r:String(r)}var Fe="http://www.w3.org/2000/svg",Ae=display_utils_createClass((function PixelsPerInch(){display_utils_classCallCheck(this,PixelsPerInch)}));me=Ae;_defineProperty(Ae,"CSS",96);_defineProperty(Ae,"PDF",72);_defineProperty(Ae,"PDF_TO_CSS_UNITS",me.CSS/me.PDF);var xe=new WeakMap,Ee=new WeakMap,Ie=new WeakMap,Te=new WeakMap,Ce=new WeakMap,Me=new WeakMap,Ge=new WeakMap,Oe=new WeakMap,Re=new WeakMap,Le=new WeakSet,De=new WeakSet,je=new WeakSet,Ne=new WeakSet,We=new WeakSet,He=function(t){display_utils_inherits(DOMFilterFactory,t);function DOMFilterFactory(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=r.docId,i=r.ownerDocument,o=void 0===i?globalThis.document:i;display_utils_classCallCheck(this,DOMFilterFactory);_classPrivateMethodInitSpec(display_utils_assertThisInitialized(t=display_utils_callSuper(this,DOMFilterFactory)),We);_classPrivateMethodInitSpec(display_utils_assertThisInitialized(t),Ne);_classPrivateMethodInitSpec(display_utils_assertThisInitialized(t),je);_classPrivateMethodInitSpec(display_utils_assertThisInitialized(t),De);_classPrivateMethodInitSpec(display_utils_assertThisInitialized(t),Le);display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Re,{get:_get_defs,set:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Oe,{get:_get_hcmCache,set:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Ge,{get:_get_cache,set:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),xe,{writable:!0,value:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Ee,{writable:!0,value:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Ie,{writable:!0,value:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Te,{writable:!0,value:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Ce,{writable:!0,value:void 0});display_utils_classPrivateFieldInitSpec(display_utils_assertThisInitialized(t),Me,{writable:!0,value:0});display_utils_classPrivateFieldSet(display_utils_assertThisInitialized(t),Ie,a);display_utils_classPrivateFieldSet(display_utils_assertThisInitialized(t),Te,o);return t}display_utils_createClass(DOMFilterFactory,[{key:"addFilter",value:function addFilter(t){var r,a;if(!t)return"none";var i,o,l,c,u=display_utils_classPrivateFieldGet(this,Ge).get(t);if(u)return u;if(1===t.length){for(var h=t[0],d=new Array(256),p=0;p<256;p++)d[p]=h[p]/255;c=i=o=l=d.join(",")}else{for(var v=display_utils_slicedToArray(t,3),_=v[0],y=v[1],g=v[2],m=new Array(256),b=new Array(256),w=new Array(256),P=0;P<256;P++){m[P]=_[P]/255;b[P]=y[P]/255;w[P]=g[P]/255}i=m.join(",");o=b.join(",");l=w.join(",");c="".concat(i).concat(o).concat(l)}if(u=display_utils_classPrivateFieldGet(this,Ge).get(c)){display_utils_classPrivateFieldGet(this,Ge).set(t,u);return u}var k="g_".concat(display_utils_classPrivateFieldGet(this,Ie),"_transfer_map_").concat((display_utils_classPrivateFieldSet(this,Me,(r=display_utils_classPrivateFieldGet(this,Me),a=r++,r)),a)),S="url(#".concat(k,")");display_utils_classPrivateFieldGet(this,Ge).set(t,S);display_utils_classPrivateFieldGet(this,Ge).set(c,S);var A=_classPrivateMethodGet(this,De,_createFilter2).call(this,k);_classPrivateMethodGet(this,Ne,_addTransferMapConversion2).call(this,i,o,l,A);return S}},{key:"addHCMFilter",value:function addHCMFilter(t,r){var a,i="".concat(t,"-").concat(r),o="base",l=display_utils_classPrivateFieldGet(this,Oe).get(o);if((null===(a=l)||void 0===a?void 0:a.key)===i)return l.url;if(l){var c;null===(c=l.filter)||void 0===c||c.remove();l.key=i;l.url="none";l.filter=null}else{l={key:i,url:"none",filter:null};display_utils_classPrivateFieldGet(this,Oe).set(o,l)}if(!t||!r)return l.url;var u=_classPrivateMethodGet(this,We,_getRGB2).call(this,t);t=fe.makeHexColor.apply(fe,display_utils_toConsumableArray(u));var h=_classPrivateMethodGet(this,We,_getRGB2).call(this,r);r=fe.makeHexColor.apply(fe,display_utils_toConsumableArray(h));display_utils_classPrivateFieldGet(this,Re).style.color="";if("#000000"===t&&"#ffffff"===r||t===r)return l.url;for(var d=new Array(256),p=0;p<=255;p++){var v=p/255;d[p]=v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4)}var _=d.join(","),y="g_".concat(display_utils_classPrivateFieldGet(this,Ie),"_hcm_filter"),g=l.filter=_classPrivateMethodGet(this,De,_createFilter2).call(this,y);_classPrivateMethodGet(this,Ne,_addTransferMapConversion2).call(this,_,_,_,g);_classPrivateMethodGet(this,Le,_addGrayConversion2).call(this,g);var m=function getSteps(t,r){for(var a=u[t]/255,i=h[t]/255,o=new Array(r+1),l=0;l<=r;l++)o[l]=a+l/r*(i-a);return o.join(",")};_classPrivateMethodGet(this,Ne,_addTransferMapConversion2).call(this,m(0,5),m(1,5),m(2,5),g);l.url="url(#".concat(y,")");return l.url}},{key:"addHighlightHCMFilter",value:function addHighlightHCMFilter(t,r,a,i,o){var l,c="".concat(r,"-").concat(a,"-").concat(i,"-").concat(o),u=display_utils_classPrivateFieldGet(this,Oe).get(t);if((null===(l=u)||void 0===l?void 0:l.key)===c)return u.url;if(u){var h;null===(h=u.filter)||void 0===h||h.remove();u.key=c;u.url="none";u.filter=null}else{u={key:c,url:"none",filter:null};display_utils_classPrivateFieldGet(this,Oe).set(t,u)}if(!r||!a)return u.url;var d=display_utils_slicedToArray([r,a].map(_classPrivateMethodGet(this,We,_getRGB2).bind(this)),2),p=d[0],v=d[1],_=Math.round(.2126*p[0]+.7152*p[1]+.0722*p[2]),y=Math.round(.2126*v[0]+.7152*v[1]+.0722*v[2]),g=display_utils_slicedToArray([i,o].map(_classPrivateMethodGet(this,We,_getRGB2).bind(this)),2),m=g[0],b=g[1];if(y<_){var w=[y,_,b,m];_=w[0];y=w[1];m=w[2];b=w[3]}display_utils_classPrivateFieldGet(this,Re).style.color="";var P=function getSteps(t,r,a){for(var i=new Array(256),o=(y-_)/a,l=t/255,c=(r-t)/(255*a),u=0,h=0;h<=a;h++){for(var d=Math.round(_+h*o),p=l+h*c,v=u;v<=d;v++)i[v]=p;u=d+1}for(var g=u;g<256;g++)i[g]=i[u-1];return i.join(",")},k="g_".concat(display_utils_classPrivateFieldGet(this,Ie),"_hcm_").concat(t,"_filter"),S=u.filter=_classPrivateMethodGet(this,De,_createFilter2).call(this,k);_classPrivateMethodGet(this,Le,_addGrayConversion2).call(this,S);_classPrivateMethodGet(this,Ne,_addTransferMapConversion2).call(this,P(m[0],b[0],5),P(m[1],b[1],5),P(m[2],b[2],5),S);u.url="url(#".concat(k,")");return u.url}},{key:"destroy",value:function destroy(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])||0===display_utils_classPrivateFieldGet(this,Oe).size){if(display_utils_classPrivateFieldGet(this,Ee)){display_utils_classPrivateFieldGet(this,Ee).parentNode.parentNode.remove();display_utils_classPrivateFieldSet(this,Ee,null)}if(display_utils_classPrivateFieldGet(this,xe)){display_utils_classPrivateFieldGet(this,xe).clear();display_utils_classPrivateFieldSet(this,xe,null)}display_utils_classPrivateFieldSet(this,Me,0)}}}]);return DOMFilterFactory}(be);function _get_cache(){return display_utils_classPrivateFieldGet(this,xe)||display_utils_classPrivateFieldSet(this,xe,new Map)}function _get_hcmCache(){return display_utils_classPrivateFieldGet(this,Ce)||display_utils_classPrivateFieldSet(this,Ce,new Map)}function _get_defs(){if(!display_utils_classPrivateFieldGet(this,Ee)){var t=display_utils_classPrivateFieldGet(this,Te).createElement("div"),r=t.style;r.visibility="hidden";r.contain="strict";r.width=r.height=0;r.position="absolute";r.top=r.left=0;r.zIndex=-1;var a=display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,"svg");a.setAttribute("width",0);a.setAttribute("height",0);display_utils_classPrivateFieldSet(this,Ee,display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,"defs"));t.append(a);a.append(display_utils_classPrivateFieldGet(this,Ee));display_utils_classPrivateFieldGet(this,Te).body.append(t)}return display_utils_classPrivateFieldGet(this,Ee)}function _addGrayConversion2(t){var r=display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,"feColorMatrix");r.setAttribute("type","matrix");r.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(r)}function _createFilter2(t){var r=display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,"filter");r.setAttribute("color-interpolation-filters","sRGB");r.setAttribute("id",t);display_utils_classPrivateFieldGet(this,Re).append(r);return r}function _appendFeFunc2(t,r,a){var i=display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,r);i.setAttribute("type","discrete");i.setAttribute("tableValues",a);t.append(i)}function _addTransferMapConversion2(t,r,a,i){var o=display_utils_classPrivateFieldGet(this,Te).createElementNS(Fe,"feComponentTransfer");i.append(o);_classPrivateMethodGet(this,je,_appendFeFunc2).call(this,o,"feFuncR",t);_classPrivateMethodGet(this,je,_appendFeFunc2).call(this,o,"feFuncG",r);_classPrivateMethodGet(this,je,_appendFeFunc2).call(this,o,"feFuncB",a)}function _getRGB2(t){display_utils_classPrivateFieldGet(this,Re).style.color=t;return getRGB(getComputedStyle(display_utils_classPrivateFieldGet(this,Re)).getPropertyValue("color"))}var Be=function(t){display_utils_inherits(DOMCanvasFactory,t);function DOMCanvasFactory(){var t,r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ownerDocument,a=void 0===r?globalThis.document:r;display_utils_classCallCheck(this,DOMCanvasFactory);(t=display_utils_callSuper(this,DOMCanvasFactory))._document=a;return t}display_utils_createClass(DOMCanvasFactory,[{key:"_createCanvas",value:function _createCanvas(t,r){var a=this._document.createElement("canvas");a.width=t;a.height=r;return a}}]);return DOMCanvasFactory}(we);function fetchData(t){return _fetchData.apply(this,arguments)}function _fetchData(){_fetchData=function display_utils_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){display_utils_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){display_utils_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}(display_utils_regeneratorRuntime().mark((function _callee(t){var r,a,i=arguments;return display_utils_regeneratorRuntime().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:r=i.length>1&&void 0!==i[1]?i[1]:"text";if(!isValidFetchUrl(t,document.baseURI)){o.next=14;break}o.next=4;return fetch(t);case 4:if((a=o.sent).ok){o.next=7;break}throw new Error(a.statusText);case 7:o.t0=r;o.next="arraybuffer"===o.t0?10:"blob"===o.t0?11:"json"===o.t0?12:13;break;case 10:return o.abrupt("return",a.arrayBuffer());case 11:return o.abrupt("return",a.blob());case 12:return o.abrupt("return",a.json());case 13:return o.abrupt("return",a.text());case 14:return o.abrupt("return",new Promise((function(a,i){var o=new XMLHttpRequest;o.open("GET",t,!0);o.responseType=r;o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE){if(200===o.status||0===o.status){var t;switch(r){case"arraybuffer":case"blob":case"json":t=o.response;break;default:t=o.responseText}if(t){a(t);return}}i(new Error(o.statusText))}};o.send(null)})));case 15:case"end":return o.stop()}}),_callee)})));return _fetchData.apply(this,arguments)}var ze=function(t){display_utils_inherits(DOMCMapReaderFactory,t);function DOMCMapReaderFactory(){display_utils_classCallCheck(this,DOMCMapReaderFactory);return display_utils_callSuper(this,DOMCMapReaderFactory,arguments)}display_utils_createClass(DOMCMapReaderFactory,[{key:"_fetchData",value:function _fetchData(t,r){return fetchData(t,this.isCompressed?"arraybuffer":"text").then((function(t){return{cMapData:t instanceof ArrayBuffer?new Uint8Array(t):stringToBytes(t),compressionType:r}}))}}]);return DOMCMapReaderFactory}(Pe),Ue=function(t){display_utils_inherits(DOMStandardFontDataFactory,t);function DOMStandardFontDataFactory(){display_utils_classCallCheck(this,DOMStandardFontDataFactory);return display_utils_callSuper(this,DOMStandardFontDataFactory,arguments)}display_utils_createClass(DOMStandardFontDataFactory,[{key:"_fetchData",value:function _fetchData(t){return fetchData(t,"arraybuffer").then((function(t){return new Uint8Array(t)}))}}]);return DOMStandardFontDataFactory}(ke),qe=function(t){display_utils_inherits(DOMSVGFactory,t);function DOMSVGFactory(){display_utils_classCallCheck(this,DOMSVGFactory);return display_utils_callSuper(this,DOMSVGFactory,arguments)}display_utils_createClass(DOMSVGFactory,[{key:"_createSVG",value:function _createSVG(t){return document.createElementNS(Fe,t)}}]);return DOMSVGFactory}(Se),Ve=function(){function PageViewport(t){var r=t.viewBox,a=t.scale,i=t.rotation,o=t.offsetX,l=void 0===o?0:o,c=t.offsetY,u=void 0===c?0:c,h=t.dontFlip,d=void 0!==h&&h;display_utils_classCallCheck(this,PageViewport);this.viewBox=r;this.scale=a;this.rotation=i;this.offsetX=l;this.offsetY=u;var p,v,_,y,g,m,b,w,P=(r[2]+r[0])/2,k=(r[3]+r[1])/2;(i%=360)<0&&(i+=360);switch(i){case 180:p=-1;v=0;_=0;y=1;break;case 90:p=0;v=1;_=1;y=0;break;case 270:p=0;v=-1;_=-1;y=0;break;case 0:p=1;v=0;_=0;y=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(d){_=-_;y=-y}if(0===p){g=Math.abs(k-r[1])*a+l;m=Math.abs(P-r[0])*a+u;b=(r[3]-r[1])*a;w=(r[2]-r[0])*a}else{g=Math.abs(P-r[0])*a+l;m=Math.abs(k-r[1])*a+u;b=(r[2]-r[0])*a;w=(r[3]-r[1])*a}this.transform=[p*a,v*a,_*a,y*a,g-p*a*P-_*a*k,m-v*a*P-y*a*k];this.width=b;this.height=w}display_utils_createClass(PageViewport,[{key:"rawDims",get:function get(){var t=this.viewBox;return shadow(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}},{key:"clone",value:function clone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.scale,a=void 0===r?this.scale:r,i=t.rotation,o=void 0===i?this.rotation:i,l=t.offsetX,c=void 0===l?this.offsetX:l,u=t.offsetY,h=void 0===u?this.offsetY:u,d=t.dontFlip,p=void 0!==d&&d;return new PageViewport({viewBox:this.viewBox.slice(),scale:a,rotation:o,offsetX:c,offsetY:h,dontFlip:p})}},{key:"convertToViewportPoint",value:function convertToViewportPoint(t,r){return fe.applyTransform([t,r],this.transform)}},{key:"convertToViewportRectangle",value:function convertToViewportRectangle(t){var r=fe.applyTransform([t[0],t[1]],this.transform),a=fe.applyTransform([t[2],t[3]],this.transform);return[r[0],r[1],a[0],a[1]]}},{key:"convertToPdfPoint",value:function convertToPdfPoint(t,r){return fe.applyInverseTransform([t,r],this.transform)}}]);return PageViewport}(),Ke=function(t){display_utils_inherits(RenderingCancelledException,t);function RenderingCancelledException(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;display_utils_classCallCheck(this,RenderingCancelledException);(r=display_utils_callSuper(this,RenderingCancelledException,[t,"RenderingCancelledException"])).extraDelay=a;return r}return display_utils_createClass(RenderingCancelledException)}(ne);function isDataScheme(t){for(var r=t.length,a=0;a<r&&""===t[a].trim();)a++;return"data:"===t.substring(a,a+5).toLowerCase()}function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function getFilenameFromUrl(t){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])){var r=t.split(/[#?]/,1);t=display_utils_slicedToArray(r,1)[0]}return t.substring(t.lastIndexOf("/")+1)}function getPdfFilenameFromUrl(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if(window.PDFViewerApplication.appConfig.filenameForDownload)return window.PDFViewerApplication.appConfig.filenameForDownload;if("string"!=typeof t)return r;if(isDataScheme(t)){warn('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return r}var a=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t),o=a.exec(i[1])||a.exec(i[2])||a.exec(i[3]);if(o&&(o=o[0]).includes("%"))try{o=a.exec(decodeURIComponent(o))[0]}catch(t){}return o||r}var Ye,Xe=function(){function StatTimer(){display_utils_classCallCheck(this,StatTimer);_defineProperty(this,"started",Object.create(null));_defineProperty(this,"times",[])}display_utils_createClass(StatTimer,[{key:"time",value:function time(t){t in this.started&&warn("Timer is already running for ".concat(t));this.started[t]=Date.now()}},{key:"timeEnd",value:function timeEnd(t){t in this.started||warn("Timer has not been started for ".concat(t));this.times.push({name:t,start:this.started[t],end:Date.now()});delete this.started[t]}},{key:"toString",value:function toString(){var t,r=[],a=0,i=display_utils_createForOfIteratorHelper(this.times);try{for(i.s();!(t=i.n()).done;){var o=t.value.name;a=Math.max(o.length,a)}}catch(t){i.e(t)}finally{i.f()}var l,c=display_utils_createForOfIteratorHelper(this.times);try{for(c.s();!(l=c.n()).done;){var u=l.value,h=u.name,d=u.start,p=u.end;r.push("".concat(h.padEnd(a)," ").concat(p-d,"ms\n"))}}catch(t){c.e(t)}finally{c.f()}return r.join("")}}]);return StatTimer}();function isValidFetchUrl(t,r){try{var a=(r?new URL(t,r):new URL(t)).protocol;return"http:"===a||"https:"===a||"capacitor:"===a}catch(t){return!1}}function noContextMenu(t){t.preventDefault()}var $e,Je=function(){function PDFDateString(){display_utils_classCallCheck(this,PDFDateString)}display_utils_createClass(PDFDateString,null,[{key:"toDateObject",value:function toDateObject(t){if(!t||"string"!=typeof t)return null;Ye||(Ye=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));var r=Ye.exec(t);if(!r)return null;var a=parseInt(r[1],10),i=parseInt(r[2],10);i=i>=1&&i<=12?i-1:0;var o=parseInt(r[3],10);o=o>=1&&o<=31?o:1;var l=parseInt(r[4],10);l=l>=0&&l<=23?l:0;var c=parseInt(r[5],10);c=c>=0&&c<=59?c:0;var u=parseInt(r[6],10);u=u>=0&&u<=59?u:0;var h=r[7]||"Z",d=parseInt(r[8],10);d=d>=0&&d<=23?d:0;var p=parseInt(r[9],10)||0;p=p>=0&&p<=59?p:0;if("-"===h){l+=d;c+=p}else if("+"===h){l-=d;c-=p}return new Date(Date.UTC(a,i,o,l,c,u))}}]);return PDFDateString}();function getXfaPageViewport(t,r){var a=r.scale,i=void 0===a?1:a,o=r.rotation,l=void 0===o?0:o,c=t.attributes.style,u=c.width,h=c.height,d=[0,0,parseInt(u),parseInt(h)];return new Ve({viewBox:d,scale:i,rotation:l})}function getRGB(t){if(t.startsWith("#")){var r=parseInt(t.slice(1),16);return[(16711680&r)>>16,(65280&r)>>8,255&r]}if(t.startsWith("rgb("))return t.slice(4,-1).split(",").map((function(t){return parseInt(t)}));if(t.startsWith("rgba("))return t.slice(5,-1).split(",").map((function(t){return parseInt(t)})).slice(0,3);warn('Not a valid color format: "'.concat(t,'"'));return[0,0,0]}function getCurrentTransform(t){var r=t.getTransform();return[r.a,r.b,r.c,r.d,r.e,r.f]}function getCurrentTransformInverse(t){var r=t.getTransform().invertSelf();return[r.a,r.b,r.c,r.d,r.e,r.f]}function setLayerDimensions(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(r instanceof Ve){var o=r.rawDims,l=o.pageWidth,c=o.pageHeight,u=t.style,h=he.isCSSRoundSupported,d="var(--scale-factor) * ".concat(l,"px"),p="var(--scale-factor) * ".concat(c,"px"),v=h?"round(".concat(d,", 1px)"):"calc(".concat(d,")"),_=h?"round(".concat(p,", 1px)"):"calc(".concat(p,")");if(a&&r.rotation%180!=0){u.width=_;u.height=v}else{u.width=v;u.height=_}}i&&t.setAttribute("data-main-rotation",r.rotation)}function tools_typeof(t){return tools_typeof="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},tools_typeof(t)}function tools_defineProperty(t,r,a){(r=tools_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function tools_toConsumableArray(t){return function tools_arrayWithoutHoles(t){if(Array.isArray(t))return tools_arrayLikeToArray(t)}(t)||function tools_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||tools_unsupportedIterableToArray(t)||function tools_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tools_slicedToArray(t,r){return function tools_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function tools_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||tools_unsupportedIterableToArray(t,r)||function tools_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tools_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */tools_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==tools_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(tools_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function tools_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function tools_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){tools_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){tools_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function tools_classPrivateMethodInitSpec(t,r){tools_checkPrivateRedeclaration(t,r);r.add(t)}function tools_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function tools_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function tools_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,tools_toPropertyKey(i.key),i)}}function tools_createClass(t,r,a){r&&tools_defineProperties(t.prototype,r);a&&tools_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function tools_toPropertyKey(t){var r=function tools_toPrimitive(t,r){if("object"!=tools_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=tools_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==tools_typeof(r)?r:String(r)}function tools_classPrivateFieldInitSpec(t,r,a){tools_checkPrivateRedeclaration(t,r);r.set(t,a)}function tools_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tools_classPrivateFieldSet(t,r,a){!function tools_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,tools_classExtractFieldDescriptor(t,r,"set"),a);return a}function tools_classPrivateFieldGet(t,r){return function tools_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,tools_classExtractFieldDescriptor(t,r,"get"))}function tools_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function tools_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=tools_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function tools_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return tools_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?tools_arrayLikeToArray(t,r):void 0}}function tools_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function bindEvents(t,r,a){var i,o=tools_createForOfIteratorHelper(a);try{for(o.s();!(i=o.n()).done;){var l=i.value;r.addEventListener(l,t[l].bind(t))}}catch(t){o.e(t)}finally{o.f()}}var Qe=new WeakMap,Ze=function(){function IdManager(){tools_classCallCheck(this,IdManager);tools_classPrivateFieldInitSpec(this,Qe,{writable:!0,value:0})}tools_createClass(IdManager,[{key:"getId",value:function getId(){var t,r;return"".concat("pdfjs_internal_editor_").concat((tools_classPrivateFieldSet(this,Qe,(t=tools_classPrivateFieldGet(this,Qe),r=t++,t)),r))}}]);return IdManager}(),et=new WeakMap,tt=new WeakMap,rt=new WeakMap,nt=new WeakSet,it=function(){function ImageManager(){tools_classCallCheck(this,ImageManager);tools_classPrivateMethodInitSpec(this,nt);tools_classPrivateFieldInitSpec(this,et,{writable:!0,value:getUuid()});tools_classPrivateFieldInitSpec(this,tt,{writable:!0,value:0});tools_classPrivateFieldInitSpec(this,rt,{writable:!0,value:null})}tools_createClass(ImageManager,[{key:"getFromFile",value:(a=tools_asyncToGenerator(tools_regeneratorRuntime().mark((function _callee(t){var r,a,i,o;return tools_regeneratorRuntime().wrap((function _callee$(l){for(;;)switch(l.prev=l.next){case 0:r=t.lastModified,a=t.name,i=t.size,o=t.type;return l.abrupt("return",tools_classPrivateMethodGet(this,nt,_get2).call(this,"".concat(r,"_").concat(a,"_").concat(i,"_").concat(o),t));case 2:case"end":return l.stop()}}),_callee,this)}))),function getFromFile(t){return a.apply(this,arguments)})},{key:"getFromUrl",value:(r=tools_asyncToGenerator(tools_regeneratorRuntime().mark((function _callee2(t){return tools_regeneratorRuntime().wrap((function _callee2$(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",tools_classPrivateMethodGet(this,nt,_get2).call(this,t,t));case 1:case"end":return r.stop()}}),_callee2,this)}))),function getFromUrl(t){return r.apply(this,arguments)})},{key:"getFromId",value:(t=tools_asyncToGenerator(tools_regeneratorRuntime().mark((function _callee3(t){var r;return tools_regeneratorRuntime().wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:tools_classPrivateFieldGet(this,rt)||tools_classPrivateFieldSet(this,rt,new Map);if(r=tools_classPrivateFieldGet(this,rt).get(t)){a.next=4;break}return a.abrupt("return",null);case 4:if(!r.bitmap){a.next=7;break}r.refCounter+=1;return a.abrupt("return",r);case 7:if(!r.file){a.next=9;break}return a.abrupt("return",this.getFromFile(r.file));case 9:return a.abrupt("return",this.getFromUrl(r.url));case 10:case"end":return a.stop()}}),_callee3,this)}))),function getFromId(r){return t.apply(this,arguments)})},{key:"getSvgUrl",value:function getSvgUrl(t){var r=tools_classPrivateFieldGet(this,rt).get(t);return null!=r&&r.isSvg?r.svgUrl:null}},{key:"deleteId",value:function deleteId(t){tools_classPrivateFieldGet(this,rt)||tools_classPrivateFieldSet(this,rt,new Map);var r=tools_classPrivateFieldGet(this,rt).get(t);if(r){r.refCounter-=1;0===r.refCounter&&(r.bitmap=null)}}},{key:"isValidId",value:function isValidId(t){return t.startsWith("image_".concat(tools_classPrivateFieldGet(this,et),"_"))}}],[{key:"_isSVGFittingCanvas",get:function get(){var t=new OffscreenCanvas(1,3).getContext("2d"),r=new Image;r.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 shadow(this,"_isSVGFittingCanvas",r.decode().then((function(){t.drawImage(r,0,0,1,1,0,0,1,3);return 0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]})))}}]);var t,r,a;return ImageManager}();$e=it;function _get2(t,r){return _get3.apply(this,arguments)}function _get3(){_get3=tools_asyncToGenerator(tools_regeneratorRuntime().mark((function _callee5(t,r){var a,i,o,l,c,u,h,d,p;return tools_regeneratorRuntime().wrap((function _callee5$(v){for(;;)switch(v.prev=v.next){case 0:tools_classPrivateFieldGet(this,rt)||tools_classPrivateFieldSet(this,rt,new Map);if(null!==(i=tools_classPrivateFieldGet(this,rt).get(t))){v.next=4;break}return v.abrupt("return",null);case 4:if(null===(a=i)||void 0===a||!a.bitmap){v.next=7;break}i.refCounter+=1;return v.abrupt("return",i);case 7:v.prev=7;i||(i={bitmap:null,id:"image_".concat(tools_classPrivateFieldGet(this,et),"_").concat((tools_classPrivateFieldSet(this,tt,(o=tools_classPrivateFieldGet(this,tt),l=o++,o)),l)),refCounter:0,isSvg:!1});if("string"!=typeof r){v.next=16;break}i.url=r;v.next=13;return fetchData(r,"blob");case 13:c=v.sent;v.next=17;break;case 16:c=i.file=r;case 17:if("image/svg+xml"!==c.type){v.next=27;break}u=$e._isSVGFittingCanvas;h=new FileReader;d=new Image;p=new Promise((function(t,r){d.onload=function(){i.bitmap=d;i.isSvg=!0;t()};h.onload=tools_asyncToGenerator(tools_regeneratorRuntime().mark((function _callee4(){var t;return tools_regeneratorRuntime().wrap((function _callee4$(r){for(;;)switch(r.prev=r.next){case 0:t=i.svgUrl=h.result;r.next=3;return u;case 3:if(!r.sent){r.next=7;break}r.t0="".concat(t,"#svgView(preserveAspectRatio(none))");r.next=8;break;case 7:r.t0=t;case 8:d.src=r.t0;case 9:case"end":return r.stop()}}),_callee4)})));d.onerror=h.onerror=r}));h.readAsDataURL(c);v.next=25;return p;case 25:v.next=30;break;case 27:v.next=29;return createImageBitmap(c);case 29:i.bitmap=v.sent;case 30:i.refCounter=1;v.next=37;break;case 33:v.prev=33;v.t0=v.catch(7);console.error(v.t0);i=null;case 37:tools_classPrivateFieldGet(this,rt).set(t,i);i&&tools_classPrivateFieldGet(this,rt).set(i.id,i);return v.abrupt("return",i);case 40:case"end":return v.stop()}}),_callee5,this,[[7,33]])})));return _get3.apply(this,arguments)}var ot=new WeakMap,st=new WeakMap,lt=new WeakMap,ct=new WeakMap,ut=function(){function CommandManager(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;tools_classCallCheck(this,CommandManager);tools_classPrivateFieldInitSpec(this,ot,{writable:!0,value:[]});tools_classPrivateFieldInitSpec(this,st,{writable:!0,value:!1});tools_classPrivateFieldInitSpec(this,lt,{writable:!0,value:void 0});tools_classPrivateFieldInitSpec(this,ct,{writable:!0,value:-1});tools_classPrivateFieldSet(this,lt,t)}tools_createClass(CommandManager,[{key:"add",value:function add(t){var r=t.cmd,a=t.undo,i=t.post,o=t.mustExec,l=t.type,c=void 0===l?NaN:l,u=t.overwriteIfSameType,h=void 0!==u&&u,d=t.keepUndo,p=void 0!==d&&d;o&&r();if(!tools_classPrivateFieldGet(this,st)){var v={cmd:r,undo:a,post:i,type:c};if(-1!==tools_classPrivateFieldGet(this,ct))if(h&&tools_classPrivateFieldGet(this,ot)[tools_classPrivateFieldGet(this,ct)].type===c){p&&(v.undo=tools_classPrivateFieldGet(this,ot)[tools_classPrivateFieldGet(this,ct)].undo);tools_classPrivateFieldGet(this,ot)[tools_classPrivateFieldGet(this,ct)]=v}else{var _=tools_classPrivateFieldGet(this,ct)+1;if(_===tools_classPrivateFieldGet(this,lt))tools_classPrivateFieldGet(this,ot).splice(0,1);else{tools_classPrivateFieldSet(this,ct,_);_<tools_classPrivateFieldGet(this,ot).length&&tools_classPrivateFieldGet(this,ot).splice(_)}tools_classPrivateFieldGet(this,ot).push(v)}else{tools_classPrivateFieldGet(this,ot).length>0&&(tools_classPrivateFieldGet(this,ot).length=0);tools_classPrivateFieldSet(this,ct,0);tools_classPrivateFieldGet(this,ot).push(v)}}}},{key:"undo",value:function undo(){if(-1!==tools_classPrivateFieldGet(this,ct)){tools_classPrivateFieldSet(this,st,!0);var t=tools_classPrivateFieldGet(this,ot)[tools_classPrivateFieldGet(this,ct)],undo=t.undo,r=t.post;undo();null==r||r();tools_classPrivateFieldSet(this,st,!1);tools_classPrivateFieldSet(this,ct,tools_classPrivateFieldGet(this,ct)-1)}}},{key:"redo",value:function redo(){if(tools_classPrivateFieldGet(this,ct)<tools_classPrivateFieldGet(this,ot).length-1){tools_classPrivateFieldSet(this,ct,tools_classPrivateFieldGet(this,ct)+1);tools_classPrivateFieldSet(this,st,!0);var t=tools_classPrivateFieldGet(this,ot)[tools_classPrivateFieldGet(this,ct)],r=t.cmd,a=t.post;r();null==a||a();tools_classPrivateFieldSet(this,st,!1)}}},{key:"hasSomethingToUndo",value:function hasSomethingToUndo(){return-1!==tools_classPrivateFieldGet(this,ct)}},{key:"hasSomethingToRedo",value:function hasSomethingToRedo(){return tools_classPrivateFieldGet(this,ct)<tools_classPrivateFieldGet(this,ot).length-1}},{key:"destroy",value:function destroy(){tools_classPrivateFieldSet(this,ot,null)}},{key:"reset",value:function reset(){tools_classPrivateFieldSet(this,ot,[]);tools_classPrivateFieldSet(this,ct,-1);tools_classPrivateFieldSet(this,st,!1)}}]);return CommandManager}(),ht=new WeakSet,dt=function(){function KeyboardManager(t){tools_classCallCheck(this,KeyboardManager);tools_classPrivateMethodInitSpec(this,ht);this.buffer=[];this.callbacks=new Map;this.allKeys=new Set;var r,a=he.platform.isMac,i=tools_createForOfIteratorHelper(t);try{for(i.s();!(r=i.n()).done;){var o,l=tools_slicedToArray(r.value,3),c=l[0],u=l[1],h=l[2],d=void 0===h?{}:h,p=tools_createForOfIteratorHelper(c);try{for(p.s();!(o=p.n()).done;){var v=o.value,_=v.startsWith("mac+");if(a&&_){this.callbacks.set(v.slice(4),{callback:u,options:d});this.allKeys.add(v.split("+").at(-1))}else if(!a&&!_){this.callbacks.set(v,{callback:u,options:d});this.allKeys.add(v.split("+").at(-1))}}}catch(t){p.e(t)}finally{p.f()}}}catch(t){i.e(t)}finally{i.f()}}tools_createClass(KeyboardManager,[{key:"exec",value:function exec(t,r){if(this.allKeys.has(r.key)){var a=this.callbacks.get(tools_classPrivateMethodGet(this,ht,_serialize2).call(this,r));if(a){var i=a.callback,o=a.options,l=o.bubbles,c=void 0!==l&&l,u=o.args,h=void 0===u?[]:u,d=o.checker,p=void 0===d?null:d;if(!p||p(t,r)){i.bind.apply(i,[t].concat(tools_toConsumableArray(h),[r]))();if(!c){r.stopPropagation();r.preventDefault()}}}}}}]);return KeyboardManager}();function _serialize2(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);var r=this.buffer.join("+");this.buffer.length=0;return r}var ft=function(){function ColorManager(){tools_classCallCheck(this,ColorManager)}tools_createClass(ColorManager,[{key:"_colors",get:function get(){var t=new Map([["CanvasText",null],["Canvas",null]]);!function getColorValues(t){var r=document.createElement("span");r.style.visibility="hidden";document.body.append(r);var a,i=display_utils_createForOfIteratorHelper(t.keys());try{for(i.s();!(a=i.n()).done;){var o=a.value;r.style.color=o;var l=window.getComputedStyle(r).color;t.set(o,getRGB(l))}}catch(t){i.e(t)}finally{i.f()}r.remove()}(t);return shadow(this,"_colors",t)}},{key:"convert",value:function convert(t){var r=getRGB(t);if(!window.matchMedia("(forced-colors: active)").matches)return r;var a,i=tools_createForOfIteratorHelper(this._colors);try{for(i.s();!(a=i.n()).done;){var o=tools_slicedToArray(a.value,2),l=o[0];if(o[1].every((function(t,a){return t===r[a]})))return ColorManager._colorsMapping.get(l)}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"getHexCode",value:function getHexCode(t){var r=this._colors.get(t);return r?fe.makeHexColor.apply(fe,tools_toConsumableArray(r)):t}}]);return ColorManager}();tools_defineProperty(ft,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var pt,vt=new WeakMap,_t=new WeakMap,yt=new WeakMap,gt=new WeakMap,mt=new WeakMap,bt=new WeakMap,wt=new WeakMap,Pt=new WeakMap,kt=new WeakMap,St=new WeakMap,Ft=new WeakMap,At=new WeakMap,xt=new WeakMap,Et=new WeakMap,It=new WeakMap,Tt=new WeakMap,Ct=new WeakMap,Mt=new WeakMap,Gt=new WeakMap,Ot=new WeakMap,Rt=new WeakMap,Lt=new WeakMap,Dt=new WeakMap,jt=new WeakMap,Nt=new WeakMap,Wt=new WeakMap,Ht=new WeakMap,Bt=new WeakMap,zt=new WeakMap,Ut=new WeakMap,qt=new WeakMap,Vt=new WeakMap,Kt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,$t=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,Zt=new WeakSet,er=new WeakSet,tr=new WeakSet,rr=new WeakSet,nr=new WeakSet,ar=new WeakSet,ir=new WeakSet,or=new WeakSet,sr=new WeakSet,lr=new WeakSet,cr=new WeakSet,ur=new WeakMap,hr=new WeakSet,dr=new WeakSet,fr=function(){function AnnotationEditorUIManager(t,r,a,i,o,l,c){tools_classCallCheck(this,AnnotationEditorUIManager);tools_classPrivateMethodInitSpec(this,dr);tools_classPrivateMethodInitSpec(this,hr);tools_classPrivateFieldInitSpec(this,ur,{get:_get_lastSelectedEditor,set:void 0});tools_classPrivateMethodInitSpec(this,cr);tools_classPrivateMethodInitSpec(this,lr);tools_classPrivateMethodInitSpec(this,sr);tools_classPrivateMethodInitSpec(this,or);tools_classPrivateMethodInitSpec(this,ir);tools_classPrivateMethodInitSpec(this,ar);tools_classPrivateMethodInitSpec(this,nr);tools_classPrivateMethodInitSpec(this,rr);tools_classPrivateMethodInitSpec(this,tr);tools_classPrivateMethodInitSpec(this,er);tools_classPrivateMethodInitSpec(this,Zt);tools_classPrivateFieldInitSpec(this,vt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,_t,{writable:!0,value:new Map});tools_classPrivateFieldInitSpec(this,yt,{writable:!0,value:new Map});tools_classPrivateFieldInitSpec(this,gt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,mt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,bt,{writable:!0,value:new ut});tools_classPrivateFieldInitSpec(this,wt,{writable:!0,value:0});tools_classPrivateFieldInitSpec(this,Pt,{writable:!0,value:new Set});tools_classPrivateFieldInitSpec(this,kt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,St,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Ft,{writable:!0,value:new Set});tools_classPrivateFieldInitSpec(this,At,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,xt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Et,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,It,{writable:!0,value:new Ze});tools_classPrivateFieldInitSpec(this,Tt,{writable:!0,value:!1});tools_classPrivateFieldInitSpec(this,Ct,{writable:!0,value:!1});tools_classPrivateFieldInitSpec(this,Mt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Gt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Ot,{writable:!0,value:g.NONE});tools_classPrivateFieldInitSpec(this,Rt,{writable:!0,value:new Set});tools_classPrivateFieldInitSpec(this,Lt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Dt,{writable:!0,value:this.blur.bind(this)});tools_classPrivateFieldInitSpec(this,jt,{writable:!0,value:this.focus.bind(this)});tools_classPrivateFieldInitSpec(this,Nt,{writable:!0,value:this.copy.bind(this)});tools_classPrivateFieldInitSpec(this,Wt,{writable:!0,value:this.cut.bind(this)});tools_classPrivateFieldInitSpec(this,Ht,{writable:!0,value:this.paste.bind(this)});tools_classPrivateFieldInitSpec(this,Bt,{writable:!0,value:this.keydown.bind(this)});tools_classPrivateFieldInitSpec(this,zt,{writable:!0,value:this.keyup.bind(this)});tools_classPrivateFieldInitSpec(this,Ut,{writable:!0,value:this.onEditingAction.bind(this)});tools_classPrivateFieldInitSpec(this,qt,{writable:!0,value:this.onPageChanging.bind(this)});tools_classPrivateFieldInitSpec(this,Vt,{writable:!0,value:this.onScaleChanging.bind(this)});tools_classPrivateFieldInitSpec(this,Kt,{writable:!0,value:this.onRotationChanging.bind(this)});tools_classPrivateFieldInitSpec(this,Yt,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}});tools_classPrivateFieldInitSpec(this,Xt,{writable:!0,value:[0,0]});tools_classPrivateFieldInitSpec(this,$t,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Jt,{writable:!0,value:null});tools_classPrivateFieldInitSpec(this,Qt,{writable:!0,value:null});tools_classPrivateFieldSet(this,Jt,t);tools_classPrivateFieldSet(this,Qt,r);tools_classPrivateFieldSet(this,gt,a);this._eventBus=i;this._eventBus._on("editingaction",tools_classPrivateFieldGet(this,Ut));this._eventBus._on("pagechanging",tools_classPrivateFieldGet(this,qt));this._eventBus._on("scalechanging",tools_classPrivateFieldGet(this,Vt));this._eventBus._on("rotationchanging",tools_classPrivateFieldGet(this,Kt));tools_classPrivateFieldSet(this,mt,o.annotationStorage);tools_classPrivateFieldSet(this,At,o.filterFactory);tools_classPrivateFieldSet(this,Lt,l);tools_classPrivateFieldSet(this,Et,c||null);this.viewParameters={realScale:Ae.PDF_TO_CSS_UNITS,rotation:0};this.isShiftKeyDown=!1}tools_createClass(AnnotationEditorUIManager,[{key:"destroy",value:function destroy(){var t;tools_classPrivateMethodGet(this,rr,_removeKeyboardManager2).call(this);tools_classPrivateMethodGet(this,er,_removeFocusManager2).call(this);this._eventBus._off("editingaction",tools_classPrivateFieldGet(this,Ut));this._eventBus._off("pagechanging",tools_classPrivateFieldGet(this,qt));this._eventBus._off("scalechanging",tools_classPrivateFieldGet(this,Vt));this._eventBus._off("rotationchanging",tools_classPrivateFieldGet(this,Kt));var r,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(a.s();!(r=a.n()).done;){r.value.destroy()}}catch(t){a.e(t)}finally{a.f()}tools_classPrivateFieldGet(this,yt).clear();tools_classPrivateFieldGet(this,_t).clear();tools_classPrivateFieldGet(this,Ft).clear();tools_classPrivateFieldSet(this,vt,null);tools_classPrivateFieldGet(this,Rt).clear();tools_classPrivateFieldGet(this,bt).destroy();null===(t=tools_classPrivateFieldGet(this,gt))||void 0===t||t.destroy();if(tools_classPrivateFieldGet(this,xt)){clearTimeout(tools_classPrivateFieldGet(this,xt));tools_classPrivateFieldSet(this,xt,null)}if(tools_classPrivateFieldGet(this,$t)){clearTimeout(tools_classPrivateFieldGet(this,$t));tools_classPrivateFieldSet(this,$t,null)}}},{key:"hcmFilter",get:function get(){return shadow(this,"hcmFilter",tools_classPrivateFieldGet(this,Lt)?tools_classPrivateFieldGet(this,At).addHCMFilter(tools_classPrivateFieldGet(this,Lt).foreground,tools_classPrivateFieldGet(this,Lt).background):"none")}},{key:"direction",get:function get(){return shadow(this,"direction",getComputedStyle(tools_classPrivateFieldGet(this,Jt)).direction)}},{key:"highlightColors",get:function get(){return shadow(this,"highlightColors",tools_classPrivateFieldGet(this,Et)?new Map(tools_classPrivateFieldGet(this,Et).split(",").map((function(t){return t.split("=").map((function(t){return t.trim()}))}))):null)}},{key:"setMainHighlightColorPicker",value:function setMainHighlightColorPicker(t){tools_classPrivateFieldSet(this,Gt,t)}},{key:"editAltText",value:function editAltText(t){var r;null===(r=tools_classPrivateFieldGet(this,gt))||void 0===r||r.editAltText(this,t)}},{key:"onPageChanging",value:function onPageChanging(t){var r=t.pageNumber;tools_classPrivateFieldSet(this,wt,r-1)}},{key:"focusMainContainer",value:function focusMainContainer(){tools_classPrivateFieldGet(this,Jt).focus()}},{key:"findParent",value:function findParent(t,r){var a,i=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(i.s();!(a=i.n()).done;){var o=a.value,l=o.div.getBoundingClientRect(),c=l.x,u=l.y,h=l.width,d=l.height;if(t>=c&&t<=c+h&&r>=u&&r<=u+d)return o}}catch(t){i.e(t)}finally{i.f()}return null}},{key:"disableUserSelect",value:function disableUserSelect(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];tools_classPrivateFieldGet(this,Qt).classList.toggle("noUserSelect",t)}},{key:"addShouldRescale",value:function addShouldRescale(t){tools_classPrivateFieldGet(this,Ft).add(t)}},{key:"removeShouldRescale",value:function removeShouldRescale(t){tools_classPrivateFieldGet(this,Ft).delete(t)}},{key:"onScaleChanging",value:function onScaleChanging(t){var r=t.scale;this.commitOrRemove();this.viewParameters.realScale=r*Ae.PDF_TO_CSS_UNITS;var a,i=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Ft));try{for(i.s();!(a=i.n()).done;){a.value.onScaleChanging()}}catch(t){i.e(t)}finally{i.f()}}},{key:"onRotationChanging",value:function onRotationChanging(t){var r=t.pagesRotation;this.commitOrRemove();this.viewParameters.rotation=r}},{key:"addToAnnotationStorage",value:function addToAnnotationStorage(t){t.isEmpty()||!tools_classPrivateFieldGet(this,mt)||tools_classPrivateFieldGet(this,mt).has(t.id)||tools_classPrivateFieldGet(this,mt).setValue(t.id,t)}},{key:"blur",value:function blur(){this.isShiftKeyDown=!1;if(this.hasSelection){var t,r=document.activeElement,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(a.s();!(t=a.n()).done;){var i=t.value;if(i.div.contains(r)){tools_classPrivateFieldSet(this,Mt,[i,r]);i._focusEventsAllowed=!1;break}}}catch(t){a.e(t)}finally{a.f()}}}},{key:"focus",value:function focus(){if(tools_classPrivateFieldGet(this,Mt)){var t=tools_slicedToArray(tools_classPrivateFieldGet(this,Mt),2),r=t[0],a=t[1];tools_classPrivateFieldSet(this,Mt,null);a.addEventListener("focusin",(function(){r._focusEventsAllowed=!0}),{once:!0});a.focus()}}},{key:"addEditListeners",value:function addEditListeners(){tools_classPrivateMethodGet(this,tr,_addKeyboardManager2).call(this);tools_classPrivateMethodGet(this,nr,_addCopyPasteListeners2).call(this)}},{key:"removeEditListeners",value:function removeEditListeners(){tools_classPrivateMethodGet(this,rr,_removeKeyboardManager2).call(this);tools_classPrivateMethodGet(this,ar,_removeCopyPasteListeners2).call(this)}},{key:"copy",value:function copy(t){var r;t.preventDefault();null===(r=tools_classPrivateFieldGet(this,vt))||void 0===r||r.commitOrRemove();if(this.hasSelection){var a,i=[],o=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(o.s();!(a=o.n()).done;){var l=a.value.serialize(!0);l&&i.push(l)}}catch(t){o.e(t)}finally{o.f()}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}}},{key:"cut",value:function cut(t){this.copy(t);this.delete()}},{key:"paste",value:function paste(t){t.preventDefault();var r,a=t.clipboardData,i=tools_createForOfIteratorHelper(a.items);try{for(i.s();!(r=i.n()).done;){var o,l=r.value,c=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,St));try{for(c.s();!(o=c.n()).done;){var u=o.value;if(u.isHandlingMimeForPasting(l.type)){u.paste(l,this.currentLayer);return}}}catch(t){c.e(t)}finally{c.f()}}}catch(t){i.e(t)}finally{i.f()}var h=a.getData("application/pdfjs");this.addSerializedEditor(h)}},{key:"addSerializedEditor",value:function addSerializedEditor(t){var r=this,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(t){try{"string"==typeof t&&(t=JSON.parse(t))}catch(t){warn('paste: "'.concat(t.message,'".'));return}if(Array.isArray(t)){var l=tools_classPrivateFieldGet(this,Ot);a&&l===g.NONE&&this.updateMode(g.FREETEXT);this.unselectAll();try{var c,u=[],h=tools_createForOfIteratorHelper(t);try{for(h.s();!(c=h.n()).done;){var d=c.value,p=void 0===d.pageIndex,v=(o||p?this.currentLayer:this.getLayer(d.pageIndex)).deserialize(d);if(!v)return;v.doNotMove=i;u.push(v)}}catch(t){h.e(t)}finally{h.f()}this.addCommands({cmd:function cmd(){for(var t=0,a=u;t<a.length;t++){var i=a[t];tools_classPrivateMethodGet(r,cr,_addEditorToLayer2).call(r,i)}tools_classPrivateMethodGet(r,dr,_selectEditors2).call(r,u)},undo:function undo(){for(var t=0,r=u;t<r.length;t++){r[t].remove()}},mustExec:!0})}catch(t){warn('paste: "'.concat(t.message,'".'))}a&&l!==tools_classPrivateFieldGet(this,Ot)&&this.updateMode(l)}}}},{key:"keydown",value:function keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0);this.isEditorHandlingKeyboard||AnnotationEditorUIManager._keyboardManager.exec(this,t)}},{key:"keyup",value:function keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1)}},{key:"onEditingAction",value:function onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}},{key:"setEditingState",value:function setEditingState(t){if(t){tools_classPrivateMethodGet(this,Zt,_addFocusManager2).call(this);tools_classPrivateMethodGet(this,tr,_addKeyboardManager2).call(this);tools_classPrivateMethodGet(this,nr,_addCopyPasteListeners2).call(this);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{isEditing:tools_classPrivateFieldGet(this,Ot)!==g.NONE,isEmpty:tools_classPrivateMethodGet(this,hr,_isEmpty2).call(this),hasSomethingToUndo:tools_classPrivateFieldGet(this,bt).hasSomethingToUndo(),hasSomethingToRedo:tools_classPrivateFieldGet(this,bt).hasSomethingToRedo(),hasSelectedEditor:!1})}else{tools_classPrivateMethodGet(this,er,_removeFocusManager2).call(this);tools_classPrivateMethodGet(this,rr,_removeKeyboardManager2).call(this);tools_classPrivateMethodGet(this,ar,_removeCopyPasteListeners2).call(this);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{isEditing:!1});this.disableUserSelect(!1)}}},{key:"registerEditorTypes",value:function registerEditorTypes(t){if(!tools_classPrivateFieldGet(this,St)){tools_classPrivateFieldSet(this,St,t);var r,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,St));try{for(a.s();!(r=a.n()).done;){var i=r.value;tools_classPrivateMethodGet(this,or,_dispatchUpdateUI2).call(this,i.defaultPropertiesToUpdate)}}catch(t){a.e(t)}finally{a.f()}}}},{key:"getId",value:function getId(){return tools_classPrivateFieldGet(this,It).getId()}},{key:"currentLayer",get:function get(){return tools_classPrivateFieldGet(this,yt).get(tools_classPrivateFieldGet(this,wt))}},{key:"getLayer",value:function getLayer(t){return tools_classPrivateFieldGet(this,yt).get(t)}},{key:"currentPageIndex",get:function get(){return tools_classPrivateFieldGet(this,wt)}},{key:"addLayer",value:function addLayer(t){tools_classPrivateFieldGet(this,yt).set(t.pageIndex,t);tools_classPrivateFieldGet(this,Tt)?t.enable():t.disable()}},{key:"removeLayer",value:function removeLayer(t){tools_classPrivateFieldGet(this,yt).delete(t.pageIndex)}},{key:"updateMode",value:function updateMode(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(tools_classPrivateFieldGet(this,Ot)!==t){tools_classPrivateFieldSet(this,Ot,t);if(t!==g.NONE){this.setEditingState(!0);tools_classPrivateMethodGet(this,sr,_enableAll2).call(this);this.unselectAll();var i,o=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(o.s();!(i=o.n()).done;){i.value.updateMode(t)}}catch(t){o.e(t)}finally{o.f()}if(r||!a){if(r){var l,c=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,_t).values());try{for(c.s();!(l=c.n()).done;){var u=l.value;if(u.annotationElementId===r){this.setSelected(u);u.enterInEditMode();break}}}catch(t){c.e(t)}finally{c.f()}}}else this.addNewEditorFromKeyboard()}else{this.setEditingState(!1);tools_classPrivateMethodGet(this,lr,_disableAll2).call(this)}}}},{key:"addNewEditorFromKeyboard",value:function addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}},{key:"updateToolbar",value:function updateToolbar(t){t!==tools_classPrivateFieldGet(this,Ot)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}},{key:"updateParams",value:function updateParams(t,r){var a;if(tools_classPrivateFieldGet(this,St)){switch(t){case m.CREATE:this.currentLayer.addNewEditor();return;case m.HIGHLIGHT_DEFAULT_COLOR:null===(a=tools_classPrivateFieldGet(this,Gt))||void 0===a||a.updateColor(r)}var i,o=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(o.s();!(i=o.n()).done;){i.value.updateParams(t,r)}}catch(t){o.e(t)}finally{o.f()}var l,c=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,St));try{for(c.s();!(l=c.n()).done;){l.value.updateDefaultParams(t,r)}}catch(t){c.e(t)}finally{c.f()}}}},{key:"enableWaiting",value:function enableWaiting(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(tools_classPrivateFieldGet(this,Ct)!==t){tools_classPrivateFieldSet(this,Ct,t);var r,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(a.s();!(r=a.n()).done;){var i=r.value;t?i.disableClick():i.enableClick();i.div.classList.toggle("waiting",t)}}catch(t){a.e(t)}finally{a.f()}}}},{key:"getEditors",value:function getEditors(t){var r,a=[],i=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,_t).values());try{for(i.s();!(r=i.n()).done;){var o=r.value;o.pageIndex===t&&a.push(o)}}catch(t){i.e(t)}finally{i.f()}return a}},{key:"getEditor",value:function getEditor(t){return tools_classPrivateFieldGet(this,_t).get(t)}},{key:"addEditor",value:function addEditor(t){tools_classPrivateFieldGet(this,_t).set(t.id,t)}},{key:"removeEditor",value:function removeEditor(t){var r=this;if(t.div.contains(document.activeElement)){tools_classPrivateFieldGet(this,xt)&&clearTimeout(tools_classPrivateFieldGet(this,xt));tools_classPrivateFieldSet(this,xt,setTimeout((function(){r.focusMainContainer();tools_classPrivateFieldSet(r,xt,null)}),0))}tools_classPrivateFieldGet(this,_t).delete(t.id);this.unselect(t);if(!t.annotationElementId||!tools_classPrivateFieldGet(this,Pt).has(t.annotationElementId)){var a;null===(a=tools_classPrivateFieldGet(this,mt))||void 0===a||a.remove(t.id)}}},{key:"addDeletedAnnotationElement",value:function addDeletedAnnotationElement(t){tools_classPrivateFieldGet(this,Pt).add(t.annotationElementId);t.deleted=!0}},{key:"isDeletedAnnotationElement",value:function isDeletedAnnotationElement(t){return tools_classPrivateFieldGet(this,Pt).has(t)}},{key:"removeDeletedAnnotationElement",value:function removeDeletedAnnotationElement(t){tools_classPrivateFieldGet(this,Pt).delete(t.annotationElementId);t.deleted=!1}},{key:"setActiveEditor",value:function setActiveEditor(t){if(tools_classPrivateFieldGet(this,vt)!==t){tools_classPrivateFieldSet(this,vt,t);t&&tools_classPrivateMethodGet(this,or,_dispatchUpdateUI2).call(this,t.propertiesToUpdate)}}},{key:"updateUI",value:function updateUI(t){tools_classPrivateFieldGet(this,ur)===t&&tools_classPrivateMethodGet(this,or,_dispatchUpdateUI2).call(this,t.propertiesToUpdate)}},{key:"toggleSelected",value:function toggleSelected(t){if(tools_classPrivateFieldGet(this,Rt).has(t)){tools_classPrivateFieldGet(this,Rt).delete(t);t.unselect();tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}else{tools_classPrivateFieldGet(this,Rt).add(t);t.select();tools_classPrivateMethodGet(this,or,_dispatchUpdateUI2).call(this,t.propertiesToUpdate);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}}},{key:"setSelected",value:function setSelected(t){var r,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(a.s();!(r=a.n()).done;){var i=r.value;i!==t&&i.unselect()}}catch(t){a.e(t)}finally{a.f()}tools_classPrivateFieldGet(this,Rt).clear();tools_classPrivateFieldGet(this,Rt).add(t);t.select();tools_classPrivateMethodGet(this,or,_dispatchUpdateUI2).call(this,t.propertiesToUpdate);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}},{key:"isSelected",value:function isSelected(t){return tools_classPrivateFieldGet(this,Rt).has(t)}},{key:"firstSelectedEditor",get:function get(){return tools_classPrivateFieldGet(this,Rt).values().next().value}},{key:"unselect",value:function unselect(t){t.unselect();tools_classPrivateFieldGet(this,Rt).delete(t);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}},{key:"hasSelection",get:function get(){return 0!==tools_classPrivateFieldGet(this,Rt).size}},{key:"isEnterHandled",get:function get(){return 1===tools_classPrivateFieldGet(this,Rt).size&&this.firstSelectedEditor.isEnterHandled}},{key:"undo",value:function undo(){tools_classPrivateFieldGet(this,bt).undo();tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:tools_classPrivateFieldGet(this,bt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:tools_classPrivateMethodGet(this,hr,_isEmpty2).call(this)})}},{key:"redo",value:function redo(){tools_classPrivateFieldGet(this,bt).redo();tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:tools_classPrivateFieldGet(this,bt).hasSomethingToRedo(),isEmpty:tools_classPrivateMethodGet(this,hr,_isEmpty2).call(this)})}},{key:"addCommands",value:function addCommands(t){tools_classPrivateFieldGet(this,bt).add(t);tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:tools_classPrivateMethodGet(this,hr,_isEmpty2).call(this)})}},{key:"delete",value:function _delete(){var t=this;this.commitOrRemove();if(this.hasSelection){var r=tools_toConsumableArray(tools_classPrivateFieldGet(this,Rt));this.addCommands({cmd:function cmd(){var t,a=tools_createForOfIteratorHelper(r);try{for(a.s();!(t=a.n()).done;){t.value.remove()}}catch(t){a.e(t)}finally{a.f()}},undo:function undo(){var a,i=tools_createForOfIteratorHelper(r);try{for(i.s();!(a=i.n()).done;){var o=a.value;tools_classPrivateMethodGet(t,cr,_addEditorToLayer2).call(t,o)}}catch(t){i.e(t)}finally{i.f()}},mustExec:!0})}}},{key:"commitOrRemove",value:function commitOrRemove(){var t;null===(t=tools_classPrivateFieldGet(this,vt))||void 0===t||t.commitOrRemove()}},{key:"hasSomethingToControl",value:function hasSomethingToControl(){return tools_classPrivateFieldGet(this,vt)||this.hasSelection}},{key:"selectAll",value:function selectAll(){var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(r.s();!(t=r.n()).done;){t.value.commit()}}catch(t){r.e(t)}finally{r.f()}tools_classPrivateMethodGet(this,dr,_selectEditors2).call(this,tools_classPrivateFieldGet(this,_t).values())}},{key:"unselectAll",value:function unselectAll(){if(tools_classPrivateFieldGet(this,vt)){tools_classPrivateFieldGet(this,vt).commitOrRemove();if(tools_classPrivateFieldGet(this,Ot)!==g.NONE)return}if(this.hasSelection){var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(r.s();!(t=r.n()).done;){t.value.unselect()}}catch(t){r.e(t)}finally{r.f()}tools_classPrivateFieldGet(this,Rt).clear();tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!1})}}},{key:"translateSelectedEditors",value:function translateSelectedEditors(t,r){var a=this;arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove();if(this.hasSelection){tools_classPrivateFieldGet(this,Xt)[0]+=t;tools_classPrivateFieldGet(this,Xt)[1]+=r;var i=tools_slicedToArray(tools_classPrivateFieldGet(this,Xt),2),o=i[0],l=i[1],c=tools_toConsumableArray(tools_classPrivateFieldGet(this,Rt));tools_classPrivateFieldGet(this,$t)&&clearTimeout(tools_classPrivateFieldGet(this,$t));tools_classPrivateFieldSet(this,$t,setTimeout((function(){tools_classPrivateFieldSet(a,$t,null);tools_classPrivateFieldGet(a,Xt)[0]=tools_classPrivateFieldGet(a,Xt)[1]=0;a.addCommands({cmd:function cmd(){var t,r=tools_createForOfIteratorHelper(c);try{for(r.s();!(t=r.n()).done;){var i=t.value;tools_classPrivateFieldGet(a,_t).has(i.id)&&i.translateInPage(o,l)}}catch(t){r.e(t)}finally{r.f()}},undo:function undo(){var t,r=tools_createForOfIteratorHelper(c);try{for(r.s();!(t=r.n()).done;){var i=t.value;tools_classPrivateFieldGet(a,_t).has(i.id)&&i.translateInPage(-o,-l)}}catch(t){r.e(t)}finally{r.f()}},mustExec:!1})}),1e3));var u,h=tools_createForOfIteratorHelper(c);try{for(h.s();!(u=h.n()).done;){u.value.translateInPage(t,r)}}catch(t){h.e(t)}finally{h.f()}}}},{key:"setUpDragSession",value:function setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0);tools_classPrivateFieldSet(this,kt,new Map);var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(r.s();!(t=r.n()).done;){var a=t.value;tools_classPrivateFieldGet(this,kt).set(a,{savedX:a.x,savedY:a.y,savedPageIndex:a.pageIndex,newX:0,newY:0,newPageIndex:-1})}}catch(t){r.e(t)}finally{r.f()}}}},{key:"endDragSession",value:function endDragSession(){var t=this;if(!tools_classPrivateFieldGet(this,kt))return!1;this.disableUserSelect(!1);var r=tools_classPrivateFieldGet(this,kt);tools_classPrivateFieldSet(this,kt,null);var a,i=!1,o=tools_createForOfIteratorHelper(r);try{for(o.s();!(a=o.n()).done;){var l=tools_slicedToArray(a.value,2),c=l[0],u=c.x,h=c.y,d=c.pageIndex,p=l[1];p.newX=u;p.newY=h;p.newPageIndex=d;i||(i=u!==p.savedX||h!==p.savedY||d!==p.savedPageIndex)}}catch(t){o.e(t)}finally{o.f()}if(!i)return!1;var v=function move(r,a,i,o){if(tools_classPrivateFieldGet(t,_t).has(r.id)){var l=tools_classPrivateFieldGet(t,yt).get(o);if(l)r._setParentAndPosition(l,a,i);else{r.pageIndex=o;r.x=a;r.y=i}}};this.addCommands({cmd:function cmd(){var t,a=tools_createForOfIteratorHelper(r);try{for(a.s();!(t=a.n()).done;){var i=tools_slicedToArray(t.value,2),o=i[0],l=i[1],c=l.newX,u=l.newY,h=l.newPageIndex;v(o,c,u,h)}}catch(t){a.e(t)}finally{a.f()}},undo:function undo(){var t,a=tools_createForOfIteratorHelper(r);try{for(a.s();!(t=a.n()).done;){var i=tools_slicedToArray(t.value,2),o=i[0],l=i[1],c=l.savedX,u=l.savedY,h=l.savedPageIndex;v(o,c,u,h)}}catch(t){a.e(t)}finally{a.f()}},mustExec:!0});return!0}},{key:"dragSelectedEditors",value:function dragSelectedEditors(t,r){if(tools_classPrivateFieldGet(this,kt)){var a,i=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,kt).keys());try{for(i.s();!(a=i.n()).done;){a.value.drag(t,r)}}catch(t){i.e(t)}finally{i.f()}}}},{key:"rebuild",value:function rebuild(t){if(null===t.parent){var r=this.getLayer(t.pageIndex);if(r){r.changeParent(t);r.addOrRebuild(t)}else{this.addEditor(t);this.addToAnnotationStorage(t);t.rebuild()}}else t.parent.addOrRebuild(t)}},{key:"isEditorHandlingKeyboard",get:function get(){var t;return(null===(t=this.getActive())||void 0===t?void 0:t.shouldGetKeyboardEvents())||1===tools_classPrivateFieldGet(this,Rt).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}},{key:"isActive",value:function isActive(t){return tools_classPrivateFieldGet(this,vt)===t}},{key:"getActive",value:function getActive(){return tools_classPrivateFieldGet(this,vt)}},{key:"getMode",value:function getMode(){return tools_classPrivateFieldGet(this,Ot)}},{key:"imageManager",get:function get(){return shadow(this,"imageManager",new it)}},{key:"removeEditors",value:function removeEditors(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0},r=!1;tools_classPrivateFieldGet(this,yt).forEach((function(t){return t.setCleaningUp(!0)}));tools_classPrivateFieldGet(this,_t).forEach((function(a){if(t(a.serialize())){a.remove();r=!0}}));tools_classPrivateFieldGet(this,yt).forEach((function(t){return t.setCleaningUp(!1)}));if(r){tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!1,hasSomethingToRedo:!1,isEmpty:tools_classPrivateMethodGet(this,hr,_isEmpty2).call(this)});tools_classPrivateFieldGet(this,bt).reset()}}}],[{key:"_keyboardManager",get:function get(){var t=AnnotationEditorUIManager.prototype,r=function arrowChecker(t){return tools_classPrivateFieldGet(t,Jt).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl()},a=function textInputChecker(t,r){var a=r.target;if(a instanceof HTMLInputElement){var i=a.type;return"text"!==i&&"number"!==i}return!0},i=this.TRANSLATE_SMALL,o=this.TRANSLATE_BIG;return shadow(this,"_keyboardManager",new dt([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:a}],[["ctrl+z","mac+meta+z"],t.undo,{checker:a}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:a}],[["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:a}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:function checker(t,r){var a=r.target;return!(a instanceof HTMLButtonElement)&&tools_classPrivateFieldGet(t,Jt).contains(a)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:function checker(t){return tools_classPrivateFieldGet(t,Jt).contains(document.activeElement)}}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-o,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[o,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-o],checker:r}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,o],checker:r}]]))}}]);return AnnotationEditorUIManager}();function _addFocusManager2(){window.addEventListener("focus",tools_classPrivateFieldGet(this,jt));window.addEventListener("blur",tools_classPrivateFieldGet(this,Dt))}function _removeFocusManager2(){window.removeEventListener("focus",tools_classPrivateFieldGet(this,jt));window.removeEventListener("blur",tools_classPrivateFieldGet(this,Dt))}function _addKeyboardManager2(){window.addEventListener("keydown",tools_classPrivateFieldGet(this,Bt));window.addEventListener("keyup",tools_classPrivateFieldGet(this,zt))}function _removeKeyboardManager2(){window.removeEventListener("keydown",tools_classPrivateFieldGet(this,Bt));window.removeEventListener("keyup",tools_classPrivateFieldGet(this,zt))}function _addCopyPasteListeners2(){document.addEventListener("copy",tools_classPrivateFieldGet(this,Nt));document.addEventListener("cut",tools_classPrivateFieldGet(this,Wt));document.addEventListener("paste",tools_classPrivateFieldGet(this,Ht))}function _removeCopyPasteListeners2(){document.removeEventListener("copy",tools_classPrivateFieldGet(this,Nt));document.removeEventListener("cut",tools_classPrivateFieldGet(this,Wt));document.removeEventListener("paste",tools_classPrivateFieldGet(this,Ht))}function _dispatchUpdateStates2(t){var r=this;Object.entries(t).some((function(t){var a=tools_slicedToArray(t,2),i=a[0],o=a[1];return tools_classPrivateFieldGet(r,Yt)[i]!==o}))&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(tools_classPrivateFieldGet(this,Yt),t)})}function _dispatchUpdateUI2(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}function _enableAll2(){if(!tools_classPrivateFieldGet(this,Tt)){tools_classPrivateFieldSet(this,Tt,!0);var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(r.s();!(t=r.n()).done;){t.value.enable()}}catch(t){r.e(t)}finally{r.f()}}}function _disableAll2(){this.unselectAll();if(tools_classPrivateFieldGet(this,Tt)){tools_classPrivateFieldSet(this,Tt,!1);var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,yt).values());try{for(r.s();!(t=r.n()).done;){t.value.disable()}}catch(t){r.e(t)}finally{r.f()}}}function _addEditorToLayer2(t){var r=tools_classPrivateFieldGet(this,yt).get(t.pageIndex);r?r.addOrRebuild(t):this.addEditor(t)}function _get_lastSelectedEditor(){var t,r=null,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(a.s();!(t=a.n()).done;)r=t.value}catch(t){a.e(t)}finally{a.f()}return r}function _isEmpty2(){if(0===tools_classPrivateFieldGet(this,_t).size)return!0;if(1===tools_classPrivateFieldGet(this,_t).size){var t,r=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,_t).values());try{for(r.s();!(t=r.n()).done;){return t.value.isEmpty()}}catch(t){r.e(t)}finally{r.f()}}return!1}function _selectEditors2(t){var r,a=tools_createForOfIteratorHelper(tools_classPrivateFieldGet(this,Rt));try{for(a.s();!(r=a.n()).done;){r.value.unselect()}}catch(t){a.e(t)}finally{a.f()}tools_classPrivateFieldGet(this,Rt).clear();var i,o=tools_createForOfIteratorHelper(t);try{for(o.s();!(i=o.n()).done;){var l=i.value;if(!l.isEmpty()){tools_classPrivateFieldGet(this,Rt).add(l);l.select()}}}catch(t){o.e(t)}finally{o.f()}tools_classPrivateMethodGet(this,ir,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}tools_defineProperty(fr,"TRANSLATE_SMALL",1);tools_defineProperty(fr,"TRANSLATE_BIG",10);function alt_text_typeof(t){return alt_text_typeof="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},alt_text_typeof(t)}function alt_text_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */alt_text_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==alt_text_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(alt_text_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function alt_text_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function alt_text_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){alt_text_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){alt_text_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function alt_text_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,alt_text_toPropertyKey(i.key),i)}}function alt_text_toPropertyKey(t){var r=function alt_text_toPrimitive(t,r){if("object"!=alt_text_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=alt_text_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==alt_text_typeof(r)?r:String(r)}function alt_text_classPrivateFieldInitSpec(t,r,a){alt_text_checkPrivateRedeclaration(t,r);r.set(t,a)}function alt_text_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function alt_text_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function alt_text_classPrivateFieldGet(t,r){return function alt_text_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,alt_text_classExtractFieldDescriptor(t,r,"get"))}function alt_text_classPrivateFieldSet(t,r,a){!function alt_text_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,alt_text_classExtractFieldDescriptor(t,r,"set"),a);return a}function alt_text_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var pr=new WeakMap,vr=new WeakMap,_r=new WeakMap,yr=new WeakMap,gr=new WeakMap,mr=new WeakMap,br=new WeakMap,wr=new WeakSet,Pr=function(){function AltText(t){!function alt_text_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,AltText);!function alt_text_classPrivateMethodInitSpec(t,r){alt_text_checkPrivateRedeclaration(t,r);r.add(t)}(this,wr);alt_text_classPrivateFieldInitSpec(this,pr,{writable:!0,value:""});alt_text_classPrivateFieldInitSpec(this,vr,{writable:!0,value:!1});alt_text_classPrivateFieldInitSpec(this,_r,{writable:!0,value:null});alt_text_classPrivateFieldInitSpec(this,yr,{writable:!0,value:null});alt_text_classPrivateFieldInitSpec(this,gr,{writable:!0,value:null});alt_text_classPrivateFieldInitSpec(this,mr,{writable:!0,value:!1});alt_text_classPrivateFieldInitSpec(this,br,{writable:!0,value:null});alt_text_classPrivateFieldSet(this,br,t)}!function alt_text_createClass(t,r,a){r&&alt_text_defineProperties(t.prototype,r);a&&alt_text_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(AltText,[{key:"render",value:(t=alt_text_asyncToGenerator(alt_text_regeneratorRuntime().mark((function _callee(){var t,r,a,i=this;return alt_text_regeneratorRuntime().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:(t=alt_text_classPrivateFieldSet(this,_r,document.createElement("button"))).className="altText";o.next=4;return AltText._l10nPromise.get("pdfjs-editor-alt-text-button-label");case 4:r=o.sent;t.textContent=r;t.setAttribute("aria-label",r);t.tabIndex="0";t.addEventListener("contextmenu",noContextMenu);t.addEventListener("pointerdown",(function(t){return t.stopPropagation()}));a=function onClick(t){t.preventDefault();alt_text_classPrivateFieldGet(i,br)._uiManager.editAltText(alt_text_classPrivateFieldGet(i,br))};t.addEventListener("click",a,{capture:!0});t.addEventListener("keydown",(function(r){if(r.target===t&&"Enter"===r.key){alt_text_classPrivateFieldSet(i,mr,!0);a(r)}}));o.next=15;return alt_text_classPrivateMethodGet(this,wr,_setState2).call(this);case 15:return o.abrupt("return",t);case 16:case"end":return o.stop()}}),_callee,this)}))),function render(){return t.apply(this,arguments)})},{key:"finish",value:function finish(){if(alt_text_classPrivateFieldGet(this,_r)){alt_text_classPrivateFieldGet(this,_r).focus({focusVisible:alt_text_classPrivateFieldGet(this,mr)});alt_text_classPrivateFieldSet(this,mr,!1)}}},{key:"data",get:function get(){return{altText:alt_text_classPrivateFieldGet(this,pr),decorative:alt_text_classPrivateFieldGet(this,vr)}},set:function set(t){var r=t.altText,a=t.decorative;if(alt_text_classPrivateFieldGet(this,pr)!==r||alt_text_classPrivateFieldGet(this,vr)!==a){alt_text_classPrivateFieldSet(this,pr,r);alt_text_classPrivateFieldSet(this,vr,a);alt_text_classPrivateMethodGet(this,wr,_setState2).call(this)}}},{key:"toggle",value:function toggle(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(alt_text_classPrivateFieldGet(this,_r)){if(!t&&alt_text_classPrivateFieldGet(this,gr)){clearTimeout(alt_text_classPrivateFieldGet(this,gr));alt_text_classPrivateFieldSet(this,gr,null)}alt_text_classPrivateFieldGet(this,_r).disabled=!t}}},{key:"destroy",value:function destroy(){var t;null===(t=alt_text_classPrivateFieldGet(this,_r))||void 0===t||t.remove();alt_text_classPrivateFieldSet(this,_r,null);alt_text_classPrivateFieldSet(this,yr,null)}}],[{key:"initialize",value:function initialize(t){AltText._l10nPromise||(AltText._l10nPromise=t)}}]);var t;return AltText}();pt=Pr;function _setState2(){return _setState3.apply(this,arguments)}function _setState3(){return(_setState3=alt_text_asyncToGenerator(alt_text_regeneratorRuntime().mark((function _callee2(){var t,r,a,i,o,l=this;return alt_text_regeneratorRuntime().wrap((function _callee2$(c){for(;;)switch(c.prev=c.next){case 0:if(t=alt_text_classPrivateFieldGet(this,_r)){c.next=3;break}return c.abrupt("return");case 3:if(alt_text_classPrivateFieldGet(this,pr)||alt_text_classPrivateFieldGet(this,vr)){c.next=7;break}t.classList.remove("done");null===(r=alt_text_classPrivateFieldGet(this,yr))||void 0===r||r.remove();return c.abrupt("return");case 7:t.classList.add("done");pt._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then((function(r){t.setAttribute("aria-label",r)}));if(!(a=alt_text_classPrivateFieldGet(this,yr))){alt_text_classPrivateFieldSet(this,yr,a=document.createElement("span"));a.className="tooltip";a.setAttribute("role","tooltip");i=a.id="alt-text-tooltip-".concat(alt_text_classPrivateFieldGet(this,br).id);t.setAttribute("aria-describedby",i);100;t.addEventListener("mouseenter",(function(){alt_text_classPrivateFieldSet(l,gr,setTimeout((function(){alt_text_classPrivateFieldSet(l,gr,null);alt_text_classPrivateFieldGet(l,yr).classList.add("show");alt_text_classPrivateFieldGet(l,br)._uiManager._eventBus.dispatch("reporttelemetry",{source:l,details:{type:"editing",subtype:alt_text_classPrivateFieldGet(l,br).editorType,data:{action:"alt_text_tooltip"}}})}),100))}));t.addEventListener("mouseleave",(function(){var t;if(alt_text_classPrivateFieldGet(l,gr)){clearTimeout(alt_text_classPrivateFieldGet(l,gr));alt_text_classPrivateFieldSet(l,gr,null)}null===(t=alt_text_classPrivateFieldGet(l,yr))||void 0===t||t.classList.remove("show")}))}if(!alt_text_classPrivateFieldGet(this,vr)){c.next=17;break}c.next=14;return pt._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip");case 14:c.t0=c.sent;c.next=18;break;case 17:c.t0=alt_text_classPrivateFieldGet(this,pr);case 18:a.innerText=c.t0;a.parentNode||t.append(a);null==(o=alt_text_classPrivateFieldGet(this,br).getImageForAltText())||o.setAttribute("aria-describedby",a.id);case 22:case"end":return c.stop()}}),_callee2,this)})))).apply(this,arguments)}!function alt_text_defineProperty(t,r,a){(r=alt_text_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}(Pr,"_l10nPromise",null);function toolbar_typeof(t){return toolbar_typeof="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},toolbar_typeof(t)}function toolbar_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,toolbar_toPropertyKey(i.key),i)}}function toolbar_toPropertyKey(t){var r=function toolbar_toPrimitive(t,r){if("object"!=toolbar_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=toolbar_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==toolbar_typeof(r)?r:String(r)}function toolbar_classPrivateMethodInitSpec(t,r){toolbar_checkPrivateRedeclaration(t,r);r.add(t)}function toolbar_classPrivateFieldInitSpec(t,r,a){toolbar_checkPrivateRedeclaration(t,r);r.set(t,a)}function toolbar_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function toolbar_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function toolbar_classPrivateFieldGet(t,r){return function toolbar_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,toolbar_classExtractFieldDescriptor(t,r,"get"))}function toolbar_classStaticPrivateMethodGet(t,r,a){!function toolbar_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function toolbar_classPrivateFieldSet(t,r,a){!function toolbar_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,toolbar_classExtractFieldDescriptor(t,r,"set"),a);return a}function toolbar_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var kr,Sr=new WeakMap,Fr=new WeakMap,Ar=new WeakMap,xr=new WeakMap,Er=new WeakSet,Ir=new WeakSet,Tr=new WeakSet,Cr=new WeakSet,Mr=new WeakMap,Gr=function(){function EditorToolbar(t){!function toolbar_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,EditorToolbar);toolbar_classPrivateFieldInitSpec(this,Mr,{get:_get_divider,set:void 0});toolbar_classPrivateMethodInitSpec(this,Cr);toolbar_classPrivateMethodInitSpec(this,Tr);toolbar_classPrivateMethodInitSpec(this,Ir);toolbar_classPrivateMethodInitSpec(this,Er);toolbar_classPrivateFieldInitSpec(this,Sr,{writable:!0,value:null});toolbar_classPrivateFieldInitSpec(this,Fr,{writable:!0,value:null});toolbar_classPrivateFieldInitSpec(this,Ar,{writable:!0,value:void 0});toolbar_classPrivateFieldInitSpec(this,xr,{writable:!0,value:null});toolbar_classPrivateFieldSet(this,Ar,t)}!function toolbar_createClass(t,r,a){r&&toolbar_defineProperties(t.prototype,r);a&&toolbar_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(EditorToolbar,[{key:"render",value:function render(){var t=toolbar_classPrivateFieldSet(this,Sr,document.createElement("div"));t.className="editToolbar";t.addEventListener("contextmenu",noContextMenu);t.addEventListener("pointerdown",toolbar_classStaticPrivateMethodGet(EditorToolbar,EditorToolbar,_pointerDown));var r=toolbar_classPrivateFieldSet(this,xr,document.createElement("div"));r.className="buttons";t.append(r);var a=toolbar_classPrivateFieldGet(this,Ar).toolbarPosition;if(a){var i=t.style,o="ltr"===toolbar_classPrivateFieldGet(this,Ar)._uiManager.direction?1-a[0]:a[0];i.insetInlineEnd="".concat(100*o,"%");i.top="calc(".concat(100*a[1],"% + var(--editor-toolbar-vert-offset))")}toolbar_classPrivateMethodGet(this,Cr,_addDeleteButton2).call(this);return t}},{key:"hide",value:function hide(){var t;toolbar_classPrivateFieldGet(this,Sr).classList.add("hidden");null===(t=toolbar_classPrivateFieldGet(this,Fr))||void 0===t||t.hideDropdown()}},{key:"show",value:function show(){toolbar_classPrivateFieldGet(this,Sr).classList.remove("hidden")}},{key:"addAltTextButton",value:function addAltTextButton(t){toolbar_classPrivateMethodGet(this,Tr,_addListenersToElement2).call(this,t);toolbar_classPrivateFieldGet(this,xr).prepend(t,toolbar_classPrivateFieldGet(this,Mr))}},{key:"addColorPicker",value:function addColorPicker(t){toolbar_classPrivateFieldSet(this,Fr,t);var r=t.renderButton();toolbar_classPrivateMethodGet(this,Tr,_addListenersToElement2).call(this,r);toolbar_classPrivateFieldGet(this,xr).prepend(r,toolbar_classPrivateFieldGet(this,Mr))}},{key:"remove",value:function remove(){var t;toolbar_classPrivateFieldGet(this,Sr).remove();null===(t=toolbar_classPrivateFieldGet(this,Fr))||void 0===t||t.destroy();toolbar_classPrivateFieldSet(this,Fr,null)}}]);return EditorToolbar}();function _pointerDown(t){t.stopPropagation()}function _focusIn2(t){toolbar_classPrivateFieldGet(this,Ar)._focusEventsAllowed=!1;t.preventDefault();t.stopPropagation()}function _focusOut2(t){toolbar_classPrivateFieldGet(this,Ar)._focusEventsAllowed=!0;t.preventDefault();t.stopPropagation()}function _addListenersToElement2(t){t.addEventListener("focusin",toolbar_classPrivateMethodGet(this,Er,_focusIn2).bind(this),{capture:!0});t.addEventListener("focusout",toolbar_classPrivateMethodGet(this,Ir,_focusOut2).bind(this),{capture:!0});t.addEventListener("contextmenu",noContextMenu)}function _addDeleteButton2(){var t=this,r=document.createElement("button");r.className="delete";r.tabIndex=0;r.setAttribute("data-l10n-id","pdfjs-editor-remove-".concat(toolbar_classPrivateFieldGet(this,Ar).editorType,"-button"));toolbar_classPrivateMethodGet(this,Tr,_addListenersToElement2).call(this,r);r.addEventListener("click",(function(r){toolbar_classPrivateFieldGet(t,Ar)._uiManager.delete()}));toolbar_classPrivateFieldGet(this,xr).append(r)}function _get_divider(){var t=document.createElement("div");t.className="divider";return t}function editor_typeof(t){return editor_typeof="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},editor_typeof(t)}function editor_toConsumableArray(t){return function editor_arrayWithoutHoles(t){if(Array.isArray(t))return editor_arrayLikeToArray(t)}(t)||function editor_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||editor_unsupportedIterableToArray(t)||function editor_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function editor_callSuper(t,r,a){return r=editor_getPrototypeOf(r),function editor_possibleConstructorReturn(t,r){if(r&&("object"===editor_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function editor_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,editor_isNativeReflectConstruct()?Reflect.construct(r,a||[],editor_getPrototypeOf(t).constructor):r.apply(t,a))}function editor_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(editor_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function editor_getPrototypeOf(t){editor_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return editor_getPrototypeOf(t)}function editor_setPrototypeOf(t,r){editor_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return editor_setPrototypeOf(t,r)}function editor_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=editor_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function editor_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */editor_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==editor_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(editor_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function editor_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function editor_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){editor_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){editor_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function editor_slicedToArray(t,r){return function editor_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function editor_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||editor_unsupportedIterableToArray(t,r)||function editor_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function editor_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return editor_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?editor_arrayLikeToArray(t,r):void 0}}function editor_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function editor_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function editor_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,editor_toPropertyKey(i.key),i)}}function editor_createClass(t,r,a){r&&editor_defineProperties(t.prototype,r);a&&editor_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function editor_classPrivateMethodInitSpec(t,r){editor_checkPrivateRedeclaration(t,r);r.add(t)}function editor_defineProperty(t,r,a){(r=editor_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function editor_toPropertyKey(t){var r=function editor_toPrimitive(t,r){if("object"!=editor_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=editor_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==editor_typeof(r)?r:String(r)}function editor_classPrivateFieldInitSpec(t,r,a){editor_checkPrivateRedeclaration(t,r);r.set(t,a)}function editor_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function editor_classStaticPrivateMethodGet(t,r,a){!function editor_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function editor_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function editor_classPrivateFieldSet(t,r,a){!function editor_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,editor_classExtractFieldDescriptor(t,r,"set"),a);return a}function editor_classPrivateFieldGet(t,r){return function editor_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,editor_classExtractFieldDescriptor(t,r,"get"))}function editor_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var Or=new WeakMap,Rr=new WeakMap,Lr=new WeakMap,Dr=new WeakMap,jr=new WeakMap,Nr=new WeakMap,Wr=new WeakMap,Hr=new WeakMap,Br=new WeakMap,zr=new WeakMap,Ur=new WeakMap,qr=new WeakMap,Vr=new WeakMap,Kr=new WeakMap,Yr=new WeakMap,Xr=new WeakMap,$r=new WeakMap,Jr=new WeakMap,Qr=new WeakSet,Zr=new WeakSet,en=new WeakSet,tn=new WeakSet,rn=new WeakSet,nn=new WeakSet,an=new WeakSet,sn=new WeakSet,ln=new WeakSet,cn=new WeakSet,un=new WeakSet,hn=new WeakSet,dn=new WeakSet,fn=function(){function AnnotationEditor(t){editor_classCallCheck(this,AnnotationEditor);editor_classPrivateMethodInitSpec(this,dn);editor_classPrivateMethodInitSpec(this,hn);editor_classPrivateMethodInitSpec(this,un);editor_classPrivateMethodInitSpec(this,cn);editor_classPrivateMethodInitSpec(this,ln);editor_classPrivateMethodInitSpec(this,sn);editor_classPrivateMethodInitSpec(this,an);editor_classPrivateMethodInitSpec(this,nn);editor_classPrivateMethodInitSpec(this,rn);editor_classPrivateMethodInitSpec(this,tn);editor_classPrivateMethodInitSpec(this,en);editor_classPrivateMethodInitSpec(this,Zr);editor_classPrivateMethodInitSpec(this,Qr);editor_classPrivateFieldInitSpec(this,Or,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,Rr,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,Lr,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,Dr,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,jr,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,Nr,{writable:!0,value:this.focusin.bind(this)});editor_classPrivateFieldInitSpec(this,Wr,{writable:!0,value:this.focusout.bind(this)});editor_classPrivateFieldInitSpec(this,Hr,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,Br,{writable:!0,value:""});editor_classPrivateFieldInitSpec(this,zr,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,Ur,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,qr,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,Vr,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,Kr,{writable:!0,value:null});editor_classPrivateFieldInitSpec(this,Yr,{writable:!0,value:0});editor_classPrivateFieldInitSpec(this,Xr,{writable:!0,value:0});editor_defineProperty(this,"_initialOptions",Object.create(null));editor_defineProperty(this,"_uiManager",null);editor_defineProperty(this,"_focusEventsAllowed",!0);editor_defineProperty(this,"_l10nPromise",null);editor_classPrivateFieldInitSpec(this,$r,{writable:!0,value:!1});editor_classPrivateFieldInitSpec(this,Jr,{writable:!0,value:AnnotationEditor._zIndex++});editor_defineProperty(this,"doNotMove",!1);this.constructor===AnnotationEditor&&unreachable("Cannot initialize AnnotationEditor.");this.parent=t.parent;this.id=t.id;this.width=this.height=null;this.pageIndex=t.parent.pageIndex;this.name=t.name;this.div=null;this._uiManager=t.uiManager;this.annotationElementId=null;this._willKeepAspectRatio=!1;this._initialOptions.isCentered=t.isCentered;this._structTreeParentId=null;var r=this.parent.viewport,a=r.rotation,i=r.rawDims,o=i.pageWidth,l=i.pageHeight,c=i.pageX,u=i.pageY;this.rotation=a;this.pageRotation=(360+a-this._uiManager.viewParameters.rotation)%360;this.pageDimensions=[o,l];this.pageTranslation=[c,u];var h=editor_slicedToArray(this.parentDimensions,2),d=h[0],p=h[1];this.x=t.x/d;this.y=t.y/p;this.isAttachedToDOM=!1;this.deleted=!1}editor_createClass(AnnotationEditor,[{key:"editorType",get:function get(){return Object.getPrototypeOf(this).constructor._type}},{key:"propertiesToUpdate",get:function get(){return[]}},{key:"_isDraggable",get:function get(){return editor_classPrivateFieldGet(this,$r)},set:function set(t){var r;editor_classPrivateFieldSet(this,$r,t);null===(r=this.div)||void 0===r||r.classList.toggle("draggable",t)}},{key:"isEnterHandled",get:function get(){return!0}},{key:"center",value:function center(){var t=editor_slicedToArray(this.pageDimensions,2),r=t[0],a=t[1];switch(this.parentRotation){case 90:this.x-=this.height*a/(2*r);this.y+=this.width*r/(2*a);break;case 180:this.x+=this.width/2;this.y+=this.height/2;break;case 270:this.x+=this.height*a/(2*r);this.y-=this.width*r/(2*a);break;default:this.x-=this.width/2;this.y-=this.height/2}this.fixAndSetPosition()}},{key:"addCommands",value:function addCommands(t){this._uiManager.addCommands(t)}},{key:"currentLayer",get:function get(){return this._uiManager.currentLayer}},{key:"setInBackground",value:function setInBackground(){this.div.style.zIndex=0}},{key:"setInForeground",value:function setInForeground(){this.div.style.zIndex=editor_classPrivateFieldGet(this,Jr)}},{key:"setParent",value:function setParent(t){if(null!==t){this.pageIndex=t.pageIndex;this.pageDimensions=t.pageDimensions}else editor_classPrivateMethodGet(this,dn,_stopResizing2).call(this);this.parent=t}},{key:"focusin",value:function focusin(t){this._focusEventsAllowed&&(editor_classPrivateFieldGet(this,zr)?editor_classPrivateFieldSet(this,zr,!1):this.parent.setSelected(this))}},{key:"focusout",value:function focusout(t){var r;if(this._focusEventsAllowed&&this.isAttachedToDOM){var a=t.relatedTarget;if(null==a||!a.closest("#".concat(this.id))){t.preventDefault();null!==(r=this.parent)&&void 0!==r&&r.isMultipleSelection||this.commitOrRemove()}}}},{key:"commitOrRemove",value:function commitOrRemove(){this.isEmpty()?this.remove():this.commit()}},{key:"commit",value:function commit(){this.addToAnnotationStorage()}},{key:"addToAnnotationStorage",value:function addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}},{key:"setAt",value:function setAt(t,r,a,i){var o=editor_slicedToArray(this.parentDimensions,2),l=o[0],c=o[1],u=editor_slicedToArray(this.screenToPageTranslation(a,i),2);a=u[0];i=u[1];if(this.doNotMove){a=0;i=0}this.x=(t+a)/l;this.y=(r+i)/c;this.fixAndSetPosition()}},{key:"translate",value:function translate(t,r){editor_classPrivateMethodGet(this,Qr,_translate2).call(this,this.parentDimensions,t,r)}},{key:"translateInPage",value:function translateInPage(t,r){editor_classPrivateMethodGet(this,Qr,_translate2).call(this,this.pageDimensions,t,r);this.div.scrollIntoView({block:"nearest"})}},{key:"drag",value:function drag(t,r){var a=editor_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1];this.x+=t/i;this.y+=r/o;if(this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){var l=this.div.getBoundingClientRect(),c=l.x,u=l.y;if(this.parent.findNewParent(this,c,u)){this.x-=Math.floor(this.x);this.y-=Math.floor(this.y)}}var h=this.x,d=this.y,p=editor_slicedToArray(this.getBaseTranslation(),2);h+=p[0];d+=p[1];this.div.style.left="".concat((100*h).toFixed(2),"%");this.div.style.top="".concat((100*d).toFixed(2),"%");this.div.scrollIntoView({block:"nearest"})}},{key:"getBaseTranslation",value:function getBaseTranslation(){var t=editor_slicedToArray(this.parentDimensions,2),r=t[0],a=t[1],i=AnnotationEditor._borderLineWidth,o=i/r,l=i/a;switch(this.rotation){case 90:return[-o,l];case 180:return[o,l];case 270:return[o,-l];default:return[-o,-l]}}},{key:"fixAndSetPosition",value:function fixAndSetPosition(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rotation,r=editor_slicedToArray(this.pageDimensions,2),a=r[0],i=r[1],o=this.x,l=this.y,c=this.width,u=this.height;c*=a;u*=i;o*=a;l*=i;switch(t){case 0:o=Math.max(0,Math.min(a-c,o));l=Math.max(0,Math.min(i-u,l));break;case 90:o=Math.max(0,Math.min(a-u,o));l=Math.min(i,Math.max(c,l));break;case 180:o=Math.min(a,Math.max(c,o));l=Math.min(i,Math.max(u,l));break;case 270:o=Math.min(a,Math.max(u,o));l=Math.max(0,Math.min(i-c,l))}this.x=o/=a;this.y=l/=i;var h=editor_slicedToArray(this.getBaseTranslation(),2);o+=h[0];l+=h[1];var d=this.div.style;d.left="".concat((100*o).toFixed(2),"%");d.top="".concat((100*l).toFixed(2),"%");this.moveInDOM()}},{key:"screenToPageTranslation",value:function screenToPageTranslation(t,r){return editor_classStaticPrivateMethodGet(AnnotationEditor,AnnotationEditor,_rotatePoint).call(AnnotationEditor,t,r,this.parentRotation)}},{key:"pageTranslationToScreen",value:function pageTranslationToScreen(t,r){return editor_classStaticPrivateMethodGet(AnnotationEditor,AnnotationEditor,_rotatePoint).call(AnnotationEditor,t,r,360-this.parentRotation)}},{key:"parentScale",get:function get(){return this._uiManager.viewParameters.realScale}},{key:"parentRotation",get:function get(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}},{key:"parentDimensions",get:function get(){var t=this.parentScale,r=editor_slicedToArray(this.pageDimensions,2),a=r[0]*t,i=r[1]*t;return he.isCSSRoundSupported?[Math.round(a),Math.round(i)]:[a,i]}},{key:"setDims",value:function setDims(t,r){var a=editor_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1];this.div.style.width="".concat((100*t/i).toFixed(2),"%");editor_classPrivateFieldGet(this,Lr)||(this.div.style.height="".concat((100*r/o).toFixed(2),"%"))}},{key:"fixDims",value:function fixDims(){var t=this.div.style,r=t.height,a=t.width,i=a.endsWith("%"),o=!editor_classPrivateFieldGet(this,Lr)&&r.endsWith("%");if(!i||!o){var l=editor_slicedToArray(this.parentDimensions,2),c=l[0],u=l[1];i||(t.width="".concat((100*parseFloat(a)/c).toFixed(2),"%"));editor_classPrivateFieldGet(this,Lr)||o||(t.height="".concat((100*parseFloat(r)/u).toFixed(2),"%"))}}},{key:"getInitialTranslation",value:function getInitialTranslation(){return[0,0]}},{key:"altTextFinish",value:function altTextFinish(){var t;null===(t=editor_classPrivateFieldGet(this,Rr))||void 0===t||t.finish()}},{key:"addEditToolbar",value:(r=editor_asyncToGenerator(editor_regeneratorRuntime().mark((function _callee(){return editor_regeneratorRuntime().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(!editor_classPrivateFieldGet(this,Hr)&&!editor_classPrivateFieldGet(this,qr)){t.next=2;break}return t.abrupt("return",editor_classPrivateFieldGet(this,Hr));case 2:editor_classPrivateFieldSet(this,Hr,new Gr(this));this.div.append(editor_classPrivateFieldGet(this,Hr).render());if(!editor_classPrivateFieldGet(this,Rr)){t.next=10;break}t.t0=editor_classPrivateFieldGet(this,Hr);t.next=8;return editor_classPrivateFieldGet(this,Rr).render();case 8:t.t1=t.sent;t.t0.addAltTextButton.call(t.t0,t.t1);case 10:return t.abrupt("return",editor_classPrivateFieldGet(this,Hr));case 11:case"end":return t.stop()}}),_callee,this)}))),function addEditToolbar(){return r.apply(this,arguments)})},{key:"removeEditToolbar",value:function removeEditToolbar(){var t;if(editor_classPrivateFieldGet(this,Hr)){editor_classPrivateFieldGet(this,Hr).remove();editor_classPrivateFieldSet(this,Hr,null);null===(t=editor_classPrivateFieldGet(this,Rr))||void 0===t||t.destroy()}}},{key:"getClientDimensions",value:function getClientDimensions(){return this.div.getBoundingClientRect()}},{key:"addAltTextButton",value:(t=editor_asyncToGenerator(editor_regeneratorRuntime().mark((function _callee2(){return editor_regeneratorRuntime().wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:if(!editor_classPrivateFieldGet(this,Rr)){t.next=2;break}return t.abrupt("return");case 2:Pr.initialize(AnnotationEditor._l10nPromise);editor_classPrivateFieldSet(this,Rr,new Pr(this));t.next=6;return this.addEditToolbar();case 6:case"end":return t.stop()}}),_callee2,this)}))),function addAltTextButton(){return t.apply(this,arguments)})},{key:"altTextData",get:function get(){var t;return null===(t=editor_classPrivateFieldGet(this,Rr))||void 0===t?void 0:t.data},set:function set(t){editor_classPrivateFieldGet(this,Rr)&&(editor_classPrivateFieldGet(this,Rr).data=t)}},{key:"render",value:function render(){this.div=document.createElement("div");this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360);this.div.className=this.name;this.div.setAttribute("id",this.id);this.div.setAttribute("tabIndex",0);this.setInForeground();this.div.addEventListener("focusin",editor_classPrivateFieldGet(this,Nr));this.div.addEventListener("focusout",editor_classPrivateFieldGet(this,Wr));var t=editor_slicedToArray(this.parentDimensions,2),r=t[0],a=t[1];if(this.parentRotation%180!=0){this.div.style.maxWidth="".concat((100*a/r).toFixed(2),"%");this.div.style.maxHeight="".concat((100*r/a).toFixed(2),"%")}var i=editor_slicedToArray(this.getInitialTranslation(),2),o=i[0],l=i[1];this.translate(o,l);bindEvents(this,this.div,["pointerdown"]);return this.div}},{key:"pointerdown",value:function pointerdown(t){var r=he.platform.isMac;if(0!==t.button||t.ctrlKey&&r)t.preventDefault();else{editor_classPrivateFieldSet(this,zr,!0);this._isDraggable?editor_classPrivateMethodGet(this,sn,_setUpDragSession2).call(this,t):editor_classPrivateMethodGet(this,an,_selectOnPointerEvent2).call(this,t)}}},{key:"moveInDOM",value:function moveInDOM(){var t=this;editor_classPrivateFieldGet(this,Kr)&&clearTimeout(editor_classPrivateFieldGet(this,Kr));editor_classPrivateFieldSet(this,Kr,setTimeout((function(){var r;editor_classPrivateFieldSet(t,Kr,null);null===(r=t.parent)||void 0===r||r.moveEditorInDOM(t)}),0))}},{key:"_setParentAndPosition",value:function _setParentAndPosition(t,r,a){t.changeParent(this);this.x=r;this.y=a;this.fixAndSetPosition()}},{key:"getRect",value:function getRect(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rotation,i=this.parentScale,o=editor_slicedToArray(this.pageDimensions,2),l=o[0],c=o[1],u=editor_slicedToArray(this.pageTranslation,2),h=u[0],d=u[1],p=t/i,v=r/i,_=this.x*l,y=this.y*c,g=this.width*l,m=this.height*c;switch(a){case 0:return[_+p+h,c-y-v-m+d,_+p+g+h,c-y-v+d];case 90:return[_+v+h,c-y+p+d,_+v+m+h,c-y+p+g+d];case 180:return[_-p-g+h,c-y+v+d,_-p+h,c-y+v+m+d];case 270:return[_-v-m+h,c-y-p-g+d,_-v+h,c-y-p+d];default:throw new Error("Invalid rotation")}}},{key:"getRectInCurrentCoords",value:function getRectInCurrentCoords(t,r){var a=editor_slicedToArray(t,4),i=a[0],o=a[1],l=a[2],c=a[3],u=l-i,h=c-o;switch(this.rotation){case 0:return[i,r-c,u,h];case 90:return[i,r-o,h,u];case 180:return[l,r-o,u,h];case 270:return[l,r-c,h,u];default:throw new Error("Invalid rotation")}}},{key:"onceAdded",value:function onceAdded(){}},{key:"isEmpty",value:function isEmpty(){return!1}},{key:"enableEditMode",value:function enableEditMode(){editor_classPrivateFieldSet(this,qr,!0)}},{key:"disableEditMode",value:function disableEditMode(){editor_classPrivateFieldSet(this,qr,!1)}},{key:"isInEditMode",value:function isInEditMode(){return editor_classPrivateFieldGet(this,qr)}},{key:"shouldGetKeyboardEvents",value:function shouldGetKeyboardEvents(){return editor_classPrivateFieldGet(this,Vr)}},{key:"needsToBeRebuilt",value:function needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}},{key:"rebuild",value:function rebuild(){var t,r;null===(t=this.div)||void 0===t||t.addEventListener("focusin",editor_classPrivateFieldGet(this,Nr));null===(r=this.div)||void 0===r||r.addEventListener("focusout",editor_classPrivateFieldGet(this,Wr))}},{key:"rotate",value:function rotate(t){}},{key:"serialize",value:function serialize(){unreachable("An editor must be serializable")}},{key:"remove",value:function remove(){this.div.removeEventListener("focusin",editor_classPrivateFieldGet(this,Nr));this.div.removeEventListener("focusout",editor_classPrivateFieldGet(this,Wr));this.isEmpty()||this.commit();this.parent?this.parent.remove(this):this._uiManager.removeEditor(this);if(editor_classPrivateFieldGet(this,Kr)){clearTimeout(editor_classPrivateFieldGet(this,Kr));editor_classPrivateFieldSet(this,Kr,null)}editor_classPrivateMethodGet(this,dn,_stopResizing2).call(this);this.removeEditToolbar()}},{key:"isResizable",get:function get(){return!1}},{key:"makeResizable",value:function makeResizable(){if(this.isResizable){editor_classPrivateMethodGet(this,en,_createResizers2).call(this);editor_classPrivateFieldGet(this,Dr).classList.remove("hidden");bindEvents(this,this.div,["keydown"])}}},{key:"toolbarPosition",get:function get(){return null}},{key:"keydown",value:function keydown(t){var r=this;if(this.isResizable&&t.target===this.div&&"Enter"===t.key){this._uiManager.setSelected(this);editor_classPrivateFieldSet(this,jr,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});var a=editor_classPrivateFieldGet(this,Dr).children;if(!editor_classPrivateFieldGet(this,Or)){editor_classPrivateFieldSet(this,Or,Array.from(a));var i,o=editor_classPrivateMethodGet(this,ln,_resizerKeydown2).bind(this),l=editor_classPrivateMethodGet(this,cn,_resizerBlur2).bind(this),c=editor_createForOfIteratorHelper(editor_classPrivateFieldGet(this,Or));try{var u=function _loop(){var t=i.value,a=t.getAttribute("data-resizer-name");t.setAttribute("role","spinbutton");t.addEventListener("keydown",o);t.addEventListener("blur",l);t.addEventListener("focus",editor_classPrivateMethodGet(r,un,_resizerFocus2).bind(r,a));AnnotationEditor._l10nPromise.get("pdfjs-editor-resizer-label-".concat(a)).then((function(r){return t.setAttribute("aria-label",r)}))};for(c.s();!(i=c.n()).done;)u()}catch(t){c.e(t)}finally{c.f()}}var h,d=editor_classPrivateFieldGet(this,Or)[0],p=0,v=editor_createForOfIteratorHelper(a);try{for(v.s();!(h=v.n()).done;){if(h.value===d)break;p++}}catch(t){v.e(t)}finally{v.f()}var _=(360-this.rotation+this.parentRotation)%360/90*(editor_classPrivateFieldGet(this,Or).length/4);if(_!==p){if(_<p)for(var y=0;y<p-_;y++)editor_classPrivateFieldGet(this,Dr).append(editor_classPrivateFieldGet(this,Dr).firstChild);else if(_>p)for(var g=0;g<_-p;g++)editor_classPrivateFieldGet(this,Dr).firstChild.before(editor_classPrivateFieldGet(this,Dr).lastChild);var m,b=0,w=editor_createForOfIteratorHelper(a);try{var P=function _loop2(){var t=m.value,a=editor_classPrivateFieldGet(r,Or)[b++].getAttribute("data-resizer-name");AnnotationEditor._l10nPromise.get("pdfjs-editor-resizer-label-".concat(a)).then((function(r){return t.setAttribute("aria-label",r)}))};for(w.s();!(m=w.n()).done;)P()}catch(t){w.e(t)}finally{w.f()}}editor_classPrivateMethodGet(this,hn,_setResizerTabIndex2).call(this,0);editor_classPrivateFieldSet(this,Vr,!0);editor_classPrivateFieldGet(this,Dr).firstChild.focus({focusVisible:!0});t.preventDefault();t.stopImmediatePropagation()}}},{key:"_resizeWithKeyboard",value:function _resizeWithKeyboard(t,r){editor_classPrivateFieldGet(this,Vr)&&editor_classPrivateMethodGet(this,nn,_resizerPointermove2).call(this,editor_classPrivateFieldGet(this,Br),{movementX:t,movementY:r})}},{key:"_stopResizingWithKeyboard",value:function _stopResizingWithKeyboard(){editor_classPrivateMethodGet(this,dn,_stopResizing2).call(this);this.div.focus()}},{key:"select",value:function select(){var t,r,a=this;this.makeResizable();null===(t=this.div)||void 0===t||t.classList.add("selectedEditor");editor_classPrivateFieldGet(this,Hr)?null===(r=editor_classPrivateFieldGet(this,Hr))||void 0===r||r.show():this.addEditToolbar().then((function(){var t;if(null!==(t=a.div)&&void 0!==t&&t.classList.contains("selectedEditor")){var r;null===(r=editor_classPrivateFieldGet(a,Hr))||void 0===r||r.show()}}))}},{key:"unselect",value:function unselect(){var t,r,a,i;null===(t=editor_classPrivateFieldGet(this,Dr))||void 0===t||t.classList.add("hidden");null===(r=this.div)||void 0===r||r.classList.remove("selectedEditor");null!==(a=this.div)&&void 0!==a&&a.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus();null===(i=editor_classPrivateFieldGet(this,Hr))||void 0===i||i.hide()}},{key:"updateParams",value:function updateParams(t,r){}},{key:"disableEditing",value:function disableEditing(){}},{key:"enableEditing",value:function enableEditing(){}},{key:"enterInEditMode",value:function enterInEditMode(){}},{key:"getImageForAltText",value:function getImageForAltText(){return null}},{key:"contentDiv",get:function get(){return this.div}},{key:"isEditing",get:function get(){return editor_classPrivateFieldGet(this,Ur)},set:function set(t){editor_classPrivateFieldSet(this,Ur,t);if(this.parent)if(t){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}},{key:"setAspectRatio",value:function setAspectRatio(t,r){editor_classPrivateFieldSet(this,Lr,!0);var a=t/r,i=this.div.style;i.aspectRatio=a;i.height="auto"}}],[{key:"_resizerKeyboardManager",get:function get(){var t=AnnotationEditor.prototype._resizeWithKeyboard,r=fr.TRANSLATE_SMALL,a=fr.TRANSLATE_BIG;return shadow(this,"_resizerKeyboardManager",new dt([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-r,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-a,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[r,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[a,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-r]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-a]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,r]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,a]}],[["Escape","mac+Escape"],AnnotationEditor.prototype._stopResizingWithKeyboard]]))}},{key:"_defaultLineColor",get:function get(){return shadow(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}},{key:"deleteAnnotationElement",value:function deleteAnnotationElement(t){var r=new pn({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});r.annotationElementId=t.annotationElementId;r.deleted=!0;r._uiManager.addToAnnotationStorage(r)}},{key:"initialize",value:function initialize(t,r,a){AnnotationEditor._l10nPromise||(AnnotationEditor._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((function(r){return[r,t.get(r.replaceAll(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())})))]}))));if(null!=a&&a.strings){var i,o=editor_createForOfIteratorHelper(a.strings);try{for(o.s();!(i=o.n()).done;){var l=i.value;AnnotationEditor._l10nPromise.set(l,t.get(l))}}catch(t){o.e(t)}finally{o.f()}}if(-1===AnnotationEditor._borderLineWidth){var c=getComputedStyle(document.documentElement);AnnotationEditor._borderLineWidth=parseFloat(c.getPropertyValue("--outline-width"))||0}}},{key:"updateDefaultParams",value:function updateDefaultParams(t,r){}},{key:"defaultPropertiesToUpdate",get:function get(){return[]}},{key:"isHandlingMimeForPasting",value:function isHandlingMimeForPasting(t){return!1}},{key:"paste",value:function paste(t,r){unreachable("Not implemented")}},{key:"deserialize",value:function deserialize(t,r,a){var i=new this.prototype.constructor({parent:r,id:r.getNextId(),uiManager:a});i.rotation=t.rotation;var o=editor_slicedToArray(i.pageDimensions,2),l=o[0],c=o[1],u=editor_slicedToArray(i.getRectInCurrentCoords(t.rect,c),4),h=u[0],d=u[1],p=u[2],v=u[3];i.x=h/l;i.y=d/c;i.width=p/l;i.height=v/c;return i}},{key:"MIN_SIZE",get:function get(){return 16}},{key:"canCreateNewEmptyEditor",value:function canCreateNewEmptyEditor(){return!0}}]);var t,r;return AnnotationEditor}();kr=fn;function _translate2(t,r,a){var i=editor_slicedToArray(t,2),o=i[0],l=i[1],c=editor_slicedToArray(this.screenToPageTranslation(r,a),2);r=c[0];a=c[1];this.x+=r/o;this.y+=a/l;this.fixAndSetPosition()}function _rotatePoint(t,r,a){switch(a){case 90:return[r,-t];case 180:return[-t,-r];case 270:return[-r,t];default:return[t,r]}}function _getRotationMatrix2(t){switch(t){case 90:var r=editor_slicedToArray(this.pageDimensions,2),a=r[0],i=r[1];return[0,-a/i,i/a,0];case 180:return[-1,0,0,-1];case 270:var o=editor_slicedToArray(this.pageDimensions,2),l=o[0],c=o[1];return[0,l/c,-c/l,0];default:return[1,0,0,1]}}function _createResizers2(){if(!editor_classPrivateFieldGet(this,Dr)){editor_classPrivateFieldSet(this,Dr,document.createElement("div"));editor_classPrivateFieldGet(this,Dr).classList.add("resizers");for(var t=0,r=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"];t<r.length;t++){var a=r[t],i=document.createElement("div");editor_classPrivateFieldGet(this,Dr).append(i);i.classList.add("resizer",a);i.setAttribute("data-resizer-name",a);i.addEventListener("pointerdown",editor_classPrivateMethodGet(this,tn,_resizerPointerdown2).bind(this,a));i.addEventListener("contextmenu",noContextMenu);i.tabIndex=-1}this.div.prepend(editor_classPrivateFieldGet(this,Dr))}}function _resizerPointerdown2(t,r){var a,i=this;r.preventDefault();var o=he.platform.isMac;if(!(0!==r.button||r.ctrlKey&&o)){null===(a=editor_classPrivateFieldGet(this,Rr))||void 0===a||a.toggle(!1);var l=editor_classPrivateMethodGet(this,nn,_resizerPointermove2).bind(this,t),c=this._isDraggable;this._isDraggable=!1;var u={passive:!0,capture:!0};this.parent.togglePointerEvents(!1);window.addEventListener("pointermove",l,u);var h=this.x,d=this.y,p=this.width,v=this.height,_=this.parent.div.style.cursor,y=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(r.target).cursor;var g=function pointerUpCallback(){var t;i.parent.togglePointerEvents(!0);null===(t=editor_classPrivateFieldGet(i,Rr))||void 0===t||t.toggle(!0);i._isDraggable=c;window.removeEventListener("pointerup",pointerUpCallback);window.removeEventListener("blur",pointerUpCallback);window.removeEventListener("pointermove",l,u);i.parent.div.style.cursor=_;i.div.style.cursor=y;editor_classPrivateMethodGet(i,rn,_addResizeToUndoStack2).call(i,h,d,p,v)};window.addEventListener("pointerup",g);window.addEventListener("blur",g)}}function _addResizeToUndoStack2(t,r,a,i){var o=this,l=this.x,c=this.y,u=this.width,h=this.height;l===t&&c===r&&u===a&&h===i||this.addCommands({cmd:function cmd(){o.width=u;o.height=h;o.x=l;o.y=c;var t=editor_slicedToArray(o.parentDimensions,2),r=t[0],a=t[1];o.setDims(r*u,a*h);o.fixAndSetPosition()},undo:function undo(){o.width=a;o.height=i;o.x=t;o.y=r;var l=editor_slicedToArray(o.parentDimensions,2),c=l[0],u=l[1];o.setDims(c*a,u*i);o.fixAndSetPosition()},mustExec:!0})}function _resizerPointermove2(t,r){var a,i,o=editor_slicedToArray(this.parentDimensions,2),l=o[0],c=o[1],u=this.x,h=this.y,d=this.width,p=this.height,v=kr.MIN_SIZE/l,_=kr.MIN_SIZE/c,y=function round(t){return Math.round(1e4*t)/1e4},g=editor_classPrivateMethodGet(this,Zr,_getRotationMatrix2).call(this,this.rotation),m=function transf(t,r){return[g[0]*t+g[2]*r,g[1]*t+g[3]*r]},b=editor_classPrivateMethodGet(this,Zr,_getRotationMatrix2).call(this,360-this.rotation),w=!1,P=!1;switch(t){case"topLeft":w=!0;a=function getPoint(t,r){return[0,0]};i=function getOpposite(t,r){return[t,r]};break;case"topMiddle":a=function getPoint(t,r){return[t/2,0]};i=function getOpposite(t,r){return[t/2,r]};break;case"topRight":w=!0;a=function getPoint(t,r){return[t,0]};i=function getOpposite(t,r){return[0,r]};break;case"middleRight":P=!0;a=function getPoint(t,r){return[t,r/2]};i=function getOpposite(t,r){return[0,r/2]};break;case"bottomRight":w=!0;a=function getPoint(t,r){return[t,r]};i=function getOpposite(t,r){return[0,0]};break;case"bottomMiddle":a=function getPoint(t,r){return[t/2,r]};i=function getOpposite(t,r){return[t/2,0]};break;case"bottomLeft":w=!0;a=function getPoint(t,r){return[0,r]};i=function getOpposite(t,r){return[t,0]};break;case"middleLeft":P=!0;a=function getPoint(t,r){return[0,r/2]};i=function getOpposite(t,r){return[t,r/2]}}var k=a(d,p),S=i(d,p),A=m.apply(void 0,editor_toConsumableArray(S)),x=y(u+A[0]),E=y(h+A[1]),I=1,T=1,C=editor_slicedToArray(this.screenToPageTranslation(r.movementX,r.movementY),2),M=C[0],G=C[1],O=editor_slicedToArray(function invTransf(t,r){return[b[0]*t+b[2]*r,b[1]*t+b[3]*r]}(M/l,G/c),2);M=O[0];G=O[1];if(w){var R=Math.hypot(d,p);I=T=Math.max(Math.min(Math.hypot(S[0]-k[0]-M,S[1]-k[1]-G)/R,1/d,1/p),v/d,_/p)}else P?I=Math.max(v,Math.min(1,Math.abs(S[0]-k[0]-M)))/d:T=Math.max(_,Math.min(1,Math.abs(S[1]-k[1]-G)))/p;var L=y(d*I),D=y(p*T),j=x-(A=m.apply(void 0,editor_toConsumableArray(i(L,D))))[0],N=E-A[1];this.width=L;this.height=D;this.x=j;this.y=N;this.setDims(l*L,c*D);this.fixAndSetPosition()}function _selectOnPointerEvent2(t){var r=he.platform.isMac;t.ctrlKey&&!r||t.shiftKey||t.metaKey&&r?this.parent.toggleSelected(this):this.parent.setSelected(this)}function _setUpDragSession2(t){var r,a,i=this,o=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();if(o){this.div.classList.add("moving");r={passive:!0,capture:!0};editor_classPrivateFieldSet(this,Yr,t.clientX);editor_classPrivateFieldSet(this,Xr,t.clientY);a=function pointerMoveCallback(t){var r=t.clientX,a=t.clientY,o=editor_slicedToArray(i.screenToPageTranslation(r-editor_classPrivateFieldGet(i,Yr),a-editor_classPrivateFieldGet(i,Xr)),2),l=o[0],c=o[1];editor_classPrivateFieldSet(i,Yr,r);editor_classPrivateFieldSet(i,Xr,a);i._uiManager.dragSelectedEditors(l,c)};window.addEventListener("pointermove",a,r)}var l=function pointerUpCallback(){window.removeEventListener("pointerup",pointerUpCallback);window.removeEventListener("blur",pointerUpCallback);if(o){i.div.classList.remove("moving");window.removeEventListener("pointermove",a,r)}editor_classPrivateFieldSet(i,zr,!1);i._uiManager.endDragSession()||editor_classPrivateMethodGet(i,an,_selectOnPointerEvent2).call(i,t)};window.addEventListener("pointerup",l);window.addEventListener("blur",l)}function _resizerKeydown2(t){kr._resizerKeyboardManager.exec(this,t)}function _resizerBlur2(t){var r;editor_classPrivateFieldGet(this,Vr)&&(null===(r=t.relatedTarget)||void 0===r?void 0:r.parentNode)!==editor_classPrivateFieldGet(this,Dr)&&editor_classPrivateMethodGet(this,dn,_stopResizing2).call(this)}function _resizerFocus2(t){editor_classPrivateFieldSet(this,Br,editor_classPrivateFieldGet(this,Vr)?t:"")}function _setResizerTabIndex2(t){if(editor_classPrivateFieldGet(this,Or)){var r,a=editor_createForOfIteratorHelper(editor_classPrivateFieldGet(this,Or));try{for(a.s();!(r=a.n()).done;){r.value.tabIndex=t}}catch(t){a.e(t)}finally{a.f()}}}function _stopResizing2(){editor_classPrivateFieldSet(this,Vr,!1);editor_classPrivateMethodGet(this,hn,_setResizerTabIndex2).call(this,-1);if(editor_classPrivateFieldGet(this,jr)){var t=editor_classPrivateFieldGet(this,jr),r=t.savedX,a=t.savedY,i=t.savedWidth,o=t.savedHeight;editor_classPrivateMethodGet(this,rn,_addResizeToUndoStack2).call(this,r,a,i,o);editor_classPrivateFieldSet(this,jr,null)}}editor_defineProperty(fn,"_borderLineWidth",-1);editor_defineProperty(fn,"_colorManager",new ft);editor_defineProperty(fn,"_zIndex",1);var pn=function(t){!function editor_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&editor_setPrototypeOf(t,r)}(FakeEditor,t);function FakeEditor(t){var r;editor_classCallCheck(this,FakeEditor);(r=editor_callSuper(this,FakeEditor,[t])).annotationElementId=t.annotationElementId;r.deleted=!0;return r}editor_createClass(FakeEditor,[{key:"serialize",value:function serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}]);return FakeEditor}(fn);function murmurhash3_typeof(t){return murmurhash3_typeof="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},murmurhash3_typeof(t)}function murmurhash3_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,murmurhash3_toPropertyKey(i.key),i)}}function murmurhash3_toPropertyKey(t){var r=function murmurhash3_toPrimitive(t,r){if("object"!=murmurhash3_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=murmurhash3_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==murmurhash3_typeof(r)?r:String(r)}var vn=3285377520,_n=4294901760,yn=65535,gn=function(){function MurmurHash3_64(t){!function murmurhash3_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,MurmurHash3_64);this.h1=t?4294967295&t:vn;this.h2=t?4294967295&t:vn}!function murmurhash3_createClass(t,r,a){r&&murmurhash3_defineProperties(t.prototype,r);a&&murmurhash3_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(MurmurHash3_64,[{key:"update",value:function update(t){var r,a;if("string"==typeof t){r=new Uint8Array(2*t.length);a=0;for(var i=0,o=t.length;i<o;i++){var l=t.charCodeAt(i);if(l<=255)r[a++]=l;else{r[a++]=l>>>8;r[a++]=255&l}}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");a=(r=t.slice()).byteLength}for(var c=a>>2,u=a-4*c,h=new Uint32Array(r.buffer,0,c),d=0,p=0,v=this.h1,_=this.h2,y=3432918353,g=461845907,m=11601,b=13715,w=0;w<c;w++)1&w?v=5*(v=(v^=d=(d=(d=(d=h[w])*y&_n|d*m&yn)<<15|d>>>17)*g&_n|d*b&yn)<<13|v>>>19)+3864292196:_=5*(_=(_^=p=(p=(p=(p=h[w])*y&_n|p*m&yn)<<15|p>>>17)*g&_n|p*b&yn)<<13|_>>>19)+3864292196;d=0;switch(u){case 3:d^=r[4*c+2]<<16;case 2:d^=r[4*c+1]<<8;case 1:d=(d=(d=(d^=r[4*c])*y&_n|d*m&yn)<<15|d>>>17)*g&_n|d*b&yn;1&c?v^=d:_^=d}this.h1=v;this.h2=_}},{key:"hexdigest",value:function hexdigest(){var t=this.h1,r=this.h2;t=3981806797*(t^=r>>>1)&_n|36045*t&yn;t=444984403*(t^=(r=4283543511*r&_n|(2950163797*(r<<16|t>>>16)&_n)>>>16)>>>1)&_n|60499*t&yn;return((t^=(r=3301882366*r&_n|(3120437893*(r<<16|t>>>16)&_n)>>>16)>>>1)>>>0).toString(16).padStart(8,"0")+(r>>>0).toString(16).padStart(8,"0")}}]);return MurmurHash3_64}();function annotation_storage_typeof(t){return annotation_storage_typeof="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},annotation_storage_typeof(t)}function annotation_storage_callSuper(t,r,a){return r=annotation_storage_getPrototypeOf(r),function annotation_storage_possibleConstructorReturn(t,r){if(r&&("object"===annotation_storage_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return annotation_storage_assertThisInitialized(t)}(t,annotation_storage_isNativeReflectConstruct()?Reflect.construct(r,a||[],annotation_storage_getPrototypeOf(t).constructor):r.apply(t,a))}function annotation_storage_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(annotation_storage_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function annotation_storage_getPrototypeOf(t){annotation_storage_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return annotation_storage_getPrototypeOf(t)}function annotation_storage_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function annotation_storage_setPrototypeOf(t,r){annotation_storage_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return annotation_storage_setPrototypeOf(t,r)}function annotation_storage_slicedToArray(t,r){return function annotation_storage_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function annotation_storage_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||annotation_storage_unsupportedIterableToArray(t,r)||function annotation_storage_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function annotation_storage_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=annotation_storage_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function annotation_storage_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return annotation_storage_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?annotation_storage_arrayLikeToArray(t,r):void 0}}function annotation_storage_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function annotation_storage_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function annotation_storage_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,annotation_storage_toPropertyKey(i.key),i)}}function annotation_storage_createClass(t,r,a){r&&annotation_storage_defineProperties(t.prototype,r);a&&annotation_storage_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function annotation_storage_toPropertyKey(t){var r=function annotation_storage_toPrimitive(t,r){if("object"!=annotation_storage_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=annotation_storage_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==annotation_storage_typeof(r)?r:String(r)}function annotation_storage_classPrivateFieldInitSpec(t,r,a){annotation_storage_checkPrivateRedeclaration(t,r);r.set(t,a)}function annotation_storage_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function annotation_storage_classPrivateFieldSet(t,r,a){!function annotation_storage_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,annotation_storage_classExtractFieldDescriptor(t,r,"set"),a);return a}function annotation_storage_classPrivateFieldGet(t,r){return function annotation_storage_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,annotation_storage_classExtractFieldDescriptor(t,r,"get"))}function annotation_storage_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var mn=Object.freeze({map:null,hash:"",transfer:void 0}),bn=new WeakMap,wn=new WeakMap,Pn=new WeakSet,kn=function(){function AnnotationStorage(){annotation_storage_classCallCheck(this,AnnotationStorage);!function annotation_storage_classPrivateMethodInitSpec(t,r){annotation_storage_checkPrivateRedeclaration(t,r);r.add(t)}(this,Pn);annotation_storage_classPrivateFieldInitSpec(this,bn,{writable:!0,value:!1});annotation_storage_classPrivateFieldInitSpec(this,wn,{writable:!0,value:new Map});this.onSetModified=null;this.onResetModified=null;this.onAnnotationEditor=null}annotation_storage_createClass(AnnotationStorage,[{key:"getValue",value:function getValue(t,r){var a=annotation_storage_classPrivateFieldGet(this,wn).get(t);return void 0===a?r:Object.assign(r,a)}},{key:"getRawValue",value:function getRawValue(t){return annotation_storage_classPrivateFieldGet(this,wn).get(t)}},{key:"remove",value:function remove(t){annotation_storage_classPrivateFieldGet(this,wn).delete(t);0===annotation_storage_classPrivateFieldGet(this,wn).size&&this.resetModified();if("function"==typeof this.onAnnotationEditor){var r,a=annotation_storage_createForOfIteratorHelper(annotation_storage_classPrivateFieldGet(this,wn).values());try{for(a.s();!(r=a.n()).done;){if(r.value instanceof fn)return}}catch(t){a.e(t)}finally{a.f()}this.onAnnotationEditor(null)}}},{key:"setValue",value:function setValue(t,r){var a=annotation_storage_classPrivateFieldGet(this,wn).get(t),i=!1;if(void 0!==a)for(var o=0,l=Object.entries(r);o<l.length;o++){var c=annotation_storage_slicedToArray(l[o],2),u=c[0],h=c[1];if(a[u]!==h){i=!0;a[u]=h}}else{i=!0;annotation_storage_classPrivateFieldGet(this,wn).set(t,r)}i&&function annotation_storage_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}(this,Pn,_setModified2).call(this);r instanceof fn&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(r.constructor._type)}},{key:"has",value:function has(t){return annotation_storage_classPrivateFieldGet(this,wn).has(t)}},{key:"getAll",value:function getAll(){return annotation_storage_classPrivateFieldGet(this,wn).size>0?objectFromMap(annotation_storage_classPrivateFieldGet(this,wn)):null}},{key:"setAll",value:function setAll(t){for(var r=0,a=Object.entries(t);r<a.length;r++){var i=annotation_storage_slicedToArray(a[r],2),o=i[0],l=i[1];this.setValue(o,l)}}},{key:"size",get:function get(){return annotation_storage_classPrivateFieldGet(this,wn).size}},{key:"resetModified",value:function resetModified(){if(annotation_storage_classPrivateFieldGet(this,bn)){annotation_storage_classPrivateFieldSet(this,bn,!1);"function"==typeof this.onResetModified&&this.onResetModified()}}},{key:"print",get:function get(){return new Fn(this)}},{key:"serializable",get:function get(){if(0===annotation_storage_classPrivateFieldGet(this,wn).size)return mn;var t,r=new Map,a=new gn,i=[],o=Object.create(null),l=!1,c=annotation_storage_createForOfIteratorHelper(annotation_storage_classPrivateFieldGet(this,wn));try{for(c.s();!(t=c.n()).done;){var u=annotation_storage_slicedToArray(t.value,2),h=u[0],d=u[1],p=d instanceof fn?d.serialize(!1,o):d;if(p){r.set(h,p);a.update("".concat(h,":").concat(JSON.stringify(p)));l||(l=!!p.bitmap)}}}catch(t){c.e(t)}finally{c.f()}if(l){var v,_=annotation_storage_createForOfIteratorHelper(r.values());try{for(_.s();!(v=_.n()).done;){var y=v.value;y.bitmap&&i.push(y.bitmap)}}catch(t){_.e(t)}finally{_.f()}}return r.size>0?{map:r,hash:a.hexdigest(),transfer:i}:mn}}]);return AnnotationStorage}();function _setModified2(){if(!annotation_storage_classPrivateFieldGet(this,bn)){annotation_storage_classPrivateFieldSet(this,bn,!0);"function"==typeof this.onSetModified&&this.onSetModified()}}var Sn=new WeakMap,Fn=function(t){!function annotation_storage_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&annotation_storage_setPrototypeOf(t,r)}(PrintAnnotationStorage,t);function PrintAnnotationStorage(t){var r;annotation_storage_classCallCheck(this,PrintAnnotationStorage);annotation_storage_classPrivateFieldInitSpec(annotation_storage_assertThisInitialized(r=annotation_storage_callSuper(this,PrintAnnotationStorage)),Sn,{writable:!0,value:void 0});var a=t.serializable,i=a.map,o=a.hash,l=a.transfer,c=structuredClone(i,l?{transfer:l}:null);annotation_storage_classPrivateFieldSet(annotation_storage_assertThisInitialized(r),Sn,{map:c,hash:o,transfer:l});return r}annotation_storage_createClass(PrintAnnotationStorage,[{key:"print",get:function get(){unreachable("Should not call PrintAnnotationStorage.print")}},{key:"serializable",get:function get(){return annotation_storage_classPrivateFieldGet(this,Sn)}}]);return PrintAnnotationStorage}(kn);function font_loader_typeof(t){return font_loader_typeof="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},font_loader_typeof(t)}function font_loader_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */font_loader_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==font_loader_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(font_loader_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function font_loader_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function font_loader_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){font_loader_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){font_loader_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function font_loader_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function font_loader_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return font_loader_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return font_loader_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function font_loader_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function font_loader_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function font_loader_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,font_loader_toPropertyKey(i.key),i)}}function font_loader_createClass(t,r,a){r&&font_loader_defineProperties(t.prototype,r);a&&font_loader_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function font_loader_toPropertyKey(t){var r=function font_loader_toPrimitive(t,r){if("object"!=font_loader_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=font_loader_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==font_loader_typeof(r)?r:String(r)}function font_loader_classPrivateFieldInitSpec(t,r,a){!function font_loader_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,r);r.set(t,a)}function font_loader_classPrivateFieldGet(t,r){var a=function font_loader_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}(t,r,"get");return function font_loader_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,a)}var An,xn=new WeakMap,En=function(){function FontLoader(t){var r=t.ownerDocument,a=void 0===r?globalThis.document:r;t.styleElement;font_loader_classCallCheck(this,FontLoader);font_loader_classPrivateFieldInitSpec(this,xn,{writable:!0,value:new Set});this._document=a;this.nativeFontFaces=new Set;this.styleElement=null;this.loadingRequests=[];this.loadTestFontId=0}font_loader_createClass(FontLoader,[{key:"addNativeFontFace",value:function addNativeFontFace(t){this.nativeFontFaces.add(t);this._document.fonts.add(t)}},{key:"removeNativeFontFace",value:function removeNativeFontFace(t){this.nativeFontFaces.delete(t);this._document.fonts.delete(t)}},{key:"insertRule",value:function insertRule(t){if(!this.styleElement){this.styleElement=this._document.createElement("style");this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement)}var r=this.styleElement.sheet;r.insertRule(t,r.cssRules.length)}},{key:"clear",value:function clear(){var t,r=font_loader_createForOfIteratorHelper(this.nativeFontFaces);try{for(r.s();!(t=r.n()).done;){var a=t.value;this._document.fonts.delete(a)}}catch(t){r.e(t)}finally{r.f()}this.nativeFontFaces.clear();font_loader_classPrivateFieldGet(this,xn).clear();if(this.styleElement){this.styleElement.remove();this.styleElement=null}}},{key:"loadSystemFont",value:(a=font_loader_asyncToGenerator(font_loader_regeneratorRuntime().mark((function _callee(t){var r,a,i,o,l,c;return font_loader_regeneratorRuntime().wrap((function _callee$(u){for(;;)switch(u.prev=u.next){case 0:r=t.systemFontInfo,a=t._inspectFont;if(r&&!font_loader_classPrivateFieldGet(this,xn).has(r.loadedName)){u.next=3;break}return u.abrupt("return");case 3:assert(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set.");if(!this.isFontLoadingAPISupported){u.next=20;break}i=r.loadedName,o=r.src,l=r.style;c=new FontFace(i,o,l);this.addNativeFontFace(c);u.prev=8;u.next=11;return c.load();case 11:font_loader_classPrivateFieldGet(this,xn).add(i);null==a||a(r);u.next=19;break;case 15:u.prev=15;u.t0=u.catch(8);warn("Cannot load system font: ".concat(r.baseFontName,", installing it could help to improve PDF rendering."));this.removeNativeFontFace(c);case 19:return u.abrupt("return");case 20:unreachable("Not implemented: loadSystemFont without the Font Loading API.");case 21:case"end":return u.stop()}}),_callee,this,[[8,15]])}))),function loadSystemFont(t){return a.apply(this,arguments)})},{key:"bind",value:(t=font_loader_asyncToGenerator(font_loader_regeneratorRuntime().mark((function _callee2(t){var r,a,i=this;return font_loader_regeneratorRuntime().wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:if(!(t.attached||t.missingFile&&!t.systemFontInfo)){o.next=2;break}return o.abrupt("return");case 2:t.attached=!0;if(!t.systemFontInfo){o.next=7;break}o.next=6;return this.loadSystemFont(t);case 6:case 21:return o.abrupt("return");case 7:if(!this.isFontLoadingAPISupported){o.next=22;break}if(!(r=t.createNativeFontFace())){o.next=21;break}this.addNativeFontFace(r);o.prev=11;o.next=14;return r.loaded;case 14:o.next=21;break;case 16:o.prev=16;o.t0=o.catch(11);warn("Failed to load font '".concat(r.family,"': '").concat(o.t0,"'."));t.disableFontFace=!0;throw o.t0;case 22:if(!(a=t.createFontFaceRule())){o.next=29;break}this.insertRule(a);if(!this.isSyncFontLoadingSupported){o.next=27;break}return o.abrupt("return");case 27:o.next=29;return new Promise((function(r){var a=i._queueLoadingCallback(r);i._prepareFontLoadEvent(t,a)}));case 29:case"end":return o.stop()}}),_callee2,this,[[11,16]])}))),function bind(r){return t.apply(this,arguments)})},{key:"isFontLoadingAPISupported",get:function get(){var t;return shadow(this,"isFontLoadingAPISupported",!(null===(t=this._document)||void 0===t||!t.fonts))}},{key:"isSyncFontLoadingSupported",get:function get(){var t,a=!1;(r||"undefined"!=typeof navigator&&"string"==typeof(null===(t=navigator)||void 0===t?void 0:t.userAgent)&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(a=!0);return shadow(this,"isSyncFontLoadingSupported",a)}},{key:"_queueLoadingCallback",value:function _queueLoadingCallback(t){var r=this.loadingRequests,a={done:!1,complete:function completeRequest(){assert(!a.done,"completeRequest() cannot be called twice.");a.done=!0;for(;r.length>0&&r[0].done;){var t=r.shift();setTimeout(t.callback,0)}},callback:t};r.push(a);return a}},{key:"_loadTestFont",get:function get(){return shadow(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}},{key:"_prepareFontLoadEvent",value:function _prepareFontLoadEvent(t,r){function int32(t,r){return t.charCodeAt(r)<<24|t.charCodeAt(r+1)<<16|t.charCodeAt(r+2)<<8|255&t.charCodeAt(r+3)}function spliceString(t,r,a,i){return t.substring(0,r)+i+t.substring(r+a)}var a,i,o=this._document.createElement("canvas");o.width=1;o.height=1;var l=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,c=o.getContext("2d",l),u=0;var h="lt".concat(Date.now()).concat(this.loadTestFontId++),d=this._loadTestFont,p=1482184792,v=int32(d=spliceString(d,976,h.length,h),16);for(a=0,i=h.length-3;a<i;a+=4)v=v-p+int32(h,a)|0;a<h.length&&(v=v-p+int32(h+"XXX",a)|0);d=spliceString(d,16,4,function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}(v));var _="url(data:font/opentype;base64,".concat(btoa(d),");"),y='@font-face {font-family:"'.concat(h,'";src:').concat(_,"}");this.insertRule(y);var g=this._document.createElement("div");g.style.visibility="hidden";g.style.width=g.style.height="10px";g.style.position="absolute";g.style.top=g.style.left="0px";for(var m=0,b=[t.loadedName,h];m<b.length;m++){var w=b[m],P=this._document.createElement("span");P.textContent="Hi";P.style.fontFamily=w;g.append(P)}this._document.body.append(g);!function isFontReady(t,r){if(++u>30){warn("Load test font never loaded.");r()}else{c.font="30px "+t;c.fillText(".",0,20);c.getImageData(0,0,1,1).data[3]>0?r():setTimeout(isFontReady.bind(null,t,r))}}(h,(function(){g.remove();r.complete()}))}}]);var t,a;return FontLoader}(),In=function(){function FontFaceObject(t,r){var a=r.isEvalSupported,i=void 0===a||a,o=r.disableFontFace,l=void 0!==o&&o,c=r.ignoreErrors,u=void 0!==c&&c,h=r.inspectFont,d=void 0===h?null:h;font_loader_classCallCheck(this,FontFaceObject);this.compiledGlyphs=Object.create(null);for(var p in t)this[p]=t[p];this.isEvalSupported=!1!==i;this.disableFontFace=!0===l;this.ignoreErrors=!0===u;this._inspectFont=d}font_loader_createClass(FontFaceObject,[{key:"createNativeFontFace",value:function createNativeFontFace(){var t,r;if(!this.data||this.disableFontFace)return null;if(this.cssFontInfo){var a={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(a.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg"));r=new FontFace(this.cssFontInfo.fontFamily,this.data,a)}else r=new FontFace(this.loadedName,this.data,{});null===(t=this._inspectFont)||void 0===t||t.call(this,this);return r}},{key:"createFontFaceRule",value:function createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;var r,a=bytesToString(this.data),i="url(data:".concat(this.mimetype,";base64,").concat(btoa(a),");");if(this.cssFontInfo){var o="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(o+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;"));r='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(o,"src:").concat(i,"}")}else r='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(i,"}");null===(t=this._inspectFont)||void 0===t||t.call(this,this,i);return r}},{key:"getPathGenerator",value:function getPathGenerator(t,r){if(void 0!==this.compiledGlyphs[r])return this.compiledGlyphs[r];var a;try{a=t.get(this.loadedName+"_path_"+r)}catch(t){if(!this.ignoreErrors)throw t;warn('getPathGenerator - ignoring character: "'.concat(t,'".'));return this.compiledGlyphs[r]=function(t,r){}}if(this.isEvalSupported&&he.isEvalSupported){var i,o=[],l=font_loader_createForOfIteratorHelper(a);try{for(l.s();!(i=l.n()).done;){var c=i.value,u=void 0!==c.args?c.args.join(","):"";o.push("c.",c.cmd,"(",u,");\n")}}catch(t){l.e(t)}finally{l.f()}return this.compiledGlyphs[r]=new Function("c","size",o.join(""))}return this.compiledGlyphs[r]=function(t,r){var i,o=font_loader_createForOfIteratorHelper(a);try{for(o.s();!(i=o.n()).done;){var l=i.value;"scale"===l.cmd&&(l.args=[r,-r]);t[l.cmd].apply(t,l.args)}}catch(t){o.e(t)}finally{o.f()}}}}]);return FontFaceObject}();function node_utils_typeof(t){return node_utils_typeof="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},node_utils_typeof(t)}function node_utils_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,node_utils_toPropertyKey(i.key),i)}}function node_utils_createClass(t,r,a){r&&node_utils_defineProperties(t.prototype,r);a&&node_utils_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function node_utils_toPropertyKey(t){var r=function node_utils_toPrimitive(t,r){if("object"!=node_utils_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=node_utils_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==node_utils_typeof(r)?r:String(r)}function node_utils_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function node_utils_callSuper(t,r,a){return r=node_utils_getPrototypeOf(r),function node_utils_possibleConstructorReturn(t,r){if(r&&("object"===node_utils_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function node_utils_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,node_utils_isNativeReflectConstruct()?Reflect.construct(r,a||[],node_utils_getPrototypeOf(t).constructor):r.apply(t,a))}function node_utils_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(node_utils_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function node_utils_getPrototypeOf(t){node_utils_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return node_utils_getPrototypeOf(t)}function node_utils_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&node_utils_setPrototypeOf(t,r)}function node_utils_setPrototypeOf(t,r){node_utils_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return node_utils_setPrototypeOf(t,r)}!function checkDOMMatrix(){if(!globalThis.DOMMatrix&&r){warn("Cannot polyfill `DOMMatrix`, rendering may be broken.")}}();!function checkPath2D(){if(!globalThis.Path2D&&r){warn("Cannot polyfill `Path2D`, rendering may be broken.")}}();var Tn=function fetchData(t){return new Promise((function(r,a){undefined.readFile(t,(function(t,i){!t&&i?r(new Uint8Array(i)):a(new Error(t))}))}))},Cn=function(t){node_utils_inherits(NodeFilterFactory,t);function NodeFilterFactory(){node_utils_classCallCheck(this,NodeFilterFactory);return node_utils_callSuper(this,NodeFilterFactory,arguments)}return node_utils_createClass(NodeFilterFactory)}(be),Mn=function(t){node_utils_inherits(NodeCanvasFactory,t);function NodeCanvasFactory(){node_utils_classCallCheck(this,NodeCanvasFactory);return node_utils_callSuper(this,NodeCanvasFactory,arguments)}node_utils_createClass(NodeCanvasFactory,[{key:"_createCanvas",value:function _createCanvas(t,r){return An.createCanvas(t,r)}}]);return NodeCanvasFactory}(we),Gn=function(t){node_utils_inherits(NodeCMapReaderFactory,t);function NodeCMapReaderFactory(){node_utils_classCallCheck(this,NodeCMapReaderFactory);return node_utils_callSuper(this,NodeCMapReaderFactory,arguments)}node_utils_createClass(NodeCMapReaderFactory,[{key:"_fetchData",value:function _fetchData(t,r){return Tn(t).then((function(t){return{cMapData:t,compressionType:r}}))}}]);return NodeCMapReaderFactory}(Pe),On=function(t){node_utils_inherits(NodeStandardFontDataFactory,t);function NodeStandardFontDataFactory(){node_utils_classCallCheck(this,NodeStandardFontDataFactory);return node_utils_callSuper(this,NodeStandardFontDataFactory,arguments)}node_utils_createClass(NodeStandardFontDataFactory,[{key:"_fetchData",value:function _fetchData(t){return Tn(t)}}]);return NodeStandardFontDataFactory}(ke);__webpack_require__(1419),__webpack_require__(5499),__webpack_require__(6976),__webpack_require__(854);function pattern_helper_toConsumableArray(t){return function pattern_helper_arrayWithoutHoles(t){if(Array.isArray(t))return pattern_helper_arrayLikeToArray(t)}(t)||function pattern_helper_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||pattern_helper_unsupportedIterableToArray(t)||function pattern_helper_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pattern_helper_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=pattern_helper_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function pattern_helper_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return pattern_helper_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?pattern_helper_arrayLikeToArray(t,r):void 0}}function pattern_helper_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function pattern_helper_callSuper(t,r,a){return r=pattern_helper_getPrototypeOf(r),function pattern_helper_possibleConstructorReturn(t,r){if(r&&("object"===pattern_helper_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function pattern_helper_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,pattern_helper_isNativeReflectConstruct()?Reflect.construct(r,a||[],pattern_helper_getPrototypeOf(t).constructor):r.apply(t,a))}function pattern_helper_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(pattern_helper_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function pattern_helper_getPrototypeOf(t){pattern_helper_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return pattern_helper_getPrototypeOf(t)}function pattern_helper_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&pattern_helper_setPrototypeOf(t,r)}function pattern_helper_setPrototypeOf(t,r){pattern_helper_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return pattern_helper_setPrototypeOf(t,r)}function pattern_helper_typeof(t){return pattern_helper_typeof="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},pattern_helper_typeof(t)}function pattern_helper_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function pattern_helper_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,pattern_helper_toPropertyKey(i.key),i)}}function pattern_helper_createClass(t,r,a){r&&pattern_helper_defineProperties(t.prototype,r);a&&pattern_helper_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function pattern_helper_toPropertyKey(t){var r=function pattern_helper_toPrimitive(t,r){if("object"!=pattern_helper_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=pattern_helper_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==pattern_helper_typeof(r)?r:String(r)}var Rn="Fill",Ln="Stroke",Dn="Shading";function applyBoundingBox(t,r){if(r){var a=r[2]-r[0],i=r[3]-r[1],o=new Path2D;o.rect(r[0],r[1],a,i);t.clip(o)}}var jn=function(){function BaseShadingPattern(){pattern_helper_classCallCheck(this,BaseShadingPattern);this.constructor===BaseShadingPattern&&unreachable("Cannot initialize BaseShadingPattern.")}pattern_helper_createClass(BaseShadingPattern,[{key:"getPattern",value:function getPattern(){unreachable("Abstract method `getPattern` called.")}}]);return BaseShadingPattern}(),Nn=function(t){pattern_helper_inherits(RadialAxialShadingPattern,t);function RadialAxialShadingPattern(t){var r;pattern_helper_classCallCheck(this,RadialAxialShadingPattern);(r=pattern_helper_callSuper(this,RadialAxialShadingPattern))._type=t[1];r._bbox=t[2];r._colorStops=t[3];r._p0=t[4];r._p1=t[5];r._r0=t[6];r._r1=t[7];r.matrix=null;return r}pattern_helper_createClass(RadialAxialShadingPattern,[{key:"_createGradient",value:function _createGradient(t){var r;"axial"===this._type?r=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(r=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));var a,i=pattern_helper_createForOfIteratorHelper(this._colorStops);try{for(i.s();!(a=i.n()).done;){var o=a.value;r.addColorStop(o[0],o[1])}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"getPattern",value:function getPattern(t,r,a,i){var o;if(i===Ln||i===Rn){var l=r.current.getClippedPathBoundingBox(i,getCurrentTransform(t))||[0,0,0,0],c=Math.ceil(l[2]-l[0])||1,u=Math.ceil(l[3]-l[1])||1,h=r.cachedCanvases.getCanvas("pattern",c,u,!0),d=h.context;d.clearRect(0,0,d.canvas.width,d.canvas.height);d.beginPath();d.rect(0,0,d.canvas.width,d.canvas.height);d.translate(-l[0],-l[1]);a=fe.transform(a,[1,0,0,1,l[0],l[1]]);d.transform.apply(d,pattern_helper_toConsumableArray(r.baseTransform));this.matrix&&d.transform.apply(d,pattern_helper_toConsumableArray(this.matrix));applyBoundingBox(d,this._bbox);d.fillStyle=this._createGradient(d);d.fill();o=t.createPattern(h.canvas,"no-repeat");var p=new DOMMatrix(a);o.setTransform(p)}else{applyBoundingBox(t,this._bbox);o=this._createGradient(t)}return o}}]);return RadialAxialShadingPattern}(jn);function drawTriangle(t,r,a,i,o,l,c,u){var h,d=r.coords,p=r.colors,v=t.data,_=4*t.width;if(d[a+1]>d[i+1]){h=a;a=i;i=h;h=l;l=c;c=h}if(d[i+1]>d[o+1]){h=i;i=o;o=h;h=c;c=u;u=h}if(d[a+1]>d[i+1]){h=a;a=i;i=h;h=l;l=c;c=h}var y=(d[a]+r.offsetX)*r.scaleX,g=(d[a+1]+r.offsetY)*r.scaleY,m=(d[i]+r.offsetX)*r.scaleX,b=(d[i+1]+r.offsetY)*r.scaleY,w=(d[o]+r.offsetX)*r.scaleX,P=(d[o+1]+r.offsetY)*r.scaleY;if(!(g>=P))for(var k,S,A,x,E,I,T,C,M=p[l],G=p[l+1],O=p[l+2],R=p[c],L=p[c+1],D=p[c+2],j=p[u],N=p[u+1],W=p[u+2],H=Math.round(g),B=Math.round(P),z=H;z<=B;z++){if(z<b){var U=z<g?0:(g-z)/(g-b);k=y-(y-m)*U;S=M-(M-R)*U;A=G-(G-L)*U;x=O-(O-D)*U}else{var q=void 0;k=m-(m-w)*(q=z>P?1:b===P?0:(b-z)/(b-P));S=R-(R-j)*q;A=L-(L-N)*q;x=D-(D-W)*q}var V=void 0;E=y-(y-w)*(V=z<g?0:z>P?1:(g-z)/(g-P));I=M-(M-j)*V;T=G-(G-N)*V;C=O-(O-W)*V;for(var K=Math.round(Math.min(k,E)),Y=Math.round(Math.max(k,E)),X=_*z+4*K,$=K;$<=Y;$++){(V=(k-$)/(k-E))<0?V=0:V>1&&(V=1);v[X++]=S-(S-I)*V|0;v[X++]=A-(A-T)*V|0;v[X++]=x-(x-C)*V|0;v[X++]=255}}}function drawFigure(t,r,a){var i,o,l=r.coords,c=r.colors;switch(r.type){case"lattice":var u=r.verticesPerRow,h=Math.floor(l.length/u)-1,d=u-1;for(i=0;i<h;i++)for(var p=i*u,v=0;v<d;v++,p++){drawTriangle(t,a,l[p],l[p+1],l[p+u],c[p],c[p+1],c[p+u]);drawTriangle(t,a,l[p+u+1],l[p+1],l[p+u],c[p+u+1],c[p+1],c[p+u])}break;case"triangles":for(i=0,o=l.length;i<o;i+=3)drawTriangle(t,a,l[i],l[i+1],l[i+2],c[i],c[i+1],c[i+2]);break;default:throw new Error("illegal figure")}}var Wn=function(t){pattern_helper_inherits(MeshShadingPattern,t);function MeshShadingPattern(t){var r;pattern_helper_classCallCheck(this,MeshShadingPattern);(r=pattern_helper_callSuper(this,MeshShadingPattern))._coords=t[2];r._colors=t[3];r._figures=t[4];r._bounds=t[5];r._bbox=t[7];r._background=t[8];r.matrix=null;return r}pattern_helper_createClass(MeshShadingPattern,[{key:"_createMeshCanvas",value:function _createMeshCanvas(t,r,a){var i=Math.floor(this._bounds[0]),o=Math.floor(this._bounds[1]),l=Math.ceil(this._bounds[2])-i,c=Math.ceil(this._bounds[3])-o,u=Math.min(Math.ceil(Math.abs(l*t[0]*1.1)),3e3),h=Math.min(Math.ceil(Math.abs(c*t[1]*1.1)),3e3),d=l/u,p=c/h,v={coords:this._coords,colors:this._colors,offsetX:-i,offsetY:-o,scaleX:1/d,scaleY:1/p},_=u+4,y=h+4,g=a.getCanvas("mesh",_,y,!1),m=g.context,b=m.createImageData(u,h);if(r)for(var w=b.data,P=0,k=w.length;P<k;P+=4){w[P]=r[0];w[P+1]=r[1];w[P+2]=r[2];w[P+3]=255}var S,A=pattern_helper_createForOfIteratorHelper(this._figures);try{for(A.s();!(S=A.n()).done;){drawFigure(b,S.value,v)}}catch(t){A.e(t)}finally{A.f()}m.putImageData(b,2,2);return{canvas:g.canvas,offsetX:i-2*d,offsetY:o-2*p,scaleX:d,scaleY:p}}},{key:"getPattern",value:function getPattern(t,r,a,i){applyBoundingBox(t,this._bbox);var o;if(i===Dn)o=fe.singularValueDecompose2dScale(getCurrentTransform(t));else{o=fe.singularValueDecompose2dScale(r.baseTransform);if(this.matrix){var l=fe.singularValueDecompose2dScale(this.matrix);o=[o[0]*l[0],o[1]*l[1]]}}var c=this._createMeshCanvas(o,i===Dn?null:this._background,r.cachedCanvases);if(i!==Dn){t.setTransform.apply(t,pattern_helper_toConsumableArray(r.baseTransform));this.matrix&&t.transform.apply(t,pattern_helper_toConsumableArray(this.matrix))}t.translate(c.offsetX,c.offsetY);t.scale(c.scaleX,c.scaleY);return t.createPattern(c.canvas,"no-repeat")}}]);return MeshShadingPattern}(jn),Hn=function(t){pattern_helper_inherits(DummyShadingPattern,t);function DummyShadingPattern(){pattern_helper_classCallCheck(this,DummyShadingPattern);return pattern_helper_callSuper(this,DummyShadingPattern,arguments)}pattern_helper_createClass(DummyShadingPattern,[{key:"getPattern",value:function getPattern(){return"hotpink"}}]);return DummyShadingPattern}(jn);var Bn=1,zn=2,Un=function(){function TilingPattern(t,r,a,i,o){pattern_helper_classCallCheck(this,TilingPattern);this.operatorList=t[2];this.matrix=t[3]||[1,0,0,1,0,0];this.bbox=t[4];this.xstep=t[5];this.ystep=t[6];this.paintType=t[7];this.tilingType=t[8];this.color=r;this.ctx=a;this.canvasGraphicsFactory=i;this.baseTransform=o}pattern_helper_createClass(TilingPattern,[{key:"createPatternCanvas",value:function createPatternCanvas(t){var r=this.operatorList,a=this.bbox,i=this.xstep,o=this.ystep,l=this.paintType,c=this.tilingType,u=this.color,h=this.canvasGraphicsFactory;info("TilingType: "+c);var d=a[0],p=a[1],v=a[2],_=a[3],y=fe.singularValueDecompose2dScale(this.matrix),g=fe.singularValueDecompose2dScale(this.baseTransform),m=[y[0]*g[0],y[1]*g[1]],b=this.getSizeAndScale(i,this.ctx.canvas.width,m[0]),w=this.getSizeAndScale(o,this.ctx.canvas.height,m[1]),P=t.cachedCanvases.getCanvas("pattern",b.size,w.size,!0),k=P.context,S=h.createCanvasGraphics(k);S.groupLevel=t.groupLevel;this.setFillAndStrokeStyleToContext(S,l,u);var A=d,x=p,E=v,I=_;if(d<0){A=0;E+=Math.abs(d)}if(p<0){x=0;I+=Math.abs(p)}k.translate(-b.scale*A,-w.scale*x);S.transform(b.scale,0,0,w.scale,0,0);k.save();this.clipBbox(S,A,x,E,I);S.baseTransform=getCurrentTransform(S.ctx);S.executeOperatorList(r);S.endDrawing();return{canvas:P.canvas,scaleX:b.scale,scaleY:w.scale,offsetX:A,offsetY:x}}},{key:"getSizeAndScale",value:function getSizeAndScale(t,r,a){t=Math.abs(t);var i=Math.max(TilingPattern.MAX_PATTERN_SIZE,r),o=Math.ceil(t*a);o>=i?o=i:a=o/t;return{scale:a,size:o}}},{key:"clipBbox",value:function clipBbox(t,r,a,i,o){var l=i-r,c=o-a;t.ctx.rect(r,a,l,c);t.current.updateRectMinMax(getCurrentTransform(t.ctx),[r,a,i,o]);t.clip();t.endPath()}},{key:"setFillAndStrokeStyleToContext",value:function setFillAndStrokeStyleToContext(t,r,a){var i=t.ctx,o=t.current;switch(r){case Bn:var l=this.ctx;i.fillStyle=l.fillStyle;i.strokeStyle=l.strokeStyle;o.fillColor=l.fillStyle;o.strokeColor=l.strokeStyle;break;case zn:var c=fe.makeHexColor(a[0],a[1],a[2]);i.fillStyle=c;i.strokeStyle=c;o.fillColor=c;o.strokeColor=c;break;default:throw new ce("Unsupported paint type: ".concat(r))}}},{key:"getPattern",value:function getPattern(t,r,a,i){var o=a;if(i!==Dn){o=fe.transform(o,r.baseTransform);this.matrix&&(o=fe.transform(o,this.matrix))}var l=this.createPatternCanvas(r),c=new DOMMatrix(o);c=(c=c.translate(l.offsetX,l.offsetY)).scale(1/l.scaleX,1/l.scaleY);var u=t.createPattern(l.canvas,"repeat");u.setTransform(c);return u}}]);return TilingPattern}();!function pattern_helper_defineProperty(t,r,a){(r=pattern_helper_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}(Un,"MAX_PATTERN_SIZE",3e3);function image_utils_slicedToArray(t,r){return function image_utils_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function image_utils_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||function image_utils_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return image_utils_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return image_utils_arrayLikeToArray(t,r)}(t,r)||function image_utils_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function image_utils_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function convertBlackAndWhiteToRGBA(t){var r=t.src,a=t.srcPos,i=void 0===a?0:a,o=t.dest,l=t.width,c=t.height,u=t.nonBlackColor,h=void 0===u?4294967295:u,d=t.inverseDecode,p=void 0!==d&&d,v=he.isLittleEndian?4278190080:255,_=image_utils_slicedToArray(p?[h,v]:[v,h],2),y=_[0],g=_[1],m=l>>3,b=7&l,w=r.length;o=new Uint32Array(o.buffer);for(var P=0,k=0;k<c;k++){for(var S=i+m;i<S;i++){var A=i<w?r[i]:255;o[P++]=128&A?g:y;o[P++]=64&A?g:y;o[P++]=32&A?g:y;o[P++]=16&A?g:y;o[P++]=8&A?g:y;o[P++]=4&A?g:y;o[P++]=2&A?g:y;o[P++]=1&A?g:y}if(0!==b)for(var x=i<w?r[i++]:255,E=0;E<b;E++)o[P++]=x&1<<7-E?g:y}return{srcPos:i,destPos:P}}function canvas_typeof(t){return canvas_typeof="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},canvas_typeof(t)}function canvas_toConsumableArray(t){return function canvas_arrayWithoutHoles(t){if(Array.isArray(t))return canvas_arrayLikeToArray(t)}(t)||function canvas_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||canvas_unsupportedIterableToArray(t)||function canvas_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function canvas_classPrivateMethodInitSpec(t,r){!function canvas_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,r);r.add(t)}function canvas_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function canvas_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=canvas_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function canvas_slicedToArray(t,r){return function canvas_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function canvas_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||canvas_unsupportedIterableToArray(t,r)||function canvas_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function canvas_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return canvas_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?canvas_arrayLikeToArray(t,r):void 0}}function canvas_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function canvas_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function canvas_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,canvas_toPropertyKey(i.key),i)}}function canvas_createClass(t,r,a){r&&canvas_defineProperties(t.prototype,r);a&&canvas_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function canvas_toPropertyKey(t){var r=function canvas_toPrimitive(t,r){if("object"!=canvas_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=canvas_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==canvas_typeof(r)?r:String(r)}var qn=4096,Vn=16;var Kn=function(){function CachedCanvases(t){canvas_classCallCheck(this,CachedCanvases);this.canvasFactory=t;this.cache=Object.create(null)}canvas_createClass(CachedCanvases,[{key:"getCanvas",value:function getCanvas(t,r,a){var i;if(void 0!==this.cache[t]){i=this.cache[t];this.canvasFactory.reset(i,r,a)}else{i=this.canvasFactory.create(r,a);this.cache[t]=i}return i}},{key:"delete",value:function _delete(t){delete this.cache[t]}},{key:"clear",value:function clear(){for(var t in this.cache){var r=this.cache[t];this.canvasFactory.destroy(r);delete this.cache[t]}}}]);return CachedCanvases}();function drawImageAtIntegerCoords(t,r,a,i,o,l,c,u,h,d){var p=canvas_slicedToArray(getCurrentTransform(t),6),v=p[0],_=p[1],y=p[2],g=p[3],m=p[4],b=p[5];if(0===_&&0===y){var w=c*v+m,P=Math.round(w),k=u*g+b,S=Math.round(k),A=(c+h)*v+m,x=Math.abs(Math.round(A)-P)||1,E=(u+d)*g+b,I=Math.abs(Math.round(E)-S)||1;t.setTransform(Math.sign(v),0,0,Math.sign(g),P,S);t.drawImage(r,a,i,o,l,0,0,x,I);t.setTransform(v,_,y,g,m,b);return[x,I]}if(0===v&&0===g){var T=u*y+m,C=Math.round(T),M=c*_+b,G=Math.round(M),O=(u+d)*y+m,R=Math.abs(Math.round(O)-C)||1,L=(c+h)*_+b,D=Math.abs(Math.round(L)-G)||1;t.setTransform(0,Math.sign(_),Math.sign(y),0,C,G);t.drawImage(r,a,i,o,l,0,0,D,R);t.setTransform(v,_,y,g,m,b);return[D,R]}t.drawImage(r,a,i,o,l,c,u,h,d);return[Math.hypot(v,_)*h,Math.hypot(y,g)*d]}var Yn=function(){function CanvasExtraState(t,r){canvas_classCallCheck(this,CanvasExtraState);this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=i;this.textMatrixScale=1;this.fontMatrix=o;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=w;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,r])}canvas_createClass(CanvasExtraState,[{key:"clone",value:function clone(){var clone=Object.create(this);clone.clipBox=this.clipBox.slice();return clone}},{key:"setCurrentPoint",value:function setCurrentPoint(t,r){this.x=t;this.y=r}},{key:"updatePathMinMax",value:function updatePathMinMax(t,r,a){var i=canvas_slicedToArray(fe.applyTransform([r,a],t),2);r=i[0];a=i[1];this.minX=Math.min(this.minX,r);this.minY=Math.min(this.minY,a);this.maxX=Math.max(this.maxX,r);this.maxY=Math.max(this.maxY,a)}},{key:"updateRectMinMax",value:function updateRectMinMax(t,r){var a=fe.applyTransform(r,t),i=fe.applyTransform(r.slice(2),t),o=fe.applyTransform([r[0],r[3]],t),l=fe.applyTransform([r[2],r[1]],t);this.minX=Math.min(this.minX,a[0],i[0],o[0],l[0]);this.minY=Math.min(this.minY,a[1],i[1],o[1],l[1]);this.maxX=Math.max(this.maxX,a[0],i[0],o[0],l[0]);this.maxY=Math.max(this.maxY,a[1],i[1],o[1],l[1])}},{key:"updateScalingPathMinMax",value:function updateScalingPathMinMax(t,r){fe.scaleMinMax(t,r);this.minX=Math.min(this.minX,r[0]);this.minY=Math.min(this.minY,r[1]);this.maxX=Math.max(this.maxX,r[2]);this.maxY=Math.max(this.maxY,r[3])}},{key:"updateCurvePathMinMax",value:function updateCurvePathMinMax(t,r,a,i,o,l,c,u,h,d){var p=fe.bezierBoundingBox(r,a,i,o,l,c,u,h,d);d||this.updateRectMinMax(t,p)}},{key:"getPathBoundingBox",value:function getPathBoundingBox(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rn,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=[this.minX,this.minY,this.maxX,this.maxY];if(t===Ln){r||unreachable("Stroke bounding box must include transform.");var i=fe.singularValueDecompose2dScale(r),o=i[0]*this.lineWidth/2,l=i[1]*this.lineWidth/2;a[0]-=o;a[1]-=l;a[2]+=o;a[3]+=l}return a}},{key:"updateClipFromPath",value:function updateClipFromPath(){var t=fe.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}},{key:"isEmptyClip",value:function isEmptyClip(){return this.minX===1/0}},{key:"startNewPathAndClipBox",value:function startNewPathAndClipBox(t){this.clipBox=t;this.minX=1/0;this.minY=1/0;this.maxX=0;this.maxY=0}},{key:"getClippedPathBoundingBox",value:function getClippedPathBoundingBox(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rn,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return fe.intersect(this.clipBox,this.getPathBoundingBox(t,r))}}]);return CanvasExtraState}();function putBinaryImageData(t,r){if("undefined"!=typeof ImageData&&r instanceof ImageData)t.putImageData(r,0,0);else{var a,i,o,l,c,u=r.height,h=r.width,d=u%Vn,p=(u-d)/Vn,v=0===d?p:p+1,_=t.createImageData(h,Vn),y=0,g=r.data,m=_.data;if(r.kind===E.GRAYSCALE_1BPP){var b=g.byteLength,w=new Uint32Array(m.buffer,0,m.byteLength>>2),P=w.length,k=h+7>>3,S=4294967295,A=he.isLittleEndian?4278190080:255;for(i=0;i<v;i++){l=i<p?Vn:d;a=0;for(o=0;o<l;o++){for(var x=b-y,I=0,T=x>k?h:8*x-7,C=-8&T,M=0,G=0;I<C;I+=8){G=g[y++];w[a++]=128&G?S:A;w[a++]=64&G?S:A;w[a++]=32&G?S:A;w[a++]=16&G?S:A;w[a++]=8&G?S:A;w[a++]=4&G?S:A;w[a++]=2&G?S:A;w[a++]=1&G?S:A}for(;I<T;I++){if(0===M){G=g[y++];M=128}w[a++]=G&M?S:A;M>>=1}}for(;a<P;)w[a++]=0;t.putImageData(_,0,i*Vn)}}else if(r.kind===E.RGBA_32BPP){o=0;c=h*Vn*4;for(i=0;i<p;i++){m.set(g.subarray(y,y+c));y+=c;t.putImageData(_,0,o);o+=Vn}if(i<v){c=h*d*4;m.set(g.subarray(y,y+c));t.putImageData(_,0,o)}}else{if(r.kind!==E.RGB_24BPP)throw new Error("bad image kind: ".concat(r.kind));c=h*(l=Vn);for(i=0;i<v;i++){i>=p&&(c=h*(l=d));a=0;for(o=c;o--;){m[a++]=g[y++];m[a++]=g[y++];m[a++]=g[y++];m[a++]=255}t.putImageData(_,0,i*Vn)}}}}function putBinaryImageMask(t,r){if(r.bitmap)t.drawImage(r.bitmap,0,0);else for(var a=r.height,i=r.width,o=a%Vn,l=(a-o)/Vn,c=0===o?l:l+1,u=t.createImageData(i,Vn),h=0,d=r.data,p=u.data,v=0;v<c;v++){h=convertBlackAndWhiteToRGBA({src:d,srcPos:h,dest:p,width:i,height:v<l?Vn:o,nonBlackColor:0}).srcPos;t.putImageData(u,0,v*Vn)}}function copyCtxState(t,r){for(var a=0,i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];a<i.length;a++){var o=i[a];void 0!==t[o]&&(r[o]=t[o])}if(void 0!==t.setLineDash){r.setLineDash(t.getLineDash());r.lineDashOffset=t.lineDashOffset}}function resetCtxToDefault(t){t.strokeStyle=t.fillStyle="#000000";t.fillRule="nonzero";t.globalAlpha=1;t.lineWidth=1;t.lineCap="butt";t.lineJoin="miter";t.miterLimit=10;t.globalCompositeOperation="source-over";t.font="10px sans-serif";if(void 0!==t.setLineDash){t.setLineDash([]);t.lineDashOffset=0}if(!r){var a=t.filter;"none"!==a&&""!==a&&(t.filter="none")}}function composeSMaskBackdrop(t,r,a,i){for(var o=t.length,l=3;l<o;l+=4){var c=t[l];if(0===c){t[l-3]=r;t[l-2]=a;t[l-1]=i}else if(c<255){var u=255-c;t[l-3]=t[l-3]*c+r*u>>8;t[l-2]=t[l-2]*c+a*u>>8;t[l-1]=t[l-1]*c+i*u>>8}}}function composeSMaskAlpha(t,r,a){for(var i=t.length,o=3;o<i;o+=4){var l=a?a[t[o]]:t[o];r[o]=r[o]*l*.00392156862745098|0}}function composeSMaskLuminosity(t,r,a){for(var i=t.length,o=3;o<i;o+=4){var l=77*t[o-3]+152*t[o-2]+28*t[o-1];r[o]=a?r[o]*a[l>>8]>>8:r[o]*l>>16}}function composeSMask(t,r,a,i){var o=i[0],l=i[1],c=i[2]-o,u=i[3]-l;if(0!==c&&0!==u){!function genericComposeSMask(t,r,a,i,o,l,c,u,h,d,p){for(var v=!!l,_=v?l[0]:0,y=v?l[1]:0,g=v?l[2]:0,m="Luminosity"===o?composeSMaskLuminosity:composeSMaskAlpha,b=Math.min(i,Math.ceil(1048576/a)),w=0;w<i;w+=b){var P=Math.min(b,i-w),k=t.getImageData(u-d,w+(h-p),a,P),S=r.getImageData(u,w+h,a,P);v&&composeSMaskBackdrop(k.data,_,y,g);m(k.data,S.data,c);r.putImageData(S,u,w+h)}}(r.context,a,c,u,r.subtype,r.backdrop,r.transferMap,o,l,r.offsetX,r.offsetY);t.save();t.globalAlpha=1;t.globalCompositeOperation="source-over";t.setTransform(1,0,0,1,0,0);t.drawImage(a.canvas,0,0);t.restore()}}function getImageSmoothingEnabled(t,r){var a=fe.singularValueDecompose2dScale(t);a[0]=Math.fround(a[0]);a[1]=Math.fround(a[1]);var i=Math.fround((globalThis.devicePixelRatio||1)*Ae.PDF_TO_CSS_UNITS);return void 0!==r?r:a[0]<=i||a[1]<=i}var Xn=["butt","round","square"],$n=["miter","round","bevel"],Jn={},Qn={},Zn=new WeakSet,ea=new WeakSet,ta=function(){function CanvasGraphics(t,r,a,i,o,l,c,u){var h=l.optionalContentConfig,d=l.markedContentStack,p=void 0===d?null:d;canvas_classCallCheck(this,CanvasGraphics);canvas_classPrivateMethodInitSpec(this,ea);canvas_classPrivateMethodInitSpec(this,Zn);this.ctx=t;this.current=new Yn(this.ctx.canvas.width,this.ctx.canvas.height);this.stateStack=[];this.pendingClip=null;this.pendingEOFill=!1;this.res=null;this.xobjs=null;this.commonObjs=r;this.objs=a;this.canvasFactory=i;this.filterFactory=o;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=p||[];this.optionalContentConfig=h;this.cachedCanvases=new Kn(this.canvasFactory);this.cachedPatterns=new Map;this.annotationCanvasMap=c;this.viewportScale=1;this.outputScaleX=1;this.outputScaleY=1;this.pageColors=u;this._cachedScaleForStroking=[-1,0];this._cachedGetSinglePixelWidth=null;this._cachedBitmapsMap=new Map}canvas_createClass(CanvasGraphics,[{key:"getObject",value:function getObject(t){var r=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):r}},{key:"beginDrawing",value:function beginDrawing(t){var r,a=t.transform,i=t.viewport,o=t.transparency,l=void 0!==o&&o,c=t.background,u=void 0===c?null:c,h=this.ctx.canvas.width,d=this.ctx.canvas.height,p=this.ctx.fillStyle;this.ctx.fillStyle=u||"#ffffff";this.ctx.fillRect(0,0,h,d);this.ctx.fillStyle=p;if(l){var v,_=this.cachedCanvases.getCanvas("transparent",h,d);this.compositeCtx=this.ctx;this.transparentCanvas=_.canvas;this.ctx=_.context;this.ctx.save();(v=this.ctx).transform.apply(v,canvas_toConsumableArray(getCurrentTransform(this.compositeCtx)))}this.ctx.save();resetCtxToDefault(this.ctx);if(a){var y;(y=this.ctx).transform.apply(y,canvas_toConsumableArray(a));this.outputScaleX=a[0];this.outputScaleY=a[0]}(r=this.ctx).transform.apply(r,canvas_toConsumableArray(i.transform));this.viewportScale=i.scale;this.baseTransform=getCurrentTransform(this.ctx)}},{key:"executeOperatorList",value:function executeOperatorList(t,r,a,i){var o=t.argsArray,l=t.fnArray,c=r||0,u=o.length;if(u===c)return c;for(var h,d=u-c>10&&"function"==typeof a,p=d?Date.now()+15:0,v=0,_=this.commonObjs,y=this.objs;;){if(void 0!==i&&c===i.nextBreakPoint){i.breakIt(c,a);return c}if((h=l[c])!==ee.dependency)this[h].apply(this,o[c]);else{var g,m=canvas_createForOfIteratorHelper(o[c]);try{for(m.s();!(g=m.n()).done;){var b=g.value,w=b.startsWith("g_")?_:y;if(!w.has(b)){w.get(b,a);return c}}}catch(t){m.e(t)}finally{m.f()}}if(++c===u)return c;if(d&&++v>10){if(Date.now()>p){a();return c}v=0}}}},{key:"endDrawing",value:function endDrawing(){canvas_classPrivateMethodGet(this,Zn,_restoreInitialState2).call(this);this.cachedCanvases.clear();this.cachedPatterns.clear();var t,r=canvas_createForOfIteratorHelper(this._cachedBitmapsMap.values());try{for(r.s();!(t=r.n()).done;){var a,i=t.value,o=canvas_createForOfIteratorHelper(i.values());try{for(o.s();!(a=o.n()).done;){var l=a.value;"undefined"!=typeof HTMLCanvasElement&&l instanceof HTMLCanvasElement&&(l.width=l.height=0)}}catch(t){o.e(t)}finally{o.f()}i.clear()}}catch(t){r.e(t)}finally{r.f()}this._cachedBitmapsMap.clear();canvas_classPrivateMethodGet(this,ea,_drawFilter2).call(this)}},{key:"_scaleImage",value:function _scaleImage(t,r){for(var a,i,o=t.width,l=t.height,c=Math.max(Math.hypot(r[0],r[1]),1),u=Math.max(Math.hypot(r[2],r[3]),1),h=o,d=l,p="prescale1";c>2&&h>1||u>2&&d>1;){var v=h,_=d;c>2&&h>1&&(c/=h/(v=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h/2)));u>2&&d>1&&(u/=d/(_=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d)/2));(i=(a=this.cachedCanvases.getCanvas(p,v,_)).context).clearRect(0,0,v,_);i.drawImage(t,0,0,h,d,0,0,v,_);t=a.canvas;h=v;d=_;p="prescale1"===p?"prescale2":"prescale1"}return{img:t,paintWidth:h,paintHeight:d}}},{key:"_createMaskCanvas",value:function _createMaskCanvas(t){var r,a,i,o,l=this.ctx,c=t.width,u=t.height,h=this.current.fillColor,d=this.current.patternFill,p=getCurrentTransform(l);if((t.bitmap||t.data)&&t.count>1){var v=t.bitmap||t.data.buffer;a=JSON.stringify(d?p:[p.slice(0,4),h]);if(!(r=this._cachedBitmapsMap.get(v))){r=new Map;this._cachedBitmapsMap.set(v,r)}var _=r.get(a);if(_&&!d){return{canvas:_,offsetX:Math.round(Math.min(p[0],p[2])+p[4]),offsetY:Math.round(Math.min(p[1],p[3])+p[5])}}i=_}i||putBinaryImageMask((o=this.cachedCanvases.getCanvas("maskCanvas",c,u)).context,t);var y=fe.transform(p,[1/c,0,0,-1/u,0,0]);y=fe.transform(y,[1,0,0,1,0,-u]);var g=canvas_slicedToArray(fe.getAxialAlignedBoundingBox([0,0,c,u],y),4),m=g[0],b=g[1],w=g[2],P=g[3],k=Math.round(w-m)||1,S=Math.round(P-b)||1,A=this.cachedCanvases.getCanvas("fillCanvas",k,S),x=A.context,E=m,I=b;x.translate(-E,-I);x.transform.apply(x,canvas_toConsumableArray(y));if(!i){i=(i=this._scaleImage(o.canvas,getCurrentTransformInverse(x))).img;r&&d&&r.set(a,i)}x.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(x),t.interpolate);drawImageAtIntegerCoords(x,i,0,0,i.width,i.height,0,0,c,u);x.globalCompositeOperation="source-in";var T=fe.transform(getCurrentTransformInverse(x),[1,0,0,1,-E,-I]);x.fillStyle=d?h.getPattern(l,this,T,Rn):h;x.fillRect(0,0,c,u);if(r&&!d){this.cachedCanvases.delete("fillCanvas");r.set(a,A.canvas)}return{canvas:A.canvas,offsetX:Math.round(E),offsetY:Math.round(I)}}},{key:"setLineWidth",value:function setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1);this.current.lineWidth=t;this.ctx.lineWidth=t}},{key:"setLineCap",value:function setLineCap(t){this.ctx.lineCap=Xn[t]}},{key:"setLineJoin",value:function setLineJoin(t){this.ctx.lineJoin=$n[t]}},{key:"setMiterLimit",value:function setMiterLimit(t){this.ctx.miterLimit=t}},{key:"setDash",value:function setDash(t,r){var a=this.ctx;if(void 0!==a.setLineDash){a.setLineDash(t);a.lineDashOffset=r}}},{key:"setRenderingIntent",value:function setRenderingIntent(t){}},{key:"setFlatness",value:function setFlatness(t){}},{key:"setGState",value:function setGState(t){var r,a=canvas_createForOfIteratorHelper(t);try{for(a.s();!(r=a.n()).done;){var i=canvas_slicedToArray(r.value,2),o=i[0],l=i[1];switch(o){case"LW":this.setLineWidth(l);break;case"LC":this.setLineCap(l);break;case"LJ":this.setLineJoin(l);break;case"ML":this.setMiterLimit(l);break;case"D":this.setDash(l[0],l[1]);break;case"RI":this.setRenderingIntent(l);break;case"FL":this.setFlatness(l);break;case"Font":this.setFont(l[0],l[1]);break;case"CA":this.current.strokeAlpha=l;break;case"ca":this.current.fillAlpha=l;this.ctx.globalAlpha=l;break;case"BM":this.ctx.globalCompositeOperation=l;break;case"SMask":this.current.activeSMask=l?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(l)}}}catch(t){a.e(t)}finally{a.f()}}},{key:"inSMaskMode",get:function get(){return!!this.suspendedCtx}},{key:"checkSMaskState",value:function checkSMaskState(){var t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}},{key:"beginSMaskMode",value:function beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");var t=this.ctx.canvas.width,r=this.ctx.canvas.height,a="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(a,t,r);this.suspendedCtx=this.ctx;this.ctx=i.context;var o=this.ctx;o.setTransform.apply(o,canvas_toConsumableArray(getCurrentTransform(this.suspendedCtx)));copyCtxState(this.suspendedCtx,o);!function mirrorContextOperations(t,r){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=function(){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 ctxSave(){r.save();this.__originalSave()};t.restore=function ctxRestore(){r.restore();this.__originalRestore()};t.translate=function ctxTranslate(t,a){r.translate(t,a);this.__originalTranslate(t,a)};t.scale=function ctxScale(t,a){r.scale(t,a);this.__originalScale(t,a)};t.transform=function ctxTransform(t,a,i,o,l,c){r.transform(t,a,i,o,l,c);this.__originalTransform(t,a,i,o,l,c)};t.setTransform=function ctxSetTransform(t,a,i,o,l,c){r.setTransform(t,a,i,o,l,c);this.__originalSetTransform(t,a,i,o,l,c)};t.resetTransform=function ctxResetTransform(){r.resetTransform();this.__originalResetTransform()};t.rotate=function ctxRotate(t){r.rotate(t);this.__originalRotate(t)};t.clip=function ctxRotate(t){r.clip(t);this.__originalClip(t)};t.moveTo=function(t,a){r.moveTo(t,a);this.__originalMoveTo(t,a)};t.lineTo=function(t,a){r.lineTo(t,a);this.__originalLineTo(t,a)};t.bezierCurveTo=function(t,a,i,o,l,c){r.bezierCurveTo(t,a,i,o,l,c);this.__originalBezierCurveTo(t,a,i,o,l,c)};t.rect=function(t,a,i,o){r.rect(t,a,i,o);this.__originalRect(t,a,i,o)};t.closePath=function(){r.closePath();this.__originalClosePath()};t.beginPath=function(){r.beginPath();this.__originalBeginPath()}}(o,this.suspendedCtx);this.setGState([["BM","source-over"],["ca",1],["CA",1]])}},{key:"endSMaskMode",value:function endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring();copyCtxState(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.suspendedCtx=null}},{key:"compose",value:function compose(t){if(this.current.activeSMask){if(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])}else t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];var r=this.current.activeSMask;composeSMask(this.suspendedCtx,r,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()}}},{key:"save",value:function save(){if(this.inSMaskMode){copyCtxState(this.ctx,this.suspendedCtx);this.suspendedCtx.save()}else this.ctx.save();var t=this.current;this.stateStack.push(t);this.current=t.clone()}},{key:"restore",value:function restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode();if(0!==this.stateStack.length){this.current=this.stateStack.pop();if(this.inSMaskMode){this.suspendedCtx.restore();copyCtxState(this.suspendedCtx,this.ctx)}else this.ctx.restore();this.checkSMaskState();this.pendingClip=null;this._cachedScaleForStroking[0]=-1;this._cachedGetSinglePixelWidth=null}}},{key:"transform",value:function transform(t,r,a,i,o,l){this.ctx.transform(t,r,a,i,o,l);this._cachedScaleForStroking[0]=-1;this._cachedGetSinglePixelWidth=null}},{key:"constructPath",value:function constructPath(t,r,a){for(var i,o,l=this.ctx,c=this.current,u=c.x,h=c.y,d=getCurrentTransform(l),p=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],v=p?a.slice(0):null,_=0,y=0,g=t.length;_<g;_++)switch(0|t[_]){case ee.rectangle:u=r[y++];h=r[y++];var m=r[y++],b=r[y++],w=u+m,P=h+b;l.moveTo(u,h);if(0===m||0===b)l.lineTo(w,P);else{l.lineTo(w,h);l.lineTo(w,P);l.lineTo(u,P)}p||c.updateRectMinMax(d,[u,h,w,P]);l.closePath();break;case ee.moveTo:u=r[y++];h=r[y++];l.moveTo(u,h);p||c.updatePathMinMax(d,u,h);break;case ee.lineTo:u=r[y++];h=r[y++];l.lineTo(u,h);p||c.updatePathMinMax(d,u,h);break;case ee.curveTo:i=u;o=h;u=r[y+4];h=r[y+5];l.bezierCurveTo(r[y],r[y+1],r[y+2],r[y+3],u,h);c.updateCurvePathMinMax(d,i,o,r[y],r[y+1],r[y+2],r[y+3],u,h,v);y+=6;break;case ee.curveTo2:i=u;o=h;l.bezierCurveTo(u,h,r[y],r[y+1],r[y+2],r[y+3]);c.updateCurvePathMinMax(d,i,o,u,h,r[y],r[y+1],r[y+2],r[y+3],v);u=r[y+2];h=r[y+3];y+=4;break;case ee.curveTo3:i=u;o=h;u=r[y+2];h=r[y+3];l.bezierCurveTo(r[y],r[y+1],u,h,u,h);c.updateCurvePathMinMax(d,i,o,r[y],r[y+1],u,h,u,h,v);y+=4;break;case ee.closePath:l.closePath()}p&&c.updateScalingPathMinMax(d,v);c.setCurrentPoint(u,h)}},{key:"closePath",value:function closePath(){this.ctx.closePath()}},{key:"stroke",value:function stroke(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.ctx,a=this.current.strokeColor;r.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"===canvas_typeof(a)&&null!=a&&a.getPattern){r.save();r.strokeStyle=a.getPattern(r,this,getCurrentTransformInverse(r),Ln);this.rescaleAndStroke(!1);r.restore()}else this.rescaleAndStroke(!0);t&&this.consumePath(this.current.getClippedPathBoundingBox());r.globalAlpha=this.current.fillAlpha}},{key:"closeStroke",value:function closeStroke(){this.closePath();this.stroke()}},{key:"fill",value:function fill(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.ctx,a=this.current.fillColor,i=!1;if(this.current.patternFill){r.save();r.fillStyle=a.getPattern(r,this,getCurrentTransformInverse(r),Rn);i=!0}var o=this.current.getClippedPathBoundingBox();if(this.contentVisible&&null!==o)if(this.pendingEOFill){r.fill("evenodd");this.pendingEOFill=!1}else r.fill();i&&r.restore();t&&this.consumePath(o)}},{key:"eoFill",value:function eoFill(){this.pendingEOFill=!0;this.fill()}},{key:"fillStroke",value:function fillStroke(){this.fill(!1);this.stroke(!1);this.consumePath()}},{key:"eoFillStroke",value:function eoFillStroke(){this.pendingEOFill=!0;this.fillStroke()}},{key:"closeFillStroke",value:function closeFillStroke(){this.closePath();this.fillStroke()}},{key:"closeEOFillStroke",value:function closeEOFillStroke(){this.pendingEOFill=!0;this.closePath();this.fillStroke()}},{key:"endPath",value:function endPath(){this.consumePath()}},{key:"clip",value:function clip(){this.pendingClip=Jn}},{key:"eoClip",value:function eoClip(){this.pendingClip=Qn}},{key:"beginText",value:function beginText(){this.current.textMatrix=i;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}},{key:"endText",value:function endText(){var t=this.pendingTextPaths,r=this.ctx;if(void 0!==t){r.save();r.beginPath();var a,i=canvas_createForOfIteratorHelper(t);try{for(i.s();!(a=i.n()).done;){var o=a.value;r.setTransform.apply(r,canvas_toConsumableArray(o.transform));r.translate(o.x,o.y);o.addToPath(r,o.fontSize)}}catch(t){i.e(t)}finally{i.f()}r.restore();r.clip();r.beginPath();delete this.pendingTextPaths}else r.beginPath()}},{key:"setCharSpacing",value:function setCharSpacing(t){this.current.charSpacing=t}},{key:"setWordSpacing",value:function setWordSpacing(t){this.current.wordSpacing=t}},{key:"setHScale",value:function setHScale(t){this.current.textHScale=t/100}},{key:"setLeading",value:function setLeading(t){this.current.leading=-t}},{key:"setFont",value:function setFont(t,r){var a,i=this.commonObjs.get(t),l=this.current;if(!i)throw new Error("Can't find font for ".concat(t));l.fontMatrix=i.fontMatrix||o;0!==l.fontMatrix[0]&&0!==l.fontMatrix[3]||warn("Invalid font matrix for font "+t);if(r<0){r=-r;l.fontDirection=-1}else l.fontDirection=1;this.current.font=i;this.current.fontSize=r;if(!i.isType3Font){var c=i.loadedName||"sans-serif",u=(null===(a=i.systemFontInfo)||void 0===a?void 0:a.css)||'"'.concat(c,'", ').concat(i.fallbackName),h="normal";i.black?h="900":i.bold&&(h="bold");var d=i.italic?"italic":"normal",p=r;r<16?p=16:r>100&&(p=100);this.current.fontSizeScale=r/p;this.ctx.font="".concat(d," ").concat(h," ").concat(p,"px ").concat(u)}}},{key:"setTextRenderingMode",value:function setTextRenderingMode(t){this.current.textRenderingMode=t}},{key:"setTextRise",value:function setTextRise(t){this.current.textRise=t}},{key:"moveText",value:function moveText(t,r){this.current.x=this.current.lineX+=t;this.current.y=this.current.lineY+=r}},{key:"setLeadingMoveText",value:function setLeadingMoveText(t,r){this.setLeading(-r);this.moveText(t,r)}},{key:"setTextMatrix",value:function setTextMatrix(t,r,a,i,o,l){this.current.textMatrix=[t,r,a,i,o,l];this.current.textMatrixScale=Math.hypot(t,r);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}},{key:"nextLine",value:function nextLine(){this.moveText(0,this.current.leading)}},{key:"paintChar",value:function paintChar(t,r,a,i){var o,l=this.ctx,c=this.current,u=c.font,h=c.textRenderingMode,d=c.fontSize/c.fontSizeScale,p=h&A,v=!!(h&x),_=c.patternFill&&!u.missingFile;(u.disableFontFace||v||_)&&(o=u.getPathGenerator(this.commonObjs,t));if(u.disableFontFace||_){l.save();l.translate(r,a);l.beginPath();o(l,d);i&&l.setTransform.apply(l,canvas_toConsumableArray(i));p!==w&&p!==k||l.fill();p!==P&&p!==k||l.stroke();l.restore()}else{p!==w&&p!==k||l.fillText(t,r,a);p!==P&&p!==k||l.strokeText(t,r,a)}if(v){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:getCurrentTransform(l),x:r,y:a,fontSize:d,addToPath:o})}}},{key:"isFontSubpixelAAEnabled",get:function get(){var t=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10).context;t.scale(1.5,1);t.fillText("I",0,10);for(var r=t.getImageData(0,0,10,10).data,a=!1,i=3;i<r.length;i+=4)if(r[i]>0&&r[i]<255){a=!0;break}return shadow(this,"isFontSubpixelAAEnabled",a)}},{key:"showText",value:function showText(t){var r=this.current,a=r.font;if(a.isType3Font)return this.showType3Text(t);var i=r.fontSize;if(0!==i){var o,l=this.ctx,c=r.fontSizeScale,u=r.charSpacing,h=r.wordSpacing,d=r.fontDirection,p=r.textHScale*d,v=t.length,_=a.vertical,y=_?1:-1,g=a.defaultVMetrics,m=i*r.fontMatrix[0],b=r.textRenderingMode===w&&!a.disableFontFace&&!r.patternFill;l.save();l.transform.apply(l,canvas_toConsumableArray(r.textMatrix));l.translate(r.x,r.y+r.textRise);d>0?l.scale(p,-1):l.scale(p,1);if(r.patternFill){l.save();var S=r.fillColor.getPattern(l,this,getCurrentTransformInverse(l),Rn);o=getCurrentTransform(l);l.restore();l.fillStyle=S}var x=r.lineWidth,E=r.textMatrixScale;if(0===E||0===x){var I=r.textRenderingMode&A;I!==P&&I!==k||(x=this.getSinglePixelWidth())}else x/=E;if(1!==c){l.scale(c,c);x/=c}l.lineWidth=x;if(a.isInvalidPDFjsFont){var T,C=[],M=0,G=canvas_createForOfIteratorHelper(t);try{for(G.s();!(T=G.n()).done;){var O=T.value;C.push(O.unicode);M+=O.width}}catch(t){G.e(t)}finally{G.f()}l.fillText(C.join(""),0,0);r.x+=M*m*p;l.restore();this.compose()}else{var R,L=0;for(R=0;R<v;++R){var D=t[R];if("number"!=typeof D){var j=!1,N=(D.isSpace?h:0)+u,W=D.fontChar,H=D.accent,B=void 0,z=void 0,U=D.width;if(_){var q=D.vmetric||g,V=-(D.vmetric?q[1]:.5*U)*m,K=q[2]*m;U=q?-q[0]:U;B=V/c;z=(L+K)/c}else{B=L/c;z=0}if(a.remeasure&&U>0){var Y=1e3*l.measureText(W).width/i*c;if(U<Y&&this.isFontSubpixelAAEnabled){var X=U/Y;j=!0;l.save();l.scale(X,1);B/=X}else U!==Y&&(B+=(U-Y)/2e3*i/c)}if(this.contentVisible&&(D.isInFont||a.missingFile))if(b&&!H)l.fillText(W,B,z);else{this.paintChar(W,B,z,o);if(H){var $=B+i*H.offset.x/c,J=z-i*H.offset.y/c;this.paintChar(H.fontChar,$,J,o)}}L+=_?U*m-N*d:U*m+N*d;j&&l.restore()}else L+=y*D*i/1e3}_?r.y-=L:r.x+=L*p;l.restore();this.compose()}}}},{key:"showType3Text",value:function showType3Text(t){var r,a,i,l,c=this.ctx,u=this.current,h=u.font,d=u.fontSize,p=u.fontDirection,v=h.vertical?1:-1,_=u.charSpacing,y=u.wordSpacing,g=u.textHScale*p,m=u.fontMatrix||o,b=t.length;if(!(u.textRenderingMode===S)&&0!==d){this._cachedScaleForStroking[0]=-1;this._cachedGetSinglePixelWidth=null;c.save();c.transform.apply(c,canvas_toConsumableArray(u.textMatrix));c.translate(u.x,u.y);c.scale(g,p);for(r=0;r<b;++r)if("number"!=typeof(a=t[r])){var w=(a.isSpace?y:0)+_,P=h.charProcOperatorList[a.operatorListId];if(P){if(this.contentVisible){this.processingType3=a;this.save();c.scale(d,d);c.transform.apply(c,canvas_toConsumableArray(m));this.executeOperatorList(P);this.restore()}i=fe.applyTransform([a.width,0],m)[0]*d+w;c.translate(i,0);u.x+=i*g}else warn('Type3 character "'.concat(a.operatorListId,'" is not available.'))}else{l=v*a*d/1e3;this.ctx.translate(l,0);u.x+=l*g}c.restore();this.processingType3=null}}},{key:"setCharWidth",value:function setCharWidth(t,r){}},{key:"setCharWidthAndBounds",value:function setCharWidthAndBounds(t,r,a,i,o,l){this.ctx.rect(a,i,o-a,l-i);this.ctx.clip();this.endPath()}},{key:"getColorN_Pattern",value:function getColorN_Pattern(t){var r,a=this;if("TilingPattern"===t[0]){var i=t[1],o=this.baseTransform||getCurrentTransform(this.ctx),l={createCanvasGraphics:function createCanvasGraphics(t){return new CanvasGraphics(t,a.commonObjs,a.objs,a.canvasFactory,a.filterFactory,{optionalContentConfig:a.optionalContentConfig,markedContentStack:a.markedContentStack})}};r=new Un(t,i,this.ctx,l,o)}else r=this._getPattern(t[1],t[2]);return r}},{key:"setStrokeColorN",value:function setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}},{key:"setFillColorN",value:function setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments);this.current.patternFill=!0}},{key:"setStrokeRGBColor",value:function setStrokeRGBColor(t,r,a){var i=fe.makeHexColor(t,r,a);this.ctx.strokeStyle=i;this.current.strokeColor=i}},{key:"setFillRGBColor",value:function setFillRGBColor(t,r,a){var i=fe.makeHexColor(t,r,a);this.ctx.fillStyle=i;this.current.fillColor=i;this.current.patternFill=!1}},{key:"_getPattern",value:function _getPattern(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.cachedPatterns.has(t))r=this.cachedPatterns.get(t);else{r=function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new Nn(t);case"Mesh":return new Wn(t);case"Dummy":return new Hn}throw new Error("Unknown IR type: ".concat(t[0]))}(this.getObject(t));this.cachedPatterns.set(t,r)}a&&(r.matrix=a);return r}},{key:"shadingFill",value:function shadingFill(t){if(this.contentVisible){var r=this.ctx;this.save();var a=this._getPattern(t);r.fillStyle=a.getPattern(r,this,getCurrentTransformInverse(r),Dn);var i=getCurrentTransformInverse(r);if(i){var o=r.canvas,l=o.width,c=o.height,u=canvas_slicedToArray(fe.getAxialAlignedBoundingBox([0,0,l,c],i),4),h=u[0],d=u[1],p=u[2],v=u[3];this.ctx.fillRect(h,d,p-h,v-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox());this.restore()}}},{key:"beginInlineImage",value:function beginInlineImage(){unreachable("Should not call beginInlineImage")}},{key:"beginImageData",value:function beginImageData(){unreachable("Should not call beginImageData")}},{key:"paintFormXObjectBegin",value:function paintFormXObjectBegin(t,r){if(this.contentVisible){this.save();this.baseTransformStack.push(this.baseTransform);Array.isArray(t)&&6===t.length&&this.transform.apply(this,canvas_toConsumableArray(t));this.baseTransform=getCurrentTransform(this.ctx);if(r){var a=r[2]-r[0],i=r[3]-r[1];this.ctx.rect(r[0],r[1],a,i);this.current.updateRectMinMax(getCurrentTransform(this.ctx),r);this.clip();this.endPath()}}}},{key:"paintFormXObjectEnd",value:function paintFormXObjectEnd(){if(this.contentVisible){this.restore();this.baseTransform=this.baseTransformStack.pop()}}},{key:"beginGroup",value:function beginGroup(t){if(this.contentVisible){this.save();if(this.inSMaskMode){this.endSMaskMode();this.current.activeSMask=null}var r=this.ctx;t.isolated||info("TODO: Support non-isolated groups.");t.knockout&&warn("Knockout groups not supported.");var a=getCurrentTransform(r);t.matrix&&r.transform.apply(r,canvas_toConsumableArray(t.matrix));if(!t.bbox)throw new Error("Bounding box is required.");var i=fe.getAxialAlignedBoundingBox(t.bbox,getCurrentTransform(r)),o=[0,0,r.canvas.width,r.canvas.height];i=fe.intersect(i,o)||[0,0,0,0];var l=Math.floor(i[0]),c=Math.floor(i[1]),u=Math.max(Math.ceil(i[2])-l,1),h=Math.max(Math.ceil(i[3])-c,1),d=1,p=1;if(u>qn){d=u/qn;u=qn}if(h>qn){p=h/qn;h=qn}this.current.startNewPathAndClipBox([0,0,u,h]);var v="groupAt"+this.groupLevel;t.smask&&(v+="_smask_"+this.smaskCounter++%2);var _=this.cachedCanvases.getCanvas(v,u,h),y=_.context;y.scale(1/d,1/p);y.translate(-l,-c);y.transform.apply(y,canvas_toConsumableArray(a));if(t.smask)this.smaskStack.push({canvas:_.canvas,context:y,offsetX:l,offsetY:c,scaleX:d,scaleY:p,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null});else{r.setTransform(1,0,0,1,0,0);r.translate(l,c);r.scale(d,p);r.save()}copyCtxState(r,y);this.ctx=y;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(r);this.groupLevel++}}},{key:"endGroup",value:function endGroup(t){if(this.contentVisible){this.groupLevel--;var r=this.ctx,a=this.groupStack.pop();this.ctx=a;this.ctx.imageSmoothingEnabled=!1;if(t.smask){this.tempSMask=this.smaskStack.pop();this.restore()}else{var i;this.ctx.restore();var o=getCurrentTransform(this.ctx);this.restore();this.ctx.save();(i=this.ctx).setTransform.apply(i,canvas_toConsumableArray(o));var l=fe.getAxialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],o);this.ctx.drawImage(r.canvas,0,0);this.ctx.restore();this.compose(l)}}}},{key:"beginAnnotation",value:function beginAnnotation(t,r,a,i,o){canvas_classPrivateMethodGet(this,Zn,_restoreInitialState2).call(this);resetCtxToDefault(this.ctx);this.ctx.save();this.save();if(this.baseTransform){var l;(l=this.ctx).setTransform.apply(l,canvas_toConsumableArray(this.baseTransform))}if(Array.isArray(r)&&4===r.length){var c=r[2]-r[0],u=r[3]-r[1];if(o&&this.annotationCanvasMap){(a=a.slice())[4]-=r[0];a[5]-=r[1];(r=r.slice())[0]=r[1]=0;r[2]=c;r[3]=u;var h=canvas_slicedToArray(fe.singularValueDecompose2dScale(getCurrentTransform(this.ctx)),2),d=h[0],p=h[1],v=this.viewportScale,_=Math.ceil(c*this.outputScaleX*v),y=Math.ceil(u*this.outputScaleY*v);this.annotationCanvas=this.canvasFactory.create(_,y);var g=this.annotationCanvas,m=g.canvas,b=g.context;this.annotationCanvasMap.set(t,m);this.annotationCanvas.savedCtx=this.ctx;this.ctx=b;this.ctx.save();this.ctx.setTransform(d,0,0,-p,0,u*p);resetCtxToDefault(this.ctx)}else{resetCtxToDefault(this.ctx);this.ctx.rect(r[0],r[1],c,u);this.ctx.clip();this.endPath()}}this.current=new Yn(this.ctx.canvas.width,this.ctx.canvas.height);this.transform.apply(this,canvas_toConsumableArray(a));this.transform.apply(this,canvas_toConsumableArray(i))}},{key:"endAnnotation",value:function endAnnotation(){if(this.annotationCanvas){this.ctx.restore();canvas_classPrivateMethodGet(this,ea,_drawFilter2).call(this);this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}}},{key:"paintImageMaskXObject",value:function paintImageMaskXObject(t){if(this.contentVisible){var r=t.count;(t=this.getObject(t.data,t)).count=r;var a=this.ctx,i=this.processingType3;if(i){void 0===i.compiled&&(i.compiled=function compileType3Glyph(t){var r=t.width,a=t.height;if(r>1e3||a>1e3)return null;var i,o,l,c,u=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),h=r+1,d=new Uint8Array(h*(a+1)),p=r+7&-8,v=new Uint8Array(p*a),_=0,y=canvas_createForOfIteratorHelper(t.data);try{for(y.s();!(c=y.n()).done;)for(var g=c.value,m=128;m>0;){v[_++]=g&m?0:255;m>>=1}}catch(t){y.e(t)}finally{y.f()}var b=0;if(0!==v[_=0]){d[0]=1;++b}for(o=1;o<r;o++){if(v[_]!==v[_+1]){d[o]=v[_]?2:1;++b}_++}if(0!==v[_]){d[o]=2;++b}for(i=1;i<a;i++){l=i*h;if(v[(_=i*p)-p]!==v[_]){d[l]=v[_]?1:8;++b}var w=(v[_]?4:0)+(v[_-p]?8:0);for(o=1;o<r;o++){if(u[w=(w>>2)+(v[_+1]?4:0)+(v[_-p+1]?8:0)]){d[l+o]=u[w];++b}_++}if(v[_-p]!==v[_]){d[l+o]=v[_]?2:4;++b}if(b>1e3)return null}l=i*h;if(0!==v[_=p*(a-1)]){d[l]=8;++b}for(o=1;o<r;o++){if(v[_]!==v[_+1]){d[l+o]=v[_]?4:8;++b}_++}if(0!==v[_]){d[l+o]=4;++b}if(b>1e3)return null;var P=new Int32Array([0,h,-1,0,-h,0,0,0,1]),k=new Path2D;for(i=0;b&&i<=a;i++){for(var S=i*h,A=S+r;S<A&&!d[S];)S++;if(S!==A){k.moveTo(S%h,i);var x=S,E=d[S];do{var I=P[E];do{S+=I}while(!d[S]);var T=d[S];if(5!==T&&10!==T){E=T;d[S]=0}else{E=T&51*E>>4;d[S]&=E>>2|E<<2}k.lineTo(S%h,S/h|0);d[S]||--b}while(x!==S);--i}}v=null;d=null;return function drawOutline(t){t.save();t.scale(1/r,-1/a);t.translate(0,-a);t.fill(k);t.beginPath();t.restore()}}(t));if(i.compiled){i.compiled(a);return}}var o=this._createMaskCanvas(t),l=o.canvas;a.save();a.setTransform(1,0,0,1,0,0);a.drawImage(l,o.offsetX,o.offsetY);a.restore();this.compose()}}},{key:"paintImageMaskXObjectRepeat",value:function paintImageMaskXObjectRepeat(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,l=arguments.length>5?arguments[5]:void 0;if(this.contentVisible){t=this.getObject(t.data,t);var c=this.ctx;c.save();var u=getCurrentTransform(c);c.transform(r,a,i,o,0,0);var h=this._createMaskCanvas(t);c.setTransform(1,0,0,1,h.offsetX-u[4],h.offsetY-u[5]);for(var d=0,p=l.length;d<p;d+=2){var v=fe.transform(u,[r,a,i,o,l[d],l[d+1]]),_=canvas_slicedToArray(fe.applyTransform([0,0],v),2),y=_[0],g=_[1];c.drawImage(h.canvas,y,g)}c.restore();this.compose()}}},{key:"paintImageMaskXObjectGroup",value:function paintImageMaskXObjectGroup(t){if(this.contentVisible){var r,a=this.ctx,i=this.current.fillColor,o=this.current.patternFill,l=canvas_createForOfIteratorHelper(t);try{for(l.s();!(r=l.n()).done;){var c=r.value,u=c.data,h=c.width,d=c.height,p=c.transform,v=this.cachedCanvases.getCanvas("maskCanvas",h,d),_=v.context;_.save();putBinaryImageMask(_,this.getObject(u,c));_.globalCompositeOperation="source-in";_.fillStyle=o?i.getPattern(_,this,getCurrentTransformInverse(a),Rn):i;_.fillRect(0,0,h,d);_.restore();a.save();a.transform.apply(a,canvas_toConsumableArray(p));a.scale(1,-1);drawImageAtIntegerCoords(a,v.canvas,0,0,h,d,0,-1,1,1);a.restore()}}catch(t){l.e(t)}finally{l.f()}this.compose()}}},{key:"paintImageXObject",value:function paintImageXObject(t){if(this.contentVisible){var r=this.getObject(t);r?this.paintInlineImageXObject(r):warn("Dependent image isn't ready yet")}}},{key:"paintImageXObjectRepeat",value:function paintImageXObjectRepeat(t,r,a,i){if(this.contentVisible){var o=this.getObject(t);if(o){for(var l=o.width,c=o.height,u=[],h=0,d=i.length;h<d;h+=2)u.push({transform:[r,0,0,a,i[h],i[h+1]],x:0,y:0,w:l,h:c});this.paintInlineImageXObjectGroup(o,u)}else warn("Dependent image isn't ready yet")}}},{key:"applyTransferMapsToCanvas",value:function applyTransferMapsToCanvas(t){if("none"!==this.current.transferMaps){t.filter=this.current.transferMaps;t.drawImage(t.canvas,0,0);t.filter="none"}return t.canvas}},{key:"applyTransferMapsToBitmap",value:function applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;var r=t.bitmap,a=t.width,i=t.height,o=this.cachedCanvases.getCanvas("inlineImage",a,i),l=o.context;l.filter=this.current.transferMaps;l.drawImage(r,0,0);l.filter="none";return o.canvas}},{key:"paintInlineImageXObject",value:function paintInlineImageXObject(t){if(this.contentVisible){var a,i=t.width,o=t.height,l=this.ctx;this.save();if(!r){var c=l.filter;"none"!==c&&""!==c&&(l.filter="none")}l.scale(1/i,-1/o);if(t.bitmap)a=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)a=t;else{var u=this.cachedCanvases.getCanvas("inlineImage",i,o).context;putBinaryImageData(u,t);a=this.applyTransferMapsToCanvas(u)}var h=this._scaleImage(a,getCurrentTransformInverse(l));l.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(l),t.interpolate);drawImageAtIntegerCoords(l,h.img,0,0,h.paintWidth,h.paintHeight,0,-o,i,o);this.compose();this.restore()}}},{key:"paintInlineImageXObjectGroup",value:function paintInlineImageXObjectGroup(t,r){if(this.contentVisible){var a,i=this.ctx;if(t.bitmap)a=t.bitmap;else{var o=t.width,l=t.height,c=this.cachedCanvases.getCanvas("inlineImage",o,l).context;putBinaryImageData(c,t);a=this.applyTransferMapsToCanvas(c)}var u,h=canvas_createForOfIteratorHelper(r);try{for(h.s();!(u=h.n()).done;){var d=u.value;i.save();i.transform.apply(i,canvas_toConsumableArray(d.transform));i.scale(1,-1);drawImageAtIntegerCoords(i,a,d.x,d.y,d.w,d.h,0,-1,1,1);i.restore()}}catch(t){h.e(t)}finally{h.f()}this.compose()}}},{key:"paintSolidColorImageMask",value:function paintSolidColorImageMask(){if(this.contentVisible){this.ctx.fillRect(0,0,1,1);this.compose()}}},{key:"markPoint",value:function markPoint(t){}},{key:"markPointProps",value:function markPointProps(t,r){}},{key:"beginMarkedContent",value:function beginMarkedContent(t){this.markedContentStack.push({visible:!0})}},{key:"beginMarkedContentProps",value:function beginMarkedContentProps(t,r){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0});this.contentVisible=this.isContentVisible()}},{key:"endMarkedContent",value:function endMarkedContent(){this.markedContentStack.pop();this.contentVisible=this.isContentVisible()}},{key:"beginCompat",value:function beginCompat(){}},{key:"endCompat",value:function endCompat(){}},{key:"consumePath",value:function consumePath(t){var r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath();this.pendingClip||this.compose(t);var a=this.ctx;if(this.pendingClip){r||(this.pendingClip===Qn?a.clip("evenodd"):a.clip());this.pendingClip=null}this.current.startNewPathAndClipBox(this.current.clipBox);a.beginPath()}},{key:"getSinglePixelWidth",value:function getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){var t=getCurrentTransform(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{var r=Math.abs(t[0]*t[3]-t[2]*t[1]),a=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(a,i)/r}}return this._cachedGetSinglePixelWidth}},{key:"getScaleForStroking",value:function getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){var t,r,a=this.current.lineWidth,i=this.ctx.getTransform(),o=i.a,l=i.b,c=i.c,u=i.d;if(0===l&&0===c){var h=Math.abs(o),d=Math.abs(u);if(h===d)if(0===a)t=r=1/h;else{var p=h*a;t=r=p<1?1/p:1}else if(0===a){t=1/h;r=1/d}else{var v=h*a,_=d*a;t=v<1?1/v:1;r=_<1?1/_:1}}else{var y=Math.abs(o*u-l*c),g=Math.hypot(o,l),m=Math.hypot(c,u);if(0===a){t=m/y;r=g/y}else{var b=a*y;t=m>b?m/b:1;r=g>b?g/b:1}}this._cachedScaleForStroking[0]=t;this._cachedScaleForStroking[1]=r}return this._cachedScaleForStroking}},{key:"rescaleAndStroke",value:function rescaleAndStroke(t){var r=this.ctx,a=this.current.lineWidth,i=canvas_slicedToArray(this.getScaleForStroking(),2),o=i[0],l=i[1];r.lineWidth=a||1;if(1!==o||1!==l){var c=r.getLineDash();t&&r.save();r.scale(o,l);if(c.length>0){var u=Math.max(o,l);r.setLineDash(c.map((function(t){return t/u})));r.lineDashOffset/=u}r.stroke();t&&r.restore()}else r.stroke()}},{key:"isContentVisible",value:function isContentVisible(){for(var t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}]);return CanvasGraphics}();function _restoreInitialState2(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore();if(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 _drawFilter2(){if(this.pageColors){var t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){var r=this.ctx.filter;this.ctx.filter=t;this.ctx.drawImage(this.ctx.canvas,0,0);this.ctx.filter=r}}}for(var ra in ee)void 0!==ta.prototype[ra]&&(ta.prototype[ee[ra]]=ta.prototype[ra]);function text_layer_typeof(t){return text_layer_typeof="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},text_layer_typeof(t)}function text_layer_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,text_layer_toPropertyKey(i.key),i)}}function text_layer_toPropertyKey(t){var r=function text_layer_toPrimitive(t,r){if("object"!=text_layer_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=text_layer_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==text_layer_typeof(r)?r:String(r)}function text_layer_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function text_layer_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return text_layer_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return text_layer_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function text_layer_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}var na=30,aa=.8,ia=new Map,oa=null;function getCtx(){if(!oa){var t=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0,alpha:!1}:{alpha:!1},r=document.createElement("canvas");r.className="hiddenCanvasElement";document.body.append(r);oa=r.getContext("2d",t)}return oa}function cleanupTextLayer(){var t;null===(t=oa)||void 0===t||t.canvas.remove();oa=null}function appendText(t,r,a){var i=document.createElement("span"),o={angle:0,canvasWidth:0,hasText:""!==r.str,hasEOL:r.hasEOL,fontSize:0};t._textDivs.push(i);var l=fe.transform(t._transform,r.transform),c=Math.atan2(l[1],l[0]),u=a[r.fontName];u.vertical&&(c+=Math.PI/2);var h,d,p=t._fontInspectorEnabled&&u.fontSubstitution||u.fontFamily,v=Math.hypot(l[2],l[3]),_=v*function getAscent(t){var r=ia.get(t);if(r)return r;var a=getCtx(),i=a.font;a.canvas.width=a.canvas.height=na;a.font="".concat(na,"px ").concat(t);var o=a.measureText(""),l=null==o?void 0:o.fontBoundingBoxAscent,c=Math.abs(null==o?void 0:o.fontBoundingBoxDescent);if(l){var u=l/(l+c);ia.set(t,u);a.canvas.width=a.canvas.height=0;a.font=i;return u}a.strokeStyle="red";a.clearRect(0,0,na,na);a.strokeText("g",0,0);var h=a.getImageData(0,0,na,na).data;c=0;for(var d=h.length-1-3;d>=0;d-=4)if(h[d]>0){c=Math.ceil(d/4/na);break}a.clearRect(0,0,na,na);a.strokeText("A",0,na);l=0;for(var p=0,v=(h=a.getImageData(0,0,na,na).data).length;p<v;p+=4)if(h[p]>0){l=na-Math.floor(p/4/na);break}a.canvas.width=a.canvas.height=0;a.font=i;if(l){var _=l/(l+c);ia.set(t,_);return _}ia.set(t,aa);return aa}(p);if(0===c){h=l[4];d=l[5]-_}else{h=l[4]+_*Math.sin(c);d=l[5]-_*Math.cos(c)}var y="calc(var(--scale-factor)*",g=i.style;if(t._container===t._rootContainer){g.left="".concat((100*h/t._pageWidth).toFixed(2),"%");g.top="".concat((100*d/t._pageHeight).toFixed(2),"%")}else{g.left="".concat(y).concat(h.toFixed(2),"px)");g.top="".concat(y).concat(d.toFixed(2),"px)")}g.fontSize="".concat(y).concat(v.toFixed(2),"px)");g.fontFamily=p;o.fontSize=v;i.setAttribute("role","presentation");i.textContent=r.str;i.dir=r.dir;t._fontInspectorEnabled&&(i.dataset.fontName=u.fontSubstitutionLoadedName||r.fontName);0!==c&&(o.angle=c*(180/Math.PI));var m=!1;if(r.str.length>1)m=!0;else if(" "!==r.str&&r.transform[0]!==r.transform[3]){var b=Math.abs(r.transform[0]),w=Math.abs(r.transform[3]);b!==w&&Math.max(b,w)/Math.min(b,w)>1.5&&(m=!0)}m&&(o.canvasWidth=u.vertical?r.height:r.width);t._textDivProperties.set(i,o);t._isReadableStream&&t._layoutText(i)}function layout(t){var r=t.div,a=t.scale,i=t.properties,o=t.ctx,l=t.prevFontSize,c=t.prevFontFamily,u=r.style,h="";if(0!==i.canvasWidth&&i.hasText){var d=u.fontFamily,p=i.canvasWidth,v=i.fontSize;if(l!==v||c!==d){o.font="".concat(v*a,"px ").concat(d);t.prevFontSize=v;t.prevFontFamily=d}try{var _=o.measureText(r.textContent).width;_>0&&(h="scaleX(".concat(p*a/_,")"))}catch(t){}}0!==i.angle&&(h="rotate(".concat(i.angle,"deg) ").concat(h));h.length>0&&(u.transform=h)}var sa=function(){function TextLayerRenderTask(t){var r,a=this,i=t.textContentSource,o=t.container,l=t.viewport,c=t.textDivs,u=t.textDivProperties,h=t.textContentItemsStr;!function text_layer_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,TextLayerRenderTask);this._textContentSource=i;this._isReadableStream=i instanceof ReadableStream;this._container=this._rootContainer=o;this._textDivs=c||[];this._textContentItemsStr=h||[];this._fontInspectorEnabled=!(null===(r=globalThis.FontInspector)||void 0===r||!r.enabled);this._reader=null;this._textDivProperties=u||new WeakMap;this._canceled=!1;this._capability=new ve;this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:l.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:getCtx()};var d=l.rawDims,p=d.pageWidth,v=d.pageHeight,_=d.pageX,y=d.pageY;this._transform=[1,0,0,-1,-_,y+v];this._pageWidth=p;this._pageHeight=v;setLayerDimensions(o,l);this._capability.promise.finally((function(){a._layoutTextParams=null})).catch((function(){}))}!function text_layer_createClass(t,r,a){r&&text_layer_defineProperties(t.prototype,r);a&&text_layer_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(TextLayerRenderTask,[{key:"promise",get:function get(){return this._capability.promise}},{key:"cancel",value:function cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new ue("TextLayer task cancelled.")).catch((function(){}));this._reader=null}this._capability.reject(new ue("TextLayer task cancelled."))}},{key:"_processItems",value:function _processItems(t,r){var a,i=text_layer_createForOfIteratorHelper(t);try{for(i.s();!(a=i.n()).done;){var o=a.value;if(void 0!==o.str){this._textContentItemsStr.push(o.str);appendText(this,o,r)}else if("beginMarkedContentProps"===o.type||"beginMarkedContent"===o.type){var l=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");null!==o.id&&this._container.setAttribute("id","".concat(o.id));l.append(this._container)}else"endMarkedContent"===o.type&&(this._container=this._container.parentNode)}}catch(t){i.e(t)}finally{i.f()}}},{key:"_layoutText",value:function _layoutText(t){var r=this._layoutTextParams.properties=this._textDivProperties.get(t);this._layoutTextParams.div=t;layout(this._layoutTextParams);r.hasText&&this._container.append(t);if(r.hasEOL){var a=document.createElement("br");a.setAttribute("role","presentation");this._container.append(a)}}},{key:"_render",value:function _render(){var t=this,r=new ve,a=Object.create(null);if(this._isReadableStream){this._reader=this._textContentSource.getReader();!function pump(){t._reader.read().then((function(i){var o=i.value;if(i.done)r.resolve();else{Object.assign(a,o.styles);t._processItems(o.items,a);pump()}}),r.reject)}()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');var i=this._textContentSource,o=i.items,l=i.styles;this._processItems(o,l);r.resolve()}r.promise.then((function(){a=null;!function render(t){if(!t._canceled){var r=t._textDivs,a=t._capability;if(r.length>1e5)a.resolve();else{if(!t._isReadableStream){var i,o=text_layer_createForOfIteratorHelper(r);try{for(o.s();!(i=o.n()).done;){var l=i.value;t._layoutText(l)}}catch(t){o.e(t)}finally{o.f()}}a.resolve()}}}(t)}),this._capability.reject)}}]);return TextLayerRenderTask}();function renderTextLayer(t){var r=new sa(t);r._render();return r}function updateTextLayer(t){var r=t.container,a=t.viewport,i=t.textDivs,o=t.textDivProperties,l=t.mustRotate,c=void 0===l||l,u=t.mustRescale,h=void 0===u||u;c&&setLayerDimensions(r,{rotation:a.rotation});if(h){var d,p=getCtx(),v={prevFontSize:null,prevFontFamily:null,div:null,scale:a.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:p},_=text_layer_createForOfIteratorHelper(i);try{for(_.s();!(d=_.n()).done;){var y=d.value;v.properties=o.get(y);v.div=y;layout(v)}}catch(t){_.e(t)}finally{_.f()}}}function worker_options_typeof(t){return worker_options_typeof="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},worker_options_typeof(t)}function worker_options_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,worker_options_toPropertyKey(i.key),i)}}function worker_options_toPropertyKey(t){var r=function worker_options_toPrimitive(t,r){if("object"!=worker_options_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=worker_options_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==worker_options_typeof(r)?r:String(r)}function _classStaticPrivateFieldSpecSet(t,r,a,i){worker_options_classCheckPrivateStaticAccess(t,r);_classCheckPrivateStaticFieldDescriptor(a,"set");!function worker_options_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,a,i);return i}function _classStaticPrivateFieldSpecGet(t,r,a){worker_options_classCheckPrivateStaticAccess(t,r);_classCheckPrivateStaticFieldDescriptor(a,"get");return function worker_options_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,a)}function _classCheckPrivateStaticFieldDescriptor(t,r){if(void 0===t)throw new TypeError("attempted to "+r+" private static field before its declaration")}function worker_options_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}var la=function(){function GlobalWorkerOptions(){!function worker_options_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,GlobalWorkerOptions)}!function worker_options_createClass(t,r,a){r&&worker_options_defineProperties(t.prototype,r);a&&worker_options_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(GlobalWorkerOptions,null,[{key:"workerPort",get:function get(){return _classStaticPrivateFieldSpecGet(this,GlobalWorkerOptions,ca)},set:function set(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");_classStaticPrivateFieldSpecSet(this,GlobalWorkerOptions,ca,t)}},{key:"workerSrc",get:function get(){return _classStaticPrivateFieldSpecGet(this,GlobalWorkerOptions,ua)},set:function set(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");_classStaticPrivateFieldSpecSet(this,GlobalWorkerOptions,ua,t)}}]);return GlobalWorkerOptions}(),ca={writable:!0,value:null},ua={writable:!0,value:""};__webpack_require__(1195);function message_handler_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */message_handler_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==message_handler_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(message_handler_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function message_handler_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function message_handler_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,message_handler_toPropertyKey(i.key),i)}}function message_handler_toPropertyKey(t){var r=function message_handler_toPrimitive(t,r){if("object"!=message_handler_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=message_handler_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==message_handler_typeof(r)?r:String(r)}function message_handler_classPrivateMethodInitSpec(t,r){!function message_handler_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,r);r.add(t)}function message_handler_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function message_handler_typeof(t){return message_handler_typeof="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},message_handler_typeof(t)}var ha=1,da=2,fa=1,pa=2,va=3,_a=4,ya=5,ga=6,ma=7,ba=8;function wrapReason(t){t instanceof Error||"object"===message_handler_typeof(t)&&null!==t||unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new ue(t.message);case"MissingPDFException":return new se(t.message);case"PasswordException":return new ae(t.message,t.code);case"UnexpectedResponseException":return new le(t.message,t.status);case"UnknownErrorException":return new ie(t.message,t.details);default:return new ie(t.message,t.toString())}}var wa=new WeakSet,Pa=new WeakSet,ka=new WeakSet,Sa=function(){function MessageHandler(t,r,a){var i=this;!function message_handler_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,MessageHandler);message_handler_classPrivateMethodInitSpec(this,ka);message_handler_classPrivateMethodInitSpec(this,Pa);message_handler_classPrivateMethodInitSpec(this,wa);this.sourceName=t;this.targetName=r;this.comObj=a;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=function(t){var r=t.data;if(r.targetName===i.sourceName)if(r.stream)message_handler_classPrivateMethodGet(i,Pa,_processStreamMessage2).call(i,r);else if(r.callback){var o=r.callbackId,l=i.callbackCapabilities[o];if(!l)throw new Error("Cannot resolve callback ".concat(o));delete i.callbackCapabilities[o];if(r.callback===ha)l.resolve(r.data);else{if(r.callback!==da)throw new Error("Unexpected callback case");l.reject(wrapReason(r.reason))}}else{var c=i.actionHandler[r.action];if(!c)throw new Error("Unknown action from worker: ".concat(r.action));if(r.callbackId){var u=i.sourceName,h=r.sourceName;new Promise((function(t){t(c(r.data))})).then((function(t){a.postMessage({sourceName:u,targetName:h,callback:ha,callbackId:r.callbackId,data:t})}),(function(t){a.postMessage({sourceName:u,targetName:h,callback:da,callbackId:r.callbackId,reason:wrapReason(t)})}))}else r.streamId?message_handler_classPrivateMethodGet(i,wa,_createStreamSink2).call(i,r):c(r.data)}};a.addEventListener("message",this._onComObjOnMessage)}!function message_handler_createClass(t,r,a){r&&message_handler_defineProperties(t.prototype,r);a&&message_handler_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(MessageHandler,[{key:"on",value:function on(t,r){var a=this.actionHandler;if(a[t])throw new Error('There is already an actionName called "'.concat(t,'"'));a[t]=r}},{key:"send",value:function send(t,r,a){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:r},a)}},{key:"sendWithPromise",value:function sendWithPromise(t,r,a){var i=this.callbackId++,o=new ve;this.callbackCapabilities[i]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:r},a)}catch(t){o.reject(t)}return o.promise}},{key:"sendWithStream",value:function sendWithStream(t,r,a,i){var o=this,l=this.streamId++,c=this.sourceName,u=this.targetName,h=this.comObj;return new ReadableStream({start:function start(a){var d=new ve;o.streamControllers[l]={controller:a,startCall:d,pullCall:null,cancelCall:null,isClosed:!1};h.postMessage({sourceName:c,targetName:u,action:t,streamId:l,data:r,desiredSize:a.desiredSize},i);return d.promise},pull:function pull(t){var r=new ve;o.streamControllers[l].pullCall=r;h.postMessage({sourceName:c,targetName:u,stream:ga,streamId:l,desiredSize:t.desiredSize});return r.promise},cancel:function cancel(t){assert(t instanceof Error,"cancel must have a valid reason");var r=new ve;o.streamControllers[l].cancelCall=r;o.streamControllers[l].isClosed=!0;h.postMessage({sourceName:c,targetName:u,stream:fa,streamId:l,reason:wrapReason(t)});return r.promise}},a)}},{key:"destroy",value:function destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}]);return MessageHandler}();function _createStreamSink2(t){var r=t.streamId,a=this.sourceName,i=t.sourceName,o=this.comObj,l=this,c=this.actionHandler[t.action],u={enqueue:function enqueue(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,c=arguments.length>2?arguments[2]:void 0;if(!this.isCancelled){var u=this.desiredSize;this.desiredSize-=l;if(u>0&&this.desiredSize<=0){this.sinkCapability=new ve;this.ready=this.sinkCapability.promise}o.postMessage({sourceName:a,targetName:i,stream:_a,streamId:r,chunk:t},c)}},close:function close(){if(!this.isCancelled){this.isCancelled=!0;o.postMessage({sourceName:a,targetName:i,stream:va,streamId:r});delete l.streamSinks[r]}},error:function error(t){assert(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;o.postMessage({sourceName:a,targetName:i,stream:ya,streamId:r,reason:wrapReason(t)})}},sinkCapability:new ve,onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};u.sinkCapability.resolve();u.ready=u.sinkCapability.promise;this.streamSinks[r]=u;new Promise((function(r){r(c(t.data,u))})).then((function(){o.postMessage({sourceName:a,targetName:i,stream:ba,streamId:r,success:!0})}),(function(t){o.postMessage({sourceName:a,targetName:i,stream:ba,streamId:r,reason:wrapReason(t)})}))}function _processStreamMessage2(t){var r=t.streamId,a=this.sourceName,i=t.sourceName,o=this.comObj,l=this.streamControllers[r],c=this.streamSinks[r];switch(t.stream){case ba:t.success?l.startCall.resolve():l.startCall.reject(wrapReason(t.reason));break;case ma:t.success?l.pullCall.resolve():l.pullCall.reject(wrapReason(t.reason));break;case ga:if(!c){o.postMessage({sourceName:a,targetName:i,stream:ma,streamId:r,success:!0});break}c.desiredSize<=0&&t.desiredSize>0&&c.sinkCapability.resolve();c.desiredSize=t.desiredSize;new Promise((function(t){var r;t(null===(r=c.onPull)||void 0===r?void 0:r.call(c))})).then((function(){o.postMessage({sourceName:a,targetName:i,stream:ma,streamId:r,success:!0})}),(function(t){o.postMessage({sourceName:a,targetName:i,stream:ma,streamId:r,reason:wrapReason(t)})}));break;case _a:assert(l,"enqueue should have stream controller");if(l.isClosed)break;l.controller.enqueue(t.chunk);break;case va:assert(l,"close should have stream controller");if(l.isClosed)break;l.isClosed=!0;l.controller.close();message_handler_classPrivateMethodGet(this,ka,_deleteStreamController2).call(this,l,r);break;case ya:assert(l,"error should have stream controller");l.controller.error(wrapReason(t.reason));message_handler_classPrivateMethodGet(this,ka,_deleteStreamController2).call(this,l,r);break;case pa:t.success?l.cancelCall.resolve():l.cancelCall.reject(wrapReason(t.reason));message_handler_classPrivateMethodGet(this,ka,_deleteStreamController2).call(this,l,r);break;case fa:if(!c)break;new Promise((function(r){var a;r(null===(a=c.onCancel)||void 0===a?void 0:a.call(c,wrapReason(t.reason)))})).then((function(){o.postMessage({sourceName:a,targetName:i,stream:pa,streamId:r,success:!0})}),(function(t){o.postMessage({sourceName:a,targetName:i,stream:pa,streamId:r,reason:wrapReason(t)})}));c.sinkCapability.reject(wrapReason(t.reason));c.isCancelled=!0;delete this.streamSinks[r];break;default:throw new Error("Unexpected stream case")}}function _deleteStreamController2(t,r){return _deleteStreamController3.apply(this,arguments)}function _deleteStreamController3(){_deleteStreamController3=function message_handler_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){message_handler_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){message_handler_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}(message_handler_regeneratorRuntime().mark((function _callee(t,r){var a,i,o;return message_handler_regeneratorRuntime().wrap((function _callee$(l){for(;;)switch(l.prev=l.next){case 0:l.next=2;return Promise.allSettled([null===(a=t.startCall)||void 0===a?void 0:a.promise,null===(i=t.pullCall)||void 0===i?void 0:i.promise,null===(o=t.cancelCall)||void 0===o?void 0:o.promise]);case 2:delete this.streamControllers[r];case 3:case"end":return l.stop()}}),_callee,this)})));return _deleteStreamController3.apply(this,arguments)}function metadata_typeof(t){return metadata_typeof="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},metadata_typeof(t)}function metadata_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,metadata_toPropertyKey(i.key),i)}}function metadata_toPropertyKey(t){var r=function metadata_toPrimitive(t,r){if("object"!=metadata_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=metadata_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==metadata_typeof(r)?r:String(r)}function metadata_classPrivateFieldInitSpec(t,r,a){!function metadata_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,r);r.set(t,a)}function metadata_classPrivateFieldGet(t,r){return function metadata_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,metadata_classExtractFieldDescriptor(t,r,"get"))}function metadata_classPrivateFieldSet(t,r,a){!function metadata_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,metadata_classExtractFieldDescriptor(t,r,"set"),a);return a}function metadata_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var Fa=new WeakMap,Aa=new WeakMap,xa=function(){function Metadata(t){var r=t.parsedData,a=t.rawData;!function metadata_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,Metadata);metadata_classPrivateFieldInitSpec(this,Fa,{writable:!0,value:void 0});metadata_classPrivateFieldInitSpec(this,Aa,{writable:!0,value:void 0});metadata_classPrivateFieldSet(this,Fa,r);metadata_classPrivateFieldSet(this,Aa,a)}!function metadata_createClass(t,r,a){r&&metadata_defineProperties(t.prototype,r);a&&metadata_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(Metadata,[{key:"getRaw",value:function getRaw(){return metadata_classPrivateFieldGet(this,Aa)}},{key:"get",value:function get(t){var r;return null!==(r=metadata_classPrivateFieldGet(this,Fa).get(t))&&void 0!==r?r:null}},{key:"getAll",value:function getAll(){return objectFromMap(metadata_classPrivateFieldGet(this,Fa))}},{key:"has",value:function has(t){return metadata_classPrivateFieldGet(this,Fa).has(t)}}]);return Metadata}();function optional_content_config_typeof(t){return optional_content_config_typeof="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},optional_content_config_typeof(t)}function optional_content_config_slicedToArray(t,r){return function optional_content_config_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function optional_content_config_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||optional_content_config_unsupportedIterableToArray(t,r)||function optional_content_config_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function optional_content_config_toConsumableArray(t){return function optional_content_config_arrayWithoutHoles(t){if(Array.isArray(t))return optional_content_config_arrayLikeToArray(t)}(t)||function optional_content_config_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||optional_content_config_unsupportedIterableToArray(t)||function optional_content_config_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function optional_content_config_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=optional_content_config_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function optional_content_config_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return optional_content_config_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?optional_content_config_arrayLikeToArray(t,r):void 0}}function optional_content_config_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function optional_content_config_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function optional_content_config_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function optional_content_config_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,optional_content_config_toPropertyKey(i.key),i)}}function optional_content_config_createClass(t,r,a){r&&optional_content_config_defineProperties(t.prototype,r);a&&optional_content_config_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function optional_content_config_toPropertyKey(t){var r=function optional_content_config_toPrimitive(t,r){if("object"!=optional_content_config_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=optional_content_config_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==optional_content_config_typeof(r)?r:String(r)}function optional_content_config_classPrivateFieldInitSpec(t,r,a){optional_content_config_checkPrivateRedeclaration(t,r);r.set(t,a)}function optional_content_config_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function optional_content_config_classPrivateFieldSet(t,r,a){!function optional_content_config_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,optional_content_config_classExtractFieldDescriptor(t,r,"set"),a);return a}function optional_content_config_classPrivateFieldGet(t,r){return function optional_content_config_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,optional_content_config_classExtractFieldDescriptor(t,r,"get"))}function optional_content_config_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var Ea=Symbol("INTERNAL"),Ia=new WeakMap,Ta=function(){function OptionalContentGroup(t,r){optional_content_config_classCallCheck(this,OptionalContentGroup);optional_content_config_classPrivateFieldInitSpec(this,Ia,{writable:!0,value:!0});this.name=t;this.intent=r}optional_content_config_createClass(OptionalContentGroup,[{key:"visible",get:function get(){return optional_content_config_classPrivateFieldGet(this,Ia)}},{key:"_setVisible",value:function _setVisible(t,r){t!==Ea&&unreachable("Internal method `_setVisible` called.");optional_content_config_classPrivateFieldSet(this,Ia,r)}}]);return OptionalContentGroup}(),Ca=new WeakMap,Ma=new WeakMap,Ga=new WeakMap,Oa=new WeakMap,Ra=new WeakSet,La=function(){function OptionalContentConfig(t){optional_content_config_classCallCheck(this,OptionalContentConfig);!function optional_content_config_classPrivateMethodInitSpec(t,r){optional_content_config_checkPrivateRedeclaration(t,r);r.add(t)}(this,Ra);optional_content_config_classPrivateFieldInitSpec(this,Ca,{writable:!0,value:null});optional_content_config_classPrivateFieldInitSpec(this,Ma,{writable:!0,value:new Map});optional_content_config_classPrivateFieldInitSpec(this,Ga,{writable:!0,value:null});optional_content_config_classPrivateFieldInitSpec(this,Oa,{writable:!0,value:null});this.name=null;this.creator=null;if(null!==t){this.name=t.name;this.creator=t.creator;optional_content_config_classPrivateFieldSet(this,Oa,t.order);var r,a=optional_content_config_createForOfIteratorHelper(t.groups);try{for(a.s();!(r=a.n()).done;){var i=r.value;optional_content_config_classPrivateFieldGet(this,Ma).set(i.id,new Ta(i.name,i.intent))}}catch(t){a.e(t)}finally{a.f()}if("OFF"===t.baseState){var o,l=optional_content_config_createForOfIteratorHelper(optional_content_config_classPrivateFieldGet(this,Ma).values());try{for(l.s();!(o=l.n()).done;){o.value._setVisible(Ea,!1)}}catch(t){l.e(t)}finally{l.f()}}var c,u=optional_content_config_createForOfIteratorHelper(t.on);try{for(u.s();!(c=u.n()).done;){var h=c.value;optional_content_config_classPrivateFieldGet(this,Ma).get(h)._setVisible(Ea,!0)}}catch(t){u.e(t)}finally{u.f()}var d,p=optional_content_config_createForOfIteratorHelper(t.off);try{for(p.s();!(d=p.n()).done;){var v=d.value;optional_content_config_classPrivateFieldGet(this,Ma).get(v)._setVisible(Ea,!1)}}catch(t){p.e(t)}finally{p.f()}optional_content_config_classPrivateFieldSet(this,Ga,this.getHash())}}optional_content_config_createClass(OptionalContentConfig,[{key:"isVisible",value:function isVisible(t){if(0===optional_content_config_classPrivateFieldGet(this,Ma).size)return!0;if(!t){warn("Optional content group not defined.");return!0}if("OCG"===t.type){if(!optional_content_config_classPrivateFieldGet(this,Ma).has(t.id)){warn("Optional content group not found: ".concat(t.id));return!0}return optional_content_config_classPrivateFieldGet(this,Ma).get(t.id).visible}if("OCMD"===t.type){if(t.expression)return optional_content_config_classPrivateMethodGet(this,Ra,_evaluateVisibilityExpression2).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){var r,a=optional_content_config_createForOfIteratorHelper(t.ids);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(!optional_content_config_classPrivateFieldGet(this,Ma).has(i)){warn("Optional content group not found: ".concat(i));return!0}if(optional_content_config_classPrivateFieldGet(this,Ma).get(i).visible)return!0}}catch(t){a.e(t)}finally{a.f()}return!1}if("AllOn"===t.policy){var o,l=optional_content_config_createForOfIteratorHelper(t.ids);try{for(l.s();!(o=l.n()).done;){var c=o.value;if(!optional_content_config_classPrivateFieldGet(this,Ma).has(c)){warn("Optional content group not found: ".concat(c));return!0}if(!optional_content_config_classPrivateFieldGet(this,Ma).get(c).visible)return!1}}catch(t){l.e(t)}finally{l.f()}return!0}if("AnyOff"===t.policy){var u,h=optional_content_config_createForOfIteratorHelper(t.ids);try{for(h.s();!(u=h.n()).done;){var d=u.value;if(!optional_content_config_classPrivateFieldGet(this,Ma).has(d)){warn("Optional content group not found: ".concat(d));return!0}if(!optional_content_config_classPrivateFieldGet(this,Ma).get(d).visible)return!0}}catch(t){h.e(t)}finally{h.f()}return!1}if("AllOff"===t.policy){var p,v=optional_content_config_createForOfIteratorHelper(t.ids);try{for(v.s();!(p=v.n()).done;){var _=p.value;if(!optional_content_config_classPrivateFieldGet(this,Ma).has(_)){warn("Optional content group not found: ".concat(_));return!0}if(optional_content_config_classPrivateFieldGet(this,Ma).get(_).visible)return!1}}catch(t){v.e(t)}finally{v.f()}return!0}warn("Unknown optional content policy ".concat(t.policy,"."));return!0}warn("Unknown group type ".concat(t.type,"."));return!0}},{key:"setVisibility",value:function setVisibility(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(optional_content_config_classPrivateFieldGet(this,Ma).has(t)){optional_content_config_classPrivateFieldGet(this,Ma).get(t)._setVisible(Ea,!!r);optional_content_config_classPrivateFieldSet(this,Ca,null)}else warn("Optional content group not found: ".concat(t))}},{key:"hasInitialVisibility",get:function get(){return null===optional_content_config_classPrivateFieldGet(this,Ga)||this.getHash()===optional_content_config_classPrivateFieldGet(this,Ga)}},{key:"getOrder",value:function getOrder(){return optional_content_config_classPrivateFieldGet(this,Ma).size?optional_content_config_classPrivateFieldGet(this,Oa)?optional_content_config_classPrivateFieldGet(this,Oa).slice():optional_content_config_toConsumableArray(optional_content_config_classPrivateFieldGet(this,Ma).keys()):null}},{key:"getGroups",value:function getGroups(){return optional_content_config_classPrivateFieldGet(this,Ma).size>0?objectFromMap(optional_content_config_classPrivateFieldGet(this,Ma)):null}},{key:"getGroup",value:function getGroup(t){return optional_content_config_classPrivateFieldGet(this,Ma).get(t)||null}},{key:"getHash",value:function getHash(){if(null!==optional_content_config_classPrivateFieldGet(this,Ca))return optional_content_config_classPrivateFieldGet(this,Ca);var t,r=new gn,a=optional_content_config_createForOfIteratorHelper(optional_content_config_classPrivateFieldGet(this,Ma));try{for(a.s();!(t=a.n()).done;){var i=optional_content_config_slicedToArray(t.value,2),o=i[0],l=i[1];r.update("".concat(o,":").concat(l.visible))}}catch(t){a.e(t)}finally{a.f()}return optional_content_config_classPrivateFieldSet(this,Ca,r.hexdigest())}}]);return OptionalContentConfig}();function _evaluateVisibilityExpression2(t){var r=t.length;if(r<2)return!0;for(var a=t[0],i=1;i<r;i++){var o=t[i],l=void 0;if(Array.isArray(o))l=optional_content_config_classPrivateMethodGet(this,Ra,_evaluateVisibilityExpression2).call(this,o);else{if(!optional_content_config_classPrivateFieldGet(this,Ma).has(o)){warn("Optional content group not found: ".concat(o));return!0}l=optional_content_config_classPrivateFieldGet(this,Ma).get(o).visible}switch(a){case"And":if(!l)return!1;break;case"Or":if(l)return!0;break;case"Not":return!l;default:return!0}}return"And"===a}__webpack_require__(7195);function transport_stream_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */transport_stream_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==transport_stream_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(transport_stream_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function transport_stream_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function transport_stream_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){transport_stream_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){transport_stream_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function transport_stream_typeof(t){return transport_stream_typeof="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},transport_stream_typeof(t)}function transport_stream_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function transport_stream_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return transport_stream_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return transport_stream_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function transport_stream_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function transport_stream_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function transport_stream_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,transport_stream_toPropertyKey(i.key),i)}}function transport_stream_createClass(t,r,a){r&&transport_stream_defineProperties(t.prototype,r);a&&transport_stream_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function transport_stream_toPropertyKey(t){var r=function transport_stream_toPrimitive(t,r){if("object"!=transport_stream_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=transport_stream_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==transport_stream_typeof(r)?r:String(r)}var Da=function(){function PDFDataTransportStream(t,r){var a=this,i=r.disableRange,o=void 0!==i&&i,l=r.disableStream,c=void 0!==l&&l;transport_stream_classCallCheck(this,PDFDataTransportStream);assert(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');var u=t.length,h=t.initialData,d=t.progressiveDone,p=t.contentDispositionFilename;this._queuedChunks=[];this._progressiveDone=d;this._contentDispositionFilename=p;if((null==h?void 0:h.length)>0){var v=h instanceof Uint8Array&&h.byteLength===h.buffer.byteLength?h.buffer:new Uint8Array(h).buffer;this._queuedChunks.push(v)}this._pdfDataRangeTransport=t;this._isStreamingSupported=!c;this._isRangeSupported=!o;this._contentLength=u;this._fullRequestReader=null;this._rangeReaders=[];t.addRangeListener((function(t,r){a._onReceiveData({begin:t,chunk:r})}));t.addProgressListener((function(t,r){a._onProgress({loaded:t,total:r})}));t.addProgressiveReadListener((function(t){a._onReceiveData({chunk:t})}));t.addProgressiveDoneListener((function(){a._onProgressiveDone()}));t.transportReady()}transport_stream_createClass(PDFDataTransportStream,[{key:"_onReceiveData",value:function _onReceiveData(t){var r=t.begin,a=t.chunk,i=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;if(void 0===r)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{assert(this._rangeReaders.some((function(t){if(t._begin!==r)return!1;t._enqueue(i);return!0})),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}},{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}},{key:"_onProgress",value:function _onProgress(t){if(void 0===t.total){var r,a;null===(r=this._rangeReaders[0])||void 0===r||null===(a=r.onProgress)||void 0===a||a.call(r,{loaded:t.loaded})}else{var i,o;null===(i=this._fullRequestReader)||void 0===i||null===(o=i.onProgress)||void 0===o||o.call(i,{loaded:t.loaded,total:t.total})}}},{key:"_onProgressiveDone",value:function _onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone();this._progressiveDone=!0}},{key:"_removeRangeReader",value:function _removeRangeReader(t){var r=this._rangeReaders.indexOf(t);r>=0&&this._rangeReaders.splice(r,1)}},{key:"getFullReader",value:function getFullReader(){assert(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var t=this._queuedChunks;this._queuedChunks=null;return new ja(this,t,this._progressiveDone,this._contentDispositionFilename)}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=new Na(this,t,r);this._pdfDataRangeTransport.requestDataRange(t,r);this._rangeReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){var r;null===(r=this._fullRequestReader)||void 0===r||r.cancel(t);var a,i=transport_stream_createForOfIteratorHelper(this._rangeReaders.slice(0));try{for(i.s();!(a=i.n()).done;){a.value.cancel(t)}}catch(t){i.e(t)}finally{i.f()}this._pdfDataRangeTransport.abort()}}]);return PDFDataTransportStream}(),ja=function(){function PDFDataTransportStreamReader(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;transport_stream_classCallCheck(this,PDFDataTransportStreamReader);this._stream=t;this._done=a||!1;this._filename=isPdfFile(i)?i:null;this._queuedChunks=r||[];this._loaded=0;var o,l=transport_stream_createForOfIteratorHelper(this._queuedChunks);try{for(l.s();!(o=l.n()).done;){var c=o.value;this._loaded+=c.byteLength}}catch(t){l.e(t)}finally{l.f()}this._requests=[];this._headersReady=Promise.resolve();t._fullRequestReader=this;this.onProgress=null}transport_stream_createClass(PDFDataTransportStreamReader,[{key:"_enqueue",value:function _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}}},{key:"headersReady",get:function get(){return this._headersReady}},{key:"filename",get:function get(){return this._filename}},{key:"isRangeSupported",get:function get(){return this._stream._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._stream._isStreamingSupported}},{key:"contentLength",get:function get(){return this._stream._contentLength}},{key:"read",value:(t=transport_stream_asyncToGenerator(transport_stream_regeneratorRuntime().mark((function _callee(){var t,r;return transport_stream_regeneratorRuntime().wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:if(!(this._queuedChunks.length>0)){a.next=3;break}t=this._queuedChunks.shift();return a.abrupt("return",{value:t,done:!1});case 3:if(!this._done){a.next=5;break}return a.abrupt("return",{value:void 0,done:!0});case 5:r=new ve;this._requests.push(r);return a.abrupt("return",r.promise);case 8:case"end":return a.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;var r,a=transport_stream_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0}},{key:"progressiveDone",value:function progressiveDone(){this._done||(this._done=!0)}}]);var t;return PDFDataTransportStreamReader}(),Na=function(){function PDFDataTransportStreamRangeReader(t,r,a){transport_stream_classCallCheck(this,PDFDataTransportStreamRangeReader);this._stream=t;this._begin=r;this._end=a;this._queuedChunk=null;this._requests=[];this._done=!1;this.onProgress=null}transport_stream_createClass(PDFDataTransportStreamRangeReader,[{key:"_enqueue",value:function _enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});var r,a=transport_stream_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0}this._done=!0;this._stream._removeRangeReader(this)}}},{key:"isStreamingSupported",get:function get(){return!1}},{key:"read",value:(t=transport_stream_asyncToGenerator(transport_stream_regeneratorRuntime().mark((function _callee2(){var t,r;return transport_stream_regeneratorRuntime().wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._queuedChunk){a.next=4;break}t=this._queuedChunk;this._queuedChunk=null;return a.abrupt("return",{value:t,done:!1});case 4:if(!this._done){a.next=6;break}return a.abrupt("return",{value:void 0,done:!0});case 6:r=new ve;this._requests.push(r);return a.abrupt("return",r.promise);case 9:case"end":return a.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;var r,a=transport_stream_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._stream._removeRangeReader(this)}}]);var t;return PDFDataTransportStreamRangeReader}();function content_disposition_slicedToArray(t,r){return function content_disposition_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function content_disposition_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||function content_disposition_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return content_disposition_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return content_disposition_arrayLikeToArray(t,r)}(t,r)||function content_disposition_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function content_disposition_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function validateRangeRequestCapabilities(t){var r=t.getResponseHeader,a=t.isHttp,i=t.rangeChunkSize,o=t.disableRange,l={allowRangeRequests:!1,suggestedLength:void 0},c=parseInt(r("Content-Length"),10);if(!Number.isInteger(c))return l;l.suggestedLength=c;if(c<=2*i)return l;if(o||!a)return l;if("bytes"!==r("Accept-Ranges"))return l;if("identity"!==(r("Content-Encoding")||"identity"))return l;l.allowRangeRequests=!0;return l}function extractFilenameFromHeader(t){var r=t("Content-Disposition");if(r){var a=function getFilenameFromContentDispositionHeader(t){var r=!0,a=toParamRegExp("filename\\*","i").exec(t);if(a){var i=rfc2616unquote(a=a[1]);return fixupEncoding(i=rfc2047decode(i=rfc5987decode(i=unescape(i))))}if(a=function rfc2231getparam(t){for(var r,a=[],i=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");null!==(r=i.exec(t));){var o=content_disposition_slicedToArray(r,4),l=o[1],c=o[2],u=o[3];if((l=parseInt(l,10))in a){if(0===l)break}else a[l]=[c,u]}for(var h=[],d=0;d<a.length&&d in a;++d){var p=content_disposition_slicedToArray(a[d],2),v=p[0],_=p[1];_=rfc2616unquote(_);if(v){_=unescape(_);0===d&&(_=rfc5987decode(_))}h.push(_)}return h.join("")}(t))return fixupEncoding(rfc2047decode(a));if(a=toParamRegExp("filename","i").exec(t)){var o=rfc2616unquote(a=a[1]);return fixupEncoding(o=rfc2047decode(o))}function toParamRegExp(t,r){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',r)}function textdecode(t,a){if(t){if(!/^[\x00-\xFF]+$/.test(a))return a;try{var i=new TextDecoder(t,{fatal:!0}),o=stringToBytes(a);a=i.decode(o);r=!1}catch(t){}}return a}function fixupEncoding(t){if(r&&/[\x80-\xff]/.test(t)){t=textdecode("utf-8",t);r&&(t=textdecode("iso-8859-1",t))}return t}function rfc2616unquote(t){if(t.startsWith('"')){for(var r=t.slice(1).split('\\"'),a=0;a<r.length;++a){var i=r[a].indexOf('"');if(-1!==i){r[a]=r[a].slice(0,i);r.length=a+1}r[a]=r[a].replaceAll(/\\(.)/g,"$1")}t=r.join('"')}return t}function rfc5987decode(t){var r=t.indexOf("'");return-1===r?t:textdecode(t.slice(0,r),t.slice(r+1).replace(/^[^']*'/,""))}function rfc2047decode(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,r,a,i){if("q"===a||"Q"===a)return textdecode(r,i=(i=i.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,r){return String.fromCharCode(parseInt(r,16))})));try{i=atob(i)}catch(t){}return textdecode(r,i)}))}return""}(r);if(a.includes("%"))try{a=decodeURIComponent(a)}catch(t){}if(isPdfFile(a))return a}return null}function createResponseStatusError(t,r){return 404===t||0===t&&r.startsWith("file:")?new se('Missing PDF "'+r+'".'):new le("Unexpected server response (".concat(t,') while retrieving PDF "').concat(r,'".'),t)}function validateResponseStatus(t){return 200===t||206===t}function fetch_stream_typeof(t){return fetch_stream_typeof="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},fetch_stream_typeof(t)}function fetch_stream_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */fetch_stream_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==fetch_stream_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(fetch_stream_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function fetch_stream_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function fetch_stream_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){fetch_stream_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){fetch_stream_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function fetch_stream_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function fetch_stream_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return fetch_stream_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return fetch_stream_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function fetch_stream_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function fetch_stream_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function fetch_stream_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,fetch_stream_toPropertyKey(i.key),i)}}function fetch_stream_createClass(t,r,a){r&&fetch_stream_defineProperties(t.prototype,r);a&&fetch_stream_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function fetch_stream_toPropertyKey(t){var r=function fetch_stream_toPrimitive(t,r){if("object"!=fetch_stream_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=fetch_stream_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==fetch_stream_typeof(r)?r:String(r)}function createFetchOptions(t,r,a){return{method:"GET",headers:t,signal:a.signal,mode:"cors",credentials:r?"include":"same-origin",redirect:"follow"}}function createHeaders(t){var r=new Headers;for(var a in t){var i=t[a];void 0!==i&&r.append(a,i)}return r}function getArrayBuffer(t){if(t instanceof Uint8Array)return t.buffer;if(t instanceof ArrayBuffer)return t;warn("getArrayBuffer - unexpected data format: ".concat(t));return new Uint8Array(t).buffer}var Wa=function(){function PDFFetchStream(t){fetch_stream_classCallCheck(this,PDFFetchStream);this.source=t;this.isHttp=/^https?:/i.test(t.url);this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}fetch_stream_createClass(PDFFetchStream,[{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}},{key:"getFullReader",value:function getFullReader(){assert(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new Ha(this);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=new Ba(this,t,r);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){var r;null===(r=this._fullRequestReader)||void 0===r||r.cancel(t);var a,i=fetch_stream_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(i.s();!(a=i.n()).done;){a.value.cancel(t)}}catch(t){i.e(t)}finally{i.f()}}}]);return PDFFetchStream}(),Ha=function(){function PDFFetchStreamReader(t){var r=this;fetch_stream_classCallCheck(this,PDFFetchStreamReader);this._stream=t;this._reader=null;this._loaded=0;this._filename=null;var a=t.source;this._withCredentials=a.withCredentials||!1;this._contentLength=a.length;this._headersCapability=new ve;this._disableRange=a.disableRange||!1;this._rangeChunkSize=a.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._abortController=new AbortController;this._isStreamingSupported=!a.disableStream;this._isRangeSupported=!a.disableRange;this._headers=createHeaders(this._stream.httpHeaders);var i=a.url;fetch(i,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((function(t){if(!validateResponseStatus(t.status))throw createResponseStatusError(t.status,i);r._reader=t.body.getReader();r._headersCapability.resolve();var a=function getResponseHeader(r){return t.headers.get(r)},o=validateRangeRequestCapabilities({getResponseHeader:a,isHttp:r._stream.isHttp,rangeChunkSize:r._rangeChunkSize,disableRange:r._disableRange}),l=o.allowRangeRequests,c=o.suggestedLength;r._isRangeSupported=l;r._contentLength=c||r._contentLength;r._filename=extractFilenameFromHeader(a);!r._isStreamingSupported&&r._isRangeSupported&&r.cancel(new ue("Streaming is disabled."))})).catch(this._headersCapability.reject);this.onProgress=null}fetch_stream_createClass(PDFFetchStreamReader,[{key:"headersReady",get:function get(){return this._headersCapability.promise}},{key:"filename",get:function get(){return this._filename}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=fetch_stream_asyncToGenerator(fetch_stream_regeneratorRuntime().mark((function _callee(){var t,r,a,i;return fetch_stream_regeneratorRuntime().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:o.next=2;return this._headersCapability.promise;case 2:o.next=4;return this._reader.read();case 4:r=o.sent;a=r.value;if(!(i=r.done)){o.next=9;break}return o.abrupt("return",{value:a,done:i});case 9:this._loaded+=a.byteLength;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return o.abrupt("return",{value:getArrayBuffer(a),done:!1});case 12:case"end":return o.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){var r;null===(r=this._reader)||void 0===r||r.cancel(t);this._abortController.abort()}}]);var t;return PDFFetchStreamReader}(),Ba=function(){function PDFFetchStreamRangeReader(t,r,a){var i=this;fetch_stream_classCallCheck(this,PDFFetchStreamRangeReader);this._stream=t;this._reader=null;this._loaded=0;var o=t.source;this._withCredentials=o.withCredentials||!1;this._readCapability=new ve;this._isStreamingSupported=!o.disableStream;this._abortController=new AbortController;this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range","bytes=".concat(r,"-").concat(a-1));var l=o.url;fetch(l,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((function(t){if(!validateResponseStatus(t.status))throw createResponseStatusError(t.status,l);i._readCapability.resolve();i._reader=t.body.getReader()})).catch(this._readCapability.reject);this.onProgress=null}fetch_stream_createClass(PDFFetchStreamRangeReader,[{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=fetch_stream_asyncToGenerator(fetch_stream_regeneratorRuntime().mark((function _callee2(){var t,r,a,i;return fetch_stream_regeneratorRuntime().wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:o.next=2;return this._readCapability.promise;case 2:o.next=4;return this._reader.read();case 4:r=o.sent;a=r.value;if(!(i=r.done)){o.next=9;break}return o.abrupt("return",{value:a,done:i});case 9:this._loaded+=a.byteLength;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return o.abrupt("return",{value:getArrayBuffer(a),done:!1});case 12:case"end":return o.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){var r;null===(r=this._reader)||void 0===r||r.cancel(t);this._abortController.abort()}}]);var t;return PDFFetchStreamRangeReader}();function network_typeof(t){return network_typeof="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},network_typeof(t)}function network_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */network_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==network_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(network_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function network_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function network_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){network_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){network_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function network_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function network_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return network_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return network_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function network_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function network_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function network_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,network_toPropertyKey(i.key),i)}}function network_createClass(t,r,a){r&&network_defineProperties(t.prototype,r);a&&network_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function network_toPropertyKey(t){var r=function network_toPrimitive(t,r){if("object"!=network_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=network_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==network_typeof(r)?r:String(r)}var za,Ua,qa,Va,Ka=function(){function NetworkManager(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};network_classCallCheck(this,NetworkManager);this.url=t;this.isHttp=/^https?:/i.test(t);this.httpHeaders=this.isHttp&&r.httpHeaders||Object.create(null);this.withCredentials=r.withCredentials||!1;this.currXhrId=0;this.pendingRequests=Object.create(null)}network_createClass(NetworkManager,[{key:"requestRange",value:function requestRange(t,r,a){var i={begin:t,end:r};for(var o in a)i[o]=a[o];return this.request(i)}},{key:"requestFull",value:function requestFull(t){return this.request(t)}},{key:"request",value:function request(t){var r=new XMLHttpRequest,a=this.currXhrId++,i=this.pendingRequests[a]={xhr:r};r.open("GET",this.url);r.withCredentials=this.withCredentials;for(var o in this.httpHeaders){var l=this.httpHeaders[o];void 0!==l&&r.setRequestHeader(o,l)}if(this.isHttp&&"begin"in t&&"end"in t){r.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1));i.expectedStatus=206}else i.expectedStatus=200;r.responseType="arraybuffer";t.onError&&(r.onerror=function(a){t.onError(r.status)});r.onreadystatechange=this.onStateChange.bind(this,a);r.onprogress=this.onProgress.bind(this,a);i.onHeadersReceived=t.onHeadersReceived;i.onDone=t.onDone;i.onError=t.onError;i.onProgress=t.onProgress;r.send(null);return a}},{key:"onProgress",value:function onProgress(t,r){var a,i=this.pendingRequests[t];i&&(null===(a=i.onProgress)||void 0===a||a.call(i,r))}},{key:"onStateChange",value:function onStateChange(t,r){var a=this.pendingRequests[t];if(a){var i=a.xhr;if(i.readyState>=2&&a.onHeadersReceived){a.onHeadersReceived();delete a.onHeadersReceived}if(4===i.readyState&&t in this.pendingRequests){delete this.pendingRequests[t];if(0===i.status&&this.isHttp){var o;null===(o=a.onError)||void 0===o||o.call(a,i.status)}else{var l=i.status||200;if(200===l&&206===a.expectedStatus||l===a.expectedStatus){var c=function network_getArrayBuffer(t){var r=t.response;return"string"!=typeof r?r:stringToBytes(r).buffer}(i);if(206===l){var u=i.getResponseHeader("Content-Range"),h=/bytes (\d+)-(\d+)\/(\d+)/.exec(u);a.onDone({begin:parseInt(h[1],10),chunk:c})}else if(c)a.onDone({begin:0,chunk:c});else{var d;null===(d=a.onError)||void 0===d||d.call(a,i.status)}}else{var p;null===(p=a.onError)||void 0===p||p.call(a,i.status)}}}}}},{key:"getRequestXhr",value:function getRequestXhr(t){return this.pendingRequests[t].xhr}},{key:"isPendingRequest",value:function isPendingRequest(t){return t in this.pendingRequests}},{key:"abortRequest",value:function abortRequest(t){var r=this.pendingRequests[t].xhr;delete this.pendingRequests[t];r.abort()}}]);return NetworkManager}(),Ya=function(){function PDFNetworkStream(t){network_classCallCheck(this,PDFNetworkStream);this._source=t;this._manager=new Ka(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials});this._rangeChunkSize=t.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}network_createClass(PDFNetworkStream,[{key:"_onRangeRequestReaderClosed",value:function _onRangeRequestReaderClosed(t){var r=this._rangeRequestReaders.indexOf(t);r>=0&&this._rangeRequestReaders.splice(r,1)}},{key:"getFullReader",value:function getFullReader(){assert(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new Xa(this._manager,this._source);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){var a=new $a(this._manager,t,r);a.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){var r;null===(r=this._fullRequestReader)||void 0===r||r.cancel(t);var a,i=network_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(i.s();!(a=i.n()).done;){a.value.cancel(t)}}catch(t){i.e(t)}finally{i.f()}}}]);return PDFNetworkStream}(),Xa=function(){function PDFNetworkStreamFullRequestReader(t,r){network_classCallCheck(this,PDFNetworkStreamFullRequestReader);this._manager=t;var a={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url;this._fullRequestId=t.requestFull(a);this._headersReceivedCapability=new ve;this._disableRange=r.disableRange||!1;this._contentLength=r.length;this._rangeChunkSize=r.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}network_createClass(PDFNetworkStreamFullRequestReader,[{key:"_onHeadersReceived",value:function _onHeadersReceived(){var t=this._fullRequestId,r=this._manager.getRequestXhr(t),a=function getResponseHeader(t){return r.getResponseHeader(t)},i=validateRangeRequestCapabilities({getResponseHeader:a,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),o=i.allowRangeRequests,l=i.suggestedLength;o&&(this._isRangeSupported=!0);this._contentLength=l||this._contentLength;this._filename=extractFilenameFromHeader(a);this._isRangeSupported&&this._manager.abortRequest(t);this._headersReceivedCapability.resolve()}},{key:"_onDone",value:function _onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);this._done=!0;if(!(this._cachedChunks.length>0)){var r,a=network_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0}}},{key:"_onError",value:function _onError(t){this._storedError=createResponseStatusError(t,this._url);this._headersReceivedCapability.reject(this._storedError);var r,a=network_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.reject(this._storedError)}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._cachedChunks.length=0}},{key:"_onProgress",value:function _onProgress(t){var r;null===(r=this.onProgress)||void 0===r||r.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}},{key:"filename",get:function get(){return this._filename}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"headersReady",get:function get(){return this._headersReceivedCapability.promise}},{key:"read",value:(t=network_asyncToGenerator(network_regeneratorRuntime().mark((function _callee(){var t,r;return network_regeneratorRuntime().wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._storedError){a.next=2;break}throw this._storedError;case 2:if(!(this._cachedChunks.length>0)){a.next=5;break}t=this._cachedChunks.shift();return a.abrupt("return",{value:t,done:!1});case 5:if(!this._done){a.next=7;break}return a.abrupt("return",{value:void 0,done:!0});case 7:r=new ve;this._requests.push(r);return a.abrupt("return",r.promise);case 10:case"end":return a.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;this._headersReceivedCapability.reject(t);var r,a=network_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId);this._fullRequestReader=null}}]);var t;return PDFNetworkStreamFullRequestReader}(),$a=function(){function PDFNetworkStreamRangeRequestReader(t,r,a){network_classCallCheck(this,PDFNetworkStreamRangeRequestReader);this._manager=t;var i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._requestId=t.requestRange(r,a,i);this._requests=[];this._queuedChunk=null;this._done=!1;this._storedError=void 0;this.onProgress=null;this.onClosed=null}network_createClass(PDFNetworkStreamRangeRequestReader,[{key:"_close",value:function _close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}},{key:"_onDone",value:function _onDone(t){var r=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:r,done:!1})}else this._queuedChunk=r;this._done=!0;var a,i=network_createForOfIteratorHelper(this._requests);try{for(i.s();!(a=i.n()).done;){a.value.resolve({value:void 0,done:!0})}}catch(t){i.e(t)}finally{i.f()}this._requests.length=0;this._close()}},{key:"_onError",value:function _onError(t){this._storedError=createResponseStatusError(t,this._url);var r,a=network_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.reject(this._storedError)}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._queuedChunk=null}},{key:"_onProgress",value:function _onProgress(t){if(!this.isStreamingSupported){var r;null===(r=this.onProgress)||void 0===r||r.call(this,{loaded:t.loaded})}}},{key:"isStreamingSupported",get:function get(){return!1}},{key:"read",value:(t=network_asyncToGenerator(network_regeneratorRuntime().mark((function _callee2(){var t,r;return network_regeneratorRuntime().wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._storedError){a.next=2;break}throw this._storedError;case 2:if(null===this._queuedChunk){a.next=6;break}t=this._queuedChunk;this._queuedChunk=null;return a.abrupt("return",{value:t,done:!1});case 6:if(!this._done){a.next=8;break}return a.abrupt("return",{value:void 0,done:!0});case 8:r=new ve;this._requests.push(r);return a.abrupt("return",r.promise);case 11:case"end":return a.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;var r,a=network_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId);this._close()}}]);var t;return PDFNetworkStreamRangeRequestReader}();function node_stream_typeof(t){return node_stream_typeof="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},node_stream_typeof(t)}function node_stream_callSuper(t,r,a){return r=node_stream_getPrototypeOf(r),function node_stream_possibleConstructorReturn(t,r){if(r&&("object"===node_stream_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function node_stream_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,node_stream_isNativeReflectConstruct()?Reflect.construct(r,a||[],node_stream_getPrototypeOf(t).constructor):r.apply(t,a))}function node_stream_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(node_stream_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function node_stream_getPrototypeOf(t){node_stream_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return node_stream_getPrototypeOf(t)}function node_stream_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&node_stream_setPrototypeOf(t,r)}function node_stream_setPrototypeOf(t,r){node_stream_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return node_stream_setPrototypeOf(t,r)}function node_stream_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */node_stream_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==node_stream_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(node_stream_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function node_stream_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function node_stream_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){node_stream_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){node_stream_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function node_stream_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function node_stream_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return node_stream_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return node_stream_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function node_stream_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function node_stream_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function node_stream_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,node_stream_toPropertyKey(i.key),i)}}function node_stream_createClass(t,r,a){r&&node_stream_defineProperties(t.prototype,r);a&&node_stream_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function node_stream_toPropertyKey(t){var r=function node_stream_toPrimitive(t,r){if("object"!=node_stream_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=node_stream_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==node_stream_typeof(r)?r:String(r)}var Ja=/^file:\/\/\/[a-zA-Z]:\//;var Qa=function(){function PDFNodeStream(t){node_stream_classCallCheck(this,PDFNodeStream);this.source=t;this.url=function parseUrl(t){var r=Va.parse(t);if("file:"===r.protocol||r.host)return r;if(/^[a-z]:[/\\]/i.test(t))return Va.parse("file:///".concat(t));r.host||(r.protocol="file:");return r}(t.url);this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol||"capacitor:"===this.url.protocol;this.isFsUrl="file:"===this.url.protocol;this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}node_stream_createClass(PDFNodeStream,[{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}},{key:"getFullReader",value:function getFullReader(){assert(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new ni(this):new ti(this);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=this.isFsUrl?new ai(this,t,r):new ri(this,t,r);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){var r;null===(r=this._fullRequestReader)||void 0===r||r.cancel(t);var a,i=node_stream_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(i.s();!(a=i.n()).done;){a.value.cancel(t)}}catch(t){i.e(t)}finally{i.f()}}}]);return PDFNodeStream}(),Za=function(){function BaseFullReader(t){node_stream_classCallCheck(this,BaseFullReader);this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;var r=t.source;this._contentLength=r.length;this._loaded=0;this._filename=null;this._disableRange=r.disableRange||!1;this._rangeChunkSize=r.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!r.disableStream;this._isRangeSupported=!r.disableRange;this._readableStream=null;this._readCapability=new ve;this._headersCapability=new ve}node_stream_createClass(BaseFullReader,[{key:"headersReady",get:function get(){return this._headersCapability.promise}},{key:"filename",get:function get(){return this._filename}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=node_stream_asyncToGenerator(node_stream_regeneratorRuntime().mark((function _callee(){var t,r,a;return node_stream_regeneratorRuntime().wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:i.next=2;return this._readCapability.promise;case 2:if(!this._done){i.next=4;break}return i.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){i.next=6;break}throw this._storedError;case 6:if(null!==(r=this._readableStream.read())){i.next=10;break}this._readCapability=new ve;return i.abrupt("return",this.read());case 10:this._loaded+=r.length;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});a=new Uint8Array(r).buffer;return i.abrupt("return",{value:a,done:!1});case 14:case"end":return i.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}},{key:"_error",value:function _error(t){this._storedError=t;this._readCapability.resolve()}},{key:"_setReadableStream",value:function _setReadableStream(t){var r=this;this._readableStream=t;t.on("readable",(function(){r._readCapability.resolve()}));t.on("end",(function(){t.destroy();r._done=!0;r._readCapability.resolve()}));t.on("error",(function(t){r._error(t)}));!this._isStreamingSupported&&this._isRangeSupported&&this._error(new ue("streaming is disabled"));this._storedError&&this._readableStream.destroy(this._storedError)}}]);var t;return BaseFullReader}(),ei=function(){function BaseRangeReader(t){node_stream_classCallCheck(this,BaseRangeReader);this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=new ve;var r=t.source;this._isStreamingSupported=!r.disableStream}node_stream_createClass(BaseRangeReader,[{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=node_stream_asyncToGenerator(node_stream_regeneratorRuntime().mark((function _callee2(){var t,r,a;return node_stream_regeneratorRuntime().wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:i.next=2;return this._readCapability.promise;case 2:if(!this._done){i.next=4;break}return i.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){i.next=6;break}throw this._storedError;case 6:if(null!==(r=this._readableStream.read())){i.next=10;break}this._readCapability=new ve;return i.abrupt("return",this.read());case 10:this._loaded+=r.length;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});a=new Uint8Array(r).buffer;return i.abrupt("return",{value:a,done:!1});case 14:case"end":return i.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}},{key:"_error",value:function _error(t){this._storedError=t;this._readCapability.resolve()}},{key:"_setReadableStream",value:function _setReadableStream(t){var r=this;this._readableStream=t;t.on("readable",(function(){r._readCapability.resolve()}));t.on("end",(function(){t.destroy();r._done=!0;r._readCapability.resolve()}));t.on("error",(function(t){r._error(t)}));this._storedError&&this._readableStream.destroy(this._storedError)}}]);var t;return BaseRangeReader}();function createRequestOptions(t,r){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:r}}var ti=function(t){node_stream_inherits(PDFNodeStreamFullReader,t);function PDFNodeStreamFullReader(t){var r;node_stream_classCallCheck(this,PDFNodeStreamFullReader);var a=function handleResponse(a){if(404!==a.statusCode){r._headersCapability.resolve();r._setReadableStream(a);var i=function getResponseHeader(t){return r._readableStream.headers[t.toLowerCase()]},o=validateRangeRequestCapabilities({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:r._rangeChunkSize,disableRange:r._disableRange}),l=o.allowRangeRequests,c=o.suggestedLength;r._isRangeSupported=l;r._contentLength=c||r._contentLength;r._filename=extractFilenameFromHeader(i)}else{var u=new se('Missing PDF "'.concat(r._url,'".'));r._storedError=u;r._headersCapability.reject(u)}};(r=node_stream_callSuper(this,PDFNodeStreamFullReader,[t]))._request=null;"http:"===r._url.protocol?r._request=Ua.request(createRequestOptions(r._url,t.httpHeaders),a):r._request=qa.request(createRequestOptions(r._url,t.httpHeaders),a);r._request.on("error",(function(t){r._storedError=t;r._headersCapability.reject(t)}));r._request.end();return r}return node_stream_createClass(PDFNodeStreamFullReader)}(Za),ri=function(t){node_stream_inherits(PDFNodeStreamRangeReader,t);function PDFNodeStreamRangeReader(t,r,a){var i;node_stream_classCallCheck(this,PDFNodeStreamRangeReader);(i=node_stream_callSuper(this,PDFNodeStreamRangeReader,[t]))._httpHeaders={};for(var o in t.httpHeaders){var l=t.httpHeaders[o];void 0!==l&&(i._httpHeaders[o]=l)}i._httpHeaders.Range="bytes=".concat(r,"-").concat(a-1);var c=function handleResponse(t){if(404!==t.statusCode)i._setReadableStream(t);else{var r=new se('Missing PDF "'.concat(i._url,'".'));i._storedError=r}};i._request=null;"http:"===i._url.protocol?i._request=Ua.request(createRequestOptions(i._url,i._httpHeaders),c):i._request=qa.request(createRequestOptions(i._url,i._httpHeaders),c);i._request.on("error",(function(t){i._storedError=t}));i._request.end();return i}return node_stream_createClass(PDFNodeStreamRangeReader)}(ei),ni=function(t){node_stream_inherits(PDFNodeStreamFsFullReader,t);function PDFNodeStreamFsFullReader(t){var r;node_stream_classCallCheck(this,PDFNodeStreamFsFullReader);r=node_stream_callSuper(this,PDFNodeStreamFsFullReader,[t]);var a=decodeURIComponent(r._url.path);Ja.test(r._url.href)&&(a=a.replace(/^\//,""));za.lstat(a,(function(t,i){if(t){"ENOENT"===t.code&&(t=new se('Missing PDF "'.concat(a,'".')));r._storedError=t;r._headersCapability.reject(t)}else{r._contentLength=i.size;r._setReadableStream(za.createReadStream(a));r._headersCapability.resolve()}}));return r}return node_stream_createClass(PDFNodeStreamFsFullReader)}(Za),ai=function(t){node_stream_inherits(PDFNodeStreamFsRangeReader,t);function PDFNodeStreamFsRangeReader(t,r,a){var i;node_stream_classCallCheck(this,PDFNodeStreamFsRangeReader);i=node_stream_callSuper(this,PDFNodeStreamFsRangeReader,[t]);var o=decodeURIComponent(i._url.path);Ja.test(i._url.href)&&(o=o.replace(/^\//,""));i._setReadableStream(za.createReadStream(o,{start:r,end:a-1}));return i}return node_stream_createClass(PDFNodeStreamFsRangeReader)}(ei);function xfa_text_typeof(t){return xfa_text_typeof="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},xfa_text_typeof(t)}function xfa_text_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function xfa_text_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return xfa_text_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return xfa_text_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function xfa_text_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function xfa_text_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,xfa_text_toPropertyKey(i.key),i)}}function xfa_text_toPropertyKey(t){var r=function xfa_text_toPrimitive(t,r){if("object"!=xfa_text_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=xfa_text_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==xfa_text_typeof(r)?r:String(r)}var ii,oi=function(){function XfaText(){!function xfa_text_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,XfaText)}!function xfa_text_createClass(t,r,a){r&&xfa_text_defineProperties(t.prototype,r);a&&xfa_text_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(XfaText,null,[{key:"textContent",value:function textContent(t){var r=[],a={items:r,styles:Object.create(null)};!function walk(t){var a;if(t){var i=null,o=t.name;if("#text"===o)i=t.value;else{if(!XfaText.shouldBuildText(o))return;null!=t&&null!==(a=t.attributes)&&void 0!==a&&a.textContent?i=t.attributes.textContent:t.value&&(i=t.value)}null!==i&&r.push({str:i});if(t.children){var l,c=xfa_text_createForOfIteratorHelper(t.children);try{for(c.s();!(l=c.n()).done;){walk(l.value)}}catch(t){c.e(t)}finally{c.f()}}}}(t);return a}},{key:"shouldBuildText",value:function shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}]);return XfaText}();function api_toConsumableArray(t){return function api_arrayWithoutHoles(t){if(Array.isArray(t))return api_arrayLikeToArray(t)}(t)||function api_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||api_unsupportedIterableToArray(t)||function api_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function api_classPrivateMethodInitSpec(t,r){api_checkPrivateRedeclaration(t,r);r.add(t)}function api_classPrivateFieldInitSpec(t,r,a){api_checkPrivateRedeclaration(t,r);r.set(t,a)}function api_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function api_classPrivateFieldGet(t,r){return api_classApplyDescriptorGet(t,api_classExtractFieldDescriptor(t,r,"get"))}function api_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function api_classPrivateFieldSet(t,r,a){api_classApplyDescriptorSet(t,api_classExtractFieldDescriptor(t,r,"set"),a);return a}function api_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function api_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=api_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function api_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */api_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==api_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(api_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function api_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function api_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,api_toPropertyKey(i.key),i)}}function api_createClass(t,r,a){r&&api_defineProperties(t.prototype,r);a&&api_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function api_toPropertyKey(t){var r=function api_toPrimitive(t,r){if("object"!=api_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=api_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==api_typeof(r)?r:String(r)}function api_classStaticPrivateFieldSpecSet(t,r,a,i){api_classCheckPrivateStaticAccess(t,r);api_classCheckPrivateStaticFieldDescriptor(a,"set");api_classApplyDescriptorSet(t,a,i);return i}function api_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}function api_classStaticPrivateFieldSpecGet(t,r,a){api_classCheckPrivateStaticAccess(t,r);api_classCheckPrivateStaticFieldDescriptor(a,"get");return api_classApplyDescriptorGet(t,a)}function api_classCheckPrivateStaticFieldDescriptor(t,r){if(void 0===t)throw new TypeError("attempted to "+r+" private static field before its declaration")}function api_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}function api_classApplyDescriptorGet(t,r){return r.get?r.get.call(t):r.value}function api_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function api_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){api_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){api_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function api_slicedToArray(t,r){return function api_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function api_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||api_unsupportedIterableToArray(t,r)||function api_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function api_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return api_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?api_arrayLikeToArray(t,r):void 0}}function api_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function api_typeof(t){return api_typeof="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},api_typeof(t)}var si=65536;window.ServiceWorkerOptions={showUnverifiedSignatures:!1};var li=r?Mn:Be,ci=r?Gn:ze,ui=r?Cn:He,hi=r?On:Ue;function getDocument(t){var a,i;"string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});if("object"!==api_typeof(t))throw new Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");var o=new di,l=o.docId,c=t.url?function getUrlProp(t,a){if(t instanceof URL)return t.href;try{return a?new URL(t,window.location.origin+a).href:new URL(t,window.location).href}catch(a){if(r&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url,t.baseHref):null,u=t.data?function getDataProp(t){if(r&&"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 stringToBytes(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===api_typeof(t)&&!isNaN(null==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.")}(t.data):null,h=t.httpHeaders||null,d=!0===t.withCredentials,p=null!==(a=t.password)&&void 0!==a?a:null,v=t.range instanceof pi?t.range:null,_=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:si,y=t.worker instanceof Ai?t.worker:null,g=t.verbosity,m="string"!=typeof t.docBaseUrl||isDataScheme(t.docBaseUrl)?null:t.docBaseUrl,b="function"==typeof t.cMapUrl?t.cMapUrl():"string"==typeof t.cMapUrl?t.cMapUrl:null,w=!1!==t.cMapPacked,P=t.CMapReaderFactory||ci,k="function"==typeof t.standardFontDataUrl?t.standardFontDataUrl():"string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,S=t.StandardFontDataFactory||hi,A=!0!==t.stopAtErrors,x=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,E=!1!==t.isEvalSupported,I="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!r,T=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,C="boolean"==typeof t.disableFontFace?t.disableFontFace:r,M=!0===t.fontExtraProperties,G=!0===t.enableXfa,O=t.ownerDocument||globalThis.document,R=!0===t.disableRange,L=!0===t.disableStream,D=!0===t.disableAutoFetch,j=!0===t.pdfBug,N=v?v.length:null!==(i=t.length)&&void 0!==i?i:NaN,W="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!r&&!C,H="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:P===ze&&S===Ue&&b&&k&&isValidFetchUrl(b,document.baseURI)&&isValidFetchUrl(k,document.baseURI),B=t.canvasFactory||new li({ownerDocument:O}),z=t.filterFactory||new ui({docId:l,ownerDocument:O});setVerbosityLevel(g);var U={canvasFactory:B,filterFactory:z};if(!H){U.cMapReaderFactory=new P({baseUrl:b,isCompressed:w});U.standardFontDataFactory=new S({baseUrl:k})}if(!y){var q={verbosity:g,port:la.workerPort};y=q.port?Ai.fromPort(q):new Ai(q);o._worker=y}var V={docId:l,apiVersion:"4.1.656",data:u,password:p,disableAutoFetch:D,rangeChunkSize:_,length:N,docBaseUrl:m,enableXfa:G,evaluatorOptions:{maxImageSize:x,disableFontFace:C,ignoreErrors:A,isEvalSupported:E,isOffscreenCanvasSupported:I,canvasMaxAreaInBytes:T,fontExtraProperties:M,useSystemFonts:W,cMapUrl:H?b:null,standardFontDataUrl:H?k:null}},K={ignoreErrors:A,isEvalSupported:E,disableFontFace:C,fontExtraProperties:M,enableXfa:G,ownerDocument:O,disableAutoFetch:D,pdfBug:j,styleElement:null};y.promise.then((function(){if(o.destroyed)throw new Error("Loading aborted");var t=function _fetchDocument(t,r){return _fetchDocument2.apply(this,arguments)}(y,V),a=new Promise((function(t){var a;if(v)a=new Da(v,{disableRange:R,disableStream:L});else if(!u){a=function createPDFNetworkStream(t){return r?new Qa(t):isValidFetchUrl(t.url)?new Wa(t):new Ya(t)}({url:c,length:N,httpHeaders:h,withCredentials:d,rangeChunkSize:_,disableRange:R,disableStream:L})}t(a)}));return Promise.all([t,a]).then((function(t){var r=api_slicedToArray(t,2),a=r[0],i=r[1];if(o.destroyed)throw new Error("Loading aborted");var c=new Sa(l,a,y.port),u=new Oi(c,o,i,K,U);o._transport=u;c.send("showUnverifiedSignatures",window.ServiceWorkerOptions.showUnverifiedSignatures);c.send("Ready",null)}))})).catch(o._capability.reject);return o}function _fetchDocument2(){return(_fetchDocument2=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee6(t,r){var a;return api_regeneratorRuntime().wrap((function _callee6$(i){for(;;)switch(i.prev=i.next){case 0:if(!t.destroyed){i.next=2;break}throw new Error("Worker was destroyed");case 2:i.next=4;return t.messageHandler.sendWithPromise("GetDocRequest",r,r.data?[r.data.buffer]:null);case 4:a=i.sent;if(!t.destroyed){i.next=7;break}throw new Error("Worker was destroyed");case 7:return i.abrupt("return",a);case 8:case"end":return i.stop()}}),_callee6)})))).apply(this,arguments)}var di=function(){function PDFDocumentLoadingTask(){var t,r;api_classCallCheck(this,PDFDocumentLoadingTask);this._capability=new ve;this._transport=null;this._worker=null;this.docId="d".concat((api_classStaticPrivateFieldSpecSet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,fi,(t=api_classStaticPrivateFieldSpecGet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,fi),r=t++,t)),r));this.destroyed=!1;this.onPassword=null;this.onProgress=null}api_createClass(PDFDocumentLoadingTask,[{key:"promise",get:function get(){return this._capability.promise}},{key:"destroy",value:(t=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee(){var t,r,a;return api_regeneratorRuntime().wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:this.destroyed=!0;i.prev=1;null!==(t=this._worker)&&void 0!==t&&t.port&&(this._worker._pendingDestroy=!0);i.next=5;return null===(r=this._transport)||void 0===r?void 0:r.destroy();case 5:i.next=11;break;case 7:i.prev=7;i.t0=i.catch(1);null!==(a=this._worker)&&void 0!==a&&a.port&&delete this._worker._pendingDestroy;throw i.t0;case 11:this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}case 13:case"end":return i.stop()}}),_callee,this,[[1,7]])}))),function destroy(){return t.apply(this,arguments)})}]);var t;return PDFDocumentLoadingTask}(),fi={writable:!0,value:0},pi=function(){function PDFDataRangeTransport(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;api_classCallCheck(this,PDFDataRangeTransport);this.length=t;this.initialData=r;this.progressiveDone=a;this.contentDispositionFilename=i;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._progressiveDoneListeners=[];this._readyCapability=new ve}api_createClass(PDFDataRangeTransport,[{key:"addRangeListener",value:function addRangeListener(t){this._rangeListeners.push(t)}},{key:"addProgressListener",value:function addProgressListener(t){this._progressListeners.push(t)}},{key:"addProgressiveReadListener",value:function addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}},{key:"addProgressiveDoneListener",value:function addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}},{key:"onDataRange",value:function onDataRange(t,r){var a,i=api_createForOfIteratorHelper(this._rangeListeners);try{for(i.s();!(a=i.n()).done;){(0,a.value)(t,r)}}catch(t){i.e(t)}finally{i.f()}}},{key:"onDataProgress",value:function onDataProgress(t,r){var a=this;this._readyCapability.promise.then((function(){var i,o=api_createForOfIteratorHelper(a._progressListeners);try{for(o.s();!(i=o.n()).done;){(0,i.value)(t,r)}}catch(t){o.e(t)}finally{o.f()}}))}},{key:"onDataProgressiveRead",value:function onDataProgressiveRead(t){var r=this;this._readyCapability.promise.then((function(){var a,i=api_createForOfIteratorHelper(r._progressiveReadListeners);try{for(i.s();!(a=i.n()).done;){(0,a.value)(t)}}catch(t){i.e(t)}finally{i.f()}}))}},{key:"onDataProgressiveDone",value:function onDataProgressiveDone(){var t=this;this._readyCapability.promise.then((function(){var r,a=api_createForOfIteratorHelper(t._progressiveDoneListeners);try{for(a.s();!(r=a.n()).done;){(0,r.value)()}}catch(t){a.e(t)}finally{a.f()}}))}},{key:"transportReady",value:function transportReady(){this._readyCapability.resolve()}},{key:"requestDataRange",value:function requestDataRange(t,r){unreachable("Abstract method PDFDataRangeTransport.requestDataRange")}},{key:"abort",value:function abort(){}}]);return PDFDataRangeTransport}(),vi=function(){function PDFDocumentProxy(t,r){api_classCallCheck(this,PDFDocumentProxy);this._pdfInfo=t;this._transport=r}api_createClass(PDFDocumentProxy,[{key:"annotationStorage",get:function get(){return this._transport.annotationStorage}},{key:"filterFactory",get:function get(){return this._transport.filterFactory}},{key:"numPages",get:function get(){return this._pdfInfo.numPages}},{key:"fingerprints",get:function get(){return this._pdfInfo.fingerprints}},{key:"isPureXfa",get:function get(){return shadow(this,"isPureXfa",!!this._transport._htmlForXfa)}},{key:"allXfaHtml",get:function get(){return this._transport._htmlForXfa}},{key:"getPage",value:function getPage(t){return this._transport.getPage(t)}},{key:"getPageIndex",value:function getPageIndex(t){return this._transport.getPageIndex(t)}},{key:"getDestinations",value:function getDestinations(){return this._transport.getDestinations()}},{key:"getDestination",value:function getDestination(t){return this._transport.getDestination(t)}},{key:"getPageLabels",value:function getPageLabels(){return this._transport.getPageLabels()}},{key:"getPageLayout",value:function getPageLayout(){return this._transport.getPageLayout()}},{key:"getPageMode",value:function getPageMode(){return this._transport.getPageMode()}},{key:"getViewerPreferences",value:function getViewerPreferences(){return this._transport.getViewerPreferences()}},{key:"getOpenAction",value:function getOpenAction(){return this._transport.getOpenAction()}},{key:"getAttachments",value:function getAttachments(){return this._transport.getAttachments()}},{key:"getJSActions",value:function getJSActions(){return this._transport.getDocJSActions()}},{key:"getOutline",value:function getOutline(){return this._transport.getOutline()}},{key:"getOptionalContentConfig",value:function getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}},{key:"getPermissions",value:function getPermissions(){return this._transport.getPermissions()}},{key:"getMetadata",value:function getMetadata(){return this._transport.getMetadata()}},{key:"getMarkInfo",value:function getMarkInfo(){return this._transport.getMarkInfo()}},{key:"getData",value:function getData(){return this._transport.getData()}},{key:"saveDocument",value:function saveDocument(){return this._transport.saveDocument()}},{key:"getDownloadInfo",value:function getDownloadInfo(){return this._transport.downloadInfoCapability.promise}},{key:"cleanup",value:function cleanup(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}},{key:"destroy",value:function destroy(){return this.loadingTask.destroy()}},{key:"loadingParams",get:function get(){return this._transport.loadingParams}},{key:"loadingTask",get:function get(){return this._transport.loadingTask}},{key:"getFieldObjects",value:function getFieldObjects(){return this._transport.getFieldObjects()}},{key:"hasJSActions",value:function hasJSActions(){return this._transport.hasJSActions()}},{key:"getCalculationOrderIds",value:function getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}]);return PDFDocumentProxy}(),_i=new WeakMap,yi=new WeakMap,gi=new WeakSet,mi=new WeakSet,bi=function(){function PDFPageProxy(t,r,a){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];api_classCallCheck(this,PDFPageProxy);api_classPrivateMethodInitSpec(this,mi);api_classPrivateMethodInitSpec(this,gi);api_classPrivateFieldInitSpec(this,_i,{writable:!0,value:null});api_classPrivateFieldInitSpec(this,yi,{writable:!0,value:!1});this._pageIndex=t;this._pageInfo=r;this._transport=a;this._stats=i?new Xe:null;this._pdfBug=i;this.commonObjs=a.commonObjs;this.objs=new Di;this._maybeCleanupAfterRender=!1;this._intentStates=new Map;this.destroyed=!1}api_createClass(PDFPageProxy,[{key:"pageNumber",get:function get(){return this._pageIndex+1}},{key:"rotate",get:function get(){return this._pageInfo.rotate}},{key:"ref",get:function get(){return this._pageInfo.ref}},{key:"userUnit",get:function get(){return this._pageInfo.userUnit}},{key:"view",get:function get(){return this._pageInfo.view}},{key:"getViewport",value:function getViewport(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.scale,a=t.rotation,i=void 0===a?this.rotate:a,o=t.offsetX,l=void 0===o?0:o,c=t.offsetY,u=void 0===c?0:c,h=t.dontFlip,d=void 0!==h&&h;return new Ve({viewBox:this.view,scale:r,rotation:i,offsetX:l,offsetY:u,dontFlip:d})}},{key:"getAnnotations",value:function getAnnotations(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).intent,r=void 0===t?"display":t,a=this._transport.getRenderingIntent(r);return this._transport.getAnnotations(this._pageIndex,a.renderingIntent)}},{key:"getJSActions",value:function getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}},{key:"filterFactory",get:function get(){return this._transport.filterFactory}},{key:"isPureXfa",get:function get(){return shadow(this,"isPureXfa",!!this._transport._htmlForXfa)}},{key:"getXfa",value:(t=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee2(){var t;return api_regeneratorRuntime().wrap((function _callee2$(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null);case 1:case"end":return r.stop()}}),_callee2,this)}))),function getXfa(){return t.apply(this,arguments)})},{key:"render",value:function render(t){var r,a,i=this,o=t.canvasContext,l=t.viewport,c=t.intent,u=void 0===c?"display":c,d=t.annotationMode,p=void 0===d?y.ENABLE:d,v=t.transform,_=void 0===v?null:v,g=t.background,m=void 0===g?null:g,b=t.optionalContentConfigPromise,w=void 0===b?null:b,P=t.annotationCanvasMap,k=void 0===P?null:P,S=t.pageColors,A=void 0===S?null:S,x=t.printAnnotationStorage,E=void 0===x?null:x;null===(r=this._stats)||void 0===r||r.time("Overall");var I=this._transport.getRenderingIntent(u,p,E);api_classPrivateFieldSet(this,yi,!1);api_classPrivateMethodGet(this,mi,_abortDelayedCleanup2).call(this);w||(w=this._transport.getOptionalContentConfig());var T=this._intentStates.get(I.cacheKey);if(!T){T=Object.create(null);this._intentStates.set(I.cacheKey,T)}if(T.streamReaderCancelTimeout){clearTimeout(T.streamReaderCancelTimeout);T.streamReaderCancelTimeout=null}var C=!!(I.renderingIntent&h);if(!T.displayReadyCapability){var M;T.displayReadyCapability=new ve;T.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};null===(M=this._stats)||void 0===M||M.time("Page Request");this._pumpOperatorList(I)}var G=function complete(t){var r,a;T.renderTasks.delete(O);(i._maybeCleanupAfterRender||C)&&api_classPrivateFieldSet(i,yi,!0);api_classPrivateMethodGet(i,gi,_tryCleanup2).call(i,!C);if(t){O.capability.reject(t);i._abortOperatorList({intentState:T,reason:t instanceof Error?t:new Error(t)})}else O.capability.resolve();null===(r=i._stats)||void 0===r||r.timeEnd("Rendering");null===(a=i._stats)||void 0===a||a.timeEnd("Overall")},O=new Wi({callback:G,params:{canvasContext:o,viewport:l,transform:_,background:m},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:k,operatorList:T.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!C,pdfBug:this._pdfBug,pageColors:A});((a=T).renderTasks||(a.renderTasks=new Set)).add(O);var R=O.task;Promise.all([T.displayReadyCapability.promise,w]).then((function(t){var r,a=api_slicedToArray(t,2),o=a[0],l=a[1];if(i.destroyed)G();else{null===(r=i._stats)||void 0===r||r.time("Rendering");O.initializeGraphics({transparency:o,optionalContentConfig:l});O.operatorListChanged()}})).catch(G);return R}},{key:"getOperatorList",value:function getOperatorList(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.intent,a=void 0===r?"display":r,i=t.annotationMode,o=void 0===i?y.ENABLE:i,l=t.printAnnotationStorage,c=void 0===l?null:l;var u,h=this._transport.getRenderingIntent(a,o,c,!0),d=this._intentStates.get(h.cacheKey);if(!d){d=Object.create(null);this._intentStates.set(h.cacheKey,d)}if(!d.opListReadCapability){var p,v;(u=Object.create(null)).operatorListChanged=function operatorListChanged(){if(d.operatorList.lastChunk){d.opListReadCapability.resolve(d.operatorList);d.renderTasks.delete(u)}};d.opListReadCapability=new ve;((p=d).renderTasks||(p.renderTasks=new Set)).add(u);d.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};null===(v=this._stats)||void 0===v||v.time("Page Request");this._pumpOperatorList(h)}return d.opListReadCapability.promise}},{key:"streamTextContent",value:function streamTextContent(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.includeMarkedContent,a=void 0!==r&&r,i=t.disableNormalization,o=void 0!==i&&i;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===a,disableNormalization:!0===o},{highWaterMark:100,size:function size(t){return t.items.length}})}},{key:"getTextContent",value:function getTextContent(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((function(t){return oi.textContent(t)}));var r=this.streamTextContent(t);return new Promise((function(t,a){var i=r.getReader(),o={items:[],styles:Object.create(null)};!function pump(){i.read().then((function(r){var a,i=r.value;if(r.done)t(o);else{Object.assign(o.styles,i.styles);(a=o.items).push.apply(a,api_toConsumableArray(i.items));pump()}}),a)}()}))}},{key:"getStructTree",value:function getStructTree(){return this._transport.getStructTree(this._pageIndex)}},{key:"_destroy",value:function _destroy(){this.destroyed=!0;var t,r=[],a=api_createForOfIteratorHelper(this._intentStates.values());try{for(a.s();!(t=a.n()).done;){var i=t.value;this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0});if(!i.opListReadCapability){var o,l=api_createForOfIteratorHelper(i.renderTasks);try{for(l.s();!(o=l.n()).done;){var c=o.value;r.push(c.completed);c.cancel()}}catch(t){l.e(t)}finally{l.f()}}}}catch(t){a.e(t)}finally{a.f()}this.objs.clear();api_classPrivateFieldSet(this,yi,!1);api_classPrivateMethodGet(this,mi,_abortDelayedCleanup2).call(this);return Promise.all(r)}},{key:"cleanup",value:function cleanup(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];api_classPrivateFieldSet(this,yi,!0);var r=api_classPrivateMethodGet(this,gi,_tryCleanup2).call(this,!1);t&&r&&this._stats&&(this._stats=new Xe);return r}},{key:"_startRenderPage",value:function _startRenderPage(t,r){var a,i,o=this._intentStates.get(r);if(o){null===(a=this._stats)||void 0===a||a.timeEnd("Page Request");null===(i=o.displayReadyCapability)||void 0===i||i.resolve(t)}}},{key:"_renderPageChunk",value:function _renderPageChunk(t,r){for(var a=0,i=t.length;a<i;a++){r.operatorList.fnArray.push(t.fnArray[a]);r.operatorList.argsArray.push(t.argsArray[a])}r.operatorList.lastChunk=t.lastChunk;r.operatorList.separateAnnots=t.separateAnnots;var o,l=api_createForOfIteratorHelper(r.renderTasks);try{for(l.s();!(o=l.n()).done;){o.value.operatorListChanged()}}catch(t){l.e(t)}finally{l.f()}t.lastChunk&&api_classPrivateMethodGet(this,gi,_tryCleanup2).call(this,!0)}},{key:"_pumpOperatorList",value:function _pumpOperatorList(t){var r=this,a=t.renderingIntent,i=t.cacheKey,o=t.annotationStorageSerializable,l=o.map,c=o.transfer,u=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:a,cacheKey:i,annotationStorage:l},c).getReader(),h=this._intentStates.get(i);h.streamReader=u;!function pump(){u.read().then((function(t){var a=t.value;if(t.done)h.streamReader=null;else if(!r._transport.destroyed){r._renderPageChunk(a,h);pump()}}),(function(t){h.streamReader=null;if(!r._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;var a,i=api_createForOfIteratorHelper(h.renderTasks);try{for(i.s();!(a=i.n()).done;){a.value.operatorListChanged()}}catch(t){i.e(t)}finally{i.f()}api_classPrivateMethodGet(r,gi,_tryCleanup2).call(r,!0)}if(h.displayReadyCapability)h.displayReadyCapability.reject(t);else{if(!h.opListReadCapability)throw t;h.opListReadCapability.reject(t)}}}))}()}},{key:"_abortOperatorList",value:function _abortOperatorList(t){var r=this,a=t.intentState,i=t.reason,o=t.force,l=void 0!==o&&o;if(a.streamReader){if(a.streamReaderCancelTimeout){clearTimeout(a.streamReaderCancelTimeout);a.streamReaderCancelTimeout=null}if(!l){if(a.renderTasks.size>0)return;if(i instanceof Ke){var c=100;i.extraDelay>0&&i.extraDelay<1e3&&(c+=i.extraDelay);a.streamReaderCancelTimeout=setTimeout((function(){a.streamReaderCancelTimeout=null;r._abortOperatorList({intentState:a,reason:i,force:!0})}),c);return}}a.streamReader.cancel(new ue(i.message)).catch((function(){}));a.streamReader=null;if(!this._transport.destroyed){var u,h=api_createForOfIteratorHelper(this._intentStates);try{for(h.s();!(u=h.n()).done;){var d=api_slicedToArray(u.value,2),p=d[0];if(d[1]===a){this._intentStates.delete(p);break}}}catch(t){h.e(t)}finally{h.f()}this.cleanup()}}}},{key:"stats",get:function get(){return this._stats}}]);var t;return PDFPageProxy}();function _tryCleanup2(){var t=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];api_classPrivateMethodGet(this,mi,_abortDelayedCleanup2).call(this);if(!api_classPrivateFieldGet(this,yi)||this.destroyed)return!1;if(r){api_classPrivateFieldSet(this,_i,setTimeout((function(){api_classPrivateFieldSet(t,_i,null);api_classPrivateMethodGet(t,gi,_tryCleanup2).call(t,!1)}),5e3));return!1}var a,i=api_createForOfIteratorHelper(this._intentStates.values());try{for(i.s();!(a=i.n()).done;){var o=a.value,l=o.renderTasks,c=o.operatorList;if(l.size>0||!c.lastChunk)return!1}}catch(t){i.e(t)}finally{i.f()}this._intentStates.clear();this.objs.clear();api_classPrivateFieldSet(this,yi,!1);return!0}function _abortDelayedCleanup2(){if(api_classPrivateFieldGet(this,_i)){clearTimeout(api_classPrivateFieldGet(this,_i));api_classPrivateFieldSet(this,_i,null)}}var wi=new WeakMap,Pi=new WeakMap,ki=function(){function LoopbackPort(){api_classCallCheck(this,LoopbackPort);api_classPrivateFieldInitSpec(this,wi,{writable:!0,value:new Set});api_classPrivateFieldInitSpec(this,Pi,{writable:!0,value:Promise.resolve()})}api_createClass(LoopbackPort,[{key:"postMessage",value:function postMessage(t,r){var a=this,i={data:structuredClone(t,r?{transfer:r}:null)};api_classPrivateFieldGet(this,Pi).then((function(){var t,r=api_createForOfIteratorHelper(api_classPrivateFieldGet(a,wi));try{for(r.s();!(t=r.n()).done;){t.value.call(a,i)}}catch(t){r.e(t)}finally{r.f()}}))}},{key:"addEventListener",value:function addEventListener(t,r){api_classPrivateFieldGet(this,wi).add(r)}},{key:"removeEventListener",value:function removeEventListener(t,r){api_classPrivateFieldGet(this,wi).delete(r)}},{key:"terminate",value:function terminate(){api_classPrivateFieldGet(this,wi).clear()}}]);return LoopbackPort}(),Si={isWorkerDisabled:!1,fakeWorkerId:0};if(r){Si.isWorkerDisabled=!0;la.workerSrc||(la.workerSrc="./pdf.worker.mjs")}Si.isSameOrigin=function(t,r){var a;try{if(!(a=new URL(t)).origin||"null"===a.origin)return!1}catch(t){return!1}var i=new URL(r,a);return a.origin===i.origin};Si.createCDNWrapper=function(t){var r='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([r],{type:"text/javascript"}))};var Fi=new WeakSet,Ai=function(){function PDFWorker(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.name,a=void 0===r?null:r,i=t.port,o=void 0===i?null:i,l=t.verbosity,c=void 0===l?getVerbosityLevel():l;api_classCallCheck(this,PDFWorker);api_classPrivateMethodInitSpec(this,Fi);this.name=a;this.destroyed=!1;this.verbosity=c;this._readyCapability=new ve;this._port=null;this._webWorker=null;this._messageHandler=null;if(o){var u;if(null!==(u=api_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,Ei))&&void 0!==u&&u.has(o))throw new Error("Cannot use more than one PDFWorker per port.");(api_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,Ei)||api_classStaticPrivateFieldSpecSet(PDFWorker,PDFWorker,Ei,new WeakMap)).set(o,this);this._initializeFromPort(o)}else this._initialize()}api_createClass(PDFWorker,[{key:"promise",get:function get(){return this._readyCapability.promise}},{key:"port",get:function get(){return this._port}},{key:"messageHandler",get:function get(){return this._messageHandler}},{key:"_initializeFromPort",value:function _initializeFromPort(t){this._port=t;this._messageHandler=new Sa("main","worker",t);this._messageHandler.on("ready",(function(){}));this._readyCapability.resolve();this._messageHandler.send("configure",{verbosity:this.verbosity})}},{key:"_initialize",value:function _initialize(){var t=this;if(!Si.isWorkerDisabled&&!api_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,xi)){var r=PDFWorker.workerSrc;try{Si.isSameOrigin(window.location.href,r)||(r=Si.createCDNWrapper(new URL(r,window.location).href));var a=new Worker(api_classPrivateMethodGet(this,Fi,_generateTrustedURL2).call(this,r),{type:"module"}),i=new Sa("main","worker",a),o=function terminateEarly(){a.removeEventListener("error",l);i.destroy();a.terminate();t.destroyed?t._readyCapability.reject(new Error("Worker was destroyed")):t._setupFakeWorker()},l=function onWorkerError(){t._webWorker||o()};a.addEventListener("error",l);i.on("test",(function(r){a.removeEventListener("error",l);if(t.destroyed)o();else if(r){t._messageHandler=i;t._port=a;t._webWorker=a;t._readyCapability.resolve();i.send("configure",{verbosity:t.verbosity})}else{t._setupFakeWorker();i.destroy();a.terminate()}}));i.on("ready",(function(r){a.removeEventListener("error",l);if(t.destroyed)o();else try{c()}catch(r){t._setupFakeWorker()}}));var c=function sendTest(){var t=new Uint8Array;i.send("test",t,[t.buffer])};c();return}catch(t){info("The worker has been disabled.")}}this._setupFakeWorker()}},{key:"_setupFakeWorker",value:function _setupFakeWorker(){var t=this;if(!Si.isWorkerDisabled){warn("Setting up fake worker.");Si.isWorkerDisabled=!0}PDFWorker._setupFakeWorkerGlobal.then((function(r){if(t.destroyed)t._readyCapability.reject(new Error("Worker was destroyed"));else{var a=new ki;t._port=a;var i="fake".concat(Si.fakeWorkerId++),o=new Sa(i+"_worker",i,a);r.setup(o,a);var l=new Sa(i,i+"_worker",a);t._messageHandler=l;t._readyCapability.resolve();l.send("configure",{verbosity:t.verbosity})}})).catch((function(r){t._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(r.message,'".')))}))}},{key:"destroy",value:function destroy(){var t;this.destroyed=!0;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}null===(t=api_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,Ei))||void 0===t||t.delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}}],[{key:"fromPort",value:function fromPort(t){var r;if(null==t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");var a=null===(r=api_classStaticPrivateFieldSpecGet(this,PDFWorker,Ei))||void 0===r?void 0:r.get(t.port);if(a){if(a._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return a}return new PDFWorker(t)}},{key:"workerSrc",get:function get(){if(la.workerSrc)return"Function"===la.workerSrc.constructor.name?la.workerSrc():la.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}},{key:"_setupFakeWorkerGlobal",get:function get(){var t=this,r=function(){var r=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee3(){var r;return api_regeneratorRuntime().wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:if(!api_classStaticPrivateFieldSpecGet(t,PDFWorker,xi)){a.next=2;break}return a.abrupt("return",api_classStaticPrivateFieldSpecGet(t,PDFWorker,xi));case 2:a.next=4;return import(t.workerSrc);case 4:r=a.sent;return a.abrupt("return",r.WorkerMessageHandler);case 6:case"end":return a.stop()}}),_callee3)})));return function loader(){return r.apply(this,arguments)}}();return shadow(this,"_setupFakeWorkerGlobal",r())}}]);return PDFWorker}();function _generateTrustedURL2(t){if(window.trustedTypes){var r=window.trustedTypes.createPolicy("foo",{createScriptURL:function createScriptURL(t){return t}});return r.createScriptURL(t)}return t}var xi={get:function _get_mainThreadWorkerMessageHandler(){try{var t;return(null===(t=globalThis.pdfjsWorker)||void 0===t?void 0:t.WorkerMessageHandler)||null}catch(t){return null}},set:void 0},Ei={writable:!0,value:void 0},Ii=new WeakMap,Ti=new WeakMap,Ci=new WeakMap,Mi=new WeakMap,Gi=new WeakSet,Oi=function(){function WorkerTransport(t,r,a,i,o){api_classCallCheck(this,WorkerTransport);api_classPrivateMethodInitSpec(this,Gi);api_classPrivateFieldInitSpec(this,Ii,{writable:!0,value:new Map});api_classPrivateFieldInitSpec(this,Ti,{writable:!0,value:new Map});api_classPrivateFieldInitSpec(this,Ci,{writable:!0,value:new Map});api_classPrivateFieldInitSpec(this,Mi,{writable:!0,value:null});this.messageHandler=t;this.loadingTask=r;this.commonObjs=new Di;this.fontLoader=new En({ownerDocument:i.ownerDocument,styleElement:i.styleElement});this._params=i;this.canvasFactory=o.canvasFactory;this.filterFactory=o.filterFactory;this.cMapReaderFactory=o.cMapReaderFactory;this.standardFontDataFactory=o.standardFontDataFactory;this.destroyed=!1;this.destroyCapability=null;this._networkStream=a;this._fullReader=null;this._lastProgress=null;this.downloadInfoCapability=new ve;this.setupMessageHandler()}api_createClass(WorkerTransport,[{key:"annotationStorage",get:function get(){return shadow(this,"annotationStorage",new kn)}},{key:"getRenderingIntent",value:function getRenderingIntent(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.ENABLE,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=u,l=mn;switch(t){case"any":o=c;break;case"display":break;case"print":o=h;break;default:warn("getRenderingIntent - invalid intent: ".concat(t))}switch(r){case y.DISABLE:o+=v;break;case y.ENABLE:break;case y.ENABLE_FORMS:o+=d;break;case y.ENABLE_STORAGE:l=((o+=p)&h&&a instanceof Fn?a:this.annotationStorage).serializable;break;default:warn("getRenderingIntent - invalid annotationMode: ".concat(r))}i&&(o+=_);return{renderingIntent:o,cacheKey:"".concat(o,"_").concat(l.hash),annotationStorageSerializable:l}}},{key:"destroy",value:function destroy(){var t,r=this;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=new ve;null===(t=api_classPrivateFieldGet(this,Mi))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));var a,i=[],o=api_createForOfIteratorHelper(api_classPrivateFieldGet(this,Ti).values());try{for(o.s();!(a=o.n()).done;){var l=a.value;i.push(l._destroy())}}catch(t){o.e(t)}finally{o.f()}api_classPrivateFieldGet(this,Ti).clear();api_classPrivateFieldGet(this,Ci).clear();this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();var c=this.messageHandler.sendWithPromise("Terminate",null);i.push(c);Promise.all(i).then((function(){var t;r.commonObjs.clear();r.fontLoader.clear();api_classPrivateFieldGet(r,Ii).clear();r.filterFactory.destroy();cleanupTextLayer();null===(t=r._networkStream)||void 0===t||t.cancelAllRequests(new ue("Worker was terminated."));if(r.messageHandler){r.messageHandler.destroy();r.messageHandler=null}r.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise}},{key:"setupMessageHandler",value:function setupMessageHandler(){var t=this,r=this.messageHandler,a=this.loadingTask;r.on("GetReader",(function(r,a){assert(t._networkStream,"GetReader - no `IPDFStream` instance available.");t._fullReader=t._networkStream.getFullReader();t._fullReader.onProgress=function(r){t._lastProgress={loaded:r.loaded,total:r.total}};a.onPull=function(){t._fullReader.read().then((function(t){var r=t.value;if(t.done)a.close();else{assert(r instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer.");a.enqueue(new Uint8Array(r),1,[r])}})).catch((function(t){a.error(t)}))};a.onCancel=function(r){t._fullReader.cancel(r);a.ready.catch((function(r){if(!t.destroyed)throw r}))}}));r.on("ReaderHeadersReady",(function(r){var i=new ve,o=t._fullReader;o.headersReady.then((function(){if(!o.isStreamingSupported||!o.isRangeSupported){if(t._lastProgress){var r;null===(r=a.onProgress)||void 0===r||r.call(a,t._lastProgress)}o.onProgress=function(t){var r;null===(r=a.onProgress)||void 0===r||r.call(a,{loaded:t.loaded,total:t.total})}}i.resolve({isStreamingSupported:o.isStreamingSupported,isRangeSupported:o.isRangeSupported,contentLength:o.contentLength})}),i.reject);return i.promise}));r.on("GetRangeReader",(function(r,a){assert(t._networkStream,"GetRangeReader - no `IPDFStream` instance available.");var i=t._networkStream.getRangeReader(r.begin,r.end);if(i){a.onPull=function(){i.read().then((function(t){var r=t.value;if(t.done)a.close();else{assert(r instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer.");a.enqueue(new Uint8Array(r),1,[r])}})).catch((function(t){a.error(t)}))};a.onCancel=function(r){i.cancel(r);a.ready.catch((function(r){if(!t.destroyed)throw r}))}}else a.close()}));r.on("GetDoc",(function(r){var i=r.pdfInfo;t._numPages=i.numPages;t._htmlForXfa=i.htmlForXfa;delete i.htmlForXfa;a._capability.resolve(new vi(i,t))}));r.on("DocException",(function(t){var r;switch(t.name){case"PasswordException":r=new ae(t.message,t.code);break;case"InvalidPDFException":r=new oe(t.message);break;case"MissingPDFException":r=new se(t.message);break;case"UnexpectedResponseException":r=new le(t.message,t.status);break;case"UnknownErrorException":r=new ie(t.message,t.details);break;default:unreachable("DocException - expected a valid Error.")}a._capability.reject(r)}));r.on("PasswordRequest",(function(r){api_classPrivateFieldSet(t,Mi,new ve);if(a.onPassword){try{a.onPassword((function updatePassword(r){r instanceof Error?api_classPrivateFieldGet(t,Mi).reject(r):api_classPrivateFieldGet(t,Mi).resolve({password:r})}),r.code)}catch(r){api_classPrivateFieldGet(t,Mi).reject(r)}}else api_classPrivateFieldGet(t,Mi).reject(new ae(r.message,r.code));return api_classPrivateFieldGet(t,Mi).promise}));r.on("DataLoaded",(function(r){var i;null===(i=a.onProgress)||void 0===i||i.call(a,{loaded:r.length,total:r.length});t.downloadInfoCapability.resolve(r)}));r.on("StartRenderPage",(function(r){if(!t.destroyed){api_classPrivateFieldGet(t,Ti).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}}));r.on("commonobj",(function(a){var i,o=api_slicedToArray(a,3),l=o[0],c=o[1],u=o[2];if(t.destroyed)return null;if(t.commonObjs.has(l))return null;switch(c){case"Font":var h=t._params;if("error"in u){var d=u.error;warn("Error during font loading: ".concat(d));t.commonObjs.resolve(l,d);break}var p=h.pdfBug&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?function(t,r){return globalThis.FontInspector.fontAdded(t,r)}:null,v=new In(u,{isEvalSupported:h.isEvalSupported,disableFontFace:h.disableFontFace,ignoreErrors:h.ignoreErrors,inspectFont:p});t.fontLoader.bind(v).catch((function(){return r.sendWithPromise("FontFallback",{id:l})})).finally((function(){!h.fontExtraProperties&&v.data&&(v.data=null);t.commonObjs.resolve(l,v)}));break;case"CopyLocalImage":var _=u.imageRef;assert(_,"The imageRef must be defined.");var y,g=api_createForOfIteratorHelper(api_classPrivateFieldGet(t,Ti).values());try{for(g.s();!(y=g.n()).done;){var m,b=api_createForOfIteratorHelper(y.value.objs);try{for(b.s();!(m=b.n()).done;){var w=api_slicedToArray(m.value,2)[1];if(w.ref===_){if(!w.dataLen)return null;t.commonObjs.resolve(l,structuredClone(w));return w.dataLen}}}catch(t){b.e(t)}finally{b.f()}}}catch(t){g.e(t)}finally{g.f()}break;case"FontPath":case"Image":case"Pattern":t.commonObjs.resolve(l,u);break;default:throw new Error("Got unknown common object type ".concat(c))}return null}));r.on("obj",(function(r){var a=api_slicedToArray(r,4),i=a[0],o=a[1],l=a[2],c=a[3];if(!t.destroyed){var u=api_classPrivateFieldGet(t,Ti).get(o);if(!u.objs.has(i))if(0!==u._intentStates.size)switch(l){case"Image":u.objs.resolve(i,c);(null==c?void 0:c.dataLen)>1e7&&(u._maybeCleanupAfterRender=!0);break;case"Pattern":u.objs.resolve(i,c);break;default:throw new Error("Got unknown object type ".concat(l))}else{var h;null==c||null===(h=c.bitmap)||void 0===h||h.close()}}}));r.on("DocProgress",(function(r){var i;t.destroyed||null===(i=a.onProgress)||void 0===i||i.call(a,{loaded:r.loaded,total:r.total})}));r.on("FetchBuiltInCMap",(function(r){return t.destroyed?Promise.reject(new Error("Worker was destroyed.")):t.cMapReaderFactory?t.cMapReaderFactory.fetch(r):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))}));r.on("FetchStandardFontData",(function(r){return t.destroyed?Promise.reject(new Error("Worker was destroyed.")):t.standardFontDataFactory?t.standardFontDataFactory.fetch(r):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))}))}},{key:"getData",value:function getData(){return this.messageHandler.sendWithPromise("GetData",null)}},{key:"saveDocument",value:function saveDocument(){var t,r,a=this;this.annotationStorage.size<=0&&warn("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");var i=this.annotationStorage.serializable,o=i.map,l=i.transfer;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:o,filename:null!==(t=null===(r=this._fullReader)||void 0===r?void 0:r.filename)&&void 0!==t?t:null},l).finally((function(){a.annotationStorage.resetModified()}))}},{key:"getPage",value:function getPage(t){var r=this;if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));var a=t-1,i=api_classPrivateFieldGet(this,Ci).get(a);if(i)return i;var o=this.messageHandler.sendWithPromise("GetPage",{pageIndex:a}).then((function(t){if(r.destroyed)throw new Error("Transport destroyed");var i=new bi(a,t,r,r._params.pdfBug);api_classPrivateFieldGet(r,Ti).set(a,i);return i}));api_classPrivateFieldGet(this,Ci).set(a,o);return o}},{key:"getPageIndex",value:function getPageIndex(t){return"object"!==api_typeof(t)||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}},{key:"getAnnotations",value:function getAnnotations(t,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:r})}},{key:"getFieldObjects",value:function getFieldObjects(){return api_classPrivateMethodGet(this,Gi,_cacheSimpleMethod2).call(this,"GetFieldObjects")}},{key:"hasJSActions",value:function hasJSActions(){return api_classPrivateMethodGet(this,Gi,_cacheSimpleMethod2).call(this,"HasJSActions")}},{key:"getCalculationOrderIds",value:function getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}},{key:"getDestinations",value:function getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}},{key:"getDestination",value:function getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}},{key:"getPageLabels",value:function getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}},{key:"getPageLayout",value:function getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}},{key:"getPageMode",value:function getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}},{key:"getViewerPreferences",value:function getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}},{key:"getOpenAction",value:function getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}},{key:"getAttachments",value:function getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}},{key:"getDocJSActions",value:function getDocJSActions(){return api_classPrivateMethodGet(this,Gi,_cacheSimpleMethod2).call(this,"GetDocJSActions")}},{key:"getPageJSActions",value:function getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}},{key:"getStructTree",value:function getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}},{key:"getOutline",value:function getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}},{key:"getOptionalContentConfig",value:function getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((function(t){return new La(t)}))}},{key:"getPermissions",value:function getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}},{key:"getMetadata",value:function getMetadata(){var t=this,r="GetMetadata",a=api_classPrivateFieldGet(this,Ii).get(r);if(a)return a;var i=this.messageHandler.sendWithPromise(r,null).then((function(r){var a,i,o,l;return{info:r[0],metadata:r[1]?new xa(r[1]):null,contentDispositionFilename:null!==(a=null===(i=t._fullReader)||void 0===i?void 0:i.filename)&&void 0!==a?a:null,contentLength:null!==(o=null===(l=t._fullReader)||void 0===l?void 0:l.contentLength)&&void 0!==o?o:null}}));api_classPrivateFieldGet(this,Ii).set(r,i);return i}},{key:"getMarkInfo",value:function getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}},{key:"startCleanup",value:(t=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee4(){var t,r,a,i,o=arguments;return api_regeneratorRuntime().wrap((function _callee4$(l){for(;;)switch(l.prev=l.next){case 0:t=o.length>0&&void 0!==o[0]&&o[0];if(!this.destroyed){l.next=3;break}return l.abrupt("return");case 3:l.next=5;return this.messageHandler.sendWithPromise("Cleanup",null);case 5:r=api_createForOfIteratorHelper(api_classPrivateFieldGet(this,Ti).values());l.prev=6;r.s();case 8:if((a=r.n()).done){l.next=15;break}if((i=a.value).cleanup()){l.next=13;break}throw new Error("startCleanup: Page ".concat(i.pageNumber," is currently rendering."));case 13:l.next=8;break;case 15:l.next=20;break;case 17:l.prev=17;l.t0=l.catch(6);r.e(l.t0);case 20:l.prev=20;r.f();return l.finish(20);case 23:this.commonObjs.clear();t||this.fontLoader.clear();api_classPrivateFieldGet(this,Ii).clear();this.filterFactory.destroy(!0);cleanupTextLayer();case 28:case"end":return l.stop()}}),_callee4,this,[[6,17,20,23]])}))),function startCleanup(){return t.apply(this,arguments)})},{key:"loadingParams",get:function get(){var t=this._params;return shadow(this,"loadingParams",{disableAutoFetch:t.disableAutoFetch,enableXfa:t.enableXfa})}}]);var t;return WorkerTransport}();function _cacheSimpleMethod2(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=api_classPrivateFieldGet(this,Ii).get(t);if(a)return a;var i=this.messageHandler.sendWithPromise(t,r);api_classPrivateFieldGet(this,Ii).set(t,i);return i}var Ri=new WeakMap,Li=new WeakSet;ii=Symbol.iterator;var Di=function(){function PDFObjects(){api_classCallCheck(this,PDFObjects);api_classPrivateMethodInitSpec(this,Li);api_classPrivateFieldInitSpec(this,Ri,{writable:!0,value:Object.create(null)})}api_createClass(PDFObjects,[{key:"get",value:function get(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(r){var a=api_classPrivateMethodGet(this,Li,_ensureObj2).call(this,t);a.capability.promise.then((function(){return r(a.data)}));return null}var i=api_classPrivateFieldGet(this,Ri)[t];if(null==i||!i.capability.settled)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}},{key:"has",value:function has(t){var r,a=api_classPrivateFieldGet(this,Ri)[t];return null!==(r=null==a?void 0:a.capability.settled)&&void 0!==r&&r}},{key:"resolve",value:function resolve(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=api_classPrivateMethodGet(this,Li,_ensureObj2).call(this,t);a.data=r;a.capability.resolve()}},{key:"clear",value:function clear(){for(var t in api_classPrivateFieldGet(this,Ri)){var r,a=api_classPrivateFieldGet(this,Ri)[t].data;null==a||null===(r=a.bitmap)||void 0===r||r.close()}api_classPrivateFieldSet(this,Ri,Object.create(null))}},{key:ii,value:api_regeneratorRuntime().mark((function value(){var t,r,a,i;return api_regeneratorRuntime().wrap((function value$(o){for(;;)switch(o.prev=o.next){case 0:o.t0=api_regeneratorRuntime().keys(api_classPrivateFieldGet(this,Ri));case 1:if((o.t1=o.t0()).done){o.next=10;break}t=o.t1.value;r=api_classPrivateFieldGet(this,Ri)[t],a=r.capability,i=r.data;if(a.settled){o.next=6;break}return o.abrupt("continue",1);case 6:o.next=8;return[t,i];case 8:o.next=1;break;case 10:case"end":return o.stop()}}),value,this)}))}]);return PDFObjects}();function _ensureObj2(t){var r;return(r=api_classPrivateFieldGet(this,Ri))[t]||(r[t]={capability:new ve,data:null})}var ji=new WeakMap,Ni=function(){function RenderTask(t){api_classCallCheck(this,RenderTask);api_classPrivateFieldInitSpec(this,ji,{writable:!0,value:null});api_classPrivateFieldSet(this,ji,t);this.onContinue=null}api_createClass(RenderTask,[{key:"promise",get:function get(){return api_classPrivateFieldGet(this,ji).capability.promise}},{key:"cancel",value:function cancel(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;api_classPrivateFieldGet(this,ji).cancel(null,t)}},{key:"separateAnnots",get:function get(){var t=api_classPrivateFieldGet(this,ji).operatorList.separateAnnots;if(!t)return!1;var r=api_classPrivateFieldGet(this,ji).annotationCanvasMap;return t.form||t.canvas&&(null==r?void 0:r.size)>0}}]);return RenderTask}(),Wi=function(){function InternalRenderTask(t){var r=t.callback,a=t.params,i=t.objs,o=t.commonObjs,l=t.annotationCanvasMap,c=t.operatorList,u=t.pageIndex,h=t.canvasFactory,d=t.filterFactory,p=t.useRequestAnimationFrame,v=void 0!==p&&p,_=t.pdfBug,y=void 0!==_&&_,g=t.pageColors,m=void 0===g?null:g;api_classCallCheck(this,InternalRenderTask);this.callback=r;this.params=a;this.objs=i;this.commonObjs=o;this.annotationCanvasMap=l;this.operatorListIdx=null;this.operatorList=c;this._pageIndex=u;this.canvasFactory=h;this.filterFactory=d;this._pdfBug=y;this.pageColors=m;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===v&&"undefined"!=typeof window;this.cancelled=!1;this.capability=new ve;this.task=new Ni(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=a.canvasContext.canvas}api_createClass(InternalRenderTask,[{key:"completed",get:function get(){return this.capability.promise.catch((function(){}))}},{key:"initializeGraphics",value:function initializeGraphics(t){var r,a,i=t.transparency,o=void 0!==i&&i,l=t.optionalContentConfig;if(!this.cancelled){if(this._canvas){if(api_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,Hi).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.");api_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,Hi).add(this._canvas)}if(this._pdfBug&&null!==(r=globalThis.StepperManager)&&void 0!==r&&r.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}var c=this.params,u=c.canvasContext,h=c.viewport,d=c.transform,p=c.background;this.gfx=new ta(u,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:l},this.annotationCanvasMap,this.pageColors);this.gfx.beginDrawing({transform:d,viewport:h,transparency:o,background:p});this.operatorListIdx=0;this.graphicsReady=!0;null===(a=this.graphicsReadyCallback)||void 0===a||a.call(this)}}},{key:"cancel",value:function cancel(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=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();api_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,Hi).delete(this._canvas);this.callback(r||new Ke("Rendering cancelled, page ".concat(this._pageIndex+1),a))}},{key:"operatorListChanged",value:function operatorListChanged(){var t;if(this.graphicsReady){null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}},{key:"_continue",value:function _continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}},{key:"_scheduleNext",value:function _scheduleNext(){var t=this;window.ngxZone.runOutsideAngular((function(){t._useRequestAnimationFrame?window.requestAnimationFrame((function(){t._nextBound().catch(t._cancelBound)})):Promise.resolve().then(t._nextBound).catch(t._cancelBound)}))}},{key:"_next",value:(t=api_asyncToGenerator(api_regeneratorRuntime().mark((function _callee5(){return api_regeneratorRuntime().wrap((function _callee5$(t){for(;;)switch(t.prev=t.next){case 0:if(!this.cancelled){t.next=2;break}return t.abrupt("return");case 2:this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing();api_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,Hi).delete(this._canvas);this.callback()}}case 4:case"end":return t.stop()}}),_callee5,this)}))),function _next(){return t.apply(this,arguments)})}]);var t;return InternalRenderTask}(),Hi={writable:!0,value:new WeakSet},Bi="4.1.656",zi="e7bfd901e";__webpack_require__(1919),__webpack_require__(9474),__webpack_require__(2349),__webpack_require__(6386),__webpack_require__(9772),__webpack_require__(4564),__webpack_require__(385),__webpack_require__(6466),__webpack_require__(9411);function scripting_utils_typeof(t){return scripting_utils_typeof="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},scripting_utils_typeof(t)}function scripting_utils_slicedToArray(t,r){return function scripting_utils_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function scripting_utils_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||function scripting_utils_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return scripting_utils_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return scripting_utils_arrayLikeToArray(t,r)}(t,r)||function scripting_utils_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function scripting_utils_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function scripting_utils_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,scripting_utils_toPropertyKey(i.key),i)}}function scripting_utils_toPropertyKey(t){var r=function scripting_utils_toPrimitive(t,r){if("object"!=scripting_utils_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=scripting_utils_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==scripting_utils_typeof(r)?r:String(r)}function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function scaleAndClamp(t){return Math.max(0,Math.min(255,255*t))}var Ui=function(){function ColorConverters(){!function scripting_utils_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,ColorConverters)}!function scripting_utils_createClass(t,r,a){r&&scripting_utils_defineProperties(t.prototype,r);a&&scripting_utils_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(ColorConverters,null,[{key:"CMYK_G",value:function CMYK_G(t){var r=scripting_utils_slicedToArray(t,4),a=r[0],i=r[1],o=r[2],l=r[3];return["G",1-Math.min(1,.3*a+.59*o+.11*i+l)]}},{key:"G_CMYK",value:function G_CMYK(t){return["CMYK",0,0,0,1-scripting_utils_slicedToArray(t,1)[0]]}},{key:"G_RGB",value:function G_RGB(t){var r=scripting_utils_slicedToArray(t,1)[0];return["RGB",r,r,r]}},{key:"G_rgb",value:function G_rgb(t){var r=scripting_utils_slicedToArray(t,1)[0];return[r=scaleAndClamp(r),r,r]}},{key:"G_HTML",value:function G_HTML(t){var r=makeColorComp(scripting_utils_slicedToArray(t,1)[0]);return"#".concat(r).concat(r).concat(r)}},{key:"RGB_G",value:function RGB_G(t){var r=scripting_utils_slicedToArray(t,3);return["G",.3*r[0]+.59*r[1]+.11*r[2]]}},{key:"RGB_rgb",value:function RGB_rgb(t){return t.map(scaleAndClamp)}},{key:"RGB_HTML",value:function RGB_HTML(t){return"#".concat(t.map(makeColorComp).join(""))}},{key:"T_HTML",value:function T_HTML(){return"#00000000"}},{key:"T_rgb",value:function T_rgb(){return[null]}},{key:"CMYK_RGB",value:function CMYK_RGB(t){var r=scripting_utils_slicedToArray(t,4),a=r[0],i=r[1],o=r[2],l=r[3];return["RGB",1-Math.min(1,a+l),1-Math.min(1,o+l),1-Math.min(1,i+l)]}},{key:"CMYK_rgb",value:function CMYK_rgb(t){var r=scripting_utils_slicedToArray(t,4),a=r[0],i=r[1],o=r[2],l=r[3];return[scaleAndClamp(1-Math.min(1,a+l)),scaleAndClamp(1-Math.min(1,o+l)),scaleAndClamp(1-Math.min(1,i+l))]}},{key:"CMYK_HTML",value:function CMYK_HTML(t){var r=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(r)}},{key:"RGB_CMYK",value:function RGB_CMYK(t){var r=scripting_utils_slicedToArray(t,3),a=1-r[0],i=1-r[1],o=1-r[2];return["CMYK",a,i,o,Math.min(a,i,o)]}}]);return ColorConverters}();function xfa_layer_typeof(t){return xfa_layer_typeof="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},xfa_layer_typeof(t)}function xfa_layer_slicedToArray(t,r){return function xfa_layer_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function xfa_layer_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||xfa_layer_unsupportedIterableToArray(t,r)||function xfa_layer_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xfa_layer_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=xfa_layer_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function xfa_layer_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return xfa_layer_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?xfa_layer_arrayLikeToArray(t,r):void 0}}function xfa_layer_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function xfa_layer_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,xfa_layer_toPropertyKey(i.key),i)}}function xfa_layer_toPropertyKey(t){var r=function xfa_layer_toPrimitive(t,r){if("object"!=xfa_layer_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=xfa_layer_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==xfa_layer_typeof(r)?r:String(r)}var qi=function(){function XfaLayer(){!function xfa_layer_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,XfaLayer)}!function xfa_layer_createClass(t,r,a){r&&xfa_layer_defineProperties(t.prototype,r);a&&xfa_layer_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(XfaLayer,null,[{key:"setupStorage",value:function setupStorage(t,r,a,i,o){var l=window.getFormValueFromAngular(t);l.value&&i.setValue(r,l);var c=l.value?l:i.getValue(r,{value:null});window.registerXFAField(t,c);t.addEventListener("updateFromAngular",(function(t){return i.setValue(r,{value:t.detail})}));switch(a.name){case"textarea":null!==c.value&&(t.textContent=c.value);if("print"===o)break;t.addEventListener("input",(function(a){window.updateAngularFormValue(t,{value:a.target.value});i.setValue(r,{value:a.target.value})}));break;case"input":if("radio"===a.attributes.type||"checkbox"===a.attributes.type){c.value===a.attributes.xfaOn?t.setAttribute("checked",!0):t.removeAttribute("checked");if("print"===o)break;t.addEventListener("change",(function(a){window.updateAngularFormValue(t,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")});i.setValue(r,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})}))}else{null!==c.value&&t.setAttribute("value",c.value);if("print"===o)break;t.addEventListener("input",(function(a){window.updateAngularFormValue(t,{value:a.target.value});i.setValue(r,{value:a.target.value})}))}break;case"select":if(null!==c.value){t.setAttribute("value",c.value);var u,h=xfa_layer_createForOfIteratorHelper(a.children);try{for(h.s();!(u=h.n()).done;){var d=u.value;d.attributes.value===c.value?d.attributes.selected=!0:d.attributes.hasOwnProperty("selected")&&delete d.attributes.selected}}catch(t){h.e(t)}finally{h.f()}}t.addEventListener("input",(function(a){var o=a.target.options,l=-1===o.selectedIndex?"":o[o.selectedIndex].value;window.updateAngularFormValue(t,{value:l});i.setValue(r,{value:l})}))}}},{key:"setAttributes",value:function setAttributes(t){var r=t.html,a=t.element,i=t.storage,o=void 0===i?null:i,l=t.intent,c=t.linkService,u=a.attributes,h=r instanceof HTMLAnchorElement;"radio"===u.type&&(u.name="".concat(u.name,"-").concat(l));for(var d=0,p=Object.entries(u);d<p.length;d++){var v=xfa_layer_slicedToArray(p[d],2),_=v[0],y=v[1];if(null!=y)switch(_){case"class":y.length&&r.setAttribute(_,y.join(" "));break;case"dataId":break;case"id":r.setAttribute("data-element-id",y);break;case"style":Object.assign(r.style,y);break;case"textContent":r.textContent=y;break;default:(!h||"href"!==_&&"newWindow"!==_)&&r.setAttribute(_,y)}}h&&c.addLinkAttributes(r,u.href,u.newWindow);o&&u.dataId&&this.setupStorage(r,u.dataId,a,o)}},{key:"render",value:function render(t){var r=t.annotationStorage,a=t.linkService,i=t.xfaHtml,o=t.intent||"display",l=document.createElement(i.name);i.attributes&&this.setAttributes({html:l,element:i,intent:o,linkService:a});var c="richText"!==o,u=t.div;u.append(l);if(t.viewport){var h="matrix(".concat(t.viewport.transform.join(","),")");u.style.transform=h}c&&u.setAttribute("class","xfaLayer xfaFont");var d=[];if(0===i.children.length){if(i.value){var p=document.createTextNode(i.value);l.append(p);c&&oi.shouldBuildText(i.name)&&d.push(p)}return{textDivs:d}}for(var v=[[i,-1,l]];v.length>0;){var _,y,g=xfa_layer_slicedToArray(v.at(-1),3),m=g[0],b=g[1],w=g[2];if(b+1!==m.children.length){var P=m.children[++v.at(-1)[1]];if(null!==P){var k=P.name;if("#text"!==k){var S=null!=P&&null!==(_=P.attributes)&&void 0!==_&&_.xmlns?document.createElementNS(P.attributes.xmlns,k):document.createElement(k);w.append(S);P.attributes&&this.setAttributes({html:S,element:P,storage:r,intent:o,linkService:a});if((null===(y=P.children)||void 0===y?void 0:y.length)>0)v.push([P,-1,S]);else if(P.value){var A=document.createTextNode(P.value);c&&oi.shouldBuildText(k)&&d.push(A);S.append(A)}}else{var x=document.createTextNode(P.value);d.push(x);w.append(x)}}}else v.pop()}var E,I=xfa_layer_createForOfIteratorHelper(u.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"));try{for(I.s();!(E=I.n()).done;){E.value.setAttribute("readOnly",!0)}}catch(t){I.e(t)}finally{I.f()}return{textDivs:d}}},{key:"update",value:function update(t){var r="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=r;t.div.hidden=!1}}]);return XfaLayer}();function annotation_layer_typeof(t){return annotation_layer_typeof="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},annotation_layer_typeof(t)}function annotation_layer_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */annotation_layer_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==annotation_layer_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(annotation_layer_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function annotation_layer_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function annotation_layer_get(){annotation_layer_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=annotation_layer_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}};return annotation_layer_get.apply(this,arguments)}function annotation_layer_toConsumableArray(t){return function annotation_layer_arrayWithoutHoles(t){if(Array.isArray(t))return annotation_layer_arrayLikeToArray(t)}(t)||function annotation_layer_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||annotation_layer_unsupportedIterableToArray(t)||function annotation_layer_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function annotation_layer_callSuper(t,r,a){return r=annotation_layer_getPrototypeOf(r),function annotation_layer_possibleConstructorReturn(t,r){if(r&&("object"===annotation_layer_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return annotation_layer_assertThisInitialized(t)}(t,annotation_layer_isNativeReflectConstruct()?Reflect.construct(r,a||[],annotation_layer_getPrototypeOf(t).constructor):r.apply(t,a))}function annotation_layer_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(annotation_layer_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function annotation_layer_getPrototypeOf(t){annotation_layer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return annotation_layer_getPrototypeOf(t)}function annotation_layer_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function annotation_layer_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&annotation_layer_setPrototypeOf(t,r)}function annotation_layer_setPrototypeOf(t,r){annotation_layer_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return annotation_layer_setPrototypeOf(t,r)}function annotation_layer_classPrivateMethodInitSpec(t,r){annotation_layer_checkPrivateRedeclaration(t,r);r.add(t)}function annotation_layer_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function annotation_layer_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=annotation_layer_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function annotation_layer_slicedToArray(t,r){return function annotation_layer_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function annotation_layer_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||annotation_layer_unsupportedIterableToArray(t,r)||function annotation_layer_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function annotation_layer_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return annotation_layer_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?annotation_layer_arrayLikeToArray(t,r):void 0}}function annotation_layer_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function annotation_layer_defineProperty(t,r,a){(r=annotation_layer_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function annotation_layer_classPrivateFieldInitSpec(t,r,a){annotation_layer_checkPrivateRedeclaration(t,r);r.set(t,a)}function annotation_layer_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function annotation_layer_classPrivateFieldGet(t,r){return function annotation_layer_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,annotation_layer_classExtractFieldDescriptor(t,r,"get"))}function annotation_layer_classPrivateFieldSet(t,r,a){!function annotation_layer_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,annotation_layer_classExtractFieldDescriptor(t,r,"set"),a);return a}function annotation_layer_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function annotation_layer_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function annotation_layer_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,annotation_layer_toPropertyKey(i.key),i)}}function annotation_layer_createClass(t,r,a){r&&annotation_layer_defineProperties(t.prototype,r);a&&annotation_layer_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function annotation_layer_toPropertyKey(t){var r=function annotation_layer_toPrimitive(t,r){if("object"!=annotation_layer_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=annotation_layer_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==annotation_layer_typeof(r)?r:String(r)}var Vi=1e3,Ki=new WeakSet;function getRectDims(t){return{width:t[2]-t[0],height:t[3]-t[1]}}var Yi=function(){function AnnotationElementFactory(){annotation_layer_classCallCheck(this,AnnotationElementFactory)}annotation_layer_createClass(AnnotationElementFactory,null,[{key:"create",value:function create(t){switch(t.data.annotationType){case T:return new eo(t);case I:return new to(t);case V:switch(t.data.fieldType){case"Tx":return new no(t);case"Btn":return t.data.radioButton?new oo(t):t.data.checkBox?new io(t):new so(t);case"Ch":return new lo(t);case"Sig":return new ao(t)}return new ro(t);case U:return new co(t);case C:return new Go(t);case M:return new Ro(t);case G:return new Do(t);case O:return new No(t);case L:return new Ho(t);case B:return new zo(t);case z:return new qo(t);case R:return new Bo(t);case D:return new Vo(t);case j:return new Ko(t);case N:return new Yo(t);case W:return new Xo(t);case H:return new $o(t);case q:return new Zo(t);default:return new $i(t)}}}]);return AnnotationElementFactory}(),Xi=new WeakMap,$i=function(){function AnnotationElement(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.isRenderable,i=void 0!==a&&a,o=r.ignoreBorder,l=void 0!==o&&o,c=r.createQuadrilaterals,u=void 0!==c&&c;annotation_layer_classCallCheck(this,AnnotationElement);annotation_layer_classPrivateFieldInitSpec(this,Xi,{writable:!0,value:!1});this.isRenderable=i;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;i&&(this.container=this._createContainer(l));u&&this._createQuadrilaterals()}annotation_layer_createClass(AnnotationElement,[{key:"hasPopupData",get:function get(){return AnnotationElement._hasPopupData(this.data)}},{key:"_createContainer",value:function _createContainer(t){var r=this.data,a=this.parent,i=a.page,o=a.viewport,l=document.createElement("section");l.setAttribute("data-annotation-id",r.id);this instanceof ro||(l.tabIndex=Vi);l.style.zIndex=this.parent.zIndex++;this.data.popupRef&&l.setAttribute("aria-haspopup","dialog");r.noRotate&&l.classList.add("norotate");var c=o.rawDims,u=c.pageWidth,h=c.pageHeight,d=c.pageX,p=c.pageY;if(!r.rect||this instanceof co){var v=r.rotation;r.hasOwnCanvas||0===v||this.setRotation(v,l);return l}var _=getRectDims(r.rect),y=_.width,g=_.height,m=fe.normalizeRect([r.rect[0],i.view[3]-r.rect[1]+i.view[1],r.rect[2],i.view[3]-r.rect[3]+i.view[1]]);if(!t&&r.borderStyle.width>0){l.style.borderWidth="".concat(r.borderStyle.width,"px");var b=r.borderStyle.horizontalCornerRadius,w=r.borderStyle.verticalCornerRadius;if(b>0||w>0){var P="calc(".concat(b,"px * var(--scale-factor)) / calc(").concat(w,"px * var(--scale-factor))");l.style.borderRadius=P}else if(this instanceof oo){var k="calc(".concat(y,"px * var(--scale-factor)) / calc(").concat(g,"px * var(--scale-factor))");l.style.borderRadius=k}switch(r.borderStyle.style){case K:l.style.borderStyle="solid";break;case Y:l.style.borderStyle="dashed";break;case X:warn("Unimplemented border style: beveled");break;case $:warn("Unimplemented border style: inset");break;case J:l.style.borderBottomStyle="solid"}var S=r.borderColor||null;if(S){annotation_layer_classPrivateFieldSet(this,Xi,!0);l.style.borderColor=fe.makeHexColor(0|S[0],0|S[1],0|S[2])}else l.style.borderWidth=0}l.style.left="".concat(100*(m[0]-d)/u,"%");l.style.top="".concat(100*(m[1]-p)/h,"%");var A=r.rotation;if(r.hasOwnCanvas||0===A){l.style.width="".concat(100*y/u,"%");l.style.height="".concat(100*g/h,"%")}else this.setRotation(A,l);return l}},{key:"setRotation",value:function setRotation(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(this.data.rect){var a,i,o=this.parent.viewport.rawDims,l=o.pageWidth,c=o.pageHeight,u=getRectDims(this.data.rect),h=u.width,d=u.height;if(t%180==0){a=100*h/l;i=100*d/c}else{a=100*d/l;i=100*h/c}r.style.width="".concat(a,"%");r.style.height="".concat(i,"%");r.setAttribute("data-main-rotation",(360-t)%360)}}},{key:"_commonActions",get:function get(){var t=this,r=function setColor(r,a,i){var o=i.detail[r],l=o[0],c=o.slice(1);i.target.style[a]=Ui["".concat(l,"_HTML")](c);t.annotationStorage.setValue(t.data.id,annotation_layer_defineProperty({},a,Ui["".concat(l,"_rgb")](c)))};return shadow(this,"_commonActions",{display:function display(r){var display=r.detail.display,a=display%2==1;t.container.style.visibility=a?"hidden":"visible";t.annotationStorage.setValue(t.data.id,{noView:a,noPrint:1===display||2===display})},print:function print(r){t.annotationStorage.setValue(t.data.id,{noPrint:!r.detail.print})},hidden:function hidden(r){var hidden=r.detail.hidden;t.container.style.visibility=hidden?"hidden":"visible";t.annotationStorage.setValue(t.data.id,{noPrint:hidden,noView:hidden})},focus:function focus(t){setTimeout((function(){return t.target.focus({preventScroll:!1})}),0)},userName:function userName(t){t.target.title=t.detail.userName},readonly:function readonly(t){t.target.disabled=t.detail.readonly},required:function required(r){t._setRequired(r.target,r.detail.required)},bgColor:function bgColor(t){r("bgColor","backgroundColor",t)},fillColor:function fillColor(t){r("fillColor","backgroundColor",t)},fgColor:function fgColor(t){r("fgColor","color",t)},textColor:function textColor(t){r("textColor","color",t)},borderColor:function borderColor(t){r("borderColor","borderColor",t)},strokeColor:function strokeColor(t){r("strokeColor","borderColor",t)},rotation:function rotation(r){var a=r.detail.rotation;t.setRotation(a);t.annotationStorage.setValue(t.data.id,{rotation:a})}})}},{key:"_dispatchEventFromSandbox",value:function _dispatchEventFromSandbox(t,r){for(var a=this._commonActions,i=0,o=Object.keys(r.detail);i<o.length;i++){var l=o[i],c=t[l]||a[l];null==c||c(r)}}},{key:"_setDefaultPropertiesFromJS",value:function _setDefaultPropertiesFromJS(t){if(this.enableScripting){var r=this.annotationStorage.getRawValue(this.data.id);if(r)for(var a=this._commonActions,i=0,o=Object.entries(r);i<o.length;i++){var l=annotation_layer_slicedToArray(o[i],2),c=l[0],u=l[1],h=a[c];if(h){h({detail:annotation_layer_defineProperty({},c,u),target:t});delete r[c]}}}}},{key:"_createQuadrilaterals",value:function _createQuadrilaterals(){if(this.container){var t=this.data.quadPoints;if(t){var r=annotation_layer_slicedToArray(this.data.rect,4),a=r[0],i=r[1],o=r[2],l=r[3];if(1===t.length){var c=annotation_layer_slicedToArray(t[0],3),u=c[1],h=u.x,d=u.y,p=c[2],v=p.x,_=p.y;if(o===h&&l===d&&a===v&&i===_)return}var y,g=this.container.style;if(annotation_layer_classPrivateFieldGet(this,Xi)){var m=g.borderColor,b=g.borderWidth;g.borderWidth=0;y=["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(m,'" stroke-width="').concat(b,'">')];this.container.classList.add("hasBorder")}var w=o-a,P=l-i,k=this.svgFactory,S=k.createElement("svg");S.classList.add("quadrilateralsContainer");S.setAttribute("width",0);S.setAttribute("height",0);var A=k.createElement("defs");S.append(A);var x=k.createElement("clipPath"),E="clippath_".concat(this.data.id);x.setAttribute("id",E);x.setAttribute("clipPathUnits","objectBoundingBox");A.append(x);var I,T=annotation_layer_createForOfIteratorHelper(t);try{for(T.s();!(I=T.n()).done;){var C,M=annotation_layer_slicedToArray(I.value,3),G=M[1],O=G.x,R=G.y,L=M[2],D=L.x,j=L.y,N=k.createElement("rect"),W=(D-a)/w,H=(l-R)/P,B=(O-D)/w,z=(R-j)/P;N.setAttribute("x",W);N.setAttribute("y",H);N.setAttribute("width",B);N.setAttribute("height",z);x.append(N);null===(C=y)||void 0===C||C.push('<rect vector-effect="non-scaling-stroke" x="'.concat(W,'" y="').concat(H,'" width="').concat(B,'" height="').concat(z,'"/>'))}}catch(t){T.e(t)}finally{T.f()}if(annotation_layer_classPrivateFieldGet(this,Xi)){y.push("</g></svg>')");g.backgroundImage=y.join("")}this.container.append(S);this.container.style.clipPath="url(#".concat(E,")")}}}},{key:"_createPopup",value:function _createPopup(){var t=this.container,r=this.data;t.setAttribute("aria-haspopup","dialog");var a=new co({data:{color:r.color,titleObj:r.titleObj,modificationDate:r.modificationDate,contentsObj:r.contentsObj,richText:r.richText,parentRect:r.rect,borderStyle:0,id:"popup_".concat(r.id),rotation:r.rotation},parent:this.parent,elements:[this]});this.parent.div.append(a.render())}},{key:"render",value:function render(){unreachable("Abstract method `AnnotationElement.render` called")}},{key:"_getElementsByName",value:function _getElementsByName(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=[];if(this._fieldObjects){var i=this._fieldObjects[t];if(i){var o,l=annotation_layer_createForOfIteratorHelper(i);try{for(l.s();!(o=l.n()).done;){var c=o.value,u=c.page,h=c.id,d=c.exportValues;if(-1!==u&&h!==r){var p="string"==typeof d?d:null,v=document.querySelector('[data-element-id="'.concat(h,'"]'));!v||Ki.has(v)?a.push({id:h,exportValue:p,domElement:v}):warn("_getElementsByName - element not allowed: ".concat(h))}}}catch(t){l.e(t)}finally{l.f()}}return a}var _,y=annotation_layer_createForOfIteratorHelper(document.getElementsByName(t));try{for(y.s();!(_=y.n()).done;){var g=_.value,m=g.exportValue,b=g.getAttribute("data-element-id");b!==r&&(Ki.has(g)&&a.push({id:b,exportValue:m,domElement:g}))}}catch(t){y.e(t)}finally{y.f()}return a}},{key:"show",value:function show(){var t;this.container&&(this.container.hidden=!1);null===(t=this.popup)||void 0===t||t.maybeShow()}},{key:"hide",value:function hide(){var t;this.container&&(this.container.hidden=!0);null===(t=this.popup)||void 0===t||t.forceHide()}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return this.container}},{key:"addHighlightArea",value:function addHighlightArea(){var t=this.getElementsToTriggerPopup();if(Array.isArray(t)){var r,a=annotation_layer_createForOfIteratorHelper(t);try{for(a.s();!(r=a.n()).done;){r.value.classList.add("highlightArea")}}catch(t){a.e(t)}finally{a.f()}}else t.classList.add("highlightArea")}},{key:"_isEditable",get:function get(){return!1}},{key:"_editOnDoubleClick",value:function _editOnDoubleClick(){var t=this;if(this._isEditable){var r=this.annotationEditorType,a=this.data.id;this.container.addEventListener("dblclick",(function(){var i;null===(i=t.linkService.eventBus)||void 0===i||i.dispatch("switchannotationeditormode",{source:t,mode:r,editId:a})}))}}}],[{key:"_hasPopupData",value:function _hasPopupData(t){var r=t.titleObj,a=t.contentsObj,i=t.richText;return!!(null!=r&&r.str||null!=a&&a.str||null!=i&&i.str)}}]);return AnnotationElement}(),Ji=new WeakSet,Qi=new WeakSet,Zi=new WeakSet,eo=function(t){annotation_layer_inherits(LinkAnnotationElement,t);function LinkAnnotationElement(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;annotation_layer_classCallCheck(this,LinkAnnotationElement);annotation_layer_classPrivateMethodInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,LinkAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!(null==a||!a.ignoreBorder),createQuadrilaterals:!0}])),Zi);annotation_layer_classPrivateMethodInitSpec(annotation_layer_assertThisInitialized(r),Qi);annotation_layer_classPrivateMethodInitSpec(annotation_layer_assertThisInitialized(r),Ji);r.isTooltipOnly=t.data.isTooltipOnly;return r}annotation_layer_createClass(LinkAnnotationElement,[{key:"render",value:function render(){var t=this.data,r=this.linkService,a=document.createElement("a");a.setAttribute("data-element-id",t.id);var i=!1;if(t.url){r.addLinkAttributes(a,t.url,t.newWindow);i=!0}else if(t.action){this._bindNamedAction(a,t.action);i=!0}else if(t.attachment){annotation_layer_classPrivateMethodGet(this,Qi,_bindAttachment2).call(this,a,t.attachment,t.attachmentDest);i=!0}else if(t.setOCGState){annotation_layer_classPrivateMethodGet(this,Zi,_bindSetOCGState2).call(this,a,t.setOCGState);i=!0}else if(t.dest){this._bindLink(a,t.dest);i=!0}else{if(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){this._bindJSAction(a,t);i=!0}if(t.resetForm){this._bindResetFormAction(a,t.resetForm);i=!0}else if(this.isTooltipOnly&&!i){this._bindLink(a,"");i=!0}}this.container.classList.add("linkAnnotation");i&&this.container.append(a);return this.container}},{key:"_bindLink",value:function _bindLink(t,r){var a=this;t.href=this.linkService.getDestinationHash(r);t.onclick=function(){r&&a.linkService.goToDestination(r);return!1};(r||""===r)&&annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this)}},{key:"_bindNamedAction",value:function _bindNamedAction(t,r){var a=this;t.href=this.linkService.getAnchorUrl("");t.onclick=function(){a.linkService.executeNamedAction(r);return!1};annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this)}},{key:"_bindJSAction",value:function _bindJSAction(t,r){var a=this;t.href=this.linkService.getAnchorUrl("");for(var i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]),o=function _loop(){var o=c[l],u=i.get(o);if(!u)return 1;t[u]=function(){var t;null===(t=a.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:a,detail:{id:r.id,name:o}});return!1}},l=0,c=Object.keys(r.actions);l<c.length;l++)o();t.onclick||(t.onclick=function(){return!1});annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this)}},{key:"_bindResetFormAction",value:function _bindResetFormAction(t,r){var a=this,i=t.onclick;i||(t.href=this.linkService.getAnchorUrl(""));annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this);if(this._fieldObjects)t.onclick=function(){null==i||i();var t=r.fields,o=r.refs,l=r.include,c=[];if(0!==t.length||0!==o.length){var u,h=new Set(o),d=annotation_layer_createForOfIteratorHelper(t);try{for(d.s();!(u=d.n()).done;){var p,v=u.value,_=annotation_layer_createForOfIteratorHelper(a._fieldObjects[v]||[]);try{for(_.s();!(p=_.n()).done;){var y=p.value.id;h.add(y)}}catch(t){_.e(t)}finally{_.f()}}}catch(t){d.e(t)}finally{d.f()}for(var g=0,m=Object.values(a._fieldObjects);g<m.length;g++){var b,w=annotation_layer_createForOfIteratorHelper(m[g]);try{for(w.s();!(b=w.n()).done;){var P=b.value;h.has(P.id)===l&&c.push(P)}}catch(t){w.e(t)}finally{w.f()}}}else for(var k=0,S=Object.values(a._fieldObjects);k<S.length;k++){var A=S[k];c.push.apply(c,annotation_layer_toConsumableArray(A))}for(var x=a.annotationStorage,E=[],I=0,T=c;I<T.length;I++){var C=T[I],M=C.id;E.push(M);switch(C.type){case"text":var G=C.defaultValue||"";x.setValue(M,{value:G});window.updateAngularFormValue(M,{value:G});break;case"checkbox":case"radiobutton":var O=C.defaultValue===C.exportValues;x.setValue(M,{value:O});window.updateAngularFormValue(M,{value:O});break;case"combobox":case"listbox":var R=C.defaultValue||"";x.setValue(M,{value:R});window.updateAngularFormValue(M,{value:R});break;default:continue}var L=document.querySelector('[data-element-id="'.concat(M,'"]'));L&&(Ki.has(L)?L.dispatchEvent(new Event("resetform")):warn("_bindResetFormAction - element not allowed: ".concat(M)))}if(a.enableScripting){var D;null===(D=a.linkService.eventBus)||void 0===D||D.dispatch("dispatcheventinsandbox",{source:a,detail:{id:"app",ids:E,name:"ResetForm"}})}return!1};else{warn('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');i||(t.onclick=function(){return!1})}}}]);return LinkAnnotationElement}($i);function _setInternalLink2(){this.container.setAttribute("data-internal-link","")}function _bindAttachment2(t,r){var a=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t.href=this.linkService.getAnchorUrl("");t.onclick=function(){var t;null===(t=a.downloadManager)||void 0===t||t.openOrDownloadData(r.content,r.filename,i);return!1};annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this)}function _bindSetOCGState2(t,r){var a=this;t.href=this.linkService.getAnchorUrl("");t.onclick=function(){a.linkService.executeSetOCGState(r);return!1};annotation_layer_classPrivateMethodGet(this,Ji,_setInternalLink2).call(this)}var to=function(t){annotation_layer_inherits(TextAnnotationElement,t);function TextAnnotationElement(t){annotation_layer_classCallCheck(this,TextAnnotationElement);return annotation_layer_callSuper(this,TextAnnotationElement,[t,{isRenderable:!0}])}annotation_layer_createClass(TextAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("textAnnotation");var t=document.createElement("img");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);return this.container}}]);return TextAnnotationElement}($i),ro=function(t){annotation_layer_inherits(WidgetAnnotationElement,t);function WidgetAnnotationElement(){annotation_layer_classCallCheck(this,WidgetAnnotationElement);return annotation_layer_callSuper(this,WidgetAnnotationElement,arguments)}annotation_layer_createClass(WidgetAnnotationElement,[{key:"render",value:function render(){this.data.alternativeText&&(this.container.title=this.data.alternativeText);return this.container}},{key:"showElementAndHideCanvas",value:function showElementAndHideCanvas(t){if(this.data.hasOwnCanvas){var r;"CANVAS"===(null===(r=t.previousSibling)||void 0===r?void 0:r.nodeName)&&(t.previousSibling.hidden=!0);t.hidden=!1}}},{key:"_getKeyModifier",value:function _getKeyModifier(t){return he.platform.isMac?t.metaKey:t.ctrlKey}},{key:"_setEventListener",value:function _setEventListener(t,r,a,i,o){var l=this;a.includes("mouse")?t.addEventListener(a,(function(t){var r;null===(r=l.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:l,detail:{id:l.data.id,name:i,value:o(t),shift:t.shiftKey,modifier:l._getKeyModifier(t)}})})):t.addEventListener(a,(function(t){var c;if("blur"===a){if(!r.focused||!t.relatedTarget)return;r.focused=!1}else if("focus"===a){if(r.focused)return;r.focused=!0}o&&(null===(c=l.linkService.eventBus)||void 0===c||c.dispatch("dispatcheventinsandbox",{source:l,detail:{id:l.data.id,name:i,value:o(t)}}))}))}},{key:"_setEventListeners",value:function _setEventListeners(t,r,a,i){var o,l=annotation_layer_createForOfIteratorHelper(a);try{for(l.s();!(o=l.n()).done;){var c,u=annotation_layer_slicedToArray(o.value,2),h=u[0],d=u[1];if("Action"===d||null!==(c=this.data.actions)&&void 0!==c&&c[d]){var p,v;"Focus"!==d&&"Blur"!==d||r||(r={focused:!1});this._setEventListener(t,r,h,d,i);"Focus"!==d||null!==(p=this.data.actions)&&void 0!==p&&p.Blur?"Blur"!==d||null!==(v=this.data.actions)&&void 0!==v&&v.Focus||this._setEventListener(t,r,"focus","Focus",null):this._setEventListener(t,r,"blur","Blur",null)}}}catch(t){l.e(t)}finally{l.f()}}},{key:"_setBackgroundColor",value:function _setBackgroundColor(t){var r=this.data.backgroundColor||null;t.style.backgroundColor=null===r?"transparent":fe.makeHexColor(r[0],r[1],r[2])}},{key:"_setTextStyle",value:function _setTextStyle(t){var r,a=this.data.defaultAppearanceData.fontColor,i=this.data.defaultAppearanceData.fontSize||9,o=t.style,c=function roundToOneDecimal(t){return Math.round(10*t)/10};if(this.data.multiLine){var u=Math.abs(this.data.rect[3]-this.data.rect[1]-2),h=u/(Math.round(u/(l*i))||1);r=Math.min(i,c(h/l))}else{var d=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(i,c(d/l))}o.fontSize="calc(".concat(r,"px * var(--scale-factor))");o.color=fe.makeHexColor(a[0],a[1],a[2]);null!==this.data.textAlignment&&(o.textAlign=["left","center","right"][this.data.textAlignment])}},{key:"_setRequired",value:function _setRequired(t,r){r?t.setAttribute("required",!0):t.removeAttribute("required");t.setAttribute("aria-required",r)}}]);return WidgetAnnotationElement}($i),no=function(t){annotation_layer_inherits(TextWidgetAnnotationElement,t);function TextWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,TextWidgetAnnotationElement);return annotation_layer_callSuper(this,TextWidgetAnnotationElement,[t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue}])}annotation_layer_createClass(TextWidgetAnnotationElement,[{key:"setPropertyOnSiblings",value:function setPropertyOnSiblings(t,r,a,i){var o,l=this.annotationStorage,c=annotation_layer_createForOfIteratorHelper(this._getElementsByName(t.name,t.id));try{for(c.s();!(o=c.n()).done;){var u=o.value;u.domElement&&(u.domElement[r]=a);l.setValue(u.id,annotation_layer_defineProperty({},i,a))}}catch(t){c.e(t)}finally{c.f()}}},{key:"render",value:function render(){var t=this,r=this.annotationStorage,a=this.data.id;this.container.classList.add("textWidgetAnnotation");var i=null;if(this.renderForms){var o,l=window.getFormValueFromAngular(this.data.fieldName),c=r.getValue(a,{value:this.data.fieldValue}),u=l.value?l:c;l!==c&&r.setValue(a,{value:l.value});var h=u.value||"",d=r.getValue(a,{charLimit:this.data.maxLen}).charLimit;d&&h.length>d&&(h=h.slice(0,d));var p=u.formattedValue||(null===(o=this.data.textContent)||void 0===o?void 0:o.join("\n"))||null;p&&this.data.comb&&(p=p.replaceAll(/\s+/g,""));var v={userValue:h,formattedValue:p,lastCommittedValue:null,commitKey:1,focused:!1};if(this.data.multiLine){var _;(i=document.createElement("textarea")).textContent=null!==(_=p)&&void 0!==_?_:h;this.data.doNotScroll&&(i.style.overflowY="hidden")}else{var y;(i=document.createElement("input")).type="text";i.setAttribute("value",null!==(y=p)&&void 0!==y?y:h);this.data.doNotScroll&&(i.style.overflowX="hidden")}this.data.hasOwnCanvas&&(i.hidden=!0);Ki.add(i);i.setAttribute("data-element-id",a);i.disabled=this.data.readOnly;i.name=this.data.fieldName;i.tabIndex=Vi;this._setRequired(i,this.data.required);d&&(i.maxLength=d);i.addEventListener("input",(function(o){r.setValue(a,{value:o.target.value});window.updateAngularFormValue(a,{value:o.target.value});t.setPropertyOnSiblings(i,"value",o.target.value,"value");v.formattedValue=null}));i.addEventListener("resetform",(function(r){var a,o=null!==(a=t.data.defaultFieldValue)&&void 0!==a?a:"";i.value=v.userValue=o;v.formattedValue=null}));var g=function blurListener(t){var r=v.formattedValue;null!=r&&(t.target.value=r);t.target.scrollLeft=0};window.registerAcroformField(a,i,u.value);i.addEventListener("updateFromAngular",(function(t){return r.setValue(a,{value:t.detail})}));if(this.enableScripting&&this.hasJSActions){var m;i.addEventListener("focus",(function(r){var a;if(!v.focused){var i=r.target;v.userValue&&(i.value=v.userValue);v.lastCommittedValue=i.value;v.commitKey=1;null!==(a=t.data.actions)&&void 0!==a&&a.Focus||(v.focused=!0)}}));i.addEventListener("updatefromsandbox",(function(i){t.showElementAndHideCanvas(i.target);var o={value:function value(t){var i;v.userValue=null!==(i=t.detail.value)&&void 0!==i?i:"";r.setValue(a,{value:v.userValue.toString()});window.updateAngularFormValue(a,{value:v.userValue.toString()});t.target.value=v.userValue},formattedValue:function formattedValue(t){var formattedValue=t.detail.formattedValue;v.formattedValue=formattedValue;null!=formattedValue&&t.target!==document.activeElement&&(t.target.value=formattedValue);r.setValue(a,{formattedValue:formattedValue});window.updateAngularFormValue(a,{formattedValue:formattedValue})},selRange:function selRange(t){var r;(r=t.target).setSelectionRange.apply(r,annotation_layer_toConsumableArray(t.detail.selRange))},charLimit:function charLimit(i){var o,charLimit=i.detail.charLimit,l=i.target;if(0!==charLimit){l.setAttribute("maxLength",charLimit);var c=v.userValue;if(c&&!(c.length<=charLimit)){c=c.slice(0,charLimit);l.value=v.userValue=c;r.setValue(a,{value:c});window.updateAngularFormValue(a,{value:c});null===(o=t.linkService.eventBus)||void 0===o||o.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:c,willCommit:!0,commitKey:1,selStart:l.selectionStart,selEnd:l.selectionEnd}})}}else l.removeAttribute("maxLength")}};t._dispatchEventFromSandbox(o,i)}));i.addEventListener("keydown",(function(r){var i;v.commitKey=1;var o=-1;"Escape"===r.key?o=0:"Enter"!==r.key||t.data.multiLine?"Tab"===r.key&&(v.commitKey=3):o=2;if(-1!==o){var l=r.target.value;if(v.lastCommittedValue!==l){v.lastCommittedValue=l;v.userValue=l;null===(i=t.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:l,willCommit:!0,commitKey:o,selStart:r.target.selectionStart,selEnd:r.target.selectionEnd}})}}}));var b=g;g=null;i.addEventListener("blur",(function(r){var i;if(v.focused&&r.relatedTarget){null!==(i=t.data.actions)&&void 0!==i&&i.Blur||(v.focused=!1);var o=r.target.value;v.userValue=o;if(v.lastCommittedValue!==o){var l;null===(l=t.linkService.eventBus)||void 0===l||l.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:o,willCommit:!0,commitKey:v.commitKey,selStart:r.target.selectionStart,selEnd:r.target.selectionEnd}})}b(r)}}));null!==(m=this.data.actions)&&void 0!==m&&m.Keystroke&&i.addEventListener("beforeinput",(function(r){var i;v.lastCommittedValue=null;var o=r.data,l=r.target,c=l.value,u=l.selectionStart,h=l.selectionEnd,d=u,p=h;switch(r.inputType){case"deleteWordBackward":var _=c.substring(0,u).match(/\w*[^\w]*$/);_&&(d-=_[0].length);break;case"deleteWordForward":var y=c.substring(u).match(/^[^\w]*\w*/);y&&(p+=y[0].length);break;case"deleteContentBackward":u===h&&(d-=1);break;case"deleteContentForward":u===h&&(p+=1)}r.preventDefault();null===(i=t.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:c,change:o||"",willCommit:!1,selStart:d,selEnd:p}})}));this._setEventListeners(i,v,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.value}))}g&&i.addEventListener("blur",g);if(this.data.comb){var w=(this.data.rect[2]-this.data.rect[0])/d;i.classList.add("comb");i.style.letterSpacing="calc(".concat(w,"px * var(--scale-factor) - 1ch)")}}else{(i=document.createElement("div")).textContent=this.data.fieldValue;i.style.verticalAlign="middle";i.style.display="table-cell";this.data.hasOwnCanvas&&(i.hidden=!0)}this._setTextStyle(i);this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}]);return TextWidgetAnnotationElement}(ro),ao=function(t){annotation_layer_inherits(SignatureWidgetAnnotationElement,t);function SignatureWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,SignatureWidgetAnnotationElement);return annotation_layer_callSuper(this,SignatureWidgetAnnotationElement,[t,{isRenderable:!!t.data.hasOwnCanvas}])}return annotation_layer_createClass(SignatureWidgetAnnotationElement)}(ro),io=function(t){annotation_layer_inherits(CheckboxWidgetAnnotationElement,t);function CheckboxWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,CheckboxWidgetAnnotationElement);return annotation_layer_callSuper(this,CheckboxWidgetAnnotationElement,[t,{isRenderable:t.renderForms}])}annotation_layer_createClass(CheckboxWidgetAnnotationElement,[{key:"render",value:function render(){var t=this,r=this.annotationStorage,a=this.data,i=a.id,o=window.getFormValueFromAngular(this.data.fieldName),l=r.getValue(i,{value:a.exportValue===a.fieldValue}).value,c=void 0;o.value&&(c=!0===o.value||o.value===a.exportValue);var u=void 0!==c?c:l,h=!1;if("string"==typeof u){u=u===a.exportValue;r.setValue(i,{value:u});h=!0}else if(void 0!==(null==o?void 0:o.value)&&o.value!==l){u=o.value===a.exportValue;r.setValue(i,{value:u})}this.container.classList.add("buttonWidgetAnnotation","checkBox");var d=document.createElement("input");Ki.add(d);d.setAttribute("data-element-id",i);d.disabled=a.readOnly;this._setRequired(d,this.data.required);d.type="checkbox";d.name=a.fieldName;u&&d.setAttribute("checked",!0);d.setAttribute("exportValue",a.exportValue);d.tabIndex=Vi;d.addEventListener("change",(function(o){var l,c=o.target,u=c.name,h=c.checked,d=annotation_layer_createForOfIteratorHelper(t._getElementsByName(u,i));try{for(d.s();!(l=d.n()).done;){var p=l.value,v=h&&p.exportValue===a.exportValue;p.domElement&&(p.domElement.checked=v);r.setValue(p.id,{value:v});window.updateAngularFormValue(i,{value:v})}}catch(t){d.e(t)}finally{d.f()}r.setValue(i,{value:h});window.updateAngularFormValue(i,{value:h})}));d.addEventListener("resetform",(function(t){var r=a.defaultFieldValue||"Off";t.target.checked=r===a.exportValue}));window.registerAcroformField(i,d,!!u&&a.exportValue);d.addEventListener("updateFromAngular",(function(t){return r.setValue(i,{value:t.detail})}));h&&window.updateAngularFormValue(i,{value:u});if(this.enableScripting&&this.hasJSActions){d.addEventListener("updatefromsandbox",(function(a){var o={value:function value(t){t.target.checked="Off"!==t.detail.value;r.setValue(i,{value:t.target.checked});window.updateAngularFormValue(i,{value:t.target.value})}};t._dispatchEventFromSandbox(o,a)}));this._setEventListeners(d,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.checked}))}this._setBackgroundColor(d);this._setDefaultPropertiesFromJS(d);this.container.append(d);return this.container}}]);return CheckboxWidgetAnnotationElement}(ro),oo=function(t){annotation_layer_inherits(RadioButtonWidgetAnnotationElement,t);function RadioButtonWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,RadioButtonWidgetAnnotationElement);return annotation_layer_callSuper(this,RadioButtonWidgetAnnotationElement,[t,{isRenderable:t.renderForms}])}annotation_layer_createClass(RadioButtonWidgetAnnotationElement,[{key:"render",value:function render(){var t,r=this;this.container.classList.add("buttonWidgetAnnotation","radioButton");var a=this.annotationStorage,i=this.data,o=i.id,l=window.getFormValueFromAngular(this.data.fieldName),c=a.getValue(o,{value:i.fieldValue===i.buttonValue}).value,u=null!==(t=l.value)&&void 0!==t?t:c;if("string"==typeof u||l!==c){u=u===i.buttonValue;a.setValue(o,{value:u})}else u&&window.updateAngularFormValue(o,{value:i.buttonValue});if(u){var h,d=annotation_layer_createForOfIteratorHelper(this._getElementsByName(i.fieldName,o));try{for(d.s();!(h=d.n()).done;){var p=h.value;a.setValue(p.id,{value:!1})}}catch(t){d.e(t)}finally{d.f()}}var v=document.createElement("input");Ki.add(v);v.setAttribute("data-element-id",o);v.disabled=i.readOnly;this._setRequired(v,this.data.required);v.type="radio";v.name=i.fieldName;u&&v.setAttribute("checked",!0);v.tabIndex=Vi;v.addEventListener("change",(function(t){var i,l=t.target,c=l.name,u=l.checked,h=annotation_layer_createForOfIteratorHelper(r._getElementsByName(c,o));try{for(h.s();!(i=h.n()).done;){var d=i.value;a.setValue(d.id,{value:!1});window.updateAngularFormValue(d.id,{value:!1})}}catch(t){h.e(t)}finally{h.f()}a.setValue(o,{value:u});window.updateAngularFormValue(o,{value:u})}));v.addEventListener("resetform",(function(t){var r=i.defaultFieldValue;t.target.checked=null!=r&&r===i.buttonValue}));window.registerAcroformField(o,v,u?i.buttonValue:void 0,i.buttonValue);v.addEventListener("updateFromAngular",(function(t){return a.setValue(o,{value:t.detail})}));if(this.enableScripting&&this.hasJSActions){var _=i.buttonValue;v.addEventListener("updatefromsandbox",(function(t){var i={value:function value(t){var i,l=_===t.detail.value,c=annotation_layer_createForOfIteratorHelper(r._getElementsByName(t.target.name));try{for(c.s();!(i=c.n()).done;){var u=i.value,h=l&&u.id===o;u.domElement&&(u.domElement.checked=h);a.setValue(u.id,{value:h});window.updateAngularFormValue(o,{value:h})}}catch(t){c.e(t)}finally{c.f()}}};r._dispatchEventFromSandbox(i,t)}));this._setEventListeners(v,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.checked}))}this._setBackgroundColor(v);this._setDefaultPropertiesFromJS(v);this.container.append(v);return this.container}}]);return RadioButtonWidgetAnnotationElement}(ro),so=function(t){annotation_layer_inherits(PushButtonWidgetAnnotationElement,t);function PushButtonWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,PushButtonWidgetAnnotationElement);return annotation_layer_callSuper(this,PushButtonWidgetAnnotationElement,[t,{ignoreBorder:t.data.hasAppearance}])}annotation_layer_createClass(PushButtonWidgetAnnotationElement,[{key:"render",value:function render(){var t=this,r=annotation_layer_get(annotation_layer_getPrototypeOf(PushButtonWidgetAnnotationElement.prototype),"render",this).call(this);r.classList.add("buttonWidgetAnnotation","pushButton");this.data.alternativeText&&(r.title=this.data.alternativeText);var a=r.lastChild;if(this.enableScripting&&this.hasJSActions&&a){this._setDefaultPropertiesFromJS(a);a.addEventListener("updatefromsandbox",(function(r){t._dispatchEventFromSandbox({},r)}))}return r}}]);return PushButtonWidgetAnnotationElement}(eo),lo=function(t){annotation_layer_inherits(ChoiceWidgetAnnotationElement,t);function ChoiceWidgetAnnotationElement(t){annotation_layer_classCallCheck(this,ChoiceWidgetAnnotationElement);return annotation_layer_callSuper(this,ChoiceWidgetAnnotationElement,[t,{isRenderable:t.renderForms}])}annotation_layer_createClass(ChoiceWidgetAnnotationElement,[{key:"render",value:function render(){var t=this;this.container.classList.add("choiceWidgetAnnotation");var r=this.annotationStorage,a=this.data.id,i=window.getFormValueFromAngular(this.data.fieldName),o=r.getValue(a,{value:this.data.fieldValue}),l=i.value?i:o;i!==o&&r.setValue(a,{value:i.value});var c=document.createElement("select");Ki.add(c);c.setAttribute("data-element-id",a);c.disabled=this.data.readOnly;this._setRequired(c,this.data.required);c.name=this.data.fieldName;c.tabIndex=Vi;var u=this.data.combo&&this.data.options.length>0;if(!this.data.combo){c.size=this.data.options.length;this.data.multiSelect&&(c.multiple=!0)}c.addEventListener("resetform",(function(r){var a,i=t.data.defaultFieldValue,o=annotation_layer_createForOfIteratorHelper(c.options);try{for(o.s();!(a=o.n()).done;){var l=a.value;l.selected=l.value===i}}catch(t){o.e(t)}finally{o.f()}}));var h,d=annotation_layer_createForOfIteratorHelper(this.data.options);try{for(d.s();!(h=d.n()).done;){var p=h.value,v=document.createElement("option");v.textContent=p.displayValue;v.value=p.exportValue;if(l.value.includes(p.exportValue)){v.setAttribute("selected",!0);u=!1}c.append(v)}}catch(t){d.e(t)}finally{d.f()}var _=null;if(u){var y=document.createElement("option");y.value=" ";y.setAttribute("hidden",!0);y.setAttribute("selected",!0);c.prepend(y);_=function removeEmptyEntry(){y.remove();c.removeEventListener("input",_);_=null};c.addEventListener("input",_)}var g=function getValue(t){var r=t?"value":"textContent",a=c.options;return c.multiple?Array.prototype.filter.call(a,(function(t){return t.selected})).map((function(t){return t[r]})):-1===a.selectedIndex?null:a[a.selectedIndex][r]},m=g(!1),b=function getItems(t){var r=t.target.options;return Array.prototype.map.call(r,(function(t){return{displayValue:t.textContent,exportValue:t.value}}))};window.registerAcroformField(a,c,m);c.addEventListener("updateFromAngular",(function(t){return r.setValue(a,{value:t.detail})}));if(this.enableScripting&&this.hasJSActions){c.addEventListener("updatefromsandbox",(function(i){var o={value:function value(t){var i;null===(i=_)||void 0===i||i();var o,value=t.detail.value,l=new Set(Array.isArray(value)?value:[value]),u=annotation_layer_createForOfIteratorHelper(c.options);try{for(u.s();!(o=u.n()).done;){var h=o.value;h.selected=l.has(h.value)}}catch(t){u.e(t)}finally{u.f()}r.setValue(a,{value:g(!0)});m=g(!1);window.updateAngularFormValue(a,{value:m})},multipleSelection:function multipleSelection(t){c.multiple=!0},remove:function remove(t){var i=c.options,o=t.detail.remove;i[o].selected=!1;c.remove(o);if(i.length>0){var l=Array.prototype.findIndex.call(i,(function(t){return t.selected}));-1===l&&(i[0].selected=!0)}r.setValue(a,{value:g(!0),items:b(t)});m=g(!1)},clear:function clear(t){for(;0!==c.length;)c.remove(0);r.setValue(a,{value:null,items:[]});m=g(!1);window.updateAngularFormValue(a,{value:m})},insert:function insert(t){var i=t.detail.insert,o=i.index,l=i.displayValue,u=i.exportValue,h=c.children[o],d=document.createElement("option");d.textContent=l;d.value=u;h?h.before(d):c.append(d);r.setValue(a,{value:g(!0),items:b(t)});m=g(!1);window.updateAngularFormValue(a,{value:m})},items:function items(t){for(var items=t.detail.items;0!==c.length;)c.remove(0);var i,o=annotation_layer_createForOfIteratorHelper(items);try{for(o.s();!(i=o.n()).done;){var l=i.value,u=l.displayValue,h=l.exportValue,d=document.createElement("option");d.textContent=u;d.value=h;c.append(d)}}catch(t){o.e(t)}finally{o.f()}c.options.length>0&&(c.options[0].selected=!0);r.setValue(a,{value:g(!0),items:b(t)});m=g(!1);window.updateAngularFormValue(a,{value:m})},indices:function indices(t){var i,indices=new Set(t.detail.indices),o=annotation_layer_createForOfIteratorHelper(t.target.options);try{for(o.s();!(i=o.n()).done;){var l=i.value;l.selected=indices.has(l.index)}}catch(t){o.e(t)}finally{o.f()}r.setValue(a,{value:g(!0)});m=g(!1);window.updateAngularFormValue(a,{value:m})},editable:function editable(t){t.target.disabled=!t.detail.editable}};t._dispatchEventFromSandbox(o,i)}));c.addEventListener("input",(function(i){var o,l=g(!0);r.setValue(a,{value:l});window.updateAngularFormValue(a,{value:l});i.preventDefault();null===(o=t.linkService.eventBus)||void 0===o||o.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:m,changeEx:l,willCommit:!1,commitKey:1,keyDown:!1}})}));this._setEventListeners(c,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(function(t){return t.target.value}))}else c.addEventListener("input",(function(t){r.setValue(a,{value:g(!0)});window.updateAngularFormValue(a,{value:g(!0)})}));this.data.combo&&this._setTextStyle(c);this._setBackgroundColor(c);this._setDefaultPropertiesFromJS(c);this.container.append(c);return this.container}}]);return ChoiceWidgetAnnotationElement}(ro),co=function(t){annotation_layer_inherits(PopupAnnotationElement,t);function PopupAnnotationElement(t){var r;annotation_layer_classCallCheck(this,PopupAnnotationElement);var a=t.data,i=t.elements;(r=annotation_layer_callSuper(this,PopupAnnotationElement,[t,{isRenderable:$i._hasPopupData(a)}])).elements=i;return r}annotation_layer_createClass(PopupAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("popupAnnotation");var t,r=new Mo({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}),a=[],i=annotation_layer_createForOfIteratorHelper(this.elements);try{for(i.s();!(t=i.n()).done;){var o=t.value;o.popup=r;a.push(o.data.id);o.addHighlightArea()}}catch(t){i.e(t)}finally{i.f()}this.container.setAttribute("aria-controls",a.map((function(t){return"".concat(ge).concat(t)})).join(","));return this.container}}]);return PopupAnnotationElement}($i),uo=new WeakMap,ho=new WeakMap,fo=new WeakMap,po=new WeakMap,vo=new WeakMap,_o=new WeakMap,yo=new WeakMap,go=new WeakMap,mo=new WeakMap,bo=new WeakMap,wo=new WeakMap,Po=new WeakMap,ko=new WeakMap,So=new WeakMap,Fo=new WeakMap,Ao=new WeakMap,xo=new WeakMap,Eo=new WeakSet,Io=new WeakSet,To=new WeakSet,Co=new WeakSet,Mo=function(){function PopupElement(t){var r=t.container,a=t.color,i=t.elements,o=t.titleObj,l=t.modificationDate,c=t.contentsObj,u=t.richText,h=t.parent,d=t.rect,p=t.parentRect,v=t.open;annotation_layer_classCallCheck(this,PopupElement);annotation_layer_classPrivateMethodInitSpec(this,Co);annotation_layer_classPrivateMethodInitSpec(this,To);annotation_layer_classPrivateMethodInitSpec(this,Io);annotation_layer_classPrivateMethodInitSpec(this,Eo);annotation_layer_classPrivateFieldInitSpec(this,uo,{writable:!0,value:annotation_layer_classPrivateMethodGet(this,Eo,_keyDown2).bind(this)});annotation_layer_classPrivateFieldInitSpec(this,ho,{writable:!0,value:annotation_layer_classPrivateMethodGet(this,Co,_hide2).bind(this)});annotation_layer_classPrivateFieldInitSpec(this,fo,{writable:!0,value:annotation_layer_classPrivateMethodGet(this,To,_show2).bind(this)});annotation_layer_classPrivateFieldInitSpec(this,po,{writable:!0,value:annotation_layer_classPrivateMethodGet(this,Io,_toggle2).bind(this)});annotation_layer_classPrivateFieldInitSpec(this,vo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,_o,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,yo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,go,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,mo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,bo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,wo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,Po,{writable:!0,value:!1});annotation_layer_classPrivateFieldInitSpec(this,ko,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,So,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,Fo,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,Ao,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,xo,{writable:!0,value:!1});annotation_layer_classPrivateFieldSet(this,_o,r);annotation_layer_classPrivateFieldSet(this,Ao,o);annotation_layer_classPrivateFieldSet(this,yo,c);annotation_layer_classPrivateFieldSet(this,Fo,u);annotation_layer_classPrivateFieldSet(this,bo,h);annotation_layer_classPrivateFieldSet(this,vo,a);annotation_layer_classPrivateFieldSet(this,So,d);annotation_layer_classPrivateFieldSet(this,wo,p);annotation_layer_classPrivateFieldSet(this,mo,i);annotation_layer_classPrivateFieldSet(this,go,Je.toDateObject(l));this.trigger=i.flatMap((function(t){return t.getElementsToTriggerPopup()}));var _,y=annotation_layer_createForOfIteratorHelper(this.trigger);try{for(y.s();!(_=y.n()).done;){var g=_.value;g.addEventListener("click",annotation_layer_classPrivateFieldGet(this,po));g.addEventListener("mouseenter",annotation_layer_classPrivateFieldGet(this,fo));g.addEventListener("mouseleave",annotation_layer_classPrivateFieldGet(this,ho));g.classList.add("popupTriggerArea")}}catch(t){y.e(t)}finally{y.f()}var m,b=annotation_layer_createForOfIteratorHelper(i);try{for(b.s();!(m=b.n()).done;){var w;null===(w=m.value.container)||void 0===w||w.addEventListener("keydown",annotation_layer_classPrivateFieldGet(this,uo))}}catch(t){b.e(t)}finally{b.f()}annotation_layer_classPrivateFieldGet(this,_o).hidden=!0;v&&annotation_layer_classPrivateMethodGet(this,Io,_toggle2).call(this)}annotation_layer_createClass(PopupElement,[{key:"render",value:function render(){if(!annotation_layer_classPrivateFieldGet(this,ko)){var t=annotation_layer_classPrivateFieldGet(this,bo),r=t.page.view,a=t.viewport.rawDims,i=a.pageWidth,o=a.pageHeight,l=a.pageX,c=a.pageY,u=annotation_layer_classPrivateFieldSet(this,ko,document.createElement("div"));u.className="popup";if(annotation_layer_classPrivateFieldGet(this,vo)){var h=u.style.outlineColor=fe.makeHexColor.apply(fe,annotation_layer_toConsumableArray(annotation_layer_classPrivateFieldGet(this,vo)));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))u.style.backgroundColor="color-mix(in srgb, ".concat(h," 30%, white)");else{u.style.backgroundColor=fe.makeHexColor.apply(fe,annotation_layer_toConsumableArray(annotation_layer_classPrivateFieldGet(this,vo).map((function(t){return Math.floor(.7*(255-t)+t)}))))}}var d=document.createElement("span");d.className="header";var p=document.createElement("h1");d.append(p);var v=annotation_layer_classPrivateFieldGet(this,Ao);p.dir=v.dir;p.textContent=v.str;u.append(d);if(annotation_layer_classPrivateFieldGet(this,go)){var _=document.createElement("span");_.classList.add("popupDate");_.setAttribute("data-l10n-id","pdfjs-annotation-date-string");_.setAttribute("data-l10n-args",JSON.stringify({date:annotation_layer_classPrivateFieldGet(this,go).toLocaleDateString(),time:annotation_layer_classPrivateFieldGet(this,go).toLocaleTimeString()}));d.append(_)}var y=annotation_layer_classPrivateFieldGet(this,yo),g=annotation_layer_classPrivateFieldGet(this,Fo);if(null==g||!g.str||null!=y&&y.str&&y.str!==g.str){var m=this._formatContents(y);u.append(m)}else{qi.render({xfaHtml:g.html,intent:"richText",div:u});u.lastChild.classList.add("richText","popupContent")}var b,w=!!annotation_layer_classPrivateFieldGet(this,wo),P=annotation_layer_classPrivateFieldGet(this,w?wo:So),k=annotation_layer_createForOfIteratorHelper(annotation_layer_classPrivateFieldGet(this,mo));try{for(k.s();!(b=k.n()).done;){var S=b.value;if(!P||null!==fe.intersect(S.data.rect,P)){P=S.data.rect;w=!0;break}}}catch(t){k.e(t)}finally{k.f()}var A=fe.normalizeRect([P[0],r[3]-P[1]+r[1],P[2],r[3]-P[3]+r[1]]),x=w?P[2]-P[0]+5:0,E=A[0]+x,I=A[1],T=annotation_layer_classPrivateFieldGet(this,_o).style;T.left="".concat(100*(E-l)/i,"%");T.top="".concat(100*(I-c)/o,"%");annotation_layer_classPrivateFieldGet(this,_o).append(u)}}},{key:"_formatContents",value:function _formatContents(t){var r=t.str,a=t.dir,i=document.createElement("p");i.classList.add("popupContent");i.dir=a;for(var o=r.split(/(?:\r\n?|\n)/),l=0,c=o.length;l<c;++l){var u=o[l];i.append(document.createTextNode(u));l<c-1&&i.append(document.createElement("br"))}return i}},{key:"forceHide",value:function forceHide(){annotation_layer_classPrivateFieldSet(this,xo,this.isVisible);annotation_layer_classPrivateFieldGet(this,xo)&&(annotation_layer_classPrivateFieldGet(this,_o).hidden=!0)}},{key:"maybeShow",value:function maybeShow(){if(annotation_layer_classPrivateFieldGet(this,xo)){annotation_layer_classPrivateFieldSet(this,xo,!1);annotation_layer_classPrivateFieldGet(this,_o).hidden=!1}}},{key:"isVisible",get:function get(){return!1===annotation_layer_classPrivateFieldGet(this,_o).hidden}}]);return PopupElement}();function _keyDown2(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&annotation_layer_classPrivateFieldGet(this,Po))&&annotation_layer_classPrivateMethodGet(this,Io,_toggle2).call(this)}function _toggle2(){annotation_layer_classPrivateFieldSet(this,Po,!annotation_layer_classPrivateFieldGet(this,Po));if(annotation_layer_classPrivateFieldGet(this,Po)){annotation_layer_classPrivateMethodGet(this,To,_show2).call(this);annotation_layer_classPrivateFieldGet(this,_o).addEventListener("click",annotation_layer_classPrivateFieldGet(this,po));annotation_layer_classPrivateFieldGet(this,_o).addEventListener("keydown",annotation_layer_classPrivateFieldGet(this,uo))}else{annotation_layer_classPrivateMethodGet(this,Co,_hide2).call(this);annotation_layer_classPrivateFieldGet(this,_o).removeEventListener("click",annotation_layer_classPrivateFieldGet(this,po));annotation_layer_classPrivateFieldGet(this,_o).removeEventListener("keydown",annotation_layer_classPrivateFieldGet(this,uo))}}function _show2(){annotation_layer_classPrivateFieldGet(this,ko)||this.render();if(this.isVisible)annotation_layer_classPrivateFieldGet(this,Po)&&annotation_layer_classPrivateFieldGet(this,_o).classList.add("focused");else{annotation_layer_classPrivateFieldGet(this,_o).hidden=!1;annotation_layer_classPrivateFieldGet(this,_o).style.zIndex=parseInt(annotation_layer_classPrivateFieldGet(this,_o).style.zIndex)+1e3}}function _hide2(){annotation_layer_classPrivateFieldGet(this,_o).classList.remove("focused");if(!annotation_layer_classPrivateFieldGet(this,Po)&&this.isVisible){annotation_layer_classPrivateFieldGet(this,_o).hidden=!0;annotation_layer_classPrivateFieldGet(this,_o).style.zIndex=parseInt(annotation_layer_classPrivateFieldGet(this,_o).style.zIndex)-1e3}}var Go=function(t){annotation_layer_inherits(FreeTextAnnotationElement,t);function FreeTextAnnotationElement(t){var r;annotation_layer_classCallCheck(this,FreeTextAnnotationElement);(r=annotation_layer_callSuper(this,FreeTextAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])).textContent=t.data.textContent;r.textPosition=t.data.textPosition;r.annotationEditorType=g.FREETEXT;return r}annotation_layer_createClass(FreeTextAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("freeTextAnnotation");if(this.textContent){var t=document.createElement("div");t.classList.add("annotationTextContent");t.setAttribute("role","comment");var r,a=annotation_layer_createForOfIteratorHelper(this.textContent);try{for(a.s();!(r=a.n()).done;){var i=r.value,o=document.createElement("span");o.textContent=i;t.append(o)}}catch(t){a.e(t)}finally{a.f()}this.container.append(t)}!this.data.popupRef&&this.hasPopupData&&this._createPopup();this._editOnDoubleClick();return this.container}},{key:"_isEditable",get:function get(){return this.data.hasOwnCanvas}}]);return FreeTextAnnotationElement}($i),Oo=new WeakMap,Ro=function(t){annotation_layer_inherits(LineAnnotationElement,t);function LineAnnotationElement(t){var r;annotation_layer_classCallCheck(this,LineAnnotationElement);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,LineAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])),Oo,{writable:!0,value:null});return r}annotation_layer_createClass(LineAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("lineAnnotation");var t=this.data,r=getRectDims(t.rect),a=r.width,i=r.height,o=this.svgFactory.create(a,i,!0),l=annotation_layer_classPrivateFieldSet(this,Oo,this.svgFactory.createElement("svg:line"));l.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]);l.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]);l.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]);l.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]);l.setAttribute("stroke-width",t.borderStyle.width||1);l.setAttribute("stroke","transparent");l.setAttribute("fill","transparent");o.append(l);this.container.append(o);!t.popupRef&&this.hasPopupData&&this._createPopup();return this.container}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,Oo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return LineAnnotationElement}($i),Lo=new WeakMap,Do=function(t){annotation_layer_inherits(SquareAnnotationElement,t);function SquareAnnotationElement(t){var r;annotation_layer_classCallCheck(this,SquareAnnotationElement);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,SquareAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])),Lo,{writable:!0,value:null});return r}annotation_layer_createClass(SquareAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("squareAnnotation");var t=this.data,r=getRectDims(t.rect),a=r.width,i=r.height,o=this.svgFactory.create(a,i,!0),l=t.borderStyle.width,c=annotation_layer_classPrivateFieldSet(this,Lo,this.svgFactory.createElement("svg:rect"));c.setAttribute("x",l/2);c.setAttribute("y",l/2);c.setAttribute("width",a-l);c.setAttribute("height",i-l);c.setAttribute("stroke-width",l||1);c.setAttribute("stroke","transparent");c.setAttribute("fill","transparent");o.append(c);this.container.append(o);!t.popupRef&&this.hasPopupData&&this._createPopup();return this.container}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,Lo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return SquareAnnotationElement}($i),jo=new WeakMap,No=function(t){annotation_layer_inherits(CircleAnnotationElement,t);function CircleAnnotationElement(t){var r;annotation_layer_classCallCheck(this,CircleAnnotationElement);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,CircleAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])),jo,{writable:!0,value:null});return r}annotation_layer_createClass(CircleAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("circleAnnotation");var t=this.data,r=getRectDims(t.rect),a=r.width,i=r.height,o=this.svgFactory.create(a,i,!0),l=t.borderStyle.width,c=annotation_layer_classPrivateFieldSet(this,jo,this.svgFactory.createElement("svg:ellipse"));c.setAttribute("cx",a/2);c.setAttribute("cy",i/2);c.setAttribute("rx",a/2-l/2);c.setAttribute("ry",i/2-l/2);c.setAttribute("stroke-width",l||1);c.setAttribute("stroke","transparent");c.setAttribute("fill","transparent");o.append(c);this.container.append(o);!t.popupRef&&this.hasPopupData&&this._createPopup();return this.container}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,jo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return CircleAnnotationElement}($i),Wo=new WeakMap,Ho=function(t){annotation_layer_inherits(PolylineAnnotationElement,t);function PolylineAnnotationElement(t){var r;annotation_layer_classCallCheck(this,PolylineAnnotationElement);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,PolylineAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])),Wo,{writable:!0,value:null});r.containerClassName="polylineAnnotation";r.svgElementName="svg:polyline";return r}annotation_layer_createClass(PolylineAnnotationElement,[{key:"render",value:function render(){this.container.classList.add(this.containerClassName);var t,r=this.data,a=getRectDims(r.rect),i=a.width,o=a.height,l=this.svgFactory.create(i,o,!0),c=[],u=annotation_layer_createForOfIteratorHelper(r.vertices);try{for(u.s();!(t=u.n()).done;){var h=t.value,d=h.x-r.rect[0],p=r.rect[3]-h.y;c.push(d+","+p)}}catch(t){u.e(t)}finally{u.f()}c=c.join(" ");var v=annotation_layer_classPrivateFieldSet(this,Wo,this.svgFactory.createElement(this.svgElementName));v.setAttribute("points",c);v.setAttribute("stroke-width",r.borderStyle.width||1);v.setAttribute("stroke","transparent");v.setAttribute("fill","transparent");l.append(v);this.container.append(l);!r.popupRef&&this.hasPopupData&&this._createPopup();return this.container}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,Wo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return PolylineAnnotationElement}($i),Bo=function(t){annotation_layer_inherits(PolygonAnnotationElement,t);function PolygonAnnotationElement(t){var r;annotation_layer_classCallCheck(this,PolygonAnnotationElement);(r=annotation_layer_callSuper(this,PolygonAnnotationElement,[t])).containerClassName="polygonAnnotation";r.svgElementName="svg:polygon";return r}return annotation_layer_createClass(PolygonAnnotationElement)}(Ho),zo=function(t){annotation_layer_inherits(CaretAnnotationElement,t);function CaretAnnotationElement(t){annotation_layer_classCallCheck(this,CaretAnnotationElement);return annotation_layer_callSuper(this,CaretAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])}annotation_layer_createClass(CaretAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("caretAnnotation");!this.data.popupRef&&this.hasPopupData&&this._createPopup();return this.container}}]);return CaretAnnotationElement}($i),Uo=new WeakMap,qo=function(t){annotation_layer_inherits(InkAnnotationElement,t);function InkAnnotationElement(t){var r;annotation_layer_classCallCheck(this,InkAnnotationElement);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(r=annotation_layer_callSuper(this,InkAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])),Uo,{writable:!0,value:[]});r.containerClassName="inkAnnotation";r.svgElementName="svg:polyline";r.annotationEditorType=g.INK;return r}annotation_layer_createClass(InkAnnotationElement,[{key:"render",value:function render(){this.container.classList.add(this.containerClassName);var t,r=this.data,a=getRectDims(r.rect),i=a.width,o=a.height,l=this.svgFactory.create(i,o,!0),c=annotation_layer_createForOfIteratorHelper(r.inkLists);try{for(c.s();!(t=c.n()).done;){var u,h=t.value,d=[],p=annotation_layer_createForOfIteratorHelper(h);try{for(p.s();!(u=p.n()).done;){var v=u.value,_=v.x-r.rect[0],y=r.rect[3]-v.y;d.push("".concat(_,",").concat(y))}}catch(t){p.e(t)}finally{p.f()}d=d.join(" ");var g=this.svgFactory.createElement(this.svgElementName);annotation_layer_classPrivateFieldGet(this,Uo).push(g);g.setAttribute("points",d);g.setAttribute("stroke-width",r.borderStyle.width||1);g.setAttribute("stroke","transparent");g.setAttribute("fill","transparent");!r.popupRef&&this.hasPopupData&&this._createPopup();l.append(g)}}catch(t){c.e(t)}finally{c.f()}this.container.append(l);return this.container}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,Uo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return InkAnnotationElement}($i),Vo=function(t){annotation_layer_inherits(HighlightAnnotationElement,t);function HighlightAnnotationElement(t){annotation_layer_classCallCheck(this,HighlightAnnotationElement);return annotation_layer_callSuper(this,HighlightAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}])}annotation_layer_createClass(HighlightAnnotationElement,[{key:"render",value:function render(){!this.data.popupRef&&this.hasPopupData&&this._createPopup();this.container.classList.add("highlightAnnotation");return this.container}}]);return HighlightAnnotationElement}($i),Ko=function(t){annotation_layer_inherits(UnderlineAnnotationElement,t);function UnderlineAnnotationElement(t){annotation_layer_classCallCheck(this,UnderlineAnnotationElement);return annotation_layer_callSuper(this,UnderlineAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}])}annotation_layer_createClass(UnderlineAnnotationElement,[{key:"render",value:function render(){!this.data.popupRef&&this.hasPopupData&&this._createPopup();this.container.classList.add("underlineAnnotation");return this.container}}]);return UnderlineAnnotationElement}($i),Yo=function(t){annotation_layer_inherits(SquigglyAnnotationElement,t);function SquigglyAnnotationElement(t){annotation_layer_classCallCheck(this,SquigglyAnnotationElement);return annotation_layer_callSuper(this,SquigglyAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}])}annotation_layer_createClass(SquigglyAnnotationElement,[{key:"render",value:function render(){!this.data.popupRef&&this.hasPopupData&&this._createPopup();this.container.classList.add("squigglyAnnotation");return this.container}}]);return SquigglyAnnotationElement}($i),Xo=function(t){annotation_layer_inherits(StrikeOutAnnotationElement,t);function StrikeOutAnnotationElement(t){annotation_layer_classCallCheck(this,StrikeOutAnnotationElement);return annotation_layer_callSuper(this,StrikeOutAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}])}annotation_layer_createClass(StrikeOutAnnotationElement,[{key:"render",value:function render(){!this.data.popupRef&&this.hasPopupData&&this._createPopup();this.container.classList.add("strikeoutAnnotation");return this.container}}]);return StrikeOutAnnotationElement}($i),$o=function(t){annotation_layer_inherits(StampAnnotationElement,t);function StampAnnotationElement(t){annotation_layer_classCallCheck(this,StampAnnotationElement);return annotation_layer_callSuper(this,StampAnnotationElement,[t,{isRenderable:!0,ignoreBorder:!0}])}annotation_layer_createClass(StampAnnotationElement,[{key:"render",value:function render(){this.container.classList.add("stampAnnotation");!this.data.popupRef&&this.hasPopupData&&this._createPopup();return this.container}}]);return StampAnnotationElement}($i),Jo=new WeakMap,Qo=new WeakSet,Zo=function(t){annotation_layer_inherits(FileAttachmentAnnotationElement,t);function FileAttachmentAnnotationElement(t){var r,a;annotation_layer_classCallCheck(this,FileAttachmentAnnotationElement);annotation_layer_classPrivateMethodInitSpec(annotation_layer_assertThisInitialized(a=annotation_layer_callSuper(this,FileAttachmentAnnotationElement,[t,{isRenderable:!0}])),Qo);annotation_layer_classPrivateFieldInitSpec(annotation_layer_assertThisInitialized(a),Jo,{writable:!0,value:null});var i=a.data.file,o=i.filename,l=i.content;a.filename=getFilenameFromUrl(o,!0);a.content=l;null===(r=a.linkService.eventBus)||void 0===r||r.dispatch("fileattachmentannotation",{source:annotation_layer_assertThisInitialized(a),filename:o,content:l});return a}annotation_layer_createClass(FileAttachmentAnnotationElement,[{key:"render",value:function render(){var t=this;this.container.classList.add("fileAttachmentAnnotation");var r,a=this.container,i=this.data;if(i.hasAppearance||0===i.fillAlpha)r=document.createElement("div");else{(r=document.createElement("img")).src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(i.name)?"paperclip":"pushpin",".svg");i.fillAlpha&&i.fillAlpha<1&&(r.style="filter: opacity(".concat(Math.round(100*i.fillAlpha),"%);"))}r.addEventListener("dblclick",annotation_layer_classPrivateMethodGet(this,Qo,_download2).bind(this));annotation_layer_classPrivateFieldSet(this,Jo,r);var o=he.platform.isMac;a.addEventListener("keydown",(function(r){"Enter"===r.key&&(o?r.metaKey:r.ctrlKey)&&annotation_layer_classPrivateMethodGet(t,Qo,_download2).call(t)}));!i.popupRef&&this.hasPopupData?this._createPopup():r.classList.add("popupTriggerArea");a.append(r);return a}},{key:"getElementsToTriggerPopup",value:function getElementsToTriggerPopup(){return annotation_layer_classPrivateFieldGet(this,Jo)}},{key:"addHighlightArea",value:function addHighlightArea(){this.container.classList.add("highlightArea")}}]);return FileAttachmentAnnotationElement}($i);function _download2(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.content,this.filename)}var es,ts=new WeakMap,rs=new WeakMap,ns=new WeakMap,as=new WeakSet,is=new WeakSet,os=function(){function AnnotationLayer(t){var r=t.div,a=t.accessibilityManager,i=t.annotationCanvasMap,o=t.page,l=t.viewport;annotation_layer_classCallCheck(this,AnnotationLayer);annotation_layer_classPrivateMethodInitSpec(this,is);annotation_layer_classPrivateMethodInitSpec(this,as);annotation_layer_classPrivateFieldInitSpec(this,ts,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,rs,{writable:!0,value:null});annotation_layer_classPrivateFieldInitSpec(this,ns,{writable:!0,value:new Map});this.div=r;annotation_layer_classPrivateFieldSet(this,ts,a);annotation_layer_classPrivateFieldSet(this,rs,i);this.page=o;this.viewport=l;this.zIndex=0}annotation_layer_createClass(AnnotationLayer,[{key:"render",value:(t=function annotation_layer_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){annotation_layer_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){annotation_layer_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}(annotation_layer_regeneratorRuntime().mark((function _callee3(t){var r,a,i,o,l,c,u,h,d,p,v,_,y,g,m;return annotation_layer_regeneratorRuntime().wrap((function _callee3$(b){for(;;)switch(b.prev=b.next){case 0:r=t.annotations;setLayerDimensions(a=this.div,this.viewport);i=new Map;o={data:null,layer:a,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new qe,annotationStorage:t.annotationStorage||new kn,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};l=annotation_layer_createForOfIteratorHelper(r);b.prev=6;l.s();case 8:if((c=l.n()).done){b.next=34;break}if(!(u=c.value).noHTML){b.next=12;break}return b.abrupt("continue",32);case 12:if(h=u.annotationType===U){b.next=19;break}d=getRectDims(u.rect),p=d.width,v=d.height;if(!(p<=0||v<=0)){b.next=17;break}return b.abrupt("continue",32);case 17:b.next=23;break;case 19:if(_=i.get(u.id)){b.next=22;break}return b.abrupt("continue",32);case 22:o.elements=_;case 23:o.data=u;if((y=Yi.create(o)).isRenderable){b.next=27;break}return b.abrupt("continue",32);case 27:!h&&u.popupRef&&((g=i.get(u.popupRef))?g.push(y):i.set(u.popupRef,[y]));y.annotationEditorType>0&&annotation_layer_classPrivateFieldGet(this,ns).set(y.data.id,y);m=y.render();u.hidden&&(m.style.visibility="hidden");annotation_layer_classPrivateMethodGet(this,as,_appendElement2).call(this,m,u.id);case 32:b.next=8;break;case 34:b.next=39;break;case 36:b.prev=36;b.t0=b.catch(6);l.e(b.t0);case 39:b.prev=39;l.f();return b.finish(39);case 42:annotation_layer_classPrivateMethodGet(this,is,_setAnnotationCanvasMap2).call(this);case 43:case"end":return b.stop()}}),_callee3,this,[[6,36,39,42]])}))),function render(r){return t.apply(this,arguments)})},{key:"update",value:function update(t){var r=t.viewport,a=this.div;this.viewport=r;setLayerDimensions(a,{rotation:r.rotation});annotation_layer_classPrivateMethodGet(this,is,_setAnnotationCanvasMap2).call(this);a.hidden=!1}},{key:"getEditableAnnotations",value:function getEditableAnnotations(){return Array.from(annotation_layer_classPrivateFieldGet(this,ns).values())}},{key:"getEditableAnnotation",value:function getEditableAnnotation(t){return annotation_layer_classPrivateFieldGet(this,ns).get(t)}}]);var t;return AnnotationLayer}();function _appendElement2(t,r){var a,i=t.firstChild||t;i.id="".concat(ge).concat(r);this.div.append(t);null===(a=annotation_layer_classPrivateFieldGet(this,ts))||void 0===a||a.moveElementInDOM(this.div,t,i,!1)}function _setAnnotationCanvasMap2(){if(annotation_layer_classPrivateFieldGet(this,rs)){var t,r=this.div,a=annotation_layer_createForOfIteratorHelper(annotation_layer_classPrivateFieldGet(this,rs));try{for(a.s();!(t=a.n()).done;){var i=annotation_layer_slicedToArray(t.value,2),o=i[0],l=i[1],c=r.querySelector('[data-annotation-id="'.concat(o,'"]'));if(c){var u=c.firstChild;u?"CANVAS"===u.nodeName?u.replaceWith(l):u.before(l):c.append(l)}}}catch(t){a.e(t)}finally{a.f()}annotation_layer_classPrivateFieldGet(this,rs).clear()}}function freetext_typeof(t){return freetext_typeof="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},freetext_typeof(t)}function freetext_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=freetext_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function freetext_toConsumableArray(t){return function freetext_arrayWithoutHoles(t){if(Array.isArray(t))return freetext_arrayLikeToArray(t)}(t)||function freetext_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||freetext_unsupportedIterableToArray(t)||function freetext_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function freetext_slicedToArray(t,r){return function freetext_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function freetext_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||freetext_unsupportedIterableToArray(t,r)||function freetext_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function freetext_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return freetext_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?freetext_arrayLikeToArray(t,r):void 0}}function freetext_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function ownKeys(t,r){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,i)}return a}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(a),!0).forEach((function(r){freetext_defineProperty(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}function freetext_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,freetext_toPropertyKey(i.key),i)}}function freetext_callSuper(t,r,a){return r=freetext_getPrototypeOf(r),function freetext_possibleConstructorReturn(t,r){if(r&&("object"===freetext_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return freetext_assertThisInitialized(t)}(t,freetext_isNativeReflectConstruct()?Reflect.construct(r,a||[],freetext_getPrototypeOf(t).constructor):r.apply(t,a))}function freetext_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(freetext_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function freetext_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function freetext_get(){freetext_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function freetext_superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=freetext_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}};return freetext_get.apply(this,arguments)}function freetext_getPrototypeOf(t){freetext_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return freetext_getPrototypeOf(t)}function freetext_setPrototypeOf(t,r){freetext_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return freetext_setPrototypeOf(t,r)}function freetext_classPrivateMethodInitSpec(t,r){freetext_checkPrivateRedeclaration(t,r);r.add(t)}function freetext_defineProperty(t,r,a){(r=freetext_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function freetext_toPropertyKey(t){var r=function freetext_toPrimitive(t,r){if("object"!=freetext_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=freetext_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==freetext_typeof(r)?r:String(r)}function freetext_classPrivateFieldInitSpec(t,r,a){freetext_checkPrivateRedeclaration(t,r);r.set(t,a)}function freetext_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function freetext_classStaticPrivateMethodGet(t,r,a){!function freetext_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function freetext_classPrivateFieldGet(t,r){return function freetext_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,freetext_classExtractFieldDescriptor(t,r,"get"))}function freetext_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function freetext_classPrivateFieldSet(t,r,a){!function freetext_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,freetext_classExtractFieldDescriptor(t,r,"set"),a);return a}function freetext_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var ss=new WeakMap,ls=new WeakMap,cs=new WeakMap,us=new WeakMap,hs=new WeakMap,ds=new WeakMap,fs=new WeakMap,ps=new WeakMap,vs=new WeakMap,_s=new WeakSet,ys=new WeakSet,gs=new WeakSet,ms=new WeakSet,bs=new WeakSet,ws=new WeakSet,Ps=new WeakSet,ks=new WeakSet,Ss=function(t){!function freetext_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&freetext_setPrototypeOf(t,r)}(FreeTextEditor,t);function FreeTextEditor(t){var r;!function freetext_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,FreeTextEditor);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r=freetext_callSuper(this,FreeTextEditor,[_objectSpread(_objectSpread({},t),{},{name:"freeTextEditor"})])),ks);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),Ps);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),ws);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),bs);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),ms);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),gs);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),ys);freetext_classPrivateMethodInitSpec(freetext_assertThisInitialized(r),_s);freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),ss,{writable:!0,value:r.editorDivBlur.bind(freetext_assertThisInitialized(r))});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),ls,{writable:!0,value:r.editorDivFocus.bind(freetext_assertThisInitialized(r))});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),cs,{writable:!0,value:r.editorDivInput.bind(freetext_assertThisInitialized(r))});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),us,{writable:!0,value:r.editorDivKeydown.bind(freetext_assertThisInitialized(r))});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),hs,{writable:!0,value:void 0});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),ds,{writable:!0,value:""});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),fs,{writable:!0,value:"".concat(r.id,"-editor")});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),ps,{writable:!0,value:void 0});freetext_classPrivateFieldInitSpec(freetext_assertThisInitialized(r),vs,{writable:!0,value:null});freetext_classPrivateFieldSet(freetext_assertThisInitialized(r),hs,t.color||FreeTextEditor._defaultColor||fn._defaultLineColor);freetext_classPrivateFieldSet(freetext_assertThisInitialized(r),ps,t.fontSize||FreeTextEditor._defaultFontSize);return r}!function freetext_createClass(t,r,a){r&&freetext_defineProperties(t.prototype,r);a&&freetext_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(FreeTextEditor,[{key:"updateParams",value:function updateParams(t,r){switch(t){case m.FREETEXT_SIZE:freetext_classPrivateMethodGet(this,_s,_updateFontSize2).call(this,r);break;case m.FREETEXT_COLOR:freetext_classPrivateMethodGet(this,ys,_updateColor2).call(this,r)}}},{key:"propertiesToUpdate",get:function get(){return[[m.FREETEXT_SIZE,freetext_classPrivateFieldGet(this,ps)],[m.FREETEXT_COLOR,freetext_classPrivateFieldGet(this,hs)]]}},{key:"_translateEmpty",value:function _translateEmpty(t,r){this._uiManager.translateSelectedEditors(t,r,!0)}},{key:"getInitialTranslation",value:function getInitialTranslation(){var t=this.parentScale;return[-FreeTextEditor._internalPadding*t,-(FreeTextEditor._internalPadding+freetext_classPrivateFieldGet(this,ps))*t]}},{key:"rebuild",value:function rebuild(){if(this.parent){freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"rebuild",this).call(this);null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}}},{key:"enableEditMode",value:function enableEditMode(){if(!this.isInEditMode()){this.parent.setEditingState(!1);this.parent.updateToolbar(g.FREETEXT);freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"enableEditMode",this).call(this);this.overlayDiv.classList.remove("enabled");this.editorDiv.contentEditable=!0;this._isDraggable=!1;this.div.removeAttribute("aria-activedescendant");this.editorDiv.addEventListener("keydown",freetext_classPrivateFieldGet(this,us));this.editorDiv.addEventListener("focus",freetext_classPrivateFieldGet(this,ls));this.editorDiv.addEventListener("blur",freetext_classPrivateFieldGet(this,ss));this.editorDiv.addEventListener("input",freetext_classPrivateFieldGet(this,cs))}}},{key:"disableEditMode",value:function disableEditMode(){if(this.isInEditMode()){this.parent.setEditingState(!0);freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"disableEditMode",this).call(this);this.overlayDiv.classList.add("enabled");this.editorDiv.contentEditable=!1;this.div.setAttribute("aria-activedescendant",freetext_classPrivateFieldGet(this,fs));this._isDraggable=!0;this.editorDiv.removeEventListener("keydown",freetext_classPrivateFieldGet(this,us));this.editorDiv.removeEventListener("focus",freetext_classPrivateFieldGet(this,ls));this.editorDiv.removeEventListener("blur",freetext_classPrivateFieldGet(this,ss));this.editorDiv.removeEventListener("input",freetext_classPrivateFieldGet(this,cs));this.div.focus({preventScroll:!0});this.isEditing=!1;this.parent.div.classList.add("freetextEditing")}}},{key:"focusin",value:function focusin(t){if(this._focusEventsAllowed){freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"focusin",this).call(this,t);t.target!==this.editorDiv&&this.editorDiv.focus()}}},{key:"onceAdded",value:function onceAdded(){var t;if(this.width)freetext_classPrivateMethodGet(this,ks,_cheatInitialRect2).call(this);else{this.enableEditMode();this.editorDiv.focus();null!==(t=this._initialOptions)&&void 0!==t&&t.isCentered&&this.center();this._initialOptions=null}}},{key:"isEmpty",value:function isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}},{key:"remove",value:function remove(){this.isEditing=!1;if(this.parent){this.parent.setEditingState(!0);this.parent.div.classList.add("freetextEditing")}freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"remove",this).call(this)}},{key:"commit",value:function commit(){var t=this;if(this.isInEditMode()){freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"commit",this).call(this);this.disableEditMode();var r=freetext_classPrivateFieldGet(this,ds),a=freetext_classPrivateFieldSet(this,ds,freetext_classPrivateMethodGet(this,gs,_extractText2).call(this).trimEnd());if(r!==a){var i=function setText(r){freetext_classPrivateFieldSet(t,ds,r);if(r){freetext_classPrivateMethodGet(t,bs,_setContent2).call(t);t._uiManager.rebuild(t);freetext_classPrivateMethodGet(t,ms,_setEditorDimensions2).call(t)}else t.remove()};this.addCommands({cmd:function cmd(){i(a)},undo:function undo(){i(r)},mustExec:!1});freetext_classPrivateMethodGet(this,ms,_setEditorDimensions2).call(this)}}}},{key:"shouldGetKeyboardEvents",value:function shouldGetKeyboardEvents(){return this.isInEditMode()}},{key:"enterInEditMode",value:function enterInEditMode(){this.enableEditMode();this.editorDiv.focus()}},{key:"dblclick",value:function dblclick(t){this.enterInEditMode()}},{key:"keydown",value:function keydown(t){if(t.target===this.div&&"Enter"===t.key){this.enterInEditMode();t.preventDefault()}}},{key:"editorDivKeydown",value:function editorDivKeydown(t){FreeTextEditor._keyboardManager.exec(this,t)}},{key:"editorDivFocus",value:function editorDivFocus(t){this.isEditing=!0}},{key:"editorDivBlur",value:function editorDivBlur(t){this.isEditing=!1}},{key:"editorDivInput",value:function editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}},{key:"disableEditing",value:function disableEditing(){this.editorDiv.setAttribute("role","comment");this.editorDiv.removeAttribute("aria-multiline")}},{key:"enableEditing",value:function enableEditing(){this.editorDiv.setAttribute("role","textbox");this.editorDiv.setAttribute("aria-multiline",!0)}},{key:"render",value:function render(){var t,r,a=this;if(this.div)return this.div;if(this.width){t=this.x;r=this.y}freetext_get(freetext_getPrototypeOf(FreeTextEditor.prototype),"render",this).call(this);this.editorDiv=document.createElement("div");this.editorDiv.className="internal";this.editorDiv.setAttribute("id",freetext_classPrivateFieldGet(this,fs));this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text");this.enableEditing();fn._l10nPromise.get("pdfjs-free-text-default-content").then((function(t){var r;return null===(r=a.editorDiv)||void 0===r?void 0:r.setAttribute("default-content",t)}));this.editorDiv.contentEditable=!0;var i=this.editorDiv.style;i.fontSize="calc(".concat(freetext_classPrivateFieldGet(this,ps),"px * var(--scale-factor))");i.color=freetext_classPrivateFieldGet(this,hs);this.div.append(this.editorDiv);this.overlayDiv=document.createElement("div");this.overlayDiv.classList.add("overlay","enabled");this.div.append(this.overlayDiv);bindEvents(this,this.div,["dblclick","keydown"]);if(this.width){var o=freetext_slicedToArray(this.parentDimensions,2),l=o[0],c=o[1];if(this.annotationElementId){var u=freetext_classPrivateFieldGet(this,vs).position,h=freetext_slicedToArray(this.getInitialTranslation(),2),d=h[0],p=h[1],v=freetext_slicedToArray(this.pageTranslationToScreen(d,p),2);d=v[0];p=v[1];var _,y,g=freetext_slicedToArray(this.pageDimensions,2),m=g[0],b=g[1],w=freetext_slicedToArray(this.pageTranslation,2),P=w[0],k=w[1];switch(this.rotation){case 0:_=t+(u[0]-P)/m;y=r+this.height-(u[1]-k)/b;break;case 90:_=t+(u[0]-P)/m;y=r-(u[1]-k)/b;var S=[p,-d];d=S[0];p=S[1];break;case 180:_=t-this.width+(u[0]-P)/m;y=r-(u[1]-k)/b;var A=[-d,-p];d=A[0];p=A[1];break;case 270:_=t+(u[0]-P-this.height*b)/m;y=r+(u[1]-k-this.width*m)/b;var x=[-p,d];d=x[0];p=x[1]}this.setAt(_*l,y*c,d,p)}else this.setAt(t*l,r*c,this.width*l,this.height*c);freetext_classPrivateMethodGet(this,bs,_setContent2).call(this);this._isDraggable=!0;this.editorDiv.contentEditable=!1}else{this._isDraggable=!1;this.editorDiv.contentEditable=!0}return this.div}},{key:"contentDiv",get:function get(){return this.editorDiv}},{key:"serialize",value:function serialize(){var 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};var r=FreeTextEditor._internalPadding*this.parentScale,a=this.getRect(r,r),i=fn._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:freetext_classPrivateFieldGet(this,hs)),o={annotationType:g.FREETEXT,color:i,fontSize:freetext_classPrivateFieldGet(this,ps),value:freetext_classPrivateMethodGet(this,ws,_serializeContent2).call(this),pageIndex:this.pageIndex,rect:a,rotation:this.rotation,structTreeParentId:this._structTreeParentId};if(t)return o;if(this.annotationElementId&&!freetext_classPrivateMethodGet(this,Ps,_hasElementChanged2).call(this,o))return null;o.id=this.annotationElementId;return o}}],[{key:"_keyboardManager",get:function get(){var t=FreeTextEditor.prototype,r=function arrowChecker(t){return t.isEmpty()},a=fr.TRANSLATE_SMALL,i=fr.TRANSLATE_BIG;return shadow(this,"_keyboardManager",new dt([[["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:[-a,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[a,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[i,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-a],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:r}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,a],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,i],checker:r}]]))}},{key:"initialize",value:function initialize(t,r){fn.initialize(t,r,{strings:["pdfjs-free-text-default-content"]});var a=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(a.getPropertyValue("--freetext-padding"))}},{key:"updateDefaultParams",value:function updateDefaultParams(t,r){switch(t){case m.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=r;break;case m.FREETEXT_COLOR:FreeTextEditor._defaultColor=r}}},{key:"defaultPropertiesToUpdate",get:function get(){return[[m.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[m.FREETEXT_COLOR,FreeTextEditor._defaultColor||fn._defaultLineColor]]}},{key:"deserialize",value:function deserialize(t,r,a){var i=null;if(t instanceof Go){var o=t,l=o.data,c=l.defaultAppearanceData,u=c.fontSize,h=c.fontColor,d=l.rect,p=l.rotation,v=l.id,_=o.textContent,y=o.textPosition,m=o.parent.page.pageNumber;if(!_||0===_.length)return null;i=t={annotationType:g.FREETEXT,color:Array.from(h),fontSize:u,value:_.join("\n"),position:y,pageIndex:m-1,rect:d,rotation:p,id:v,deleted:!1}}var b=freetext_get(freetext_getPrototypeOf(FreeTextEditor),"deserialize",this).call(this,t,r,a);freetext_classPrivateFieldSet(b,ps,t.fontSize);freetext_classPrivateFieldSet(b,hs,fe.makeHexColor.apply(fe,freetext_toConsumableArray(t.color)));freetext_classPrivateFieldSet(b,ds,freetext_classStaticPrivateMethodGet(FreeTextEditor,FreeTextEditor,_deserializeContent).call(FreeTextEditor,t.value));b.annotationElementId=t.id||null;freetext_classPrivateFieldSet(b,vs,i);return b}}]);return FreeTextEditor}(fn);es=Ss;function _updateFontSize2(t){var r=this,a=function setFontsize(t){r.editorDiv.style.fontSize="calc(".concat(t,"px * var(--scale-factor))");r.translate(0,-(t-freetext_classPrivateFieldGet(r,ps))*r.parentScale);freetext_classPrivateFieldSet(r,ps,t);freetext_classPrivateMethodGet(r,ms,_setEditorDimensions2).call(r)},i=freetext_classPrivateFieldGet(this,ps);this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function _updateColor2(t){var r=this,a=function setColor(t){freetext_classPrivateFieldSet(r,hs,r.editorDiv.style.color=t)},i=freetext_classPrivateFieldGet(this,hs);this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _extractText2(){var t=[];this.editorDiv.normalize();var r,a=/\r\n?|\n/g,i=freetext_createForOfIteratorHelper(this.editorDiv.childNodes);try{for(i.s();!(r=i.n()).done;){var o=r.value,l=o.nodeType===Node.TEXT_NODE?o.nodeValue:o.innerText;t.push(l.replaceAll(a,""))}}catch(t){i.e(t)}finally{i.f()}return t.join("\n")}function _setEditorDimensions2(){var t,r=freetext_slicedToArray(this.parentDimensions,2),a=r[0],i=r[1];if(this.isAttachedToDOM)t=this.div.getBoundingClientRect();else{var o=this.currentLayer,l=this.div,c=l.style.display;l.style.display="hidden";o.div.append(this.div);t=l.getBoundingClientRect();l.remove();l.style.display=c}if(this.rotation%180==this.parentRotation%180){this.width=t.width/a;this.height=t.height/i}else{this.width=t.height/a;this.height=t.width/i}this.fixAndSetPosition()}function _setContent2(){this.editorDiv.replaceChildren();if(freetext_classPrivateFieldGet(this,ds)){var t,r=freetext_createForOfIteratorHelper(freetext_classPrivateFieldGet(this,ds).split("\n"));try{for(r.s();!(t=r.n()).done;){var a=t.value,i=document.createElement("div");i.append(a?document.createTextNode(a):document.createElement("br"));this.editorDiv.append(i)}}catch(t){r.e(t)}finally{r.f()}}}function _serializeContent2(){return freetext_classPrivateFieldGet(this,ds).replaceAll(" "," ")}function _deserializeContent(t){return t.replaceAll(" "," ")}function _hasElementChanged2(t){var r=freetext_classPrivateFieldGet(this,vs),a=r.value,i=r.fontSize,o=r.color,l=r.rect,c=r.pageIndex;return t.value!==a||t.fontSize!==i||t.rect.some((function(t,r){return Math.abs(t-l[r])>=1}))||t.color.some((function(t,r){return t!==o[r]}))||t.pageIndex!==c}function _cheatInitialRect2(){var t=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.annotationElementId){freetext_classPrivateMethodGet(this,ms,_setEditorDimensions2).call(this);if(r||0!==this.width&&0!==this.height){var a=es._internalPadding*this.parentScale;freetext_classPrivateFieldGet(this,vs).rect=this.getRect(a,a)}else setTimeout((function(){return freetext_classPrivateMethodGet(t,ks,_cheatInitialRect2).call(t,!0)}),0)}}freetext_defineProperty(Ss,"_freeTextDefaultContent","");freetext_defineProperty(Ss,"_internalPadding",0);freetext_defineProperty(Ss,"_defaultColor",null);freetext_defineProperty(Ss,"_defaultFontSize",10);freetext_defineProperty(Ss,"_type","freetext");freetext_defineProperty(Ss,"_editorType",g.FREETEXT);var Fs;__webpack_require__(5137),__webpack_require__(292);function outliner_typeof(t){return outliner_typeof="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},outliner_typeof(t)}function outliner_classStaticPrivateFieldSpecGet(t,r,a){!function outliner_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);!function outliner_classCheckPrivateStaticFieldDescriptor(t,r){if(void 0===t)throw new TypeError("attempted to "+r+" private static field before its declaration")}(a,"get");return outliner_classApplyDescriptorGet(t,a)}function outliner_callSuper(t,r,a){return r=outliner_getPrototypeOf(r),function outliner_possibleConstructorReturn(t,r){if(r&&("object"===outliner_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return outliner_assertThisInitialized(t)}(t,outliner_isNativeReflectConstruct()?Reflect.construct(r,a||[],outliner_getPrototypeOf(t).constructor):r.apply(t,a))}function outliner_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(outliner_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function outliner_getPrototypeOf(t){outliner_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return outliner_getPrototypeOf(t)}function outliner_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function outliner_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&outliner_setPrototypeOf(t,r)}function outliner_setPrototypeOf(t,r){outliner_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return outliner_setPrototypeOf(t,r)}function outliner_toConsumableArray(t){return function outliner_arrayWithoutHoles(t){if(Array.isArray(t))return outliner_arrayLikeToArray(t)}(t)||function outliner_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||outliner_unsupportedIterableToArray(t)||function outliner_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function outliner_slicedToArray(t,r){return function outliner_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function outliner_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||outliner_unsupportedIterableToArray(t,r)||function outliner_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function outliner_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=outliner_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function outliner_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return outliner_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?outliner_arrayLikeToArray(t,r):void 0}}function outliner_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function outliner_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function outliner_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,outliner_toPropertyKey(i.key),i)}}function outliner_createClass(t,r,a){r&&outliner_defineProperties(t.prototype,r);a&&outliner_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function outliner_toPropertyKey(t){var r=function outliner_toPrimitive(t,r){if("object"!=outliner_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=outliner_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==outliner_typeof(r)?r:String(r)}function outliner_classPrivateMethodInitSpec(t,r){outliner_checkPrivateRedeclaration(t,r);r.add(t)}function outliner_classPrivateFieldInitSpec(t,r,a){outliner_checkPrivateRedeclaration(t,r);r.set(t,a)}function outliner_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function outliner_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function outliner_classPrivateFieldSet(t,r,a){!function outliner_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,outliner_classExtractFieldDescriptor(t,r,"set"),a);return a}function outliner_classPrivateFieldGet(t,r){return outliner_classApplyDescriptorGet(t,outliner_classExtractFieldDescriptor(t,r,"get"))}function outliner_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function outliner_classApplyDescriptorGet(t,r){return r.get?r.get.call(t):r.value}var As=new WeakMap,xs=new WeakMap,Es=new WeakMap,Is=new WeakSet,Ts=new WeakSet,Cs=new WeakSet,Ms=new WeakSet,Gs=new WeakSet,Os=function(){function Outliner(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];outliner_classCallCheck(this,Outliner);outliner_classPrivateMethodInitSpec(this,Gs);outliner_classPrivateMethodInitSpec(this,Ms);outliner_classPrivateMethodInitSpec(this,Cs);outliner_classPrivateMethodInitSpec(this,Ts);outliner_classPrivateMethodInitSpec(this,Is);outliner_classPrivateFieldInitSpec(this,As,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,xs,{writable:!0,value:[]});outliner_classPrivateFieldInitSpec(this,Es,{writable:!0,value:[]});var o,l=1/0,c=-1/0,u=1/0,h=-1/0,d=Math.pow(10,-4),p=outliner_createForOfIteratorHelper(t);try{for(p.s();!(o=p.n()).done;){var v=o.value,_=v.x,y=v.y,g=v.width,m=v.height,b=Math.floor((_-r)/d)*d,w=Math.ceil((_+g+r)/d)*d,P=Math.floor((y-r)/d)*d,k=Math.ceil((y+m+r)/d)*d,S=[b,P,k,!0],A=[w,P,k,!1];outliner_classPrivateFieldGet(this,xs).push(S,A);l=Math.min(l,b);c=Math.max(c,w);u=Math.min(u,P);h=Math.max(h,k)}}catch(t){p.e(t)}finally{p.f()}var x,E=c-l+2*a,I=h-u+2*a,T=l-a,C=u-a,M=outliner_classPrivateFieldGet(this,xs).at(i?-1:-2),G=[M[0],M[2]],O=outliner_createForOfIteratorHelper(outliner_classPrivateFieldGet(this,xs));try{for(O.s();!(x=O.n()).done;){var R=x.value,L=outliner_slicedToArray(R,3),D=L[0],j=L[1],N=L[2];R[0]=(D-T)/E;R[1]=(j-C)/I;R[2]=(N-C)/I}}catch(t){O.e(t)}finally{O.f()}outliner_classPrivateFieldSet(this,As,{x:T,y:C,width:E,height:I,lastPoint:G})}outliner_createClass(Outliner,[{key:"getOutlines",value:function getOutlines(){outliner_classPrivateFieldGet(this,xs).sort((function(t,r){return t[0]-r[0]||t[1]-r[1]||t[2]-r[2]}));var t,r=[],a=outliner_createForOfIteratorHelper(outliner_classPrivateFieldGet(this,xs));try{for(a.s();!(t=a.n()).done;){var i=t.value;if(i[3]){r.push.apply(r,outliner_toConsumableArray(outliner_classPrivateMethodGet(this,Gs,_breakEdge2).call(this,i)));outliner_classPrivateMethodGet(this,Cs,_insert2).call(this,i)}else{outliner_classPrivateMethodGet(this,Ms,_remove2).call(this,i);r.push.apply(r,outliner_toConsumableArray(outliner_classPrivateMethodGet(this,Gs,_breakEdge2).call(this,i)))}}}catch(t){a.e(t)}finally{a.f()}return outliner_classPrivateMethodGet(this,Is,_getOutlines2).call(this,r)}}]);return Outliner}();function _getOutlines2(t){var r,a=[],i=new Set,o=outliner_createForOfIteratorHelper(t);try{for(o.s();!(r=o.n()).done;){var l=r.value,c=outliner_slicedToArray(l,3),u=c[0],h=c[1],d=c[2];a.push([u,h,l],[u,d,l])}}catch(t){o.e(t)}finally{o.f()}a.sort((function(t,r){return t[1]-r[1]||t[0]-r[0]}));for(var p=0,v=a.length;p<v;p+=2){var _=a[p][2],y=a[p+1][2];_.push(y);y.push(_);i.add(_);i.add(y)}for(var g,m=[];i.size>0;){var b=i.values().next().value,w=outliner_slicedToArray(b,5),P=w[0],k=w[1],S=w[2],A=w[3],x=w[4];i.delete(b);var E=P,I=k;g=[P,S];m.push(g);for(;;){var T=void 0;if(i.has(A))T=A;else{if(!i.has(x))break;T=x}i.delete(T);var C=outliner_slicedToArray(T,5);P=C[0];k=C[1];S=C[2];A=C[3];x=C[4];if(E!==P){g.push(E,I,P,I===k?k:S);E=P}I=I===k?S:k}g.push(E,I)}return new js(m,outliner_classPrivateFieldGet(this,As))}function _binarySearch2(t){for(var r=outliner_classPrivateFieldGet(this,Es),a=0,i=r.length-1;a<=i;){var o=a+i>>1,l=r[o][0];if(l===t)return o;l<t?a=o+1:i=o-1}return i+1}function _insert2(t){var r=outliner_slicedToArray(t,3),a=r[1],i=r[2],o=outliner_classPrivateMethodGet(this,Ts,_binarySearch2).call(this,a);outliner_classPrivateFieldGet(this,Es).splice(o,0,[a,i])}function _remove2(t){for(var r=outliner_slicedToArray(t,3),a=r[1],i=r[2],o=outliner_classPrivateMethodGet(this,Ts,_binarySearch2).call(this,a),l=o;l<outliner_classPrivateFieldGet(this,Es).length;l++){var c=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Es)[l],2),u=c[0],h=c[1];if(u!==a)break;if(u===a&&h===i){outliner_classPrivateFieldGet(this,Es).splice(l,1);return}}for(var d=o-1;d>=0;d--){var p=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Es)[d],2),v=p[0],_=p[1];if(v!==a)break;if(v===a&&_===i){outliner_classPrivateFieldGet(this,Es).splice(d,1);return}}}function _breakEdge2(t){for(var r=outliner_slicedToArray(t,3),a=r[0],i=r[1],o=r[2],l=[[a,i,o]],c=outliner_classPrivateMethodGet(this,Ts,_binarySearch2).call(this,o),u=0;u<c;u++)for(var h=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Es)[u],2),d=h[0],p=h[1],v=0,_=l.length;v<_;v++){var y=outliner_slicedToArray(l[v],3),g=y[1],m=y[2];if(!(p<=g||m<=d))if(g>=d)if(m>p)l[v][1]=p;else{if(1===_)return[];l.splice(v,1);v--;_--}else{l[v][2]=d;m>p&&l.push([a,p,m])}}return l}var Rs=function(){function Outline(){outliner_classCallCheck(this,Outline)}outliner_createClass(Outline,[{key:"toSVGPath",value:function toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}},{key:"box",get:function get(){throw new Error("Abstract getter `box` must be implemented.")}},{key:"serialize",value:function serialize(t,r){throw new Error("Abstract method `serialize` must be implemented.")}},{key:"free",get:function get(){return this instanceof fl}}]);return Outline}(),Ls=new WeakMap,Ds=new WeakMap,js=function(t){outliner_inherits(HighlightOutline,t);function HighlightOutline(t,r){var a;outliner_classCallCheck(this,HighlightOutline);outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(a=outliner_callSuper(this,HighlightOutline)),Ls,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(a),Ds,{writable:!0,value:void 0});outliner_classPrivateFieldSet(outliner_assertThisInitialized(a),Ds,t);outliner_classPrivateFieldSet(outliner_assertThisInitialized(a),Ls,r);return a}outliner_createClass(HighlightOutline,[{key:"toSVGPath",value:function toSVGPath(){var t,r=[],a=outliner_createForOfIteratorHelper(outliner_classPrivateFieldGet(this,Ds));try{for(a.s();!(t=a.n()).done;){var i=t.value,o=outliner_slicedToArray(i,2),l=o[0],c=o[1];r.push("M".concat(l," ").concat(c));for(var u=2;u<i.length;u+=2){var h=i[u],d=i[u+1];if(h===l){r.push("V".concat(d));c=d}else if(d===c){r.push("H".concat(h));l=h}}r.push("Z")}}catch(t){a.e(t)}finally{a.f()}return r.join(" ")}},{key:"serialize",value:function serialize(t,r){var a,i=outliner_slicedToArray(t,4),o=i[0],l=i[1],c=i[2],u=i[3],h=[],d=c-o,p=u-l,v=outliner_createForOfIteratorHelper(outliner_classPrivateFieldGet(this,Ds));try{for(v.s();!(a=v.n()).done;){for(var _=a.value,y=new Array(_.length),g=0;g<_.length;g+=2){y[g]=o+_[g]*d;y[g+1]=u-_[g+1]*p}h.push(y)}}catch(t){v.e(t)}finally{v.f()}return h}},{key:"box",get:function get(){return outliner_classPrivateFieldGet(this,Ls)}}]);return HighlightOutline}(Rs),Ns=new WeakMap,Ws=new WeakMap,Hs=new WeakMap,Bs=new WeakMap,zs=new WeakMap,Us=new WeakMap,qs=new WeakMap,Vs=new WeakMap,Ks=new WeakMap,Ys=new WeakMap,Xs=new WeakMap,$s=new WeakMap,Js=new WeakMap,Qs=new WeakSet,Zs=function(){function FreeOutliner(t,r,a,i,o){var l=t.x,c=t.y,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;outliner_classCallCheck(this,FreeOutliner);outliner_classPrivateMethodInitSpec(this,Qs);outliner_classPrivateFieldInitSpec(this,Ns,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Ws,{writable:!0,value:[]});outliner_classPrivateFieldInitSpec(this,Hs,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Bs,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,zs,{writable:!0,value:[]});outliner_classPrivateFieldInitSpec(this,Us,{writable:!0,value:new Float64Array(18)});outliner_classPrivateFieldInitSpec(this,qs,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Vs,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Ks,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Ys,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Xs,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,$s,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(this,Js,{writable:!0,value:[]});outliner_classPrivateFieldSet(this,Ns,r);outliner_classPrivateFieldSet(this,$s,i*a);outliner_classPrivateFieldSet(this,Bs,o);outliner_classPrivateFieldGet(this,Us).set([NaN,NaN,NaN,NaN,l,c],6);outliner_classPrivateFieldSet(this,Hs,u);outliner_classPrivateFieldSet(this,Ys,outliner_classStaticPrivateFieldSpecGet(FreeOutliner,FreeOutliner,tl)*a);outliner_classPrivateFieldSet(this,Ks,outliner_classStaticPrivateFieldSpecGet(FreeOutliner,FreeOutliner,rl)*a);outliner_classPrivateFieldSet(this,Xs,a);outliner_classPrivateFieldGet(this,Js).push(l,c)}outliner_createClass(FreeOutliner,[{key:"free",get:function get(){return!0}},{key:"isEmpty",value:function isEmpty(){return isNaN(outliner_classPrivateFieldGet(this,Us)[8])}},{key:"add",value:function add(t){var r,a=t.x,i=t.y;outliner_classPrivateFieldSet(this,qs,a);outliner_classPrivateFieldSet(this,Vs,i);var o=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Ns),4),l=o[0],c=o[1],u=o[2],h=o[3],d=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Us).subarray(8,12),4),p=d[0],v=d[1],_=d[2],y=d[3],g=a-_,m=i-y,b=Math.hypot(g,m);if(b<outliner_classPrivateFieldGet(this,Ks))return!1;var w=b-outliner_classPrivateFieldGet(this,Ys),P=w/b,k=P*g,S=P*m,A=p,x=v;p=_;v=y;_+=k;y+=S;null===(r=outliner_classPrivateFieldGet(this,Js))||void 0===r||r.push(a,i);var E=k/w,I=-S/w*outliner_classPrivateFieldGet(this,$s),T=E*outliner_classPrivateFieldGet(this,$s);outliner_classPrivateFieldGet(this,Us).set(outliner_classPrivateFieldGet(this,Us).subarray(2,8),0);outliner_classPrivateFieldGet(this,Us).set([_+I,y+T],4);outliner_classPrivateFieldGet(this,Us).set(outliner_classPrivateFieldGet(this,Us).subarray(14,18),12);outliner_classPrivateFieldGet(this,Us).set([_-I,y-T],16);if(isNaN(outliner_classPrivateFieldGet(this,Us)[6])){if(0===outliner_classPrivateFieldGet(this,zs).length){outliner_classPrivateFieldGet(this,Us).set([p+I,v+T],2);outliner_classPrivateFieldGet(this,zs).push(NaN,NaN,NaN,NaN,(p+I-l)/u,(v+T-c)/h);outliner_classPrivateFieldGet(this,Us).set([p-I,v-T],14);outliner_classPrivateFieldGet(this,Ws).push(NaN,NaN,NaN,NaN,(p-I-l)/u,(v-T-c)/h)}outliner_classPrivateFieldGet(this,Us).set([A,x,p,v,_,y],6);return!this.isEmpty()}outliner_classPrivateFieldGet(this,Us).set([A,x,p,v,_,y],6);if(Math.abs(Math.atan2(x-v,A-p)-Math.atan2(S,k))<Math.PI/2){var C=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Us).subarray(2,6),4);p=C[0];v=C[1];_=C[2];y=C[3];outliner_classPrivateFieldGet(this,zs).push(NaN,NaN,NaN,NaN,((p+_)/2-l)/u,((v+y)/2-c)/h);var M=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Us).subarray(14,18),4);p=M[0];v=M[1];A=M[2];x=M[3];outliner_classPrivateFieldGet(this,Ws).push(NaN,NaN,NaN,NaN,((A+p)/2-l)/u,((x+v)/2-c)/h);return!0}var G=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Us).subarray(0,6),6);A=G[0];x=G[1];p=G[2];v=G[3];_=G[4];y=G[5];outliner_classPrivateFieldGet(this,zs).push(((A+5*p)/6-l)/u,((x+5*v)/6-c)/h,((5*p+_)/6-l)/u,((5*v+y)/6-c)/h,((p+_)/2-l)/u,((v+y)/2-c)/h);var O=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Us).subarray(12,18),6);_=O[0];y=O[1];p=O[2];v=O[3];A=O[4];x=O[5];outliner_classPrivateFieldGet(this,Ws).push(((A+5*p)/6-l)/u,((x+5*v)/6-c)/h,((5*p+_)/6-l)/u,((5*v+y)/6-c)/h,((p+_)/2-l)/u,((v+y)/2-c)/h);return!0}},{key:"toSVGPath",value:function toSVGPath(){if(this.isEmpty())return"";var t=outliner_classPrivateFieldGet(this,zs),r=outliner_classPrivateFieldGet(this,Ws),a=outliner_classPrivateFieldGet(this,Us).subarray(4,6),i=outliner_classPrivateFieldGet(this,Us).subarray(16,18),o=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Ns),4),l=o[0],c=o[1],u=o[2],h=o[3],d=outliner_slicedToArray(outliner_classPrivateMethodGet(this,Qs,_getLastCoords2).call(this),4),p=d[0],v=d[1],_=d[2],y=d[3];if(isNaN(outliner_classPrivateFieldGet(this,Us)[6])&&!this.isEmpty())return"M".concat((outliner_classPrivateFieldGet(this,Us)[2]-l)/u," ").concat((outliner_classPrivateFieldGet(this,Us)[3]-c)/h," L").concat((outliner_classPrivateFieldGet(this,Us)[4]-l)/u," ").concat((outliner_classPrivateFieldGet(this,Us)[5]-c)/h," L").concat(p," ").concat(v," L").concat(_," ").concat(y," L").concat((outliner_classPrivateFieldGet(this,Us)[16]-l)/u," ").concat((outliner_classPrivateFieldGet(this,Us)[17]-c)/h," L").concat((outliner_classPrivateFieldGet(this,Us)[14]-l)/u," ").concat((outliner_classPrivateFieldGet(this,Us)[15]-c)/h," Z");var g=[];g.push("M".concat(t[4]," ").concat(t[5]));for(var m=6;m<t.length;m+=6)isNaN(t[m])?g.push("L".concat(t[m+4]," ").concat(t[m+5])):g.push("C".concat(t[m]," ").concat(t[m+1]," ").concat(t[m+2]," ").concat(t[m+3]," ").concat(t[m+4]," ").concat(t[m+5]));g.push("L".concat((a[0]-l)/u," ").concat((a[1]-c)/h," L").concat(p," ").concat(v," L").concat(_," ").concat(y," L").concat((i[0]-l)/u," ").concat((i[1]-c)/h));for(var b=r.length-6;b>=6;b-=6)isNaN(r[b])?g.push("L".concat(r[b+4]," ").concat(r[b+5])):g.push("C".concat(r[b]," ").concat(r[b+1]," ").concat(r[b+2]," ").concat(r[b+3]," ").concat(r[b+4]," ").concat(r[b+5]));g.push("L".concat(r[4]," ").concat(r[5]," Z"));return g.join(" ")}},{key:"getOutlines",value:function getOutlines(){for(var t,r,a=outliner_classPrivateFieldGet(this,zs),i=outliner_classPrivateFieldGet(this,Ws),o=outliner_classPrivateFieldGet(this,Us),l=o.subarray(4,6),c=o.subarray(16,18),u=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Ns),4),h=u[0],d=u[1],p=u[2],v=u[3],_=new Float64Array((null!==(t=null===(r=outliner_classPrivateFieldGet(this,Js))||void 0===r?void 0:r.length)&&void 0!==t?t:0)+2),y=0,g=_.length-2;y<g;y+=2){_[y]=(outliner_classPrivateFieldGet(this,Js)[y]-h)/p;_[y+1]=(outliner_classPrivateFieldGet(this,Js)[y+1]-d)/v}_[_.length-2]=(outliner_classPrivateFieldGet(this,qs)-h)/p;_[_.length-1]=(outliner_classPrivateFieldGet(this,Vs)-d)/v;var m=outliner_slicedToArray(outliner_classPrivateMethodGet(this,Qs,_getLastCoords2).call(this),4),b=m[0],w=m[1],P=m[2],k=m[3];if(isNaN(o[6])&&!this.isEmpty()){var S=new Float64Array(36);S.set([NaN,NaN,NaN,NaN,(o[2]-h)/p,(o[3]-d)/v,NaN,NaN,NaN,NaN,(o[4]-h)/p,(o[5]-d)/v,NaN,NaN,NaN,NaN,b,w,NaN,NaN,NaN,NaN,P,k,NaN,NaN,NaN,NaN,(o[16]-h)/p,(o[17]-d)/v,NaN,NaN,NaN,NaN,(o[14]-h)/p,(o[15]-d)/v],0);return new fl(S,_,outliner_classPrivateFieldGet(this,Ns),outliner_classPrivateFieldGet(this,Xs),outliner_classPrivateFieldGet(this,Hs),outliner_classPrivateFieldGet(this,Bs))}for(var A=new Float64Array(outliner_classPrivateFieldGet(this,zs).length+24+outliner_classPrivateFieldGet(this,Ws).length),x=a.length,E=0;E<x;E+=2)if(isNaN(a[E]))A[E]=A[E+1]=NaN;else{A[E]=a[E];A[E+1]=a[E+1]}A.set([NaN,NaN,NaN,NaN,(l[0]-h)/p,(l[1]-d)/v,NaN,NaN,NaN,NaN,b,w,NaN,NaN,NaN,NaN,P,k,NaN,NaN,NaN,NaN,(c[0]-h)/p,(c[1]-d)/v],x);x+=24;for(var I=i.length-6;I>=6;I-=6)for(var T=0;T<6;T+=2)if(isNaN(i[I+T])){A[x]=A[x+1]=NaN;x+=2}else{A[x]=i[I+T];A[x+1]=i[I+T+1];x+=2}A.set([NaN,NaN,NaN,NaN,i[4],i[5]],x);return new fl(A,_,outliner_classPrivateFieldGet(this,Ns),outliner_classPrivateFieldGet(this,Xs),outliner_classPrivateFieldGet(this,Hs),outliner_classPrivateFieldGet(this,Bs))}}]);return FreeOutliner}();function _getLastCoords2(){var t=outliner_classPrivateFieldGet(this,Us).subarray(4,6),r=outliner_classPrivateFieldGet(this,Us).subarray(16,18),a=outliner_slicedToArray(outliner_classPrivateFieldGet(this,Ns),4),i=a[0],o=a[1],l=a[2],c=a[3];return[(outliner_classPrivateFieldGet(this,qs)+(t[0]-r[0])/2-i)/l,(outliner_classPrivateFieldGet(this,Vs)+(t[1]-r[1])/2-o)/c,(outliner_classPrivateFieldGet(this,qs)+(r[0]-t[0])/2-i)/l,(outliner_classPrivateFieldGet(this,Vs)+(r[1]-t[1])/2-o)/c]}var el,tl={writable:!0,value:8},rl={writable:!0,value:outliner_classStaticPrivateFieldSpecGet(Fs=Zs,Fs,tl)+outliner_classStaticPrivateFieldSpecGet(Fs,Fs,{writable:!0,value:2})},nl=new WeakMap,al=new WeakMap,il=new WeakMap,ol=new WeakMap,sl=new WeakMap,ll=new WeakMap,cl=new WeakMap,ul=new WeakSet,hl=new WeakSet,dl=new WeakSet,fl=function(t){outliner_inherits(FreeHighlightOutline,t);function FreeHighlightOutline(t,r,a,i,o,l){var c;outliner_classCallCheck(this,FreeHighlightOutline);outliner_classPrivateMethodInitSpec(outliner_assertThisInitialized(c=outliner_callSuper(this,FreeHighlightOutline)),dl);outliner_classPrivateMethodInitSpec(outliner_assertThisInitialized(c),hl);outliner_classPrivateMethodInitSpec(outliner_assertThisInitialized(c),ul);outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),nl,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),al,{writable:!0,value:null});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),il,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),ol,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),sl,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),ll,{writable:!0,value:void 0});outliner_classPrivateFieldInitSpec(outliner_assertThisInitialized(c),cl,{writable:!0,value:void 0});outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),cl,t);outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),sl,r);outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),nl,a);outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),ll,i);outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),il,o);outliner_classPrivateFieldSet(outliner_assertThisInitialized(c),ol,l);outliner_classPrivateMethodGet(outliner_assertThisInitialized(c),dl,_computeMinMax2).call(outliner_assertThisInitialized(c),l);for(var u=outliner_classPrivateFieldGet(outliner_assertThisInitialized(c),al),h=u.x,d=u.y,p=u.width,v=u.height,_=0,y=t.length;_<y;_+=2){t[_]=(t[_]-h)/p;t[_+1]=(t[_+1]-d)/v}for(var g=0,m=r.length;g<m;g+=2){r[g]=(r[g]-h)/p;r[g+1]=(r[g+1]-d)/v}return c}outliner_createClass(FreeHighlightOutline,[{key:"toSVGPath",value:function toSVGPath(){for(var t=["M".concat(outliner_classPrivateFieldGet(this,cl)[4]," ").concat(outliner_classPrivateFieldGet(this,cl)[5])],r=6,a=outliner_classPrivateFieldGet(this,cl).length;r<a;r+=6)isNaN(outliner_classPrivateFieldGet(this,cl)[r])?t.push("L".concat(outliner_classPrivateFieldGet(this,cl)[r+4]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+5])):t.push("C".concat(outliner_classPrivateFieldGet(this,cl)[r]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+1]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+2]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+3]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+4]," ").concat(outliner_classPrivateFieldGet(this,cl)[r+5]));t.push("Z");return t.join(" ")}},{key:"serialize",value:function serialize(t,r){var a,i,o=outliner_slicedToArray(t,4),l=o[0],c=o[1],u=o[2],h=o[3],d=u-l,p=h-c;switch(r){case 0:a=outliner_classPrivateMethodGet(this,ul,_rescale2).call(this,outliner_classPrivateFieldGet(this,cl),l,h,d,-p);i=outliner_classPrivateMethodGet(this,ul,_rescale2).call(this,outliner_classPrivateFieldGet(this,sl),l,h,d,-p);break;case 90:a=outliner_classPrivateMethodGet(this,hl,_rescaleAndSwap2).call(this,outliner_classPrivateFieldGet(this,cl),l,c,d,p);i=outliner_classPrivateMethodGet(this,hl,_rescaleAndSwap2).call(this,outliner_classPrivateFieldGet(this,sl),l,c,d,p);break;case 180:a=outliner_classPrivateMethodGet(this,ul,_rescale2).call(this,outliner_classPrivateFieldGet(this,cl),u,c,-d,p);i=outliner_classPrivateMethodGet(this,ul,_rescale2).call(this,outliner_classPrivateFieldGet(this,sl),u,c,-d,p);break;case 270:a=outliner_classPrivateMethodGet(this,hl,_rescaleAndSwap2).call(this,outliner_classPrivateFieldGet(this,cl),u,h,-d,-p);i=outliner_classPrivateMethodGet(this,hl,_rescaleAndSwap2).call(this,outliner_classPrivateFieldGet(this,sl),u,h,-d,-p)}return{outline:Array.from(a),points:[Array.from(i)]}}},{key:"box",get:function get(){return outliner_classPrivateFieldGet(this,al)}},{key:"getNewOutline",value:function getNewOutline(t,r){for(var a=outliner_classPrivateFieldGet(this,al),i=a.x,o=a.y,l=a.width,c=a.height,u=outliner_slicedToArray(outliner_classPrivateFieldGet(this,nl),4),h=u[0],d=u[1],p=u[2],v=u[3],_=l*p,y=c*v,g=i*p+h,m=o*v+d,b=new Zs({x:outliner_classPrivateFieldGet(this,sl)[0]*_+g,y:outliner_classPrivateFieldGet(this,sl)[1]*y+m},outliner_classPrivateFieldGet(this,nl),outliner_classPrivateFieldGet(this,ll),t,outliner_classPrivateFieldGet(this,ol),null!=r?r:outliner_classPrivateFieldGet(this,il)),w=2;w<outliner_classPrivateFieldGet(this,sl).length;w+=2)b.add({x:outliner_classPrivateFieldGet(this,sl)[w]*_+g,y:outliner_classPrivateFieldGet(this,sl)[w+1]*y+m});return b.getOutlines()}}]);return FreeHighlightOutline}(Rs);function _rescale2(t,r,a,i,o){for(var l=new Float64Array(t.length),c=0,u=t.length;c<u;c+=2){l[c]=r+t[c]*i;l[c+1]=a+t[c+1]*o}return l}function _rescaleAndSwap2(t,r,a,i,o){for(var l=new Float64Array(t.length),c=0,u=t.length;c<u;c+=2){l[c]=r+t[c+1]*i;l[c+1]=a+t[c]*o}return l}function _computeMinMax2(t){for(var r=outliner_classPrivateFieldGet(this,cl),a=r[4],i=r[5],o=a,l=i,c=a,u=i,h=a,d=i,p=t?Math.max:Math.min,v=6,_=r.length;v<_;v+=6){if(isNaN(r[v])){o=Math.min(o,r[v+4]);l=Math.min(l,r[v+5]);c=Math.max(c,r[v+4]);u=Math.max(u,r[v+5]);if(d<r[v+5]){h=r[v+4];d=r[v+5]}else d===r[v+5]&&(h=p(h,r[v+4]))}else{var y=fe.bezierBoundingBox.apply(fe,[a,i].concat(outliner_toConsumableArray(r.slice(v,v+6))));o=Math.min(o,y[0]);l=Math.min(l,y[1]);c=Math.max(c,y[2]);u=Math.max(u,y[3]);if(d<y[3]){h=y[2];d=y[3]}else d===y[3]&&(h=p(h,y[2]))}a=r[v+4];i=r[v+5]}var g=o-outliner_classPrivateFieldGet(this,il),m=l-outliner_classPrivateFieldGet(this,il),b=c-o+2*outliner_classPrivateFieldGet(this,il),w=u-l+2*outliner_classPrivateFieldGet(this,il);outliner_classPrivateFieldSet(this,al,{x:g,y:m,width:b,height:w,lastPoint:[h,d]})}function color_picker_typeof(t){return color_picker_typeof="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},color_picker_typeof(t)}function color_picker_slicedToArray(t,r){return function color_picker_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function color_picker_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||color_picker_unsupportedIterableToArray(t,r)||function color_picker_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function color_picker_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=color_picker_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function color_picker_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return color_picker_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?color_picker_arrayLikeToArray(t,r):void 0}}function color_picker_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function color_picker_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,color_picker_toPropertyKey(i.key),i)}}function color_picker_toPropertyKey(t){var r=function color_picker_toPrimitive(t,r){if("object"!=color_picker_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=color_picker_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==color_picker_typeof(r)?r:String(r)}function color_picker_classPrivateMethodInitSpec(t,r){color_picker_checkPrivateRedeclaration(t,r);r.add(t)}function color_picker_classPrivateFieldInitSpec(t,r,a){color_picker_checkPrivateRedeclaration(t,r);r.set(t,a)}function color_picker_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function color_picker_classPrivateFieldGet(t,r){return function color_picker_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,color_picker_classExtractFieldDescriptor(t,r,"get"))}function color_picker_classPrivateFieldSet(t,r,a){!function color_picker_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,color_picker_classExtractFieldDescriptor(t,r,"set"),a);return a}function color_picker_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function color_picker_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}var pl,vl=new WeakMap,_l=new WeakMap,yl=new WeakMap,gl=new WeakMap,ml=new WeakMap,bl=new WeakMap,wl=new WeakMap,Pl=new WeakMap,kl=new WeakMap,Sl=new WeakMap,Fl=new WeakMap,Al=new WeakSet,xl=new WeakSet,El=new WeakSet,Il=new WeakSet,Tl=new WeakSet,Cl=new WeakMap,Ml=function(){function ColorPicker(t){var r,a=t.editor,i=void 0===a?null:a,o=t.uiManager,l=void 0===o?null:o;!function color_picker_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,ColorPicker);color_picker_classPrivateFieldInitSpec(this,Cl,{get:_get_isDropdownVisible,set:void 0});color_picker_classPrivateMethodInitSpec(this,Tl);color_picker_classPrivateMethodInitSpec(this,Il);color_picker_classPrivateMethodInitSpec(this,El);color_picker_classPrivateMethodInitSpec(this,xl);color_picker_classPrivateMethodInitSpec(this,Al);color_picker_classPrivateFieldInitSpec(this,vl,{writable:!0,value:color_picker_classPrivateMethodGet(this,El,color_picker_keyDown2).bind(this)});color_picker_classPrivateFieldInitSpec(this,_l,{writable:!0,value:color_picker_classPrivateMethodGet(this,Tl,_pointerDown2).bind(this)});color_picker_classPrivateFieldInitSpec(this,yl,{writable:!0,value:null});color_picker_classPrivateFieldInitSpec(this,gl,{writable:!0,value:null});color_picker_classPrivateFieldInitSpec(this,ml,{writable:!0,value:void 0});color_picker_classPrivateFieldInitSpec(this,bl,{writable:!0,value:null});color_picker_classPrivateFieldInitSpec(this,wl,{writable:!0,value:!1});color_picker_classPrivateFieldInitSpec(this,Pl,{writable:!0,value:!1});color_picker_classPrivateFieldInitSpec(this,kl,{writable:!0,value:void 0});color_picker_classPrivateFieldInitSpec(this,Sl,{writable:!0,value:null});color_picker_classPrivateFieldInitSpec(this,Fl,{writable:!0,value:void 0});if(i){color_picker_classPrivateFieldSet(this,Pl,!1);color_picker_classPrivateFieldSet(this,Fl,m.HIGHLIGHT_COLOR)}else{color_picker_classPrivateFieldSet(this,Pl,!0);color_picker_classPrivateFieldSet(this,Fl,m.HIGHLIGHT_DEFAULT_COLOR)}color_picker_classPrivateFieldSet(this,Sl,(null==i?void 0:i._uiManager)||l);color_picker_classPrivateFieldSet(this,kl,color_picker_classPrivateFieldGet(this,Sl)._eventBus);color_picker_classPrivateFieldSet(this,ml,(null==i?void 0:i.color)||(null===(r=color_picker_classPrivateFieldGet(this,Sl))||void 0===r?void 0:r.highlightColors.values().next().value)||"#FFFF98")}!function color_picker_createClass(t,r,a){r&&color_picker_defineProperties(t.prototype,r);a&&color_picker_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(ColorPicker,[{key:"renderButton",value:function renderButton(){var t=color_picker_classPrivateFieldSet(this,yl,document.createElement("button"));t.className="colorPicker";t.tabIndex="0";t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button");t.setAttribute("aria-haspopup",!0);t.addEventListener("click",color_picker_classPrivateMethodGet(this,Il,_openDropdown2).bind(this));t.addEventListener("keydown",color_picker_classPrivateFieldGet(this,vl));var r=color_picker_classPrivateFieldSet(this,gl,document.createElement("span"));r.className="swatch";r.style.backgroundColor=color_picker_classPrivateFieldGet(this,ml);t.append(r);return t}},{key:"renderMainDropdown",value:function renderMainDropdown(){var t=color_picker_classPrivateFieldSet(this,bl,color_picker_classPrivateMethodGet(this,Al,_getDropdownRoot2).call(this));t.setAttribute("aria-orientation","horizontal");t.setAttribute("aria-labelledby","highlightColorPickerLabel");return t}},{key:"_colorSelectFromKeyboard",value:function _colorSelectFromKeyboard(t){if(t.target!==color_picker_classPrivateFieldGet(this,yl)){var r=t.target.getAttribute("data-color");r&&color_picker_classPrivateMethodGet(this,xl,_colorSelect2).call(this,r,t)}else color_picker_classPrivateMethodGet(this,Il,_openDropdown2).call(this,t)}},{key:"_moveToNext",value:function _moveToNext(t){var r;if(color_picker_classPrivateFieldGet(this,Cl))if(t.target!==color_picker_classPrivateFieldGet(this,yl))null===(r=t.target.nextSibling)||void 0===r||r.focus();else{var a;null===(a=color_picker_classPrivateFieldGet(this,bl).firstChild)||void 0===a||a.focus()}else color_picker_classPrivateMethodGet(this,Il,_openDropdown2).call(this,t)}},{key:"_moveToPrevious",value:function _moveToPrevious(t){var r,a;if(t.target!==(null===(r=color_picker_classPrivateFieldGet(this,bl))||void 0===r?void 0:r.firstChild)&&t.target!==color_picker_classPrivateFieldGet(this,yl)){color_picker_classPrivateFieldGet(this,Cl)||color_picker_classPrivateMethodGet(this,Il,_openDropdown2).call(this,t);null===(a=t.target.previousSibling)||void 0===a||a.focus()}else color_picker_classPrivateFieldGet(this,Cl)&&this._hideDropdownFromKeyboard()}},{key:"_moveToBeginning",value:function _moveToBeginning(t){var r;color_picker_classPrivateFieldGet(this,Cl)?null===(r=color_picker_classPrivateFieldGet(this,bl).firstChild)||void 0===r||r.focus():color_picker_classPrivateMethodGet(this,Il,_openDropdown2).call(this,t)}},{key:"_moveToEnd",value:function _moveToEnd(t){var r;color_picker_classPrivateFieldGet(this,Cl)?null===(r=color_picker_classPrivateFieldGet(this,bl).lastChild)||void 0===r||r.focus():color_picker_classPrivateMethodGet(this,Il,_openDropdown2).call(this,t)}},{key:"hideDropdown",value:function hideDropdown(){var t;null===(t=color_picker_classPrivateFieldGet(this,bl))||void 0===t||t.classList.add("hidden");window.removeEventListener("pointerdown",color_picker_classPrivateFieldGet(this,_l))}},{key:"_hideDropdownFromKeyboard",value:function _hideDropdownFromKeyboard(){if(!color_picker_classPrivateFieldGet(this,Pl)&&color_picker_classPrivateFieldGet(this,Cl)){this.hideDropdown();color_picker_classPrivateFieldGet(this,yl).focus({preventScroll:!0,focusVisible:color_picker_classPrivateFieldGet(this,wl)})}}},{key:"updateColor",value:function updateColor(t){color_picker_classPrivateFieldGet(this,gl)&&(color_picker_classPrivateFieldGet(this,gl).style.backgroundColor=t);if(color_picker_classPrivateFieldGet(this,bl)){var r,a=color_picker_classPrivateFieldGet(this,Sl).highlightColors.values(),i=color_picker_createForOfIteratorHelper(color_picker_classPrivateFieldGet(this,bl).children);try{for(i.s();!(r=i.n()).done;){r.value.setAttribute("aria-selected",a.next().value===t)}}catch(t){i.e(t)}finally{i.f()}}}},{key:"destroy",value:function destroy(){var t,r;null===(t=color_picker_classPrivateFieldGet(this,yl))||void 0===t||t.remove();color_picker_classPrivateFieldSet(this,yl,null);color_picker_classPrivateFieldSet(this,gl,null);null===(r=color_picker_classPrivateFieldGet(this,bl))||void 0===r||r.remove();color_picker_classPrivateFieldSet(this,bl,null)}}],[{key:"_keyboardManager",get:function get(){return shadow(this,"_keyboardManager",new dt([[["Escape","mac+Escape"],ColorPicker.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ColorPicker.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ColorPicker.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ColorPicker.prototype._moveToPrevious],[["Home","mac+Home"],ColorPicker.prototype._moveToBeginning],[["End","mac+End"],ColorPicker.prototype._moveToEnd]]))}}]);return ColorPicker}();el=Ml;function _getDropdownRoot2(){var t=document.createElement("div");t.addEventListener("contextmenu",noContextMenu);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");var r,a=color_picker_createForOfIteratorHelper(color_picker_classPrivateFieldGet(this,Sl).highlightColors);try{for(a.s();!(r=a.n()).done;){var i=color_picker_slicedToArray(r.value,2),o=i[0],l=i[1],c=document.createElement("button");c.tabIndex="0";c.role="option";c.setAttribute("data-color",l);c.title=o;c.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-".concat(o));var u=document.createElement("span");c.append(u);u.className="swatch";u.style.backgroundColor=l;c.setAttribute("aria-selected",l===color_picker_classPrivateFieldGet(this,ml));c.addEventListener("click",color_picker_classPrivateMethodGet(this,xl,_colorSelect2).bind(this,l));t.append(c)}}catch(t){a.e(t)}finally{a.f()}t.addEventListener("keydown",color_picker_classPrivateFieldGet(this,vl));return t}function _colorSelect2(t,r){r.stopPropagation();color_picker_classPrivateFieldGet(this,kl).dispatch("switchannotationeditorparams",{source:this,type:color_picker_classPrivateFieldGet(this,Fl),value:t})}function color_picker_keyDown2(t){el._keyboardManager.exec(this,t)}function _openDropdown2(t){if(color_picker_classPrivateFieldGet(this,Cl))this.hideDropdown();else{color_picker_classPrivateFieldSet(this,wl,0===t.detail);window.addEventListener("pointerdown",color_picker_classPrivateFieldGet(this,_l));if(color_picker_classPrivateFieldGet(this,bl))color_picker_classPrivateFieldGet(this,bl).classList.remove("hidden");else{var r=color_picker_classPrivateFieldSet(this,bl,color_picker_classPrivateMethodGet(this,Al,_getDropdownRoot2).call(this));color_picker_classPrivateFieldGet(this,yl).append(r)}}}function _pointerDown2(t){var r;null!==(r=color_picker_classPrivateFieldGet(this,bl))&&void 0!==r&&r.contains(t.target)||this.hideDropdown()}function _get_isDropdownVisible(){return color_picker_classPrivateFieldGet(this,bl)&&!color_picker_classPrivateFieldGet(this,bl).classList.contains("hidden")}function highlight_typeof(t){return highlight_typeof="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},highlight_typeof(t)}function highlight_toConsumableArray(t){return function highlight_arrayWithoutHoles(t){if(Array.isArray(t))return highlight_arrayLikeToArray(t)}(t)||function highlight_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||highlight_unsupportedIterableToArray(t)||function highlight_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function highlight_slicedToArray(t,r){return function highlight_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function highlight_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||highlight_unsupportedIterableToArray(t,r)||function highlight_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function highlight_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return highlight_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?highlight_arrayLikeToArray(t,r):void 0}}function highlight_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function highlight_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */highlight_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==highlight_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(highlight_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function highlight_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function highlight_ownKeys(t,r){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,i)}return a}function highlight_objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?highlight_ownKeys(Object(a),!0).forEach((function(r){highlight_defineProperty(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):highlight_ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}function highlight_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,highlight_toPropertyKey(i.key),i)}}function highlight_callSuper(t,r,a){return r=highlight_getPrototypeOf(r),function highlight_possibleConstructorReturn(t,r){if(r&&("object"===highlight_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return highlight_assertThisInitialized(t)}(t,highlight_isNativeReflectConstruct()?Reflect.construct(r,a||[],highlight_getPrototypeOf(t).constructor):r.apply(t,a))}function highlight_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(highlight_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function highlight_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function highlight_get(){highlight_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function highlight_superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=highlight_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}};return highlight_get.apply(this,arguments)}function highlight_getPrototypeOf(t){highlight_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return highlight_getPrototypeOf(t)}function highlight_setPrototypeOf(t,r){highlight_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return highlight_setPrototypeOf(t,r)}function highlight_classPrivateMethodInitSpec(t,r){highlight_checkPrivateRedeclaration(t,r);r.add(t)}function highlight_defineProperty(t,r,a){(r=highlight_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function highlight_toPropertyKey(t){var r=function highlight_toPrimitive(t,r){if("object"!=highlight_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=highlight_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==highlight_typeof(r)?r:String(r)}function highlight_classPrivateFieldInitSpec(t,r,a){highlight_checkPrivateRedeclaration(t,r);r.set(t,a)}function highlight_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldDestructureSet(t,r){return function _classApplyDescriptorDestructureSet(t,r){if(r.set){"__destrObj"in r||(r.__destrObj={set value(a){r.set.call(t,a)}});return r.__destrObj}if(!r.writable)throw new TypeError("attempted to set read only private field");return r}(t,highlight_classExtractFieldDescriptor(t,r,"set"))}function highlight_classStaticPrivateMethodGet(t,r,a){!function highlight_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function highlight_classPrivateFieldGet(t,r){return function highlight_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,highlight_classExtractFieldDescriptor(t,r,"get"))}function highlight_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function highlight_classPrivateFieldSet(t,r,a){!function highlight_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,highlight_classExtractFieldDescriptor(t,r,"set"),a);return a}function highlight_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var Gl,Ol=new WeakMap,Rl=new WeakMap,Ll=new WeakMap,Dl=new WeakMap,jl=new WeakMap,Nl=new WeakMap,Wl=new WeakMap,Hl=new WeakMap,Bl=new WeakMap,zl=new WeakMap,Ul=new WeakMap,ql=new WeakMap,Vl=new WeakSet,Kl=new WeakSet,Yl=new WeakSet,Xl=new WeakSet,$l=new WeakSet,Jl=new WeakSet,Ql=new WeakSet,Zl=new WeakSet,ec=new WeakSet,tc=new WeakSet,rc=function(t){!function highlight_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&highlight_setPrototypeOf(t,r)}(HighlightEditor,t);function HighlightEditor(t){var r;!function highlight_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,HighlightEditor);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r=highlight_callSuper(this,HighlightEditor,[highlight_objectSpread(highlight_objectSpread({},t),{},{name:"highlightEditor"})])),tc);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),ec);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Zl);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Ql);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Jl);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),$l);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Xl);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Yl);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Kl);highlight_classPrivateMethodInitSpec(highlight_assertThisInitialized(r),Vl);highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Ol,{writable:!0,value:void 0});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Rl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Ll,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Dl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),jl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Nl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Wl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Hl,{writable:!0,value:!1});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Bl,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),zl,{writable:!0,value:void 0});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),Ul,{writable:!0,value:null});highlight_classPrivateFieldInitSpec(highlight_assertThisInitialized(r),ql,{writable:!0,value:void 0});r.color=t.color||HighlightEditor._defaultColor;highlight_classPrivateFieldSet(highlight_assertThisInitialized(r),ql,t.thickness||HighlightEditor._defaultThickness);highlight_classPrivateFieldSet(highlight_assertThisInitialized(r),zl,t.opacity||HighlightEditor._defaultOpacity);highlight_classPrivateFieldSet(highlight_assertThisInitialized(r),Ol,t.boxes||null);r._isDraggable=!1;if(t.highlightId>-1){highlight_classPrivateFieldSet(highlight_assertThisInitialized(r),Hl,!0);highlight_classPrivateMethodGet(highlight_assertThisInitialized(r),Kl,_createFreeOutlines2).call(highlight_assertThisInitialized(r),t);highlight_classPrivateMethodGet(highlight_assertThisInitialized(r),Ql,_addToDrawLayer2).call(highlight_assertThisInitialized(r))}else{highlight_classPrivateMethodGet(highlight_assertThisInitialized(r),Vl,_createOutlines2).call(highlight_assertThisInitialized(r));highlight_classPrivateMethodGet(highlight_assertThisInitialized(r),Ql,_addToDrawLayer2).call(highlight_assertThisInitialized(r));r.rotate(r.rotation)}return r}!function highlight_createClass(t,r,a){r&&highlight_defineProperties(t.prototype,r);a&&highlight_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(HighlightEditor,[{key:"translateInPage",value:function translateInPage(t,r){}},{key:"toolbarPosition",get:function get(){return highlight_classPrivateFieldGet(this,Bl)}},{key:"updateParams",value:function updateParams(t,r){switch(t){case m.HIGHLIGHT_COLOR:highlight_classPrivateMethodGet(this,Yl,highlight_updateColor2).call(this,r);break;case m.HIGHLIGHT_THICKNESS:highlight_classPrivateMethodGet(this,Xl,_updateThickness2).call(this,r)}}},{key:"propertiesToUpdate",get:function get(){return[[m.HIGHLIGHT_COLOR,this.color||HighlightEditor._defaultColor],[m.HIGHLIGHT_THICKNESS,highlight_classPrivateFieldGet(this,ql)||HighlightEditor._defaultThickness],[m.HIGHLIGHT_FREE,highlight_classPrivateFieldGet(this,Hl)]]}},{key:"addEditToolbar",value:(r=function highlight_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){highlight_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){highlight_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}(highlight_regeneratorRuntime().mark((function _callee(){var t;return highlight_regeneratorRuntime().wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:r.next=2;return highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"addEditToolbar",this).call(this);case 2:if(t=r.sent){r.next=5;break}return r.abrupt("return",null);case 5:if(this._uiManager.highlightColors){highlight_classPrivateFieldSet(this,Ll,new Ml({editor:this}));t.addColorPicker(highlight_classPrivateFieldGet(this,Ll))}return r.abrupt("return",t);case 7:case"end":return r.stop()}}),_callee,this)}))),function addEditToolbar(){return r.apply(this,arguments)})},{key:"disableEditing",value:function disableEditing(){highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"disableEditing",this).call(this);this.div.classList.toggle("disabled",!0)}},{key:"enableEditing",value:function enableEditing(){highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"enableEditing",this).call(this);this.div.classList.toggle("disabled",!1)}},{key:"fixAndSetPosition",value:function fixAndSetPosition(){return highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"fixAndSetPosition",this).call(this,highlight_classPrivateMethodGet(this,Zl,_getRotation2).call(this))}},{key:"getBaseTranslation",value:function getBaseTranslation(){return[0,0]}},{key:"getRect",value:function getRect(t,r){return highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"getRect",this).call(this,t,r,highlight_classPrivateMethodGet(this,Zl,_getRotation2).call(this))}},{key:"onceAdded",value:function onceAdded(){this.parent.addUndoableEditor(this);this.div.focus()}},{key:"remove",value:function remove(){highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"remove",this).call(this);highlight_classPrivateMethodGet(this,Jl,_cleanDrawLayer2).call(this)}},{key:"rebuild",value:function rebuild(){if(this.parent){highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"rebuild",this).call(this);if(null!==this.div){highlight_classPrivateMethodGet(this,Ql,_addToDrawLayer2).call(this);this.isAttachedToDOM||this.parent.add(this)}}}},{key:"setParent",value:function setParent(t){var r=!1;if(this.parent&&!t)highlight_classPrivateMethodGet(this,Jl,_cleanDrawLayer2).call(this);else if(t){var a;highlight_classPrivateMethodGet(this,Ql,_addToDrawLayer2).call(this,t);r=!this.parent&&(null===(a=this.div)||void 0===a?void 0:a.classList.contains("selectedEditor"))}highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"setParent",this).call(this,t);r&&this.select()}},{key:"rotate",value:function rotate(t){var r,a=this.parent.drawLayer;if(highlight_classPrivateFieldGet(this,Hl)){t=(t-this.rotation+360)%360;r=highlight_classStaticPrivateMethodGet(HighlightEditor,HighlightEditor,_rotateBbox).call(HighlightEditor,highlight_classPrivateFieldGet(this,Nl).box,t)}else r=highlight_classStaticPrivateMethodGet(HighlightEditor,HighlightEditor,_rotateBbox).call(HighlightEditor,this,t);a.rotate(highlight_classPrivateFieldGet(this,Wl),t);a.rotate(highlight_classPrivateFieldGet(this,Ul),t);a.updateBox(highlight_classPrivateFieldGet(this,Wl),r);a.updateBox(highlight_classPrivateFieldGet(this,Ul),highlight_classStaticPrivateMethodGet(HighlightEditor,HighlightEditor,_rotateBbox).call(HighlightEditor,highlight_classPrivateFieldGet(this,Dl).box,t))}},{key:"render",value:function render(){if(this.div)return this.div;var t=highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"render",this).call(this);highlight_classPrivateFieldGet(this,Hl)&&t.classList.add("free");var r=highlight_classPrivateFieldSet(this,jl,document.createElement("div"));t.append(r);r.className="internal";r.style.clipPath=highlight_classPrivateFieldGet(this,Rl);var a=highlight_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1];this.setDims(this.width*i,this.height*o);bindEvents(this,highlight_classPrivateFieldGet(this,jl),["pointerover","pointerleave"]);this.enableEditing();return t}},{key:"pointerover",value:function pointerover(){this.parent.drawLayer.addClass(highlight_classPrivateFieldGet(this,Ul),"hovered")}},{key:"pointerleave",value:function pointerleave(){this.parent.drawLayer.removeClass(highlight_classPrivateFieldGet(this,Ul),"hovered")}},{key:"select",value:function select(){var t,r;highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"select",this).call(this);null===(t=this.parent)||void 0===t||t.drawLayer.removeClass(highlight_classPrivateFieldGet(this,Ul),"hovered");null===(r=this.parent)||void 0===r||r.drawLayer.addClass(highlight_classPrivateFieldGet(this,Ul),"selected")}},{key:"unselect",value:function unselect(){var t;highlight_get(highlight_getPrototypeOf(HighlightEditor.prototype),"unselect",this).call(this);null===(t=this.parent)||void 0===t||t.drawLayer.removeClass(highlight_classPrivateFieldGet(this,Ul),"selected")}},{key:"serialize",value:function serialize(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||t)return null;var r=this.getRect(0,0),a=fn._colorManager.convert(this.color);return{annotationType:g.HIGHLIGHT,color:a,opacity:highlight_classPrivateFieldGet(this,zl),thickness:highlight_classPrivateFieldGet(this,ql),quadPoints:highlight_classPrivateMethodGet(this,ec,_serializeBoxes2).call(this,r),outlines:highlight_classPrivateMethodGet(this,tc,_serializeOutlines2).call(this,r),pageIndex:this.pageIndex,rect:r,rotation:highlight_classPrivateMethodGet(this,Zl,_getRotation2).call(this),structTreeParentId:this._structTreeParentId}}}],[{key:"initialize",value:function initialize(t,r){var a;fn.initialize(t,r);HighlightEditor._defaultColor||(HighlightEditor._defaultColor=(null===(a=r.highlightColors)||void 0===a?void 0:a.values().next().value)||"#fff066")}},{key:"updateDefaultParams",value:function updateDefaultParams(t,r){switch(t){case m.HIGHLIGHT_DEFAULT_COLOR:HighlightEditor._defaultColor=r;break;case m.HIGHLIGHT_THICKNESS:HighlightEditor._defaultThickness=r}}},{key:"defaultPropertiesToUpdate",get:function get(){return[[m.HIGHLIGHT_DEFAULT_COLOR,HighlightEditor._defaultColor],[m.HIGHLIGHT_THICKNESS,HighlightEditor._defaultThickness]]}},{key:"startHighlighting",value:function startHighlighting(t,r,a){var i=this,o=a.target,l=a.x,c=a.y,u=o.getBoundingClientRect(),h=u.x,d=u.y,p=u.width,v=u.height,_=function pointerMove(r){highlight_classStaticPrivateMethodGet(i,HighlightEditor,_highlightMove).call(i,t,r)},y={capture:!0,passive:!1},g=function pointerDown(t){t.preventDefault();t.stopPropagation()},m=function pointerUpCallback(r){o.removeEventListener("pointermove",_);window.removeEventListener("blur",pointerUpCallback);window.removeEventListener("pointerup",pointerUpCallback);window.removeEventListener("pointerdown",g,y);window.removeEventListener("contextmenu",noContextMenu);highlight_classStaticPrivateMethodGet(i,HighlightEditor,_endHighlight).call(i,t,r)};window.addEventListener("blur",m);window.addEventListener("pointerup",m);window.addEventListener("pointerdown",g,y);window.addEventListener("contextmenu",noContextMenu);o.addEventListener("pointermove",_);this._freeHighlight=new Zs({x:l,y:c},[h,d,p,v],t.scale,this._defaultThickness/2,r,.001);var b=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0);this._freeHighlightId=b.id;this._freeHighlightClipId=b.clipPathId}},{key:"deserialize",value:function deserialize(t,r,a){var i=highlight_get(highlight_getPrototypeOf(HighlightEditor),"deserialize",this).call(this,t,r,a),o=highlight_slicedToArray(t.rect,4),l=o[0],c=o[1],u=o[2],h=o[3],d=t.color,p=t.quadPoints;i.color=fe.makeHexColor.apply(fe,highlight_toConsumableArray(d));highlight_classPrivateFieldSet(i,zl,t.opacity);var v=highlight_slicedToArray(i.pageDimensions,2),_=v[0],y=v[1];i.width=(u-l)/_;i.height=(h-c)/y;for(var g=highlight_classPrivateFieldSet(i,Ol,[]),m=0;m<p.length;m+=8)g.push({x:(p[4]-u)/_,y:(h-(1-p[m+5]))/y,width:(p[m+2]-p[m])/_,height:(p[m+5]-p[m+1])/y});highlight_classPrivateMethodGet(i,Vl,_createOutlines2).call(i);return i}},{key:"canCreateNewEmptyEditor",value:function canCreateNewEmptyEditor(){return!1}}]);var r;return HighlightEditor}(fn);pl=rc;function _createOutlines2(){var t=new Os(highlight_classPrivateFieldGet(this,Ol),.001);highlight_classPrivateFieldSet(this,Nl,t.getOutlines());var r=highlight_classPrivateFieldGet(this,Nl).box;this.x=r.x;this.y=r.y;this.width=r.width;this.height=r.height;var a=new Os(highlight_classPrivateFieldGet(this,Ol),.0025,.001,"ltr"===this._uiManager.direction);highlight_classPrivateFieldSet(this,Dl,a.getOutlines());var i=highlight_classPrivateFieldGet(this,Dl).box.lastPoint;highlight_classPrivateFieldSet(this,Bl,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])}function _createFreeOutlines2(t){var r=t.highlightOutlines,a=t.highlightId,i=t.clipPathId;highlight_classPrivateFieldSet(this,Nl,r);highlight_classPrivateFieldSet(this,Dl,r.getNewOutline(highlight_classPrivateFieldGet(this,ql)/2+1.5,.0025));if(a>=0){highlight_classPrivateFieldSet(this,Wl,a);highlight_classPrivateFieldSet(this,Rl,i);this.parent.drawLayer.finalizeLine(a,r);highlight_classPrivateFieldSet(this,Ul,this.parent.drawLayer.highlightOutline(highlight_classPrivateFieldGet(this,Dl)))}else if(this.parent){var o=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(highlight_classPrivateFieldGet(this,Wl),r);this.parent.drawLayer.updateBox(highlight_classPrivateFieldGet(this,Wl),highlight_classStaticPrivateMethodGet(pl,pl,_rotateBbox).call(pl,highlight_classPrivateFieldGet(this,Nl).box,(o-this.rotation+360)%360));this.parent.drawLayer.updateLine(highlight_classPrivateFieldGet(this,Ul),highlight_classPrivateFieldGet(this,Dl));this.parent.drawLayer.updateBox(highlight_classPrivateFieldGet(this,Ul),highlight_classStaticPrivateMethodGet(pl,pl,_rotateBbox).call(pl,highlight_classPrivateFieldGet(this,Dl).box,o))}var l=r.box,c=l.x,u=l.y,h=l.width,d=l.height;switch(this.rotation){case 0:this.x=c;this.y=u;this.width=h;this.height=d;break;case 90:var p=highlight_slicedToArray(this.parentDimensions,2),v=p[0],_=p[1];this.x=u;this.y=1-c;this.width=h*_/v;this.height=d*v/_;break;case 180:this.x=1-c;this.y=1-u;this.width=h;this.height=d;break;case 270:var y=highlight_slicedToArray(this.parentDimensions,2),g=y[0],m=y[1];this.x=1-u;this.y=c;this.width=h*m/g;this.height=d*g/m}var b=highlight_classPrivateFieldGet(this,Dl).box.lastPoint;highlight_classPrivateFieldSet(this,Bl,[(b[0]-c)/h,(b[1]-u)/d])}function highlight_updateColor2(t){var r=this,a=function setColor(t){var a,i;r.color=t;null===(a=r.parent)||void 0===a||a.drawLayer.changeColor(highlight_classPrivateFieldGet(r,Wl),t);null===(i=highlight_classPrivateFieldGet(r,Ll))||void 0===i||i.updateColor(t)},i=this.color;this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _updateThickness2(t){var r=this,a=highlight_classPrivateFieldGet(this,ql),i=function setThickness(t){highlight_classPrivateFieldSet(r,ql,t);highlight_classPrivateMethodGet(r,$l,_changeThickness2).call(r,t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function _changeThickness2(t){if(highlight_classPrivateFieldGet(this,Hl)){highlight_classPrivateMethodGet(this,Kl,_createFreeOutlines2).call(this,{highlightOutlines:highlight_classPrivateFieldGet(this,Nl).getNewOutline(t/2)});this.fixAndSetPosition();var r=highlight_slicedToArray(this.parentDimensions,2),a=r[0],i=r[1];this.setDims(this.width*a,this.height*i)}}function _cleanDrawLayer2(){if(null!==highlight_classPrivateFieldGet(this,Wl)&&this.parent){this.parent.drawLayer.remove(highlight_classPrivateFieldGet(this,Wl));highlight_classPrivateFieldSet(this,Wl,null);this.parent.drawLayer.remove(highlight_classPrivateFieldGet(this,Ul));highlight_classPrivateFieldSet(this,Ul,null)}}function _addToDrawLayer2(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;if(null===highlight_classPrivateFieldGet(this,Wl)){var r=t.drawLayer.highlight(highlight_classPrivateFieldGet(this,Nl),this.color,highlight_classPrivateFieldGet(this,zl));_classPrivateFieldDestructureSet(this,Wl).value=r.id;_classPrivateFieldDestructureSet(this,Rl).value=r.clipPathId;highlight_classPrivateFieldSet(this,Ul,t.drawLayer.highlightOutline(highlight_classPrivateFieldGet(this,Dl)));highlight_classPrivateFieldGet(this,jl)&&(highlight_classPrivateFieldGet(this,jl).style.clipPath=highlight_classPrivateFieldGet(this,Rl))}}function _rotateBbox(t,r){var a=t.x,i=t.y,o=t.width,l=t.height;switch(r){case 90:return{x:1-i-l,y:a,width:l,height:o};case 180:return{x:1-a-o,y:1-i-l,width:o,height:l};case 270:return{x:i,y:1-a-o,width:l,height:o}}return{x:a,y:i,width:o,height:l}}function _getRotation2(){return highlight_classPrivateFieldGet(this,Hl)?this.rotation:0}function _serializeBoxes2(t){if(highlight_classPrivateFieldGet(this,Hl))return null;var r,a=highlight_slicedToArray(this.pageDimensions,2),i=a[0],o=a[1],l=highlight_classPrivateFieldGet(this,Ol),c=new Array(8*l.length),u=highlight_slicedToArray(t,2),h=u[0],d=u[1],p=0,v=function highlight_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=highlight_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}(l);try{for(v.s();!(r=v.n()).done;){var _=r.value,y=_.x,g=_.y,m=_.width,b=_.height,w=h+y*i,P=d+(1-g-b)*o;c[p]=c[p+4]=w;c[p+1]=c[p+3]=P;c[p+2]=c[p+6]=w+m*i;c[p+5]=c[p+7]=P+b*o;p+=8}}catch(t){v.e(t)}finally{v.f()}return c}function _serializeOutlines2(t){return highlight_classPrivateFieldGet(this,Nl).serialize(t,highlight_classPrivateMethodGet(this,Zl,_getRotation2).call(this))}function _highlightMove(t,r){this._freeHighlight.add(r)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}function _endHighlight(t,r){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(this._freeHighlightId):t.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId});this._freeHighlightId=-1;this._freeHighlight=null;this._freeHighlightClipId=""}highlight_defineProperty(rc,"_defaultColor",null);highlight_defineProperty(rc,"_defaultOpacity",1);highlight_defineProperty(rc,"_defaultThickness",12);highlight_defineProperty(rc,"_l10nPromise",void 0);highlight_defineProperty(rc,"_type","highlight");highlight_defineProperty(rc,"_editorType",g.HIGHLIGHT);highlight_defineProperty(rc,"_freeHighlightId",-1);highlight_defineProperty(rc,"_freeHighlight",null);highlight_defineProperty(rc,"_freeHighlightClipId","");function ink_typeof(t){return ink_typeof="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},ink_typeof(t)}function ink_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=ink_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function ink_toConsumableArray(t){return function ink_arrayWithoutHoles(t){if(Array.isArray(t))return ink_arrayLikeToArray(t)}(t)||function ink_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ink_unsupportedIterableToArray(t)||function ink_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ink_slicedToArray(t,r){return function ink_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function ink_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||ink_unsupportedIterableToArray(t,r)||function ink_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ink_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return ink_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?ink_arrayLikeToArray(t,r):void 0}}function ink_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function ink_ownKeys(t,r){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,i)}return a}function ink_objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?ink_ownKeys(Object(a),!0).forEach((function(r){ink_defineProperty(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ink_ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}function ink_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,ink_toPropertyKey(i.key),i)}}function ink_callSuper(t,r,a){return r=ink_getPrototypeOf(r),function ink_possibleConstructorReturn(t,r){if(r&&("object"===ink_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return ink_assertThisInitialized(t)}(t,ink_isNativeReflectConstruct()?Reflect.construct(r,a||[],ink_getPrototypeOf(t).constructor):r.apply(t,a))}function ink_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ink_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function ink_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ink_get(){ink_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function ink_superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=ink_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}};return ink_get.apply(this,arguments)}function ink_getPrototypeOf(t){ink_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return ink_getPrototypeOf(t)}function ink_setPrototypeOf(t,r){ink_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return ink_setPrototypeOf(t,r)}function ink_classPrivateMethodInitSpec(t,r){ink_checkPrivateRedeclaration(t,r);r.add(t)}function ink_defineProperty(t,r,a){(r=ink_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function ink_toPropertyKey(t){var r=function ink_toPrimitive(t,r){if("object"!=ink_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=ink_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==ink_typeof(r)?r:String(r)}function ink_classPrivateFieldInitSpec(t,r,a){ink_checkPrivateRedeclaration(t,r);r.set(t,a)}function ink_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ink_classStaticPrivateMethodGet(t,r,a){!function ink_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function ink_classPrivateFieldSet(t,r,a){!function ink_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,ink_classExtractFieldDescriptor(t,r,"set"),a);return a}function ink_classPrivateFieldGet(t,r){return function ink_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,ink_classExtractFieldDescriptor(t,r,"get"))}function ink_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function ink_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}var nc,ac=new WeakMap,ic=new WeakMap,oc=new WeakMap,sc=new WeakMap,lc=new WeakMap,cc=new WeakMap,uc=new WeakMap,hc=new WeakMap,dc=new WeakMap,fc=new WeakMap,pc=new WeakMap,vc=new WeakMap,_c=new WeakMap,yc=new WeakMap,gc=new WeakMap,mc=new WeakSet,bc=new WeakSet,wc=new WeakSet,Pc=new WeakSet,kc=new WeakSet,Sc=new WeakSet,Fc=new WeakSet,Ac=new WeakSet,xc=new WeakSet,Ec=new WeakSet,Ic=new WeakSet,Tc=new WeakSet,Cc=new WeakSet,Mc=new WeakSet,Gc=new WeakSet,Oc=new WeakSet,Rc=new WeakSet,Lc=new WeakSet,Dc=new WeakSet,jc=new WeakSet,Nc=new WeakSet,Wc=new WeakSet,Hc=new WeakSet,Bc=function(t){!function ink_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&ink_setPrototypeOf(t,r)}(InkEditor,t);function InkEditor(t){var r;!function ink_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,InkEditor);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r=ink_callSuper(this,InkEditor,[ink_objectSpread(ink_objectSpread({},t),{},{name:"inkEditor"})])),Hc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Wc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Nc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),jc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Dc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Lc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Rc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Oc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Gc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Mc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Cc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Tc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Ic);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Ec);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),xc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Ac);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Fc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Sc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),kc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),Pc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),wc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),bc);ink_classPrivateMethodInitSpec(ink_assertThisInitialized(r),mc);ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),ac,{writable:!0,value:0});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),ic,{writable:!0,value:0});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),oc,{writable:!0,value:r.canvasPointermove.bind(ink_assertThisInitialized(r))});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),sc,{writable:!0,value:r.canvasPointerleave.bind(ink_assertThisInitialized(r))});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),lc,{writable:!0,value:r.canvasPointerup.bind(ink_assertThisInitialized(r))});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),cc,{writable:!0,value:r.canvasPointerdown.bind(ink_assertThisInitialized(r))});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),uc,{writable:!0,value:null});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),hc,{writable:!0,value:new Path2D});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),dc,{writable:!0,value:!1});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),fc,{writable:!0,value:!1});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),pc,{writable:!0,value:!1});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),vc,{writable:!0,value:null});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),_c,{writable:!0,value:0});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),yc,{writable:!0,value:0});ink_classPrivateFieldInitSpec(ink_assertThisInitialized(r),gc,{writable:!0,value:null});r.color=t.color||null;r.thickness=t.thickness||null;r.opacity=t.opacity||null;r.paths=[];r.bezierPath2D=[];r.allRawPaths=[];r.currentPath=[];r.scaleFactor=1;r.translationX=r.translationY=0;r.x=0;r.y=0;r._willKeepAspectRatio=!0;return r}!function ink_createClass(t,r,a){r&&ink_defineProperties(t.prototype,r);a&&ink_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(InkEditor,[{key:"updateParams",value:function updateParams(t,r){switch(t){case m.INK_THICKNESS:ink_classPrivateMethodGet(this,mc,ink_updateThickness2).call(this,r);break;case m.INK_COLOR:ink_classPrivateMethodGet(this,bc,ink_updateColor2).call(this,r);break;case m.INK_OPACITY:ink_classPrivateMethodGet(this,wc,_updateOpacity2).call(this,r)}}},{key:"propertiesToUpdate",get:function get(){var t;return[[m.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[m.INK_COLOR,this.color||InkEditor._defaultColor||fn._defaultLineColor],[m.INK_OPACITY,Math.round(100*(null!==(t=this.opacity)&&void 0!==t?t:InkEditor._defaultOpacity))]]}},{key:"rebuild",value:function rebuild(){if(this.parent){ink_get(ink_getPrototypeOf(InkEditor.prototype),"rebuild",this).call(this);if(null!==this.div){if(!this.canvas){ink_classPrivateMethodGet(this,Gc,_createCanvas2).call(this);ink_classPrivateMethodGet(this,Oc,_createObserver2).call(this)}if(!this.isAttachedToDOM){this.parent.add(this);ink_classPrivateMethodGet(this,Rc,_setCanvasDims2).call(this)}ink_classPrivateMethodGet(this,Hc,_fitToContent2).call(this)}}}},{key:"remove",value:function remove(){if(null!==this.canvas){this.isEmpty()||this.commit();this.canvas.width=this.canvas.height=0;this.canvas.remove();this.canvas=null;if(ink_classPrivateFieldGet(this,uc)){clearTimeout(ink_classPrivateFieldGet(this,uc));ink_classPrivateFieldSet(this,uc,null)}ink_classPrivateFieldGet(this,vc).disconnect();ink_classPrivateFieldSet(this,vc,null);ink_get(ink_getPrototypeOf(InkEditor.prototype),"remove",this).call(this)}}},{key:"setParent",value:function setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this);ink_get(ink_getPrototypeOf(InkEditor.prototype),"setParent",this).call(this,t)}},{key:"onScaleChanging",value:function onScaleChanging(){var t=ink_slicedToArray(this.parentDimensions,2),r=t[0],a=t[1],i=this.width*r,o=this.height*a;this.setDimensions(i,o)}},{key:"enableEditMode",value:function enableEditMode(){if(!ink_classPrivateFieldGet(this,dc)&&null!==this.canvas){ink_get(ink_getPrototypeOf(InkEditor.prototype),"enableEditMode",this).call(this);this._isDraggable=!1;this.canvas.addEventListener("pointerdown",ink_classPrivateFieldGet(this,cc))}}},{key:"disableEditMode",value:function disableEditMode(){if(this.isInEditMode()&&null!==this.canvas){ink_get(ink_getPrototypeOf(InkEditor.prototype),"disableEditMode",this).call(this);this._isDraggable=!this.isEmpty();this.div.classList.remove("editing");this.canvas.removeEventListener("pointerdown",ink_classPrivateFieldGet(this,cc))}}},{key:"onceAdded",value:function onceAdded(){this._isDraggable=!this.isEmpty()}},{key:"isEmpty",value:function isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}},{key:"commit",value:function commit(){if(!ink_classPrivateFieldGet(this,dc)){ink_get(ink_getPrototypeOf(InkEditor.prototype),"commit",this).call(this);this.isEditing=!1;this.disableEditMode();this.setInForeground();ink_classPrivateFieldSet(this,dc,!0);this.div.classList.add("disabled");ink_classPrivateMethodGet(this,Hc,_fitToContent2).call(this,!0);this.select();this.parent.addInkEditorIfNeeded(!0);this.moveInDOM();this.div.focus({preventScroll:!0})}}},{key:"focusin",value:function focusin(t){if(this._focusEventsAllowed){ink_get(ink_getPrototypeOf(InkEditor.prototype),"focusin",this).call(this,t);this.enableEditMode()}}},{key:"canvasPointerdown",value:function canvasPointerdown(t){if(0===t.button&&this.isInEditMode()&&!ink_classPrivateFieldGet(this,dc)){this.setInForeground();t.preventDefault();this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0});ink_classPrivateMethodGet(this,Sc,_startDrawing2).call(this,t.offsetX,t.offsetY)}}},{key:"canvasPointermove",value:function canvasPointermove(t){t.preventDefault();ink_classPrivateMethodGet(this,Fc,_draw2).call(this,t.offsetX,t.offsetY)}},{key:"canvasPointerup",value:function canvasPointerup(t){t.preventDefault();ink_classPrivateMethodGet(this,Mc,_endDrawing2).call(this,t)}},{key:"canvasPointerleave",value:function canvasPointerleave(t){ink_classPrivateMethodGet(this,Mc,_endDrawing2).call(this,t)}},{key:"isResizable",get:function get(){return!this.isEmpty()&&ink_classPrivateFieldGet(this,dc)}},{key:"render",value:function render(){if(this.div)return this.div;var t,r;if(this.width){t=this.x;r=this.y}ink_get(ink_getPrototypeOf(InkEditor.prototype),"render",this).call(this);this.div.setAttribute("data-l10n-id","pdfjs-ink");var a=ink_slicedToArray(ink_classPrivateMethodGet(this,Pc,_getInitialBBox2).call(this),4),i=a[0],o=a[1],l=a[2],c=a[3];this.setAt(i,o,0,0);this.setDims(l,c);ink_classPrivateMethodGet(this,Gc,_createCanvas2).call(this);if(this.width){var u=ink_slicedToArray(this.parentDimensions,2),h=u[0],d=u[1];this.setAspectRatio(this.width*h,this.height*d);this.setAt(t*h,r*d,this.width*h,this.height*d);ink_classPrivateFieldSet(this,pc,!0);ink_classPrivateMethodGet(this,Rc,_setCanvasDims2).call(this);this.setDims(this.width*h,this.height*d);ink_classPrivateMethodGet(this,Cc,_redraw2).call(this);this.div.classList.add("disabled")}else{this.div.classList.add("editing");this.enableEditMode()}ink_classPrivateMethodGet(this,Oc,_createObserver2).call(this);return this.div}},{key:"setDimensions",value:function setDimensions(t,r){var a=Math.round(t),i=Math.round(r);if(ink_classPrivateFieldGet(this,_c)!==a||ink_classPrivateFieldGet(this,yc)!==i){ink_classPrivateFieldSet(this,_c,a);ink_classPrivateFieldSet(this,yc,i);this.canvas.style.visibility="hidden";var o=ink_slicedToArray(this.parentDimensions,2),l=o[0],c=o[1];this.width=t/l;this.height=r/c;this.fixAndSetPosition();ink_classPrivateFieldGet(this,dc)&&ink_classPrivateMethodGet(this,Lc,_setScaleFactor2).call(this,t,r);ink_classPrivateMethodGet(this,Rc,_setCanvasDims2).call(this);ink_classPrivateMethodGet(this,Cc,_redraw2).call(this);this.canvas.style.visibility="visible";this.fixDims()}}},{key:"serialize",value:function serialize(){if(this.isEmpty())return null;var t=this.getRect(0,0),r=fn._colorManager.convert(this.ctx.strokeStyle);return{annotationType:g.INK,color:r,thickness:this.thickness,opacity:this.opacity,paths:ink_classPrivateMethodGet(this,jc,_serializePaths2).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}],[{key:"initialize",value:function initialize(t,r){fn.initialize(t,r)}},{key:"updateDefaultParams",value:function updateDefaultParams(t,r){switch(t){case m.INK_THICKNESS:InkEditor._defaultThickness=r;break;case m.INK_COLOR:InkEditor._defaultColor=r;break;case m.INK_OPACITY:InkEditor._defaultOpacity=r/100}}},{key:"defaultPropertiesToUpdate",get:function get(){return[[m.INK_THICKNESS,InkEditor._defaultThickness],[m.INK_COLOR,InkEditor._defaultColor||fn._defaultLineColor],[m.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}},{key:"deserialize",value:function deserialize(t,r,a){if(t instanceof qo)return null;var i=ink_get(ink_getPrototypeOf(InkEditor),"deserialize",this).call(this,t,r,a);i.thickness=t.thickness;i.color=fe.makeHexColor.apply(fe,ink_toConsumableArray(t.color));i.opacity=t.opacity;var o=ink_slicedToArray(i.pageDimensions,2),l=o[0],c=o[1],u=i.width*l,h=i.height*c,d=i.parentScale,p=t.thickness/2;ink_classPrivateFieldSet(i,dc,!0);ink_classPrivateFieldSet(i,_c,Math.round(u));ink_classPrivateFieldSet(i,yc,Math.round(h));var v,_=t.paths,y=t.rect,g=t.rotation,m=ink_createForOfIteratorHelper(_);try{for(m.s();!(v=m.n()).done;){var b=v.value.bezier;b=ink_classStaticPrivateMethodGet(InkEditor,InkEditor,_fromPDFCoordinates).call(InkEditor,b,y,g);var w=[];i.paths.push(w);for(var P=d*(b[0]-p),k=d*(b[1]-p),S=2,A=b.length;S<A;S+=6){var x=d*(b[S]-p),E=d*(b[S+1]-p),I=d*(b[S+2]-p),T=d*(b[S+3]-p),C=d*(b[S+4]-p),M=d*(b[S+5]-p);w.push([[P,k],[x,E],[I,T],[C,M]]);P=C;k=M}var G=ink_classStaticPrivateMethodGet(this,InkEditor,_buildPath2D).call(this,w);i.bezierPath2D.push(G)}}catch(t){m.e(t)}finally{m.f()}var O=ink_classPrivateMethodGet(i,Nc,_getBbox2).call(i);ink_classPrivateFieldSet(i,ic,Math.max(fn.MIN_SIZE,O[2]-O[0]));ink_classPrivateFieldSet(i,ac,Math.max(fn.MIN_SIZE,O[3]-O[1]));ink_classPrivateMethodGet(i,Lc,_setScaleFactor2).call(i,u,h);return i}}]);return InkEditor}(fn);Gl=Bc;function ink_updateThickness2(t){var r=this,a=function setThickness(t){r.thickness=t;ink_classPrivateMethodGet(r,Hc,_fitToContent2).call(r)},i=this.thickness;this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function ink_updateColor2(t){var r=this,a=function setColor(t){r.color=t;ink_classPrivateMethodGet(r,Cc,_redraw2).call(r)},i=this.color;this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _updateOpacity2(t){var r=this,a=function setOpacity(t){r.opacity=t;ink_classPrivateMethodGet(r,Cc,_redraw2).call(r)};t/=100;var i=this.opacity;this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:m.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function _getInitialBBox2(){var t=this.parentRotation,r=ink_slicedToArray(this.parentDimensions,2),a=r[0],i=r[1];switch(t){case 90:return[0,i,i,a];case 180:return[a,i,a,i];case 270:return[a,0,i,a];default:return[0,0,a,i]}}function _setStroke2(){var t=this.ctx,r=this.color,a=this.opacity,i=this.thickness,o=this.parentScale,l=this.scaleFactor;t.lineWidth=i*o/l;t.lineCap="round";t.lineJoin="round";t.miterLimit=10;t.strokeStyle="".concat(r).concat(function opacityToHex(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}(a))}function _startDrawing2(t,r){var a=this;this.canvas.addEventListener("contextmenu",noContextMenu);this.canvas.addEventListener("pointerleave",ink_classPrivateFieldGet(this,sc));this.canvas.addEventListener("pointermove",ink_classPrivateFieldGet(this,oc));this.canvas.addEventListener("pointerup",ink_classPrivateFieldGet(this,lc));this.canvas.removeEventListener("pointerdown",ink_classPrivateFieldGet(this,cc));this.isEditing=!0;if(!ink_classPrivateFieldGet(this,pc)){var i;ink_classPrivateFieldSet(this,pc,!0);ink_classPrivateMethodGet(this,Rc,_setCanvasDims2).call(this);this.thickness||(this.thickness=Gl._defaultThickness);this.color||(this.color=Gl._defaultColor||fn._defaultLineColor);null!==(i=this.opacity)&&void 0!==i||(this.opacity=Gl._defaultOpacity)}this.currentPath.push([t,r]);ink_classPrivateFieldSet(this,fc,!1);ink_classPrivateMethodGet(this,kc,_setStroke2).call(this);ink_classPrivateFieldSet(this,gc,(function(){ink_classPrivateMethodGet(a,Ec,_drawPoints2).call(a);ink_classPrivateFieldGet(a,gc)&&window.requestAnimationFrame(ink_classPrivateFieldGet(a,gc))}));window.requestAnimationFrame(ink_classPrivateFieldGet(this,gc))}function _draw2(t,r){var a,i=ink_slicedToArray(this.currentPath.at(-1),2),o=i[0],l=i[1];if(!(this.currentPath.length>1&&t===o&&r===l)){var c=this.currentPath,u=ink_classPrivateFieldGet(this,hc);c.push([t,r]);ink_classPrivateFieldSet(this,fc,!0);if(c.length<=2){var h;(h=u).moveTo.apply(h,ink_toConsumableArray(c[0]));u.lineTo(t,r)}else{if(3===c.length){var d;ink_classPrivateFieldSet(this,hc,u=new Path2D);(d=u).moveTo.apply(d,ink_toConsumableArray(c[0]))}(a=ink_classPrivateMethodGet(this,Ic,_makeBezierCurve2)).call.apply(a,[this,u].concat(ink_toConsumableArray(c.at(-3)),ink_toConsumableArray(c.at(-2)),[t,r]))}}}function _endPath2(){var t;if(0!==this.currentPath.length){var r=this.currentPath.at(-1);(t=ink_classPrivateFieldGet(this,hc)).lineTo.apply(t,ink_toConsumableArray(r))}}function _stopDrawing2(t,r){var a,i=this;ink_classPrivateFieldSet(this,gc,null);t=Math.min(Math.max(t,0),this.canvas.width);r=Math.min(Math.max(r,0),this.canvas.height);ink_classPrivateMethodGet(this,Fc,_draw2).call(this,t,r);ink_classPrivateMethodGet(this,Ac,_endPath2).call(this);if(1!==this.currentPath.length)a=ink_classPrivateMethodGet(this,Tc,_generateBezierPoints2).call(this);else{var o=[t,r];a=[[o,o.slice(),o.slice(),o]]}var l=ink_classPrivateFieldGet(this,hc),c=this.currentPath;this.currentPath=[];ink_classPrivateFieldSet(this,hc,new Path2D);this.addCommands({cmd:function cmd(){i.allRawPaths.push(c);i.paths.push(a);i.bezierPath2D.push(l);i.rebuild()},undo:function undo(){i.allRawPaths.pop();i.paths.pop();i.bezierPath2D.pop();if(0===i.paths.length)i.remove();else{if(!i.canvas){ink_classPrivateMethodGet(i,Gc,_createCanvas2).call(i);ink_classPrivateMethodGet(i,Oc,_createObserver2).call(i)}ink_classPrivateMethodGet(i,Hc,_fitToContent2).call(i)}},mustExec:!0})}function _drawPoints2(){if(ink_classPrivateFieldGet(this,fc)){ink_classPrivateFieldSet(this,fc,!1);var t=Math.ceil(this.thickness*this.parentScale),r=this.currentPath.slice(-3),a=r.map((function(t){return t[0]})),i=r.map((function(t){return t[1]})),o=(Math.min.apply(Math,ink_toConsumableArray(a)),Math.max.apply(Math,ink_toConsumableArray(a)),Math.min.apply(Math,ink_toConsumableArray(i)),Math.max.apply(Math,ink_toConsumableArray(i)),this.ctx);o.save();o.clearRect(0,0,this.canvas.width,this.canvas.height);var l,c=ink_createForOfIteratorHelper(this.bezierPath2D);try{for(c.s();!(l=c.n()).done;){var u=l.value;o.stroke(u)}}catch(t){c.e(t)}finally{c.f()}o.stroke(ink_classPrivateFieldGet(this,hc));o.restore()}}function _makeBezierCurve2(t,r,a,i,o,l,c){var u=(r+i)/2,h=(a+o)/2,d=(i+l)/2,p=(o+c)/2;t.bezierCurveTo(u+2*(i-u)/3,h+2*(o-h)/3,d+2*(i-d)/3,p+2*(o-p)/3,d,p)}function _generateBezierPoints2(){var t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];var r,a=[],i=ink_slicedToArray(t[0],2),o=i[0],l=i[1];for(r=1;r<t.length-2;r++){var c=ink_slicedToArray(t[r],2),u=c[0],h=c[1],d=ink_slicedToArray(t[r+1],2),p=(u+d[0])/2,v=(h+d[1])/2,_=[o+2*(u-o)/3,l+2*(h-l)/3],y=[p+2*(u-p)/3,v+2*(h-v)/3];a.push([[o,l],_,y,[p,v]]);o=p;l=v}var g=ink_slicedToArray(t[r],2),m=g[0],b=g[1],w=ink_slicedToArray(t[r+1],2),P=w[0],k=w[1],S=[o+2*(m-o)/3,l+2*(b-l)/3],A=[P+2*(m-P)/3,k+2*(b-k)/3];a.push([[o,l],S,A,[P,k]]);return a}function _redraw2(){if(this.isEmpty())ink_classPrivateMethodGet(this,Dc,_updateTransform2).call(this);else{ink_classPrivateMethodGet(this,kc,_setStroke2).call(this);var t=this.canvas,r=this.ctx;r.setTransform(1,0,0,1,0,0);r.clearRect(0,0,t.width,t.height);ink_classPrivateMethodGet(this,Dc,_updateTransform2).call(this);var a,i=ink_createForOfIteratorHelper(this.bezierPath2D);try{for(i.s();!(a=i.n()).done;){var o=a.value;r.stroke(o)}}catch(t){i.e(t)}finally{i.f()}}}function _endDrawing2(t){var r=this;this.canvas.removeEventListener("pointerleave",ink_classPrivateFieldGet(this,sc));this.canvas.removeEventListener("pointermove",ink_classPrivateFieldGet(this,oc));this.canvas.removeEventListener("pointerup",ink_classPrivateFieldGet(this,lc));this.canvas.addEventListener("pointerdown",ink_classPrivateFieldGet(this,cc));ink_classPrivateFieldGet(this,uc)&&clearTimeout(ink_classPrivateFieldGet(this,uc));ink_classPrivateFieldSet(this,uc,setTimeout((function(){ink_classPrivateFieldSet(r,uc,null);r.canvas.removeEventListener("contextmenu",noContextMenu)}),10));ink_classPrivateMethodGet(this,xc,_stopDrawing2).call(this,t.offsetX,t.offsetY);this.addToAnnotationStorage();this.setInBackground()}function _createCanvas2(){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);var t=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0;this.ctx=this.canvas.getContext("2d",t)}function _createObserver2(){var t=this;ink_classPrivateFieldSet(this,vc,new ResizeObserver((function(r){var a=r[0].contentRect;a.width&&a.height&&t.setDimensions(a.width,a.height)})));ink_classPrivateFieldGet(this,vc).observe(this.div)}function _setCanvasDims2(){if(ink_classPrivateFieldGet(this,pc)){var t=ink_slicedToArray(this.parentDimensions,2),r=t[0],a=t[1];this.canvas.width=Math.ceil(this.width*r);this.canvas.height=Math.ceil(this.height*a);ink_classPrivateMethodGet(this,Dc,_updateTransform2).call(this)}}function _setScaleFactor2(t,r){var a=ink_classPrivateMethodGet(this,Wc,_getPadding2).call(this),i=(t-a)/ink_classPrivateFieldGet(this,ic),o=(r-a)/ink_classPrivateFieldGet(this,ac);this.scaleFactor=Math.min(i,o)}function _updateTransform2(){var t=ink_classPrivateMethodGet(this,Wc,_getPadding2).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function _buildPath2D(t){for(var r=new Path2D,a=0,i=t.length;a<i;a++){var o=ink_slicedToArray(t[a],4),l=o[0],c=o[1],u=o[2],h=o[3];0===a&&r.moveTo.apply(r,ink_toConsumableArray(l));r.bezierCurveTo(c[0],c[1],u[0],u[1],h[0],h[1])}return r}function _toPDFCoordinates(t,r,a){var i=ink_slicedToArray(r,4),o=i[0],l=i[1],c=i[2],u=i[3];switch(a){case 0:for(var h=0,d=t.length;h<d;h+=2){t[h]+=o;t[h+1]=u-t[h+1]}break;case 90:for(var p=0,v=t.length;p<v;p+=2){var _=t[p];t[p]=t[p+1]+o;t[p+1]=_+l}break;case 180:for(var y=0,g=t.length;y<g;y+=2){t[y]=c-t[y];t[y+1]+=l}break;case 270:for(var m=0,b=t.length;m<b;m+=2){var w=t[m];t[m]=c-t[m+1];t[m+1]=u-w}break;default:throw new Error("Invalid rotation")}return t}function _fromPDFCoordinates(t,r,a){var i=ink_slicedToArray(r,4),o=i[0],l=i[1],c=i[2],u=i[3];switch(a){case 0:for(var h=0,d=t.length;h<d;h+=2){t[h]-=o;t[h+1]=u-t[h+1]}break;case 90:for(var p=0,v=t.length;p<v;p+=2){var _=t[p];t[p]=t[p+1]-l;t[p+1]=_-o}break;case 180:for(var y=0,g=t.length;y<g;y+=2){t[y]=c-t[y];t[y+1]-=l}break;case 270:for(var m=0,b=t.length;m<b;m+=2){var w=t[m];t[m]=u-t[m+1];t[m+1]=c-w}break;default:throw new Error("Invalid rotation")}return t}function _serializePaths2(t,r,a,i){var o,l=[],c=this.thickness/2,u=t*r+c,h=t*a+c,d=ink_createForOfIteratorHelper(this.paths);try{for(d.s();!(o=d.n()).done;){for(var p=o.value,v=[],_=[],y=0,g=p.length;y<g;y++){var m=ink_slicedToArray(p[y],4),b=m[0],w=m[1],P=m[2],k=m[3];if(b[0]===k[0]&&b[1]===k[1]&&1===g){var S=t*b[0]+u,A=t*b[1]+h;v.push(S,A);_.push(S,A);break}var x=t*b[0]+u,E=t*b[1]+h,I=t*w[0]+u,T=t*w[1]+h,C=t*P[0]+u,M=t*P[1]+h,G=t*k[0]+u,O=t*k[1]+h;if(0===y){v.push(x,E);_.push(x,E)}v.push(I,T,C,M,G,O);_.push(I,T);y===g-1&&_.push(G,O)}l.push({bezier:ink_classStaticPrivateMethodGet(Gl,Gl,_toPDFCoordinates).call(Gl,v,i,this.rotation),points:ink_classStaticPrivateMethodGet(Gl,Gl,_toPDFCoordinates).call(Gl,_,i,this.rotation)})}}catch(t){d.e(t)}finally{d.f()}return l}function _getBbox2(){var t,r=1/0,a=-1/0,i=1/0,o=-1/0,l=ink_createForOfIteratorHelper(this.paths);try{for(l.s();!(t=l.n()).done;){var c,u=ink_createForOfIteratorHelper(t.value);try{for(u.s();!(c=u.n()).done;){var h=ink_slicedToArray(c.value,4),d=h[0],p=h[1],v=h[2],_=h[3],y=fe.bezierBoundingBox.apply(fe,ink_toConsumableArray(d).concat(ink_toConsumableArray(p),ink_toConsumableArray(v),ink_toConsumableArray(_)));r=Math.min(r,y[0]);i=Math.min(i,y[1]);a=Math.max(a,y[2]);o=Math.max(o,y[3])}}catch(t){u.e(t)}finally{u.f()}}}catch(t){l.e(t)}finally{l.f()}return[r,i,a,o]}function _getPadding2(){return ink_classPrivateFieldGet(this,dc)?Math.ceil(this.thickness*this.parentScale):0}function _fitToContent2(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isEmpty())if(ink_classPrivateFieldGet(this,dc)){var r=ink_classPrivateMethodGet(this,Nc,_getBbox2).call(this),a=ink_classPrivateMethodGet(this,Wc,_getPadding2).call(this);ink_classPrivateFieldSet(this,ic,Math.max(fn.MIN_SIZE,r[2]-r[0]));ink_classPrivateFieldSet(this,ac,Math.max(fn.MIN_SIZE,r[3]-r[1]));var i=Math.ceil(a+ink_classPrivateFieldGet(this,ic)*this.scaleFactor),o=Math.ceil(a+ink_classPrivateFieldGet(this,ac)*this.scaleFactor),l=ink_slicedToArray(this.parentDimensions,2),c=l[0],u=l[1];this.width=i/c;this.height=o/u;this.setAspectRatio(i,o);var h=this.translationX,d=this.translationY;this.translationX=-r[0];this.translationY=-r[1];ink_classPrivateMethodGet(this,Rc,_setCanvasDims2).call(this);ink_classPrivateMethodGet(this,Cc,_redraw2).call(this);ink_classPrivateFieldSet(this,_c,i);ink_classPrivateFieldSet(this,yc,o);this.setDims(i,o);var p=t?a/this.scaleFactor/2:0;this.translate(h-this.translationX-p,d-this.translationY-p)}else ink_classPrivateMethodGet(this,Cc,_redraw2).call(this)}ink_defineProperty(Bc,"_defaultColor",null);ink_defineProperty(Bc,"_defaultOpacity",1);ink_defineProperty(Bc,"_defaultThickness",1);ink_defineProperty(Bc,"_type","ink");ink_defineProperty(Bc,"_editorType",g.INK);function stamp_typeof(t){return stamp_typeof="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},stamp_typeof(t)}function stamp_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */stamp_regeneratorRuntime=function _regeneratorRuntime(){return r};var t,r={},a=Object.prototype,i=a.hasOwnProperty,o=Object.defineProperty||function(t,r,a){t[r]=a.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function define(t,r,a){return Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var l=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(l.prototype),u=new Context(i||[]);return o(c,"_invoke",{value:makeInvokeMethod(t,a,u)}),c}function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="suspendedYield",v="executing",_="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(values([])));b&&b!==a&&i.call(b,c)&&(g=b);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"==stamp_typeof(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(d).then((function(t){h.value=t,l(h)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(r,a,i){var o=d;return function(l,c){if(o===v)throw new Error("Generator is already running");if(o===_){if("throw"===l)throw c;return{value:t,done:!0}}for(i.method=l,i.arg=c;;){var u=i.delegate;if(u){var h=maybeInvokeDelegate(u,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===d)throw o=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=v;var g=tryCatch(r,a,i);if("normal"===g.type){if(o=i.done?_:p,g.arg===y)continue;return{value:g.arg,done:i.done}}"throw"===g.type&&(o=_,i.method="throw",i.arg=g.arg)}}}function maybeInvokeDelegate(r,a){var i=a.method,o=r.iterator[i];if(o===t)return a.delegate=null,"throw"===i&&r.iterator.return&&(a.method="return",a.arg=t,maybeInvokeDelegate(r,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=tryCatch(o,r.iterator,a.arg);if("throw"===l.type)return a.method="throw",a.arg=l.arg,a.delegate=null,y;var c=l.arg;return c?c.done?(a[r.resultName]=c.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,y):c:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,y)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(r){if(r||""===r){var a=r[c];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,l=function next(){for(;++o<r.length;)if(i.call(r,o))return next.value=r[o],next.done=!1,next;return next.value=t,next.done=!0,next};return l.next=l}}throw new TypeError(stamp_typeof(r)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(t,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(t,a,i,o),l);return r.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),define(w,c,(function(){return this})),define(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),a=[];for(var i in r)a.push(i);return a.reverse(),function next(){for(;a.length;){var t=a.pop();if(t in r)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!r)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(r){if(this.done)throw r;var a=this;function handle(i,o){return c.type="throw",c.arg=r,a.next=i,o&&(a.method="next",a.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),h=i.call(l,"finallyLoc");if(u&&h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};return c.type=t,c.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),y}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(r,a,i){return this.delegate={iterator:values(r),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),y}},r}function stamp_asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),h=u.value}catch(t){a(t);return}u.done?r(h):Promise.resolve(h).then(i,o)}function stamp_asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){stamp_asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){stamp_asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function stamp_slicedToArray(t,r){return function stamp_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function stamp_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||function stamp_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return stamp_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return stamp_arrayLikeToArray(t,r)}(t,r)||function stamp_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function stamp_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function stamp_ownKeys(t,r){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,i)}return a}function stamp_objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?stamp_ownKeys(Object(a),!0).forEach((function(r){stamp_defineProperty(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):stamp_ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}function stamp_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,stamp_toPropertyKey(i.key),i)}}function stamp_callSuper(t,r,a){return r=stamp_getPrototypeOf(r),function stamp_possibleConstructorReturn(t,r){if(r&&("object"===stamp_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return stamp_assertThisInitialized(t)}(t,stamp_isNativeReflectConstruct()?Reflect.construct(r,a||[],stamp_getPrototypeOf(t).constructor):r.apply(t,a))}function stamp_isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(stamp_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function stamp_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function stamp_get(){stamp_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function stamp_superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=stamp_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}};return stamp_get.apply(this,arguments)}function stamp_getPrototypeOf(t){stamp_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return stamp_getPrototypeOf(t)}function stamp_setPrototypeOf(t,r){stamp_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return stamp_setPrototypeOf(t,r)}function stamp_classPrivateMethodInitSpec(t,r){stamp_checkPrivateRedeclaration(t,r);r.add(t)}function stamp_defineProperty(t,r,a){(r=stamp_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function stamp_toPropertyKey(t){var r=function stamp_toPrimitive(t,r){if("object"!=stamp_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=stamp_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==stamp_typeof(r)?r:String(r)}function stamp_classPrivateFieldInitSpec(t,r,a){stamp_checkPrivateRedeclaration(t,r);r.set(t,a)}function stamp_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function stamp_classPrivateFieldGet(t,r){return function stamp_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,stamp_classExtractFieldDescriptor(t,r,"get"))}function stamp_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function stamp_classPrivateFieldSet(t,r,a){!function stamp_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,stamp_classExtractFieldDescriptor(t,r,"set"),a);return a}function stamp_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var zc,Uc=new WeakMap,qc=new WeakMap,Vc=new WeakMap,Kc=new WeakMap,Yc=new WeakMap,Xc=new WeakMap,$c=new WeakMap,Jc=new WeakMap,Qc=new WeakMap,Zc=new WeakMap,eu=new WeakMap,tu=new WeakSet,ru=new WeakSet,nu=new WeakSet,au=new WeakSet,iu=new WeakSet,ou=new WeakSet,su=new WeakSet,lu=new WeakSet,cu=new WeakSet,uu=function(t){!function stamp_inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&stamp_setPrototypeOf(t,r)}(StampEditor,t);function StampEditor(t){var r;!function stamp_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,StampEditor);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r=stamp_callSuper(this,StampEditor,[stamp_objectSpread(stamp_objectSpread({},t),{},{name:"stampEditor"})])),cu);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),lu);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),su);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),ou);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),iu);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),au);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),nu);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),ru);stamp_classPrivateMethodInitSpec(stamp_assertThisInitialized(r),tu);stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Uc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),qc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Vc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Kc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Yc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Xc,{writable:!0,value:""});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),$c,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Jc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Qc,{writable:!0,value:null});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),Zc,{writable:!0,value:!1});stamp_classPrivateFieldInitSpec(stamp_assertThisInitialized(r),eu,{writable:!0,value:!1});stamp_classPrivateFieldSet(stamp_assertThisInitialized(r),Kc,t.bitmapUrl);stamp_classPrivateFieldSet(stamp_assertThisInitialized(r),Yc,t.bitmapFile);return r}!function stamp_createClass(t,r,a){r&&stamp_defineProperties(t.prototype,r);a&&stamp_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(StampEditor,[{key:"remove",value:function remove(){if(stamp_classPrivateFieldGet(this,qc)){var t,r;stamp_classPrivateFieldSet(this,Uc,null);this._uiManager.imageManager.deleteId(stamp_classPrivateFieldGet(this,qc));null===(t=stamp_classPrivateFieldGet(this,$c))||void 0===t||t.remove();stamp_classPrivateFieldSet(this,$c,null);null===(r=stamp_classPrivateFieldGet(this,Jc))||void 0===r||r.disconnect();stamp_classPrivateFieldSet(this,Jc,null);if(stamp_classPrivateFieldGet(this,Qc)){clearTimeout(stamp_classPrivateFieldGet(this,Qc));stamp_classPrivateFieldSet(this,Qc,null)}}stamp_get(stamp_getPrototypeOf(StampEditor.prototype),"remove",this).call(this)}},{key:"rebuild",value:function rebuild(){if(this.parent){stamp_get(stamp_getPrototypeOf(StampEditor.prototype),"rebuild",this).call(this);if(null!==this.div){stamp_classPrivateFieldGet(this,qc)&&stamp_classPrivateMethodGet(this,nu,_getBitmap2).call(this);this.isAttachedToDOM||this.parent.add(this)}}else stamp_classPrivateFieldGet(this,qc)&&stamp_classPrivateMethodGet(this,nu,_getBitmap2).call(this)}},{key:"onceAdded",value:function onceAdded(){this._isDraggable=!0;this.div.focus()}},{key:"isEmpty",value:function isEmpty(){return!(stamp_classPrivateFieldGet(this,Vc)||stamp_classPrivateFieldGet(this,Uc)||stamp_classPrivateFieldGet(this,Kc)||stamp_classPrivateFieldGet(this,Yc))}},{key:"isResizable",get:function get(){return!0}},{key:"render",value:function render(){if(this.div)return this.div;var t,r;if(this.width){t=this.x;r=this.y}stamp_get(stamp_getPrototypeOf(StampEditor.prototype),"render",this).call(this);this.div.hidden=!0;stamp_classPrivateFieldGet(this,Uc)?stamp_classPrivateMethodGet(this,au,stamp_createCanvas2).call(this):stamp_classPrivateMethodGet(this,nu,_getBitmap2).call(this);if(this.width){var a=stamp_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1];this.setAt(t*i,r*o,this.width*i,this.height*o)}return this.div}},{key:"getImageForAltText",value:function getImageForAltText(){return stamp_classPrivateFieldGet(this,$c)}},{key:"serialize",value:function serialize(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;var a={annotationType:g.STAMP,bitmapId:stamp_classPrivateFieldGet(this,qc),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:stamp_classPrivateFieldGet(this,Zc),structTreeParentId:this._structTreeParentId};if(t){a.bitmapUrl=stamp_classPrivateMethodGet(this,lu,_serializeBitmap2).call(this,!0);a.accessibilityData=this.altTextData;return a}var i=this.altTextData,o=i.decorative,l=i.altText;!o&&l&&(a.accessibilityData={type:"Figure",alt:l});if(null===r)return a;r.stamps||(r.stamps=new Map);var c=stamp_classPrivateFieldGet(this,Zc)?(a.rect[2]-a.rect[0])*(a.rect[3]-a.rect[1]):null;if(r.stamps.has(stamp_classPrivateFieldGet(this,qc))){if(stamp_classPrivateFieldGet(this,Zc)){var u=r.stamps.get(stamp_classPrivateFieldGet(this,qc));if(c>u.area){u.area=c;u.serialized.bitmap.close();u.serialized.bitmap=stamp_classPrivateMethodGet(this,lu,_serializeBitmap2).call(this,!1)}}}else{r.stamps.set(stamp_classPrivateFieldGet(this,qc),{area:c,serialized:a});a.bitmap=stamp_classPrivateMethodGet(this,lu,_serializeBitmap2).call(this,!1)}return a}}],[{key:"initialize",value:function initialize(t,r){fn.initialize(t,r)}},{key:"supportedTypes",get:function get(){return shadow(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((function(t){return"image/".concat(t)})))}},{key:"supportedTypesStr",get:function get(){return shadow(this,"supportedTypesStr",this.supportedTypes.join(","))}},{key:"isHandlingMimeForPasting",value:function isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}},{key:"paste",value:function paste(t,r){r.pasteEditor(g.STAMP,{bitmapFile:t.getAsFile()})}},{key:"deserialize",value:function deserialize(t,r,a){if(t instanceof $o)return null;var i=stamp_get(stamp_getPrototypeOf(StampEditor),"deserialize",this).call(this,t,r,a),o=t.rect,l=t.bitmapUrl,c=t.bitmapId,u=t.isSvg,h=t.accessibilityData;c&&a.imageManager.isValidId(c)?stamp_classPrivateFieldSet(i,qc,c):stamp_classPrivateFieldSet(i,Kc,l);stamp_classPrivateFieldSet(i,Zc,u);var d=stamp_slicedToArray(i.pageDimensions,2),p=d[0],v=d[1];i.width=(o[2]-o[0])/p;i.height=(o[3]-o[1])/v;h&&(i.altTextData=h);return i}}]);return StampEditor}(fn);nc=uu;function _getBitmapFetched2(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){stamp_classPrivateFieldSet(this,Uc,t.bitmap);if(!r){stamp_classPrivateFieldSet(this,qc,t.id);stamp_classPrivateFieldSet(this,Zc,t.isSvg)}t.file&&stamp_classPrivateFieldSet(this,Xc,t.file.name);stamp_classPrivateMethodGet(this,au,stamp_createCanvas2).call(this)}else this.remove()}function _getBitmapDone2(){stamp_classPrivateFieldSet(this,Vc,null);this._uiManager.enableWaiting(!1);stamp_classPrivateFieldGet(this,$c)&&this.div.focus()}function _getBitmap2(){var t=this;if(stamp_classPrivateFieldGet(this,qc)){this._uiManager.enableWaiting(!0);this._uiManager.imageManager.getFromId(stamp_classPrivateFieldGet(this,qc)).then((function(r){return stamp_classPrivateMethodGet(t,tu,_getBitmapFetched2).call(t,r,!0)})).finally((function(){return stamp_classPrivateMethodGet(t,ru,_getBitmapDone2).call(t)}))}else if(stamp_classPrivateFieldGet(this,Kc)){var r=stamp_classPrivateFieldGet(this,Kc);stamp_classPrivateFieldSet(this,Kc,null);this._uiManager.enableWaiting(!0);stamp_classPrivateFieldSet(this,Vc,this._uiManager.imageManager.getFromUrl(r).then((function(r){return stamp_classPrivateMethodGet(t,tu,_getBitmapFetched2).call(t,r)})).finally((function(){return stamp_classPrivateMethodGet(t,ru,_getBitmapDone2).call(t)})))}else if(stamp_classPrivateFieldGet(this,Yc)){var a=stamp_classPrivateFieldGet(this,Yc);stamp_classPrivateFieldSet(this,Yc,null);this._uiManager.enableWaiting(!0);stamp_classPrivateFieldSet(this,Vc,this._uiManager.imageManager.getFromFile(a).then((function(r){return stamp_classPrivateMethodGet(t,tu,_getBitmapFetched2).call(t,r)})).finally((function(){return stamp_classPrivateMethodGet(t,ru,_getBitmapDone2).call(t)})))}else{var i=document.createElement("input");i.type="file";i.accept=nc.supportedTypesStr;stamp_classPrivateFieldSet(this,Vc,new Promise((function(r){i.addEventListener("change",stamp_asyncToGenerator(stamp_regeneratorRuntime().mark((function _callee(){var a;return stamp_regeneratorRuntime().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:if(i.files&&0!==i.files.length){o.next=4;break}t.remove();o.next=9;break;case 4:t._uiManager.enableWaiting(!0);o.next=7;return t._uiManager.imageManager.getFromFile(i.files[0]);case 7:a=o.sent;stamp_classPrivateMethodGet(t,tu,_getBitmapFetched2).call(t,a);case 9:r();case 10:case"end":return o.stop()}}),_callee)}))));i.addEventListener("cancel",(function(){t.remove();r()}))})).finally((function(){return stamp_classPrivateMethodGet(t,ru,_getBitmapDone2).call(t)})));i.click()}}function stamp_createCanvas2(){var t=this.div,r=stamp_classPrivateFieldGet(this,Uc),a=r.width,i=r.height,o=stamp_slicedToArray(this.pageDimensions,2),l=o[0],c=o[1],u=.75;if(this.width){a=this.width*l;i=this.height*c}else if(a>u*l||i>u*c){var h=Math.min(u*l/a,u*c/i);a*=h;i*=h}var d=stamp_slicedToArray(this.parentDimensions,2),p=d[0],v=d[1];this.setDims(a*p/l,i*v/c);this._uiManager.enableWaiting(!1);var _=stamp_classPrivateFieldSet(this,$c,document.createElement("canvas"));t.append(_);t.hidden=!1;stamp_classPrivateMethodGet(this,su,_drawBitmap2).call(this,a,i);stamp_classPrivateMethodGet(this,cu,stamp_createObserver2).call(this);if(!stamp_classPrivateFieldGet(this,eu)){this.parent.addUndoableEditor(this);stamp_classPrivateFieldSet(this,eu,!0)}this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}});this.addAltTextButton();stamp_classPrivateFieldGet(this,Xc)&&_.setAttribute("aria-label",stamp_classPrivateFieldGet(this,Xc))}function _setDimensions2(t,r){var a,i=this,o=stamp_slicedToArray(this.parentDimensions,2),l=o[0],c=o[1];this.width=t/l;this.height=r/c;this.setDims(t,r);null!==(a=this._initialOptions)&&void 0!==a&&a.isCentered?this.center():this.fixAndSetPosition();this._initialOptions=null;null!==stamp_classPrivateFieldGet(this,Qc)&&clearTimeout(stamp_classPrivateFieldGet(this,Qc));stamp_classPrivateFieldSet(this,Qc,setTimeout((function(){stamp_classPrivateFieldSet(i,Qc,null);stamp_classPrivateMethodGet(i,su,_drawBitmap2).call(i,t,r)}),200))}function _scaleBitmap2(t,r){for(var a=stamp_classPrivateFieldGet(this,Uc),i=a.width,o=a.height,l=stamp_classPrivateFieldGet(this,Uc);i>2*t||o>2*r;){var c=i,u=o;i>2*t&&(i=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2));o>2*r&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));var h=new OffscreenCanvas(i,o);h.getContext("2d").drawImage(l,0,0,c,u,0,0,i,o);l=h.transferToImageBitmap()}return l}function _drawBitmap2(t,r){t=Math.ceil(t);r=Math.ceil(r);var a=stamp_classPrivateFieldGet(this,$c);if(a&&(a.width!==t||a.height!==r)){a.width=t;a.height=r;var i=stamp_classPrivateFieldGet(this,Zc)?stamp_classPrivateFieldGet(this,Uc):stamp_classPrivateMethodGet(this,ou,_scaleBitmap2).call(this,t,r),o=a.getContext("2d");o.filter=this._uiManager.hcmFilter;o.drawImage(i,0,0,i.width,i.height,0,0,t,r)}}function _serializeBitmap2(t){if(t){if(stamp_classPrivateFieldGet(this,Zc)){var r=this._uiManager.imageManager.getSvgUrl(stamp_classPrivateFieldGet(this,qc));if(r)return r}var a=document.createElement("canvas"),i=stamp_classPrivateFieldGet(this,Uc);a.width=i.width;a.height=i.height;a.getContext("2d").drawImage(stamp_classPrivateFieldGet(this,Uc),0,0);return a.toDataURL()}if(stamp_classPrivateFieldGet(this,Zc)){var o=stamp_slicedToArray(this.pageDimensions,2),l=o[0],c=o[1],u=Math.round(this.width*l*Ae.PDF_TO_CSS_UNITS),h=Math.round(this.height*c*Ae.PDF_TO_CSS_UNITS),d=new OffscreenCanvas(u,h);d.getContext("2d").drawImage(stamp_classPrivateFieldGet(this,Uc),0,0,stamp_classPrivateFieldGet(this,Uc).width,stamp_classPrivateFieldGet(this,Uc).height,0,0,u,h);return d.transferToImageBitmap()}return structuredClone(stamp_classPrivateFieldGet(this,Uc))}function stamp_createObserver2(){var t=this;stamp_classPrivateFieldSet(this,Jc,new ResizeObserver((function(r){var a=r[0].contentRect;a.width&&a.height&&stamp_classPrivateMethodGet(t,iu,_setDimensions2).call(t,a.width,a.height)})));stamp_classPrivateFieldGet(this,Jc).observe(this.div)}stamp_defineProperty(uu,"_type","stamp");stamp_defineProperty(uu,"_editorType",g.STAMP);function annotation_editor_layer_typeof(t){return annotation_editor_layer_typeof="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},annotation_editor_layer_typeof(t)}function annotation_editor_layer_slicedToArray(t,r){return function annotation_editor_layer_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function annotation_editor_layer_iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],h=!0,d=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;h=!1}else for(;!(h=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(t){d=!0,o=t}finally{try{if(!h&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw o}}return u}}(t,r)||annotation_editor_layer_unsupportedIterableToArray(t,r)||function annotation_editor_layer_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function annotation_editor_layer_ownKeys(t,r){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,i)}return a}function annotation_editor_layer_objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?annotation_editor_layer_ownKeys(Object(a),!0).forEach((function(r){annotation_editor_layer_defineProperty(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):annotation_editor_layer_ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}function annotation_editor_layer_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=annotation_editor_layer_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function annotation_editor_layer_toConsumableArray(t){return function annotation_editor_layer_arrayWithoutHoles(t){if(Array.isArray(t))return annotation_editor_layer_arrayLikeToArray(t)}(t)||function annotation_editor_layer_iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||annotation_editor_layer_unsupportedIterableToArray(t)||function annotation_editor_layer_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function annotation_editor_layer_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return annotation_editor_layer_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?annotation_editor_layer_arrayLikeToArray(t,r):void 0}}function annotation_editor_layer_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function annotation_editor_layer_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,annotation_editor_layer_toPropertyKey(i.key),i)}}function annotation_editor_layer_classPrivateMethodInitSpec(t,r){annotation_editor_layer_checkPrivateRedeclaration(t,r);r.add(t)}function annotation_editor_layer_defineProperty(t,r,a){(r=annotation_editor_layer_toPropertyKey(r))in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function annotation_editor_layer_toPropertyKey(t){var r=function annotation_editor_layer_toPrimitive(t,r){if("object"!=annotation_editor_layer_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=annotation_editor_layer_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==annotation_editor_layer_typeof(r)?r:String(r)}function annotation_editor_layer_classPrivateFieldInitSpec(t,r,a){annotation_editor_layer_checkPrivateRedeclaration(t,r);r.set(t,a)}function annotation_editor_layer_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function annotation_editor_layer_classPrivateFieldGet(t,r){return annotation_editor_layer_classApplyDescriptorGet(t,annotation_editor_layer_classExtractFieldDescriptor(t,r,"get"))}function annotation_editor_layer_classPrivateFieldSet(t,r,a){!function annotation_editor_layer_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,annotation_editor_layer_classExtractFieldDescriptor(t,r,"set"),a);return a}function annotation_editor_layer_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function annotation_editor_layer_classStaticPrivateFieldSpecGet(t,r,a){!function annotation_editor_layer_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);!function annotation_editor_layer_classCheckPrivateStaticFieldDescriptor(t,r){if(void 0===t)throw new TypeError("attempted to "+r+" private static field before its declaration")}(a,"get");return annotation_editor_layer_classApplyDescriptorGet(t,a)}function annotation_editor_layer_classApplyDescriptorGet(t,r){return r.get?r.get.call(t):r.value}function annotation_editor_layer_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}var hu=new WeakMap,du=new WeakMap,fu=new WeakMap,pu=new WeakMap,vu=new WeakMap,_u=new WeakMap,yu=new WeakMap,gu=new WeakMap,mu=new WeakMap,bu=new WeakMap,wu=new WeakMap,Pu=new WeakMap,ku=new WeakMap,Su=new WeakMap,Fu=new WeakMap,Au=new WeakSet,xu=new WeakMap,Eu=new WeakSet,Iu=new WeakSet,Tu=new WeakSet,Cu=function(){function AnnotationEditorLayer(t){var r=t.uiManager,a=t.pageIndex,i=t.div,o=t.accessibilityManager,l=t.annotationLayer,c=t.drawLayer,u=t.textLayer,h=t.viewport,d=t.l10n;!function annotation_editor_layer_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,AnnotationEditorLayer);annotation_editor_layer_classPrivateMethodInitSpec(this,Tu);annotation_editor_layer_classPrivateMethodInitSpec(this,Iu);annotation_editor_layer_classPrivateMethodInitSpec(this,Eu);annotation_editor_layer_classPrivateFieldInitSpec(this,xu,{get:_get_currentEditorType,set:void 0});annotation_editor_layer_classPrivateMethodInitSpec(this,Au);annotation_editor_layer_classPrivateFieldInitSpec(this,hu,{writable:!0,value:void 0});annotation_editor_layer_classPrivateFieldInitSpec(this,du,{writable:!0,value:!1});annotation_editor_layer_classPrivateFieldInitSpec(this,fu,{writable:!0,value:null});annotation_editor_layer_classPrivateFieldInitSpec(this,pu,{writable:!0,value:this.pointerup.bind(this)});annotation_editor_layer_classPrivateFieldInitSpec(this,vu,{writable:!0,value:this.pointerUpAfterSelection.bind(this)});annotation_editor_layer_classPrivateFieldInitSpec(this,_u,{writable:!0,value:this.pointerdown.bind(this)});annotation_editor_layer_classPrivateFieldInitSpec(this,yu,{writable:!0,value:annotation_editor_layer_classPrivateMethodGet(this,Au,_textLayerPointerDown2).bind(this)});annotation_editor_layer_classPrivateFieldInitSpec(this,gu,{writable:!0,value:null});annotation_editor_layer_classPrivateFieldInitSpec(this,mu,{writable:!0,value:this.selectionStart.bind(this)});annotation_editor_layer_classPrivateFieldInitSpec(this,bu,{writable:!0,value:new Map});annotation_editor_layer_classPrivateFieldInitSpec(this,wu,{writable:!0,value:!1});annotation_editor_layer_classPrivateFieldInitSpec(this,Pu,{writable:!0,value:!1});annotation_editor_layer_classPrivateFieldInitSpec(this,ku,{writable:!0,value:!1});annotation_editor_layer_classPrivateFieldInitSpec(this,Su,{writable:!0,value:null});annotation_editor_layer_classPrivateFieldInitSpec(this,Fu,{writable:!0,value:void 0});var p=annotation_editor_layer_toConsumableArray(annotation_editor_layer_classStaticPrivateFieldSpecGet(AnnotationEditorLayer,AnnotationEditorLayer,Gu).values());if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;var v,_=annotation_editor_layer_createForOfIteratorHelper(p);try{for(_.s();!(v=_.n()).done;){v.value.initialize(d,r)}}catch(t){_.e(t)}finally{_.f()}}r.registerEditorTypes(p);annotation_editor_layer_classPrivateFieldSet(this,Fu,r);this.pageIndex=a;this.div=i;annotation_editor_layer_classPrivateFieldSet(this,hu,o);annotation_editor_layer_classPrivateFieldSet(this,fu,l);this.viewport=h;annotation_editor_layer_classPrivateFieldSet(this,Su,u);this.drawLayer=c;annotation_editor_layer_classPrivateFieldGet(this,Fu).addLayer(this)}!function annotation_editor_layer_createClass(t,r,a){r&&annotation_editor_layer_defineProperties(t.prototype,r);a&&annotation_editor_layer_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(AnnotationEditorLayer,[{key:"isEmpty",get:function get(){return 0===annotation_editor_layer_classPrivateFieldGet(this,bu).size}},{key:"updateToolbar",value:function updateToolbar(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).updateToolbar(t)}},{key:"updateMode",value:function updateMode(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:annotation_editor_layer_classPrivateFieldGet(this,Fu).getMode();annotation_editor_layer_classPrivateMethodGet(this,Tu,_cleanup2).call(this);switch(t){case g.NONE:this.disableTextSelection();this.togglePointerEvents(!1);this.disableClick();break;case g.INK:this.addInkEditorIfNeeded(!1);this.disableTextSelection();this.togglePointerEvents(!0);this.disableClick();break;case g.HIGHLIGHT:this.enableTextSelection();this.togglePointerEvents(!1);this.disableClick();break;default:this.disableTextSelection();this.togglePointerEvents(!0);this.enableClick()}if(t!==g.NONE){var r,a=this.div.classList,i=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classStaticPrivateFieldSpecGet(AnnotationEditorLayer,AnnotationEditorLayer,Gu).values());try{for(i.s();!(r=i.n()).done;){var o=r.value;a.toggle("".concat(o._type,"Editing"),t===o._editorType)}}catch(t){i.e(t)}finally{i.f()}this.div.hidden=!1}}},{key:"addInkEditorIfNeeded",value:function addInkEditorIfNeeded(t){if(annotation_editor_layer_classPrivateFieldGet(this,Fu).getMode()===g.INK){if(!t){var r,a=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(a.s();!(r=a.n()).done;){var i=r.value;if(i.isEmpty()){i.setInBackground();return}}}catch(t){a.e(t)}finally{a.f()}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}}},{key:"setEditingState",value:function setEditingState(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).setEditingState(t)}},{key:"addCommands",value:function addCommands(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).addCommands(t)}},{key:"togglePointerEvents",value:function togglePointerEvents(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}},{key:"enable",value:function enable(){this.togglePointerEvents(!0);var t,r=new Set,a=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(a.s();!(t=a.n()).done;){var i=t.value;i.enableEditing();i.annotationElementId&&r.add(i.annotationElementId)}}catch(t){a.e(t)}finally{a.f()}if(annotation_editor_layer_classPrivateFieldGet(this,fu)){var o,l=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,fu).getEditableAnnotations());try{for(l.s();!(o=l.n()).done;){var c=o.value;c.hide();if(!annotation_editor_layer_classPrivateFieldGet(this,Fu).isDeletedAnnotationElement(c.data.id)&&!r.has(c.data.id)){var u=this.deserialize(c);if(u){this.addOrRebuild(u);u.enableEditing()}}}}catch(t){l.e(t)}finally{l.f()}}}},{key:"disable",value:function disable(){annotation_editor_layer_classPrivateFieldSet(this,ku,!0);this.togglePointerEvents(!1);var t,r=new Set,a=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(a.s();!(t=a.n()).done;){var i,o=t.value;o.disableEditing();if(o.annotationElementId&&null===o.serialize()){null===(i=this.getEditableAnnotation(o.annotationElementId))||void 0===i||i.show();o.remove()}else r.add(o.annotationElementId)}}catch(t){a.e(t)}finally{a.f()}if(annotation_editor_layer_classPrivateFieldGet(this,fu)){var l,c=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,fu).getEditableAnnotations());try{for(c.s();!(l=c.n()).done;){var u=l.value,h=u.data.id;r.has(h)||annotation_editor_layer_classPrivateFieldGet(this,Fu).isDeletedAnnotationElement(h)||u.show()}}catch(t){c.e(t)}finally{c.f()}}annotation_editor_layer_classPrivateMethodGet(this,Tu,_cleanup2).call(this);this.isEmpty&&(this.div.hidden=!0);var d,p=this.div.classList,v=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classStaticPrivateFieldSpecGet(AnnotationEditorLayer,AnnotationEditorLayer,Gu).values());try{for(v.s();!(d=v.n()).done;){var _=d.value;p.remove("".concat(_._type,"Editing"))}}catch(t){v.e(t)}finally{v.f()}this.disableTextSelection();annotation_editor_layer_classPrivateFieldSet(this,ku,!1)}},{key:"getEditableAnnotation",value:function getEditableAnnotation(t){var r;return(null===(r=annotation_editor_layer_classPrivateFieldGet(this,fu))||void 0===r?void 0:r.getEditableAnnotation(t))||null}},{key:"setActiveEditor",value:function setActiveEditor(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).getActive()!==t&&annotation_editor_layer_classPrivateFieldGet(this,Fu).setActiveEditor(t)}},{key:"enableTextSelection",value:function enableTextSelection(){var t;if(null!==(t=annotation_editor_layer_classPrivateFieldGet(this,Su))&&void 0!==t&&t.div){document.addEventListener("selectstart",annotation_editor_layer_classPrivateFieldGet(this,mu));annotation_editor_layer_classPrivateFieldGet(this,Su).div.addEventListener("pointerdown",annotation_editor_layer_classPrivateFieldGet(this,yu));annotation_editor_layer_classPrivateFieldGet(this,Su).div.classList.add("highlighting")}}},{key:"disableTextSelection",value:function disableTextSelection(){var t;if(null!==(t=annotation_editor_layer_classPrivateFieldGet(this,Su))&&void 0!==t&&t.div){document.removeEventListener("selectstart",annotation_editor_layer_classPrivateFieldGet(this,mu));annotation_editor_layer_classPrivateFieldGet(this,Su).div.removeEventListener("pointerdown",annotation_editor_layer_classPrivateFieldGet(this,yu));annotation_editor_layer_classPrivateFieldGet(this,Su).div.classList.remove("highlighting")}}},{key:"enableClick",value:function enableClick(){this.div.addEventListener("pointerdown",annotation_editor_layer_classPrivateFieldGet(this,_u));this.div.addEventListener("pointerup",annotation_editor_layer_classPrivateFieldGet(this,pu))}},{key:"disableClick",value:function disableClick(){this.div.removeEventListener("pointerdown",annotation_editor_layer_classPrivateFieldGet(this,_u));this.div.removeEventListener("pointerup",annotation_editor_layer_classPrivateFieldGet(this,pu))}},{key:"attach",value:function attach(t){annotation_editor_layer_classPrivateFieldGet(this,bu).set(t.id,t);var r=t.annotationElementId;r&&annotation_editor_layer_classPrivateFieldGet(this,Fu).isDeletedAnnotationElement(r)&&annotation_editor_layer_classPrivateFieldGet(this,Fu).removeDeletedAnnotationElement(t)}},{key:"detach",value:function detach(t){var r;annotation_editor_layer_classPrivateFieldGet(this,bu).delete(t.id);null===(r=annotation_editor_layer_classPrivateFieldGet(this,hu))||void 0===r||r.removePointerInTextLayer(t.contentDiv);!annotation_editor_layer_classPrivateFieldGet(this,ku)&&t.annotationElementId&&annotation_editor_layer_classPrivateFieldGet(this,Fu).addDeletedAnnotationElement(t)}},{key:"remove",value:function remove(t){this.detach(t);annotation_editor_layer_classPrivateFieldGet(this,Fu).removeEditor(t);t.div.remove();t.isAttachedToDOM=!1;annotation_editor_layer_classPrivateFieldGet(this,Pu)||this.addInkEditorIfNeeded(!1)}},{key:"changeParent",value:function changeParent(t){var r;if(t.parent!==this){if(t.annotationElementId){annotation_editor_layer_classPrivateFieldGet(this,Fu).addDeletedAnnotationElement(t.annotationElementId);fn.deleteAnnotationElement(t);t.annotationElementId=null}this.attach(t);null===(r=t.parent)||void 0===r||r.detach(t);t.setParent(this);if(t.div&&t.isAttachedToDOM){t.div.remove();this.div.append(t.div)}}}},{key:"add",value:function add(t){this.changeParent(t);annotation_editor_layer_classPrivateFieldGet(this,Fu).addEditor(t);this.attach(t);if(!t.isAttachedToDOM){var r=t.render();this.div.append(r);t.isAttachedToDOM=!0}t.fixAndSetPosition();t.onceAdded();annotation_editor_layer_classPrivateFieldGet(this,Fu).addToAnnotationStorage(t)}},{key:"moveEditorInDOM",value:function moveEditorInDOM(t){var r,a=this;if(t.isAttachedToDOM){var i=document.activeElement;if(t.div.contains(i)&&!annotation_editor_layer_classPrivateFieldGet(this,gu)){t._focusEventsAllowed=!1;annotation_editor_layer_classPrivateFieldSet(this,gu,setTimeout((function(){annotation_editor_layer_classPrivateFieldSet(a,gu,null);if(t.div.contains(document.activeElement))t._focusEventsAllowed=!0;else{t.div.addEventListener("focusin",(function(){t._focusEventsAllowed=!0}),{once:!0});i.focus()}}),0))}t._structTreeParentId=null===(r=annotation_editor_layer_classPrivateFieldGet(this,hu))||void 0===r?void 0:r.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}}},{key:"addOrRebuild",value:function addOrRebuild(t){if(t.needsToBeRebuilt()){t.parent||(t.parent=this);t.rebuild()}else this.add(t)}},{key:"addUndoableEditor",value:function addUndoableEditor(t){this.addCommands({cmd:function cmd(){return t._uiManager.rebuild(t)},undo:function undo(){t.remove()},mustExec:!1})}},{key:"getNextId",value:function getNextId(){return annotation_editor_layer_classPrivateFieldGet(this,Fu).getId()}},{key:"canCreateNewEmptyEditor",value:function canCreateNewEmptyEditor(){var t;return null===(t=annotation_editor_layer_classPrivateFieldGet(this,xu))||void 0===t?void 0:t.canCreateNewEmptyEditor()}},{key:"pasteEditor",value:function pasteEditor(t,r){annotation_editor_layer_classPrivateFieldGet(this,Fu).updateToolbar(t);annotation_editor_layer_classPrivateFieldGet(this,Fu).updateMode(t);var a=annotation_editor_layer_classPrivateMethodGet(this,Iu,_getCenterPoint2).call(this),i=a.offsetX,o=a.offsetY,l=this.getNextId(),c=annotation_editor_layer_classPrivateMethodGet(this,Eu,_createNewEditor2).call(this,annotation_editor_layer_objectSpread({parent:this,id:l,x:i,y:o,uiManager:annotation_editor_layer_classPrivateFieldGet(this,Fu),isCentered:!0},r));c&&this.add(c)}},{key:"deserialize",value:function deserialize(t){var r,a;return(null===(r=annotation_editor_layer_classStaticPrivateFieldSpecGet(AnnotationEditorLayer,AnnotationEditorLayer,Gu).get(null!==(a=t.annotationType)&&void 0!==a?a:t.annotationEditorType))||void 0===r?void 0:r.deserialize(t,this,annotation_editor_layer_classPrivateFieldGet(this,Fu)))||null}},{key:"createAndAddNewEditor",value:function createAndAddNewEditor(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.getNextId(),o=annotation_editor_layer_classPrivateMethodGet(this,Eu,_createNewEditor2).call(this,annotation_editor_layer_objectSpread({parent:this,id:i,x:t.offsetX,y:t.offsetY,uiManager:annotation_editor_layer_classPrivateFieldGet(this,Fu),isCentered:r},a));o&&this.add(o);return o}},{key:"addNewEditor",value:function addNewEditor(){this.createAndAddNewEditor(annotation_editor_layer_classPrivateMethodGet(this,Iu,_getCenterPoint2).call(this),!0)}},{key:"setSelected",value:function setSelected(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).setSelected(t)}},{key:"toggleSelected",value:function toggleSelected(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).toggleSelected(t)}},{key:"isSelected",value:function isSelected(t){return annotation_editor_layer_classPrivateFieldGet(this,Fu).isSelected(t)}},{key:"unselect",value:function unselect(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).unselect(t)}},{key:"selectionStart",value:function selectionStart(t){var r=this;if(annotation_editor_layer_classPrivateFieldGet(this,Su)&&t.target.parentElement.closest(".textLayer")===annotation_editor_layer_classPrivateFieldGet(this,Su).div)if(annotation_editor_layer_classPrivateFieldGet(this,Fu).isShiftKeyDown){var a=function keyup(){if(!annotation_editor_layer_classPrivateFieldGet(r,Fu).isShiftKeyDown){window.removeEventListener("keyup",keyup);window.removeEventListener("blur",keyup);r.pointerUpAfterSelection({})}};window.addEventListener("keyup",a);window.addEventListener("blur",a)}else annotation_editor_layer_classPrivateFieldGet(this,Su).div.addEventListener("pointerup",annotation_editor_layer_classPrivateFieldGet(this,vu),{once:!0})}},{key:"pointerUpAfterSelection",value:function pointerUpAfterSelection(t){var r,a=document.getSelection();if(0!==a.rangeCount){var i=a.getRangeAt(0);if(!i.collapsed&&null!==(r=annotation_editor_layer_classPrivateFieldGet(this,Su))&&void 0!==r&&r.div.contains(i.commonAncestorContainer)){var o,l=annotation_editor_layer_classPrivateFieldGet(this,Su).div.getBoundingClientRect(),c=l.x,u=l.y,h=l.width,d=l.height,p=i.getClientRects();switch(this.viewport.rotation){case 90:o=function rotator(t,r,a,i){return{x:(r-u)/d,y:1-(t+a-c)/h,width:i/d,height:a/h}};break;case 180:o=function rotator(t,r,a,i){return{x:1-(t+a-c)/h,y:1-(r+i-u)/d,width:a/h,height:i/d}};break;case 270:o=function rotator(t,r,a,i){return{x:1-(r+i-u)/d,y:(t-c)/h,width:i/d,height:a/h}};break;default:o=function rotator(t,r,a,i){return{x:(t-c)/h,y:(r-u)/d,width:a/h,height:i/d}}}var v,_=[],y=annotation_editor_layer_createForOfIteratorHelper(p);try{for(y.s();!(v=y.n()).done;){var g=v.value,m=g.x,b=g.y,w=g.width,P=g.height;0!==w&&0!==P&&_.push(o(m,b,w,P))}}catch(t){y.e(t)}finally{y.f()}0!==_.length&&this.createAndAddNewEditor(t,!1,{boxes:_});a.empty()}}}},{key:"pointerup",value:function pointerup(t){var r=he.platform.isMac;if(!(0!==t.button||t.ctrlKey&&r)&&t.target===this.div&&annotation_editor_layer_classPrivateFieldGet(this,wu)){annotation_editor_layer_classPrivateFieldSet(this,wu,!1);annotation_editor_layer_classPrivateFieldGet(this,du)?annotation_editor_layer_classPrivateFieldGet(this,Fu).getMode()!==g.STAMP?this.createAndAddNewEditor(t,!1):annotation_editor_layer_classPrivateFieldGet(this,Fu).unselectAll():annotation_editor_layer_classPrivateFieldSet(this,du,!0)}}},{key:"pointerdown",value:function pointerdown(t){annotation_editor_layer_classPrivateFieldGet(this,Fu).getMode()===g.HIGHLIGHT&&this.enableTextSelection();if(annotation_editor_layer_classPrivateFieldGet(this,wu))annotation_editor_layer_classPrivateFieldSet(this,wu,!1);else{var r=he.platform.isMac;if(!(0!==t.button||t.ctrlKey&&r)&&t.target===this.div){annotation_editor_layer_classPrivateFieldSet(this,wu,!0);var a=annotation_editor_layer_classPrivateFieldGet(this,Fu).getActive();annotation_editor_layer_classPrivateFieldSet(this,du,!a||a.isEmpty())}}}},{key:"findNewParent",value:function findNewParent(t,r,a){var i=annotation_editor_layer_classPrivateFieldGet(this,Fu).findParent(r,a);if(null===i||i===this)return!1;i.changeParent(t);return!0}},{key:"destroy",value:function destroy(){var t;if((null===(t=annotation_editor_layer_classPrivateFieldGet(this,Fu).getActive())||void 0===t?void 0:t.parent)===this){annotation_editor_layer_classPrivateFieldGet(this,Fu).commitOrRemove();annotation_editor_layer_classPrivateFieldGet(this,Fu).setActiveEditor(null)}if(annotation_editor_layer_classPrivateFieldGet(this,gu)){clearTimeout(annotation_editor_layer_classPrivateFieldGet(this,gu));annotation_editor_layer_classPrivateFieldSet(this,gu,null)}var r,a=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(a.s();!(r=a.n()).done;){var i,o=r.value;null===(i=annotation_editor_layer_classPrivateFieldGet(this,hu))||void 0===i||i.removePointerInTextLayer(o.contentDiv);o.setParent(null);o.isAttachedToDOM=!1;o.div.remove()}}catch(t){a.e(t)}finally{a.f()}this.div=null;annotation_editor_layer_classPrivateFieldGet(this,bu).clear();annotation_editor_layer_classPrivateFieldGet(this,Fu).removeLayer(this)}},{key:"render",value:function render(t){var r=t.viewport;this.viewport=r;setLayerDimensions(this.div,r);var a,i=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,Fu).getEditors(this.pageIndex));try{for(i.s();!(a=i.n()).done;){var o=a.value;this.add(o)}}catch(t){i.e(t)}finally{i.f()}this.updateMode()}},{key:"update",value:function update(t){var r=t.viewport;annotation_editor_layer_classPrivateFieldGet(this,Fu).commitOrRemove();var a=this.viewport.rotation,i=r.rotation;this.viewport=r;setLayerDimensions(this.div,{rotation:i});if(a!==i){var o,l=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(l.s();!(o=l.n()).done;){o.value.rotate(i)}}catch(t){l.e(t)}finally{l.f()}}this.updateMode()}},{key:"pageDimensions",get:function get(){var t=this.viewport.rawDims;return[t.pageWidth,t.pageHeight]}},{key:"scale",get:function get(){return annotation_editor_layer_classPrivateFieldGet(this,Fu).viewParameters.realScale}},{key:"setCleaningUp",value:function setCleaningUp(t){annotation_editor_layer_classPrivateFieldSet(this,Pu,t)}}]);return AnnotationEditorLayer}();zc=Cu;function _textLayerPointerDown2(t){var r=this;annotation_editor_layer_classPrivateFieldGet(this,Fu).unselectAll();if(t.target===annotation_editor_layer_classPrivateFieldGet(this,Su).div){var a=he.platform.isMac;if(0!==t.button||t.ctrlKey&&a)return;annotation_editor_layer_classPrivateFieldGet(this,Su).div.classList.add("free");rc.startHighlighting(this,"ltr"===annotation_editor_layer_classPrivateFieldGet(this,Fu).direction,t);annotation_editor_layer_classPrivateFieldGet(this,Su).div.addEventListener("pointerup",(function(){annotation_editor_layer_classPrivateFieldGet(r,Su).div.classList.remove("free")}),{once:!0});t.preventDefault()}}function _get_currentEditorType(){return annotation_editor_layer_classStaticPrivateFieldSpecGet(zc,zc,Gu).get(annotation_editor_layer_classPrivateFieldGet(this,Fu).getMode())}function _createNewEditor2(t){var r=annotation_editor_layer_classPrivateFieldGet(this,xu);return r?new r.prototype.constructor(t):null}function _getCenterPoint2(){var t=this.div.getBoundingClientRect(),r=t.x,a=t.y,i=t.width,o=t.height,l=Math.max(0,r),c=Math.max(0,a),u=(l+Math.min(window.innerWidth,r+i))/2-r,h=(c+Math.min(window.innerHeight,a+o))/2-a,d=annotation_editor_layer_slicedToArray(this.viewport.rotation%180==0?[u,h]:[h,u],2);return{offsetX:d[0],offsetY:d[1]}}function _cleanup2(){annotation_editor_layer_classPrivateFieldSet(this,Pu,!0);var t,r=annotation_editor_layer_createForOfIteratorHelper(annotation_editor_layer_classPrivateFieldGet(this,bu).values());try{for(r.s();!(t=r.n()).done;){var a=t.value;a.isEmpty()&&a.remove()}}catch(t){r.e(t)}finally{r.f()}annotation_editor_layer_classPrivateFieldSet(this,Pu,!1)}annotation_editor_layer_defineProperty(Cu,"_initialized",!1);var Mu,Gu={writable:!0,value:new Map([Ss,Bc,uu,rc].map((function(t){return[t._editorType,t]})))};function draw_layer_typeof(t){return draw_layer_typeof="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},draw_layer_typeof(t)}function draw_layer_createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function draw_layer_unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return draw_layer_arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return draw_layer_arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function draw_layer_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function draw_layer_defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,draw_layer_toPropertyKey(i.key),i)}}function draw_layer_toPropertyKey(t){var r=function draw_layer_toPrimitive(t,r){if("object"!=draw_layer_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,r||"default");if("object"!=draw_layer_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==draw_layer_typeof(r)?r:String(r)}function draw_layer_classPrivateMethodInitSpec(t,r){draw_layer_checkPrivateRedeclaration(t,r);r.add(t)}function draw_layer_classPrivateFieldInitSpec(t,r,a){draw_layer_checkPrivateRedeclaration(t,r);r.set(t,a)}function draw_layer_checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function draw_layer_classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function draw_layer_classStaticPrivateMethodGet(t,r,a){!function draw_layer_classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function draw_layer_classPrivateFieldSet(t,r,a){!function draw_layer_classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,draw_layer_classExtractFieldDescriptor(t,r,"set"),a);return a}function draw_layer_classPrivateFieldGet(t,r){return function draw_layer_classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,draw_layer_classExtractFieldDescriptor(t,r,"get"))}function draw_layer_classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var Ou=new WeakMap,Ru=new WeakMap,Lu=new WeakMap,Du=new WeakMap,ju=new WeakSet,Nu=new WeakSet,Wu=function(){function DrawLayer(t){var r=t.pageIndex;!function draw_layer_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,DrawLayer);draw_layer_classPrivateMethodInitSpec(this,Nu);draw_layer_classPrivateMethodInitSpec(this,ju);draw_layer_classPrivateFieldInitSpec(this,Ou,{writable:!0,value:null});draw_layer_classPrivateFieldInitSpec(this,Ru,{writable:!0,value:0});draw_layer_classPrivateFieldInitSpec(this,Lu,{writable:!0,value:new Map});draw_layer_classPrivateFieldInitSpec(this,Du,{writable:!0,value:new Map});this.pageIndex=r}!function draw_layer_createClass(t,r,a){r&&draw_layer_defineProperties(t.prototype,r);a&&draw_layer_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(DrawLayer,[{key:"setParent",value:function setParent(t){if(draw_layer_classPrivateFieldGet(this,Ou)){if(draw_layer_classPrivateFieldGet(this,Ou)!==t){if(draw_layer_classPrivateFieldGet(this,Lu).size>0){var r,a=draw_layer_createForOfIteratorHelper(draw_layer_classPrivateFieldGet(this,Lu).values());try{for(a.s();!(r=a.n()).done;){var i=r.value;i.remove();t.append(i)}}catch(t){a.e(t)}finally{a.f()}}draw_layer_classPrivateFieldSet(this,Ou,t)}}else draw_layer_classPrivateFieldSet(this,Ou,t)}},{key:"highlight",value:function highlight(t,r,a){var i,o,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=(draw_layer_classPrivateFieldSet(this,Ru,(i=draw_layer_classPrivateFieldGet(this,Ru),o=i++,i)),o),u=draw_layer_classPrivateMethodGet(this,ju,_createSVG2).call(this,t.box);u.classList.add("highlight");t.free&&u.classList.add("free");var h=DrawLayer._svgFactory.createElement("defs");u.append(h);var d=DrawLayer._svgFactory.createElement("path");h.append(d);var p="path_p".concat(this.pageIndex,"_").concat(c);d.setAttribute("id",p);d.setAttribute("d",t.toSVGPath());l&&draw_layer_classPrivateFieldGet(this,Du).set(c,d);var v=draw_layer_classPrivateMethodGet(this,Nu,_createClipPath2).call(this,h,p),_=DrawLayer._svgFactory.createElement("use");u.append(_);u.setAttribute("fill",r);u.setAttribute("fill-opacity",a);_.setAttribute("href","#".concat(p));draw_layer_classPrivateFieldGet(this,Lu).set(c,u);return{id:c,clipPathId:"url(#".concat(v,")")}}},{key:"highlightOutline",value:function highlightOutline(t){var r,a,i=(draw_layer_classPrivateFieldSet(this,Ru,(r=draw_layer_classPrivateFieldGet(this,Ru),a=r++,r)),a),o=draw_layer_classPrivateMethodGet(this,ju,_createSVG2).call(this,t.box);o.classList.add("highlightOutline");var l=DrawLayer._svgFactory.createElement("defs");o.append(l);var c=DrawLayer._svgFactory.createElement("path");l.append(c);var u,h="path_p".concat(this.pageIndex,"_").concat(i);c.setAttribute("id",h);c.setAttribute("d",t.toSVGPath());c.setAttribute("vector-effect","non-scaling-stroke");if(t.free){o.classList.add("free");var d=DrawLayer._svgFactory.createElement("mask");l.append(d);u="mask_p".concat(this.pageIndex,"_").concat(i);d.setAttribute("id",u);d.setAttribute("maskUnits","objectBoundingBox");var p=DrawLayer._svgFactory.createElement("rect");d.append(p);p.setAttribute("width","1");p.setAttribute("height","1");p.setAttribute("fill","white");var v=DrawLayer._svgFactory.createElement("use");d.append(v);v.setAttribute("href","#".concat(h));v.setAttribute("stroke","none");v.setAttribute("fill","black");v.setAttribute("fill-rule","nonzero");v.classList.add("mask")}var _=DrawLayer._svgFactory.createElement("use");o.append(_);_.setAttribute("href","#".concat(h));u&&_.setAttribute("mask","url(#".concat(u,")"));var y=_.cloneNode();o.append(y);_.classList.add("mainOutline");y.classList.add("secondaryOutline");draw_layer_classPrivateFieldGet(this,Lu).set(i,o);return i}},{key:"finalizeLine",value:function finalizeLine(t,r){var a=draw_layer_classPrivateFieldGet(this,Du).get(t);draw_layer_classPrivateFieldGet(this,Du).delete(t);this.updateBox(t,r.box);a.setAttribute("d",r.toSVGPath())}},{key:"updateLine",value:function updateLine(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).firstChild.firstChild.setAttribute("d",r.toSVGPath())}},{key:"removeFreeHighlight",value:function removeFreeHighlight(t){this.remove(t);draw_layer_classPrivateFieldGet(this,Du).delete(t)}},{key:"updatePath",value:function updatePath(t,r){draw_layer_classPrivateFieldGet(this,Du).get(t).setAttribute("d",r.toSVGPath())}},{key:"updateBox",value:function updateBox(t,r){draw_layer_classStaticPrivateMethodGet(DrawLayer,DrawLayer,_setBox).call(DrawLayer,draw_layer_classPrivateFieldGet(this,Lu).get(t),r)}},{key:"rotate",value:function rotate(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).setAttribute("data-main-rotation",r)}},{key:"changeColor",value:function changeColor(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).setAttribute("fill",r)}},{key:"changeOpacity",value:function changeOpacity(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).setAttribute("fill-opacity",r)}},{key:"addClass",value:function addClass(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).classList.add(r)}},{key:"removeClass",value:function removeClass(t,r){draw_layer_classPrivateFieldGet(this,Lu).get(t).classList.remove(r)}},{key:"remove",value:function remove(t){if(null!==draw_layer_classPrivateFieldGet(this,Ou)){draw_layer_classPrivateFieldGet(this,Lu).get(t).remove();draw_layer_classPrivateFieldGet(this,Lu).delete(t)}}},{key:"destroy",value:function destroy(){draw_layer_classPrivateFieldSet(this,Ou,null);var t,r=draw_layer_createForOfIteratorHelper(draw_layer_classPrivateFieldGet(this,Lu).values());try{for(r.s();!(t=r.n()).done;){t.value.remove()}}catch(t){r.e(t)}finally{r.f()}draw_layer_classPrivateFieldGet(this,Lu).clear()}}],[{key:"_svgFactory",get:function get(){return shadow(this,"_svgFactory",new qe)}}]);return DrawLayer}();Mu=Wu;function _setBox(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.x,i=void 0===a?0:a,o=r.y,l=void 0===o?0:o,c=r.width,u=void 0===c?1:c,h=r.height,d=void 0===h?1:h,p=t.style;p.top="".concat(100*l,"%");p.left="".concat(100*i,"%");p.width="".concat(100*u,"%");p.height="".concat(100*d,"%")}function _createSVG2(t){var r=Mu._svgFactory.create(1,1,!0);draw_layer_classPrivateFieldGet(this,Ou).append(r);draw_layer_classStaticPrivateMethodGet(Mu,Mu,_setBox).call(Mu,r,t);return r}function _createClipPath2(t,r){var a=Mu._svgFactory.createElement("clipPath");t.append(a);var i="clip_".concat(r);a.setAttribute("id",i);a.setAttribute("clipPathUnits","objectBoundingBox");var o=Mu._svgFactory.createElement("use");a.append(o);o.setAttribute("href","#".concat(r));o.classList.add("clip");return i}})();var i=a.AbortException,o=a.AnnotationEditorLayer,l=a.AnnotationEditorParamsType,c=a.AnnotationEditorType,u=a.AnnotationEditorUIManager,h=a.AnnotationLayer,d=a.AnnotationMode,p=a.CMapCompressionType,v=a.ColorPicker,_=a.DOMSVGFactory,y=a.DrawLayer,g=a.FeatureTest,m=a.GlobalWorkerOptions,b=a.ImageKind,w=a.InvalidPDFException,P=a.MissingPDFException,k=a.OPS,S=a.Outliner,A=a.PDFDataRangeTransport,x=a.PDFDateString,E=a.PDFWorker,I=a.PasswordResponses,T=a.PermissionFlag,C=a.PixelsPerInch,M=a.PromiseCapability,G=a.RenderingCancelledException,O=a.UnexpectedResponseException,R=a.Util,L=a.VerbosityLevel,D=a.XfaLayer,j=a.build,N=a.createValidAbsoluteUrl,W=a.fetchData,H=a.getDocument,B=a.getFilenameFromUrl,z=a.getPdfFilenameFromUrl,U=a.getXfaPageViewport,q=a.isDataScheme,V=a.isPdfFile,K=a.noContextMenu,Y=a.normalizeUnicode,X=a.renderTextLayer,$=a.setLayerDimensions,J=a.shadow,Q=a.updateTextLayer,Z=a.version;export{i as AbortException,o as AnnotationEditorLayer,l as AnnotationEditorParamsType,c as AnnotationEditorType,u as AnnotationEditorUIManager,h as AnnotationLayer,d as AnnotationMode,p as CMapCompressionType,v as ColorPicker,_ as DOMSVGFactory,y as DrawLayer,g as FeatureTest,m as GlobalWorkerOptions,b as ImageKind,w as InvalidPDFException,P as MissingPDFException,k as OPS,S as Outliner,A as PDFDataRangeTransport,x as PDFDateString,E as PDFWorker,I as PasswordResponses,T as PermissionFlag,C as PixelsPerInch,M as PromiseCapability,G as RenderingCancelledException,O as UnexpectedResponseException,R as Util,L as VerbosityLevel,D as XfaLayer,j as build,N as createValidAbsoluteUrl,W as fetchData,H as getDocument,B as getFilenameFromUrl,z as getPdfFilenameFromUrl,U as getXfaPageViewport,q as isDataScheme,V as isPdfFile,K as noContextMenu,Y as normalizeUnicode,X as renderTextLayer,$ as setLayerDimensions,J as shadow,Q as updateTextLayer,Z as version};