diff --git a/asset-manifest.json b/asset-manifest.json index 2d6e4e8..fb63d1e 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "/front-end/static/css/main.0dc15aa6.css", - "main.js": "/front-end/static/js/main.8f070d11.js", + "main.js": "/front-end/static/js/main.3c4575d7.js", "static/js/787.46c27676.chunk.js": "/front-end/static/js/787.46c27676.chunk.js", "static/media/securian_name.png": "/front-end/static/media/securian_name.50bb371563c4321e8a8e.png", "static/media/securian_logo.png": "/front-end/static/media/securian_logo.3bad7ee848c35f17f298.png", @@ -10,11 +10,11 @@ "static/media/background.png": "/front-end/static/media/background.b418bbfa63a4205d5596.png", "index.html": "/front-end/index.html", "main.0dc15aa6.css.map": "/front-end/static/css/main.0dc15aa6.css.map", - "main.8f070d11.js.map": "/front-end/static/js/main.8f070d11.js.map", + "main.3c4575d7.js.map": "/front-end/static/js/main.3c4575d7.js.map", "787.46c27676.chunk.js.map": "/front-end/static/js/787.46c27676.chunk.js.map" }, "entrypoints": [ "static/css/main.0dc15aa6.css", - "static/js/main.8f070d11.js" + "static/js/main.3c4575d7.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 3c526d2..a187614 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Flo.CI
\ No newline at end of file +Flo.CI
\ No newline at end of file diff --git a/static/js/main.8f070d11.js b/static/js/main.3c4575d7.js similarity index 92% rename from static/js/main.8f070d11.js rename to static/js/main.3c4575d7.js index 6d717f6..723bab7 100644 --- a/static/js/main.8f070d11.js +++ b/static/js/main.3c4575d7.js @@ -1,3 +1,3 @@ -/*! For license information please see main.8f070d11.js.LICENSE.txt */ -(function(){var __webpack_modules__={3361:function(e,t,n){"use strict";n.d(t,{Z:function(){return ae}});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?u(b,--y):0,m--,10===_&&(m=1,v--),_}function x(){return _=y2||F(_)>3?"":" "}function R(e,t){for(;--t&&x()&&!(_<48||_>102||_>57&&_<65||_>70&&_<97););return C(e,A()+(t<6&&32==P()&&32==x()))}function O(e){for(;x();)switch(_){case e:return y;case 34:case 39:34!==e&&39!==e&&O(_);break;case 40:41===e&&O(e);break;case 92:x()}return y}function L(e,t){for(;x()&&e+_!==57&&(e+_!==84||47!==P()););return"/*"+C(t,y-1)+"*"+i(47===e?e:x())}function D(e){for(;!F(P());)x();return C(e,y)}var N="-ms-",G="-moz-",j="-webkit-",Z="comm",z="rule",W="decl",B="@keyframes";function U(e,t){for(var n="",r=h(e),a=0;a0&&f(G)-g&&p(_>32?Y(G+";",r,n,g-1):Y(l(G," ","")+";",r,n,g-2),h);break;case 59:G+=";";default:if(p(N=K(G,t,n,v,m,a,d,E,M=[],O=[],g),o),123===F)if(0===m)V(G,t,N,N,M,o,g,d,O);else switch(99===y&&110===u(G,3)?100:y){case 100:case 108:case 109:case 115:V(e,N,N,r&&p(K(e,N,N,0,0,a,d,E,a,M=[],g),O),a,O,g,d,r?M:O);break;default:V(G,N,N,N,[""],O,0,d,O)}}v=m=_=0,k=C=1,E=G="",g=s;break;case 58:g=1+f(G),_=b;default:if(k<1)if(123==F)--k;else if(125==F&&0==k++&&125==S())continue;switch(G+=i(F),F*k){case 38:C=m>0?1:(G+="\f",-1);break;case 44:d[v++]=(f(G)-1)*C,C=1;break;case 64:45===P()&&(G+=T(x())),y=P(),m=g=f(E=G+=D(A())),F++;break;case 45:45===b&&2==f(G)&&(k=0)}}return o}function K(e,t,n,r,i,o,c,u,f,p,v){for(var m=i-1,g=0===i?o:[""],y=h(g),_=0,b=0,w=0;_0?g[S]+" "+x:l(x,/&\f/g,g[S])))&&(f[w++]=P);return k(e,t,n,0===i?z:u,f,p,v)}function X(e,t,n){return k(e,t,n,Z,i(_),d(e,2,-2),0)}function Y(e,t,n,r){return k(e,t,n,W,d(e,0,r),d(e,r+1,-1),r)}var $=function(e,t,n){for(var r=0,a=0;r=a,a=P(),38===r&&12===a&&(t[n]=1),!F(a);)x();return C(e,y)},Q=function(e,t){return M(function(e,t){var n=-1,r=44;do{switch(F(r)){case 0:38===r&&12===P()&&(t[n]=1),e[n]+=$(y-1,t,n);break;case 2:e[n]+=T(r);break;case 4:if(44===r){e[++n]=58===P()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=i(r)}}while(r=x());return e}(E(e),t))},J=new WeakMap,ee=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||J.get(n))&&!r){J.set(e,!0);for(var a=[],i=Q(t,a),o=n.props,s=0,l=0;s6)switch(u(e,t+1)){case 109:if(45!==u(e,t+4))break;case 102:return l(e,/(.+:)(.+)-([^]+)/,"$1"+j+"$2-$3$1"+G+(108==u(e,t+3)?"$3":"$2-$3"))+e;case 115:return~c(e,"stretch")?ne(l(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==u(e,t+1))break;case 6444:switch(u(e,f(e)-3-(~c(e,"!important")&&10))){case 107:return l(e,":",":"+j)+e;case 101:return l(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+j+(45===u(e,14)?"inline-":"")+"box$3$1"+j+"$2$3$1"+N+"$2box$3")+e}break;case 5936:switch(u(e,t+11)){case 114:return j+e+N+l(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return j+e+N+l(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return j+e+N+l(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return j+e+N+e+e}return e}var re=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case W:e.return=ne(e.value,e.length);break;case B:return U([w(e,{value:l(e.value,"@","@"+j)})],r);case z:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return U([w(e,{props:[l(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return U([w(e,{props:[l(t,/:(plac\w+)/,":"+j+"input-$1")]}),w(e,{props:[l(t,/:(plac\w+)/,":-moz-$1")]}),w(e,{props:[l(t,/:(plac\w+)/,N+"input-$1")]})],r)}return""}))}}],ae=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var a=e.stylisPlugins||re;var i,o,s={},l=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,a-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(a){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(a)+l;return{name:c,styles:a,next:f}}},2561:function(e,t,n){"use strict";var r;n.d(t,{L:function(){return o},j:function(){return s}});var a=n(2791),i=!!(r||(r=n.t(a,2))).useInsertionEffect&&(r||(r=n.t(a,2))).useInsertionEffect,o=i||function(e){return e()},s=i||a.useLayoutEffect},5438:function(e,t,n){"use strict";n.d(t,{My:function(){return i},fp:function(){return r},hC:function(){return a}});function r(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}var a=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},i=function(e,t,n){a(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+r:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}},9596:function(e,t,n){"use strict";var r=n(4836);t.Z=void 0;var a=r(n(5649)),i=n(184),o=(0,a.default)((0,i.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"}),"CloudUpload");t.Z=o},7247:function(e,t,n){"use strict";var r=n(4836);t.Z=void 0;var a=r(n(5649)),i=n(184),o=(0,a.default)((0,i.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");t.Z=o},3717:function(e,t,n){"use strict";var r=n(4836);t.Z=void 0;var a=r(n(5649)),i=n(184),o=(0,a.default)((0,i.jsx)("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"}),"Folder");t.Z=o},5649:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(4454)},6532:function(e,t){"use strict";var n,r=Symbol.for("react.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function g(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case s:case o:case f:case h:return e;default:switch(e=e&&e.$$typeof){case u:case c:case d:case v:case p:case l:return e;default:return t}}case a:return t}}}n=Symbol.for("react.module.reference")},8457:function(e,t,n){"use strict";n(6532)},4591:function(e,t,n){"use strict";n.d(t,{Z:function(){return z}});var r=n(7462),a=n(3366),i=n(6189),o=n(2466),s=n(5080),l=n(7416),c=n(104),u=n(4942);function d(e,t){var n;return(0,r.Z)({toolbar:(n={minHeight:56},(0,u.Z)(n,e.up("xs"),{"@media (orientation: landscape)":{minHeight:48}}),(0,u.Z)(n,e.up("sm"),{minHeight:64}),n)},t)}var f=n(2065),h={black:"#000",white:"#fff"},p={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},v={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},m={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},g={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},y={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},_={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},b={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},k=["mode","contrastThreshold","tonalOffset"],w={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:h.white,default:h.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},S={text:{primary:h.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:h.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function x(e,t,n,r){var a=r.light||r,i=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,f.$n)(e.main,a):"dark"===t&&(e.dark=(0,f._j)(e.main,i)))}function P(e){var t=e.mode,n=void 0===t?"light":t,s=e.contrastThreshold,l=void 0===s?3:s,c=e.tonalOffset,u=void 0===c?.2:c,d=(0,a.Z)(e,k),P=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:y[200],light:y[50],dark:y[400]}:{main:y[700],light:y[400],dark:y[800]}}(n),A=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:v[200],light:v[50],dark:v[400]}:{main:v[500],light:v[300],dark:v[700]}}(n),C=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m[500],light:m[300],dark:m[700]}:{main:m[700],light:m[400],dark:m[800]}}(n),F=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:_[400],light:_[300],dark:_[700]}:{main:_[700],light:_[500],dark:_[900]}}(n),E=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:b[400],light:b[300],dark:b[700]}:{main:b[800],light:b[500],dark:b[900]}}(n),M=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:g[400],light:g[300],dark:g[700]}:{main:"#ed6c02",light:g[500],dark:g[900]}}(n);function T(e){return(0,f.mi)(e,S.text.primary)>=l?S.text.primary:w.text.primary}var I=function(e){var t=e.color,n=e.name,a=e.mainShade,o=void 0===a?500:a,s=e.lightShade,l=void 0===s?300:s,c=e.darkShade,d=void 0===c?700:c;if(!(t=(0,r.Z)({},t)).main&&t[o]&&(t.main=t[o]),!t.hasOwnProperty("main"))throw new Error((0,i.Z)(11,n?" (".concat(n,")"):"",o));if("string"!==typeof t.main)throw new Error((0,i.Z)(12,n?" (".concat(n,")"):"",JSON.stringify(t.main)));return x(t,"light",l,u),x(t,"dark",d,u),t.contrastText||(t.contrastText=T(t.main)),t},R={dark:S,light:w};return(0,o.Z)((0,r.Z)({common:(0,r.Z)({},h),mode:n,primary:I({color:P,name:"primary"}),secondary:I({color:A,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:I({color:C,name:"error"}),warning:I({color:M,name:"warning"}),info:I({color:F,name:"info"}),success:I({color:E,name:"success"}),grey:p,contrastThreshold:l,getContrastText:T,augmentColor:I,tonalOffset:u},R[n]),d)}var A=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];var C={textTransform:"uppercase"},F='"Roboto", "Helvetica", "Arial", sans-serif';function E(e,t){var n="function"===typeof t?t(e):t,i=n.fontFamily,s=void 0===i?F:i,l=n.fontSize,c=void 0===l?14:l,u=n.fontWeightLight,d=void 0===u?300:u,f=n.fontWeightRegular,h=void 0===f?400:f,p=n.fontWeightMedium,v=void 0===p?500:p,m=n.fontWeightBold,g=void 0===m?700:m,y=n.htmlFontSize,_=void 0===y?16:y,b=n.allVariants,k=n.pxToRem,w=(0,a.Z)(n,A);var S=c/14,x=k||function(e){return"".concat(e/_*S,"rem")},P=function(e,t,n,a,i){return(0,r.Z)({fontFamily:s,fontWeight:e,fontSize:x(t),lineHeight:n},s===F?{letterSpacing:"".concat((o=a/t,Math.round(1e5*o)/1e5),"em")}:{},i,b);var o},E={h1:P(d,96,1.167,-1.5),h2:P(d,60,1.2,-.5),h3:P(h,48,1.167,0),h4:P(h,34,1.235,.25),h5:P(h,24,1.334,0),h6:P(v,20,1.6,.15),subtitle1:P(h,16,1.75,.15),subtitle2:P(v,14,1.57,.1),body1:P(h,16,1.5,.15),body2:P(h,14,1.43,.15),button:P(v,14,1.75,.4,C),caption:P(h,12,1.66,.4),overline:P(h,12,2.66,1,C),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,o.Z)((0,r.Z)({htmlFontSize:_,pxToRem:x,fontFamily:s,fontSize:c,fontWeightLight:d,fontWeightRegular:h,fontWeightMedium:v,fontWeightBold:g},E),w,{clone:!1})}function M(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var T=["none",M(0,2,1,-1,0,1,1,0,0,1,3,0),M(0,3,1,-2,0,2,2,0,0,1,5,0),M(0,3,3,-2,0,3,4,0,0,1,8,0),M(0,2,4,-1,0,4,5,0,0,1,10,0),M(0,3,5,-1,0,5,8,0,0,1,14,0),M(0,3,5,-1,0,6,10,0,0,1,18,0),M(0,4,5,-2,0,7,10,1,0,2,16,1),M(0,5,5,-3,0,8,10,1,0,3,14,2),M(0,5,6,-3,0,9,12,1,0,3,16,2),M(0,6,6,-3,0,10,14,1,0,4,18,3),M(0,6,7,-4,0,11,15,1,0,4,20,3),M(0,7,8,-4,0,12,17,2,0,5,22,4),M(0,7,8,-4,0,13,19,2,0,5,24,4),M(0,7,9,-4,0,14,21,2,0,5,26,4),M(0,8,9,-5,0,15,22,2,0,6,28,5),M(0,8,10,-5,0,16,24,2,0,6,30,5),M(0,8,11,-5,0,17,26,2,0,6,32,5),M(0,9,11,-5,0,18,28,2,0,7,34,6),M(0,9,12,-6,0,19,29,2,0,7,36,6),M(0,10,13,-6,0,20,31,3,0,8,38,7),M(0,10,13,-6,0,21,33,3,0,8,40,7),M(0,10,14,-6,0,22,35,3,0,8,42,7),M(0,11,14,-7,0,23,36,3,0,9,44,8),M(0,11,15,-7,0,24,38,3,0,9,46,8)],I=["duration","easing","delay"],R={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},O={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function L(e){return"".concat(Math.round(e),"ms")}function D(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}function N(e){var t=(0,r.Z)({},R,e.easing),n=(0,r.Z)({},O,e.duration);return(0,r.Z)({getAutoHeightDuration:D,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.duration,o=void 0===i?n.standard:i,s=r.easing,l=void 0===s?t.easeInOut:s,c=r.delay,u=void 0===c?0:c;(0,a.Z)(r,I);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof o?o:L(o)," ").concat(l," ").concat("string"===typeof u?u:L(u))})).join(",")}},e,{easing:t,duration:n})}var G={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},j=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mixins,n=void 0===t?{}:t,u=e.palette,f=void 0===u?{}:u,h=e.transitions,p=void 0===h?{}:h,v=e.typography,m=void 0===v?{}:v,g=(0,a.Z)(e,j);if(e.vars)throw new Error((0,i.Z)(18));var y=P(f),_=(0,s.Z)(e),b=(0,o.Z)(_,{mixins:d(_.breakpoints,n),palette:y,shadows:T.slice(),typography:E(y,m),transitions:N(p),zIndex:(0,r.Z)({},G)});b=(0,o.Z)(b,g);for(var k=arguments.length,w=new Array(k>1?k-1:0),S=1;S0&&void 0!==arguments[0]?arguments[0]:{};return(null==(e=t.keys)?void 0:e.reduce((function(e,n){return e[t.up(n)]={},e}),{}))||{}}function l(e,t){return e.reduce((function(e,t){var n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}function c(e){for(var t=s(e),n=arguments.length,a=new Array(n>1?n-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function i(e){if(e.type)return e;if("#"===e.charAt(0))return i(function(e){e=e.slice(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error((0,r.Z)(9,e));var a,o=e.substring(t+1,e.length-1);if("color"===n){if(a=(o=o.split(" ")).shift(),4===o.length&&"/"===o[3].charAt(0)&&(o[3]=o[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(a))throw new Error((0,r.Z)(10,a))}else o=o.split(",");return{type:n,values:o=o.map((function(e){return parseFloat(e)})),colorSpace:a}}function o(e){var t=e.type,n=e.colorSpace,r=e.values;return-1!==t.indexOf("rgb")?r=r.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(r[1]="".concat(r[1],"%"),r[2]="".concat(r[2],"%")),r=-1!==t.indexOf("color")?"".concat(n," ").concat(r.join(" ")):"".concat(r.join(", ")),"".concat(t,"(").concat(r,")")}function s(e){var t="hsl"===(e=i(e)).type||"hsla"===e.type?i(function(e){var t=(e=i(e)).values,n=t[0],r=t[1]/100,a=t[2]/100,s=r*Math.min(a,1-a),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return a-s*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",u=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(c+="a",u.push(t[3])),o({type:c,values:u})}(e)).values:e.values;return t=t.map((function(t){return"color"!==e.type&&(t/=255),t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function l(e,t){var n=s(e),r=s(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function c(e,t){return e=i(e),t=a(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]="/".concat(t):e.values[3]=t,o(e)}function u(e,t){if(e=i(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return o(e)}function d(e,t){if(e=i(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(var r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return o(e)}},7091:function(e,t,n){"use strict";n.d(t,{ZP:function(){return Z},x9:function(){return L}});var r=n(9439),a=n(3433),i=n(3366),o=n(7462),s=n(2791),l=n(9797),c=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,u=(0,l.Z)((function(e){return c.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),d=n(2564),f=n(5438),h=n(9140),p=n(2561),v=u,m=function(e){return"theme"!==e},g=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?v:m},y=function(e,t,n){var r;if(t){var a=t.shouldForwardProp;r=e.__emotion_forwardProp&&a?function(t){return e.__emotion_forwardProp(t)&&a(t)}:a}return"function"!==typeof r&&n&&(r=e.__emotion_forwardProp),r},_=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return(0,f.hC)(t,n,r),(0,p.L)((function(){return(0,f.My)(t,n,r)})),null},b=function e(t,n){var r,a,i=t.__emotion_real===t,l=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,a=n.target);var c=y(t,n,i),u=c||g(l),p=!u("as");return function(){var v=arguments,m=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&m.push("label:"+r+";"),null==v[0]||void 0===v[0].raw)m.push.apply(m,v);else{0,m.push(v[0][0]);for(var b=v.length,k=1;k0&&void 0!==arguments[0]?arguments[0]:{},t=e.themeId,n=e.defaultTheme,s=void 0===n?D:n,l=e.rootShouldForwardProp,c=void 0===l?L:l,u=e.slotShouldForwardProp,d=void 0===u?L:u,f=function(e){return(0,F.Z)((0,o.Z)({},e,{theme:G((0,o.Z)({},e,{defaultTheme:s,themeId:t}))}))};return f.__mui_systemSx=!0,function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k(e,(function(e){return e.filter((function(e){return!(null!=e&&e.__mui_systemSx)}))}));var l,u=n.name,h=n.slot,p=n.skipVariantsResolver,v=n.skipSx,m=n.overridesResolver,g=void 0===m?(l=N(h))?function(e,t){return t[l]}:null:m,y=(0,i.Z)(n,E),_=void 0!==p?p:h&&"Root"!==h&&"root"!==h||!1,S=v||!1;var x=L;"Root"===h||"root"===h?x=c:h?x=d:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(x=void 0);var P=function(e,t){return b(e,t)}(e,(0,o.Z)({shouldForwardProp:x,label:undefined},y)),A=function(n){for(var i=arguments.length,l=new Array(i>1?i-1:0),c=1;c0){var m=new Array(v).fill("");(p=[].concat((0,a.Z)(n),(0,a.Z)(m))).raw=[].concat((0,a.Z)(n.raw),(0,a.Z)(m))}var y=P.apply(void 0,[p].concat((0,a.Z)(h)));return e.muiName&&(y.muiName=e.muiName),y};return P.withConfig&&(A.withConfig=P.withConfig),A}}},5080:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(7462),a=n(3366),i=n(2466),o=n(4942),s=["values","unit","step"],l=function(e){var t=Object.keys(e).map((function(t){return{key:t,val:e[t]}}))||[];return t.sort((function(e,t){return e.val-t.val})),t.reduce((function(e,t){return(0,r.Z)({},e,(0,o.Z)({},t.key,t.val))}),{})};var c={borderRadius:4},u=n(5682);var d=n(104),f=n(7416),h=["breakpoints","palette","spacing","shape"];var p=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,o=e.palette,p=void 0===o?{}:o,v=e.spacing,m=e.shape,g=void 0===m?{}:m,y=(0,a.Z)(e,h),_=function(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:900,lg:1200,xl:1536}:t,i=e.unit,o=void 0===i?"px":i,c=e.step,u=void 0===c?5:c,d=(0,a.Z)(e,s),f=l(n),h=Object.keys(f);function p(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(o,")")}function v(e){var t="number"===typeof n[e]?n[e]:e;return"@media (max-width:".concat(t-u/100).concat(o,")")}function m(e,t){var r=h.indexOf(t);return"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(o,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[h[r]]?n[h[r]]:t)-u/100).concat(o,")")}return(0,r.Z)({keys:h,values:f,up:p,down:v,between:m,only:function(e){return h.indexOf(e)+10&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=(0,u.hB)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r1?w-1:0),x=1;x2){if(!c[e])return[e];e=c[e]}var t=e.split(""),n=(0,r.Z)(t,2),a=n[0],i=n[1],o=s[a],u=l[i]||"";return Array.isArray(u)?u.map((function(e){return o+e})):[o+u]})),d=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],f=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],h=[].concat(d,f);function p(e,t,n,r){var a,o=null!=(a=(0,i.DW)(e,t,!1))?a:n;return"number"===typeof o?function(e){return"string"===typeof e?e:o*e}:Array.isArray(o)?function(e){return"string"===typeof e?e:o[e]}:"function"===typeof o?o:function(){}}function v(e){return p(e,"spacing",8)}function m(e,t){if("string"===typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}function g(e,t,n,r){if(-1===t.indexOf(n))return null;var i=function(e,t){return function(n){return e.reduce((function(e,r){return e[r]=m(t,n),e}),{})}}(u(n),r),o=e[n];return(0,a.k9)(e,o,i)}function y(e,t){var n=v(e.theme);return Object.keys(e).map((function(r){return g(e,t,r,n)})).reduce(o.Z,{})}function _(e){return y(e,d)}function b(e){return y(e,f)}function k(e){return y(e,h)}_.propTypes={},_.filterProps=d,b.propTypes={},b.filterProps=f,k.propTypes={},k.filterProps=h},8529:function(e,t,n){"use strict";n.d(t,{DW:function(){return o},Jq:function(){return s}});var r=n(4942),a=n(1122),i=n(1184);function o(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&n){var r="vars.".concat(t).split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e);if(null!=r)return r}return t.split(".").reduce((function(e,t){return e&&null!=e[t]?e[t]:null}),e)}function s(e,t,n){var r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;return r="function"===typeof e?e(n):Array.isArray(e)?e[n]||a:o(e,n)||a,t&&(r=t(r,a,e)),r}t.ZP=function(e){var t=e.prop,n=e.cssProperty,l=void 0===n?e.prop:n,c=e.themeKey,u=e.transform,d=function(e){if(null==e[t])return null;var n=e[t],d=o(e.theme,c)||{};return(0,i.k9)(e,n,(function(e){var n=s(d,u,e);return e===n&&"string"===typeof e&&(n=s(d,u,"".concat(t).concat("default"===e?"":(0,a.Z)(e)),e)),!1===l?n:(0,r.Z)({},l,n)}))};return d.propTypes={},d.filterProps=[t],d}},7416:function(e,t,n){"use strict";n.d(t,{Z:function(){return T}});var r=n(5682),a=n(8529),i=n(8247);var o=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:null,n=a.useContext(i.T);return n&&(e=n,0!==Object.keys(e).length)?n:t},s=(0,r.Z)();var l=function(){return o(arguments.length>0&&void 0!==arguments[0]?arguments[0]:s)}},7078:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(5735);var a=n(3459);function i(e){var t=e.props,n=e.name,i=e.defaultTheme,o=e.themeId,s=(0,a.Z)(i);o&&(s=s[o]||s);var l=function(e){var t=e.theme,n=e.name,a=e.props;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,r.Z)(t.components[n].defaultProps,a):a}({theme:s,name:n,props:t});return l}},5902:function(e,t){"use strict";var n=function(e){return e},r=function(){var e=n;return{configure:function(t){e=t},generate:function(t){return e(t)},reset:function(){e=n}}}();t.Z=r},1122:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6189);function a(e){if("string"!==typeof e)throw new Error((0,r.Z)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},4419:function(e,t,n){"use strict";function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r={};return Object.keys(e).forEach((function(a){r[a]=e[a].reduce((function(e,r){if(r){var a=t(r);""!==a&&e.push(a),n&&n[r]&&e.push(n[r])}return e}),[]).join(" ")})),r}n.d(t,{Z:function(){return r}})},8949:function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=this,a=arguments.length,i=new Array(a),o=0;o2&&void 0!==arguments[2]?arguments[2]:{clone:!0},s=n.clone?(0,r.Z)({},e):e;return a(e)&&a(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(a(t[r])&&r in e&&a(e[r])?s[r]=o(e[r],t[r],n):n.clone?s[r]=a(t[r])?i(t[r]):t[r]:s[r]=t[r])})),s}},6189:function(e,t,n){"use strict";function r(e){for(var t="https://mui.com/production-error/?code="+e,n=1;n2&&void 0!==arguments[2]?arguments[2]:"Mui",i=a[t];return i?"".concat(n,"-").concat(i):"".concat(r.Z.generate(e),"-").concat(t)}},5878:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(1217);function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",a={};return t.forEach((function(t){a[t]=(0,r.Z)(e,t,n)})),a}},4913:function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{Z:function(){return r}})},5202:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(4913);function a(e){return(0,r.Z)(e).defaultView||window}},5735:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7462);function a(e,t){var n=(0,r.Z)({},t);return Object.keys(e).forEach((function(i){if(i.toString().match(/^(components|slots)$/))n[i]=(0,r.Z)({},e[i],n[i]);else if(i.toString().match(/^(componentsProps|slotProps)$/)){var o=e[i]||{},s=t[i];n[i]={},s&&Object.keys(s)?o&&Object.keys(o)?(n[i]=(0,r.Z)({},s),Object.keys(o).forEach((function(e){n[i][e]=a(o[e],s[e])}))):n[i]=s:n[i]=o}else void 0===n[i]&&(n[i]=e[i])})),n}},2971:function(e,t,n){"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,{Z:function(){return r}})},2876:function(e,t,n){"use strict";var r=n(2791),a="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;t.Z=a},7054:function(e,t,n){"use strict";var r=n(2791),a=n(2876);t.Z=function(e){var t=r.useRef(e);return(0,a.Z)((function(){t.current=e})),r.useRef((function(){return t.current.apply(void 0,arguments)})).current}},6117:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2791),a=n(2971);function i(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return null;try{if(n&&"string"===typeof e){if(n.addDefaultProtocol&&e.startsWith("www.")){var r=e.match(/\./g);(null===r||void 0===r?void 0:r.length)>=2&&(e="http://".concat(e))}if(n.tryConvertEncoding)try{e=w(e)}catch(i){}}var a=t?new URL(e,t):new URL(e);if(function(e){switch(null===e||void 0===e?void 0:e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(a))return a}catch(o){}return null},t.getModificationDate=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getUuid=function(){var e,t;if("undefined"!==typeof crypto&&"function"===typeof(null===(e=crypto)||void 0===e?void 0:e.randomUUID))return crypto.randomUUID();var n=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof(null===(t=crypto)||void 0===t?void 0:t.getRandomValues))crypto.getRandomValues(n);else for(var r=0;r<32;r++)n[r]=Math.floor(255*Math.random());return m(n)},t.getVerbosityLevel=function(){return a},t.info=function(e){a>=r.INFOS&&console.log("Info: ".concat(e))},t.isArrayBuffer=function(e){return"object"===typeof e&&void 0!==(null===e||void 0===e?void 0:e.byteLength)},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=g,t.stringToPDFString=function(e){var t;if(e[0]>="\xef"&&("\xfe"===e[0]&&"\xff"===e[1]?t="utf-16be":"\xff"===e[0]&&"\xfe"===e[1]?t="utf-16le":"\xef"===e[0]&&"\xbb"===e[1]&&"\xbf"===e[2]&&(t="utf-8"),t))try{var n=new TextDecoder(t,{fatal:!0}),r=g(e);return n.decode(r)}catch(c){i('stringToPDFString: "'.concat(c,'".'))}for(var a=[],o=0,s=e.length;o=r.WARNINGS&&console.log("Warning: ".concat(e))}function o(e){throw new Error(e)}function s(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}var l=function(){function e(t,n){this.constructor===e&&o("Cannot initialize BaseException."),this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}();t.BaseException=l;var c=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r){var a;return _classCallCheck(this,n),(a=t.call(this,e,"PasswordException")).code=r,a}return _createClass(n)}(l);t.PasswordException=c;var u=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r){var a;return _classCallCheck(this,n),(a=t.call(this,e,"UnknownErrorException")).details=r,a}return _createClass(n)}(l);t.UnknownErrorException=u;var d=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){return _classCallCheck(this,n),t.call(this,e,"InvalidPDFException")}return _createClass(n)}(l);t.InvalidPDFException=d;var f=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){return _classCallCheck(this,n),t.call(this,e,"MissingPDFException")}return _createClass(n)}(l);t.MissingPDFException=f;var h=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r){var a;return _classCallCheck(this,n),(a=t.call(this,e,"UnexpectedResponseException")).status=r,a}return _createClass(n)}(l);t.UnexpectedResponseException=h;var p=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){return _classCallCheck(this,n),t.call(this,e,"FormatError")}return _createClass(n)}(l);t.FormatError=p;var v=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){return _classCallCheck(this,n),t.call(this,e,"AbortException")}return _createClass(n)}(l);function m(e){"object"===typeof e&&void 0!==(null===e||void 0===e?void 0:e.length)||o("Invalid argument for bytesToString");var t=e.length,n=8192;if(te[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}},{key:"intersect",value:function(e,t){var n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;var a=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),i=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return a>i?null:[n,a,r,i]}},{key:"bezierBoundingBox",value:function(e,t,n,r,a,i,o,s){for(var l,c,u,d,f,h,p,v,m=[],g=[[],[]],y=0;y<2;++y)if(0===y?(c=6*e-12*n+6*a,l=-3*e+9*n-9*a+3*o,u=3*n-3*e):(c=6*t-12*r+6*i,l=-3*t+9*r-9*i+3*s,u=3*r-3*t),Math.abs(l)<1e-12){if(Math.abs(c)<1e-12)continue;0<(d=-u/c)&&d<1&&m.push(d)}else p=c*c-4*u*l,v=Math.sqrt(p),p<0||(0<(f=(-c+v)/(2*l))&&f<1&&m.push(f),0<(h=(-c-v)/(2*l))&&h<1&&m.push(h));for(var _,b=m.length,k=b;b--;)_=1-(d=m[b]),g[0][b]=_*_*_*e+3*_*_*d*n+3*_*d*d*a+d*d*d*o,g[1][b]=_*_*_*t+3*_*_*d*r+3*_*d*d*i+d*d*d*s;return g[0][k]=e,g[1][k]=t,g[0][k+1]=o,g[1][k+1]=s,g[0].length=g[1].length=k+2,[Math.min.apply(Math,_toConsumableArray(g[0])),Math.min.apply(Math,_toConsumableArray(g[1])),Math.max.apply(Math,_toConsumableArray(g[0])),Math.max.apply(Math,_toConsumableArray(g[1]))]}}]),e}();t.Util=b;var k=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function w(e){return decodeURIComponent(escape(e))}var S=new WeakMap,x=function(){function e(){var t=this;_classCallCheck(this,e),_classPrivateFieldInitSpec(this,S,{writable:!0,value:!1}),this.promise=new Promise((function(e,n){t.resolve=function(n){_classPrivateFieldSet(t,S,!0),e(n)},t.reject=function(e){_classPrivateFieldSet(t,S,!0),n(e)}}))}return _createClass(e,[{key:"settled",get:function(){return _classPrivateFieldGet(this,S)}}]),e}();t.PromiseCapability=x;var P=null,A=null;t.AnnotationPrefix="pdfjs_internal_id_"},function(__unused_webpack_module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25),DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;var DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;var DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;var DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;function getDocument(e){var t,n;if("string"===typeof e||e instanceof URL?e={url:e}:(0,_util.isArrayBuffer)(e)&&(e={data:e}),"object"!==typeof e)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");var r=new PDFDocumentLoadingTask,a=r.docId,i=e.url?getUrlProp(e.url):null,o=e.data?getDataProp(e.data):null,s=e.httpHeaders||null,l=!0===e.withCredentials,c=null!==(t=e.password)&&void 0!==t?t:null,u=e.range instanceof PDFDataRangeTransport?e.range:null,d=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE,f=e.worker instanceof PDFWorker?e.worker:null,h=e.verbosity,p="string"!==typeof e.docBaseUrl||(0,_display_utils.isDataScheme)(e.docBaseUrl)?null:e.docBaseUrl,v="string"===typeof e.cMapUrl?e.cMapUrl:null,m=!1!==e.cMapPacked,g=e.CMapReaderFactory||DefaultCMapReaderFactory,y="string"===typeof e.standardFontDataUrl?e.standardFontDataUrl:null,_=e.StandardFontDataFactory||DefaultStandardFontDataFactory,b=!0!==e.stopAtErrors,k=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,w=!1!==e.isEvalSupported,S="boolean"===typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!_util.isNodeJS,x=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,P="boolean"===typeof e.disableFontFace?e.disableFontFace:_util.isNodeJS,A=!0===e.fontExtraProperties,C=!0===e.enableXfa,F=e.ownerDocument||globalThis.document,E=!0===e.disableRange,M=!0===e.disableStream,T=!0===e.disableAutoFetch,I=!0===e.pdfBug,R=u?u.length:null!==(n=e.length)&&void 0!==n?n:NaN,O="boolean"===typeof e.useSystemFonts?e.useSystemFonts:!_util.isNodeJS&&!P,L="boolean"===typeof e.useWorkerFetch?e.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&_===_display_utils.DOMStandardFontDataFactory&&v&&y&&(0,_display_utils.isValidFetchUrl)(v,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(y,document.baseURI),D=e.canvasFactory||new DefaultCanvasFactory({ownerDocument:F}),N=e.filterFactory||new DefaultFilterFactory({docId:a,ownerDocument:F});(0,_util.setVerbosityLevel)(h);var G={canvasFactory:D,filterFactory:N};if(L||(G.cMapReaderFactory=new g({baseUrl:v,isCompressed:m}),G.standardFontDataFactory=new _({baseUrl:y})),!f){var j={verbosity:h,port:_worker_options.GlobalWorkerOptions.workerPort};f=j.port?PDFWorker.fromPort(j):new PDFWorker(j),r._worker=f}var Z={docId:a,apiVersion:"3.11.174",data:o,password:c,disableAutoFetch:T,rangeChunkSize:d,length:R,docBaseUrl:p,enableXfa:C,evaluatorOptions:{maxImageSize:k,disableFontFace:P,ignoreErrors:b,isEvalSupported:w,isOffscreenCanvasSupported:S,canvasMaxAreaInBytes:x,fontExtraProperties:A,useSystemFonts:O,cMapUrl:L?v:null,standardFontDataUrl:L?y:null}},z={ignoreErrors:b,isEvalSupported:w,disableFontFace:P,fontExtraProperties:A,enableXfa:C,ownerDocument:F,disableAutoFetch:T,pdfBug:I,styleElement:null};return f.promise.then((function(){if(r.destroyed)throw new Error("Loading aborted");var e=_fetchDocument(f,Z),t=new Promise((function(e){var t,n;u?t=new _transport_stream.PDFDataTransportStream({length:R,initialData:u.initialData,progressiveDone:u.progressiveDone,contentDispositionFilename:u.contentDispositionFilename,disableRange:E,disableStream:M},u):o||(n={url:i,length:R,httpHeaders:s,withCredentials:l,rangeChunkSize:d,disableRange:E,disableStream:M},t=_util.isNodeJS?new _displayNode_stream.PDFNodeStream(n):(0,_display_utils.isValidFetchUrl)(n.url)?new _displayFetch_stream.PDFFetchStream(n):new _displayNetwork.PDFNetworkStream(n)),e(t)}));return Promise.all([e,t]).then((function(e){var t=_slicedToArray(e,2),n=t[0],i=t[1];if(r.destroyed)throw new Error("Loading aborted");var o=new _message_handler.MessageHandler(a,n,f.port),s=new WorkerTransport(o,r,i,z,G);r._transport=s,o.send("Ready",null)}))})).catch(r._capability.reject),r}function _fetchDocument(e,t){return _fetchDocument2.apply(this,arguments)}function _fetchDocument2(){return(_fetchDocument2=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,n){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.destroyed){e.next=2;break}throw new Error("Worker was destroyed");case 2:return e.next=4,t.messageHandler.sendWithPromise("GetDocRequest",n,n.data?[n.data.buffer]:null);case 4:if(r=e.sent,!t.destroyed){e.next=7;break}throw new Error("Worker was destroyed");case 7:return e.abrupt("return",r);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function getUrlProp(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch(t){if(_util.isNodeJS&&"string"===typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(e){if(_util.isNodeJS&&"undefined"!==typeof Buffer&&e instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"===typeof e)return(0,_util.stringToBytes)(e);if("object"===typeof e&&!isNaN(null===e||void 0===e?void 0:e.length)||(0,_util.isArrayBuffer)(e))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;var PDFDocumentLoadingTask=function(){function e(){var t,n;_classCallCheck(this,e),this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d".concat((_classStaticPrivateFieldSpecSet(e,e,_docId,(t=_classStaticPrivateFieldSpecGet(e,e,_docId),n=t++,t)),n)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}return _createClass(e,[{key:"promise",get:function(){return this._capability.promise}},{key:"destroy",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n,r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.destroyed=!0,e.prev=1,null!==(t=this._worker)&&void 0!==t&&t.port&&(this._worker._pendingDestroy=!0),e.next=5,null===(n=this._transport)||void 0===n?void 0:n.destroy();case 5:e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(1),null!==(r=this._worker)&&void 0!==r&&r.port&&delete this._worker._pendingDestroy,e.t0;case 11:this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null);case 13:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(){return e.apply(this,arguments)}}()}]),e}(),_docId={writable:!0,value:0};exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;var PDFDataRangeTransport=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;_classCallCheck(this,e),this.length=t,this.initialData=n,this.progressiveDone=r,this.contentDispositionFilename=a,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}return _createClass(e,[{key:"addRangeListener",value:function(e){this._rangeListeners.push(e)}},{key:"addProgressListener",value:function(e){this._progressListeners.push(e)}},{key:"addProgressiveReadListener",value:function(e){this._progressiveReadListeners.push(e)}},{key:"addProgressiveDoneListener",value:function(e){this._progressiveDoneListeners.push(e)}},{key:"onDataRange",value:function(e,t){var n,r=_createForOfIteratorHelper(this._rangeListeners);try{for(r.s();!(n=r.n()).done;)(0,n.value)(e,t)}catch(a){r.e(a)}finally{r.f()}}},{key:"onDataProgress",value:function(e,t){var n=this;this._readyCapability.promise.then((function(){var r,a=_createForOfIteratorHelper(n._progressListeners);try{for(a.s();!(r=a.n()).done;)(0,r.value)(e,t)}catch(i){a.e(i)}finally{a.f()}}))}},{key:"onDataProgressiveRead",value:function(e){var t=this;this._readyCapability.promise.then((function(){var n,r=_createForOfIteratorHelper(t._progressiveReadListeners);try{for(r.s();!(n=r.n()).done;)(0,n.value)(e)}catch(a){r.e(a)}finally{r.f()}}))}},{key:"onDataProgressiveDone",value:function(){var e=this;this._readyCapability.promise.then((function(){var t,n=_createForOfIteratorHelper(e._progressiveDoneListeners);try{for(n.s();!(t=n.n()).done;)(0,t.value)()}catch(r){n.e(r)}finally{n.f()}}))}},{key:"transportReady",value:function(){this._readyCapability.resolve()}},{key:"requestDataRange",value:function(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}},{key:"abort",value:function(){}}]),e}();exports.PDFDataRangeTransport=PDFDataRangeTransport;var PDFDocumentProxy=function(){function e(t,n){var r=this;_classCallCheck(this,e),this._pdfInfo=t,this._transport=n,Object.defineProperty(this,"getJavaScript",{value:function(){return(0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),r.getJSActions().then((function(e){if(!e)return e;var t=[];for(var n in e)t.push.apply(t,_toConsumableArray(e[n]));return t}))}})}return _createClass(e,[{key:"annotationStorage",get:function(){return this._transport.annotationStorage}},{key:"filterFactory",get:function(){return this._transport.filterFactory}},{key:"numPages",get:function(){return this._pdfInfo.numPages}},{key:"fingerprints",get:function(){return this._pdfInfo.fingerprints}},{key:"isPureXfa",get:function(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}},{key:"allXfaHtml",get:function(){return this._transport._htmlForXfa}},{key:"getPage",value:function(e){return this._transport.getPage(e)}},{key:"getPageIndex",value:function(e){return this._transport.getPageIndex(e)}},{key:"getDestinations",value:function(){return this._transport.getDestinations()}},{key:"getDestination",value:function(e){return this._transport.getDestination(e)}},{key:"getPageLabels",value:function(){return this._transport.getPageLabels()}},{key:"getPageLayout",value:function(){return this._transport.getPageLayout()}},{key:"getPageMode",value:function(){return this._transport.getPageMode()}},{key:"getViewerPreferences",value:function(){return this._transport.getViewerPreferences()}},{key:"getOpenAction",value:function(){return this._transport.getOpenAction()}},{key:"getAttachments",value:function(){return this._transport.getAttachments()}},{key:"getJSActions",value:function(){return this._transport.getDocJSActions()}},{key:"getOutline",value:function(){return this._transport.getOutline()}},{key:"getOptionalContentConfig",value:function(){return this._transport.getOptionalContentConfig()}},{key:"getPermissions",value:function(){return this._transport.getPermissions()}},{key:"getMetadata",value:function(){return this._transport.getMetadata()}},{key:"getMarkInfo",value:function(){return this._transport.getMarkInfo()}},{key:"getData",value:function(){return this._transport.getData()}},{key:"saveDocument",value:function(){return this._transport.saveDocument()}},{key:"getDownloadInfo",value:function(){return this._transport.downloadInfoCapability.promise}},{key:"cleanup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(e||this.isPureXfa)}},{key:"destroy",value:function(){return this.loadingTask.destroy()}},{key:"loadingParams",get:function(){return this._transport.loadingParams}},{key:"loadingTask",get:function(){return this._transport.loadingTask}},{key:"getFieldObjects",value:function(){return this._transport.getFieldObjects()}},{key:"hasJSActions",value:function(){return this._transport.hasJSActions()}},{key:"getCalculationOrderIds",value:function(){return this._transport.getCalculationOrderIds()}}]),e}();exports.PDFDocumentProxy=PDFDocumentProxy;var _delayedCleanupTimeout=new WeakMap,_pendingCleanup=new WeakMap,_tryCleanup=new WeakSet,_abortDelayedCleanup=new WeakSet,PDFPageProxy=function(){function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_classCallCheck(this,e),_classPrivateMethodInitSpec(this,_abortDelayedCleanup),_classPrivateMethodInitSpec(this,_tryCleanup),_classPrivateFieldInitSpec(this,_delayedCleanupTimeout,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,_pendingCleanup,{writable:!0,value:!1}),this._pageIndex=t,this._pageInfo=n,this._transport=r,this._stats=a?new _display_utils.StatTimer:null,this._pdfBug=a,this.commonObjs=r.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}return _createClass(e,[{key:"pageNumber",get:function(){return this._pageIndex+1}},{key:"rotate",get:function(){return this._pageInfo.rotate}},{key:"ref",get:function(){return this._pageInfo.ref}},{key:"userUnit",get:function(){return this._pageInfo.userUnit}},{key:"view",get:function(){return this._pageInfo.view}},{key:"getViewport",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.scale,n=e.rotation,r=void 0===n?this.rotate:n,a=e.offsetX,i=void 0===a?0:a,o=e.offsetY,s=void 0===o?0:o,l=e.dontFlip,c=void 0!==l&&l;return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:r,offsetX:i,offsetY:s,dontFlip:c})}},{key:"getAnnotations",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).intent,t=void 0===e?"display":e,n=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,n.renderingIntent)}},{key:"getJSActions",value:function(){return this._transport.getPageJSActions(this._pageIndex)}},{key:"filterFactory",get:function(){return this._transport.filterFactory}},{key:"isPureXfa",get:function(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}},{key:"getXfa",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(e){var t,n,r=this,a=e.canvasContext,i=e.viewport,o=e.intent,s=void 0===o?"display":o,l=e.annotationMode,c=void 0===l?_util.AnnotationMode.ENABLE:l,u=e.transform,d=void 0===u?null:u,f=e.background,h=void 0===f?null:f,p=e.optionalContentConfigPromise,v=void 0===p?null:p,m=e.annotationCanvasMap,g=void 0===m?null:m,y=e.pageColors,_=void 0===y?null:y,b=e.printAnnotationStorage,k=void 0===b?null:b;null===(t=this._stats)||void 0===t||t.time("Overall");var w=this._transport.getRenderingIntent(s,c,k);_classPrivateFieldSet(this,_pendingCleanup,!1),_classPrivateMethodGet(this,_abortDelayedCleanup,_abortDelayedCleanup2).call(this),v||(v=this._transport.getOptionalContentConfig());var S=this._intentStates.get(w.cacheKey);S||(S=Object.create(null),this._intentStates.set(w.cacheKey,S)),S.streamReaderCancelTimeout&&(clearTimeout(S.streamReaderCancelTimeout),S.streamReaderCancelTimeout=null);var x,P=!!(w.renderingIntent&_util.RenderingIntentFlag.PRINT);S.displayReadyCapability||(S.displayReadyCapability=new _util.PromiseCapability,S.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(x=this._stats)||void 0===x||x.time("Page Request"),this._pumpOperatorList(w));var A=function(e){var t,n;S.renderTasks.delete(C),(r._maybeCleanupAfterRender||P)&&_classPrivateFieldSet(r,_pendingCleanup,!0),_classPrivateMethodGet(r,_tryCleanup,_tryCleanup2).call(r,!P),e?(C.capability.reject(e),r._abortOperatorList({intentState:S,reason:e instanceof Error?e:new Error(e)})):C.capability.resolve(),null===(t=r._stats)||void 0===t||t.timeEnd("Rendering"),null===(n=r._stats)||void 0===n||n.timeEnd("Overall")},C=new InternalRenderTask({callback:A,params:{canvasContext:a,viewport:i,transform:d,background:h},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:g,operatorList:S.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!P,pdfBug:this._pdfBug,pageColors:_});((n=S).renderTasks||(n.renderTasks=new Set)).add(C);var F=C.task;return Promise.all([S.displayReadyCapability.promise,v]).then((function(e){var t,n=_slicedToArray(e,2),a=n[0],i=n[1];r.destroyed?A():(null===(t=r._stats)||void 0===t||t.time("Rendering"),C.initializeGraphics({transparency:a,optionalContentConfig:i}),C.operatorListChanged())})).catch(A),F}},{key:"getOperatorList",value:function(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=r.intent,i=void 0===a?"display":a,o=r.annotationMode,s=void 0===o?_util.AnnotationMode.ENABLE:o,l=r.printAnnotationStorage,c=void 0===l?null:l,u=this._transport.getRenderingIntent(i,s,c,!0),d=this._intentStates.get(u.cacheKey);return d||(d=Object.create(null),this._intentStates.set(u.cacheKey,d)),d.opListReadCapability||((e=Object.create(null)).operatorListChanged=function(){d.operatorList.lastChunk&&(d.opListReadCapability.resolve(d.operatorList),d.renderTasks.delete(e))},d.opListReadCapability=new _util.PromiseCapability,((t=d).renderTasks||(t.renderTasks=new Set)).add(e),d.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(n=this._stats)||void 0===n||n.time("Page Request"),this._pumpOperatorList(u)),d.opListReadCapability.promise}},{key:"streamTextContent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.includeMarkedContent,n=void 0!==t&&t,r=e.disableNormalization,a=void 0!==r&&r;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===n,disableNormalization:!0===a},{highWaterMark:100,size:function(e){return e.items.length}})}},{key:"getTextContent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((function(e){return _xfa_text.XfaText.textContent(e)}));var t=this.streamTextContent(e);return new Promise((function(e,n){var r=t.getReader(),a={items:[],styles:Object.create(null)};!function t(){r.read().then((function(n){var r,i=n.value;n.done?e(a):(Object.assign(a.styles,i.styles),(r=a.items).push.apply(r,_toConsumableArray(i.items)),t())}),n)}()}))}},{key:"getStructTree",value:function(){return this._transport.getStructTree(this._pageIndex)}},{key:"_destroy",value:function(){this.destroyed=!0;var e,t=[],n=_createForOfIteratorHelper(this._intentStates.values());try{for(n.s();!(e=n.n()).done;){var r=e.value;if(this._abortOperatorList({intentState:r,reason:new Error("Page was destroyed."),force:!0}),!r.opListReadCapability){var a,i=_createForOfIteratorHelper(r.renderTasks);try{for(i.s();!(a=i.n()).done;){var o=a.value;t.push(o.completed),o.cancel()}}catch(s){i.e(s)}finally{i.f()}}}}catch(s){n.e(s)}finally{n.f()}return this.objs.clear(),_classPrivateFieldSet(this,_pendingCleanup,!1),_classPrivateMethodGet(this,_abortDelayedCleanup,_abortDelayedCleanup2).call(this),Promise.all(t)}},{key:"cleanup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classPrivateFieldSet(this,_pendingCleanup,!0);var t=_classPrivateMethodGet(this,_tryCleanup,_tryCleanup2).call(this,!1);return e&&t&&this._stats&&(this._stats=new _display_utils.StatTimer),t}},{key:"_startRenderPage",value:function(e,t){var n,r,a=this._intentStates.get(t);a&&(null===(n=this._stats)||void 0===n||n.timeEnd("Page Request"),null===(r=a.displayReadyCapability)||void 0===r||r.resolve(e))}},{key:"_renderPageChunk",value:function(e,t){for(var n=0,r=e.length;n0)return;if(r instanceof _display_utils.RenderingCancelledException){var o=RENDERING_CANCELLED_TIMEOUT;return r.extraDelay>0&&r.extraDelay<1e3&&(o+=r.extraDelay),void(n.streamReaderCancelTimeout=setTimeout((function(){n.streamReaderCancelTimeout=null,t._abortOperatorList({intentState:n,reason:r,force:!0})}),o))}}if(n.streamReader.cancel(new _util.AbortException(r.message)).catch((function(){})),n.streamReader=null,!this._transport.destroyed){var s,l=_createForOfIteratorHelper(this._intentStates);try{for(l.s();!(s=l.n()).done;){var c=_slicedToArray(s.value,2),u=c[0];if(c[1]===n){this._intentStates.delete(u);break}}}catch(d){l.e(d)}finally{l.f()}this.cleanup()}}}},{key:"stats",get:function(){return this._stats}}]),e}();function _tryCleanup2(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(_classPrivateMethodGet(this,_abortDelayedCleanup,_abortDelayedCleanup2).call(this),!_classPrivateFieldGet(this,_pendingCleanup)||this.destroyed)return!1;if(t)return _classPrivateFieldSet(this,_delayedCleanupTimeout,setTimeout((function(){_classPrivateFieldSet(e,_delayedCleanupTimeout,null),_classPrivateMethodGet(e,_tryCleanup,_tryCleanup2).call(e,!1)}),DELAYED_CLEANUP_TIMEOUT)),!1;var n,r=_createForOfIteratorHelper(this._intentStates.values());try{for(r.s();!(n=r.n()).done;){var a=n.value,i=a.renderTasks,o=a.operatorList;if(i.size>0||!o.lastChunk)return!1}}catch(s){r.e(s)}finally{r.f()}return this._intentStates.clear(),this.objs.clear(),_classPrivateFieldSet(this,_pendingCleanup,!1),!0}function _abortDelayedCleanup2(){_classPrivateFieldGet(this,_delayedCleanupTimeout)&&(clearTimeout(_classPrivateFieldGet(this,_delayedCleanupTimeout)),_classPrivateFieldSet(this,_delayedCleanupTimeout,null))}exports.PDFPageProxy=PDFPageProxy;var _listeners=new WeakMap,_deferred=new WeakMap,LoopbackPort=function(){function e(){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_listeners,{writable:!0,value:new Set}),_classPrivateFieldInitSpec(this,_deferred,{writable:!0,value:Promise.resolve()})}return _createClass(e,[{key:"postMessage",value:function(e,t){var n=this,r={data:structuredClone(e,t?{transfer:t}:null)};_classPrivateFieldGet(this,_deferred).then((function(){var e,t=_createForOfIteratorHelper(_classPrivateFieldGet(n,_listeners));try{for(t.s();!(e=t.n()).done;)e.value.call(n,r)}catch(a){t.e(a)}finally{t.f()}}))}},{key:"addEventListener",value:function(e,t){_classPrivateFieldGet(this,_listeners).add(t)}},{key:"removeEventListener",value:function(e,t){_classPrivateFieldGet(this,_listeners).delete(t)}},{key:"terminate",value:function(){_classPrivateFieldGet(this,_listeners).clear()}}]),e}();exports.LoopbackPort=LoopbackPort;var PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_util.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"===typeof document){var _document,pdfjsFilePath=null===(_document=document)||void 0===_document||null===(_document=_document.currentScript)||void 0===_document?void 0:_document.src;pdfjsFilePath&&(PDFWorkerUtil.fallbackWorkerSrc=pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(e,t){var n;try{if(!(n=new URL(e)).origin||"null"===n.origin)return!1}catch(a){return!1}var r=new URL(t,n);return n.origin===r.origin},PDFWorkerUtil.createCDNWrapper=function(e){var t='importScripts("'.concat(e,'");');return URL.createObjectURL(new Blob([t]))};var PDFWorker=function(){function PDFWorker(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.name,n=void 0===t?null:t,r=e.port,a=void 0===r?null:r,i=e.verbosity,o=void 0===i?(0,_util.getVerbosityLevel)():i;if(_classCallCheck(this,PDFWorker),this.name=n,this.destroyed=!1,this.verbosity=o,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,a){var s;if(null!==(s=_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts))&&void 0!==s&&s.has(a))throw new Error("Cannot use more than one PDFWorker per port.");return(_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts)||_classStaticPrivateFieldSpecSet(PDFWorker,PDFWorker,_workerPorts,new WeakMap)).set(a,this),void this._initializeFromPort(a)}this._initialize()}return _createClass(PDFWorker,[{key:"promise",get:function(){return this._readyCapability.promise}},{key:"port",get:function(){return this._port}},{key:"messageHandler",get:function(){return this._messageHandler}},{key:"_initializeFromPort",value:function(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}},{key:"_initialize",value:function(){var e=this;if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){var t=PDFWorker.workerSrc;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));var n=new Worker(t),r=new _message_handler.MessageHandler("main","worker",n),a=function(){n.removeEventListener("error",i),r.destroy(),n.terminate(),e.destroyed?e._readyCapability.reject(new Error("Worker was destroyed")):e._setupFakeWorker()},i=function(){e._webWorker||a()};n.addEventListener("error",i),r.on("test",(function(t){n.removeEventListener("error",i),e.destroyed?a():t?(e._messageHandler=r,e._port=n,e._webWorker=n,e._readyCapability.resolve(),r.send("configure",{verbosity:e.verbosity})):(e._setupFakeWorker(),r.destroy(),n.terminate())})),r.on("ready",(function(t){if(n.removeEventListener("error",i),e.destroyed)a();else try{o()}catch(r){e._setupFakeWorker()}}));var o=function(){var e=new Uint8Array;r.send("test",e,[e.buffer])};return void o()}catch(s){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}},{key:"_setupFakeWorker",value:function(){var e=this;PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then((function(t){if(e.destroyed)e._readyCapability.reject(new Error("Worker was destroyed"));else{var n=new LoopbackPort;e._port=n;var r="fake".concat(PDFWorkerUtil.fakeWorkerId++),a=new _message_handler.MessageHandler(r+"_worker",r,n);t.setup(a,n);var i=new _message_handler.MessageHandler(r,r+"_worker",n);e._messageHandler=i,e._readyCapability.resolve(),i.send("configure",{verbosity:e.verbosity})}})).catch((function(t){e._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))}))}},{key:"destroy",value:function(){var e;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null===(e=_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts))||void 0===e||e.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}}],[{key:"fromPort",value:function(e){var t;if(null===e||void 0===e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");var n=null===(t=_classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts))||void 0===t?void 0:t.get(e.port);if(n){if(n._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new PDFWorker(e)}},{key:"workerSrc",get:function(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}},{key:"_mainThreadWorkerMessageHandler",get:function(){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch(t){return null}}},{key:"_setupFakeWorkerGlobal",get:function get(){var _this15=this,loader=function(){var _ref15=_asyncToGenerator(_regeneratorRuntime().mark((function _callee3(){var mainWorkerMessageHandler,worker;return _regeneratorRuntime().wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if(mainWorkerMessageHandler=_this15._mainThreadWorkerMessageHandler,!mainWorkerMessageHandler){_context3.next=3;break}return _context3.abrupt("return",mainWorkerMessageHandler);case 3:if(!_util.isNodeJS){_context3.next=6;break}return worker=eval("require")(_this15.workerSrc),_context3.abrupt("return",worker.WorkerMessageHandler);case 6:return _context3.next=8,(0,_display_utils.loadScript)(_this15.workerSrc);case 8:return _context3.abrupt("return",window.pdfjsWorker.WorkerMessageHandler);case 9:case"end":return _context3.stop()}}),_callee3)})));return function(){return _ref15.apply(this,arguments)}}();return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}]),PDFWorker}(),_workerPorts={writable:!0,value:void 0};exports.PDFWorker=PDFWorker;var _methodPromises=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_passwordCapability=new WeakMap,_cacheSimpleMethod=new WeakSet,WorkerTransport=function(){function e(t,n,r,a,i){_classCallCheck(this,e),_classPrivateMethodInitSpec(this,_cacheSimpleMethod),_classPrivateFieldInitSpec(this,_methodPromises,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,_pageCache,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,_pagePromises,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,_passwordCapability,{writable:!0,value:null}),this.messageHandler=t,this.loadingTask=n,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:a.ownerDocument,styleElement:a.styleElement}),this._params=a,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.cMapReaderFactory=i.cMapReaderFactory,this.standardFontDataFactory=i.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}return _createClass(e,[{key:"annotationStorage",get:function(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}},{key:"getRenderingIntent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=_util.RenderingIntentFlag.DISPLAY,i=_annotation_storage.SerializableEmpty;switch(e){case"any":a=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":a=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(e))}switch(t){case _util.AnnotationMode.DISABLE:a+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:a+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:i=((a+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE)&_util.RenderingIntentFlag.PRINT&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(t))}return r&&(a+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:a,cacheKey:"".concat(a,"_").concat(i.hash),annotationStorageSerializable:i}}},{key:"destroy",value:function(){var e,t=this;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,null===(e=_classPrivateFieldGet(this,_passwordCapability))||void 0===e||e.reject(new Error("Worker was destroyed during onPassword callback"));var n,r=[],a=_createForOfIteratorHelper(_classPrivateFieldGet(this,_pageCache).values());try{for(a.s();!(n=a.n()).done;){var i=n.value;r.push(i._destroy())}}catch(s){a.e(s)}finally{a.f()}_classPrivateFieldGet(this,_pageCache).clear(),_classPrivateFieldGet(this,_pagePromises).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();var o=this.messageHandler.sendWithPromise("Terminate",null);return r.push(o),Promise.all(r).then((function(){var e;t.commonObjs.clear(),t.fontLoader.clear(),_classPrivateFieldGet(t,_methodPromises).clear(),t.filterFactory.destroy(),null===(e=t._networkStream)||void 0===e||e.cancelAllRequests(new _util.AbortException("Worker was terminated.")),t.messageHandler&&(t.messageHandler.destroy(),t.messageHandler=null),t.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}},{key:"setupMessageHandler",value:function(){var e=this,t=this.messageHandler,n=this.loadingTask;t.on("GetReader",(function(t,n){(0,_util.assert)(e._networkStream,"GetReader - no `IPDFStream` instance available."),e._fullReader=e._networkStream.getFullReader(),e._fullReader.onProgress=function(t){e._lastProgress={loaded:t.loaded,total:t.total}},n.onPull=function(){e._fullReader.read().then((function(e){var t=e.value;e.done?n.close():((0,_util.assert)(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(t),1,[t]))})).catch((function(e){n.error(e)}))},n.onCancel=function(t){e._fullReader.cancel(t),n.ready.catch((function(t){if(!e.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(function(t){var r=new _util.PromiseCapability,a=e._fullReader;return a.headersReady.then((function(){var t;a.isStreamingSupported&&a.isRangeSupported||(e._lastProgress&&(null===(t=n.onProgress)||void 0===t||t.call(n,e._lastProgress)),a.onProgress=function(e){var t;null===(t=n.onProgress)||void 0===t||t.call(n,{loaded:e.loaded,total:e.total})});r.resolve({isStreamingSupported:a.isStreamingSupported,isRangeSupported:a.isRangeSupported,contentLength:a.contentLength})}),r.reject),r.promise})),t.on("GetRangeReader",(function(t,n){(0,_util.assert)(e._networkStream,"GetRangeReader - no `IPDFStream` instance available.");var r=e._networkStream.getRangeReader(t.begin,t.end);r?(n.onPull=function(){r.read().then((function(e){var t=e.value;e.done?n.close():((0,_util.assert)(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(t),1,[t]))})).catch((function(e){n.error(e)}))},n.onCancel=function(t){r.cancel(t),n.ready.catch((function(t){if(!e.destroyed)throw t}))}):n.close()})),t.on("GetDoc",(function(t){var r=t.pdfInfo;e._numPages=r.numPages,e._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,n._capability.resolve(new PDFDocumentProxy(r,e))})),t.on("DocException",(function(e){var t;switch(e.name){case"PasswordException":t=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":t=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":t=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":t=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":t=new _util.UnknownErrorException(e.message,e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}n._capability.reject(t)})),t.on("PasswordRequest",(function(t){if(_classPrivateFieldSet(e,_passwordCapability,new _util.PromiseCapability),n.onPassword)try{n.onPassword((function(t){t instanceof Error?_classPrivateFieldGet(e,_passwordCapability).reject(t):_classPrivateFieldGet(e,_passwordCapability).resolve({password:t})}),t.code)}catch(r){_classPrivateFieldGet(e,_passwordCapability).reject(r)}else _classPrivateFieldGet(e,_passwordCapability).reject(new _util.PasswordException(t.message,t.code));return _classPrivateFieldGet(e,_passwordCapability).promise})),t.on("DataLoaded",(function(t){var r;null===(r=n.onProgress)||void 0===r||r.call(n,{loaded:t.length,total:t.length}),e.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(function(t){e.destroyed||_classPrivateFieldGet(e,_pageCache).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(function(n){var r,a=_slicedToArray(n,3),i=a[0],o=a[1],s=a[2];if(!e.destroyed&&!e.commonObjs.has(i))switch(o){case"Font":var l=e._params;if("error"in s){var c=s.error;(0,_util.warn)("Error during font loading: ".concat(c)),e.commonObjs.resolve(i,c);break}var u=l.pdfBug&&null!==(r=globalThis.FontInspector)&&void 0!==r&&r.enabled?function(e,t){return globalThis.FontInspector.fontAdded(e,t)}:null,d=new _font_loader.FontFaceObject(s,{isEvalSupported:l.isEvalSupported,disableFontFace:l.disableFontFace,ignoreErrors:l.ignoreErrors,inspectFont:u});e.fontLoader.bind(d).catch((function(e){return t.sendWithPromise("FontFallback",{id:i})})).finally((function(){!l.fontExtraProperties&&d.data&&(d.data=null),e.commonObjs.resolve(i,d)}));break;case"FontPath":case"Image":case"Pattern":e.commonObjs.resolve(i,s);break;default:throw new Error("Got unknown common object type ".concat(o))}})),t.on("obj",(function(t){var n=_slicedToArray(t,4),r=n[0],a=n[1],i=n[2],o=n[3];if(!e.destroyed){var s=_classPrivateFieldGet(e,_pageCache).get(a);if(!s.objs.has(r))switch(i){case"Image":var l;if(s.objs.resolve(r,o),o)(o.bitmap?o.width*o.height*4:(null===(l=o.data)||void 0===l?void 0:l.length)||0)>_util.MAX_IMAGE_SIZE_TO_CACHE&&(s._maybeCleanupAfterRender=!0);break;case"Pattern":s.objs.resolve(r,o);break;default:throw new Error("Got unknown object type ".concat(i))}}})),t.on("DocProgress",(function(t){var r;e.destroyed||null===(r=n.onProgress)||void 0===r||r.call(n,{loaded:t.loaded,total:t.total})})),t.on("FetchBuiltInCMap",(function(t){return e.destroyed?Promise.reject(new Error("Worker was destroyed.")):e.cMapReaderFactory?e.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))})),t.on("FetchStandardFontData",(function(t){return e.destroyed?Promise.reject(new Error("Worker was destroyed.")):e.standardFontDataFactory?e.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))}))}},{key:"getData",value:function(){return this.messageHandler.sendWithPromise("GetData",null)}},{key:"saveDocument",value:function(){var e,t,n=this;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");var r=this.annotationStorage.serializable,a=r.map,i=r.transfers;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:a,filename:null!==(e=null===(t=this._fullReader)||void 0===t?void 0:t.filename)&&void 0!==e?e:null},i).finally((function(){n.annotationStorage.resetModified()}))}},{key:"getPage",value:function(e){var t=this;if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));var n=e-1,r=_classPrivateFieldGet(this,_pagePromises).get(n);if(r)return r;var a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then((function(e){if(t.destroyed)throw new Error("Transport destroyed");var r=new PDFPageProxy(n,e,t,t._params.pdfBug);return _classPrivateFieldGet(t,_pageCache).set(n,r),r}));return _classPrivateFieldGet(this,_pagePromises).set(n,a),a}},{key:"getPageIndex",value:function(e){return"object"!==typeof e||null===e||!Number.isInteger(e.num)||e.num<0||!Number.isInteger(e.gen)||e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen})}},{key:"getAnnotations",value:function(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}},{key:"getFieldObjects",value:function(){return _classPrivateMethodGet(this,_cacheSimpleMethod,_cacheSimpleMethod2).call(this,"GetFieldObjects")}},{key:"hasJSActions",value:function(){return _classPrivateMethodGet(this,_cacheSimpleMethod,_cacheSimpleMethod2).call(this,"HasJSActions")}},{key:"getCalculationOrderIds",value:function(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}},{key:"getDestinations",value:function(){return this.messageHandler.sendWithPromise("GetDestinations",null)}},{key:"getDestination",value:function(e){return"string"!==typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}},{key:"getPageLabels",value:function(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}},{key:"getPageLayout",value:function(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}},{key:"getPageMode",value:function(){return this.messageHandler.sendWithPromise("GetPageMode",null)}},{key:"getViewerPreferences",value:function(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}},{key:"getOpenAction",value:function(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}},{key:"getAttachments",value:function(){return this.messageHandler.sendWithPromise("GetAttachments",null)}},{key:"getDocJSActions",value:function(){return _classPrivateMethodGet(this,_cacheSimpleMethod,_cacheSimpleMethod2).call(this,"GetDocJSActions")}},{key:"getPageJSActions",value:function(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}},{key:"getStructTree",value:function(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}},{key:"getOutline",value:function(){return this.messageHandler.sendWithPromise("GetOutline",null)}},{key:"getOptionalContentConfig",value:function(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((function(e){return new _optional_content_config.OptionalContentConfig(e)}))}},{key:"getPermissions",value:function(){return this.messageHandler.sendWithPromise("GetPermissions",null)}},{key:"getMetadata",value:function(){var e=this,t="GetMetadata",n=_classPrivateFieldGet(this,_methodPromises).get(t);if(n)return n;var r=this.messageHandler.sendWithPromise(t,null).then((function(t){var n,r,a,i;return{info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:null!==(n=null===(r=e._fullReader)||void 0===r?void 0:r.filename)&&void 0!==n?n:null,contentLength:null!==(a=null===(i=e._fullReader)||void 0===i?void 0:i.contentLength)&&void 0!==a?a:null}}));return _classPrivateFieldGet(this,_methodPromises).set(t,r),r}},{key:"getMarkInfo",value:function(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}},{key:"startCleanup",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n,r,a,i=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]&&i[0],!this.destroyed){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.messageHandler.sendWithPromise("Cleanup",null);case 5:n=_createForOfIteratorHelper(_classPrivateFieldGet(this,_pageCache).values()),e.prev=6,n.s();case 8:if((r=n.n()).done){e.next=15;break}if((a=r.value).cleanup()){e.next=13;break}throw new Error("startCleanup: Page ".concat(a.pageNumber," is currently rendering."));case 13:e.next=8;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(6),n.e(e.t0);case 20:return e.prev=20,n.f(),e.finish(20);case 23:this.commonObjs.clear(),t||this.fontLoader.clear(),_classPrivateFieldGet(this,_methodPromises).clear(),this.filterFactory.destroy(!0);case 27:case"end":return e.stop()}}),e,this,[[6,17,20,23]])})));return function(){return e.apply(this,arguments)}}()},{key:"loadingParams",get:function(){var e=this._params,t=e.disableAutoFetch,n=e.enableXfa;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:n})}}]),e}();function _cacheSimpleMethod2(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=_classPrivateFieldGet(this,_methodPromises).get(e);if(n)return n;var r=this.messageHandler.sendWithPromise(e,t);return _classPrivateFieldGet(this,_methodPromises).set(e,r),r}var _objs=new WeakMap,_ensureObj=new WeakSet,PDFObjects=function(){function e(){_classCallCheck(this,e),_classPrivateMethodInitSpec(this,_ensureObj),_classPrivateFieldInitSpec(this,_objs,{writable:!0,value:Object.create(null)})}return _createClass(e,[{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t){var n=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,e);return n.capability.promise.then((function(){return t(n.data)})),null}var r=_classPrivateFieldGet(this,_objs)[e];if(null===r||void 0===r||!r.capability.settled)throw new Error("Requesting object that isn't resolved yet ".concat(e,"."));return r.data}},{key:"has",value:function(e){var t=_classPrivateFieldGet(this,_objs)[e];return(null===t||void 0===t?void 0:t.capability.settled)||!1}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,e);n.data=t,n.capability.resolve()}},{key:"clear",value:function(){for(var e in _classPrivateFieldGet(this,_objs)){var t,n=_classPrivateFieldGet(this,_objs)[e].data;null===n||void 0===n||null===(t=n.bitmap)||void 0===t||t.close()}_classPrivateFieldSet(this,_objs,Object.create(null))}}]),e}();function _ensureObj2(e){var t;return(t=_classPrivateFieldGet(this,_objs))[e]||(t[e]={capability:new _util.PromiseCapability,data:null})}var _internalRenderTask=new WeakMap,RenderTask=function(){function e(t){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_internalRenderTask,{writable:!0,value:null}),_classPrivateFieldSet(this,_internalRenderTask,t),this.onContinue=null}return _createClass(e,[{key:"promise",get:function(){return _classPrivateFieldGet(this,_internalRenderTask).capability.promise}},{key:"cancel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;_classPrivateFieldGet(this,_internalRenderTask).cancel(null,e)}},{key:"separateAnnots",get:function(){var e=_classPrivateFieldGet(this,_internalRenderTask).operatorList.separateAnnots;if(!e)return!1;var t=_classPrivateFieldGet(this,_internalRenderTask).annotationCanvasMap;return e.form||e.canvas&&(null===t||void 0===t?void 0:t.size)>0}}]),e}();exports.RenderTask=RenderTask;var InternalRenderTask=function(){function e(t){var n=t.callback,r=t.params,a=t.objs,i=t.commonObjs,o=t.annotationCanvasMap,s=t.operatorList,l=t.pageIndex,c=t.canvasFactory,u=t.filterFactory,d=t.useRequestAnimationFrame,f=void 0!==d&&d,h=t.pdfBug,p=void 0!==h&&h,v=t.pageColors,m=void 0===v?null:v;_classCallCheck(this,e),this.callback=n,this.params=r,this.objs=a,this.commonObjs=i,this.annotationCanvasMap=o,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=l,this.canvasFactory=c,this.filterFactory=u,this._pdfBug=p,this.pageColors=m,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===f&&"undefined"!==typeof window,this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=r.canvasContext.canvas}return _createClass(e,[{key:"completed",get:function(){return this.capability.promise.catch((function(){}))}},{key:"initializeGraphics",value:function(t){var n,r,a=t.transparency,i=void 0!==a&&a,o=t.optionalContentConfig;if(!this.cancelled){if(this._canvas){if(_classStaticPrivateFieldSpecGet(e,e,_canvasInUse).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");_classStaticPrivateFieldSpecGet(e,e,_canvasInUse).add(this._canvas)}this._pdfBug&&null!==(n=globalThis.StepperManager)&&void 0!==n&&n.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());var s=this.params,l=s.canvasContext,c=s.viewport,u=s.transform,d=s.background;this.gfx=new _canvas.CanvasGraphics(l,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:o},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:u,viewport:c,transparency:i,background:d}),this.operatorListIdx=0,this.graphicsReady=!0,null===(r=this.graphicsReadyCallback)||void 0===r||r.call(this)}}},{key:"cancel",value:function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=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(),_classStaticPrivateFieldSpecGet(e,e,_canvasInUse).delete(this._canvas),this.callback(n||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),r))}},{key:"operatorListChanged",value:function(){var e;this.graphicsReady?(null===(e=this.stepper)||void 0===e||e.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}},{key:"_continue",value:function(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}},{key:"_scheduleNext",value:function(){var e=this;this._useRequestAnimationFrame?window.requestAnimationFrame((function(){e._nextBound().catch(e._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}},{key:"_next",value:function(){var t=_asyncToGenerator(_regeneratorRuntime().mark((function t(){return _regeneratorRuntime().wrap((function(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),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),_classStaticPrivateFieldSpecGet(e,e,_canvasInUse).delete(this._canvas),this.callback()));case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),e}(),_canvasInUse={writable:!0,value:new WeakSet},version="3.11.174";exports.version=version;var build="ce8716743";exports.build=build},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SerializableEmpty=t.PrintAnnotationStorage=t.AnnotationStorage=void 0;var r=n(1),a=n(4),i=n(8),o=Object.freeze({map:null,hash:"",transfers:void 0});t.SerializableEmpty=o;var s=new WeakMap,l=new WeakMap,c=new WeakSet,u=function(){function e(){_classCallCheck(this,e),_classPrivateMethodInitSpec(this,c),_classPrivateFieldInitSpec(this,s,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,l,{writable:!0,value:new Map}),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}return _createClass(e,[{key:"getValue",value:function(e,t){var n=_classPrivateFieldGet(this,l).get(e);return void 0===n?t:Object.assign(t,n)}},{key:"getRawValue",value:function(e){return _classPrivateFieldGet(this,l).get(e)}},{key:"remove",value:function(e){if(_classPrivateFieldGet(this,l).delete(e),0===_classPrivateFieldGet(this,l).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){var t,n=_createForOfIteratorHelper(_classPrivateFieldGet(this,l).values());try{for(n.s();!(t=n.n()).done;)if(t.value instanceof a.AnnotationEditor)return}catch(r){n.e(r)}finally{n.f()}this.onAnnotationEditor(null)}}},{key:"setValue",value:function(e,t){var n=_classPrivateFieldGet(this,l).get(e),r=!1;if(void 0!==n)for(var i=0,o=Object.entries(t);i0?(0,r.objectFromMap)(_classPrivateFieldGet(this,l)):null}},{key:"setAll",value:function(e){for(var t=0,n=Object.entries(e);t0?{map:t,hash:n.hexdigest(),transfers:r}:o}}]),e}();function d(){_classPrivateFieldGet(this,s)||(_classPrivateFieldSet(this,s,!0),"function"===typeof this.onSetModified&&this.onSetModified())}t.AnnotationStorage=u;var f=new WeakMap,h=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var r;_classCallCheck(this,n),r=t.call(this),_classPrivateFieldInitSpec(_assertThisInitialized(r),f,{writable:!0,value:void 0});var a=e.serializable,i=a.map,o=a.hash,s=a.transfers,l=structuredClone(i,s?{transfer:s}:null);return _classPrivateFieldSet(_assertThisInitialized(r),f,{map:l,hash:o,transfers:s}),r}return _createClass(n,[{key:"print",get:function(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}},{key:"serializable",get:function(){return _classPrivateFieldGet(this,f)}}]),n}(u);t.PrintAnnotationStorage=h},function(e,t,n){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditor=void 0;var a=n(5),i=n(1),o=n(6),s=new WeakMap,l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,h=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,g=new WeakMap,y=new WeakMap,_=new WeakMap,b=new WeakMap,k=new WeakSet,w=new WeakSet,S=new WeakSet,x=new WeakSet,P=new WeakSet,A=new WeakSet,C=new WeakSet,F=new WeakSet,E=function(){function e(t){_classCallCheck(this,e),_classPrivateMethodInitSpec(this,F),_classPrivateMethodInitSpec(this,C),_classPrivateMethodInitSpec(this,A),_classPrivateMethodInitSpec(this,P),_classPrivateMethodInitSpec(this,x),_classPrivateMethodInitSpec(this,S),_classPrivateMethodInitSpec(this,w),_classPrivateMethodInitSpec(this,k),_classPrivateFieldInitSpec(this,s,{writable:!0,value:""}),_classPrivateFieldInitSpec(this,l,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,c,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,u,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,d,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,f,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,h,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,p,{writable:!0,value:this.focusin.bind(this)}),_classPrivateFieldInitSpec(this,v,{writable:!0,value:this.focusout.bind(this)}),_classPrivateFieldInitSpec(this,m,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,g,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,y,{writable:!0,value:!1}),_defineProperty(this,"_initialOptions",Object.create(null)),_defineProperty(this,"_uiManager",null),_defineProperty(this,"_focusEventsAllowed",!0),_defineProperty(this,"_l10nPromise",null),_classPrivateFieldInitSpec(this,_,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,b,{writable:!0,value:e._zIndex++}),this.constructor===e&&(0,i.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 n=this.parent.viewport,r=n.rotation,a=n.rawDims,o=a.pageWidth,E=a.pageHeight,M=a.pageX,T=a.pageY;this.rotation=r,this.pageRotation=(360+r-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[o,E],this.pageTranslation=[M,T];var I=_slicedToArray(this.parentDimensions,2),R=I[0],O=I[1];this.x=t.x/R,this.y=t.y/O,this.isAttachedToDOM=!1,this.deleted=!1}return _createClass(e,[{key:"editorType",get:function(){return Object.getPrototypeOf(this).constructor._type}},{key:"propertiesToUpdate",get:function(){return[]}},{key:"_isDraggable",get:function(){return _classPrivateFieldGet(this,_)},set:function(e){var t;_classPrivateFieldSet(this,_,e),null===(t=this.div)||void 0===t||t.classList.toggle("draggable",e)}},{key:"center",value:function(){var e=_slicedToArray(this.pageDimensions,2),t=e[0],n=e[1];switch(this.parentRotation){case 90:this.x-=this.height*n/(2*t),this.y+=this.width*t/(2*n);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*n/(2*t),this.y-=this.width*t/(2*n);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}},{key:"addCommands",value:function(e){this._uiManager.addCommands(e)}},{key:"currentLayer",get:function(){return this._uiManager.currentLayer}},{key:"setInBackground",value:function(){this.div.style.zIndex=0}},{key:"setInForeground",value:function(){this.div.style.zIndex=_classPrivateFieldGet(this,b)}},{key:"setParent",value:function(e){null!==e&&(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}},{key:"focusin",value:function(e){this._focusEventsAllowed&&(_classPrivateFieldGet(this,m)?_classPrivateFieldSet(this,m,!1):this.parent.setSelected(this))}},{key:"focusout",value:function(e){var t;if(this._focusEventsAllowed&&this.isAttachedToDOM){var n=e.relatedTarget;null!==n&&void 0!==n&&n.closest("#".concat(this.id))||(e.preventDefault(),null!==(t=this.parent)&&void 0!==t&&t.isMultipleSelection||this.commitOrRemove())}}},{key:"commitOrRemove",value:function(){this.isEmpty()?this.remove():this.commit()}},{key:"commit",value:function(){this.addToAnnotationStorage()}},{key:"addToAnnotationStorage",value:function(){this._uiManager.addToAnnotationStorage(this)}},{key:"setAt",value:function(e,t,n,r){var a=_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1],s=this.screenToPageTranslation(n,r),l=_slicedToArray(s,2);n=l[0],r=l[1],this.x=(e+n)/i,this.y=(t+r)/o,this.fixAndSetPosition()}},{key:"translate",value:function(e,t){_classPrivateMethodGet(this,k,M).call(this,this.parentDimensions,e,t)}},{key:"translateInPage",value:function(e,t){_classPrivateMethodGet(this,k,M).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}},{key:"drag",value:function(e,t){var n=_slicedToArray(this.parentDimensions,2),r=n[0],a=n[1];if(this.x+=e/r,this.y+=t/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){var i=this.div.getBoundingClientRect(),o=i.x,s=i.y;this.parent.findNewParent(this,o,s)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}var l=this.x,c=this.y,u=_classPrivateMethodGet(this,w,T).call(this),d=_slicedToArray(u,2);l+=d[0],c+=d[1],this.div.style.left="".concat((100*l).toFixed(2),"%"),this.div.style.top="".concat((100*c).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}},{key:"fixAndSetPosition",value:function(){var e=_slicedToArray(this.pageDimensions,2),t=e[0],n=e[1],r=this.x,a=this.y,i=this.width,o=this.height;switch(i*=t,o*=n,r*=t,a*=n,this.rotation){case 0:r=Math.max(0,Math.min(t-i,r)),a=Math.max(0,Math.min(n-o,a));break;case 90:r=Math.max(0,Math.min(t-o,r)),a=Math.min(n,Math.max(i,a));break;case 180:r=Math.min(t,Math.max(i,r)),a=Math.min(n,Math.max(o,a));break;case 270:r=Math.min(t,Math.max(o,r)),a=Math.max(0,Math.min(n-i,a))}this.x=r/=t,this.y=a/=n;var s=_classPrivateMethodGet(this,w,T).call(this),l=_slicedToArray(s,2);r+=l[0],a+=l[1];var c=this.div.style;c.left="".concat((100*r).toFixed(2),"%"),c.top="".concat((100*a).toFixed(2),"%"),this.moveInDOM()}},{key:"screenToPageTranslation",value:function(t,n){return _classStaticPrivateMethodGet(e,e,I).call(e,t,n,this.parentRotation)}},{key:"pageTranslationToScreen",value:function(t,n){return _classStaticPrivateMethodGet(e,e,I).call(e,t,n,360-this.parentRotation)}},{key:"parentScale",get:function(){return this._uiManager.viewParameters.realScale}},{key:"parentRotation",get:function(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}},{key:"parentDimensions",get:function(){var e=this.parentScale,t=_slicedToArray(this.pageDimensions,2),n=t[0]*e,r=t[1]*e;return i.FeatureTest.isCSSRoundSupported?[Math.round(n),Math.round(r)]:[n,r]}},{key:"setDims",value:function(t,n){var r,a=_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1];this.div.style.width="".concat((100*t/i).toFixed(2),"%"),_classPrivateFieldGet(this,f)||(this.div.style.height="".concat((100*n/o).toFixed(2),"%")),null===(r=_classPrivateFieldGet(this,c))||void 0===r||r.classList.toggle("small",t1&&void 0!==arguments[1]?arguments[1]:null;if(e._l10nPromise||(e._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map((function(e){return[e,t.get(e)]})))),null!==n&&void 0!==n&&n.strings){var r,a=_createForOfIteratorHelper(n.strings);try{for(a.s();!(r=a.n()).done;){var i=r.value;e._l10nPromise.set(i,t.get(i))}}catch(s){a.e(s)}finally{a.f()}}if(-1===e._borderLineWidth){var o=getComputedStyle(document.documentElement);e._borderLineWidth=parseFloat(o.getPropertyValue("--outline-width"))||0}}},{key:"updateDefaultParams",value:function(e,t){}},{key:"defaultPropertiesToUpdate",get:function(){return[]}},{key:"isHandlingMimeForPasting",value:function(e){return!1}},{key:"paste",value:function(e,t){(0,i.unreachable)("Not implemented")}},{key:"deserialize",value:function(e,t,n){var r=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n});r.rotation=e.rotation;var a=_slicedToArray(r.pageDimensions,2),i=a[0],o=a[1],s=r.getRectInCurrentCoords(e.rect,o),l=_slicedToArray(s,4),c=l[0],u=l[1],d=l[2],f=l[3];return r.x=c/i,r.y=u/o,r.width=d/i,r.height=f/o,r}},{key:"MIN_SIZE",get:function(){return 16}}]),e}();function M(e,t,n){var r=_slicedToArray(e,2),a=r[0],i=r[1],o=this.screenToPageTranslation(t,n),s=_slicedToArray(o,2);t=s[0],n=s[1],this.x+=t/a,this.y+=n/i,this.fixAndSetPosition()}function T(){var e=_slicedToArray(this.parentDimensions,2),t=e[0],n=e[1],a=r._borderLineWidth,i=a/t,o=a/n;switch(this.rotation){case 90:return[-i,o];case 180:return[i,o];case 270:return[i,-o];default:return[-i,-o]}}function I(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}function R(e){switch(e){case 90:var t=_slicedToArray(this.pageDimensions,2),n=t[0],r=t[1];return[0,-n/r,r/n,0];case 180:return[-1,0,0,-1];case 270:var a=_slicedToArray(this.pageDimensions,2),i=a[0],o=a[1];return[0,i/o,-o/i,0];default:return[1,0,0,1]}}function O(){if(!_classPrivateFieldGet(this,h)){_classPrivateFieldSet(this,h,document.createElement("div")),_classPrivateFieldGet(this,h).classList.add("resizers");var e=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||e.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(var t=0,n=e;t0&&void 0!==arguments[0]?arguments[0]:128;_classCallCheck(this,e),_classPrivateFieldInitSpec(this,v,{writable:!0,value:[]}),_classPrivateFieldInitSpec(this,m,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,g,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,y,{writable:!0,value:-1}),_classPrivateFieldSet(this,g,t)}return _createClass(e,[{key:"add",value:function(e){var t=e.cmd,n=e.undo,r=e.mustExec,a=e.type,i=void 0===a?NaN:a,o=e.overwriteIfSameType,s=void 0!==o&&o,l=e.keepUndo,c=void 0!==l&&l;if(r&&t(),!_classPrivateFieldGet(this,m)){var u={cmd:t,undo:n,type:i};if(-1===_classPrivateFieldGet(this,y))return _classPrivateFieldGet(this,v).length>0&&(_classPrivateFieldGet(this,v).length=0),_classPrivateFieldSet(this,y,0),void _classPrivateFieldGet(this,v).push(u);if(s&&_classPrivateFieldGet(this,v)[_classPrivateFieldGet(this,y)].type===i)return c&&(u.undo=_classPrivateFieldGet(this,v)[_classPrivateFieldGet(this,y)].undo),void(_classPrivateFieldGet(this,v)[_classPrivateFieldGet(this,y)]=u);var d=_classPrivateFieldGet(this,y)+1;d===_classPrivateFieldGet(this,g)?_classPrivateFieldGet(this,v).splice(0,1):(_classPrivateFieldSet(this,y,d),d<_classPrivateFieldGet(this,v).length&&_classPrivateFieldGet(this,v).splice(d)),_classPrivateFieldGet(this,v).push(u)}}},{key:"undo",value:function(){-1!==_classPrivateFieldGet(this,y)&&(_classPrivateFieldSet(this,m,!0),_classPrivateFieldGet(this,v)[_classPrivateFieldGet(this,y)].undo(),_classPrivateFieldSet(this,m,!1),_classPrivateFieldSet(this,y,_classPrivateFieldGet(this,y)-1))}},{key:"redo",value:function(){_classPrivateFieldGet(this,y)<_classPrivateFieldGet(this,v).length-1&&(_classPrivateFieldSet(this,y,_classPrivateFieldGet(this,y)+1),_classPrivateFieldSet(this,m,!0),_classPrivateFieldGet(this,v)[_classPrivateFieldGet(this,y)].cmd(),_classPrivateFieldSet(this,m,!1))}},{key:"hasSomethingToUndo",value:function(){return-1!==_classPrivateFieldGet(this,y)}},{key:"hasSomethingToRedo",value:function(){return _classPrivateFieldGet(this,y)<_classPrivateFieldGet(this,v).length-1}},{key:"destroy",value:function(){_classPrivateFieldSet(this,v,null)}}]),e}();t.CommandManager=_;var b=new WeakSet,k=function(){function e(t){_classCallCheck(this,e),_classPrivateMethodInitSpec(this,b),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;var n,r=a.FeatureTest.platform.isMac,i=_createForOfIteratorHelper(t);try{for(i.s();!(n=i.n()).done;){var o,s=_slicedToArray(n.value,3),l=s[0],c=s[1],u=s[2],d=void 0===u?{}:u,f=_createForOfIteratorHelper(l);try{for(f.s();!(o=f.n()).done;){var h=o.value,p=h.startsWith("mac+");r&&p?(this.callbacks.set(h.slice(4),{callback:c,options:d}),this.allKeys.add(h.split("+").at(-1))):r||p||(this.callbacks.set(h,{callback:c,options:d}),this.allKeys.add(h.split("+").at(-1)))}}catch(v){f.e(v)}finally{f.f()}}}catch(v){i.e(v)}finally{i.f()}}return _createClass(e,[{key:"exec",value:function(e,t){if(this.allKeys.has(t.key)){var n=this.callbacks.get(_classPrivateMethodGet(this,b,w).call(this,t));if(n){var r=n.callback,a=n.options,i=a.bubbles,o=void 0!==i&&i,s=a.args,l=void 0===s?[]:s,c=a.checker,u=void 0===c?null:c;u&&!u(e,t)||(r.bind.apply(r,[e].concat(_toConsumableArray(l)))(),o||(t.stopPropagation(),t.preventDefault()))}}}}]),e}();function w(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);var t=this.buffer.join("+");return this.buffer.length=0,t}t.KeyboardManager=k;var S=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"_colors",get:function(){var e=new Map([["CanvasText",null],["Canvas",null]]);return(0,i.getColorValues)(e),(0,a.shadow)(this,"_colors",e)}},{key:"convert",value:function(t){var n=(0,i.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return n;var r,a=_createForOfIteratorHelper(this._colors);try{for(a.s();!(r=a.n()).done;){var o=_slicedToArray(r.value,2),s=o[0];if(o[1].every((function(e,t){return e===n[t]})))return e._colorsMapping.get(s)}}catch(l){a.e(l)}finally{a.f()}return n}},{key:"getHexCode",value:function(e){var t,n=this._colors.get(e);return n?(t=a.Util).makeHexColor.apply(t,_toConsumableArray(n)):e}}]),e}();_defineProperty(S,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]])),t.ColorManager=S;var x=new WeakMap,P=new WeakMap,A=new WeakMap,C=new WeakMap,F=new WeakMap,E=new WeakMap,M=new WeakMap,T=new WeakMap,I=new WeakMap,R=new WeakMap,O=new WeakMap,L=new WeakMap,D=new WeakMap,N=new WeakMap,G=new WeakMap,j=new WeakMap,Z=new WeakMap,z=new WeakMap,W=new WeakMap,B=new WeakMap,U=new WeakMap,H=new WeakMap,q=new WeakMap,V=new WeakMap,K=new WeakMap,X=new WeakMap,Y=new WeakMap,$=new WeakMap,Q=new WeakMap,J=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,ae=new WeakSet,ie=new WeakSet,oe=new WeakSet,se=new WeakSet,le=new WeakSet,ce=new WeakSet,ue=new WeakSet,de=new WeakSet,fe=new WeakSet,he=new WeakSet,pe=new WeakSet,ve=new WeakSet,me=new WeakSet,ge=function(){function e(t,n,r,o,l,c){_classCallCheck(this,e),_classPrivateMethodInitSpec(this,me),_classPrivateMethodInitSpec(this,ve),_classPrivateMethodInitSpec(this,pe),_classPrivateMethodInitSpec(this,he),_classPrivateMethodInitSpec(this,fe),_classPrivateMethodInitSpec(this,de),_classPrivateMethodInitSpec(this,ue),_classPrivateMethodInitSpec(this,ce),_classPrivateMethodInitSpec(this,le),_classPrivateMethodInitSpec(this,se),_classPrivateMethodInitSpec(this,oe),_classPrivateMethodInitSpec(this,ie),_classPrivateMethodInitSpec(this,ae),_classPrivateFieldInitSpec(this,x,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,P,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,A,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,C,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,F,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,E,{writable:!0,value:new _}),_classPrivateFieldInitSpec(this,M,{writable:!0,value:0}),_classPrivateFieldInitSpec(this,T,{writable:!0,value:new Set}),_classPrivateFieldInitSpec(this,I,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,R,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,O,{writable:!0,value:new Set}),_classPrivateFieldInitSpec(this,L,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,D,{writable:!0,value:new s}),_classPrivateFieldInitSpec(this,N,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,G,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,j,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,Z,{writable:!0,value:a.AnnotationEditorType.NONE}),_classPrivateFieldInitSpec(this,z,{writable:!0,value:new Set}),_classPrivateFieldInitSpec(this,W,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,B,{writable:!0,value:this.blur.bind(this)}),_classPrivateFieldInitSpec(this,U,{writable:!0,value:this.focus.bind(this)}),_classPrivateFieldInitSpec(this,H,{writable:!0,value:this.copy.bind(this)}),_classPrivateFieldInitSpec(this,q,{writable:!0,value:this.cut.bind(this)}),_classPrivateFieldInitSpec(this,V,{writable:!0,value:this.paste.bind(this)}),_classPrivateFieldInitSpec(this,K,{writable:!0,value:this.keydown.bind(this)}),_classPrivateFieldInitSpec(this,X,{writable:!0,value:this.onEditingAction.bind(this)}),_classPrivateFieldInitSpec(this,Y,{writable:!0,value:this.onPageChanging.bind(this)}),_classPrivateFieldInitSpec(this,$,{writable:!0,value:this.onScaleChanging.bind(this)}),_classPrivateFieldInitSpec(this,Q,{writable:!0,value:this.onRotationChanging.bind(this)}),_classPrivateFieldInitSpec(this,J,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}}),_classPrivateFieldInitSpec(this,ee,{writable:!0,value:[0,0]}),_classPrivateFieldInitSpec(this,te,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,ne,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,re,{writable:!0,value:null}),_classPrivateFieldSet(this,ne,t),_classPrivateFieldSet(this,re,n),_classPrivateFieldSet(this,C,r),this._eventBus=o,this._eventBus._on("editingaction",_classPrivateFieldGet(this,X)),this._eventBus._on("pagechanging",_classPrivateFieldGet(this,Y)),this._eventBus._on("scalechanging",_classPrivateFieldGet(this,$)),this._eventBus._on("rotationchanging",_classPrivateFieldGet(this,Q)),_classPrivateFieldSet(this,F,l.annotationStorage),_classPrivateFieldSet(this,L,l.filterFactory),_classPrivateFieldSet(this,W,c),this.viewParameters={realScale:i.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}return _createClass(e,[{key:"destroy",value:function(){_classPrivateMethodGet(this,se,ke).call(this),_classPrivateMethodGet(this,ie,_e).call(this),this._eventBus._off("editingaction",_classPrivateFieldGet(this,X)),this._eventBus._off("pagechanging",_classPrivateFieldGet(this,Y)),this._eventBus._off("scalechanging",_classPrivateFieldGet(this,$)),this._eventBus._off("rotationchanging",_classPrivateFieldGet(this,Q));var e,t=_createForOfIteratorHelper(_classPrivateFieldGet(this,A).values());try{for(t.s();!(e=t.n()).done;)e.value.destroy()}catch(n){t.e(n)}finally{t.f()}_classPrivateFieldGet(this,A).clear(),_classPrivateFieldGet(this,P).clear(),_classPrivateFieldGet(this,O).clear(),_classPrivateFieldSet(this,x,null),_classPrivateFieldGet(this,z).clear(),_classPrivateFieldGet(this,E).destroy(),_classPrivateFieldGet(this,C).destroy()}},{key:"hcmFilter",get:function(){return(0,a.shadow)(this,"hcmFilter",_classPrivateFieldGet(this,W)?_classPrivateFieldGet(this,L).addHCMFilter(_classPrivateFieldGet(this,W).foreground,_classPrivateFieldGet(this,W).background):"none")}},{key:"direction",get:function(){return(0,a.shadow)(this,"direction",getComputedStyle(_classPrivateFieldGet(this,ne)).direction)}},{key:"editAltText",value:function(e){var t;null===(t=_classPrivateFieldGet(this,C))||void 0===t||t.editAltText(this,e)}},{key:"onPageChanging",value:function(e){var t=e.pageNumber;_classPrivateFieldSet(this,M,t-1)}},{key:"focusMainContainer",value:function(){_classPrivateFieldGet(this,ne).focus()}},{key:"findParent",value:function(e,t){var n,r=_createForOfIteratorHelper(_classPrivateFieldGet(this,A).values());try{for(r.s();!(n=r.n()).done;){var a=n.value,i=a.div.getBoundingClientRect(),o=i.x,s=i.y,l=i.width,c=i.height;if(e>=o&&e<=o+l&&t>=s&&t<=s+c)return a}}catch(u){r.e(u)}finally{r.f()}return null}},{key:"disableUserSelect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classPrivateFieldGet(this,re).classList.toggle("noUserSelect",e)}},{key:"addShouldRescale",value:function(e){_classPrivateFieldGet(this,O).add(e)}},{key:"removeShouldRescale",value:function(e){_classPrivateFieldGet(this,O).delete(e)}},{key:"onScaleChanging",value:function(e){var t=e.scale;this.commitOrRemove(),this.viewParameters.realScale=t*i.PixelsPerInch.PDF_TO_CSS_UNITS;var n,r=_createForOfIteratorHelper(_classPrivateFieldGet(this,O));try{for(r.s();!(n=r.n()).done;)n.value.onScaleChanging()}catch(a){r.e(a)}finally{r.f()}}},{key:"onRotationChanging",value:function(e){var t=e.pagesRotation;this.commitOrRemove(),this.viewParameters.rotation=t}},{key:"addToAnnotationStorage",value:function(e){e.isEmpty()||!_classPrivateFieldGet(this,F)||_classPrivateFieldGet(this,F).has(e.id)||_classPrivateFieldGet(this,F).setValue(e.id,e)}},{key:"blur",value:function(){if(this.hasSelection){var e,t=document.activeElement,n=_createForOfIteratorHelper(_classPrivateFieldGet(this,z));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.div.contains(t)){_classPrivateFieldSet(this,j,[r,t]),r._focusEventsAllowed=!1;break}}}catch(a){n.e(a)}finally{n.f()}}}},{key:"focus",value:function(){if(_classPrivateFieldGet(this,j)){var e=_classPrivateFieldGet(this,j),t=_slicedToArray(e,2),n=t[0],r=t[1];_classPrivateFieldSet(this,j,null),r.addEventListener("focusin",(function(){n._focusEventsAllowed=!0}),{once:!0}),r.focus()}}},{key:"addEditListeners",value:function(){_classPrivateMethodGet(this,oe,be).call(this),_classPrivateMethodGet(this,le,we).call(this)}},{key:"removeEditListeners",value:function(){_classPrivateMethodGet(this,se,ke).call(this),_classPrivateMethodGet(this,ce,Se).call(this)}},{key:"copy",value:function(e){var t;if(e.preventDefault(),null===(t=_classPrivateFieldGet(this,x))||void 0===t||t.commitOrRemove(),this.hasSelection){var n,r=[],a=_createForOfIteratorHelper(_classPrivateFieldGet(this,z));try{for(a.s();!(n=a.n()).done;){var i=n.value.serialize(!0);i&&r.push(i)}}catch(o){a.e(o)}finally{a.f()}0!==r.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(r))}}},{key:"cut",value:function(e){this.copy(e),this.delete()}},{key:"paste",value:function(e){var t=this;e.preventDefault();var n,r=e.clipboardData,i=_createForOfIteratorHelper(r.items);try{for(i.s();!(n=i.n()).done;){var o,s=n.value,l=_createForOfIteratorHelper(_classPrivateFieldGet(this,R));try{for(l.s();!(o=l.n()).done;){var c=o.value;if(c.isHandlingMimeForPasting(s.type))return void c.paste(s,this.currentLayer)}}catch(g){l.e(g)}finally{l.f()}}}catch(g){i.e(g)}finally{i.f()}var u=r.getData("application/pdfjs");if(u){try{u=JSON.parse(u)}catch(y){return void(0,a.warn)('paste: "'.concat(y.message,'".'))}if(Array.isArray(u)){this.unselectAll();var d=this.currentLayer;try{var f,h=[],p=_createForOfIteratorHelper(u);try{for(p.s();!(f=p.n()).done;){var v=f.value,m=d.deserialize(v);if(!m)return;h.push(m)}}catch(g){p.e(g)}finally{p.f()}this.addCommands({cmd:function(){for(var e=0,n=h;e1&&void 0!==arguments[1]?arguments[1]:null;if(_classPrivateFieldGet(this,Z)!==e){if(_classPrivateFieldSet(this,Z,e),e===a.AnnotationEditorType.NONE)return this.setEditingState(!1),void _classPrivateMethodGet(this,he,Ce).call(this);this.setEditingState(!0),_classPrivateMethodGet(this,fe,Ae).call(this),this.unselectAll();var n,r=_createForOfIteratorHelper(_classPrivateFieldGet(this,A).values());try{for(r.s();!(n=r.n()).done;)n.value.updateMode(e)}catch(l){r.e(l)}finally{r.f()}if(t){var i,o=_createForOfIteratorHelper(_classPrivateFieldGet(this,P).values());try{for(o.s();!(i=o.n()).done;){var s=i.value;if(s.annotationElementId===t){this.setSelected(s),s.enterInEditMode();break}}}catch(l){o.e(l)}finally{o.f()}}}}},{key:"updateToolbar",value:function(e){e!==_classPrivateFieldGet(this,Z)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}},{key:"updateParams",value:function(e,t){if(_classPrivateFieldGet(this,R))if(e!==a.AnnotationEditorParamsType.CREATE){var n,r=_createForOfIteratorHelper(_classPrivateFieldGet(this,z));try{for(r.s();!(n=r.n()).done;)n.value.updateParams(e,t)}catch(s){r.e(s)}finally{r.f()}var i,o=_createForOfIteratorHelper(_classPrivateFieldGet(this,R));try{for(o.s();!(i=o.n()).done;)i.value.updateDefaultParams(e,t)}catch(s){o.e(s)}finally{o.f()}}else this.currentLayer.addNewEditor(e)}},{key:"enableWaiting",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(_classPrivateFieldGet(this,G)!==e){_classPrivateFieldSet(this,G,e);var t,n=_createForOfIteratorHelper(_classPrivateFieldGet(this,A).values());try{for(n.s();!(t=n.n()).done;){var r=t.value;e?r.disableClick():r.enableClick(),r.div.classList.toggle("waiting",e)}}catch(a){n.e(a)}finally{n.f()}}}},{key:"getEditors",value:function(e){var t,n=[],r=_createForOfIteratorHelper(_classPrivateFieldGet(this,P).values());try{for(r.s();!(t=r.n()).done;){var a=t.value;a.pageIndex===e&&n.push(a)}}catch(i){r.e(i)}finally{r.f()}return n}},{key:"getEditor",value:function(e){return _classPrivateFieldGet(this,P).get(e)}},{key:"addEditor",value:function(e){_classPrivateFieldGet(this,P).set(e.id,e)}},{key:"removeEditor",value:function(e){var t;_classPrivateFieldGet(this,P).delete(e.id),this.unselect(e),e.annotationElementId&&_classPrivateFieldGet(this,T).has(e.annotationElementId)||null===(t=_classPrivateFieldGet(this,F))||void 0===t||t.remove(e.id)}},{key:"addDeletedAnnotationElement",value:function(e){_classPrivateFieldGet(this,T).add(e.annotationElementId),e.deleted=!0}},{key:"isDeletedAnnotationElement",value:function(e){return _classPrivateFieldGet(this,T).has(e)}},{key:"removeDeletedAnnotationElement",value:function(e){_classPrivateFieldGet(this,T).delete(e.annotationElementId),e.deleted=!1}},{key:"setActiveEditor",value:function(e){_classPrivateFieldGet(this,x)!==e&&(_classPrivateFieldSet(this,x,e),e&&_classPrivateMethodGet(this,de,Pe).call(this,e.propertiesToUpdate))}},{key:"toggleSelected",value:function(e){if(_classPrivateFieldGet(this,z).has(e))return _classPrivateFieldGet(this,z).delete(e),e.unselect(),void _classPrivateMethodGet(this,ue,xe).call(this,{hasSelectedEditor:this.hasSelection});_classPrivateFieldGet(this,z).add(e),e.select(),_classPrivateMethodGet(this,de,Pe).call(this,e.propertiesToUpdate),_classPrivateMethodGet(this,ue,xe).call(this,{hasSelectedEditor:!0})}},{key:"setSelected",value:function(e){var t,n=_createForOfIteratorHelper(_classPrivateFieldGet(this,z));try{for(n.s();!(t=n.n()).done;){var r=t.value;r!==e&&r.unselect()}}catch(a){n.e(a)}finally{n.f()}_classPrivateFieldGet(this,z).clear(),_classPrivateFieldGet(this,z).add(e),e.select(),_classPrivateMethodGet(this,de,Pe).call(this,e.propertiesToUpdate),_classPrivateMethodGet(this,ue,xe).call(this,{hasSelectedEditor:!0})}},{key:"isSelected",value:function(e){return _classPrivateFieldGet(this,z).has(e)}},{key:"unselect",value:function(e){e.unselect(),_classPrivateFieldGet(this,z).delete(e),_classPrivateMethodGet(this,ue,xe).call(this,{hasSelectedEditor:this.hasSelection})}},{key:"hasSelection",get:function(){return 0!==_classPrivateFieldGet(this,z).size}},{key:"undo",value:function(){_classPrivateFieldGet(this,E).undo(),_classPrivateMethodGet(this,ue,xe).call(this,{hasSomethingToUndo:_classPrivateFieldGet(this,E).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:_classPrivateMethodGet(this,ve,Ee).call(this)})}},{key:"redo",value:function(){_classPrivateFieldGet(this,E).redo(),_classPrivateMethodGet(this,ue,xe).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:_classPrivateFieldGet(this,E).hasSomethingToRedo(),isEmpty:_classPrivateMethodGet(this,ve,Ee).call(this)})}},{key:"addCommands",value:function(e){_classPrivateFieldGet(this,E).add(e),_classPrivateMethodGet(this,ue,xe).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:_classPrivateMethodGet(this,ve,Ee).call(this)})}},{key:"delete",value:function(){var e=this;if(this.commitOrRemove(),this.hasSelection){var t=_toConsumableArray(_classPrivateFieldGet(this,z));this.addCommands({cmd:function(){var e,n=_createForOfIteratorHelper(t);try{for(n.s();!(e=n.n()).done;)e.value.remove()}catch(r){n.e(r)}finally{n.f()}},undo:function(){var n,r=_createForOfIteratorHelper(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;_classPrivateMethodGet(e,pe,Fe).call(e,a)}}catch(i){r.e(i)}finally{r.f()}},mustExec:!0})}}},{key:"commitOrRemove",value:function(){var e;null===(e=_classPrivateFieldGet(this,x))||void 0===e||e.commitOrRemove()}},{key:"hasSomethingToControl",value:function(){return _classPrivateFieldGet(this,x)||this.hasSelection}},{key:"selectAll",value:function(){var e,t=_createForOfIteratorHelper(_classPrivateFieldGet(this,z));try{for(t.s();!(e=t.n()).done;)e.value.commit()}catch(n){t.e(n)}finally{t.f()}_classPrivateMethodGet(this,me,Me).call(this,_classPrivateFieldGet(this,P).values())}},{key:"unselectAll",value:function(){if(_classPrivateFieldGet(this,x))_classPrivateFieldGet(this,x).commitOrRemove();else if(this.hasSelection){var e,t=_createForOfIteratorHelper(_classPrivateFieldGet(this,z));try{for(t.s();!(e=t.n()).done;)e.value.unselect()}catch(n){t.e(n)}finally{t.f()}_classPrivateFieldGet(this,z).clear(),_classPrivateMethodGet(this,ue,xe).call(this,{hasSelectedEditor:!1})}}},{key:"translateSelectedEditors",value:function(e,t){var n=this;if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),this.hasSelection){_classPrivateFieldGet(this,ee)[0]+=e,_classPrivateFieldGet(this,ee)[1]+=t;var r=_classPrivateFieldGet(this,ee),a=_slicedToArray(r,2),i=a[0],o=a[1],s=_toConsumableArray(_classPrivateFieldGet(this,z));_classPrivateFieldGet(this,te)&&clearTimeout(_classPrivateFieldGet(this,te)),_classPrivateFieldSet(this,te,setTimeout((function(){_classPrivateFieldSet(n,te,null),_classPrivateFieldGet(n,ee)[0]=_classPrivateFieldGet(n,ee)[1]=0,n.addCommands({cmd:function(){var e,t=_createForOfIteratorHelper(s);try{for(t.s();!(e=t.n()).done;){var r=e.value;_classPrivateFieldGet(n,P).has(r.id)&&r.translateInPage(i,o)}}catch(a){t.e(a)}finally{t.f()}},undo:function(){var e,t=_createForOfIteratorHelper(s);try{for(t.s();!(e=t.n()).done;){var r=e.value;_classPrivateFieldGet(n,P).has(r.id)&&r.translateInPage(-i,-o)}}catch(a){t.e(a)}finally{t.f()}},mustExec:!1})}),1e3));var l,c=_createForOfIteratorHelper(s);try{for(c.s();!(l=c.n()).done;)l.value.translateInPage(e,t)}catch(u){c.e(u)}finally{c.f()}}}},{key:"setUpDragSession",value:function(){if(this.hasSelection){this.disableUserSelect(!0),_classPrivateFieldSet(this,I,new Map);var e,t=_createForOfIteratorHelper(_classPrivateFieldGet(this,z));try{for(t.s();!(e=t.n()).done;){var n=e.value;_classPrivateFieldGet(this,I).set(n,{savedX:n.x,savedY:n.y,savedPageIndex:n.pageIndex,newX:0,newY:0,newPageIndex:-1})}}catch(r){t.e(r)}finally{t.f()}}}},{key:"endDragSession",value:function(){var e=this;if(!_classPrivateFieldGet(this,I))return!1;this.disableUserSelect(!1);var t=_classPrivateFieldGet(this,I);_classPrivateFieldSet(this,I,null);var n,r=!1,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var i=_slicedToArray(n.value,2),o=i[0],s=o.x,l=o.y,c=o.pageIndex,u=i[1];u.newX=s,u.newY=l,u.newPageIndex=c,r||(r=s!==u.savedX||l!==u.savedY||c!==u.savedPageIndex)}}catch(f){a.e(f)}finally{a.f()}if(!r)return!1;var d=function(t,n,r,a){if(_classPrivateFieldGet(e,P).has(t.id)){var i=_classPrivateFieldGet(e,A).get(a);i?t._setParentAndPosition(i,n,r):(t.pageIndex=a,t.x=n,t.y=r)}};return this.addCommands({cmd:function(){var e,n=_createForOfIteratorHelper(t);try{for(n.s();!(e=n.n()).done;){var r=_slicedToArray(e.value,2),a=r[0],i=r[1],o=i.newX,s=i.newY,l=i.newPageIndex;d(a,o,s,l)}}catch(f){n.e(f)}finally{n.f()}},undo:function(){var e,n=_createForOfIteratorHelper(t);try{for(n.s();!(e=n.n()).done;){var r=_slicedToArray(e.value,2),a=r[0],i=r[1],o=i.savedX,s=i.savedY,l=i.savedPageIndex;d(a,o,s,l)}}catch(f){n.e(f)}finally{n.f()}},mustExec:!0}),!0}},{key:"dragSelectedEditors",value:function(e,t){if(_classPrivateFieldGet(this,I)){var n,r=_createForOfIteratorHelper(_classPrivateFieldGet(this,I).keys());try{for(r.s();!(n=r.n()).done;)n.value.drag(e,t)}catch(a){r.e(a)}finally{r.f()}}}},{key:"rebuild",value:function(e){if(null===e.parent){var t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}},{key:"isActive",value:function(e){return _classPrivateFieldGet(this,x)===e}},{key:"getActive",value:function(){return _classPrivateFieldGet(this,x)}},{key:"getMode",value:function(){return _classPrivateFieldGet(this,Z)}},{key:"imageManager",get:function(){return(0,a.shadow)(this,"imageManager",new f)}}],[{key:"_keyboardManager",get:function(){var t=e.prototype,n=function(e){var t=document.activeElement;return t&&_classPrivateFieldGet(e,ne).contains(t)&&e.hasSomethingToControl()},r=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return(0,a.shadow)(this,"_keyboardManager",new k([[["ctrl+a","mac+meta+a"],t.selectAll],[["ctrl+z","mac+meta+z"],t.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:n}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:n}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:n}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:n}]]))}}]),e}();function ye(){window.addEventListener("focus",_classPrivateFieldGet(this,U)),window.addEventListener("blur",_classPrivateFieldGet(this,B))}function _e(){window.removeEventListener("focus",_classPrivateFieldGet(this,U)),window.removeEventListener("blur",_classPrivateFieldGet(this,B))}function be(){window.addEventListener("keydown",_classPrivateFieldGet(this,K),{capture:!0})}function ke(){window.removeEventListener("keydown",_classPrivateFieldGet(this,K),{capture:!0})}function we(){document.addEventListener("copy",_classPrivateFieldGet(this,H)),document.addEventListener("cut",_classPrivateFieldGet(this,q)),document.addEventListener("paste",_classPrivateFieldGet(this,V))}function Se(){document.removeEventListener("copy",_classPrivateFieldGet(this,H)),document.removeEventListener("cut",_classPrivateFieldGet(this,q)),document.removeEventListener("paste",_classPrivateFieldGet(this,V))}function xe(e){var t=this;Object.entries(e).some((function(e){var n=_slicedToArray(e,2),r=n[0],a=n[1];return _classPrivateFieldGet(t,J)[r]!==a}))&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(_classPrivateFieldGet(this,J),e)})}function Pe(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}function Ae(){if(!_classPrivateFieldGet(this,N)){_classPrivateFieldSet(this,N,!0);var e,t=_createForOfIteratorHelper(_classPrivateFieldGet(this,A).values());try{for(t.s();!(e=t.n()).done;)e.value.enable()}catch(n){t.e(n)}finally{t.f()}}}function Ce(){if(this.unselectAll(),_classPrivateFieldGet(this,N)){_classPrivateFieldSet(this,N,!1);var e,t=_createForOfIteratorHelper(_classPrivateFieldGet(this,A).values());try{for(t.s();!(e=t.n()).done;)e.value.disable()}catch(n){t.e(n)}finally{t.f()}}}function Fe(e){var t=_classPrivateFieldGet(this,A).get(e.pageIndex);t?t.addOrRebuild(e):this.addEditor(e)}function Ee(){if(0===_classPrivateFieldGet(this,P).size)return!0;if(1===_classPrivateFieldGet(this,P).size){var e,t=_createForOfIteratorHelper(_classPrivateFieldGet(this,P).values());try{for(t.s();!(e=t.n()).done;)return e.value.isEmpty()}catch(n){t.e(n)}finally{t.f()}}return!1}function Me(e){_classPrivateFieldGet(this,z).clear();var t,n=_createForOfIteratorHelper(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.isEmpty()||(_classPrivateFieldGet(this,z).add(r),r.select())}}catch(a){n.e(a)}finally{n.f()}_classPrivateMethodGet(this,ue,xe).call(this,{hasSelectedEditor:!0})}_defineProperty(ge,"TRANSLATE_SMALL",1),_defineProperty(ge,"TRANSLATE_BIG",10),t.AnnotationEditorUIManager=ge},function(e,t,n){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.StatTimer=t.RenderingCancelledException=t.PixelsPerInch=t.PageViewport=t.PDFDateString=t.DOMStandardFontDataFactory=t.DOMSVGFactory=t.DOMFilterFactory=t.DOMCanvasFactory=t.DOMCMapReaderFactory=void 0,t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.getColorValues=function(e){var t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);var n,r=_createForOfIteratorHelper(e.keys());try{for(r.s();!(n=r.n()).done;){var a=n.value;t.style.color=a;var i=window.getComputedStyle(t).color;e.set(a,V(i))}}catch(o){r.e(o)}finally{r.f()}t.remove()},t.getCurrentTransform=function(e){var t=e.getTransform(),n=t.a,r=t.b,a=t.c,i=t.d,o=t.e,s=t.f;return[n,r,a,i,o,s]},t.getCurrentTransformInverse=function(e){var t=e.getTransform().invertSelf(),n=t.a,r=t.b,a=t.c,i=t.d,o=t.e,s=t.f;return[n,r,a,i,o,s]},t.getFilenameFromUrl=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t){var n=e.split(/[#?]/,1);e=_slicedToArray(n,1)[0]}return e.substring(e.lastIndexOf("/")+1)},t.getPdfFilenameFromUrl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof e)return t;if(W(e))return(0,i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;var n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e),a=n.exec(r[1])||n.exec(r[2])||n.exec(r[3]);if(a&&(a=a[0]).includes("%"))try{a=n.exec(decodeURIComponent(a))[0]}catch(o){}return a||t},t.getRGB=V,t.getXfaPageViewport=function(e,t){var n=t.scale,r=void 0===n?1:n,a=t.rotation,i=void 0===a?0:a,o=e.attributes.style,s=o.width,l=o.height,c=[0,0,parseInt(s),parseInt(l)];return new Z({viewBox:c,scale:r,rotation:i})},t.isDataScheme=W,t.isPdfFile=function(e){return"string"===typeof e&&/\.pdf$/i.test(e)},t.isValidFetchUrl=H,t.loadScript=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(n,r){var a=document.createElement("script");a.src=e,a.onload=function(e){t&&a.remove(),n(e)},a.onerror=function(){r(new Error("Cannot load script at: ".concat(a.src)))},(document.head||document.documentElement).append(a)}))},t.noContextMenu=function(e){e.preventDefault()},t.setLayerDimensions=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(t instanceof Z){var a=t.rawDims,o=a.pageWidth,s=a.pageHeight,l=e.style,c=i.FeatureTest.isCSSRoundSupported,u="var(--scale-factor) * ".concat(o,"px"),d="var(--scale-factor) * ".concat(s,"px"),f=c?"round(".concat(u,", 1px)"):"calc(".concat(u,")"),h=c?"round(".concat(d,", 1px)"):"calc(".concat(d,")");n&&t.rotation%180!==0?(l.width=h,l.height=f):(l.width=f,l.height=h)}r&&e.setAttribute("data-main-rotation",t.rotation)};var a=n(7),i=n(1),o="http://www.w3.org/2000/svg",s=_createClass((function e(){_classCallCheck(this,e)}));r=s,_defineProperty(s,"CSS",96),_defineProperty(s,"PDF",72),_defineProperty(s,"PDF_TO_CSS_UNITS",r.CSS/r.PDF),t.PixelsPerInch=s;var l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,h=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,g=new WeakMap,y=new WeakMap,_=new WeakMap,b=new WeakMap,k=new WeakSet,w=new WeakSet,S=new WeakSet,x=new WeakSet,P=new WeakSet,A=function(e){_inherits(n,e);var t=_createSuper(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=r.docId,i=r.ownerDocument,o=void 0===i?globalThis.document:i;return _classCallCheck(this,n),e=t.call(this),_classPrivateMethodInitSpec(_assertThisInitialized(e),P),_classPrivateMethodInitSpec(_assertThisInitialized(e),x),_classPrivateMethodInitSpec(_assertThisInitialized(e),S),_classPrivateMethodInitSpec(_assertThisInitialized(e),w),_classPrivateMethodInitSpec(_assertThisInitialized(e),k),_classPrivateFieldInitSpec(_assertThisInitialized(e),b,{get:F,set:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),_,{get:C,set:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),l,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),c,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),u,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),d,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),f,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),h,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),p,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),v,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),m,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),g,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(e),y,{writable:!0,value:0}),_classPrivateFieldSet(_assertThisInitialized(e),u,a),_classPrivateFieldSet(_assertThisInitialized(e),d,o),e}return _createClass(n,[{key:"addFilter",value:function(e){var t,n;if(!e)return"none";var r,a,i,o,s=_classPrivateFieldGet(this,_).get(e);if(s)return s;if(1===e.length){for(var l=e[0],c=new Array(256),d=0;d<256;d++)c[d]=l[d]/255;o=r=a=i=c.join(",")}else{for(var f=_slicedToArray(e,3),h=f[0],p=f[1],v=f[2],m=new Array(256),g=new Array(256),b=new Array(256),k=0;k<256;k++)m[k]=h[k]/255,g[k]=p[k]/255,b[k]=v[k]/255;r=m.join(","),a=g.join(","),i=b.join(","),o="".concat(r).concat(a).concat(i)}if(s=_classPrivateFieldGet(this,_).get(o))return _classPrivateFieldGet(this,_).set(e,s),s;var S="g_".concat(_classPrivateFieldGet(this,u),"_transfer_map_").concat((_classPrivateFieldSet(this,y,(t=_classPrivateFieldGet(this,y),n=t++,t)),n)),P="url(#".concat(S,")");_classPrivateFieldGet(this,_).set(e,P),_classPrivateFieldGet(this,_).set(o,P);var A=_classPrivateMethodGet(this,w,M).call(this,S);return _classPrivateMethodGet(this,x,I).call(this,r,a,i,A),P}},{key:"addHCMFilter",value:function(e,t){var n,r,a,o="".concat(e,"-").concat(t);if(_classPrivateFieldGet(this,h)===o)return _classPrivateFieldGet(this,p);if(_classPrivateFieldSet(this,h,o),_classPrivateFieldSet(this,p,"none"),null===(n=_classPrivateFieldGet(this,f))||void 0===n||n.remove(),!e||!t)return _classPrivateFieldGet(this,p);var s=_classPrivateMethodGet(this,P,R).call(this,e);e=(r=i.Util).makeHexColor.apply(r,_toConsumableArray(s));var l=_classPrivateMethodGet(this,P,R).call(this,t);if(t=(a=i.Util).makeHexColor.apply(a,_toConsumableArray(l)),_classPrivateFieldGet(this,b).style.color="","#000000"===e&&"#ffffff"===t||e===t)return _classPrivateFieldGet(this,p);for(var c=new Array(256),d=0;d<=255;d++){var m=d/255;c[d]=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4)}var g=c.join(","),y="g_".concat(_classPrivateFieldGet(this,u),"_hcm_filter"),_=_classPrivateFieldSet(this,v,_classPrivateMethodGet(this,w,M).call(this,y));_classPrivateMethodGet(this,x,I).call(this,g,g,g,_),_classPrivateMethodGet(this,k,E).call(this,_);var S=function(e,t){for(var n=s[e]/255,r=l[e]/255,a=new Array(t+1),i=0;i<=t;i++)a[i]=n+i/t*(r-n);return a.join(",")};return _classPrivateMethodGet(this,x,I).call(this,S(0,5),S(1,5),S(2,5),_),_classPrivateFieldSet(this,p,"url(#".concat(y,")")),_classPrivateFieldGet(this,p)}},{key:"addHighlightHCMFilter",value:function(e,t,n,r){var a,i="".concat(e,"-").concat(t,"-").concat(n,"-").concat(r);if(_classPrivateFieldGet(this,m)===i)return _classPrivateFieldGet(this,g);if(_classPrivateFieldSet(this,m,i),_classPrivateFieldSet(this,g,"none"),null===(a=_classPrivateFieldGet(this,v))||void 0===a||a.remove(),!e||!t)return _classPrivateFieldGet(this,g);var o=[e,t].map(_classPrivateMethodGet(this,P,R).bind(this)),s=_slicedToArray(o,2),l=s[0],c=s[1],d=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),f=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),h=[n,r].map(_classPrivateMethodGet(this,P,R).bind(this)),p=_slicedToArray(h,2),y=p[0],_=p[1];if(f0&&void 0!==arguments[0]&&arguments[0]&&(_classPrivateFieldGet(this,p)||_classPrivateFieldGet(this,g))||(_classPrivateFieldGet(this,c)&&(_classPrivateFieldGet(this,c).parentNode.parentNode.remove(),_classPrivateFieldSet(this,c,null)),_classPrivateFieldGet(this,l)&&(_classPrivateFieldGet(this,l).clear(),_classPrivateFieldSet(this,l,null)),_classPrivateFieldSet(this,y,0))}}]),n}(a.BaseFilterFactory);function C(){return _classPrivateFieldGet(this,l)||_classPrivateFieldSet(this,l,new Map)}function F(){if(!_classPrivateFieldGet(this,c)){var e=_classPrivateFieldGet(this,d).createElement("div"),t=e.style;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;var n=_classPrivateFieldGet(this,d).createElementNS(o,"svg");n.setAttribute("width",0),n.setAttribute("height",0),_classPrivateFieldSet(this,c,_classPrivateFieldGet(this,d).createElementNS(o,"defs")),e.append(n),n.append(_classPrivateFieldGet(this,c)),_classPrivateFieldGet(this,d).body.append(e)}return _classPrivateFieldGet(this,c)}function E(e){var t=_classPrivateFieldGet(this,d).createElementNS(o,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(t)}function M(e){var t=_classPrivateFieldGet(this,d).createElementNS(o,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),_classPrivateFieldGet(this,b).append(t),t}function T(e,t,n){var r=_classPrivateFieldGet(this,d).createElementNS(o,t);r.setAttribute("type","discrete"),r.setAttribute("tableValues",n),e.append(r)}function I(e,t,n,r){var a=_classPrivateFieldGet(this,d).createElementNS(o,"feComponentTransfer");r.append(a),_classPrivateMethodGet(this,S,T).call(this,a,"feFuncR",e),_classPrivateMethodGet(this,S,T).call(this,a,"feFuncG",t),_classPrivateMethodGet(this,S,T).call(this,a,"feFuncB",n)}function R(e){return _classPrivateFieldGet(this,b).style.color=e,V(getComputedStyle(_classPrivateFieldGet(this,b)).getPropertyValue("color"))}t.DOMFilterFactory=A;var O=function(e){_inherits(n,e);var t=_createSuper(n);function n(){var e,r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ownerDocument,a=void 0===r?globalThis.document:r;return _classCallCheck(this,n),(e=t.call(this))._document=a,e}return _createClass(n,[{key:"_createCanvas",value:function(e,t){var n=this._document.createElement("canvas");return n.width=e,n.height=t,n}}]),n}(a.BaseCanvasFactory);function L(e){return D.apply(this,arguments)}function D(){return D=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var n,r,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]&&a[1],!H(t,document.baseURI)){e.next=21;break}return e.next=4,fetch(t);case 4:if((r=e.sent).ok){e.next=7;break}throw new Error(r.statusText);case 7:if(!n){e.next=15;break}return e.t1=Uint8Array,e.next=11,r.arrayBuffer();case 11:e.t2=e.sent,e.t0=new e.t1(e.t2),e.next=20;break;case 15:return e.t3=i.stringToBytes,e.next=18,r.text();case 18:e.t4=e.sent,e.t0=(0,e.t3)(e.t4);case 20:return e.abrupt("return",e.t0);case 21:return e.abrupt("return",new Promise((function(e,r){var a=new XMLHttpRequest;a.open("GET",t,!0),n&&(a.responseType="arraybuffer"),a.onreadystatechange=function(){if(a.readyState===XMLHttpRequest.DONE){var t;if((200===a.status||0===a.status)&&(n&&a.response?t=new Uint8Array(a.response):!n&&a.responseText&&(t=(0,i.stringToBytes)(a.responseText)),t))return void e(t);r(new Error(a.statusText))}},a.send(null)})));case 22:case"end":return e.stop()}}),e)}))),D.apply(this,arguments)}t.DOMCanvasFactory=O;var N=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"_fetchData",value:function(e,t){return L(e,this.isCompressed).then((function(e){return{cMapData:e,compressionType:t}}))}}]),n}(a.BaseCMapReaderFactory);t.DOMCMapReaderFactory=N;var G=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"_fetchData",value:function(e){return L(e,!0)}}]),n}(a.BaseStandardFontDataFactory);t.DOMStandardFontDataFactory=G;var j=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"_createSVG",value:function(e){return document.createElementNS(o,e)}}]),n}(a.BaseSVGFactory);t.DOMSVGFactory=j;var Z=function(){function e(t){var n=t.viewBox,r=t.scale,a=t.rotation,i=t.offsetX,o=void 0===i?0:i,s=t.offsetY,l=void 0===s?0:s,c=t.dontFlip,u=void 0!==c&&c;_classCallCheck(this,e),this.viewBox=n,this.scale=r,this.rotation=a,this.offsetX=o,this.offsetY=l;var d,f,h,p,v,m,g,y,_=(n[2]+n[0])/2,b=(n[3]+n[1])/2;switch((a%=360)<0&&(a+=360),a){case 180:d=-1,f=0,h=0,p=1;break;case 90:d=0,f=1,h=1,p=0;break;case 270:d=0,f=-1,h=-1,p=0;break;case 0:d=1,f=0,h=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}u&&(h=-h,p=-p),0===d?(v=Math.abs(b-n[1])*r+o,m=Math.abs(_-n[0])*r+l,g=(n[3]-n[1])*r,y=(n[2]-n[0])*r):(v=Math.abs(_-n[0])*r+o,m=Math.abs(b-n[1])*r+l,g=(n[2]-n[0])*r,y=(n[3]-n[1])*r),this.transform=[d*r,f*r,h*r,p*r,v-d*r*_-h*r*b,m-f*r*_-p*r*b],this.width=g,this.height=y}return _createClass(e,[{key:"rawDims",get:function(){var e=this.viewBox;return(0,i.shadow)(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}},{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.scale,r=void 0===n?this.scale:n,a=t.rotation,i=void 0===a?this.rotation:a,o=t.offsetX,s=void 0===o?this.offsetX:o,l=t.offsetY,c=void 0===l?this.offsetY:l,u=t.dontFlip,d=void 0!==u&&u;return new e({viewBox:this.viewBox.slice(),scale:r,rotation:i,offsetX:s,offsetY:c,dontFlip:d})}},{key:"convertToViewportPoint",value:function(e,t){return i.Util.applyTransform([e,t],this.transform)}},{key:"convertToViewportRectangle",value:function(e){var t=i.Util.applyTransform([e[0],e[1]],this.transform),n=i.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}},{key:"convertToPdfPoint",value:function(e,t){return i.Util.applyInverseTransform([e,t],this.transform)}}]),e}();t.PageViewport=Z;var z=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return _classCallCheck(this,n),(r=t.call(this,e,"RenderingCancelledException")).extraDelay=a,r}return _createClass(n)}(i.BaseException);function W(e){for(var t=e.length,n=0;n=1&&r<=12?r-1:0;var a=parseInt(t[3],10);a=a>=1&&a<=31?a:1;var i=parseInt(t[4],10);i=i>=0&&i<=23?i:0;var o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;var s=parseInt(t[6],10);s=s>=0&&s<=59?s:0;var l=t[7]||"Z",c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;var u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,"-"===l?(i+=c,o+=u):"+"===l&&(i-=c,o-=u),new Date(Date.UTC(n,r,a,i,o,s))}}]),e}();function V(e){if(e.startsWith("#")){var t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map((function(e){return parseInt(e)})):e.startsWith("rgba(")?e.slice(5,-1).split(",").map((function(e){return parseInt(e)})).slice(0,3):((0,i.warn)('Not a valid color format: "'.concat(e,'"')),[0,0,0])}t.PDFDateString=q},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStandardFontDataFactory=t.BaseSVGFactory=t.BaseFilterFactory=t.BaseCanvasFactory=t.BaseCMapReaderFactory=void 0;var r=n(1),a=function(){function e(){_classCallCheck(this,e),this.constructor===e&&(0,r.unreachable)("Cannot initialize BaseFilterFactory.")}return _createClass(e,[{key:"addFilter",value:function(e){return"none"}},{key:"addHCMFilter",value:function(e,t){return"none"}},{key:"addHighlightHCMFilter",value:function(e,t,n,r){return"none"}},{key:"destroy",value:function(){}}]),e}();t.BaseFilterFactory=a;var i=function(){function e(){_classCallCheck(this,e),this.constructor===e&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}return _createClass(e,[{key:"create",value:function(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");var n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d")}}},{key:"reset",value:function(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}},{key:"destroy",value:function(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}},{key:"_createCanvas",value:function(e,t){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}]),e}();t.BaseCanvasFactory=i;var o=function(){function e(t){var n=t.baseUrl,a=void 0===n?null:n,i=t.isCompressed,o=void 0===i||i;_classCallCheck(this,e),this.constructor===e&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=a,this.isCompressed=o}return _createClass(e,[{key:"fetch",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var n,a,i,o=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.name,this.baseUrl){e.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(n){e.next=5;break}throw new Error("CMap name must be specified.");case 5:return a=this.baseUrl+n+(this.isCompressed?".bcmap":""),i=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE,e.abrupt("return",this._fetchData(a,i).catch((function(e){throw new Error("Unable to load ".concat(o.isCompressed?"binary ":"","CMap at: ").concat(a))})));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_fetchData",value:function(e,t){(0,r.unreachable)("Abstract method `_fetchData` called.")}}]),e}();t.BaseCMapReaderFactory=o;var s=function(){function e(t){var n=t.baseUrl,a=void 0===n?null:n;_classCallCheck(this,e),this.constructor===e&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=a}return _createClass(e,[{key:"fetch",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var n,r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.filename,this.baseUrl){e.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(n){e.next=5;break}throw new Error("Font filename must be specified.");case 5:return r="".concat(this.baseUrl).concat(n),e.abrupt("return",this._fetchData(r).catch((function(e){throw new Error("Unable to load font data at: ".concat(r))})));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_fetchData",value:function(e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}]),e}();t.BaseStandardFontDataFactory=s;var l=function(){function e(){_classCallCheck(this,e),this.constructor===e&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}return _createClass(e,[{key:"create",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");var r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),n||(r.setAttribute("width","".concat(e,"px")),r.setAttribute("height","".concat(t,"px"))),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox","0 0 ".concat(e," ").concat(t)),r}},{key:"createElement",value:function(e){if("string"!==typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}},{key:"_createSVG",value:function(e){(0,r.unreachable)("Abstract method `_createSVG` called.")}}]),e}();t.BaseSVGFactory=l},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.MurmurHash3_64=void 0;var r=n(1),a=3285377520,i=4294901760,o=65535,s=function(){function e(t){_classCallCheck(this,e),this.h1=t?4294967295&t:a,this.h2=t?4294967295&t:a}return _createClass(e,[{key:"update",value:function(e){var t,n;if("string"===typeof e){t=new Uint8Array(2*e.length),n=0;for(var a=0,s=e.length;a>>8,t[n++]=255&l)}}else{if(!(0,r.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");n=(t=e.slice()).byteLength}for(var c=n>>2,u=n-4*c,d=new Uint32Array(t.buffer,0,c),f=0,h=0,p=this.h1,v=this.h2,m=3432918353,g=461845907,y=11601,_=13715,b=0;b>>17)*g&i|f*_&o)<<13|p>>>19)+3864292196:v=5*(v=(v^=h=(h=(h=(h=d[b])*m&i|h*y&o)<<15|h>>>17)*g&i|h*_&o)<<13|v>>>19)+3864292196;switch(f=0,u){case 3:f^=t[4*c+2]<<16;case 2:f^=t[4*c+1]<<8;case 1:f=(f=(f=(f^=t[4*c])*m&i|f*y&o)<<15|f>>>17)*g&i|f*_&o,1&c?p^=f:v^=f}this.h1=p,this.h2=v}},{key:"hexdigest",value:function(){var e=this.h1,t=this.h2;return e=3981806797*(e^=t>>>1)&i|36045*e&o,e=444984403*(e^=(t=4283543511*t&i|(2950163797*(t<<16|e>>>16)&i)>>>16)>>>1)&i|60499*e&o,((e^=(t=3301882366*t&i|(3120437893*(t<<16|e>>>16)&i)>>>16)>>>1)>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}]),e}();t.MurmurHash3_64=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var r=n(1),a=new WeakMap,i=function(){function e(t){var n=t.ownerDocument,r=void 0===n?globalThis.document:n;t.styleElement,_classCallCheck(this,e),_classPrivateFieldInitSpec(this,a,{writable:!0,value:new Set}),this._document=r,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}return _createClass(e,[{key:"addNativeFontFace",value:function(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}},{key:"removeNativeFontFace",value:function(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}},{key:"insertRule",value:function(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));var t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}},{key:"clear",value:function(){var e,t=_createForOfIteratorHelper(this.nativeFontFaces);try{for(t.s();!(e=t.n()).done;){var n=e.value;this._document.fonts.delete(n)}}catch(r){t.e(r)}finally{t.f()}this.nativeFontFaces.clear(),_classPrivateFieldGet(this,a).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}},{key:"loadSystemFont",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var n,i,o,s;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&!_classPrivateFieldGet(this,a).has(t.loadedName)){e.next=2;break}return e.abrupt("return");case 2:if((0,r.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),!this.isFontLoadingAPISupported){e.next=18;break}return n=t.loadedName,i=t.src,o=t.style,s=new FontFace(n,i,o),this.addNativeFontFace(s),e.prev=7,e.next=10,s.load();case 10:_classPrivateFieldGet(this,a).add(n),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(7),(0,r.warn)("Cannot load system font: ".concat(t.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(s);case 17:return e.abrupt("return");case 18:(0,r.unreachable)("Not implemented: loadSystemFont without the Font Loading API.");case 19:case"end":return e.stop()}}),e,this,[[7,13]])})));return function(t){return e.apply(this,arguments)}}()},{key:"bind",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var n,a,i=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.attached||t.missingFile&&!t.systemFontInfo)){e.next=2;break}return e.abrupt("return");case 2:if(t.attached=!0,!t.systemFontInfo){e.next=7;break}return e.next=6,this.loadSystemFont(t.systemFontInfo);case 6:case 21:return e.abrupt("return");case 7:if(!this.isFontLoadingAPISupported){e.next=22;break}if(!(n=t.createNativeFontFace())){e.next=21;break}return this.addNativeFontFace(n),e.prev=11,e.next=14,n.loaded;case 14:e.next=21;break;case 16:throw e.prev=16,e.t0=e.catch(11),(0,r.warn)("Failed to load font '".concat(n.family,"': '").concat(e.t0,"'.")),t.disableFontFace=!0,e.t0;case 22:if(!(a=t.createFontFaceRule())){e.next=29;break}if(this.insertRule(a),!this.isSyncFontLoadingSupported){e.next=27;break}return e.abrupt("return");case 27:return e.next=29,new Promise((function(e){var n=i._queueLoadingCallback(e);i._prepareFontLoadEvent(t,n)}));case 29:case"end":return e.stop()}}),e,this,[[11,16]])})));return function(t){return e.apply(this,arguments)}}()},{key:"isFontLoadingAPISupported",get:function(){var e,t=!(null===(e=this._document)||void 0===e||!e.fonts);return(0,r.shadow)(this,"isFontLoadingAPISupported",t)}},{key:"isSyncFontLoadingSupported",get:function(){var e=!1;return(r.isNodeJS||"undefined"!==typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),(0,r.shadow)(this,"isSyncFontLoadingSupported",e)}},{key:"_queueLoadingCallback",value:function(e){var t=this.loadingRequests,n={done:!1,complete:function(){for((0,r.assert)(!n.done,"completeRequest() cannot be called twice."),n.done=!0;t.length>0&&t[0].done;){var e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(n),n}},{key:"_loadTestFont",get:function(){var e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,r.shadow)(this,"_loadTestFont",e)}},{key:"_prepareFontLoadEvent",value:function(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function a(e,t,n,r){return e.substring(0,t)+r+e.substring(t+n)}var i,o,s=this._document.createElement("canvas");s.width=1,s.height=1;var l=s.getContext("2d"),c=0,u="lt".concat(Date.now()).concat(this.loadTestFontId++),d=this._loadTestFont,f=1482184792,h=n(d=a(d,976,u.length,u),16);for(i=0,o=u.length-3;i30)return(0,r.warn)("Load test font never loaded."),void n();l.font="30px "+t,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(u,(function(){m.remove(),t.complete()}))}}]),e}();t.FontLoader=i;var o=function(){function e(t,n){var r=n.isEvalSupported,a=void 0===r||r,i=n.disableFontFace,o=void 0!==i&&i,s=n.ignoreErrors,l=void 0!==s&&s,c=n.inspectFont,u=void 0===c?null:c;for(var d in _classCallCheck(this,e),this.compiledGlyphs=Object.create(null),t)this[d]=t[d];this.isEvalSupported=!1!==a,this.disableFontFace=!0===o,this.ignoreErrors=!0===l,this._inspectFont=u}return _createClass(e,[{key:"createNativeFontFace",value:function(){var e,t;if(!this.data||this.disableFontFace)return null;if(this.cssFontInfo){var n={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(n.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),t=new FontFace(this.cssFontInfo.fontFamily,this.data,n)}else t=new FontFace(this.loadedName,this.data,{});return null===(e=this._inspectFont)||void 0===e||e.call(this,this),t}},{key:"createFontFaceRule",value:function(){var e;if(!this.data||this.disableFontFace)return null;var t,n=(0,r.bytesToString)(this.data),a="url(data:".concat(this.mimetype,";base64,").concat(btoa(n),");");if(this.cssFontInfo){var i="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(i+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),t='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(i,"src:").concat(a,"}")}else t='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(a,"}");return null===(e=this._inspectFont)||void 0===e||e.call(this,this,a),t}},{key:"getPathGenerator",value:function(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];var n;try{n=e.get(this.loadedName+"_path_"+t)}catch(c){if(!this.ignoreErrors)throw c;return(0,r.warn)('getPathGenerator - ignoring character: "'.concat(c,'".')),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&r.FeatureTest.isEvalSupported){var a,i=[],o=_createForOfIteratorHelper(n);try{for(o.s();!(a=o.n()).done;){var s=a.value,l=void 0!==s.args?s.args.join(","):"";i.push("c.",s.cmd,"(",l,");\n")}}catch(u){o.e(u)}finally{o.f()}return this.compiledGlyphs[t]=new Function("c","size",i.join(""))}return this.compiledGlyphs[t]=function(e,t){var r,a=_createForOfIteratorHelper(n);try{for(a.s();!(r=a.n()).done;){var i=r.value;"scale"===i.cmd&&(i.args=[t,-t]),e[i.cmd].apply(e,i.args)}}catch(u){a.e(u)}finally{a.f()}}}}]),e}();t.FontFaceObject=o},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStandardFontDataFactory=t.NodeFilterFactory=t.NodeCanvasFactory=t.NodeCMapReaderFactory=void 0;var r=n(7),a=(n(1),function(e){return new Promise((function(t,n){__webpack_require__(172).readFile(e,(function(e,r){!e&&r?t(new Uint8Array(r)):n(new Error(e))}))}))}),i=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n)}(r.BaseFilterFactory);t.NodeFilterFactory=i;var o=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"_createCanvas",value:function(e,t){return __webpack_require__(3414).createCanvas(e,t)}}]),n}(r.BaseCanvasFactory);t.NodeCanvasFactory=o;var s=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"_fetchData",value:function(e,t){return a(e).then((function(e){return{cMapData:e,compressionType:t}}))}}]),n}(r.BaseCMapReaderFactory);t.NodeCMapReaderFactory=s;var l=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"_fetchData",value:function(e){return a(e)}}]),n}(r.BaseStandardFontDataFactory);t.NodeStandardFontDataFactory=l},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0;var r=n(1),a=n(6),i=n(12),o=n(13),s=4096,l=16,c=function(){function e(t){_classCallCheck(this,e),this.canvasFactory=t,this.cache=Object.create(null)}return _createClass(e,[{key:"getCanvas",value:function(e,t,n){var r;return void 0!==this.cache[e]?(r=this.cache[e],this.canvasFactory.reset(r,t,n)):(r=this.canvasFactory.create(t,n),this.cache[e]=r),r}},{key:"delete",value:function(e){delete this.cache[e]}},{key:"clear",value:function(){for(var e in this.cache){var t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}]),e}();function u(e,t,n,r,i,o,s,l,c,u){var d=(0,a.getCurrentTransform)(e),f=_slicedToArray(d,6),h=f[0],p=f[1],v=f[2],m=f[3],g=f[4],y=f[5];if(0===p&&0===v){var _=s*h+g,b=Math.round(_),k=l*m+y,w=Math.round(k),S=(s+c)*h+g,x=Math.abs(Math.round(S)-b)||1,P=(l+u)*m+y,A=Math.abs(Math.round(P)-w)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(m),b,w),e.drawImage(t,n,r,i,o,0,0,x,A),e.setTransform(h,p,v,m,g,y),[x,A]}if(0===h&&0===m){var C=l*v+g,F=Math.round(C),E=s*p+y,M=Math.round(E),T=(l+u)*v+g,I=Math.abs(Math.round(T)-F)||1,R=(s+c)*p+y,O=Math.abs(Math.round(R)-M)||1;return e.setTransform(0,Math.sign(p),Math.sign(v),0,F,M),e.drawImage(t,n,r,i,o,0,0,O,I),e.setTransform(h,p,v,m,g,y),[O,I]}return e.drawImage(t,n,r,i,o,s,l,c,u),[Math.hypot(h,p)*c,Math.hypot(v,m)*u]}var d=function(){function e(t,n){_classCallCheck(this,e),this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=r.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=r.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,n])}return _createClass(e,[{key:"clone",value:function(){var e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}},{key:"setCurrentPoint",value:function(e,t){this.x=e,this.y=t}},{key:"updatePathMinMax",value:function(e,t,n){var a=r.Util.applyTransform([t,n],e),i=_slicedToArray(a,2);t=i[0],n=i[1],this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,n)}},{key:"updateRectMinMax",value:function(e,t){var n=r.Util.applyTransform(t,e),a=r.Util.applyTransform(t.slice(2),e);this.minX=Math.min(this.minX,n[0],a[0]),this.minY=Math.min(this.minY,n[1],a[1]),this.maxX=Math.max(this.maxX,n[0],a[0]),this.maxY=Math.max(this.maxY,n[1],a[1])}},{key:"updateScalingPathMinMax",value:function(e,t){r.Util.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.maxX=Math.max(this.maxX,t[1]),this.minY=Math.min(this.minY,t[2]),this.maxY=Math.max(this.maxY,t[3])}},{key:"updateCurvePathMinMax",value:function(e,t,n,a,i,o,s,l,c,u){var d=r.Util.bezierBoundingBox(t,n,a,i,o,s,l,c);if(u)return u[0]=Math.min(u[0],d[0],d[2]),u[1]=Math.max(u[1],d[0],d[2]),u[2]=Math.min(u[2],d[1],d[3]),void(u[3]=Math.max(u[3],d[1],d[3]));this.updateRectMinMax(e,d)}},{key:"getPathBoundingBox",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.PathType.FILL,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[this.minX,this.minY,this.maxX,this.maxY];if(e===i.PathType.STROKE){t||(0,r.unreachable)("Stroke bounding box must include transform.");var a=r.Util.singularValueDecompose2dScale(t),o=a[0]*this.lineWidth/2,s=a[1]*this.lineWidth/2;n[0]-=o,n[1]-=s,n[2]+=o,n[3]+=s}return n}},{key:"updateClipFromPath",value:function(){var e=r.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}},{key:"isEmptyClip",value:function(){return this.minX===1/0}},{key:"startNewPathAndClipBox",value:function(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}},{key:"getClippedPathBoundingBox",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.PathType.FILL,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return r.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}]),e}();function f(e,t){if("undefined"!==typeof ImageData&&t instanceof ImageData)e.putImageData(t,0,0);else{var n,a,i,o,s,c=t.height,u=t.width,d=c%l,f=(c-d)/l,h=0===d?f:f+1,p=e.createImageData(u,l),v=0,m=t.data,g=p.data;if(t.kind===r.ImageKind.GRAYSCALE_1BPP){var y=m.byteLength,_=new Uint32Array(g.buffer,0,g.byteLength>>2),b=_.length,k=u+7>>3,w=4294967295,S=r.FeatureTest.isLittleEndian?4278190080:255;for(a=0;ak?u:8*x-7,C=-8&A,F=0,E=0;P>=1}for(;n=f&&(s=u*(o=d)),n=0,i=s;i--;)g[n++]=m[v++],g[n++]=m[v++],g[n++]=m[v++],g[n++]=255;e.putImageData(p,0,a*l)}}}}function h(e,t){if(t.bitmap)e.drawImage(t.bitmap,0,0);else for(var n=t.height,r=t.width,a=n%l,i=(n-a)/l,s=0===a?i:i+1,c=e.createImageData(r,l),u=0,d=t.data,f=c.data,h=0;h>8,e[i-2]=e[i-2]*o+n*s>>8,e[i-1]=e[i-1]*o+r*s>>8}}}function g(e,t,n){for(var r=e.length,a=3;a>8]>>8:t[a]*i>>16}}function _(e,t,n,r){var a=r[0],i=r[1],o=r[2]-a,s=r[3]-i;0!==o&&0!==s&&(function(e,t,n,r,a,i,o,s,l,c,u){for(var d=!!i,f=d?i[0]:0,h=d?i[1]:0,p=d?i[2]:0,v="Luminosity"===a?y:g,_=Math.min(r,Math.ceil(1048576/n)),b=0;b1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}},{key:"beginDrawing",value:function(e){var t,n,r=e.transform,i=e.viewport,o=e.transparency,s=void 0!==o&&o,l=e.background,c=void 0===l?null:l,u=this.ctx.canvas.width,d=this.ctx.canvas.height,f=this.ctx.fillStyle;if(this.ctx.fillStyle=c||"#ffffff",this.ctx.fillRect(0,0,u,d),this.ctx.fillStyle=f,s){var h,p=this.cachedCanvases.getCanvas("transparent",u,d);this.compositeCtx=this.ctx,this.transparentCanvas=p.canvas,this.ctx=p.context,this.ctx.save(),(h=this.ctx).transform.apply(h,_toConsumableArray((0,a.getCurrentTransform)(this.compositeCtx)))}this.ctx.save(),v(this.ctx),r&&((n=this.ctx).transform.apply(n,_toConsumableArray(r)),this.outputScaleX=r[0],this.outputScaleY=r[0]),(t=this.ctx).transform.apply(t,_toConsumableArray(i.transform)),this.viewportScale=i.scale,this.baseTransform=(0,a.getCurrentTransform)(this.ctx)}},{key:"executeOperatorList",value:function(e,t,n,a){var i=e.argsArray,o=e.fnArray,s=t||0,l=i.length;if(l===s)return s;for(var c,u=l-s>10&&"function"===typeof n,d=u?Date.now()+15:0,f=0,h=this.commonObjs,p=this.objs;;){if(void 0!==a&&s===a.nextBreakPoint)return a.breakIt(s,n),s;if((c=o[s])!==r.OPS.dependency)this[c].apply(this,i[s]);else{var v,m=_createForOfIteratorHelper(i[s]);try{for(m.s();!(v=m.n()).done;){var g=v.value,y=g.startsWith("g_")?h:p;if(!y.has(g))return y.get(g,n),s}}catch(_){m.e(_)}finally{m.f()}}if(++s===l)return s;if(u&&++f>10){if(Date.now()>d)return n(),s;f=0}}}},{key:"endDrawing",value:function(){_classPrivateMethodGet(this,P,F).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();var e,t=_createForOfIteratorHelper(this._cachedBitmapsMap.values());try{for(t.s();!(e=t.n()).done;){var n,r=e.value,a=_createForOfIteratorHelper(r.values());try{for(a.s();!(n=a.n()).done;){var i=n.value;"undefined"!==typeof HTMLCanvasElement&&i instanceof HTMLCanvasElement&&(i.width=i.height=0)}}catch(o){a.e(o)}finally{a.f()}r.clear()}}catch(o){t.e(o)}finally{t.f()}this._cachedBitmapsMap.clear(),_classPrivateMethodGet(this,A,E).call(this)}},{key:"_scaleImage",value:function(e,t){for(var n,r,a=e.width,i=e.height,o=Math.max(Math.hypot(t[0],t[1]),1),s=Math.max(Math.hypot(t[2],t[3]),1),l=a,c=i,u="prescale1";o>2&&l>1||s>2&&c>1;){var d=l,f=c;o>2&&l>1&&(o/=l/(d=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2))),s>2&&c>1&&(s/=c/(f=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2)),(r=(n=this.cachedCanvases.getCanvas(u,d,f)).context).clearRect(0,0,d,f),r.drawImage(e,0,0,l,c,0,0,d,f),e=n.canvas,l=d,c=f,u="prescale1"===u?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}},{key:"_createMaskCanvas",value:function(e){var t,n,o,s,l=this.ctx,c=e.width,d=e.height,f=this.current.fillColor,p=this.current.patternFill,v=(0,a.getCurrentTransform)(l);if((e.bitmap||e.data)&&e.count>1){var m=e.bitmap||e.data.buffer;n=JSON.stringify(p?v:[v.slice(0,4),f]),(t=this._cachedBitmapsMap.get(m))||(t=new Map,this._cachedBitmapsMap.set(m,t));var g=t.get(n);if(g&&!p)return{canvas:g,offsetX:Math.round(Math.min(v[0],v[2])+v[4]),offsetY:Math.round(Math.min(v[1],v[3])+v[5])};o=g}o||h((s=this.cachedCanvases.getCanvas("maskCanvas",c,d)).context,e);var y=r.Util.transform(v,[1/c,0,0,-1/d,0,0]);y=r.Util.transform(y,[1,0,0,1,0,-d]);var _=r.Util.applyTransform([0,0],y),k=r.Util.applyTransform([c,d],y),w=r.Util.normalizeRect([_[0],_[1],k[0],k[1]]),S=Math.round(w[2]-w[0])||1,x=Math.round(w[3]-w[1])||1,P=this.cachedCanvases.getCanvas("fillCanvas",S,x),A=P.context,C=Math.min(_[0],k[0]),F=Math.min(_[1],k[1]);A.translate(-C,-F),A.transform.apply(A,_toConsumableArray(y)),o||(o=(o=this._scaleImage(s.canvas,(0,a.getCurrentTransformInverse)(A))).img,t&&p&&t.set(n,o)),A.imageSmoothingEnabled=b((0,a.getCurrentTransform)(A),e.interpolate),u(A,o,0,0,o.width,o.height,0,0,c,d),A.globalCompositeOperation="source-in";var E=r.Util.transform((0,a.getCurrentTransformInverse)(A),[1,0,0,1,-C,-F]);return A.fillStyle=p?f.getPattern(l,this,E,i.PathType.FILL):f,A.fillRect(0,0,c,d),t&&!p&&(this.cachedCanvases.delete("fillCanvas"),t.set(n,P.canvas)),{canvas:P.canvas,offsetX:Math.round(C),offsetY:Math.round(F)}}},{key:"setLineWidth",value:function(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}},{key:"setLineCap",value:function(e){this.ctx.lineCap=k[e]}},{key:"setLineJoin",value:function(e){this.ctx.lineJoin=w[e]}},{key:"setMiterLimit",value:function(e){this.ctx.miterLimit=e}},{key:"setDash",value:function(e,t){var n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)}},{key:"setRenderingIntent",value:function(e){}},{key:"setFlatness",value:function(e){}},{key:"setGState",value:function(e){var t,n=_createForOfIteratorHelper(e);try{for(n.s();!(t=n.n()).done;){var r=_slicedToArray(t.value,2),a=r[0],i=r[1];switch(a){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}}catch(o){n.e(o)}finally{n.f()}}},{key:"inSMaskMode",get:function(){return!!this.suspendedCtx}},{key:"checkSMaskState",value:function(){var e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}},{key:"beginSMaskMode",value:function(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");var e=this.ctx.canvas.width,t=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(n,e,t);this.suspendedCtx=this.ctx,this.ctx=r.context;var i=this.ctx;i.setTransform.apply(i,_toConsumableArray((0,a.getCurrentTransform)(this.suspendedCtx))),p(this.suspendedCtx,i),function(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=function(){e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,r,a,i,o){t.transform(e,n,r,a,i,o),this.__originalTransform(e,n,r,a,i,o)},e.setTransform=function(e,n,r,a,i,o){t.setTransform(e,n,r,a,i,o),this.__originalSetTransform(e,n,r,a,i,o)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,r,a,i,o){t.bezierCurveTo(e,n,r,a,i,o),this.__originalBezierCurveTo(e,n,r,a,i,o)},e.rect=function(e,n,r,a){t.rect(e,n,r,a),this.__originalRect(e,n,r,a)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(i,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}},{key:"endSMaskMode",value:function(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),p(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}},{key:"compose",value:function(e){if(this.current.activeSMask){e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];var t=this.current.activeSMask;_(this.suspendedCtx,t,this.ctx,e),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(){this.inSMaskMode?(p(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();var e=this.current;this.stateStack.push(e),this.current=e.clone()}},{key:"restore",value:function(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),p(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}},{key:"transform",value:function(e,t,n,r,a,i){this.ctx.transform(e,t,n,r,a,i),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}},{key:"constructPath",value:function(e,t,n){for(var i,o,s=this.ctx,l=this.current,c=l.x,u=l.y,d=(0,a.getCurrentTransform)(s),f=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],h=f?n.slice(0):null,p=0,v=0,m=e.length;p0&&void 0!==arguments[0])||arguments[0],t=this.ctx,n=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof n&&null!==n&&void 0!==n&&n.getPattern?(t.save(),t.strokeStyle=n.getPattern(t,this,(0,a.getCurrentTransformInverse)(t),i.PathType.STROKE),this.rescaleAndStroke(!1),t.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}},{key:"closeStroke",value:function(){this.closePath(),this.stroke()}},{key:"fill",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.ctx,n=this.current.fillColor,r=!1;this.current.patternFill&&(t.save(),t.fillStyle=n.getPattern(t,this,(0,a.getCurrentTransformInverse)(t),i.PathType.FILL),r=!0);var o=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==o&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),r&&t.restore(),e&&this.consumePath(o)}},{key:"eoFill",value:function(){this.pendingEOFill=!0,this.fill()}},{key:"fillStroke",value:function(){this.fill(!1),this.stroke(!1),this.consumePath()}},{key:"eoFillStroke",value:function(){this.pendingEOFill=!0,this.fillStroke()}},{key:"closeFillStroke",value:function(){this.closePath(),this.fillStroke()}},{key:"closeEOFillStroke",value:function(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}},{key:"endPath",value:function(){this.consumePath()}},{key:"clip",value:function(){this.pendingClip=S}},{key:"eoClip",value:function(){this.pendingClip=x}},{key:"beginText",value:function(){this.current.textMatrix=r.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}},{key:"endText",value:function(){var e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save(),t.beginPath();var n,r=_createForOfIteratorHelper(e);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.setTransform.apply(t,_toConsumableArray(a.transform)),t.translate(a.x,a.y),a.addToPath(t,a.fontSize)}}catch(i){r.e(i)}finally{r.f()}t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}else t.beginPath()}},{key:"setCharSpacing",value:function(e){this.current.charSpacing=e}},{key:"setWordSpacing",value:function(e){this.current.wordSpacing=e}},{key:"setHScale",value:function(e){this.current.textHScale=e/100}},{key:"setLeading",value:function(e){this.current.leading=-e}},{key:"setFont",value:function(e,t){var n,a=this.commonObjs.get(e),i=this.current;if(!a)throw new Error("Can't find font for ".concat(e));if(i.fontMatrix=a.fontMatrix||r.FONT_IDENTITY_MATRIX,0!==i.fontMatrix[0]&&0!==i.fontMatrix[3]||(0,r.warn)("Invalid font matrix for font "+e),t<0?(t=-t,i.fontDirection=-1):i.fontDirection=1,this.current.font=a,this.current.fontSize=t,!a.isType3Font){var o=a.loadedName||"sans-serif",s=(null===(n=a.systemFontInfo)||void 0===n?void 0:n.css)||'"'.concat(o,'", ').concat(a.fallbackName),l="normal";a.black?l="900":a.bold&&(l="bold");var c=a.italic?"italic":"normal",u=t;t<16?u=16:t>100&&(u=100),this.current.fontSizeScale=t/u,this.ctx.font="".concat(c," ").concat(l," ").concat(u,"px ").concat(s)}}},{key:"setTextRenderingMode",value:function(e){this.current.textRenderingMode=e}},{key:"setTextRise",value:function(e){this.current.textRise=e}},{key:"moveText",value:function(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}},{key:"setLeadingMoveText",value:function(e,t){this.setLeading(-t),this.moveText(e,t)}},{key:"setTextMatrix",value:function(e,t,n,r,a,i){this.current.textMatrix=[e,t,n,r,a,i],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}},{key:"nextLine",value:function(){this.moveText(0,this.current.leading)}},{key:"paintChar",value:function(e,t,n,i){var o,s=this.ctx,l=this.current,c=l.font,u=l.textRenderingMode,d=l.fontSize/l.fontSizeScale,f=u&r.TextRenderingMode.FILL_STROKE_MASK,h=!!(u&r.TextRenderingMode.ADD_TO_PATH_FLAG),p=l.patternFill&&!c.missingFile;(c.disableFontFace||h||p)&&(o=c.getPathGenerator(this.commonObjs,e)),c.disableFontFace||p?(s.save(),s.translate(t,n),s.beginPath(),o(s,d),i&&s.setTransform.apply(s,_toConsumableArray(i)),f!==r.TextRenderingMode.FILL&&f!==r.TextRenderingMode.FILL_STROKE||s.fill(),f!==r.TextRenderingMode.STROKE&&f!==r.TextRenderingMode.FILL_STROKE||s.stroke(),s.restore()):(f!==r.TextRenderingMode.FILL&&f!==r.TextRenderingMode.FILL_STROKE||s.fillText(e,t,n),f!==r.TextRenderingMode.STROKE&&f!==r.TextRenderingMode.FILL_STROKE||s.strokeText(e,t,n)),h&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,a.getCurrentTransform)(s),x:t,y:n,fontSize:d,addToPath:o})}},{key:"isFontSubpixelAAEnabled",get:function(){var e=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10).context;e.scale(1.5,1),e.fillText("I",0,10);for(var t=e.getImageData(0,0,10,10).data,n=!1,a=3;a0&&t[a]<255){n=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",n)}},{key:"showText",value:function(e){var t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);var o=t.fontSize;if(0!==o){var s,l=this.ctx,c=t.fontSizeScale,u=t.charSpacing,d=t.wordSpacing,f=t.fontDirection,h=t.textHScale*f,p=e.length,v=n.vertical,m=v?1:-1,g=n.defaultVMetrics,y=o*t.fontMatrix[0],_=t.textRenderingMode===r.TextRenderingMode.FILL&&!n.disableFontFace&&!t.patternFill;if(l.save(),l.transform.apply(l,_toConsumableArray(t.textMatrix)),l.translate(t.x,t.y+t.textRise),f>0?l.scale(h,-1):l.scale(h,1),t.patternFill){l.save();var b=t.fillColor.getPattern(l,this,(0,a.getCurrentTransformInverse)(l),i.PathType.FILL);s=(0,a.getCurrentTransform)(l),l.restore(),l.fillStyle=b}var k=t.lineWidth,w=t.textMatrixScale;if(0===w||0===k){var S=t.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;S!==r.TextRenderingMode.STROKE&&S!==r.TextRenderingMode.FILL_STROKE||(k=this.getSinglePixelWidth())}else k/=w;if(1!==c&&(l.scale(c,c),k/=c),l.lineWidth=k,n.isInvalidPDFjsFont){var x,P=[],A=0,C=_createForOfIteratorHelper(e);try{for(C.s();!(x=C.n()).done;){var F=x.value;P.push(F.unicode),A+=F.width}}catch(q){C.e(q)}finally{C.f()}return l.fillText(P.join(""),0,0),t.x+=A*y*h,l.restore(),void this.compose()}var E,M=0;for(E=0;E0){var W=1e3*l.measureText(O).width/o*c;if(G1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(e)?t=this.cachedPatterns.get(e):(t=(0,i.getShadingPattern)(this.getObject(e)),this.cachedPatterns.set(e,t)),n&&(t.matrix=n),t}},{key:"shadingFill",value:function(e){if(this.contentVisible){var t=this.ctx;this.save();var n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,(0,a.getCurrentTransformInverse)(t),i.PathType.SHADING);var o=(0,a.getCurrentTransformInverse)(t);if(o){var s=t.canvas,l=s.width,c=s.height,u=r.Util.getAxialAlignedBoundingBox([0,0,l,c],o),d=_slicedToArray(u,4),f=d[0],h=d[1],p=d[2],v=d[3];this.ctx.fillRect(f,h,p-f,v-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}}},{key:"beginInlineImage",value:function(){(0,r.unreachable)("Should not call beginInlineImage")}},{key:"beginImageData",value:function(){(0,r.unreachable)("Should not call beginImageData")}},{key:"paintFormXObjectBegin",value:function(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform.apply(this,_toConsumableArray(e)),this.baseTransform=(0,a.getCurrentTransform)(this.ctx),t)){var n=t[2]-t[0],r=t[3]-t[1];this.ctx.rect(t[0],t[1],n,r),this.current.updateRectMinMax((0,a.getCurrentTransform)(this.ctx),t),this.clip(),this.endPath()}}},{key:"paintFormXObjectEnd",value:function(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}},{key:"beginGroup",value:function(e){if(this.contentVisible){this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);var t=this.ctx;e.isolated||(0,r.info)("TODO: Support non-isolated groups."),e.knockout&&(0,r.warn)("Knockout groups not supported.");var n=(0,a.getCurrentTransform)(t);if(e.matrix&&t.transform.apply(t,_toConsumableArray(e.matrix)),!e.bbox)throw new Error("Bounding box is required.");var i=r.Util.getAxialAlignedBoundingBox(e.bbox,(0,a.getCurrentTransform)(t)),o=[0,0,t.canvas.width,t.canvas.height];i=r.Util.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),d=Math.max(Math.ceil(i[3])-c,1),f=1,h=1;u>s&&(f=u/s,u=s),d>s&&(h=d/s,d=s),this.current.startNewPathAndClipBox([0,0,u,d]);var v="groupAt"+this.groupLevel;e.smask&&(v+="_smask_"+this.smaskCounter++%2);var m=this.cachedCanvases.getCanvas(v,u,d),g=m.context;g.scale(1/f,1/h),g.translate(-l,-c),g.transform.apply(g,_toConsumableArray(n)),e.smask?this.smaskStack.push({canvas:m.canvas,context:g,offsetX:l,offsetY:c,scaleX:f,scaleY:h,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(l,c),t.scale(f,h),t.save()),p(t,g),this.ctx=g,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}}},{key:"endGroup",value:function(e){if(this.contentVisible){this.groupLevel--;var t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{var i;this.ctx.restore();var o=(0,a.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),(i=this.ctx).setTransform.apply(i,_toConsumableArray(o));var s=r.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],o);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(s)}}}},{key:"beginAnnotation",value:function(e,t,n,i,o){var s;if(_classPrivateMethodGet(this,P,F).call(this),v(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&(s=this.ctx).setTransform.apply(s,_toConsumableArray(this.baseTransform)),Array.isArray(t)&&4===t.length){var l=t[2]-t[0],c=t[3]-t[1];if(o&&this.annotationCanvasMap){(n=n.slice())[4]-=t[0],n[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=l,t[3]=c;var u=r.Util.singularValueDecompose2dScale((0,a.getCurrentTransform)(this.ctx)),f=_slicedToArray(u,2),h=f[0],p=f[1],m=this.viewportScale,g=Math.ceil(l*this.outputScaleX*m),y=Math.ceil(c*this.outputScaleY*m);this.annotationCanvas=this.canvasFactory.create(g,y);var _=this.annotationCanvas,b=_.canvas,k=_.context;this.annotationCanvasMap.set(e,b),this.annotationCanvas.savedCtx=this.ctx,this.ctx=k,this.ctx.save(),this.ctx.setTransform(h,0,0,-p,0,c*p),v(this.ctx)}else v(this.ctx),this.ctx.rect(t[0],t[1],l,c),this.ctx.clip(),this.endPath()}this.current=new d(this.ctx.canvas.width,this.ctx.canvas.height),this.transform.apply(this,_toConsumableArray(n)),this.transform.apply(this,_toConsumableArray(i))}},{key:"endAnnotation",value:function(){this.annotationCanvas&&(this.ctx.restore(),_classPrivateMethodGet(this,A,E).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}},{key:"paintImageMaskXObject",value:function(e){if(this.contentVisible){var t=e.count;(e=this.getObject(e.data,e)).count=t;var n=this.ctx,r=this.processingType3;if(r&&(void 0===r.compiled&&(r.compiled=function(e){var t=e.width,n=e.height;if(t>1e3||n>1e3)return null;var r,a,i,o,s=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),l=t+1,c=new Uint8Array(l*(n+1)),u=t+7&-8,d=new Uint8Array(u*n),f=0,h=_createForOfIteratorHelper(e.data);try{for(h.s();!(o=h.n()).done;)for(var p=o.value,v=128;v>0;)d[f++]=p&v?0:255,v>>=1}catch(A){h.e(A)}finally{h.f()}var m=0;for(0!==d[f=0]&&(c[0]=1,++m),a=1;a>2)+(d[f+1]?4:0)+(d[f-u+1]?8:0)]&&(c[i+a]=s[g],++m),f++;if(d[f-u]!==d[f]&&(c[i+a]=d[f]?2:4,++m),m>1e3)return null}for(i=r*l,0!==d[f=u*(n-1)]&&(c[i]=8,++m),a=1;a1e3)return null;var y=new Int32Array([0,l,-1,0,-l,0,0,0,1]),_=new Path2D;for(r=0;m&&r<=n;r++){for(var b=r*l,k=b+t;b>4,c[b]&=S>>2|S<<2),_.lineTo(b%l,b/l|0),c[b]||--m}while(w!==b);--r}}return d=null,c=null,function(e){e.save(),e.scale(1/t,-1/n),e.translate(0,-n),e.fill(_),e.beginPath(),e.restore()}}(e)),r.compiled))r.compiled(n);else{var a=this._createMaskCanvas(e),i=a.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(i,a.offsetX,a.offsetY),n.restore(),this.compose()}}}},{key:"paintImageMaskXObjectRepeat",value:function(e,t){var n=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,s=arguments.length>5?arguments[5]:void 0;if(this.contentVisible){e=this.getObject(e.data,e);var l=this.ctx;l.save();var c=(0,a.getCurrentTransform)(l);l.transform(t,n,i,o,0,0);var u=this._createMaskCanvas(e);l.setTransform(1,0,0,1,u.offsetX-c[4],u.offsetY-c[5]);for(var d=0,f=s.length;dm?v/m:1,t=p>m?p/m:1}}this._cachedScaleForStroking[0]=e,this._cachedScaleForStroking[1]=t}return this._cachedScaleForStroking}},{key:"rescaleAndStroke",value:function(e){var t=this.ctx,n=this.current.lineWidth,r=this.getScaleForStroking(),a=_slicedToArray(r,2),i=a[0],o=a[1];if(t.lineWidth=n||1,1!==i||1!==o){var s=t.getLineDash();if(e&&t.save(),t.scale(i,o),s.length>0){var l=Math.max(i,o);t.setLineDash(s.map((function(e){return e/l}))),t.lineDashOffset/=l}t.stroke(),e&&t.restore()}else t.stroke()}},{key:"isContentVisible",value:function(){for(var e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}]),e}();function F(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}function E(){if(this.pageColors){var e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==e){var t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}for(var M in t.CanvasGraphics=C,r.OPS)void 0!==C.prototype[M]&&(C.prototype[r.OPS[M]]=C.prototype[M])},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.TilingPattern=t.PathType=void 0,t.getShadingPattern=function(e){switch(e[0]){case"RadialAxial":return new l(e);case"Mesh":return new d(e);case"Dummy":return new f}throw new Error("Unknown IR type: ".concat(e[0]))};var r=n(1),a=n(6),i={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function o(e,t){if(t){var n=t[2]-t[0],r=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],n,r),e.clip(a)}}t.PathType=i;var s=function(){function e(){_classCallCheck(this,e),this.constructor===e&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}return _createClass(e,[{key:"getPattern",value:function(){(0,r.unreachable)("Abstract method `getPattern` called.")}}]),e}(),l=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var r;return _classCallCheck(this,n),(r=t.call(this))._type=e[1],r._bbox=e[2],r._colorStops=e[3],r._p0=e[4],r._p1=e[5],r._r0=e[6],r._r1=e[7],r.matrix=null,r}return _createClass(n,[{key:"_createGradient",value:function(e){var t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));var n,r=_createForOfIteratorHelper(this._colorStops);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.addColorStop(a[0],a[1])}}catch(i){r.e(i)}finally{r.f()}return t}},{key:"getPattern",value:function(e,t,n,s){var l;if(s===i.STROKE||s===i.FILL){var c=t.current.getClippedPathBoundingBox(s,(0,a.getCurrentTransform)(e))||[0,0,0,0],u=Math.ceil(c[2]-c[0])||1,d=Math.ceil(c[3]-c[1])||1,f=t.cachedCanvases.getCanvas("pattern",u,d,!0),h=f.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-c[0],-c[1]),n=r.Util.transform(n,[1,0,0,1,c[0],c[1]]),h.transform.apply(h,_toConsumableArray(t.baseTransform)),this.matrix&&h.transform.apply(h,_toConsumableArray(this.matrix)),o(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),l=e.createPattern(f.canvas,"no-repeat");var p=new DOMMatrix(n);l.setTransform(p)}else o(e,this._bbox),l=this._createGradient(e);return l}}]),n}(s);function c(e,t,n,r,a,i,o,s){var l,c=t.coords,u=t.colors,d=e.data,f=4*e.width;c[n+1]>c[r+1]&&(l=n,n=r,r=l,l=i,i=o,o=l),c[r+1]>c[a+1]&&(l=r,r=a,a=l,l=o,o=s,s=l),c[n+1]>c[r+1]&&(l=n,n=r,r=l,l=i,i=o,o=l);var h=(c[n]+t.offsetX)*t.scaleX,p=(c[n+1]+t.offsetY)*t.scaleY,v=(c[r]+t.offsetX)*t.scaleX,m=(c[r+1]+t.offsetY)*t.scaleY,g=(c[a]+t.offsetX)*t.scaleX,y=(c[a+1]+t.offsetY)*t.scaleY;if(!(p>=y))for(var _,b,k,w,S,x,P,A,C=u[i],F=u[i+1],E=u[i+2],M=u[o],T=u[o+1],I=u[o+2],R=u[s],O=u[s+1],L=u[s+2],D=Math.round(p),N=Math.round(y),G=D;G<=N;G++){if(Gy?1:m===y?0:(m-G)/(m-y)),b=M-(M-R)*Z,k=T-(T-O)*Z,w=I-(I-L)*Z}var z=void 0;S=h-(h-g)*(z=Gy?1:(p-G)/(p-y)),x=C-(C-R)*z,P=F-(F-O)*z,A=E-(E-L)*z;for(var W=Math.round(Math.min(_,S)),B=Math.round(Math.max(_,S)),U=f*G+4*W,H=W;H<=B;H++)(z=(_-H)/(_-S))<0?z=0:z>1&&(z=1),d[U++]=b-(b-x)*z|0,d[U++]=k-(k-P)*z|0,d[U++]=w-(w-A)*z|0,d[U++]=255}}function u(e,t,n){var r,a,i=t.coords,o=t.colors;switch(t.type){case"lattice":var s=t.verticesPerRow,l=Math.floor(i.length/s)-1,u=s-1;for(r=0;r=a?i=a:r=i/t,{scale:r,size:i}}},{key:"clipBbox",value:function(e,t,n,r,i){var o=r-t,s=i-n;e.ctx.rect(t,n,o,s),e.current.updateRectMinMax((0,a.getCurrentTransform)(e.ctx),[t,n,r,i]),e.clip(),e.endPath()}},{key:"setFillAndStrokeStyleToContext",value:function(e,t,n){var a=e.ctx,i=e.current;switch(t){case h:var o=this.ctx;a.fillStyle=o.fillStyle,a.strokeStyle=o.strokeStyle,i.fillColor=o.fillStyle,i.strokeColor=o.strokeStyle;break;case p:var s=r.Util.makeHexColor(n[0],n[1],n[2]);a.fillStyle=s,a.strokeStyle=s,i.fillColor=s,i.strokeColor=s;break;default:throw new r.FormatError("Unsupported paint type: ".concat(t))}}},{key:"getPattern",value:function(e,t,n,a){var o=n;a!==i.SHADING&&(o=r.Util.transform(o,t.baseTransform),this.matrix&&(o=r.Util.transform(o,this.matrix)));var s=this.createPatternCanvas(t),l=new DOMMatrix(o);l=(l=l.translate(s.offsetX,s.offsetY)).scale(1/s.scaleX,1/s.scaleY);var c=e.createPattern(s.canvas,"repeat");return c.setTransform(l),c}}]),e}();_defineProperty(v,"MAX_PATTERN_SIZE",3e3),t.TilingPattern=v},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.convertBlackAndWhiteToRGBA=a,t.convertToRGBA=function(e){switch(e.kind){case r.ImageKind.GRAYSCALE_1BPP:return a(e);case r.ImageKind.RGB_24BPP:return function(e){var t=e.src,n=e.srcPos,a=void 0===n?0:n,i=e.dest,o=e.destPos,s=void 0===o?0:o,l=(e.width,e.height,0),c=t.length>>2,u=new Uint32Array(t.buffer,a,c);if(r.FeatureTest.isLittleEndian){for(;l>>24|f<<8|4278190080,i[s+2]=f>>>16|h<<16|4278190080,i[s+3]=h>>>8|4278190080}for(var p=4*l,v=t.length;p>>8|255,i[s+2]=g<<16|y>>>16|255,i[s+3]=y<<8|255}for(var _=4*l,b=t.length;_>3,g=7&o,y=t.length;i=new Uint32Array(i.buffer);for(var _=0,b=0;b1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2?arguments[2]:void 0;if(!this.isCancelled){var l=this.desiredSize;this.desiredSize-=o,l>0&&this.desiredSize<=0&&(this.sinkCapability=new r.PromiseCapability,this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:a,stream:c,streamId:t,chunk:e},s)}},close:function(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:a,stream:l,streamId:t}),delete o.streamSinks[t])},error:function(e){(0,r.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:a,stream:u,streamId:t,reason:p(e)}))},sinkCapability:new r.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[t]=d,new Promise((function(t){t(s(e.data,d))})).then((function(){i.postMessage({sourceName:n,targetName:a,stream:h,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:a,stream:h,streamId:t,reason:p(e)})}))}function b(e){var t=e.streamId,n=this.sourceName,a=e.sourceName,i=this.comObj,v=this.streamControllers[t],m=this.streamSinks[t];switch(e.stream){case h:e.success?v.startCall.resolve():v.startCall.reject(p(e.reason));break;case f:e.success?v.pullCall.resolve():v.pullCall.reject(p(e.reason));break;case d:if(!m){i.postMessage({sourceName:n,targetName:a,stream:f,streamId:t,success:!0});break}m.desiredSize<=0&&e.desiredSize>0&&m.sinkCapability.resolve(),m.desiredSize=e.desiredSize,new Promise((function(e){var t;e(null===(t=m.onPull)||void 0===t?void 0:t.call(m))})).then((function(){i.postMessage({sourceName:n,targetName:a,stream:f,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:a,stream:f,streamId:t,reason:p(e)})}));break;case c:if((0,r.assert)(v,"enqueue should have stream controller"),v.isClosed)break;v.controller.enqueue(e.chunk);break;case l:if((0,r.assert)(v,"close should have stream controller"),v.isClosed)break;v.isClosed=!0,v.controller.close(),_classPrivateMethodGet(this,g,k).call(this,v,t);break;case u:(0,r.assert)(v,"error should have stream controller"),v.controller.error(p(e.reason)),_classPrivateMethodGet(this,g,k).call(this,v,t);break;case s:e.success?v.cancelCall.resolve():v.cancelCall.reject(p(e.reason)),_classPrivateMethodGet(this,g,k).call(this,v,t);break;case o:if(!m)break;new Promise((function(t){var n;t(null===(n=m.onCancel)||void 0===n?void 0:n.call(m,p(e.reason)))})).then((function(){i.postMessage({sourceName:n,targetName:a,stream:s,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:a,stream:s,streamId:t,reason:p(e)})})),m.sinkCapability.reject(p(e.reason)),m.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}function k(e,t){return w.apply(this,arguments)}function w(){return(w=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,n){var r,a,i;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.allSettled([null===(r=t.startCall)||void 0===r?void 0:r.promise,null===(a=t.pullCall)||void 0===a?void 0:a.promise,null===(i=t.cancelCall)||void 0===i?void 0:i.promise]);case 2:delete this.streamControllers[n];case 3:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}t.MessageHandler=y},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var r=n(1),a=new WeakMap,i=new WeakMap,o=function(){function e(t){var n=t.parsedData,r=t.rawData;_classCallCheck(this,e),_classPrivateFieldInitSpec(this,a,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,i,{writable:!0,value:void 0}),_classPrivateFieldSet(this,a,n),_classPrivateFieldSet(this,i,r)}return _createClass(e,[{key:"getRaw",value:function(){return _classPrivateFieldGet(this,i)}},{key:"get",value:function(e){var t;return null!==(t=_classPrivateFieldGet(this,a).get(e))&&void 0!==t?t:null}},{key:"getAll",value:function(){return(0,r.objectFromMap)(_classPrivateFieldGet(this,a))}},{key:"has",value:function(e){return _classPrivateFieldGet(this,a).has(e)}}]),e}();t.Metadata=o},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalContentConfig=void 0;var r=n(1),a=n(8),i=Symbol("INTERNAL"),o=new WeakMap,s=function(){function e(t,n){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,o,{writable:!0,value:!0}),this.name=t,this.intent=n}return _createClass(e,[{key:"visible",get:function(){return _classPrivateFieldGet(this,o)}},{key:"_setVisible",value:function(e,t){e!==i&&(0,r.unreachable)("Internal method `_setVisible` called."),_classPrivateFieldSet(this,o,t)}}]),e}(),l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakSet,h=function(){function e(t){if(_classCallCheck(this,e),_classPrivateMethodInitSpec(this,f),_classPrivateFieldInitSpec(this,l,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,c,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,u,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,d,{writable:!0,value:null}),this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,_classPrivateFieldSet(this,d,t.order);var n,r=_createForOfIteratorHelper(t.groups);try{for(r.s();!(n=r.n()).done;){var a=n.value;_classPrivateFieldGet(this,c).set(a.id,new s(a.name,a.intent))}}catch(b){r.e(b)}finally{r.f()}if("OFF"===t.baseState){var o,h=_createForOfIteratorHelper(_classPrivateFieldGet(this,c).values());try{for(h.s();!(o=h.n()).done;)o.value._setVisible(i,!1)}catch(b){h.e(b)}finally{h.f()}}var p,v=_createForOfIteratorHelper(t.on);try{for(v.s();!(p=v.n()).done;){var m=p.value;_classPrivateFieldGet(this,c).get(m)._setVisible(i,!0)}}catch(b){v.e(b)}finally{v.f()}var g,y=_createForOfIteratorHelper(t.off);try{for(y.s();!(g=y.n()).done;){var _=g.value;_classPrivateFieldGet(this,c).get(_)._setVisible(i,!1)}}catch(b){y.e(b)}finally{y.f()}_classPrivateFieldSet(this,u,this.getHash())}}return _createClass(e,[{key:"isVisible",value:function(e){if(0===_classPrivateFieldGet(this,c).size)return!0;if(!e)return(0,r.warn)("Optional content group not defined."),!0;if("OCG"===e.type)return _classPrivateFieldGet(this,c).has(e.id)?_classPrivateFieldGet(this,c).get(e.id).visible:((0,r.warn)("Optional content group not found: ".concat(e.id)),!0);if("OCMD"===e.type){if(e.expression)return _classPrivateMethodGet(this,f,p).call(this,e.expression);if(!e.policy||"AnyOn"===e.policy){var t,n=_createForOfIteratorHelper(e.ids);try{for(n.s();!(t=n.n()).done;){var a=t.value;if(!_classPrivateFieldGet(this,c).has(a))return(0,r.warn)("Optional content group not found: ".concat(a)),!0;if(_classPrivateFieldGet(this,c).get(a).visible)return!0}}catch(g){n.e(g)}finally{n.f()}return!1}if("AllOn"===e.policy){var i,o=_createForOfIteratorHelper(e.ids);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(!_classPrivateFieldGet(this,c).has(s))return(0,r.warn)("Optional content group not found: ".concat(s)),!0;if(!_classPrivateFieldGet(this,c).get(s).visible)return!1}}catch(g){o.e(g)}finally{o.f()}return!0}if("AnyOff"===e.policy){var l,u=_createForOfIteratorHelper(e.ids);try{for(u.s();!(l=u.n()).done;){var d=l.value;if(!_classPrivateFieldGet(this,c).has(d))return(0,r.warn)("Optional content group not found: ".concat(d)),!0;if(!_classPrivateFieldGet(this,c).get(d).visible)return!0}}catch(g){u.e(g)}finally{u.f()}return!1}if("AllOff"===e.policy){var h,v=_createForOfIteratorHelper(e.ids);try{for(v.s();!(h=v.n()).done;){var m=h.value;if(!_classPrivateFieldGet(this,c).has(m))return(0,r.warn)("Optional content group not found: ".concat(m)),!0;if(_classPrivateFieldGet(this,c).get(m).visible)return!1}}catch(g){v.e(g)}finally{v.f()}return!0}return(0,r.warn)("Unknown optional content policy ".concat(e.policy,".")),!0}return(0,r.warn)("Unknown group type ".concat(e.type,".")),!0}},{key:"setVisibility",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];_classPrivateFieldGet(this,c).has(e)?(_classPrivateFieldGet(this,c).get(e)._setVisible(i,!!t),_classPrivateFieldSet(this,l,null)):(0,r.warn)("Optional content group not found: ".concat(e))}},{key:"hasInitialVisibility",get:function(){return null===_classPrivateFieldGet(this,u)||this.getHash()===_classPrivateFieldGet(this,u)}},{key:"getOrder",value:function(){return _classPrivateFieldGet(this,c).size?_classPrivateFieldGet(this,d)?_classPrivateFieldGet(this,d).slice():_toConsumableArray(_classPrivateFieldGet(this,c).keys()):null}},{key:"getGroups",value:function(){return _classPrivateFieldGet(this,c).size>0?(0,r.objectFromMap)(_classPrivateFieldGet(this,c)):null}},{key:"getGroup",value:function(e){return _classPrivateFieldGet(this,c).get(e)||null}},{key:"getHash",value:function(){if(null!==_classPrivateFieldGet(this,l))return _classPrivateFieldGet(this,l);var e,t=new a.MurmurHash3_64,n=_createForOfIteratorHelper(_classPrivateFieldGet(this,c));try{for(n.s();!(e=n.n()).done;){var r=_slicedToArray(e.value,2),i=r[0],o=r[1];t.update("".concat(i,":").concat(o.visible))}}catch(s){n.e(s)}finally{n.f()}return _classPrivateFieldSet(this,l,t.hexdigest())}}]),e}();function p(e){var t=e.length;if(t<2)return!0;for(var n=e[0],a=1;a0){var v=o instanceof Uint8Array&&o.byteLength===o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer;this._queuedChunks.push(v)}this._pdfDataRangeTransport=n,this._isStreamingSupported=!p,this._isRangeSupported=!f,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((function(e,t){a._onReceiveData({begin:e,chunk:t})})),this._pdfDataRangeTransport.addProgressListener((function(e,t){a._onProgress({loaded:e,total:t})})),this._pdfDataRangeTransport.addProgressiveReadListener((function(e){a._onReceiveData({chunk:e})})),this._pdfDataRangeTransport.addProgressiveDoneListener((function(){a._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}return _createClass(e,[{key:"_onReceiveData",value:function(e){var t=e.begin,n=e.chunk,a=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(a):this._queuedChunks.push(a);else{var i=this._rangeReaders.some((function(e){return e._begin===t&&(e._enqueue(a),!0)}));(0,r.assert)(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}},{key:"_progressiveDataLength",get:function(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}},{key:"_onProgress",value:function(e){var t,n,r,a;void 0===e.total?null===(t=this._rangeReaders[0])||void 0===t||null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.loaded}):null===(r=this._fullRequestReader)||void 0===r||null===(a=r.onProgress)||void 0===a||a.call(r,{loaded:e.loaded,total:e.total})}},{key:"_onProgressiveDone",value:function(){var e;null===(e=this._fullRequestReader)||void 0===e||e.progressiveDone(),this._progressiveDone=!0}},{key:"_removeRangeReader",value:function(e){var t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}},{key:"getFullReader",value:function(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var e=this._queuedChunks;return this._queuedChunks=null,new o(this,e,this._progressiveDone,this._contentDispositionFilename)}},{key:"getRangeReader",value:function(e,t){if(t<=this._progressiveDataLength)return null;var n=new s(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}},{key:"cancelAllRequests",value:function(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);var n,r=_createForOfIteratorHelper(this._rangeReaders.slice(0));try{for(r.s();!(n=r.n()).done;)n.value.cancel(e)}catch(a){r.e(a)}finally{r.f()}this._pdfDataRangeTransport.abort()}}]),e}();t.PDFDataTransportStream=i;var o=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;_classCallCheck(this,e),this._stream=t,this._done=r||!1,this._filename=(0,a.isPdfFile)(i)?i:null,this._queuedChunks=n||[],this._loaded=0;var o,s=_createForOfIteratorHelper(this._queuedChunks);try{for(s.s();!(o=s.n()).done;){var l=o.value;this._loaded+=l.byteLength}}catch(c){s.e(c)}finally{s.f()}this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}return _createClass(e,[{key:"_enqueue",value:function(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}},{key:"headersReady",get:function(){return this._headersReady}},{key:"filename",get:function(){return this._filename}},{key:"isRangeSupported",get:function(){return this._stream._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._stream._isStreamingSupported}},{key:"contentLength",get:function(){return this._stream._contentLength}},{key:"read",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this._queuedChunks.length>0)){e.next=3;break}return t=this._queuedChunks.shift(),e.abrupt("return",{value:t,done:!1});case 3:if(!this._done){e.next=5;break}return e.abrupt("return",{value:void 0,done:!0});case 5:return n=new r.PromiseCapability,this._requests.push(n),e.abrupt("return",n.promise);case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"cancel",value:function(e){this._done=!0;var t,n=_createForOfIteratorHelper(this._requests);try{for(n.s();!(t=n.n()).done;)t.value.resolve({value:void 0,done:!0})}catch(r){n.e(r)}finally{n.f()}this._requests.length=0}},{key:"progressiveDone",value:function(){this._done||(this._done=!0)}}]),e}(),s=function(){function e(t,n,r){_classCallCheck(this,e),this._stream=t,this._begin=n,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}return _createClass(e,[{key:"_enqueue",value:function(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});var t,n=_createForOfIteratorHelper(this._requests);try{for(n.s();!(t=n.n()).done;)t.value.resolve({value:void 0,done:!0})}catch(r){n.e(r)}finally{n.f()}this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}},{key:"isStreamingSupported",get:function(){return!1}},{key:"read",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._queuedChunk){e.next=4;break}return t=this._queuedChunk,this._queuedChunk=null,e.abrupt("return",{value:t,done:!1});case 4:if(!this._done){e.next=6;break}return e.abrupt("return",{value:void 0,done:!0});case 6:return n=new r.PromiseCapability,this._requests.push(n),e.abrupt("return",n.promise);case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"cancel",value:function(e){this._done=!0;var t,n=_createForOfIteratorHelper(this._requests);try{for(n.s();!(t=n.n()).done;)t.value.resolve({value:void 0,done:!0})}catch(r){n.e(r)}finally{n.f()}this._requests.length=0,this._stream._removeRangeReader(this)}}]),e}()},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var r=n(1),a=n(20);function i(e,t,n){return{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function o(e){var t=new Headers;for(var n in e){var r=e[n];void 0!==r&&t.append(n,r)}return t}function s(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:((0,r.warn)("getArrayBuffer - unexpected data format: ".concat(e)),new Uint8Array(e).buffer)}var l=function(){function e(t){_classCallCheck(this,e),this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}return _createClass(e,[{key:"_progressiveDataLength",get:function(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}},{key:"getFullReader",value:function(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new c(this),this._fullRequestReader}},{key:"getRangeReader",value:function(e,t){if(t<=this._progressiveDataLength)return null;var n=new u(this,e,t);return this._rangeRequestReaders.push(n),n}},{key:"cancelAllRequests",value:function(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);var n,r=_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(r.s();!(n=r.n()).done;)n.value.cancel(e)}catch(a){r.e(a)}finally{r.f()}}}]),e}();t.PDFFetchStream=l;var c=function(){function e(t){var n=this;_classCallCheck(this,e),this._stream=t,this._reader=null,this._loaded=0,this._filename=null;var s=t.source;this._withCredentials=s.withCredentials||!1,this._contentLength=s.length,this._headersCapability=new r.PromiseCapability,this._disableRange=s.disableRange||!1,this._rangeChunkSize=s.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!s.disableStream,this._isRangeSupported=!s.disableRange,this._headers=o(this._stream.httpHeaders);var l=s.url;fetch(l,i(this._headers,this._withCredentials,this._abortController)).then((function(e){if(!(0,a.validateResponseStatus)(e.status))throw(0,a.createResponseStatusError)(e.status,l);n._reader=e.body.getReader(),n._headersCapability.resolve();var t=function(t){return e.headers.get(t)},i=(0,a.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:n._stream.isHttp,rangeChunkSize:n._rangeChunkSize,disableRange:n._disableRange}),o=i.allowRangeRequests,s=i.suggestedLength;n._isRangeSupported=o,n._contentLength=s||n._contentLength,n._filename=(0,a.extractFilenameFromHeader)(t),!n._isStreamingSupported&&n._isRangeSupported&&n.cancel(new r.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}return _createClass(e,[{key:"headersReady",get:function(){return this._headersCapability.promise}},{key:"filename",get:function(){return this._filename}},{key:"contentLength",get:function(){return this._contentLength}},{key:"isRangeSupported",get:function(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}},{key:"read",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n,r,a;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._headersCapability.promise;case 2:return e.next=4,this._reader.read();case 4:if(n=e.sent,r=n.value,!(a=n.done)){e.next=9;break}return e.abrupt("return",{value:r,done:a});case 9:return this._loaded+=r.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),e.abrupt("return",{value:s(r),done:!1});case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"cancel",value:function(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e),this._abortController.abort()}}]),e}(),u=function(){function e(t,n,s){var l=this;_classCallCheck(this,e),this._stream=t,this._reader=null,this._loaded=0;var c=t.source;this._withCredentials=c.withCredentials||!1,this._readCapability=new r.PromiseCapability,this._isStreamingSupported=!c.disableStream,this._abortController=new AbortController,this._headers=o(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(n,"-").concat(s-1));var u=c.url;fetch(u,i(this._headers,this._withCredentials,this._abortController)).then((function(e){if(!(0,a.validateResponseStatus)(e.status))throw(0,a.createResponseStatusError)(e.status,u);l._readCapability.resolve(),l._reader=e.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}return _createClass(e,[{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}},{key:"read",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n,r,a;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._readCapability.promise;case 2:return e.next=4,this._reader.read();case 4:if(n=e.sent,r=n.value,!(a=n.done)){e.next=9;break}return e.abrupt("return",{value:r,done:a});case 9:return this._loaded+=r.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),e.abrupt("return",{value:s(r),done:!1});case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"cancel",value:function(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e),this._abortController.abort()}}]),e}()},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(e,t){return 404===e||0===e&&t.startsWith("file:")?new r.MissingPDFException('Missing PDF "'+t+'".'):new r.UnexpectedResponseException("Unexpected server response (".concat(e,') while retrieving PDF "').concat(t,'".'),e)},t.extractFilenameFromHeader=function(e){var t=e("Content-Disposition");if(t){var n=(0,a.getFilenameFromContentDispositionHeader)(t);if(n.includes("%"))try{n=decodeURIComponent(n)}catch(r){}if((0,i.isPdfFile)(n))return n}return null},t.validateRangeRequestCapabilities=function(e){var t=e.getResponseHeader,n=e.isHttp,r=e.rangeChunkSize,a=e.disableRange,i={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(t("Content-Length"),10);return Number.isInteger(o)?(i.suggestedLength=o,o<=2*r||a||!n||"bytes"!==t("Accept-Ranges")||"identity"!==(t("Content-Encoding")||"identity")||(i.allowRangeRequests=!0),i):i},t.validateResponseStatus=function(e){return 200===e||206===e};var r=n(1),a=n(21),i=n(6)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){var t=!0,n=o("filename\\*","i").exec(e);if(n){var a=c(n=n[1]);return l(a=d(a=u(a=unescape(a))))}if(n=function(e){for(var t,n=[],r=o("filename\\*((?!0\\d)\\d+)(\\*?)","ig");null!==(t=r.exec(e));){var a=_slicedToArray(t,4),i=a[1],s=a[2],l=a[3];if((i=parseInt(i,10))in n){if(0===i)break}else n[i]=[s,l]}for(var d=[],f=0;f1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,e),this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&n.httpHeaders||Object.create(null),this.withCredentials=n.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}return _createClass(e,[{key:"requestRange",value:function(e,t,n){var r={begin:e,end:t};for(var a in n)r[a]=n[a];return this.request(r)}},{key:"requestFull",value:function(e){return this.request(e)}},{key:"request",value:function(e){var t=new XMLHttpRequest,n=this.currXhrId++,r=this.pendingRequests[n]={xhr:t};for(var a in t.open("GET",this.url),t.withCredentials=this.withCredentials,this.httpHeaders){var i=this.httpHeaders[a];void 0!==i&&t.setRequestHeader(a,i)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range","bytes=".concat(e.begin,"-").concat(e.end-1)),r.expectedStatus=206):r.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(n){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),n}},{key:"onProgress",value:function(e,t){var n,r=this.pendingRequests[e];r&&(null===(n=r.onProgress)||void 0===n||n.call(r,t))}},{key:"onStateChange",value:function(e,t){var n=this.pendingRequests[e];if(n){var a=n.xhr;if(a.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4===a.readyState&&e in this.pendingRequests)if(delete this.pendingRequests[e],0===a.status&&this.isHttp){var i;null===(i=n.onError)||void 0===i||i.call(n,a.status)}else{var o=a.status||200;if(200===o&&206===n.expectedStatus||o===n.expectedStatus){var s=function(e){var t=e.response;return"string"!==typeof t?t:(0,r.stringToBytes)(t).buffer}(a);if(206===o){var l=a.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);n.onDone({begin:parseInt(c[1],10),chunk:s})}else if(s)n.onDone({begin:0,chunk:s});else{var u;null===(u=n.onError)||void 0===u||u.call(n,a.status)}}else{var d;null===(d=n.onError)||void 0===d||d.call(n,a.status)}}}}},{key:"getRequestXhr",value:function(e){return this.pendingRequests[e].xhr}},{key:"isPendingRequest",value:function(e){return e in this.pendingRequests}},{key:"abortRequest",value:function(e){var t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}]),e}(),o=function(){function e(t){_classCallCheck(this,e),this._source=t,this._manager=new i(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}return _createClass(e,[{key:"_onRangeRequestReaderClosed",value:function(e){var t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}},{key:"getFullReader",value:function(){return(0,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new s(this._manager,this._source),this._fullRequestReader}},{key:"getRangeReader",value:function(e,t){var n=new l(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}},{key:"cancelAllRequests",value:function(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);var n,r=_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(r.s();!(n=r.n()).done;)n.value.cancel(e)}catch(a){r.e(a)}finally{r.f()}}}]),e}();t.PDFNetworkStream=o;var s=function(){function e(t,n){_classCallCheck(this,e),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=n.url,this._fullRequestId=t.requestFull(a),this._headersReceivedCapability=new r.PromiseCapability,this._disableRange=n.disableRange||!1,this._contentLength=n.length,this._rangeChunkSize=n.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}return _createClass(e,[{key:"_onHeadersReceived",value:function(){var e=this._fullRequestId,t=this._manager.getRequestXhr(e),n=function(e){return t.getResponseHeader(e)},r=(0,a.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),i=r.allowRangeRequests,o=r.suggestedLength;i&&(this._isRangeSupported=!0),this._contentLength=o||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}},{key:"_onDone",value:function(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){var t,n=_createForOfIteratorHelper(this._requests);try{for(n.s();!(t=n.n()).done;)t.value.resolve({value:void 0,done:!0})}catch(r){n.e(r)}finally{n.f()}this._requests.length=0}}},{key:"_onError",value:function(e){this._storedError=(0,a.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);var t,n=_createForOfIteratorHelper(this._requests);try{for(n.s();!(t=n.n()).done;)t.value.reject(this._storedError)}catch(r){n.e(r)}finally{n.f()}this._requests.length=0,this._cachedChunks.length=0}},{key:"_onProgress",value:function(e){var t;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}},{key:"filename",get:function(){return this._filename}},{key:"isRangeSupported",get:function(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}},{key:"contentLength",get:function(){return this._contentLength}},{key:"headersReady",get:function(){return this._headersReceivedCapability.promise}},{key:"read",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._storedError){e.next=2;break}throw this._storedError;case 2:if(!(this._cachedChunks.length>0)){e.next=5;break}return t=this._cachedChunks.shift(),e.abrupt("return",{value:t,done:!1});case 5:if(!this._done){e.next=7;break}return e.abrupt("return",{value:void 0,done:!0});case 7:return n=new r.PromiseCapability,this._requests.push(n),e.abrupt("return",n.promise);case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"cancel",value:function(e){this._done=!0,this._headersReceivedCapability.reject(e);var t,n=_createForOfIteratorHelper(this._requests);try{for(n.s();!(t=n.n()).done;)t.value.resolve({value:void 0,done:!0})}catch(r){n.e(r)}finally{n.f()}this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}]),e}(),l=function(){function e(t,n,r){_classCallCheck(this,e),this._manager=t;var a={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(n,r,a),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}return _createClass(e,[{key:"_close",value:function(){var e;null===(e=this.onClosed)||void 0===e||e.call(this,this)}},{key:"_onDone",value:function(e){var t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;var n,r=_createForOfIteratorHelper(this._requests);try{for(r.s();!(n=r.n()).done;)n.value.resolve({value:void 0,done:!0})}catch(a){r.e(a)}finally{r.f()}this._requests.length=0,this._close()}},{key:"_onError",value:function(e){this._storedError=(0,a.createResponseStatusError)(e,this._url);var t,n=_createForOfIteratorHelper(this._requests);try{for(n.s();!(t=n.n()).done;)t.value.reject(this._storedError)}catch(r){n.e(r)}finally{n.f()}this._requests.length=0,this._queuedChunk=null}},{key:"_onProgress",value:function(e){var t;this.isStreamingSupported||null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:e.loaded})}},{key:"isStreamingSupported",get:function(){return!1}},{key:"read",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._storedError){e.next=2;break}throw this._storedError;case 2:if(null===this._queuedChunk){e.next=6;break}return t=this._queuedChunk,this._queuedChunk=null,e.abrupt("return",{value:t,done:!1});case 6:if(!this._done){e.next=8;break}return e.abrupt("return",{value:void 0,done:!0});case 8:return n=new r.PromiseCapability,this._requests.push(n),e.abrupt("return",n.promise);case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"cancel",value:function(e){this._done=!0;var t,n=_createForOfIteratorHelper(this._requests);try{for(n.s();!(t=n.n()).done;)t.value.resolve({value:void 0,done:!0})}catch(r){n.e(r)}finally{n.f()}this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}]),e}()},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var r=n(1),a=n(20),i=/^file:\/\/\/[a-zA-Z]:\//,o=function(){function e(t){_classCallCheck(this,e),this.source=t,this.url=function(e){var t=__webpack_require__(6558),n=t.parse(e);return"file:"===n.protocol||n.host?n:/^[a-z]:[/\\]/i.test(e)?t.parse("file:///".concat(e)):(n.host||(n.protocol="file:"),n)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}return _createClass(e,[{key:"_progressiveDataLength",get:function(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}},{key:"getFullReader",value:function(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new f(this):new u(this),this._fullRequestReader}},{key:"getRangeReader",value:function(e,t){if(t<=this._progressiveDataLength)return null;var n=this.isFsUrl?new h(this,e,t):new d(this,e,t);return this._rangeRequestReaders.push(n),n}},{key:"cancelAllRequests",value:function(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);var n,r=_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(r.s();!(n=r.n()).done;)n.value.cancel(e)}catch(a){r.e(a)}finally{r.f()}}}]),e}();t.PDFNodeStream=o;var s=function(){function e(t){_classCallCheck(this,e),this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;var n=t.source;this._contentLength=n.length,this._loaded=0,this._filename=null,this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.disableRange,this._readableStream=null,this._readCapability=new r.PromiseCapability,this._headersCapability=new r.PromiseCapability}return _createClass(e,[{key:"headersReady",get:function(){return this._headersCapability.promise}},{key:"filename",get:function(){return this._filename}},{key:"contentLength",get:function(){return this._contentLength}},{key:"isRangeSupported",get:function(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}},{key:"read",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n,a;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._readCapability.promise;case 2:if(!this._done){e.next=4;break}return e.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){e.next=6;break}throw this._storedError;case 6:if(null!==(n=this._readableStream.read())){e.next=10;break}return this._readCapability=new r.PromiseCapability,e.abrupt("return",this.read());case 10:return this._loaded+=n.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),a=new Uint8Array(n).buffer,e.abrupt("return",{value:a,done:!1});case 14:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"cancel",value:function(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}},{key:"_error",value:function(e){this._storedError=e,this._readCapability.resolve()}},{key:"_setReadableStream",value:function(e){var t=this;this._readableStream=e,e.on("readable",(function(){t._readCapability.resolve()})),e.on("end",(function(){e.destroy(),t._done=!0,t._readCapability.resolve()})),e.on("error",(function(e){t._error(e)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new r.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}]),e}(),l=function(){function e(t){_classCallCheck(this,e),this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new r.PromiseCapability;var n=t.source;this._isStreamingSupported=!n.disableStream}return _createClass(e,[{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}},{key:"read",value:function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n,a;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._readCapability.promise;case 2:if(!this._done){e.next=4;break}return e.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){e.next=6;break}throw this._storedError;case 6:if(null!==(n=this._readableStream.read())){e.next=10;break}return this._readCapability=new r.PromiseCapability,e.abrupt("return",this.read());case 10:return this._loaded+=n.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),a=new Uint8Array(n).buffer,e.abrupt("return",{value:a,done:!1});case 14:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"cancel",value:function(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}},{key:"_error",value:function(e){this._storedError=e,this._readCapability.resolve()}},{key:"_setReadableStream",value:function(e){var t=this;this._readableStream=e,e.on("readable",(function(){t._readCapability.resolve()})),e.on("end",(function(){e.destroy(),t._done=!0,t._readCapability.resolve()})),e.on("error",(function(e){t._error(e)})),this._storedError&&this._readableStream.destroy(this._storedError)}}]),e}();function c(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}var u=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var i;_classCallCheck(this,n);var o=function(t){if(404===t.statusCode){var n=new r.MissingPDFException('Missing PDF "'.concat(i._url,'".'));return i._storedError=n,void i._headersCapability.reject(n)}i._headersCapability.resolve(),i._setReadableStream(t);var o=function(e){return i._readableStream.headers[e.toLowerCase()]},s=(0,a.validateRangeRequestCapabilities)({getResponseHeader:o,isHttp:e.isHttp,rangeChunkSize:i._rangeChunkSize,disableRange:i._disableRange}),l=s.allowRangeRequests,c=s.suggestedLength;i._isRangeSupported=l,i._contentLength=c||i._contentLength,i._filename=(0,a.extractFilenameFromHeader)(o)};if((i=t.call(this,e))._request=null,"http:"===i._url.protocol){var s=__webpack_require__(2001);i._request=s.request(c(i._url,e.httpHeaders),o)}else{var l=__webpack_require__(3779);i._request=l.request(c(i._url,e.httpHeaders),o)}return i._request.on("error",(function(e){i._storedError=e,i._headersCapability.reject(e)})),i._request.end(),i}return _createClass(n)}(s),d=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,a,i){var o;for(var s in _classCallCheck(this,n),(o=t.call(this,e))._httpHeaders={},e.httpHeaders){var l=e.httpHeaders[s];void 0!==l&&(o._httpHeaders[s]=l)}o._httpHeaders.Range="bytes=".concat(a,"-").concat(i-1);var u=function(e){if(404!==e.statusCode)o._setReadableStream(e);else{var t=new r.MissingPDFException('Missing PDF "'.concat(o._url,'".'));o._storedError=t}};if(o._request=null,"http:"===o._url.protocol){var d=__webpack_require__(2001);o._request=d.request(c(o._url,o._httpHeaders),u)}else{var f=__webpack_require__(3779);o._request=f.request(c(o._url,o._httpHeaders),u)}return o._request.on("error",(function(e){o._storedError=e})),o._request.end(),o}return _createClass(n)}(l),f=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var a;_classCallCheck(this,n),a=t.call(this,e);var o=decodeURIComponent(a._url.path);i.test(a._url.href)&&(o=o.replace(/^\//,""));var s=__webpack_require__(172);return s.lstat(o,(function(e,t){if(e)return"ENOENT"===e.code&&(e=new r.MissingPDFException('Missing PDF "'.concat(o,'".'))),a._storedError=e,void a._headersCapability.reject(e);a._contentLength=t.size,a._setReadableStream(s.createReadStream(o)),a._headersCapability.resolve()})),a}return _createClass(n)}(s),h=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r,a){var o;_classCallCheck(this,n),o=t.call(this,e);var s=decodeURIComponent(o._url.path);i.test(o._url.href)&&(s=s.replace(/^\//,""));var l=__webpack_require__(172);return o._setReadableStream(l.createReadStream(s,{start:r,end:a-1})),o}return _createClass(n)}(l)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var r=n(6),a=n(1),i="normal",o="normal",s="#000000",l=["butt","round","square"],c=["miter","round","bevel"],u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!==typeof Blob&&!n)return URL.createObjectURL(new Blob([e],{type:t}));for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a="data:".concat(t,";base64,"),i=0,o=e.length;i>2]+r[(3&s)<<4|l>>4]+r[i+1>6:64]+r[i+2>1&2147483647:r>>1&2147483647;t[n]=r}function o(e,n,r,a){var i=a,o=n.length;r[i]=o>>24&255,r[i+1]=o>>16&255,r[i+2]=o>>8&255,r[i+3]=255&o,r[i+=4]=255&e.charCodeAt(0),r[i+1]=255&e.charCodeAt(1),r[i+2]=255&e.charCodeAt(2),r[i+3]=255&e.charCodeAt(3),i+=4,r.set(n,i);var s=function(e,n,r){for(var a=-1,i=n;i>>8^t[o]}return-1^a}(r,a+4,i+=n.length);r[i]=s>>24&255,r[i+1]=s>>16&255,r[i+2]=s>>8&255,r[i+3]=255&s}function s(e){var t=e.length,n=65535,r=Math.ceil(t/n),a=new Uint8Array(2+t+5*r+4),i=0;a[i++]=120,a[i++]=156;for(var o=0;t>n;)a[i++]=0,a[i++]=255,a[i++]=255,a[i++]=0,a[i++]=0,a.set(e.subarray(o,o+n),i),i+=n,o+=n,t-=n;a[i++]=1,a[i++]=255&t,a[i++]=t>>8&255,a[i++]=255&~t,a[i++]=(65535&~t)>>8&255,a.set(e.subarray(o),i),i+=e.length-o;var s=function(e,t,n){for(var r=1,a=0,i=t;i>24&255,a[i++]=s>>16&255,a[i++]=s>>8&255,a[i++]=255&s,a}function l(t,n,r,i){var l,c,d,f=t.width,h=t.height,p=t.data;switch(n){case a.ImageKind.GRAYSCALE_1BPP:c=0,l=1,d=f+7>>3;break;case a.ImageKind.RGB_24BPP:c=2,l=8,d=3*f;break;case a.ImageKind.RGBA_32BPP:c=6,l=8,d=4*f;break;default:throw new Error("invalid format")}for(var v=new Uint8Array((1+d)*h),m=0,g=0,y=0;y>24&255,f>>16&255,f>>8&255,255&f,h>>24&255,h>>16&255,h>>8&255,255&h,l,c,0,0,0]),w=function(e){if(!a.isNodeJS)return s(e);try{var t=parseInt(process.versions.node)>=8?e:Buffer.from(e),n=__webpack_require__(2258).deflateSync(t,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(r){(0,a.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+r)}return s(e)}(v),S=e.length+36+k.length+w.length,x=new Uint8Array(S),P=0;return x.set(e,P),o("IHDR",k,x,P+=e.length),o("IDATA",w,x,P+=12+k.length),P+=12+w.length,o("IEND",new Uint8Array(0),x,P),u(x,"image/png",r)}return function(e,t,n){return l(e,void 0===e.kind?a.ImageKind.GRAYSCALE_1BPP:e.kind,t,n)}}(),f=function(){function e(){_classCallCheck(this,e),this.fontSizeScale=1,this.fontWeight=o,this.fontSize=0,this.textMatrix=a.IDENTITY_MATRIX,this.fontMatrix=a.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=a.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=s,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}return _createClass(e,[{key:"clone",value:function(){return Object.create(this)}},{key:"setCurrentPoint",value:function(e,t){this.x=e,this.y=t}}]),e}();function h(e){if(Number.isInteger(e))return e.toString();var t=e.toFixed(10),n=t.length-1;if("0"!==t[n])return t;do{n--}while("0"===t[n]);return t.substring(0,"."===t[n]?n:n+1)}function p(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":"scale(".concat(h(e[0])," ").concat(h(e[3]),")");if(e[0]===e[3]&&e[1]===-e[2]){var t=180*Math.acos(e[0])/Math.PI;return"rotate(".concat(h(t),")")}}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return"translate(".concat(h(e[4])," ").concat(h(e[5]),")");return"matrix(".concat(h(e[0])," ").concat(h(e[1])," ").concat(h(e[2])," ").concat(h(e[3])," ").concat(h(e[4])," ")+"".concat(h(e[5]),")")}var v=0,m=0,g=0,y=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var o in _classCallCheck(this,e),(0,r.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new r.DOMSVGFactory,this.current=new f,this.transformMatrix=a.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=t,this.objs=n,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!i,this._operatorIdMapping=[],a.OPS)this._operatorIdMapping[a.OPS[o]]=o}return _createClass(e,[{key:"getObject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}},{key:"save",value:function(){this.transformStack.push(this.transformMatrix);var e=this.current;this.extraStack.push(e),this.current=e.clone()}},{key:"restore",value:function(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}},{key:"group",value:function(e){this.save(),this.executeOpTree(e),this.restore()}},{key:"loadDependencies",value:function(e){for(var t=this,n=e.fnArray,r=e.argsArray,i=0,o=n.length;i0&&(this.current.lineWidth=e)}},{key:"setLineCap",value:function(e){this.current.lineCap=l[e]}},{key:"setLineJoin",value:function(e){this.current.lineJoin=c[e]}},{key:"setMiterLimit",value:function(e){this.current.miterLimit=e}},{key:"setStrokeAlpha",value:function(e){this.current.strokeAlpha=e}},{key:"setStrokeRGBColor",value:function(e,t,n){this.current.strokeColor=a.Util.makeHexColor(e,t,n)}},{key:"setFillAlpha",value:function(e){this.current.fillAlpha=e}},{key:"setFillRGBColor",value:function(e,t,n){this.current.fillColor=a.Util.makeHexColor(e,t,n),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}},{key:"setStrokeColorN",value:function(e){this.current.strokeColor=this._makeColorN_Pattern(e)}},{key:"setFillColorN",value:function(e){this.current.fillColor=this._makeColorN_Pattern(e)}},{key:"shadingFill",value:function(e){var t=this.viewport,n=t.width,r=t.height,i=a.Util.inverseTransform(this.transformMatrix),o=a.Util.getAxialAlignedBoundingBox([0,0,n,r],i),s=_slicedToArray(o,4),l=s[0],c=s[1],u=s[2],d=s[3],f=this.svgFactory.createElement("svg:rect");f.setAttributeNS(null,"x",l),f.setAttributeNS(null,"y",c),f.setAttributeNS(null,"width",u-l),f.setAttributeNS(null,"height",d-c),f.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&f.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(f)}},{key:"_makeColorN_Pattern",value:function(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}},{key:"_makeTilingPattern",value:function(e){var t=e[1],n=e[2],r=e[3]||a.IDENTITY_MATRIX,i=_slicedToArray(e[4],4),o=i[0],s=i[1],l=i[2],c=i[3],u=e[5],d=e[6],f=e[7],h="shading".concat(g++),p=a.Util.normalizeRect([].concat(_toConsumableArray(a.Util.applyTransform([o,s],r)),_toConsumableArray(a.Util.applyTransform([l,c],r)))),v=_slicedToArray(p,4),m=v[0],y=v[1],_=v[2],b=v[3],k=a.Util.singularValueDecompose2dScale(r),w=_slicedToArray(k,2),S=u*w[0],x=d*w[1],P=this.svgFactory.createElement("svg:pattern");P.setAttributeNS(null,"id",h),P.setAttributeNS(null,"patternUnits","userSpaceOnUse"),P.setAttributeNS(null,"width",S),P.setAttributeNS(null,"height",x),P.setAttributeNS(null,"x","".concat(m)),P.setAttributeNS(null,"y","".concat(y));var A=this.svg,C=this.transformMatrix,F=this.current.fillColor,E=this.current.strokeColor,M=this.svgFactory.create(_-m,b-y);if(this.svg=M,this.transformMatrix=r,2===f){var T,I=(T=a.Util).makeHexColor.apply(T,_toConsumableArray(t));this.current.fillColor=I,this.current.strokeColor=I}return this.executeOpTree(this.convertOpList(n)),this.svg=A,this.transformMatrix=C,this.current.fillColor=F,this.current.strokeColor=E,P.append(M.childNodes[0]),this.defs.append(P),"url(#".concat(h,")")}},{key:"_makeShadingPattern",value:function(e){switch("string"===typeof e&&(e=this.objs.get(e)),e[0]){case"RadialAxial":var t,n="shading".concat(g++),r=e[3];switch(e[1]){case"axial":var i=e[4],o=e[5];(t=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",n),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"x1",i[0]),t.setAttributeNS(null,"y1",i[1]),t.setAttributeNS(null,"x2",o[0]),t.setAttributeNS(null,"y2",o[1]);break;case"radial":var s=e[4],l=e[5],c=e[6],u=e[7];(t=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",n),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"cx",l[0]),t.setAttributeNS(null,"cy",l[1]),t.setAttributeNS(null,"r",u),t.setAttributeNS(null,"fx",s[0]),t.setAttributeNS(null,"fy",s[1]),t.setAttributeNS(null,"fr",c);break;default:throw new Error("Unknown RadialAxial type: ".concat(e[1]))}var d,f=_createForOfIteratorHelper(r);try{for(f.s();!(d=f.n()).done;){var h=d.value,p=this.svgFactory.createElement("svg:stop");p.setAttributeNS(null,"offset",h[0]),p.setAttributeNS(null,"stop-color",h[1]),t.append(p)}}catch(v){f.e(v)}finally{f.f()}return this.defs.append(t),"url(#".concat(n,")");case"Mesh":return(0,a.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(e[0]))}}},{key:"setDash",value:function(e,t){this.current.dashArray=e,this.current.dashPhase=t}},{key:"constructPath",value:function(e,t){var n,r=this.current,i=r.x,o=r.y,s=[],l=0,c=_createForOfIteratorHelper(e);try{for(c.s();!(n=c.n()).done;)switch(0|n.value){case a.OPS.rectangle:i=t[l++],o=t[l++];var u=t[l++],d=t[l++],f=i+u,p=o+d;s.push("M",h(i),h(o),"L",h(f),h(o),"L",h(f),h(p),"L",h(i),h(p),"Z");break;case a.OPS.moveTo:i=t[l++],o=t[l++],s.push("M",h(i),h(o));break;case a.OPS.lineTo:i=t[l++],o=t[l++],s.push("L",h(i),h(o));break;case a.OPS.curveTo:i=t[l+4],o=t[l+5],s.push("C",h(t[l]),h(t[l+1]),h(t[l+2]),h(t[l+3]),h(i),h(o)),l+=6;break;case a.OPS.curveTo2:s.push("C",h(i),h(o),h(t[l]),h(t[l+1]),h(t[l+2]),h(t[l+3])),i=t[l+2],o=t[l+3],l+=4;break;case a.OPS.curveTo3:i=t[l+2],o=t[l+3],s.push("C",h(t[l]),h(t[l+1]),h(i),h(o),h(i),h(o)),l+=4;break;case a.OPS.closePath:s.push("Z")}}catch(v){c.e(v)}finally{c.f()}s=s.join(" "),r.path&&e.length>0&&e[0]!==a.OPS.rectangle&&e[0]!==a.OPS.moveTo?s=r.path.getAttributeNS(null,"d")+s:(r.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(r.path)),r.path.setAttributeNS(null,"d",s),r.path.setAttributeNS(null,"fill","none"),r.element=r.path,r.setCurrentPoint(i,o)}},{key:"endPath",value:function(){var e=this.current;if(e.path=null,this.pendingClip)if(e.element){var t="clippath".concat(v++),n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",t),n.setAttributeNS(null,"transform",p(this.transformMatrix));var r=e.element.cloneNode(!0);if("evenodd"===this.pendingClip?r.setAttributeNS(null,"clip-rule","evenodd"):r.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.append(r),this.defs.append(n),e.activeClipUrl){e.clipGroup=null;var a,i=_createForOfIteratorHelper(this.extraStack);try{for(i.s();!(a=i.n()).done;)a.value.clipGroup=null}catch(o){i.e(o)}finally{i.f()}n.setAttributeNS(null,"clip-path",e.activeClipUrl)}e.activeClipUrl="url(#".concat(t,")"),this.tgrp=null}else this.pendingClip=null}},{key:"clip",value:function(e){this.pendingClip=e}},{key:"closePath",value:function(){var e=this.current;if(e.path){var t="".concat(e.path.getAttributeNS(null,"d"),"Z");e.path.setAttributeNS(null,"d",t)}}},{key:"setLeading",value:function(e){this.current.leading=-e}},{key:"setTextRise",value:function(e){this.current.textRise=e}},{key:"setTextRenderingMode",value:function(e){this.current.textRenderingMode=e}},{key:"setHScale",value:function(e){this.current.textHScale=e/100}},{key:"setRenderingIntent",value:function(e){}},{key:"setFlatness",value:function(e){}},{key:"setGState",value:function(e){var t,n=_createForOfIteratorHelper(e);try{for(n.s();!(t=n.n()).done;){var r=_slicedToArray(t.value,2),i=r[0],o=r[1];switch(i){case"LW":this.setLineWidth(o);break;case"LC":this.setLineCap(o);break;case"LJ":this.setLineJoin(o);break;case"ML":this.setMiterLimit(o);break;case"D":this.setDash(o[0],o[1]);break;case"RI":this.setRenderingIntent(o);break;case"FL":this.setFlatness(o);break;case"Font":this.setFont(o);break;case"CA":this.setStrokeAlpha(o);break;case"ca":this.setFillAlpha(o);break;default:(0,a.warn)("Unimplemented graphic state operator ".concat(i))}}}catch(s){n.e(s)}finally{n.f()}}},{key:"fill",value:function(){var e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}},{key:"stroke",value:function(){var e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}},{key:"_setStrokeAttributes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.current,r=n.dashArray;1!==t&&r.length>0&&(r=r.map((function(e){return t*e}))),e.setAttributeNS(null,"stroke",n.strokeColor),e.setAttributeNS(null,"stroke-opacity",n.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",h(n.miterLimit)),e.setAttributeNS(null,"stroke-linecap",n.lineCap),e.setAttributeNS(null,"stroke-linejoin",n.lineJoin),e.setAttributeNS(null,"stroke-width",h(t*n.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",r.map(h).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",h(t*n.dashPhase)+"px")}},{key:"eoFill",value:function(){var e;null===(e=this.current.element)||void 0===e||e.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}},{key:"fillStroke",value:function(){this.stroke(),this.fill()}},{key:"eoFillStroke",value:function(){var e;null===(e=this.current.element)||void 0===e||e.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}},{key:"closeStroke",value:function(){this.closePath(),this.stroke()}},{key:"closeFillStroke",value:function(){this.closePath(),this.fillStroke()}},{key:"closeEOFillStroke",value:function(){this.closePath(),this.eoFillStroke()}},{key:"paintSolidColorImageMask",value:function(){var e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(e)}},{key:"paintImageXObject",value:function(e){var t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,a.warn)("Dependent image with object ID ".concat(e," is not ready yet"))}},{key:"paintInlineImageXObject",value:function(e,t){var n=e.width,r=e.height,a=d(e,this.forceDataSchema,!!t),i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y","0"),i.setAttributeNS(null,"width",h(n)),i.setAttributeNS(null,"height",h(r)),this.current.element=i,this.clip("nonzero");var o=this.svgFactory.createElement("svg:image");o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y",h(-r)),o.setAttributeNS(null,"width",h(n)+"px"),o.setAttributeNS(null,"height",h(r)+"px"),o.setAttributeNS(null,"transform","scale(".concat(h(1/n)," ").concat(h(-1/r),")")),t?t.append(o):this._ensureTransformGroup().append(o)}},{key:"paintImageMaskXObject",value:function(e){var t=this.getObject(e.data,e);if(t.bitmap)(0,a.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");else{var n=this.current,r=t.width,i=t.height,o=n.fillColor;n.maskId="mask".concat(m++);var s=this.svgFactory.createElement("svg:mask");s.setAttributeNS(null,"id",n.maskId);var l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width",h(r)),l.setAttributeNS(null,"height",h(i)),l.setAttributeNS(null,"fill",o),l.setAttributeNS(null,"mask","url(#".concat(n.maskId,")")),this.defs.append(s),this._ensureTransformGroup().append(l),this.paintInlineImageXObject(t,s)}}},{key:"paintFormXObjectBegin",value:function(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t){var n=t[2]-t[0],r=t[3]-t[1],a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x",t[0]),a.setAttributeNS(null,"y",t[1]),a.setAttributeNS(null,"width",h(n)),a.setAttributeNS(null,"height",h(r)),this.current.element=a,this.clip("nonzero"),this.endPath()}}},{key:"paintFormXObjectEnd",value:function(){}},{key:"_initialize",value:function(e){var t=this.svgFactory.create(e.width,e.height),n=this.svgFactory.createElement("svg:defs");t.append(n),this.defs=n;var r=this.svgFactory.createElement("svg:g");return r.setAttributeNS(null,"transform",p(e.transform)),t.append(r),this.svg=r,t}},{key:"_ensureClipGroup",value:function(){if(!this.current.clipGroup){var e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(e),this.current.clipGroup=e}return this.current.clipGroup}},{key:"_ensureTransformGroup",value:function(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",p(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}]),e}();t.SVGGraphics=y},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.XfaText=void 0;var n=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"textContent",value:function(t){var n=[],r={items:n,styles:Object.create(null)};return function t(r){var a;if(r){var i=null,o=r.name;if("#text"===o)i=r.value;else{if(!e.shouldBuildText(o))return;null!==r&&void 0!==r&&null!==(a=r.attributes)&&void 0!==a&&a.textContent?i=r.attributes.textContent:r.value&&(i=r.value)}if(null!==i&&n.push({str:i}),r.children){var s,l=_createForOfIteratorHelper(r.children);try{for(l.s();!(s=l.n()).done;)t(s.value)}catch(c){l.e(c)}finally{l.f()}}}}(t),r}},{key:"shouldBuildText",value:function(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}]),e}();t.XfaText=n},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerRenderTask=void 0,t.renderTextLayer=function(e){e.textContentSource||!e.textContent&&!e.textContentStream||((0,a.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),e.textContentSource=e.textContent||e.textContentStream);var t=e.container,n=e.viewport,r=getComputedStyle(t),i=r.getPropertyValue("visibility"),o=parseFloat(r.getPropertyValue("--scale-factor"));"visible"===i&&(!o||Math.abs(o-n.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");var s=new d(e);return s._render(),s},t.updateTextLayer=function(e){var t=e.container,n=e.viewport,r=e.textDivs,i=e.textDivProperties,o=e.isOffscreenCanvasSupported,s=e.mustRotate,c=void 0===s||s,d=e.mustRescale,f=void 0===d||d;if(c&&(0,a.setLayerDimensions)(t,{rotation:n.rotation}),f){var h,p=l(0,o),v={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:p},m=_createForOfIteratorHelper(r);try{for(m.s();!(h=m.n()).done;){var g=h.value;v.properties=i.get(g),v.div=g,u(v)}}catch(y){m.e(y)}finally{m.f()}}};var r=n(1),a=n(6),i=30,o=.8,s=new Map;function l(e,t){var n;if(t&&r.FeatureTest.isOffscreenCanvasSupported)n=new OffscreenCanvas(e,e).getContext("2d",{alpha:!1});else{var a=document.createElement("canvas");a.width=a.height=e,n=a.getContext("2d",{alpha:!1})}return n}function c(e,t,n){var a=document.createElement("span"),c={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(a);var u=r.Util.transform(e._transform,t.transform),d=Math.atan2(u[1],u[0]),f=n[t.fontName];f.vertical&&(d+=Math.PI/2);var h,p,v=Math.hypot(u[2],u[3]),m=v*function(e,t){var n=s.get(e);if(n)return n;var r=l(i,t);r.font="".concat(i,"px ").concat(e);var a=r.measureText(""),c=a.fontBoundingBoxAscent,u=Math.abs(a.fontBoundingBoxDescent);if(c){var d=c/(c+u);return s.set(e,d),r.canvas.width=r.canvas.height=0,d}r.strokeStyle="red",r.clearRect(0,0,i,i),r.strokeText("g",0,0);var f=r.getImageData(0,0,i,i).data;u=0;for(var h=f.length-1-3;h>=0;h-=4)if(f[h]>0){u=Math.ceil(h/4/i);break}r.clearRect(0,0,i,i),r.strokeText("A",0,i),c=0;for(var p=0,v=(f=r.getImageData(0,0,i,i).data).length;p0){c=i-Math.floor(p/4/i);break}if(r.canvas.width=r.canvas.height=0,c){var m=c/(c+u);return s.set(e,m),m}return s.set(e,o),o}(f.fontFamily,e._isOffscreenCanvasSupported);0===d?(h=u[4],p=u[5]-m):(h=u[4]+m*Math.sin(d),p=u[5]-m*Math.cos(d));var g="calc(var(--scale-factor)*",y=a.style;e._container===e._rootContainer?(y.left="".concat((100*h/e._pageWidth).toFixed(2),"%"),y.top="".concat((100*p/e._pageHeight).toFixed(2),"%")):(y.left="".concat(g).concat(h.toFixed(2),"px)"),y.top="".concat(g).concat(p.toFixed(2),"px)")),y.fontSize="".concat(g).concat(v.toFixed(2),"px)"),y.fontFamily=f.fontFamily,c.fontSize=v,a.setAttribute("role","presentation"),a.textContent=t.str,a.dir=t.dir,e._fontInspectorEnabled&&(a.dataset.fontName=t.fontName),0!==d&&(c.angle=d*(180/Math.PI));var _=!1;if(t.str.length>1)_=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){var b=Math.abs(t.transform[0]),k=Math.abs(t.transform[3]);b!==k&&Math.max(b,k)/Math.min(b,k)>1.5&&(_=!0)}_&&(c.canvasWidth=f.vertical?t.height:t.width),e._textDivProperties.set(a,c),e._isReadableStream&&e._layoutText(a)}function u(e){var t=e.div,n=e.scale,r=e.properties,a=e.ctx,i=e.prevFontSize,o=e.prevFontFamily,s=t.style,l="";if(0!==r.canvasWidth&&r.hasText){var c=s.fontFamily,u=r.canvasWidth,d=r.fontSize;i===d&&o===c||(a.font="".concat(d*n,"px ").concat(c),e.prevFontSize=d,e.prevFontFamily=c);var f=a.measureText(t.textContent).width;f>0&&(l="scaleX(".concat(u*n/f,")"))}0!==r.angle&&(l="rotate(".concat(r.angle,"deg) ").concat(l)),l.length>0&&(s.transform=l)}var d=function(){function e(t){var n,i=this,o=t.textContentSource,s=t.container,c=t.viewport,u=t.textDivs,d=t.textDivProperties,f=t.textContentItemsStr,h=t.isOffscreenCanvasSupported;_classCallCheck(this,e),this._textContentSource=o,this._isReadableStream=o instanceof ReadableStream,this._container=this._rootContainer=s,this._textDivs=u||[],this._textContentItemsStr=f||[],this._isOffscreenCanvasSupported=h,this._fontInspectorEnabled=!(null===(n=globalThis.FontInspector)||void 0===n||!n.enabled),this._reader=null,this._textDivProperties=d||new WeakMap,this._canceled=!1,this._capability=new r.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:c.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:l(0,h)};var p=c.rawDims,v=p.pageWidth,m=p.pageHeight,g=p.pageX,y=p.pageY;this._transform=[1,0,0,-1,-g,y+m],this._pageWidth=v,this._pageHeight=m,(0,a.setLayerDimensions)(s,c),this._capability.promise.finally((function(){i._layoutTextParams=null})).catch((function(){}))}return _createClass(e,[{key:"promise",get:function(){return this._capability.promise}},{key:"cancel",value:function(){this._canceled=!0,this._reader&&(this._reader.cancel(new r.AbortException("TextLayer task cancelled.")).catch((function(){})),this._reader=null),this._capability.reject(new r.AbortException("TextLayer task cancelled."))}},{key:"_processItems",value:function(e,t){var n,r=_createForOfIteratorHelper(e);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(void 0!==a.str)this._textContentItemsStr.push(a.str),c(this,a,t);else if("beginMarkedContentProps"===a.type||"beginMarkedContent"===a.type){var i=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==a.id&&this._container.setAttribute("id","".concat(a.id)),i.append(this._container)}else"endMarkedContent"===a.type&&(this._container=this._container.parentNode)}}catch(o){r.e(o)}finally{r.f()}}},{key:"_layoutText",value:function(e){var t=this._layoutTextParams.properties=this._textDivProperties.get(e);if(this._layoutTextParams.div=e,u(this._layoutTextParams),t.hasText&&this._container.append(e),t.hasEOL){var n=document.createElement("br");n.setAttribute("role","presentation"),this._container.append(n)}}},{key:"_render",value:function(){var e=this,t=new r.PromiseCapability,n=Object.create(null);if(this._isReadableStream)this._reader=this._textContentSource.getReader(),function r(){e._reader.read().then((function(a){var i=a.value;a.done?t.resolve():(Object.assign(n,i.styles),e._processItems(i.items,n),r())}),t.reject)}();else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');var a=this._textContentSource,i=a.items,o=a.styles;this._processItems(i,o),t.resolve()}t.promise.then((function(){n=null,function(e){if(!e._canceled){var t=e._textDivs,n=e._capability;if(t.length>1e5)n.resolve();else{if(!e._isReadableStream){var r,a=_createForOfIteratorHelper(t);try{for(a.s();!(r=a.n()).done;){var i=r.value;e._layoutText(i)}}catch(o){a.e(o)}finally{a.f()}}n.resolve()}}}(e)}),this._capability.reject)}}]),e}();t.TextLayerRenderTask=d},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayer=void 0;var r=n(1),a=n(4),i=n(28),o=n(33),s=n(6),l=n(34),c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,h=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,g=new WeakMap,y=new WeakMap,_=new WeakSet,b=new WeakSet,k=new WeakSet,w=new WeakSet,S=function(){function e(t){var n=t.uiManager,r=t.pageIndex,a=t.div,s=t.accessibilityManager,S=t.annotationLayer,x=t.viewport,P=t.l10n;_classCallCheck(this,e),_classPrivateMethodInitSpec(this,w),_classPrivateMethodInitSpec(this,k),_classPrivateMethodInitSpec(this,b),_classPrivateMethodInitSpec(this,_),_classPrivateFieldInitSpec(this,c,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,u,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,d,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,f,{writable:!0,value:this.pointerup.bind(this)}),_classPrivateFieldInitSpec(this,h,{writable:!0,value:this.pointerdown.bind(this)}),_classPrivateFieldInitSpec(this,p,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,v,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,m,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,g,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,y,{writable:!0,value:void 0});var A=[i.FreeTextEditor,o.InkEditor,l.StampEditor];if(!e._initialized){e._initialized=!0;var C,F=_createForOfIteratorHelper(A);try{for(F.s();!(C=F.n()).done;)C.value.initialize(P)}catch(E){F.e(E)}finally{F.f()}}n.registerEditorTypes(A),_classPrivateFieldSet(this,y,n),this.pageIndex=r,this.div=a,_classPrivateFieldSet(this,c,s),_classPrivateFieldSet(this,d,S),this.viewport=x,_classPrivateFieldGet(this,y).addLayer(this)}return _createClass(e,[{key:"isEmpty",get:function(){return 0===_classPrivateFieldGet(this,p).size}},{key:"updateToolbar",value:function(e){_classPrivateFieldGet(this,y).updateToolbar(e)}},{key:"updateMode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_classPrivateFieldGet(this,y).getMode();_classPrivateMethodGet(this,w,C).call(this),e===r.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),e!==r.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",e===r.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",e===r.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",e===r.AnnotationEditorType.STAMP),this.div.hidden=!1)}},{key:"addInkEditorIfNeeded",value:function(e){if(e||_classPrivateFieldGet(this,y).getMode()===r.AnnotationEditorType.INK){if(!e){var t,n=_createForOfIteratorHelper(_classPrivateFieldGet(this,p).values());try{for(n.s();!(t=n.n()).done;){var a=t.value;if(a.isEmpty())return void a.setInBackground()}}catch(i){n.e(i)}finally{n.f()}}_classPrivateMethodGet(this,b,P).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}}},{key:"setEditingState",value:function(e){_classPrivateFieldGet(this,y).setEditingState(e)}},{key:"addCommands",value:function(e){_classPrivateFieldGet(this,y).addCommands(e)}},{key:"enable",value:function(){this.div.style.pointerEvents="auto";var e,t=new Set,n=_createForOfIteratorHelper(_classPrivateFieldGet(this,p).values());try{for(n.s();!(e=n.n()).done;){var r=e.value;r.enableEditing(),r.annotationElementId&&t.add(r.annotationElementId)}}catch(c){n.e(c)}finally{n.f()}if(_classPrivateFieldGet(this,d)){var a,i=_classPrivateFieldGet(this,d).getEditableAnnotations(),o=_createForOfIteratorHelper(i);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(s.hide(),!_classPrivateFieldGet(this,y).isDeletedAnnotationElement(s.data.id)&&!t.has(s.data.id)){var l=this.deserialize(s);l&&(this.addOrRebuild(l),l.enableEditing())}}}catch(c){o.e(c)}finally{o.f()}}}},{key:"disable",value:function(){_classPrivateFieldSet(this,g,!0),this.div.style.pointerEvents="none";var e,t=new Set,n=_createForOfIteratorHelper(_classPrivateFieldGet(this,p).values());try{for(n.s();!(e=n.n()).done;){var r,a=e.value;a.disableEditing(),a.annotationElementId&&null===a.serialize()?(null===(r=this.getEditableAnnotation(a.annotationElementId))||void 0===r||r.show(),a.remove()):t.add(a.annotationElementId)}}catch(u){n.e(u)}finally{n.f()}if(_classPrivateFieldGet(this,d)){var i,o=_classPrivateFieldGet(this,d).getEditableAnnotations(),s=_createForOfIteratorHelper(o);try{for(s.s();!(i=s.n()).done;){var l=i.value,c=l.data.id;t.has(c)||_classPrivateFieldGet(this,y).isDeletedAnnotationElement(c)||l.show()}}catch(u){s.e(u)}finally{s.f()}}_classPrivateMethodGet(this,w,C).call(this),this.isEmpty&&(this.div.hidden=!0),_classPrivateFieldSet(this,g,!1)}},{key:"getEditableAnnotation",value:function(e){var t;return(null===(t=_classPrivateFieldGet(this,d))||void 0===t?void 0:t.getEditableAnnotation(e))||null}},{key:"setActiveEditor",value:function(e){_classPrivateFieldGet(this,y).getActive()!==e&&_classPrivateFieldGet(this,y).setActiveEditor(e)}},{key:"enableClick",value:function(){this.div.addEventListener("pointerdown",_classPrivateFieldGet(this,h)),this.div.addEventListener("pointerup",_classPrivateFieldGet(this,f))}},{key:"disableClick",value:function(){this.div.removeEventListener("pointerdown",_classPrivateFieldGet(this,h)),this.div.removeEventListener("pointerup",_classPrivateFieldGet(this,f))}},{key:"attach",value:function(e){_classPrivateFieldGet(this,p).set(e.id,e);var t=e.annotationElementId;t&&_classPrivateFieldGet(this,y).isDeletedAnnotationElement(t)&&_classPrivateFieldGet(this,y).removeDeletedAnnotationElement(e)}},{key:"detach",value:function(e){var t;_classPrivateFieldGet(this,p).delete(e.id),null===(t=_classPrivateFieldGet(this,c))||void 0===t||t.removePointerInTextLayer(e.contentDiv),!_classPrivateFieldGet(this,g)&&e.annotationElementId&&_classPrivateFieldGet(this,y).addDeletedAnnotationElement(e)}},{key:"remove",value:function(e){var t=this;this.detach(e),_classPrivateFieldGet(this,y).removeEditor(e),e.div.contains(document.activeElement)&&setTimeout((function(){_classPrivateFieldGet(t,y).focusMainContainer()}),0),e.div.remove(),e.isAttachedToDOM=!1,_classPrivateFieldGet(this,m)||this.addInkEditorIfNeeded(!1)}},{key:"changeParent",value:function(e){var t;e.parent!==this&&(e.annotationElementId&&(_classPrivateFieldGet(this,y).addDeletedAnnotationElement(e.annotationElementId),a.AnnotationEditor.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),null===(t=e.parent)||void 0===t||t.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}},{key:"add",value:function(e){if(this.changeParent(e),_classPrivateFieldGet(this,y).addEditor(e),this.attach(e),!e.isAttachedToDOM){var t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),_classPrivateFieldGet(this,y).addToAnnotationStorage(e)}},{key:"moveEditorInDOM",value:function(e){var t;if(e.isAttachedToDOM){var n=document.activeElement;e.div.contains(n)&&(e._focusEventsAllowed=!1,setTimeout((function(){e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",(function(){e._focusEventsAllowed=!0}),{once:!0}),n.focus())}),0)),e._structTreeParentId=null===(t=_classPrivateFieldGet(this,c))||void 0===t?void 0:t.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}}},{key:"addOrRebuild",value:function(e){e.needsToBeRebuilt()?e.rebuild():this.add(e)}},{key:"addUndoableEditor",value:function(e){this.addCommands({cmd:function(){return e._uiManager.rebuild(e)},undo:function(){e.remove()},mustExec:!1})}},{key:"getNextId",value:function(){return _classPrivateFieldGet(this,y).getId()}},{key:"pasteEditor",value:function(e,t){_classPrivateFieldGet(this,y).updateToolbar(e),_classPrivateFieldGet(this,y).updateMode(e);var n=_classPrivateMethodGet(this,k,A).call(this),r=n.offsetX,a=n.offsetY,i=this.getNextId(),o=_classPrivateMethodGet(this,_,x).call(this,_objectSpread({parent:this,id:i,x:r,y:a,uiManager:_classPrivateFieldGet(this,y),isCentered:!0},t));o&&this.add(o)}},{key:"deserialize",value:function(e){var t;switch(null!==(t=e.annotationType)&&void 0!==t?t:e.annotationEditorType){case r.AnnotationEditorType.FREETEXT:return i.FreeTextEditor.deserialize(e,this,_classPrivateFieldGet(this,y));case r.AnnotationEditorType.INK:return o.InkEditor.deserialize(e,this,_classPrivateFieldGet(this,y));case r.AnnotationEditorType.STAMP:return l.StampEditor.deserialize(e,this,_classPrivateFieldGet(this,y))}return null}},{key:"addNewEditor",value:function(){_classPrivateMethodGet(this,b,P).call(this,_classPrivateMethodGet(this,k,A).call(this),!0)}},{key:"setSelected",value:function(e){_classPrivateFieldGet(this,y).setSelected(e)}},{key:"toggleSelected",value:function(e){_classPrivateFieldGet(this,y).toggleSelected(e)}},{key:"isSelected",value:function(e){return _classPrivateFieldGet(this,y).isSelected(e)}},{key:"unselect",value:function(e){_classPrivateFieldGet(this,y).unselect(e)}},{key:"pointerup",value:function(e){var t=r.FeatureTest.platform.isMac;0!==e.button||e.ctrlKey&&t||e.target===this.div&&_classPrivateFieldGet(this,v)&&(_classPrivateFieldSet(this,v,!1),_classPrivateFieldGet(this,u)?_classPrivateFieldGet(this,y).getMode()!==r.AnnotationEditorType.STAMP?_classPrivateMethodGet(this,b,P).call(this,e,!1):_classPrivateFieldGet(this,y).unselectAll():_classPrivateFieldSet(this,u,!0))}},{key:"pointerdown",value:function(e){if(_classPrivateFieldGet(this,v))_classPrivateFieldSet(this,v,!1);else{var t=r.FeatureTest.platform.isMac;if(!(0!==e.button||e.ctrlKey&&t)&&e.target===this.div){_classPrivateFieldSet(this,v,!0);var n=_classPrivateFieldGet(this,y).getActive();_classPrivateFieldSet(this,u,!n||n.isEmpty())}}}},{key:"findNewParent",value:function(e,t,n){var r=_classPrivateFieldGet(this,y).findParent(t,n);return null!==r&&r!==this&&(r.changeParent(e),!0)}},{key:"destroy",value:function(){var e;(null===(e=_classPrivateFieldGet(this,y).getActive())||void 0===e?void 0:e.parent)===this&&(_classPrivateFieldGet(this,y).commitOrRemove(),_classPrivateFieldGet(this,y).setActiveEditor(null));var t,n=_createForOfIteratorHelper(_classPrivateFieldGet(this,p).values());try{for(n.s();!(t=n.n()).done;){var r,a=t.value;null===(r=_classPrivateFieldGet(this,c))||void 0===r||r.removePointerInTextLayer(a.contentDiv),a.setParent(null),a.isAttachedToDOM=!1,a.div.remove()}}catch(i){n.e(i)}finally{n.f()}this.div=null,_classPrivateFieldGet(this,p).clear(),_classPrivateFieldGet(this,y).removeLayer(this)}},{key:"render",value:function(e){var t=e.viewport;this.viewport=t,(0,s.setLayerDimensions)(this.div,t);var n,r=_createForOfIteratorHelper(_classPrivateFieldGet(this,y).getEditors(this.pageIndex));try{for(r.s();!(n=r.n()).done;){var a=n.value;this.add(a)}}catch(i){r.e(i)}finally{r.f()}this.updateMode()}},{key:"update",value:function(e){var t=e.viewport;_classPrivateFieldGet(this,y).commitOrRemove(),this.viewport=t,(0,s.setLayerDimensions)(this.div,{rotation:t.rotation}),this.updateMode()}},{key:"pageDimensions",get:function(){var e=this.viewport.rawDims;return[e.pageWidth,e.pageHeight]}}]),e}();function x(e){switch(_classPrivateFieldGet(this,y).getMode()){case r.AnnotationEditorType.FREETEXT:return new i.FreeTextEditor(e);case r.AnnotationEditorType.INK:return new o.InkEditor(e);case r.AnnotationEditorType.STAMP:return new l.StampEditor(e)}return null}function P(e,t){var n=this.getNextId(),r=_classPrivateMethodGet(this,_,x).call(this,{parent:this,id:n,x:e.offsetX,y:e.offsetY,uiManager:_classPrivateFieldGet(this,y),isCentered:t});return r&&this.add(r),r}function A(){var e=this.div.getBoundingClientRect(),t=e.x,n=e.y,r=e.width,a=e.height,i=Math.max(0,t),o=Math.max(0,n),s=(i+Math.min(window.innerWidth,t+r))/2-t,l=(o+Math.min(window.innerHeight,n+a))/2-n,c=this.viewport.rotation%180===0?[s,l]:[l,s],u=_slicedToArray(c,2);return{offsetX:u[0],offsetY:u[1]}}function C(){_classPrivateFieldSet(this,m,!0);var e,t=_createForOfIteratorHelper(_classPrivateFieldGet(this,p).values());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.isEmpty()&&n.remove()}}catch(r){t.e(r)}finally{t.f()}_classPrivateFieldSet(this,m,!1)}_defineProperty(S,"_initialized",!1),t.AnnotationEditorLayer=S},function(e,t,n){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextEditor=void 0;var a=n(1),i=n(5),o=n(4),s=n(29),l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,h=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,g=new WeakSet,y=new WeakSet,_=new WeakSet,b=new WeakSet,k=new WeakSet,w=new WeakSet,S=new WeakSet,x=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var r;return _classCallCheck(this,n),r=t.call(this,_objectSpread(_objectSpread({},e),{},{name:"freeTextEditor"})),_classPrivateMethodInitSpec(_assertThisInitialized(r),S),_classPrivateMethodInitSpec(_assertThisInitialized(r),w),_classPrivateMethodInitSpec(_assertThisInitialized(r),k),_classPrivateMethodInitSpec(_assertThisInitialized(r),b),_classPrivateMethodInitSpec(_assertThisInitialized(r),_),_classPrivateMethodInitSpec(_assertThisInitialized(r),y),_classPrivateMethodInitSpec(_assertThisInitialized(r),g),_classPrivateFieldInitSpec(_assertThisInitialized(r),l,{writable:!0,value:r.editorDivBlur.bind(_assertThisInitialized(r))}),_classPrivateFieldInitSpec(_assertThisInitialized(r),c,{writable:!0,value:r.editorDivFocus.bind(_assertThisInitialized(r))}),_classPrivateFieldInitSpec(_assertThisInitialized(r),u,{writable:!0,value:r.editorDivInput.bind(_assertThisInitialized(r))}),_classPrivateFieldInitSpec(_assertThisInitialized(r),d,{writable:!0,value:r.editorDivKeydown.bind(_assertThisInitialized(r))}),_classPrivateFieldInitSpec(_assertThisInitialized(r),f,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(r),h,{writable:!0,value:""}),_classPrivateFieldInitSpec(_assertThisInitialized(r),p,{writable:!0,value:"".concat(r.id,"-editor")}),_classPrivateFieldInitSpec(_assertThisInitialized(r),v,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(_assertThisInitialized(r),m,{writable:!0,value:null}),_classPrivateFieldSet(_assertThisInitialized(r),f,e.color||n._defaultColor||o.AnnotationEditor._defaultLineColor),_classPrivateFieldSet(_assertThisInitialized(r),v,e.fontSize||n._defaultFontSize),r}return _createClass(n,[{key:"updateParams",value:function(e,t){switch(e){case a.AnnotationEditorParamsType.FREETEXT_SIZE:_classPrivateMethodGet(this,g,P).call(this,t);break;case a.AnnotationEditorParamsType.FREETEXT_COLOR:_classPrivateMethodGet(this,y,A).call(this,t)}}},{key:"propertiesToUpdate",get:function(){return[[a.AnnotationEditorParamsType.FREETEXT_SIZE,_classPrivateFieldGet(this,v)],[a.AnnotationEditorParamsType.FREETEXT_COLOR,_classPrivateFieldGet(this,f)]]}},{key:"_translateEmpty",value:function(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}},{key:"getInitialTranslation",value:function(){var e=this.parentScale;return[-n._internalPadding*e,-(n._internalPadding+_classPrivateFieldGet(this,v))*e]}},{key:"rebuild",value:function(){this.parent&&(_get4(_getPrototypeOf(n.prototype),"rebuild",this).call(this),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}},{key:"enableEditMode",value:function(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(a.AnnotationEditorType.FREETEXT),_get4(_getPrototypeOf(n.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",_classPrivateFieldGet(this,d)),this.editorDiv.addEventListener("focus",_classPrivateFieldGet(this,c)),this.editorDiv.addEventListener("blur",_classPrivateFieldGet(this,l)),this.editorDiv.addEventListener("input",_classPrivateFieldGet(this,u)))}},{key:"disableEditMode",value:function(){this.isInEditMode()&&(this.parent.setEditingState(!0),_get4(_getPrototypeOf(n.prototype),"disableEditMode",this).call(this),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",_classPrivateFieldGet(this,p)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",_classPrivateFieldGet(this,d)),this.editorDiv.removeEventListener("focus",_classPrivateFieldGet(this,c)),this.editorDiv.removeEventListener("blur",_classPrivateFieldGet(this,l)),this.editorDiv.removeEventListener("input",_classPrivateFieldGet(this,u)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}},{key:"focusin",value:function(e){this._focusEventsAllowed&&(_get4(_getPrototypeOf(n.prototype),"focusin",this).call(this,e),e.target!==this.editorDiv&&this.editorDiv.focus())}},{key:"onceAdded",value:function(){var e;this.width?_classPrivateMethodGet(this,S,T).call(this):(this.enableEditMode(),this.editorDiv.focus(),null!==(e=this._initialOptions)&&void 0!==e&&e.isCentered&&this.center(),this._initialOptions=null)}},{key:"isEmpty",value:function(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}},{key:"remove",value:function(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),_get4(_getPrototypeOf(n.prototype),"remove",this).call(this)}},{key:"commit",value:function(){var e=this;if(this.isInEditMode()){_get4(_getPrototypeOf(n.prototype),"commit",this).call(this),this.disableEditMode();var t=_classPrivateFieldGet(this,h),r=_classPrivateFieldSet(this,h,_classPrivateMethodGet(this,_,C).call(this).trimEnd());if(t!==r){var a=function(t){_classPrivateFieldSet(e,h,t),t?(_classPrivateMethodGet(e,k,E).call(e),e._uiManager.rebuild(e),_classPrivateMethodGet(e,b,F).call(e)):e.remove()};this.addCommands({cmd:function(){a(r)},undo:function(){a(t)},mustExec:!1}),_classPrivateMethodGet(this,b,F).call(this)}}}},{key:"shouldGetKeyboardEvents",value:function(){return this.isInEditMode()}},{key:"enterInEditMode",value:function(){this.enableEditMode(),this.editorDiv.focus()}},{key:"dblclick",value:function(e){this.enterInEditMode()}},{key:"keydown",value:function(e){e.target===this.div&&"Enter"===e.key&&(this.enterInEditMode(),e.preventDefault())}},{key:"editorDivKeydown",value:function(e){n._keyboardManager.exec(this,e)}},{key:"editorDivFocus",value:function(e){this.isEditing=!0}},{key:"editorDivBlur",value:function(e){this.isEditing=!1}},{key:"editorDivInput",value:function(e){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}},{key:"disableEditing",value:function(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}},{key:"enableEditing",value:function(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}},{key:"render",value:function(){var e,t,r=this;if(this.div)return this.div;this.width&&(e=this.x,t=this.y),_get4(_getPrototypeOf(n.prototype),"render",this).call(this),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",_classPrivateFieldGet(this,p)),this.enableEditing(),o.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then((function(e){var t;return null===(t=r.editorDiv)||void 0===t?void 0:t.setAttribute("aria-label",e)})),o.AnnotationEditor._l10nPromise.get("free_text2_default_content").then((function(e){var t;return null===(t=r.editorDiv)||void 0===t?void 0:t.setAttribute("default-content",e)})),this.editorDiv.contentEditable=!0;var a=this.editorDiv.style;if(a.fontSize="calc(".concat(_classPrivateFieldGet(this,v),"px * var(--scale-factor))"),a.color=_classPrivateFieldGet(this,f),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,i.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){var s=_slicedToArray(this.parentDimensions,2),l=s[0],c=s[1];if(this.annotationElementId){var u=_classPrivateFieldGet(this,m).position,d=this.getInitialTranslation(),h=_slicedToArray(d,2),g=h[0],y=h[1],_=this.pageTranslationToScreen(g,y),b=_slicedToArray(_,2);g=b[0],y=b[1];var w,S,x=_slicedToArray(this.pageDimensions,2),P=x[0],A=x[1],C=_slicedToArray(this.pageTranslation,2),F=C[0],M=C[1];switch(this.rotation){case 0:w=e+(u[0]-F)/P,S=t+this.height-(u[1]-M)/A;break;case 90:w=e+(u[0]-F)/P,S=t-(u[1]-M)/A;var T=[y,-g];g=T[0],y=T[1];break;case 180:w=e-this.width+(u[0]-F)/P,S=t-(u[1]-M)/A;var I=[-g,-y];g=I[0],y=I[1];break;case 270:w=e+(u[0]-F-this.height*A)/P,S=t+(u[1]-M-this.width*P)/A;var R=[-y,g];g=R[0],y=R[1]}this.setAt(w*l,S*c,g,y)}else this.setAt(e*l,t*c,this.width*l,this.height*c);_classPrivateMethodGet(this,k,E).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}},{key:"contentDiv",get:function(){return this.editorDiv}},{key:"serialize",value:function(){var e=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 t=n._internalPadding*this.parentScale,r=this.getRect(t,t),i=o.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:_classPrivateFieldGet(this,f)),s={annotationType:a.AnnotationEditorType.FREETEXT,color:i,fontSize:_classPrivateFieldGet(this,v),value:_classPrivateFieldGet(this,h),pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?s:this.annotationElementId&&!_classPrivateMethodGet(this,w,M).call(this,s)?null:(s.id=this.annotationElementId,s)}}],[{key:"_keyboardManager",get:function(){var e=n.prototype,t=function(e){return e.isEmpty()},r=i.AnnotationEditorUIManager.TRANSLATE_SMALL,o=i.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,a.shadow)(this,"_keyboardManager",new i.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-o,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[r,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[o,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-o],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,r],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,o],checker:t}]]))}},{key:"initialize",value:function(e){o.AnnotationEditor.initialize(e,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});var t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}},{key:"updateDefaultParams",value:function(e,t){switch(e){case a.AnnotationEditorParamsType.FREETEXT_SIZE:n._defaultFontSize=t;break;case a.AnnotationEditorParamsType.FREETEXT_COLOR:n._defaultColor=t}}},{key:"defaultPropertiesToUpdate",get:function(){return[[a.AnnotationEditorParamsType.FREETEXT_SIZE,n._defaultFontSize],[a.AnnotationEditorParamsType.FREETEXT_COLOR,n._defaultColor||o.AnnotationEditor._defaultLineColor]]}},{key:"deserialize",value:function(e,t,r){var i,o=null;if(e instanceof s.FreeTextAnnotationElement){var l=e,c=l.data,u=c.defaultAppearanceData,d=u.fontSize,p=u.fontColor,g=c.rect,y=c.rotation,_=c.id,b=l.textContent,k=l.textPosition,w=l.parent.page.pageNumber;if(!b||0===b.length)return null;o=e={annotationType:a.AnnotationEditorType.FREETEXT,color:Array.from(p),fontSize:d,value:b.join("\n"),position:k,pageIndex:w-1,rect:g,rotation:y,id:_,deleted:!1}}var S=_get4(_getPrototypeOf(n),"deserialize",this).call(this,e,t,r);return _classPrivateFieldSet(S,v,e.fontSize),_classPrivateFieldSet(S,f,(i=a.Util).makeHexColor.apply(i,_toConsumableArray(e.color))),_classPrivateFieldSet(S,h,e.value),S.annotationElementId=e.id||null,_classPrivateFieldSet(S,m,o),S}}]),n}(o.AnnotationEditor);function P(e){var t=this,n=function(e){t.editorDiv.style.fontSize="calc(".concat(e,"px * var(--scale-factor))"),t.translate(0,-(e-_classPrivateFieldGet(t,v))*t.parentScale),_classPrivateFieldSet(t,v,e),_classPrivateMethodGet(t,b,F).call(t)},r=_classPrivateFieldGet(this,v);this.addCommands({cmd:function(){n(e)},undo:function(){n(r)},mustExec:!0,type:a.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function A(e){var t=this,n=_classPrivateFieldGet(this,f);this.addCommands({cmd:function(){_classPrivateFieldSet(t,f,t.editorDiv.style.color=e)},undo:function(){_classPrivateFieldSet(t,f,t.editorDiv.style.color=n)},mustExec:!0,type:a.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function C(){var e=this.editorDiv.getElementsByTagName("div");if(0===e.length)return this.editorDiv.innerText;var t,n=[],r=_createForOfIteratorHelper(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;n.push(a.innerText.replace(/\r\n?|\n/,""))}}catch(i){r.e(i)}finally{r.f()}return n.join("\n")}function F(){var e,t=_slicedToArray(this.parentDimensions,2),n=t[0],r=t[1];if(this.isAttachedToDOM)e=this.div.getBoundingClientRect();else{var a=this.currentLayer,i=this.div,o=i.style.display;i.style.display="hidden",a.div.append(this.div),e=i.getBoundingClientRect(),i.remove(),i.style.display=o}this.rotation%180===this.parentRotation%180?(this.width=e.width/n,this.height=e.height/r):(this.width=e.height/n,this.height=e.width/r),this.fixAndSetPosition()}function E(){if(this.editorDiv.replaceChildren(),_classPrivateFieldGet(this,h)){var e,t=_createForOfIteratorHelper(_classPrivateFieldGet(this,h).split("\n"));try{for(t.s();!(e=t.n()).done;){var n=e.value,r=document.createElement("div");r.append(n?document.createTextNode(n):document.createElement("br")),this.editorDiv.append(r)}}catch(a){t.e(a)}finally{t.f()}}}function M(e){var t=_classPrivateFieldGet(this,m),n=t.value,r=t.fontSize,a=t.color,i=t.rect,o=t.pageIndex;return e.value!==n||e.fontSize!==r||e.rect.some((function(e,t){return Math.abs(e-i[t])>=1}))||e.color.some((function(e,t){return e!==a[t]}))||e.pageIndex!==o}function T(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.annotationElementId)if(_classPrivateMethodGet(this,b,F).call(this),t||0!==this.width&&0!==this.height){var n=r._internalPadding*this.parentScale;_classPrivateFieldGet(this,m).rect=this.getRect(n,n)}else setTimeout((function(){return _classPrivateMethodGet(e,S,T).call(e,!0)}),0)}r=x,_defineProperty(x,"_freeTextDefaultContent",""),_defineProperty(x,"_internalPadding",0),_defineProperty(x,"_defaultColor",null),_defineProperty(x,"_defaultFontSize",10),_defineProperty(x,"_type","freetext"),t.FreeTextEditor=x},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.StampAnnotationElement=t.InkAnnotationElement=t.FreeTextAnnotationElement=t.AnnotationLayer=void 0;var r=n(1),a=n(6),i=n(3),o=n(30),s=n(31),l=n(32),c=1e3,u=new WeakSet;function d(e){return{width:e[2]-e[0],height:e[3]-e[1]}}var f=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"create",value:function(e){switch(e.data.annotationType){case r.AnnotationType.LINK:return new g(e);case r.AnnotationType.TEXT:return new b(e);case r.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new w(e);case"Btn":return e.data.radioButton?new P(e):e.data.checkBox?new x(e):new A(e);case"Ch":return new C(e);case"Sig":return new S(e)}return new k(e);case r.AnnotationType.POPUP:return new F(e);case r.AnnotationType.FREETEXT:return new te(e);case r.AnnotationType.LINE:return new re(e);case r.AnnotationType.SQUARE:return new ie(e);case r.AnnotationType.CIRCLE:return new se(e);case r.AnnotationType.POLYLINE:return new ce(e);case r.AnnotationType.CARET:return new de(e);case r.AnnotationType.INK:return new he(e);case r.AnnotationType.POLYGON:return new ue(e);case r.AnnotationType.HIGHLIGHT:return new pe(e);case r.AnnotationType.UNDERLINE:return new ve(e);case r.AnnotationType.SQUIGGLY:return new me(e);case r.AnnotationType.STRIKEOUT:return new ge(e);case r.AnnotationType.STAMP:return new ye(e);case r.AnnotationType.FILEATTACHMENT:return new ke(e);default:return new p(e)}}}]),e}(),h=new WeakMap,p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.isRenderable,a=void 0!==r&&r,i=n.ignoreBorder,o=void 0!==i&&i,s=n.createQuadrilaterals,l=void 0!==s&&s;_classCallCheck(this,e),_classPrivateFieldInitSpec(this,h,{writable:!0,value:!1}),this.isRenderable=a,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,a&&(this.container=this._createContainer(o)),l&&this._createQuadrilaterals()}return _createClass(e,[{key:"hasPopupData",get:function(){return e._hasPopupData(this.data)}},{key:"_createContainer",value:function(e){var t=this.data,n=this.parent,a=n.page,i=n.viewport,o=document.createElement("section");o.setAttribute("data-annotation-id",t.id),this instanceof k||(o.tabIndex=c),o.style.zIndex=this.parent.zIndex++,this.data.popupRef&&o.setAttribute("aria-haspopup","dialog"),t.noRotate&&o.classList.add("norotate");var s=i.rawDims,l=s.pageWidth,u=s.pageHeight,f=s.pageX,p=s.pageY;if(!t.rect||this instanceof F){var v=t.rotation;return t.hasOwnCanvas||0===v||this.setRotation(v,o),o}var m=d(t.rect),g=m.width,y=m.height,_=r.Util.normalizeRect([t.rect[0],a.view[3]-t.rect[1]+a.view[1],t.rect[2],a.view[3]-t.rect[3]+a.view[1]]);if(!e&&t.borderStyle.width>0){o.style.borderWidth="".concat(t.borderStyle.width,"px");var b=t.borderStyle.horizontalCornerRadius,w=t.borderStyle.verticalCornerRadius;if(b>0||w>0){var S="calc(".concat(b,"px * var(--scale-factor)) / calc(").concat(w,"px * var(--scale-factor))");o.style.borderRadius=S}else if(this instanceof P){var x="calc(".concat(g,"px * var(--scale-factor)) / calc(").concat(y,"px * var(--scale-factor))");o.style.borderRadius=x}switch(t.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:o.style.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:o.style.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:o.style.borderBottomStyle="solid"}var A=t.borderColor||null;A?(_classPrivateFieldSet(this,h,!0),o.style.borderColor=r.Util.makeHexColor(0|A[0],0|A[1],0|A[2])):o.style.borderWidth=0}o.style.left="".concat(100*(_[0]-f)/l,"%"),o.style.top="".concat(100*(_[1]-p)/u,"%");var C=t.rotation;return t.hasOwnCanvas||0===C?(o.style.width="".concat(100*g/l,"%"),o.style.height="".concat(100*y/u,"%")):this.setRotation(C,o),o}},{key:"setRotation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(this.data.rect){var n,r,a=this.parent.viewport.rawDims,i=a.pageWidth,o=a.pageHeight,s=d(this.data.rect),l=s.width,c=s.height;e%180===0?(n=100*l/i,r=100*c/o):(n=100*c/i,r=100*l/o),t.style.width="".concat(n,"%"),t.style.height="".concat(r,"%"),t.setAttribute("data-main-rotation",(360-e)%360)}}},{key:"_commonActions",get:function(){var e=this,t=function(t,n,r){var a=r.detail[t],i=a[0],s=a.slice(1);r.target.style[n]=o.ColorConverters["".concat(i,"_HTML")](s),e.annotationStorage.setValue(e.data.id,_defineProperty({},n,o.ColorConverters["".concat(i,"_rgb")](s)))};return(0,r.shadow)(this,"_commonActions",{display:function(t){var n=t.detail.display,r=n%2===1;e.container.style.visibility=r?"hidden":"visible",e.annotationStorage.setValue(e.data.id,{noView:r,noPrint:1===n||2===n})},print:function(t){e.annotationStorage.setValue(e.data.id,{noPrint:!t.detail.print})},hidden:function(t){var n=t.detail.hidden;e.container.style.visibility=n?"hidden":"visible",e.annotationStorage.setValue(e.data.id,{noPrint:n,noView:n})},focus:function(e){setTimeout((function(){return e.target.focus({preventScroll:!1})}),0)},userName:function(e){e.target.title=e.detail.userName},readonly:function(e){e.target.disabled=e.detail.readonly},required:function(t){e._setRequired(t.target,t.detail.required)},bgColor:function(e){t("bgColor","backgroundColor",e)},fillColor:function(e){t("fillColor","backgroundColor",e)},fgColor:function(e){t("fgColor","color",e)},textColor:function(e){t("textColor","color",e)},borderColor:function(e){t("borderColor","borderColor",e)},strokeColor:function(e){t("strokeColor","borderColor",e)},rotation:function(t){var n=t.detail.rotation;e.setRotation(n),e.annotationStorage.setValue(e.data.id,{rotation:n})}})}},{key:"_dispatchEventFromSandbox",value:function(e,t){for(var n=this._commonActions,r=0,a=Object.keys(t.detail);r','')],this.container.classList.add("hasBorder")}var y=a-n,_=i-r,b=this.svgFactory,k=b.createElement("svg");k.classList.add("quadrilateralsContainer"),k.setAttribute("width",0),k.setAttribute("height",0);var w=b.createElement("defs");k.append(w);var S=b.createElement("clipPath"),x="clippath_".concat(this.data.id);S.setAttribute("id",x),S.setAttribute("clipPathUnits","objectBoundingBox"),w.append(S);var P,A=_createForOfIteratorHelper(e);try{for(A.s();!(P=A.n()).done;){var C,F=_slicedToArray(P.value,3),E=F[1],M=E.x,T=E.y,I=F[2],R=I.x,O=I.y,L=b.createElement("rect"),D=(R-n)/y,N=(i-T)/_,G=(M-R)/y,j=(T-O)/_;L.setAttribute("x",D),L.setAttribute("y",N),L.setAttribute("width",G),L.setAttribute("height",j),S.append(L),null===(C=p)||void 0===C||C.push(''))}}catch(Z){A.e(Z)}finally{A.f()}_classPrivateFieldGet(this,h)&&(p.push("')"),v.backgroundImage=p.join("")),this.container.append(k),this.container.style.clipPath="url(#".concat(x,")")}}}},{key:"_createPopup",value:function(){var e=this.container,t=this.data;e.setAttribute("aria-haspopup","dialog");var n=new F({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:"popup_".concat(t.id),rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}},{key:"render",value:function(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}},{key:"_getElementsByName",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[];if(this._fieldObjects){var a=this._fieldObjects[e];if(a){var i,o=_createForOfIteratorHelper(a);try{for(o.s();!(i=o.n()).done;){var s=i.value,l=s.page,c=s.id,d=s.exportValues;if(-1!==l&&c!==t){var f="string"===typeof d?d:null,h=document.querySelector('[data-element-id="'.concat(c,'"]'));!h||u.has(h)?n.push({id:c,exportValue:f,domElement:h}):(0,r.warn)("_getElementsByName - element not allowed: ".concat(c))}}}catch(_){o.e(_)}finally{o.f()}}return n}var p,v=_createForOfIteratorHelper(document.getElementsByName(e));try{for(v.s();!(p=v.n()).done;){var m=p.value,g=m.exportValue,y=m.getAttribute("data-element-id");y!==t&&u.has(m)&&n.push({id:y,exportValue:g,domElement:m})}}catch(_){v.e(_)}finally{v.f()}return n}},{key:"show",value:function(){var e;this.container&&(this.container.hidden=!1),null===(e=this.popup)||void 0===e||e.maybeShow()}},{key:"hide",value:function(){var e;this.container&&(this.container.hidden=!0),null===(e=this.popup)||void 0===e||e.forceHide()}},{key:"getElementsToTriggerPopup",value:function(){return this.container}},{key:"addHighlightArea",value:function(){var e=this.getElementsToTriggerPopup();if(Array.isArray(e)){var t,n=_createForOfIteratorHelper(e);try{for(n.s();!(t=n.n()).done;)t.value.classList.add("highlightArea")}catch(r){n.e(r)}finally{n.f()}}else e.classList.add("highlightArea")}},{key:"_editOnDoubleClick",value:function(){var e=this,t=this.annotationEditorType,n=this.data.id;this.container.addEventListener("dblclick",(function(){var r;null===(r=e.linkService.eventBus)||void 0===r||r.dispatch("switchannotationeditormode",{source:e,mode:t,editId:n})}))}}],[{key:"_hasPopupData",value:function(e){var t=e.titleObj,n=e.contentsObj,r=e.richText;return!!(null!==t&&void 0!==t&&t.str||null!==n&&void 0!==n&&n.str||null!==r&&void 0!==r&&r.str)}}]),e}(),v=new WeakSet,m=new WeakSet,g=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _classCallCheck(this,n),r=t.call(this,e,{isRenderable:!0,ignoreBorder:!(null===a||void 0===a||!a.ignoreBorder),createQuadrilaterals:!0}),_classPrivateMethodInitSpec(_assertThisInitialized(r),m),_classPrivateMethodInitSpec(_assertThisInitialized(r),v),r.isTooltipOnly=e.data.isTooltipOnly,r}return _createClass(n,[{key:"render",value:function(){var e=this.data,t=this.linkService,n=document.createElement("a");n.setAttribute("data-element-id",e.id);var r=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action),r=!0):e.attachment?(this._bindAttachment(n,e.attachment),r=!0):e.setOCGState?(_classPrivateMethodGet(this,m,_).call(this,n,e.setOCGState),r=!0):e.dest?(this._bindLink(n,e.dest),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,""),r=!0)),this.container.classList.add("linkAnnotation"),r&&this.container.append(n),this.container}},{key:"_bindLink",value:function(e,t){var n=this;e.href=this.linkService.getDestinationHash(t),e.onclick=function(){return t&&n.linkService.goToDestination(t),!1},(t||""===t)&&_classPrivateMethodGet(this,v,y).call(this)}},{key:"_bindNamedAction",value:function(e,t){var n=this;e.href=this.linkService.getAnchorUrl(""),e.onclick=function(){return n.linkService.executeNamedAction(t),!1},_classPrivateMethodGet(this,v,y).call(this)}},{key:"_bindAttachment",value:function(e,t){var n=this;e.href=this.linkService.getAnchorUrl(""),e.onclick=function(){var e;return null===(e=n.downloadManager)||void 0===e||e.openOrDownloadData(n.container,t.content,t.filename),!1},_classPrivateMethodGet(this,v,y).call(this)}},{key:"_bindJSAction",value:function(e,t){var n=this;e.href=this.linkService.getAnchorUrl("");for(var r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]),a=function(){var a=o[i],s=r.get(a);if(!s)return 1;e[s]=function(){var e;return null===(e=n.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:n,detail:{id:t.id,name:a}}),!1}},i=0,o=Object.keys(t.actions);is&&(o=o.slice(0,s));var l=i.formattedValue||(null===(a=this.data.textContent)||void 0===a?void 0:a.join("\n"))||null;l&&this.data.comb&&(l=l.replaceAll(/\s+/g,""));var d,f,h={userValue:o,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?((r=document.createElement("textarea")).textContent=null!==(d=l)&&void 0!==d?d:o,this.data.doNotScroll&&(r.style.overflowY="hidden")):((r=document.createElement("input")).type="text",r.setAttribute("value",null!==(f=l)&&void 0!==f?f:o),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),u.add(r),r.setAttribute("data-element-id",n),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=c,this._setRequired(r,this.data.required),s&&(r.maxLength=s),r.addEventListener("input",(function(a){t.setValue(n,{value:a.target.value}),e.setPropertyOnSiblings(r,"value",a.target.value,"value"),h.formattedValue=null})),r.addEventListener("resetform",(function(t){var n,a=null!==(n=e.data.defaultFieldValue)&&void 0!==n?n:"";r.value=h.userValue=a,h.formattedValue=null}));var p=function(e){var t=h.formattedValue;null!==t&&void 0!==t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var v;r.addEventListener("focus",(function(e){if(!h.focused){var t=e.target;h.userValue&&(t.value=h.userValue),h.lastCommittedValue=t.value,h.commitKey=1,h.focused=!0}})),r.addEventListener("updatefromsandbox",(function(r){e.showElementAndHideCanvas(r.target);var a={value:function(e){var r;h.userValue=null!==(r=e.detail.value)&&void 0!==r?r:"",t.setValue(n,{value:h.userValue.toString()}),e.target.value=h.userValue},formattedValue:function(e){var r=e.detail.formattedValue;h.formattedValue=r,null!==r&&void 0!==r&&e.target!==document.activeElement&&(e.target.value=r),t.setValue(n,{formattedValue:r})},selRange:function(e){var t;(t=e.target).setSelectionRange.apply(t,_toConsumableArray(e.detail.selRange))},charLimit:function(r){var a,i=r.detail.charLimit,o=r.target;if(0!==i){o.setAttribute("maxLength",i);var s=h.userValue;!s||s.length<=i||(s=s.slice(0,i),o.value=h.userValue=s,t.setValue(n,{value:s}),null===(a=e.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:e,detail:{id:n,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:o.selectionStart,selEnd:o.selectionEnd}}))}else o.removeAttribute("maxLength")}};e._dispatchEventFromSandbox(a,r)})),r.addEventListener("keydown",(function(t){var r;h.commitKey=1;var a=-1;if("Escape"===t.key?a=0:"Enter"!==t.key||e.data.multiLine?"Tab"===t.key&&(h.commitKey=3):a=2,-1!==a){var i=t.target.value;h.lastCommittedValue!==i&&(h.lastCommittedValue=i,h.userValue=i,null===(r=e.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:e,detail:{id:n,name:"Keystroke",value:i,willCommit:!0,commitKey:a,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}}));var m=p;p=null,r.addEventListener("blur",(function(t){if(h.focused&&t.relatedTarget){h.focused=!1;var r,a=t.target.value;h.userValue=a,h.lastCommittedValue!==a&&(null===(r=e.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:e,detail:{id:n,name:"Keystroke",value:a,willCommit:!0,commitKey:h.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})),m(t)}})),null!==(v=this.data.actions)&&void 0!==v&&v.Keystroke&&r.addEventListener("beforeinput",(function(t){var r;h.lastCommittedValue=null;var a=t.data,i=t.target,o=i.value,s=i.selectionStart,l=i.selectionEnd,c=s,u=l;switch(t.inputType){case"deleteWordBackward":var d=o.substring(0,s).match(/\w*[^\w]*$/);d&&(c-=d[0].length);break;case"deleteWordForward":var f=o.substring(s).match(/^[^\w]*\w*/);f&&(u+=f[0].length);break;case"deleteContentBackward":s===l&&(c-=1);break;case"deleteContentForward":s===l&&(u+=1)}t.preventDefault(),null===(r=e.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:e,detail:{id:n,name:"Keystroke",value:o,change:a||"",willCommit:!1,selStart:c,selEnd:u}})})),this._setEventListeners(r,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(e){return e.target.value}))}if(p&&r.addEventListener("blur",p),this.data.comb){var g=(this.data.rect[2]-this.data.rect[0])/s;r.classList.add("comb"),r.style.letterSpacing="calc(".concat(g,"px * var(--scale-factor) - 1ch)")}}else(r=document.createElement("div")).textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell";return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}]),n}(k),S=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){return _classCallCheck(this,n),t.call(this,e,{isRenderable:!!e.data.hasOwnCanvas})}return _createClass(n)}(k),x=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){return _classCallCheck(this,n),t.call(this,e,{isRenderable:e.renderForms})}return _createClass(n,[{key:"render",value:function(){var e=this,t=this.annotationStorage,n=this.data,r=n.id,a=t.getValue(r,{value:n.exportValue===n.fieldValue}).value;"string"===typeof a&&(a="Off"!==a,t.setValue(r,{value:a})),this.container.classList.add("buttonWidgetAnnotation","checkBox");var i=document.createElement("input");return u.add(i),i.setAttribute("data-element-id",r),i.disabled=n.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=n.fieldName,a&&i.setAttribute("checked",!0),i.setAttribute("exportValue",n.exportValue),i.tabIndex=c,i.addEventListener("change",(function(a){var i,o=a.target,s=o.name,l=o.checked,c=_createForOfIteratorHelper(e._getElementsByName(s,r));try{for(c.s();!(i=c.n()).done;){var u=i.value,d=l&&u.exportValue===n.exportValue;u.domElement&&(u.domElement.checked=d),t.setValue(u.id,{value:d})}}catch(f){c.e(f)}finally{c.f()}t.setValue(r,{value:l})})),i.addEventListener("resetform",(function(e){var t=n.defaultFieldValue||"Off";e.target.checked=t===n.exportValue})),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",(function(n){var a={value:function(e){e.target.checked="Off"!==e.detail.value,t.setValue(r,{value:e.target.checked})}};e._dispatchEventFromSandbox(a,n)})),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(e){return e.target.checked}))),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}]),n}(k),P=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){return _classCallCheck(this,n),t.call(this,e,{isRenderable:e.renderForms})}return _createClass(n,[{key:"render",value:function(){var e=this;this.container.classList.add("buttonWidgetAnnotation","radioButton");var t=this.annotationStorage,n=this.data,r=n.id,a=t.getValue(r,{value:n.fieldValue===n.buttonValue}).value;"string"===typeof a&&(a=a!==n.buttonValue,t.setValue(r,{value:a}));var i=document.createElement("input");if(u.add(i),i.setAttribute("data-element-id",r),i.disabled=n.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=n.fieldName,a&&i.setAttribute("checked",!0),i.tabIndex=c,i.addEventListener("change",(function(n){var a,i=n.target,o=i.name,s=i.checked,l=_createForOfIteratorHelper(e._getElementsByName(o,r));try{for(l.s();!(a=l.n()).done;){var c=a.value;t.setValue(c.id,{value:!1})}}catch(u){l.e(u)}finally{l.f()}t.setValue(r,{value:s})})),i.addEventListener("resetform",(function(e){var t=n.defaultFieldValue;e.target.checked=null!==t&&void 0!==t&&t===n.buttonValue})),this.enableScripting&&this.hasJSActions){var o=n.buttonValue;i.addEventListener("updatefromsandbox",(function(n){var a={value:function(n){var a,i=o===n.detail.value,s=_createForOfIteratorHelper(e._getElementsByName(n.target.name));try{for(s.s();!(a=s.n()).done;){var l=a.value,c=i&&l.id===r;l.domElement&&(l.domElement.checked=c),t.setValue(l.id,{value:c})}}catch(u){s.e(u)}finally{s.f()}}};e._dispatchEventFromSandbox(a,n)})),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(e){return e.target.checked}))}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}]),n}(k),A=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){return _classCallCheck(this,n),t.call(this,e,{ignoreBorder:e.data.hasAppearance})}return _createClass(n,[{key:"render",value:function(){var e=this,t=_get4(_getPrototypeOf(n.prototype),"render",this).call(this);t.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(t.title=this.data.alternativeText);var r=t.lastChild;return this.enableScripting&&this.hasJSActions&&r&&(this._setDefaultPropertiesFromJS(r),r.addEventListener("updatefromsandbox",(function(t){e._dispatchEventFromSandbox({},t)}))),t}}]),n}(g),C=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){return _classCallCheck(this,n),t.call(this,e,{isRenderable:e.renderForms})}return _createClass(n,[{key:"render",value:function(){var e=this;this.container.classList.add("choiceWidgetAnnotation");var t=this.annotationStorage,n=this.data.id,r=t.getValue(n,{value:this.data.fieldValue}),a=document.createElement("select");u.add(a),a.setAttribute("data-element-id",n),a.disabled=this.data.readOnly,this._setRequired(a,this.data.required),a.name=this.data.fieldName,a.tabIndex=c;var i=this.data.combo&&this.data.options.length>0;this.data.combo||(a.size=this.data.options.length,this.data.multiSelect&&(a.multiple=!0)),a.addEventListener("resetform",(function(t){var n,r=e.data.defaultFieldValue,i=_createForOfIteratorHelper(a.options);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.selected=o.value===r}}catch(s){i.e(s)}finally{i.f()}}));var o,s=_createForOfIteratorHelper(this.data.options);try{for(s.s();!(o=s.n()).done;){var l=o.value,d=document.createElement("option");d.textContent=l.displayValue,d.value=l.exportValue,r.value.includes(l.exportValue)&&(d.setAttribute("selected",!0),i=!1),a.append(d)}}catch(g){s.e(g)}finally{s.f()}var f=null;if(i){var h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),a.prepend(h),f=function(){h.remove(),a.removeEventListener("input",f),f=null},a.addEventListener("input",f)}var p=function(e){var t=e?"value":"textContent",n=a.options;return a.multiple?Array.prototype.filter.call(n,(function(e){return e.selected})).map((function(e){return e[t]})):-1===n.selectedIndex?null:n[n.selectedIndex][t]},v=p(!1),m=function(e){var t=e.target.options;return Array.prototype.map.call(t,(function(e){return{displayValue:e.textContent,exportValue:e.value}}))};return this.enableScripting&&this.hasJSActions?(a.addEventListener("updatefromsandbox",(function(r){var i={value:function(e){var r;null===(r=f)||void 0===r||r();var i,o=e.detail.value,s=new Set(Array.isArray(o)?o:[o]),l=_createForOfIteratorHelper(a.options);try{for(l.s();!(i=l.n()).done;){var c=i.value;c.selected=s.has(c.value)}}catch(g){l.e(g)}finally{l.f()}t.setValue(n,{value:p(!0)}),v=p(!1)},multipleSelection:function(e){a.multiple=!0},remove:function(e){var r=a.options,i=e.detail.remove;if(r[i].selected=!1,a.remove(i),r.length>0){var o=Array.prototype.findIndex.call(r,(function(e){return e.selected}));-1===o&&(r[0].selected=!0)}t.setValue(n,{value:p(!0),items:m(e)}),v=p(!1)},clear:function(e){for(;0!==a.length;)a.remove(0);t.setValue(n,{value:null,items:[]}),v=p(!1)},insert:function(e){var r=e.detail.insert,i=r.index,o=r.displayValue,s=r.exportValue,l=a.children[i],c=document.createElement("option");c.textContent=o,c.value=s,l?l.before(c):a.append(c),t.setValue(n,{value:p(!0),items:m(e)}),v=p(!1)},items:function(e){for(var r=e.detail.items;0!==a.length;)a.remove(0);var i,o=_createForOfIteratorHelper(r);try{for(o.s();!(i=o.n()).done;){var s=i.value,l=s.displayValue,c=s.exportValue,u=document.createElement("option");u.textContent=l,u.value=c,a.append(u)}}catch(g){o.e(g)}finally{o.f()}a.options.length>0&&(a.options[0].selected=!0),t.setValue(n,{value:p(!0),items:m(e)}),v=p(!1)},indices:function(e){var r,a=new Set(e.detail.indices),i=_createForOfIteratorHelper(e.target.options);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.selected=a.has(o.index)}}catch(g){i.e(g)}finally{i.f()}t.setValue(n,{value:p(!0)}),v=p(!1)},editable:function(e){e.target.disabled=!e.detail.editable}};e._dispatchEventFromSandbox(i,r)})),a.addEventListener("input",(function(r){var a,i=p(!0);t.setValue(n,{value:i}),r.preventDefault(),null===(a=e.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:e,detail:{id:n,name:"Keystroke",value:v,changeEx:i,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(a,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(function(e){return e.target.value}))):a.addEventListener("input",(function(e){t.setValue(n,{value:p(!0)})})),this.data.combo&&this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}]),n}(k),F=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var r;_classCallCheck(this,n);var a=e.data,i=e.elements;return(r=t.call(this,e,{isRenderable:p._hasPopupData(a)})).elements=i,r}return _createClass(n,[{key:"render",value:function(){this.container.classList.add("popupAnnotation");var e,t=new Y({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}),n=[],a=_createForOfIteratorHelper(this.elements);try{for(a.s();!(e=a.n()).done;){var i=e.value;i.popup=t,n.push(i.data.id),i.addHighlightArea()}}catch(o){a.e(o)}finally{a.f()}return this.container.setAttribute("aria-controls",n.map((function(e){return"".concat(r.AnnotationPrefix).concat(e)})).join(",")),this.container}}]),n}(p),E=new WeakMap,M=new WeakMap,T=new WeakMap,I=new WeakMap,R=new WeakMap,O=new WeakMap,L=new WeakMap,D=new WeakMap,N=new WeakMap,G=new WeakMap,j=new WeakMap,Z=new WeakMap,z=new WeakMap,W=new WeakMap,B=new WeakMap,U=new WeakMap,H=new WeakMap,q=new WeakSet,V=new WeakSet,K=new WeakSet,X=new WeakSet,Y=function(){function e(t){var n=t.container,r=t.color,i=t.elements,o=t.titleObj,s=t.modificationDate,l=t.contentsObj,c=t.richText,u=t.parent,d=t.rect,f=t.parentRect,h=t.open;_classCallCheck(this,e),_classPrivateMethodInitSpec(this,X),_classPrivateMethodInitSpec(this,K),_classPrivateMethodInitSpec(this,V),_classPrivateMethodInitSpec(this,q),_classPrivateFieldInitSpec(this,E,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,M,{writable:!0,value:_classPrivateMethodGet(this,q,$).bind(this)}),_classPrivateFieldInitSpec(this,T,{writable:!0,value:_classPrivateMethodGet(this,X,ee).bind(this)}),_classPrivateFieldInitSpec(this,I,{writable:!0,value:_classPrivateMethodGet(this,K,J).bind(this)}),_classPrivateFieldInitSpec(this,R,{writable:!0,value:_classPrivateMethodGet(this,V,Q).bind(this)}),_classPrivateFieldInitSpec(this,O,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,L,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,D,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,N,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,G,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,j,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,Z,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,z,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,W,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,B,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,U,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,H,{writable:!0,value:!1}),_classPrivateFieldSet(this,L,n),_classPrivateFieldSet(this,U,o),_classPrivateFieldSet(this,D,l),_classPrivateFieldSet(this,B,c),_classPrivateFieldSet(this,G,u),_classPrivateFieldSet(this,O,r),_classPrivateFieldSet(this,W,d),_classPrivateFieldSet(this,j,f),_classPrivateFieldSet(this,N,i);var p=a.PDFDateString.toDateObject(s);p&&_classPrivateFieldSet(this,E,u.l10n.get("annotation_date_string",{date:p.toLocaleDateString(),time:p.toLocaleTimeString()})),this.trigger=i.flatMap((function(e){return e.getElementsToTriggerPopup()}));var v,m=_createForOfIteratorHelper(this.trigger);try{for(m.s();!(v=m.n()).done;){var g=v.value;g.addEventListener("click",_classPrivateFieldGet(this,R)),g.addEventListener("mouseenter",_classPrivateFieldGet(this,I)),g.addEventListener("mouseleave",_classPrivateFieldGet(this,T)),g.classList.add("popupTriggerArea")}}catch(k){m.e(k)}finally{m.f()}var y,_=_createForOfIteratorHelper(i);try{for(_.s();!(y=_.n()).done;){var b;null===(b=y.value.container)||void 0===b||b.addEventListener("keydown",_classPrivateFieldGet(this,M))}}catch(k){_.e(k)}finally{_.f()}_classPrivateFieldGet(this,L).hidden=!0,h&&_classPrivateMethodGet(this,V,Q).call(this)}return _createClass(e,[{key:"render",value:function(){if(!_classPrivateFieldGet(this,z)){var e=_classPrivateFieldGet(this,G),t=e.page.view,n=e.viewport.rawDims,a=n.pageWidth,i=n.pageHeight,o=n.pageX,s=n.pageY,c=_classPrivateFieldSet(this,z,document.createElement("div"));if(c.className="popup",_classPrivateFieldGet(this,O)){var u,d,f=c.style.outlineColor=(u=r.Util).makeHexColor.apply(u,_toConsumableArray(_classPrivateFieldGet(this,O)));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))c.style.backgroundColor="color-mix(in srgb, ".concat(f," 30%, white)");else c.style.backgroundColor=(d=r.Util).makeHexColor.apply(d,_toConsumableArray(_classPrivateFieldGet(this,O).map((function(e){return Math.floor(.7*(255-e)+e)}))))}var h=document.createElement("span");h.className="header";var p=document.createElement("h1");h.append(p);var v=_classPrivateFieldGet(this,U);if(p.dir=v.dir,p.textContent=v.str,c.append(h),_classPrivateFieldGet(this,E)){var m=document.createElement("span");m.classList.add("popupDate"),_classPrivateFieldGet(this,E).then((function(e){m.textContent=e})),h.append(m)}var g=_classPrivateFieldGet(this,D),y=_classPrivateFieldGet(this,B);if(null===y||void 0===y||!y.str||null!==g&&void 0!==g&&g.str&&g.str!==y.str){var _=this._formatContents(g);c.append(_)}else l.XfaLayer.render({xfaHtml:y.html,intent:"richText",div:c}),c.lastChild.classList.add("richText","popupContent");var b,k=!!_classPrivateFieldGet(this,j),w=_classPrivateFieldGet(this,k?j:W),S=_createForOfIteratorHelper(_classPrivateFieldGet(this,N));try{for(S.s();!(b=S.n()).done;){var x=b.value;if(!w||null!==r.Util.intersect(x.data.rect,w)){w=x.data.rect,k=!0;break}}}catch(T){S.e(T)}finally{S.f()}var P=r.Util.normalizeRect([w[0],t[3]-w[1]+t[1],w[2],t[3]-w[3]+t[1]]),A=k?w[2]-w[0]+5:0,C=P[0]+A,F=P[1],M=_classPrivateFieldGet(this,L).style;M.left="".concat(100*(C-o)/a,"%"),M.top="".concat(100*(F-s)/i,"%"),_classPrivateFieldGet(this,L).append(c)}}},{key:"_formatContents",value:function(e){var t=e.str,n=e.dir,r=document.createElement("p");r.classList.add("popupContent"),r.dir=n;for(var a=t.split(/(?:\r\n?|\n)/),i=0,o=a.length;i0&&_classPrivateFieldGet(this,Pe).set(_.data.id,_),k=_.render(),h.hidden&&(k.style.visibility="hidden"),_classPrivateMethodGet(this,Ae,Ee).call(this,k,h.id);case 32:e.next=8;break;case 34:e.next=39;break;case 36:e.prev=36,e.t0=e.catch(6),c.e(e.t0);case 39:return e.prev=39,c.f(),e.finish(39);case 42:return _classPrivateMethodGet(this,Ce,Me).call(this),e.next=45,this.l10n.translate(o);case 45:case"end":return e.stop()}}),e,this,[[6,36,39,42]])})));return function(t){return e.apply(this,arguments)}}()},{key:"update",value:function(e){var t=e.viewport,n=this.div;this.viewport=t,(0,a.setLayerDimensions)(n,{rotation:t.rotation}),_classPrivateMethodGet(this,Ce,Me).call(this),n.hidden=!1}},{key:"getEditableAnnotations",value:function(){return Array.from(_classPrivateFieldGet(this,Pe).values())}},{key:"getEditableAnnotation",value:function(e){return _classPrivateFieldGet(this,Pe).get(e)}}]),e}();function Ee(e,t){var n,a=e.firstChild||e;a.id="".concat(r.AnnotationPrefix).concat(t),this.div.append(e),null===(n=_classPrivateFieldGet(this,Se))||void 0===n||n.moveElementInDOM(this.div,e,a,!1)}function Me(){if(_classPrivateFieldGet(this,xe)){var e,t=this.div,n=_createForOfIteratorHelper(_classPrivateFieldGet(this,xe));try{for(n.s();!(e=n.n()).done;){var r=_slicedToArray(e.value,2),a=r[0],i=r[1],o=t.querySelector('[data-annotation-id="'.concat(a,'"]'));if(o){var s=o.firstChild;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.before(i):o.append(i)}}}catch(l){n.e(l)}finally{n.f()}_classPrivateFieldGet(this,xe).clear()}}t.AnnotationLayer=Fe},function(e,t){function n(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}function r(e){return Math.max(0,Math.min(255,255*e))}Object.defineProperty(t,"__esModule",{value:!0}),t.ColorConverters=void 0;var a=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"CMYK_G",value:function(e){var t=_slicedToArray(e,4),n=t[0],r=t[1],a=t[2],i=t[3];return["G",1-Math.min(1,.3*n+.59*a+.11*r+i)]}},{key:"G_CMYK",value:function(e){return["CMYK",0,0,0,1-_slicedToArray(e,1)[0]]}},{key:"G_RGB",value:function(e){var t=_slicedToArray(e,1)[0];return["RGB",t,t,t]}},{key:"G_rgb",value:function(e){var t=_slicedToArray(e,1)[0];return[t=r(t),t,t]}},{key:"G_HTML",value:function(e){var t=n(_slicedToArray(e,1)[0]);return"#".concat(t).concat(t).concat(t)}},{key:"RGB_G",value:function(e){var t=_slicedToArray(e,3);return["G",.3*t[0]+.59*t[1]+.11*t[2]]}},{key:"RGB_rgb",value:function(e){return e.map(r)}},{key:"RGB_HTML",value:function(e){return"#".concat(e.map(n).join(""))}},{key:"T_HTML",value:function(){return"#00000000"}},{key:"T_rgb",value:function(){return[null]}},{key:"CMYK_RGB",value:function(e){var t=_slicedToArray(e,4),n=t[0],r=t[1],a=t[2],i=t[3];return["RGB",1-Math.min(1,n+i),1-Math.min(1,a+i),1-Math.min(1,r+i)]}},{key:"CMYK_rgb",value:function(e){var t=_slicedToArray(e,4),n=t[0],a=t[1],i=t[2],o=t[3];return[r(1-Math.min(1,n+o)),r(1-Math.min(1,i+o)),r(1-Math.min(1,a+o))]}},{key:"CMYK_HTML",value:function(e){var t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}},{key:"RGB_CMYK",value:function(e){var t=_slicedToArray(e,3),n=1-t[0],r=1-t[1],a=1-t[2];return["CMYK",n,r,a,Math.min(n,r,a)]}}]),e}();t.ColorConverters=a},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.NullL10n=void 0,t.getL10nFallback=r;var n={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} \xd7 {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} \xd7 {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing\u2026",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};function r(e,t){switch(e){case"find_match_count":e="find_match_count[".concat(1===t.total?"one":"other","]");break;case"find_match_count_limit":e="find_match_count_limit[".concat(1===t.limit?"one":"other","]")}return n[e]||""}function a(e,t){return t?e.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(function(e,n){return n in t?t[n]:"{{"+n+"}}"})):e}n.print_progress_percent="{{progress}}%";var i={getLanguage:function(){return _asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return","en-us");case 1:case"end":return e.stop()}}),e)})))()},getDirection:function(){return _asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return","ltr");case 1:case"end":return e.stop()}}),e)})))()},get:function(e){var t=arguments;return _asyncToGenerator(_regeneratorRuntime().mark((function n(){var i,o;return _regeneratorRuntime().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=t.length>1&&void 0!==t[1]?t[1]:null,o=t.length>2&&void 0!==t[2]?t[2]:r(e,i),n.abrupt("return",a(o,i));case 3:case"end":return n.stop()}}),n)})))()},translate:function(e){return _asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()}};t.NullL10n=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayer=void 0;var r=n(25),a=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"setupStorage",value:function(e,t,n,r,a){var i=r.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==i.value&&(e.textContent=i.value),"print"===a)break;e.addEventListener("input",(function(e){r.setValue(t,{value:e.target.value})}));break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(i.value===n.attributes.xfaOn?e.setAttribute("checked",!0):i.value===n.attributes.xfaOff&&e.removeAttribute("checked"),"print"===a)break;e.addEventListener("change",(function(e){r.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})}))}else{if(null!==i.value&&e.setAttribute("value",i.value),"print"===a)break;e.addEventListener("input",(function(e){r.setValue(t,{value:e.target.value})}))}break;case"select":if(null!==i.value){e.setAttribute("value",i.value);var o,s=_createForOfIteratorHelper(n.children);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.attributes.value===i.value?l.attributes.selected=!0:l.attributes.hasOwnProperty("selected")&&delete l.attributes.selected}}catch(c){s.e(c)}finally{s.f()}}e.addEventListener("input",(function(e){var n=e.target.options,a=-1===n.selectedIndex?"":n[n.selectedIndex].value;r.setValue(t,{value:a})}))}}},{key:"setAttributes",value:function(e){var t=e.html,n=e.element,r=e.storage,a=void 0===r?null:r,i=e.intent,o=e.linkService,s=n.attributes,l=t instanceof HTMLAnchorElement;"radio"===s.type&&(s.name="".concat(s.name,"-").concat(i));for(var c=0,u=Object.entries(s);c0;){var d,f=s.at(-1),h=_slicedToArray(f,3),p=h[0],v=h[1],m=h[2];if(v+1!==p.children.length){var g=p.children[++s.at(-1)[1]];if(null!==g){var y=g.name;if("#text"!==y){var _=null!==g&&void 0!==g&&null!==(d=g.attributes)&&void 0!==d&&d.xmlns?document.createElementNS(g.attributes.xmlns,y):document.createElement(y);if(m.append(_),g.attributes&&this.setAttributes({html:_,element:g,storage:t,intent:i,linkService:n}),g.children&&g.children.length>0)s.push([g,-1,_]);else if(g.value){var b=document.createTextNode(g.value);r.XfaText.shouldBuildText(y)&&u.push(b),_.append(b)}}else{var k=document.createTextNode(g.value);u.push(k),m.append(k)}}}else s.pop()}var w,S=_createForOfIteratorHelper(l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"));try{for(S.s();!(w=S.n()).done;)w.value.setAttribute("readOnly",!0)}catch(x){S.e(x)}finally{S.f()}return{textDivs:u}}},{key:"update",value:function(e){var t="matrix(".concat(e.viewport.transform.join(","),")");e.div.style.transform=t,e.div.hidden=!1}}]),e}();t.XfaLayer=a},function(e,t,n){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.InkEditor=void 0;var a=n(1),i=n(4),o=n(29),s=n(6),l=n(5),c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,h=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,g=new WeakMap,y=new WeakMap,_=new WeakMap,b=new WeakMap,k=new WeakMap,w=new WeakMap,S=new WeakSet,x=new WeakSet,P=new WeakSet,A=new WeakSet,C=new WeakSet,F=new WeakSet,E=new WeakSet,M=new WeakSet,T=new WeakSet,I=new WeakSet,R=new WeakSet,O=new WeakSet,L=new WeakSet,D=new WeakSet,N=new WeakSet,G=new WeakSet,j=new WeakSet,Z=new WeakSet,z=new WeakSet,W=new WeakSet,B=new WeakSet,U=new WeakSet,H=new WeakSet,q=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var r;return _classCallCheck(this,n),r=t.call(this,_objectSpread(_objectSpread({},e),{},{name:"inkEditor"})),_classPrivateMethodInitSpec(_assertThisInitialized(r),H),_classPrivateMethodInitSpec(_assertThisInitialized(r),U),_classPrivateMethodInitSpec(_assertThisInitialized(r),B),_classPrivateMethodInitSpec(_assertThisInitialized(r),W),_classPrivateMethodInitSpec(_assertThisInitialized(r),z),_classPrivateMethodInitSpec(_assertThisInitialized(r),Z),_classPrivateMethodInitSpec(_assertThisInitialized(r),j),_classPrivateMethodInitSpec(_assertThisInitialized(r),G),_classPrivateMethodInitSpec(_assertThisInitialized(r),N),_classPrivateMethodInitSpec(_assertThisInitialized(r),D),_classPrivateMethodInitSpec(_assertThisInitialized(r),L),_classPrivateMethodInitSpec(_assertThisInitialized(r),O),_classPrivateMethodInitSpec(_assertThisInitialized(r),R),_classPrivateMethodInitSpec(_assertThisInitialized(r),I),_classPrivateMethodInitSpec(_assertThisInitialized(r),T),_classPrivateMethodInitSpec(_assertThisInitialized(r),M),_classPrivateMethodInitSpec(_assertThisInitialized(r),E),_classPrivateMethodInitSpec(_assertThisInitialized(r),F),_classPrivateMethodInitSpec(_assertThisInitialized(r),C),_classPrivateMethodInitSpec(_assertThisInitialized(r),A),_classPrivateMethodInitSpec(_assertThisInitialized(r),P),_classPrivateMethodInitSpec(_assertThisInitialized(r),x),_classPrivateMethodInitSpec(_assertThisInitialized(r),S),_classPrivateFieldInitSpec(_assertThisInitialized(r),c,{writable:!0,value:0}),_classPrivateFieldInitSpec(_assertThisInitialized(r),u,{writable:!0,value:0}),_classPrivateFieldInitSpec(_assertThisInitialized(r),d,{writable:!0,value:r.canvasPointermove.bind(_assertThisInitialized(r))}),_classPrivateFieldInitSpec(_assertThisInitialized(r),f,{writable:!0,value:r.canvasPointerleave.bind(_assertThisInitialized(r))}),_classPrivateFieldInitSpec(_assertThisInitialized(r),h,{writable:!0,value:r.canvasPointerup.bind(_assertThisInitialized(r))}),_classPrivateFieldInitSpec(_assertThisInitialized(r),p,{writable:!0,value:r.canvasPointerdown.bind(_assertThisInitialized(r))}),_classPrivateFieldInitSpec(_assertThisInitialized(r),v,{writable:!0,value:new Path2D}),_classPrivateFieldInitSpec(_assertThisInitialized(r),m,{writable:!0,value:!1}),_classPrivateFieldInitSpec(_assertThisInitialized(r),g,{writable:!0,value:!1}),_classPrivateFieldInitSpec(_assertThisInitialized(r),y,{writable:!0,value:!1}),_classPrivateFieldInitSpec(_assertThisInitialized(r),_,{writable:!0,value:null}),_classPrivateFieldInitSpec(_assertThisInitialized(r),b,{writable:!0,value:0}),_classPrivateFieldInitSpec(_assertThisInitialized(r),k,{writable:!0,value:0}),_classPrivateFieldInitSpec(_assertThisInitialized(r),w,{writable:!0,value:null}),r.color=e.color||null,r.thickness=e.thickness||null,r.opacity=e.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,r}return _createClass(n,[{key:"updateParams",value:function(e,t){switch(e){case a.AnnotationEditorParamsType.INK_THICKNESS:_classPrivateMethodGet(this,S,V).call(this,t);break;case a.AnnotationEditorParamsType.INK_COLOR:_classPrivateMethodGet(this,x,K).call(this,t);break;case a.AnnotationEditorParamsType.INK_OPACITY:_classPrivateMethodGet(this,P,X).call(this,t)}}},{key:"propertiesToUpdate",get:function(){var e;return[[a.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||n._defaultThickness],[a.AnnotationEditorParamsType.INK_COLOR,this.color||n._defaultColor||i.AnnotationEditor._defaultLineColor],[a.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(null!==(e=this.opacity)&&void 0!==e?e:n._defaultOpacity))]]}},{key:"rebuild",value:function(){this.parent&&(_get4(_getPrototypeOf(n.prototype),"rebuild",this).call(this),null!==this.div&&(this.canvas||(_classPrivateMethodGet(this,N,se).call(this),_classPrivateMethodGet(this,G,le).call(this)),this.isAttachedToDOM||(this.parent.add(this),_classPrivateMethodGet(this,j,ce).call(this)),_classPrivateMethodGet(this,H,ye).call(this)))}},{key:"remove",value:function(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,_classPrivateFieldGet(this,_).disconnect(),_classPrivateFieldSet(this,_,null),_get4(_getPrototypeOf(n.prototype),"remove",this).call(this))}},{key:"setParent",value:function(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this),_get4(_getPrototypeOf(n.prototype),"setParent",this).call(this,e)}},{key:"onScaleChanging",value:function(){var e=_slicedToArray(this.parentDimensions,2),t=e[0],n=e[1],r=this.width*t,a=this.height*n;this.setDimensions(r,a)}},{key:"enableEditMode",value:function(){_classPrivateFieldGet(this,m)||null===this.canvas||(_get4(_getPrototypeOf(n.prototype),"enableEditMode",this).call(this),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",_classPrivateFieldGet(this,p)))}},{key:"disableEditMode",value:function(){this.isInEditMode()&&null!==this.canvas&&(_get4(_getPrototypeOf(n.prototype),"disableEditMode",this).call(this),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(this,p)))}},{key:"onceAdded",value:function(){this._isDraggable=!this.isEmpty()}},{key:"isEmpty",value:function(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}},{key:"commit",value:function(){_classPrivateFieldGet(this,m)||(_get4(_getPrototypeOf(n.prototype),"commit",this).call(this),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),_classPrivateFieldSet(this,m,!0),this.div.classList.add("disabled"),_classPrivateMethodGet(this,H,ye).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}},{key:"focusin",value:function(e){this._focusEventsAllowed&&(_get4(_getPrototypeOf(n.prototype),"focusin",this).call(this,e),this.enableEditMode())}},{key:"canvasPointerdown",value:function(e){0===e.button&&this.isInEditMode()&&!_classPrivateFieldGet(this,m)&&(this.setInForeground(),e.preventDefault(),"mouse"!==e.type&&this.div.focus(),_classPrivateMethodGet(this,F,Q).call(this,e.offsetX,e.offsetY))}},{key:"canvasPointermove",value:function(e){e.preventDefault(),_classPrivateMethodGet(this,E,J).call(this,e.offsetX,e.offsetY)}},{key:"canvasPointerup",value:function(e){e.preventDefault(),_classPrivateMethodGet(this,D,oe).call(this,e)}},{key:"canvasPointerleave",value:function(e){_classPrivateMethodGet(this,D,oe).call(this,e)}},{key:"isResizable",get:function(){return!this.isEmpty()&&_classPrivateFieldGet(this,m)}},{key:"render",value:function(){var e,t,r=this;if(this.div)return this.div;this.width&&(e=this.x,t=this.y),_get4(_getPrototypeOf(n.prototype),"render",this).call(this),i.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then((function(e){var t;return null===(t=r.div)||void 0===t?void 0:t.setAttribute("aria-label",e)}));var a=_classPrivateMethodGet(this,A,Y).call(this),o=_slicedToArray(a,4),s=o[0],l=o[1],c=o[2],u=o[3];if(this.setAt(s,l,0,0),this.setDims(c,u),_classPrivateMethodGet(this,N,se).call(this),this.width){var d=_slicedToArray(this.parentDimensions,2),f=d[0],h=d[1];this.setAspectRatio(this.width*f,this.height*h),this.setAt(e*f,t*h,this.width*f,this.height*h),_classPrivateFieldSet(this,y,!0),_classPrivateMethodGet(this,j,ce).call(this),this.setDims(this.width*f,this.height*h),_classPrivateMethodGet(this,L,ie).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return _classPrivateMethodGet(this,G,le).call(this),this.div}},{key:"setDimensions",value:function(e,t){var n=Math.round(e),r=Math.round(t);if(_classPrivateFieldGet(this,b)!==n||_classPrivateFieldGet(this,k)!==r){_classPrivateFieldSet(this,b,n),_classPrivateFieldSet(this,k,r),this.canvas.style.visibility="hidden";var a=_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1];this.width=e/i,this.height=t/o,this.fixAndSetPosition(),_classPrivateFieldGet(this,m)&&_classPrivateMethodGet(this,Z,ue).call(this,e,t),_classPrivateMethodGet(this,j,ce).call(this),_classPrivateMethodGet(this,L,ie).call(this),this.canvas.style.visibility="visible",this.fixDims()}}},{key:"serialize",value:function(){if(this.isEmpty())return null;var e=this.getRect(0,0),t=i.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:a.AnnotationEditorType.INK,color:t,thickness:this.thickness,opacity:this.opacity,paths:_classPrivateMethodGet(this,W,ve).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:e,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}],[{key:"initialize",value:function(e){i.AnnotationEditor.initialize(e,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}},{key:"updateDefaultParams",value:function(e,t){switch(e){case a.AnnotationEditorParamsType.INK_THICKNESS:n._defaultThickness=t;break;case a.AnnotationEditorParamsType.INK_COLOR:n._defaultColor=t;break;case a.AnnotationEditorParamsType.INK_OPACITY:n._defaultOpacity=t/100}}},{key:"defaultPropertiesToUpdate",get:function(){return[[a.AnnotationEditorParamsType.INK_THICKNESS,n._defaultThickness],[a.AnnotationEditorParamsType.INK_COLOR,n._defaultColor||i.AnnotationEditor._defaultLineColor],[a.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*n._defaultOpacity)]]}},{key:"deserialize",value:function(e,t,r){var s;if(e instanceof o.InkAnnotationElement)return null;var l=_get4(_getPrototypeOf(n),"deserialize",this).call(this,e,t,r);l.thickness=e.thickness,l.color=(s=a.Util).makeHexColor.apply(s,_toConsumableArray(e.color)),l.opacity=e.opacity;var d=_slicedToArray(l.pageDimensions,2),f=d[0],h=d[1],p=l.width*f,v=l.height*h,g=l.parentScale,y=e.thickness/2;_classPrivateFieldSet(l,m,!0),_classPrivateFieldSet(l,b,Math.round(p)),_classPrivateFieldSet(l,k,Math.round(v));var _,w=e.paths,S=e.rect,x=e.rotation,P=_createForOfIteratorHelper(w);try{for(P.s();!(_=P.n()).done;){var A=_.value.bezier;A=_classStaticPrivateMethodGet(n,n,pe).call(n,A,S,x);var C=[];l.paths.push(C);for(var F=g*(A[0]-y),E=g*(A[1]-y),M=2,T=A.length;M1&&e===i&&t===o)){var s,l,c=this.currentPath,u=_classPrivateFieldGet(this,v);if(c.push([e,t]),_classPrivateFieldSet(this,g,!0),c.length<=2)return(s=u).moveTo.apply(s,_toConsumableArray(c[0])),void u.lineTo(e,t);3===c.length&&(_classPrivateFieldSet(this,v,u=new Path2D),(l=u).moveTo.apply(l,_toConsumableArray(c[0]))),(n=_classPrivateMethodGet(this,R,re)).call.apply(n,[this,u].concat(_toConsumableArray(c.at(-3)),_toConsumableArray(c.at(-2)),[e,t]))}}function ee(){var e;if(0!==this.currentPath.length){var t=this.currentPath.at(-1);(e=_classPrivateFieldGet(this,v)).lineTo.apply(e,_toConsumableArray(t))}}function te(e,t){var n,r=this;if(_classPrivateFieldSet(this,w,null),e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height),_classPrivateMethodGet(this,E,J).call(this,e,t),_classPrivateMethodGet(this,M,ee).call(this),1!==this.currentPath.length)n=_classPrivateMethodGet(this,O,ae).call(this);else{var a=[e,t];n=[[a,a.slice(),a.slice(),a]]}var i=_classPrivateFieldGet(this,v),o=this.currentPath;this.currentPath=[],_classPrivateFieldSet(this,v,new Path2D),this.addCommands({cmd:function(){r.allRawPaths.push(o),r.paths.push(n),r.bezierPath2D.push(i),r.rebuild()},undo:function(){r.allRawPaths.pop(),r.paths.pop(),r.bezierPath2D.pop(),0===r.paths.length?r.remove():(r.canvas||(_classPrivateMethodGet(r,N,se).call(r),_classPrivateMethodGet(r,G,le).call(r)),_classPrivateMethodGet(r,H,ye).call(r))},mustExec:!0})}function ne(){if(_classPrivateFieldGet(this,g)){_classPrivateFieldSet(this,g,!1);Math.ceil(this.thickness*this.parentScale);var e=this.currentPath.slice(-3),t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]})),r=(Math.min.apply(Math,_toConsumableArray(t)),Math.max.apply(Math,_toConsumableArray(t)),Math.min.apply(Math,_toConsumableArray(n)),Math.max.apply(Math,_toConsumableArray(n)),this.ctx);r.save(),r.clearRect(0,0,this.canvas.width,this.canvas.height);var a,i=_createForOfIteratorHelper(this.bezierPath2D);try{for(i.s();!(a=i.n()).done;){var o=a.value;r.stroke(o)}}catch(s){i.e(s)}finally{i.f()}r.stroke(_classPrivateFieldGet(this,v)),r.restore()}}function re(e,t,n,r,a,i,o){var s=(t+r)/2,l=(n+a)/2,c=(r+i)/2,u=(a+o)/2;e.bezierCurveTo(s+2*(r-s)/3,l+2*(a-l)/3,c+2*(r-c)/3,u+2*(a-u)/3,c,u)}function ae(){var e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];var t,n=[],r=_slicedToArray(e[0],2),a=r[0],i=r[1];for(t=1;t0&&void 0!==arguments[0]&&arguments[0];if(!this.isEmpty())if(_classPrivateFieldGet(this,m)){var t=_classPrivateMethodGet(this,B,me).call(this),n=_classPrivateMethodGet(this,U,ge).call(this);_classPrivateFieldSet(this,u,Math.max(i.AnnotationEditor.MIN_SIZE,t[2]-t[0])),_classPrivateFieldSet(this,c,Math.max(i.AnnotationEditor.MIN_SIZE,t[3]-t[1]));var r=Math.ceil(n+_classPrivateFieldGet(this,u)*this.scaleFactor),a=Math.ceil(n+_classPrivateFieldGet(this,c)*this.scaleFactor),o=_slicedToArray(this.parentDimensions,2),s=o[0],l=o[1];this.width=r/s,this.height=a/l,this.setAspectRatio(r,a);var d=this.translationX,f=this.translationY;this.translationX=-t[0],this.translationY=-t[1],_classPrivateMethodGet(this,j,ce).call(this),_classPrivateMethodGet(this,L,ie).call(this),_classPrivateFieldSet(this,b,r),_classPrivateFieldSet(this,k,a),this.setDims(r,a);var h=e?n/this.scaleFactor/2:0;this.translate(d-this.translationX-h,f-this.translationY-h)}else _classPrivateMethodGet(this,L,ie).call(this)}r=q,_defineProperty(q,"_defaultColor",null),_defineProperty(q,"_defaultOpacity",1),_defineProperty(q,"_defaultThickness",1),_defineProperty(q,"_type","ink"),t.InkEditor=q},function(e,t,n){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.StampEditor=void 0;var a=n(1),i=n(4),o=n(6),s=n(29),l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,h=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,g=new WeakMap,y=new WeakSet,_=new WeakSet,b=new WeakSet,k=new WeakSet,w=new WeakSet,S=new WeakSet,x=new WeakSet,P=new WeakSet,A=new WeakSet,C=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var r;return _classCallCheck(this,n),r=t.call(this,_objectSpread(_objectSpread({},e),{},{name:"stampEditor"})),_classPrivateMethodInitSpec(_assertThisInitialized(r),A),_classPrivateMethodInitSpec(_assertThisInitialized(r),P),_classPrivateMethodInitSpec(_assertThisInitialized(r),x),_classPrivateMethodInitSpec(_assertThisInitialized(r),S),_classPrivateMethodInitSpec(_assertThisInitialized(r),w),_classPrivateMethodInitSpec(_assertThisInitialized(r),k),_classPrivateMethodInitSpec(_assertThisInitialized(r),b),_classPrivateMethodInitSpec(_assertThisInitialized(r),_),_classPrivateMethodInitSpec(_assertThisInitialized(r),y),_classPrivateFieldInitSpec(_assertThisInitialized(r),l,{writable:!0,value:null}),_classPrivateFieldInitSpec(_assertThisInitialized(r),c,{writable:!0,value:null}),_classPrivateFieldInitSpec(_assertThisInitialized(r),u,{writable:!0,value:null}),_classPrivateFieldInitSpec(_assertThisInitialized(r),d,{writable:!0,value:null}),_classPrivateFieldInitSpec(_assertThisInitialized(r),f,{writable:!0,value:null}),_classPrivateFieldInitSpec(_assertThisInitialized(r),h,{writable:!0,value:null}),_classPrivateFieldInitSpec(_assertThisInitialized(r),p,{writable:!0,value:null}),_classPrivateFieldInitSpec(_assertThisInitialized(r),v,{writable:!0,value:null}),_classPrivateFieldInitSpec(_assertThisInitialized(r),m,{writable:!0,value:!1}),_classPrivateFieldInitSpec(_assertThisInitialized(r),g,{writable:!0,value:!1}),_classPrivateFieldSet(_assertThisInitialized(r),d,e.bitmapUrl),_classPrivateFieldSet(_assertThisInitialized(r),f,e.bitmapFile),r}return _createClass(n,[{key:"remove",value:function(){var e,t;_classPrivateFieldGet(this,c)&&(_classPrivateFieldSet(this,l,null),this._uiManager.imageManager.deleteId(_classPrivateFieldGet(this,c)),null===(e=_classPrivateFieldGet(this,h))||void 0===e||e.remove(),_classPrivateFieldSet(this,h,null),null===(t=_classPrivateFieldGet(this,p))||void 0===t||t.disconnect(),_classPrivateFieldSet(this,p,null)),_get4(_getPrototypeOf(n.prototype),"remove",this).call(this)}},{key:"rebuild",value:function(){this.parent?(_get4(_getPrototypeOf(n.prototype),"rebuild",this).call(this),null!==this.div&&(_classPrivateFieldGet(this,c)&&_classPrivateMethodGet(this,b,M).call(this),this.isAttachedToDOM||this.parent.add(this))):_classPrivateFieldGet(this,c)&&_classPrivateMethodGet(this,b,M).call(this)}},{key:"onceAdded",value:function(){this._isDraggable=!0,this.div.focus()}},{key:"isEmpty",value:function(){return!(_classPrivateFieldGet(this,u)||_classPrivateFieldGet(this,l)||_classPrivateFieldGet(this,d)||_classPrivateFieldGet(this,f))}},{key:"isResizable",get:function(){return!0}},{key:"render",value:function(){if(this.div)return this.div;var e,t;if(this.width&&(e=this.x,t=this.y),_get4(_getPrototypeOf(n.prototype),"render",this).call(this),this.div.hidden=!0,_classPrivateFieldGet(this,l)?_classPrivateMethodGet(this,k,T).call(this):_classPrivateMethodGet(this,b,M).call(this),this.width){var r=_slicedToArray(this.parentDimensions,2),a=r[0],i=r[1];this.setAt(e*a,t*i,this.width*a,this.height*i)}return this.div}},{key:"serialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;var n={annotationType:a.AnnotationEditorType.STAMP,bitmapId:_classPrivateFieldGet(this,c),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:_classPrivateFieldGet(this,m),structTreeParentId:this._structTreeParentId};if(e)return n.bitmapUrl=_classPrivateMethodGet(this,P,L).call(this,!0),n.accessibilityData=this.altTextData,n;var r=this.altTextData,i=r.decorative,o=r.altText;if(!i&&o&&(n.accessibilityData={type:"Figure",alt:o}),null===t)return n;t.stamps||(t.stamps=new Map);var s=_classPrivateFieldGet(this,m)?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(t.stamps.has(_classPrivateFieldGet(this,c))){if(_classPrivateFieldGet(this,m)){var l=t.stamps.get(_classPrivateFieldGet(this,c));s>l.area&&(l.area=s,l.serialized.bitmap.close(),l.serialized.bitmap=_classPrivateMethodGet(this,P,L).call(this,!1))}}else t.stamps.set(_classPrivateFieldGet(this,c),{area:s,serialized:n}),n.bitmap=_classPrivateMethodGet(this,P,L).call(this,!1);return n}}],[{key:"initialize",value:function(e){i.AnnotationEditor.initialize(e)}},{key:"supportedTypes",get:function(){return(0,a.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((function(e){return"image/".concat(e)})))}},{key:"supportedTypesStr",get:function(){return(0,a.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}},{key:"isHandlingMimeForPasting",value:function(e){return this.supportedTypes.includes(e)}},{key:"paste",value:function(e,t){t.pasteEditor(a.AnnotationEditorType.STAMP,{bitmapFile:e.getAsFile()})}},{key:"deserialize",value:function(e,t,r){if(e instanceof s.StampAnnotationElement)return null;var a=_get4(_getPrototypeOf(n),"deserialize",this).call(this,e,t,r),i=e.rect,o=e.bitmapUrl,l=e.bitmapId,u=e.isSvg,f=e.accessibilityData;l&&r.imageManager.isValidId(l)?_classPrivateFieldSet(a,c,l):_classPrivateFieldSet(a,d,o),_classPrivateFieldSet(a,m,u);var h=_slicedToArray(a.pageDimensions,2),p=h[0],v=h[1];return a.width=(i[2]-i[0])/p,a.height=(i[3]-i[1])/v,f&&(a.altTextData=f),a}}]),n}(i.AnnotationEditor);function F(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e?(_classPrivateFieldSet(this,l,e.bitmap),t||(_classPrivateFieldSet(this,c,e.id),_classPrivateFieldSet(this,m,e.isSvg)),_classPrivateMethodGet(this,k,T).call(this)):this.remove()}function E(){_classPrivateFieldSet(this,u,null),this._uiManager.enableWaiting(!1),_classPrivateFieldGet(this,h)&&this.div.focus()}function M(){var e=this;if(_classPrivateFieldGet(this,c))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(_classPrivateFieldGet(this,c)).then((function(t){return _classPrivateMethodGet(e,y,F).call(e,t,!0)})).finally((function(){return _classPrivateMethodGet(e,_,E).call(e)}));if(_classPrivateFieldGet(this,d)){var t=_classPrivateFieldGet(this,d);return _classPrivateFieldSet(this,d,null),this._uiManager.enableWaiting(!0),void _classPrivateFieldSet(this,u,this._uiManager.imageManager.getFromUrl(t).then((function(t){return _classPrivateMethodGet(e,y,F).call(e,t)})).finally((function(){return _classPrivateMethodGet(e,_,E).call(e)})))}if(_classPrivateFieldGet(this,f)){var n=_classPrivateFieldGet(this,f);return _classPrivateFieldSet(this,f,null),this._uiManager.enableWaiting(!0),void _classPrivateFieldSet(this,u,this._uiManager.imageManager.getFromFile(n).then((function(t){return _classPrivateMethodGet(e,y,F).call(e,t)})).finally((function(){return _classPrivateMethodGet(e,_,E).call(e)})))}var a=document.createElement("input");a.type="file",a.accept=r.supportedTypesStr,_classPrivateFieldSet(this,u,new Promise((function(t){a.addEventListener("change",_asyncToGenerator(_regeneratorRuntime().mark((function n(){var r;return _regeneratorRuntime().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a.files&&0!==a.files.length){n.next=4;break}e.remove(),n.next=9;break;case 4:return e._uiManager.enableWaiting(!0),n.next=7,e._uiManager.imageManager.getFromFile(a.files[0]);case 7:r=n.sent,_classPrivateMethodGet(e,y,F).call(e,r);case 9:t();case 10:case"end":return n.stop()}}),n)})))),a.addEventListener("cancel",(function(){e.remove(),t()}))})).finally((function(){return _classPrivateMethodGet(e,_,E).call(e)}))),a.click()}function T(){var e=this.div,t=_classPrivateFieldGet(this,l),n=t.width,r=t.height,a=_slicedToArray(this.pageDimensions,2),i=a[0],o=a[1],s=.75;if(this.width)n=this.width*i,r=this.height*o;else if(n>s*i||r>s*o){var c=Math.min(s*i/n,s*o/r);n*=c,r*=c}var u=_slicedToArray(this.parentDimensions,2),d=u[0],f=u[1];this.setDims(n*d/i,r*f/o),this._uiManager.enableWaiting(!1);var p=_classPrivateFieldSet(this,h,document.createElement("canvas"));e.append(p),e.hidden=!1,_classPrivateMethodGet(this,x,O).call(this,n,r),_classPrivateMethodGet(this,A,D).call(this),_classPrivateFieldGet(this,g)||(this.parent.addUndoableEditor(this),_classPrivateFieldSet(this,g,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}function I(e,t){var n,r=this,a=_slicedToArray(this.parentDimensions,2),i=a[0],o=a[1];this.width=e/i,this.height=t/o,this.setDims(e,t),null!==(n=this._initialOptions)&&void 0!==n&&n.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==_classPrivateFieldGet(this,v)&&clearTimeout(_classPrivateFieldGet(this,v)),_classPrivateFieldSet(this,v,setTimeout((function(){_classPrivateFieldSet(r,v,null),_classPrivateMethodGet(r,x,O).call(r,e,t)}),200))}function R(e,t){for(var n=_classPrivateFieldGet(this,l),r=n.width,a=n.height,i=_classPrivateFieldGet(this,l);r>2*e||a>2*t;){var o=r,s=a;r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2)),a>2*t&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));var c=new OffscreenCanvas(r,a);c.getContext("2d").drawImage(i,0,0,o,s,0,0,r,a),i=c.transferToImageBitmap()}return i}function O(e,t){e=Math.ceil(e),t=Math.ceil(t);var n=_classPrivateFieldGet(this,h);if(n&&(n.width!==e||n.height!==t)){n.width=e,n.height=t;var r=_classPrivateFieldGet(this,m)?_classPrivateFieldGet(this,l):_classPrivateMethodGet(this,S,R).call(this,e,t),a=n.getContext("2d");a.filter=this._uiManager.hcmFilter,a.drawImage(r,0,0,r.width,r.height,0,0,e,t)}}function L(e){if(e){if(_classPrivateFieldGet(this,m)){var t=this._uiManager.imageManager.getSvgUrl(_classPrivateFieldGet(this,c));if(t)return t}var n=document.createElement("canvas"),r=_classPrivateFieldGet(this,l);return n.width=r.width,n.height=r.height,n.getContext("2d").drawImage(_classPrivateFieldGet(this,l),0,0),n.toDataURL()}if(_classPrivateFieldGet(this,m)){var a=_slicedToArray(this.pageDimensions,2),i=a[0],s=a[1],u=Math.round(this.width*i*o.PixelsPerInch.PDF_TO_CSS_UNITS),d=Math.round(this.height*s*o.PixelsPerInch.PDF_TO_CSS_UNITS),f=new OffscreenCanvas(u,d);return f.getContext("2d").drawImage(_classPrivateFieldGet(this,l),0,0,_classPrivateFieldGet(this,l).width,_classPrivateFieldGet(this,l).height,0,0,u,d),f.transferToImageBitmap()}return structuredClone(_classPrivateFieldGet(this,l))}function D(){var e=this;_classPrivateFieldSet(this,p,new ResizeObserver((function(t){var n=t[0].contentRect;n.width&&n.height&&_classPrivateMethodGet(e,w,I).call(e,n.width,n.height)}))),_classPrivateFieldGet(this,p).observe(this.div)}r=C,_defineProperty(C,"_type","stamp"),t.StampEditor=C}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__w_pdfjs_require__),n.exports}var __nested_webpack_exports__={};return function(){var e=__nested_webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AbortException",{enumerable:!0,get:function(){return t.AbortException}}),Object.defineProperty(e,"AnnotationEditorLayer",{enumerable:!0,get:function(){return i.AnnotationEditorLayer}}),Object.defineProperty(e,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return t.AnnotationEditorParamsType}}),Object.defineProperty(e,"AnnotationEditorType",{enumerable:!0,get:function(){return t.AnnotationEditorType}}),Object.defineProperty(e,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return o.AnnotationEditorUIManager}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return s.AnnotationLayer}}),Object.defineProperty(e,"AnnotationMode",{enumerable:!0,get:function(){return t.AnnotationMode}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}}),Object.defineProperty(e,"DOMSVGFactory",{enumerable:!0,get:function(){return r.DOMSVGFactory}}),Object.defineProperty(e,"FeatureTest",{enumerable:!0,get:function(){return t.FeatureTest}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(e,"ImageKind",{enumerable:!0,get:function(){return t.ImageKind}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return t.OPS}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return r.PDFDateString}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}}),Object.defineProperty(e,"PixelsPerInch",{enumerable:!0,get:function(){return r.PixelsPerInch}}),Object.defineProperty(e,"PromiseCapability",{enumerable:!0,get:function(){return t.PromiseCapability}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return n.SVGGraphics}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return t.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}}),Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return c.XfaLayer}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return r.getFilenameFromUrl}}),Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return r.getPdfFilenameFromUrl}}),Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return r.getXfaPageViewport}}),Object.defineProperty(e,"isDataScheme",{enumerable:!0,get:function(){return r.isDataScheme}}),Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return r.isPdfFile}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(e,"noContextMenu",{enumerable:!0,get:function(){return r.noContextMenu}}),Object.defineProperty(e,"normalizeUnicode",{enumerable:!0,get:function(){return t.normalizeUnicode}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return a.renderTextLayer}}),Object.defineProperty(e,"setLayerDimensions",{enumerable:!0,get:function(){return r.setLayerDimensions}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(e,"updateTextLayer",{enumerable:!0,get:function(){return a.updateTextLayer}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}});var t=__w_pdfjs_require__(1),n=__w_pdfjs_require__(2),r=__w_pdfjs_require__(6),a=__w_pdfjs_require__(26),i=__w_pdfjs_require__(27),o=__w_pdfjs_require__(5),s=__w_pdfjs_require__(29),l=__w_pdfjs_require__(14),c=__w_pdfjs_require__(32)}(),__nested_webpack_exports__}()},module.exports=root.pdfjsLib=factory()},888:function(e,t,n){"use strict";var r=n(9047);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,i,o){if(o!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:a};return n.PropTypes=n,n}},2007:function(e,t,n){e.exports=n(888)()},9047:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4463:function(e,t,n){"use strict";var r=n(2791),a=n(5296);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n