(function(){var e={9662:function(e,t,r){var n=r(614),a=r(6330),i=TypeError;e.exports=function(e){if(n(e))return e;throw i(a(e)+" is not a function")}},6077:function(e,t,r){var n=r(614),a=String,i=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw i("Can't set "+a(e)+" as a prototype")}},5787:function(e,t,r){var n=r(7976),a=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw a("Incorrect invocation")}},9670:function(e,t,r){var n=r(111),a=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw i(a(e)+" is not an object")}},1318:function(e,t,r){var n=r(5656),a=r(1400),i=r(6244),o=function(e){return function(t,r,o){var s,c=n(t),l=i(c),u=a(o,l);if(e&&r!=r){while(l>u)if(s=c[u++],s!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},3658:function(e,t,r){"use strict";var n=r(9781),a=r(3157),i=TypeError,o=Object.getOwnPropertyDescriptor,s=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(a(e)&&!o(e,"length").writable)throw i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},4326:function(e,t,r){var n=r(1702),a=n({}.toString),i=n("".slice);e.exports=function(e){return i(a(e),8,-1)}},648:function(e,t,r){var n=r(1694),a=r(614),i=r(4326),o=r(5112),s=o("toStringTag"),c=Object,l="Arguments"==i(function(){return arguments}()),u=function(e,t){try{return e[t]}catch(r){}};e.exports=n?i:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=u(t=c(e),s))?r:l?i(t):"Object"==(n=i(t))&&a(t.callee)?"Arguments":n}},9920:function(e,t,r){var n=r(2597),a=r(3887),i=r(1236),o=r(3070);e.exports=function(e,t,r){for(var s=a(t),c=o.f,l=i.f,u=0;ur)throw t("Maximum allowed index exceeded");return e}},3678:function(e){e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},8113:function(e,t,r){var n=r(5005);e.exports=n("navigator","userAgent")||""},7392:function(e,t,r){var n,a,i=r(7854),o=r(8113),s=i.process,c=i.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u&&(n=u.split("."),a=n[0]>0&&n[0]<4?1:+(n[0]+n[1])),!a&&o&&(n=o.match(/Edge\/(\d+)/),(!n||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/),n&&(a=+n[1]))),e.exports=a},748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},1060:function(e,t,r){var n=r(1702),a=Error,i=n("".replace),o=function(e){return String(a(e).stack)}("zxcasd"),s=/\n\s*at [^:]*:[^\n]*/,c=s.test(o);e.exports=function(e,t){if(c&&"string"==typeof e&&!a.prepareStackTrace)while(t--)e=i(e,s,"");return e}},2109:function(e,t,r){var n=r(7854),a=r(1236).f,i=r(8880),o=r(8052),s=r(3072),c=r(9920),l=r(4705);e.exports=function(e,t){var r,u,h,f,d,p,g=e.target,m=e.global,v=e.stat;if(u=m?n:v?n[g]||s(g,{}):(n[g]||{}).prototype,u)for(h in t){if(d=t[h],e.dontCallGetSet?(p=a(u,h),f=p&&p.value):f=u[h],r=l(m?h:g+(v?".":"#")+h,e.forced),!r&&void 0!==f){if(typeof d==typeof f)continue;c(d,f)}(e.sham||f&&f.sham)&&i(d,"sham",!0),o(u,h,d,e)}}},7293:function(e){e.exports=function(e){try{return!!e()}catch(t){return!0}}},4374:function(e,t,r){var n=r(7293);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},6916:function(e,t,r){var n=r(4374),a=Function.prototype.call;e.exports=n?a.bind(a):function(){return a.apply(a,arguments)}},6530:function(e,t,r){var n=r(9781),a=r(2597),i=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,s=a(i,"name"),c=s&&"something"===function(){}.name,l=s&&(!n||n&&o(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},1702:function(e,t,r){var n=r(4374),a=Function.prototype,i=a.call,o=n&&a.bind.bind(i,i);e.exports=n?o:function(e){return function(){return i.apply(e,arguments)}}},5005:function(e,t,r){var n=r(7854),a=r(614),i=function(e){return a(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?i(n[e]):n[e]&&n[e][t]}},8173:function(e,t,r){var n=r(9662),a=r(8554);e.exports=function(e,t){var r=e[t];return a(r)?void 0:n(r)}},7854:function(e,t,r){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2597:function(e,t,r){var n=r(1702),a=r(7908),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(a(e),t)}},3501:function(e){e.exports={}},4664:function(e,t,r){var n=r(9781),a=r(7293),i=r(317);e.exports=!n&&!a((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:function(e,t,r){var n=r(1702),a=r(7293),i=r(4326),o=Object,s=n("".split);e.exports=a((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?s(e,""):o(e)}:o},9587:function(e,t,r){var n=r(614),a=r(111),i=r(7674);e.exports=function(e,t,r){var o,s;return i&&n(o=t.constructor)&&o!==r&&a(s=o.prototype)&&s!==r.prototype&&i(e,s),e}},2788:function(e,t,r){var n=r(1702),a=r(614),i=r(5465),o=n(Function.toString);a(i.inspectSource)||(i.inspectSource=function(e){return o(e)}),e.exports=i.inspectSource},9909:function(e,t,r){var n,a,i,o=r(4811),s=r(7854),c=r(111),l=r(8880),u=r(2597),h=r(5465),f=r(6200),d=r(3501),p="Object already initialized",g=s.TypeError,m=s.WeakMap,v=function(e){return i(e)?a(e):n(e,{})},b=function(e){return function(t){var r;if(!c(t)||(r=a(t)).type!==e)throw g("Incompatible receiver, "+e+" required");return r}};if(o||h.state){var y=h.state||(h.state=new m);y.get=y.get,y.has=y.has,y.set=y.set,n=function(e,t){if(y.has(e))throw g(p);return t.facade=e,y.set(e,t),t},a=function(e){return y.get(e)||{}},i=function(e){return y.has(e)}}else{var w=f("state");d[w]=!0,n=function(e,t){if(u(e,w))throw g(p);return t.facade=e,l(e,w,t),t},a=function(e){return u(e,w)?e[w]:{}},i=function(e){return u(e,w)}}e.exports={set:n,get:a,has:i,enforce:v,getterFor:b}},3157:function(e,t,r){var n=r(4326);e.exports=Array.isArray||function(e){return"Array"==n(e)}},614:function(e,t,r){var n=r(4154),a=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===a}:function(e){return"function"==typeof e}},4705:function(e,t,r){var n=r(7293),a=r(614),i=/#|\.prototype\./,o=function(e,t){var r=c[s(e)];return r==u||r!=l&&(a(t)?n(t):!!t)},s=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=o.data={},l=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},8554:function(e){e.exports=function(e){return null===e||void 0===e}},111:function(e,t,r){var n=r(614),a=r(4154),i=a.all;e.exports=a.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===i}:function(e){return"object"==typeof e?null!==e:n(e)}},1913:function(e){e.exports=!1},2190:function(e,t,r){var n=r(5005),a=r(614),i=r(7976),o=r(3307),s=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return a(t)&&i(t.prototype,s(e))}},6244:function(e,t,r){var n=r(7466);e.exports=function(e){return n(e.length)}},6339:function(e,t,r){var n=r(7293),a=r(614),i=r(2597),o=r(9781),s=r(6530).CONFIGURABLE,c=r(2788),l=r(9909),u=l.enforce,h=l.get,f=Object.defineProperty,d=o&&!n((function(){return 8!==f((function(){}),"length",{value:8}).length})),p=String(String).split("String"),g=e.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!i(e,"name")||s&&e.name!==t)&&(o?f(e,"name",{value:t,configurable:!0}):e.name=t),d&&r&&i(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&i(r,"constructor")&&r.constructor?o&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(a){}var n=u(e);return i(n,"source")||(n.source=p.join("string"==typeof t?t:"")),e};Function.prototype.toString=g((function(){return a(this)&&h(this).source||c(this)}),"toString")},4758:function(e){var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},6277:function(e,t,r){var n=r(1340);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},3070:function(e,t,r){var n=r(9781),a=r(4664),i=r(3353),o=r(9670),s=r(4948),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",f="configurable",d="writable";t.f=n?i?function(e,t,r){if(o(e),t=s(t),o(r),"function"===typeof e&&"prototype"===t&&"value"in r&&d in r&&!r[d]){var n=u(e,t);n&&n[d]&&(e[t]=r.value,r={configurable:f in r?r[f]:n[f],enumerable:h in r?r[h]:n[h],writable:!1})}return l(e,t,r)}:l:function(e,t,r){if(o(e),t=s(t),o(r),a)try{return l(e,t,r)}catch(n){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},1236:function(e,t,r){var n=r(9781),a=r(6916),i=r(5296),o=r(9114),s=r(5656),c=r(4948),l=r(2597),u=r(4664),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=s(e),t=c(t),u)try{return h(e,t)}catch(r){}if(l(e,t))return o(!a(i.f,e,t),e[t])}},8006:function(e,t,r){var n=r(6324),a=r(748),i=a.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},5181:function(e,t){t.f=Object.getOwnPropertySymbols},7976:function(e,t,r){var n=r(1702);e.exports=n({}.isPrototypeOf)},6324:function(e,t,r){var n=r(1702),a=r(2597),i=r(5656),o=r(1318).indexOf,s=r(3501),c=n([].push);e.exports=function(e,t){var r,n=i(e),l=0,u=[];for(r in n)!a(s,r)&&a(n,r)&&c(u,r);while(t.length>l)a(n,r=t[l++])&&(~o(u,r)||c(u,r));return u}},5296:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,a=n&&!r.call({1:2},1);t.f=a?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},7674:function(e,t,r){var n=r(1702),a=r(9670),i=r(6077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),e(r,[]),t=r instanceof Array}catch(o){}return function(r,n){return a(r),i(n),t?e(r,n):r.__proto__=n,r}}():void 0)},2140:function(e,t,r){var n=r(6916),a=r(614),i=r(111),o=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&a(r=e.toString)&&!i(s=n(r,e)))return s;if(a(r=e.valueOf)&&!i(s=n(r,e)))return s;if("string"!==t&&a(r=e.toString)&&!i(s=n(r,e)))return s;throw o("Can't convert object to primitive value")}},3887:function(e,t,r){var n=r(5005),a=r(1702),i=r(8006),o=r(5181),s=r(9670),c=a([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),r=o.f;return r?c(t,r(e)):t}},7066:function(e,t,r){"use strict";var n=r(9670);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},4488:function(e,t,r){var n=r(8554),a=TypeError;e.exports=function(e){if(n(e))throw a("Can't call method on "+e);return e}},6200:function(e,t,r){var n=r(2309),a=r(9711),i=n("keys");e.exports=function(e){return i[e]||(i[e]=a(e))}},5465:function(e,t,r){var n=r(7854),a=r(3072),i="__core-js_shared__",o=n[i]||a(i,{});e.exports=o},2309:function(e,t,r){var n=r(1913),a=r(5465);(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.1",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"})},6293:function(e,t,r){var n=r(7392),a=r(7293);e.exports=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},1400:function(e,t,r){var n=r(9303),a=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?a(r+t,0):i(r,t)}},5656:function(e,t,r){var n=r(8361),a=r(4488);e.exports=function(e){return n(a(e))}},9303:function(e,t,r){var n=r(4758);e.exports=function(e){var t=+e;return t!==t||0===t?0:n(t)}},7466:function(e,t,r){var n=r(9303),a=Math.min;e.exports=function(e){return e>0?a(n(e),9007199254740991):0}},7908:function(e,t,r){var n=r(4488),a=Object;e.exports=function(e){return a(n(e))}},7593:function(e,t,r){var n=r(6916),a=r(111),i=r(2190),o=r(8173),s=r(2140),c=r(5112),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!a(e)||i(e))return e;var r,c=o(e,u);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!a(r)||i(r))return r;throw l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},4948:function(e,t,r){var n=r(7593),a=r(2190);e.exports=function(e){var t=n(e,"string");return a(t)?t:t+""}},1694:function(e,t,r){var n=r(5112),a=n("toStringTag"),i={};i[a]="z",e.exports="[object z]"===String(i)},1340:function(e,t,r){var n=r(648),a=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return a(e)}},6330:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(r){return"Object"}}},9711:function(e,t,r){var n=r(1702),a=0,i=Math.random(),o=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++a+i,36)}},3307:function(e,t,r){var n=r(6293);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(e,t,r){var n=r(9781),a=r(7293);e.exports=n&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4811:function(e,t,r){var n=r(7854),a=r(614),i=n.WeakMap;e.exports=a(i)&&/native code/.test(String(i))},5112:function(e,t,r){var n=r(7854),a=r(2309),i=r(2597),o=r(9711),s=r(6293),c=r(3307),l=a("wks"),u=n.Symbol,h=u&&u["for"],f=c?u:u&&u.withoutSetter||o;e.exports=function(e){if(!i(l,e)||!s&&"string"!=typeof l[e]){var t="Symbol."+e;s&&i(u,e)?l[e]=u[e]:l[e]=c&&h?h(t):f(t)}return l[e]}},7658:function(e,t,r){"use strict";var n=r(2109),a=r(7908),i=r(6244),o=r(3658),s=r(7207),c=r(7293),l=c((function(){return 4294967297!==[].push.call({length:4294967296},1)})),u=!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}();n({target:"Array",proto:!0,arity:1,forced:l||u},{push:function(e){var t=a(this),r=i(t),n=arguments.length;s(r+n);for(var c=0;c=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r["return"]||r["return"]()}finally{if(s)throw i}}}}function p(e){return k(e)||g(e)||b(e)||v()}function g(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function m(e,t){return k(e)||w(e,t)||b(e,t)||v()}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(e,t){if(e){if("string"===typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=a.VerbosityLevel.INFOS?Date.now():0;r.getOperatorList({handler:E,sink:t,task:i,intent:e.intent,renderInteractiveForms:e.renderInteractiveForms,annotationStorage:e.annotationStorage}).then((function(e){P(i),o&&(0,a.info)("page=".concat(n+1," - getOperatorList: time=")+"".concat(Date.now()-o,"ms, len=").concat(e.length)),t.close()}),(function(e){P(i),i.terminated||(E.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorOperatorList}),t.error(e))}))}))}),this),E.on("GetTextContent",(function(e,t){var n=e.pageIndex;t.onPull=function(e){},t.onCancel=function(e){},r.getPage(n).then((function(r){var i=new O("GetTextContent: page "+n);I(i);var o=v>=a.VerbosityLevel.INFOS?Date.now():0;r.extractTextContent({handler:E,task:i,sink:t,normalizeWhitespace:e.normalizeWhitespace,combineTextItems:e.combineTextItems}).then((function(){P(i),o&&(0,a.info)("page=".concat(n+1," - getTextContent: time=")+"".concat(Date.now()-o,"ms")),t.close()}),(function(e){P(i),i.terminated||t.error(e)}))}))})),E.on("FontFallback",(function(e){return r.fontFallback(e.id,E)})),E.on("Cleanup",(function(e){return r.cleanup(!0)})),E.on("Terminate",(function(e){c=!0;var t=[];if(r){r.terminate(new a.AbortException("Worker was terminated."));var n=r.cleanup();t.push(n),r=null}else(0,i.clearPrimitiveCaches)();return f&&f(new a.AbortException("Worker was terminated.")),g.forEach((function(e){t.push(e.finished),e.terminate()})),Promise.all(t).then((function(){E.destroy(),E=null}))})),E.on("Ready",(function(t){M(e),e=null})),A}},{key:"initializeFromPort",value:function(t){var r=new l.MessageHandler("worker","main",t);e.setup(r,t),r.send("ready",null)}}]),e}();function I(e){return"function"===typeof e.postMessage&&"onmessage"in e}t.WorkerMessageHandler=T,"undefined"===typeof window&&!c.isNodeJS&&"undefined"!==typeof self&&I(self)&&T.initializeFromPort(self)},function(e,t,r){"use strict";e.exports=r(3)},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},t(e)}var r=function(e){var r,n=Object.prototype,a=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(R){l=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,i=Object.create(a.prototype),o=new P(n||[]);return i._invoke=E(e,r,o),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(R){return{type:"throw",arg:R}}}e.wrap=u;var f="suspendedStart",d="suspendedYield",p="executing",g="completed",m={};function v(){}function b(){}function y(){}var w={};w[o]=function(){return this};var k=Object.getPrototypeOf,S=k&&k(k(_([])));S&&S!==n&&a.call(S,o)&&(w=S);var x=y.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,r){function n(i,o,s,c){var l=h(e[i],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"===t(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,s,c)}),(function(e){n("throw",e,s,c)})):r.resolve(f).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,c)}))}c(l.arg)}var i;function o(e,t){function a(){return new r((function(r,a){n(e,t,r,a)}))}return i=i?i.then(a,a):a()}this._invoke=o}function E(e,t,r){var n=f;return function(a,i){if(n===p)throw new Error("Generator is already running");if(n===g){if("throw"===a)throw i;return F()}r.method=a,r.arg=i;while(1){var o=r.delegate;if(o){var s=O(o,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=h(e,t,r);if("normal"===c.type){if(n=r.done?g:d,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=g,r.method="throw",r.arg=c.arg)}}}function O(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator["return"]&&(t.method="return",t.arg=r,O(e,t),"throw"===t.method))return m;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=h(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,m;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,m):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function T(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 I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function _(e){if(e){var t=e[o];if(t)return t.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){while(++n=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),l=a.call(o,"finallyLoc");if(c&&l){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),m}},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 a=n.arg;I(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:_(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),m}},e}("object"===t(e)?e.exports:{});try{regeneratorRuntime=r}catch(n){Function("r","regeneratorRuntime = r")(r)}}).call(this,r(4)(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,t){for(var r=0;r>24&255,e>>16&255,e>>8&255,255&e)}function oe(){var e=new Uint8Array(4);e[0]=1;var t=new Uint32Array(e.buffer,0,1);return 1===t[0]}var se={get value(){return H(this,"value",oe())}};function ce(){try{return new Function(""),!0}catch(e){return!1}}t.IsLittleEndianCached=se;var le={get value(){return H(this,"value",ce())}};t.IsEvalSupportedCached=le;var ue=["rgb(",0,",",0,",",0,")"],he=function(){function e(){o(this,e)}return a(e,null,[{key:"makeCssRgb",value:function(e,t,r){return ue[1]=e,ue[3]=t,ue[5]=r,ue.join("")}},{key:"transform",value:function(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}},{key:"applyTransform",value:function(e,t){var r=e[0]*t[0]+e[1]*t[2]+t[4],n=e[0]*t[1]+e[1]*t[3]+t[5];return[r,n]}},{key:"applyInverseTransform",value:function(e,t){var r=t[0]*t[3]-t[1]*t[2],n=(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/r,a=(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/r;return[n,a]}},{key:"getAxialAlignedBoundingBox",value:function(t,r){var n=e.applyTransform(t,r),a=e.applyTransform(t.slice(2,4),r),i=e.applyTransform([t[0],t[3]],r),o=e.applyTransform([t[2],t[1]],r);return[Math.min(n[0],a[0],i[0],o[0]),Math.min(n[1],a[1],i[1],o[1]),Math.max(n[0],a[0],i[0],o[0]),Math.max(n[1],a[1],i[1],o[1])]}},{key:"inverseTransform",value:function(e){var t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}},{key:"apply3dTransform",value:function(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]}},{key:"singularValueDecompose2dScale",value:function(e){var t=[e[0],e[2],e[1],e[3]],r=e[0]*t[0]+e[1]*t[2],n=e[0]*t[1]+e[1]*t[3],a=e[2]*t[0]+e[3]*t[2],i=e[2]*t[1]+e[3]*t[3],o=(r+i)/2,s=Math.sqrt((r+i)*(r+i)-4*(r*i-a*n))/2,c=o+s||1,l=o-s||1;return[Math.sqrt(c),Math.sqrt(l)]}},{key:"normalizeRect",value:function(e){var t=e.slice(0);return e[0]>e[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 a=[t[0],t[2],r[0],r[2]].sort(n),i=[t[1],t[3],r[1],r[3]].sort(n),o=[];return t=e.normalizeRect(t),r=e.normalizeRect(r),a[0]===t[0]&&a[1]===r[0]||a[0]===r[0]&&a[1]===t[0]?(o[0]=a[1],o[2]=a[2],i[0]===t[1]&&i[1]===r[1]||i[0]===r[1]&&i[1]===t[1]?(o[1]=i[1],o[3]=i[2],o):null):null}}]),e}();t.Util=he;var fe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function de(e){var t=e.length,r=[];if("þ"===e[0]&&"ÿ"===e[1])for(var n=2;n0&&void 0!==arguments[0]?arguments[0]:new Date(Date.now()),t=[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),(e.getUTCDate()+1).toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")];return t.join("")}function xe(){var e=Object.create(null),t=!1;return Object.defineProperty(e,"settled",{get:function(){return t}}),e.promise=new Promise((function(r,n){e.resolve=function(e){t=!0,r(e)},e.reject=function(e){t=!0,n(e)}})),e}var 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 a=new Blob([t],{type:r});return URL.createObjectURL(a)}for(var i="data:".concat(r,";base64,"),o=0,s=t.length;o>2,f=(3&c)<<4|l>>4,d=o+1>6:64,p=o+21?!!arguments[1]:!this.contains(e);return this[t?"add":"remove"](e),t})}}(),function(){if(i&&s){var e=window.history.pushState,t=window.history.replaceState;window.history.pushState=function(t,r,n){var a=void 0===n?[t,r]:[t,r,n];e.apply(this,a)},window.history.replaceState=function(e,r,n){var a=void 0===n?[e,r]:[e,r,n];t.apply(this,a)}}}(),function(){String.prototype.startsWith||r(53)}(),function(){String.prototype.endsWith||r(64)}(),function(){String.prototype.includes||r(66)}(),function(){Array.prototype.includes||r(68)}(),function(){Array.from||r(76)}(),function(){Object.assign||r(98)}(),function(){Object.fromEntries||r(101)}(),function(){Math.log2||(Math.log2=r(105))}(),function(){Number.isNaN||(Number.isNaN=r(107))}(),function(){Number.isInteger||(Number.isInteger=r(109))}(),function(){Uint8Array.prototype.slice||r(112)}(),function(){globalThis.Promise&&globalThis.Promise.allSettled||(globalThis.Promise=r(117))}(),function(){globalThis.URL=r(138)}(),function(){var e=!1;if("undefined"!==typeof ReadableStream)try{new ReadableStream({start:function(e){e.close()}}),e=!0}catch(t){}e||(globalThis.ReadableStream=r(145).ReadableStream)}(),function(){globalThis.Map&&globalThis.Map.prototype.entries||(globalThis.Map=r(146))}(),function(){globalThis.Set&&globalThis.Set.prototype.entries||(globalThis.Set=r(153))}(),function(){globalThis.WeakMap||(globalThis.WeakMap=r(155))}(),function(){globalThis.WeakSet||(globalThis.WeakSet=r(161))}(),function(){String.prototype.codePointAt||r(163)}(),function(){String.fromCodePoint||(String.fromCodePoint=r(165))}(),function(){globalThis.Symbol||r(167)}(),function(){String.prototype.padStart||r(190)}(),function(){String.prototype.padEnd||r(195)}(),function(){Object.values||(Object.values=r(197))}(),function(){Object.entries||(Object.entries=r(200))}()}},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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeJS=void 0;var a="object"===("undefined"===typeof process?"undefined":n(process))&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=a},function(e,t,r){r(9),e.exports=r(11)},function(e,t,r){var n=r(10),a=r(11);n({global:!0},{globalThis:a})},function(e,t,r){var n=r(11),a=r(12).f,i=r(26),o=r(29),s=r(30),c=r(40),l=r(52);e.exports=function(e,t){var r,u,h,f,d,p,g=e.target,m=e.global,v=e.stat;if(u=m?n:v?n[g]||s(g,{}):(n[g]||{}).prototype,u)for(h in t){if(d=t[h],e.noTargetGet?(p=a(u,h),f=p&&p.value):f=u[h],r=l(m?h:g+(v?".":"#")+h,e.forced),!r&&void 0!==f){if(typeof d===typeof f)continue;c(d,f)}(e.sham||f&&f.sham)&&i(d,"sham",!0),o(u,h,d,e)}}},function(e,t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||Function("return this")()},function(e,t,r){var n=r(13),a=r(15),i=r(16),o=r(17),s=r(21),c=r(23),l=r(24),u=Object.getOwnPropertyDescriptor;t.f=n?u:function(e,t){if(e=o(e),t=s(t,!0),l)try{return u(e,t)}catch(r){}if(c(e,t))return i(!a.f.call(e,t),e[t])}},function(e,t,r){var n=r(14);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,r){"use strict";var n={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,i=a&&!n.call({1:2},1);t.f=i?function(e){var t=a(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(18),a=r(20);e.exports=function(e){return n(a(e))}},function(e,t,r){var n=r(14),a=r(19),i="".split;e.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?i.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(22);e.exports=function(e,t){if(!n(e))return e;var r,a;if(t&&"function"==typeof(r=e.toString)&&!n(a=r.call(e)))return a;if("function"==typeof(r=e.valueOf)&&!n(a=r.call(e)))return a;if(!t&&"function"==typeof(r=e.toString)&&!n(a=r.call(e)))return a;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(13),a=r(14),i=r(25);e.exports=!n&&!a((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(e,t,r){var n=r(11),a=r(22),i=n.document,o=a(i)&&a(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,r){var n=r(13),a=r(27),i=r(16);e.exports=n?function(e,t,r){return a.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(13),a=r(24),i=r(28),o=r(21),s=Object.defineProperty;t.f=n?s:function(e,t,r){if(i(e),t=o(t,!0),i(r),a)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(22);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,r){var n=r(11),a=r(26),i=r(23),o=r(30),s=r(31),c=r(33),l=c.get,u=c.enforce,h=String(String).split("String");(e.exports=function(e,t,r,s){var c=!!s&&!!s.unsafe,l=!!s&&!!s.enumerable,f=!!s&&!!s.noTargetGet;"function"==typeof r&&("string"!=typeof t||i(r,"name")||a(r,"name",t),u(r).source=h.join("string"==typeof t?t:"")),e!==n?(c?!f&&e[t]&&(l=!0):delete e[t],l?e[t]=r:a(e,t,r)):l?e[t]=r:o(t,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&l(this).source||s(this)}))},function(e,t,r){var n=r(11),a=r(26);e.exports=function(e,t){try{a(n,e,t)}catch(r){n[e]=t}return t}},function(e,t,r){var n=r(32),a=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(e){return a.call(e)}),e.exports=n.inspectSource},function(e,t,r){var n=r(11),a=r(30),i="__core-js_shared__",o=n[i]||a(i,{});e.exports=o},function(e,t,r){var n,a,i,o=r(34),s=r(11),c=r(22),l=r(26),u=r(23),h=r(35),f=r(39),d=s.WeakMap,p=function(e){return i(e)?a(e):n(e,{})},g=function(e){return function(t){var r;if(!c(t)||(r=a(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}};if(o){var m=new d,v=m.get,b=m.has,y=m.set;n=function(e,t){return y.call(m,e,t),t},a=function(e){return v.call(m,e)||{}},i=function(e){return b.call(m,e)}}else{var w=h("state");f[w]=!0,n=function(e,t){return l(e,w,t),t},a=function(e){return u(e,w)?e[w]:{}},i=function(e){return u(e,w)}}e.exports={set:n,get:a,has:i,enforce:p,getterFor:g}},function(e,t,r){var n=r(11),a=r(31),i=n.WeakMap;e.exports="function"===typeof i&&/native code/.test(a(i))},function(e,t,r){var n=r(36),a=r(38),i=n("keys");e.exports=function(e){return i[e]||(i[e]=a(e))}},function(e,t,r){var n=r(37),a=r(32);(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:n?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},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(23),a=r(41),i=r(12),o=r(27);e.exports=function(e,t){for(var r=a(t),s=o.f,c=i.f,l=0;lc)n(s,r=t[c++])&&(~i(l,r)||l.push(r));return l}},function(e,t,r){var n=r(17),a=r(47),i=r(49),o=function(e){return function(t,r,o){var s,c=n(t),l=a(c.length),u=i(o,l);if(e&&r!=r){while(l>u)if(s=c[u++],s!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},function(e,t,r){var n=r(48),a=Math.min;e.exports=function(e){return e>0?a(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(48),a=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?a(r+t,0):i(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(14),a=/#|\.prototype\./,i=function(e,t){var r=s[o(e)];return r==l||r!=c&&("function"==typeof t?n(t):!!t)},o=i.normalize=function(e){return String(e).replace(a,".").toLowerCase()},s=i.data={},c=i.NATIVE="N",l=i.POLYFILL="P";e.exports=i},function(e,t,r){r(54);var n=r(61);e.exports=n("String","startsWith")},function(e,t,r){"use strict";var n=r(10),a=r(12).f,i=r(47),o=r(55),s=r(20),c=r(60),l=r(37),u="".startsWith,h=Math.min,f=c("startsWith"),d=!l&&!f&&!!function(){var e=a(String.prototype,"startsWith");return e&&!e.writable}();n({target:"String",proto:!0,forced:!d&&!f},{startsWith:function(e){var t=String(s(this));o(e);var r=i(h(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(56);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(22),a=r(19),i=r(57),o=i("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==a(e))}},function(e,t,r){var n=r(11),a=r(36),i=r(23),o=r(38),s=r(58),c=r(59),l=a("wks"),u=n.Symbol,h=c?u:u&&u.withoutSetter||o;e.exports=function(e){return i(l,e)||(s&&i(u,e)?l[e]=u[e]:l[e]=h("Symbol."+e)),l[e]}},function(e,t,r){var n=r(14);e.exports=!!Object.getOwnPropertySymbols&&!n((function(){return!String(Symbol())}))},function(e,t,r){var n=r(58);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,r){var n=r(57),a=n("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[a]=!1,"/./"[e](t)}catch(n){}}return!1}},function(e,t,r){var n=r(11),a=r(62),i=Function.call;e.exports=function(e,t,r){return a(i,n[e].prototype[t],r)}},function(e,t,r){var n=r(63);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,a){return e.call(t,r,n,a)}}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(65);var n=r(61);e.exports=n("String","endsWith")},function(e,t,r){"use strict";var n=r(10),a=r(12).f,i=r(47),o=r(55),s=r(20),c=r(60),l=r(37),u="".endsWith,h=Math.min,f=c("endsWith"),d=!l&&!f&&!!function(){var e=a(String.prototype,"endsWith");return e&&!e.writable}();n({target:"String",proto:!0,forced:!d&&!f},{endsWith:function(e){var t=String(s(this));o(e);var r=arguments.length>1?arguments[1]:void 0,n=i(t.length),a=void 0===r?n:h(i(r),n),c=String(e);return u?u.call(t,c,a):t.slice(a-c.length,a)===c}})},function(e,t,r){r(67);var n=r(61);e.exports=n("String","includes")},function(e,t,r){"use strict";var n=r(10),a=r(55),i=r(20),o=r(60);n({target:"String",proto:!0,forced:!o("includes")},{includes:function(e){return!!~String(i(this)).indexOf(a(e),arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){r(69);var n=r(61);e.exports=n("Array","includes")},function(e,t,r){"use strict";var n=r(10),a=r(46).includes,i=r(70),o=r(75),s=o("indexOf",{ACCESSORS:!0,1:0});n({target:"Array",proto:!0,forced:!s},{includes:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),i("includes")},function(e,t,r){var n=r(57),a=r(71),i=r(27),o=n("unscopables"),s=Array.prototype;void 0==s[o]&&i.f(s,o,{configurable:!0,value:a(null)}),e.exports=function(e){s[o][e]=!0}},function(e,t,r){var n,a=r(28),i=r(72),o=r(50),s=r(39),c=r(74),l=r(25),u=r(35),h=">",f="<",d="prototype",p="script",g=u("IE_PROTO"),m=function(){},v=function(e){return f+p+h+e+f+"/"+p+h},b=function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){var e,t=l("iframe"),r="java"+p+":";return t.style.display="none",c.appendChild(t),t.src=String(r),e=t.contentWindow.document,e.open(),e.write(v("document.F=Object")),e.close(),e.F},w=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(t){}w=n?b(n):y();var e=o.length;while(e--)delete w[d][o[e]];return w()};s[g]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(m[d]=a(e),r=new m,m[d]=null,r[g]=e):r=w(),void 0===t?r:i(r,t)}},function(e,t,r){var n=r(13),a=r(27),i=r(28),o=r(73);e.exports=n?Object.defineProperties:function(e,t){i(e);var r,n=o(t),s=n.length,c=0;while(s>c)a.f(e,r=n[c++],t[r]);return e}},function(e,t,r){var n=r(45),a=r(50);e.exports=Object.keys||function(e){return n(e,a)}},function(e,t,r){var n=r(42);e.exports=n("document","documentElement")},function(e,t,r){var n=r(13),a=r(14),i=r(23),o=Object.defineProperty,s={},c=function(e){throw e};e.exports=function(e,t){if(i(s,e))return s[e];t||(t={});var r=[][e],l=!!i(t,"ACCESSORS")&&t.ACCESSORS,u=i(t,0)?t[0]:c,h=i(t,1)?t[1]:void 0;return s[e]=!!r&&!a((function(){if(l&&!n)return!0;var e={length:-1};l?o(e,1,{enumerable:!0,get:c}):e[1]=1,r.call(e,u,h)}))}},function(e,t,r){r(77),r(89);var n=r(43);e.exports=n.Array.from},function(e,t,r){"use strict";var n=r(78).charAt,a=r(33),i=r(79),o="String Iterator",s=a.set,c=a.getterFor(o);i(String,"String",(function(e){s(this,{type:o,string:String(e),index:0})}),(function(){var e,t=c(this),r=t.string,a=t.index;return a>=r.length?{value:void 0,done:!0}:(e=n(r,a),t.index+=e.length,{value:e,done:!1})}))},function(e,t,r){var n=r(48),a=r(20),i=function(e){return function(t,r){var i,o,s=String(a(t)),c=n(r),l=s.length;return c<0||c>=l?e?"":void 0:(i=s.charCodeAt(c),i<55296||i>56319||c+1===l||(o=s.charCodeAt(c+1))<56320||o>57343?e?s.charAt(c):i:e?s.slice(c,c+2):o-56320+(i-55296<<10)+65536)}};e.exports={codeAt:i(!1),charAt:i(!0)}},function(e,t,r){"use strict";var n=r(10),a=r(80),i=r(82),o=r(87),s=r(85),c=r(26),l=r(29),u=r(57),h=r(37),f=r(86),d=r(81),p=d.IteratorPrototype,g=d.BUGGY_SAFARI_ITERATORS,m=u("iterator"),v="keys",b="values",y="entries",w=function(){return this};e.exports=function(e,t,r,u,d,k,S){a(r,t,u);var x,C,A,E=function(e){if(e===d&&_)return _;if(!g&&e in I)return I[e];switch(e){case v:return function(){return new r(this,e)};case b:return function(){return new r(this,e)};case y:return function(){return new r(this,e)}}return function(){return new r(this)}},O=t+" Iterator",T=!1,I=e.prototype,P=I[m]||I["@@iterator"]||d&&I[d],_=!g&&P||E(d),F="Array"==t&&I.entries||P;if(F&&(x=i(F.call(new e)),p!==Object.prototype&&x.next&&(h||i(x)===p||(o?o(x,p):"function"!=typeof x[m]&&c(x,m,w)),s(x,O,!0,!0),h&&(f[O]=w))),d==b&&P&&P.name!==b&&(T=!0,_=function(){return P.call(this)}),h&&!S||I[m]===_||c(I,m,_),f[t]=_,d)if(C={values:E(b),keys:k?_:E(v),entries:E(y)},S)for(A in C)(g||T||!(A in I))&&l(I,A,C[A]);else n({target:t,proto:!0,forced:g||T},C);return C}},function(e,t,r){"use strict";var n=r(81).IteratorPrototype,a=r(71),i=r(16),o=r(85),s=r(86),c=function(){return this};e.exports=function(e,t,r){var l=t+" Iterator";return e.prototype=a(n,{next:i(1,r)}),o(e,l,!1,!0),s[l]=c,e}},function(e,t,r){"use strict";var n,a,i,o=r(82),s=r(26),c=r(23),l=r(57),u=r(37),h=l("iterator"),f=!1,d=function(){return this};[].keys&&(i=[].keys(),"next"in i?(a=o(o(i)),a!==Object.prototype&&(n=a)):f=!0),void 0==n&&(n={}),u||c(n,h)||s(n,h,d),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},function(e,t,r){var n=r(23),a=r(83),i=r(35),o=r(84),s=i("IE_PROTO"),c=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return e=a(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?c:null}},function(e,t,r){var n=r(20);e.exports=function(e){return Object(n(e))}},function(e,t,r){var n=r(14);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},function(e,t,r){var n=r(27).f,a=r(23),i=r(57),o=i("toStringTag");e.exports=function(e,t,r){e&&!a(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(28),a=r(88);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(i){}return function(r,i){return n(r),a(i),t?e.call(r,i):r.__proto__=i,r}}():void 0)},function(e,t,r){var n=r(22);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(10),a=r(90),i=r(97),o=!i((function(e){Array.from(e)}));n({target:"Array",stat:!0,forced:o},{from:a})},function(e,t,r){"use strict";var n=r(62),a=r(83),i=r(91),o=r(92),s=r(47),c=r(93),l=r(94);e.exports=function(e){var t,r,u,h,f,d,p=a(e),g="function"==typeof this?this:Array,m=arguments.length,v=m>1?arguments[1]:void 0,b=void 0!==v,y=l(p),w=0;if(b&&(v=n(v,m>2?arguments[2]:void 0,2)),void 0==y||g==Array&&o(y))for(t=s(p.length),r=new g(t);t>w;w++)d=b?v(p[w],w):p[w],c(r,w,d);else for(h=y.call(p),f=h.next,r=new g;!(u=f.call(h)).done;w++)d=b?i(h,v,[u.value,w],!0):u.value,c(r,w,d);return r.length=w,r}},function(e,t,r){var n=r(28);e.exports=function(e,t,r,a){try{return a?t(n(r)[0],r[1]):t(r)}catch(o){var i=e["return"];throw void 0!==i&&n(i.call(e)),o}}},function(e,t,r){var n=r(57),a=r(86),i=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(a.Array===e||o[i]===e)}},function(e,t,r){"use strict";var n=r(21),a=r(27),i=r(16);e.exports=function(e,t,r){var o=n(t);o in e?a.f(e,o,i(0,r)):e[o]=r}},function(e,t,r){var n=r(95),a=r(86),i=r(57),o=i("iterator");e.exports=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||a[n(e)]}},function(e,t,r){var n=r(96),a=r(19),i=r(57),o=i("toStringTag"),s="Arguments"==a(function(){return arguments}()),c=function(e,t){try{return e[t]}catch(r){}};e.exports=n?a:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=c(t=Object(e),o))?r:s?a(t):"Object"==(n=a(t))&&"function"==typeof t.callee?"Arguments":n}},function(e,t,r){var n=r(57),a=n("toStringTag"),i={};i[a]="z",e.exports="[object z]"===String(i)},function(e,t,r){var n=r(57),a=n("iterator"),i=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){i=!0}};s[a]=function(){return this},Array.from(s,(function(){throw 2}))}catch(c){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var n={};n[a]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(c){}return r}},function(e,t,r){r(99);var n=r(43);e.exports=n.Object.assign},function(e,t,r){var n=r(10),a=r(100);n({target:"Object",stat:!0,forced:Object.assign!==a},{assign:a})},function(e,t,r){"use strict";var n=r(13),a=r(14),i=r(73),o=r(51),s=r(15),c=r(83),l=r(18),u=Object.assign,h=Object.defineProperty;e.exports=!u||a((function(){if(n&&1!==u({b:1},u(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),a="abcdefghijklmnopqrst";return e[r]=7,a.split("").forEach((function(e){t[e]=e})),7!=u({},e)[r]||i(u({},t)).join("")!=a}))?function(e,t){var r=c(e),a=arguments.length,u=1,h=o.f,f=s.f;while(a>u){var d,p=l(arguments[u++]),g=h?i(p).concat(h(p)):i(p),m=g.length,v=0;while(m>v)d=g[v++],n&&!f.call(p,d)||(r[d]=p[d])}return r}:u},function(e,t,r){r(102),r(103);var n=r(43);e.exports=n.Object.fromEntries},function(e,t,r){"use strict";var n=r(17),a=r(70),i=r(86),o=r(33),s=r(79),c="Array Iterator",l=o.set,u=o.getterFor(c);e.exports=s(Array,"Array",(function(e,t){l(this,{type:c,target:n(e),index:0,kind:t})}),(function(){var e=u(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"),i.Arguments=i.Array,a("keys"),a("values"),a("entries")},function(e,t,r){var n=r(10),a=r(104),i=r(93);n({target:"Object",stat:!0},{fromEntries:function(e){var t={};return a(e,(function(e,r){i(t,e,r)}),void 0,!0),t}})},function(e,t,r){var n=r(28),a=r(92),i=r(47),o=r(62),s=r(94),c=r(91),l=function(e,t){this.stopped=e,this.result=t},u=e.exports=function(e,t,r,u,h){var f,d,p,g,m,v,b,y=o(t,r,u?2:1);if(h)f=e;else{if(d=s(e),"function"!=typeof d)throw TypeError("Target is not iterable");if(a(d)){for(p=0,g=i(e.length);g>p;p++)if(m=u?y(n(b=e[p])[0],b[1]):y(e[p]),m&&m instanceof l)return m;return new l(!1)}f=d.call(e)}v=f.next;while(!(b=v.call(f)).done)if(m=c(f,y,b.value,u),"object"==typeof m&&m&&m instanceof l)return m;return new l(!1)};u.stop=function(e){return new l(!0,e)}},function(e,t,r){r(106);var n=r(43);e.exports=n.Math.log2},function(e,t,r){var n=r(10),a=Math.log,i=Math.LN2;n({target:"Math",stat:!0},{log2:function(e){return a(e)/i}})},function(e,t,r){r(108);var n=r(43);e.exports=n.Number.isNaN},function(e,t,r){var n=r(10);n({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},function(e,t,r){r(110);var n=r(43);e.exports=n.Number.isInteger},function(e,t,r){var n=r(10),a=r(111);n({target:"Number",stat:!0},{isInteger:a})},function(e,t,r){var n=r(22),a=Math.floor;e.exports=function(e){return!n(e)&&isFinite(e)&&a(e)===e}},function(e,t,r){r(113)},function(e,t,r){"use strict";var n=r(114),a=r(116),i=r(14),o=n.aTypedArray,s=n.aTypedArrayConstructor,c=n.exportTypedArrayMethod,l=[].slice,u=i((function(){new Int8Array(1).slice()}));c("slice",(function(e,t){var r=l.call(o(this),e,t),n=a(this,this.constructor),i=0,c=r.length,u=new(s(n))(c);while(c>i)u[i]=r[i++];return u}),u)},function(e,t,r){"use strict";var n,a=r(115),i=r(13),o=r(11),s=r(22),c=r(23),l=r(95),u=r(26),h=r(29),f=r(27).f,d=r(82),p=r(87),g=r(57),m=r(38),v=o.Int8Array,b=v&&v.prototype,y=o.Uint8ClampedArray,w=y&&y.prototype,k=v&&d(v),S=b&&d(b),x=Object.prototype,C=x.isPrototypeOf,A=g("toStringTag"),E=m("TYPED_ARRAY_TAG"),O=a&&!!p&&"Opera"!==l(o.opera),T=!1,I={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},P=function(e){var t=l(e);return"DataView"===t||c(I,t)},_=function(e){return s(e)&&c(I,l(e))},F=function(e){if(_(e))return e;throw TypeError("Target is not a typed array")},R=function(e){if(p){if(C.call(k,e))return e}else for(var t in I)if(c(I,n)){var r=o[t];if(r&&(e===r||C.call(r,e)))return e}throw TypeError("Target is not a typed array constructor")},M=function(e,t,r){if(i){if(r)for(var n in I){var a=o[n];a&&c(a.prototype,e)&&delete a.prototype[e]}S[e]&&!r||h(S,e,r?t:O&&b[e]||t)}},B=function(e,t,r){var n,a;if(i){if(p){if(r)for(n in I)a=o[n],a&&c(a,e)&&delete a[e];if(k[e]&&!r)return;try{return h(k,e,r?t:O&&v[e]||t)}catch(s){}}for(n in I)a=o[n],!a||a[e]&&!r||h(a,e,t)}};for(n in I)o[n]||(O=!1);if((!O||"function"!=typeof k||k===Function.prototype)&&(k=function(){throw TypeError("Incorrect invocation")},O))for(n in I)o[n]&&p(o[n],k);if((!O||!S||S===x)&&(S=k.prototype,O))for(n in I)o[n]&&p(o[n].prototype,S);if(O&&d(w)!==S&&p(w,S),i&&!c(S,A))for(n in T=!0,f(S,A,{get:function(){return s(this)?this[E]:void 0}}),I)o[n]&&u(o[n],E,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:O,TYPED_ARRAY_TAG:T&&E,aTypedArray:F,aTypedArrayConstructor:R,exportTypedArrayMethod:M,exportTypedArrayStaticMethod:B,isView:P,isTypedArray:_,TypedArray:k,TypedArrayPrototype:S}},function(e,t){e.exports="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView},function(e,t,r){var n=r(28),a=r(63),i=r(57),o=i("species");e.exports=function(e,t){var r,i=n(e).constructor;return void 0===i||void 0==(r=n(i)[o])?t:a(r)}},function(e,t,r){r(118),r(77),r(120),r(122),r(136),r(137);var n=r(43);e.exports=n.Promise},function(e,t,r){var n=r(96),a=r(29),i=r(119);n||a(Object.prototype,"toString",i,{unsafe:!0})},function(e,t,r){"use strict";var n=r(96),a=r(95);e.exports=n?{}.toString:function(){return"[object "+a(this)+"]"}},function(e,t,r){var n=r(11),a=r(121),i=r(102),o=r(26),s=r(57),c=s("iterator"),l=s("toStringTag"),u=i.values;for(var h in a){var f=n[h],d=f&&f.prototype;if(d){if(d[c]!==u)try{o(d,c,u)}catch(g){d[c]=u}if(d[l]||o(d,l,h),a[h])for(var p in i)if(d[p]!==i[p])try{o(d,p,i[p])}catch(g){d[p]=i[p]}}}},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,a,i,o,s=r(10),c=r(37),l=r(11),u=r(42),h=r(123),f=r(29),d=r(124),p=r(85),g=r(125),m=r(22),v=r(63),b=r(126),y=r(19),w=r(31),k=r(104),S=r(97),x=r(116),C=r(127).set,A=r(130),E=r(131),O=r(133),T=r(132),I=r(134),P=r(33),_=r(52),F=r(57),R=r(135),M=F("species"),B="Promise",L=P.get,D=P.set,N=P.getterFor(B),U=h,j=l.TypeError,q=l.document,z=l.process,G=u("fetch"),H=T.f,W=H,X="process"==y(z),V=!!(q&&q.createEvent&&l.dispatchEvent),Y="unhandledrejection",K="rejectionhandled",J=0,Z=1,Q=2,$=1,ee=2,te=_(B,(function(){var e=w(U)!==String(U);if(!e){if(66===R)return!0;if(!X&&"function"!=typeof PromiseRejectionEvent)return!0}if(c&&!U.prototype["finally"])return!0;if(R>=51&&/native code/.test(U))return!1;var t=U.resolve(1),r=function(e){e((function(){}),(function(){}))},n=t.constructor={};return n[M]=r,!(t.then((function(){}))instanceof r)})),re=te||!S((function(e){U.all(e)["catch"]((function(){}))})),ne=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},ae=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;A((function(){var a=t.value,i=t.state==Z,o=0;while(n.length>o){var s,c,l,u=n[o++],h=i?u.ok:u.fail,f=u.resolve,d=u.reject,p=u.domain;try{h?(i||(t.rejection===ee&&ce(e,t),t.rejection=$),!0===h?s=a:(p&&p.enter(),s=h(a),p&&(p.exit(),l=!0)),s===u.promise?d(j("Promise-chain cycle")):(c=ne(s))?c.call(s,f,d):f(s)):d(a)}catch(g){p&&!l&&p.exit(),d(g)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&oe(e,t)}))}},ie=function(e,t,r){var n,a;V?(n=q.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),l.dispatchEvent(n)):n={promise:t,reason:r},(a=l["on"+e])?a(n):e===Y&&O("Unhandled promise rejection",r)},oe=function(e,t){C.call(l,(function(){var r,n=t.value,a=se(t);if(a&&(r=I((function(){X?z.emit("unhandledRejection",n,e):ie(Y,e,n)})),t.rejection=X||se(t)?ee:$,r.error))throw r.value}))},se=function(e){return e.rejection!==$&&!e.parent},ce=function(e,t){C.call(l,(function(){X?z.emit("rejectionHandled",e):ie(K,e,t.value)}))},le=function(e,t,r,n){return function(a){e(t,r,a,n)}},ue=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=Q,ae(e,t,!0))},he=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw j("Promise can't be resolved itself");var a=ne(r);a?A((function(){var n={done:!1};try{a.call(r,le(he,e,n,t),le(ue,e,n,t))}catch(i){ue(e,n,i,t)}})):(t.value=r,t.state=Z,ae(e,t,!1))}catch(i){ue(e,{done:!1},i,t)}}};te&&(U=function(e){b(this,U,B),v(e),n.call(this);var t=L(this);try{e(le(he,this,t),le(ue,this,t))}catch(r){ue(this,t,r)}},n=function(e){D(this,{type:B,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:J,value:void 0})},n.prototype=d(U.prototype,{then:function(e,t){var r=N(this),n=H(x(this,U));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=X?z.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)}}),a=function(){var e=new n,t=L(e);this.promise=e,this.resolve=le(he,e,t),this.reject=le(ue,e,t)},T.f=H=function(e){return e===U||e===i?new a(e):W(e)},c||"function"!=typeof h||(o=h.prototype.then,f(h.prototype,"then",(function(e,t){var r=this;return new U((function(e,t){o.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof G&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return E(U,G.apply(l,arguments))}}))),s({global:!0,wrap:!0,forced:te},{Promise:U}),p(U,B,!1,!0),g(B),i=u(B),s({target:B,stat:!0,forced:te},{reject:function(e){var t=H(this);return t.reject.call(void 0,e),t.promise}}),s({target:B,stat:!0,forced:c||te},{resolve:function(e){return E(c&&this===i?U:this,e)}}),s({target:B,stat:!0,forced:re},{all:function(e){var t=this,r=H(t),n=r.resolve,a=r.reject,i=I((function(){var r=v(t.resolve),i=[],o=0,s=1;k(e,(function(e){var c=o++,l=!1;i.push(void 0),s++,r.call(t,e).then((function(e){l||(l=!0,i[c]=e,--s||n(i))}),a)})),--s||n(i)}));return i.error&&a(i.value),r.promise},race:function(e){var t=this,r=H(t),n=r.reject,a=I((function(){var a=v(t.resolve);k(e,(function(e){a.call(t,e).then(r.resolve,n)}))}));return a.error&&n(a.value),r.promise}})},function(e,t,r){var n=r(11);e.exports=n.Promise},function(e,t,r){var n=r(29);e.exports=function(e,t,r){for(var a in t)n(e,a,t[a],r);return e}},function(e,t,r){"use strict";var n=r(42),a=r(27),i=r(57),o=r(13),s=i("species");e.exports=function(e){var t=n(e),r=a.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,a,i,o=r(11),s=r(14),c=r(19),l=r(62),u=r(74),h=r(25),f=r(128),d=o.location,p=o.setImmediate,g=o.clearImmediate,m=o.process,v=o.MessageChannel,b=o.Dispatch,y=0,w={},k="onreadystatechange",S=function(e){if(w.hasOwnProperty(e)){var t=w[e];delete w[e],t()}},x=function(e){return function(){S(e)}},C=function(e){S(e.data)},A=function(e){o.postMessage(e+"",d.protocol+"//"+d.host)};p&&g||(p=function(e){var t=[],r=1;while(arguments.length>r)t.push(arguments[r++]);return w[++y]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},n(y),y},g=function(e){delete w[e]},"process"==c(m)?n=function(e){m.nextTick(x(e))}:b&&b.now?n=function(e){b.now(x(e))}:v&&!f?(a=new v,i=a.port2,a.port1.onmessage=C,n=l(i.postMessage,i,1)):!o.addEventListener||"function"!=typeof postMessage||o.importScripts||s(A)||"file:"===d.protocol?n=k in h("script")?function(e){u.appendChild(h("script"))[k]=function(){u.removeChild(this),S(e)}}:function(e){setTimeout(x(e),0)}:(n=A,o.addEventListener("message",C,!1))),e.exports={set:p,clear:g}},function(e,t,r){var n=r(129);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(n)},function(e,t,r){var n=r(42);e.exports=n("navigator","userAgent")||""},function(e,t,r){var n,a,i,o,s,c,l,u,h=r(11),f=r(12).f,d=r(19),p=r(127).set,g=r(128),m=h.MutationObserver||h.WebKitMutationObserver,v=h.process,b=h.Promise,y="process"==d(v),w=f(h,"queueMicrotask"),k=w&&w.value;k||(n=function(){var e,t;y&&(e=v.domain)&&e.exit();while(a){t=a.fn,a=a.next;try{t()}catch(r){throw a?o():i=void 0,r}}i=void 0,e&&e.enter()},y?o=function(){v.nextTick(n)}:m&&!g?(s=!0,c=document.createTextNode(""),new m(n).observe(c,{characterData:!0}),o=function(){c.data=s=!s}):b&&b.resolve?(l=b.resolve(void 0),u=l.then,o=function(){u.call(l,n)}):o=function(){p.call(h,n)}),e.exports=k||function(e){var t={fn:e,next:void 0};i&&(i.next=t),a||(a=t,o()),i=t}},function(e,t,r){var n=r(28),a=r(22),i=r(132);e.exports=function(e,t){if(n(e),a(t)&&t.constructor===e)return t;var r=i.f(e),o=r.resolve;return o(t),r.promise}},function(e,t,r){"use strict";var n=r(63),a=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 a(e)}},function(e,t,r){var n=r(11);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){var n,a,i=r(11),o=r(129),s=i.process,c=s&&s.versions,l=c&&c.v8;l?(n=l.split("."),a=n[0]+n[1]):o&&(n=o.match(/Edge\/(\d+)/),(!n||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/),n&&(a=n[1]))),e.exports=a&&+a},function(e,t,r){"use strict";var n=r(10),a=r(63),i=r(132),o=r(134),s=r(104);n({target:"Promise",stat:!0},{allSettled:function(e){var t=this,r=i.f(t),n=r.resolve,c=r.reject,l=o((function(){var r=a(t.resolve),i=[],o=0,c=1;s(e,(function(e){var a=o++,s=!1;i.push(void 0),c++,r.call(t,e).then((function(e){s||(s=!0,i[a]={status:"fulfilled",value:e},--c||n(i))}),(function(e){s||(s=!0,i[a]={status:"rejected",reason:e},--c||n(i))}))})),--c||n(i)}));return l.error&&c(l.value),r.promise}})},function(e,t,r){"use strict";var n=r(10),a=r(37),i=r(123),o=r(14),s=r(42),c=r(116),l=r(131),u=r(29),h=!!i&&o((function(){i.prototype["finally"].call({then:function(){}},(function(){}))}));n({target:"Promise",proto:!0,real:!0,forced:h},{finally:function(e){var t=c(this,s("Promise")),r="function"==typeof e;return this.then(r?function(r){return l(t,e()).then((function(){return r}))}:e,r?function(r){return l(t,e()).then((function(){throw r}))}:e)}}),a||"function"!=typeof i||i.prototype["finally"]||u(i.prototype,"finally",s("Promise").prototype["finally"])},function(e,t,r){r(139),r(144),r(142);var n=r(43);e.exports=n.URL},function(e,t,r){"use strict";r(77);var n,a=r(10),i=r(13),o=r(140),s=r(11),c=r(72),l=r(29),u=r(126),h=r(23),f=r(100),d=r(90),p=r(78).codeAt,g=r(141),m=r(85),v=r(142),b=r(33),y=s.URL,w=v.URLSearchParams,k=v.getState,S=b.set,x=b.getterFor("URL"),C=Math.floor,A=Math.pow,E="Invalid authority",O="Invalid scheme",T="Invalid host",I="Invalid port",P=/[A-Za-z]/,_=/[\d+-.A-Za-z]/,F=/\d/,R=/^(0x|0X)/,M=/^[0-7]+$/,B=/^\d+$/,L=/^[\dA-Fa-f]+$/,D=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,N=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,U=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,j=/[\u0009\u000A\u000D]/g,q=function(e,t){var r,n,a;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return T;if(r=G(t.slice(1,-1)),!r)return T;e.host=r}else if(Q(e)){if(t=g(t),D.test(t))return T;if(r=z(t),null===r)return T;e.host=r}else{if(N.test(t))return T;for(r="",n=d(t),a=0;a4)return e;for(r=[],n=0;n1&&"0"==a.charAt(0)&&(i=R.test(a)?16:8,a=a.slice(8==i?1:2)),""===a)o=0;else{if(!(10==i?B:8==i?M:L).test(a))return e;o=parseInt(a,i)}r.push(o)}for(n=0;n=A(256,5-t))return null}else if(o>255)return null;for(s=r.pop(),n=0;n6)return;n=0;while(f()){if(a=null,n>0){if(!("."==f()&&n<4))return;h++}if(!F.test(f()))return;while(F.test(f())){if(i=parseInt(f(),10),null===a)a=i;else{if(0==a)return;a=10*a+i}if(a>255)return;h++}c[l]=256*c[l]+a,n++,2!=n&&4!=n||l++}if(4!=n)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;c[l++]=t}else{if(null!==u)return;h++,l++,u=l}}if(null!==u){o=l-u,l=7;while(0!=l&&o>0)s=c[l],c[l--]=c[u+o-1],c[u+--o]=s}else if(8!=l)return;return c},H=function(e){for(var t=null,r=1,n=null,a=0,i=0;i<8;i++)0!==e[i]?(a>r&&(t=n,r=a),n=null,a=0):(null===n&&(n=i),++a);return a>r&&(t=n,r=a),t},W=function(e){var t,r,n,a;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=C(e/256);return t.join(".")}if("object"==typeof e){for(t="",n=H(e),r=0;r<8;r++)a&&0===e[r]||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}return e},X={},V=f({},X,{" ":1,'"':1,"<":1,">":1,"`":1}),Y=f({},V,{"#":1,"?":1,"{":1,"}":1}),K=f({},Y,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),J=function(e,t){var r=p(e,0);return r>32&&r<127&&!h(t,e)?e:encodeURIComponent(e)},Z={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Q=function(e){return h(Z,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&&P.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()},ae=function(e){return"."===e||"%2e"===e.toLowerCase()},ie=function(e){return e=e.toLowerCase(),".."===e||"%2e."===e||".%2e"===e||"%2e%2e"===e},oe={},se={},ce={},le={},ue={},he={},fe={},de={},pe={},ge={},me={},ve={},be={},ye={},we={},ke={},Se={},xe={},Ce={},Ae={},Ee={},Oe=function(e,t,r,a){var i,o,s,c,l=r||oe,u=0,f="",p=!1,g=!1,m=!1;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(U,"")),t=t.replace(j,""),i=d(t);while(u<=i.length){switch(o=i[u],l){case oe:if(!o||!P.test(o)){if(r)return O;l=ce;continue}f+=o.toLowerCase(),l=se;break;case se:if(o&&(_.test(o)||"+"==o||"-"==o||"."==o))f+=o.toLowerCase();else{if(":"!=o){if(r)return O;f="",l=ce,u=0;continue}if(r&&(Q(e)!=h(Z,f)||"file"==f&&($(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=f,r)return void(Q(e)&&Z[e.scheme]==e.port&&(e.port=null));f="","file"==e.scheme?l=ye:Q(e)&&a&&a.scheme==e.scheme?l=le:Q(e)?l=de:"/"==i[u+1]?(l=ue,u++):(e.cannotBeABaseURL=!0,e.path.push(""),l=Ce)}break;case ce:if(!a||a.cannotBeABaseURL&&"#"!=o)return O;if(a.cannotBeABaseURL&&"#"==o){e.scheme=a.scheme,e.path=a.path.slice(),e.query=a.query,e.fragment="",e.cannotBeABaseURL=!0,l=Ee;break}l="file"==a.scheme?ye:he;continue;case le:if("/"!=o||"/"!=i[u+1]){l=he;continue}l=pe,u++;break;case ue:if("/"==o){l=ge;break}l=xe;continue;case he:if(e.scheme=a.scheme,o==n)e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query=a.query;else if("/"==o||"\\"==o&&Q(e))l=fe;else if("?"==o)e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query="",l=Ae;else{if("#"!=o){e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.path.pop(),l=xe;continue}e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query=a.query,e.fragment="",l=Ee}break;case fe:if(!Q(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,l=xe;continue}l=ge}else l=pe;break;case de:if(l=pe,"/"!=o||"/"!=f.charAt(u+1))continue;u++;break;case pe:if("/"!=o&&"\\"!=o){l=ge;continue}break;case ge:if("@"==o){p&&(f="%40"+f),p=!0,s=d(f);for(var v=0;v65535)return I;e.port=Q(e)&&w===Z[e.scheme]?null:w,f=""}if(r)return;l=Se;continue}return I}f+=o;break;case ye:if(e.scheme="file","/"==o||"\\"==o)l=we;else{if(!a||"file"!=a.scheme){l=xe;continue}if(o==n)e.host=a.host,e.path=a.path.slice(),e.query=a.query;else if("?"==o)e.host=a.host,e.path=a.path.slice(),e.query="",l=Ae;else{if("#"!=o){re(i.slice(u).join(""))||(e.host=a.host,e.path=a.path.slice(),ne(e)),l=xe;continue}e.host=a.host,e.path=a.path.slice(),e.query=a.query,e.fragment="",l=Ee}}break;case we:if("/"==o||"\\"==o){l=ke;break}a&&"file"==a.scheme&&!re(i.slice(u).join(""))&&(te(a.path[0],!0)?e.path.push(a.path[0]):e.host=a.host),l=xe;continue;case ke:if(o==n||"/"==o||"\\"==o||"?"==o||"#"==o){if(!r&&te(f))l=xe;else if(""==f){if(e.host="",r)return;l=Se}else{if(c=q(e,f),c)return c;if("localhost"==e.host&&(e.host=""),r)return;f="",l=Se}continue}f+=o;break;case Se:if(Q(e)){if(l=xe,"/"!=o&&"\\"!=o)continue}else if(r||"?"!=o)if(r||"#"!=o){if(o!=n&&(l=xe,"/"!=o))continue}else e.fragment="",l=Ee;else e.query="",l=Ae;break;case xe:if(o==n||"/"==o||"\\"==o&&Q(e)||!r&&("?"==o||"#"==o)){if(ie(f)?(ne(e),"/"==o||"\\"==o&&Q(e)||e.path.push("")):ae(f)?"/"==o||"\\"==o&&Q(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))while(e.path.length>1&&""===e.path[0])e.path.shift();"?"==o?(e.query="",l=Ae):"#"==o&&(e.fragment="",l=Ee)}else f+=J(o,Y);break;case Ce:"?"==o?(e.query="",l=Ae):"#"==o?(e.fragment="",l=Ee):o!=n&&(e.path[0]+=J(o,X));break;case Ae:r||"#"!=o?o!=n&&("'"==o&&Q(e)?e.query+="%27":e.query+="#"==o?"%23":J(o,X)):(e.fragment="",l=Ee);break;case Ee:o!=n&&(e.fragment+=J(o,V));break}u++}},Te=function(e){var t,r,n=u(this,Te,"URL"),a=arguments.length>1?arguments[1]:void 0,o=String(e),s=S(n,{type:"URL"});if(void 0!==a)if(a instanceof Te)t=x(a);else if(r=Oe(t={},String(a)),r)throw TypeError(r);if(r=Oe(s,o,null,t),r)throw TypeError(r);var c=s.searchParams=new w,l=k(c);l.updateSearchParams(s.query),l.updateURL=function(){s.query=String(c)||null},i||(n.href=Pe.call(n),n.origin=_e.call(n),n.protocol=Fe.call(n),n.username=Re.call(n),n.password=Me.call(n),n.host=Be.call(n),n.hostname=Le.call(n),n.port=De.call(n),n.pathname=Ne.call(n),n.search=Ue.call(n),n.searchParams=je.call(n),n.hash=qe.call(n))},Ie=Te.prototype,Pe=function(){var e=x(this),t=e.scheme,r=e.username,n=e.password,a=e.host,i=e.port,o=e.path,s=e.query,c=e.fragment,l=t+":";return null!==a?(l+="//",$(e)&&(l+=r+(n?":"+n:"")+"@"),l+=W(a),null!==i&&(l+=":"+i)):"file"==t&&(l+="//"),l+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(l+="?"+s),null!==c&&(l+="#"+c),l},_e=function(){var e=x(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&&Q(e)?t+"://"+W(e.host)+(null!==r?":"+r:""):"null"},Fe=function(){return x(this).scheme+":"},Re=function(){return x(this).username},Me=function(){return x(this).password},Be=function(){var e=x(this),t=e.host,r=e.port;return null===t?"":null===r?W(t):W(t)+":"+r},Le=function(){var e=x(this).host;return null===e?"":W(e)},De=function(){var e=x(this).port;return null===e?"":String(e)},Ne=function(){var e=x(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Ue=function(){var e=x(this).query;return e?"?"+e:""},je=function(){return x(this).searchParams},qe=function(){var e=x(this).fragment;return e?"#"+e:""},ze=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(i&&c(Ie,{href:ze(Pe,(function(e){var t=x(this),r=String(e),n=Oe(t,r);if(n)throw TypeError(n);k(t.searchParams).updateSearchParams(t.query)})),origin:ze(_e),protocol:ze(Fe,(function(e){var t=x(this);Oe(t,String(e)+":",oe)})),username:ze(Re,(function(e){var t=x(this),r=d(String(e));if(!ee(t)){t.username="";for(var n=0;n=55296&&a<=56319&&r>1,e+=m(e/t);e>g*o>>1;n+=a)e=m(e/g);return m(n+(g+1)*e/(e+s))},k=function(e){var t=[];e=b(e);var r,s,c=e.length,f=u,d=0,g=l;for(r=0;r=f&&sm((n-d)/C))throw RangeError(p);for(d+=(x-f)*C,f=x,r=0;rn)throw RangeError(p);if(s==f){for(var A=d,E=a;;E+=a){var O=E<=g?i:E>=g+o?o:E-g;if(A0?arguments[0]:void 0,u=this,d=[];if(O(u,{type:A,entries:d,updateURL:function(){},updateSearchParams:j}),void 0!==l)if(m(l))if(e=w(l),"function"===typeof e){t=e.call(l),r=t.next;while(!(n=r.call(t)).done){if(a=y(g(n.value)),i=a.next,(o=i.call(a)).done||(s=i.call(a)).done||!i.call(a).done)throw TypeError("Expected sequence with length 2");d.push({key:o.value+"",value:s.value+""})}}else for(c in l)f(l,c)&&d.push({key:c,value:l[c]+""});else U(d,"string"===typeof l?"?"===l.charAt(0)?l.slice(1):l:l+"")},H=G.prototype;s(H,{append:function(e,t){q(arguments.length,2);var r=T(this);r.entries.push({key:e+"",value:t+""}),r.updateURL()},delete:function(e){q(arguments.length,1);var t=T(this),r=t.entries,n=e+"",a=0;while(ae.key){a.splice(t,0,e);break}t===r&&a.push(e)}n.updateURL()},forEach:function(e){var t,r=T(this).entries,n=d(e,arguments.length>1?arguments[1]:void 0,3),a=0;while(a1&&(t=arguments[1],m(t)&&(r=t.body,p(r)===A&&(n=t.headers?new x(t.headers):new x,n.has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=v(t,{body:b(0,String(r)),headers:b(0,n)}))),a.push(t)),S.apply(this,a)}}),e.exports={URLSearchParams:G,getState:T}},function(e,t,r){var n=r(28),a=r(94);e.exports=function(e){var t=a(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return n(t.call(e))}},function(e,t,r){"use strict";var n=r(10);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},function(e,t,r){(function(e,r){r(t)})(0,(function(e){"use strict";var t="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?Symbol:function(e){return"Symbol("+e+")"};function r(){}var n=Number.isNaN||function(e){return e!==e},a=r;function i(e){return"object"===typeof e&&null!==e||"function"===typeof e}function o(e){return e.slice()}function s(e,t,r,n,a){new Uint8Array(e).set(new Uint8Array(r,n,a),t)}function c(e){return!1!==l(e)&&e!==1/0}function l(e){return"number"===typeof e&&(!n(e)&&!(e<0))}function u(e,t,r){if("function"!==typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function h(e,t,r,n){var a=e[t];if(void 0!==a){if("function"!==typeof a)throw new TypeError(a+" is not a method");switch(r){case 0:return function(){return d(a,e,n)};case 1:return function(t){var r=[t].concat(n);return d(a,e,r)}}}return function(){return x(void 0)}}function f(e,t,r){var n=e[t];if(void 0!==n)return u(n,e,r)}function d(e,t,r){try{return x(u(e,t,r))}catch(n){return C(n)}}function p(e){return e}function g(e){return!1}function m(e){if(e=Number(e),n(e)||e<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return e}function v(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)}}var b=Promise,y=Promise.prototype.then,w=Promise.resolve.bind(b),k=Promise.reject.bind(b);function S(e){return new b(e)}function x(e){return w(e)}function C(e){return k(e)}function A(e,t,r){return y.call(e,t,r)}function E(e,t,r){A(A(e,t,r),void 0,a)}function O(e,t){E(e,t)}function T(e,t){E(e,void 0,t)}function I(e,t,r){return A(e,t,r)}function P(e){A(e,void 0,a)}var _=16384,F=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===_-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,a=e._elements,i=a[r];return n===_&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),a[r]=void 0,i},e.prototype.forEach=function(e){var t=this._cursor,r=this._front,n=r._elements;while(t!==n.length||void 0!==r._next){if(t===n.length&&(r=r._next,n=r._elements,t=0,0===n.length))break;e(n[t]),++t}},e.prototype.peek=function(){var e=this._front,t=this._cursor;return e._elements[t]},e}();function R(e,t,r){var n=null;!0===r&&(n=Object.prototype);var a=Object.create(n);return a.value=e,a.done=t,a}function M(e,t){e._forAuthorCode=!0,e._ownerReadableStream=t,t._reader=e,"readable"===t._state?N(e):"closed"===t._state?j(e):U(e,t._storedError)}function B(e,t){var r=e._ownerReadableStream;return Lr(r,t)}function L(e){"readable"===e._ownerReadableStream._state?q(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):z(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 D(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function N(e){e._closedPromise=S((function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function U(e,t){N(e),q(e,t)}function j(e){N(e),G(e)}function q(e,t){P(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function z(e,t){U(e,t)}function G(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}var H=t("[[CancelSteps]]"),W=t("[[PullSteps]]");function X(e,t){void 0===t&&(t=!1);var r=new $(e);return r._forAuthorCode=t,r}function V(e){var t=S((function(t,r){var n={_resolve:t,_reject:r};e._reader._readRequests.push(n)}));return t}function Y(e,t,r){var n=e._reader,a=n._readRequests.shift();a._resolve(R(t,r,n._forAuthorCode))}function K(e){return e._reader._readRequests.length}function J(e){var t=e._reader;return void 0!==t&&!!ee(t)}var Z,Q,$=function(){function e(e){if(!1===Mr(e))throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===Br(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");M(this,e),this._readRequests=new F}return Object.defineProperty(e.prototype,"closed",{get:function(){return ee(this)?this._closedPromise:C(re("closed"))},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return ee(this)?void 0===this._ownerReadableStream?C(D("cancel")):B(this,e):C(re("cancel"))},e.prototype.read=function(){return ee(this)?void 0===this._ownerReadableStream?C(D("read from")):te(this):C(re("read"))},e.prototype.releaseLock=function(){if(!ee(this))throw re("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");L(this)}},e}();function ee(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function te(e){var t=e._ownerReadableStream;return t._disturbed=!0,"closed"===t._state?x(R(void 0,!0,e._forAuthorCode)):"errored"===t._state?C(t._storedError):t._readableStreamController[W]()}function re(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}"symbol"===typeof t.asyncIterator&&(Z={},Z[t.asyncIterator]=function(){return this},Q=Z,Object.defineProperty(Q,t.asyncIterator,{enumerable:!1}));var ne={next:function(){if(!1===ie(this))return C(oe("next"));var e=this._asyncIteratorReader;return void 0===e._ownerReadableStream?C(D("iterate")):I(te(e),(function(t){var r=t.done;r&&L(e);var n=t.value;return R(n,r,!0)}))},return:function(e){if(!1===ie(this))return C(oe("next"));var t=this._asyncIteratorReader;if(void 0===t._ownerReadableStream)return C(D("finish iterating"));if(t._readRequests.length>0)return C(new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this._preventCancel){var r=B(t,e);return L(t),I(r,(function(){return R(e,!0,!0)}))}return L(t),x(R(e,!0,!0))}};function ae(e,t){void 0===t&&(t=!1);var r=X(e),n=Object.create(ne);return n._asyncIteratorReader=r,n._preventCancel=Boolean(t),n}function ie(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorReader")}function oe(e){return new TypeError("ReadableStreamAsyncIterator."+e+" can only be used on a ReadableSteamAsyncIterator")}function se(e){var t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function ce(e,t,r){if(r=Number(r),!c(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 le(e){var t=e._queue.peek();return t.value}function ue(e){e._queue=new F,e._queueTotalSize=0}void 0!==Q&&Object.setPrototypeOf(ne,Q),Object.defineProperty(ne,"next",{enumerable:!1}),Object.defineProperty(ne,"return",{enumerable:!1});var he=t("[[AbortSteps]]"),fe=t("[[ErrorSteps]]"),de=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),me(this);var r=t.size,n=t.highWaterMark,a=e.type;if(void 0!==a)throw new RangeError("Invalid type is specified");var i=v(r);void 0===n&&(n=1),n=m(n),Ye(this,e,n,i)}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!1===ve(this))throw ot("locked");return be(this)},enumerable:!0,configurable:!0}),e.prototype.abort=function(e){return!1===ve(this)?C(ot("abort")):!0===be(this)?C(new TypeError("Cannot abort a stream that already has a writer")):ye(this,e)},e.prototype.close=function(){return!1===ve(this)?C(ot("close")):!0===be(this)?C(new TypeError("Cannot close a stream that already has a writer")):!0===Ie(this)?C(new TypeError("Cannot close an already-closing stream")):we(this)},e.prototype.getWriter=function(){if(!1===ve(this))throw ot("getWriter");return pe(this)},e}();function pe(e){return new Be(e)}function ge(e,t,r,n,a,i){void 0===a&&(a=1),void 0===i&&(i=function(){return 1});var o=Object.create(de.prototype);me(o);var s=Object.create(We.prototype);return Ve(o,s,e,t,r,n,a,i),o}function me(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new F,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function ve(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function be(e){return void 0!==e._writer}function ye(e,t){var r=e._state;if("closed"===r||"errored"===r)return x(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var n=!1;"erroring"===r&&(n=!0,t=void 0);var a=S((function(r,a){e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:a,_reason:t,_wasAlreadyErroring:n}}));return e._pendingAbortRequest._promise=a,!1===n&&xe(e,t),a}function we(e){var t=e._state;if("closed"===t||"errored"===t)return C(new TypeError("The stream (in "+t+" state) is not in the writable state and cannot be closed"));var r=S((function(t,r){var n={_resolve:t,_reject:r};e._closeRequest=n})),n=e._writer;return void 0!==n&&!0===e._backpressure&&"writable"===t&&kt(n),Je(e._writableStreamController),r}function ke(e){var t=S((function(t,r){var n={_resolve:t,_reject:r};e._writeRequests.push(n)}));return t}function Se(e,t){var r=e._state;"writable"!==r?Ce(e):xe(e,t)}function xe(e,t){var r=e._writableStreamController;e._state="erroring",e._storedError=t;var n=e._writer;void 0!==n&&qe(n,t),!1===Pe(e)&&!0===r._started&&Ce(e)}function Ce(e){e._state="errored",e._writableStreamController[fe]();var t=e._storedError;if(e._writeRequests.forEach((function(e){e._reject(t)})),e._writeRequests=new F,void 0!==e._pendingAbortRequest){var r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,!0===r._wasAlreadyErroring)return r._reject(t),void Re(e);var n=e._writableStreamController[he](r._reason);E(n,(function(){r._resolve(),Re(e)}),(function(t){r._reject(t),Re(e)}))}else Re(e)}function Ae(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}function Ee(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,Se(e,t)}function Oe(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&&pt(r)}function Te(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),Se(e,t)}function Ie(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function Pe(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}function _e(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0}function Fe(e){e._inFlightWriteRequest=e._writeRequests.shift()}function Re(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var t=e._writer;void 0!==t&&ft(t,e._storedError)}function Me(e,t){var r=e._writer;void 0!==r&&t!==e._backpressure&&(!0===t?yt(r):kt(r)),e._backpressure=t}var Be=function(){function e(e){if(!1===ve(e))throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===be(e))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)!1===Ie(e)&&!0===e._backpressure?gt(this):vt(this),lt(this);else if("erroring"===t)mt(this,e._storedError),lt(this);else if("closed"===t)vt(this),ht(this);else{var r=e._storedError;mt(this,r),ut(this,r)}}return Object.defineProperty(e.prototype,"closed",{get:function(){return!1===Le(this)?C(st("closed")):this._closedPromise},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===Le(this))throw st("desiredSize");if(void 0===this._ownerWritableStream)throw ct("desiredSize");return ze(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return!1===Le(this)?C(st("ready")):this._readyPromise},enumerable:!0,configurable:!0}),e.prototype.abort=function(e){return!1===Le(this)?C(st("abort")):void 0===this._ownerWritableStream?C(ct("abort")):De(this,e)},e.prototype.close=function(){if(!1===Le(this))return C(st("close"));var e=this._ownerWritableStream;return void 0===e?C(ct("close")):!0===Ie(e)?C(new TypeError("Cannot close an already-closing stream")):Ne(this)},e.prototype.releaseLock=function(){if(!1===Le(this))throw st("releaseLock");var e=this._ownerWritableStream;void 0!==e&&Ge(this)},e.prototype.write=function(e){return!1===Le(this)?C(st("write")):void 0===this._ownerWritableStream?C(ct("write to")):He(this,e)},e}();function Le(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function De(e,t){var r=e._ownerWritableStream;return ye(r,t)}function Ne(e){var t=e._ownerWritableStream;return we(t)}function Ue(e){var t=e._ownerWritableStream,r=t._state;return!0===Ie(t)||"closed"===r?x(void 0):"errored"===r?C(t._storedError):Ne(e)}function je(e,t){"pending"===e._closedPromiseState?ft(e,t):dt(e,t)}function qe(e,t){"pending"===e._readyPromiseState?bt(e,t):wt(e,t)}function ze(e){var t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:Qe(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");qe(e,r),je(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function He(e,t){var r=e._ownerWritableStream,n=r._writableStreamController,a=Ze(n,t);if(r!==e._ownerWritableStream)return C(ct("write to"));var i=r._state;if("errored"===i)return C(r._storedError);if(!0===Ie(r)||"closed"===i)return C(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===i)return C(r._storedError);var o=ke(r);return $e(n,t,a),o}var We=function(){function e(){throw new TypeError("WritableStreamDefaultController cannot be constructed explicitly")}return e.prototype.error=function(e){if(!1===Xe(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");var t=this._controlledWritableStream._state;"writable"===t&&it(this,e)},e.prototype[he]=function(e){var t=this._abortAlgorithm(e);return Ke(this),t},e.prototype[fe]=function(){ue(this)},e}();function Xe(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")}function Ve(e,t,r,n,a,i,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,ue(t),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=n,t._closeAlgorithm=a,t._abortAlgorithm=i;var c=at(t);Me(e,c);var l=r(),u=x(l);E(u,(function(){t._started=!0,et(t)}),(function(r){t._started=!0,Se(e,r)}))}function Ye(e,t,r,n){var a=Object.create(We.prototype);function i(){return f(t,"start",[a])}var o=h(t,"write",1,[a]),s=h(t,"close",0,[]),c=h(t,"abort",1,[]);Ve(e,a,i,o,s,c,r,n)}function Ke(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Je(e){ce(e,"close",0),et(e)}function Ze(e,t){try{return e._strategySizeAlgorithm(t)}catch(r){return tt(e,r),1}}function Qe(e){return e._strategyHWM-e._queueTotalSize}function $e(e,t,r){var n={chunk:t};try{ce(e,n,r)}catch(o){return void tt(e,o)}var a=e._controlledWritableStream;if(!1===Ie(a)&&"writable"===a._state){var i=at(e);Me(a,i)}et(e)}function et(e){var t=e._controlledWritableStream;if(!1!==e._started&&void 0===t._inFlightWriteRequest){var r=t._state;if("erroring"!==r){if(0!==e._queue.length){var n=le(e);"close"===n?rt(e):nt(e,n.chunk)}}else Ce(t)}}function tt(e,t){"writable"===e._controlledWritableStream._state&&it(e,t)}function rt(e){var t=e._controlledWritableStream;_e(t),se(e);var r=e._closeAlgorithm();Ke(e),E(r,(function(){Oe(t)}),(function(e){Te(t,e)}))}function nt(e,t){var r=e._controlledWritableStream;Fe(r);var n=e._writeAlgorithm(t);E(n,(function(){Ae(r);var t=r._state;if(se(e),!1===Ie(r)&&"writable"===t){var n=at(e);Me(r,n)}et(e)}),(function(t){"writable"===r._state&&Ke(e),Ee(r,t)}))}function at(e){var t=Qe(e);return t<=0}function it(e,t){var r=e._controlledWritableStream;Ke(e),xe(r,t)}function ot(e){return new TypeError("WritableStream.prototype."+e+" can only be used on a WritableStream")}function st(e){return new TypeError("WritableStreamDefaultWriter.prototype."+e+" can only be used on a WritableStreamDefaultWriter")}function ct(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function lt(e){e._closedPromise=S((function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function ut(e,t){lt(e),ft(e,t)}function ht(e){lt(e),pt(e)}function ft(e,t){P(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected"}function dt(e,t){ut(e,t)}function pt(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved"}function gt(e){e._readyPromise=S((function(t,r){e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function mt(e,t){gt(e),bt(e,t)}function vt(e){gt(e),kt(e)}function bt(e,t){P(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected"}function yt(e){gt(e)}function wt(e,t){mt(e,t)}function kt(e){e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled"}function St(e){if("object"!==typeof e||null===e)return!1;try{return"boolean"===typeof e.aborted}catch(Z){return!1}}var xt="undefined"!==typeof DOMException?DOMException:void 0;function Ct(e){if("function"!==typeof e&&"object"!==typeof e)return!1;try{return new e,!0}catch(Z){return!1}}function At(){var e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}var Et=Ct(xt)?xt:At();function Ot(e,t,n,a,i,o){var s=X(e),c=pe(t);e._disturbed=!0;var l=!1,u=x(void 0);return S((function(h,f){var d;if(void 0!==o){if(d=function(){var r=new Et("Aborted","AbortError"),n=[];!1===a&&n.push((function(){return"writable"===t._state?ye(t,r):x(void 0)})),!1===i&&n.push((function(){return"readable"===e._state?Lr(e,r):x(void 0)})),w((function(){return Promise.all(n.map((function(e){return e()})))}),!0,r)},!0===o.aborted)return void d();o.addEventListener("abort",d)}function p(){return S((function(e,t){function r(n){n?e():A(g(),r,t)}r(!1)}))}function g(){return!0===l?x(!0):A(c._readyPromise,(function(){return A(te(s),(function(e){return!0===e.done||(u=A(He(c,e.value),void 0,r),!1)}))}))}if(b(e,s._closedPromise,(function(e){!1===a?w((function(){return ye(t,e)}),!0,e):k(!0,e)})),b(t,c._closedPromise,(function(t){!1===i?w((function(){return Lr(e,t)}),!0,t):k(!0,t)})),y(e,s._closedPromise,(function(){!1===n?w((function(){return Ue(c)})):k()})),!0===Ie(t)||"closed"===t._state){var m=new TypeError("the destination writable stream closed before all data could be piped to it");!1===i?w((function(){return Lr(e,m)}),!0,m):k(!0,m)}function v(){var e=u;return A(u,(function(){return e!==u?v():void 0}))}function b(e,t,r){"errored"===e._state?r(e._storedError):T(t,r)}function y(e,t,r){"closed"===e._state?r():O(t,r)}function w(e,r,n){function a(){E(e(),(function(){return C(r,n)}),(function(e){return C(!0,e)}))}!0!==l&&(l=!0,"writable"===t._state&&!1===Ie(t)?O(v(),a):a())}function k(e,r){!0!==l&&(l=!0,"writable"===t._state&&!1===Ie(t)?O(v(),(function(){return C(e,r)})):C(e,r))}function C(e,t){Ge(c),L(s),void 0!==o&&o.removeEventListener("abort",d),e?f(t):h(void 0)}P(p())}))}var Tt=function(){function e(){throw new TypeError}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===It(this))throw qt("desiredSize");return Lt(this)},enumerable:!0,configurable:!0}),e.prototype.close=function(){if(!1===It(this))throw qt("close");if(!1===Nt(this))throw new TypeError("The stream is not in a state that permits close");Rt(this)},e.prototype.enqueue=function(e){if(!1===It(this))throw qt("enqueue");if(!1===Nt(this))throw new TypeError("The stream is not in a state that permits enqueue");return Mt(this,e)},e.prototype.error=function(e){if(!1===It(this))throw qt("error");Bt(this,e)},e.prototype[H]=function(e){ue(this);var t=this._cancelAlgorithm(e);return Ft(this),t},e.prototype[W]=function(){var e=this._controlledReadableStream;if(this._queue.length>0){var t=se(this);return!0===this._closeRequested&&0===this._queue.length?(Ft(this),Dr(e)):Pt(this),x(R(t,!1,e._reader._forAuthorCode))}var r=V(e);return Pt(this),r},e}();function It(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function Pt(e){var t=_t(e);if(!1!==t)if(!0!==e._pulling){e._pulling=!0;var r=e._pullAlgorithm();E(r,(function(){e._pulling=!1,!0===e._pullAgain&&(e._pullAgain=!1,Pt(e))}),(function(t){Bt(e,t)}))}else e._pullAgain=!0}function _t(e){var t=e._controlledReadableStream;if(!1===Nt(e))return!1;if(!1===e._started)return!1;if(!0===Br(t)&&K(t)>0)return!0;var r=Lt(e);return r>0}function Ft(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Rt(e){var t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(Ft(e),Dr(t))}function Mt(e,t){var r=e._controlledReadableStream;if(!0===Br(r)&&K(r)>0)Y(r,t,!1);else{var n=void 0;try{n=e._strategySizeAlgorithm(t)}catch(a){throw Bt(e,a),a}try{ce(e,t,n)}catch(i){throw Bt(e,i),i}}Pt(e)}function Bt(e,t){var r=e._controlledReadableStream;"readable"===r._state&&(ue(e),Ft(e),Nr(r,t))}function Lt(e){var t=e._controlledReadableStream,r=t._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function Dt(e){return!0!==_t(e)}function Nt(e){var t=e._controlledReadableStream._state;return!1===e._closeRequested&&"readable"===t}function Ut(e,t,r,n,a,i,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,ue(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=i,t._pullAlgorithm=n,t._cancelAlgorithm=a,e._readableStreamController=t;var s=r();E(x(s),(function(){t._started=!0,Pt(t)}),(function(e){Bt(t,e)}))}function jt(e,t,r,n){var a=Object.create(Tt.prototype);function i(){return f(t,"start",[a])}var o=h(t,"pull",0,[a]),s=h(t,"cancel",1,[]);Ut(e,a,i,o,s,r,n)}function qt(e){return new TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function zt(e,t){var r,n,a,i,s,c=X(e),l=!1,u=!1,h=!1,f=S((function(e){s=e}));function d(){if(!0===l)return x(void 0);l=!0;var e=I(te(c),(function(e){l=!1;var t=e.done;if(!0===t)return!1===u&&Rt(a._readableStreamController),void(!1===h&&Rt(i._readableStreamController));var r=e.value,n=r,o=r;!1===u&&Mt(a._readableStreamController,n),!1===h&&Mt(i._readableStreamController,o)}));return P(e),x(void 0)}function p(t){if(u=!0,r=t,!0===h){var a=o([r,n]),i=Lr(e,a);s(i)}return f}function g(t){if(h=!0,n=t,!0===u){var a=o([r,n]),i=Lr(e,a);s(i)}return f}function m(){}return a=Fr(m,d,p),i=Fr(m,d,g),T(c._closedPromise,(function(e){Bt(a._readableStreamController,e),Bt(i._readableStreamController,e)})),[a,i]}var Gt=Number.isInteger||function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e},Ht=function(){function e(){throw new TypeError("ReadableStreamBYOBRequest cannot be used directly")}return Object.defineProperty(e.prototype,"view",{get:function(){if(!1===Vt(this))throw wr("view");return this._view},enumerable:!0,configurable:!0}),e.prototype.respond=function(e){if(!1===Vt(this))throw wr("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");g(this._view.buffer),gr(this._associatedReadableByteStreamController,e)},e.prototype.respondWithNewView=function(e){if(!1===Vt(this))throw wr("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");g(e.buffer),mr(this._associatedReadableByteStreamController,e)},e}(),Wt=function(){function e(){throw new TypeError("ReadableByteStreamController constructor cannot be used directly")}return Object.defineProperty(e.prototype,"byobRequest",{get:function(){if(!1===Xt(this))throw kr("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(Ht.prototype);yr(r,this,t),this._byobRequest=r}return this._byobRequest},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===Xt(this))throw kr("desiredSize");return pr(this)},enumerable:!0,configurable:!0}),e.prototype.close=function(){if(!1===Xt(this))throw kr("close");if(!0===this._closeRequested)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");hr(this)},e.prototype.enqueue=function(e){if(!1===Xt(this))throw kr("enqueue");if(!0===this._closeRequested)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");g(e.buffer),fr(this,e)},e.prototype.error=function(e){if(!1===Xt(this))throw kr("error");dr(this,e)},e.prototype[H]=function(e){if(this._pendingPullIntos.length>0){var t=this._pendingPullIntos.peek();t.bytesFilled=0}ue(this);var r=this._cancelAlgorithm(e);return ur(this),r},e.prototype[W]=function(){var e=this._controlledReadableByteStream;if(this._queueTotalSize>0){var t=this._queue.shift();this._queueTotalSize-=t.byteLength,tr(this);var r=void 0;try{r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}catch(s){return C(s)}return x(R(r,!1,e._reader._forAuthorCode))}var n=this._autoAllocateChunkSize;if(void 0!==n){var a=void 0;try{a=new ArrayBuffer(n)}catch(c){return C(c)}var i={buffer:a,byteOffset:0,byteLength:n,bytesFilled:0,elementSize:1,ctor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}var o=V(e);return Yt(this),o},e}();function Xt(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function Vt(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function Yt(e){var t=lr(e);if(!1!==t)if(!0!==e._pulling){e._pulling=!0;var r=e._pullAlgorithm();E(r,(function(){e._pulling=!1,!0===e._pullAgain&&(e._pullAgain=!1,Yt(e))}),(function(t){dr(e,t)}))}else e._pullAgain=!0}function Kt(e){rr(e),e._pendingPullIntos=new F}function Jt(e,t){var r=!1;"closed"===e._state&&(r=!0);var n=Zt(t);"default"===t.readerType?Y(e,n,r):Cr(e,n,r)}function Zt(e){var t=e.bytesFilled,r=e.elementSize;return new e.ctor(e.buffer,e.byteOffset,t/r)}function Qt(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function $t(e,t){var r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,a=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),i=t.bytesFilled+a,o=i-i%r,c=a,l=!1;o>n&&(c=o-t.bytesFilled,l=!0);var u=e._queue;while(c>0){var h=u.peek(),f=Math.min(c,h.byteLength),d=t.byteOffset+t.bytesFilled;s(t.buffer,d,h.buffer,h.byteOffset,f),h.byteLength===f?u.shift():(h.byteOffset+=f,h.byteLength-=f),e._queueTotalSize-=f,er(e,f,t),c-=f}return l}function er(e,t,r){rr(e),r.bytesFilled+=t}function tr(e){0===e._queueTotalSize&&!0===e._closeRequested?(ur(e),Dr(e._controlledReadableByteStream)):Yt(e)}function rr(e){void 0!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=void 0,e._byobRequest=void 0)}function nr(e){while(e._pendingPullIntos.length>0){if(0===e._queueTotalSize)return;var t=e._pendingPullIntos.peek();!0===$t(e,t)&&(cr(e),Jt(e._controlledReadableByteStream,t))}}function ar(e,t){var r=e._controlledReadableByteStream,n=1;t.constructor!==DataView&&(n=t.constructor.BYTES_PER_ELEMENT);var a=t.constructor,i=p(t.buffer),o={buffer:i,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:n,ctor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(o),xr(r);if("closed"===r._state){var s=new a(o.buffer,o.byteOffset,0);return x(R(s,!0,r._reader._forAuthorCode))}if(e._queueTotalSize>0){if(!0===$t(e,o)){var c=Zt(o);return tr(e),x(R(c,!1,r._reader._forAuthorCode))}if(!0===e._closeRequested){var l=new TypeError("Insufficient bytes to fill elements in the given buffer");return dr(e,l),C(l)}}e._pendingPullIntos.push(o);var u=xr(r);return Yt(e),u}function ir(e,t){t.buffer=p(t.buffer);var r=e._controlledReadableByteStream;if(!0===Er(r))while(Ar(r)>0){var n=cr(e);Jt(r,n)}}function or(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(er(e,t,r),!(r.bytesFilled0){var a=r.byteOffset+r.bytesFilled,i=r.buffer.slice(a-n,a);Qt(e,i,0,i.byteLength)}r.buffer=p(r.buffer),r.bytesFilled-=n,Jt(e._controlledReadableByteStream,r),nr(e)}}function sr(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");ir(e,r)}else or(e,t,r);Yt(e)}function cr(e){var t=e._pendingPullIntos.shift();return rr(e),t}function lr(e){var t=e._controlledReadableByteStream;if("readable"!==t._state)return!1;if(!0===e._closeRequested)return!1;if(!1===e._started)return!1;if(!0===J(t)&&K(t)>0)return!0;if(!0===Er(t)&&Ar(t)>0)return!0;var r=pr(e);return r>0}function ur(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function hr(e){var t=e._controlledReadableByteStream;if(e._queueTotalSize>0)e._closeRequested=!0;else{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 dr(e,n),n}}ur(e),Dr(t)}}function fr(e,t){var r=e._controlledReadableByteStream,n=t.buffer,a=t.byteOffset,i=t.byteLength,o=p(n);if(!0===J(r))if(0===K(r))Qt(e,o,a,i);else{var s=new Uint8Array(o,a,i);Y(r,s,!1)}else!0===Er(r)?(Qt(e,o,a,i),nr(e)):Qt(e,o,a,i);Yt(e)}function dr(e,t){var r=e._controlledReadableByteStream;"readable"===r._state&&(Kt(e),ue(e),ur(e),Nr(r,t))}function pr(e){var t=e._controlledReadableByteStream,r=t._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function gr(e,t){if(t=Number(t),!1===c(t))throw new RangeError("bytesWritten must be a finite");sr(e,t)}function mr(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,sr(e,t.byteLength)}function vr(e,t,r,n,a,i,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=void 0,t._queue=t._queueTotalSize=void 0,ue(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=m(i),t._pullAlgorithm=n,t._cancelAlgorithm=a,t._autoAllocateChunkSize=o,t._pendingPullIntos=new F,e._readableStreamController=t;var s=r();E(x(s),(function(){t._started=!0,Yt(t)}),(function(e){dr(t,e)}))}function br(e,t,r){var n=Object.create(Wt.prototype);function a(){return f(t,"start",[n])}var i=h(t,"pull",0,[n]),o=h(t,"cancel",1,[]),s=t.autoAllocateChunkSize;if(void 0!==s&&(s=Number(s),!1===Gt(s)||s<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");vr(e,n,a,i,o,r,s)}function yr(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}function wr(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function kr(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}function Sr(e,t){void 0===t&&(t=!1);var r=new Or(e);return r._forAuthorCode=t,r}function xr(e){var t=S((function(t,r){var n={_resolve:t,_reject:r};e._reader._readIntoRequests.push(n)}));return t}function Cr(e,t,r){var n=e._reader,a=n._readIntoRequests.shift();a._resolve(R(t,r,n._forAuthorCode))}function Ar(e){return e._reader._readIntoRequests.length}function Er(e){var t=e._reader;return void 0!==t&&!!Tr(t)}var Or=function(){function e(e){if(!Mr(e))throw new TypeError("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===Xt(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(Br(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");M(this,e),this._readIntoRequests=new F}return Object.defineProperty(e.prototype,"closed",{get:function(){return Tr(this)?this._closedPromise:C(Pr("closed"))},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return Tr(this)?void 0===this._ownerReadableStream?C(D("cancel")):B(this,e):C(Pr("cancel"))},e.prototype.read=function(e){return Tr(this)?void 0===this._ownerReadableStream?C(D("read from")):ArrayBuffer.isView(e)?(g(e.buffer),0===e.byteLength?C(new TypeError("view must have non-zero byteLength")):Ir(this,e)):C(new TypeError("view must be an array buffer view")):C(Pr("read"))},e.prototype.releaseLock=function(){if(!Tr(this))throw Pr("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");L(this)}},e}();function Tr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function Ir(e,t){var r=e._ownerReadableStream;return r._disturbed=!0,"errored"===r._state?C(r._storedError):ar(r._readableStreamController,t)}function Pr(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}var _r=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Rr(this);var r=t.size,n=t.highWaterMark,a=e.type,i=String(a);if("bytes"===i){if(void 0!==r)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===n&&(n=0),n=m(n),br(this,e,n)}else{if(void 0!==a)throw new RangeError("Invalid type is specified");var o=v(r);void 0===n&&(n=1),n=m(n),jt(this,e,n,o)}}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!1===Mr(this))throw Ur("locked");return Br(this)},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return!1===Mr(this)?C(Ur("cancel")):!0===Br(this)?C(new TypeError("Cannot cancel a stream that already has a reader")):Lr(this,e)},e.prototype.getReader=function(e){var t=(void 0===e?{}:e).mode;if(!1===Mr(this))throw Ur("getReader");if(void 0===t)return X(this,!0);if(t=String(t),"byob"===t)return Sr(this,!0);throw new RangeError("Invalid mode is specified")},e.prototype.pipeThrough=function(e,t){var r=e.writable,n=e.readable,a=void 0===t?{}:t,i=a.preventClose,o=a.preventAbort,s=a.preventCancel,c=a.signal;if(!1===Mr(this))throw Ur("pipeThrough");if(!1===ve(r))throw new TypeError("writable argument to pipeThrough must be a WritableStream");if(!1===Mr(n))throw new TypeError("readable argument to pipeThrough must be a ReadableStream");if(i=Boolean(i),o=Boolean(o),s=Boolean(s),void 0!==c&&!St(c))throw new TypeError("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===Br(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===be(r))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");var l=Ot(this,r,i,o,s,c);return P(l),n},e.prototype.pipeTo=function(e,t){var r=void 0===t?{}:t,n=r.preventClose,a=r.preventAbort,i=r.preventCancel,o=r.signal;return!1===Mr(this)?C(Ur("pipeTo")):!1===ve(e)?C(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(n=Boolean(n),a=Boolean(a),i=Boolean(i),void 0===o||St(o)?!0===Br(this)?C(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===be(e)?C(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Ot(this,e,n,a,i,o):C(new TypeError("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},e.prototype.tee=function(){if(!1===Mr(this))throw Ur("tee");var e=zt(this);return o(e)},e.prototype.getIterator=function(e){var t=(void 0===e?{}:e).preventCancel,r=void 0!==t&&t;if(!1===Mr(this))throw Ur("getIterator");return ae(this,r)},e}();function Fr(e,t,r,n,a){void 0===n&&(n=1),void 0===a&&(a=function(){return 1});var i=Object.create(_r.prototype);Rr(i);var o=Object.create(Tt.prototype);return Ut(i,o,e,t,r,n,a),i}function Rr(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Mr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Br(e){return void 0!==e._reader}function Lr(e,t){if(e._disturbed=!0,"closed"===e._state)return x(void 0);if("errored"===e._state)return C(e._storedError);Dr(e);var n=e._readableStreamController[H](t);return I(n,r)}function Dr(e){e._state="closed";var t=e._reader;void 0!==t&&(ee(t)&&(t._readRequests.forEach((function(e){e._resolve(R(void 0,!0,t._forAuthorCode))})),t._readRequests=new F),G(t))}function Nr(e,t){e._state="errored",e._storedError=t;var r=e._reader;void 0!==r&&(ee(r)?(r._readRequests.forEach((function(e){e._reject(t)})),r._readRequests=new F):(r._readIntoRequests.forEach((function(e){e._reject(t)})),r._readIntoRequests=new F),q(r,t))}function Ur(e){return new TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}"symbol"===typeof t.asyncIterator&&Object.defineProperty(_r.prototype,t.asyncIterator,{value:_r.prototype.getIterator,enumerable:!1,writable:!0,configurable:!0});var jr=function(){function e(e){var t=e.highWaterMark;this.highWaterMark=t}return e.prototype.size=function(e){return e.byteLength},e}(),qr=function(){function e(e){var t=e.highWaterMark;this.highWaterMark=t}return e.prototype.size=function(){return 1},e}(),zr=function(){function e(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.size,a=t.highWaterMark,i=r.size,o=r.highWaterMark,s=e.writableType;if(void 0!==s)throw new RangeError("Invalid writable type specified");var c=v(n);void 0===a&&(a=1),a=m(a);var l=e.readableType;if(void 0!==l)throw new RangeError("Invalid readable type specified");var u,h=v(i);void 0===o&&(o=0),o=m(o);var d=S((function(e){u=e}));Gr(this,d,a,c,o,h),Zr(this,e);var p=f(e,"start",[this._transformStreamController]);u(p)}return Object.defineProperty(e.prototype,"readable",{get:function(){if(!1===Hr(this))throw ln("readable");return this._readable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){if(!1===Hr(this))throw ln("writable");return this._writable},enumerable:!0,configurable:!0}),e}();function Gr(e,t,r,n,a,i){function o(){return t}function s(t){return nn(e,t)}function c(t){return an(e,t)}function l(){return on(e)}function u(){return sn(e)}function h(t){return Xr(e,t),x(void 0)}e._writable=ge(o,s,l,c,r,n),e._readable=Fr(o,u,h,a,i),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,Vr(e,!0),e._transformStreamController=void 0}function Hr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function Wr(e,t){Bt(e._readable._readableStreamController,t),Xr(e,t)}function Xr(e,t){Qr(e._transformStreamController),tt(e._writable._writableStreamController,t),!0===e._backpressure&&Vr(e,!1)}function Vr(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=S((function(t){e._backpressureChangePromise_resolve=t})),e._backpressure=t}var Yr=function(){function e(){throw new TypeError("TransformStreamDefaultController instances cannot be created directly")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===Kr(this))throw cn("desiredSize");var e=this._controlledTransformStream._readable._readableStreamController;return Lt(e)},enumerable:!0,configurable:!0}),e.prototype.enqueue=function(e){if(!1===Kr(this))throw cn("enqueue");$r(this,e)},e.prototype.error=function(e){if(!1===Kr(this))throw cn("error");en(this,e)},e.prototype.terminate=function(){if(!1===Kr(this))throw cn("terminate");rn(this)},e}();function Kr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function Jr(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}function Zr(e,t){var r=Object.create(Yr.prototype),n=function(e){try{return $r(r,e),x(void 0)}catch(t){return C(t)}},a=t.transform;if(void 0!==a){if("function"!==typeof a)throw new TypeError("transform is not a method");n=function(e){return d(a,t,[e,r])}}var i=h(t,"flush",0,[r]);Jr(e,r,n,i)}function Qr(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function $r(e,t){var r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!1===Nt(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{Mt(n,t)}catch(i){throw Xr(r,i),r._readable._storedError}var a=Dt(n);a!==r._backpressure&&Vr(r,!0)}function en(e,t){Wr(e._controlledTransformStream,t)}function tn(e,t){var r=e._transformAlgorithm(t);return I(r,void 0,(function(t){throw Wr(e._controlledTransformStream,t),t}))}function rn(e){var t=e._controlledTransformStream,r=t._readable._readableStreamController;!0===Nt(r)&&Rt(r);var n=new TypeError("TransformStream terminated");Xr(t,n)}function nn(e,t){var r=e._transformStreamController;if(!0===e._backpressure){var n=e._backpressureChangePromise;return I(n,(function(){var n=e._writable,a=n._state;if("erroring"===a)throw n._storedError;return tn(r,t)}))}return tn(r,t)}function an(e,t){return Wr(e,t),x(void 0)}function on(e){var t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return Qr(r),I(n,(function(){if("errored"===t._state)throw t._storedError;var e=t._readableStreamController;!0===Nt(e)&&Rt(e)}),(function(r){throw Wr(e,r),t._storedError}))}function sn(e){return Vr(e,!1),e._backpressureChangePromise}function cn(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function ln(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}e.ByteLengthQueuingStrategy=jr,e.CountQueuingStrategy=qr,e.ReadableStream=_r,e.TransformStream=zr,e.WritableStream=de,Object.defineProperty(e,"__esModule",{value:!0})}))},function(e,t,r){r(147),r(118),r(77),r(120);var n=r(43);e.exports=n.Map},function(e,t,r){"use strict";var n=r(148),a=r(152);e.exports=n("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),a)},function(e,t,r){"use strict";var n=r(10),a=r(11),i=r(52),o=r(29),s=r(149),c=r(104),l=r(126),u=r(22),h=r(14),f=r(97),d=r(85),p=r(151);e.exports=function(e,t,r){var g=-1!==e.indexOf("Map"),m=-1!==e.indexOf("Weak"),v=g?"set":"add",b=a[e],y=b&&b.prototype,w=b,k={},S=function(e){var t=y[e];o(y,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(m&&!u(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!u(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(m&&!u(e))&&t.call(this,0===e?0:e)}:function(e,r){return t.call(this,0===e?0:e,r),this})};if(i(e,"function"!=typeof b||!(m||y.forEach&&!h((function(){(new b).entries().next()})))))w=r.getConstructor(t,e,g,v),s.REQUIRED=!0;else if(i(e,!0)){var x=new w,C=x[v](m?{}:-0,1)!=x,A=h((function(){x.has(1)})),E=f((function(e){new b(e)})),O=!m&&h((function(){var e=new b,t=5;while(t--)e[v](t,t);return!e.has(-0)}));E||(w=t((function(t,r){l(t,w,e);var n=p(new b,t,w);return void 0!=r&&c(r,n[v],n,g),n})),w.prototype=y,y.constructor=w),(A||O)&&(S("delete"),S("has"),g&&S("get")),(O||C)&&S(v),m&&y.clear&&delete y.clear}return k[e]=w,n({global:!0,forced:w!=b},k),d(w,e),m||r.setStrong(w,e,g),w}},function(e,t,r){var n=r(39),a=r(22),i=r(23),o=r(27).f,s=r(38),c=r(150),l=s("meta"),u=0,h=Object.isExtensible||function(){return!0},f=function(e){o(e,l,{value:{objectID:"O"+ ++u,weakData:{}}})},d=function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,l)){if(!h(e))return"F";if(!t)return"E";f(e)}return e[l].objectID},p=function(e,t){if(!i(e,l)){if(!h(e))return!0;if(!t)return!1;f(e)}return e[l].weakData},g=function(e){return c&&m.REQUIRED&&h(e)&&!i(e,l)&&f(e),e},m=e.exports={REQUIRED:!1,fastKey:d,getWeakData:p,onFreeze:g};n[l]=!0},function(e,t,r){var n=r(14);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(e,t,r){var n=r(22),a=r(87);e.exports=function(e,t,r){var i,o;return a&&"function"==typeof(i=t.constructor)&&i!==r&&n(o=i.prototype)&&o!==r.prototype&&a(e,o),e}},function(e,t,r){"use strict";var n=r(27).f,a=r(71),i=r(124),o=r(62),s=r(126),c=r(104),l=r(79),u=r(125),h=r(13),f=r(149).fastKey,d=r(33),p=d.set,g=d.getterFor;e.exports={getConstructor:function(e,t,r,l){var u=e((function(e,n){s(e,u,t),p(e,{type:t,index:a(null),first:void 0,last:void 0,size:0}),h||(e.size=0),void 0!=n&&c(n,e[l],e,r)})),d=g(t),m=function(e,t,r){var n,a,i=d(e),o=v(e,t);return o?o.value=r:(i.last=o={index:a=f(t,!0),key:t,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=o),n&&(n.next=o),h?i.size++:e.size++,"F"!==a&&(i.index[a]=o)),e},v=function(e,t){var r,n=d(e),a=f(t);if("F"!==a)return n.index[a];for(r=n.first;r;r=r.next)if(r.key==t)return r};return i(u.prototype,{clear:function(){var e=this,t=d(e),r=t.index,n=t.first;while(n)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete r[n.index],n=n.next;t.first=t.last=void 0,h?t.size=0:e.size=0},delete:function(e){var t=this,r=d(t),n=v(t,e);if(n){var a=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=a),a&&(a.previous=i),r.first==n&&(r.first=a),r.last==n&&(r.last=i),h?r.size--:t.size--}return!!n},forEach:function(e){var t,r=d(this),n=o(e,arguments.length>1?arguments[1]:void 0,3);while(t=t?t.next:r.first){n(t.value,t.key,this);while(t&&t.removed)t=t.previous}},has:function(e){return!!v(this,e)}}),i(u.prototype,r?{get:function(e){var t=v(this,e);return t&&t.value},set:function(e,t){return m(this,0===e?0:e,t)}}:{add:function(e){return m(this,e=0===e?0:e,e)}}),h&&n(u.prototype,"size",{get:function(){return d(this).size}}),u},setStrong:function(e,t,r){var n=t+" Iterator",a=g(t),i=g(n);l(e,t,(function(e,t){p(this,{type:n,target:e,state:a(e),kind:t,last:void 0})}),(function(){var e=i(this),t=e.kind,r=e.last;while(r&&r.removed)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),u(t)}}},function(e,t,r){r(154),r(118),r(77),r(120);var n=r(43);e.exports=n.Set},function(e,t,r){"use strict";var n=r(148),a=r(152);e.exports=n("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),a)},function(e,t,r){r(118),r(156),r(120);var n=r(43);e.exports=n.WeakMap},function(e,t,r){"use strict";var n,a=r(11),i=r(124),o=r(149),s=r(148),c=r(157),l=r(22),u=r(33).enforce,h=r(34),f=!a.ActiveXObject&&"ActiveXObject"in a,d=Object.isExtensible,p=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},g=e.exports=s("WeakMap",p,c);if(h&&f){n=c.getConstructor(p,"WeakMap",!0),o.REQUIRED=!0;var m=g.prototype,v=m["delete"],b=m.has,y=m.get,w=m.set;i(m,{delete:function(e){if(l(e)&&!d(e)){var t=u(this);return t.frozen||(t.frozen=new n),v.call(this,e)||t.frozen["delete"](e)}return v.call(this,e)},has:function(e){if(l(e)&&!d(e)){var t=u(this);return t.frozen||(t.frozen=new n),b.call(this,e)||t.frozen.has(e)}return b.call(this,e)},get:function(e){if(l(e)&&!d(e)){var t=u(this);return t.frozen||(t.frozen=new n),b.call(this,e)?y.call(this,e):t.frozen.get(e)}return y.call(this,e)},set:function(e,t){if(l(e)&&!d(e)){var r=u(this);r.frozen||(r.frozen=new n),b.call(this,e)?w.call(this,e,t):r.frozen.set(e,t)}else w.call(this,e,t);return this}})}},function(e,t,r){"use strict";var n=r(124),a=r(149).getWeakData,i=r(28),o=r(22),s=r(126),c=r(104),l=r(158),u=r(23),h=r(33),f=h.set,d=h.getterFor,p=l.find,g=l.findIndex,m=0,v=function(e){return e.frozen||(e.frozen=new b)},b=function(){this.entries=[]},y=function(e,t){return p(e.entries,(function(e){return e[0]===t}))};b.prototype={get:function(e){var t=y(this,e);if(t)return t[1]},has:function(e){return!!y(this,e)},set:function(e,t){var r=y(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=g(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,r,l){var h=e((function(e,n){s(e,h,t),f(e,{type:t,id:m++,frozen:void 0}),void 0!=n&&c(n,e[l],e,r)})),p=d(t),g=function(e,t,r){var n=p(e),o=a(i(t),!0);return!0===o?v(n).set(t,r):o[n.id]=r,e};return n(h.prototype,{delete:function(e){var t=p(this);if(!o(e))return!1;var r=a(e);return!0===r?v(t)["delete"](e):r&&u(r,t.id)&&delete r[t.id]},has:function(e){var t=p(this);if(!o(e))return!1;var r=a(e);return!0===r?v(t).has(e):r&&u(r,t.id)}}),n(h.prototype,r?{get:function(e){var t=p(this);if(o(e)){var r=a(e);return!0===r?v(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return g(this,e,t)}}:{add:function(e){return g(this,e,!0)}}),h}}},function(e,t,r){var n=r(62),a=r(18),i=r(83),o=r(47),s=r(159),c=[].push,l=function(e){var t=1==e,r=2==e,l=3==e,u=4==e,h=6==e,f=5==e||h;return function(d,p,g,m){for(var v,b,y=i(d),w=a(y),k=n(p,g,3),S=o(w.length),x=0,C=m||s,A=t?C(d,S):r?C(d,0):void 0;S>x;x++)if((f||x in w)&&(v=w[x],b=k(v,x,y),e))if(t)A[x]=b;else if(b)switch(e){case 3:return!0;case 5:return v;case 6:return x;case 2:c.call(A,v)}else if(u)return!1;return h?-1:l||u?u:A}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6)}},function(e,t,r){var n=r(22),a=r(160),i=r(57),o=i("species");e.exports=function(e,t){var r;return a(e)&&(r=e.constructor,"function"!=typeof r||r!==Array&&!a(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(19);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){r(118),r(162),r(120);var n=r(43);e.exports=n.WeakSet},function(e,t,r){"use strict";var n=r(148),a=r(157);n("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),a)},function(e,t,r){r(164);var n=r(61);e.exports=n("String","codePointAt")},function(e,t,r){"use strict";var n=r(10),a=r(78).codeAt;n({target:"String",proto:!0},{codePointAt:function(e){return a(this,e)}})},function(e,t,r){r(166);var n=r(43);e.exports=n.String.fromCodePoint},function(e,t,r){var n=r(10),a=r(49),i=String.fromCharCode,o=String.fromCodePoint,s=!!o&&1!=o.length;n({target:"String",stat:!0,forced:s},{fromCodePoint:function(e){var t,r=[],n=arguments.length,o=0;while(n>o){if(t=+arguments[o++],a(t,1114111)!==t)throw RangeError(t+" is not a valid code point");r.push(t<65536?i(t):i(55296+((t-=65536)>>10),t%1024+56320))}return r.join("")}})},function(e,t,r){r(168),r(118),r(170),r(174),r(175),r(176),r(177),r(178),r(179),r(180),r(181),r(182),r(183),r(184),r(185),r(186),r(187),r(188),r(189);var n=r(43);e.exports=n.Symbol},function(e,t,r){"use strict";var n=r(10),a=r(14),i=r(160),o=r(22),s=r(83),c=r(47),l=r(93),u=r(159),h=r(169),f=r(57),d=r(135),p=f("isConcatSpreadable"),g=9007199254740991,m="Maximum allowed index exceeded",v=d>=51||!a((function(){var e=[];return e[p]=!1,e.concat()[0]!==e})),b=h("concat"),y=function(e){if(!o(e))return!1;var t=e[p];return void 0!==t?!!t:i(e)},w=!v||!b;n({target:"Array",proto:!0,forced:w},{concat:function(e){var t,r,n,a,i,o=s(this),h=u(o,0),f=0;for(t=-1,n=arguments.length;tg)throw TypeError(m);for(r=0;r=g)throw TypeError(m);l(h,f++,i)}return h.length=f,h}})},function(e,t,r){var n=r(14),a=r(57),i=r(135),o=a("species");e.exports=function(e){return i>=51||!n((function(){var t=[],r=t.constructor={};return r[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},function(e,t,r){"use strict";var n=r(10),a=r(11),i=r(42),o=r(37),s=r(13),c=r(58),l=r(59),u=r(14),h=r(23),f=r(160),d=r(22),p=r(28),g=r(83),m=r(17),v=r(21),b=r(16),y=r(71),w=r(73),k=r(44),S=r(171),x=r(51),C=r(12),A=r(27),E=r(15),O=r(26),T=r(29),I=r(36),P=r(35),_=r(39),F=r(38),R=r(57),M=r(172),B=r(173),L=r(85),D=r(33),N=r(158).forEach,U=P("hidden"),j="Symbol",q="prototype",z=R("toPrimitive"),G=D.set,H=D.getterFor(j),W=Object[q],X=a.Symbol,V=i("JSON","stringify"),Y=C.f,K=A.f,J=S.f,Z=E.f,Q=I("symbols"),$=I("op-symbols"),ee=I("string-to-symbol-registry"),te=I("symbol-to-string-registry"),re=I("wks"),ne=a.QObject,ae=!ne||!ne[q]||!ne[q].findChild,ie=s&&u((function(){return 7!=y(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Y(W,t);n&&delete W[t],K(e,t,r),n&&e!==W&&K(W,t,n)}:K,oe=function(e,t){var r=Q[e]=y(X[q]);return G(r,{type:j,tag:e,description:t}),s||(r.description=t),r},se=l?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof X},ce=function(e,t,r){e===W&&ce($,t,r),p(e);var n=v(t,!0);return p(r),h(Q,n)?(r.enumerable?(h(e,U)&&e[U][n]&&(e[U][n]=!1),r=y(r,{enumerable:b(0,!1)})):(h(e,U)||K(e,U,b(1,{})),e[U][n]=!0),ie(e,n,r)):K(e,n,r)},le=function(e,t){p(e);var r=m(t),n=w(r).concat(pe(r));return N(n,(function(t){s&&!he.call(r,t)||ce(e,t,r[t])})),e},ue=function(e,t){return void 0===t?y(e):le(y(e),t)},he=function(e){var t=v(e,!0),r=Z.call(this,t);return!(this===W&&h(Q,t)&&!h($,t))&&(!(r||!h(this,t)||!h(Q,t)||h(this,U)&&this[U][t])||r)},fe=function(e,t){var r=m(e),n=v(t,!0);if(r!==W||!h(Q,n)||h($,n)){var a=Y(r,n);return!a||!h(Q,n)||h(r,U)&&r[U][n]||(a.enumerable=!0),a}},de=function(e){var t=J(m(e)),r=[];return N(t,(function(e){h(Q,e)||h(_,e)||r.push(e)})),r},pe=function(e){var t=e===W,r=J(t?$:m(e)),n=[];return N(r,(function(e){!h(Q,e)||t&&!h(W,e)||n.push(Q[e])})),n};if(c||(X=function(){if(this instanceof X)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=F(e),r=function(e){this===W&&r.call($,e),h(this,U)&&h(this[U],t)&&(this[U][t]=!1),ie(this,t,b(1,e))};return s&&ae&&ie(W,t,{configurable:!0,set:r}),oe(t,e)},T(X[q],"toString",(function(){return H(this).tag})),T(X,"withoutSetter",(function(e){return oe(F(e),e)})),E.f=he,A.f=ce,C.f=fe,k.f=S.f=de,x.f=pe,M.f=function(e){return oe(R(e),e)},s&&(K(X[q],"description",{configurable:!0,get:function(){return H(this).description}}),o||T(W,"propertyIsEnumerable",he,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:X}),N(w(re),(function(e){B(e)})),n({target:j,stat:!0,forced:!c},{for:function(e){var t=String(e);if(h(ee,t))return ee[t];var r=X(t);return ee[t]=r,te[r]=t,r},keyFor:function(e){if(!se(e))throw TypeError(e+" is not a symbol");if(h(te,e))return te[e]},useSetter:function(){ae=!0},useSimple:function(){ae=!1}}),n({target:"Object",stat:!0,forced:!c,sham:!s},{create:ue,defineProperty:ce,defineProperties:le,getOwnPropertyDescriptor:fe}),n({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:de,getOwnPropertySymbols:pe}),n({target:"Object",stat:!0,forced:u((function(){x.f(1)}))},{getOwnPropertySymbols:function(e){return x.f(g(e))}}),V){var ge=!c||u((function(){var e=X();return"[null]"!=V([e])||"{}"!=V({a:e})||"{}"!=V(Object(e))}));n({target:"JSON",stat:!0,forced:ge},{stringify:function(e,t,r){var n,a=[e],i=1;while(arguments.length>i)a.push(arguments[i++]);if(n=t,(d(t)||void 0!==e)&&!se(e))return f(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!se(t))return t}),a[1]=t,V.apply(null,a)}})}X[q][z]||O(X[q],z,X[q].valueOf),L(X,j),_[U]=!0},function(e,t,r){var n=r(17),a=r(44).f,i={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return a(e)}catch(t){return o.slice()}};e.exports.f=function(e){return o&&"[object Window]"==i.call(e)?s(e):a(n(e))}},function(e,t,r){var n=r(57);t.f=n},function(e,t,r){var n=r(43),a=r(23),i=r(172),o=r(27).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});a(t,e)||o(t,e,{value:i.f(e)})}},function(e,t,r){var n=r(173);n("asyncIterator")},function(e,t,r){"use strict";var n=r(10),a=r(13),i=r(11),o=r(23),s=r(22),c=r(27).f,l=r(40),u=i.Symbol;if(a&&"function"==typeof u&&(!("description"in u.prototype)||void 0!==u().description)){var h={},f=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof f?new u(e):void 0===e?u():u(e);return""===e&&(h[t]=!0),t};l(f,u);var d=f.prototype=u.prototype;d.constructor=f;var p=d.toString,g="Symbol(test)"==String(u("test")),m=/^Symbol\((.*)\)[^)]+$/;c(d,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=p.call(e);if(o(h,e))return"";var r=g?t.slice(7,-1):t.replace(m,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:f})}},function(e,t,r){var n=r(173);n("hasInstance")},function(e,t,r){var n=r(173);n("isConcatSpreadable")},function(e,t,r){var n=r(173);n("iterator")},function(e,t,r){var n=r(173);n("match")},function(e,t,r){var n=r(173);n("matchAll")},function(e,t,r){var n=r(173);n("replace")},function(e,t,r){var n=r(173);n("search")},function(e,t,r){var n=r(173);n("species")},function(e,t,r){var n=r(173);n("split")},function(e,t,r){var n=r(173);n("toPrimitive")},function(e,t,r){var n=r(173);n("toStringTag")},function(e,t,r){var n=r(173);n("unscopables")},function(e,t,r){var n=r(85);n(Math,"Math",!0)},function(e,t,r){var n=r(11),a=r(85);a(n.JSON,"JSON",!0)},function(e,t,r){r(191);var n=r(61);e.exports=n("String","padStart")},function(e,t,r){"use strict";var n=r(10),a=r(192).start,i=r(194);n({target:"String",proto:!0,forced:i},{padStart:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(47),a=r(193),i=r(20),o=Math.ceil,s=function(e){return function(t,r,s){var c,l,u=String(i(t)),h=u.length,f=void 0===s?" ":String(s),d=n(r);return d<=h||""==f?u:(c=d-h,l=a.call(f,o(c/f.length)),l.length>c&&(l=l.slice(0,c)),e?u+l:l+u)}};e.exports={start:s(!1),end:s(!0)}},function(e,t,r){"use strict";var n=r(48),a=r(20);e.exports="".repeat||function(e){var t=String(a(this)),r="",i=n(e);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(r+=t);return r}},function(e,t,r){var n=r(129);e.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(n)},function(e,t,r){r(196);var n=r(61);e.exports=n("String","padEnd")},function(e,t,r){"use strict";var n=r(10),a=r(192).end,i=r(194);n({target:"String",proto:!0,forced:i},{padEnd:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){r(198);var n=r(43);e.exports=n.Object.values},function(e,t,r){var n=r(10),a=r(199).values;n({target:"Object",stat:!0},{values:function(e){return a(e)}})},function(e,t,r){var n=r(13),a=r(73),i=r(17),o=r(15).f,s=function(e){return function(t){var r,s=i(t),c=a(s),l=c.length,u=0,h=[];while(l>u)r=c[u++],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){r(201);var n=r(43);e.exports=n.Object.entries},function(e,t,r){var n=r(10),a=r(199).entries;n({target:"Object",stat:!0},{entries:function(e){return a(e)}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearPrimitiveCaches=F,t.isEOF=A,t.isCmd=O,t.isDict=T,t.isName=E,t.isRef=I,t.isRefsEqual=P,t.isStream=_,t.RefSetCache=t.RefSet=t.Ref=t.Name=t.Dict=t.Cmd=t.EOF=void 0;var n=a(r(2));r(5);function a(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},i(e)}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=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r["return"]||r["return"]()}finally{if(s)throw i}}}}function p(e,t){if(e){if("string"===typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t.empty}var v,b=new Map,y=d(n);try{for(y.s();!(v=y.n()).done;){var w=v.value;if(w instanceof t)for(var k=0,S=Object.entries(w._map);k0&&(o._map[P]=R)}else o._map[P]=_[0]}}catch(q){T.e(q)}finally{T.f()}return b.clear(),o.size>0?o:t.empty},t}();t.Dict=k;var S=function(){var e=Object.create(null);function t(e,t){this.num=e,this.gen=t}return t.prototype={toString:function(){return 0===this.gen?"".concat(this.num,"R"):"".concat(this.num,"R").concat(this.gen)}},t.get=function(r,n){var a=0===n?"".concat(r,"R"):"".concat(r,"R").concat(n),i=e[a];return i||(e[a]=new t(r,n))},t._clearCache=function(){e=Object.create(null)},t}();t.Ref=S;var x=function(){function e(){o(this,e),this._set=new Set}return c(e,[{key:"has",value:function(e){return this._set.has(e.toString())}},{key:"put",value:function(e){this._set.add(e.toString())}},{key:"remove",value:function(e){this._set["delete"](e.toString())}}]),e}();t.RefSet=x;var C=function(){function e(){o(this,e),this._map=new Map}return c(e,[{key:"get",value:function(e){return this._map.get(e.toString())}},{key:"has",value:function(e){return this._map.has(e.toString())}},{key:"put",value:function(e,t){this._map.set(e.toString(),t)}},{key:"putAlias",value:function(e,t){this._map.set(e.toString(),this.get(t))}},{key:"forEach",value:function(e){var t,r=d(this._map.values());try{for(r.s();!(t=r.n()).done;){var n=t.value;e(n)}}catch(a){r.e(a)}finally{r.f()}}},{key:"clear",value:function(){this._map.clear()}},{key:"size",get:function(){return this._map.size}}]),e}();function A(e){return e===b}function E(e,t){return e instanceof y&&(void 0===t||e.name===t)}function O(e,t){return e instanceof w&&(void 0===t||e.cmd===t)}function T(e,t){return e instanceof k&&(void 0===t||E(e.get("Type"),t))}function I(e){return e instanceof S}function P(e,t){return e.num===t.num&&e.gen===t.gen}function _(e){return"object"===i(e)&&null!==e&&void 0!==e.getBytes}function F(){w._clearCache(),y._clearCache(),S._clearCache()}t.RefSetCache=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkPdfManager=t.LocalPdfManager=void 0;var n=l(r(2)),a=r(5),i=r(204),o=r(205),s=r(206),c=r(209);function l(e){return e&&e.__esModule?e:{default:e}}function u(e){return u="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},u(e)}function h(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&&f(e,t)}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function d(e){var t=m();return function(){var r,n=v(e);if(t){var a=v(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return p(this,r)}}function p(e,t){return!t||"object"!==u(t)&&"function"!==typeof t?g(e):t}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function b(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,a)}function y(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){b(i,n,a,o,s,"next",e)}function s(e){b(i,n,a,o,s,"throw",e)}o(void 0)}))}}function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k(e,t){for(var r=0;r0&&void 0!==arguments[0]&&arguments[0];return this.pdfDocument.cleanup(e)}},{key:"ensure",value:function(){var e=y(n["default"].mark((function e(t,r,i){return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:(0,a.unreachable)("Abstract method `ensure` called");case 1:case"end":return e.stop()}}),e)})));function t(t,r,n){return e.apply(this,arguments)}return t}()},{key:"requestRange",value:function(e,t){(0,a.unreachable)("Abstract method `requestRange` called")}},{key:"requestLoadedStream",value:function(){(0,a.unreachable)("Abstract method `requestLoadedStream` called")}},{key:"sendProgressiveData",value:function(e){(0,a.unreachable)("Abstract method `sendProgressiveData` called")}},{key:"updatePassword",value:function(e){this._password=e}},{key:"terminate",value:function(e){(0,a.unreachable)("Abstract method `terminate` called")}},{key:"docId",get:function(){return this._docId}},{key:"password",get:function(){return this._password}},{key:"docBaseUrl",get:function(){var e=null;if(this._docBaseUrl){var t=(0,a.createValidAbsoluteUrl)(this._docBaseUrl);t?e=t.href:(0,a.warn)('Invalid absolute docBaseUrl: "'.concat(this._docBaseUrl,'".'))}return(0,a.shadow)(this,"docBaseUrl",e)}}]),e}(),C=function(e){h(r,e);var t=d(r);function r(e,n,a,i,o){var l;w(this,r),l=t.call(this),l._docId=e,l._password=a,l._docBaseUrl=o,l.evaluatorOptions=i;var u=new c.Stream(n);return l.pdfDocument=new s.PDFDocument(g(l),u),l._loadedStreamPromise=Promise.resolve(u),l}return S(r,[{key:"ensure",value:function(){var e=y(n["default"].mark((function e(t,r,a){var i;return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t[r],"function"!==typeof i){e.next=3;break}return e.abrupt("return",i.apply(t,a));case 3:return e.abrupt("return",i);case 4:case"end":return e.stop()}}),e)})));function t(t,r,n){return e.apply(this,arguments)}return t}()},{key:"requestRange",value:function(e,t){return Promise.resolve()}},{key:"requestLoadedStream",value:function(){}},{key:"onLoadedStream",value:function(){return this._loadedStreamPromise}},{key:"terminate",value:function(e){}}]),r}(x);t.LocalPdfManager=C;var A=function(e){h(r,e);var t=d(r);function r(e,n,a,o,c){var l;return w(this,r),l=t.call(this),l._docId=e,l._password=a.password,l._docBaseUrl=c,l.msgHandler=a.msgHandler,l.evaluatorOptions=o,l.streamManager=new i.ChunkedStreamManager(n,{msgHandler:a.msgHandler,length:a.length,disableAutoFetch:a.disableAutoFetch,rangeChunkSize:a.rangeChunkSize}),l.pdfDocument=new s.PDFDocument(g(l),l.streamManager.getStream()),l}return S(r,[{key:"ensure",value:function(){var e=y(n["default"].mark((function e(t,r,a){var i;return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,i=t[r],"function"!==typeof i){e.next=4;break}return e.abrupt("return",i.apply(t,a));case 4:return e.abrupt("return",i);case 7:if(e.prev=7,e.t0=e["catch"](0),e.t0 instanceof o.MissingDataException){e.next=11;break}throw e.t0;case 11:return e.next=13,this.requestRange(e.t0.begin,e.t0.end);case 13:return e.abrupt("return",this.ensure(t,r,a));case 14:case"end":return e.stop()}}),e,this,[[0,7]])})));function t(t,r,n){return e.apply(this,arguments)}return t}()},{key:"requestRange",value:function(e,t){return this.streamManager.requestRange(e,t)}},{key:"requestLoadedStream",value:function(){this.streamManager.requestAllChunks()}},{key:"sendProgressiveData",value:function(e){this.streamManager.onReceiveData({chunk:e})}},{key:"onLoadedStream",value:function(){return this.streamManager.onLoadedStream()}},{key:"terminate",value:function(e){this.streamManager.abort(e)}}]),r}(x);t.NetworkPdfManager=A},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkedStreamManager=t.ChunkedStream=void 0;var n=r(5),a=r(205);function i(e,t){var r;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=o(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,i=e},f:function(){try{s||null==r["return"]||r["return"]()}finally{if(c)throw i}}}}function o(e,t){if(e){if("string"===typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=this.end?this.numChunks:Math.floor(t/this.chunkSize),a=r;a=t)&&!(t<=this.progressiveDataLength))for(var r=this.chunkSize,n=Math.floor(e/r),i=Math.floor((t-1)/r)+1,o=n;o=this.end?-1:(e>=this.progressiveDataLength&&this.ensureByte(e),this.bytes[this.pos++])}},{key:"getUint16",value:function(){var e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t}},{key:"getInt32",value:function(){var e=this.getByte(),t=this.getByte(),r=this.getByte(),n=this.getByte();return(e<<24)+(t<<16)+(r<<8)+n}},{key:"getBytes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.bytes,n=this.pos,a=this.end;if(!e){a>this.progressiveDataLength&&this.ensureRange(n,a);var i=r.subarray(n,a);return t?new Uint8ClampedArray(i):i}var o=n+e;o>a&&(o=a),o>this.progressiveDataLength&&this.ensureRange(n,o),this.pos=o;var s=r.subarray(n,o);return t?new Uint8ClampedArray(s):s}},{key:"peekByte",value:function(){var e=this.getByte();return-1!==e&&this.pos--,e}},{key:"peekBytes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBytes(e,t);return this.pos-=r.length,r}},{key:"getByteRange",value:function(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),t>this.progressiveDataLength&&this.ensureRange(e,t),this.bytes.subarray(e,t)}},{key:"skip",value:function(e){e||(e=1),this.pos+=e}},{key:"reset",value:function(){this.pos=this.start}},{key:"moveStart",value:function(){this.start=this.pos}},{key:"makeSubStream",value:function(e,t,r){function n(){}t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e),n.prototype=Object.create(this),n.prototype.getMissingChunks=function(){for(var e=this.chunkSize,t=Math.floor(this.start/e),r=Math.floor((this.end-1)/e)+1,n=[],a=t;a0){var g,m=this.groupChunks(h),v=i(m);try{for(v.s();!(g=v.n()).done;){var b=g.value,y=b.beginChunk*this.chunkSize,w=Math.min(b.endChunk*this.chunkSize,this.length);this.sendRequest(y,w)}}catch(k){v.e(k)}finally{v.f()}}return l.promise["catch"]((function(e){if(!t.aborted)throw e}))}},{key:"getStream",value:function(){return this.stream}},{key:"requestRange",value:function(e,t){t=Math.min(t,this.length);for(var r=this.getBeginChunk(e),n=this.getEndChunk(t),a=[],i=r;i0&&void 0!==arguments[0]?arguments[0]:[],r=[],n=i(t);try{for(n.s();!(e=n.n()).done;)for(var a=e.value,o=this.getBeginChunk(a.begin),s=this.getEndChunk(a.end),c=o;c=0&&n+1!==o&&(t.push({beginChunk:r,endChunk:n+1}),r=o),a+1===e.length&&t.push({beginChunk:r,endChunk:o+1}),n=o}return t}},{key:"onProgress",value:function(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}},{key:"onReceiveData",value:function(e){var t=e.chunk,r=void 0===e.begin,n=r?this.progressiveDataLength:e.begin,a=n+t.byteLength,o=Math.floor(n/this.chunkSize),s=a0||c.push(d)}}catch(k){f.e(k)}finally{f.f()}}}if(!this.disableAutoFetch&&0===this._requestsByChunk.size){var g;if(1===this.stream.numChunksLoaded){var m=this.stream.numChunks-1;this.stream.hasChunk(m)||(g=m)}else g=this.stream.nextEmptyChunk(s);Number.isInteger(g)&&this._requestChunks([g])}for(var v=0,b=c;vl){(0,n.warn)('getInheritableProperty: maximum loop count exceeded for "'.concat(a,'"'));break}r=r.get("Parent")}return t}t.XRefParseException=m;var b=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function y(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,n.assert)(Number.isInteger(e)&&e>0,"The number should be a positive integer.");var r,a=[];while(e>=1e3)e-=1e3,a.push("M");r=e/100|0,e%=100,a.push(b[r]),r=e/10|0,e%=10,a.push(b[10+r]),a.push(b[20+e]);var i=a.join("");return t?i.toLowerCase():i}function w(e){return e<=0?0:Math.ceil(Math.log2(e))}function k(e,t){return e[t]<<24>>24}function S(e,t){return e[t]<<8|e[t+1]}function x(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function C(e){return 32===e||9===e||13===e||10===e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDocument=t.Page=void 0;var n=p(r(2)),a=r(5),i=r(207),o=r(202),s=r(205),c=r(209),l=r(222),u=r(219),h=r(208),f=r(223),d=r(225);function p(e){return e&&e.__esModule?e:{default:e}}function g(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,a)}function m(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){g(i,n,a,o,s,"next",e)}function s(e){g(i,n,a,o,s,"throw",e)}o(void 0)}))}}function v(e){return v="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},v(e)}function b(e,t){return k(e)||w(e,t)||x(e,t)||y()}function y(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0)if(r.push(o.value),t&&r.length===t)break}catch(c){a=!0,i=c}finally{try{n||null==s["return"]||s["return"]()}finally{if(a)throw i}}return r}}function k(e){if(Array.isArray(e))return e}function S(e,t){var r;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=x(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r["return"]||r["return"]()}finally{if(s)throw i}}}}function x(e,t){if(e){if("string"===typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(e,t):void 0}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1],r=(0,s.getInheritableProperty)({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(r)?1!==r.length&&(0,o.isDict)(r[0])?o.Dict.merge({xref:this.xref,dictArray:r}):r[0]:r}},{key:"_getBoundingBox",value:function(e){var t=this._getInheritableProperty(e,!0);if(Array.isArray(t)&&4===t.length){if(t[2]-t[0]!==0&&t[3]-t[1]!==0)return t;(0,a.warn)("Empty /".concat(e," entry."))}return null}},{key:"getContentStream",value:function(){var e,t=this.content;if(Array.isArray(t)){var r,n=this.xref,a=[],i=S(t);try{for(i.s();!(r=i.n()).done;){var s=r.value;a.push(n.fetchIfRef(s))}}catch(l){i.e(l)}finally{i.f()}e=new c.StreamsSequenceStream(a)}else e=(0,o.isStream)(t)?t:new c.NullStream;return e}},{key:"save",value:function(e,t,r){var n=new d.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions});return this._parsedAnnotations.then((function(e){var i,o=[],s=S(e);try{for(s.s();!(i=s.n()).done;){var c=i.value;D(c,"print")&&o.push(c.save(n,t,r)["catch"]((function(e){return(0,a.warn)("save - ignoring annotation data during "+'"'.concat(t.name,'" task: "').concat(e,'".')),null})))}}catch(l){s.e(l)}finally{s.f()}return Promise.all(o)}))}},{key:"loadResources",value:function(e){var t=this;return this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,"resources")),this.resourcesPromise.then((function(){var r=new i.ObjectLoader(t.resources,e,t.xref);return r.load()}))}},{key:"getOperatorList",value:function(e){var t=this,r=e.handler,n=e.sink,i=e.task,o=e.intent,s=e.renderInteractiveForms,c=e.annotationStorage,l=this.pdfManager.ensure(this,"getContentStream"),u=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"]),h=new d.PartialEvaluator({xref:this.xref,handler:r,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}),p=Promise.all([l,u]),g=p.then((function(e){var a=b(e,1),s=a[0],c=new f.OperatorList(o,n);return r.send("StartRenderPage",{transparency:h.hasBlendModes(t.resources),pageIndex:t.pageIndex,intent:o}),h.getOperatorList({stream:s,task:i,resources:t.resources,operatorList:c}).then((function(){return c}))}));return Promise.all([g,this._parsedAnnotations]).then((function(e){var t=b(e,2),r=t[0],n=t[1];if(0===n.length)return r.flush(!0),{length:r.totalLength};var l,u=[],f=S(n);try{for(f.s();!(l=f.n()).done;){var d=l.value;D(d,o)&&u.push(d.getOperatorList(h,i,s,c)["catch"]((function(e){return(0,a.warn)("getOperatorList - ignoring annotation data during "+'"'.concat(i.name,'" task: "').concat(e,'".')),null})))}}catch(p){f.e(p)}finally{f.f()}return Promise.all(u).then((function(e){r.addOp(a.OPS.beginAnnotations,[]);var t,n=S(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;r.addOpList(i)}}catch(p){n.e(p)}finally{n.f()}return r.addOp(a.OPS.endAnnotations,[]),r.flush(!0),{length:r.totalLength}}))}))}},{key:"extractTextContent",value:function(e){var t=this,r=e.handler,n=e.task,a=e.normalizeWhitespace,i=e.sink,o=e.combineTextItems,s=this.pdfManager.ensure(this,"getContentStream"),c=this.loadResources(["ExtGState","XObject","Font"]),l=Promise.all([s,c]);return l.then((function(e){var s=b(e,1),c=s[0],l=new d.PartialEvaluator({xref:t.xref,handler:r,pageIndex:t.pageIndex,idFactory:t._localIdFactory,fontCache:t.fontCache,builtInCMapCache:t.builtInCMapCache,globalImageCache:t.globalImageCache,options:t.evaluatorOptions});return l.getTextContent({stream:c,task:n,resources:t.resources,normalizeWhitespace:a,combineTextItems:o,sink:i})}))}},{key:"getAnnotationsData",value:function(e){return this._parsedAnnotations.then((function(t){for(var r=[],n=0,a=t.length;n=360?e%=360:e<0&&(e=(e%360+360)%360),(0,a.shadow)(this,"rotate",e)}},{key:"annotations",get:function(){return(0,a.shadow)(this,"annotations",this._getInheritableProperty("Annots")||[])}},{key:"_parsedAnnotations",get:function(){var e=this,t=this.pdfManager.ensure(this,"annotations").then((function(){var t,r=[],n=S(e.annotations);try{for(n.s();!(t=n.n()).done;){var i=t.value;r.push(l.AnnotationFactory.create(e.xref,i,e.pdfManager,e._localIdFactory)["catch"]((function(e){return(0,a.warn)('_parsedAnnotations: "'.concat(e,'".')),null})))}}catch(o){n.e(o)}finally{n.f()}return Promise.all(r).then((function(e){return e.filter((function(e){return!!e}))}))}));return(0,a.shadow)(this,"_parsedAnnotations",t)}}]),e}();t.Page=N;var U=new Uint8Array([37,80,68,70,45]),j=new Uint8Array([115,116,97,114,116,120,114,101,102]),q=new Uint8Array([101,110,100,111,98,106]),z=1024,G="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",H=/^[1-9]\.[0-9]$/;function W(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1024,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=t.length,i=e.peekBytes(r),o=i.length-a;if(o<=0)return!1;if(n){var s=a-1,c=i.length-1;while(c>=s){var l=0;while(l=a)return e.pos+=c-s,!0;c--}}else{var u=0;while(u<=o){var h=0;while(h=a)return e.pos+=u,!0;u++}}return!1}var X=function(){function e(t,r){var n;if(F(this,e),(0,o.isStream)(r))n=r;else{if(!(0,a.isArrayBuffer)(r))throw new Error("PDFDocument: Unknown argument type");n=new c.Stream(r)}if(n.length<=0)throw new a.InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=t,this.stream=n,this.xref=new i.XRef(n,t),this._pagePromises=[],this._version=null;var s={font:0};this._globalIdFactory=function(){function e(){F(this,e)}return M(e,null,[{key:"getDocId",value:function(){return"g_".concat(t.docId)}},{key:"createFontId",value:function(){return"f".concat(++s.font)}},{key:"createObjId",value:function(){(0,a.unreachable)("Abstract method `createObjId` called.")}}]),e}()}return M(e,[{key:"parse",value:function(e){this.xref.parse(e),this.catalog=new i.Catalog(this.pdfManager,this.xref),this.catalog.version&&(this._version=this.catalog.version)}},{key:"checkHeader",value:function(){var e=this.stream;if(e.reset(),W(e,U)){e.moveStart();var t,r=12,n="";while((t=e.getByte())>32){if(n.length>=r)break;n+=String.fromCharCode(t)}this._version||(this._version=n.substring(5))}}},{key:"parseStartXRef",value:function(){this.xref.setStartXRef(this.startXRef)}},{key:"_hasOnlyDocumentSignatures",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=10;return e.every((function(e){if(e=t.xref.fetchIfRef(e),e.has("Kids"))return++r>n?((0,a.warn)("_hasOnlyDocumentSignatures: maximum recursion depth reached"),!1):t._hasOnlyDocumentSignatures(e.get("Kids"),r);var i=(0,o.isName)(e.get("FT"),"Sig"),s=e.get("Rect"),c=Array.isArray(s)&&s.every((function(e){return 0===e}));return i&&c}))}},{key:"_getLinearizationPage",value:function(e){var t=this.catalog,r=this.linearization,n=o.Ref.get(r.objectNumberFirst,0);return this.xref.fetchAsync(n).then((function(e){if((0,o.isDict)(e,"Page")||(0,o.isDict)(e)&&!e.has("Type")&&e.has("Contents"))return n&&!t.pageKidsCountCache.has(n)&&t.pageKidsCountCache.put(n,1),[e,n];throw new a.FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.")}))["catch"]((function(r){return(0,a.info)(r),t.getPageDict(e)}))}},{key:"getPage",value:function(e){var t=this;if(void 0!==this._pagePromises[e])return this._pagePromises[e];var r=this.catalog,n=this.linearization,a=n&&n.pageFirst===e?this._getLinearizationPage(e):r.getPageDict(e);return this._pagePromises[e]=a.then((function(n){var a=b(n,2),i=a[0],o=a[1];return new N({pdfManager:t.pdfManager,xref:t.xref,pageIndex:e,pageDict:i,ref:o,globalIdFactory:t._globalIdFactory,fontCache:r.fontCache,builtInCMapCache:r.builtInCMapCache,globalImageCache:r.globalImageCache})}))}},{key:"checkFirstPage",value:function(){var e=this;return this.getPage(0)["catch"](function(){var t=m(n["default"].mark((function t(r){return n["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!(r instanceof s.XRefEntryException)){t.next=5;break}return e._pagePromises.length=0,t.next=4,e.cleanup();case 4:throw new s.XRefParseException;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"fontFallback",value:function(e,t){return this.catalog.fontFallback(e,t)}},{key:"cleanup",value:function(){var e=m(n["default"].mark((function e(){var t,r=arguments;return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]&&r[0],e.abrupt("return",this.catalog?this.catalog.cleanup(t):(0,o.clearPrimitiveCaches)());case 2:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"linearization",get:function(){var e=null;try{e=h.Linearization.create(this.stream)}catch(t){if(t instanceof s.MissingDataException)throw t;(0,a.info)(t)}return(0,a.shadow)(this,"linearization",e)}},{key:"startXRef",get:function(){var e=this.stream,t=0;if(this.linearization)e.reset(),W(e,q)&&(t=e.pos+6-e.start);else{var r=1024,n=j.length,i=!1,o=e.end;while(!i&&o>0)o-=r-n,o<0&&(o=0),e.pos=o,i=W(e,j,r,!0);if(i){var c;e.skip(9);do{c=e.getByte()}while((0,s.isWhiteSpace)(c));var l="";while(c>=32&&c<=57)l+=String.fromCharCode(c),c=e.getByte();t=parseInt(l,10),isNaN(t)&&(t=0)}}return(0,a.shadow)(this,"startXRef",t)}},{key:"numPages",get:function(){var e=this.linearization,t=e?e.numPages:this.catalog.numPages;return(0,a.shadow)(this,"numPages",t)}},{key:"formInfo",get:function(){var e={hasAcroForm:!1,hasXfa:!1},t=this.catalog.acroForm;if(!t)return(0,a.shadow)(this,"formInfo",e);try{var r=t.get("XFA"),n=Array.isArray(r)&&r.length>0||(0,o.isStream)(r)&&!r.isEmpty;e.hasXfa=n;var i=t.get("Fields"),c=Array.isArray(i)&&i.length>0,l=t.get("SigFlags"),u=!!(1&l)&&this._hasOnlyDocumentSignatures(i);e.hasAcroForm=c&&!u}catch(h){if(h instanceof s.MissingDataException)throw h;(0,a.info)("Cannot fetch form information.")}return(0,a.shadow)(this,"formInfo",e)}},{key:"documentInfo",get:function(){var e={Title:a.isString,Author:a.isString,Subject:a.isString,Keywords:a.isString,Creator:a.isString,Producer:a.isString,CreationDate:a.isString,ModDate:a.isString,Trapped:o.isName},t=this._version;"string"===typeof t&&H.test(t)||((0,a.warn)("Invalid PDF header version number: ".concat(t)),t=null);var r,n={PDFFormatVersion:t,IsLinearized:!!this.linearization,IsAcroFormPresent:this.formInfo.hasAcroForm,IsXFAPresent:this.formInfo.hasXfa,IsCollectionPresent:!!this.catalog.collection};try{r=this.xref.trailer.get("Info")}catch(f){if(f instanceof s.MissingDataException)throw f;(0,a.info)("The document information dictionary is invalid.")}if((0,o.isDict)(r)){var i,c=S(r.getKeys());try{for(c.s();!(i=c.n()).done;){var l=i.value,u=r.get(l);if(e[l])e[l](u)?n[l]="string"!==typeof u?u:(0,a.stringToPDFString)(u):(0,a.info)('Bad value in document info for "'.concat(l,'".'));else if("string"===typeof l){var h=void 0;if((0,a.isString)(u))h=(0,a.stringToPDFString)(u);else{if(!((0,o.isName)(u)||(0,a.isNum)(u)||(0,a.isBool)(u))){(0,a.info)('Unsupported value in document info for (custom) "'.concat(l,'".'));continue}h=u}n.Custom||(n.Custom=Object.create(null)),n.Custom[l]=h}}}catch(f){c.e(f)}finally{c.f()}}return(0,a.shadow)(this,"documentInfo",n)}},{key:"fingerprint",get:function(){var e,t=this.xref.trailer.get("ID");e=Array.isArray(t)&&t[0]&&(0,a.isString)(t[0])&&t[0]!==G?(0,a.stringToBytes)(t[0]):(0,u.calculateMD5)(this.stream.getByteRange(0,z),0,z);for(var r=[],n=0,i=e.length;n=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r["return"]||r["return"]()}finally{if(s)throw i}}}}function O(e,t){if(e){if("string"===typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0){var u=n.shift(),h=s.fetchIfRef(u.obj);if(null!==h){if(!h.has("Title"))throw new a.FormatError("Invalid outline item encountered.");var f={url:null,dest:null};e.parseDestDictionary({destDict:h,resultObj:f,docBaseUrl:this.pdfManager.docBaseUrl});var d=h.get("Title"),p=h.get("F")||0,g=h.getArray("C"),m=h.get("Count"),v=c;!Array.isArray(g)||3!==g.length||0===g[0]&&0===g[1]&&0===g[2]||(v=l.ColorSpace.singletons.rgb.getRgb(g,0));var b={dest:f.dest,url:f.url,unsafeUrl:f.unsafeUrl,newWindow:f.newWindow,title:(0,a.stringToPDFString)(d),color:v,count:Number.isInteger(m)?m:void 0,bold:!!(2&p),italic:!!(1&p),items:[]};u.parent.items.push(b),t=h.getRaw("First"),(0,i.isRef)(t)&&!o.has(t)&&(n.push({obj:t,parent:b}),o.put(t)),t=h.getRaw("Next"),(0,i.isRef)(t)&&!o.has(t)&&(n.push({obj:t,parent:u.parent}),o.put(t))}}return r.items.length>0?r.items:null}},{key:"_readPermissions",value:function(){var e=this.xref.trailer.get("Encrypt");if(!(0,i.isDict)(e))return null;var t=e.get("P");if(!(0,a.isNum)(t))return null;t+=Math.pow(2,32);var r=[];for(var n in a.PermissionFlag){var o=a.PermissionFlag[n];t&o&&r.push(o)}return r}},{key:"_readOptionalContentConfig",value:function(e,t){function r(e){var r=[];if(Array.isArray(e)){var n,a=E(e);try{for(a.s();!(n=a.n()).done;){var o=n.value;(0,i.isRef)(o)&&(t.includes(o)&&r.push(o.toString()))}}catch(s){a.e(s)}finally{a.f()}}return r}function n(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!Array.isArray(e))return null;var n,a=[],s=E(e);try{for(s.s();!(n=s.n()).done;){var l=n.value;if((0,i.isRef)(l)&&t.includes(l))c.put(l),a.push(l.toString());else{var u=o(l,r);u&&a.push(u)}}}catch(g){s.e(g)}finally{s.f()}if(r>0)return a;var h,f=[],d=E(t);try{for(d.s();!(h=d.n()).done;){var p=h.value;c.has(p)||f.push(p.toString())}}catch(g){d.e(g)}finally{d.f()}return f.length&&a.push({name:null,order:f}),a}function o(e,t){if(++t>l)return(0,a.warn)("parseNestedOrder - reached MAX_NESTED_LEVELS."),null;var r=s.fetchIfRef(e);if(!Array.isArray(r))return null;var i=s.fetchIfRef(r[0]);if("string"!==typeof i)return null;var o=n(r.slice(1),t);return o&&o.length?{name:(0,a.stringToPDFString)(i),order:o}:null}var s=this.xref,c=new i.RefSet,l=10;return{name:(0,a.isString)(e.get("Name"))?(0,a.stringToPDFString)(e.get("Name")):null,creator:(0,a.isString)(e.get("Creator"))?(0,a.stringToPDFString)(e.get("Creator")):null,baseState:(0,i.isName)(e.get("BaseState"))?e.get("BaseState").name:null,on:r(e.get("ON")),off:r(e.get("OFF")),order:n(e.get("Order")),groups:null}}},{key:"getDestination",value:function(e){var t=this._readDests();return t instanceof L||t instanceof i.Dict?F(t.get(e)||null):null}},{key:"_readDests",value:function(){var e=this._catDict.get("Names");return e&&e.has("Dests")?new L(e.getRaw("Dests"),this.xref):this._catDict.has("Dests")?this._catDict.get("Dests"):void 0}},{key:"_readPageLabels",value:function(){var e=this._catDict.getRaw("PageLabels");if(!e)return null;for(var t=new Array(this.numPages),r=null,n="",o=new D(e,this.xref),c=o.getAll(),l="",u=1,h=0,f=this.numPages;h=1))throw new a.FormatError("Invalid start in PageLabel dictionary.");u=m}else u=1}switch(r){case"D":l=u;break;case"R":case"r":l=(0,s.toRomanNumerals)(u,"r"===r);break;case"A":case"a":for(var v=26,b=65,y=97,w="a"===r?y:b,k=u-1,S=String.fromCharCode(w+k%v),x=[],C=0,A=k/v|0;C<=A;C++)x.push(S);l=x.join("");break;default:if(r)throw new a.FormatError('Invalid style "'.concat(r,'" in PageLabel dictionary.'));l=""}t[h]=n+l,u++}return t}},{key:"fontFallback",value:function(e,t){var r=[];return this.fontCache.forEach((function(e){r.push(e)})),Promise.all(r).then((function(r){var n,a=E(r);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i.loadedName===e)return void i.fallback(t)}}catch(o){a.e(o)}finally{a.f()}}))}},{key:"cleanup",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,i.clearPrimitiveCaches)(),this.globalImageCache.clear(t),this.pageKidsCountCache.clear();var r=[];return this.fontCache.forEach((function(e){r.push(e)})),Promise.all(r).then((function(t){var r,n=E(t);try{for(n.s();!(r=n.n()).done;){var a=r.value.dict;delete a.translated}}catch(i){n.e(i)}finally{n.f()}e.fontCache.clear(),e.builtInCMapCache.clear()}))}},{key:"getPageDict",value:function(e){var t,r=(0,a.createPromiseCapability)(),n=[this._catDict.getRaw("Pages")],o=new i.RefSet,s=this.xref,c=this.pageKidsCountCache,l=0;function u(){var h=function(){var h=n.pop();if((0,i.isRef)(h))return t=c.get(h),t>0&&l+t=0){var f=h.objId;if(f&&!c.has(f)&&c.put(f,t),l+t<=e)return l+=t,"continue"}var d=h.get("Kids");if(!Array.isArray(d))return(0,i.isName)(h.get("Type"),"Page")||!h.has("Type")&&h.has("Contents")?l===e?(r.resolve([h,null]),{v:void 0}):(l++,"continue"):(r.reject(new a.FormatError("Page dictionary kids object is not an array.")),{v:void 0});for(var p=d.length-1;p>=0;p--)n.push(d[p])};while(n.length){var f=h();if("continue"!==f&&"object"===A(f))return f.v}r.reject(new Error("Page index ".concat(e," not found.")))}return u(),r.promise}},{key:"getPageIndex",value:function(e){var t=this.xref;function r(r){var n,o=0;return t.fetchAsync(r).then((function(t){if((0,i.isRefsEqual)(r,e)&&!(0,i.isDict)(t,"Page")&&(!(0,i.isDict)(t)||t.has("Type")||!t.has("Contents")))throw new a.FormatError("The reference does not point to a /Page dictionary.");if(!t)return null;if(!(0,i.isDict)(t))throw new a.FormatError("Node must be a dictionary.");return n=t.getRaw("Parent"),t.getAsync("Parent")})).then((function(e){if(!e)return null;if(!(0,i.isDict)(e))throw new a.FormatError("Parent must be a dictionary.");return e.getAsync("Kids")})).then((function(e){if(!e)return null;for(var s=[],c=!1,l=0,u=e.length;l0&&(e=t)}catch(r){if(r instanceof s.MissingDataException)throw r;(0,a.info)("Cannot fetch Collection entry; assuming no collection is present.")}return(0,a.shadow)(this,"collection",e)}},{key:"acroForm",get:function(){var e=null;try{var t=this._catDict.get("AcroForm");(0,i.isDict)(t)&&t.size>0&&(e=t)}catch(r){if(r instanceof s.MissingDataException)throw r;(0,a.info)("Cannot fetch AcroForm entry; assuming no forms are present.")}return(0,a.shadow)(this,"acroForm",e)}},{key:"metadata",get:function(){var e=this._catDict.getRaw("Metadata");if(!(0,i.isRef)(e))return(0,a.shadow)(this,"metadata",null);var t,r=!(this.xref.encrypt&&this.xref.encrypt.encryptMetadata),n=this.xref.fetch(e,r);if(n&&(0,i.isDict)(n.dict)){var o=n.dict.get("Type"),c=n.dict.get("Subtype");if((0,i.isName)(o,"Metadata")&&(0,i.isName)(c,"XML"))try{t=(0,a.stringToUTF8String)((0,a.bytesToString)(n.getBytes()))}catch(l){if(l instanceof s.MissingDataException)throw l;(0,a.info)("Skipping invalid metadata.")}}return(0,a.shadow)(this,"metadata",t)}},{key:"toplevelPagesDict",get:function(){var e=this._catDict.get("Pages");if(!(0,i.isDict)(e))throw new a.FormatError("Invalid top-level pages dictionary.");return(0,a.shadow)(this,"toplevelPagesDict",e)}},{key:"documentOutline",get:function(){var e=null;try{e=this._readDocumentOutline()}catch(t){if(t instanceof s.MissingDataException)throw t;(0,a.warn)("Unable to read document outline.")}return(0,a.shadow)(this,"documentOutline",e)}},{key:"permissions",get:function(){var e=null;try{e=this._readPermissions()}catch(t){if(t instanceof s.MissingDataException)throw t;(0,a.warn)("Unable to read permissions.")}return(0,a.shadow)(this,"permissions",e)}},{key:"optionalContentConfig",get:function(){var e=null;try{var t=this._catDict.get("OCProperties");if(!t)return(0,a.shadow)(this,"optionalContentConfig",null);var r=t.get("D");if(!r)return(0,a.shadow)(this,"optionalContentConfig",null);var n=t.get("OCGs");if(!Array.isArray(n))return(0,a.shadow)(this,"optionalContentConfig",null);var o,c=[],l=[],u=E(n);try{for(u.s();!(o=u.n()).done;){var h=o.value;if((0,i.isRef)(h)){l.push(h);var f=this.xref.fetchIfRef(h);c.push({id:h.toString(),name:(0,a.isString)(f.get("Name"))?(0,a.stringToPDFString)(f.get("Name")):null,intent:(0,a.isString)(f.get("Intent"))?(0,a.stringToPDFString)(f.get("Intent")):null})}}}catch(d){u.e(d)}finally{u.f()}e=this._readOptionalContentConfig(r,l),e.groups=c}catch(p){if(p instanceof s.MissingDataException)throw p;(0,a.warn)("Unable to read optional content config: ".concat(p))}return(0,a.shadow)(this,"optionalContentConfig",e)}},{key:"numPages",get:function(){var e=this.toplevelPagesDict.get("Count");if(!Number.isInteger(e))throw new a.FormatError("Page count in top-level pages dictionary is not an integer.");return(0,a.shadow)(this,"numPages",e)}},{key:"destinations",get:function(){var e=this._readDests(),t=Object.create(null);if(e instanceof L){var r=e.getAll();for(var n in r)t[n]=F(r[n])}else e instanceof i.Dict&&e.forEach((function(e,r){r&&(t[e]=F(r))}));return(0,a.shadow)(this,"destinations",t)}},{key:"pageLabels",get:function(){var e=null;try{e=this._readPageLabels()}catch(t){if(t instanceof s.MissingDataException)throw t;(0,a.warn)("Unable to read page labels.")}return(0,a.shadow)(this,"pageLabels",e)}},{key:"pageLayout",get:function(){var e=this._catDict.get("PageLayout"),t="";if((0,i.isName)(e))switch(e.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":t=e.name}return(0,a.shadow)(this,"pageLayout",t)}},{key:"pageMode",get:function(){var e=this._catDict.get("PageMode"),t="UseNone";if((0,i.isName)(e))switch(e.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":t=e.name}return(0,a.shadow)(this,"pageMode",t)}},{key:"viewerPreferences",get:function(){var e=this,t={HideToolbar:a.isBool,HideMenubar:a.isBool,HideWindowUI:a.isBool,FitWindow:a.isBool,CenterWindow:a.isBool,DisplayDocTitle:a.isBool,NonFullScreenPageMode:i.isName,Direction:i.isName,ViewArea:i.isName,ViewClip:i.isName,PrintArea:i.isName,PrintClip:i.isName,PrintScaling:i.isName,Duplex:i.isName,PickTrayByPDFSize:a.isBool,PrintPageRange:Array.isArray,NumCopies:Number.isInteger},r=this._catDict.get("ViewerPreferences"),n=null;if((0,i.isDict)(r))for(var o in t)if(r.has(o)){var s=r.get(o);if(t[o](s)){var c=void 0;switch(o){case"NonFullScreenPageMode":switch(s.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":c=s.name;break;default:c="UseNone"}break;case"Direction":switch(s.name){case"L2R":case"R2L":c=s.name;break;default:c="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":switch(s.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":c=s.name;break;default:c="CropBox"}break;case"PrintScaling":switch(s.name){case"None":case"AppDefault":c=s.name;break;default:c="AppDefault"}break;case"Duplex":switch(s.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":c=s.name;break;default:c="None"}break;case"PrintPageRange":var l=s.length;if(l%2!==0)break;var u=s.every((function(t,r,n){return Number.isInteger(t)&&t>0&&(0===r||t>=n[r-1])&&t<=e.numPages}));u&&(c=s);break;case"NumCopies":s>0&&(c=s);break;default:if("boolean"!==typeof s)throw new a.FormatError("viewerPreferences - expected a boolean value for: ".concat(o));c=s}void 0!==c?(n||(n=Object.create(null)),n[o]=c):(0,a.info)('Bad value in ViewerPreferences for "'.concat(o,'".'))}else(0,a.info)('Bad value in ViewerPreferences for "'.concat(o,'".'))}return(0,a.shadow)(this,"viewerPreferences",n)}},{key:"openAction",get:function(){var t=this._catDict.get("OpenAction"),r=null;if((0,i.isDict)(t)){var n=new i.Dict(this.xref);n.set("A",t);var o={url:null,dest:null,action:null};e.parseDestDictionary({destDict:n,resultObj:o}),Array.isArray(o.dest)?(r||(r=Object.create(null)),r.dest=o.dest):o.action&&(r||(r=Object.create(null)),r.action=o.action)}else Array.isArray(t)&&(r||(r=Object.create(null)),r.dest=t);return(0,a.shadow)(this,"openAction",r)}},{key:"attachments",get:function(){var e=this._catDict.get("Names"),t=null;if(e&&e.has("EmbeddedFiles")){var r=new L(e.getRaw("EmbeddedFiles"),this.xref),n=r.getAll();for(var i in n){var o=new N(n[i],this.xref);t||(t=Object.create(null)),t[(0,a.stringToPDFString)(i)]=o.serializable}}return(0,a.shadow)(this,"attachments",t)}},{key:"javaScript",get:function(){var e=this._catDict.get("Names"),t=null;function r(e){var r=e.get("S");if((0,i.isName)(r,"JavaScript")){var n=e.get("JS");if((0,i.isStream)(n))n=(0,a.bytesToString)(n.getBytes());else if(!(0,a.isString)(n))return;t||(t=[]),t.push((0,a.stringToPDFString)(n))}}if(e&&e.has("JavaScript")){var n=new L(e.getRaw("JavaScript"),this.xref),o=n.getAll();for(var s in o){var c=o[s];(0,i.isDict)(c)&&r(c)}}var l=this._catDict.get("OpenAction");return(0,i.isDict)(l)&&(0,i.isName)(l.get("S"),"JavaScript")&&r(l),(0,a.shadow)(this,"javaScript",t)}}],[{key:"parseDestDictionary",value:function(e){function t(e){return e.startsWith("www.")?"http://".concat(e):e}function r(e){try{return(0,a.stringToUTF8String)(e)}catch(t){return e}}var n=e.destDict;if((0,i.isDict)(n)){var o=e.resultObj;if("object"===A(o)){var s,c,l=e.docBaseUrl||null,u=n.get("A");if(!(0,i.isDict)(u)&&n.has("Dest")&&(u=n.get("Dest")),(0,i.isDict)(u)){var h=u.get("S");if(!(0,i.isName)(h))return void(0,a.warn)("parseDestDictionary: Invalid type in Action dictionary.");var f=h.name;switch(f){case"URI":s=u.get("URI"),(0,i.isName)(s)?s="/"+s.name:(0,a.isString)(s)&&(s=t(s));break;case"GoTo":c=u.get("D");break;case"Launch":case"GoToR":var d=u.get("F");(0,i.isDict)(d)?s=d.get("F")||null:(0,a.isString)(d)&&(s=d);var p=u.get("D");if(p&&((0,i.isName)(p)&&(p=p.name),(0,a.isString)(s))){var g=s.split("#")[0];(0,a.isString)(p)?s=g+"#"+p:Array.isArray(p)&&(s=g+"#"+JSON.stringify(p))}var m=u.get("NewWindow");(0,a.isBool)(m)&&(o.newWindow=m);break;case"Named":var v=u.get("N");(0,i.isName)(v)&&(o.action=v.name);break;case"JavaScript":var b,y=u.get("JS");if((0,i.isStream)(y)?b=(0,a.bytesToString)(y.getBytes()):(0,a.isString)(y)&&(b=y),b){var w=["app.launchURL","window.open"],k=new RegExp("^\\s*("+w.join("|").split(".").join("\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i"),S=k.exec((0,a.stringToPDFString)(b));if(S&&S[2]){s=S[2],"true"===S[3]&&"app.launchURL"===S[1]&&(o.newWindow=!0);break}}default:(0,a.warn)('parseDestDictionary: unsupported action type "'.concat(f,'".'));break}}else n.has("Dest")&&(c=n.get("Dest"));if((0,a.isString)(s)){s=r(s);var x=(0,a.createValidAbsoluteUrl)(s,l);x&&(o.url=x.href),o.unsafeUrl=s}c&&((0,i.isName)(c)&&(c=c.name),((0,a.isString)(c)||Array.isArray(c))&&(o.dest=c))}else(0,a.warn)("parseDestDictionary: `resultObj` must be an object.")}else(0,a.warn)("parseDestDictionary: `destDict` must be a dictionary.")}}]),e}();t.Catalog=R;var M=function(){function e(e,t){this.stream=e,this.pdfManager=t,this.entries=[],this.xrefstms=Object.create(null),this._cacheMap=new Map,this.stats={streamTypes:Object.create(null),fontTypes:Object.create(null)},this._newRefNum=null}return e.prototype={getNewRef:function(){return null===this._newRefNum&&(this._newRefNum=this.entries.length),i.Ref.get(this._newRefNum++,0)},resetNewRef:function(){this._newRefNum=null},setStartXRef:function(e){this.startXRefQueue=[e]},parse:function(e){var t,r,n;e?((0,a.warn)("Indexing all PDF objects"),t=this.indexObjects()):t=this.readXRef(),t.assignXref(this),this.trailer=t;try{r=t.get("Encrypt")}catch(u){if(u instanceof s.MissingDataException)throw u;(0,a.warn)('XRef.parse - Invalid "Encrypt" reference: "'.concat(u,'".'))}if((0,i.isDict)(r)){var o=t.get("ID"),l=o&&o.length?o[0]:"";r.suppressEncryption=!0,this.encrypt=new c.CipherTransformFactory(r,l,this.pdfManager.password)}try{n=t.get("Root")}catch(u){if(u instanceof s.MissingDataException)throw u;(0,a.warn)('XRef.parse - Invalid "Root" reference: "'.concat(u,'".'))}if(!(0,i.isDict)(n)||!n.has("Pages")){if(!e)throw new s.XRefParseException;throw new a.FormatError("Invalid root reference")}this.root=n},processXRefTable:function(e){"tableState"in this||(this.tableState={entryNum:0,streamPos:e.lexer.stream.pos,parserBuf1:e.buf1,parserBuf2:e.buf2});var t=this.readXRefTable(e);if(!(0,i.isCmd)(t,"trailer"))throw new a.FormatError("Invalid XRef table: could not find trailer dictionary");var r=e.getObj();if(!(0,i.isDict)(r)&&r.dict&&(r=r.dict),!(0,i.isDict)(r))throw new a.FormatError("Invalid XRef table: could not parse trailer dictionary");return delete this.tableState,r},readXRefTable:function(e){var t,r=e.lexer.stream,n=this.tableState;r.pos=n.streamPos,e.buf1=n.parserBuf1,e.buf2=n.parserBuf2;while(1){if(!("firstEntryNum"in n)||!("entryCount"in n)){if((0,i.isCmd)(t=e.getObj(),"trailer"))break;n.firstEntryNum=t,n.entryCount=e.getObj()}var o=n.firstEntryNum,s=n.entryCount;if(!Number.isInteger(o)||!Number.isInteger(s))throw new a.FormatError("Invalid XRef table: wrong types in subsection header");for(var c=n.entryNum;c0){var u=l[0],h=l[1];if(!Number.isInteger(u)||!Number.isInteger(h))throw new a.FormatError("Invalid XRef range fields: ".concat(u,", ").concat(h));if(!Number.isInteger(o)||!Number.isInteger(s)||!Number.isInteger(c))throw new a.FormatError("Invalid XRef entry fields length: ".concat(u,", ").concat(h));for(t=n.entryNum;t=e.length)break;a+=String.fromCharCode(i),i=e[n]}return a}function h(e,t,r){var n=r.length,a=e.length,i=0;while(t=n)break;t++,i++}return i}var f=/^(\d+)\s+(\d+)\s+obj\b/,d=/\bendobj[\b\s]$/,p=/\s+(\d+\s+\d+\s+obj[\b\s<])$/,g=25,m=new Uint8Array([116,114,97,105,108,101,114]),v=new Uint8Array([115,116,97,114,116,120,114,101,102]),b=new Uint8Array([111,98,106]),y=new Uint8Array([47,88,82,101,102]);this.entries.length=0;var w=this.stream;w.pos=0;var k,S,x,C=w.getBytes(),A=w.start,E=C.length,O=[],T=[];while(A=E)break;I=C[A]}while(I!==t&&I!==r);else++A}for(k=0,S=T.length;k2&&void 0!==arguments[2]&&arguments[2],n=e.gen,a=e.num;if(t.gen!==n)throw new s.XRefEntryException("Inconsistent generation in XRef: ".concat(e));var c=this.stream.makeSubStream(t.offset+this.stream.start),l=new o.Parser({lexer:new o.Lexer(c),xref:this,allowStreams:!0}),u=l.getObj(),h=l.getObj(),f=l.getObj();if(u!==a||h!==n||!(f instanceof i.Cmd))throw new s.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(e));if("obj"!==f.cmd){if(f.cmd.startsWith("obj")&&(a=parseInt(f.cmd.substring(3),10),!Number.isNaN(a)))return a;throw new s.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(e))}return t=this.encrypt&&!r?l.getObj(this.encrypt.createCipherTransform(a,n)):l.getObj(),(0,i.isStream)(t)||this._cacheMap.set(a,t),t},fetchCompressed:function(e,t){var r=t.offset,n=this.fetch(i.Ref.get(r,0));if(!(0,i.isStream)(n))throw new a.FormatError("bad ObjStm stream");var c=n.dict.get("First"),l=n.dict.get("N");if(!Number.isInteger(c)||!Number.isInteger(l))throw new a.FormatError("invalid first and n parameters for ObjStm stream");for(var u=new o.Parser({lexer:new o.Lexer(n),xref:this,allowStreams:!0}),h=new Array(l),f=0;f0){var o=t.fetchIfRef(n.shift());if((0,i.isDict)(o))if(o.has("Kids"))for(var s=o.get("Kids"),c=0,l=s.length;ci)return(0,a.warn)('Search depth limit reached for "'.concat(this._type,'" tree.')),null;var o=r.get("Kids");if(!Array.isArray(o))return null;var s=0,c=o.length-1;while(s<=c){var l=s+c>>1,u=t.fetchIfRef(o[l]),h=u.get("Limits");if(et.fetchIfRef(h[1]))){r=t.fetchIfRef(o[l]);break}s=l+1}}if(s>c)return null}var f=r.get(this._type);if(Array.isArray(f)){var d=0,p=f.length-2;while(d<=p){var g=d+p>>1,m=g+(1&g),v=t.fetchIfRef(f[m]);if(ev))return t.fetchIfRef(f[m+1]);d=m+2}}(0,a.info)('Falling back to an exhaustive search, for key "'.concat(e,'", ')+'in "'.concat(this._type,'" tree.'));for(var b=0,y=f.length;b0&&void 0!==arguments[0]?arguments[0]:null,t=this.buf1;if(this.shift(),t instanceof i.Cmd)switch(t.cmd){case"BI":return this.makeInlineImage(e);case"[":var r=[];while(!(0,i.isCmd)(this.buf1,"]")&&!(0,i.isEOF)(this.buf1))r.push(this.getObj(e));if((0,i.isEOF)(this.buf1)){if(!this.recoveryMode)throw new a.FormatError("End of file inside array");return r}return this.shift(),r;case"<<":var n=new i.Dict(this.xref);while(!(0,i.isCmd)(this.buf1,">>")&&!(0,i.isEOF)(this.buf1))if((0,i.isName)(this.buf1)){var o=this.buf1.name;if(this.shift(),(0,i.isEOF)(this.buf1))break;n.set(o,this.getObj(e))}else(0,a.info)("Malformed dictionary: key must be a name object"),this.shift();if((0,i.isEOF)(this.buf1)){if(!this.recoveryMode)throw new a.FormatError("End of file inside dictionary");return n}return(0,i.isCmd)(this.buf2,"stream")?this.allowStreams?this.makeStream(n,e):n:(this.shift(),n);default:return t}if(Number.isInteger(t)){if(Number.isInteger(this.buf1)&&(0,i.isCmd)(this.buf2,"R")){var s=i.Ref.get(t,this.buf1);return this.shift(),this.shift(),s}return t}return"string"===typeof t&&e?e.decryptString(t):t}},{key:"findDefaultInlineStreamEnd",value:function(e){var t,r,n=69,s=73,c=32,l=10,u=13,h=0,f=this.lexer,d=e.pos,p=10,g=0;while(-1!==(t=e.getByte()))if(0===g)g=t===n?1:0;else if(1===g)g=t===s?2:0;else if((0,a.assert)(2===g,"findDefaultInlineStreamEnd - invalid state."),t===c||t===l||t===u){r=e.pos;for(var m=e.peekBytes(p),v=0,b=m.length;v127)){g=0;break}if(2!==g)continue;if(f.knownCommands){var y=f.peekObj();y instanceof i.Cmd&&!f.knownCommands[y.cmd]&&(g=0)}else(0,a.warn)("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");if(2===g)break}else g=0;-1===t&&((0,a.warn)("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker"),r&&((0,a.warn)('... trying to recover by using the last "EI" occurrence.'),e.skip(-(e.pos-r))));var w=4;return e.skip(-w),t=e.peekByte(),e.skip(w),(0,o.isWhiteSpace)(t)||w--,e.pos-w-d}},{key:"findDCTDecodeInlineStreamEnd",value:function(e){var t,r,n=e.pos,i=!1;while(-1!==(t=e.getByte()))if(255===t){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:i=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:r=e.getUint16(),r>2?e.skip(r-2):e.skip(-2);break}if(i)break}var o=e.pos-n;return-1===t?((0,a.warn)("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead."),e.skip(-o),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),o)}},{key:"findASCII85DecodeInlineStreamEnd",value:function(e){var t,r=126,n=62,i=e.pos;while(-1!==(t=e.getByte()))if(t===r){var s=e.pos;t=e.peekByte();while((0,o.isWhiteSpace)(t))e.skip(),t=e.peekByte();if(t===n){e.skip();break}if(e.pos>s){var c=e.peekBytes(2);if(69===c[0]&&73===c[1])break}}var l=e.pos-i;return-1===t?((0,a.warn)("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-l),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),l)}},{key:"findASCIIHexDecodeInlineStreamEnd",value:function(e){var t,r=62,n=e.pos;while(-1!==(t=e.getByte()))if(t===r)break;var i=e.pos-n;return-1===t?((0,a.warn)("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-i),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),i)}},{key:"inlineStreamSkipEI",value:function(e){var t,r=69,n=73,a=0;while(-1!==(t=e.getByte()))if(0===a)a=t===r?1:0;else if(1===a)a=t===n?2:0;else if(2===a)break}},{key:"makeInlineImage",value:function(e){var t,r=this.lexer,n=r.stream,o=new i.Dict(this.xref);while(!(0,i.isCmd)(this.buf1,"ID")&&!(0,i.isEOF)(this.buf1)){if(!(0,i.isName)(this.buf1))throw new a.FormatError("Dictionary key must be a name object");var s=this.buf1.name;if(this.shift(),(0,i.isEOF)(this.buf1))break;o.set(s,this.getObj(e))}-1!==r.beginInlineImagePos&&(t=n.pos-r.beginInlineImagePos);var c,l=o.get("Filter","F");if((0,i.isName)(l))c=l.name;else if(Array.isArray(l)){var u=this.xref.fetchIfRef(l[0]);(0,i.isName)(u)&&(c=u.name)}var h,f=n.pos;h="DCTDecode"===c||"DCT"===c?this.findDCTDecodeInlineStreamEnd(n):"ASCII85Decode"===c||"A85"===c?this.findASCII85DecodeInlineStreamEnd(n):"ASCIIHexDecode"===c||"AHx"===c?this.findASCIIHexDecodeInlineStreamEnd(n):this.findDefaultInlineStreamEnd(n);var d,v=n.makeSubStream(f,h,o);if(h=a)return r.pos+=s,r.pos-e;s++}r.pos+=o}return-1}},{key:"makeStream",value:function(e,t){var r=this.lexer,n=r.stream;r.skipToNextLine();var s=n.pos-1,c=e.get("Length");if(Number.isInteger(c)||((0,a.info)('Bad length "'.concat(c,'" in stream')),c=0),n.pos=s+c,r.nextChar(),this.tryShift()&&(0,i.isCmd)(this.buf2,"endstream"))this.shift();else{var l=new Uint8Array([101,110,100,115,116,114,101,97,109]),u=this._findStreamLength(s,l);if(u<0){for(var h=1,f=1;f<=h;f++){var d=l.length-f,p=l.slice(0,d),g=this._findStreamLength(s,p);if(g>=0){var m=n.peekBytes(d+1)[d];if(!(0,o.isWhiteSpace)(m))break;(0,a.info)('Found "'.concat((0,a.bytesToString)(p),'" when ')+"searching for endstream command."),u=g;break}}if(u<0)throw new a.FormatError("Missing endstream command.")}c=u,r.nextChar(),this.shift(),this.shift()}return this.shift(),n=n.makeSubStream(s,c,e),t&&(n=t.createStream(n,c)),n=this.filter(n,e,c),n.dict=e,n}},{key:"filter",value:function(e,t,r){var n=t.get("Filter","F"),o=t.get("DecodeParms","DP");if((0,i.isName)(n))return Array.isArray(o)&&(0,a.warn)("/DecodeParms should not contain an Array, when /Filter contains a Name."),this.makeFilter(e,n.name,r,o);var s=r;if(Array.isArray(n))for(var c=n,l=o,u=0,h=c.length;u=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}var w=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;h(this,e),this.stream=t,this.nextChar(),this.strBuf=[],this.knownCommands=r,this._hexStringNumWarn=0,this.beginInlineImagePos=-1}return d(e,[{key:"nextChar",value:function(){return this.currentChar=this.stream.getByte()}},{key:"peekChar",value:function(){return this.stream.peekByte()}},{key:"getNumber",value:function(){var e=this.currentChar,t=!1,r=0,n=0;if(45===e?(n=-1,e=this.nextChar(),45===e&&(e=this.nextChar())):43===e&&(n=1,e=this.nextChar()),10===e||13===e)do{e=this.nextChar()}while(10===e||13===e);if(46===e&&(r=10,e=this.nextChar()),e<48||e>57){if(10===r&&0===n&&((0,o.isWhiteSpace)(e)||-1===e))return(0,a.warn)("Lexer.getNumber - treating a single decimal point as zero."),0;throw new a.FormatError("Invalid number: ".concat(String.fromCharCode(e)," (charCode ").concat(e,")"))}n=n||1;var i=e-48,s=0,c=1;while((e=this.nextChar())>=0)if(e>=48&&e<=57){var l=e-48;t?s=10*s+l:(0!==r&&(r*=10),i=10*i+l)}else if(46===e){if(0!==r)break;r=1}else if(45===e)(0,a.warn)("Badly formatted number: minus sign in the middle");else{if(69!==e&&101!==e)break;if(e=this.peekChar(),43===e||45===e)c=45===e?-1:1,this.nextChar();else if(e<48||e>57)break;t=!0}return 0!==r&&(i/=r),t&&(i*=Math.pow(10,c*s)),n*i}},{key:"getString",value:function(){var e=1,t=!1,r=this.strBuf;r.length=0;var n=this.nextChar();while(1){var i=!1;switch(0|n){case-1:(0,a.warn)("Unterminated string"),t=!0;break;case 40:++e,r.push("(");break;case 41:0===--e?(this.nextChar(),t=!0):r.push(")");break;case 92:switch(n=this.nextChar(),n){case-1:(0,a.warn)("Unterminated string"),t=!0;break;case 110:r.push("\n");break;case 114:r.push("\r");break;case 116:r.push("\t");break;case 98:r.push("\b");break;case 102:r.push("\f");break;case 92:case 40:case 41:r.push(String.fromCharCode(n));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:var o=15&n;n=this.nextChar(),i=!0,n>=48&&n<=55&&(o=(o<<3)+(15&n),n=this.nextChar(),n>=48&&n<=55&&(i=!1,o=(o<<3)+(15&n))),r.push(String.fromCharCode(o));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:r.push(String.fromCharCode(n));break}break;default:r.push(String.fromCharCode(n));break}if(t)break;i||(n=this.nextChar())}return r.join("")}},{key:"getName",value:function(){var e,t,r=this.strBuf;r.length=0;while((e=this.nextChar())>=0&&!b[e])if(35===e){if(e=this.nextChar(),b[e]){(0,a.warn)("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."),r.push("#");break}var n=y(e);if(-1!==n){t=e,e=this.nextChar();var o=y(e);if(-1===o){if((0,a.warn)("Lexer_getName: Illegal digit (".concat(String.fromCharCode(e),") ")+"in hexadecimal number."),r.push("#",String.fromCharCode(t)),b[e])break;r.push(String.fromCharCode(e));continue}r.push(String.fromCharCode(n<<4|o))}else r.push("#",String.fromCharCode(e))}else r.push(String.fromCharCode(e));return r.length>127&&(0,a.warn)("Name token is longer than allowed by the spec: ".concat(r.length)),i.Name.get(r.join(""))}},{key:"_hexStringWarn",value:function(e){var t=5;this._hexStringNumWarn++!==t?this._hexStringNumWarn>t||(0,a.warn)("getHexString - ignoring invalid character: ".concat(e)):(0,a.warn)("getHexString - ignoring additional invalid characters.")}},{key:"getHexString",value:function(){var e=this.strBuf;e.length=0;var t,r,n=this.currentChar,i=!0;this._hexStringNumWarn=0;while(1){if(n<0){(0,a.warn)("Unterminated hex string");break}if(62===n){this.nextChar();break}if(1!==b[n]){if(i){if(t=y(n),-1===t){this._hexStringWarn(n),n=this.nextChar();continue}}else{if(r=y(n),-1===r){this._hexStringWarn(n),n=this.nextChar();continue}e.push(String.fromCharCode(t<<4|r))}i=!i,n=this.nextChar()}else n=this.nextChar()}return e.join("")}},{key:"getObj",value:function(){var e=!1,t=this.currentChar;while(1){if(t<0)return i.EOF;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(1!==b[t])break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),i.Cmd.get("[");case 93:return this.nextChar(),i.Cmd.get("]");case 60:return t=this.nextChar(),60===t?(this.nextChar(),i.Cmd.get("<<")):this.getHexString();case 62:return t=this.nextChar(),62===t?(this.nextChar(),i.Cmd.get(">>")):i.Cmd.get(">");case 123:return this.nextChar(),i.Cmd.get("{");case 125:return this.nextChar(),i.Cmd.get("}");case 41:throw this.nextChar(),new a.FormatError("Illegal character: ".concat(t))}var r=String.fromCharCode(t),n=this.knownCommands,o=n&&void 0!==n[r];while((t=this.nextChar())>=0&&!b[t]){var s=r+String.fromCharCode(t);if(o&&void 0===n[s])break;if(128===r.length)throw new a.FormatError("Command token too long: ".concat(r.length));r=s,o=n&&void 0!==n[r]}return"true"===r||"false"!==r&&("null"===r?null:("BI"===r&&(this.beginInlineImagePos=this.stream.pos),i.Cmd.get(r)))}},{key:"peekObj",value:function(){var e,t=this.stream.pos,r=this.currentChar,n=this.beginInlineImagePos;try{e=this.getObj()}catch(i){if(i instanceof o.MissingDataException)throw i;(0,a.warn)("peekObj: ".concat(i))}return this.stream.pos=t,this.currentChar=r,this.beginInlineImagePos=n,e}},{key:"skipToNextLine",value:function(){var e=this.currentChar;while(e>=0){if(13===e){e=this.nextChar(),10===e&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}}}]),e}();t.Lexer=w;var k=function(){function e(){h(this,e)}return d(e,null,[{key:"create",value:function(e){function t(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.get(t);if(Number.isInteger(n)&&(r?n>=0:n>0))return n;throw new Error('The "'.concat(t,'" parameter in the linearization ')+"dictionary is invalid.")}function r(e){var t,r=e.get("H");if(Array.isArray(r)&&(2===(t=r.length)||4===t)){for(var n=0;n0))throw new Error("Hint (".concat(n,") in the linearization dictionary is invalid."))}return r}throw new Error("Hint array in the linearization dictionary is invalid.")}var n,o,s=new v({lexer:new w(e),xref:null}),c=s.getObj(),l=s.getObj(),u=s.getObj(),h=s.getObj();if(!(Number.isInteger(c)&&Number.isInteger(l)&&(0,i.isCmd)(u,"obj")&&(0,i.isDict)(h)&&(0,a.isNum)(n=h.get("Linearized"))&&n>0))return null;if((o=t(h,"L"))!==e.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:o,hints:r(h),objectNumberFirst:t(h,"O"),endFirst:t(h,"E"),numPages:t(h,"N"),mainXRefEntriesOffset:t(h,"T"),pageFirst:h.has("P")?t(h,"P",!0):0}}}]),e}();t.Linearization=k},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LZWStream=t.StringStream=t.StreamsSequenceStream=t.Stream=t.RunLengthStream=t.PredictorStream=t.NullStream=t.FlateStream=t.DecodeStream=t.DecryptStream=t.AsciiHexStream=t.Ascii85Stream=void 0;var n=r(5),a=r(202),i=r(205);function o(e){return u(e)||l(e)||c(e)||s()}function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){if(e){if("string"===typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}function l(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function u(e){if(Array.isArray(e))return h(e)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=this.end?-1:this.bytes[this.pos++]},getUint16:function(){var e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t},getInt32:function(){var e=this.getByte(),t=this.getByte(),r=this.getByte(),n=this.getByte();return(e<<24)+(t<<16)+(r<<8)+n},getBytes:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.bytes,n=this.pos,a=this.end;if(!e){var i=r.subarray(n,a);return t?new Uint8ClampedArray(i):i}var o=n+e;o>a&&(o=a),this.pos=o;var s=r.subarray(n,o);return t?new Uint8ClampedArray(s):s},peekByte:function(){var e=this.getByte();return-1!==e&&this.pos--,e},peekBytes:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBytes(e,t);return this.pos-=r.length,r},getByteRange:function(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),this.bytes.subarray(e,t)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=this.start},moveStart:function(){this.start=this.pos},makeSubStream:function(t,r,n){return new e(this.bytes.buffer,t,r,n)}},e}();t.Stream=f;var d=function(){function e(e){var t=(0,n.stringToBytes)(e);f.call(this,t)}return e.prototype=f.prototype,e}();t.StringStream=d;var p=function(){var e=new Uint8Array(0);function t(t){if(this._rawMinBufferLength=t||0,this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=e,this.minBufferLength=512,t)while(this.minBufferLength1&&void 0!==arguments[1]&&arguments[1],n=this.pos;if(e){this.ensureBuffer(n+e),t=n+e;while(!this.eof&&this.bufferLengtha&&(t=a)}else{while(!this.eof)this.readBlock();t=this.bufferLength}this.pos=t;var i=this.buffer.subarray(n,t);return!r||i instanceof Uint8ClampedArray?i:new Uint8ClampedArray(i)},peekByte:function(){var e=this.getByte();return-1!==e&&this.pos--,e},peekBytes:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBytes(e,t);return this.pos-=r.length,r},makeSubStream:function(e,t,r){var n=e+t;while(this.bufferLength<=n&&!this.eof)this.readBlock();return new f(this.buffer,e,t,r)},getByteRange:function(e,t){(0,n.unreachable)("Should not call DecodeStream.getByteRange")},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0},getBaseStreams:function(){return this.str&&this.str.getBaseStreams?this.str.getBaseStreams():[]}},t}();t.DecodeStream=p;var g=function(){function e(e){this.streams=e;for(var t=0,r=0,n=e.length;r>e,this.codeSize=a-=e,t},o.prototype.getCode=function(e){var t,r=this.str,a=e[0],i=e[1],o=this.codeSize,s=this.codeBuf;while(o>16,u=65535&c;if(l<1||o>l,this.codeSize=o-l,u},o.prototype.generateHuffmanTable=function(e){var t,r=e.length,n=0;for(t=0;tn&&(n=e[t]);for(var a=1<>=1;for(t=u;t>=1,0!==l){var u,h;if(1===l)u=a,h=i;else{if(2!==l)throw new n.FormatError("Unknown block type in flate stream");var f,d=this.getBits(5)+257,p=this.getBits(5)+1,g=this.getBits(4)+4,m=new Uint8Array(e.length);for(f=0;f0)S[f++]=w}u=this.generateHuffmanTable(S.subarray(0,d)),h=this.generateHuffmanTable(S.subarray(d,k))}o=this.buffer;var A=o?o.length:0,E=this.bufferLength;while(1){var O=this.getCode(u);if(O<256)E+1>=A&&(o=this.ensureBuffer(E+1),A=o.length),o[E++]=O;else{if(256===O)return void(this.bufferLength=E);O-=257,O=t[O];var T=O>>16;T>0&&(T=this.getBits(T)),s=(65535&O)+T,O=this.getCode(h),O=r[O],T=O>>16,T>0&&(T=this.getBits(T));var I=(65535&O)+T;E+s>=A&&(o=this.ensureBuffer(E+s),A=o.length);for(var P=0;P15))throw new n.FormatError("Unsupported predictor: ".concat(i));this.readBlock=2===i?this.readBlockTiff:this.readBlockPng,this.str=e,this.dict=e.dict;var o=this.colors=r.get("Colors")||1,s=this.bits=r.get("BitsPerComponent")||8,c=this.columns=r.get("Columns")||1;return this.pixBytes=o*s+7>>3,this.rowBytes=c*o*s+7>>3,p.call(this,t),this}return e.prototype=Object.create(p.prototype),e.prototype.readBlockTiff=function(){var e=this.rowBytes,t=this.bufferLength,r=this.ensureBuffer(t+e),n=this.bits,a=this.colors,i=this.str.getBytes(e);if(this.eof=!i.length,!this.eof){var o,s=0,c=0,l=0,u=0,h=t;if(1===n&&1===a)for(o=0;o>1,f^=f>>2,f^=f>>4,s=(1&f)<<7,r[h++]=f}else if(8===n){for(o=0;o>8&255,r[h++]=255&p}}else{var g=new Uint8Array(a+1),m=(1<>l-n)&m,l-=n,c=c<=8&&(r[b++]=c>>u-8&255,u-=8);u>0&&(r[b++]=(c<<8-u)+(s&(1<<8-u)-1))}this.bufferLength+=e}},e.prototype.readBlockPng=function(){var e=this.rowBytes,t=this.pixBytes,r=this.str.getByte(),a=this.str.getBytes(e);if(this.eof=!a.length,!this.eof){var i=this.bufferLength,o=this.ensureBuffer(i+e),s=o.subarray(i-e,i);0===s.length&&(s=new Uint8Array(e));var c,l,u,h=i;switch(r){case 0:for(c=0;c>1)+a[c];for(;c>1)+a[c]&255,h++;break;case 4:for(c=0;c0,n=this.decrypt;e=n(e,!r);var a,i=this.bufferLength,o=e.length,s=this.ensureBuffer(i+o);for(a=0;a=0;--s)o[c+s]=255&u,u>>=8}}else this.eof=!0},e}();t.Ascii85Stream=y;var w=function(){function e(e,t){this.str=e,this.dict=e.dict,this.firstDigit=-1,t&&(t*=.5),p.call(this,t)}return e.prototype=Object.create(p.prototype),e.prototype.readBlock=function(){var e=8e3,t=this.str.getBytes(e);if(t.length){for(var r=t.length+1>>1,n=this.ensureBuffer(this.bufferLength+r),a=this.bufferLength,i=this.firstDigit,o=0,s=t.length;o=48&&l<=57)c=15&l;else{if(!(l>=65&&l<=70||l>=97&&l<=102)){if(62===l){this.eof=!0;break}continue}c=9+(15&l)}i<0?i=c:(n[a++]=i<<4|c,i=-1)}i>=0&&this.eof&&(n[a++]=i<<4,i=-1),this.firstDigit=i,this.bufferLength=a}else this.eof=!0},e}();t.AsciiHexStream=w;var k=function(){function e(e,t){this.str=e,this.dict=e.dict,p.call(this,t)}return e.prototype=Object.create(p.prototype),e.prototype.readBlock=function(){var e=this.str.getBytes(2);if(!e||e.length<2||128===e[0])this.eof=!0;else{var t,r=this.bufferLength,n=e[0];if(n<128){if(t=this.ensureBuffer(r+n+1),t[r++]=e[1],n>0){var a=this.str.getBytes(n);t.set(a,r),r+=n}}else{n=257-n;var i=e[1];t=this.ensureBuffer(r+n+1);for(var o=0;o>>t&(1<0;if(y<256)p[0]=y,g=1;else{if(!(y>=258)){if(256===y){f=9,c=258,g=0;continue}this.eof=!0,delete this.lzwState;break}if(y=0;t--)p[t]=l[r],r=h[r];else p[g++]=p[0]}if(w&&(h[c]=d,u[c]=u[d]+1,l[c]=p[0],c++,f=c+s&c+s-1?f:0|Math.min(Math.log(c+s)/.6931471805599453+1,12)),d=y,m+=g,a1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"function"!==typeof e.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=e,this.eof=!1,this.encoding=t.K||0,this.eoline=t.EndOfLine||!1,this.byteAlign=t.EncodedByteAlign||!1,this.columns=t.Columns||1728,this.rows=t.Rows||0;var r,n=t.EndOfBlock;null!==n&&void 0!==n||(n=!0),this.eoblock=n,this.black=t.BlackIs1||!1,this.codingLine=new Uint32Array(this.columns+1),this.refLine=new Uint32Array(this.columns+2),this.codingLine[0]=this.columns,this.codingPos=0,this.row=0,this.nextLine2D=this.encoding<0,this.inputBits=0,this.inputBuf=0,this.outputBits=0,this.rowsDone=!1;while(0===(r=this._lookBits(12)))this._eatBits(1);1===r&&this._eatBits(12),this.encoding>0&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1))}return b.prototype={readNextChar:function(){if(this.eof)return-1;var e,f,d,p,g,m=this.refLine,v=this.codingLine,b=this.columns;if(0===this.outputBits){if(this.rowsDone&&(this.eof=!0),this.eof)return-1;var y,w,k;if(this.err=!1,this.nextLine2D){for(p=0;v[p]=64);do{w+=k=this._getWhiteCode()}while(k>=64)}else{do{y+=k=this._getWhiteCode()}while(k>=64);do{w+=k=this._getBlackCode()}while(k>=64)}this._addPixels(v[this.codingPos]+y,f),v[this.codingPos]0?--e:++e;while(m[e]<=v[this.codingPos]&&m[e]0?--e:++e;while(m[e]<=v[this.codingPos]&&m[e]0?--e:++e;while(m[e]<=v[this.codingPos]&&m[e]=64);else do{y+=k=this._getWhiteCode()}while(k>=64);this._addPixels(v[this.codingPos]+y,f),f^=1}}var S=!1;if(this.byteAlign&&(this.inputBits&=-8),this.eoblock||this.row!==this.rows-1){if(y=this._lookBits(12),this.eoline)while(y!==t&&1!==y)this._eatBits(1),y=this._lookBits(12);else while(0===y)this._eatBits(1),y=this._lookBits(12);1===y?(this._eatBits(12),S=!0):y===t&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1)),this.eoblock&&S&&this.byteAlign){if(y=this._lookBits(12),1===y){if(this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1)),this.encoding>=0)for(p=0;p<4;++p)y=this._lookBits(12),1!==y&&(0,n.info)("bad rtc code: "+y),this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){while(1){if(y=this._lookBits(13),y===t)return this.eof=!0,-1;if(y>>1===1)break;this._eatBits(1)}this._eatBits(12),this.encoding>0&&(this._eatBits(1),this.nextLine2D=!(1&y))}v[0]>0?this.outputBits=v[this.codingPos=0]:this.outputBits=v[this.codingPos=1],this.row++}if(this.outputBits>=8)g=1&this.codingPos?0:255,this.outputBits-=8,0===this.outputBits&&v[this.codingPos]d?(g<<=d,1&this.codingPos||(g|=255>>8-d),this.outputBits-=d,d=0):(g<<=this.outputBits,1&this.codingPos||(g|=255>>8-this.outputBits),d-=this.outputBits,this.outputBits=0,v[this.codingPos]0&&(g<<=d,d=0))}while(d)}return this.black&&(g^=255),g},_addPixels:function(e,t){var r=this.codingLine,a=this.codingPos;e>r[a]&&(e>this.columns&&((0,n.info)("row is wrong length"),this.err=!0,e=this.columns),1&a^t&&++a,r[a]=e),this.codingPos=a},_addPixelsNeg:function(e,t){var r=this.codingLine,a=this.codingPos;if(e>r[a])e>this.columns&&((0,n.info)("row is wrong length"),this.err=!0,e=this.columns),1&a^t&&++a,r[a]=e;else if(e0&&e=i){var c=n[s-i];if(c[0]===o)return this._eatBits(o),[!0,c[1],!0]}}return[!1,0,!1]},_getTwoDimCode:function(){var e,r=0;if(this.eoblock){if(r=this._lookBits(7),e=f[r],e&&e[0]>0)return this._eatBits(e[0]),e[1]}else{var a=this._findTableCode(1,7,f);if(a[0]&&a[2])return a[1]}return(0,n.info)("Bad two dim code"),t},_getWhiteCode:function(){var e,r=0;if(this.eoblock){if(r=this._lookBits(12),r===t)return 1;if(e=r>>5===0?d[r]:p[r>>3],e[0]>0)return this._eatBits(e[0]),e[1]}else{var a=this._findTableCode(1,9,p);if(a[0])return a[1];if(a=this._findTableCode(11,12,d),a[0])return a[1]}return(0,n.info)("bad white code"),this._eatBits(1),1},_getBlackCode:function(){var e,r;if(this.eoblock){if(e=this._lookBits(13),e===t)return 1;if(r=e>>7===0?g[e]:e>>9===0&&e>>7!==0?m[(e>>1)-64]:v[e>>7],r[0]>0)return this._eatBits(r[0]),r[1]}else{var a=this._findTableCode(2,6,v);if(a[0])return a[1];if(a=this._findTableCode(7,12,m,64),a[0])return a[1];if(a=this._findTableCode(10,13,g),a[0])return a[1]}return(0,n.info)("bad black code"),this._eatBits(1),1},_lookBits:function(e){var r;while(this.inputBits>16-e;this.inputBuf=this.inputBuf<<8|r,this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e},_eatBits:function(e){(this.inputBits-=e)<0&&(this.inputBits=0)}},b}();t.CCITTFaxDecoder=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Jbig2Stream=void 0;var n=r(202),a=r(209),i=r(213),o=r(5),s=function(){function e(e,t,r,n){this.stream=e,this.maybeLength=t,this.dict=r,this.params=n,a.DecodeStream.call(this,t)}return e.prototype=Object.create(a.DecodeStream.prototype),Object.defineProperty(e.prototype,"bytes",{get:function(){return(0,o.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},configurable:!0}),e.prototype.ensureBuffer=function(e){},e.prototype.readBlock=function(){if(!this.eof){var e=new i.Jbig2Image,t=[];if((0,n.isDict)(this.params)){var r=this.params.get("JBIG2Globals");if((0,n.isStream)(r)){var a=r.getBytes();t.push({data:a,start:0,end:a.length})}}t.push({data:this.bytes,start:0,end:this.bytes.length});for(var o=e.parseChunks(t),s=o.length,c=0;c>>0}var o=i(1),s=i(1)?i(1)?i(1)?i(1)?i(1)?i(32)+4436:i(12)+340:i(8)+84:i(6)+20:i(4)+4:i(2);return 0===o?s:s>0?-s:null}function s(e,t,r){for(var n=e.getContexts("IAID"),a=1,i=0;i=R&&T=M)for(H=H<<1&w,g=0;g=0&&P=0&&(_=U[I][P],_&&(H|=_<=e?M<<=1:M=M<<1|C[F][R];for(h=0;h=S||R<0||R>=k?M<<=1:M=M<<1|n[F][R];var B=A.readBit(E,M);P[_]=B}}return C}function v(e,t,n,i,o,c,l,u,h,f,d,v){if(e&&t)throw new m("symbol refinement with Huffman is not supported");var y,w,k=[],S=0,x=(0,a.log2)(n.length+i),C=d.decoder,A=d.contextCache;e&&(y=B(1),w=[],x=Math.max(x,1));while(k.length1)P=b(e,t,O,S,0,F,1,n.concat(k),x,0,0,1,0,c,h,f,d,0,v);else{var R=s(A,C,x),M=r(A,"IARDX",C),L=r(A,"IARDY",C),D=R1&&(M=e?S.readBits(k):r(T,"IAIT",O));var B=c*I+M,L=e?v.symbolIDTable.decode(S):s(T,O,u),D=t&&(e?S.readBit():r(T,"IARI",O)),N=l[L],U=N[0].length,j=N.length;if(D){var q=r(T,"IARDW",O),z=r(T,"IARDH",O),G=r(T,"IARDX",O),H=r(T,"IARDY",O);U+=q,j+=z,N=g(U,j,b,N,(q>>1)+G,(z>>1)+H,!1,y,w)}var W,X,V,Y=B-(1&d?0:j-1),K=R-(2&d?U-1:0);if(h){for(W=0;W=0;y--)P=e?q(I,l,u,!0):p(!1,l,u,r,!1,b,T,v),z[y]=P;for(_=0;_=0;w--)R=z[w][_][F]^R,M|=R<>8,N=f+_*d-F*g>>8,D>=0&&D+A<=n&&N>=0&&N+E<=i)for(y=0;y=i))for(j=S[H],U=B[y],w=0;w=0&&G>5&7,u=[31&s],h=t+6;if(7===s){l=536870911&(0,a.readUint32)(e,h-1),h+=3;var f=l+7>>3;u[0]=e[h++];while(--f>0)u.push(e[h++])}else if(5===s||6===s)throw new m("invalid referred-to flags");r.retainBits=u;var d=4;r.number<=256?d=1:r.number<=65536&&(d=2);var p,g,v=[];for(p=0;p>>24&255,A[3]=y.height>>16&255,A[4]=y.height>>8&255,A[5]=255&y.height,p=h,g=e.length;p>2&3,h.huffmanDWSelector=f>>4&3,h.bitmapSizeSelector=f>>6&1,h.aggregationInstancesSelector=f>>7&1,h.bitmapCodingContextUsed=!!(256&f),h.bitmapCodingContextRetained=!!(512&f),h.template=f>>10&3,h.refinementTemplate=f>>12&1,l+=2,!h.huffman){for(o=0===h.template?4:1,n=[],i=0;i>2&3,d.stripSize=1<>4&3,d.transposed=!!(64&p),d.combinationOperator=p>>7&3,d.defaultPixelValue=p>>9&1,d.dsOffset=p<<17>>27,d.refinementTemplate=p>>15&1,d.huffman){var g=(0,a.readUint16)(c,l);l+=2,d.huffmanFS=3&g,d.huffmanDS=g>>2&3,d.huffmanDT=g>>4&3,d.huffmanRefinementDW=g>>6&3,d.huffmanRefinementDH=g>>8&3,d.huffmanRefinementDX=g>>10&3,d.huffmanRefinementDY=g>>12&3,d.huffmanRefinementSizeSelector=!!(16384&g)}if(d.refinement&&!d.refinementTemplate){for(n=[],i=0;i<2;i++)n.push({x:(0,a.readInt8)(c,l),y:(0,a.readInt8)(c,l+1)}),l+=2;d.refinementAt=n}d.numberOfSymbolInstances=(0,a.readUint32)(c,l),l+=4,r=[d,s.referredTo,c,l,u];break;case 16:var v={},b=c[l++];v.mmr=!!(1&b),v.template=b>>1&3,v.patternWidth=c[l++],v.patternHeight=c[l++],v.maxPatternIndex=(0,a.readUint32)(c,l),l+=4,r=[v,s.number,c,l,u];break;case 22:case 23:var y={};y.info=x(c,l),l+=C;var w=c[l++];y.mmr=!!(1&w),y.template=w>>1&3,y.enableSkip=!!(8&w),y.combinationOperator=w>>4&7,y.defaultPixelValue=w>>7&1,y.gridWidth=(0,a.readUint32)(c,l),l+=4,y.gridHeight=(0,a.readUint32)(c,l),l+=4,y.gridOffsetX=4294967295&(0,a.readUint32)(c,l),l+=4,y.gridOffsetY=4294967295&(0,a.readUint32)(c,l),l+=4,y.gridVectorX=(0,a.readUint16)(c,l),l+=2,y.gridVectorY=(0,a.readUint16)(c,l),l+=2,r=[y,s.referredTo,c,l,u];break;case 38:case 39:var k={};k.info=x(c,l),l+=C;var S=c[l++];if(k.mmr=!!(1&S),k.template=S>>1&3,k.prediction=!!(8&S),!k.mmr){for(o=0===k.template?4:1,n=[],i=0;i>2&1,A.combinationOperator=E>>3&3,A.requiresBuffer=!!(32&E),A.combinationOperatorOverride=!!(64&E),r=[A];break;case 49:break;case 50:break;case 51:break;case 53:r=[s.number,c,l,u];break;case 62:break;default:throw new m("segment type ".concat(s.typeName,"(").concat(s.type,")")+" is not implemented")}var O="on"+s.typeName;O in t&&t[O].apply(t,r)}function E(e,t){for(var r=0,n=e.length;r>=1;return{imgData:f,width:l,height:u}}function I(){}function P(e){2===e.length?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=e[0],this.rangeLength=0,this.prefixCode=e[1],this.isLowerRange=!1):(this.isOOB=!1,this.rangeLow=e[0],this.prefixLength=e[1],this.rangeLength=e[2],this.prefixCode=e[3],this.isLowerRange="lower"===e[4])}function _(e){this.children=[],e?(this.isLeaf=!0,this.rangeLength=e.rangeLength,this.rangeLow=e.rangeLow,this.isLowerRange=e.isLowerRange,this.isOOB=e.isOOB):this.isLeaf=!1}function F(e,t){t||this.assignPrefixCodes(e),this.rootNode=new _(null);for(var r=0,n=e.length;r0&&this.rootNode.buildTree(a,a.prefixLength-1)}}function R(e,t,r){var n,i,o=e[t],s=4294967295&(0,a.readUint32)(e,t+1),c=4294967295&(0,a.readUint32)(e,t+5),l=new L(e,t+9,r),u=1+(o>>1&7),h=1+(o>>4&7),f=[],d=s;do{n=l.readBits(u),i=l.readBits(h),f.push(new P([d,n,i,0])),d+=1<>3,r=new Uint8ClampedArray(t*e.height);if(e.defaultPixelValue)for(var n=0,a=r.length;n>3,u=o.combinationOperatorOverride?e.combinationOperator:o.combinationOperator,h=this.buffer,f=128>>(7&e.x),d=e.y*l+(e.x>>3);switch(u){case 0:for(r=0;r>=1,a||(a=128,i++);d+=l}break;case 2:for(r=0;r>=1,a||(a=128,i++);d+=l}break;default:throw new m("operator ".concat(u," is not supported"))}},onImmediateGenericRegion:function(e,r,n,a){var i=e.info,o=new t(r,n,a),s=p(e.mmr,i.width,i.height,e.template,e.prediction,null,e.at,o);this.drawBitmap(i,s)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(e,r,n,a,i,o){var s,c;e.huffman&&(s=U(e,n,this.customTables),c=new L(a,i,o));var l=this.symbols;l||(this.symbols=l={});for(var u=[],h=0,f=n.length;h>t&1;if(t<=0)this.children[r]=new _(e);else{var n=this.children[r];n||(this.children[r]=n=new _(null)),n.buildTree(e,t-1)}},decodeNode:function(e){if(this.isLeaf){if(this.isOOB)return null;var t=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-t:t)}var r=this.children[e.readBit()];if(!r)throw new m("invalid Huffman data");return r.decodeNode(e)}},F.prototype={decode:function(e){return this.rootNode.decodeNode(e)},assignPrefixCodes:function(e){for(var t=e.length,r=0,n=0;n=32){var h=void 0,f=void 0,d=void 0;switch(u){case 32:if(0===l)throw new m("no previous value in symbol ID table");f=a.readBits(2)+3,h=i[l-1].prefixLength;break;case 33:f=a.readBits(3)+3,h=0;break;case 34:f=a.readBits(7)+11,h=0;break;default:throw new m("invalid code length in symbol ID table")}for(d=0;d>f&1,f--}if(n&&!l)for(var p=5,g=0;g=this.end)throw new m("end of data while reading bit");this.currentByte=this.data[this.position++],this.shift=7}var e=this.currentByte>>this.shift&1;return this.shift--,e},readBits:function(e){var t,r=0;for(t=e-1;t>=0;t--)r|=this.readBit()<=this.end?-1:this.data[this.position++]}},z.prototype={parseChunks:function(e){return O(e)},parse:function(e){var t=T(e),r=t.imgData,n=t.width,a=t.height;return this.width=n,this.height=a,r}},z}();t.Jbig2Image=v},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 a(e,t){for(var r=0;r>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}return i(e,[{key:"byteIn",value:function(){var e=this.data,t=this.bp;255===e[t]?e[t+1]>143?(this.clow+=65280,this.ct=8):(t++,this.clow+=e[t]<<9,this.ct=7,this.bp=t):(t++,this.clow+=t65535&&(this.chigh+=this.clow>>16,this.clow&=65535)}},{key:"readBit",value:function(e,t){var r,n=e[t]>>1,a=1&e[t],i=o[n],s=i.qe,c=this.a-s;if(this.chigh>15&1,this.clow=this.clow<<1&65535,this.ct--}while(0===(32768&c));return this.a=c,e[t]=n<<1|a,r}}]),e}();t.ArithmeticDecoder=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JpegStream=void 0;var n=r(209),a=r(202),i=r(216),o=r(5),s=function(){function e(e,t,r,a){var i;while(-1!==(i=e.getByte()))if(255===i){e.skip(-1);break}this.stream=e,this.maybeLength=t,this.dict=r,this.params=a,n.DecodeStream.call(this,t)}return e.prototype=Object.create(n.DecodeStream.prototype),Object.defineProperty(e.prototype,"bytes",{get:function(){return(0,o.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},configurable:!0}),e.prototype.ensureBuffer=function(e){},e.prototype.readBlock=function(){if(!this.eof){var e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray("Decode","D");if(this.forceRGB&&Array.isArray(t)){for(var r=this.dict.get("BitsPerComponent")||8,n=t.length,o=new Int32Array(n),s=!1,c=(1<0&&void 0!==arguments[0]?arguments[0]:{},t=e.decodeTransform,r=void 0===t?null:t,n=e.colorTransform,a=void 0===n?-1:n;this._decodeTransform=r,this._colorTransform=a}function d(e,t){var r,n,a=0,i=[],o=16;while(o>0&&!e[o-1])o--;i.push({children:[],index:0});var s,c=i[0];for(r=0;r0)c=i.pop();c.index++,i.push(c);while(i.length<=r)i.push(s={children:[],index:0}),c.children[c.index]=s.children,c=s;a++}r+19&&void 0!==arguments[9]&&arguments[9],b=o.mcusPerLine,y=o.progressive,w=r,S=0,x=0;function C(){if(x>0)return x--,S>>x&1;if(S=t[r++],255===S){var e=t[r++];if(e){if(220===e&&d){r+=2;var n=(0,a.readUint16)(t,r);if(r+=2,n>0&&n!==o.scanLines)throw new g("Found DNL marker (0xFFDC) while parsing scan data",n)}else if(217===e){if(d){var i=L*(8===o.precision?8:0);if(i>0&&Math.round(o.scanLines/i)>=10)throw new g("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",i)}throw new m("Found EOI marker (0xFFD9) while parsing scan data")}throw new p("unexpected marker ".concat((S<<8|e).toString(16)))}}return x=7,S>>>7}function A(e){var t=e;while(1){switch(t=t[C()],i(t)){case"number":return t;case"object":continue}throw new p("invalid huffman sequence")}}function E(e){var t=0;while(e>0)t=t<<1|C(),e--;return t}function O(e){if(1===e)return 1===C()?1:-1;var t=E(e);return t>=1<>4;if(0!==s){i+=c;var l=e[i];t.blockData[r+l]=O(s),i++}else{if(c<15)break;i+=16}}}function I(e,t){var r=A(e.huffmanTableDC),n=0===r?0:O(r)<0)_--;else{var n=l,a=u;while(n<=a){var i=A(t.huffmanTableAC),o=15&i,s=i>>4;if(0!==o){n+=s;var c=e[n];t.blockData[r+c]=O(o)*(1<>4,0===n)s<15?(_=E(s)+(1<0){for(j=0;j0?"unexpected":"excessive";(0,n.warn)("decodeScan - ".concat(Q," MCU data, current marker is: ").concat(X.invalid)),r=X.offset}if(!(X.marker>=65488&&X.marker<=65495))break;r+=2}return r-w}function y(e,n,a){var i,f,d,g,m,v,b,y,w,k,S,x,C,A,E,O,T,I=e.quantizationTable,P=e.blockData;if(!I)throw new p("missing required Quantization Table.");for(var _=0;_<64;_+=8)w=P[n+_],k=P[n+_+1],S=P[n+_+2],x=P[n+_+3],C=P[n+_+4],A=P[n+_+5],E=P[n+_+6],O=P[n+_+7],w*=I[_],0!==(k|S|x|C|A|E|O)?(k*=I[_+1],S*=I[_+2],x*=I[_+3],C*=I[_+4],A*=I[_+5],E*=I[_+6],O*=I[_+7],i=u*w+128>>8,f=u*C+128>>8,d=S,g=E,m=h*(k-O)+128>>8,y=h*(k+O)+128>>8,v=x<<4,b=A<<4,i=i+f+1>>1,f=i-f,T=d*l+g*c+128>>8,d=d*c-g*l+128>>8,g=T,m=m+b+1>>1,b=m-b,y=y+v+1>>1,v=y-v,i=i+g+1>>1,g=i-g,f=f+d+1>>1,d=f-d,T=m*s+y*o+2048>>12,m=m*o-y*s+2048>>12,y=T,T=v*r+b*t+2048>>12,v=v*t-b*r+2048>>12,b=T,a[_]=i+y,a[_+7]=i-y,a[_+1]=f+b,a[_+6]=f-b,a[_+2]=d+v,a[_+5]=d-v,a[_+3]=g+m,a[_+4]=g-m):(T=u*w+512>>10,a[_]=T,a[_+1]=T,a[_+2]=T,a[_+3]=T,a[_+4]=T,a[_+5]=T,a[_+6]=T,a[_+7]=T);for(var F=0;F<8;++F)w=a[F],k=a[F+8],S=a[F+16],x=a[F+24],C=a[F+32],A=a[F+40],E=a[F+48],O=a[F+56],0!==(k|S|x|C|A|E|O)?(i=u*w+2048>>12,f=u*C+2048>>12,d=S,g=E,m=h*(k-O)+2048>>12,y=h*(k+O)+2048>>12,v=x,b=A,i=4112+(i+f+1>>1),f=i-f,T=d*l+g*c+2048>>12,d=d*c-g*l+2048>>12,g=T,m=m+b+1>>1,b=m-b,y=y+v+1>>1,v=y-v,i=i+g+1>>1,g=i-g,f=f+d+1>>1,d=f-d,T=m*s+y*o+2048>>12,m=m*o-y*s+2048>>12,y=T,T=v*r+b*t+2048>>12,v=v*t-b*r+2048>>12,b=T,w=i+y,O=i-y,k=f+b,E=f-b,S=d+v,A=d-v,x=g+m,C=g-m,w<16?w=0:w>=4080?w=255:w>>=4,k<16?k=0:k>=4080?k=255:k>>=4,S<16?S=0:S>=4080?S=255:S>>=4,x<16?x=0:x>=4080?x=255:x>>=4,C<16?C=0:C>=4080?C=255:C>>=4,A<16?A=0:A>=4080?A=255:A>>=4,E<16?E=0:E>=4080?E=255:E>>=4,O<16?O=0:O>=4080?O=255:O>>=4,P[n+F]=w,P[n+F+8]=k,P[n+F+16]=S,P[n+F+24]=x,P[n+F+32]=C,P[n+F+40]=A,P[n+F+48]=E,P[n+F+56]=O):(T=u*w+8192>>14,T=T<-2040?0:T>=2024?255:T+2056>>4,P[n+F]=T,P[n+F+8]=T,P[n+F+16]=T,P[n+F+24]=T,P[n+F+32]=T,P[n+F+40]=T,P[n+F+48]=T,P[n+F+56]=T)}function w(e,t){for(var r=t.blocksPerLine,n=t.blocksPerColumn,a=new Int16Array(64),i=0;i2&&void 0!==arguments[2]?arguments[2]:t,n=e.length-1,i=r=n)return null;var o=(0,a.readUint16)(e,t);if(o>=65472&&o<=65534)return{invalid:null,marker:o,offset:t};var s=(0,a.readUint16)(e,i);while(!(s>=65472&&s<=65534)){if(++i>=n)return null;s=(0,a.readUint16)(e,i)}return{invalid:o.toString(16),marker:s,offset:i}}return f.prototype={parse:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.dnlScanLines,o=void 0===i?null:i;function s(){var e=(0,a.readUint16)(t,h);h+=2;var r=h+e-2,i=k(t,r,h);i&&i.invalid&&((0,n.warn)("readDataBlock - incorrect length, current marker is: "+i.invalid),r=i.offset);var o=t.subarray(h,r);return h+=o.length,o}function c(e){for(var t=Math.ceil(e.samplesPerLine/8/e.maxH),r=Math.ceil(e.scanLines/8/e.maxV),n=0;n>4===0)for(O=0;O<64;O++)_=e[O],M[_]=t[h++];else{if(R>>4!==1)throw new p("DQT - invalid table spec");for(O=0;O<64;O++)_=e[O],M[_]=(0,a.readUint16)(t,h),h+=2}S[15&R]=M}break;case 65472:case 65473:case 65474:if(l)throw new p("Only single frame JPEGs supported");h+=2,l={},l.extended=65473===A,l.progressive=65474===A,l.precision=t[h++];var B=(0,a.readUint16)(t,h);h+=2,l.scanLines=o||B,l.samplesPerLine=(0,a.readUint16)(t,h),h+=2,l.components=[],l.componentIds={};var L,D=t[h++],N=0,U=0;for(E=0;E>4,q=15&t[h+1];N>4===0?C:x)[15&H]=d(W,V)}break;case 65501:h+=2,u=(0,a.readUint16)(t,h),h+=2;break;case 65498:var Y=1===++y&&!o;h+=2;var K,J=t[h++],Z=[];for(E=0;E>4],K.huffmanTableAC=x[15&ee],Z.push(K)}var te=t[h++],re=t[h++],ne=t[h++];try{var ae=b(t,h,l,Z,u,te,re,ne>>4,15&ne,Y);h+=ae}catch(se){if(se instanceof g)return(0,n.warn)("".concat(se.message," -- attempting to re-parse the JPEG image.")),this.parse(t,{dnlScanLines:se.scanLines});if(se instanceof m){(0,n.warn)("".concat(se.message," -- ignoring the rest of the image data."));break e}throw se}break;case 65500:h+=4;break;case 65535:255!==t[h]&&h--;break;default:var ie=k(t,h-2,h-3);if(ie&&ie.invalid){(0,n.warn)("JpegImage.parse - unexpected data, current marker is: "+ie.invalid),h=ie.offset;break}if(h>=t.length-1){(0,n.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new p("JpegImage.parse - unknown marker: "+A.toString(16))}A=(0,a.readUint16)(t,h),h+=2}for(this.width=l.samplesPerLine,this.height=l.scanLines,this.jfif=f,this.adobe=v,this.components=[],E=0;E2&&void 0!==arguments[2]&&arguments[2],g=this.width/e,m=this.height/t,v=0,b=this.components.length,y=e*t*b,w=new Uint8ClampedArray(y),k=new Uint32Array(e),S=4294967288;for(c=0;c>8)+x[u+1];return w},get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform},_convertYccToRgb:function(e){for(var t,r,n,a=0,i=e.length;a4)throw new p("Unsupported color mode");var s=this._getLinearizedBlockData(t,r,o);if(1===this.numComponents&&a){for(var c=s.length,l=new Uint8ClampedArray(3*c),u=0,h=0;h0?Math.min(n.xcb,a.PPx-1):Math.min(n.xcb,a.PPx),a.ycb_=r>0?Math.min(n.ycb,a.PPy-1):Math.min(n.ycb,a.PPy),a}function c(e,t,r){var n=1<t.trx0?Math.ceil(t.trx1/n)-Math.floor(t.trx0/n):0,l=t.try1>t.try0?Math.ceil(t.try1/a)-Math.floor(t.try0/a):0,u=c*l;t.precinctParameters={precinctWidth:n,precinctHeight:a,numprecinctswide:c,numprecinctshigh:l,numprecincts:u,precinctWidthInSubband:o,precinctHeightInSubband:s}}function l(e,t,r){var n,a,i,o,s=r.xcb_,c=r.ycb_,l=1<>s,f=t.tby0>>c,d=t.tbx1+l-1>>s,p=t.tby1+u-1>>c,g=t.resolution.precinctParameters,m=[],v=[];for(a=f;aw.cbxMax&&(w.cbxMax=n),aw.cbyMax&&(w.cbyMax=a)):v[o]=w={cbxMin:n,cbyMin:a,cbxMax:n,cbyMax:a},i.precinct=w}}t.codeblockParameters={codeblockWidth:s,codeblockHeight:c,numcodeblockwide:d-h+1,numcodeblockhigh:p-f+1},t.codeblocks=m,t.precincts=v}function u(e,t,r){for(var n=[],a=e.subbands,i=0,o=a.length;ie.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[l],r=t.precinctParameters.numprecincts;fe.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[c],r=t.precinctParameters.numprecincts;fe.codingStyleParameters.decompositionLevelsCount)){var i=e.resolutions[r],o=i.precinctParameters.numprecincts;if(!(a>=o)){for(;t=0;--m){var v=c.resolutions[m],b=g*v.precinctParameters.precinctWidth,y=g*v.precinctParameters.precinctHeight;h=Math.min(h,b),f=Math.min(f,y),d=Math.max(d,v.precinctParameters.numprecinctswide),p=Math.max(p,v.precinctParameters.numprecinctshigh),u[m]={width:b,height:y},g<<=1}r=Math.min(r,h),n=Math.min(n,f),a=Math.max(a,d),i=Math.max(i,p),o[s]={resolutions:u,minWidth:h,minHeight:f,maxNumWide:d,maxNumHigh:p}}return{components:o,minWidth:r,minHeight:n,maxNumWide:a,maxNumHigh:i}}function y(e){for(var t=e.SIZ,r=e.currentTile.index,n=e.tiles[r],a=t.Csiz,i=0;i>>s&(1<0){var q=S.shift();w=q.codeblock,void 0===w.data&&(w.data=[]),w.data.push({data:t,start:r+o,end:r+o+q.dataLength,codingpasses:q.codingpasses}),o+=q.dataLength}}}return o}function k(e,t,r,n,a,o,s,c){for(var l=n.tbx0,u=n.tby0,h=n.tbx1-n.tbx0,f=n.codeblocks,d="H"===n.type.charAt(0)?1:0,p="H"===n.type.charAt(1)?t:0,g=0,m=f.length;g=o?M:M*(1<0?1-v:0));var O=b.subbands[x],T=e[O.type],_=d?1:Math.pow(2,f+T-E)*(1+A/2048),F=u+E-1;k(S,y,w,O,_,F,d,h)}g.push({width:y,height:w,items:S})}var R=p.calculate(g,a.tcx0,a.tcy0);return{left:a.tcx0,top:a.tcy0,width:R.width,height:R.height,items:R.items}}function x(e){for(var t=e.SIZ,r=e.components,n=t.Csiz,a=[],i=0,o=e.tiles.length;i>2);b[w++]=I+m>>u,b[w++]=I>>u,b[w++]=I+g>>u}else for(f=0;f>u,b[w++]=p-.34413*g-.71414*m>>u,b[w++]=p+1.772*g>>u;if(k)for(f=0,w=3;f>u}else for(s=0;s>u,w+=n}a.push(y)}return a}function C(e,t){for(var r=e.SIZ,n=r.Csiz,a=e.tiles[t],i=0;i>24&255,c>>16&255,c>>8&255,255&c);(0,n.warn)("Unsupported header type "+c+" ("+d+")");break}u&&(r+=l)}}else this.parseCodestream(e,0,e.length)},parseImageProperties:function(e){var t=e.getByte();while(t>=0){var r=t;t=e.getByte();var n=r<<8|t;if(65361===n){e.skip(4);var a=e.getInt32()>>>0,i=e.getInt32()>>>0,o=e.getInt32()>>>0,s=e.getInt32()>>>0;e.skip(16);var c=e.getUint16();return this.width=a-o,this.height=i-s,this.componentsCount=c,void(this.bitsPerComponent=8)}}throw new g("No size marker found in JPX stream")},parseCodestream:function(e,t,i){var s={},c=!1;try{var l=t;while(l+1>5,d=[];while(h>3,I.mu=0):(I.epsilon=e[h]>>3,I.mu=(7&e[h])<<8|e[h+1],h+=2),d.push(I)}T.SPqcds=d,s.mainHeader?s.QCD=T:(s.currentTile.QCD=T,s.currentTile.QCC=[]);break;case 65373:b=(0,a.readUint16)(e,l);var P,_={};switch(h=l+2,s.SIZ.Csiz<257?P=e[h++]:(P=(0,a.readUint16)(e,h),h+=2),f=e[h++],31&f){case 0:p=8,m=!0;break;case 1:p=16,m=!1;break;case 2:p=16,m=!0;break;default:throw new Error("Invalid SQcd value "+f)}_.noQuantization=8===p,_.scalarExpounded=m,_.guardBits=f>>5,d=[];while(h>3,I.mu=0):(I.epsilon=e[h]>>3,I.mu=(7&e[h])<<8|e[h+1],h+=2),d.push(I);_.SPqcds=d,s.mainHeader?s.QCC[P]=_:s.currentTile.QCC[P]=_;break;case 65362:b=(0,a.readUint16)(e,l);var F={};h=l+2;var R=e[h++];F.entropyCoderWithCustomPrecincts=!!(1&R),F.sopMarkerUsed=!!(2&R),F.ephMarkerUsed=!!(4&R),F.progressionOrder=e[h++],F.layersCount=(0,a.readUint16)(e,h),h+=2,F.multipleComponentTransform=e[h++],F.decompositionLevelsCount=e[h++],F.xcb=2+(15&e[h++]),F.ycb=2+(15&e[h++]);var M=e[h++];if(F.selectiveArithmeticCodingBypass=!!(1&M),F.resetContextProbabilities=!!(2&M),F.terminationOnEachCodingPass=!!(4&M),F.verticallyStripe=!!(8&M),F.predictableTermination=!!(16&M),F.segmentationSymbolUsed=!!(32&M),F.reversibleTransformation=e[h++],F.entropyCoderWithCustomPrecincts){var B=[];while(h>4})}F.precinctsSizes=B}var D=[];if(F.selectiveArithmeticCodingBypass&&D.push("selectiveArithmeticCodingBypass"),F.resetContextProbabilities&&D.push("resetContextProbabilities"),F.terminationOnEachCodingPass&&D.push("terminationOnEachCodingPass"),F.verticallyStripe&&D.push("verticallyStripe"),F.predictableTermination&&D.push("predictableTermination"),D.length>0)throw c=!0,new Error("Unsupported COD options ("+D.join(", ")+")");s.mainHeader?s.COD=F:(s.currentTile.COD=F,s.currentTile.COC=[]);break;case 65424:b=(0,a.readUint16)(e,l),v={},v.index=(0,a.readUint16)(e,l+2),v.length=(0,a.readUint32)(e,l+4),v.dataEnd=v.length+l-2,v.partIndex=e[l+8],v.partsCount=e[l+9],s.mainHeader=!1,0===v.partIndex&&(v.COD=s.COD,v.COC=s.COC.slice(0),v.QCD=s.QCD,v.QCC=s.QCC.slice(0)),s.currentTile=v;break;case 65427:v=s.currentTile,0===v.partIndex&&(C(s,v.index),y(s)),b=v.dataEnd-l,w(s,e,l,b);break;case 65365:case 65367:case 65368:case 65380:b=(0,a.readUint16)(e,l);break;case 65363:throw new Error("Codestream code 0xFF53 (COC) is not implemented");default:throw new Error("Unknown codestream code: "+u.toString(16))}l+=b}}catch(N){if(c||this.failOnCorruptedImage)throw new g(N.message);(0,n.warn)("JPX: Trying to recover from: "+N.message)}this.tiles=x(s),this.width=s.SIZ.Xsiz-s.SIZ.XOsiz,this.height=s.SIZ.Ysiz-s.SIZ.YOsiz,this.componentsCount=s.SIZ.Csiz}};var A=function(){function e(e,t){var r=(0,a.log2)(Math.max(e,t))+1;this.levels=[];for(var n=0;n>=1,t>>=1,n++}n--,r=this.levels[n],r.items[r.index]=a,this.currentLevel=n,delete this.value},incrementValue:function(){var e=this.levels[this.currentLevel];e.items[e.index]++},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],r=t.items[t.index];return e--,e<0?(this.value=r,!1):(this.currentLevel=e,t=this.levels[e],t.items[t.index]=r,!0)}},e}(),E=function(){function e(e,t,r){var n=(0,a.log2)(Math.max(e,t))+1;this.levels=[];for(var i=0;ir)return this.currentLevel=n,this.propagateValues(),!1;e>>=1,t>>=1,n++}return this.currentLevel=n-1,!0},incrementValue:function(e){var t=this.levels[this.currentLevel];t.items[t.index]=e+1,this.propagateValues()},propagateValues:function(){var e=this.currentLevel,t=this.levels[e],r=t.items[t.index];while(--e>=0)t=this.levels[e],t.items[t.index]=r},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],r=t.items[t.index];return t.items[t.index]=255,e--,!(e<0)&&(this.currentLevel=e,t=this.levels[e],t.items[t.index]=r,!0)}},e}(),O=function(){var e=17,t=18,r=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),n=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),a=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);function i(e,t,i,o,s){var c;this.width=e,this.height=t,c="HH"===i?a:"HL"===i?n:r,this.contextLabelTable=c;var l,u=e*t;this.neighborsSignificance=new Uint8Array(u),this.coefficentsSign=new Uint8Array(u),l=s>14?new Uint32Array(u):s>6?new Uint16Array(u):new Uint8Array(u),this.coefficentsMagnitude=l,this.processingFlags=new Uint8Array(u);var h=new Uint8Array(u);if(0!==o)for(var f=0;f0,c=t+10&&(n=r-i,s&&(a[n-1]+=16),c&&(a[n+1]+=16),a[n]+=4),e+1=r)break;if(o[g]&=u,!n[g]&&i[g]){var b=c[i[g]],y=e.readBit(s,b);if(y){var w=this.decodeSignBit(v,p,g);a[g]=w,n[g]=1,this.setNeighborsSignificance(v,p,g),o[g]|=f}l[g]++,o[g]|=h}}},decodeSignBit:function(e,t,r){var n,a,i,o,s,c,l=this.width,u=this.height,h=this.coefficentsMagnitude,f=this.coefficentsSign;o=t>0&&0!==h[r-1],t+10&&0!==h[r-l],e+1=0?(s=9+n,c=this.decoder.readBit(this.contexts,s)):(s=9-n,c=1^this.decoder.readBit(this.contexts,s)),c},runMagnitudeRefinementPass:function(){for(var e,t=this.decoder,r=this.width,n=this.height,a=this.coefficentsMagnitude,i=this.neighborsSignificance,o=this.contexts,s=this.bitsDecoded,c=this.processingFlags,l=1,u=2,h=r*n,f=4*r,d=0;d>1;t|=0;var c=-1.586134342059924,l=-.052980118572961,u=.882911075530934,h=.443506852043971,f=1.230174104914001,d=1/f;for(n=t-3,a=s+4;a--;n+=2)e[n]*=d;for(n=t-2,i=h*e[n-1],a=s+3;a--;n+=2){if(o=h*e[n+1],e[n]=f*e[n]-i-o,!a--)break;n+=2,i=h*e[n+1],e[n]=f*e[n]-i-o}for(n=t-1,i=u*e[n-1],a=s+2;a--;n+=2){if(o=u*e[n+1],e[n]-=i+o,!a--)break;n+=2,i=u*e[n+1],e[n]-=i+o}for(n=t,i=l*e[n-1],a=s+1;a--;n+=2){if(o=l*e[n+1],e[n]-=i+o,!a--)break;n+=2,i=l*e[n+1],e[n]-=i+o}if(0!==s)for(n=t+1,i=c*e[n-1],a=s;a--;n+=2){if(o=c*e[n+1],e[n]-=i+o,!a--)break;n+=2,i=c*e[n+1],e[n]-=i+o}},e}(),P=function(){function e(){T.call(this)}return e.prototype=Object.create(T.prototype),e.prototype.filter=function(e,t,r){var n,a,i=r>>1;for(t|=0,n=t,a=i+1;a--;n+=2)e[n]-=e[n-1]+e[n+1]+2>>2;for(n=t+1,a=i;a--;n+=2)e[n]+=e[n-1]+e[n+1]>>1},e}();return t}();t.JpxImage=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateSHA512=t.calculateSHA384=t.calculateSHA256=t.calculateMD5=t.PDF20=t.PDF17=t.CipherTransformFactory=t.ARCFourCipher=t.AES256Cipher=t.AES128Cipher=void 0;var n=r(5),a=r(202),i=r(209);function o(e){return o="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},o(e)}function s(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},c(e,t)}function l(e){var t=f();return function(){var r,n=d(e);if(t){var a=d(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return u(this,r)}}function u(e,t){return!t||"object"!==o(t)&&"function"!==typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var r=0;r>5&255,d[i++]=a>>13&255,d[i++]=a>>21&255,d[i++]=a>>>29&255,d[i++]=0,d[i++]=0,d[i++]=0;var p=new Int32Array(16);for(i=0;i>>32-x)|0,v=k}c=c+v|0,l=l+b|0,u=u+y|0,h=h+w|0}return new Uint8Array([255&c,c>>8&255,c>>16&255,c>>>24&255,255&l,l>>8&255,l>>16&255,l>>>24&255,255&u,u>>8&255,u>>16&255,u>>>24&255,255&h,h>>8&255,h>>16&255,h>>>24&255])}return r}();t.calculateMD5=b;var y=function(){function e(e,t){this.high=0|e,this.low=0|t}return e.prototype={and:function(e){this.high&=e.high,this.low&=e.low},xor:function(e){this.high^=e.high,this.low^=e.low},or:function(e){this.high|=e.high,this.low|=e.low},shiftRight:function(e){e>=32?(this.low=this.high>>>e-32|0,this.high=0):(this.low=this.low>>>e|this.high<<32-e,this.high=this.high>>>e|0)},shiftLeft:function(e){e>=32?(this.high=this.low<>>32-e,this.low=this.low<>>e|r<<32-e,this.high=r>>>e|t<<32-e},not:function(){this.high=~this.high,this.low=~this.low},add:function(e){var t=(this.low>>>0)+(e.low>>>0),r=(this.high>>>0)+(e.high>>>0);t>4294967295&&(r+=1),this.low=0|t,this.high=0|r},copyTo:function(e,t){e[t]=this.high>>>24&255,e[t+1]=this.high>>16&255,e[t+2]=this.high>>8&255,e[t+3]=255&this.high,e[t+4]=this.low>>>24&255,e[t+5]=this.low>>16&255,e[t+6]=this.low>>8&255,e[t+7]=255&this.low},assign:function(e){this.high=e.high,this.low=e.low}},e}(),w=function(){function e(e,t){return e>>>t|e<<32-t}function t(e,t,r){return e&t^~e&r}function r(e,t,r){return e&t^e&r^t&r}function n(t){return e(t,2)^e(t,13)^e(t,22)}function a(t){return e(t,6)^e(t,11)^e(t,25)}function i(t){return e(t,7)^e(t,18)^t>>>3}function o(t){return e(t,17)^e(t,19)^t>>>10}var s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function c(e,c,l){var u,h,f,d=1779033703,p=3144134277,g=1013904242,m=2773480762,v=1359893119,b=2600822924,y=528734635,w=1541459225,k=64*Math.ceil((l+9)/64),S=new Uint8Array(k);for(u=0;u>>29&255,S[u++]=l>>21&255,S[u++]=l>>13&255,S[u++]=l>>5&255,S[u++]=l<<3&255;var x=new Uint32Array(64);for(u=0;u>24&255,d>>16&255,d>>8&255,255&d,p>>24&255,p>>16&255,p>>8&255,255&p,g>>24&255,g>>16&255,g>>8&255,255&g,m>>24&255,m>>16&255,m>>8&255,255&m,v>>24&255,v>>16&255,v>>8&255,255&v,b>>24&255,b>>16&255,b>>8&255,255&b,y>>24&255,y>>16&255,y>>8&255,255&y,w>>24&255,w>>16&255,w>>8&255,255&w])}return c}();t.calculateSHA256=w;var k=function(){function e(e,t,r,n,a){e.assign(t),e.and(r),a.assign(t),a.not(),a.and(n),e.xor(a)}function t(e,t,r,n,a){e.assign(t),e.and(r),a.assign(t),a.and(n),e.xor(a),a.assign(r),a.and(n),e.xor(a)}function r(e,t,r){e.assign(t),e.rotateRight(28),r.assign(t),r.rotateRight(34),e.xor(r),r.assign(t),r.rotateRight(39),e.xor(r)}function n(e,t,r){e.assign(t),e.rotateRight(14),r.assign(t),r.rotateRight(18),e.xor(r),r.assign(t),r.rotateRight(41),e.xor(r)}function a(e,t,r){e.assign(t),e.rotateRight(1),r.assign(t),r.rotateRight(8),e.xor(r),r.assign(t),r.shiftRight(7),e.xor(r)}function i(e,t,r){e.assign(t),e.rotateRight(19),r.assign(t),r.rotateRight(61),e.xor(r),r.assign(t),r.shiftRight(6),e.xor(r)}var o=[new y(1116352408,3609767458),new y(1899447441,602891725),new y(3049323471,3964484399),new y(3921009573,2173295548),new y(961987163,4081628472),new y(1508970993,3053834265),new y(2453635748,2937671579),new y(2870763221,3664609560),new y(3624381080,2734883394),new y(310598401,1164996542),new y(607225278,1323610764),new y(1426881987,3590304994),new y(1925078388,4068182383),new y(2162078206,991336113),new y(2614888103,633803317),new y(3248222580,3479774868),new y(3835390401,2666613458),new y(4022224774,944711139),new y(264347078,2341262773),new y(604807628,2007800933),new y(770255983,1495990901),new y(1249150122,1856431235),new y(1555081692,3175218132),new y(1996064986,2198950837),new y(2554220882,3999719339),new y(2821834349,766784016),new y(2952996808,2566594879),new y(3210313671,3203337956),new y(3336571891,1034457026),new y(3584528711,2466948901),new y(113926993,3758326383),new y(338241895,168717936),new y(666307205,1188179964),new y(773529912,1546045734),new y(1294757372,1522805485),new y(1396182291,2643833823),new y(1695183700,2343527390),new y(1986661051,1014477480),new y(2177026350,1206759142),new y(2456956037,344077627),new y(2730485921,1290863460),new y(2820302411,3158454273),new y(3259730800,3505952657),new y(3345764771,106217008),new y(3516065817,3606008344),new y(3600352804,1432725776),new y(4094571909,1467031594),new y(275423344,851169720),new y(430227734,3100823752),new y(506948616,1363258195),new y(659060556,3750685593),new y(883997877,3785050280),new y(958139571,3318307427),new y(1322822218,3812723403),new y(1537002063,2003034995),new y(1747873779,3602036899),new y(1955562222,1575990012),new y(2024104815,1125592928),new y(2227730452,2716904306),new y(2361852424,442776044),new y(2428436474,593698344),new y(2756734187,3733110249),new y(3204031479,2999351573),new y(3329325298,3815920427),new y(3391569614,3928383900),new y(3515267271,566280711),new y(3940187606,3454069534),new y(4118630271,4000239992),new y(116418474,1914138554),new y(174292421,2731055270),new y(289380356,3203993006),new y(460393269,320620315),new y(685471733,587496836),new y(852142971,1086792851),new y(1017036298,365543100),new y(1126000580,2618297676),new y(1288033470,3409855158),new y(1501505948,4234509866),new y(1607167915,987167468),new y(1816402316,1246189591)];function s(s,c,l,u){var h,f,d,p,g,m,v,b;u=!!u,u?(h=new y(3418070365,3238371032),f=new y(1654270250,914150663),d=new y(2438529370,812702999),p=new y(355462360,4144912697),g=new y(1731405415,4290775857),m=new y(2394180231,1750603025),v=new y(3675008525,1694076839),b=new y(1203062813,3204075428)):(h=new y(1779033703,4089235720),f=new y(3144134277,2227873595),d=new y(1013904242,4271175723),p=new y(2773480762,1595750129),g=new y(1359893119,2917565137),m=new y(2600822924,725511199),v=new y(528734635,4215389547),b=new y(1541459225,327033209));var w,k,S,x=128*Math.ceil((l+17)/128),C=new Uint8Array(x);for(w=0;w>>29&255,C[w++]=l>>21&255,C[w++]=l>>13&255,C[w++]=l>>5&255,C[w++]=l<<3&255;var A=new Array(80);for(w=0;w<80;w++)A[w]=new y(0,0);var E,O,T=new y(0,0),I=new y(0,0),P=new y(0,0),_=new y(0,0),F=new y(0,0),R=new y(0,0),M=new y(0,0),B=new y(0,0),L=new y(0,0),D=new y(0,0),N=new y(0,0),U=new y(0,0);for(w=0;w=1;--c){r=i[13],i[13]=i[9],i[9]=i[5],i[5]=i[1],i[1]=r,r=i[14],n=i[10],i[14]=i[6],i[10]=i[2],i[6]=r,i[2]=n,r=i[15],n=i[11],a=i[7],i[15]=i[3],i[11]=r,i[7]=n,i[3]=a;for(var l=0;l<16;++l)i[l]=this._inv_s[i[l]];for(var u=0,h=16*c;u<16;++u,++h)i[u]^=t[h];for(var f=0;f<16;f+=4){var d=this._mix[i[f]],p=this._mix[i[f+1]],g=this._mix[i[f+2]],m=this._mix[i[f+3]];r=d^p>>>8^p<<24^g>>>16^g<<16^m>>>24^m<<8,i[f]=r>>>24&255,i[f+1]=r>>16&255,i[f+2]=r>>8&255,i[f+3]=255&r}}r=i[13],i[13]=i[9],i[9]=i[5],i[5]=i[1],i[1]=r,r=i[14],n=i[10],i[14]=i[6],i[10]=i[2],i[6]=r,i[2]=n,r=i[15],n=i[11],a=i[7],i[15]=i[3],i[11]=r,i[7]=n,i[3]=a;for(var v=0;v<16;++v)i[v]=this._inv_s[i[v]],i[v]^=t[v];return i}},{key:"_encrypt",value:function(e,t){var r,n,a,i=this._s,o=new Uint8Array(16);o.set(e);for(var s=0;s<16;++s)o[s]^=t[s];for(var c=1;c=p;--d)if(h[d]!==f){f=0;break}u-=f,i[i.length-1]=h.subarray(0,16-f)}}for(var g=new Uint8Array(u),m=0,v=0,b=i.length;m2&&void 0!==arguments[2]?arguments[2]:null,n=e.length,a=this.buffer,i=this.bufferPosition;if(r)this.iv=r;else{for(var o=0;i<16&&o=256&&(c=255&(27^c)));for(var h=0;h<4;++h)n[l]=a^=n[l-32],l++,n[l]=i^=n[l-32],l++,n[l]=o^=n[l-32],l++,n[l]=s^=n[l-32],l++}return n}}]),r}(C);t.AES256Cipher=E;var O=function(){function e(e,t){if(e.length!==t.length)return!1;for(var r=0;ro-32){var s=t.length+a.length+n.length,c=new Uint8Array(64*s),l=e(t,a);l=e(l,n);for(var u=0,h=0;u<64;u++,h+=s)c.set(l,h);var f=new A(a.subarray(0,16));i=f.encrypt(c,a.subarray(16,32));for(var d=0,p=0;p<16;p++)d*=1,d%=3,d+=(i[p]>>>0)%3,d%=3;0===d?a=w(i,0,i.length):1===d?a=S(i,0,i.length):2===d&&(a=k(i,0,i.length)),o++}return a.subarray(0,32)}function r(){}function n(e,t){if(e.length!==t.length)return!1;for(var r=0;r>8&255,f[d++]=i>>16&255,f[d++]=i>>>24&255,l=0,u=t.length;l=4&&!c&&(f[d++]=255,f[d++]=255,f[d++]=255,f[d++]=255);var p=b(f,0,d),g=s>>3;if(o>=3)for(l=0;l<50;++l)p=b(p,0,g);var m,y,w=p.subarray(0,g);if(o>=3){for(d=0;d<32;++d)f[d]=e[d];for(l=0,u=t.length;l>3;if(n>=3)for(i=0;i<50;++i)h=b(h,0,h.length);if(n>=3){u=r;var d,p=new Uint8Array(f);for(i=19;i>=0;i--){for(d=0;d=4){var F=e.get("CF");(0,a.isDict)(F)&&(F.suppressEncryption=!0),this.cf=F,this.stmf=e.get("StmF")||o,this.strf=e.get("StrF")||o,this.eff=e.get("EFF")||this.stmf}}function c(e,t,r,n){var a,i,o=new Uint8Array(r.length+9);for(a=0,i=r.length;a>8&255,o[a++]=e>>16&255,o[a++]=255&t,o[a++]=t>>8&255,n&&(o[a++]=115,o[a++]=65,o[a++]=108,o[a++]=84);var s=b(o,0,a);return s.subarray(0,Math.min(r.length+5,16))}function l(e,t,r,i,o){if(!(0,a.isName)(t))throw new n.FormatError("Invalid crypt filter name.");var s,l=e.get(t.name);if(null!==l&&void 0!==l&&(s=l.get("CFM")),!s||"None"===s.name)return function(){return new x};if("V2"===s.name)return function(){return new v(c(r,i,o,!1))};if("AESV2"===s.name)return function(){return new A(c(r,i,o,!0))};if("AESV3"===s.name)return function(){return new E(o)};throw new n.FormatError("Unknown crypto method")}return s.prototype={createCipherTransform:function(e,t){if(4===this.algorithm||5===this.algorithm)return new I(l(this.cf,this.stmf,e,t,this.encryptionKey),l(this.cf,this.strf,e,t,this.encryptionKey));var r=c(e,t,this.encryptionKey,!1),n=function(){return new v(r)};return new I(n,n)}},s}();t.CipherTransformFactory=P},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorSpace=void 0;var n=s(r(2)),a=r(5),i=r(202),o=r(205);function s(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="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},c(e)}function l(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&&u(e,t)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function h(e){var t=p();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return f(this,r)}}function f(e,t){return!t||"object"!==c(t)&&"function"!==typeof t?d(e):t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function m(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,a)}function v(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){m(i,n,a,o,s,"next",e)}function s(e){m(i,n,a,o,s,"throw",e)}o(void 0)}))}}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var r=0;rh&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){for(var d=o<=8?new Uint8Array(h):new Uint16Array(h),p=0;p2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3?arguments[3]:void 0;if(e=t.fetchIfRef(e),(0,i.isName)(e))switch(e.name){case"DeviceGray":case"G":return this.singletons.gray;case"DeviceRGB":case"RGB":return this.singletons.rgb;case"DeviceCMYK":case"CMYK":return this.singletons.cmyk;case"Pattern":return new C(null);default:if((0,i.isDict)(r)){var o=r.get("ColorSpace");if((0,i.isDict)(o)){var s=o.get(e.name);if(s){if((0,i.isName)(s))return this._parse(s,t,r,n);e=s;break}}}throw new a.FormatError("Unrecognized ColorSpace: ".concat(e.name))}if(Array.isArray(e)){var c,l,u,h,f,d,p=t.fetchIfRef(e[0]).name;switch(p){case"DeviceGray":case"G":return this.singletons.gray;case"DeviceRGB":case"RGB":return this.singletons.rgb;case"DeviceCMYK":case"CMYK":return this.singletons.cmyk;case"CalGray":return c=t.fetchIfRef(e[1]),h=c.getArray("WhitePoint"),f=c.getArray("BlackPoint"),d=c.get("Gamma"),new I(h,f,d);case"CalRGB":c=t.fetchIfRef(e[1]),h=c.getArray("WhitePoint"),f=c.getArray("BlackPoint"),d=c.getArray("Gamma");var g=c.getArray("Matrix");return new P(h,f,d,g);case"ICCBased":var m=t.fetchIfRef(e[1]),v=m.dict;l=v.get("N");var b=v.get("Alternate");if(b){var y=this._parse(b,t,r,n);if(y.numComps===l)return y;(0,a.warn)("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===l)return this.singletons.gray;if(3===l)return this.singletons.rgb;if(4===l)return this.singletons.cmyk;break;case"Pattern":return u=e[1]||null,u&&(u=this._parse(u,t,r,n)),new C(u);case"Indexed":case"I":u=this._parse(e[1],t,r,n);var w=t.fetchIfRef(e[2])+1,k=t.fetchIfRef(e[3]);return new A(u,w,k);case"Separation":case"DeviceN":var S=t.fetchIfRef(e[1]);l=Array.isArray(S)?S.length:1,u=this._parse(e[2],t,r,n);var E=n.create(e[3]);return new x(l,u,E);case"Lab":c=t.fetchIfRef(e[1]),h=c.getArray("WhitePoint"),f=c.getArray("BlackPoint");var O=c.getArray("Range");return new _(h,f,O);default:throw new a.FormatError("Unimplemented ColorSpace object: ".concat(p))}}throw new a.FormatError("Unrecognized ColorSpace object: ".concat(e))}},{key:"isDefaultDecode",value:function(e,t){if(!Array.isArray(e))return!0;if(2*t!==e.length)return(0,a.warn)("The decode map is not the correct length"),!0;for(var r=0,n=e.length;r=.99554525?1:g(0,1,1.055*Math.pow(e,1/2.4)-.055)}function g(e,t,r){return Math.max(e,Math.min(t,r))}function m(e){return e<0?-m(-e):e>8?Math.pow((e+16)/116,3):e*c}function v(e,t,r){if(0===e[0]&&0===e[1]&&0===e[2])return r[0]=t[0],r[1]=t[1],void(r[2]=t[2]);var n=m(0),a=n,i=m(e[0]),o=n,s=m(e[1]),c=n,l=m(e[2]),u=(1-a)/(1-i),h=1-u,f=(1-o)/(1-s),d=1-f,p=(1-c)/(1-l),g=1-p;r[0]=t[0]*u+h,r[1]=t[1]*f+d,r[2]=t[2]*p+g}function y(r,n,a){if(1===r[0]&&1===r[2])return a[0]=n[0],a[1]=n[1],void(a[2]=n[2]);var o=a;u(e,n,o);var s=i;f(r,o,s),u(t,s,a)}function k(r,n,a){var o=a;u(e,n,o);var s=i;d(r,o,s),u(t,s,a)}function x(e,t,a,i,c,l){var h=g(0,1,t[a]*l),f=g(0,1,t[a+1]*l),d=g(0,1,t[a+2]*l),m=1===h?1:Math.pow(h,e.GR),b=1===f?1:Math.pow(f,e.GG),w=1===d?1:Math.pow(d,e.GB),S=e.MXA*m+e.MXB*b+e.MXC*w,x=e.MYA*m+e.MYB*b+e.MYC*w,C=e.MZA*m+e.MZB*b+e.MZC*w,A=o;A[0]=S,A[1]=x,A[2]=C;var E=s;y(e.whitePoint,A,E);var O=o;v(e.blackPoint,E,O);var T=s;k(n,O,T);var I=o;u(r,T,I),i[c]=255*p(I[0]),i[c+1]=255*p(I[1]),i[c+2]=255*p(I[2])}var C=function(e){l(r,e);var t=h(r);function r(e,n,i,o){var s;if(b(this,r),s=t.call(this,"CalRGB",3),!e)throw new a.FormatError("WhitePoint missing - required for color space CalRGB");n=n||new Float32Array(3),i=i||new Float32Array([1,1,1]),o=o||new Float32Array([1,0,0,0,1,0,0,0,1]);var c=e[0],l=e[1],u=e[2];s.whitePoint=e;var h=n[0],f=n[1],d=n[2];if(s.blackPoint=n,s.GR=i[0],s.GG=i[1],s.GB=i[2],s.MXA=o[0],s.MYA=o[1],s.MZA=o[2],s.MXB=o[3],s.MYB=o[4],s.MZB=o[5],s.MXC=o[6],s.MYC=o[7],s.MZC=o[8],c<0||u<0||1!==l)throw new a.FormatError("Invalid WhitePoint components for ".concat(s.name)+", no fallback available");return(h<0||f<0||d<0)&&((0,a.info)("Invalid BlackPoint for ".concat(s.name," [").concat(h,", ").concat(f,", ").concat(d,"], ")+"falling back to default."),s.blackPoint=new Float32Array(3)),(s.GR<0||s.GG<0||s.GB<0)&&((0,a.info)("Invalid Gamma [".concat(s.GR,", ").concat(s.GG,", ").concat(s.GB,"] for ")+"".concat(s.name,", falling back to default.")),s.GR=s.GG=s.GB=1),s}return w(r,[{key:"getRgbItem",value:function(e,t,r,n){x(this,e,t,r,n,1)}},{key:"getRgbBuffer",value:function(e,t,r,n,a,i,o){for(var s=1/((1<=6/29?e*e*e:108/841*(e-4/29),t}function t(e,t,r,n){return r+e*(n-r)/t}function r(r,n,a,i,o,s){var c=n[a],l=n[a+1],u=n[a+2];!1!==i&&(c=t(c,i,0,100),l=t(l,i,r.amin,r.amax),u=t(u,i,r.bmin,r.bmax)),l>r.amax?l=r.amax:lr.bmax?u=r.bmax:uo.amax||o.bmin>o.bmax)&&((0,a.info)("Invalid Range, falling back to defaults"),o.amin=-100,o.amax=100,o.bmin=-100,o.bmax=100),o}return w(n,[{key:"getRgbItem",value:function(e,t,n,a){r(this,e,t,!1,n,a)}},{key:"getRgbBuffer",value:function(e,t,n,a,i,o,s){for(var c=(1<1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0;if(!e)throw new Error('LocalImageCache.set - expected "name" argument.');if(t){if(this._imageCache.has(t))return;return this._nameRefMap.set(e,t),void this._imageCache.put(t,r)}this._imageMap.has(e)||this._imageMap.set(e,r)}}]),r}(m);t.LocalImageCache=v;var b=function(e){o(r,e);var t=c(r);function r(){return d(this,r),t.apply(this,arguments)}return g(r,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0;if(!e&&!t)throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');if(t){if(this._imageCache.has(t))return;return e&&this._nameRefMap.set(e,t),void this._imageCache.put(t,r)}this._imageMap.has(e)||this._imageMap.set(e,r)}}]),r}(m);t.LocalColorSpaceCache=b;var y=function(e){o(r,e);var t=c(r);function r(e){return d(this,r),t.call(this,{onlyRefs:!0})}return g(r,[{key:"getByName",value:function(e){(0,n.unreachable)("Should not call `getByName` method.")}},{key:"set",value:function(){var e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0;if(!e)throw new Error('LocalFunctionCache.set - expected "ref" argument.');this._imageCache.has(e)||this._imageCache.put(e,t)}}]),r}(m);t.LocalFunctionCache=y;var w=function(e){o(r,e);var t=c(r);function r(){return d(this,r),t.apply(this,arguments)}return g(r,[{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0;if(!e)throw new Error('LocalGStateCache.set - expected "name" argument.');if(t){if(this._imageCache.has(t))return;return this._nameRefMap.set(e,t),void this._imageCache.put(t,r)}this._imageMap.has(e)||this._imageMap.set(e,r)}}]),r}(m);t.LocalGStateCache=w;var k=function(){function e(){d(this,e),this._refCache=new a.RefSetCache,this._imageCache=new a.RefSetCache}return g(e,null,[{key:"NUM_PAGES_THRESHOLD",get:function(){return(0,n.shadow)(this,"NUM_PAGES_THRESHOLD",2)}},{key:"MAX_IMAGES_TO_CACHE",get:function(){return(0,n.shadow)(this,"MAX_IMAGES_TO_CACHE",10)}}]),g(e,[{key:"shouldCache",value:function(t,r){var n=this._refCache.get(t),a=n?n.size+(n.has(r)?0:1):1;return!(a=e.MAX_IMAGES_TO_CACHE)}},{key:"addPageIndex",value:function(e,t){var r=this._refCache.get(e);r||(r=new Set,this._refCache.put(e,r)),r.add(t)}},{key:"getData",value:function(t,r){var n=this._refCache.get(t);return n?n.size=e.MAX_IMAGES_TO_CACHE?(0,n.info)("GlobalImageCache.setData - ignoring image above MAX_IMAGES_TO_CACHE."):this._imageCache.put(t,r))}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e||this._refCache.clear(),this._imageCache.clear()}}]),e}();t.GlobalImageCache=k},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getQuadPoints=L,t.MarkupAnnotation=t.AnnotationFactory=t.AnnotationBorderStyle=t.Annotation=void 0;var n=f(r(2)),a=r(5),i=r(207),o=r(202),s=r(220),c=r(205),l=r(223),u=r(209),h=r(224);function f(e){return e&&e.__esModule?e:{default:e}}function d(e,t,r){return d="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=p(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(r):a.value}},d(e,t,r||e)}function p(e,t){while(!Object.prototype.hasOwnProperty.call(e,t))if(e=S(e),null===e)break;return e}function g(e){return g="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},g(e)}function m(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&&v(e,t)}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function b(e){var t=k();return function(){var r,n=S(e);if(t){var a=S(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return y(this,r)}}function y(e,t){return!t||"object"!==g(t)&&"function"!==typeof t?w(e):t}function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function x(e,t){var r;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=T(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r["return"]||r["return"]()}finally{if(s)throw i}}}}function C(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,a)}function A(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){C(i,n,a,o,s,"next",e)}function s(e){C(i,n,a,o,s,"throw",e)}o(void 0)}))}}function E(e,t){return _(e)||P(e,t)||T(e,t)||O()}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(e,t){if(e){if("string"===typeof e)return I(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(e,t):void 0}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0)return null;for(var n=[],a=0,i=r.length/8;at[2]||lt[3])return null;n[a].push({x:c,y:l})}}return n}function D(e,t,r){var n=a.Util.getAxialAlignedBoundingBox(t,r),i=E(n,4),o=i[0],s=i[1],c=i[2],l=i[3];if(o===c||s===l)return[1,0,0,1,e[0],e[1]];var u=(e[2]-e[0])/(c-o),h=(e[3]-e[1])/(l-s);return[u,0,0,h,e[0]-o*u,e[1]-s*h]}t.AnnotationFactory=B;var N=function(){function e(t){F(this,e);var r=t.dict;this.setContents(r.get("Contents")),this.setModificationDate(r.get("M")),this.setFlags(r.get("F")),this.setRectangle(r.getArray("Rect")),this.setColor(r.getArray("C")),this.setBorderStyle(r),this.setAppearance(r),this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,contents:this.contents,hasAppearance:!!this.appearance,id:t.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:t.subtype}}return M(e,[{key:"_hasFlag",value:function(e,t){return!!(e&t)}},{key:"_isViewable",value:function(e){return!this._hasFlag(e,a.AnnotationFlag.INVISIBLE)&&!this._hasFlag(e,a.AnnotationFlag.HIDDEN)&&!this._hasFlag(e,a.AnnotationFlag.NOVIEW)}},{key:"_isPrintable",value:function(e){return this._hasFlag(e,a.AnnotationFlag.PRINT)&&!this._hasFlag(e,a.AnnotationFlag.INVISIBLE)&&!this._hasFlag(e,a.AnnotationFlag.HIDDEN)}},{key:"setContents",value:function(e){this.contents=(0,a.stringToPDFString)(e||"")}},{key:"setModificationDate",value:function(e){this.modificationDate=(0,a.isString)(e)?e:null}},{key:"setFlags",value:function(e){this.flags=Number.isInteger(e)&&e>0?e:0}},{key:"hasFlag",value:function(e){return this._hasFlag(this.flags,e)}},{key:"setRectangle",value:function(e){Array.isArray(e)&&4===e.length?this.rectangle=a.Util.normalizeRect(e):this.rectangle=[0,0,0,0]}},{key:"setColor",value:function(e){var t=new Uint8ClampedArray(3);if(Array.isArray(e))switch(e.length){case 0:this.color=null;break;case 1:s.ColorSpace.singletons.gray.getRgbItem(e,0,t,0),this.color=t;break;case 3:s.ColorSpace.singletons.rgb.getRgbItem(e,0,t,0),this.color=t;break;case 4:s.ColorSpace.singletons.cmyk.getRgbItem(e,0,t,0),this.color=t;break;default:this.color=t;break}else this.color=t}},{key:"setBorderStyle",value:function(e){if(this.borderStyle=new U,(0,o.isDict)(e))if(e.has("BS")){var t=e.get("BS"),r=t.get("Type");r&&!(0,o.isName)(r,"Border")||(this.borderStyle.setWidth(t.get("W"),this.rectangle),this.borderStyle.setStyle(t.get("S")),this.borderStyle.setDashArray(t.getArray("D")))}else if(e.has("Border")){var n=e.getArray("Border");Array.isArray(n)&&n.length>=3&&(this.borderStyle.setHorizontalCornerRadius(n[0]),this.borderStyle.setVerticalCornerRadius(n[1]),this.borderStyle.setWidth(n[2],this.rectangle),4===n.length&&this.borderStyle.setDashArray(n[3]))}else this.borderStyle.setWidth(0)}},{key:"setAppearance",value:function(e){this.appearance=null;var t=e.get("AP");if((0,o.isDict)(t)){var r=t.get("N");if((0,o.isStream)(r))this.appearance=r;else if((0,o.isDict)(r)){var n=e.get("AS");(0,o.isName)(n)&&r.has(n.name)&&(this.appearance=r.get(n.name))}}}},{key:"loadResources",value:function(e){return this.appearance.dict.getAsync("Resources").then((function(t){if(t){var r=new i.ObjectLoader(t,e,t.xref);return r.load().then((function(){return t}))}}))}},{key:"getOperatorList",value:function(e,t,r,n){if(!this.appearance)return Promise.resolve(new l.OperatorList);var i=this.appearance,o=this.data,s=i.dict,c=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"]),u=s.getArray("BBox")||[0,0,1,1],h=s.getArray("Matrix")||[1,0,0,1,0,0],f=D(o.rect,u,h);return c.then((function(r){var n=new l.OperatorList;return n.addOp(a.OPS.beginAnnotation,[o.rect,f,h]),e.getOperatorList({stream:i,task:t,resources:r,operatorList:n}).then((function(){return n.addOp(a.OPS.endAnnotation,[]),i.reset(),n}))}))}},{key:"save",value:function(){var e=A(n["default"].mark((function e(t,r,a){return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 1:case"end":return e.stop()}}),e)})));function t(t,r,n){return e.apply(this,arguments)}return t}()},{key:"viewable",get:function(){return 0===this.flags||this._isViewable(this.flags)}},{key:"printable",get:function(){return 0!==this.flags&&this._isPrintable(this.flags)}}]),e}();t.Annotation=N;var U=function(){function e(){F(this,e),this.width=1,this.style=a.AnnotationBorderStyleType.SOLID,this.dashArray=[3],this.horizontalCornerRadius=0,this.verticalCornerRadius=0}return M(e,[{key:"setWidth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0];if((0,o.isName)(e))this.width=0;else if(Number.isInteger(e)){if(e>0){var r=(t[2]-t[0])/2,n=(t[3]-t[1])/2;r>0&&n>0&&(e>r||e>n)&&((0,a.warn)("AnnotationBorderStyle.setWidth - ignoring width: ".concat(e)),e=1)}this.width=e}}},{key:"setStyle",value:function(e){if((0,o.isName)(e))switch(e.name){case"S":this.style=a.AnnotationBorderStyleType.SOLID;break;case"D":this.style=a.AnnotationBorderStyleType.DASHED;break;case"B":this.style=a.AnnotationBorderStyleType.BEVELED;break;case"I":this.style=a.AnnotationBorderStyleType.INSET;break;case"U":this.style=a.AnnotationBorderStyleType.UNDERLINE;break;default:break}}},{key:"setDashArray",value:function(e){if(Array.isArray(e)&&e.length>0){var t,r=!0,n=!0,a=x(e);try{for(a.s();!(t=a.n()).done;){var i=t.value,o=+i>=0;if(!o){r=!1;break}i>0&&(n=!1)}}catch(s){a.e(s)}finally{a.f()}r&&!n?this.dashArray=e:this.width=0}else e&&(this.width=0)}},{key:"setHorizontalCornerRadius",value:function(e){Number.isInteger(e)&&(this.horizontalCornerRadius=e)}},{key:"setVerticalCornerRadius",value:function(e){Number.isInteger(e)&&(this.verticalCornerRadius=e)}}]),e}();t.AnnotationBorderStyle=U;var j=function(e){m(r,e);var t=b(r);function r(e){var n;F(this,r),n=t.call(this,e);var i=e.dict;if(i.has("IRT")){var s=i.getRaw("IRT");n.data.inReplyTo=(0,o.isRef)(s)?s.toString():null;var c=i.get("RT");n.data.replyType=(0,o.isName)(c)?c.name:a.AnnotationReplyType.REPLY}if(n.data.replyType===a.AnnotationReplyType.GROUP){var l=i.get("IRT");n.data.title=(0,a.stringToPDFString)(l.get("T")||""),n.setContents(l.get("Contents")),n.data.contents=n.contents,l.has("CreationDate")?(n.setCreationDate(l.get("CreationDate")),n.data.creationDate=n.creationDate):n.data.creationDate=null,l.has("M")?(n.setModificationDate(l.get("M")),n.data.modificationDate=n.modificationDate):n.data.modificationDate=null,n.data.hasPopup=l.has("Popup"),l.has("C")?(n.setColor(l.getArray("C")),n.data.color=n.color):n.data.color=null}else n.data.title=(0,a.stringToPDFString)(i.get("T")||""),n.setCreationDate(i.get("CreationDate")),n.data.creationDate=n.creationDate,n.data.hasPopup=i.has("Popup"),i.has("C")||(n.data.color=null);return n}return M(r,[{key:"setCreationDate",value:function(e){this.creationDate=(0,a.isString)(e)?e:null}}]),r}(N);t.MarkupAnnotation=j;var q=function(e){m(r,e);var t=b(r);function r(e){var n;F(this,r),n=t.call(this,e);var i=e.dict,s=n.data;n.ref=e.ref,s.annotationType=a.AnnotationType.WIDGET,s.fieldName=n._constructFieldName(i);var l=(0,c.getInheritableProperty)({dict:i,key:"V",getArray:!0});s.fieldValue=n._decodeFormValue(l),s.alternativeText=(0,a.stringToPDFString)(i.get("TU")||""),s.defaultAppearance=(0,c.getInheritableProperty)({dict:i,key:"DA"})||e.acroForm.get("DA")||"";var u=(0,c.getInheritableProperty)({dict:i,key:"FT"});return s.fieldType=(0,o.isName)(u)?u.name:null,n.fieldResources=(0,c.getInheritableProperty)({dict:i,key:"DR"})||e.acroForm.get("DR")||o.Dict.empty,s.fieldFlags=(0,c.getInheritableProperty)({dict:i,key:"Ff"}),(!Number.isInteger(s.fieldFlags)||s.fieldFlags<0)&&(s.fieldFlags=0),s.readOnly=n.hasFieldFlag(a.AnnotationFieldFlag.READONLY),"Sig"===s.fieldType&&(s.fieldValue=null,n.setFlags(a.AnnotationFlag.HIDDEN)),n}return M(r,[{key:"_constructFieldName",value:function(e){if(!e.has("T")&&!e.has("Parent"))return(0,a.warn)("Unknown field name, falling back to empty field name."),"";if(!e.has("Parent"))return(0,a.stringToPDFString)(e.get("T"));var t=[];e.has("T")&&t.unshift((0,a.stringToPDFString)(e.get("T")));var r=e;while(r.has("Parent")){if(r=r.get("Parent"),!(0,o.isDict)(r))break;r.has("T")&&t.unshift((0,a.stringToPDFString)(r.get("T")))}return t.join(".")}},{key:"_decodeFormValue",value:function(e){return Array.isArray(e)?e.filter((function(e){return(0,a.isString)(e)})).map((function(e){return(0,a.stringToPDFString)(e)})):(0,o.isName)(e)?(0,a.stringToPDFString)(e.name):(0,a.isString)(e)?(0,a.stringToPDFString)(e):null}},{key:"hasFieldFlag",value:function(e){return!!(this.data.fieldFlags&e)}},{key:"getOperatorList",value:function(e,t,n,i){var o=this;return n?Promise.resolve(new l.OperatorList):this._hasText?this._getAppearance(e,t,i).then((function(s){if(o.appearance&&null===s)return d(S(r.prototype),"getOperatorList",o).call(o,e,t,n,i);var c=new l.OperatorList;if(!o.data.defaultAppearance||null===s)return c;var h=[1,0,0,1,0,0],f=[0,0,o.data.rect[2]-o.data.rect[0],o.data.rect[3]-o.data.rect[1]],p=D(o.data.rect,f,h);c.addOp(a.OPS.beginAnnotation,[o.data.rect,p,h]);var g=new u.StringStream(s);return e.getOperatorList({stream:g,task:t,resources:o.fieldResources,operatorList:c}).then((function(){return c.addOp(a.OPS.endAnnotation,[]),c}))})):d(S(r.prototype),"getOperatorList",this).call(this,e,t,n,i)}},{key:"save",value:function(){var e=A(n["default"].mark((function e(t,r,i){var s,c,l,u,f,d,p,g,m,v,b,y;return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.data.fieldValue!==i[this.data.id]){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,this._getAppearance(t,r,i);case 4:if(s=e.sent,null!==s){e.next=7;break}return e.abrupt("return",null);case 7:if(c=t.xref.fetchIfRef(this.ref),(0,o.isDict)(c)){e.next=10;break}return e.abrupt("return",null);case 10:return l=[0,0,this.data.rect[2]-this.data.rect[0],this.data.rect[3]-this.data.rect[1]],u=t.xref.getNewRef(),f=new o.Dict(t.xref),f.set("N",u),d=i[this.data.id],p=t.xref.encrypt,g=null,m=null,p&&(g=p.createCipherTransform(this.ref.num,this.ref.gen),m=p.createCipherTransform(u.num,u.gen),s=m.encryptString(s)),c.set("V",d),c.set("AP",f),c.set("M","D:".concat((0,a.getModificationDate)())),v=new o.Dict(t.xref),v.set("Length",s.length),v.set("Subtype",o.Name.get("Form")),v.set("Resources",this.fieldResources),v.set("BBox",l),b=["".concat(this.ref.num," ").concat(this.ref.gen," obj\n")],(0,h.writeDict)(c,b,g),b.push("\nendobj\n"),y=["".concat(u.num," ").concat(u.gen," obj\n")],(0,h.writeDict)(v,y,m),y.push(" stream\n"),y.push(s),y.push("\nendstream\nendobj\n"),e.abrupt("return",[{ref:this.ref,data:b.join("")},{ref:u,data:y.join("")}]);case 36:case"end":return e.stop()}}),e,this)})));function t(t,r,n){return e.apply(this,arguments)}return t}()},{key:"_getAppearance",value:function(){var e=A(n["default"].mark((function e(t,r,i){var o,s,c,l,u,h,f,d,p,g,m,v,b,y,w,k;return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(o=this.hasFieldFlag(a.AnnotationFieldFlag.PASSWORD),i&&!o){e.next=3;break}return e.abrupt("return",null);case 3:if(s=i[this.data.id],""!==s){e.next=6;break}return e.abrupt("return","");case 6:return c=2,l=c,u=this.data.rect[3]-this.data.rect[1],h=this.data.rect[2]-this.data.rect[0],e.next=12,this._getFontData(t,r);case 12:if(f=e.sent,d=E(f,2),p=d[0],g=d[1],m=f[2],m=this._computeFontSize(p,g,m,u),v=p.descent,isNaN(v)&&(v=0),b=c+Math.abs(v)*m,y=this.data.defaultAppearance,w=this.data.textAlignment,!this.data.comb){e.next=23;break}return e.abrupt("return",this._getCombAppearance(y,s,h,l,b));case 23:if(!this.data.multiLine){e.next=25;break}return e.abrupt("return",this._getMultilineAppearance(y,s,p,m,h,u,w,l,b));case 25:if(!(0===w||w>2)){e.next=27;break}return e.abrupt("return","/Tx BMC q BT "+y+" 1 0 0 1 ".concat(l," ").concat(b," Tm (").concat((0,a.escapeString)(s),") Tj")+" ET Q EMC");case 27:return k=this._renderText(s,p,m,h,w,l,b),e.abrupt("return","/Tx BMC q BT "+y+" 1 0 0 1 0 0 Tm ".concat(k)+" ET Q EMC");case 29:case"end":return e.stop()}}),e,this)})));function t(t,r,n){return e.apply(this,arguments)}return t}()},{key:"_getFontData",value:function(){var e=A(n["default"].mark((function e(t,r){var a,i;return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=new l.OperatorList,i={fontSize:0,font:null,fontName:null,clone:function(){return this}},e.next=4,t.getOperatorList({stream:new u.StringStream(this.data.defaultAppearance),task:r,resources:this.fieldResources,operatorList:a,initialState:i});case 4:return e.abrupt("return",[i.font,i.fontName,i.fontSize]);case 5:case"end":return e.stop()}}),e,this)})));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"_computeFontSize",value:function(e,t,r,n){if(null===r||0===r){var a=e.charsToGlyphs("M",!0)[0].width/1e3,i=.7*a;r=Math.max(1,Math.floor(n/(1.5*i)));var o=new RegExp("/".concat(t,"\\s+[0-9.]+\\s+Tf"));-1===this.data.defaultAppearance.search(o)&&(o=new RegExp("/".concat(t,"\\s+Tf"))),this.data.defaultAppearance=this.data.defaultAppearance.replace(o,"/".concat(t," ").concat(r," Tf"))}return r}},{key:"_renderText",value:function(e,t,r,n,i,o,s){var c,l,u=t.charsToGlyphs(e),h=r/1e3,f=0,d=x(u);try{for(d.s();!(c=d.n()).done;){var p=c.value;f+=p.width*h}}catch(g){d.e(g)}finally{d.f()}return l=1===i?(n-f)/2:2===i?n-f-o:o,l=l.toFixed(2),s=s.toFixed(2),"".concat(l," ").concat(s," Td (").concat((0,a.escapeString)(e),") Tj")}}]),r}(N),z=function(e){m(r,e);var t=b(r);function r(e){var n;F(this,r),n=t.call(this,e),n._hasText=!0;var i=e.dict;(0,a.isString)(n.data.fieldValue)||(n.data.fieldValue="");var o=(0,c.getInheritableProperty)({dict:i,key:"Q"});(!Number.isInteger(o)||o<0||o>2)&&(o=null),n.data.textAlignment=o;var s=(0,c.getInheritableProperty)({dict:i,key:"MaxLen"});return(!Number.isInteger(s)||s<0)&&(s=null),n.data.maxLen=s,n.data.multiLine=n.hasFieldFlag(a.AnnotationFieldFlag.MULTILINE),n.data.comb=n.hasFieldFlag(a.AnnotationFieldFlag.COMB)&&!n.hasFieldFlag(a.AnnotationFieldFlag.MULTILINE)&&!n.hasFieldFlag(a.AnnotationFieldFlag.PASSWORD)&&!n.hasFieldFlag(a.AnnotationFieldFlag.FILESELECT)&&null!==n.data.maxLen,n}return M(r,[{key:"_getCombAppearance",value:function(e,t,r,n,i){var o,s=(r/this.data.maxLen).toFixed(2),c=[],l=x(t);try{for(l.s();!(o=l.n()).done;){var u=o.value;c.push("(".concat((0,a.escapeString)(u),") Tj"))}}catch(f){l.e(f)}finally{l.f()}var h=c.join(" ".concat(s," 0 Td "));return"/Tx BMC q BT "+e+" 1 0 0 1 ".concat(n," ").concat(i," Tm ").concat(h)+" ET Q EMC"}},{key:"_getMultilineAppearance",value:function(e,t,r,n,a,i,o,s,c){var l,u=t.split(/\r\n|\r|\n/),h=[],f=a-2*s,d=x(u);try{for(d.s();!(l=d.n()).done;){var p,g=l.value,m=this._splitLine(g,r,n,f),v=x(m);try{for(v.s();!(p=v.n()).done;){var b=p.value,y=0===h.length?s:0;h.push(this._renderText(b,r,n,a,o,y,-n))}}catch(k){v.e(k)}finally{v.f()}}}catch(k){d.e(k)}finally{d.f()}var w=h.join("\n");return"/Tx BMC q BT "+e+" 1 0 0 1 0 ".concat(i," Tm ").concat(w)+" ET Q EMC"}},{key:"_splitLine",value:function(e,t,r,n){if(e.length<=1)return[e];for(var a=r/1e3,i=t.charsToGlyphs(" ",!0)[0].width*a,o=[],s=-1,c=0,l=0,u=0,h=e.length;un?(o.push(e.substring(c,u)),c=u,l=i,s=-1):(l+=i,s=u);else{var d=t.charsToGlyphs(f,!1)[0].width*a;l+d>n?-1!==s?(o.push(e.substring(c,s+1)),c=u=s+1,s=-1,l=0):(o.push(e.substring(c,u)),c=u,l=d):l+=d}}return c=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||null==r["return"]||r["return"]()}finally{if(c)throw o}}}}function i(e,t){if(e){if("string"===typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);ri&&(g=Math.max(g,b),y+=v+2*o,b=0,v=0),m.push({transform:w,x:b,y:y,w:k.width,h:k.height}),b+=k.width+2*o,v=Math.max(v,k.height)}var S=Math.max(g,b)+o,x=y+v+o,C=new Uint8ClampedArray(S*x*4),A=S<<2;for(p=0;p=0)E[I-4]=E[I],E[I-3]=E[I+1],E[I-2]=E[I+2],E[I-1]=E[I+3],E[I+O]=E[I+O-4],E[I+O+1]=E[I+O-3],E[I+O+2]=E[I+O-2],E[I+O+3]=E[I+O-1],I-=A}return s.splice(u,4*d,n.OPS.paintInlineImageXObjectGroup),c.splice(u,4*d,[{width:S,height:x,kind:n.ImageKind.RGBA_32BPP,data:C},m]),u+1})),e(r,[n.OPS.save,n.OPS.transform,n.OPS.paintImageMaskXObject,n.OPS.restore],null,(function(e,t){var r=e.fnArray,a=e.iCurr-3,i=(t-a)%4;switch(i){case 0:return r[t]===n.OPS.save;case 1:return r[t]===n.OPS.transform;case 2:return r[t]===n.OPS.paintImageMaskXObject;case 3:return r[t]===n.OPS.restore}throw new Error("iterateImageMaskGroup - invalid pos: ".concat(i))}),(function(e,r){var a,i=10,o=100,s=1e3,c=e.fnArray,l=e.argsArray,u=e.iCurr,h=u-3,f=u-2,d=u-1,p=Math.floor((r-h)/4);if(p=t(h,p,c,l),p=4&&a[s-4]===a[c]&&a[s-3]===a[l]&&a[s-2]===a[u]&&a[s-1]===a[h]&&i[s-4][0]===f&&i[s-4][1]===d&&(p++,g-=5);for(var m=g+4,v=1;v=n)break}a=(a||r)[e[t]],a&&!Array.isArray(a)?(o.iCurr=t,t++,!a.checkFn||(0,a.checkFn)(o)?(i=a,a=null):a=null):t++}this.state=a,this.match=i,this.lastProcessed=t}else this.lastProcessed=n},push:function(e,t){this.queue.fnArray.push(e),this.queue.argsArray.push(t),this._optimize()},flush:function(){while(this.match){var e=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,e),this.match=null,this.state=null,this._optimize()}},reset:function(){this.state=null,this.match=null,this.lastProcessed=0}},a}(),c=function(){function e(e){this.queue=e}return e.prototype={push:function(e,t){this.queue.fnArray.push(e),this.queue.argsArray.push(t)},flush:function(){},reset:function(){}},e}(),l=function(){var e=1e3,t=e-5;function r(e,t){this._streamSink=t,this.fnArray=[],this.argsArray=[],this.optimizer=t&&"oplist"!==e?new s(this):new c(this),this.dependencies=new Set,this._totalLength=0,this.weight=0,this._resolved=t?null:Promise.resolve()}return r.prototype={get length(){return this.argsArray.length},get ready(){return this._resolved||this._streamSink.ready},get totalLength(){return this._totalLength+this.length},addOp:function(r,a){this.optimizer.push(r,a),this.weight++,this._streamSink&&(this.weight>=e||this.weight>=t&&(r===n.OPS.restore||r===n.OPS.endText))&&this.flush()},addDependency:function(e){this.dependencies.has(e)||(this.dependencies.add(e),this.addOp(n.OPS.dependency,[e]))},addDependencies:function(e){var t,r=a(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;this.addDependency(n)}}catch(i){r.e(i)}finally{r.f()}},addOpList:function(e){if(e instanceof r){var t,i=a(e.dependencies);try{for(i.s();!(t=i.n()).done;){var o=t.value;this.dependencies.add(o)}}catch(l){i.e(l)}finally{i.f()}for(var s=0,c=e.length;s0&&void 0!==arguments[0]&&arguments[0];this.optimizer.flush();var t=this.length;this._totalLength+=t,this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:e,length:t},1,this._transfers),this.dependencies.clear(),this.fnArray.length=0,this.argsArray.length=0,this.weight=0,this.optimizer.reset()}},r}();t.OperatorList=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.writeDict=d,t.incrementalUpdate=k;var n=r(5),a=r(202),i=r(219);function o(e,t){return l(e)||c(e,t)||h(e,t)||s()}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0)if(r.push(o.value),t&&r.length===t)break}catch(c){a=!0,i=c}finally{try{n||null==s["return"]||s["return"]()}finally{if(a)throw i}}return r}}function l(e){if(Array.isArray(e))return e}function u(e,t){var r;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=h(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r["return"]||r["return"]()}finally{if(s)throw i}}}}function h(e,t){if(e){if("string"===typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>")}function p(e,t,r){d(e.dict,t,r),t.push(" stream\n");var a=(0,n.bytesToString)(e.getBytes());null!==r&&(a=r.encryptString(a)),t.push(a),t.push("\nendstream\n")}function g(e,t,r){t.push("[");var n,a=!0,i=u(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;a?a=!1:t.push(" "),v(o,t,r)}}catch(s){i.e(s)}finally{i.f()}t.push("]")}function m(e){if(Number.isInteger(e))return e.toString();var t=Math.round(100*e);return t%100===0?(t/100).toString():t%10===0?e.toFixed(1):e.toFixed(2)}function v(e,t,r){(0,a.isName)(e)?t.push("/".concat(e.name)):(0,a.isRef)(e)?t.push("".concat(e.num," ").concat(e.gen," R")):Array.isArray(e)?g(e,t,r):"string"===typeof e?(null!==r&&(e=r.encryptString(e)),t.push("(".concat((0,n.escapeString)(e),")"))):"number"===typeof e?t.push(m(e)):(0,a.isDict)(e)?d(e,t,r):(0,a.isStream)(e)&&p(e,t,r)}function b(e,t,r,n){for(var a=t+r-1;a>r-1;a--)n[a]=255&e,e>>=8;return r+t}function y(e,t,r){for(var n=0,a=e.length;n=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r["return"]||r["return"]()}finally{if(s)throw i}}}}function T(e,t){if(e){if("string"===typeof e)return I(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(e,t):void 0}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1];if(Array.isArray(e)){for(var r=0,n=e.length;r0&&void 0!==arguments[0]?arguments[0]:R,t=Object.create(this);return t.options=e,t}},{key:"hasBlendModes",value:function(e){if(!(e instanceof o.Dict))return!1;var t=new o.RefSet;e.objId&&t.put(e.objId);var r=[e],n=this.xref;while(r.length){var i=r.shift(),s=i.get("ExtGState");if(s instanceof o.Dict){var c,u=O(s.getRawValues());try{for(u.s();!(c=u.n()).done;){var h=c.value;if(h instanceof o.Ref){if(t.has(h))continue;try{h=n.fetch(h)}catch(k){if(k instanceof l.MissingDataException)throw k;t.put(h),(0,a.info)('hasBlendModes - ignoring ExtGState: "'.concat(k,'".'));continue}}if(h instanceof o.Dict){h.objId&&t.put(h.objId);var f=h.get("BM");if(f instanceof o.Name){if("Normal"!==f.name)return!0}else if(void 0!==f&&Array.isArray(f)){var d,p=O(f);try{for(p.s();!(d=p.n()).done;){var g=d.value;if(g instanceof o.Name&&"Normal"!==g.name)return!0}}catch(S){p.e(S)}finally{p.f()}}}}}catch(S){u.e(S)}finally{u.f()}}var m=i.get("XObject");if(m instanceof o.Dict){var v,b=O(m.getRawValues());try{for(b.s();!(v=b.n()).done;){var y=v.value;if(y instanceof o.Ref){if(t.has(y))continue;try{y=n.fetch(y)}catch(k){if(k instanceof l.MissingDataException)throw k;t.put(y),(0,a.info)('hasBlendModes - ignoring XObject: "'.concat(k,'".'));continue}}if((0,o.isStream)(y)){y.dict.objId&&t.put(y.dict.objId);var w=y.dict.get("Resources");w instanceof o.Dict&&(w.objId&&t.has(w.objId)||(r.push(w),w.objId&&t.put(w.objId)))}}}catch(S){b.e(S)}finally{b.f()}}}return!1}},{key:"fetchBuiltInCMap",value:function(){var e=E(n["default"].mark((function e(t){var r,i,o,s;return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=this.builtInCMapCache.get(t),!r){e.next=3;break}return e.abrupt("return",r);case 3:return i=this.handler.sendWithStream("FetchBuiltInCMap",{name:t}),o=i.getReader(),e.next=7,new Promise((function(e,t){function r(){o.read().then((function(t){var n=t.value,a=t.done;a||(e(n),r())}),t)}r()}));case 7:return s=e.sent,s.compressionType!==a.CMapCompressionType.NONE&&this.builtInCMapCache.set(t,s),e.abrupt("return",s);case 10:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"buildFormXObject",value:function(){var e=E(n["default"].mark((function e(t,r,i,s,c,l,u){var h,f,d,p,g,m,b,y,w,k;return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(h=r.dict,f=h.getArray("Matrix"),d=h.getArray("BBox"),d=Array.isArray(d)&&4===d.length?a.Util.normalizeRect(d):null,p=null,!h.has("OC")){e.next=10;break}return e.next=8,this.parseMarkedContentProps(h.get("OC"),t);case 8:p=e.sent,s.addOp(a.OPS.beginMarkedContentProps,["OC",p]);case 10:if(g=h.get("Group"),!g){e.next=30;break}if(m={matrix:f,bbox:d,smask:i,isolated:!1,knockout:!1},b=g.get("S"),y=null,!(0,o.isName)(b,"Transparency")){e.next=28;break}if(m.isolated=g.get("I")||!1,m.knockout=g.get("K")||!1,!g.has("CS")){e.next=28;break}if(w=g.getRaw("CS"),k=v.ColorSpace.getCached(w,this.xref,u),!k){e.next=25;break}y=k,e.next=28;break;case 25:return e.next=27,this.parseColorSpace({cs:w,resources:t,localColorSpaceCache:u});case 27:y=e.sent;case 28:i&&i.backdrop&&(y=y||v.ColorSpace.singletons.rgb,i.backdrop=y.getRgb(i.backdrop,0)),s.addOp(a.OPS.beginGroup,[m]);case 30:return s.addOp(a.OPS.paintFormXObjectBegin,[f,d]),e.abrupt("return",this.getOperatorList({stream:r,task:c,resources:h.get("Resources")||t,operatorList:s,initialState:l}).then((function(){s.addOp(a.OPS.paintFormXObjectEnd,[]),g&&s.addOp(a.OPS.endGroup,[m]),p&&s.addOp(a.OPS.endMarkedContent,[])})));case 32:case"end":return e.stop()}}),e,this)})));function t(t,r,n,a,i,o,s){return e.apply(this,arguments)}return t}()},{key:"_sendImgData",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t?[t.data.buffer]:null;return this.parsingType3Font||r?this.handler.send("commonobj",[e,"Image",t],n):this.handler.send("obj",[e,this.pageIndex,"Image",t],n)}},{key:"buildPaintImageXObject",value:function(){var e=E(n["default"].mark((function e(t){var r,i,o,s,c,l,u,h,f,d,p,g,m,v,y,w,k,S,C,A,E,O,T,I,P,_,F,R=this;return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=t.resources,i=t.image,o=t.isInline,s=void 0!==o&&o,c=t.operatorList,l=t.cacheKey,u=t.localImageCache,h=t.localColorSpaceCache,f=i.dict,d=f.objId,p=f.get("Width","W"),g=f.get("Height","H"),p&&(0,a.isNum)(p)&&g&&(0,a.isNum)(g)){e.next=8;break}return(0,a.warn)("Image dimensions are missing, or not numbers."),e.abrupt("return",void 0);case 8:if(m=this.options.maxImageSize,!(-1!==m&&p*g>m)){e.next=12;break}return(0,a.warn)("Image exceeded maximum allowed size and was removed."),e.abrupt("return",void 0);case 12:if(v=f.get("ImageMask","IM")||!1,!v){e.next=25;break}return k=f.get("Width","W"),S=f.get("Height","H"),C=k+7>>3,A=i.getBytes(C*S,!0),E=f.getArray("Decode","D"),y=x.PDFImage.createMask({imgArray:A,width:k,height:S,imageIsFromDecodeStream:i instanceof b.DecodeStream,inverseDecode:!!E&&E[0]>0}),y.cached=!!l,w=[y],c.addOp(a.OPS.paintImageMaskXObject,w),l&&u.set(l,d,{fn:a.OPS.paintImageMaskXObject,args:w}),e.abrupt("return",void 0);case 25:if(O=f.get("SMask","SM")||!1,T=f.get("Mask")||!1,I=200,!s||O||T||!(p+g0&&s.addOp(a.OPS.setGState,[g]),p&&h.set(c,d,g)})));case 9:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"loadFont",value:function(t,r,n){var i,c=this,l=function(){return Promise.resolve(new U({loadedName:"g_font_error",font:new s.ErrorFont('Font "'.concat(t,'" is not available.')),dict:r,extraProperties:c.options.fontExtraProperties}))},u=this.xref;if(r){if(!(0,o.isRef)(r))throw new a.FormatError('The "font" object should be a reference.');i=r}else{var h=n.get("Font");h&&(i=h.getRaw(t))}if(!i){var f='Font "'.concat(t||r&&r.toString(),'" is not available');if(!this.options.ignoreErrors&&!this.parsingType3Font)return(0,a.warn)("".concat(f,".")),l();this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontMissing}),(0,a.warn)("".concat(f," -- attempting to fallback to a default font.")),i=e.fallbackFontDict}if(this.fontCache.has(i))return this.fontCache.get(i);if(r=u.fetchIfRef(i),!(0,o.isDict)(r))return l();if(r.translated)return r.translated;var d,p,g=(0,a.createPromiseCapability)(),m=this.preEvaluateFont(r),v=m.descriptor,b=m.hash,y=(0,o.isRef)(i);if(y&&(d="f".concat(i.toString())),b&&(0,o.isDict)(v)){v.fontAliases||(v.fontAliases=Object.create(null));var w=v.fontAliases;if(w[b]){var k=w[b].aliasRef;if(y&&k&&this.fontCache.has(k))return this.fontCache.putAlias(i,k),this.fontCache.get(i)}else w[b]={fontID:this.idFactory.createFontId()};y&&(w[b].aliasRef=i),d=w[b].fontID}y?this.fontCache.put(i,g.promise):(d||(d=this.idFactory.createFontId()),this.fontCache.put("id_".concat(d),g.promise)),(0,a.assert)(d&&d.startsWith("f"),'The "fontID" must be (correctly) defined.'),r.loadedName="".concat(this.idFactory.getDocId(),"_").concat(d),r.translated=g.promise;try{p=this.translateFont(m)}catch(S){p=Promise.reject(S)}return p.then((function(e){if(void 0!==e.fontType){var t=u.stats.fontTypes;t[e.fontType]=!0}g.resolve(new U({loadedName:r.loadedName,font:e,dict:r,extraProperties:c.options.fontExtraProperties}))}))["catch"]((function(e){c.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontTranslate});try{var t=v&&v.get("FontFile3"),n=t&&t.get("Subtype"),i=(0,s.getFontType)(m.type,n&&n.name),o=u.stats.fontTypes;o[i]=!0}catch(l){}g.resolve(new U({loadedName:r.loadedName,font:new s.ErrorFont(e instanceof Error?e.message:e),dict:r,extraProperties:c.options.fontExtraProperties}))})),g.promise}},{key:"buildPath",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.length-1;if(r||(r=[]),i<0||e.fnArray[i]!==a.OPS.constructPath)n&&((0,a.warn)('Encountered path operator "'.concat(t,'" inside of a text object.')),e.addOp(a.OPS.save,null)),e.addOp(a.OPS.constructPath,[[t],r]),n&&e.addOp(a.OPS.restore,null);else{var o=e.argsArray[i];o[0].push(t),Array.prototype.push.apply(o[1],r)}}},{key:"parseColorSpace",value:function(e){var t=this,r=e.cs,n=e.resources,i=e.localColorSpaceCache;return v.ColorSpace.parseAsync({cs:r,xref:this.xref,resources:n,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:i})["catch"]((function(e){if(e instanceof a.AbortException)return null;if(t.options.ignoreErrors)return t.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorColorSpace}),(0,a.warn)('parseColorSpace - ignoring ColorSpace: "'.concat(e,'".')),null;throw e}))}},{key:"handleColorN",value:function(){var e=E(n["default"].mark((function e(t,r,i,s,c,l,u,h){var d,p,g,m,v,b,y;return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(d=i[i.length-1],!(0,o.isName)(d)||!(p=c.get(d.name))){e.next=16;break}if(g=(0,o.isStream)(p)?p.dict:p,m=g.get("PatternType"),m!==M.TILING){e.next=9;break}return v=s.base?s.base.getRgb(i,0):null,e.abrupt("return",this.handleTilingType(r,v,l,p,g,t,u));case 9:if(m!==M.SHADING){e.next=15;break}return b=g.get("Shading"),y=g.getArray("Matrix"),p=f.Pattern.parseShading(b,y,this.xref,l,this.handler,this._pdfFunctionFactory,h),t.addOp(r,p.getIR()),e.abrupt("return",void 0);case 15:throw new a.FormatError("Unknown PatternType: ".concat(m));case 16:throw new a.FormatError("Unknown PatternName: ".concat(d));case 17:case"end":return e.stop()}}),e,this)})));function t(t,r,n,a,i,o,s,c){return e.apply(this,arguments)}return t}()},{key:"parseMarkedContentProps",value:function(){var e=E(n["default"].mark((function e(t,r){var i,s,c,l,u,h;return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!(0,o.isName)(t)){e.next=5;break}s=r.get("Properties"),i=s.get(t.name),e.next=10;break;case 5:if(!(0,o.isDict)(t)){e.next=9;break}i=t,e.next=10;break;case 9:throw new a.FormatError("Optional content properties malformed.");case 10:if(c=i.get("Type").name,"OCG"!==c){e.next=15;break}return e.abrupt("return",{type:c,id:i.objId});case 15:if("OCMD"!==c){e.next=27;break}if(l=i.get("OCGs"),!Array.isArray(l)&&!(0,o.isDict)(l)){e.next=25;break}return u=[],Array.isArray(l)?i.get("OCGs").forEach((function(e){u.push(e.toString())})):u.push(l.objId),h=null,i.get("VE")&&(h=!0),e.abrupt("return",{type:c,ids:u,policy:(0,o.isName)(i.get("P"))?i.get("P").name:null,expression:h});case 25:if(!(0,o.isRef)(l)){e.next=27;break}return e.abrupt("return",{type:c,id:l.toString()});case 27:return e.abrupt("return",null);case 28:case"end":return e.stop()}}),e)})));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"getOperatorList",value:function(e){var t=this,r=e.stream,n=e.task,i=e.resources,s=e.operatorList,c=e.initialState,l=void 0===c?null:c;if(i=i||o.Dict.empty,l=l||new z,!s)throw new Error('getOperatorList: missing "operatorList" parameter');var u=this,h=this.xref,d=!1,p=new g.LocalImageCache,m=new g.LocalColorSpaceCache,b=new g.LocalGStateCache,y=i.get("XObject")||o.Dict.empty,w=i.get("Pattern")||o.Dict.empty,k=new j(l),S=new G(r,h,k),x=new D;function C(e){for(var t=0,r=S.savedStatesDepth;t0&&s.addOp(a.OPS.setGState,[V]),I=null;continue}}return void c(new Promise((function(e,t){if(!O)throw new a.FormatError("GState must be referred to by name.");var r=i.get("ExtGState");if(!(r instanceof o.Dict))throw new a.FormatError("ExtGState should be a dictionary.");var c=r.get(O);if(!(c instanceof o.Dict))throw new a.FormatError("GState should be a dictionary.");u.setGState({resources:i,gState:c,operatorList:s,cacheKey:O,task:n,stateManager:k,localGStateCache:b,localColorSpaceCache:m}).then(e,t)}))["catch"]((function(e){if(!(e instanceof a.AbortException)){if(u.options.ignoreErrors)return u.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorExtGState}),void(0,a.warn)('getOperatorList - ignoring ExtGState: "'.concat(e,'".'));throw e}})));case a.OPS.moveTo:case a.OPS.lineTo:case a.OPS.curveTo:case a.OPS.curveTo2:case a.OPS.curveTo3:case a.OPS.closePath:case a.OPS.rectangle:u.buildPath(s,P,I,d);continue;case a.OPS.markPoint:case a.OPS.markPointProps:case a.OPS.beginCompat:case a.OPS.endCompat:continue;case a.OPS.beginMarkedContentProps:if(!(0,o.isName)(I[0])){(0,a.warn)("Expected name for beginMarkedContentProps arg0=".concat(I[0]));continue}if("OC"===I[0].name)return void c(u.parseMarkedContentProps(I[1],i).then((function(e){s.addOp(a.OPS.beginMarkedContentProps,["OC",e])}))["catch"]((function(e){if(!(e instanceof a.AbortException)){if(u.options.ignoreErrors)return u.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorMarkedContent}),void(0,a.warn)('getOperatorList - ignoring beginMarkedContentProps: "'.concat(e,'".'));throw e}})));I=[I[0].name];break;case a.OPS.beginMarkedContent:case a.OPS.endMarkedContent:default:if(null!==I){for(g=0,A=I.length;g0&&(t[3]*=r*y.fontMatrix[3])}var n=a.Util.transform(y.ctm,a.Util.transform(y.textMatrix,t));S.transform=n,e.vertical?(S.width=Math.sqrt(n[0]*n[0]+n[1]*n[1]),S.height=0,S.vertical=!0):(S.width=0,S.height=Math.sqrt(n[2]*n[2]+n[3]*n[3]),S.vertical=!1);var i=y.textLineMatrix[0],o=y.textLineMatrix[1],s=Math.sqrt(i*i+o*o);i=y.ctm[0],o=y.ctm[1];var c=Math.sqrt(i*i+o*o);S.textAdvanceScale=c*s,S.lastAdvanceWidth=0,S.lastAdvanceHeight=0;var l=e.spaceWidth/1e3*y.fontSize;return l?(S.spaceWidth=l,S.fakeSpaceMin=l*x,S.fakeMultiSpaceMin=l*C,S.fakeMultiSpaceMax=l*A,S.textRunBreakAllowed=!e.isMonospace):(S.spaceWidth=0,S.fakeSpaceMin=1/0,S.fakeMultiSpaceMin=1/0,S.fakeMultiSpaceMax=0,S.textRunBreakAllowed=!1),S.initialized=!0,S}function R(e){var t,r=0,n=e.length;while(r=32&&t<=127)r++;return r0&&U(d,r.str)}var p=0,g=0;if(t.vertical){var m=c*y.fontMatrix[0];g=m*y.fontSize+f,a+=g}else{var v=c*y.fontMatrix[0];p=(v*y.fontSize+f)*y.textHScale,n+=p}y.translateTextMatrix(p,g),r.str.push(l)}return t.vertical?(r.lastAdvanceHeight=a,r.height+=Math.abs(a)):(r.lastAdvanceWidth=n,r.width+=n),r}function U(e,t){if(!(e0)t.push(" ")}}function z(){S.initialized&&(S.vertical?S.height*=S.textAdvanceScale:S.width*=S.textAdvanceScale,k.items.push(M(S)),S.initialized=!1,S.str.length=0)}function H(){var e=k.items.length;e>0&&(p.enqueue(k,e),k.items=[],k.styles=Object.create(null))}var W=new D;return new Promise((function e(t,r){var s=function(n){H(),Promise.all([n,p.ready]).then((function(){try{e(t,r)}catch(n){r(n)}}),r)};n.ensureNotTerminated(),W.reset();var l,u={},f=[];while(!(l=W.check())){if(f.length=0,u.args=f,!_.read(u))break;y=c.state;var g,m,v=u.fn;switch(f=u.args,0|v){case a.OPS.setFont:var w=f[0].name,x=f[1];if(y.font&&w===y.fontName&&x===y.fontSize)break;return z(),y.fontName=w,y.fontSize=x,void s(L(w,null));case a.OPS.setTextRise:z(),y.textRise=f[0];break;case a.OPS.setHScale:z(),y.textHScale=f[0]/100;break;case a.OPS.setLeading:z(),y.leading=f[0];break;case a.OPS.moveText:var C=!!y.font&&0===(y.font.vertical?f[0]:f[1]);if(g=f[0]-f[1],d&&C&&S.initialized&&g>0&&g<=S.fakeMultiSpaceMax){y.translateTextLineMatrix(f[0],f[1]),S.width+=f[0]-S.lastAdvanceWidth,S.height+=f[1]-S.lastAdvanceHeight,m=f[0]-S.lastAdvanceWidth-(f[1]-S.lastAdvanceHeight),U(m,S.str);break}z(),y.translateTextLineMatrix(f[0],f[1]),y.textMatrix=y.textLineMatrix.slice();break;case a.OPS.setLeadingMoveText:z(),y.leading=-f[1],y.translateTextLineMatrix(f[0],f[1]),y.textMatrix=y.textLineMatrix.slice();break;case a.OPS.nextLine:z(),y.carriageReturn();break;case a.OPS.setTextMatrix:if(g=y.calcTextLineMatrixAdvance(f[0],f[1],f[2],f[3],f[4],f[5]),d&&null!==g&&S.initialized&&g.value>0&&g.value<=S.fakeMultiSpaceMax){y.translateTextLineMatrix(g.width,g.height),S.width+=g.width-S.lastAdvanceWidth,S.height+=g.height-S.lastAdvanceHeight,m=g.width-S.lastAdvanceWidth-(g.height-S.lastAdvanceHeight),U(m,S.str);break}z(),y.setTextMatrix(f[0],f[1],f[2],f[3],f[4],f[5]),y.setTextLineMatrix(f[0],f[1],f[2],f[3],f[4],f[5]);break;case a.OPS.setCharSpacing:y.charSpacing=f[0];break;case a.OPS.setWordSpacing:y.wordSpacing=f[0];break;case a.OPS.beginText:z(),y.textMatrix=a.IDENTITY_MATRIX.slice(),y.textLineMatrix=a.IDENTITY_MATRIX.slice();break;case a.OPS.showSpacedText:if(!c.state.font){E.ensureStateFont(c.state);continue}for(var A,R=f[0],M=0,D=R.length;MS.fakeMultiSpaceMax,q||(S.height+=A)):(g=-g,A=g*y.textHScale,y.translateTextMatrix(A,0),q=S.textRunBreakAllowed&&g>S.fakeMultiSpaceMax,q||(S.width+=A)),q?z():g>0&&U(g,S.str)}break;case a.OPS.showText:if(!c.state.font){E.ensureStateFont(c.state);continue}N(f[0]);break;case a.OPS.nextLineShowText:if(!c.state.font){E.ensureStateFont(c.state);continue}z(),y.carriageReturn(),N(f[0]);break;case a.OPS.nextLineSetSpacingShowText:if(!c.state.font){E.ensureStateFont(c.state);continue}z(),y.wordSpacing=f[0],y.charSpacing=f[1],y.carriageReturn(),N(f[2]);break;case a.OPS.paintXObject:z(),T||(T=i.get("XObject")||o.Dict.empty);var G=f[0].name;if(G&&I.getByName(G))break;return void s(new Promise((function(e,t){if(!G)throw new a.FormatError("XObject must be referred to by name.");var r=T.getRaw(G);if(r instanceof o.Ref){if(I.getByRef(r))return void e();r=O.fetch(r)}if(!(0,o.isStream)(r))throw new a.FormatError("XObject should be a stream");var s=r.dict.get("Subtype");if(!(0,o.isName)(s))throw new a.FormatError("XObject should have a Name subtype");if("Form"!==s.name)return I.set(G,r.dict.objId,!0),void e();var l=c.state.clone(),u=new j(l),f=r.dict.getArray("Matrix");Array.isArray(f)&&6===f.length&&u.transform(f),H();var g={enqueueInvoked:!1,enqueue:function(e,t){this.enqueueInvoked=!0,p.enqueue(e,t)},get desiredSize(){return p.desiredSize},get ready(){return p.ready}};E.getTextContent({stream:r,task:n,resources:r.dict.get("Resources")||i,stateManager:u,normalizeWhitespace:h,combineTextItems:d,sink:g,seenStyles:b}).then((function(){g.enqueueInvoked||I.set(G,r.dict.objId,!0),e()}),t)}))["catch"]((function(e){if(!(e instanceof a.AbortException)){if(!E.options.ignoreErrors)throw e;(0,a.warn)('getTextContent - ignoring XObject: "'.concat(e,'".'))}})));case a.OPS.setGState:if(G=f[0].name,G&&P.getByName(G))break;return void s(new Promise((function(e,t){if(!G)throw new a.FormatError("GState must be referred to by name.");var r=i.get("ExtGState");if(!(r instanceof o.Dict))throw new a.FormatError("ExtGState should be a dictionary.");var n=r.get(G);if(!(n instanceof o.Dict))throw new a.FormatError("GState should be a dictionary.");var s=n.get("Font");if(!s)return P.set(G,n.objId,!0),void e();z(),y.fontName=null,y.fontSize=s[1],L(null,s[0]).then(e,t)}))["catch"]((function(e){if(!(e instanceof a.AbortException)){if(!E.options.ignoreErrors)throw e;(0,a.warn)('getTextContent - ignoring ExtGState: "'.concat(e,'".'))}})))}if(k.items.length>=p.desiredSize){l=!0;break}}l?s(B):(z(),H(),t())}))["catch"]((function(e){if(!(e instanceof a.AbortException)){if(t.options.ignoreErrors)return(0,a.warn)('getTextContent - ignoring errors during "'.concat(n.name,'" ')+'task: "'.concat(e,'".')),z(),void H();throw e}}))}},{key:"extractDataStructures",value:function(e,t,r){var n,i=this,l=this.xref,u=e.get("ToUnicode")||t.get("ToUnicode"),h=u?this.readToUnicode(u):Promise.resolve(void 0);if(r.composite){var f=e.get("CIDSystemInfo");(0,o.isDict)(f)&&(r.cidSystemInfo={registry:(0,a.stringToPDFString)(f.get("Registry")),ordering:(0,a.stringToPDFString)(f.get("Ordering")),supplement:f.get("Supplement")});var d=e.get("CIDToGIDMap");(0,o.isStream)(d)&&(n=d.getBytes())}var p,g=[],m=null;if(e.has("Encoding")){if(p=e.get("Encoding"),(0,o.isDict)(p)){if(m=p.get("BaseEncoding"),m=(0,o.isName)(m)?m.name:null,p.has("Differences"))for(var v=p.get("Differences"),b=0,y=0,w=v.length;y0,r.dict=e,h.then((function(e){return r.toUnicode=e,i.buildToUnicode(r)})).then((function(e){return r.toUnicode=e,n&&(r.cidToGidMap=i.readCidToGidMap(n,e)),r}))}},{key:"_buildSimpleFontToUnicode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,a.assert)(!e.composite,"Must be a simple font.");var r=[],n=e.defaultEncoding.slice(),i=e.baseEncodingName,o=e.differences;for(var l in o){var h=o[l];".notdef"!==h&&(n[l]=h)}var f=(0,y.getGlyphsUnicode)();for(var d in n){var p=n[d];if(""!==p)if(void 0!==f[p])r[d]=String.fromCharCode(f[p]);else{var g=0;switch(p[0]){case"G":3===p.length&&(g=parseInt(p.substring(1),16));break;case"g":5===p.length&&(g=parseInt(p.substring(1),16));break;case"C":case"c":if(p.length>=3&&p.length<=4){var m=p.substring(1);if(t){g=parseInt(m,16);break}if(g=+m,Number.isNaN(g)&&Number.isInteger(parseInt(m,16)))return this._buildSimpleFontToUnicode(e,!0)}break;default:var v=(0,u.getUnicodeForGlyph)(p,f);-1!==v&&(g=v)}if(g>0&&g<=1114111&&Number.isInteger(g)){if(i&&g===+d){var b=(0,c.getEncoding)(i);if(b&&(p=b[d])){r[d]=String.fromCharCode(f[p]);continue}}r[d]=String.fromCodePoint(g)}}}return new s.ToUnicodeMap(r)}},{key:"buildToUnicode",value:function(e){if(e.hasIncludedToUnicodeMap=!!e.toUnicode&&e.toUnicode.length>0,e.hasIncludedToUnicodeMap)return!e.composite&&e.hasEncoding&&(e.fallbackToUnicode=this._buildSimpleFontToUnicode(e)),Promise.resolve(e.toUnicode);if(!e.composite)return Promise.resolve(this._buildSimpleFontToUnicode(e));if(e.composite&&(e.cMap.builtInCMap&&!(e.cMap instanceof i.IdentityCMap)||"Adobe"===e.cidSystemInfo.registry&&("GB1"===e.cidSystemInfo.ordering||"CNS1"===e.cidSystemInfo.ordering||"Japan1"===e.cidSystemInfo.ordering||"Korea1"===e.cidSystemInfo.ordering))){var t=e.cidSystemInfo.registry,r=e.cidSystemInfo.ordering,n=o.Name.get(t+"-"+r+"-UCS2");return i.CMapFactory.create({encoding:n,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}).then((function(t){var r=e.cMap,n=[];return r.forEach((function(e,r){if(r>65535)throw new a.FormatError("Max size of CID is 65,535");var i=t.lookup(r);i&&(n[e]=String.fromCharCode((i.charCodeAt(0)<<8)+i.charCodeAt(1)))})),new s.ToUnicodeMap(n)}))}return Promise.resolve(new s.IdentityToUnicodeMap(e.firstChar,e.lastChar))}},{key:"readToUnicode",value:function(e){var t=this,r=e;return(0,o.isName)(r)?i.CMapFactory.create({encoding:r,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}).then((function(e){return e instanceof i.IdentityCMap?new s.IdentityToUnicodeMap(0,65535):new s.ToUnicodeMap(e.getMap())})):(0,o.isStream)(r)?i.CMapFactory.create({encoding:r,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}).then((function(e){if(e instanceof i.IdentityCMap)return new s.IdentityToUnicodeMap(0,65535);var t=new Array(e.length);return e.forEach((function(e,r){for(var n=[],a=0;a>1;(0!==i||t.has(o))&&(r[o]=i)}return r}},{key:"extractWidths",value:function(e,t,r){var n,a,i,c,l,u,h,f,d=this.xref,p=[],g=0,m=[];if(r.composite){if(g=e.has("DW")?e.get("DW"):1e3,f=e.get("W"),f)for(a=0,i=f.length;al&&(0,a.info)("Command ".concat(i,": expected [0, ").concat(l,"] args, ")+"but received ".concat(u," args."));else{if(u!==l){var h=this.nonProcessedArgs;while(u>l)h.push(r.shift()),u--;while(u=a.OPS.moveTo&&c<=a.OPS.endPath&&++this._numInvalidPathOPS>e.MAX_INVALID_PATH_OPS)throw new a.FormatError("Invalid ".concat(f));(0,a.warn)("Skipping ".concat(f)),null!==r&&(r.length=0);continue}}return this.preprocessCommand(c,r),t.fn=c,t.args=r,!0}if(n===o.EOF)return!1;if(null!==n&&(null===r&&(r=[]),r.push(n),r.length>33))throw new a.FormatError("Too many arguments")}}},{key:"preprocessCommand",value:function(e,t){switch(0|e){case a.OPS.save:this.stateManager.save();break;case a.OPS.restore:this.stateManager.restore();break;case a.OPS.transform:this.stateManager.transform(t);break}}},{key:"savedStatesDepth",get:function(){return this.stateManager.stateStack.length}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CMapFactory=t.IdentityCMap=t.CMap=void 0;var n=l(r(2)),a=r(5),i=r(202),o=r(208),s=r(205),c=r(209);function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,a)}function h(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){u(i,n,a,o,s,"next",e)}function s(e){u(i,n,a,o,s,"throw",e)}o(void 0)}))}}function f(e){return f="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},f(e)}function d(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&&p(e,t)}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function g(e){var t=b();return function(){var r,n=y(e);if(t){var a=y(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return m(this,r)}}function m(e,t){return!t||"object"!==f(t)&&"function"!==typeof t?v(e):t}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k(e,t){for(var r=0;r0&&void 0!==arguments[0]&&arguments[0];w(this,e),this.codespaceRanges=[[],[],[],[]],this.numCodespaceRanges=0,this._map=[],this.name="",this.vertical=!1,this.useCMap=null,this.builtInCMap=t}return S(e,[{key:"addCodespaceRange",value:function(e,t,r){this.codespaceRanges[e-1].push(t,r),this.numCodespaceRanges++}},{key:"mapCidRange",value:function(e,t,r){if(t-e>C)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");while(e<=t)this._map[e++]=r++}},{key:"mapBfRange",value:function(e,t,r){if(t-e>C)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");var n=r.length-1;while(e<=t)this._map[e++]=r,r=r.substring(0,n)+String.fromCharCode(r.charCodeAt(n)+1)}},{key:"mapBfRangeToArray",value:function(e,t,r){if(t-e>C)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");var n=r.length,a=0;while(e<=t&&a>>0;for(var s=a[i],c=0,l=s.length;c=u&&n<=h)return r.charcode=n,void(r.length=i+1)}}r.charcode=0,r.length=1}},{key:"length",get:function(){return this._map.length}},{key:"isIdentityCMap",get:function(){if("Identity-H"!==this.name&&"Identity-V"!==this.name)return!1;if(65536!==this._map.length)return!1;for(var e=0;e<65536;e++)if(this._map[e]!==e)return!1;return!0}}]),e}();t.CMap=A;var E=function(e){d(r,e);var t=g(r);function r(e,n){var a;return w(this,r),a=t.call(this),a.vertical=e,a.addCodespaceRange(n,0,65535),a}return S(r,[{key:"mapCidRange",value:function(e,t,r){(0,a.unreachable)("should not call mapCidRange")}},{key:"mapBfRange",value:function(e,t,r){(0,a.unreachable)("should not call mapBfRange")}},{key:"mapBfRangeToArray",value:function(e,t,r){(0,a.unreachable)("should not call mapBfRangeToArray")}},{key:"mapOne",value:function(e,t){(0,a.unreachable)("should not call mapCidOne")}},{key:"lookup",value:function(e){return Number.isInteger(e)&&e<=65535?e:void 0}},{key:"contains",value:function(e){return Number.isInteger(e)&&e<=65535}},{key:"forEach",value:function(e){for(var t=0;t<=65535;t++)e(t,t)}},{key:"charCodeOf",value:function(e){return Number.isInteger(e)&&e<=65535?e:-1}},{key:"getMap",value:function(){for(var e=new Array(65536),t=0;t<=65535;t++)e[t]=t;return e}},{key:"length",get:function(){return 65536}},{key:"isIdentityCMap",get:function(){(0,a.unreachable)("should not access .isIdentityCMap")}}]),r}(A);t.IdentityCMap=E;var O=function(){function e(e,t){for(var r=0,n=0;n<=t;n++)r=r<<8|e[n];return r>>>0}function t(e,t){return 1===t?String.fromCharCode(e[0],e[1]):3===t?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode.apply(null,e.subarray(0,t+1))}function r(e,t,r){for(var n=0,a=r;a>=0;a--)n+=e[a]+t[a],e[a]=255&n,n>>=8}function n(e,t){for(var r=1,n=t;n>=0&&r>0;n--)r+=e[n],e[n]=255&r,r>>=8}var i=16,o=19;function s(e){this.buffer=e,this.pos=0,this.end=e.length,this.tmpBuf=new Uint8Array(o)}function c(a,o,c){return new Promise((function(l,u){var h=new s(a),f=h.readByte();o.vertical=!!(1&f);var d,p,g=null,m=new Uint8Array(i),v=new Uint8Array(i),b=new Uint8Array(i),y=new Uint8Array(i),w=new Uint8Array(i);while((p=h.readByte())>=0){var k=p>>5;if(7!==k){var S=!!(16&p),x=15&p;if(x+1>i)throw new Error("processBinaryCMap: Invalid dataSize.");var C,A=1,E=h.readNumber();switch(k){case 0:for(h.readHex(m,x),h.readHexNumber(v,x),r(v,m,x),o.addCodespaceRange(x+1,e(m,x),e(v,x)),C=1;C=this.end?-1:this.buffer[this.pos++]},readNumber:function(){var e,t=0;do{var r=this.readByte();if(r<0)throw new a.FormatError("unexpected EOF in bcmap");e=!(128&r),t=t<<7|127&r}while(!e);return t},readSigned:function(){var e=this.readNumber();return 1&e?~(e>>>1):e>>>1},readHex:function(e,t){e.set(this.buffer.subarray(this.pos,this.pos+t+1)),this.pos+=t+1},readHexNumber:function(e,t){var r,n=this.tmpBuf,i=0;do{var o=this.readByte();if(o<0)throw new a.FormatError("unexpected EOF in bcmap");r=!(128&o),n[i++]=127&o}while(!r);var s=t,c=0,l=0;while(s>=0){while(l<8&&n.length>0)c=n[--i]<>=8,l-=8}},readHexSigned:function(e,t){this.readHexNumber(e,t);for(var r=1&e[t]?255:0,n=0,a=0;a<=t;a++)n=(1&n)<<8|e[a],e[a]=n>>1^r},readString:function(){for(var e=this.readNumber(),t="",r=0;r>>0}function t(e){if(!(0,a.isString)(e))throw new a.FormatError("Malformed CMap: expected string.")}function r(e){if(!Number.isInteger(e))throw new a.FormatError("Malformed CMap: expected int.")}function l(r,n){while(1){var a=n.getObj();if((0,i.isEOF)(a))break;if((0,i.isCmd)(a,"endbfchar"))return;t(a);var o=e(a);a=n.getObj(),t(a);var s=a;r.mapOne(o,s)}}function u(r,n){while(1){var o=n.getObj();if((0,i.isEOF)(o))break;if((0,i.isCmd)(o,"endbfrange"))return;t(o);var s=e(o);o=n.getObj(),t(o);var c=e(o);if(o=n.getObj(),Number.isInteger(o)||(0,a.isString)(o)){var l=Number.isInteger(o)?String.fromCharCode(o):o;r.mapBfRange(s,c,l)}else{if(!(0,i.isCmd)(o,"["))break;o=n.getObj();var u=[];while(!(0,i.isCmd)(o,"]")&&!(0,i.isEOF)(o))u.push(o),o=n.getObj();r.mapBfRangeToArray(s,c,u)}}throw new a.FormatError("Invalid bf range.")}function f(n,a){while(1){var o=a.getObj();if((0,i.isEOF)(o))break;if((0,i.isCmd)(o,"endcidchar"))return;t(o);var s=e(o);o=a.getObj(),r(o);var c=o;n.mapOne(s,c)}}function d(n,a){while(1){var o=a.getObj();if((0,i.isEOF)(o))break;if((0,i.isCmd)(o,"endcidrange"))return;t(o);var s=e(o);o=a.getObj(),t(o);var c=e(o);o=a.getObj(),r(o);var l=o;n.mapCidRange(s,c,l)}}function p(t,r){while(1){var n=r.getObj();if((0,i.isEOF)(n))break;if((0,i.isCmd)(n,"endcodespacerange"))return;if(!(0,a.isString)(n))break;var o=e(n);if(n=r.getObj(),!(0,a.isString)(n))break;var s=e(n);t.addCodespaceRange(n.length,o,s)}throw new a.FormatError("Invalid codespace range.")}function g(e,t){var r=t.getObj();Number.isInteger(r)&&(e.vertical=!!r)}function m(e,t){var r=t.getObj();(0,i.isName)(r)&&(0,a.isString)(r.name)&&(e.name=r.name)}function v(e,t,r,n){var o,c;e:while(1)try{var h=t.getObj();if((0,i.isEOF)(h))break;if((0,i.isName)(h))"WMode"===h.name?g(e,t):"CMapName"===h.name&&m(e,t),o=h;else if((0,i.isCmd)(h))switch(h.cmd){case"endcmap":break e;case"usecmap":(0,i.isName)(o)&&(c=o.name);break;case"begincodespacerange":p(e,t);break;case"beginbfchar":l(e,t);break;case"begincidchar":f(e,t);break;case"beginbfrange":u(e,t);break;case"begincidrange":d(e,t);break}}catch(v){if(v instanceof s.MissingDataException)throw v;(0,a.warn)("Invalid cMap data: "+v);continue}return!n&&c&&(n=c),n?b(e,r,n):Promise.resolve(e)}function b(e,t,r){return y(r,t).then((function(t){if(e.useCMap=t,0===e.numCodespaceRanges){for(var r=e.useCMap.codespaceRanges,n=0;n=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r["return"]||r["return"]()}finally{if(s)throw i}}}}function g(e,t){return w(e)||y(e,t)||v(e,t)||m()}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(e,t){if(e){if("string"===typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:[];this._map=e}return e.prototype={get length(){return this._map.length},forEach:function(e){for(var t in this._map)e(t,this._map[t].charCodeAt(0))},has:function(e){return void 0!==this._map[e]},get:function(e){return this._map[e]},charCodeOf:function(e){var t=this._map;if(t.length<=65536)return t.indexOf(e);for(var r in t)if(t[r]===e)return 0|r;return-1},amend:function(e){for(var t in e)this._map[t]=e[t]}},e}();t.ToUnicodeMap=R;var M=function(){function e(e,t){this.firstChar=e,this.lastChar=t}return e.prototype={get length(){return this.lastChar+1-this.firstChar},forEach:function(e){for(var t=this.firstChar,r=this.lastChar;t<=r;t++)e(t,t)},has:function(e){return this.firstChar<=e&&e<=this.lastChar},get:function(e){if(this.firstChar<=e&&e<=this.lastChar)return String.fromCharCode(e)},charCodeOf:function(e){return Number.isInteger(e)&&e>=this.firstChar&&e<=this.lastChar?e:-1},amend:function(e){(0,n.unreachable)("Should not call amend()")}},e}();t.IdentityToUnicodeMap=M;var B=function(){function e(e,t,r){e[t]=r>>8&255,e[t+1]=255&r}function t(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}function r(e,t,r){var n,a;if(r instanceof Uint8Array)e.set(r,t);else if("string"===typeof r)for(n=0,a=r.length;nr)r<<=1,n++;var a=r*t;return{range:a,entry:n,rangeShift:t*e-a}};var i=12,o=16;return a.prototype={toArray:function(){var s=this.sfnt,c=this.tables,u=Object.keys(c);u.sort();var h,f,d,p,g,m=u.length,v=i+m*o,b=[v];for(h=0;h>>0;v+=y,b.push(v)}var w=new Uint8Array(v);for(h=0;h>>0}t(w,v+4,S),t(w,v+8,b[h]),t(w,v+12,c[g].length),v+=o}return w},addTable:function(e,t){if(e in this.tables)throw new Error("Table "+e+" already exists");this.tables[e]=t}},a}(),L=function(){function e(e,t,r){var a;this.name=e,this.loadedName=r.loadedName,this.isType3Font=r.isType3Font,this.missingFile=!1,this.glyphCache=Object.create(null),this.isSerifFont=!!(r.flags&E.Serif),this.isSymbolicFont=!!(r.flags&E.Symbolic),this.isMonospace=!!(r.flags&E.FixedPitch);var i=r.type,o=r.subtype;this.type=i,this.subtype=o;var s="sans-serif";if(this.isMonospace?s="monospace":this.isSerifFont&&(s="serif"),this.fallbackName=s,this.differences=r.differences,this.widths=r.widths,this.defaultWidth=r.defaultWidth,this.composite=r.composite,this.cMap=r.cMap,this.ascent=r.ascent/S,this.descent=r.descent/S,this.fontMatrix=r.fontMatrix,this.bbox=r.bbox,this.defaultEncoding=r.defaultEncoding,this.toUnicode=r.toUnicode,this.fallbackToUnicode=r.fallbackToUnicode||new R,this.toFontChar=[],"Type3"!==r.type){if(this.cidEncoding=r.cidEncoding,this.vertical=!!r.vertical,this.vertical&&(this.vmetrics=r.vmetrics,this.defaultVMetrics=r.defaultVMetrics),!t||t.isEmpty)return t&&(0,n.warn)('Font file is empty in "'+e+'" ('+this.loadedName+")"),void this.fallbackToSystemFont();var c=q(t,r),l=g(c,2);i=l[0],o=l[1],i===this.type&&o===this.subtype||(0,n.info)("Inconsistent font file Type/SubType, expected: "+"".concat(this.type,"/").concat(this.subtype," but found: ").concat(i,"/").concat(o,"."));try{var u;switch(i){case"MMType1":(0,n.info)("MMType1 font ("+e+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";var h="Type1C"===o||"CIDFontType0C"===o?new j(t,r):new U(e,t,r);T(r),u=this.convert(e,h,r);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype",u=this.checkAndRepair(e,t,r),this.isOpenType&&(T(r),i="OpenType");break;default:throw new n.FormatError("Font ".concat(i," is not supported"))}}catch(f){return(0,n.warn)(f),void this.fallbackToSystemFont()}this.data=u,this.fontType=P(i,o),this.fontMatrix=r.fontMatrix,this.widths=r.widths,this.defaultWidth=r.defaultWidth,this.toUnicode=r.toUnicode,this.seacMap=r.seacMap}else{for(a=0;a<256;a++)this.toFontChar[a]=this.differences[a]||r.defaultEncoding[a];this.fontType=n.FontType.TYPE3}}function t(e,t){return(e<<8)+t}function r(e,t,r){e[t+1]=r,e[t]=r>>>8}function d(e,t){var r=(e<<8)+t;return 32768&r?r-65536:r}function m(e,t,r,n){return(e<<24)+(t<<16)+(r<<8)+n}function v(e){return String.fromCharCode(e>>8&255,255&e)}function b(e){return e>32767?e=32767:e<-32768&&(e=-32768),String.fromCharCode(e>>8&255,255&e)}function y(e){var t=e.peekBytes(4);return 65536===(0,l.readUint32)(t,0)||"true"===(0,n.bytesToString)(t)}function w(e){var t=e.peekBytes(4);return"ttcf"===(0,n.bytesToString)(t)}function L(e){var t=e.peekBytes(4);return"OTTO"===(0,n.bytesToString)(t)}function D(e){var t=e.peekBytes(2);return 37===t[0]&&33===t[1]||128===t[0]&&1===t[1]}function N(e){var t=e.peekBytes(4);return t[0]>=1&&t[3]>=1&&t[3]<=4}function q(e,t){var r,a,i=t.type,o=t.subtype,s=t.composite;return y(e)||w(e)?r=s?"CIDFontType2":"TrueType":L(e)?r=s?"CIDFontType2":"OpenType":D(e)?r=s?"CIDFontType0":"MMType1"===i?"MMType1":"Type1":N(e)?s?(r="CIDFontType0",a="CIDFontType0C"):(r="MMType1"===i?"MMType1":"Type1",a="Type1C"):((0,n.warn)("getFontFileType: Unable to detect correct font file Type/Subtype."),r=i,a=o),[r,a]}function z(e,t,r){for(var n,a=[],i=0,o=e.length;ic){if(o++,o>=k.length){(0,n.warn)("Ran out of space in font private use area.");break}s=k[o][0],c=k[o][1]}var h=s++;0===u&&(u=r),a[h]=u,i[l]=h}}return{toFontChar:i,charCodeToGlyphId:a,nextAvailableFontCharCode:s}}function H(e,t){var r=[];for(var n in e)e[n]>=t||r.push({fontCharCode:0|n,glyphId:e[n]});0===r.length&&r.push({fontCharCode:0,glyphId:0}),r.sort((function(e,t){return e.fontCharCode-t.fontCharCode}));for(var a=[],i=r.length,o=0;o65535?2:1,l="\0\0"+v(c)+"\0\0"+(0,n.string32)(4+8*c);for(r=s.length-1;r>=0;--r)if(s[r][0]<=65535)break;var u=r+1;s[r][0]<65535&&65535===s[r][1]&&(s[r][1]=65534);var h,f,d,p,g=s[r][1]<65535?1:0,m=u+g,b=B.getSearchParams(m,2),y="",w="",k="",S="",x="",C=0;for(r=0,a=u;r0&&(w+="ÿÿ",y+="ÿÿ",k+="\0",S+="\0\0");var T="\0\0"+v(2*m)+v(b.range)+v(b.entry)+v(b.rangeShift)+w+"\0\0"+y+k+S+x,I="",P="";if(c>1){for(l+="\0\0\n"+(0,n.string32)(4+8*c+4+T.length),I="",r=0,a=s.length;ri)return!1;t.skip(6);var o=t.getUint16();return 0!==o&&(e.data[8]=e.data[9]=0,!0)}function V(e,t,r){r=r||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};var a=0,i=0,o=0,s=0,l=null,u=0;if(t){for(var h in t){h|=0,(l>h||!l)&&(l=h),u 123 are reserved for internal usage");s|=1<65535&&(u=65535)}else l=0,u=255;var d=e.bbox||[0,0,0,0],p=r.unitsPerEm||1/(e.fontMatrix||n.FONT_IDENTITY_MATRIX)[0],g=e.ascentScaled?1:p/S,m=r.ascent||Math.round(g*(e.ascent||d[3])),b=r.descent||Math.round(g*(e.descent||d[1]));b>0&&e.descent>0&&d[1]<0&&(b=-b);var y=r.yMax||m,w=-r.yMin||-b;return"\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0"+String.fromCharCode(e.fixedPitch?9:0)+"\0\0\0\0\0\0"+(0,n.string32)(a)+(0,n.string32)(i)+(0,n.string32)(o)+(0,n.string32)(s)+"*21*"+v(e.italicAngle?1:0)+v(l||e.firstChar)+v(u||e.lastChar)+v(m)+v(b)+"\0d"+v(y)+v(w)+"\0\0\0\0\0\0\0\0"+v(e.xHeight)+v(e.capHeight)+v(0)+v(l||e.firstChar)+"\0"}function Y(e){var t=Math.floor(e.italicAngle*Math.pow(2,16));return"\0\0\0"+(0,n.string32)(t)+"\0\0\0\0"+(0,n.string32)(e.fixedPitch)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function K(e,t){t||(t=[[],[]]);var r,n,a,i,o,s=[t[0][0]||"Original licence",t[0][1]||e,t[0][2]||"Unknown",t[0][3]||"uniqueID",t[0][4]||e,t[0][5]||"Version 0.11",t[0][6]||"",t[0][7]||"Unknown",t[0][8]||"Unknown",t[0][9]||"Unknown"],c=[];for(r=0,n=s.length;r0&&void 0!==arguments[0]&&arguments[0],a=n?[].concat(C,A):C,i=Object.create(null),o=p(a);try{for(o.s();!(r=o.n()).done;)e=r.value,t=this[e],void 0!==t&&(i[e]=t)}catch(s){o.e(s)}finally{o.f()}return i},fallbackToSystemFont:function(){var e=this;this.missingFile=!0;var t=this.name,r=this.type,a=this.subtype,l=t.replace(/[,_]/g,"-").replace(/\s/g,""),u=(0,s.getStdFontMap)(),h=(0,s.getNonStdFontMap)(),f=!!u[l]||!(!h[l]||!u[h[l]]);if(l=u[l]||h[l]||l,this.bold=-1!==l.search(/bold/gi),this.italic=-1!==l.search(/oblique/gi)||-1!==l.search(/italic/gi),this.black=-1!==t.search(/Black/g),this.remeasure=Object.keys(this.widths).length>0,f&&"CIDFontType2"===r&&this.cidEncoding.startsWith("Identity-")){var d=(0,s.getGlyphMapForStandardFonts)(),p=[];for(var g in d)p[+g]=d[g];if(/Arial-?Black/i.test(t)){var m=(0,s.getSupplementalGlyphMapForArialBlack)();for(var v in m)p[+v]=m[v]}else if(/Calibri/i.test(t)){var b=(0,s.getSupplementalGlyphMapForCalibri)();for(var y in b)p[+y]=b[y]}var w=this.toUnicode instanceof M;w||this.toUnicode.forEach((function(e,t){p[+e]=t})),this.toFontChar=p,this.toUnicode=new R(p)}else if(/Symbol/i.test(l))this.toFontChar=z(o.SymbolSetEncoding,(0,i.getGlyphsUnicode)(),this.differences);else if(/Dingbats/i.test(l))/Wingdings/i.test(t)&&(0,n.warn)("Non-embedded Wingdings font, falling back to ZapfDingbats."),this.toFontChar=z(o.ZapfDingbatsEncoding,(0,i.getDingbatsGlyphsUnicode)(),this.differences);else if(f)this.toFontChar=z(this.defaultEncoding,(0,i.getGlyphsUnicode)(),this.differences);else{var k=(0,i.getGlyphsUnicode)(),S=[];if(this.toUnicode.forEach((function(t,r){if(!e.composite){var n=e.differences[t]||e.defaultEncoding[t],a=(0,c.getUnicodeForGlyph)(n,k);-1!==a&&(r=a)}S[+t]=r})),this.composite&&this.toUnicode instanceof M&&/Verdana/i.test(t)){var x=(0,s.getGlyphMapForStandardFonts)();for(var C in x)S[+C]=x[C]}this.toFontChar=S}this.loadedName=l.split("-")[0],this.fontType=P(r,a)},checkAndRepair:function(e,s,c){var l=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function u(e,t){var r=Object.create(null);r["OS/2"]=null,r.cmap=null,r.head=null,r.hhea=null,r.hmtx=null,r.maxp=null,r.name=null,r.post=null;for(var n=0;n>>0,a=e.getInt32()>>>0,i=e.getInt32()>>>0,o=e.pos;e.pos=e.start?e.start:0,e.skip(a);var s=e.getBytes(i);return e.pos=o,"head"===t&&(s[8]=s[9]=s[10]=s[11]=0,s[17]|=32),{tag:t,checksum:r,length:i,offset:a,data:s}}function g(e){return{version:(0,n.bytesToString)(e.getBytes(4)),numTables:e.getUint16(),searchRange:e.getUint16(),entrySelector:e.getUint16(),rangeShift:e.getUint16()}}function v(e){var t=(0,n.bytesToString)(e.getBytes(4));(0,n.assert)("ttcf"===t,"Must be a TrueType Collection font.");for(var r=e.getUint16(),a=e.getUint16(),i=e.getInt32()>>>0,o=[],s=0;s>>0);var c={ttcTag:t,majorVersion:r,minorVersion:a,numFonts:i,offsetTable:o};switch(r){case 1:return c;case 2:return c.dsigTag=e.getInt32()>>>0,c.dsigLength=e.getInt32()>>>0,c.dsigOffset=e.getInt32()>>>0,c}throw new n.FormatError("Invalid TrueType Collection majorVersion: ".concat(r,"."))}function b(e,t){for(var r=v(e),a=r.numFonts,i=r.offsetTable,o=0;o>>0,p=!1;if((!s||s.platformId!==h||s.encodingId!==f)&&(0!==h||0!==f&&1!==f&&3!==f?1===h&&0===f?p=!0:3!==h||1!==f||!a&&s?r&&3===h&&0===f&&(p=!0,l=!0):(p=!0,r||(l=!0)):p=!0,p&&(s={platformId:h,encodingId:f,offset:d}),l))break}if(s&&(t.pos=o+s.offset),!s||-1===t.peekByte())return(0,n.warn)("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};var g=t.getUint16();t.skip(4);var m,v,b=!1,y=[];if(0===g){for(m=0;m<256;m++){var w=t.getByte();w&&y.push({charCode:m,glyphId:w})}b=!0}else if(4===g){var k=t.getUint16()>>1;t.skip(6);var S,x=[];for(S=0;S>1)-(k-S);i.offsetIndex=E,C=Math.max(C,E+i.end-i.start+1)}else i.offsetIndex=-1}var O=[];for(m=0;ma&&((0,n.info)("The numOfMetrics ("+o+") should not be greater than the numGlyphs ("+a+")"),o=a,t.data[34]=(65280&o)>>8,t.data[35]=255&o);var s=a-o,c=s-(r.length-4*o>>1);if(c>0){var l=new Uint8Array(r.length+2*c);l.set(r.data),i&&(l[r.length]=r.data[2],l[r.length+1]=r.data[3]),r.data=l}}else r&&(r.data=null)}function S(e,t,n,a,i,o){var s={length:0,sizeOfInstructions:0};if(n-t<=12)return s;var c=e.subarray(t,n),l=d(c[0],c[1]);if(l<0)return l=-1,r(c,0,l),a.set(c,i),s.length=c.length,s;var u,h=10,f=0;for(u=0;uc.length?s:!o&&m>0?(a.set(c.subarray(0,g),i),a.set([0,0],i+g),a.set(c.subarray(v,C),i+g+2),C-=m,c.length-C>3&&(C=C+3&-4),s.length=C,s):c.length-C>3?(C=C+3&-4,a.set(c.subarray(0,C),i),s.length=C,s):(a.set(c,i),s.length=c.length,s)}function C(e,r,a){var i=e.data,o=m(i[0],i[1],i[2],i[3]);o>>16!==1&&((0,n.info)("Attempting to fix invalid version in head table: "+o),i[0]=0,i[1]=1,i[2]=0,i[3]=0);var s=t(i[50],i[51]);if(s<0||s>1){(0,n.info)("Attempting to fix invalid indexToLocFormat in head table: "+s);var c=r+1;if(a===c<<1)i[50]=0,i[51]=0;else{if(a!==c<<2)throw new n.FormatError("Could not fix indexToLocFormat: "+s);i[50]=0,i[51]=1}}}function A(e,t,r,n,a,i,o){var s,c,l;n?(s=4,c=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]},l=function(e,t,r){e[t]=r>>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}):(s=2,c=function(e,t){return e[t]<<9|e[t+1]<<1},l=function(e,t,r){e[t]=r>>9&255,e[t+1]=r>>1&255});var u=i?r+1:r,h=s*(1+u),f=new Uint8Array(h);f.set(e.data.subarray(0,h)),e.data=f;var d,p,g=t.data,m=g.length,v=new Uint8Array(m),b=[];for(d=0,p=0;dm&&(y=m),b.push({index:d,offset:y,endOffset:0})}for(b.sort((function(e,t){return e.offset-t.offset})),d=0;do&&(o=x.sizeOfInstructions),k+=C,l(f,p,k)}if(0===k){var A=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(d=0,p=s;dE+k?t.data=v.subarray(0,E+k):(t.data=new Uint8Array(E+k),t.data.set(v.subarray(0,k))),t.data.set(v.subarray(0,E),k),l(e.data,f.length-s,k+E)}else t.data=v.subarray(0,k);return{missingGlyphs:w,maxSizeOfInstructions:o}}function E(e,t,r){var a=(s.start?s.start:0)+e.offset;s.pos=a;var i,o=e.length,c=a+o,l=s.getInt32();s.skip(28);var u,h=!0;switch(l){case 65536:i=O;break;case 131072:var f=s.getUint16();if(f!==r){h=!1;break}var d=[];for(u=0;u=32768){h=!1;break}d.push(p)}if(!h)break;var g=[],m=[];while(s.posi)){s.pos=v;var b=m.name;if(m.encoding){for(var y="",w=0,k=m.length;w0&&(l+=k-1)}}else(m||b)&&((0,n.warn)("TT: nested FDEFs not allowed"),g=!0),m=!0,h=l,o=f.pop(),t.functionsDefined[o]={data:c,i:l};else if(!m&&!b)if(o=f[f.length-1],isNaN(o))(0,n.info)("TT: CALL empty stack (or invalid entry).");else if(t.functionsUsed[o]=!0,o in t.functionsStackDeltas){var S=f.length+t.functionsStackDeltas[o];if(S<0)return(0,n.warn)("TT: CALL invalid functions stack delta."),void(t.hintsValid=!1);f.length=S}else if(o in t.functionsDefined&&!p.includes(o)){if(d.push({data:c,i:l,stackTop:f.length-1}),p.push(o),s=t.functionsDefined[o],!s)return(0,n.warn)("TT: CALL non-existent function"),void(t.hintsValid=!1);c=s.data,l=s.i}if(!m&&!b){var x=0;w<=142?x=L[w]:w>=192&&w<=223?x=-1:w>=224&&(x=-2),w>=113&&w<=117&&(a=f.pop(),isNaN(a)||(x=2*-a));while(x<0&&f.length>0)f.pop(),x++;while(x>0)f.push(NaN),x--}}t.tooComplexToFollowFunctions=g;var C=[c];l>c.length&&C.push(new Uint8Array(l-c.length)),h>u&&((0,n.warn)("TT: complementing a missing function tail"),C.push(new Uint8Array([34,45]))),U(e,C)}function N(e,t){if(!e.tooComplexToFollowFunctions){if(e.functionsDefined.length>t)return(0,n.warn)("TT: more functions defined than expected"),void(e.hintsValid=!1);for(var r=0,a=e.functionsUsed.length;rt)return(0,n.warn)("TT: invalid function id: "+r),void(e.hintsValid=!1);if(e.functionsUsed[r]&&!e.functionsDefined[r])return(0,n.warn)("TT: undefined function: "+r),void(e.hintsValid=!1)}}}function U(e,t){if(t.length>1){var r,n,a=0;for(r=0,n=t.length;r0||!(c.cMap instanceof h.IdentityCMap));if("OTTO"===P.version&&!J||!F.head||!F.hhea||!F.maxp||!F.post)return M=new f.Stream(F["CFF "].data),R=new j(M,c),T(c),this.convert(e,R,c);delete F.glyf,delete F.loca,delete F.fpgm,delete F.prep,delete F["cvt "],this.isOpenType=!0}if(!F.maxp)throw new n.FormatError('Required "maxp" table is not found');s.pos=(s.start||0)+F.maxp.offset;var Z=s.getInt32(),Q=s.getUint16(),$=Q+1,ee=!0;$>65535&&(ee=!1,$=Q,(0,n.warn)("Not enough space in glyfs to duplicate first glyph."));var te=0,re=0;if(Z>=65536&&F.maxp.length>=22){s.pos+=8;var ne=s.getUint16();ne>2&&(F.maxp.data[14]=0,F.maxp.data[15]=2),s.pos+=4,te=s.getUint16(),s.pos+=4,re=s.getUint16()}F.maxp.data[4]=$>>8,F.maxp.data[5]=255&$;var ae=q(F.fpgm,F.prep,F["cvt "],te);if(ae||(delete F.fpgm,delete F.prep,delete F["cvt "]),k(s,F.hhea,F.hmtx,$,ee),!F.head)throw new n.FormatError('Required "head" table is not found');C(F.head,Q,H?F.loca.length:0);var ie=Object.create(null);if(H){var oe=t(F.head.data[50],F.head.data[51]),se=A(F.loca,F.glyf,Q,oe,ae,ee,re);ie=se.missingGlyphs,Z>=65536&&F.maxp.length>=22&&(F.maxp.data[26]=se.maxSizeOfInstructions>>8,F.maxp.data[27]=255&se.maxSizeOfInstructions)}if(!F.hhea)throw new n.FormatError('Required "hhea" table is not found');0===F.hhea.data[10]&&0===F.hhea.data[11]&&(F.hhea.data[10]=255,F.hhea.data[11]=255);var ce={unitsPerEm:t(F.head.data[18],F.head.data[19]),yMax:t(F.head.data[42],F.head.data[43]),yMin:d(F.head.data[38],F.head.data[39]),ascent:t(F.hhea.data[4],F.hhea.data[5]),descent:d(F.hhea.data[6],F.hhea.data[7])};this.ascent=ce.ascent/ce.unitsPerEm,this.descent=ce.descent/ce.unitsPerEm,F.post&&E(F.post,c,Q),F.post={tag:"post",data:Y(c)};var le=[];function ue(e){return!ie[e]}if(c.composite){var he=c.cidToGidMap||[],fe=0===he.length;c.cMap.forEach((function(e,t){if(t>65535)throw new n.FormatError("Max size of CID is 65,535");var r=-1;fe?r=t:void 0!==he[t]&&(r=he[t]),r>=0&&r=61440&&Oe<=61695&&(Oe&=255),le[Oe]=me[Ee].glyphId}if(c.glyphNames&&be.length)for(var Te=0;Te<256;++Te)if(void 0===le[Te]&&be[Te]){ke=be[Te];var Ie=c.glyphNames.indexOf(ke);Ie>0&&ue(Ie)&&(le[Te]=Ie)}}0===le.length&&(le[0]=0);var Pe=$-1;ee||(Pe=0);var _e=G(le,ue,Pe);if(this.toFontChar=_e.toFontChar,F.cmap={tag:"cmap",data:W(_e.charCodeToGlyphId,$)},F["OS/2"]&&X(F["OS/2"],s)||(F["OS/2"]={tag:"OS/2",data:V(c,_e.charCodeToGlyphId,ce)}),!H)try{M=new f.Stream(F["CFF "].data);var Fe=new a.CFFParser(M,c,x);R=Fe.parse(),R.duplicateFirstGlyph();var Re=new a.CFFCompiler(R);F["CFF "].data=Re.compile()}catch(De){(0,n.warn)("Failed to compile font "+c.loadedName)}if(F.name){var Me=I(F.name);F.name.data=K(e,Me)}else F.name={tag:"name",data:K(this.name)};var Be=new B(P.version);for(var Le in F)Be.addTable(Le,F[Le].data);return Be.toArray()},convert:function(e,t,r){r.fixedPitch=!1,r.builtInEncoding&&I(r,r.builtInEncoding);var a=1;t instanceof j&&(a=t.numGlyphs-1);var i=t.getGlyphMapping(r),s=G(i,t.hasGlyphId.bind(t),a);this.toFontChar=s.toFontChar;var c=t.numGlyphs;function l(e,t){var r=null;for(var n in e)t===e[n]&&(r||(r=[]),r.push(0|n));return r}function u(e,t){for(var r in e)if(t===e[r])return 0|r;return s.charCodeToGlyphId[s.nextAvailableFontCharCode]=t,s.nextAvailableFontCharCode++}var h=t.seacs;if(x&&h&&h.length){var f=r.fontMatrix||n.FONT_IDENTITY_MATRIX,d=t.getCharset(),p=Object.create(null);for(var g in h){g|=0;var m=h[g],y=o.StandardEncoding[m[2]],w=o.StandardEncoding[m[3]],k=d.indexOf(y),S=d.indexOf(w);if(!(k<0||S<0)){var C={x:m[0]*f[0]+m[1]*f[2]+f[4],y:m[0]*f[1]+m[1]*f[3]+f[5]},A=l(i,g);if(A)for(var E=0,O=A.length;E=0?n:0;else if(l)for(a in t)c[a]=t[a];else for(s=o.StandardEncoding,a=0;a=0?n:0;var u,h=e.differences;if(h)for(a in h){var f=h[a];if(n=r.indexOf(f),-1===n){u||(u=(0,i.getGlyphsUnicode)());var d=_(f,u);d!==f&&(n=r.indexOf(d))}c[a]=n>=0?n:0}return c}t.ErrorFont=D;var U=function(){function e(e,t,r){var n,a=e.length,i=t.length,o=a-i,s=r,c=!1;while(s=i){s+=n;while(s=0&&(l[u]=o)}return N(e,l,s)},hasGlyphId:function(e){if(e<0||e>=this.numGlyphs)return!1;if(0===e)return!0;var t=this.charstrings[e-1];return t.charstring.length>0},getSeacs:function(e){var t,r,n=[];for(t=0,r=e.length;t0;w--)y[w]-=y[w-1];m.setByName(b,y)}}o.topDict.privateDict=m;var k=new a.CFFIndex;for(l=0,u=n.length;l=t)throw new n.FormatError("Invalid CFF header");0!==r&&((0,n.info)("cff data is shifted"),e=e.subarray(r),this.bytes=e);var a=e[0],i=e[1],o=e[2],s=e[3],c=new S(a,i,o,s);return{obj:c,endPos:o}}},{key:"parseDict",value:function(e){var t=0;function r(){var r=e[t++];return 30===r?a():28===r?(r=e[t++],r=(r<<24|e[t++]<<16)>>16,r):29===r?(r=e[t++],r=r<<8|e[t++],r=r<<8|e[t++],r=r<<8|e[t++],r):r>=32&&r<=246?r-139:r>=247&&r<=250?256*(r-247)+e[t++]+108:r>=251&&r<=254?-256*(r-251)-e[t++]-108:((0,n.warn)('CFFParser_parseDict: "'+r+'" is a reserved command.'),NaN)}function a(){var r="",n=15,a=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],i=e.length;while(t>4,c=15&o;if(s===n)break;if(r+=a[s],c===n)break;r+=a[c]}return parseFloat(r)}var i=[],o=[];t=0;var s=e.length;while(tv)return!1;for(var s=r.stackSize,c=r.stack,l=a.length,u=0;u>16,u+=2,s++;else if(14===h){if(s>=4&&(s-=4,this.seacAnalysisEnabled))return r.seac=c.slice(s,s+4),!1;f=e[h]}else if(h>=32&&h<=246)c[s]=h-139,s++;else if(h>=247&&h<=254)c[s]=h<251?(h-247<<8)+a[u]+108:-(h-251<<8)-a[u]-108,u++,s++;else if(255===h)c[s]=(a[u]<<24|a[u+1]<<16|a[u+2]<<8|a[u+3])/65536,u+=4,s++;else if(19===h||20===h)r.hints+=s>>1,u+=r.hints+7>>3,s%=2,f=e[h];else{if(10===h||29===h){var p;if(p=10===h?i:o,!p)return f=e[h],(0,n.warn)("Missing subrsIndex for "+f.id),!1;var g=32768;p.count<1240?g=107:p.count<33900&&(g=1131);var m=c[--s]+g;if(m<0||m>=p.count||isNaN(m))return f=e[h],(0,n.warn)("Out of bounds subrIndex for "+f.id),!1;r.stackSize=s,r.callDepth++;var b=this.parseCharString(r,p.get(m),i,o);if(!b)return!1;r.callDepth--,s=r.stackSize;continue}if(11===h)return r.stackSize=s,!0;f=e[h]}if(f){if(f.stem&&(r.hints+=s>>1,3===h||23===h?r.hasVStems=!0:!r.hasVStems||1!==h&&18!==h||((0,n.warn)("CFF stem hints are in wrong order"),a[u-1]=1===h?3:23)),"min"in f&&!r.undefStack&&s=2&&f.stem?s%=2:s>1&&(0,n.warn)("Found too many parameters for stack-clearing command"),s>0&&c[s-1]>=0&&(r.width=c[s-1])),"stackDelta"in f?("stackFn"in f&&f.stackFn(c,s),s+=f.stackDelta):f.stackClearing?s=0:f.resetStack?(s=0,r.undefStack=!1):f.undefStack&&(s=0,r.undefStack=!0,r.firstStackClearing=!1)}}return r.stackSize=s,!0}},{key:"parseCharStrings",value:function(e){for(var t=e.charStrings,r=e.localSubrIndex,a=e.globalSubrIndex,i=e.fdSelect,o=e.fdArray,s=e.privateDict,c=[],l=[],u=t.count,h=0;h=o.length&&((0,n.warn)("Invalid fd index for glyph index."),p=!1),p&&(m=o[v].privateDict,g=m.subrsIndex)}else r&&(g=r);if(p&&(p=this.parseCharString(d,f,g,a)),null!==d.width){var b=m.getByName("nominalWidthX");l[h]=b+d.width}else{var y=m.getByName("defaultWidthX");l[h]=y}null!==d.seac&&(c[h]=d.seac),p||t.set(h,new Uint8Array([14]))}return{charStrings:t,seacs:c,widths:l}}},{key:"emptyPrivateDictionary",value:function(e){var t=this.createDict(O,[],e.strings);e.setByKey(18,[0,0]),e.privateDict=t}},{key:"parsePrivateDict",value:function(e){if(e.hasName("Private")){var t=e.getByName("Private");if(Array.isArray(t)&&2===t.length){var r=t[0],n=t[1];if(0===r||n>=this.bytes.length)this.emptyPrivateDictionary(e);else{var a=n+r,i=this.bytes.subarray(n,a),o=this.parseDict(i),s=this.createDict(O,o,e.strings);if(e.privateDict=s,s.getByName("Subrs")){var c=s.getByName("Subrs"),l=n+c;if(0===c||l>=this.bytes.length)this.emptyPrivateDictionary(e);else{var u=this.parseIndex(l);s.subrsIndex=u.obj}}}}else e.removeByName("Private")}else this.emptyPrivateDictionary(e)}},{key:"parseCharsets",value:function(e,t,r,i){if(0===e)return new I(!0,T.ISO_ADOBE,a.ISOAdobeCharset);if(1===e)return new I(!0,T.EXPERT,a.ExpertCharset);if(2===e)return new I(!0,T.EXPERT_SUBSET,a.ExpertSubsetCharset);var o,s,c,l=this.bytes,u=e,h=l[e++],f=[i?0:".notdef"];switch(t-=1,h){case 0:for(c=0;c=65535)(0,n.warn)("Not enough space in charstrings to duplicate first glyph.");else{var e=this.charStrings.get(0);this.charStrings.add(e),this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}}},{key:"hasGlyphId",value:function(e){if(e<0||e>=this.charStrings.count)return!1;var t=this.charStrings.get(e);return t.length>0}}]),e}();t.CFF=k;var S=function e(t,r,n,a){p(this,e),this.major=t,this.minor=r,this.hdrSize=n,this.offSize=a};t.CFFHeader=S;var x=function(){function e(){p(this,e),this.strings=[]}return m(e,[{key:"get",value:function(e){return e>=0&&e<=y-1?b[e]:e-y<=this.strings.length?this.strings[e-y]:b[0]}},{key:"getSID",value:function(e){var t=b.indexOf(e);return-1!==t?t:(t=this.strings.indexOf(e),-1!==t?t+y:-1)}},{key:"add",value:function(e){this.strings.push(e)}},{key:"count",get:function(){return this.strings.length}}]),e}();t.CFFStrings=x;var C=function(){function e(){p(this,e),this.objects=[],this.length=0}return m(e,[{key:"add",value:function(e){this.length+=e.length,this.objects.push(e)}},{key:"set",value:function(e,t){this.length+=t.length-this.objects[e].length,this.objects[e]=t}},{key:"get",value:function(e){return this.objects[e]}},{key:"count",get:function(){return this.objects.length}}]),e}();t.CFFIndex=C;var A=function(){function e(t,r){p(this,e),this.keyToNameMap=t.keyToNameMap,this.nameToKeyMap=t.nameToKeyMap,this.defaults=t.defaults,this.types=t.types,this.opcodes=t.opcodes,this.order=t.order,this.strings=r,this.values=Object.create(null)}return m(e,[{key:"setByKey",value:function(e,t){if(!(e in this.keyToNameMap))return!1;var r=t.length;if(0===r)return!0;for(var a=0;a=this.fdSelect.length?-1:this.fdSelect[e]}}]),e}();t.CFFFDSelect=_;var F=function(){function e(){p(this,e),this.offsets=Object.create(null)}return m(e,[{key:"isTracking",value:function(e){return e in this.offsets}},{key:"track",value:function(e,t){if(e in this.offsets)throw new n.FormatError("Already tracking location of ".concat(e));this.offsets[e]=t}},{key:"offset",value:function(e){for(var t in this.offsets)this.offsets[t]+=e}},{key:"setEntryLocation",value:function(e,t,r){if(!(e in this.offsets))throw new n.FormatError("Not tracking location of ".concat(e));for(var a=r.data,i=this.offsets[e],o=5,s=0,c=t.length;s>24&255,a[h]=p>>16&255,a[f]=p>>8&255,a[d]=255&p}}}]),e}(),R=function(){function e(t){p(this,e),this.cff=t}return m(e,[{key:"compile",value:function(){var e=this.cff,t={data:[],length:0,add:function(e){this.data=this.data.concat(e),this.length=this.data.length}},r=this.compileHeader(e.header);t.add(r);var a=this.compileNameIndex(e.names);if(t.add(a),e.isCIDFont&&e.topDict.hasName("FontMatrix")){var i=e.topDict.getByName("FontMatrix");e.topDict.removeByName("FontMatrix");for(var o=0,s=e.fdArray.length;o=-107&&e<=107?t=[e+139]:e>=108&&e<=1131?(e-=108,t=[247+(e>>8),255&e]):e>=-1131&&e<=-108?(e=-e-108,t=[251+(e>>8),255&e]):t=e>=-32768&&e<=32767?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e],t}},{key:"compileHeader",value:function(e){return[e.major,e.minor,e.hdrSize,e.offSize]}},{key:"compileNameIndex",value:function(e){for(var t=new C,r=0,a=e.length;r"~"||"["===l||"]"===l||"("===l||")"===l||"{"===l||"}"===l||"<"===l||">"===l||"/"===l||"%"===l)&&(l="_"),s[c]=l}s=s.join(""),""===s&&(s="Bad_Font_Name"),t.add((0,n.stringToBytes)(s))}return this.compileIndex(t)}},{key:"compileTopDicts",value:function(e,t,r){for(var n=[],a=new C,i=0,o=e.length;i>8&255,255&o]);else{var s=1+2*o;i=new Uint8Array(s),i[0]=0;for(var c=0,l=e.charset.length,u=!1,h=1;h>8&255,i[h+1]=255&f}}return this.compileTypedArray(i)}},{key:"compileEncoding",value:function(e){return this.compileTypedArray(e.raw)}},{key:"compileFDSelect",value:function(e){var t,r,n=e.format;switch(n){case 0:for(t=new Uint8Array(1+e.fdSelect.length),t[0]=n,r=0;r>8&255,255&a,i];for(r=1;r>8&255,255&r,s),i=s)}var c=(o.length-3)/3;o[1]=c>>8&255,o[2]=255&c,o.push(r>>8&255,255&r),t=new Uint8Array(o);break}return this.compileTypedArray(t)}},{key:"compileTypedArray",value:function(e){for(var t=[],r=0,n=e.length;r1&&void 0!==arguments[1]?arguments[1]:[],r=e.objects,n=r.length;if(0===n)return[0,0,0];var a,i,o=[n>>8&255,255&n],s=1;for(a=0;a>8&255,255&c):3===i?o.push(c>>16&255,c>>8&255,255&c):o.push(c>>>24&255,c>>16&255,c>>8&255,255&c),r[a]&&(c+=r[a].length);for(a=0;a=65520&&e<=65535?0:e>=62976&&e<=63743?a()[e]||e:173===e?45:e}function o(e,t){var r=t[e];if(void 0!==r)return r;if(!e)return-1;if("u"===e[0]){var n,a=e.length;if(7===a&&"n"===e[1]&&"i"===e[2])n=e.substring(3);else{if(!(a>=5&&a<=7))return-1;n=e.substring(1)}if(n===n.toUpperCase()&&(r=parseInt(n,16),r>=0))return r}return-1}var s=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function c(e){for(var t=0,r=s.length;t=n.begin&&e=t.begin&&e=t.begin&&e=0;n--)r+=e[n];return r}t.mapSpecialUnicodeValues=i,t.reverseIfRtl=h,t.getUnicodeRangeFor=c,t.getNormalizedUnicodes=u,t.getUnicodeForGlyph=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FontRendererFactory=void 0;var n=r(5),a=r(228),i=r(231),o=r(230),s=r(209);function c(e){return c="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},c(e)}function l(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&&u(e,t)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function h(e){var t=p();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return f(this,r)}}function f(e,t){return!t||"object"!==c(t)&&"function"!==typeof t?d(e):t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;r>1;for(s=a+l+14,o=[],c=0;c>1;r>16,l=0,u=0;if(s+=10,c<0)do{o=e[s]<<8|e[s+1];var h,f,d=e[s+2]<<8|e[s+3];s+=4,1&o?(h=(e[s]<<24|e[s+1]<<16)>>16,f=(e[s+2]<<24|e[s+3]<<16)>>16,s+=4):(h=e[s++],f=e[s++]),2&o?(l=h,u=f):(l=0,u=0);var g=1,m=1,v=0,b=0;8&o?(g=m=(e[s]<<24|e[s+1]<<16)/1073741824,s+=2):64&o?(g=(e[s]<<24|e[s+1]<<16)/1073741824,m=(e[s+2]<<24|e[s+3]<<16)/1073741824,s+=4):128&o&&(g=(e[s]<<24|e[s+1]<<16)/1073741824,v=(e[s+2]<<24|e[s+3]<<16)/1073741824,b=(e[s+4]<<24|e[s+5]<<16)/1073741824,m=(e[s+6]<<24|e[s+7]<<16)/1073741824,s+=8);var y=r.glyphs[d];y&&(t.push({cmd:"save"}),t.push({cmd:"transform",args:[g,v,b,m,l,u]}),p(y,t,r),t.push({cmd:"restore"}))}while(32&o);else{var w,k,S=[];for(w=0;w0)A.push({flags:o})}for(w=0;w>16,s+=2;break;case 2:l-=e[s++];break;case 18:l+=e[s++];break}A[w].x=l}for(w=0;w>16,s+=2;break;case 4:u-=e[s++];break;case 36:u+=e[s++];break}A[w].y=u}var O=0;for(s=0;s>1,O=!0;break;case 3:p+=u.length>>1,O=!0;break;case 4:f+=u.pop(),s(h,f),O=!0;break;case 5:while(u.length>0)h+=u.shift(),f+=u.shift(),c(h,f);break;case 6:while(u.length>0){if(h+=u.shift(),c(h,f),0===u.length)break;f+=u.shift(),c(h,f)}break;case 7:while(u.length>0){if(f+=u.shift(),c(h,f),0===u.length)break;h+=u.shift(),c(h,f)}break;case 8:while(u.length>0)b=h+u.shift(),w=f+u.shift(),y=b+u.shift(),k=w+u.shift(),h=y+u.shift(),f=k+u.shift(),l(b,w,y,k,h,f);break;case 10:if(A=u.pop(),E=null,a.isCFFCIDFont){var I=a.fdSelect.getFDIndex(i);if(I>=0&&IMath.abs(f-R)?h+=u.shift():f+=u.shift(),l(b,w,y,k,h,f);break;default:throw new n.FormatError("unknown operator: 12 ".concat(T))}break;case 14:if(u.length>=4){var M=u.pop(),B=u.pop();f=u.pop(),h=u.pop(),t.push({cmd:"save"}),t.push({cmd:"translate",args:[h,f]});var L=d(a.cmap,String.fromCharCode(a.glyphNameMap[o.StandardEncoding[M]]));g(a.glyphs[L.glyphId],t,a,L.glyphId),t.push({cmd:"restore"}),L=d(a.cmap,String.fromCharCode(a.glyphNameMap[o.StandardEncoding[B]])),g(a.glyphs[L.glyphId],t,a,L.glyphId)}return;case 18:p+=u.length>>1,O=!0;break;case 19:p+=u.length>>1,v+=p+7>>3,O=!0;break;case 20:p+=u.length>>1,v+=p+7>>3,O=!0;break;case 21:f+=u.pop(),h+=u.pop(),s(h,f),O=!0;break;case 22:h+=u.pop(),s(h,f),O=!0;break;case 23:p+=u.length>>1,O=!0;break;case 24:while(u.length>2)b=h+u.shift(),w=f+u.shift(),y=b+u.shift(),k=w+u.shift(),h=y+u.shift(),f=k+u.shift(),l(b,w,y,k,h,f);h+=u.shift(),f+=u.shift(),c(h,f);break;case 25:while(u.length>6)h+=u.shift(),f+=u.shift(),c(h,f);b=h+u.shift(),w=f+u.shift(),y=b+u.shift(),k=w+u.shift(),h=y+u.shift(),f=k+u.shift(),l(b,w,y,k,h,f);break;case 26:u.length%2&&(h+=u.shift());while(u.length>0)b=h,w=f+u.shift(),y=b+u.shift(),k=w+u.shift(),h=y,f=k+u.shift(),l(b,w,y,k,h,f);break;case 27:u.length%2&&(f+=u.shift());while(u.length>0)b=h+u.shift(),w=f,y=b+u.shift(),k=w+u.shift(),h=y+u.shift(),f=k,l(b,w,y,k,h,f);break;case 28:u.push((e[v]<<24|e[v+1]<<16)>>16),v+=2;break;case 29:A=u.pop()+a.gsubrsBias,E=a.gsubrs[A],E&&m(E);break;case 30:while(u.length>0){if(b=h,w=f+u.shift(),y=b+u.shift(),k=w+u.shift(),h=y+u.shift(),f=k+(1===u.length?u.shift():0),l(b,w,y,k,h,f),0===u.length)break;b=h+u.shift(),w=f,y=b+u.shift(),k=w+u.shift(),f=k+u.shift(),h=y+(1===u.length?u.shift():0),l(b,w,y,k,h,f)}break;case 31:while(u.length>0){if(b=h+u.shift(),w=f,y=b+u.shift(),k=w+u.shift(),f=k+u.shift(),h=y+(1===u.length?u.shift():0),l(b,w,y,k,h,f),0===u.length)break;b=h,w=f+u.shift(),y=b+u.shift(),k=w+u.shift(),h=y+u.shift(),f=k+(1===u.length?u.shift():0),l(b,w,y,k,h,f)}break;default:if(T<32)throw new n.FormatError("unknown operator: ".concat(T));T<247?u.push(T-139):T<251?u.push(256*(T-247)+e[v++]+108):T<255?u.push(256*-(T-251)-e[v++]-108):(u.push((e[v]<<24|e[v+1]<<16|e[v+2]<<8|e[v+3])/65536),v+=4);break}O&&(u.length=0)}}m(e)}var v=[],y=function(){function e(t){m(this,e),this.constructor===e&&(0,n.unreachable)("Cannot initialize CompiledFont."),this.fontMatrix=t,this.compiledGlyphs=Object.create(null),this.compiledCharCodeToGlyphId=Object.create(null)}return b(e,[{key:"getPathJs",value:function(e){var t=d(this.cmap,e),r=this.compiledGlyphs[t.glyphId];return r||(r=this.compileGlyph(this.glyphs[t.glyphId],t.glyphId),this.compiledGlyphs[t.glyphId]=r),void 0===this.compiledCharCodeToGlyphId[t.charCode]&&(this.compiledCharCodeToGlyphId[t.charCode]=t.glyphId),r}},{key:"compileGlyph",value:function(e,t){if(!e||0===e.length||14===e[0])return v;var r=this.fontMatrix;if(this.isCFFCIDFont){var a=this.fdSelect.getFDIndex(t);if(a>=0&&an)return!0;for(var a=n-e,i=a;i>8&255,255&o):(o=65536*o|0,this.output.push(255,o>>24&255,o>>16&255,o>>8&255,255&o))}return this.output.push.apply(this.output,t),r?this.stack.splice(a,e):this.stack.length=0,!1}},t}(),l=function(){var e=55665,t=4330;function r(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function o(e,t,r){if(r>=e.length)return new Uint8Array(0);var n,a,i=0|t,o=52845,s=22719;for(n=0;n>8,i=(u+i)*o+s&65535}return l}function l(e,t,n){var a,i,o=0|t,s=52845,c=22719,l=e.length,u=l>>>1,h=new Uint8Array(u);for(a=0,i=0;a>8,o=(p+o)*s+c&65535}}}return h.slice(n,i)}function u(e){return 47===e||91===e||93===e||123===e||125===e||40===e||41===e}function h(t,n,s){if(n){var c=t.getBytes(),u=!((r(c[0])||(0,a.isWhiteSpace)(c[0]))&&r(c[1])&&r(c[2])&&r(c[3])&&r(c[4])&&r(c[5])&&r(c[6])&&r(c[7]));t=new i.Stream(u?o(c,e,4):l(c,e,4))}this.seacAnalysisEnabled=!!s,this.stream=t,this.nextChar()}return h.prototype={readNumberArray:function(){this.getToken();var e=[];while(1){var t=this.getToken();if(null===t||"]"===t||"}"===t)break;e.push(parseFloat(t||0))}return e},readNumber:function(){var e=this.getToken();return parseFloat(e||0)},readInt:function(){var e=this.getToken();return 0|parseInt(e||0,10)},readBoolean:function(){var e=this.getToken();return"true"===e?1:0},nextChar:function(){return this.currentChar=this.stream.getByte()},getToken:function(){var e=!1,t=this.currentChar;while(1){if(-1===t)return null;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!(0,a.isWhiteSpace)(t))break;t=this.nextChar()}if(u(t))return this.nextChar(),String.fromCharCode(t);var r="";do{r+=String.fromCharCode(t),t=this.nextChar()}while(t>=0&&!(0,a.isWhiteSpace)(t)&&!u(t));return r},readCharStrings:function(e,r){return-1===r?e:o(e,t,r)},extractFontProgram:function(e){var t=this.stream,r=[],n=[],a=Object.create(null);a.lenIV=4;var i,o,l,u,h,f={subrs:[],charstrings:[],properties:{privateData:a}};while(null!==(i=this.getToken()))if("/"===i)switch(i=this.getToken(),i){case"CharStrings":this.getToken(),this.getToken(),this.getToken(),this.getToken();while(1){if(i=this.getToken(),null===i||"end"===i)break;if("/"===i){var d=this.getToken();o=this.readInt(),this.getToken(),l=o>0?t.getBytes(o):new Uint8Array(0),u=f.properties.privateData.lenIV,h=this.readCharStrings(l,u),this.nextChar(),i=this.getToken(),"noaccess"===i&&this.getToken(),n.push({glyph:d,encoded:h})}}break;case"Subrs":this.readInt(),this.getToken();while("dup"===this.getToken()){var p=this.readInt();o=this.readInt(),this.getToken(),l=o>0?t.getBytes(o):new Uint8Array(0),u=f.properties.privateData.lenIV,h=this.readCharStrings(l,u),this.nextChar(),i=this.getToken(),"noaccess"===i&&this.getToken(),r[p]=h}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":var g=this.readNumberArray();g.length>0&&g.length%2===0&&s&&(f.properties.privateData[i]=g);break;case"StemSnapH":case"StemSnapV":f.properties.privateData[i]=this.readNumberArray();break;case"StdHW":case"StdVW":f.properties.privateData[i]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":case"ExpansionFactor":f.properties.privateData[i]=this.readNumber();break;case"ForceBold":f.properties.privateData[i]=this.readBoolean();break}for(var m=0;m-1&&void 0===e.widths[k]&&k>=e.firstChar&&k<=e.lastChar&&(e.widths[k]=v.width)}}return f},extractFontHeader:function(e){var t;while(null!==(t=this.getToken()))if("/"===t)switch(t=this.getToken(),t){case"FontMatrix":var r=this.readNumberArray();e.fontMatrix=r;break;case"Encoding":var a,i=this.getToken();if(/^\d+$/.test(i)){a=[];var o=0|parseInt(i,10);this.getToken();for(var s=0;s=d||T<=0)(0,n.info)("Bad shading domain.");else{for(var P,_=new Float32Array(u.numComps),F=new Float32Array(1),R=0;R<=O;R++){F[0]=f+R*T,E(F,0,_,0),P=u.getRgb(_,0);var M=n.Util.makeCssRgb(P[0],P[1],P[2]);I.push([R/O,M])}var B="transparent";e.has("Background")&&(P=u.getRgb(e.get("Background"),0),B=n.Util.makeCssRgb(P[0],P[1],P[2])),g||(I.unshift([0,B]),I[1][0]+=l.SMALL_NUMBER),m||(I[I.length-1][0]-=l.SMALL_NUMBER,I.push([1,B])),this.colorStops=I}}return e.prototype={getIR:function(){var e,t,r,a,i,o=this.coordsArr,c=this.shadingType;c===s.AXIAL?(t=[o[0],o[1]],r=[o[2],o[3]],a=null,i=null,e="axial"):c===s.RADIAL?(t=[o[0],o[1]],r=[o[3],o[4]],a=o[2],i=o[5],e="radial"):(0,n.unreachable)("getPattern type unknown: ".concat(c));var l=this.matrix;if(l&&(t=n.Util.applyTransform(t,l),r=n.Util.applyTransform(r,l),c===s.RADIAL)){var u=n.Util.singularValueDecompose2dScale(l);a*=u[0],i*=u[1]}return["RadialAxial",e,this.bbox,this.colorStops,t,r,a,i]}},e}(),l.Mesh=function(){function e(e,t){this.stream=e,this.context=t,this.buffer=0,this.bufferLength=0;var r=t.numComps;this.tmpCompsBuf=new Float32Array(r);var n=t.colorSpace.numComps;this.tmpCsCompsBuf=t.colorFn?new Float32Array(n):this.tmpCompsBuf}function t(e,t){var r=e.coords,a=e.colors,i=[],o=[],s=0;while(t.hasData){var c=t.readFlag(),l=t.readCoordinate(),u=t.readComponents();if(0===s){if(!(0<=c&&c<=2))throw new n.FormatError("Unknown type4 flag");switch(c){case 0:s=3;break;case 1:o.push(o[o.length-2],o[o.length-1]),s=1;break;case 2:o.push(o[o.length-3],o[o.length-1]),s=1;break}i.push(c)}o.push(r.length),r.push(l),a.push(u),s--,t.align()}e.figures.push({type:"triangles",coords:new Int32Array(o),colors:new Int32Array(o)})}function r(e,t,r){var n=e.coords,a=e.colors,i=[];while(t.hasData){var o=t.readCoordinate(),s=t.readComponents();i.push(n.length),n.push(o),a.push(s)}e.figures.push({type:"lattice",coords:new Int32Array(i),colors:new Int32Array(i),verticesPerRow:r})}e.prototype={get hasData(){if(this.stream.end)return this.stream.pos0)return!0;var e=this.stream.getByte();return!(e<0)&&(this.buffer=e,this.bufferLength=8,!0)},readBits:function(e){var t=this.buffer,r=this.bufferLength;if(32===e){if(0===r)return(this.stream.getByte()<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte())>>>0;t=t<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte();var n=this.stream.getByte();return this.buffer=n&(1<>r)>>>0}if(8===e&&0===r)return this.stream.getByte();while(r>r},align:function(){this.buffer=0,this.bufferLength=0},readFlag:function(){return this.readBits(this.context.bitsPerFlag)},readCoordinate:function(){var e=this.context.bitsPerCoordinate,t=this.readBits(e),r=this.readBits(e),n=this.context.decode,a=e<32?1/((1<s?s:t,r=r>c?c:r,n=n>c)*u,l&=(1<r?e=r:e0&&(d=n[h-1]);var p=r[1];h>1,l=n.length>>1,u=new m(o),h=Object.create(null),f=8192,d=f,p=new Float32Array(l);return function(e,t,r,n){var a,o,s="",f=p;for(a=0;ay&&(o=y)),m[a]=o}d>0&&(d--,h[s]=m),r.set(m,n)}else r.set(g,n)}}}}();function p(e){var t;if("object"!==s(e))return!1;if((0,n.isDict)(e))t=e;else{if(!(0,n.isStream)(e))return!1;t=e.dict}return t.has("FunctionType")}var g=function(){var e=100;function t(e){this.stack=e?Array.prototype.slice.call(e,0):[]}return t.prototype={push:function(t){if(this.stack.length>=e)throw new Error("PostScript function stack overflow.");this.stack.push(t)},pop:function(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()},copy:function(t){if(this.stack.length+t>=e)throw new Error("PostScript function stack overflow.");for(var r=this.stack,n=r.length-t,a=t-1;a>=0;a--,n++)r.push(r[n])},index:function(e){this.push(this.stack[this.stack.length-e-1])},roll:function(e,t){var r,n,a,i=this.stack,o=i.length-e,s=i.length-1,c=o+(t-Math.floor(t/e)*e);for(r=o,n=s;r0?i.push(r<>n);break;case"ceiling":r=i.pop(),i.push(Math.ceil(r));break;case"copy":r=i.pop(),i.copy(r);break;case"cos":r=i.pop(),i.push(Math.cos(r));break;case"cvi":r=0|i.pop(),i.push(r);break;case"cvr":break;case"div":n=i.pop(),r=i.pop(),i.push(r/n);break;case"dup":i.copy(1);break;case"eq":n=i.pop(),r=i.pop(),i.push(r===n);break;case"exch":i.roll(2,1);break;case"exp":n=i.pop(),r=i.pop(),i.push(Math.pow(r,n));break;case"false":i.push(!1);break;case"floor":r=i.pop(),i.push(Math.floor(r));break;case"ge":n=i.pop(),r=i.pop(),i.push(r>=n);break;case"gt":n=i.pop(),r=i.pop(),i.push(r>n);break;case"idiv":n=i.pop(),r=i.pop(),i.push(r/n|0);break;case"index":r=i.pop(),i.index(r);break;case"le":n=i.pop(),r=i.pop(),i.push(r<=n);break;case"ln":r=i.pop(),i.push(Math.log(r));break;case"log":r=i.pop(),i.push(Math.log(r)/Math.LN10);break;case"lt":n=i.pop(),r=i.pop(),i.push(r=t?new r(t):e.max<=t?e:new i(e,t)}function d(){}return e.prototype.visit=function(e){(0,a.unreachable)("abstract method")},t.prototype=Object.create(e.prototype),t.prototype.visit=function(e){e.visitArgument(this)},r.prototype=Object.create(e.prototype),r.prototype.visit=function(e){e.visitLiteral(this)},n.prototype=Object.create(e.prototype),n.prototype.visit=function(e){e.visitBinaryOperation(this)},i.prototype=Object.create(e.prototype),i.prototype.visit=function(e){e.visitMin(this)},o.prototype=Object.create(e.prototype),o.prototype.visit=function(e){e.visitVariable(this)},s.prototype=Object.create(e.prototype),s.prototype.visit=function(e){e.visitVariableDefinition(this)},c.prototype={visitArgument:function(e){this.parts.push("Math.max(",e.min,", Math.min(",e.max,", src[srcOffset + ",e.index,"]))")},visitVariable:function(e){this.parts.push("v",e.index)},visitLiteral:function(e){this.parts.push(e.number)},visitBinaryOperation:function(e){this.parts.push("("),e.arg1.visit(this),this.parts.push(" ",e.op," "),e.arg2.visit(this),this.parts.push(")")},visitVariableDefinition:function(e){this.parts.push("var "),e.variable.visit(this),this.parts.push(" = "),e.arg.visit(this),this.parts.push(";")},visitMin:function(e){this.parts.push("Math.min("),e.arg.visit(this),this.parts.push(", ",e.max,")")},toString:function(){return this.parts.join("")}},d.prototype={compile:function(e,n,a){for(var i,d,p,g,m,v,b,y,w=[],k=[],S=n.length>>1,x=a.length>>1,C=0,A=0;Ae.min&&(o.unshift("Math.max(",n,", "),o.push(")")),i=0&&(t>=65&&t<=90||t>=97&&t<=122))r.push(String.fromCharCode(t));var n=r.join("");switch(n.toLowerCase()){case"if":return h.IF;case"ifelse":return h.IFELSE;default:return h.getOperator(n)}}},{key:"getNumber",value:function(){var e=this.currentChar,t=this.strBuf;t.length=0,t[0]=String.fromCharCode(e);while((e=this.nextChar())>=0){if(!(e>=48&&e<=57||45===e||46===e))break;t.push(String.fromCharCode(e))}var r=parseFloat(t.join(""));if(isNaN(r))throw new n.FormatError("Invalid floating point number: ".concat(r));return r}}]),e}();t.PostScriptLexer=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bidi=p;var n=r(5),a=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],i=["AN","AN","AN","AN","AN","AN","ON","ON","AL","ET","ET","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL"];function o(e){return 0!==(1&e)}function s(e){return 0===(1&e)}function c(e,t,r){for(var n=t,a=e.length;n2&&void 0!==arguments[2]&&arguments[2],n="ltr";return r?n="ttb":t||(n="rtl"),{str:e,dir:n}}var f=[],d=[];function p(e,t,r){var p=!0,g=e.length;if(0===g||r)return h(e,p,r);f.length=g,d.length=g;var m,v,b=0;for(m=0;m=0;--O){if("ET"!==d[O])break;d[O]="EN"}for(O=m+1;O0&&(I=d[m-1]);var P=A;T+1_&&o(_)&&(R=_);for(_=F;_>=R;--_){var M=-1;for(m=0,v=k.length;m=0&&(u(f,M,m),M=-1):M<0&&(M=m);M>=0&&u(f,M,k.length)}for(m=0,v=f.length;m"!==B||(f[m]="")}return h(f.join(""),p)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMetrics=void 0;var n=r(205),a=(0,n.getLookupTableFactory)((function(e){e.Courier=600,e["Courier-Bold"]=600,e["Courier-BoldOblique"]=600,e["Courier-Oblique"]=600,e.Helvetica=(0,n.getLookupTableFactory)((function(e){e.space=278,e.exclam=278,e.quotedbl=355,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=667,e.quoteright=222,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=278,e.semicolon=278,e.less=584,e.equal=584,e.greater=584,e.question=556,e.at=1015,e.A=667,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=500,e.K=667,e.L=556,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=278,e.backslash=278,e.bracketright=278,e.asciicircum=469,e.underscore=556,e.quoteleft=222,e.a=556,e.b=556,e.c=500,e.d=556,e.e=556,e.f=278,e.g=556,e.h=556,e.i=222,e.j=222,e.k=500,e.l=222,e.m=833,e.n=556,e.o=556,e.p=556,e.q=556,e.r=333,e.s=500,e.t=278,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=500,e.braceleft=334,e.bar=260,e.braceright=334,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=191,e.quotedblleft=333,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=537,e.bullet=350,e.quotesinglbase=222,e.quotedblbase=333,e.quotedblright=333,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=556,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=222,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=556,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=667,e.aacute=556,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=500,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=500,e.aring=556,e.Ncommaaccent=722,e.lacute=222,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=500,e.scedilla=500,e.iacute=278,e.lozenge=471,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=556,e.Amacron=667,e.rcaron=333,e.ccedilla=500,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=643,e.Umacron=722,e.uring=556,e.threesuperior=333,e.Ograve=778,e.Agrave=667,e.Abreve=667,e.multiply=584,e.uacute=556,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=500,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=260,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=333,e.omacron=556,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=222,e.tcaron=317,e.eogonek=556,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=556,e.zacute=500,e.iogonek=222,e.Oacute=778,e.oacute=556,e.amacron=556,e.sacute=500,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=333,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=556,e.Eogonek=667,e.dcroat=556,e.threequarters=834,e.Scedilla=667,e.lcaron=299,e.Kcommaaccent=667,e.Lacute=556,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=556,e.onehalf=834,e.lessequal=549,e.ocircumflex=556,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=556,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=556,e.Ccaron=722,e.ugrave=556,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=556,e.Rcommaaccent=722,e.Lcommaaccent=556,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=500,e.minus=584,e.Icircumflex=278,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=584,e.odieresis=556,e.udieresis=556,e.notequal=549,e.gcommaaccent=556,e.eth=556,e.zcaron=500,e.ncommaaccent=556,e.onesuperior=333,e.imacron=278,e.Euro=556})),e["Helvetica-Bold"]=(0,n.getLookupTableFactory)((function(e){e.space=278,e.exclam=333,e.quotedbl=474,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=722,e.quoteright=278,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=333,e.semicolon=333,e.less=584,e.equal=584,e.greater=584,e.question=611,e.at=975,e.A=722,e.B=722,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=556,e.K=722,e.L=611,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=584,e.underscore=556,e.quoteleft=278,e.a=556,e.b=611,e.c=556,e.d=611,e.e=556,e.f=333,e.g=611,e.h=611,e.i=278,e.j=278,e.k=556,e.l=278,e.m=889,e.n=611,e.o=611,e.p=611,e.q=611,e.r=389,e.s=556,e.t=333,e.u=611,e.v=556,e.w=778,e.x=556,e.y=556,e.z=500,e.braceleft=389,e.bar=280,e.braceright=389,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=238,e.quotedblleft=500,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=611,e.fl=611,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=556,e.bullet=350,e.quotesinglbase=278,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=611,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=278,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=611,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=722,e.aacute=556,e.Ucircumflex=722,e.yacute=556,e.scommaaccent=556,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=611,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=556,e.aring=556,e.Ncommaaccent=722,e.lacute=278,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=556,e.scedilla=556,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=611,e.acircumflex=556,e.Amacron=722,e.rcaron=389,e.ccedilla=556,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=743,e.Umacron=722,e.uring=611,e.threesuperior=333,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=584,e.uacute=611,e.Tcaron=611,e.partialdiff=494,e.ydieresis=556,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=556,e.nacute=611,e.umacron=611,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=280,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=611,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=389,e.eogonek=556,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=556,e.zacute=500,e.iogonek=278,e.Oacute=778,e.oacute=611,e.amacron=556,e.sacute=556,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=611,e.twosuperior=333,e.Odieresis=778,e.mu=611,e.igrave=278,e.ohungarumlaut=611,e.Eogonek=667,e.dcroat=611,e.threequarters=834,e.Scedilla=667,e.lcaron=400,e.Kcommaaccent=722,e.Lacute=611,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=611,e.onehalf=834,e.lessequal=549,e.ocircumflex=611,e.ntilde=611,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=611,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=611,e.Ccaron=722,e.ugrave=611,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=611,e.Rcommaaccent=722,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=556,e.minus=584,e.Icircumflex=278,e.ncaron=611,e.tcommaaccent=333,e.logicalnot=584,e.odieresis=611,e.udieresis=611,e.notequal=549,e.gcommaaccent=611,e.eth=611,e.zcaron=500,e.ncommaaccent=611,e.onesuperior=333,e.imacron=278,e.Euro=556})),e["Helvetica-BoldOblique"]=(0,n.getLookupTableFactory)((function(e){e.space=278,e.exclam=333,e.quotedbl=474,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=722,e.quoteright=278,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=333,e.semicolon=333,e.less=584,e.equal=584,e.greater=584,e.question=611,e.at=975,e.A=722,e.B=722,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=556,e.K=722,e.L=611,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=584,e.underscore=556,e.quoteleft=278,e.a=556,e.b=611,e.c=556,e.d=611,e.e=556,e.f=333,e.g=611,e.h=611,e.i=278,e.j=278,e.k=556,e.l=278,e.m=889,e.n=611,e.o=611,e.p=611,e.q=611,e.r=389,e.s=556,e.t=333,e.u=611,e.v=556,e.w=778,e.x=556,e.y=556,e.z=500,e.braceleft=389,e.bar=280,e.braceright=389,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=238,e.quotedblleft=500,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=611,e.fl=611,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=556,e.bullet=350,e.quotesinglbase=278,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=611,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=278,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=611,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=722,e.aacute=556,e.Ucircumflex=722,e.yacute=556,e.scommaaccent=556,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=611,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=556,e.aring=556,e.Ncommaaccent=722,e.lacute=278,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=556,e.scedilla=556,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=611,e.acircumflex=556,e.Amacron=722,e.rcaron=389,e.ccedilla=556,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=743,e.Umacron=722,e.uring=611,e.threesuperior=333,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=584,e.uacute=611,e.Tcaron=611,e.partialdiff=494,e.ydieresis=556,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=556,e.nacute=611,e.umacron=611,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=280,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=611,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=389,e.eogonek=556,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=556,e.zacute=500,e.iogonek=278,e.Oacute=778,e.oacute=611,e.amacron=556,e.sacute=556,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=611,e.twosuperior=333,e.Odieresis=778,e.mu=611,e.igrave=278,e.ohungarumlaut=611,e.Eogonek=667,e.dcroat=611,e.threequarters=834,e.Scedilla=667,e.lcaron=400,e.Kcommaaccent=722,e.Lacute=611,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=611,e.onehalf=834,e.lessequal=549,e.ocircumflex=611,e.ntilde=611,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=611,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=611,e.Ccaron=722,e.ugrave=611,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=611,e.Rcommaaccent=722,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=556,e.minus=584,e.Icircumflex=278,e.ncaron=611,e.tcommaaccent=333,e.logicalnot=584,e.odieresis=611,e.udieresis=611,e.notequal=549,e.gcommaaccent=611,e.eth=611,e.zcaron=500,e.ncommaaccent=611,e.onesuperior=333,e.imacron=278,e.Euro=556})),e["Helvetica-Oblique"]=(0,n.getLookupTableFactory)((function(e){e.space=278,e.exclam=278,e.quotedbl=355,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=667,e.quoteright=222,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=278,e.semicolon=278,e.less=584,e.equal=584,e.greater=584,e.question=556,e.at=1015,e.A=667,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=500,e.K=667,e.L=556,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=278,e.backslash=278,e.bracketright=278,e.asciicircum=469,e.underscore=556,e.quoteleft=222,e.a=556,e.b=556,e.c=500,e.d=556,e.e=556,e.f=278,e.g=556,e.h=556,e.i=222,e.j=222,e.k=500,e.l=222,e.m=833,e.n=556,e.o=556,e.p=556,e.q=556,e.r=333,e.s=500,e.t=278,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=500,e.braceleft=334,e.bar=260,e.braceright=334,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=191,e.quotedblleft=333,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=537,e.bullet=350,e.quotesinglbase=222,e.quotedblbase=333,e.quotedblright=333,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=556,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=222,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=556,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=667,e.aacute=556,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=500,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=500,e.aring=556,e.Ncommaaccent=722,e.lacute=222,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=500,e.scedilla=500,e.iacute=278,e.lozenge=471,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=556,e.Amacron=667,e.rcaron=333,e.ccedilla=500,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=643,e.Umacron=722,e.uring=556,e.threesuperior=333,e.Ograve=778,e.Agrave=667,e.Abreve=667,e.multiply=584,e.uacute=556,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=500,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=260,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=333,e.omacron=556,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=222,e.tcaron=317,e.eogonek=556,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=556,e.zacute=500,e.iogonek=222,e.Oacute=778,e.oacute=556,e.amacron=556,e.sacute=500,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=333,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=556,e.Eogonek=667,e.dcroat=556,e.threequarters=834,e.Scedilla=667,e.lcaron=299,e.Kcommaaccent=667,e.Lacute=556,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=556,e.onehalf=834,e.lessequal=549,e.ocircumflex=556,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=556,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=556,e.Ccaron=722,e.ugrave=556,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=556,e.Rcommaaccent=722,e.Lcommaaccent=556,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=500,e.minus=584,e.Icircumflex=278,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=584,e.odieresis=556,e.udieresis=556,e.notequal=549,e.gcommaaccent=556,e.eth=556,e.zcaron=500,e.ncommaaccent=556,e.onesuperior=333,e.imacron=278,e.Euro=556})),e.Symbol=(0,n.getLookupTableFactory)((function(e){e.space=250,e.exclam=333,e.universal=713,e.numbersign=500,e.existential=549,e.percent=833,e.ampersand=778,e.suchthat=439,e.parenleft=333,e.parenright=333,e.asteriskmath=500,e.plus=549,e.comma=250,e.minus=549,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=278,e.semicolon=278,e.less=549,e.equal=549,e.greater=549,e.question=444,e.congruent=549,e.Alpha=722,e.Beta=667,e.Chi=722,e.Delta=612,e.Epsilon=611,e.Phi=763,e.Gamma=603,e.Eta=722,e.Iota=333,e.theta1=631,e.Kappa=722,e.Lambda=686,e.Mu=889,e.Nu=722,e.Omicron=722,e.Pi=768,e.Theta=741,e.Rho=556,e.Sigma=592,e.Tau=611,e.Upsilon=690,e.sigma1=439,e.Omega=768,e.Xi=645,e.Psi=795,e.Zeta=611,e.bracketleft=333,e.therefore=863,e.bracketright=333,e.perpendicular=658,e.underscore=500,e.radicalex=500,e.alpha=631,e.beta=549,e.chi=549,e.delta=494,e.epsilon=439,e.phi=521,e.gamma=411,e.eta=603,e.iota=329,e.phi1=603,e.kappa=549,e.lambda=549,e.mu=576,e.nu=521,e.omicron=549,e.pi=549,e.theta=521,e.rho=549,e.sigma=603,e.tau=439,e.upsilon=576,e.omega1=713,e.omega=686,e.xi=493,e.psi=686,e.zeta=494,e.braceleft=480,e.bar=200,e.braceright=480,e.similar=549,e.Euro=750,e.Upsilon1=620,e.minute=247,e.lessequal=549,e.fraction=167,e.infinity=713,e.florin=500,e.club=753,e.diamond=753,e.heart=753,e.spade=753,e.arrowboth=1042,e.arrowleft=987,e.arrowup=603,e.arrowright=987,e.arrowdown=603,e.degree=400,e.plusminus=549,e.second=411,e.greaterequal=549,e.multiply=549,e.proportional=713,e.partialdiff=494,e.bullet=460,e.divide=549,e.notequal=549,e.equivalence=549,e.approxequal=549,e.ellipsis=1e3,e.arrowvertex=603,e.arrowhorizex=1e3,e.carriagereturn=658,e.aleph=823,e.Ifraktur=686,e.Rfraktur=795,e.weierstrass=987,e.circlemultiply=768,e.circleplus=768,e.emptyset=823,e.intersection=768,e.union=768,e.propersuperset=713,e.reflexsuperset=713,e.notsubset=713,e.propersubset=713,e.reflexsubset=713,e.element=713,e.notelement=713,e.angle=768,e.gradient=713,e.registerserif=790,e.copyrightserif=790,e.trademarkserif=890,e.product=823,e.radical=549,e.dotmath=250,e.logicalnot=713,e.logicaland=603,e.logicalor=603,e.arrowdblboth=1042,e.arrowdblleft=987,e.arrowdblup=603,e.arrowdblright=987,e.arrowdbldown=603,e.lozenge=494,e.angleleft=329,e.registersans=790,e.copyrightsans=790,e.trademarksans=786,e.summation=713,e.parenlefttp=384,e.parenleftex=384,e.parenleftbt=384,e.bracketlefttp=384,e.bracketleftex=384,e.bracketleftbt=384,e.bracelefttp=494,e.braceleftmid=494,e.braceleftbt=494,e.braceex=494,e.angleright=329,e.integral=274,e.integraltp=686,e.integralex=686,e.integralbt=686,e.parenrighttp=384,e.parenrightex=384,e.parenrightbt=384,e.bracketrighttp=384,e.bracketrightex=384,e.bracketrightbt=384,e.bracerighttp=494,e.bracerightmid=494,e.bracerightbt=494,e.apple=790})),e["Times-Roman"]=(0,n.getLookupTableFactory)((function(e){e.space=250,e.exclam=333,e.quotedbl=408,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=564,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=278,e.semicolon=278,e.less=564,e.equal=564,e.greater=564,e.question=444,e.at=921,e.A=722,e.B=667,e.C=667,e.D=722,e.E=611,e.F=556,e.G=722,e.H=722,e.I=333,e.J=389,e.K=722,e.L=611,e.M=889,e.N=722,e.O=722,e.P=556,e.Q=722,e.R=667,e.S=556,e.T=611,e.U=722,e.V=722,e.W=944,e.X=722,e.Y=722,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=469,e.underscore=500,e.quoteleft=333,e.a=444,e.b=500,e.c=444,e.d=500,e.e=444,e.f=333,e.g=500,e.h=500,e.i=278,e.j=278,e.k=500,e.l=278,e.m=778,e.n=500,e.o=500,e.p=500,e.q=500,e.r=333,e.s=389,e.t=278,e.u=500,e.v=500,e.w=722,e.x=500,e.y=500,e.z=444,e.braceleft=480,e.bar=200,e.braceright=480,e.asciitilde=541,e.exclamdown=333,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=180,e.quotedblleft=444,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=453,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=444,e.quotedblright=444,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=444,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=889,e.ordfeminine=276,e.Lslash=611,e.Oslash=722,e.OE=889,e.ordmasculine=310,e.ae=667,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=500,e.Idieresis=333,e.eacute=444,e.abreve=444,e.uhungarumlaut=500,e.ecaron=444,e.Ydieresis=722,e.divide=564,e.Yacute=722,e.Acircumflex=722,e.aacute=444,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=444,e.Uacute=722,e.uogonek=500,e.Edieresis=611,e.Dcroat=722,e.commaaccent=250,e.copyright=760,e.Emacron=611,e.ccaron=444,e.aring=444,e.Ncommaaccent=722,e.lacute=278,e.agrave=444,e.Tcommaaccent=611,e.Cacute=667,e.atilde=444,e.Edotaccent=611,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=471,e.Rcaron=667,e.Gcommaaccent=722,e.ucircumflex=500,e.acircumflex=444,e.Amacron=722,e.rcaron=333,e.ccedilla=444,e.Zdotaccent=611,e.Thorn=556,e.Omacron=722,e.Racute=667,e.Sacute=556,e.dcaron=588,e.Umacron=722,e.uring=500,e.threesuperior=300,e.Ograve=722,e.Agrave=722,e.Abreve=722,e.multiply=564,e.uacute=500,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=611,e.adieresis=444,e.edieresis=444,e.cacute=444,e.nacute=500,e.umacron=500,e.Ncaron=722,e.Iacute=333,e.plusminus=564,e.brokenbar=200,e.registered=760,e.Gbreve=722,e.Idotaccent=333,e.summation=600,e.Egrave=611,e.racute=333,e.omacron=500,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=326,e.eogonek=444,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=444,e.zacute=444,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=444,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=500,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=611,e.dcroat=500,e.threequarters=750,e.Scedilla=556,e.lcaron=344,e.Kcommaaccent=722,e.Lacute=611,e.trademark=980,e.edotaccent=444,e.Igrave=333,e.Imacron=333,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=500,e.Uhungarumlaut=722,e.Eacute=611,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=500,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=667,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=722,e.zdotaccent=444,e.Ecaron=611,e.Iogonek=333,e.kcommaaccent=500,e.minus=564,e.Icircumflex=333,e.ncaron=500,e.tcommaaccent=278,e.logicalnot=564,e.odieresis=500,e.udieresis=500,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=444,e.ncommaaccent=500,e.onesuperior=300,e.imacron=278,e.Euro=500})),e["Times-Bold"]=(0,n.getLookupTableFactory)((function(e){e.space=250,e.exclam=333,e.quotedbl=555,e.numbersign=500,e.dollar=500,e.percent=1e3,e.ampersand=833,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=570,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=570,e.equal=570,e.greater=570,e.question=500,e.at=930,e.A=722,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=778,e.I=389,e.J=500,e.K=778,e.L=667,e.M=944,e.N=722,e.O=778,e.P=611,e.Q=778,e.R=722,e.S=556,e.T=667,e.U=722,e.V=722,e.W=1e3,e.X=722,e.Y=722,e.Z=667,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=581,e.underscore=500,e.quoteleft=333,e.a=500,e.b=556,e.c=444,e.d=556,e.e=444,e.f=333,e.g=500,e.h=556,e.i=278,e.j=333,e.k=556,e.l=278,e.m=833,e.n=556,e.o=500,e.p=556,e.q=556,e.r=444,e.s=389,e.t=333,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=444,e.braceleft=394,e.bar=220,e.braceright=394,e.asciitilde=520,e.exclamdown=333,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=278,e.quotedblleft=500,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=540,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=300,e.Lslash=667,e.Oslash=778,e.OE=1e3,e.ordmasculine=330,e.ae=722,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=556,e.Idieresis=389,e.eacute=444,e.abreve=500,e.uhungarumlaut=556,e.ecaron=444,e.Ydieresis=722,e.divide=570,e.Yacute=722,e.Acircumflex=722,e.aacute=500,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=747,e.Emacron=667,e.ccaron=444,e.aring=500,e.Ncommaaccent=722,e.lacute=278,e.agrave=500,e.Tcommaaccent=667,e.Cacute=722,e.atilde=500,e.Edotaccent=667,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=500,e.Amacron=722,e.rcaron=444,e.ccedilla=444,e.Zdotaccent=667,e.Thorn=611,e.Omacron=778,e.Racute=722,e.Sacute=556,e.dcaron=672,e.Umacron=722,e.uring=556,e.threesuperior=300,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=570,e.uacute=556,e.Tcaron=667,e.partialdiff=494,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=389,e.plusminus=570,e.brokenbar=220,e.registered=747,e.Gbreve=778,e.Idotaccent=389,e.summation=600,e.Egrave=667,e.racute=444,e.omacron=500,e.Zacute=667,e.Zcaron=667,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=416,e.eogonek=444,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=444,e.zacute=444,e.iogonek=278,e.Oacute=778,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=300,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=667,e.dcroat=556,e.threequarters=750,e.Scedilla=556,e.lcaron=394,e.Kcommaaccent=778,e.Lacute=667,e.trademark=1e3,e.edotaccent=444,e.Igrave=389,e.Imacron=389,e.Lcaron=667,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=778,e.degree=400,e.ograve=500,e.Ccaron=722,e.ugrave=556,e.radical=549,e.Dcaron=722,e.rcommaaccent=444,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=722,e.Lcommaaccent=667,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=444,e.Ecaron=667,e.Iogonek=389,e.kcommaaccent=556,e.minus=570,e.Icircumflex=389,e.ncaron=556,e.tcommaaccent=333,e.logicalnot=570,e.odieresis=500,e.udieresis=556,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=444,e.ncommaaccent=556,e.onesuperior=300,e.imacron=278,e.Euro=500})),e["Times-BoldItalic"]=(0,n.getLookupTableFactory)((function(e){e.space=250,e.exclam=389,e.quotedbl=555,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=570,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=570,e.equal=570,e.greater=570,e.question=500,e.at=832,e.A=667,e.B=667,e.C=667,e.D=722,e.E=667,e.F=667,e.G=722,e.H=778,e.I=389,e.J=500,e.K=667,e.L=611,e.M=889,e.N=722,e.O=722,e.P=611,e.Q=722,e.R=667,e.S=556,e.T=611,e.U=722,e.V=667,e.W=889,e.X=667,e.Y=611,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=570,e.underscore=500,e.quoteleft=333,e.a=500,e.b=500,e.c=444,e.d=500,e.e=444,e.f=333,e.g=500,e.h=556,e.i=278,e.j=278,e.k=500,e.l=278,e.m=778,e.n=556,e.o=500,e.p=500,e.q=500,e.r=389,e.s=389,e.t=278,e.u=556,e.v=444,e.w=667,e.x=500,e.y=444,e.z=389,e.braceleft=348,e.bar=220,e.braceright=348,e.asciitilde=570,e.exclamdown=389,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=278,e.quotedblleft=500,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=500,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=944,e.ordfeminine=266,e.Lslash=611,e.Oslash=722,e.OE=944,e.ordmasculine=300,e.ae=722,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=500,e.Idieresis=389,e.eacute=444,e.abreve=500,e.uhungarumlaut=556,e.ecaron=444,e.Ydieresis=611,e.divide=570,e.Yacute=611,e.Acircumflex=667,e.aacute=500,e.Ucircumflex=722,e.yacute=444,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=747,e.Emacron=667,e.ccaron=444,e.aring=500,e.Ncommaaccent=722,e.lacute=278,e.agrave=500,e.Tcommaaccent=611,e.Cacute=667,e.atilde=500,e.Edotaccent=667,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=494,e.Rcaron=667,e.Gcommaaccent=722,e.ucircumflex=556,e.acircumflex=500,e.Amacron=667,e.rcaron=389,e.ccedilla=444,e.Zdotaccent=611,e.Thorn=611,e.Omacron=722,e.Racute=667,e.Sacute=556,e.dcaron=608,e.Umacron=722,e.uring=556,e.threesuperior=300,e.Ograve=722,e.Agrave=667,e.Abreve=667,e.multiply=570,e.uacute=556,e.Tcaron=611,e.partialdiff=494,e.ydieresis=444,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=389,e.plusminus=570,e.brokenbar=220,e.registered=747,e.Gbreve=722,e.Idotaccent=389,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=500,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=366,e.eogonek=444,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=444,e.zacute=389,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=576,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=667,e.dcroat=500,e.threequarters=750,e.Scedilla=556,e.lcaron=382,e.Kcommaaccent=667,e.Lacute=611,e.trademark=1e3,e.edotaccent=444,e.Igrave=389,e.Imacron=389,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=556,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=667,e.Lcommaaccent=611,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=722,e.zdotaccent=389,e.Ecaron=667,e.Iogonek=389,e.kcommaaccent=500,e.minus=606,e.Icircumflex=389,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=606,e.odieresis=500,e.udieresis=556,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=389,e.ncommaaccent=556,e.onesuperior=300,e.imacron=278,e.Euro=500})),e["Times-Italic"]=(0,n.getLookupTableFactory)((function(e){e.space=250,e.exclam=333,e.quotedbl=420,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=675,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=675,e.equal=675,e.greater=675,e.question=500,e.at=920,e.A=611,e.B=611,e.C=667,e.D=722,e.E=611,e.F=611,e.G=722,e.H=722,e.I=333,e.J=444,e.K=667,e.L=556,e.M=833,e.N=667,e.O=722,e.P=611,e.Q=722,e.R=611,e.S=500,e.T=556,e.U=722,e.V=611,e.W=833,e.X=611,e.Y=556,e.Z=556,e.bracketleft=389,e.backslash=278,e.bracketright=389,e.asciicircum=422,e.underscore=500,e.quoteleft=333,e.a=500,e.b=500,e.c=444,e.d=500,e.e=444,e.f=278,e.g=500,e.h=500,e.i=278,e.j=278,e.k=444,e.l=278,e.m=722,e.n=500,e.o=500,e.p=500,e.q=500,e.r=389,e.s=389,e.t=278,e.u=500,e.v=444,e.w=667,e.x=444,e.y=444,e.z=389,e.braceleft=400,e.bar=275,e.braceright=400,e.asciitilde=541,e.exclamdown=389,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=214,e.quotedblleft=556,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=523,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=556,e.quotedblright=556,e.guillemotright=500,e.ellipsis=889,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=889,e.AE=889,e.ordfeminine=276,e.Lslash=556,e.Oslash=722,e.OE=944,e.ordmasculine=310,e.ae=667,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=667,e.germandbls=500,e.Idieresis=333,e.eacute=444,e.abreve=500,e.uhungarumlaut=500,e.ecaron=444,e.Ydieresis=556,e.divide=675,e.Yacute=556,e.Acircumflex=611,e.aacute=500,e.Ucircumflex=722,e.yacute=444,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=500,e.Edieresis=611,e.Dcroat=722,e.commaaccent=250,e.copyright=760,e.Emacron=611,e.ccaron=444,e.aring=500,e.Ncommaaccent=667,e.lacute=278,e.agrave=500,e.Tcommaaccent=556,e.Cacute=667,e.atilde=500,e.Edotaccent=611,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=471,e.Rcaron=611,e.Gcommaaccent=722,e.ucircumflex=500,e.acircumflex=500,e.Amacron=611,e.rcaron=389,e.ccedilla=444,e.Zdotaccent=556,e.Thorn=611,e.Omacron=722,e.Racute=611,e.Sacute=500,e.dcaron=544,e.Umacron=722,e.uring=500,e.threesuperior=300,e.Ograve=722,e.Agrave=611,e.Abreve=611,e.multiply=675,e.uacute=500,e.Tcaron=556,e.partialdiff=476,e.ydieresis=444,e.Nacute=667,e.icircumflex=278,e.Ecircumflex=611,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=500,e.umacron=500,e.Ncaron=667,e.Iacute=333,e.plusminus=675,e.brokenbar=275,e.registered=760,e.Gbreve=722,e.Idotaccent=333,e.summation=600,e.Egrave=611,e.racute=389,e.omacron=500,e.Zacute=556,e.Zcaron=556,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=300,e.eogonek=444,e.Uogonek=722,e.Aacute=611,e.Adieresis=611,e.egrave=444,e.zacute=389,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=500,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=611,e.dcroat=500,e.threequarters=750,e.Scedilla=500,e.lcaron=300,e.Kcommaaccent=667,e.Lacute=556,e.trademark=980,e.edotaccent=444,e.Igrave=333,e.Imacron=333,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=500,e.Uhungarumlaut=722,e.Eacute=611,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=500,e.Scommaaccent=500,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=500,e.radical=453,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=667,e.otilde=500,e.Rcommaaccent=611,e.Lcommaaccent=556,e.Atilde=611,e.Aogonek=611,e.Aring=611,e.Otilde=722,e.zdotaccent=389,e.Ecaron=611,e.Iogonek=333,e.kcommaaccent=444,e.minus=675,e.Icircumflex=333,e.ncaron=500,e.tcommaaccent=278,e.logicalnot=675,e.odieresis=500,e.udieresis=500,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=389,e.ncommaaccent=500,e.onesuperior=300,e.imacron=278,e.Euro=500})),e.ZapfDingbats=(0,n.getLookupTableFactory)((function(e){e.space=278,e.a1=974,e.a2=961,e.a202=974,e.a3=980,e.a4=719,e.a5=789,e.a119=790,e.a118=791,e.a117=690,e.a11=960,e.a12=939,e.a13=549,e.a14=855,e.a15=911,e.a16=933,e.a105=911,e.a17=945,e.a18=974,e.a19=755,e.a20=846,e.a21=762,e.a22=761,e.a23=571,e.a24=677,e.a25=763,e.a26=760,e.a27=759,e.a28=754,e.a6=494,e.a7=552,e.a8=537,e.a9=577,e.a10=692,e.a29=786,e.a30=788,e.a31=788,e.a32=790,e.a33=793,e.a34=794,e.a35=816,e.a36=823,e.a37=789,e.a38=841,e.a39=823,e.a40=833,e.a41=816,e.a42=831,e.a43=923,e.a44=744,e.a45=723,e.a46=749,e.a47=790,e.a48=792,e.a49=695,e.a50=776,e.a51=768,e.a52=792,e.a53=759,e.a54=707,e.a55=708,e.a56=682,e.a57=701,e.a58=826,e.a59=815,e.a60=789,e.a61=789,e.a62=707,e.a63=687,e.a64=696,e.a65=689,e.a66=786,e.a67=787,e.a68=713,e.a69=791,e.a70=785,e.a71=791,e.a72=873,e.a73=761,e.a74=762,e.a203=762,e.a75=759,e.a204=759,e.a76=892,e.a77=892,e.a78=788,e.a79=784,e.a81=438,e.a82=138,e.a83=277,e.a84=415,e.a97=392,e.a98=392,e.a99=668,e.a100=668,e.a89=390,e.a90=390,e.a93=317,e.a94=317,e.a91=276,e.a92=276,e.a205=509,e.a85=509,e.a206=410,e.a86=410,e.a87=234,e.a88=234,e.a95=334,e.a96=334,e.a101=732,e.a102=544,e.a103=544,e.a104=910,e.a106=667,e.a107=760,e.a108=760,e.a112=776,e.a111=595,e.a110=694,e.a109=626,e.a120=788,e.a121=788,e.a122=788,e.a123=788,e.a124=788,e.a125=788,e.a126=788,e.a127=788,e.a128=788,e.a129=788,e.a130=788,e.a131=788,e.a132=788,e.a133=788,e.a134=788,e.a135=788,e.a136=788,e.a137=788,e.a138=788,e.a139=788,e.a140=788,e.a141=788,e.a142=788,e.a143=788,e.a144=788,e.a145=788,e.a146=788,e.a147=788,e.a148=788,e.a149=788,e.a150=788,e.a151=788,e.a152=788,e.a153=788,e.a154=788,e.a155=788,e.a156=788,e.a157=788,e.a158=788,e.a159=788,e.a160=894,e.a161=838,e.a163=1016,e.a164=458,e.a196=748,e.a165=924,e.a192=748,e.a166=918,e.a167=927,e.a168=928,e.a169=928,e.a170=834,e.a171=873,e.a172=828,e.a173=924,e.a162=924,e.a174=917,e.a175=930,e.a176=931,e.a177=463,e.a178=883,e.a179=836,e.a193=836,e.a180=867,e.a199=867,e.a181=696,e.a200=696,e.a182=874,e.a201=874,e.a183=760,e.a184=946,e.a197=771,e.a185=865,e.a194=771,e.a198=888,e.a186=967,e.a195=888,e.a187=831,e.a188=873,e.a189=927,e.a190=970,e.a191=918}))}));t.getMetrics=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MurmurHash3_64=void 0;var n=r(5);function a(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>>8,t[r++]=255&o)}}else{if(!(0,n.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e,r=t.byteLength}for(var s=r>>2,u=r-4*s,h=new Uint32Array(t.buffer,0,s),f=0,d=0,p=this.h1,g=this.h2,m=3432918353,v=461845907,b=m&l,y=v&l,w=0;w>>17,f=f*v&c|f*y&l,p^=f,p=p<<13|p>>>19,p=5*p+3864292196):(d=h[w],d=d*m&c|d*b&l,d=d<<15|d>>>17,d=d*v&c|d*y&l,g^=d,g=g<<13|g>>>19,g=5*g+3864292196);switch(f=0,u){case 3:f^=t[4*s+2]<<16;case 2:f^=t[4*s+1]<<8;case 1:f^=t[4*s],f=f*m&c|f*b&l,f=f<<15|f>>>17,f=f*v&c|f*y&l,1&s?p^=f:g^=f}this.h1=p,this.h2=g}},{key:"hexdigest",value:function(){var e=this.h1,t=this.h2;e^=t>>>1,e=3981806797*e&c|36045*e&l,t=4283543511*t&c|(2950163797*(t<<16|e>>>16)&c)>>>16,e^=t>>>1,e=444984403*e&c|60499*e&l,t=3301882366*t&c|(3120437893*(t<<16|e>>>16)&c)>>>16,e^=t>>>1;var r=(e>>>0).toString(16),n=(t>>>0).toString(16);return r.padStart(8,"0")+n.padStart(8,"0")}}]),e}();t.MurmurHash3_64=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFImage=void 0;var n=u(r(2)),a=r(5),i=r(202),o=r(220),s=r(209),c=r(215),l=r(218);function u(e){return e&&e.__esModule?e:{default:e}}function h(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,a)}function f(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){h(i,n,a,o,s,"next",e)}function s(e){h(i,n,a,o,s,"throw",e)}o(void 0)}))}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;rn&&(e=n),e}function v(e,t,r,n,a,i){var o,s=a*i;o=t<=8?new Uint8Array(s):t<=16?new Uint16Array(s):new Uint32Array(s);var c,l,u,h,f=r/a,d=n/i,p=0,g=new Uint16Array(a),m=r;for(c=0;c0&&Number.isInteger(s.height)&&s.height>0&&(s.width!==x||s.height!==C)&&((0,a.warn)("PDFImage - using the Width/Height of the image data, rather than the image dictionary."),x=s.width,C=s.height),x<1||C<1)throw new a.FormatError("Invalid image width: ".concat(x," or height: ").concat(C));this.width=x,this.height=C,this.interpolate=w.get("Interpolate","I")||!1,this.imageMask=w.get("ImageMask","IM")||!1,this.matte=w.get("Matte")||!1;var A=s.bitsPerComponent;if(!A&&(A=w.get("BitsPerComponent","BPC"),!A)){if(!this.imageMask)throw new a.FormatError("Bits per component missing in image: ".concat(this.imageMask));A=1}if(this.bpc=A,!this.imageMask){var E=w.getRaw("ColorSpace")||w.getRaw("CS");if(!E)switch((0,a.info)("JPX images (which do not require color spaces)"),s.numComps){case 1:E=i.Name.get("DeviceGray");break;case 3:E=i.Name.get("DeviceRGB");break;case 4:E=i.Name.get("DeviceCMYK");break;default:throw new Error("JPX images with ".concat(s.numComps," ")+"color components not supported.")}this.colorSpace=o.ColorSpace.parse({cs:E,xref:r,resources:u?n:null,pdfFunctionFactory:b,localColorSpaceCache:y}),this.numComps=this.colorSpace.numComps}if(this.decode=w.getArray("Decode","D"),this.needsDecode=!1,this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,A)||v&&!o.ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=!0;var O=(1<>7&1,r[f+1]=l>>6&1,r[f+2]=l>>5&1,r[f+3]=l>>4&1,r[f+4]=l>>3&1,r[f+5]=l>>2&1,r[f+6]=l>>1&1,r[f+7]=1&l,f+=8;if(f>=1}}else{var v=0;for(l=0,f=0,c=o;f>b;y<0?y=0:y>h&&(y=h),r[f]=y,l&=(1<p[w+1]){m=255;break}}s[u]=m}}if(s)for(u=0,f=3,h=r*i;u0&&void 0!==arguments[0]&&arguments[0],r=this.drawWidth,n=this.drawHeight,i={width:r,height:n,kind:0,data:null},o=this.numComps,l=this.width,u=this.height,h=this.bpc,f=l*o*h+7>>3;if(!t){var d;if("DeviceGray"===this.colorSpace.name&&1===h?d=a.ImageKind.GRAYSCALE_1BPP:"DeviceRGB"!==this.colorSpace.name||8!==h||this.needsDecode||(d=a.ImageKind.RGB_24BPP),d&&!this.smask&&!this.mask&&r===l&&n===u){if(i.kind=d,e=this.getImageBytes(u*f),this.image instanceof s.DecodeStream)i.data=e;else{var p=new Uint8ClampedArray(e.length);p.set(e),i.data=p}if(this.needsDecode){(0,a.assert)(d===a.ImageKind.GRAYSCALE_1BPP,"PDFImage.createImageData: The image must be grayscale.");for(var g=i.data,m=0,v=g.length;m>3,l=this.getImageBytes(o*c),u=this.getComponents(l);if(1!==s){this.needsDecode&&this.decodeBuffer(u),n=i*o;var h=255/((1<3&&void 0!==arguments[3]&&arguments[3];return this.image.reset(),this.image.drawWidth=t||this.width,this.image.drawHeight=r||this.height,this.image.forceRGB=!!n,this.image.getBytes(e,!0)}},{key:"drawWidth",get:function(){return Math.max(this.width,this.smask&&this.smask.width||0,this.mask&&this.mask.width||0)}},{key:"drawHeight",get:function(){return Math.max(this.height,this.smask&&this.smask.height||0,this.mask&&this.mask.height||0)}}],[{key:"buildImage",value:function(){var t=f(n["default"].mark((function t(r){var o,s,c,l,u,h,f,d,p,g,m,v;return n["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return o=r.xref,s=r.res,c=r.image,l=r.isInline,u=void 0!==l&&l,h=r.pdfFunctionFactory,f=r.localColorSpaceCache,d=c,p=null,g=null,m=c.dict.get("SMask"),v=c.dict.get("Mask"),m?p=m:v&&((0,i.isStream)(v)||Array.isArray(v)?g=v:(0,a.warn)("Unsupported mask format.")),t.abrupt("return",new e({xref:o,res:s,image:d,isInline:u,smask:p,mask:g,pdfFunctionFactory:h,localColorSpaceCache:f}));case 8:case"end":return t.stop()}}),t)})));function r(e){return t.apply(this,arguments)}return r}()},{key:"createMask",value:function(e){var t,r,n=e.imgArray,a=e.width,i=e.height,o=e.imageIsFromDecodeStream,s=e.inverseDecode,c=(a+7>>3)*i,l=n.byteLength,u=c===l;if(!o||s&&!u)if(s)for(t=new Uint8ClampedArray(c),t.set(n),r=l;r1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2?arguments[2]:void 0;if(!this.isCancelled){var c=this.desiredSize;this.desiredSize-=r,c>0&&this.desiredSize<=0&&(this.sinkCapability=(0,a.createPromiseCapability)(),this.ready=this.sinkCapability.promise),t._postMessage({sourceName:i,targetName:o,stream:d.ENQUEUE,streamId:n,chunk:e},s)}},close:function(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:o,stream:d.CLOSE,streamId:n}),delete t.streamSinks[n])},error:function(e){(0,a.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:o,stream:d.ERROR,streamId:n,reason:p(e)}))},sinkCapability:(0,a.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[n]=c,new Promise((function(t){t(r(e.data,c))})).then((function(){s.postMessage({sourceName:i,targetName:o,stream:d.START_COMPLETE,streamId:n,success:!0})}),(function(e){s.postMessage({sourceName:i,targetName:o,stream:d.START_COMPLETE,streamId:n,reason:p(e)})}))}},{key:"_processStreamMessage",value:function(e){var t=e.streamId,r=this.sourceName,n=e.sourceName,i=this.comObj;switch(e.stream){case d.START_COMPLETE:e.success?this.streamControllers[t].startCall.resolve():this.streamControllers[t].startCall.reject(p(e.reason));break;case d.PULL_COMPLETE:e.success?this.streamControllers[t].pullCall.resolve():this.streamControllers[t].pullCall.reject(p(e.reason));break;case d.PULL:if(!this.streamSinks[t]){i.postMessage({sourceName:r,targetName:n,stream:d.PULL_COMPLETE,streamId:t,success:!0});break}this.streamSinks[t].desiredSize<=0&&e.desiredSize>0&&this.streamSinks[t].sinkCapability.resolve(),this.streamSinks[t].desiredSize=e.desiredSize;var o=this.streamSinks[e.streamId].onPull;new Promise((function(e){e(o&&o())})).then((function(){i.postMessage({sourceName:r,targetName:n,stream:d.PULL_COMPLETE,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:r,targetName:n,stream:d.PULL_COMPLETE,streamId:t,reason:p(e)})}));break;case d.ENQUEUE:if((0,a.assert)(this.streamControllers[t],"enqueue should have stream controller"),this.streamControllers[t].isClosed)break;this.streamControllers[t].controller.enqueue(e.chunk);break;case d.CLOSE:if((0,a.assert)(this.streamControllers[t],"close should have stream controller"),this.streamControllers[t].isClosed)break;this.streamControllers[t].isClosed=!0,this.streamControllers[t].controller.close(),this._deleteStreamController(t);break;case d.ERROR:(0,a.assert)(this.streamControllers[t],"error should have stream controller"),this.streamControllers[t].controller.error(p(e.reason)),this._deleteStreamController(t);break;case d.CANCEL_COMPLETE:e.success?this.streamControllers[t].cancelCall.resolve():this.streamControllers[t].cancelCall.reject(p(e.reason)),this._deleteStreamController(t);break;case d.CANCEL:if(!this.streamSinks[t])break;var s=this.streamSinks[e.streamId].onCancel;new Promise((function(t){t(s&&s(p(e.reason)))})).then((function(){i.postMessage({sourceName:r,targetName:n,stream:d.CANCEL_COMPLETE,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:r,targetName:n,stream:d.CANCEL_COMPLETE,streamId:t,reason:p(e)})})),this.streamSinks[t].sinkCapability.reject(p(e.reason)),this.streamSinks[t].isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}},{key:"_deleteStreamController",value:function(){var e=s(n["default"].mark((function e(t){return n["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Promise.allSettled([this.streamControllers[t].startCall,this.streamControllers[t].pullCall,this.streamControllers[t].cancelCall].map((function(e){return e&&e.promise})));case 2:delete this.streamControllers[t];case 3:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_postMessage",value:function(e,t){t&&this.postMessageTransfers?this.comObj.postMessage(e,t):this.comObj.postMessage(e)}},{key:"destroy",value:function(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}]),e}();t.MessageHandler=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFWorkerStream=void 0;var n=i(r(2)),a=r(5);function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,a)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function s(e){o(i,n,a,s,c,"next",e)}function c(e){o(i,n,a,s,c,"throw",e)}s(void 0)}))}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var r=0;r