!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("./pdf.js",[],t):"object"==typeof exports?exports["./pdf.js"]=t():e["./pdf.js"]=e.pdfjsLib=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(t){return e[t]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";var n=r(1),i=r(179),a=r(194),o=r(195),s=r(183),u=r(196),c=r(188),l=r(185),h=r(4);if(h()){var f=r(197).PDFNodeStream;i.setPDFNetworkStreamFactory(function(e){return new f(e)})}else{var d,p=r(200).PDFNetworkStream;s.isFetchSupported()&&(d=r(201).PDFFetchStream),i.setPDFNetworkStreamFactory(function(e){return d&&s.isValidFetchUrl(e.url)?new d(e):new p(e)})}t.build=i.build,t.version=i.version,t.getDocument=i.getDocument,t.LoopbackPort=i.LoopbackPort,t.PDFDataRangeTransport=i.PDFDataRangeTransport,t.PDFWorker=i.PDFWorker,t.renderTextLayer=a.renderTextLayer,t.AnnotationLayer=o.AnnotationLayer,t.createPromiseCapability=n.createPromiseCapability,t.PasswordResponses=n.PasswordResponses,t.InvalidPDFException=n.InvalidPDFException,t.MissingPDFException=n.MissingPDFException,t.SVGGraphics=u.SVGGraphics,t.NativeImageDecoding=n.NativeImageDecoding,t.CMapCompressionType=n.CMapCompressionType,t.PermissionFlag=n.PermissionFlag,t.UnexpectedResponseException=n.UnexpectedResponseException,t.OPS=n.OPS,t.VerbosityLevel=n.VerbosityLevel,t.UNSUPPORTED_FEATURES=n.UNSUPPORTED_FEATURES,t.createValidAbsoluteUrl=n.createValidAbsoluteUrl,t.createObjectURL=n.createObjectURL,t.removeNullCharacters=n.removeNullCharacters,t.shadow=n.shadow,t.Util=n.Util,t.ReadableStream=n.ReadableStream,t.RenderingCancelledException=s.RenderingCancelledException,t.getFilenameFromUrl=s.getFilenameFromUrl,t.LinkTarget=s.LinkTarget,t.addLinkAttributes=s.addLinkAttributes,t.loadScript=s.loadScript,t.PDFDateString=s.PDFDateString,t.GlobalWorkerOptions=c.GlobalWorkerOptions,t.apiCompatibilityParams=l.apiCompatibilityParams},function(e,t,r){"use strict";function n(e,t){for(var r=0;r=ue.INFOS&&console.log("Info: ".concat(e))}function v(e){de>=ue.WARNINGS}function g(e){throw new Error(e)}function m(e,t){e||g(t)}function y(e,t){var r;try{if(r=new URL(e),!r.origin||"null"===r.origin)return!1}catch(n){return!1}var i=new URL(t,r);return r.origin===i.origin}function b(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function _(e,t){if(!e)return null;try{var r=t?new URL(e,t):new URL(e);if(b(r))return r}catch(n){}return null}function A(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1}),r}function S(e){return"string"!=typeof e?(v("The argument for removeNullCharacters must be a string."),e):e.replace(Se,"")}function w(e){m(null!==e&&"object"===a(e)&&void 0!==e.length,"Invalid argument for bytesToString");var t=e.length,r=8192;if(t>24&255,e>>16&255,e>>8&255,255&e)}function R(e){return e<=0?0:Math.ceil(Math.log2(e))}function E(e,t){return e[t]<<24>>24}function T(e,t){return e[t]<<8|e[t+1]}function O(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function L(){var e=new Uint8Array(4);e[0]=1;var t=new Uint32Array(e.buffer,0,1);return 1===t[0]}function F(){try{return new Function(""),!0}catch(e){return!1}}function I(e){var t=e.length,r=[];if("þ"===e[0]&&"ÿ"===e[1])for(var n=2;ne[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(t,r){function n(e,t){return e-t}var i=[t[0],t[2],r[0],r[2]].sort(n),a=[t[1],t[3],r[1],r[3]].sort(n),o=[];return t=e.normalizeRect(t),r=e.normalizeRect(r),i[0]===t[0]&&i[1]===r[0]||i[0]===r[0]&&i[1]===t[0]?(o[0]=i[1],o[2]=i[2],a[0]===t[1]&&a[1]===r[1]||a[0]===r[1]&&a[1]===t[1]?(o[1]=a[1],o[3]=a[2],o):null):null}}]),e}();t.Util=ke;var xe=[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],Ce=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!n&&URL.createObjectURL){var i=new Blob([t],{type:r});return URL.createObjectURL(i)}for(var a="data:".concat(r,";base64,"),o=0,s=t.length;o>2,f=(3&u)<<4|c>>4,d=o+1>6:64,p=o+21?!!arguments[1]:!this.contains(e);return this[t?"add":"remove"](e),t})}}(),function(){String.prototype.startsWith||r(5)}(),function(){String.prototype.endsWith||r(57)}(),function(){String.prototype.includes||r(59)}(),function(){Array.prototype.includes||r(61)}(),function(){Array.from||r(68)}(),function(){Object.assign||r(89)}(),function(){Math.log2||(Math.log2=r(92))}(),function(){Number.isNaN||(Number.isNaN=r(94))}(),function(){Number.isInteger||(Number.isInteger=r(96))}(),function(){i.Promise&&i.Promise.prototype&&i.Promise.prototype["finally"]||(i.Promise=r(99))}(),function(){i.URL=r(121)}(),function(){i.WeakMap||(i.WeakMap=r(128))}(),function(){i.WeakSet||(i.WeakSet=r(138))}(),function(){String.prototype.codePointAt||r(140)}(),function(){String.fromCodePoint||(String.fromCodePoint=r(142))}(),function(){i.Symbol||r(144)}(),function(){String.prototype.padStart||r(167)}(),function(){String.prototype.padEnd||r(172)}(),function(){Object.values||(Object.values=r(174))}()}},function(e,t,r){"use strict";e.exports="undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:{}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(){return"object"===("undefined"==typeof process?"undefined":n(process))&&process+""=="[object process]"&&!process.versions.nw&&!process.versions.electron}},function(e,t,r){r(6);var n=r(54);e.exports=n("String","startsWith")},function(e,t,r){"use strict";var n=r(7),i=r(43),a=r(49),o=r(17),s=r(53),u="".startsWith,c=Math.min;n({target:"String",proto:!0,forced:!s("startsWith")},{startsWith:function(e){var t=String(o(this));a(e);var r=i(c(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return u?u.call(t,n,r):t.slice(r,r+n.length)===n}})},function(e,t,r){var n=r(8),i=r(9).f,a=r(23),o=r(26),s=r(28),u=r(36),c=r(48);e.exports=function(e,t){var r,l,h,f,d,p,v=e.target,g=e.global,m=e.stat;if(l=g?n:m?n[v]||s(v,{}):(n[v]||{}).prototype)for(h in t){if(d=t[h],e.noTargetGet?(p=i(l,h),f=p&&p.value):f=l[h],r=c(g?h:v+(m?".":"#")+h,e.forced),!r&&void 0!==f){if(typeof d==typeof f)continue;u(d,f)}(e.sham||f&&f.sham)&&a(d,"sham",!0),o(l,h,d,e)}}},function(e,t){var r="object",n=function(e){return e&&e.Math==Math&&e};e.exports=n(typeof globalThis==r&&globalThis)||n(typeof window==r&&window)||n(typeof self==r&&self)||n(typeof global==r&&global)||Function("return this")()},function(e,t,r){var n=r(10),i=r(12),a=r(13),o=r(14),s=r(18),u=r(20),c=r(21),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=o(e),t=s(t,!0),c)try{return l(e,t)}catch(r){}if(u(e,t))return a(!i.f.call(e,t),e[t])}},function(e,t,r){var n=r(11);e.exports=!n(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,r){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,a=i&&!n.call({1:2},1);t.f=a?function(e){var t=i(this,e);return!!t&&t.enumerable}:n},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var n=r(15),i=r(17);e.exports=function(e){return n(i(e))}},function(e,t,r){var n=r(11),i=r(16),a="".split;e.exports=n(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==i(e)?a.call(e,""):Object(e)}:Object},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(19);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(10),i=r(11),a=r(22);e.exports=!n&&!i(function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){var n=r(8),i=r(19),a=n.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},function(e,t,r){var n=r(10),i=r(24),a=r(13);e.exports=n?function(e,t,r){return i.f(e,t,a(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(10),i=r(21),a=r(25),o=r(18),s=Object.defineProperty;t.f=n?s:function(e,t,r){if(a(e),t=o(t,!0),a(r),i)try{return s(e,t,r)}catch(n){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){var n=r(19);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,r){var n=r(8),i=r(27),a=r(23),o=r(20),s=r(28),u=r(30),c=r(31),l=c.get,h=c.enforce,f=String(u).split("toString");i("inspectSource",function(e){return u.call(e)}),(e.exports=function(e,t,r,i){var u=!!i&&!!i.unsafe,c=!!i&&!!i.enumerable,l=!!i&&!!i.noTargetGet;return"function"==typeof r&&("string"!=typeof t||o(r,"name")||a(r,"name",t),h(r).source=f.join("string"==typeof t?t:"")),e===n?void(c?e[t]=r:s(t,r)):(u?!l&&e[t]&&(c=!0):delete e[t],void(c?e[t]=r:a(e,t,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&l(this).source||u.call(this)})},function(e,t,r){var n=r(8),i=r(28),a=r(29),o="__core-js_shared__",s=n[o]||i(o,{});(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.2.1",mode:a?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t,r){var n=r(8),i=r(23);e.exports=function(e,t){try{i(n,e,t)}catch(r){n[e]=t}return t}},function(e,t){e.exports=!1},function(e,t,r){var n=r(27);e.exports=n("native-function-to-string",Function.toString)},function(e,t,r){var n,i,a,o=r(32),s=r(8),u=r(19),c=r(23),l=r(20),h=r(33),f=r(35),d=s.WeakMap,p=function(e){return a(e)?i(e):n(e,{})},v=function(e){return function(t){var r;if(!u(t)||(r=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}};if(o){var g=new d,m=g.get,y=g.has,b=g.set;n=function(e,t){return b.call(g,e,t),t},i=function(e){return m.call(g,e)||{}},a=function(e){return y.call(g,e)}}else{var _=h("state");f[_]=!0,n=function(e,t){return c(e,_,t),t},i=function(e){return l(e,_)?e[_]:{}},a=function(e){return l(e,_)}}e.exports={set:n,get:i,has:a,enforce:p,getterFor:v}},function(e,t,r){var n=r(8),i=r(30),a=n.WeakMap;e.exports="function"==typeof a&&/native code/.test(i.call(a))},function(e,t,r){var n=r(27),i=r(34),a=n("keys");e.exports=function(e){return a[e]||(a[e]=i(e))}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++r+n).toString(36)}},function(e,t){e.exports={}},function(e,t,r){var n=r(20),i=r(37),a=r(9),o=r(24);e.exports=function(e,t){for(var r=i(t),s=o.f,u=a.f,c=0;cu;)n(s,r=t[u++])&&(~a(c,r)||c.push(r));return c}},function(e,t,r){var n=r(14),i=r(43),a=r(45),o=function(e){return function(t,r,o){var s,u=n(t),c=i(u.length),l=a(o,c);if(e&&r!=r){for(;c>l;)if(s=u[l++],s!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},function(e,t,r){var n=r(44),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n=r(44),i=Math.max,a=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):a(r,t)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(11),i=/#|\.prototype\./,a=function(e,t){var r=s[o(e)];return r==c||r!=u&&("function"==typeof t?n(t):!!t)},o=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},s=a.data={},u=a.NATIVE="N",c=a.POLYFILL="P";e.exports=a},function(e,t,r){var n=r(50);e.exports=function(e){if(n(e))throw TypeError("The method doesn't accept regular expressions");return e}},function(e,t,r){var n=r(19),i=r(16),a=r(51),o=a("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,r){var n=r(8),i=r(27),a=r(34),o=r(52),s=n.Symbol,u=i("wks");e.exports=function(e){return u[e]||(u[e]=o&&s[e]||(o?s:a)("Symbol."+e))}},function(e,t,r){var n=r(11);e.exports=!!Object.getOwnPropertySymbols&&!n(function(){return!String(Symbol())})},function(e,t,r){var n=r(51),i=n("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[i]=!1,"/./"[e](t)}catch(n){}}return!1}},function(e,t,r){var n=r(8),i=r(55),a=Function.call;e.exports=function(e,t,r){return i(a,n[e].prototype[t],r)}},function(e,t,r){var n=r(56);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,r){r(58);var n=r(54);e.exports=n("String","endsWith")},function(e,t,r){"use strict";var n=r(7),i=r(43),a=r(49),o=r(17),s=r(53),u="".endsWith,c=Math.min;n({target:"String",proto:!0,forced:!s("endsWith")},{endsWith:function(e){var t=String(o(this));a(e);var r=arguments.length>1?arguments[1]:void 0,n=i(t.length),s=void 0===r?n:c(i(r),n),l=String(e);return u?u.call(t,l,s):t.slice(s-l.length,s)===l}})},function(e,t,r){r(60);var n=r(54);e.exports=n("String","includes")},function(e,t,r){"use strict";var n=r(7),i=r(49),a=r(17),o=r(53);n({target:"String",proto:!0,forced:!o("includes")},{includes:function(e){return!!~String(a(this)).indexOf(i(e),arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){r(62);var n=r(54);e.exports=n("Array","includes")},function(e,t,r){"use strict";var n=r(7),i=r(42).includes,a=r(63);n({target:"Array",proto:!0},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},function(e,t,r){var n=r(51),i=r(64),a=r(23),o=n("unscopables"),s=Array.prototype;void 0==s[o]&&a(s,o,i(null)),e.exports=function(e){s[o][e]=!0}},function(e,t,r){var n=r(25),i=r(65),a=r(46),o=r(35),s=r(67),u=r(22),c=r(33),l=c("IE_PROTO"),h="prototype",f=function(){},d=function(){var e,t=u("iframe"),r=a.length,n="<",i="script",o=">",c="java"+i+":";for(t.style.display="none",s.appendChild(t),t.src=String(c),e=t.contentWindow.document,e.open(),e.write(n+i+o+"document.F=Object"+n+"/"+i+o),e.close(),d=e.F;r--;)delete d[h][a[r]];return d()};e.exports=Object.create||function(e,t){var r;return null!==e?(f[h]=n(e),r=new f,f[h]=null,r[l]=e):r=d(),void 0===t?r:i(r,t)},o[l]=!0},function(e,t,r){var n=r(10),i=r(24),a=r(25),o=r(66);e.exports=n?Object.defineProperties:function(e,t){a(e);for(var r,n=o(t),s=n.length,u=0;s>u;)i.f(e,r=n[u++],t[r]);return e}},function(e,t,r){var n=r(41),i=r(46);e.exports=Object.keys||function(e){return n(e,i)}},function(e,t,r){var n=r(38);e.exports=n("document","documentElement")},function(e,t,r){r(69),r(81);var n=r(39);e.exports=n.Array.from},function(e,t,r){"use strict";var n=r(70).charAt,i=r(31),a=r(71),o="String Iterator",s=i.set,u=i.getterFor(o);a(String,"String",function(e){s(this,{type:o,string:String(e),index:0})},function(){var e,t=u(this),r=t.string,i=t.index;return i>=r.length?{value:void 0,done:!0}:(e=n(r,i),t.index+=e.length,{value:e,done:!1})})},function(e,t,r){var n=r(44),i=r(17),a=function(e){return function(t,r){var a,o,s=String(i(t)),u=n(r),c=s.length;return u<0||u>=c?e?"":void 0:(a=s.charCodeAt(u),a<55296||a>56319||u+1===c||(o=s.charCodeAt(u+1))<56320||o>57343?e?s.charAt(u):a:e?s.slice(u,u+2):(a-55296<<10)+(o-56320)+65536)}};e.exports={codeAt:a(!1),charAt:a(!0)}},function(e,t,r){"use strict";var n=r(7),i=r(72),a=r(74),o=r(79),s=r(77),u=r(23),c=r(26),l=r(51),h=r(29),f=r(78),d=r(73),p=d.IteratorPrototype,v=d.BUGGY_SAFARI_ITERATORS,g=l("iterator"),m="keys",y="values",b="entries",_=function(){return this};e.exports=function(e,t,r,l,d,A,S){i(r,t,l);var w,k,x,C=function(e){if(e===d&&O)return O;if(!v&&e in E)return E[e];switch(e){case m:return function(){return new r(this,e)};case y:return function(){return new r(this,e)};case b:return function(){return new r(this,e)}}return function(){return new r(this)}},P=t+" Iterator",R=!1,E=e.prototype,T=E[g]||E["@@iterator"]||d&&E[d],O=!v&&T||C(d),L="Array"==t?E.entries||T:T;if(L&&(w=a(L.call(new e)),p!==Object.prototype&&w.next&&(h||a(w)===p||(o?o(w,p):"function"!=typeof w[g]&&u(w,g,_)),s(w,P,!0,!0),h&&(f[P]=_))),d==y&&T&&T.name!==y&&(R=!0,O=function(){return T.call(this)}),h&&!S||E[g]===O||u(E,g,O),f[t]=O,d)if(k={values:C(y), keys:A?O:C(m),entries:C(b)},S)for(x in k)!v&&!R&&x in E||c(E,x,k[x]);else n({target:t,proto:!0,forced:v||R},k);return k}},function(e,t,r){"use strict";var n=r(73).IteratorPrototype,i=r(64),a=r(13),o=r(77),s=r(78),u=function(){return this};e.exports=function(e,t,r){var c=t+" Iterator";return e.prototype=i(n,{next:a(1,r)}),o(e,c,!1,!0),s[c]=u,e}},function(e,t,r){"use strict";var n,i,a,o=r(74),s=r(23),u=r(20),c=r(51),l=r(29),h=c("iterator"),f=!1,d=function(){return this};[].keys&&(a=[].keys(),"next"in a?(i=o(o(a)),i!==Object.prototype&&(n=i)):f=!0),void 0==n&&(n={}),l||u(n,h)||s(n,h,d),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},function(e,t,r){var n=r(20),i=r(75),a=r(33),o=r(76),s=a("IE_PROTO"),u=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return e=i(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},function(e,t,r){var n=r(17);e.exports=function(e){return Object(n(e))}},function(e,t,r){var n=r(11);e.exports=!n(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},function(e,t,r){var n=r(24).f,i=r(20),a=r(51),o=a("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},function(e,t){e.exports={}},function(e,t,r){var n=r(25),i=r(80);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,e.call(r,[]),t=r instanceof Array}catch(a){}return function(r,a){return n(r),i(a),t?e.call(r,a):r.__proto__=a,r}}():void 0)},function(e,t,r){var n=r(19);e.exports=function(e){if(!n(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t,r){var n=r(7),i=r(82),a=r(88),o=!a(function(e){Array.from(e)});n({target:"Array",stat:!0,forced:o},{from:i})},function(e,t,r){"use strict";var n=r(55),i=r(75),a=r(83),o=r(84),s=r(43),u=r(85),c=r(86);e.exports=function(e){var t,r,l,h,f=i(e),d="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,g=void 0!==v,m=0,y=c(f);if(g&&(v=n(v,p>2?arguments[2]:void 0,2)),void 0==y||d==Array&&o(y))for(t=s(f.length),r=new d(t);t>m;m++)u(r,m,g?v(f[m],m):f[m]);else for(h=y.call(f),r=new d;!(l=h.next()).done;m++)u(r,m,g?a(h,v,[l.value,m],!0):l.value);return r.length=m,r}},function(e,t,r){var n=r(25);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(a){var o=e["return"];throw void 0!==o&&n(o.call(e)),a}}},function(e,t,r){var n=r(51),i=r(78),a=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[a]===e)}},function(e,t,r){"use strict";var n=r(18),i=r(24),a=r(13);e.exports=function(e,t,r){var o=n(t);o in e?i.f(e,o,a(0,r)):e[o]=r}},function(e,t,r){var n=r(87),i=r(78),a=r(51),o=a("iterator");e.exports=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||i[n(e)]}},function(e,t,r){var n=r(16),i=r(51),a=i("toStringTag"),o="Arguments"==n(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(r){}};e.exports=function(e){var t,r,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=s(t=Object(e),a))?r:o?n(t):"Object"==(i=n(t))&&"function"==typeof t.callee?"Arguments":i}},function(e,t,r){var n=r(51),i=n("iterator"),a=!1;try{var o=0,s={next:function(){return{done:!!o++}},"return":function(){a=!0}};s[i]=function(){return this},Array.from(s,function(){throw 2})}catch(u){}e.exports=function(e,t){if(!t&&!a)return!1;var r=!1;try{var n={};n[i]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(o){}return r}},function(e,t,r){r(90);var n=r(39);e.exports=n.Object.assign},function(e,t,r){var n=r(7),i=r(91);n({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},function(e,t,r){"use strict";var n=r(10),i=r(11),a=r(66),o=r(47),s=r(12),u=r(75),c=r(15),l=Object.assign;e.exports=!l||i(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=l({},e)[r]||a(l({},t)).join("")!=n})?function(e,t){for(var r=u(e),i=arguments.length,l=1,h=o.f,f=s.f;i>l;)for(var d,p=c(arguments[l++]),v=h?a(p).concat(h(p)):a(p),g=v.length,m=0;g>m;)d=v[m++],n&&!f.call(p,d)||(r[d]=p[d]);return r}:l},function(e,t,r){r(93);var n=r(39);e.exports=n.Math.log2},function(e,t,r){var n=r(7),i=Math.log,a=Math.LN2;n({target:"Math",stat:!0},{log2:function(e){return i(e)/a}})},function(e,t,r){r(95);var n=r(39);e.exports=n.Number.isNaN},function(e,t,r){var n=r(7);n({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},function(e,t,r){r(97);var n=r(39);e.exports=n.Number.isInteger},function(e,t,r){var n=r(7),i=r(98);n({target:"Number",stat:!0},{isInteger:i})},function(e,t,r){var n=r(19),i=Math.floor;e.exports=function(e){return!n(e)&&isFinite(e)&&i(e)===e}},function(e,t,r){r(100),r(69),r(102),r(105),r(119),r(120);var n=r(39);e.exports=n.Promise},function(e,t,r){var n=r(26),i=r(101),a=Object.prototype;i!==a.toString&&n(a,"toString",i,{unsafe:!0})},function(e,t,r){"use strict";var n=r(87),i=r(51),a=i("toStringTag"),o={};o[a]="z",e.exports="[object z]"!==String(o)?function(){return"[object "+n(this)+"]"}:o.toString},function(e,t,r){var n=r(8),i=r(103),a=r(104),o=r(23),s=r(51),u=s("iterator"),c=s("toStringTag"),l=a.values;for(var h in i){var f=n[h],d=f&&f.prototypeif(d){if(d[u]!==l)try{o(d,u,l)}catch(p){d[u]=l}if(d[c]||o(d,c,h),i[h])for(var v in a)if(d[v]!==a[v])try{o(d,v,a[v])}catch(p){d[v]=a[v]}}}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,r){"use strict";var n=r(14),i=r(63),a=r(78),o=r(31),s=r(71),u="Array Iterator",c=o.set,l=o.getterFor(u);e.exports=s(Array,"Array",function(e,t){c(this,{type:u,target:n(e),index:0,kind:t})},function(){var e=l(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},function(e,t,r){"use strict";var n,i,a,o,s=r(7),u=r(29),c=r(8),l=r(39),h=r(106),f=r(26),d=r(107),p=r(77),v=r(108),g=r(19),m=r(56),y=r(109),b=r(16),_=r(110),A=r(88),S=r(111),w=r(112).set,k=r(113),x=r(115),C=r(117),P=r(116),R=r(118),E=r(114),T=r(31),O=r(48),L=r(51),F=L("species"),I="Promise",j=T.get,M=T.set,N=T.getterFor(I),D=h,q=c.TypeError,U=c.document,W=c.process,B=c.fetch,z=W&&W.versions,G=z&&z.v8||"",H=P.f,X=H,Y="process"==b(W),V=!!(U&&U.createEvent&&c.dispatchEvent),Q="unhandledrejection",K="rejectionhandled",J=0,Z=1,$=2,ee=1,te=2,re=O(I,function(){var e=D.resolve(1),t=function(){},r=(e.constructor={})[F]=function(e){e(t,t)};return!((Y||"function"==typeof PromiseRejectionEvent)&&(!u||e["finally"])&&e.then(t)instanceof r&&0!==G.indexOf("6.6")&&E.indexOf("Chrome/66")===-1)}),ne=re||!A(function(e){D.all(e)["catch"](function(){})}),ie=function(e){var t;return!(!g(e)||"function"!=typeof(t=e.then))&&t},ae=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;k(function(){for(var i=t.value,a=t.state==Z,o=0;n.length>o;){var s,u,c,l=n[o++],h=a?l.ok:l.fail,f=l.resolve,d=l.reject,p=l.domain;try{h?(a||(t.rejection===te&&ce(e,t),t.rejection=ee),h===!0?s=i:(p&&p.enter(),s=h(i),p&&(p.exit(),c=!0)),s===l.promise?d(q("Promise-chain cycle")):(u=ie(s))?u.call(s,f,d):f(s)):d(i)}catch(v){p&&!c&&p.exit(),d(v)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&se(e,t)})}},oe=function(e,t,r){var n,i;V?(n=U.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},(i=c["on"+e])?i(n):e===Q&&C("Unhandled promise rejection",r)},se=function(e,t){w.call(c,function(){var r,n=t.value,i=ue(t);if(i&&(r=R(function(){Y?W.emit("unhandledRejection",n,e):oe(Q,e,n)}),t.rejection=Y||ue(t)?te:ee,r.error))throw r.value})},ue=function(e){return e.rejection!==ee&&!e.parent},ce=function(e,t){w.call(c,function(){Y?W.emit("rejectionHandled",e):oe(K,e,t.value)})},le=function(e,t,r,n){return function(i){e(t,r,i,n)}},he=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=$,ae(e,t,!0))},fe=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw q("Promise can't be resolved itself");var i=ie(r);i?k(function(){var n={done:!1};try{i.call(r,le(fe,e,n,t),le(he,e,n,t))}catch(a){he(e,n,a,t)}}):(t.value=r,t.state=Z,ae(e,t,!1))}catch(a){he(e,{done:!1},a,t)}}};re&&(D=function(e){y(this,D,I),m(e),n.call(this);var t=j(this);try{e(le(fe,this,t),le(he,this,t))}catch(r){he(this,t,r)}},n=function(e){M(this,{type:I,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:J,value:void 0})},n.prototype=d(D.prototype,{then:function(e,t){var r=N(this),n=H(S(this,D));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=Y?W.domain:void 0,r.parent=!0,r.reactions.push(n),r.state!=J&&ae(this,r,!1),n.promise},"catch":function(e){return this.then(void 0,e)}}),i=function(){var e=new n,t=j(e);this.promise=e,this.resolve=le(fe,e,t),this.reject=le(he,e,t)},P.f=H=function(e){return e===D||e===a?new i(e):X(e)},u||"function"!=typeof h||(o=h.prototype.then,f(h.prototype,"then",function(e,t){var r=this;return new D(function(e,t){o.call(r,e,t)}).then(e,t)}),"function"==typeof B&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return x(D,B.apply(c,arguments))}}))),s({global:!0,wrap:!0,forced:re},{Promise:D}),p(D,I,!1,!0),v(I),a=l[I],s({target:I,stat:!0,forced:re},{reject:function(e){var t=H(this);return t.reject.call(void 0,e),t.promise}}),s({target:I,stat:!0,forced:u||re},{resolve:function(e){return x(u&&this===a?D:this,e)}}),s({target:I,stat:!0,forced:ne},{all:function(e){var t=this,r=H(t),n=r.resolve,i=r.reject,a=R(function(){var r=m(t.resolve),a=[],o=0,s=1;_(e,function(e){var u=o++,c=!1;a.push(void 0),s++,r.call(t,e).then(function(e){c||(c=!0,a[u]=e,--s||n(a))},i)}),--s||n(a)});return a.error&&i(a.value),r.promise},race:function(e){var t=this,r=H(t),n=r.reject,i=R(function(){var i=m(t.resolve);_(e,function(e){i.call(t,e).then(r.resolve,n)})});return i.error&&n(i.value),r.promise}})},function(e,t,r){var n=r(8);e.exports=n.Promise},function(e,t,r){var n=r(26);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},function(e,t,r){"use strict";var n=r(38),i=r(24),a=r(51),o=r(10),s=a("species");e.exports=function(e){var t=n(e),r=i.f;o&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e}},function(e,t,r){var n=r(25),i=r(84),a=r(43),o=r(55),s=r(86),u=r(83),c=function(e,t){this.stopped=e,this.result=t},l=e.exports=function(e,t,r,l,h){var f,d,p,v,g,m,y=o(t,r,l?2:1);if(h)f=e;else{if(d=s(e),"function"!=typeof d)throw TypeError("Target is not iterable");if(i(d)){for(p=0,v=a(e.length);v>p;p++)if(g=l?y(n(m=e[p])[0],m[1]):y(e[p]),g&&g instanceof c)return g;return new c((!1))}f=d.call(e)}for(;!(m=f.next()).done;)if(g=u(f,y,m.value,l),g&&g instanceof c)return g;return new c((!1))};l.stop=function(e){return new c((!0),e)}},function(e,t,r){var n=r(25),i=r(56),a=r(51),o=a("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||void 0==(r=n(a)[o])?t:i(r)}},function(e,t,r){var n,i,a,o=r(8),s=r(11),u=r(16),c=r(55),l=r(67),h=r(22),f=o.location,d=o.setImmediate,p=o.clearImmediate,v=o.process,g=o.MessageChannel,m=o.Dispatch,y=0,b={},_="onreadystatechange",A=function(e){if(b.hasOwnProperty(e)){var t=b[e];delete b[e],t()}},S=function(e){return function(){A(e)}},w=function(e){A(e.data)},k=function(e){o.postMessage(e+"",f.protocol+"//"+f.host)};d&&p||(d=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return b[++y]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},n(y),y},p=function(e){delete b[e]},"process"==u(v)?n=function(e){v.nextTick(S(e))}:m&&m.now?n=function(e){m.now(S(e))}:g?(i=new g,a=i.port2,i.port1.onmessage=w,n=c(a.postMessage,a,1)):!o.addEventListener||"function"!=typeof postMessage||o.importScripts||s(k)?n=_ in h("script")?function(e){l.appendChild(h("script"))[_]=function(){l.removeChild(this),A(e)}}:function(e){setTimeout(S(e),0)}:(n=k,o.addEventListener("message",w,!1))),e.exports={set:d,clear:p}},function(e,t,r){var n,i,a,o,s,u,c,l,h=r(8),f=r(9).f,d=r(16),p=r(112).set,v=r(114),g=h.MutationObserver||h.WebKitMutationObserver,m=h.process,y=h.Promise,b="process"==d(m),_=f(h,"queueMicrotask"),A=_&&_.value;A||(n=function(){var e,t;for(b&&(e=m.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(r){throw i?o():a=void 0,r}}a=void 0,e&&e.enter()},b?o=function(){m.nextTick(n)}:g&&!/(iphone|ipod|ipad).*applewebkit/i.test(v)?(s=!0,u=document.createTextNode(""),new g(n).observe(u,{characterData:!0}),o=function(){u.data=s=!s}):y&&y.resolve?(c=y.resolve(void 0),l=c.then,o=function(){l.call(c,n)}):o=function(){p.call(h,n)}),e.exports=A||function(e){var t={fn:e,next:void 0};a&&(a.next=t),i||(i=t,o()),a=t}},function(e,t,r){var n=r(38);e.exports=n("navigator","userAgent")||""},function(e,t,r){var n=r(25),i=r(19),a=r(116);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=a.f(e),o=r.resolve;return o(t),r.promise}},function(e,t,r){"use strict";var n=r(56),i=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new i(e)}},function(e,t,r){var n=r(8);e.exports=function(e,t){var r=n.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}},function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},function(e,t,r){"use strict";var n=r(7),i=r(56),a=r(116),o=r(118),s=r(110);n({target:"Promise",stat:!0},{allSettled:function(e){var t=this,r=a.f(t),n=r.resolve,u=r.reject,c=o(function(){var r=i(t.resolve),a=[],o=0,u=1;s(e,function(e){var i=o++,s=!1;a.push(void 0),u++,r.call(t,e).then(function(e){s||(s=!0,a[i]={status:"fulfilled",value:e},--u||n(a))},function(e){s||(s=!0,a[i]={status:"rejected",reason:e},--u||n(a))})}),--u||n(a)});return c.error&&u(c.value),r.promise}})},function(e,t,r){"use strict";var n=r(7),i=r(29),a=r(106),o=r(38),s=r(111),u=r(115),c=r(26);n({target:"Promise",proto:!0,real:!0},{"finally":function(e){var t=s(this,o("Promise")),r="function"==typeof e;return this.then(r?function(r){return u(t,e()).then(function(){return r})}:e,r?function(r){return u(t,e()).then(function(){throw r})}:e)}}),i||"function"!=typeof a||a.prototype["finally"]||c(a.prototype,"finally",o("Promise").prototype["finally"])},function(e,t,r){r(122),r(127),r(125);var n=r(39);e.exports=n.URL},function(e,t,r){"use strict";r(69);var n,i=r(7),a=r(10),o=r(123),s=r(8),u=r(65),c=r(26),l=r(109),h=r(20),f=r(91),d=r(82),p=r(70).codeAt,v=r(124),g=r(77),m=r(125),y=r(31),b=s.URL,_=m.URLSearchParams,A=m.getState,S=y.set,w=y.getterFor("URL"),k=Math.floor,x=Math.pow,C="Invalid authority",P="Invalid scheme",R="Invalid host",E="Invalid port",T=/[A-Za-z]/,O=/[\d+\-.A-Za-z]/,L=/\d/,F=/^(0x|0X)/,I=/^[0-7]+$/,j=/^\d+$/,M=/^[\dA-Fa-f]+$/,N=/[\u0000\u0009\u000A\u000D #%\/:?@[\\]]/,D=/[\u0000\u0009\u000A\u000D #\/:?@[\\]]/,q=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,U=/[\u0009\u000A\u000D]/g,W=function(e,t){var r,n,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return R;if(r=z(t.slice(1,-1)),!r)return R;e.host=r}else if(Z(e)){if(t=v(t),N.test(t))return R;if(r=B(t),null===r)return R;e.host=r}else{if(D.test(t))return R;for(r="",n=d(t),i=0;i4)return e;for(r=[],n=0;n1&&"0"==i.charAt(0)&&(a=F.test(i)?16:8,i=i.slice(8==a?1:2)),""===i)o=0;else{if(!(10==a?j:8==a?I:M).test(i))return e;o=parseInt(i,a)}r.push(o)}for(n=0;n=x(256,5-t))return null}else if(o>255)return null;for(s=r.pop(),n=0;n6)return;for(n=0;f();){if(i=null,n>0){if(!("."==f()&&n<4))return;h++}if(!L.test(f()))return;for(;L.test(f());){if(a=parseInt(f(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;h++}u[c]=256*u[c]+i,n++,2!=n&&4!=n||c++}if(4!=n)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;u[c++]=t}else{if(null!==l)return;h++,c++,l=c}}if(null!==l)for(o=c-l,c=7;0!=c&&o>0;)s=u[c],u[c--]=u[l+o-1],u[l+--o]=s;else if(8!=c)return;return u},G=function(e){for(var t=null,r=1,n=null,i=0,a=0;a<8;a++)0!==e[a]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=a),++i);return i>r&&(t=n,r=i),t},H=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=k(e/256);return t.join(".")}if("object"==typeof e){for(t="",n=G(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}return e},X={},Y=f({},X,{" ":1,'"':1,"<":1,">":1,"`":1}),V=f({},Y,{"#":1,"?":1,"{":1,"}":1}),Q=f({},V,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),K=function(e,t){var r=p(e,0);return r>32&&r<127&&!h(t,e)?e:encodeURIComponent(e)},J={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443},Z=function(e){return h(J,e.scheme)},$=function(e){return""!=e.username||""!=e.password},ee=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},te=function(e,t){var r;return 2==e.length&&T.test(e.charAt(0))&&(":"==(r=e.charAt(1))||!t&&"|"==r)},re=function(e){var t;return e.length>1&&te(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},ne=function(e){var t=e.path,r=t.length;!r||"file"==e.scheme&&1==r&&te(t[0],!0)||t.pop()},ie=function(e){return"."===e||"%2e"===e.toLowerCase()},ae=function(e){return e=e.toLowerCase(),".."===e||"%2e."===e||".%2e"===e||"%2e%2e"===e},oe={},se={},ue={},ce={},le={},he={},fe={},de={},pe={},ve={},ge={},me={},ye={},be={},_e={},Ae={},Se={},we={},ke={},xe={},Ce={},Pe=function(e,t,r,i){var a,o,s,u,c=r||oe,l=0,f="",p=!1,v=!1,g=!1;for(r||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(q,"")),t=t.replace(U,""),a=d(t);l<=a.length;){switch(o=a[l],c){case oe:if(!o||!T.test(o)){if(r)return P;c=ue;continue}f+=o.toLowerCase(),c=se;break;case se:if(o&&(O.test(o)||"+"==o||"-"==o||"."==o))f+=o.toLowerCase();else{if(":"!=o){if(r)return P;f="",c=ue,l=0;continue}if(r&&(Z(e)!=h(J,f)||"file"==f&&($(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=f,r)return void(Z(e)&&J[e.scheme]==e.port&&(e.port=null));f="","file"==e.scheme?c=be:Z(e)&&i&&i.scheme==e.scheme?c=ce:Z(e)?c=de:"/"==a[l+1]?(c=le,l++):(e.cannotBeABaseURL=!0,e.path.push(""),c=ke)}break;case ue:if(!i||i.cannotBeABaseURL&&"#"!=o)return P;if(i.cannotBeABaseURL&&"#"==o){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,c=Ce;break}c="file"==i.scheme?be:he;continue;case ce:if("/"!=o||"/"!=a[l+1]){c=he;continue}c=pe,l++;break;case le:if("/"==o){c=ve;break}c=we;continue;case he:if(e.scheme=i.scheme,o==n)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==o||"\\"==o&&Z(e))c=fe;else if("?"==o)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",c=xe;else{if("#"!=o){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),c=we;continue}e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=Ce}break;case fe:if(!Z(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,c=we;continue}c=ve}else c=pe;break;case de:if(c=pe,"/"!=o||"/"!=f.charAt(l+1))continue;l++;break;case pe:if("/"!=o&&"\\"!=o){c=ve;continue}break;case ve:if("@"==o){p&&(f="%40"+f),p=!0,s=d(f);for(var m=0;m65535)return E;e.port=Z(e)&&_===J[e.scheme]?null:_,f=""}if(r)return;c=Se;continue}return E}f+=o;break;case be:if(e.scheme="file","/"==o||"\\"==o)c=_e;else{if(!i||"file"!=i.scheme){c=we;continue}if(o==n)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==o)e.host=i.host,e.path=i.path.slice(),e.query="",c=xe;else{if("#"!=o){re(a.slice(l).join(""))||(e.host=i.host,e.path=i.path.slice(),ne(e)),c=we;continue}e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=Ce}}break;case _e:if("/"==o||"\\"==o){c=Ae;break}i&&"file"==i.scheme&&!re(a.slice(l).join(""))&&(te(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),c=we;continue;case Ae:if(o==n||"/"==o||"\\"==o||"?"==o||"#"==o){if(!r&&te(f))c=we;else if(""==f){if(e.host="",r)return;c=Se}else{if(u=W(e,f))return u;if("localhost"==e.host&&(e.host=""),r)return;f="",c=Se}continue}f+=o;break;case Se:if(Z(e)){if(c=we,"/"!=o&&"\\"!=o)continue}else if(r||"?"!=o)if(r||"#"!=o){if(o!=n&&(c=we,"/"!=o))continue}else e.fragment="",c=Ce;else e.query="",c=xe;break;case we:if(o==n||"/"==o||"\\"==o&&Z(e)||!r&&("?"==o||"#"==o)){if(ae(f)?(ne(e),"/"==o||"\\"==o&&Z(e)||e.path.push("")):ie(f)?"/"==o||"\\"==o&&Z(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&te(f)&&(e.host&&(e.host=""),f=f.charAt(0)+":"),e.path.push(f)),f="","file"==e.scheme&&(o==n||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",c=xe):"#"==o&&(e.fragment="",c=Ce)}else f+=K(o,V);break;case ke:"?"==o?(e.query="",c=xe):"#"==o?(e.fragment="",c=Ce):o!=n&&(e.path[0]+=K(o,X));break;case xe:r||"#"!=o?o!=n&&("'"==o&&Z(e)?e.query+="%27":"#"==o?e.query+="%23":e.query+=K(o,X)):(e.fragment="",c=Ce);break;case Ce:o!=n&&(e.fragment+=K(o,Y))}l++}},Re=function(e){var t,r,n=l(this,Re,"URL"),i=arguments.length>1?arguments[1]:void 0,o=String(e),s=S(n,{type:"URL"});if(void 0!==i)if(i instanceof Re)t=w(i);else if(r=Pe(t={},String(i)))throw TypeError(r);if(r=Pe(s,o,null,t))throw TypeError(r);var u=s.searchParams=new _,c=A(u);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(u)||null},a||(n.href=Te.call(n),n.origin=Oe.call(n),n.protocol=Le.call(n),n.username=Fe.call(n),n.password=Ie.call(n),n.host=je.call(n),n.hostname=Me.call(n),n.port=Ne.call(n),n.pathname=De.call(n),n.search=qe.call(n),n.searchParams=Ue.call(n),n.hash=We.call(n))},Ee=Re.prototype,Te=function(){var e=w(this),t=e.scheme,r=e.username,n=e.password,i=e.host,a=e.port,o=e.path,s=e.query,u=e.fragment,c=t+":";return null!==i?(c+="//",$(e)&&(c+=r+(n?":"+n:"")+"@"),c+=H(i),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},Oe=function(){var e=w(this),t=e.scheme,r=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(n){return"null"}return"file"!=t&&Z(e)?t+"://"+H(e.host)+(null!==r?":"+r:""):"null"},Le=function(){return w(this).scheme+":"},Fe=function(){return w(this).username},Ie=function(){return w(this).password},je=function(){var e=w(this),t=e.host,r=e.port;return null===t?"":null===r?H(t):H(t)+":"+r},Me=function(){var e=w(this).host;return null===e?"":H(e)},Ne=function(){var e=w(this).port;return null===e?"":String(e)},De=function(){var e=w(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},qe=function(){var e=w(this).query;return e?"?"+e:""},Ue=function(){return w(this).searchParams},We=function(){var e=w(this).fragment;return e?"#"+e:""},Be=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(a&&u(Ee,{href:Be(Te,function(e){var t=w(this),r=String(e),n=Pe(t,r);if(n)throw TypeError(n);A(t.searchParams).updateSearchParams(t.query)}),origin:Be(Oe),protocol:Be(Le,function(e){var t=w(this);Pe(t,String(e)+":",oe)}),username:Be(Fe,function(e){var t=w(this),r=d(String(e));if(!ee(t)){t.username="";for(var n=0;n=55296&&i<=56319&&r>1,e+=g(e/t);e>v*o>>1;n+=i)e=g(e/v);return g(n+(v+1)*e/(e+s))},A=function(e){var t=[];e=y(e);var r,s,u=e.length,f=l,d=0,v=c;for(r=0;r=f&&sg((n-d)/k))throw RangeError(p);for(d+=(w-f)*k,f=w,r=0;rn)throw RangeError(p);if(s==f){for(var x=d,C=i;;C+=i){var P=C<=v?a:C>=v+o?o:C-v;if(x0?arguments[0]:void 0,u=this,c=[];if(A(u,{type:b,entries:c,updateURL:function(){},updateSearchParams:I}),void 0!==s)if(p(s))if(e=g(s),"function"==typeof e)for(t=e.call(s);!(r=t.next()).done;){if(n=v(d(r.value)),(i=n.next()).done||(a=n.next()).done||!n.next().done)throw TypeError("Expected sequence with length 2");c.push({key:i.value+"",value:a.value+""})}else for(o in s)h(s,o)&&c.push({key:o,value:s[o]+""});else F(c,"string"==typeof s?"?"===s.charAt(0)?s.slice(1):s:s+"")},D=N.prototype;o(D,{append:function(e,t){j(arguments.length,2);var r=S(this);r.entries.push({key:e+"",value:t+""}),r.updateURL()},"delete":function(e){j(arguments.length,1);for(var t=S(this),r=t.entries,n=e+"",i=0;ie.key){i.splice(t,0,e);break}t===r&&i.push(e)}n.updateURL()},forEach:function(e){for(var t,r=S(this).entries,n=f(e,arguments.length>1?arguments[1]:void 0,3),i=0;iw;w++)if((f||w in _)&&(m=_[w],y=A(m,w,b),e))if(t)x[w]=y;else if(y)switch(e){case 3:return!0;case 5:return m;case 6:return w;case 2:u.call(x,m)}else if(l)return!1;return h?-1:c||l?l:x}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6)}},function(e,t,r){var n=r(19),i=r(137),a=r(51),o=a("species");e.exports=function(e,t){var r;return i(e)&&(r=e.constructor,"function"!=typeof r||r!==Array&&!i(r.prototype)?n(r)&&(r=r[o],null===r&&(r=void 0)):r=void 0),new(void 0===r?Array:r)(0===t?0:t)}},function(e,t,r){var n=r(16);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){r(100),r(139),r(102);var n=r(39);e.exports=n.WeakSet},function(e,t,r){"use strict";var n=r(132),i=r(134);n("WeakSet",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},i,!1,!0)},function(e,t,r){r(141);var n=r(54);e.exports=n("String","codePointAt")},function(e,t,r){"use strict";var n=r(7),i=r(70).codeAt;n({target:"String",proto:!0},{codePointAt:function(e){return i(this,e)}})},function(e,t,r){r(143);var n=r(39);e.exports=n.String.fromCodePoint},function(e,t,r){var n=r(7),i=r(45),a=String.fromCharCode,o=String.fromCodePoint,s=!!o&&1!=o.length;n({target:"String",stat:!0,forced:s},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,o=0;n>o;){if(t=+arguments[o++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");r.push(t<65536?a(t):a(((t-=65536)>>10)+55296,t%1024+56320))}return r.join("")}})},function(e,t,r){r(145),r(100),r(147),r(151),r(152),r(153),r(154),r(155),r(156),r(157),r(158),r(159),r(160),r(161),r(162),r(163),r(164),r(165),r(166);var n=r(39);e.exports=n.Symbol},function(e,t,r){"use strict";var n=r(7),i=r(11),a=r(137),o=r(19),s=r(75),u=r(43),c=r(85),l=r(136),h=r(146),f=r(51),d=f("isConcatSpreadable"),p=9007199254740991,v="Maximum allowed index exceeded",g=!i(function(){var e=[];return e[d]=!1,e.concat()[0]!==e}),m=h("concat"),y=function(e){if(!o(e))return!1;var t=e[d];return void 0!==t?!!t:a(e)},b=!g||!m;n({target:"Array",proto:!0,forced:b},{concat:function(e){var t,r,n,i,a,o=s(this),h=l(o,0),f=0;for(t=-1,n=arguments.length;tp)throw TypeError(v);for(r=0;r=p)throw TypeError(v);c(h,f++,a)}return h.length=f,h}})},function(e,t,r){var n=r(11),i=r(51),a=i("species");e.exports=function(e){return!n(function(){var t=[],r=t.constructor={};return r[a]=function(){return{foo:1}},1!==t[e](Boolean).foo})}},function(e,t,r){"use strict";var n=r(7),i=r(8),a=r(29),o=r(10),s=r(52),u=r(11),c=r(20),l=r(137),h=r(19),f=r(25),d=r(75),p=r(14),v=r(18),g=r(13),m=r(64),y=r(66),b=r(40),_=r(148),A=r(47),S=r(9),w=r(24),k=r(12),x=r(23),C=r(26),P=r(27),R=r(33),E=r(35),T=r(34),O=r(51),L=r(149),F=r(150),I=r(77),j=r(31),M=r(135).forEach,N=R("hidden"),D="Symbol",q="prototype",U=O("toPrimitive"),W=j.set,B=j.getterFor(D),z=Object[q],G=i.Symbol,H=i.JSON,X=H&&H.stringify,Y=S.f,V=w.f,Q=_.f,K=k.f,J=P("symbols"),Z=P("op-symbols"),$=P("string-to-symbol-registry"),ee=P("symbol-to-string-registry"),te=P("wks"),re=i.QObject,ne=!re||!re[q]||!re[q].findChild,ie=o&&u(function(){return 7!=m(V({},"a",{get:function(){return V(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=Y(z,t);n&&delete z[t],V(e,t,r),n&&e!==z&&V(z,t,n)}:V,ae=function(e,t){var r=J[e]=m(G[q]);return W(r,{type:D,tag:e,description:t}),o||(r.description=t),r},oe=s&&"symbol"==typeof G.iterator?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof G},se=function(e,t,r){e===z&&se(Z,t,r),f(e);var n=v(t,!0);return f(r),c(J,n)?(r.enumerable?(c(e,N)&&e[N][n]&&(e[N][n]=!1),r=m(r,{enumerable:g(0,!1)})):(c(e,N)||V(e,N,g(1,{})),e[N][n]=!0),ie(e,n,r)):V(e,n,r)},ue=function(e,t){f(e);var r=p(t),n=y(r).concat(de(r));return M(n,function(t){o&&!le.call(r,t)||se(e,t,r[t])}),e},ce=function(e,t){return void 0===t?m(e):ue(m(e),t)},le=function(e){var t=v(e,!0),r=K.call(this,t);return!(this===z&&c(J,t)&&!c(Z,t))&&(!(r||!c(this,t)||!c(J,t)||c(this,N)&&this[N][t])||r)},he=function(e,t){var r=p(e),n=v(t,!0);if(r!==z||!c(J,n)||c(Z,n)){var i=Y(r,n);return!i||!c(J,n)||c(r,N)&&r[N][n]||(i.enumerable=!0),i}},fe=function(e){var t=Q(p(e)),r=[];return M(t,function(e){c(J,e)||c(E,e)||r.push(e)}),r},de=function(e){var t=e===z,r=Q(t?Z:p(e)),n=[];return M(r,function(e){!c(J,e)||t&&!c(z,e)||n.push(J[e])}),n};s||(G=function(){if(this instanceof G)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=T(e),r=function(e){this===z&&r.call(Z,e),c(this,N)&&c(this[N],t)&&(this[N][t]=!1),ie(this,t,g(1,e))};return o&≠&&ie(z,t,{configurable:!0,set:r}),ae(t,e)},C(G[q],"toString",function(){return B(this).tag}),k.f=le,w.f=se,S.f=he,b.f=_.f=fe,A.f=de,o&&(V(G[q],"description",{configurable:!0,get:function(){return B(this).description}}),a||C(z,"propertyIsEnumerable",le,{unsafe:!0})),L.f=function(e){return ae(O(e),e)}),n({global:!0,wrap:!0,forced:!s,sham:!s},{Symbol:G}),M(y(te),function(e){F(e)}),n({target:D,stat:!0,forced:!s},{"for":function(e){var t=String(e);if(c($,t))return $[t];var r=G(t);return $[t]=r,ee[r]=t,r},keyFor:function(e){if(!oe(e))throw TypeError(e+" is not a symbol");if(c(ee,e))return ee[e]},useSetter:function(){ne=!0},useSimple:function(){ne=!1}}),n({target:"Object",stat:!0,forced:!s,sham:!o},{create:ce,defineProperty:se,defineProperties:ue,getOwnPropertyDescriptor:he}),n({target:"Object",stat:!0,forced:!s},{getOwnPropertyNames:fe,getOwnPropertySymbols:de}),n({target:"Object",stat:!0,forced:u(function(){A.f(1)})},{getOwnPropertySymbols:function(e){return A.f(d(e))}}),H&&n({target:"JSON",stat:!0,forced:!s||u(function(){var e=G();return"[null]"!=X([e])||"{}"!=X({a:e})||"{}"!=X(Object(e))})},{stringify:function(e){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=t=n[1],(h(t)||void 0!==e)&&!oe(e))return l(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!oe(t))return t}),n[1]=t,X.apply(H,n)}}),G[q][U]||x(G[q],U,G[q].valueOf),I(G,D),E[N]=!0},function(e,t,r){var n=r(14),i=r(40).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch(t){return o.slice()}};e.exports.f=function(e){return o&&"[object Window]"==a.call(e)?s(e):i(n(e))}},function(e,t,r){t.f=r(51)},function(e,t,r){var n=r(39),i=r(20),a=r(149),o=r(24).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||o(t,e,{value:a.f(e)})}},function(e,t,r){var n=r(150);n("asyncIterator")},function(e,t,r){"use strict";var n=r(7),i=r(10),a=r(8),o=r(20),s=r(19),u=r(24).f,c=r(36),l=a.Symbol;if(i&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var h={},f=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof f?new l(e):void 0===e?l():l(e);return""===e&&(h[t]=!0),t};c(f,l);var d=f.prototype=l.prototype;d.constructor=f;var p=d.toString,v="Symbol(test)"==String(l("test")),g=/^Symbol\((.*)\)[^)]+$/;u(d,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=p.call(e);if(o(h,e))return"";var r=v?t.slice(7,-1):t.replace(g,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:f})}},function(e,t,r){var n=r(150);n("hasInstance")},function(e,t,r){var n=r(150);n("isConcatSpreadable")},function(e,t,r){var n=r(150);n("iterator")},function(e,t,r){var n=r(150);n("match")},function(e,t,r){var n=r(150);n("matchAll")},function(e,t,r){var n=r(150);n("replace")},function(e,t,r){var n=r(150);n("search")},function(e,t,r){var n=r(150);n("species")},function(e,t,r){var n=r(150);n("split")},function(e,t,r){var n=r(150);n("toPrimitive")},function(e,t,r){var n=r(150);n("toStringTag")},function(e,t,r){var n=r(150);n("unscopables")},function(e,t,r){var n=r(77);n(Math,"Math",!0)},function(e,t,r){var n=r(8),i=r(77);i(n.JSON,"JSON",!0)},function(e,t,r){r(168);var n=r(54);e.exports=n("String","padStart")},function(e,t,r){"use strict";var n=r(7),i=r(169).start,a=r(171);n({target:"String",proto:!0,forced:a},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(43),i=r(170),a=r(17),o=Math.ceil,s=function(e){return function(t,r,s){var u,c,l=String(a(t)),h=l.length,f=void 0===s?" ":String(s),d=n(r);return d<=h||""==f?l:(u=d-h,c=i.call(f,o(u/f.length)),c.length>u&&(c=c.slice(0,u)),e?l+c:c+l)}};e.exports={start:s(!1),end:s(!0)}},function(e,t,r){"use strict";var n=r(44),i=r(17);e.exports="".repeat||function(e){var t=String(i(this)),r="",a=n(e);if(a<0||a==1/0)throw RangeError("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(r+=t);return r}},function(e,t,r){var n=r(114);e.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(n)},function(e,t,r){r(173);var n=r(54);e.exports=n("String","padEnd")},function(e,t,r){"use strict";var n=r(7),i=r(169).end,a=r(171);n({target:"String",proto:!0,forced:a},{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){r(175);var n=r(39);e.exports=n.Object.values},function(e,t,r){var n=r(7),i=r(176).values;n({target:"Object",stat:!0},{values:function(e){return i(e)}})},function(e,t,r){var n=r(10),i=r(66),a=r(14),o=r(12).f,s=function(e){return function(t){for(var r,s=a(t),u=i(s),c=u.length,l=0,h=[];c>l;)r=u[l++],n&&!o.call(s,r)||h.push(e?[r,s[r]]:s[r]);return h}};e.exports={entries:s(!0),values:s(!1)}},function(e,t,r){"use strict";var n=!1;if("undefined"!=typeof ReadableStream)try{new ReadableStream({start:function(e){e.close()}}),n=!0}catch(i){}n?t.ReadableStream=ReadableStream:t.ReadableStream=r(178).ReadableStream},function(e,t,r){"use strict";function n(){}function i(e){return"object"==typeof e&&null!==e||"function"==typeof e}function a(e){return e.slice()}function o(e,t,r,n,i){new Uint8Array(e).set(new Uint8Array(r,n,i),t)}function s(e){return u(e)!==!1&&e!==1/0}function u(e){return"number"==typeof e&&(!kr(e)&&!(e<0))}function c(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function l(e,t,r,n){var i=e[t];if(void 0!==i){if("function"!=typeof i)throw new TypeError(i+" is not a method");switch(r){case 0:return function(){return f(i,e,n)};case 1:return function(t){var r=[t].concat(n);return f(i,e,r)}}}return function(){return Promise.resolve()}}function h(e,t,r){var n=e[t];if(void 0!==n)return c(n,e,r)}function f(e,t,r){try{return Promise.resolve(c(e,t,r))}catch(n){return Promise.reject(n)}}function d(e){return e}function p(e){return!1}function v(e){if(e=Number(e),kr(e)||e<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return e}function g(e){if(void 0===e)return function(){return 1};if("function"!=typeof e)throw new TypeError("size property of a queuing strategy must be a function");return function(t){return e(t)}}function m(e,t,r){var n=null;r===!0&&(n=Object.prototype);var i=Object.create(n);return i.value=e,i.done=t,i}function y(e,t){e._forAuthorCode=!0,e._ownerReadableStream=t,t._reader=e,"readable"===t._state?S(e):"closed"===t._state?k(e):w(e,t._storedError)}function b(e,t){var r=e._ownerReadableStream;return Jt(r,t)}function _(e){"readable"===e._ownerReadableStream._state?x(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):C(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function A(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function S(e){e._closedPromise=new Promise(function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r})}function w(e,t){S(e),x(e,t)}function k(e){S(e),P(e)}function x(e,t){e._closedPromise["catch"](n),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function C(e,t){w(e,t)}function P(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function R(e,t){void 0===t&&(t=!1);var r=new Er(e);return r._forAuthorCode=t,r}function E(e){var t=new Promise(function(t,r){var n={_resolve:t,_reject:r};e._reader._readRequests.push(n)});return t}function T(e,t,r){var n=e._reader,i=n._readRequests.shift();i._resolve(m(t,r,n._forAuthorCode))}function O(e){return e._reader._readRequests.length}function L(e){var t=e._reader;return void 0!==t&&!!F(t)}function F(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function I(e){var t=e._ownerReadableStream;return t._disturbed=!0,"closed"===t._state?Promise.resolve(m(void 0,!0,e._forAuthorCode)):"errored"===t._state?Promise.reject(t._storedError):t._readableStreamController[Rr]()}function j(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}function M(e,t){void 0===t&&(t=!1);var r=R(e),n=Object.create(Tr);return n._asyncIteratorReader=r,n._preventCancel=Boolean(t),n}function N(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorReader")}function D(e){return new TypeError("ReadableStreamAsyncIterator."+e+" can only be used on a ReadableSteamAsyncIterator")}function q(e){var t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function U(e,t,r){if(r=Number(r),!s(r))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function W(e){var t=e._queue.peek();return t.value}function B(e){e._queue=new Cr,e._queueTotalSize=0}function z(e){return new jr(e)}function G(e,t,r,n,i,a){void 0===i&&(i=1),void 0===a&&(a=function(){return 1});var o=Object.create(Ir.prototype);H(o);var s=Object.create(Mr.prototype);return be(o,s,e,t,r,n,i,a),o}function H(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new Cr,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function X(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function Y(e){return void 0!==e._writer}function V(e,t){var r=e._state;if("closed"===r||"errored"===r)return Promise.resolve(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var n=!1;"erroring"===r&&(n=!0,t=void 0);var i=new Promise(function(r,i){e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:i,_reason:t,_wasAlreadyErroring:n}});return e._pendingAbortRequest._promise=i,n===!1&&J(e,t),i}function Q(e){var t=new Promise(function(t,r){var n={_resolve:t,_reject:r};e._writeRequests.push(n)});return t}function K(e,t){var r=e._state;return"writable"===r?void J(e,t):void Z(e)}function J(e,t){var r=e._writableStreamController;e._state="erroring",e._storedError=t;var n=e._writer;void 0!==n&&pe(n,t),ie(e)===!1&&r._started===!0&&Z(e)}function Z(e){e._state="errored",e._writableStreamController[Fr]();var t=e._storedError;if(e._writeRequests.forEach(function(e){e._reject(t)}),e._writeRequests=new Cr,void 0===e._pendingAbortRequest)return void se(e);var r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring===!0)return r._reject(t),void se(e);var n=e._writableStreamController[Lr](r._reason);n.then(function(){r._resolve(),se(e)},function(t){r._reject(t),se(e)})}function $(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}function ee(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,K(e,t)}function te(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0;var t=e._state;"erroring"===t&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";var r=e._writer;void 0!==r&&Ue(r)}function re(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),K(e,t)}function ne(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function ie(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}function ae(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0}function oe(e){e._inFlightWriteRequest=e._writeRequests.shift()}function se(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var t=e._writer;void 0!==t&&De(t,e._storedError)}function ue(e,t){var r=e._writer;void 0!==r&&t!==e._backpressure&&(t===!0?He(r):Ye(r)),e._backpressure=t}function ce(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function le(e,t){var r=e._ownerWritableStream;return V(r,t)}function he(e){var t=e._ownerWritableStream,r=t._state;if("closed"===r||"errored"===r)return Promise.reject(new TypeError("The stream (in "+r+" state) is not in the writable state and cannot be closed"));var n=new Promise(function(e,r){var n={_resolve:e,_reject:r};t._closeRequest=n});return t._backpressure===!0&&"writable"===r&&Ye(e),Se(t._writableStreamController),n}function fe(e){var t=e._ownerWritableStream,r=t._state;return ne(t)===!0||"closed"===r?Promise.resolve():"errored"===r?Promise.reject(t._storedError):he(e)}function de(e,t){"pending"===e._closedPromiseState?De(e,t):qe(e,t)}function pe(e,t){"pending"===e._readyPromiseState?Ge(e,t):Xe(e,t)}function ve(e){var t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:ke(t._writableStreamController)}function ge(e){var t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");pe(e,r),de(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function me(e,t){var r=e._ownerWritableStream,n=r._writableStreamController,i=we(n,t);if(r!==e._ownerWritableStream)return Promise.reject(Ie("write to"));var a=r._state;if("errored"===a)return Promise.reject(r._storedError);if(ne(r)===!0||"closed"===a)return Promise.reject(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===a)return Promise.reject(r._storedError);var o=Q(r);return xe(n,t,i),o}function ye(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")}function be(e,t,r,n,i,a,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,B(t),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=n,t._closeAlgorithm=i,t._abortAlgorithm=a;var u=Te(t);ue(e,u);var c=r(),l=Promise.resolve(c);l.then(function(){t._started=!0,Ce(t)},function(r){t._started=!0,K(e,r)})["catch"](Or)}function _e(e,t,r,n){function i(){return h(t,"start",[a])}var a=Object.create(Mr.prototype),o=l(t,"write",1,[a]),s=l(t,"close",0,[]),u=l(t,"abort",1,[]);be(e,a,i,o,s,u,r,n)}function Ae(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Se(e){U(e,"close",0),Ce(e)}function we(e,t){try{return e._strategySizeAlgorithm(t)}catch(r){return Pe(e,r),1}}function ke(e){return e._strategyHWM-e._queueTotalSize}function xe(e,t,r){var n={chunk:t};try{U(e,n,r)}catch(i){return void Pe(e,i)}var a=e._controlledWritableStream;if(ne(a)===!1&&"writable"===a._state){var o=Te(e);ue(a,o)}Ce(e)}function Ce(e){var t=e._controlledWritableStream;if(e._started!==!1&&void 0===t._inFlightWriteRequest){var r=t._state;if("erroring"===r)return void Z(t);if(0!==e._queue.length){var n=W(e);"close"===n?Re(e):Ee(e,n.chunk)}}}function Pe(e,t){"writable"===e._controlledWritableStream._state&&Oe(e,t)}function Re(e){var t=e._controlledWritableStream;ae(t),q(e);var r=e._closeAlgorithm();Ae(e),r.then(function(){te(t)},function(e){re(t,e)})["catch"](Or)}function Ee(e,t){var r=e._controlledWritableStream;oe(r);var n=e._writeAlgorithm(t);n.then(function(){$(r);var t=r._state;if(q(e),ne(r)===!1&&"writable"===t){var n=Te(e);ue(r,n)}Ce(e)},function(t){"writable"===r._state&&Ae(e),ee(r,t)})["catch"](Or)}function Te(e){var t=ke(e);return t<=0}function Oe(e,t){var r=e._controlledWritableStream;Ae(e),J(r,t)}function Le(e){return new TypeError("WritableStream.prototype."+e+" can only be used on a WritableStream")}function Fe(e){return new TypeError("WritableStreamDefaultWriter.prototype."+e+" can only be used on a WritableStreamDefaultWriter")}function Ie(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function je(e){e._closedPromise=new Promise(function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"})}function Me(e,t){je(e),De(e,t)}function Ne(e){je(e),Ue(e)}function De(e,t){e._closedPromise["catch"](n),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected"}function qe(e,t){Me(e,t)}function Ue(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved"}function We(e){e._readyPromise=new Promise(function(t,r){e._readyPromise_resolve=t,e._readyPromise_reject=r}),e._readyPromiseState="pending"}function Be(e,t){We(e),Ge(e,t)}function ze(e){We(e),Ye(e)}function Ge(e,t){e._readyPromise["catch"](n),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected"}function He(e){We(e)}function Xe(e,t){Be(e,t)}function Ye(e){e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled"}function Ve(e,t,r,i,a,o){var s=R(e),u=z(t),c=!1,l=Promise.resolve();return new Promise(function(h,f){function d(){return new Promise(function(e,t){function r(n){n?e():p().then(r,t)}r(!1)})}function p(){return c===!0?Promise.resolve(!0):u._readyPromise.then(function(){return I(s).then(function(e){var t=e.value,r=e.done;return r===!0||(l=me(u,t)["catch"](n),!1)})})}function v(){var e=l;return l.then(function(){return e!==l?v():void 0})}function g(e,t,r){"errored"===e._state?r(e._storedError):t["catch"](r)["catch"](Or)}function m(e,t,r){"closed"===e._state?r():t.then(r)["catch"](Or)}function y(e,r,n){function i(){e().then(function(){return A(r,n)},function(e){return A(!0,e)})["catch"](Or)}c!==!0&&(c=!0,"writable"===t._state&≠(t)===!1?v().then(i):i())}function b(e,r){c!==!0&&(c=!0,"writable"===t._state&≠(t)===!1?v().then(function(){return A(e,r)})["catch"](Or):A(e,r))}function A(e,t){ge(u),_(s),void 0!==o&&o.removeEventListener("abort",S),e?f(t):h(void 0)}var S;if(void 0!==o){if(S=function(){var r=new DOMException("Aborted","AbortError"),n=[];i===!1&&n.push(function(){return"writable"===t._state?V(t,r):Promise.resolve()}),a===!1&&n.push(function(){return"readable"===e._state?Jt(e,r):Promise.resolve()}),y(function(){return Promise.all(n.map(function(e){return e()}))},!0,r)},o.aborted===!0)return void S();o.addEventListener("abort",S)}if(g(e,s._closedPromise,function(e){i===!1?y(function(){return V(t,e)},!0,e):b(!0,e)}),g(t,u._closedPromise,function(t){a===!1?y(function(){return Jt(e,t)},!0,t):b(!0,t)}),m(e,s._closedPromise,function(){r===!1?y(function(){return fe(u)}):b()}),ne(t)===!0||"closed"===t._state){var w=new TypeError("the destination writable stream closed before all data could be piped to it");a===!1?y(function(){return Jt(e,w)},!0,w):b(!0,w)}d()["catch"](Or)})}function Qe(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function Ke(e){var t=Je(e);if(t!==!1){if(e._pulling===!0)return void(e._pullAgain=!0);e._pulling=!0;var r=e._pullAlgorithm();r.then(function(){e._pulling=!1,e._pullAgain===!0&&(e._pullAgain=!1,Ke(e))},function(t){tt(e,t)})["catch"](Or)}}function Je(e){var t=e._controlledReadableStream;if(it(e)===!1)return!1;if(e._started===!1)return!1;if(Kt(t)===!0&&O(t)>0)return!0;var r=rt(e);return r>0}function Ze(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function $e(e){var t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(Ze(e),Zt(t))}function et(e,t){var r=e._controlledReadableStream;if(Kt(r)===!0&&O(r)>0)T(r,t,!1);else{var n=void 0;try{n=e._strategySizeAlgorithm(t)}catch(i){throw tt(e,i),i}try{U(e,t,n)}catch(a){throw tt(e,a),a}}Ke(e)}function tt(e,t){var r=e._controlledReadableStream;"readable"===r._state&&(B(e),Ze(e),$t(r,t))}function rt(e){var t=e._controlledReadableStream,r=t._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function nt(e){return Je(e)!==!0}function it(e){var t=e._controlledReadableStream._state;return e._closeRequested===!1&&"readable"===t}function at(e,t,r,n,i,a,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,B(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,e._readableStreamController=t;var s=r();Promise.resolve(s).then(function(){t._started=!0,Ke(t)},function(e){tt(t,e)})["catch"](Or)}function ot(e,t,r,n){function i(){return h(t,"start",[a])}var a=Object.create(Nr.prototype),o=l(t,"pull",0,[a]),s=l(t,"cancel",1,[]);at(e,a,i,o,s,r,n)}function st(e){return new TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function ut(e,t){function r(){if(d===!0)return Promise.resolve();d=!0;var e=I(f).then(function(e){d=!1;var t=e.done;if(t===!0)return p===!1&&$e(c._readableStreamController),void(v===!1&&$e(l._readableStreamController));var r=e.value,n=r,i=r;p===!1&&et(c._readableStreamController,n),v===!1&&et(l._readableStreamController,i)});return e["catch"](Or),Promise.resolve()}function n(t){if(p=!0,s=t,v===!0){var r=a([s,u]),n=Jt(e,r);h(n)}return g}function i(t){if(v=!0,u=t,p===!0){var r=a([s,u]),n=Jt(e,r);h(n)}return g}function o(){}var s,u,c,l,h,f=R(e),d=!1,p=!1,v=!1,g=new Promise(function(e){h=e});return c=Yt(o,r,n),l=Yt(o,r,i),f._closedPromise["catch"](function(e){tt(c._readableStreamController,e),tt(l._readableStreamController,e)}),[c,l]}function ct(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function lt(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function ht(e){var t=Ct(e);if(t!==!1){if(e._pulling===!0)return void(e._pullAgain=!0);e._pulling=!0;var r=e._pullAlgorithm();r.then(function(){e._pulling=!1,e._pullAgain===!0&&(e._pullAgain=!1,ht(e))},function(t){Tt(e,t)})["catch"](Or)}}function ft(e){bt(e),e._pendingPullIntos=new Cr}function dt(e,t){var r=!1;"closed"===e._state&&(r=!0);var n=pt(t);"default"===t.readerType?T(e,n,r):Wt(e,n,r)}function pt(e){var t=e.bytesFilled,r=e.elementSize;return new e.ctor(e.buffer,e.byteOffset,t/r)}function vt(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function gt(e,t){var r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,i=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),a=t.bytesFilled+i,s=a-a%r,u=i,c=!1;s>n&&(u=s-t.bytesFilled,c=!0);for(var l=e._queue;u>0;){var h=l.peek(),f=Math.min(u,h.byteLength),d=t.byteOffset+t.bytesFilled;o(t.buffer,d,h.buffer,h.byteOffset,f),h.byteLength===f?l.shift():(h.byteOffset+=f,h.byteLength-=f),e._queueTotalSize-=f,mt(e,f,t),u-=f}return c}function mt(e,t,r){bt(e),r.bytesFilled+=t}function yt(e){0===e._queueTotalSize&&e._closeRequested===!0?(Pt(e),Zt(e._controlledReadableByteStream)):ht(e)}function bt(e){void 0!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=void 0,e._byobRequest=void 0)}function _t(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;var t=e._pendingPullIntos.peek(); gt(e,t)===!0&&(xt(e),dt(e._controlledReadableByteStream,t))}}function At(e,t){var r=e._controlledReadableByteStream,n=1;t.constructor!==DataView&&(n=t.constructor.BYTES_PER_ELEMENT);var i=t.constructor,a=d(t.buffer),o={buffer:a,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:n,ctor:i,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(o),Ut(r);if("closed"===r._state){var s=new i(o.buffer,o.byteOffset,0);return Promise.resolve(m(s,!0,r._reader._forAuthorCode))}if(e._queueTotalSize>0){if(gt(e,o)===!0){var u=pt(o);return yt(e),Promise.resolve(m(u,!1,r._reader._forAuthorCode))}if(e._closeRequested===!0){var c=new TypeError("Insufficient bytes to fill elements in the given buffer");return Tt(e,c),Promise.reject(c)}}e._pendingPullIntos.push(o);var l=Ut(r);return ht(e),l}function St(e,t){t.buffer=d(t.buffer);var r=e._controlledReadableByteStream;if(zt(r)===!0)for(;Bt(r)>0;){var n=xt(e);dt(r,n)}}function wt(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(mt(e,t,r),!(r.bytesFilled0){var i=r.byteOffset+r.bytesFilled,a=r.buffer.slice(i-n,i);vt(e,a,0,a.byteLength)}r.buffer=d(r.buffer),r.bytesFilled-=n,dt(e._controlledReadableByteStream,r),_t(e)}}function kt(e,t){var r=e._pendingPullIntos.peek(),n=e._controlledReadableByteStream;if("closed"===n._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");St(e,r)}else wt(e,t,r);ht(e)}function xt(e){var t=e._pendingPullIntos.shift();return bt(e),t}function Ct(e){var t=e._controlledReadableByteStream;if("readable"!==t._state)return!1;if(e._closeRequested===!0)return!1;if(e._started===!1)return!1;if(L(t)===!0&&O(t)>0)return!0;if(zt(t)===!0&&Bt(t)>0)return!0;var r=Ot(e);return r>0}function Pt(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Rt(e){var t=e._controlledReadableByteStream;if(e._queueTotalSize>0)return void(e._closeRequested=!0);if(e._pendingPullIntos.length>0){var r=e._pendingPullIntos.peek();if(r.bytesFilled>0){var n=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Tt(e,n),n}}Pt(e),Zt(t)}function Et(e,t){var r=e._controlledReadableByteStream,n=t.buffer,i=t.byteOffset,a=t.byteLength,o=d(n);if(L(r)===!0)if(0===O(r))vt(e,o,i,a);else{var s=new Uint8Array(o,i,a);T(r,s,!1)}else zt(r)===!0?(vt(e,o,i,a),_t(e)):vt(e,o,i,a);ht(e)}function Tt(e,t){var r=e._controlledReadableByteStream;"readable"===r._state&&(ft(e),B(e),Pt(e),$t(r,t))}function Ot(e){var t=e._controlledReadableByteStream,r=t._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function Lt(e,t){if(t=Number(t),s(t)===!1)throw new RangeError("bytesWritten must be a finite");kt(e,t)}function Ft(e,t){var r=e._pendingPullIntos.peek();if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,kt(e,t.byteLength)}function It(e,t,r,n,i,a,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=void 0,t._queue=t._queueTotalSize=void 0,B(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=v(a),t._pullAlgorithm=n,t._cancelAlgorithm=i,t._autoAllocateChunkSize=o,t._pendingPullIntos=new Cr,e._readableStreamController=t;var s=r();Promise.resolve(s).then(function(){t._started=!0,ht(t)},function(e){Tt(t,e)})["catch"](Or)}function jt(e,t,r){function n(){return h(t,"start",[i])}var i=Object.create(Ur.prototype),a=l(t,"pull",0,[i]),o=l(t,"cancel",1,[]),s=t.autoAllocateChunkSize;if(void 0!==s&&(s=Number(s),Dr(s)===!1||s<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");It(e,i,n,a,o,r,s)}function Mt(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}function Nt(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function Dt(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}function qt(e,t){void 0===t&&(t=!1);var r=new Wr(e);return r._forAuthorCode=t,r}function Ut(e){var t=new Promise(function(t,r){var n={_resolve:t,_reject:r};e._reader._readIntoRequests.push(n)});return t}function Wt(e,t,r){var n=e._reader,i=n._readIntoRequests.shift();i._resolve(m(t,r,n._forAuthorCode))}function Bt(e){return e._reader._readIntoRequests.length}function zt(e){var t=e._reader;return void 0!==t&&!!Gt(t)}function Gt(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function Ht(e,t){var r=e._ownerReadableStream;return r._disturbed=!0,"errored"===r._state?Promise.reject(r._storedError):At(r._readableStreamController,t)}function Xt(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}function Yt(e,t,r,n,i){void 0===n&&(n=1),void 0===i&&(i=function(){return 1});var a=Object.create(Br.prototype);Vt(a);var o=Object.create(Nr.prototype);return at(a,o,e,t,r,n,i),a}function Vt(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Qt(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Kt(e){return void 0!==e._reader}function Jt(e,t){if(e._disturbed=!0,"closed"===e._state)return Promise.resolve(void 0);if("errored"===e._state)return Promise.reject(e._storedError);Zt(e);var r=e._readableStreamController[Pr](t);return r.then(function(){})}function Zt(e){e._state="closed";var t=e._reader;void 0!==t&&(F(t)&&(t._readRequests.forEach(function(e){e._resolve(m(void 0,!0,t._forAuthorCode))}),t._readRequests=new Cr),P(t))}function $t(e,t){e._state="errored",e._storedError=t;var r=e._reader;void 0!==r&&(F(r)?(r._readRequests.forEach(function(e){e._reject(t)}),r._readRequests=new Cr):(r._readIntoRequests.forEach(function(e){e._reject(t)}),r._readIntoRequests=new Cr),x(r,t))}function er(e){if("object"!=typeof e||null===e)return!1;var t=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"aborted").get;try{return t.call(e),!0}catch(r){return!1}}function tr(e){return new TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}function rr(e,t,r,n,i,a){function o(){return t}function s(t){return vr(e,t)}function u(t){return gr(e,t)}function c(){return mr(e)}function l(){return yr(e)}function h(t){return ar(e,t),Promise.resolve()}e._writable=G(o,s,c,u,r,n),e._readable=Yt(o,l,h,i,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,or(e,!0),e._transformStreamController=void 0}function nr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function ir(e,t){tt(e._readable._readableStreamController,t),ar(e,t)}function ar(e,t){lr(e._transformStreamController),Pe(e._writable._writableStreamController,t),e._backpressure===!0&∨(e,!1)}function or(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=new Promise(function(t){e._backpressureChangePromise_resolve=t}),e._backpressure=t}function sr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function ur(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}function cr(e,t){var r=Object.create(Xr.prototype),n=function(e){try{return hr(r,e),Promise.resolve()}catch(t){return Promise.reject(t)}},i=t.transform;if(void 0!==i){if("function"!=typeof i)throw new TypeError("transform is not a method");n=function(e){return f(i,t,[e,r])}}var a=l(t,"flush",0,[r]);ur(e,r,n,a)}function lr(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function hr(e,t){var r=e._controlledTransformStream,n=r._readable._readableStreamController;if(it(n)===!1)throw new TypeError("Readable side is not in a state that permits enqueue");try{et(n,t)}catch(i){throw ar(r,i),r._readable._storedError}var a=nt(n);a!==r._backpressure&∨(r,!0)}function fr(e,t){ir(e._controlledTransformStream,t)}function dr(e,t){var r=e._transformAlgorithm(t);return r["catch"](function(t){throw ir(e._controlledTransformStream,t),t})}function pr(e){var t=e._controlledTransformStream,r=t._readable._readableStreamController;it(r)===!0&&$e(r);var n=new TypeError("TransformStream terminated");ar(t,n)}function vr(e,t){var r=e._transformStreamController;if(e._backpressure===!0){var n=e._backpressureChangePromise;return n.then(function(){var n=e._writable,i=n._state;if("erroring"===i)throw n._storedError;return dr(r,t)})}return dr(r,t)}function gr(e,t){return ir(e,t),Promise.resolve()}function mr(e){var t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return lr(r),n.then(function(){if("errored"===t._state)throw t._storedError;var e=t._readableStreamController;it(e)===!0&&$e(e)})["catch"](function(r){throw ir(e,r),t._storedError})}function yr(e){return or(e,!1),e._backpressureChangePromise}function br(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function _r(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}r.r(t),r.d(t,"ByteLengthQueuingStrategy",function(){return zr}),r.d(t,"CountQueuingStrategy",function(){return Gr}),r.d(t,"ReadableStream",function(){return Br}),r.d(t,"TransformStream",function(){return Hr}),r.d(t,"WritableStream",function(){return Ir});var Ar,Sr,wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(e){return"Symbol("+e+")"},kr=Number.isNaN||function(e){return e!==e},xr=16384,Cr=function(){function e(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype.push=function(e){var t=this._back,r=t;t._elements.length===xr-1&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size},e.prototype.shift=function(){var e=this._front,t=e,r=this._cursor,n=r+1,i=e._elements,a=i[r];return n===xr&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),i[r]=void 0,a},e.prototype.forEach=function(e){for(var t=this._cursor,r=this._front,n=r._elements;!(t===n.length&&void 0===r._next||t===n.length&&(r=r._next,n=r._elements,t=0,0===n.length));)e(n[t]),++t},e.prototype.peek=function(){var e=this._front,t=this._cursor;return e._elements[t]},e}(),Pr=wr("[[CancelSteps]]"),Rr=wr("[[PullSteps]]"),Er=function(){function e(e){if(Qt(e)===!1)throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(Kt(e)===!0)throw new TypeError("This stream has already been locked for exclusive reading by another reader");y(this,e),this._readRequests=new Cr}return Object.defineProperty(e.prototype,"closed",{get:function(){return F(this)?this._closedPromise:Promise.reject(j("closed"))},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return F(this)?void 0===this._ownerReadableStream?Promise.reject(A("cancel")):b(this,e):Promise.reject(j("cancel"))},e.prototype.read=function(){return F(this)?void 0===this._ownerReadableStream?Promise.reject(A("read from")):I(this):Promise.reject(j("read"))},e.prototype.releaseLock=function(){if(!F(this))throw j("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");_(this)}},e}();"symbol"==typeof wr.asyncIterator&&(Ar={},Ar[wr.asyncIterator]=function(){return this},Sr=Ar,Object.defineProperty(Sr,wr.asyncIterator,{enumerable:!1}));var Tr={next:function(){if(N(this)===!1)return Promise.reject(D("next"));var e=this._asyncIteratorReader;return void 0===e._ownerReadableStream?Promise.reject(A("iterate")):I(e).then(function(t){var r=t.done;r&&_(e);var n=t.value;return m(n,r,!0)})},"return":function(e){if(N(this)===!1)return Promise.reject(D("next"));var t=this._asyncIteratorReader;if(void 0===t._ownerReadableStream)return Promise.reject(A("finish iterating"));if(t._readRequests.length>0)return Promise.reject(new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(this._preventCancel===!1){var r=b(t,e);return _(t),r.then(function(){return m(e,!0,!0)})}return _(t),Promise.resolve(m(e,!0,!0))}};void 0!==Sr&&Object.setPrototypeOf(Tr,Sr),Object.defineProperty(Tr,"next",{enumerable:!1}),Object.defineProperty(Tr,"return",{enumerable:!1});var Or=n,Lr=wr("[[AbortSteps]]"),Fr=wr("[[ErrorSteps]]"),Ir=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),H(this);var r=t.size,n=t.highWaterMark,i=e.type;if(void 0!==i)throw new RangeError("Invalid type is specified");var a=g(r);void 0===n&&(n=1),n=v(n),_e(this,e,n,a)}return Object.defineProperty(e.prototype,"locked",{get:function(){if(X(this)===!1)throw Le("locked");return Y(this)},enumerable:!0,configurable:!0}),e.prototype.abort=function(e){return X(this)===!1?Promise.reject(Le("abort")):Y(this)===!0?Promise.reject(new TypeError("Cannot abort a stream that already has a writer")):V(this,e)},e.prototype.getWriter=function(){if(X(this)===!1)throw Le("getWriter");return z(this)},e}(),jr=function(){function e(e){if(X(e)===!1)throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(Y(e)===!0)throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;var t=e._state;if("writable"===t)ne(e)===!1&&e._backpressure===!0?We(this):ze(this),je(this);else if("erroring"===t)Be(this,e._storedError),je(this);else if("closed"===t)ze(this),Ne(this);else{var r=e._storedError;Be(this,r),Me(this,r)}}return Object.defineProperty(e.prototype,"closed",{get:function(){return ce(this)===!1?Promise.reject(Fe("closed")):this._closedPromise},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(ce(this)===!1)throw Fe("desiredSize");if(void 0===this._ownerWritableStream)throw Ie("desiredSize");return ve(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return ce(this)===!1?Promise.reject(Fe("ready")):this._readyPromise},enumerable:!0,configurable:!0}),e.prototype.abort=function(e){return ce(this)===!1?Promise.reject(Fe("abort")):void 0===this._ownerWritableStream?Promise.reject(Ie("abort")):le(this,e)},e.prototype.close=function(){if(ce(this)===!1)return Promise.reject(Fe("close"));var e=this._ownerWritableStream;return void 0===e?Promise.reject(Ie("close")):ne(e)===!0?Promise.reject(new TypeError("cannot close an already-closing stream")):he(this)},e.prototype.releaseLock=function(){if(ce(this)===!1)throw Fe("releaseLock");var e=this._ownerWritableStream;void 0!==e&≥(this)},e.prototype.write=function(e){return ce(this)===!1?Promise.reject(Fe("write")):void 0===this._ownerWritableStream?Promise.reject(Ie("write to")):me(this,e)},e}(),Mr=function(){function e(){throw new TypeError("WritableStreamDefaultController cannot be constructed explicitly")}return e.prototype.error=function(e){if(ye(this)===!1)throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");var t=this._controlledWritableStream._state;"writable"===t&&Oe(this,e)},e.prototype[Lr]=function(e){var t=this._abortAlgorithm(e);return Ae(this),t},e.prototype[Fr]=function(){B(this)},e}(),Nr=function(){function e(){throw new TypeError}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(Qe(this)===!1)throw st("desiredSize");return rt(this)},enumerable:!0,configurable:!0}),e.prototype.close=function(){if(Qe(this)===!1)throw st("close");if(it(this)===!1)throw new TypeError("The stream is not in a state that permits close");$e(this)},e.prototype.enqueue=function(e){if(Qe(this)===!1)throw st("enqueue");if(it(this)===!1)throw new TypeError("The stream is not in a state that permits enqueue");return et(this,e)},e.prototype.error=function(e){if(Qe(this)===!1)throw st("error");tt(this,e)},e.prototype[Pr]=function(e){B(this);var t=this._cancelAlgorithm(e);return Ze(this),t},e.prototype[Rr]=function(){var e=this._controlledReadableStream;if(this._queue.length>0){var t=q(this);return this._closeRequested===!0&&0===this._queue.length?(Ze(this),Zt(e)):Ke(this),Promise.resolve(m(t,!1,e._reader._forAuthorCode))}var r=E(e);return Ke(this),r},e}(),Dr=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},qr=function(){function e(){throw new TypeError("ReadableStreamBYOBRequest cannot be used directly")}return Object.defineProperty(e.prototype,"view",{get:function(){if(lt(this)===!1)throw Nt("view");return this._view},enumerable:!0,configurable:!0}),e.prototype.respond=function(e){if(lt(this)===!1)throw Nt("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");p(this._view.buffer)===!0,Lt(this._associatedReadableByteStreamController,e)},e.prototype.respondWithNewView=function(e){if(lt(this)===!1)throw Nt("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");p(e.buffer)===!0,Ft(this._associatedReadableByteStreamController,e)},e}(),Ur=function(){function e(){throw new TypeError("ReadableByteStreamController constructor cannot be used directly")}return Object.defineProperty(e.prototype,"byobRequest",{get:function(){if(ct(this)===!1)throw Dt("byobRequest");if(void 0===this._byobRequest&&this._pendingPullIntos.length>0){var e=this._pendingPullIntos.peek(),t=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),r=Object.create(qr.prototype);Mt(r,this,t),this._byobRequest=r}return this._byobRequest},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(ct(this)===!1)throw Dt("desiredSize");return Ot(this)},enumerable:!0,configurable:!0}),e.prototype.close=function(){if(ct(this)===!1)throw Dt("close");if(this._closeRequested===!0)throw new TypeError("The stream has already been closed; do not close it again!");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError("The stream (in "+e+" state) is not in the readable state and cannot be closed");Rt(this)},e.prototype.enqueue=function(e){if(ct(this)===!1)throw Dt("enqueue");if(this._closeRequested===!0)throw new TypeError("stream is closed or draining");var t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be enqueued to");if(!ArrayBuffer.isView(e))throw new TypeError("You can only enqueue array buffer views when using a ReadableByteStreamController");p(e.buffer)===!0,Et(this,e)},e.prototype.error=function(e){if(ct(this)===!1)throw Dt("error");Tt(this,e)},e.prototype[Pr]=function(e){if(this._pendingPullIntos.length>0){var t=this._pendingPullIntos.peek();t.bytesFilled=0}B(this);var r=this._cancelAlgorithm(e);return Pt(this),r},e.prototype[Rr]=function(){var e=this._controlledReadableByteStream;if(this._queueTotalSize>0){var t=this._queue.shift();this._queueTotalSize-=t.byteLength,yt(this);var r=void 0;try{r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}catch(n){return Promise.reject(n)}return Promise.resolve(m(r,!1,e._reader._forAuthorCode))}var i=this._autoAllocateChunkSize;if(void 0!==i){var a=void 0;try{a=new ArrayBuffer(i)}catch(o){return Promise.reject(o)}var s={buffer:a,byteOffset:0,byteLength:i,bytesFilled:0,elementSize:1,ctor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(s)}var u=E(e);return ht(this),u},e}(),Wr=function(){function e(e){if(!Qt(e))throw new TypeError("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(ct(e._readableStreamController)===!1)throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(Kt(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");y(this,e),this._readIntoRequests=new Cr}return Object.defineProperty(e.prototype,"closed",{get:function(){return Gt(this)?this._closedPromise:Promise.reject(Xt("closed"))},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return Gt(this)?void 0===this._ownerReadableStream?Promise.reject(A("cancel")):b(this,e):Promise.reject(Xt("cancel"))},e.prototype.read=function(e){return Gt(this)?void 0===this._ownerReadableStream?Promise.reject(A("read from")):ArrayBuffer.isView(e)?(p(e.buffer)===!0,0===e.byteLength?Promise.reject(new TypeError("view must have non-zero byteLength")):Ht(this,e)):Promise.reject(new TypeError("view must be an array buffer view")):Promise.reject(Xt("read"))},e.prototype.releaseLock=function(){if(!Gt(this))throw Xt("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");_(this)}},e}(),Br=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Vt(this);var r=t.size,n=t.highWaterMark,i=e.type,a=String(i);if("bytes"===a){if(void 0!==r)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===n&&(n=0),n=v(n),jt(this,e,n)}else{if(void 0!==i)throw new RangeError("Invalid type is specified");var o=g(r);void 0===n&&(n=1),n=v(n),ot(this,e,n,o)}}return Object.defineProperty(e.prototype,"locked",{get:function(){if(Qt(this)===!1)throw tr("locked");return Kt(this)},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return Qt(this)===!1?Promise.reject(tr("cancel")):Kt(this)===!0?Promise.reject(new TypeError("Cannot cancel a stream that already has a reader")):Jt(this,e)},e.prototype.getReader=function(e){var t=(void 0===e?{}:e).mode;if(Qt(this)===!1)throw tr("getReader");if(void 0===t)return R(this,!0);if(t=String(t),"byob"===t)return qt(this,!0);throw new RangeError("Invalid mode is specified")},e.prototype.pipeThrough=function(e,t){var r=e.writable,i=e.readable,a=void 0===t?{}:t,o=a.preventClose,s=a.preventAbort,u=a.preventCancel,c=a.signal;if(Qt(this)===!1)throw tr("pipeThrough");if(X(r)===!1)throw new TypeError("writable argument to pipeThrough must be a WritableStream");if(Qt(i)===!1)throw new TypeError("readable argument to pipeThrough must be a ReadableStream");if(o=Boolean(o),s=Boolean(s),u=Boolean(u),void 0!==c&&!er(c))throw new TypeError("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(Kt(this)===!0)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Y(r)===!0)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");var l=Ve(this,r,o,s,u,c);return l["catch"](n),i},e.prototype.pipeTo=function(e,t){var r=void 0===t?{}:t,n=r.preventClose,i=r.preventAbort,a=r.preventCancel,o=r.signal;return Qt(this)===!1?Promise.reject(tr("pipeTo")):X(e)===!1?Promise.reject(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(n=Boolean(n),i=Boolean(i),a=Boolean(a),void 0===o||er(o)?Kt(this)===!0?Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Y(e)===!0?Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Ve(this,e,n,i,a,o):Promise.reject(new TypeError("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},e.prototype.tee=function(){if(Qt(this)===!1)throw tr("tee");var e=ut(this);return a(e)},e.prototype.getIterator=function(e){var t=(void 0===e?{}:e).preventCancel,r=void 0!==t&&tif(Qt(this)===!1)throw tr("getIterator");return M(this,r)},e}();"symbol"==typeof wr.asyncIterator&&Object.defineProperty(Br.prototype,wr.asyncIterator,{value:Br.prototype.getIterator,enumerable:!1,writable:!0,configurable:!0});var zr=function(){function e(e){var t=e.highWaterMark;this.highWaterMark=t}return e.prototype.size=function(e){return e.byteLength},e}(),Gr=function(){function e(e){var t=e.highWaterMark;this.highWaterMark=t}return e.prototype.size=function(){return 1},e}(),Hr=function(){function e(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.size,i=t.highWaterMark,a=r.size,o=r.highWaterMark,s=e.writableType;if(void 0!==s)throw new RangeError("Invalid writable type specified");var u=g(n);void 0===i&&(i=1),i=v(i);var c=e.readableType;if(void 0!==c)throw new RangeError("Invalid readable type specified");var l=g(a);void 0===o&&(o=0),o=v(o);var f,d=new Promise(function(e){f=e});rr(this,d,i,u,o,l),cr(this,e);var p=h(e,"start",[this._transformStreamController]);f(p)}return Object.defineProperty(e.prototype,"readable",{get:function(){if(nr(this)===!1)throw _r("readable");return this._readable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){if(nr(this)===!1)throw _r("writable");return this._writable},enumerable:!0,configurable:!0}),e}(),Xr=function(){function e(){throw new TypeError("TransformStreamDefaultController instances cannot be created directly")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(sr(this)===!1)throw br("desiredSize");var e=this._controlledTransformStream._readable._readableStreamController;return rt(e)},enumerable:!0,configurable:!0}),e.prototype.enqueue=function(e){if(sr(this)===!1)throw br("enqueue");hr(this,e)},e.prototype.error=function(e){if(sr(this)===!1)throw br("error");fr(this,e)},e.prototype.terminate=function(){if(sr(this)===!1)throw br("terminate");pr(this)},e}()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){function o(e){i(u,n,a,o,s,"next",e)}function s(e){i(u,n,a,o,s,"throw",e)}var u=e.apply(t,r);o(void 0)})}}function o(e,t){return c(e)||u(e,t)||s()}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function u(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(u){i=!0,a=u}finally{try{n||null==s["return"]||s["return"]()}finally{if(i)throw a}}return r}}function c(e){if(Array.isArray(e))return e}function l(e){return d(e)||f(e)||h()}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function f(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function d(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t2&&void 0!==arguments[2]&&arguments[2];p(this,e),this.length=t,this.initialData=r,this.progressiveDone=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,w.createPromiseCapability)()}return g(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 r=!0,n=!1,i=void 0;try{for(var a,o=this._rangeListeners[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;s(e,t)}}catch(u){n=!0,i=u}finally{try{r||null==o["return"]||o["return"]()}finally{if(n)throw i}}}},{key:"onDataProgress",value:function(e,t){var r=this;this._readyCapability.promise.then(function(){var n=!0,i=!1,a=void 0;try{for(var o,s=r._progressListeners[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;u(e,t)}}catch(c){i=!0,a=c}finally{try{n||null==s["return"]||s["return"]()}finally{if(i)throw a}}})}},{key:"onDataProgressiveRead",value:function(e){var t=this;this._readyCapability.promise.then(function(){var r=!0,n=!1,i=void 0;try{for(var a,o=t._progressiveReadListeners[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;s(e)}}catch(u){n=!0,i=u}finally{try{r||null==o["return"]||o["return"]()}finally{if(n)throw i}}})}},{key:"onDataProgressiveDone",value:function(){var e=this;this._readyCapability.promise.then(function(){var t=!0,r=!1,n=void 0;try{for(var i,a=e._progressiveDoneListeners[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;o()}}catch(s){r=!0,n=s}finally{try{t||null==a["return"]||a["return"]()}finally{if(r)throw n}}})}},{key:"transportReady",value:function(){this._readyCapability.resolve()}},{key:"requestDataRange",value:function(e,t){(0,w.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}},{key:"abort",value:function(){}}]),e}();t.PDFDataRangeTransport=z;var G=function(){function e(t,r){p(this,e),this._pdfInfo=t,this._transport=r}return g(e,[{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:"getOpenActionDestination",value:function(){return this._transport.getOpenActionDestination()}},{key:"getAttachments",value:function(){return this._transport.getAttachments()}},{key:"getJavaScript",value:function(){return this._transport.getJavaScript()}},{key:"getOutline",value:function(){return this._transport.getOutline()}},{key:"getPermissions",value:function(){return this._transport.getPermissions()}},{key:"getMetadata",value:function(){return this._transport.getMetadata()}},{key:"getData",value:function(){return this._transport.getData()}},{key:"getDownloadInfo",value:function(){return this._transport.downloadInfoCapability.promise}},{key:"getStats",value:function(){return this._transport.getStats()}},{key:"cleanup",value:function(){this._transport.startCleanup()}},{key:"destroy",value:function(){return this.loadingTask.destroy()}},{key:"numPages",get:function(){return this._pdfInfo.numPages}},{key:"fingerprint",get:function(){return this._pdfInfo.fingerprint}},{key:"loadingParams",get:function(){return this._transport.loadingParams}},{key:"loadingTask",get:function(){return this._transport.loadingTask}}]),e}();t.PDFDocumentProxy=G;var H=function(){function e(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];p(this,e),this.pageIndex=t,this._pageInfo=r,this._transport=n,this._stats=i?new k.StatTimer:k.DummyStatTimer,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new Q,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this.intentStates=Object.create(null),this.destroyed=!1}return g(e,[{key:"getViewport",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.scale,r=e.rotation,n=void 0===r?this.rotate:r,i=e.dontFlip,a=void 0!==i&&ireturn(arguments.length>1||"number"==typeof arguments[0])&&((0,k.deprecated)("getViewport is called with obsolete arguments."),t=arguments[0],n="number"==typeof arguments[1]?arguments[1]:this.rotate,a="boolean"==typeof arguments[2]&&arguments[2]),new k.PageViewport({viewBox:this.view,scale:t,rotation:n,dontFlip:a})}},{key:"getAnnotations",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.intent,r=void 0===t?null:t;return this.annotationsPromise&&this.annotationsIntent===r||(this.annotationsPromise=this._transport.getAnnotations(this.pageIndex,r),this.annotationsIntent=r),this.annotationsPromise}},{key:"render",value:function(e){var t=this,r=e.canvasContext,n=e.viewport,i=e.intent,a=void 0===i?"display":i,o=e.enableWebGL,s=void 0!==o&&o,u=e.renderInteractiveForms,c=void 0!==u&&u,l=e.transform,h=void 0===l?null:l,f=e.imageLayer,d=void 0===f?null:f,p=e.canvasFactory,v=void 0===p?null:p,g=e.background,m=void 0===g?null:g,y=this._stats;y.time("Overall");var b="print"===a?"print":"display";this.pendingCleanup=!1,this.intentStates[b]||(this.intentStates[b]=Object.create(null));var _=this.intentStates[b];_.streamReaderCancelTimeout&&(clearTimeout(_.streamReaderCancelTimeout),_.streamReaderCancelTimeout=null);var A=v||new k.DOMCanvasFactory,S=new F.WebGLContext({enable:s});_.displayReadyCapability||(_.displayReadyCapability=(0,w.createPromiseCapability)(),_.operatorList={fnArray:[],argsArray:[],lastChunk:!1},y.time("Page Request"),this._pumpOperatorList({pageIndex:this.pageNumber-1,intent:b,renderInteractiveForms:c===!0}));var x=function(e){var r=_.renderTasks.indexOf(C);r>=0&&_.renderTasks.splice(r,1),(t.cleanupAfterRender||"print"===b)&&(t.pendingCleanup=!0),t._tryCleanup(),e?(C.capability.reject(e),t._abortOperatorList({intentState:_,reason:e})):C.capability.resolve(),y.timeEnd("Rendering"),y.timeEnd("Overall")},C=new J({callback:x,params:{canvasContext:r,viewport:n,transform:h,imageLayer:d,background:m},objs:this.objs,commonObjs:this.commonObjs,operatorList:_.operatorList,pageNumber:this.pageNumber,canvasFactory:A,webGLContext:S,useRequestAnimationFrame:"print"!==b,pdfBug:this._pdfBug});_.renderTasks||(_.renderTasks=[]),_.renderTasks.push(C);var P=C.task;return _.displayReadyCapability.promise.then(function(e){return t.pendingCleanup?void x():(y.time("Rendering"),C.initializeGraphics(e),void C.operatorListChanged())})["catch"](x),P}},{key:"getOperatorList",value:function(){function e(){if(n.operatorList.lastChunk){n.opListReadCapability.resolve(n.operatorList);var e=n.renderTasks.indexOf(r);e>=0&&n.renderTasks.splice(e,1)}}var t="oplist";this.intentStates[t]||(this.intentStates[t]=Object.create(null));var r,n=this.intentStates[t];return n.opListReadCapability||(r={},r.operatorListChanged=e,n.opListReadCapability=(0,w.createPromiseCapability)(),n.renderTasks=[],n.renderTasks.push(r),n.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this.pageIndex,intent:t})),n.opListReadCapability.promise}},{key:"streamTextContent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.normalizeWhitespace,r=void 0!==t&&t,n=e.disableCombineTextItems,i=void 0!==n&&n,a=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this.pageNumber-1,normalizeWhitespace:r===!0,combineTextItems:i!==!0},{highWaterMark:a,size:function(e){return e.items.length}})}},{key:"getTextContent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.streamTextContent(e);return new Promise(function(e,r){function n(){i.read().then(function(t){var r,i=t.value,o=t.done;return o?void e(a):(Object.assign(a.styles,i.styles),(r=a.items).push.apply(r,l(i.items)),void n())},r)}var i=t.getReader(),a={items:[],styles:Object.create(null)};n()})}},{key:"_destroy",value:function(){var e=this;this.destroyed=!0,this._transport.pageCache[this.pageIndex]=null;var t=[];return Object.keys(this.intentStates).forEach(function(r){var n=e.intentStates[r];e._abortOperatorList({intentState:n,reason:new Error("Page was destroyed."),force:!0}),"oplist"!==r&&n.renderTasks.forEach(function(e){var r=e.capability.promise["catch"](function(){});t.push(r),e.cancel()})}),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(t)}},{key:"cleanup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.pendingCleanup=!0,this._tryCleanup(e)}},{key:"_tryCleanup",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.pendingCleanup&&!Object.keys(this.intentStates).some(function(t){var r=e.intentStates[t];return 0!==r.renderTasks.length||!r.operatorList.lastChunk})&&(Object.keys(this.intentStates).forEach(function(t){delete e.intentStates[t]}),this.objs.clear(),this.annotationsPromise=null,t&&this._stats instanceof k.StatTimer&&(this._stats=new k.StatTimer),this.pendingCleanup=!1)}},{key:"_startRenderPage",value:function(e,t){var r=this.intentStates[t];r&&(this._stats.timeEnd("Page Request"),r.displayReadyCapability&&r.displayReadyCapability.resolve(e))}},{key:"_renderPageChunk",value:function(e,t){for(var r=0,n=e.length;r0&&void 0!==arguments[0])||arguments[0];p(this,e),this._listeners=[],this._defer=t,this._deferred=Promise.resolve(void 0)}return g(e,[{key:"postMessage",value:function(e,t){function r(e){if("object"!==m(e)||null===e)return e;if(i.has(e))return i.get(e);var n,a;if((n=e.buffer)&&(0,w.isArrayBuffer)(n)){var o=t&&t.includes(n);return a=e===n?e:o?new e.constructor(n,e.byteOffset,e.byteLength):new e.constructor(e),i.set(e,a),a}a=Array.isArray(e)?[]:{},i.set(e,a);for(var s in e){for(var u=void 0,c=e;!(u=Object.getOwnPropertyDescriptor(c,s));)c=Object.getPrototypeOf(c);if("undefined"!=typeof u.value)if("function"!=typeof u.value)a[s]=r(u.value);else if(e.hasOwnProperty&&e.hasOwnProperty(s))throw new Error("LoopbackPort.postMessage - cannot clone: ".concat(e[s]))}return a}var n=this;if(!this._defer)return void this._listeners.forEach(function(t){t.call(n,{data:e})});var i=new WeakMap,a={data:r(e)};this._deferred.then(function(){n._listeners.forEach(function(e){e.call(n,a)})})}},{key:"addEventListener",value:function(e,t){this._listeners.push(t)}},{key:"removeEventListener",value:function(e,t){var r=this._listeners.indexOf(t);this._listeners.splice(r,1)}},{key:"terminate",value:function(){this._listeners.length=0}}]),e}();t.LoopbackPort=X;var Y=function(){function e(){if(E.GlobalWorkerOptions.workerSrc)return E.GlobalWorkerOptions.workerSrc;if("undefined"!=typeof A)return A;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function t(){try{if("undefined"!=typeof window)return window.pdfjsWorker&&window.pdfjsWorker.WorkerMessageHandler}catch(e){}return null}function r(){if(i)return i.promise;i=(0,w.createPromiseCapability)();var r=t();if(r)return i.resolve(r),i.promise;var n=N||function(){return(0,k.loadScript)(e()).then(function(){return window.pdfjsWorker.WorkerMessageHandler})};return n().then(i.resolve,i.reject),i.promise}function n(e){var t="importScripts('"+e+"');";return URL.createObjectURL(new Blob([t]))}var i,a=new WeakMap,o=0,s=function(){function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.name,r=void 0===t?null:t,n=e.port,o=void 0===n?null:n,s=e.verbosity,u=void 0===s?(0,w.getVerbosityLevel)():s;if(p(this,i),o&&a.has(o))throw new Error("Cannot use more than one PDFWorker per port");return this.name=r,this.destroyed=!1,this.postMessageTransfers=!0,this.verbosity=u,this._readyCapability=(0,w.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,o?(a.set(o,this),void this._initializeFromPort(o)):void this._initialize()}return g(i,[{key:"_initializeFromPort",value:function(e){this._port=e,this._messageHandler=new T.MessageHandler("main","worker",e),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()}},{key:"_initialize",value:function(){var r=this;if("undefined"!=typeof Worker&&!M&&!t()){var i=e();try{(0,w.isSameOrigin)(window.location.href,i)||(i=n(new URL(i,window.location).href));var a=new Worker(i),o=new T.MessageHandler("main","worker",a),s=function(){a.removeEventListener("error",u),o.destroy(),a.terminate(),r.destroyed?r._readyCapability.reject(new Error("Worker was destroyed")):r._setupFakeWorker()},u=function(){r._webWorker||s()};a.addEventListener("error",u),o.on("test",function(e){return a.removeEventListener("error",u),r.destroyed?void s():void(e?(r._messageHandler=o,r._port=a,r._webWorker=a,e.supportTransfers||(r.postMessageTransfers=!1),r._readyCapability.resolve(),o.send("configure",{verbosity:r.verbosity})):(r._setupFakeWorker(),o.destroy(),a.terminate()))}),o.on("ready",function(e){if(a.removeEventListener("error",u),r.destroyed)return void s();try{c()}catch(t){r._setupFakeWorker()}});var c=function(){var e=new Uint8Array([r.postMessageTransfers?255:0]);try{o.send("test",e,[e.buffer])}catch(t){(0,w.warn)("Cannot use postMessage transfers."),e[0]=0,o.send("test",e)}};return void c()}catch(l){(0,w.info)("The worker has been disabled.")}}this._setupFakeWorker()}},{key:"_setupFakeWorker",value:function(){var e=this;M||((0,w.warn)("Setting up fake worker."),M=!0),r().then(function(t){if(e.destroyed)return void e._readyCapability.reject(new Error("Worker was destroyed"));var r=new X;e._port=r;var n="fake"+o++,i=new T.MessageHandler(n+"_worker",n,r);t.setup(i,r);var a=new T.MessageHandler(n,n+"_worker",r);e._messageHandler=a,e._readyCapability.resolve()})["catch"](function(t){e._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))})}},{key:"destroy",value:function(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),a["delete"](this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}},{key:"promise",get:function(){return this._readyCapability.promise}},{key:"port",get:function(){return this._port}},{key:"messageHandler",get:function(){return this._messageHandler}}],[{key:"fromPort",value:function(e){if(!e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return a.has(e.port)?a.get(e.port):new i(e)}},{key:"getWorkerSrc",value:function(){return e()}}]),i}();return s}();t.PDFWorker=Y;var V=function(){function e(t,r,n,i){p(this,e),this.messageHandler=t,this.loadingTask=r,this.commonObjs=new Q,this.fontLoader=new x.FontLoader({docId:r.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this)}),this._params=i,this.CMapReaderFactory=new i.CMapReaderFactory({baseUrl:i.cMapUrl,isCompressed:i.cMapPacked}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,w.createPromiseCapability)(),this.setupMessageHandler()}return g(e,[{key:"destroy",value:function(){var e=this;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,w.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));var t=[];this.pageCache.forEach(function(e){e&&t.push(e._destroy())}),this.pageCache.length=0,this.pagePromises.length=0;var r=this.messageHandler.sendWithPromise("Terminate",null);return t.push(r),Promise.all(t).then(function(){e.fontLoader.clear(),e._networkStream&&e._networkStream.cancelAllRequests(new w.AbortException("Worker was terminated.")),e.messageHandler&&(e.messageHandler.destroy(),e.messageHandler=null),e.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}},{key:"setupMessageHandler",value:function(){var e=this,t=this.messageHandler,r=this.loadingTask;t.on("GetReader",function(t,r){(0,w.assert)(e._networkStream),e._fullReader=e._networkStream.getFullReader(),e._fullReader.onProgress=function(t){e._lastProgress={loaded:t.loaded,total:t.total}},r.onPull=function(){e._fullReader.read().then(function(e){var t=e.value,n=e.done;return n?void r.close():((0,w.assert)((0,w.isArrayBuffer)(t)),void r.enqueue(new Uint8Array(t),1,[t]))})["catch"](function(e){r.error(e)})},r.onCancel=function(t){e._fullReader.cancel(t)}}),t.on("ReaderHeadersReady",function(t){var n=(0,w.createPromiseCapability)(),i=e._fullReader;return i.headersReady.then(function(){i.isStreamingSupported&&i.isRangeSupported||(e._lastProgress&&r.onProgress&&r.onProgress(e._lastProgress),i.onProgress=function(e){r.onProgress&&r.onProgress({loaded:e.loaded,total:e.total})}),n.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})},n.reject),n.promise}),t.on("GetRangeReader",function(t,r){(0,w.assert)(e._networkStream);var n=e._networkStream.getRangeReader(t.begin,t.end);return n?(r.onPull=function(){n.read().then(function(e){var t=e.value,n=e.done;return n?void r.close():((0,w.assert)((0,w.isArrayBuffer)(t)),void r.enqueue(new Uint8Array(t),1,[t]))})["catch"](function(e){r.error(e)})},void(r.onCancel=function(e){n.cancel(e)})):void r.close()}),t.on("GetDoc",function(t){var n=t.pdfInfo;e._numPages=n.numPages,r._capability.resolve(new G(n,e))}),t.on("PasswordRequest",function(t){if(e._passwordCapability=(0,w.createPromiseCapability)(),r.onPassword){var n=function(t){e._passwordCapability.resolve({password:t})};try{r.onPassword(n,t.code)}catch(i){e._passwordCapability.reject(i)}}else e._passwordCapability.reject(new w.PasswordException(t.message,t.code));return e._passwordCapability.promise}),t.on("PasswordException",function(e){r._capability.reject(new w.PasswordException(e.message,e.code))}),t.on("InvalidPDF",function(e){r._capability.reject(new w.InvalidPDFException(e.message))}),t.on("MissingPDF",function(e){r._capability.reject(new w.MissingPDFException(e.message))}),t.on("UnexpectedResponse",function(e){r._capability.reject(new w.UnexpectedResponseException(e.message,e.status))}),t.on("UnknownError",function(e){r._capability.reject(new w.UnknownErrorException(e.message,e.details))}),t.on("DataLoaded",function(t){r.onProgress&&r.onProgress({loaded:t.length,total:t.length}),e.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",function(t){if(!e.destroyed){var r=e.pageCache[t.pageIndex];r._startRenderPage(t.transparency,t.intent)}}),t.on("commonobj",function(r){if(!e.destroyed){var n=o(r,3),i=n[0],a=n[1],s=n[2];if(!e.commonObjs.has(i))switch(a){case"Font":var u=e._params;if("error"in s){var c=s.error;(0,w.warn)("Error during font loading: ".concat(c)),e.commonObjs.resolve(i,c);break}var l=null;u.pdfBug&&R["default"].FontInspector&&R["default"].FontInspector.enabled&&(l={registerFont:function(e,t){R["default"].FontInspector.fontAdded(e,t)}});var h=new x.FontFaceObject(s,{isEvalSupported:u.isEvalSupported,disableFontFace:u.disableFontFace,ignoreErrors:u.ignoreErrors,onUnsupportedFeature:e._onUnsupportedFeature.bind(e),fontRegistry:l});e.fontLoader.bind(h).then(function(){e.commonObjs.resolve(i,h)},function(r){t.sendWithPromise("FontFallback",{id:i})["finally"](function(){e.commonObjs.resolve(i,h)})});break;case"FontPath":case"FontType3Res":e.commonObjs.resolve(i,s);break;default:throw new Error("Got unknown common object type ".concat(a))}}}),t.on("obj",function(t){if(!e.destroyed){var r=o(t,4),n=r[0],i=r[1],a=r[2],s=r[3],u=e.pageCache[i];if(!u.objs.has(n))switch(a){case"JpegStream":return new Promise(function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=function(){t(new Error("Error during JPEG image loading")),(0,k.releaseImageResources)(r)},r.src=s}).then(function(e){u.objs.resolve(n,e)});case"Image":u.objs.resolve(n,s);var c=8e6;s&&"data"in s&&s.data.length>c&&(u.cleanupAfterRender=!0);break;default:throw new Error("Got unknown object type ".concat(a))}}}),t.on("DocProgress",function(t){e.destroyed||r.onProgress&&r.onProgress({loaded:t.loaded,total:t.total})}),t.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),t.on("JpegDecode",function(t){if(e.destroyed)return Promise.reject(new Error("Worker was destroyed"));if("undefined"==typeof document)return Promise.reject(new Error('"document" is not defined.'));var r=o(t,2),n=r[0],i=r[1];return 3!==i&&1!==i?Promise.reject(new Error("Only 3 components or 1 component can be returned")):new Promise(function(e,t){var r=new Image;r.onload=function(){var t=r.width,n=r.height,a=t*n,o=4*a,s=new Uint8ClampedArray(a*i),u=document.createElement("canvas");u.width=t,u.height=n;var c=u.getContext("2d");c.drawImage(r,0,0);var l=c.getImageData(0,0,t,n).data;if(3===i)for(var h=0,f=0;hthis._numPages)return Promise.reject(new Error("Invalid page request"));var r=e-1;if(r in this.pagePromises)return this.pagePromises[r];var n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then(function(e){if(t.destroyed)throw new Error("Transport destroyed");var n=new H(r,e,t,t._params.pdfBug);return t.pageCache[r]=n,n});return this.pagePromises[r]=n,n}},{key:"getPageIndex",value:function(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e})["catch"](function(e){return Promise.reject(new Error(e))})}},{key:"getAnnotations",value:function(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}},{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:"getOpenActionDestination",value:function(){return this.messageHandler.sendWithPromise("GetOpenActionDestination",null)}},{key:"getAttachments",value:function(){return this.messageHandler.sendWithPromise("GetAttachments",null)}},{key:"getJavaScript",value:function(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}},{key:"getOutline",value:function(){return this.messageHandler.sendWithPromise("GetOutline",null)}},{key:"getPermissions",value:function(){return this.messageHandler.sendWithPromise("GetPermissions",null)}},{key:"getMetadata",value:function(){var e=this;return this.messageHandler.sendWithPromise("GetMetadata",null).then(function(t){return{info:t[0],metadata:t[1]?new O.Metadata(t[1]):null,contentDispositionFilename:e._fullReader?e._fullReader.filename:null}})}},{key:"getStats",value:function(){return this.messageHandler.sendWithPromise("GetStats",null)}},{key:"startCleanup",value:function(){var e=this;this.messageHandler.sendWithPromise("Cleanup",null).then(function(){for(var t=0,r=e.pageCache.length;t1&&void 0!==arguments[1]?arguments[1]:null;if(t)return this._ensureObj(e).capability.promise.then(t),null;var r=this._objs[e];if(!r||!r.resolved)throw new Error("Requesting object that isn't resolved yet ".concat(e,"."));return r.data}},{key:"has",value:function(e){var t=this._objs[e];return!!t&&t.resolved}},{key:"resolve",value:function(e,t){var r=this._ensureObj(e);r.resolved=!0,r.data=t,r.capability.resolve(t)}},{key:"clear",value:function(){for(var e in this._objs){var t=this._objs[e].data;"undefined"!=typeof Image&&t instanceof Image&&(0,k.releaseImageResources)(t)}this._objs=Object.create(null)}}]),e}(),K=function(){function e(t){p(this,e),this._internalRenderTask=t,this.onContinue=null}return g(e,[{key:"cancel",value:function(){this._internalRenderTask.cancel()}},{key:"then",value:function(e,t){return(0,k.deprecated)("RenderTask.then method, use the `promise` getter instead."),this.promise.then.apply(this.promise,arguments)}},{key:"promise",get:function(){return this._internalRenderTask.capability.promise}}]),e}(),J=function(){var e=new WeakSet,t=function(){function t(e){var r=e.callback,n=e.params,i=e.objs,a=e.commonObjs,o=e.operatorList,s=e.pageNumber,u=e.canvasFactory,c=e.webGLContext,l=e.useRequestAnimationFrame,h=void 0!==l&&l,f=e.pdfBug,d=void 0!==f&&fp(this,t),this.callback=r,this.params=n,this.objs=i,this.commonObjs=a,this.operatorListIdx=null,this.operatorList=o,this.pageNumber=s,this.canvasFactory=u,this.webGLContext=c,this._pdfBug=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&"undefined"!=typeof window,this.cancelled=!1,this.capability=(0,w.createPromiseCapability)(),this.task=new K(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=n.canvasContext.canvas}return g(t,[{key:"initializeGraphics",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.cancelled){if(this._canvas){if(e.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.");e.add(this._canvas)}this._pdfBug&&R["default"].StepperManager&&R["default"].StepperManager.enabled&&(this.stepper=R["default"].StepperManager.create(this.pageNumber-1),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());var r=this.params,n=r.canvasContext,i=r.viewport,a=r.transform,o=r.imageLayer,s=r.background;this.gfx=new P.CanvasGraphics(n,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext,o),this.gfx.beginDrawing({transform:a,viewport:i,transparency:t,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&e["delete"](this._canvas),this.callback(t||new k.RenderingCancelledException("Rendering cancelled, page ".concat(this.pageNumber),"canvas")); }},{key:"operatorListChanged",value:function(){return this.graphicsReady?(this.stepper&&this.stepper.updateOperatorList(this.operatorList),void(this.running||this._continue())):void(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.cancel.bind(e))}):Promise.resolve().then(this._nextBound)["catch"](this.cancel.bind(this))}},{key:"_next",value:function(){function t(){return r.apply(this,arguments)}var r=a(S["default"].mark(function n(){return S["default"].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(),this._canvas&&e["delete"](this._canvas),this.callback()));case 4:case"end":return t.stop()}},n,this)}));return t}()}]),t}();return t}(),Z="2.3.200";t.version=Z;var $="4ae3f9fc";t.build=$},function(e,t,r){"use strict";e.exports=r(181)},function(e,t,r){"use strict";(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r=function(e){function r(e,t,r,n){var a=t&&t.prototype instanceof i?t:i,o=Object.create(a.prototype),s=new d(n||[]);return o._invoke=c(e,r,s),o}function n(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}function i(){}function a(){}function o(){}function s(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function u(e){function r(i,a,o,s){var u=n(e[i],e,a);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"===t(l)&&y.call(l,"__await")?Promise.resolve(l.__await).then(function(e){r("next",e,o,s)},function(e){r("throw",e,o,s)}):Promise.resolve(l).then(function(e){c.value=e,o(c)},function(e){return r("throw",e,o,s)})}s(u.arg)}function i(e,t){function n(){return new Promise(function(n,i){r(e,t,n,i)})}return a=a?a.then(n,n):n()}var a;this._invoke=i}function c(e,t,r){var i=w;return function(a,o){if(i===x)throw new Error("Generator is already running");if(i===C){if("throw"===a)throw o;return v()}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=l(s,r);if(u){if(u===P)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===w)throw i=C,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=x;var c=n(e,t,r);if("normal"===c.type){if(i=r.done?C:k,c.arg===P)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=C,r.method="throw",r.arg=c.arg)}}}function l(e,t){var r=e.iterator[t.method];if(r===g){if(t.delegate=null,"throw"===t.method){if(e.iterator["return"]&&(t.method="return",t.arg=g,l(e,t),"throw"===t.method))return P;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var i=n(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,P;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=g),t.delegate=null,P):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,P)}function h(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function f(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(h,this),this.reset(!0)}function p(e){if(e){var t=e[_];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function i(){for(;++r=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(o&&s){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&y.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),f(r),P}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;f(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:p(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=g),P}},e}("object"===t(e)?e.exports:{});try{regeneratorRuntime=r}catch(n){Function("r","regeneratorRuntime = r")(r)}}).call(this,r(182)(e))},function(e,t,r){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?o(e):t}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,i)}function h(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){function a(e){l(s,n,i,a,o,"next",e)}function o(e){l(s,n,i,a,o,"throw",e)}var s=e.apply(t,r);a(void 0)})}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=t.url,n=t.target,i=t.rel,a=t.enabled,o=void 0===a||a;(0,w.assert)(r&&"string"==typeof r,'addLinkAttributes: A valid "url" parameter must provided.');var s=(0,w.removeNullCharacters)(r);o?e.href=e.title=s:(e.href="",e.title="Disabled: ".concat(s),e.onclick=function(){return!1});var u=Object.values(O),c=u.includes(n)?n:O.NONE;e.target=L[c],e.rel="string"==typeof i?i:k}function g(e){var t=e.indexOf("#"),r=e.indexOf("?"),n=Math.min(t>0?t:e.length,r>0?r:e.length);return e.substring(e.lastIndexOf("/",n)+1,n)}function m(){return"undefined"!=typeof fetch&&"undefined"!=typeof Response&&"body"in Response.prototype&&"undefined"!=typeof ReadableStream}function y(e,t){try{var r=t?new URL(e,t):new URL(e),n=r.protocol;return"http:"===n||"https:"===n}catch(i){return!1}}function b(e){return new Promise(function(t,r){var n=document.createElement("script");n.src=e,n.onload=t,n.onerror=function(){r(new Error("Cannot load script at: ".concat(n.src)))},(document.head||document.documentElement).appendChild(n)})}function _(e){}function A(e){(0,w.assert)(e instanceof Image,"Invalid `img` parameter.");var t=e.src;"string"==typeof t&&t.startsWith("blob:")&&URL.revokeObjectURL&&URL.revokeObjectURL(t),e.removeAttribute("src")}Object.defineProperty(t,"__esModule",{value:!0}),t.addLinkAttributes=v,t.getFilenameFromUrl=g,t.isFetchSupported=m,t.isValidFetchUrl=y,t.loadScript=b,t.deprecated=_,t.releaseImageResources=A,t.PDFDateString=t.DummyStatTimer=t.StatTimer=t.DOMSVGFactory=t.DOMCMapReaderFactory=t.DOMCanvasFactory=t.DEFAULT_LINK_REL=t.LinkTarget=t.RenderingCancelledException=t.PageViewport=void 0;var S=n(r(180)),w=r(1),k="noopener noreferrer nofollow";t.DEFAULT_LINK_REL=k;var x="http://www.w3.org/2000/svg",C=function(){function e(){f(this,e)}return p(e,[{key:"create",value:function(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");var r=document.createElement("canvas"),n=r.getContext("2d");return r.width=e,r.height=t,{canvas:r,context:n}}},{key:"reset",value:function(e,t,r){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=r}},{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}}]),e}();t.DOMCanvasFactory=C;var P=function(){function e(t){var r=t.baseUrl,n=void 0===r?null:r,i=t.isCompressed,a=void 0!==i&&if(this,e),this.baseUrl=n,this.isCompressed=a}return p(e,[{key:"fetch",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){var e=h(S["default"].mark(function t(e){var r,n,i,a=this;return S["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.name,this.baseUrl){t.next=3;break}throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');case 3:if(r){t.next=5;break}throw new Error("CMap name must be specified.");case 5:if(n=this.baseUrl+r+(this.isCompressed?".bcmap":""),i=this.isCompressed?w.CMapCompressionType.BINARY:w.CMapCompressionType.NONE,!m()||!y(n,document.baseURI)){t.next=9;break}return t.abrupt("return",fetch(n).then(function(){var e=h(S["default"].mark(function t(e){var r;return S["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.ok){t.next=2;break}throw new Error(e.statusText);case 2:if(!a.isCompressed){t.next=10;break}return t.t0=Uint8Array,t.next=6,e.arrayBuffer();case 6:t.t1=t.sent,r=new t.t0(t.t1),t.next=15;break;case 10:return t.t2=w.stringToBytes,t.next=13,e.text();case 13:t.t3=t.sent,r=(0,t.t2)(t.t3);case 15:return t.abrupt("return",{cMapData:r,compressionType:i});case 16:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}())["catch"](function(e){throw new Error("Unable to load ".concat(a.isCompressed?"binary ":"")+"CMap at: ".concat(n))}));case 9:return t.abrupt("return",new Promise(function(e,t){var r=new XMLHttpRequest;r.open("GET",n,!0),a.isCompressed&&(r.responseType="arraybuffer"),r.onreadystatechange=function(){if(r.readyState===XMLHttpRequest.DONE){if(200===r.status||0===r.status){var n;if(a.isCompressed&&r.response?n=new Uint8Array(r.response):!a.isCompressed&&r.responseText&&(n=(0,w.stringToBytes)(r.responseText)),n)return void e({cMapData:n,compressionType:i})}t(new Error(r.statusText))}},r.send(null)})["catch"](function(e){throw new Error("Unable to load ".concat(a.isCompressed?"binary ":"")+"CMap at: ".concat(n))}));case 10:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}())}]),e}();t.DOMCMapReaderFactory=P;var R=function(){function e(){f(this,e)}return p(e,[{key:"create",value:function(e,t){(0,w.assert)(e>0&&t>0,"Invalid SVG dimensions");var r=document.createElementNS(x,"svg:svg");return r.setAttribute("version","1.1"),r.setAttribute("width",e+"px"),r.setAttribute("height",t+"px"),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox","0 0 "+e+" "+t),r}},{key:"createElement",value:function(e){return(0,w.assert)("string"==typeof e,"Invalid SVG element type"),document.createElementNS(x,e)}}]),e}();t.DOMSVGFactory=R;var E=function(){function e(t){var r=t.viewBox,n=t.scale,i=t.rotation,a=t.offsetX,o=void 0===a?0:a,s=t.offsetY,u=void 0===s?0:s,c=t.dontFlip,l=void 0!==c&&cf(this,e),this.viewBox=r,this.scale=n,this.rotation=i,this.offsetX=o,this.offsetY=u;var h,d,p,v,g=(r[2]+r[0])/2,m=(r[3]+r[1])/2;switch(i%=360,i=i<0?i+360:i){case 180:h=-1,d=0,p=0,v=1;break;case 90:h=0,d=1,p=1,v=0;break;case 270:h=0,d=-1,p=-1,v=0;break;default:h=1,d=0,p=0,v=-1}l&&(p=-p,v=-v);var y,b,_,A;0===h?(y=Math.abs(m-r[1])*n+o,b=Math.abs(g-r[0])*n+u,_=Math.abs(r[3]-r[1])*n,A=Math.abs(r[2]-r[0])*n):(y=Math.abs(g-r[0])*n+o,b=Math.abs(m-r[1])*n+u,_=Math.abs(r[2]-r[0])*n,A=Math.abs(r[3]-r[1])*n),this.transform=[h*n,d*n,p*n,v*n,y-h*n*g-p*n*m,b-d*n*g-v*n*m],this.width=_,this.height=A}return p(e,[{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.scale,n=void 0===r?this.scale:r,i=t.rotation,a=void 0===i?this.rotation:i,o=t.dontFlip,s=void 0!==o&&oreturn new e({viewBox:this.viewBox.slice(),scale:n,rotation:a,offsetX:this.offsetX,offsetY:this.offsetY,dontFlip:s})}},{key:"convertToViewportPoint",value:function(e,t){return w.Util.applyTransform([e,t],this.transform)}},{key:"convertToViewportRectangle",value:function(e){var t=w.Util.applyTransform([e[0],e[1]],this.transform),r=w.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],r[0],r[1]]}},{key:"convertToPdfPoint",value:function(e,t){return w.Util.applyInverseTransform([e,t],this.transform)}}]),e}();t.PageViewport=E;var T=function(e){function t(e,r){var n;return f(this,t),n=a(this,s(t).call(this,e)),n.type=r,n}return u(t,e),t}(w.BaseException);t.RenderingCancelledException=T;var O={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};t.LinkTarget=O;var L=["","_self","_blank","_parent","_top"],F=function(){function e(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];f(this,e),this.enabled=!!t,this.started=Object.create(null),this.times=[]}return p(e,[{key:"time",value:function(e){this.enabled&&(e in this.started&&(0,w.warn)("Timer is already running for "+e),this.started[e]=Date.now())}},{key:"timeEnd",value:function(e){this.enabled&&(e in this.started||(0,w.warn)("Timer has not been started for "+e),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e])}},{key:"toString",value:function(){var e="",t=0,r=!0,n=!1,i=void 0;try{for(var a,o=this.times[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value,u=s.name;u.length>t&&(t=u.length)}}catch(c){n=!0,i=c}finally{try{r||null==o["return"]||o["return"]()}finally{if(n)throw i}}var l=!0,h=!1,f=void 0;try{for(var d,p=this.times[Symbol.iterator]();!(l=(d=p.next()).done);l=!0){var v=d.value,g=v.end-v.start;e+="".concat(v.name.padEnd(t)," ").concat(g,"ms\n")}}catch(c){h=!0,f=c}finally{try{l||null==p["return"]||p["return"]()}finally{if(h)throw f}}return e}}]),e}();t.StatTimer=F;var I=function(){function e(){f(this,e),(0,w.unreachable)("Cannot initialize DummyStatTimer.")}return p(e,null,[{key:"time",value:function(e){}},{key:"timeEnd",value:function(e){}},{key:"toString",value:function(){return""}}]),e}();t.DummyStatTimer=I;var j,M=function(){function e(){f(this,e)}return p(e,null,[{key:"toDateObject",value:function(e){if(!e||!(0,w.isString)(e))return null;j||(j=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));var t=j.exec(e);if(!t)return null;var r=parseInt(t[1],10),n=parseInt(t[2],10);n=n>=1&&n<=12?n-1:0;var i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;var a=parseInt(t[4],10);a=a>=0&&a<=23?a: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 u=t[7]||"Z",c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;var l=parseInt(t[9],10)||0;return l=l>=0&&l<=59?l:0,"-"===u?(a+=c,o+=l):"+"===u&&(a-=c,o-=l),new Date(Date.UTC(r,n,i,a,o,s))}}]),e}();t.PDFDateString=M},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?o(e):t}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,i)}function h(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){function a(e){l(s,n,i,a,o,"next",e)}function o(e){l(s,n,i,a,o,"throw",e)}var s=e.apply(t,r);a(void 0)})}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r0&&r.requests[0].done;){var e=r.requests.shift();setTimeout(e.callback,0)}}var r=this.loadingContext,n={id:"pdfjs-font-loading-".concat(r.nextRequestId++),done:!1,complete:t,callback:e};return r.requests.push(n),n}},{key:"_prepareFontLoadEvent",value:function(e,t,r){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 i(e,t,r,n){var i=e.substring(0,t),a=e.substring(t+r);return i+n+a}function a(e,t){if(l++,l>30)return(0,m.warn)("Load test font never loaded."),void t();c.font="30px "+e,c.fillText(".",0,20);var r=c.getImageData(0,0,1,1);return r.data[3]>0?void t():void setTimeout(a.bind(null,e,t))}var o,s,u=document.createElement("canvas");u.width=1,u.height=1;var c=u.getContext("2d"),l=0,h="lt".concat(Date.now()).concat(this.loadTestFontId++),f=this._loadTestFont,d=976;f=i(f,d,h.length,h);var p=16,v=1482184792,g=n(f,p);for(o=0,s=h.length-3;o=14&&(e=!0)}return(0,m.shadow)(this,"isSyncFontLoadingSupported",e)}},{key:"_loadTestFont",get:function(){var e=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,m.shadow)(this,"_loadTestFont",e())}}]),t}(y);var b={get value(){return(0,m.shadow)(this,"value",(0,m.isEvalSupported)())}},_=function(){function e(t,r){var n=r.isEvalSupported,i=void 0===n||n,a=r.disableFontFace,o=void 0!==a&&a,s=r.ignoreErrors,u=void 0!==s&&s,c=r.onUnsupportedFeature,l=void 0===c?null:c,h=r.fontRegistry,d=void 0===h?null:h;f(this,e),this.compiledGlyphs=Object.create(null);for(var p in t)this[p]=t[p];this.isEvalSupported=i!==!1,this.disableFontFace=o===!0,this.ignoreErrors=u===!0,this._onUnsupportedFeature=l,this.fontRegistry=d}return p(e,[{key:"createNativeFontFace",value:function(){if(!this.data||this.disableFontFace)return null;var e=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),e}},{key:"createFontFaceRule",value:function(){if(!this.data||this.disableFontFace)return null;var e=(0,m.bytesToString)(new Uint8Array(this.data)),t="url(data:".concat(this.mimetype,";base64,").concat(btoa(e),");"),r='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(t,"}");return this.fontRegistry&&this.fontRegistry.registerFont(this,t),r}},{key:"getPathGenerator",value:function(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];var r,n;try{r=e.get(this.loadedName+"_path_"+t)}catch(i){if(!this.ignoreErrors)throw i;return this._onUnsupportedFeature&&this._onUnsupportedFeature({featureId:m.UNSUPPORTED_FEATURES.font}),(0,m.warn)('getPathGenerator - ignoring character: "'.concat(i,'".')),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&b.value){for(var a,o="",s=0,u=r.length;s0;)d[p++]=g&v?0:255,v>>=1;var m=0;for(p=0,0!==d[p]&&(c[0]=1,++m),r=1;r>2)+(d[p+1]?4:0)+(d[p-h+1]?8:0),l[y]&&(c[n+r]=l[y],++m),p++;if(d[p-h]!==d[p]&&(c[n+r]=d[p]?2:4,++m),m>a)return null}for(p=h*(s-1),n=t*u,0!==d[p]&&(c[n]=8,++m),r=1;ra)return null;var b=new Int32Array([0,u,-1,0,-u,0,0,0,1]),_=[];for(t=0;m&&t<=s;t++){for(var A=t*u,S=A+o;A>4,c[A]&=x>>2|x<<2),k.push(A%u),k.push(A/u|0),c[A]||--m}while(C!==A);_.push(k),--t}}var R=function(e){e.save(),e.scale(1/o,-1/s),e.translate(0,-s),e.beginPath();for(var t=0,r=_.length;t>2),A=_.length,S=c+7>>3,w=4294967295,k=p.value?4278190080:255;for(n=0;nS?c:8*x-7,R=P&-8,E=0,T=0;C>=1}for(;r=h&&(o=l,s=c*o),r=0,i=s;i--;)y[r++]=m[g++],y[r++]=m[g++],y[r++]=m[g++],y[r++]=255;e.putImageData(v,0,n*d)}}}function r(e,t){for(var r=t.height,n=t.width,i=r%d,a=(r-i)/d,o=0===i?a:a+1,s=e.createImageData(n,d),u=0,c=t.data,l=s.data,h=0;h>=1}e.putImageData(s,0,h*d)}}function m(e,t){for(var r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],n=0,i=r.length;n>8,e[a-2]=e[a-2]*o+r*s>>8,e[a-1]=e[a-1]*o+n*s>>8}}}function _(e,t,r){for(var n=e.length,i=1/255,a=3;a>8]>>8:t[i]*a>>16}}function S(e,t,r,n,i,a,o){var s,u=!!a,c=u?a[0]:0,l=u?a[1]:0,h=u?a[2]:0;s="Luminosity"===i?A:_;for(var f=1048576,d=Math.min(n,Math.ceil(f/r)),p=0;px&&"function"==typeof r,h=l?Date.now()+k:0,f=0,d=this.commonObjs,p=this.objs;;){if(void 0!==n&&s===n.nextBreakPoint)return n.breakIt(s,r),s;if(c=o[s],c!==a.OPS.dependency)this[c].apply(this,i[s]);else{var v=!0,g=!1,m=void 0;try{for(var y,b=i[s][Symbol.iterator]();!(v=(y=b.next()).done);v=!0){var _=y.value,A=_.startsWith("g_")?d:p;if(!A.has(_))return A.get(_,r),s}}catch(S){g=!0,m=S}finally{try{v||null==b["return"]||b["return"]()}finally{if(g)throw m}}}if(s++,s===u)return s;if(l&&++f>x){if(Date.now()>h)return r(),s;f=0}}},endDrawing:function(){null!==this.current.activeSMask&&this.endSMaskGroup(),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),this.cachedCanvases.clear(),this.webGLContext.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(e){this.current.lineWidth=e,this.ctx.lineWidth=e},setLineCap:function(e){this.ctx.lineCap=C[e]},setLineJoin:function(e){this.ctx.lineJoin=P[e]},setMiterLimit:function(e){this.ctx.miterLimit=e},setDash:function(e,t){var r=this.ctx;void 0!==r.setLineDash&&(r.setLineDash(e),r.lineDashOffset=t)},setRenderingIntent:function(e){},setFlatness:function(e){},setGState:function(e){for(var t=0,r=e.length;t0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=a?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null}}},beginSMaskGroup:function(){var e=this.current.activeSMask,t=e.canvas.width,r=e.canvas.height,n="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(n,t,r,!0),a=this.ctx,o=a.mozCurrentTransform;this.ctx.save();var s=i.context;s.scale(1/e.scaleX,1/e.scaleY),s.translate(-e.offsetX,-e.offsetY),s.transform.apply(s,o),e.startTransformInverse=s.mozCurrentTransformInverse,m(a,s),this.ctx=s,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(a),this.groupLevel++},suspendSMaskGroup:function(){var e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),w(this.ctx,this.current.activeSMask,e,this.webGLContext),this.ctx.restore(),this.ctx.save(),m(e,this.ctx),this.current.resumeSMaskCtx=e;var t=a.Util.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t),e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.restore()},resumeSMaskGroup:function(){var e=this.current.resumeSMaskCtx,t=this.ctx;this.ctx=e,this.groupStack.push(t),this.groupLevel++},endSMaskGroup:function(){var e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),w(this.ctx,this.current.activeSMask,e,this.webGLContext),this.ctx.restore(),m(e,this.ctx);var t=a.Util.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t)},save:function(){this.ctx.save();var e=this.current;this.stateStack.push(e),this.current=e.clone(),this.current.resumeSMaskCtx=null},restore:function(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),null===this.current.activeSMask||0!==this.stateStack.length&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask||this.endSMaskGroup(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null)},transform:function(e,t,r,n,i,a){this.ctx.transform(e,t,r,n,i,a),this._cachedGetSinglePixelWidth=null},constructPath:function(e,t){for(var r=this.ctx,n=this.current,i=n.x,o=n.y,s=0,u=0,c=e.length;su?u:t;this.current.fontSizeScale=t/h,this.ctx.font="".concat(c," ").concat(o," ").concat(h,"px ").concat(l)}},setTextRenderingMode:function(e){this.current.textRenderingMode=e},setTextRise:function(e){this.current.textRise=e},moveText:function(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t},setLeadingMoveText:function(e,t){this.setLeading(-t),this.moveText(e,t)},setTextMatrix:function(e,t,r,n,i,a){this.current.textMatrix=[e,t,r,n,i,a],this.current.textMatrixScale=Math.sqrt(e*e+t*t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar:function(e,t,r,n){var i,o=this.ctx,s=this.current,u=s.font,c=s.textRenderingMode,l=s.fontSize/s.fontSizeScale,h=c&a.TextRenderingMode.FILL_STROKE_MASK,f=!!(c&a.TextRenderingMode.ADD_TO_PATH_FLAG),d=s.patternFill&&u.dataif((u.disableFontFace||f||d)&&(i=u.getPathGenerator(this.commonObjs,e)),u.disableFontFace||d?(o.save(),o.translate(t,r),o.beginPath(),i(o,l),n&&o.setTransform.apply(o,n),h!==a.TextRenderingMode.FILL&&h!==a.TextRenderingMode.FILL_STROKE||o.fill(),h!==a.TextRenderingMode.STROKE&&h!==a.TextRenderingMode.FILL_STROKE||o.stroke(),o.restore()):(h!==a.TextRenderingMode.FILL&&h!==a.TextRenderingMode.FILL_STROKE||o.fillText(e,t,r),h!==a.TextRenderingMode.STROKE&&h!==a.TextRenderingMode.FILL_STROKE||o.strokeText(e,t,r)),f){var p=this.pendingTextPaths||(this.pendingTextPaths=[]);p.push({transform:o.mozCurrentTransform,x:t,y:r,fontSize:l,addToPath:i})}},get isFontSubpixelAAEnabled(){var e=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10),t=e.context;t.scale(1.5,1),t.fillText("I",0,10);for(var r=t.getImageData(0,0,10,10).data,n=!1,i=3;i0&&r[i]<255){n=!0;break}return(0,a.shadow)(this,"isFontSubpixelAAEnabled",n)},showText:function(e){var t=this.current,r=t.font;if(r.isType3Font)return this.showType3Text(e);var n=t.fontSize;if(0!==n){var i=this.ctx,o=t.fontSizeScale,s=t.charSpacing,u=t.wordSpacing,c=t.fontDirection,h=t.textHScale*c,f=e.length,d=r.vertical,p=d?1:-1,v=r.defaultVMetrics,g=n*t.fontMatrix[0],m=t.textRenderingMode===a.TextRenderingMode.FILL&&!r.disableFontFace&&!t.patternFill;i.save();var y;if(t.patternFill){i.save();var b=t.fillColor.getPattern(i,this);y=i.mozCurrentTransform,i.restore(),i.fillStyle=b}i.transform.apply(i,t.textMatrix),i.translate(t.x,t.y+t.textRise),c>0?i.scale(h,-1):i.scale(h,1);var _=t.lineWidth,A=t.textMatrixScale;if(0===A||0===_){var S=t.textRenderingMode&a.TextRenderingMode.FILL_STROKE_MASK;S!==a.TextRenderingMode.STROKE&&S!==a.TextRenderingMode.FILL_STROKE||(this._cachedGetSinglePixelWidth=null,_=this.getSinglePixelWidth()*l)}else _/=A;1!==o&&(i.scale(o,o),_/=o),i.lineWidth=_;var w,k=0;for(w=0;w0){var D=1e3*i.measureText(L).width/n*o;if(Ic&&(h=u/c,u=c),l>c&&(f=l/c,l=c);var d="groupAt"+this.groupLevel;e.smask&&(d+="_smask_"+this.smaskCounter++%2);var p=this.cachedCanvases.getCanvas(d,u,l,!0),v=p.context;v.scale(1/h,1/f),v.translate(-o,-s),v.transform.apply(v,r),e.smask?this.smaskStack.push({canvas:p.canvas,context:v,offsetX:o,offsetY:s,scaleX:h,scaleY:f,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(o,s),t.scale(h,f)),m(t,v),this.ctx=v,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++,this.current.activeSMask=null},endGroup:function(e){this.groupLevel--;var t=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,e.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(t.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(e,t,r){if(this.save(),y(this.ctx),this.current=new g,Array.isArray(e)&&4===e.length){var n=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],n,i),this.clip(),this.endPath()}this.transform.apply(this,t),this.transform.apply(this,r)},endAnnotation:function(){this.restore()},paintJpegXObject:function(e,t,r){var n=this.processingType3?this.commonObjs.get(e):this.objs.get(e);if(!n)return void(0,a.warn)("Dependent image isn't ready yet");this.save();var i=this.ctx;if(i.scale(1/t,-1/r),i.drawImage(n,0,0,n.width,n.height,0,-r,t,r),this.imageLayer){var o=i.mozCurrentTransformInverse,s=this.getCanvasPosition(0,0);this.imageLayer.appendImage({objId:e,left:s[0],top:s[1],width:t/o[0],height:r/o[3]})}this.restore()},paintImageMaskXObject:function(e){var t=this.ctx,n=e.width,a=e.height,o=this.current.fillColor,s=this.current.patternFill,u=this.processingType3;if(h&&u&&void 0===u.compiled&&(n<=f&&a<=f?u.compiled=i({data:e.data,width:n,height:a}):u.compiled=null),u&&u.compiled)return void u.compiled(t);var c=this.cachedCanvases.getCanvas("maskCanvas",n,a),l=c.context;l.save(),r(l,e),l.globalCompositeOperation="source-in",l.fillStyle=s?o.getPattern(l,this):o,l.fillRect(0,0,n,a),l.restore(),this.paintInlineImageXObject(c.canvas)},paintImageMaskXObjectRepeat:function(e,t,n,i){var a=e.width,o=e.height,s=this.current.fillColor,u=this.current.patternFill,c=this.cachedCanvases.getCanvas("maskCanvas",a,o),l=c.context;l.save(),r(l,e),l.globalCompositeOperation="source-in",l.fillStyle=u?s.getPattern(l,this):s,l.fillRect(0,0,a,o),l.restore();for(var h=this.ctx,f=0,d=i.length;f2&&v>1||d>2&&g>1;){var y=v,b=g;l>2&&v>1&&(y=Math.ceil(v/2),l/=v/y),d>2&&g>1&&(b=Math.ceil(g/2),d/=g/b),o=this.cachedCanvases.getCanvas(m,y,b),p=o.context,p.clearRect(0,0,y,b),p.drawImage(a,0,0,v,g,0,0,y,b),a=o.canvas,v=y,g=b,m="prescale1"===m?"prescale2":"prescale1"}if(i.drawImage(a,0,0,v,g,0,-n,r,n),this.imageLayer){var _=this.getCanvasPosition(0,-n);this.imageLayer.appendImage({imgData:e,left:_[0],top:_[1],width:r/s[0],height:n/s[3]})}this.restore()},paintInlineImageXObjectGroup:function(e,r){var n=this.ctx,i=e.width,a=e.height,o=this.cachedCanvases.getCanvas("inlineImage",i,a),s=o.context;t(s,e);for(var u=0,c=r.length;uc[n+1]&&(u=r,r=n,n=u,u=a,a=o,o=u),c[n+1]>c[i+1]&&(u=n,n=i,i=u,u=o,o=s,s=u),c[r+1]>c[n+1]&&(u=r,r=n,n=u,u=a,a=o,o=u);var d=(c[r]+t.offsetX)*t.scaleX,p=(c[r+1]+t.offsetY)*t.scaleY,v=(c[n]+t.offsetX)*t.scaleX,g=(c[n+1]+t.offsetY)*t.scaleY,m=(c[i]+t.offsetX)*t.scaleX,y=(c[i+1]+t.offsetY)*t.scaleY;if(!(p>=y))for(var b,_,A,S,w,k,x,C,P,R=l[a],E=l[a+1],T=l[a+2],O=l[o],L=l[o+1],F=l[o+2],I=l[s],j=l[s+1],M=l[s+2],N=Math.round(p),D=Math.round(y),q=N;q<=D;q++){qy?1:g===y?0:(g-q)/(g-y),b=v-(v-m)*P,_=O-(O-I)*P,A=L-(L-j)*P,S=F-(F-M)*P),P=qy?1:(p-q)/(p-y),w=d-(d-m)*P,k=R-(R-I)*P,x=E-(E-j)*P,C=T-(T-M)*P;for(var U=Math.round(Math.min(b,w)),W=Math.round(Math.max(b,w)),B=f*q+4*U,z=U;z<=W;z++)P=(b-z)/(b-w),P=P<0?0:P>1?1:P,h[B++]=_-(_-k)*P|0,h[B++]=A-(A-x)*P|0,h[B++]=S-(S-C)*P|0,h[B++]=255}}function t(t,r,n){var i,a,o=r.coords,s=r.colors;switch(r.type){case"lattice":var u=r.verticesPerRow,c=Math.floor(o.length/u)-1,l=u-1;for(i=0;i=i?a=i:n=a/e,{scale:n,size:a}},clipBbox:function(e,t,r,n,i,a){if(Array.isArray(t)&&4===t.length){var o=i-r,s=a-n;e.ctx.rect(r,n,o,s),e.clip(),e.endPath()}},setFillAndStrokeStyleToContext:function(e,r,n){var i=e.ctx,o=e.current;switch(r){case t.COLORED:var s=this.ctx;i.fillStyle=s.fillStyle,i.strokeStyle=s.strokeStyle,o.fillColor=s.fillStyle, o.strokeColor=s.strokeStyle;break;case t.UNCOLORED:var u=a.Util.makeCssRgb(n[0],n[1],n[2]);i.fillStyle=u,i.strokeStyle=u,o.fillColor=u,o.strokeColor=u;break;default:throw new a.FormatError("Unsupported paint type: ".concat(r))}},getPattern:function(e,t){e=this.ctx,e.setTransform.apply(e,this.baseTransform),e.transform.apply(e,this.matrix);var r=this.createPatternCanvas(t);return e.createPattern(r,"repeat")}},e}();t.TilingPattern=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;var n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=void 0===n.workerPort?null:n.workerPort,n.workerSrc=void 0===n.workerSrc?"":n.workerSrc},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){if("object"!==n(e))return e;switch(e.name){case"AbortException":return new o.AbortException(e.message);case"MissingPDFException":return new o.MissingPDFException(e.message);case"UnexpectedResponseException":return new o.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new o.UnknownErrorException(e.message,e.details);default:return new o.UnknownErrorException(e.message,e.toString())}}function a(e,t,r){var n=this;this.sourceName=e,this.targetName=t,this.comObj=r,this.callbackId=1,this.streamId=1,this.postMessageTransfers=!0,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null);var a=this.callbacksCapabilities=Object.create(null),o=this.actionHandler=Object.create(null);this._onComObjOnMessage=function(e){var t=e.data;if(t.targetName===n.sourceName)if(t.stream)n._processStreamMessage(t);else if(t.isReply){var s=t.callbackId;if(!(t.callbackId in a))throw new Error("Cannot resolve callback ".concat(s));var u=a[s];delete a[s],"reason"in t?u.reject(i(t.reason)):u.resolve(t.data)}else{if(!(t.action in o))throw new Error("Unknown action from worker: ".concat(t.action));var c=o[t.action];if(t.callbackId){var l=n.sourceName,h=t.sourceName;new Promise(function(e){e(c(t.data))}).then(function(e){r.postMessage({sourceName:l,targetName:h,isReply:!0,callbackId:t.callbackId,data:e})},function(e){r.postMessage({sourceName:l,targetName:h,isReply:!0,callbackId:t.callbackId,reason:i(e)})})}else t.streamId?n._createStreamSink(t):c(t.data)}},r.addEventListener("message",this._onComObjOnMessage)}Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=a;var o=r(1),s={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};a.prototype={on:function(e,t){var r=this.actionHandler;if(r[e])throw new Error('There is already an actionName called "'.concat(e,'"'));r[e]=t},send:function(e,t,r){this.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},r)},sendWithPromise:function(e,t,r){var n=this.callbackId++,i=(0,o.createPromiseCapability)();this.callbacksCapabilities[n]=i;try{this.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},r)}catch(a){i.reject(a)}return i.promise},sendWithStream:function(e,t,r,n){var a=this,u=this.streamId++,c=this.sourceName,l=this.targetName,h=this.comObj;return new o.ReadableStream({start:function(r){var i=(0,o.createPromiseCapability)();return a.streamControllers[u]={controller:r,startCall:i,pullCall:null,cancelCall:null,isClosed:!1},a.postMessage({sourceName:c,targetName:l,action:e,streamId:u,data:t,desiredSize:r.desiredSize},n),i.promise},pull:function(e){var t=(0,o.createPromiseCapability)();return a.streamControllers[u].pullCall=t,h.postMessage({sourceName:c,targetName:l,stream:s.PULL,streamId:u,desiredSize:e.desiredSize}),t.promise},cancel:function(e){(0,o.assert)(e instanceof Error,"cancel must have a valid reason");var t=(0,o.createPromiseCapability)();return a.streamControllers[u].cancelCall=t,a.streamControllers[u].isClosed=!0,h.postMessage({sourceName:c,targetName:l,stream:s.CANCEL,streamId:u,reason:i(e)}),t.promise}},r)},_createStreamSink:function(e){var t=this,r=this.actionHandler[e.action],n=e.streamId,a=e.desiredSize,u=this.sourceName,c=e.sourceName,l=(0,o.createPromiseCapability)(),h=this.comObj,f={enqueue:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2?arguments[2]:void 0;if(!this.isCancelled){var a=this.desiredSize;this.desiredSize-=r,a>0&&this.desiredSize<=0&&(this.sinkCapability=(0,o.createPromiseCapability)(),this.ready=this.sinkCapability.promise),t.postMessage({sourceName:u,targetName:c,stream:s.ENQUEUE,streamId:n,chunk:e},i)}},close:function(){this.isCancelled||(this.isCancelled=!0,h.postMessage({sourceName:u,targetName:c,stream:s.CLOSE,streamId:n}),delete t.streamSinks[n])},error:function(e){(0,o.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,h.postMessage({sourceName:u,targetName:c,stream:s.ERROR,streamId:n,reason:i(e)}))},sinkCapability:l,onPull:null,onCancel:null,isCancelled:!1,desiredSize:a,ready:null};f.sinkCapability.resolve(),f.ready=f.sinkCapability.promise,this.streamSinks[n]=f,new Promise(function(t){t(r(e.data,f))}).then(function(){h.postMessage({sourceName:u,targetName:c,stream:s.START_COMPLETE,streamId:n,success:!0})},function(e){h.postMessage({sourceName:u,targetName:c,stream:s.START_COMPLETE,streamId:n,reason:i(e)})})},_processStreamMessage:function(e){var t=this,r=this.sourceName,n=e.sourceName,a=e.streamId,u=this.comObj,c=function(){Promise.all([t.streamControllers[a].startCall,t.streamControllers[a].pullCall,t.streamControllers[a].cancelCall].map(function(e){return e&&e.promise["catch"](function(){})})).then(function(){delete t.streamControllers[a]})};switch(e.stream){case s.START_COMPLETE:e.success?this.streamControllers[a].startCall.resolve():this.streamControllers[a].startCall.reject(i(e.reason));break;case s.PULL_COMPLETE:e.success?this.streamControllers[a].pullCall.resolve():this.streamControllers[a].pullCall.reject(i(e.reason));break;case s.PULL:if(!this.streamSinks[a]){u.postMessage({sourceName:r,targetName:n,stream:s.PULL_COMPLETE,streamId:a,success:!0});break}this.streamSinks[a].desiredSize<=0&&e.desiredSize>0&&this.streamSinks[a].sinkCapability.resolve(),this.streamSinks[a].desiredSize=e.desiredSize;var l=this.streamSinks[e.streamId].onPull;new Promise(function(e){e(l&&l())}).then(function(){u.postMessage({sourceName:r,targetName:n,stream:s.PULL_COMPLETE,streamId:a,success:!0})},function(e){u.postMessage({sourceName:r,targetName:n,stream:s.PULL_COMPLETE,streamId:a,reason:i(e)})});break;case s.ENQUEUE:if((0,o.assert)(this.streamControllers[a],"enqueue should have stream controller"),this.streamControllers[a].isClosed)break;this.streamControllers[a].controller.enqueue(e.chunk);break;case s.CLOSE:if((0,o.assert)(this.streamControllers[a],"close should have stream controller"),this.streamControllers[a].isClosed)break;this.streamControllers[a].isClosed=!0,this.streamControllers[a].controller.close(),c();break;case s.ERROR:(0,o.assert)(this.streamControllers[a],"error should have stream controller"),this.streamControllers[a].controller.error(i(e.reason)),c();break;case s.CANCEL_COMPLETE:e.success?this.streamControllers[a].cancelCall.resolve():this.streamControllers[a].cancelCall.reject(i(e.reason)),c();break;case s.CANCEL:if(!this.streamSinks[a])break;var h=this.streamSinks[e.streamId].onCancel;new Promise(function(t){t(h&&h(i(e.reason)))}).then(function(){u.postMessage({sourceName:r,targetName:n,stream:s.CANCEL_COMPLETE,streamId:a,success:!0})},function(e){u.postMessage({sourceName:r,targetName:n,stream:s.CANCEL_COMPLETE,streamId:a,reason:i(e)})}),this.streamSinks[a].sinkCapability.reject(i(e.reason)),this.streamSinks[a].isCancelled=!0,delete this.streamSinks[a];break;default:throw new Error("Unexpected stream case")}},postMessage:function(e,t){t&&this.postMessageTransfers?this.comObj.postMessage(e,t):this.comObj.postMessage(e)},destroy:function(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r\\376\\377([^<]+)/g,function(e,t){for(var r=t.replace(/\\([0-3])([0-7])([0-7])/g,function(e,t,r,n){return String.fromCharCode(64*t+8*r+1*n)}).replace(/&(amp|apos|gt|lt|quot);/g,function(e,t){switch(t){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error("_repair: ".concat(t," isn't defined."))}),n="",i=0,a=r.length;i=32&&o<127&&60!==o&&62!==o&&38!==o?String.fromCharCode(o):"&#x"+(65536+o).toString(16).substring(1)+";"}return">"+n})}},{key:"_parse",value:function(e){var t=e.documentElement;if("rdf:rdf"!==t.nodeName.toLowerCase())for(t=t.firstChild;t&&"rdf:rdf"!==t.nodeName.toLowerCase();)t=t.nextSibling;var r=t?t.nodeName.toLowerCase():null;if(t&&"rdf:rdf"===r&&t.hasChildNodes())for(var n=t.childNodes,i=0,a=n.length;i";case"amp":return"&";case"quot":return'"'}return t.onResolveEntity(r)})}},{key:"_parseContent",value:function(e,t){function r(){for(;i"!==e[i]&&"/"!==e[i];)++i;for(n=e.substring(t,i),r();i"!==e[i]&&"/"!==e[i]&&"?"!==e[i];){r();for(var o="",s="";i"!==e[a]&&"/"!==e[a];)++a;n=e.substring(t,a),r();for(var o=a;a"!==e[a+1]);)++a;return i=e.substring(o,a),{name:n,value:i,parsed:a-t}}},{key:"parseXml",value:function(e){for(var t=0;t",n),a<0)return void this.onError(_.UnterminatedElement);this.onEndElement(e.substring(n,a)),n=a+1;break;case"?":++n;var o=this._parseProcessingInstruction(e,n);if("?>"!==e.substring(n+o.parsed,n+o.parsed+2))return void this.onError(_.UnterminatedXmlDeclaration);this.onPi(o.name,o.value),n+=o.parsed+2;break;case"!":if("--"===e.substring(n+1,n+3)){if(a=e.indexOf("-->",n+3),a<0)return void this.onError(_.UnterminatedComment);this.onComment(e.substring(n+3,a)),n=a+3}else if("[CDATA["===e.substring(n+1,n+8)){if(a=e.indexOf("]]>",n+8),a<0)return void this.onError(_.UnterminatedCdat);this.onCdata(e.substring(n+8,a)),n=a+3}else{if("DOCTYPE"!==e.substring(n+1,n+8))return void this.onError(_.MalformedElement);var s=e.indexOf("[",n+8),u=!1;if(a=e.indexOf(">",n+8),a<0)return void this.onError(_.UnterminatedDoctypeDeclaration);if(s>0&&a>s){if(a=e.indexOf("]>",n+8),a<0)return void this.onError(_.UnterminatedDoctypeDeclaration);u=!0}var c=e.substring(n+8,a+(u?1:0));this.onDoctype(c),n=a+(u?2:1)}break;default:var l=this._parseContent(e,n);if(null===l)return void this.onError(_.MalformedElement);var h=!1;if("/>"===e.substring(n+l.parsed,n+l.parsed+2))h=!0;else if(">"!==e.substring(n+l.parsed,n+l.parsed+1))return void this.onError(_.UnterminatedElement);this.onBeginElement(l.name,l.attributes,h),n+=l.parsed+(h?2:1)}}else{for(;n0}},{key:"firstChild",get:function(){return this.childNodes&&this.childNodes[0]}},{key:"nextSibling",get:function(){var e=this.parentNode.childNodes;if(e){var t=e.indexOf(this);if(t!==-1)return e[t+1]}}},{key:"textContent",get:function(){return this.childNodes?this.childNodes.map(function(e){return e.textContent}).join(""):this.nodeValue||""}}]),e}(),w=function(e){function t(){var e;return v(this,t),e=u(this,f(t).call(this)),e._currentFragment=null,e._stack=null,e._errorCode=_.NoError,e}return d(t,e),m(t,[{key:"parseFromString",value:function(e){if(this._currentFragment=[],this._stack=[],this._errorCode=_.NoError,this.parseXml(e),this._errorCode===_.NoError){var t=i(this._currentFragment,1),r=t[0];if(r)return{documentElement:r}}}},{key:"onResolveEntity",value:function(e){switch(e){case"apos":return"'"}return l(f(t.prototype),"onResolveEntity",this).call(this,e)}},{key:"onText",value:function(e){if(!b(e)){var t=new S("#text",e);this._currentFragment.push(t)}}},{key:"onCdata",value:function(e){var t=new S("#text",e);this._currentFragment.push(t)}},{key:"onBeginElement",value:function(e,t,r){var n=new S(e);n.childNodes=[],this._currentFragment.push(n),r||(this._stack.push(this._currentFragment),this._currentFragment=n.childNodes)}},{key:"onEndElement",value:function(e){this._currentFragment=this._stack.pop()||[];var t=this._currentFragment[this._currentFragment.length-1];if(t)for(var r=0,n=t.childNodes.length;r0){var a=new Uint8Array(i).buffer;this._queuedChunks.push(a)}this._pdfDataRangeTransport=r,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._contentLength=t.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(function(e,t){n._onReceiveData({begin:e,chunk:t})}),this._pdfDataRangeTransport.addProgressListener(function(e,t){n._onProgress({loaded:e,total:t})}),this._pdfDataRangeTransport.addProgressiveReadListener(function(e){n._onReceiveData({chunk:e})}),this._pdfDataRangeTransport.addProgressiveDoneListener(function(){n._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}return u(e,[{key:"_onReceiveData",value:function(e){var t=new Uint8Array(e.chunk).buffer;if(void 0===e.begin)this._fullRequestReader?this._fullRequestReader._enqueue(t):this._queuedChunks.push(t);else{var r=this._rangeReaders.some(function(r){return r._begin===e.begin&&(r._enqueue(t),!0)});(0,l.assert)(r)}}},{key:"_onProgress",value:function(e){if(void 0===e.total){var t=this._rangeReaders[0];t&&t.onProgress&&t.onProgress({loaded:e.loaded})}else{var r=this._fullRequestReader;r&&r.onProgress&&r.onProgress({loaded:e.loaded,total:e.total})}}},{key:"_onProgressiveDone",value:function(){this._fullRequestReader&&this._fullRequestReader.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,l.assert)(!this._fullRequestReader);var e=this._queuedChunks;return this._queuedChunks=null,new f(this,e,this._progressiveDone)}},{key:"getRangeReader",value:function(e,t){if(t<=this._progressiveDataLength)return null;var r=new d(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(r),r}},{key:"cancelAllRequests",value:function(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);var t=this._rangeReaders.slice(0);t.forEach(function(t){t.cancel(e)}),this._pdfDataRangeTransport.abort()}},{key:"_progressiveDataLength",get:function(){return this._fullRequestReader?this._fullRequestReader._loaded:0}}]),e}();t.PDFDataTransportStream=h;var f=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o(this,e),this._stream=t,this._done=n||!1,this._filename=null,this._queuedChunks=r||[],this._loaded=0;var i=!0,a=!1,s=void 0;try{for(var u,c=this._queuedChunks[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var l=u.value;this._loaded+=l.byteLength}}catch(h){a=!0,s=h}finally{try{i||null==c["return"]||c["return"]()}finally{if(a)throw s}}this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}return u(e,[{key:"_enqueue",value:function(e){if(!this._done){if(this._requests.length>0){var t=this._requests.shift();t.resolve({value:e,done:!1})}else this._queuedChunks.push(e);this._loaded+=e.byteLength}}},{key:"read",value:function(){function e(){return t.apply(this,arguments)}var t=a(c["default"].mark(function r(){var e,t;return c["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(this._queuedChunks.length>0)){r.next=3;break}return e=this._queuedChunks.shift(),r.abrupt("return",{value:e,done:!1});case 3:if(!this._done){r.next=5;break}return r.abrupt("return",{value:void 0,done:!0});case 5:return t=(0,l.createPromiseCapability)(),this._requests.push(t),r.abrupt("return",t.promise);case 8:case"end":return r.stop()}},r,this)}));return e}()},{key:"cancel",value:function(e){this._done=!0,this._requests.forEach(function(e){e.resolve({value:void 0,done:!0})}),this._requests=[]}},{key:"progressiveDone",value:function(){this._done||(this._done=!0)}},{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}}]),e}(),d=function(){function e(t,r,n){o(this,e),this._stream=t,this._begin=r,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}return u(e,[{key:"_enqueue",value:function(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{var t=this._requests.shift();t.resolve({value:e,done:!1}),this._requests.forEach(function(e){e.resolve({value:void 0,done:!0})}),this._requests=[]}this._done=!0,this._stream._removeRangeReader(this)}}},{key:"read",value:function(){function e(){return t.apply(this,arguments)}var t=a(c["default"].mark(function r(){var e,t;return c["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!this._queuedChunk){r.next=4;break}return e=this._queuedChunk,this._queuedChunk=null,r.abrupt("return",{value:e,done:!1});case 4:if(!this._done){r.next=6;break}return r.abrupt("return",{value:void 0,done:!0});case 6:return t=(0,l.createPromiseCapability)(),this._requests.push(t),r.abrupt("return",t.promise);case 9:case"end":return r.stop()}},r,this)}));return e}()},{key:"cancel",value:function(e){this._done=!0,this._requests.forEach(function(e){e.resolve({value:void 0,done:!0})}),this._requests=[],this._stream._removeRangeReader(this)}},{key:"isStreamingSupported",get:function(){return!1}}]),e}()},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r1&&(c.vertical?o.canvasWidth=r.height*t._viewport.scale:o.canvasWidth=r.width*t._viewport.scale),t._textDivProperties.set(a,o),t._textContentStream&&t._layoutText(a),t._enhanceTextSelection){var p=1,v=0;0!==u&&(p=Math.cos(u),v=Math.sin(u));var g,m,y=(c.vertical?r.height:r.width)*t._viewport.scale,b=l;0!==u?(g=[p,v,-v,p,f,d],m=i.Util.getAxialAlignedBoundingBox([0,0,y,b],g)):m=[f,d,f+y,d+b],t._bounds.push({left:m[0],top:m[1],right:m[2],bottom:m[3],div:a,size:[y,b],m:g})}}function r(e){if(!e._canceled){var t=e._textDivs,r=e._capability,n=t.length;if(n>l)return e._renderingDone=!0,void r.resolve();if(!e._textContentStream)for(var i=0;i0&&(n=n?Math.min(a,n):a)}return n},m=1+Math.min(Math.abs(f),Math.abs(d));u.paddingLeft=g(v,32,16)/m,u.paddingTop=g(v,48,16)/m,u.paddingRight=g(v,0,16)/m,u.paddingBottom=g(v,16,16)/m,e._textDivProperties.set(s,u)}else u.paddingLeft=t[a].left-n[a].left,u.paddingTop=t[a].top-n[a].top,u.paddingRight=n[a].right-t[a].right,u.paddingBottom=n[a].bottom-t[a].bottom,e._textDivProperties.set(s,u)}}function o(e,t,r){var n=r.map(function(e,t){return{x1:e.left,y1:e.top,x2:e.right,y2:e.bottom,index:t,x1New:void 0,x2New:void 0}});s(e,n);var i=new Array(r.length);return n.forEach(function(e){var t=e.index;i[t]={left:e.x1New,top:0,right:e.x2New,bottom:0}}),r.map(function(t,r){var a=i[r],o=n[r];o.x1=t.top,o.y1=e-a.right,o.x2=t.bottom,o.y2=e-a.left,o.index=r,o.x1New=void 0,o.x2New=void 0}),s(t,n),n.forEach(function(e){var t=e.index;i[t].top=e.x1New,i[t].bottom=e.x2New}),i}function s(e,t){t.sort(function(e,t){return e.x1-t.x1||e.index-t.index});var r={x1:-(1/0),y1:-(1/0),x2:0,y2:1/0,index:-1,x1New:0,x2New:0},n=[{start:-(1/0),end:1/0,boundary:r}];t.forEach(function(e){for(var t=0;t=0&&n[r].start>=e.y2;)r--;var i,a,o,s,u=-(1/0);for(o=t;o<=r;o++){i=n[o],a=i.boundary;var c;c=a.x2>e.x1?a.index>e.index?a.x1New:e.x1:void 0===a.x2New?(a.x2+e.x1)/2:a.x2New,c>u&&(u=c)}for(e.x1New=u,o=t;o<=r;o++)i=n[o],a=i.boundary,void 0===a.x2New?a.x2>e.x1?a.index>e.index&&(a.x2New=a.x2):a.x2New=u:a.x2New>u&&(a.x2New=Math.max(u,a.x2));var l=[],h=null;for(o=t;o<=r;o++){i=n[o],a=i.boundary;var f=a.x2>e.x2?a:e;h===f?l[l.length-1].end=i.end:(l.push({start:i.start,end:i.end,boundary:f}),h=f)}for(n[t].start=0&&n[s].start>=a.y1;s--)d=n[s].boundary===a;for(s=r+1;!d&&s0&&(t.scale=t.canvasWidth/s,r="scaleX(".concat(t.scale,")"))}0!==t.angle&&(r="rotate(".concat(t.angle,"deg) ").concat(r)),r.length>0&&(this._enhanceTextSelection&&(t.originalTransform=r),e.style.transform=r),this._textDivProperties.set(e,t),this._container.appendChild(e)}},_render:function(e){var t=this,n=(0,i.createPromiseCapability)(),a=Object.create(null),o=document.createElement("canvas");if(o.mozOpaque=!0,this._layoutTextCtx=o.getContext("2d",{alpha:!1}),this._textContent){var s=this._textContent.items,u=this._textContent.styles;this._processItems(s,u),n.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');var c=function l(){t._reader.read().then(function(e){var r=e.value,i=e.done;return i?void n.resolve():(Object.assign(a,r.styles),t._processItems(r.items,a),void l())},n.reject)};this._reader=this._textContentStream.getReader(),c()}n.promise.then(function(){a=null,e?t._renderTimer=setTimeout(function(){r(t),t._renderTimer=null},e):r(t)},this._capability.reject)},expandTextDivs:function(e){if(this._enhanceTextSelection&&this._renderingDone){null!==this._bounds&&(n(this),this._bounds=null);for(var t="0 0 0 0",r=[],i=[],a=0,o=this._textDivs.length;a0?(i.push("".concat(u.paddingTop,"px")),r.push("translateY(".concat(-u.paddingTop,"px)"))):i.push(0),u.paddingRight>0?i.push("".concat(u.paddingRight/u.scale,"px")):i.push(0),u.paddingBottom>0?i.push("".concat(u.paddingBottom,"px")):i.push(0),u.paddingLeft>0?(i.push("".concat(u.paddingLeft/u.scale,"px")),r.push("translateX(".concat(-u.paddingLeft/u.scale,"px)"))):i.push(0);var c=i.join(" ");c!==t&&(s.style.padding=c),r.length&&(s.style.transform=r.join(" "))}else s.style.padding=null,s.style.transform=u.originalTransform}}}},c}();t.renderTextLayer=o},function(e,t,r){"use strict";function n(e,t,r){return(n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=i(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(r):a.value}})(e,t,r||e)}function i(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=u(e),null!==e););return e}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];h(this,e),this.isRenderable=r,this.data=t.data,this.layer=t.layer,this.page=t.page,this.viewport=t.viewport,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderInteractiveForms=t.renderInteractiveForms,this.svgFactory=t.svgFactory,r&&(this.container=this._createContainer(n))}return d(e,[{key:"_createContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.data,r=this.page,n=this.viewport,i=document.createElement("section"),a=t.rect[2]-t.rect[0],o=t.rect[3]-t.rect[1];i.setAttribute("data-annotation-id",t.id);var s=v.Util.normalizeRect([t.rect[0],r.view[3]-t.rect[1]+r.view[1],t.rect[2],r.view[3]-t.rect[3]+r.view[1]]);if(i.style.transform="matrix(".concat(n.transform.join(","),")"),i.style.transformOrigin="-".concat(s[0],"px -").concat(s[1],"px"),!e&&t.borderStyle.width>0){i.style.borderWidth="".concat(t.borderStyle.width,"px"),t.borderStyle.style!==v.AnnotationBorderStyleType.UNDERLINE&&(a-=2*t.borderStyle.width,o-=2*t.borderStyle.width);var u=t.borderStyle.horizontalCornerRadius,c=t.borderStyle.verticalCornerRadius;if(u>0||c>0){var l="".concat(u,"px / ").concat(c,"px");i.style.borderRadius=l}switch(t.borderStyle.style){case v.AnnotationBorderStyleType.SOLID:i.style.borderStyle="solid";break;case v.AnnotationBorderStyleType.DASHED:i.style.borderStyle="dashed";break;case v.AnnotationBorderStyleType.BEVELED:(0,v.warn)("Unimplemented border style: beveled");break;case v.AnnotationBorderStyleType.INSET:(0,v.warn)("Unimplemented border style: inset");break;case v.AnnotationBorderStyleType.UNDERLINE:i.style.borderBottomStyle="solid"}t.color?i.style.borderColor=v.Util.makeCssRgb(0|t.color[0],0|t.color[1],0|t.color[2]):i.style.borderWidth=0}return i.style.left="".concat(s[0],"px"),i.style.top="".concat(s[1],"px"),i.style.width="".concat(a,"px"),i.style.height="".concat(o,"px"),i}},{key:"_createPopup",value:function(e,t,r){t||(t=document.createElement("div"),t.style.height=e.style.height,t.style.width=e.style.width,e.appendChild(t));var n=new P({container:e,trigger:t,color:r.color,title:r.title,modificationDate:r.modificationDate,contents:r.contents,hideWrapper:!0}),i=n.render();i.style.left=e.style.width,e.appendChild(i)}},{key:"render",value:function(){(0,v.unreachable)("Abstract method `AnnotationElement.render` called")}}]),e}(),y=function(e){function t(e){h(this,t);var r=!!(e.data.url||e.data.dest||e.data.action);return o(this,u(t).call(this,e,r))}return c(t,e),d(t,[{key:"render",value:function(){this.container.className="linkAnnotation";var e=this.data,t=this.linkService,r=document.createElement("a");return e.url?(0,p.addLinkAttributes)(r,{url:e.url,target:e.newWindow?p.LinkTarget.BLANK:t.externalLinkTarget,rel:t.externalLinkRel,enabled:t.externalLinkEnabled}):e.action?this._bindNamedAction(r,e.action):this._bindLink(r,e.dest),this.container.appendChild(r),this.container}},{key:"_bindLink",value:function(e,t){var r=this;e.href=this.linkService.getDestinationHash(t),e.onclick=function(){return t&&r.linkService.navigateTo(t),!1},t&&(e.className="internalLink")}},{key:"_bindNamedAction",value:function(e,t){var r=this;e.href=this.linkService.getAnchorUrl(""),e.onclick=function(){return r.linkService.executeNamedAction(t),!1},e.className="internalLink"}}]),t}(m),b=function(e){function t(e){h(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,u(t).call(this,e,r))}return c(t,e),d(t,[{key:"render",value:function(){this.container.className="textAnnotation";var e=document.createElement("img");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,e,this.data),this.container.appendChild(e),this.container}}]),t}(m),_=function(e){function t(){return h(this,t),o(this,u(t).apply(this,arguments))}return c(t,e),d(t,[{key:"render",value:function(){return this.container}}]),t}(m),A=function(e){function t(e){h(this,t);var r=e.renderInteractiveForms||!e.data.hasAppearance&&!!e.data.fieldValue;return o(this,u(t).call(this,e,r))}return c(t,e),d(t,[{key:"render",value:function(){var e=["left","center","right"];this.container.className="textWidgetAnnotation";var t=null;if(this.renderInteractiveForms){if(this.data.multiLine?(t=document.createElement("textarea"),t.textContent=this.data.fieldValue):(t=document.createElement("input"),t.type="text",t.setAttribute("value",this.data.fieldValue)),t.disabled=this.data.readOnly,null!==this.data.maxLen&&(t.maxLength=this.data.maxLen),this.data.comb){var r=this.data.rect[2]-this.data.rect[0],n=r/this.data.maxLen;t.classList.add("comb"),t.style.letterSpacing="calc(".concat(n,"px - 1ch)")}}else{t=document.createElement("div"),t.textContent=this.data.fieldValue,t.style.verticalAlign="middle",t.style.display="table-cell";var i=null;this.data.fontRefName&&this.page.commonObjs.has(this.data.fontRefName)&&(i=this.page.commonObjs.get(this.data.fontRefName)),this._setTextStyle(t,i)}return null!==this.data.textAlignment&&(t.style.textAlign=e[this.data.textAlignment]),this.container.appendChild(t),this.container}},{key:"_setTextStyle",value:function(e,t){var r=e.style;if(r.fontSize="".concat(this.data.fontSize,"px"),r.direction=this.data.fontDirection<0?"rtl":"ltr",t){r.fontWeight=t.black?t.bold?"900":"bold":t.bold?"bold":"normal",r.fontStyle=t.italic?"italic":"normal";var n=t.loadedName?'"'.concat(t.loadedName,'", '):"",i=t.fallbackName||"Helvetica, sans-serif";r.fontFamily=n+i}}}]),t}(_),S=function(e){function t(e){return h(this,t),o(this,u(t).call(this,e,e.renderInteractiveForms))}return c(t,e),d(t,[{key:"render",value:function(){this.container.className="buttonWidgetAnnotation checkBox";var e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="checkbox",this.data.fieldValue&&"Off"!==this.data.fieldValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}]),t}(_),w=function(e){function t(e){return h(this,t),o(this,u(t).call(this,e,e.renderInteractiveForms))}return c(t,e),d(t,[{key:"render",value:function(){this.container.className="buttonWidgetAnnotation radioButton";var e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="radio",e.name=this.data.fieldName,this.data.fieldValue===this.data.buttonValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}]),t}(_),k=function(e){function t(){return h(this,t),o(this,u(t).apply(this,arguments))}return c(t,e),d(t,[{key:"render",value:function(){var e=n(u(t.prototype),"render",this).call(this);return e.className="buttonWidgetAnnotation pushButton",e}}]),t}(y),x=function(e){function t(e){return h(this,t),o(this,u(t).call(this,e,e.renderInteractiveForms))}return c(t,e),d(t,[{key:"render",value:function(){this.container.className="choiceWidgetAnnotation";var e=document.createElement("select");e.disabled=this.data.readOnly,this.data.combo||(e.size=this.data.options.length,this.data.multiSelect&&(e.multiple=!0));var t=!0,r=!1,n=void 0;try{for(var i,a=this.data.options[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=document.createElement("option");s.textContent=o.displayValue,s.value=o.exportValue,this.data.fieldValue.includes(o.displayValue)&&s.setAttribute("selected",!0),e.appendChild(s)}}catch(u){r=!0,n=u}finally{try{t||null==a["return"]||a["return"]()}finally{if(r)throw n}}return this.container.appendChild(e),this.container}}]),t}(_),C=function(e){function t(e){h(this,t);var r=!(!e.data.title&&!e.data.contents);return o(this,u(t).call(this,e,r))}return c(t,e),d(t,[{key:"render",value:function(){var e=["Line","Square","Circle","PolyLine","Polygon","Ink"];if(this.container.className="popupAnnotation",e.includes(this.data.parentType))return this.container;var t='[data-annotation-id="'.concat(this.data.parentId,'"]'),r=this.layer.querySelector(t);if(!r)return this.container;var n=new P({container:this.container,trigger:r,color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),i=parseFloat(r.style.left),a=parseFloat(r.style.width);return this.container.style.transformOrigin="-".concat(i+a,"px -").concat(r.style.top),this.container.style.left="".concat(i+a,"px"),this.container.appendChild(n.render()),this.container}}]),t}(m),P=function(){function e(t){h(this,e),this.container=t.container,this.trigger=t.trigger,this.color=t.color,this.title=t.title,this.modificationDate=t.modificationDate,this.contents=t.contents,this.hideWrapper=t.hideWrapper||!1,this.pinned=!1}return d(e,[{key:"render",value:function(){var e=.7,t=document.createElement("div");t.className="popupWrapper",this.hideElement=this.hideWrapper?t:this.container,this.hideElement.setAttribute("hidden",!0);var r=document.createElement("div");r.className="popup";var n=this.color;if(n){var i=e*(255-n[0])+n[0],a=e*(255-n[1])+n[1],o=e*(255-n[2])+n[2];r.style.backgroundColor=v.Util.makeCssRgb(0|i,0|a,0|o)}var s=document.createElement("h1");s.textContent=this.title,r.appendChild(s);var u=p.PDFDateString.toDateObject(this.modificationDate);if(u){var c=document.createElement("span");c.textContent="{{date}}, {{time}}",c.dataset.l10nId="annotation_date_string",c.dataset.l10nArgs=JSON.stringify({date:u.toLocaleDateString(),time:u.toLocaleTimeString()}),r.appendChild(c)}var l=this._formatContents(this.contents);return r.appendChild(l),this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),r.addEventListener("click",this._hide.bind(this,!0)),t.appendChild(r),t}},{key:"_formatContents",value:function(e){for(var t=document.createElement("p"),r=e.split(/(?:\r\n?|\n)/),n=0,i=r.length;n0&&void 0!==arguments[0]&&arguments[0];e&&(this.pinned=!0),this.hideElement.hasAttribute("hidden")&&(this.hideElement.removeAttribute("hidden"),this.container.style.zIndex+=1)}},{key:"_hide",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e&&(this.pinned=!1),this.hideElement.hasAttribute("hidden")||this.pinned||(this.hideElement.setAttribute("hidden",!0),this.container.style.zIndex-=1)}}]),e}(),R=function(e){function t(e){h(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,u(t).call(this,e,r,!0))}return c(t,e),d(t,[{key:"render",value:function(){return this.container.className="freeTextAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),t}(m),E=function(e){function t(e){h(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,u(t).call(this,e,r,!0))}return c(t,e),d(t,[{key:"render",value:function(){this.container.className="lineAnnotation";var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),i=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width),i.setAttribute("stroke","transparent"),n.appendChild(i),this.container.append(n),this._createPopup(this.container,i,e),this.container}}]),t}(m),T=function(e){function t(e){h(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,u(t).call(this,e,r,!0))}return c(t,e),d(t,[{key:"render",value:function(){this.container.className="squareAnnotation";var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),i=e.borderStyle.width,a=this.svgFactory.createElement("svg:rect");return a.setAttribute("x",i/2),a.setAttribute("y",i/2),a.setAttribute("width",t-i),a.setAttribute("height",r-i),a.setAttribute("stroke-width",i),a.setAttribute("stroke","transparent"),a.setAttribute("fill","none"),n.appendChild(a),this.container.append(n),this._createPopup(this.container,a,e),this.container}}]),t}(m),O=function(e){function t(e){h(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,u(t).call(this,e,r,!0))}return c(t,e),d(t,[{key:"render",value:function(){this.container.className="circleAnnotation";var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),i=e.borderStyle.width,a=this.svgFactory.createElement("svg:ellipse");return a.setAttribute("cx",t/2),a.setAttribute("cy",r/2),a.setAttribute("rx",t/2-i/2),a.setAttribute("ry",r/2-i/2),a.setAttribute("stroke-width",i),a.setAttribute("stroke","transparent"),a.setAttribute("fill","none"),n.appendChild(a),this.container.append(n),this._createPopup(this.container,a,e),this.container}}]),t}(m),L=function(e){function t(e){var r;h(this,t);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return r=o(this,u(t).call(this,e,n,!0)),r.containerClassName="polylineAnnotation",r.svgElementName="svg:polyline",r}return c(t,e),d(t,[{key:"render",value:function(){this.container.className=this.containerClassName;var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),i=[],a=!0,o=!1,s=void 0;try{for(var u,c=e.vertices[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value,h=l.x-e.rect[0],f=e.rect[3]-l.y;i.push(h+","+f)}}catch(d){o=!0,s=d}finally{try{a||null==c["return"]||c["return"]()}finally{if(o)throw s}}i=i.join(" ");var p=this.svgFactory.createElement(this.svgElementName);return p.setAttribute("points",i),p.setAttribute("stroke-width",e.borderStyle.width),p.setAttribute("stroke","transparent"),p.setAttribute("fill","none"),n.appendChild(p),this.container.append(n),this._createPopup(this.container,p,e),this.container}}]),t}(m),F=function(e){function t(e){var r;return h(this,t),r=o(this,u(t).call(this,e)),r.containerClassName="polygonAnnotation",r.svgElementName="svg:polygon",r}return c(t,e),t}(L),I=function(e){function t(e){h(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,u(t).call(this,e,r,!0))}return c(t,e),d(t,[{key:"render",value:function(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),t}(m),j=function(e){function t(e){var r;h(this,t);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return r=o(this,u(t).call(this,e,n,!0)),r.containerClassName="inkAnnotation",r.svgElementName="svg:polyline",r}return c(t,e),d(t,[{key:"render",value:function(){this.container.className=this.containerClassName;var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),i=!0,a=!1,o=void 0;try{for(var s,u=e.inkLists[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value,l=[],h=!0,f=!1,d=void 0;try{for(var p,v=c[Symbol.iterator]();!(h=(p=v.next()).done);h=!0){var g=p.value,m=g.x-e.rect[0],y=e.rect[3]-g.y;l.push("".concat(m,",").concat(y))}}catch(b){f=!0,d=b}finally{try{h||null==v["return"]||v["return"]()}finally{if(f)throw d}}l=l.join(" ");var _=this.svgFactory.createElement(this.svgElementName);_.setAttribute("points",l),_.setAttribute("stroke-width",e.borderStyle.width),_.setAttribute("stroke","transparent"),_.setAttribute("fill","none"),this._createPopup(this.container,_,e),n.appendChild(_)}}catch(b){a=!0,o=b}finally{try{i||null==u["return"]||u["return"]()}finally{if(a)throw o}}return this.container.append(n),this.container}}]),t}(m),M=function(e){function t(e){h(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,u(t).call(this,e,r,!0))}return c(t,e),d(t,[{key:"render",value:function(){return this.container.className="highlightAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),t}(m),N=function(e){function t(e){h(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,u(t).call(this,e,r,!0))}return c(t,e),d(t,[{key:"render",value:function(){return this.container.className="underlineAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),t}(m),D=function(e){function t(e){h(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,u(t).call(this,e,r,!0))}return c(t,e),d(t,[{key:"render",value:function(){return this.container.className="squigglyAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),t}(m),q=function(e){function t(e){h(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,u(t).call(this,e,r,!0))}return c(t,e),d(t,[{key:"render",value:function(){return this.container.className="strikeoutAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),t}(m),U=function(e){function t(e){h(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,u(t).call(this,e,r,!0))}return c(t,e),d(t,[{key:"render",value:function(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),t}(m),W=function(e){function t(e){var r;h(this,t),r=o(this,u(t).call(this,e,!0));var n=r.data.file,i=n.filename,a=n.content;return r.filename=(0,p.getFilenameFromUrl)(i),r.content=a,r.linkService.eventBus&&r.linkService.eventBus.dispatch("fileattachmentannotation",{source:s(r),id:(0,v.stringToPDFString)(i),filename:i,content:a}),r}return c(t,e),d(t,[{key:"render",value:function(){this.container.className="fileAttachmentAnnotation";var e=document.createElement("div");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.addEventListener("dblclick",this._download.bind(this)),this.data.hasPopup||!this.data.title&&!this.data.contents||this._createPopup(this.container,e,this.data),this.container.appendChild(e),this.container}},{key:"_download",value:function(){return this.downloadManager?void this.downloadManager.downloadData(this.content,this.filename,""):void(0,v.warn)("Download cannot be started due to unavailable download manager")}}]),t}(m),B=function(){function e(){h(this,e)}return d(e,null,[{key:"render",value:function(e){var t=!0,r=!1,n=void 0;try{for(var i,a=e.annotations[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;if(o){var s=g.create({data:o,layer:e.div,page:e.page,viewport:e.viewport,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderInteractiveForms:e.renderInteractiveForms||!1,svgFactory:new p.DOMSVGFactory});s.isRenderable&&e.div.appendChild(s.render())}}}catch(u){r=!0,n=u}finally{try{t||null==a["return"]||a["return"]()}finally{if(r)throw n}}}},{key:"update",value:function(e){var t=!0,r=!1,n=void 0;try{for(var i,a=e.annotations[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=e.div.querySelector('[data-annotation-id="'.concat(o.id,'"]'));s&&(s.style.transform="matrix(".concat(e.viewport.transform.join(","),")"))}}catch(u){r=!0,n=u}finally{try{t||null==a["return"]||a["return"]()}finally{if(r)throw n}}e.div.removeAttribute("hidden")}}]),e}();t.AnnotationLayer=B},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){return s(e)||o(e)||a()}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function o(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function s(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t>>8^o}return n^-1}function t(t,r,n,i){var a=i,o=r.length;n[a]=o>>24&255,n[a+1]=o>>16&255,n[a+2]=o>>8&255,n[a+3]=255&o,a+=4,n[a]=255&t.charCodeAt(0),n[a+1]=255&t.charCodeAt(1),n[a+2]=255&t.charCodeAt(2),n[a+3]=255&t.charCodeAt(3),a+=4,n.set(r,a),a+=r.length;var s=e(n,i+4,a);n[a]=s>>24&255,n[a+1]=s>>16&255,n[a+2]=s>>8&255,n[a+3]=255&s}function r(e,t,r){for(var n=1,i=0,a=t;a=8?e:new Buffer(e);var r=require("zlib").deflateSync(t,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(n){(0,v.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+n)}return i(e)}function i(e){var t=e.length,n=65535,i=Math.ceil(t/n),a=new Uint8Array(2+t+5*i+4),o=0;a[o++]=120,a[o++]=156;for(var s=0;t>n;)a[o++]=0,a[o++]=255,a[o++]=255,a[o++]=0,a[o++]=0,a.set(e.subarray(s,s+n),o),o+=n,s+=n,t-=n;a[o++]=1,a[o++]=255&t,a[o++]=t>>8&255,a[o++]=65535&~t&255,a[o++]=(65535&~t)>>8&255,a.set(e.subarray(s),o),o+=e.length-s;var u=r(e,0,e.length);return a[o++]=u>>24&255,a[o++]=u>>16&255,a[o++]=u>>8&255,a[o++]=255&u,a}function a(e,r,i,a){var u,c,l,h=e.width,f=e.height,d=e.data;switch(r){case v.ImageKind.GRAYSCALE_1BPP:c=0,u=1,l=h+7>>3;break;case v.ImageKind.RGB_24BPP:c=2,u=8,l=3*h;break;case v.ImageKind.RGBA_32BPP:c=6,u=8,l=4*h;break;default:throw new Error("invalid format")}for(var p=new Uint8Array((1+l)*f),g=0,m=0,y=0;y>24&255,h>>16&255,h>>8&255,255&h,f>>24&255,f>>16&255,f>>8&255,255&f,u,c,0,0,0]),S=n(p),w=o.length+3*s+A.length+S.length,k=new Uint8Array(w),x=0;return k.set(o,x),x+=o.length,t("IHDR",A,k,x),x+=s+A.length,t("IDATA",S,k,x),x+=s+S.length,t("IEND",new Uint8Array(0),k,x),(0,v.createObjectURL)(k,"image/png",i)}for(var o=new Uint8Array([137,80,78,71,13,10,26,10]),s=12,u=new Int32Array(256),c=0;c<256;c++){for(var l=c,h=0;h<8;h++)l=1&l?3988292384^l>>1&2147483647:l>>1&2147483647;u[c]=l}return function(e,t,r){var n=void 0===e.kind?v.ImageKind.GRAYSCALE_1BPP:e.kind;return a(e,n,t,r)}}(),R=function(){function e(){f(this,e),this.fontSizeScale=1,this.fontWeight=S.fontWeight,this.fontSize=0,this.textMatrix=v.IDENTITY_MATRIX,this.fontMatrix=v.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=v.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.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}return p(e,[{key:"clone",value:function(){return Object.create(this)}},{key:"setCurrentPoint",value:function(e,t){this.x=e,this.y=t}}]),e}(),E=0,T=0,O=0;t.SVGGraphics=y=function(){function e(t,r,n){f(this,e),this.svgFactory=new g.DOMSVGFactory,this.current=new R,this.transformMatrix=v.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=t,this.objs=r,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!n,this._operatorIdMapping=[];for(var i in v.OPS)this._operatorIdMapping[v.OPS[i]]=i}return p(e,[{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,r=e.fnArray,n=e.argsArray,i=0,a=r.length;i0&&(this.current.lineWidth=e)}},{key:"setLineCap",value:function(e){this.current.lineCap=x[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,r){this.current.strokeColor=v.Util.makeCssRgb(e,t,r)}},{key:"setFillAlpha",value:function(e){this.current.fillAlpha=e}},{key:"setFillRGBColor",value:function(e,t,r){this.current.fillColor=v.Util.makeCssRgb(e,t,r),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[]}},{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.width,r=this.viewport.height,n=v.Util.inverseTransform(this.transformMatrix),i=v.Util.applyTransform([0,0],n),a=v.Util.applyTransform([0,r],n),o=v.Util.applyTransform([t,0],n),s=v.Util.applyTransform([t,r],n),u=Math.min(i[0],a[0],o[0],s[0]),c=Math.min(i[1],a[1],o[1],s[1]),l=Math.max(i[0],a[0],o[0],s[0]),h=Math.max(i[1],a[1],o[1],s[1]),f=this.svgFactory.createElement("svg:rect");f.setAttributeNS(null,"x",u),f.setAttributeNS(null,"y",c),f.setAttributeNS(null,"width",l-u),f.setAttributeNS(null,"height",h-c),f.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this._ensureTransformGroup().appendChild(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],r=e[2],n=e[3]||v.IDENTITY_MATRIX,a=u(e[4],4),o=a[0],s=a[1],c=a[2],l=a[3],h=e[5],f=e[6],d=e[7],p="shading".concat(O++),g=v.Util.applyTransform([o,s],n),m=u(g,2),y=m[0],b=m[1],_=v.Util.applyTransform([c,l],n),A=u(_,2),S=A[0],w=A[1],k=v.Util.singularValueDecompose2dScale(n),x=u(k,2),C=x[0],P=x[1],R=h*C,E=f*P,T=this.svgFactory.createElement("svg:pattern");T.setAttributeNS(null,"id",p),T.setAttributeNS(null,"patternUnits","userSpaceOnUse"),T.setAttributeNS(null,"width",R),T.setAttributeNS(null,"height",E),T.setAttributeNS(null,"x","".concat(y)),T.setAttributeNS(null,"y","".concat(b));var L=this.svg,F=this.transformMatrix,I=this.current.fillColor,j=this.current.strokeColor,M=this.svgFactory.create(S-y,w-b);if(this.svg=M,this.transformMatrix=n,2===d){var N=v.Util.makeCssRgb.apply(v.Util,i(t));this.current.fillColor=N,this.current.strokeColor=N}return this.executeOpTree(this.convertOpList(r)),this.svg=L,this.transformMatrix=F,this.current.fillColor=I,this.current.strokeColor=j,T.appendChild(M.childNodes[0]),this.defs.appendChild(T),"url(#".concat(p,")")}},{key:"_makeShadingPattern",value:function(e){switch(e[0]){case"RadialAxial":var t,r="shading".concat(O++),n=e[2];switch(e[1]){case"axial":var i=e[3],a=e[4];t=this.svgFactory.createElement("svg:linearGradient"),t.setAttributeNS(null,"id",r),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"x1",i[0]),t.setAttributeNS(null,"y1",i[1]),t.setAttributeNS(null,"x2",a[0]),t.setAttributeNS(null,"y2",a[1]);break;case"radial":var o=e[3],s=e[4],u=e[5],c=e[6];t=this.svgFactory.createElement("svg:radialGradient"),t.setAttributeNS(null,"id",r),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"cx",s[0]),t.setAttributeNS(null,"cy",s[1]),t.setAttributeNS(null,"r",c),t.setAttributeNS(null,"fx",o[0]),t.setAttributeNS(null,"fy",o[1]),t.setAttributeNS(null,"fr",u);break;default:throw new Error("Unknown RadialAxial type: ".concat(e[1]))}var l=!0,h=!1,f=void 0;try{for(var d,p=n[Symbol.iterator]();!(l=(d=p.next()).done);l=!0){var g=d.value,m=this.svgFactory.createElement("svg:stop");m.setAttributeNS(null,"offset",g[0]),m.setAttributeNS(null,"stop-color",g[1]),t.appendChild(m)}}catch(y){h=!0,f=y}finally{try{l||null==p["return"]||p["return"]()}finally{if(h)throw f}}return this.defs.appendChild(t),"url(#".concat(r,")");case"Mesh":return(0,v.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 r=this.current,n=r.x,i=r.y,a=[],o=0,s=!0,u=!1,c=void 0;try{for(var l,h=e[Symbol.iterator]();!(s=(l=h.next()).done);s=!0){var f=l.value;switch(0|f){case v.OPS.rectangle:n=t[o++],i=t[o++];var d=t[o++],p=t[o++],g=n+d,m=i+p;a.push("M",_(n),_(i),"L",_(g),_(i),"L",_(g),_(m),"L",_(n),_(m),"Z");break;case v.OPS.moveTo:n=t[o++],i=t[o++],a.push("M",_(n),_(i));break;case v.OPS.lineTo:n=t[o++],i=t[o++],a.push("L",_(n),_(i));break;case v.OPS.curveTo:n=t[o+4],i=t[o+5],a.push("C",_(t[o]),_(t[o+1]),_(t[o+2]),_(t[o+3]),_(n),_(i)),o+=6;break;case v.OPS.curveTo2:n=t[o+2],i=t[o+3],a.push("C",_(n),_(i),_(t[o]),_(t[o+1]),_(t[o+2]),_(t[o+3])),o+=4;break;case v.OPS.curveTo3:n=t[o+2],i=t[o+3],a.push("C",_(t[o]),_(t[o+1]),_(n),_(i),_(n),_(i)),o+=4;break;case v.OPS.closePath:a.push("Z")}}}catch(y){u=!0,c=y}finally{try{s||null==h["return"]||h["return"]()}finally{if(u)throw c}}a=a.join(" "),r.path&&e.length>0&&e[0]!==v.OPS.rectangle&&e[0]!==v.OPS.moveTo?a=r.path.getAttributeNS(null,"d")+a:(r.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(r.path)),r.path.setAttributeNS(null,"d",a),r.path.setAttributeNS(null,"fill","none"),r.element=r.path,r.setCurrentPoint(n,i)}},{key:"endPath",value:function(){var e=this.current;if(e.path=null,this.pendingClip){if(!e.element)return void(this.pendingClip=null);var t="clippath".concat(E++),r=this.svgFactory.createElement("svg:clipPath");r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"transform",A(this.transformMatrix));var n=e.element.cloneNode(!0);"evenodd"===this.pendingClip?n.setAttributeNS(null,"clip-rule","evenodd"):n.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,r.appendChild(n),this.defs.appendChild(r),e.activeClipUrl&&(e.clipGroup=null,this.extraStack.forEach(function(e){e.clipGroup=null}),r.setAttributeNS(null,"clip-path",e.activeClipUrl)),e.activeClipUrl="url(#".concat(t,")"),this.tgrp=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=!0,r=!1,n=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=u(i.value,2),s=o[0],c=o[1];switch(s){case"LW":this.setLineWidth(c);break;case"LC":this.setLineCap(c);break;case"LJ":this.setLineJoin(c);break;case"ML":this.setMiterLimit(c);break;case"D":this.setDash(c[0],c[1]);break;case"RI":this.setRenderingIntent(c);break;case"FL":this.setFlatness(c);break;case"Font":this.setFont(c);break;case"CA":this.setStrokeAlpha(c);break;case"ca":this.setFillAlpha(c);break;default:(0,v.warn)("Unimplemented graphic state operator ".concat(s))}}}catch(l){r=!0,n=l}finally{try{t||null==a["return"]||a["return"]()}finally{if(r)throw n}}}},{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,r=this.current,n=r.dashArray;1!==t&&n.length>0&&(n=n.map(function(e){return t*e})),e.setAttributeNS(null,"stroke",r.strokeColor),e.setAttributeNS(null,"stroke-opacity",r.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",_(r.miterLimit)),e.setAttributeNS(null,"stroke-linecap",r.lineCap),e.setAttributeNS(null,"stroke-linejoin",r.lineJoin),e.setAttributeNS(null,"stroke-width",_(t*r.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",n.map(_).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",_(t*r.dashPhase)+"px")}},{key:"eoFill",value:function(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}},{key:"fillStroke",value:function(){this.stroke(),this.fill()}},{key:"eoFillStroke",value:function(){this.current.element&&this.current.element.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().appendChild(e)}},{key:"paintJpegXObject",value:function(e,t,r){var n=this.objs.get(e),i=this.svgFactory.createElement("svg:image");i.setAttributeNS(k,"xlink:href",n.src),i.setAttributeNS(null,"width",_(t)),i.setAttributeNS(null,"height",_(r)),i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y",_(-r)),i.setAttributeNS(null,"transform","scale(".concat(_(1/t)," ").concat(_(-1/r),")")),this._ensureTransformGroup().appendChild(i)}},{key:"paintImageXObject",value:function(e){var t=this.objs.get(e);return t?void this.paintInlineImageXObject(t):void(0,v.warn)("Dependent image with object ID ".concat(e," is not ready yet"))}},{key:"paintInlineImageXObject",value:function(e,t){var r=e.width,n=e.height,i=P(e,this.forceDataSchema,!!t),a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",_(r)),a.setAttributeNS(null,"height",_(n)),this.current.element=a,this.clip("nonzero");var o=this.svgFactory.createElement("svg:image");o.setAttributeNS(k,"xlink:href",i),o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y",_(-n)),o.setAttributeNS(null,"width",_(r)+"px"),o.setAttributeNS(null,"height",_(n)+"px"),o.setAttributeNS(null,"transform","scale(".concat(_(1/r)," ").concat(_(-1/n),")")),t?t.appendChild(o):this._ensureTransformGroup().appendChild(o)}},{key:"paintImageMaskXObject",value:function(e){var t=this.current,r=e.width,n=e.height,i=t.fillColor;t.maskId="mask".concat(T++);var a=this.svgFactory.createElement("svg:mask");a.setAttributeNS(null,"id",t.maskId);var o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",_(r)),o.setAttributeNS(null,"height",_(n)),o.setAttributeNS(null,"fill",i),o.setAttributeNS(null,"mask","url(#".concat(t.maskId,")")),this.defs.appendChild(a),this._ensureTransformGroup().appendChild(o),this.paintInlineImageXObject(e,a)}},{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 r=t[2]-t[0],n=t[3]-t[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",t[0]),i.setAttributeNS(null,"y",t[1]),i.setAttributeNS(null,"width",_(r)),i.setAttributeNS(null,"height",_(n)),this.current.element=i,this.clip("nonzero"),this.endPath()}}},{key:"paintFormXObjectEnd",value:function(){}},{key:"_initialize",value:function(e){var t=this.svgFactory.create(e.width,e.height),r=this.svgFactory.createElement("svg:defs");t.appendChild(r),this.defs=r;var n=this.svgFactory.createElement("svg:g");return n.setAttributeNS(null,"transform",A(e.transform)),t.appendChild(n),this.svg=n,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.appendChild(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",A(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}]),e}()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?o(e):t}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,i)}function h(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){function a(e){l(s,n,i,a,o,"next",e)}function o(e){l(s,n,i,a,o,"throw",e)}var s=e.apply(t,r);a(void 0)})}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r0,"Range chunk size must be larger than zero");var a={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(t("Content-Length"),10);if(!Number.isInteger(o))return a;if(a.suggestedLength=o,o<=2*n)return a;if(i||!r)return a;if("bytes"!==t("Accept-Ranges"))return a;var u=t("Content-Encoding")||"identity";return"identity"!==u?a:(a.allowRangeRequests=!0,a)}function i(e){var t=e("Content-Disposition");if(t){var r=(0,u.getFilenameFromContentDispositionHeader)(t);if(r.includes("%"))try{r=decodeURIComponent(r)}catch(n){}if(/\.pdf$/i.test(r))return r}return null}function a(e,t){return 404===e||0===e&&/^file:/.test(t)?new s.MissingPDFException('Missing PDF "'+t+'".'):new s.UnexpectedResponseException("Unexpected server response ("+e+') while retrieving PDF "'+t+'".',e)}function o(e){return 200===e||206===e}Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=a,t.extractFilenameFromHeader=i,t.validateRangeRequestCapabilities=n,t.validateResponseStatus=o;var s=r(1),u=r(199)},function(e,t,r){"use strict";function n(e,t){return o(e)||a(e,t)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function a(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(u){i=!0,a=u}finally{try{n||null==s["return"]||s["return"]()}finally{if(i)throw a}}return r}}function o(e){if(Array.isArray(e))return e}function s(e){function t(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function r(e,t){if(e){if(!/^[\x00-\xFF]+$/.test(t))return t;try{var r=new TextDecoder(e,{fatal:!0}),n=Array.from(t,function(e){return 255&e.charCodeAt(0)});t=r.decode(new Uint8Array(n)),c=!1}catch(i){if(/^utf-?8$/i.test(e))try{t=decodeURIComponent(escape(t)),c=!1}catch(a){}}}return t}function i(e){return c&&/[\x80-\xff]/.test(e)&&(e=r("utf-8",e),c&&(e=r("iso-8859-1",e))),e}function a(e){for(var r,i=[],a=t("filename\\*((?!0\\d)\\d+)(\\*?)","ig");null!==(r=a.exec(e));){var u=r,c=n(u,4),l=c[1],h=c[2],f=c[3];if(l=parseInt(l,10),l in i){if(0===l)break}else i[l]=[h,f]}for(var d=[],l=0;l=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),4===n.readyState&&e in this.pendingRequests){if(delete this.pendingRequests[e],0===n.status&&this.isHttp)return void(r.onError&&r.onError(n.status));var i=n.status||d,a=i===d&&r.expectedStatus===p;if(!a&&i!==r.expectedStatus)return void(r.onError&&r.onError(n.status));var o=c(n);if(i===p){var s=n.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(s);r.onDone({begin:parseInt(u[1],10),chunk:o})}else o?r.onDone({begin:0,chunk:o}):r.onError&&r.onError(n.status)}}}},{key:"hasPendingRequests",value:function(){for(var e in this.pendingRequests)return!0;return!1}},{key:"getRequestXhr",value:function(e){return this.pendingRequests[e].xhr}},{key:"isPendingRequest",value:function(e){return e in this.pendingRequests}},{key:"abortAllRequests",value:function(){for(var e in this.pendingRequests)this.abortRequest(0|e)}},{key:"abortRequest",value:function(e){var t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}]),e}(),g=function(){function e(t){o(this,e),this._source=t,this._manager=new v(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}return u(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,h.assert)(!this._fullRequestReader),this._fullRequestReader=new m(this._manager,this._source),this._fullRequestReader}},{key:"getRangeReader",value:function(e,t){var r=new y(this._manager,e,t);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}},{key:"cancelAllRequests",value:function(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);var t=this._rangeRequestReaders.slice(0);t.forEach(function(t){t.cancel(e)})}}]),e}();t.PDFNetworkStream=g;var m=function(){function e(t,r){o(this,e),this._manager=t;var n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url,this._fullRequestId=t.requestFull(n),this._headersReceivedCapability=(0,h.createPromiseCapability)(),this._disableRange=r.disableRange||!1,this._contentLength=r.length,this._rangeChunkSize=r.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}return u(e,[{key:"_onHeadersReceived",value:function(){var e=this._fullRequestId,t=this._manager.getRequestXhr(e),r=function(e){return t.getResponseHeader(e)},n=(0,f.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),i=n.allowRangeRequests,a=n.suggestedLength;i&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=(0,f.extractFilenameFromHeader)(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}},{key:"_onDone",value:function(e){if(e)if(this._requests.length>0){var t=this._requests.shift();t.resolve({value:e.chunk,done:!1})}else this._cachedChunks.push(e.chunk);this._done=!0,this._cachedChunks.length>0||(this._requests.forEach(function(e){e.resolve({value:void 0,done:!0})}),this._requests=[])}},{key:"_onError",value:function(e){var t=this._url,r=(0,f.createResponseStatusError)(e,t);this._storedError=r,this._headersReceivedCapability.reject(r),this._requests.forEach(function(e){e.reject(r)}),this._requests=[],this._cachedChunks=[]}},{key:"_onProgress",value:function(e){this.onProgress&&this.onProgress({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}},{key:"read",value:function(){function e(){return t.apply(this,arguments)}var t=a(l["default"].mark(function r(){var e,t;return l["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!this._storedError){r.next=2;break}throw this._storedError;case 2:if(!(this._cachedChunks.length>0)){r.next=5;break}return e=this._cachedChunks.shift(),r.abrupt("return",{value:e,done:!1});case 5:if(!this._done){r.next=7;break}return r.abrupt("return",{value:void 0,done:!0});case 7:return t=(0,h.createPromiseCapability)(),this._requests.push(t),r.abrupt("return",t.promise);case 10:case"end":return r.stop()}},r,this)}));return e}()},{key:"cancel",value:function(e){this._done=!0,this._headersReceivedCapability.reject(e),this._requests.forEach(function(e){e.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}},{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}}]),e}(),y=function(){function e(t,r,n){o(this,e),this._manager=t;var i={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=t.requestRange(r,n,i),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}return u(e,[{key:"_close",value:function(){this.onClosed&&this.onClosed(this)}},{key:"_onDone",value:function(e){var t=e.chunk;if(this._requests.length>0){var r=this._requests.shift();r.resolve({value:t,done:!1})}else this._queuedChunk=t;this._done=!0,this._requests.forEach(function(e){e.resolve({value:void 0,done:!0})}),this._requests=[],this._close()}},{key:"_onProgress",value:function(e){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:e.loaded})}},{key:"read",value:function(){function e(){return t.apply(this,arguments)}var t=a(l["default"].mark(function r(){var e,t;return l["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(null===this._queuedChunk){r.next=4;break}return e=this._queuedChunk,this._queuedChunk=null,r.abrupt("return",{value:e,done:!1});case 4:if(!this._done){r.next=6;break}return r.abrupt("return",{value:void 0,done:!0});case 6:return t=(0,h.createPromiseCapability)(),this._requests.push(t),r.abrupt("return",t.promise);case 9:case"end":return r.stop()}},r,this)}));return e}()},{key:"cancel",value:function(e){this._done=!0,this._requests.forEach(function(e){e.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}},{key:"isStreamingSupported",get:function(){return!1}}]),e}()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){function o(e){i(u,n,a,o,s,"next",e)}function s(e){i(u,n,a,o,s,"throw",e)}var u=e.apply(t,r);o(void 0)})}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),e}function c(e,t,r){return{method:"GET",headers:e,signal:r&&r.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var l=n(r(180)),h=r(1),f=r(198),d=function(){function e(t){o(this,e),this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}return u(e,[{key:"getFullReader",value:function(){return(0,h.assert)(!this._fullRequestReader),this._fullRequestReader=new p(this),this._fullRequestReader}},{key:"getRangeReader",value:function(e,t){if(t<=this._progressiveDataLength)return null;var r=new v(this,e,t);return this._rangeRequestReaders.push(r),r}},{key:"cancelAllRequests",value:function(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);var t=this._rangeRequestReaders.slice(0);t.forEach(function(t){t.cancel(e)})}},{key:"_progressiveDataLength",get:function(){return this._fullRequestReader?this._fullRequestReader._loaded:0}}]),e}();t.PDFFetchStream=d;var p=function(){function e(t){var r=this;o(this,e),this._stream=t,this._reader=null,this._loaded=0,this._filename=null;var n=t.source;this._withCredentials=n.withCredentials||!1,this._contentLength=n.length,this._headersCapability=(0,h.createPromiseCapability)(),this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.disableRange,this._headers=new Headers;for(var i in this._stream.httpHeaders){var a=this._stream.httpHeaders[i];"undefined"!=typeof a&&this._headers.append(i,a)}var s=n.url;fetch(s,c(this._headers,this._withCredentials,this._abortController)).then(function(e){if(!(0,f.validateResponseStatus)(e.status))throw(0,f.createResponseStatusError)(e.status,s);r._reader=e.body.getReader(),r._headersCapability.resolve();var t=function(t){return e.headers.get(t)},n=(0,f.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:r._stream.isHttp,rangeChunkSize:r._rangeChunkSize,disableRange:r._disableRange}),i=n.allowRangeRequests,a=n.suggestedLength;r._isRangeSupported=i,r._contentLength=a||r._contentLength,r._filename=(0,f.extractFilenameFromHeader)(t),!r._isStreamingSupported&&r._isRangeSupported&&r.cancel(new h.AbortException("Streaming is disabled."))})["catch"](this._headersCapability.reject),this.onProgress=null}return u(e,[{key:"read",value:function(){function e(){return t.apply(this,arguments)}var t=a(l["default"].mark(function r(){var e,t,n,i;return l["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._headersCapability.promise;case 2:return r.next=4,this._reader.read();case 4:if(e=r.sent,t=e.value,n=e.done,!n){r.next=9;break}return r.abrupt("return",{value:t,done:n});case 9:return this._loaded+=t.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),i=new Uint8Array(t).buffer,r.abrupt("return",{value:i,done:!1});case 13:case"end":return r.stop()}},r,this)}));return e}()},{key:"cancel",value:function(e){this._reader&&this._reader.cancel(e),this._abortController&&this._abortController.abort()}},{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}}]),e}(),v=function(){function e(t,r,n){var i=this;o(this,e),this._stream=t,this._reader=null,this._loaded=0;var a=t.source;this._withCredentials=a.withCredentials||!1,this._readCapability=(0,h.createPromiseCapability)(),this._isStreamingSupported=!a.disableStream,"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._headers=new Headers;for(var s in this._stream.httpHeaders){var u=this._stream.httpHeaders[s];"undefined"!=typeof u&&this._headers.append(s,u)}this._headers.append("Range","bytes=".concat(r,"-").concat(n-1));var l=a.url;fetch(l,c(this._headers,this._withCredentials,this._abortController)).then(function(e){if(!(0,f.validateResponseStatus)(e.status))throw(0,f.createResponseStatusError)(e.status,l);i._readCapability.resolve(),i._reader=e.body.getReader()}),this.onProgress=null}return u(e,[{key:"read",value:function(){function e(){return t.apply(this,arguments)}var t=a(l["default"].mark(function r(){var e,t,n,i;return l["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._readCapability.promise;case 2:return r.next=4,this._reader.read();case 4:if(e=r.sent,t=e.value,n=e.done,!n){r.next=9;break}return r.abrupt("return",{value:t,done:n});case 9:return this._loaded+=t.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),i=new Uint8Array(t).buffer,r.abrupt("return",{value:i,done:!1});case 13:case"end":return r.stop()}},r,this)}));return e}()},{key:"cancel",value:function(e){this._reader&&this._reader.cancel(e),this._abortController&&this._abortController.abort()}},{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}}]),e}()}])});