(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[824],{78783:function(module,__unused_webpack_exports,__webpack_require__){var Buffer=__webpack_require__(82473).Buffer,process=__webpack_require__(94692);/** * @licstart The following is the entire license notice for the * Javascript code in this page * * Copyright 2021 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @licend The above is the entire license notice for the * Javascript code in this page */!function(u,A){module.exports=A()}(0,function(){return(()=>{var __webpack_modules__=[,(u,A,T)=>{"use strict";function _typeof(u){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(u)}Object.defineProperty(A,"__esModule",{value:!0}),A.StatTimer=A.RenderingCancelledException=A.PixelsPerInch=A.PageViewport=A.PDFDateString=A.LinkTarget=A.DOMStandardFontDataFactory=A.DOMSVGFactory=A.DOMCanvasFactory=A.DOMCMapReaderFactory=void 0,A.addLinkAttributes=addLinkAttributes,A.deprecated=deprecated,A.getFilenameFromUrl=getFilenameFromUrl,A.getPdfFilenameFromUrl=getPdfFilenameFromUrl,A.getXfaPageViewport=getXfaPageViewport,A.isDataScheme=isDataScheme,A.isPdfFile=isPdfFile,A.isValidFetchUrl=isValidFetchUrl,A.loadScript=loadScript;var E,I=_interopRequireDefault(T(2)),D=T(4),L=T(135);function _interopRequireDefault(u){return u&&u.__esModule?u:{default:u}}function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T0&&void 0!==arguments[0]?arguments[0]:{},E=T.ownerDocument,I=void 0===E?globalThis.document:E;return _classCallCheck(this,DOMCanvasFactory),(u=A.call(this))._document=I,u}return _createClass(DOMCanvasFactory,[{key:"_createCanvas",value:function(u,A){var T=this._document.createElement("canvas");return T.width=u,T.height=A,T}}]),DOMCanvasFactory}(L.BaseCanvasFactory);function fetchData(u){return _fetchData.apply(this,arguments)}function _fetchData(){return(_fetchData=_asyncToGenerator(I.default.mark(function _callee(u){var A,T,E=arguments;return I.default.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(A=E.length>1&&void 0!==E[1]&&E[1],!isValidFetchUrl(u,document.baseURI)){I.next=21;break}return I.next=4,fetch(u);case 4:if((T=I.sent).ok){I.next=7;break}throw Error(T.statusText);case 7:if(!A){I.next=15;break}return I.t1=Uint8Array,I.next=11,T.arrayBuffer();case 11:I.t2=I.sent,I.t0=new I.t1(I.t2),I.next=20;break;case 15:return I.t3=D.stringToBytes,I.next=18,T.text();case 18:I.t4=I.sent,I.t0=(0,I.t3)(I.t4);case 20:return I.abrupt("return",I.t0);case 21:return I.abrupt("return",new Promise(function(T,E){var I=new XMLHttpRequest;I.open("GET",u,!0),A&&(I.responseType="arraybuffer"),I.onreadystatechange=function(){if(I.readyState===XMLHttpRequest.DONE){if(200===I.status||0===I.status){var u;if(A&&I.response?u=new Uint8Array(I.response):!A&&I.responseText&&(u=(0,D.stringToBytes)(I.responseText)),u){T(u);return}}E(Error(I.statusText))}},I.send(null)}));case 22:case"end":return I.stop()}},_callee)}))).apply(this,arguments)}A.DOMCanvasFactory=H;var Q=function(u){_inherits(DOMCMapReaderFactory,u);var A=_createSuper(DOMCMapReaderFactory);function DOMCMapReaderFactory(){return _classCallCheck(this,DOMCMapReaderFactory),A.apply(this,arguments)}return _createClass(DOMCMapReaderFactory,[{key:"_fetchData",value:function(u,A){return fetchData(u,this.isCompressed).then(function(u){return{cMapData:u,compressionType:A}})}}]),DOMCMapReaderFactory}(L.BaseCMapReaderFactory);A.DOMCMapReaderFactory=Q;var K=function(u){_inherits(DOMStandardFontDataFactory,u);var A=_createSuper(DOMStandardFontDataFactory);function DOMStandardFontDataFactory(){return _classCallCheck(this,DOMStandardFontDataFactory),A.apply(this,arguments)}return _createClass(DOMStandardFontDataFactory,[{key:"_fetchData",value:function(u){return fetchData(u,!0)}}]),DOMStandardFontDataFactory}(L.BaseStandardFontDataFactory);A.DOMStandardFontDataFactory=K;var J=function(u){_inherits(DOMSVGFactory,u);var A=_createSuper(DOMSVGFactory);function DOMSVGFactory(){return _classCallCheck(this,DOMSVGFactory),A.apply(this,arguments)}return _createClass(DOMSVGFactory,[{key:"_createSVG",value:function(u){return document.createElementNS(N,u)}}]),DOMSVGFactory}(L.BaseSVGFactory);A.DOMSVGFactory=J;var ee=function(){function PageViewport(u){var A,T,E,I,D,L,W,N,U=u.viewBox,H=u.scale,Q=u.rotation,K=u.offsetX,J=void 0===K?0:K,ee=u.offsetY,et=void 0===ee?0:ee,er=u.dontFlip,en=void 0!==er&&er;_classCallCheck(this,PageViewport),this.viewBox=U,this.scale=H,this.rotation=Q,this.offsetX=J,this.offsetY=et;var ea=(U[2]+U[0])/2,eo=(U[3]+U[1])/2;switch((Q%=360)<0&&(Q+=360),Q){case 180:A=-1,T=0,E=0,I=1;break;case 90:A=0,T=1,E=1,I=0;break;case 270:A=0,T=-1,E=-1,I=0;break;case 0:A=1,T=0,E=0,I=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}en&&(E=-E,I=-I),0===A?(D=Math.abs(eo-U[1])*H+J,L=Math.abs(ea-U[0])*H+et,W=Math.abs(U[3]-U[1])*H,N=Math.abs(U[2]-U[0])*H):(D=Math.abs(ea-U[0])*H+J,L=Math.abs(eo-U[1])*H+et,W=Math.abs(U[2]-U[0])*H,N=Math.abs(U[3]-U[1])*H),this.transform=[A*H,T*H,E*H,I*H,D-A*H*ea-E*H*eo,L-T*H*ea-I*H*eo],this.width=W,this.height=N}return _createClass(PageViewport,[{key:"clone",value:function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},A=u.scale,T=void 0===A?this.scale:A,E=u.rotation,I=void 0===E?this.rotation:E,D=u.offsetX,L=void 0===D?this.offsetX:D,W=u.offsetY,N=void 0===W?this.offsetY:W,U=u.dontFlip,H=void 0!==U&&U;return new PageViewport({viewBox:this.viewBox.slice(),scale:T,rotation:I,offsetX:L,offsetY:N,dontFlip:H})}},{key:"convertToViewportPoint",value:function(u,A){return D.Util.applyTransform([u,A],this.transform)}},{key:"convertToViewportRectangle",value:function(u){var A=D.Util.applyTransform([u[0],u[1]],this.transform),T=D.Util.applyTransform([u[2],u[3]],this.transform);return[A[0],A[1],T[0],T[1]]}},{key:"convertToPdfPoint",value:function(u,A){return D.Util.applyInverseTransform([u,A],this.transform)}}]),PageViewport}();A.PageViewport=ee;var et=function(u){_inherits(RenderingCancelledException,u);var A=_createSuper(RenderingCancelledException);function RenderingCancelledException(u,T){var E;return _classCallCheck(this,RenderingCancelledException),(E=A.call(this,u,"RenderingCancelledException")).type=T,E}return RenderingCancelledException}(D.BaseException);A.RenderingCancelledException=et;var er={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};function addLinkAttributes(u){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},T=A.url,E=A.target,I=A.rel,L=A.enabled,N=void 0===L||L;(0,D.assert)(T&&"string"==typeof T,'addLinkAttributes: A valid "url" parameter must provided.');var U=(0,D.removeNullCharacters)(T);N?u.href=u.title=U:(u.href="",u.title="Disabled: ".concat(U),u.onclick=function(){return!1});var H="";switch(E){case er.NONE:break;case er.SELF:H="_self";break;case er.BLANK:H="_blank";break;case er.PARENT:H="_parent";break;case er.TOP:H="_top"}u.target=H,u.rel="string"==typeof I?I:W}function isDataScheme(u){for(var A=u.length,T=0;T0?A:u.length,T>0?T:u.length);return u.substring(u.lastIndexOf("/",E)+1,E)}function getPdfFilenameFromUrl(u){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof u)return A;if(isDataScheme(u))return(0,D.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),A;var T=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,E=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(u),I=T.exec(E[1])||T.exec(E[2])||T.exec(E[3]);if(I&&(I=I[0]).includes("%"))try{I=T.exec(decodeURIComponent(I))[0]}catch(u){}return I||A}A.LinkTarget=er;var en=function(){function StatTimer(){_classCallCheck(this,StatTimer),this.started=Object.create(null),this.times=[]}return _createClass(StatTimer,[{key:"time",value:function(u){u in this.started&&(0,D.warn)("Timer is already running for ".concat(u)),this.started[u]=Date.now()}},{key:"timeEnd",value:function(u){u in this.started||(0,D.warn)("Timer has not been started for ".concat(u)),this.times.push({name:u,start:this.started[u],end:Date.now()}),delete this.started[u]}},{key:"toString",value:function(){var u,A=[],T=0,E=_createForOfIteratorHelper(this.times);try{for(E.s();!(u=E.n()).done;){var I=u.value.name;I.length>T&&(T=I.length)}}catch(u){E.e(u)}finally{E.f()}var D,L=_createForOfIteratorHelper(this.times);try{for(L.s();!(D=L.n()).done;){var W=D.value,N=W.end-W.start;A.push("".concat(W.name.padEnd(T)," ").concat(N,"ms\n"))}}catch(u){L.e(u)}finally{L.f()}return A.join("")}}]),StatTimer}();function isValidFetchUrl(u,A){try{var T=(A?new URL(u,A):new URL(u)).protocol;return"http:"===T||"https:"===T}catch(u){return!1}}function loadScript(u){var A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(function(T,E){var I=document.createElement("script");I.src=u,I.onload=function(u){A&&I.remove(),T(u)},I.onerror=function(){E(Error("Cannot load script at: ".concat(I.src)))},(document.head||document.documentElement).appendChild(I)})}function deprecated(u){console.log("Deprecated API usage: "+u)}A.StatTimer=en;var ea=function(){function PDFDateString(){_classCallCheck(this,PDFDateString)}return _createClass(PDFDateString,null,[{key:"toDateObject",value:function(u){if(!u||!(0,D.isString)(u))return null;E||(E=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));var A=E.exec(u);if(!A)return null;var T=parseInt(A[1],10),I=parseInt(A[2],10);I=I>=1&&I<=12?I-1:0;var L=parseInt(A[3],10);L=L>=1&&L<=31?L:1;var W=parseInt(A[4],10);W=W>=0&&W<=23?W:0;var N=parseInt(A[5],10);N=N>=0&&N<=59?N:0;var U=parseInt(A[6],10);U=U>=0&&U<=59?U:0;var H=A[7]||"Z",Q=parseInt(A[8],10);Q=Q>=0&&Q<=23?Q:0;var K=parseInt(A[9],10)||0;return K=K>=0&&K<=59?K:0,"-"===H?(W+=Q,N+=K):"+"===H&&(W-=Q,N-=K),new Date(Date.UTC(T,I,L,W,N,U))}}]),PDFDateString}();function getXfaPageViewport(u,A){var T=A.scale,E=void 0===T?1:T,I=A.rotation,D=void 0===I?0:I,L=u.attributes.style,W=L.width,N=L.height,U=[0,0,parseInt(W),parseInt(N)];return new ee({viewBox:U,scale:E,rotation:D})}A.PDFDateString=ea},(u,A,T)=>{"use strict";u.exports=T(3)},(u,A,T)=>{"use strict";function _typeof(u){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(u)}u=T.nmd(u);var E=function(u){var A,T=Object.prototype,E=T.hasOwnProperty,I="function"==typeof Symbol?Symbol:{},D=I.iterator||"@@iterator",L=I.asyncIterator||"@@asyncIterator",W=I.toStringTag||"@@toStringTag";function define(u,A,T){return Object.defineProperty(u,A,{value:T,enumerable:!0,configurable:!0,writable:!0}),u[A]}try{define({},"")}catch(u){define=function(u,A,T){return u[A]=T}}function wrap(u,A,T,E){var I=Object.create((A&&A.prototype instanceof Generator?A:Generator).prototype),D=new Context(E||[]);return I._invoke=makeInvokeMethod(u,T,D),I}function tryCatch(u,A,T){try{return{type:"normal",arg:u.call(A,T)}}catch(u){return{type:"throw",arg:u}}}u.wrap=wrap;var N="suspendedStart",U="suspendedYield",H="executing",Q="completed",K={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var J={};define(J,D,function(){return this});var ee=Object.getPrototypeOf,et=ee&&ee(ee(values([])));et&&et!==T&&E.call(et,D)&&(J=et);var er=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(J);function defineIteratorMethods(u){["next","throw","return"].forEach(function(A){define(u,A,function(u){return this._invoke(A,u)})})}function AsyncIterator(u,A){var T;function invoke(T,I,D,L){var W=tryCatch(u[T],u,I);if("throw"===W.type)L(W.arg);else{var N=W.arg,U=N.value;return U&&"object"===_typeof(U)&&E.call(U,"__await")?A.resolve(U.__await).then(function(u){invoke("next",u,D,L)},function(u){invoke("throw",u,D,L)}):A.resolve(U).then(function(u){N.value=u,D(N)},function(u){return invoke("throw",u,D,L)})}}function enqueue(u,E){function callInvokeWithMethodAndArg(){return new A(function(A,T){invoke(u,E,A,T)})}return T=T?T.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}this._invoke=enqueue}function makeInvokeMethod(u,A,T){var E=N;return function(I,D){if(E===H)throw Error("Generator is already running");if(E===Q){if("throw"===I)throw D;return doneResult()}for(T.method=I,T.arg=D;;){var L=T.delegate;if(L){var W=maybeInvokeDelegate(L,T);if(W){if(W===K)continue;return W}}if("next"===T.method)T.sent=T._sent=T.arg;else if("throw"===T.method){if(E===N)throw E=Q,T.arg;T.dispatchException(T.arg)}else"return"===T.method&&T.abrupt("return",T.arg);E=H;var J=tryCatch(u,A,T);if("normal"===J.type){if(E=T.done?Q:U,J.arg===K)continue;return{value:J.arg,done:T.done}}"throw"===J.type&&(E=Q,T.method="throw",T.arg=J.arg)}}}function maybeInvokeDelegate(u,T){var E=u.iterator[T.method];if(A===E){if(T.delegate=null,"throw"===T.method){if(u.iterator.return&&(T.method="return",T.arg=A,maybeInvokeDelegate(u,T),"throw"===T.method))return K;T.method="throw",T.arg=TypeError("The iterator does not provide a 'throw' method")}return K}var I=tryCatch(E,u.iterator,T.arg);if("throw"===I.type)return T.method="throw",T.arg=I.arg,T.delegate=null,K;var D=I.arg;return D?D.done?(T[u.resultName]=D.value,T.next=u.nextLoc,"return"!==T.method&&(T.method="next",T.arg=A),T.delegate=null,K):D:(T.method="throw",T.arg=TypeError("iterator result is not an object"),T.delegate=null,K)}function pushTryEntry(u){var A={tryLoc:u[0]};1 in u&&(A.catchLoc=u[1]),2 in u&&(A.finallyLoc=u[2],A.afterLoc=u[3]),this.tryEntries.push(A)}function resetTryEntry(u){var A=u.completion||{};A.type="normal",delete A.arg,u.completion=A}function Context(u){this.tryEntries=[{tryLoc:"root"}],u.forEach(pushTryEntry,this),this.reset(!0)}function values(u){if(u){var T=u[D];if(T)return T.call(u);if("function"==typeof u.next)return u;if(!isNaN(u.length)){var I=-1,next=function next(){for(;++I=0;--I){var D=this.tryEntries[I],L=D.completion;if("root"===D.tryLoc)return handle("end");if(D.tryLoc<=this.prev){var W=E.call(D,"catchLoc"),N=E.call(D,"finallyLoc");if(W&&N){if(this.prev=0;--T){var I=this.tryEntries[T];if(I.tryLoc<=this.prev&&E.call(I,"finallyLoc")&&this.prev=0;--A){var T=this.tryEntries[A];if(T.finallyLoc===u)return this.complete(T.completion,T.afterLoc),resetTryEntry(T),K}},catch:function(u){for(var A=this.tryEntries.length-1;A>=0;--A){var T=this.tryEntries[A];if(T.tryLoc===u){var E=T.completion;if("throw"===E.type){var I=E.arg;resetTryEntry(T)}return I}}throw Error("illegal catch attempt")},delegateYield:function(u,T,E){return this.delegate={iterator:values(u),resultName:T,nextLoc:E},"next"===this.method&&(this.arg=A),K}},u}("object"===_typeof(u)?u.exports:{});try{regeneratorRuntime=E}catch(u){("undefined"==typeof globalThis?"undefined":_typeof(globalThis))==="object"?globalThis.regeneratorRuntime=E:Function("r","regeneratorRuntime = r")(E)}},(u,A,T)=>{"use strict";function _defineProperties(u,A){for(var T=0;T=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T=ec.INFOS&&console.log("Info: ".concat(u))}function warn(u){em>=ec.WARNINGS&&console.log("Warning: ".concat(u))}function unreachable(u){throw Error(u)}function assert(u,A){u||unreachable(A)}function isSameOrigin(u,A){try{if(!(T=new URL(u)).origin||"null"===T.origin)return!1}catch(u){return!1}var T,E=new URL(A,T);return T.origin===E.origin}function _isValidProtocol(u){if(!u)return!1;switch(u.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function createValidAbsoluteUrl(u){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,T=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!u)return null;try{if(T&&"string"==typeof u){if(T.addDefaultProtocol&&u.startsWith("www.")){var E=u.match(/\./g);E&&E.length>=2&&(u="http://".concat(u))}if(T.tryConvertEncoding)try{u=stringToUTF8String(u)}catch(u){}}var I=A?new URL(u,A):new URL(u);if(_isValidProtocol(I))return I}catch(u){}return null}function shadow(u,A,T){return Object.defineProperty(u,A,{value:T,enumerable:!0,configurable:!0,writable:!1}),T}var ev=function(){function BaseException(u,A){this.constructor===BaseException&&unreachable("Cannot initialize BaseException."),this.message=u,this.name=A}return BaseException.prototype=Error(),BaseException.constructor=BaseException,BaseException}();A.BaseException=ev;var ey=function(u){_inherits(PasswordException,u);var A=_createSuper(PasswordException);function PasswordException(u,T){var E;return _classCallCheck(this,PasswordException),(E=A.call(this,u,"PasswordException")).code=T,E}return PasswordException}(ev);A.PasswordException=ey;var eb=function(u){_inherits(UnknownErrorException,u);var A=_createSuper(UnknownErrorException);function UnknownErrorException(u,T){var E;return _classCallCheck(this,UnknownErrorException),(E=A.call(this,u,"UnknownErrorException")).details=T,E}return UnknownErrorException}(ev);A.UnknownErrorException=eb;var eg=function(u){_inherits(InvalidPDFException,u);var A=_createSuper(InvalidPDFException);function InvalidPDFException(u){return _classCallCheck(this,InvalidPDFException),A.call(this,u,"InvalidPDFException")}return InvalidPDFException}(ev);A.InvalidPDFException=eg;var e_=function(u){_inherits(MissingPDFException,u);var A=_createSuper(MissingPDFException);function MissingPDFException(u){return _classCallCheck(this,MissingPDFException),A.call(this,u,"MissingPDFException")}return MissingPDFException}(ev);A.MissingPDFException=e_;var eS=function(u){_inherits(UnexpectedResponseException,u);var A=_createSuper(UnexpectedResponseException);function UnexpectedResponseException(u,T){var E;return _classCallCheck(this,UnexpectedResponseException),(E=A.call(this,u,"UnexpectedResponseException")).status=T,E}return UnexpectedResponseException}(ev);A.UnexpectedResponseException=eS;var eA=function(u){_inherits(FormatError,u);var A=_createSuper(FormatError);function FormatError(u){return _classCallCheck(this,FormatError),A.call(this,u,"FormatError")}return FormatError}(ev);A.FormatError=eA;var eC=function(u){_inherits(AbortException,u);var A=_createSuper(AbortException);function AbortException(u){return _classCallCheck(this,AbortException),A.call(this,u,"AbortException")}return AbortException}(ev);A.AbortException=eC;var eR=/\x00+/g,ek=/[\x01-\x1F]/g;function removeNullCharacters(u){var A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"string"!=typeof u?(warn("The argument for removeNullCharacters must be a string."),u):(A&&(u=u.replace(ek," ")),u.replace(eR,""))}function bytesToString(u){assert(null!==u&&"object"===_typeof(u)&&void 0!==u.length,"Invalid argument for bytesToString");var A=u.length,T=8192;if(A<8192)return String.fromCharCode.apply(null,u);for(var E=[],I=0;I>24&255,u>>16&255,u>>8&255,255&u)}function objectSize(u){return Object.keys(u).length}function objectFromMap(u){var A,T=Object.create(null),E=_createForOfIteratorHelper(u);try{for(E.s();!(A=E.n()).done;){var I=_slicedToArray(A.value,2),D=I[0],L=I[1];T[D]=L}}catch(u){E.e(u)}finally{E.f()}return T}function isLittleEndian(){var u=new Uint8Array(4);return u[0]=1,1===new Uint32Array(u.buffer,0,1)[0]}var eP={get value(){return shadow(this,"value",isLittleEndian())}};function isEvalSupported(){try{return Function(""),!0}catch(u){return!1}}A.IsLittleEndianCached=eP;var eT={get value(){return shadow(this,"value",isEvalSupported())}};A.IsEvalSupportedCached=eT;var ew=_toConsumableArray(Array(256).keys()).map(function(u){return u.toString(16).padStart(2,"0")}),eE=function(){function Util(){_classCallCheck(this,Util)}return _createClass(Util,null,[{key:"makeHexColor",value:function(u,A,T){return"#".concat(ew[u]).concat(ew[A]).concat(ew[T])}},{key:"transform",value:function(u,A){return[u[0]*A[0]+u[2]*A[1],u[1]*A[0]+u[3]*A[1],u[0]*A[2]+u[2]*A[3],u[1]*A[2]+u[3]*A[3],u[0]*A[4]+u[2]*A[5]+u[4],u[1]*A[4]+u[3]*A[5]+u[5]]}},{key:"applyTransform",value:function(u,A){return[u[0]*A[0]+u[1]*A[2]+A[4],u[0]*A[1]+u[1]*A[3]+A[5]]}},{key:"applyInverseTransform",value:function(u,A){var T=A[0]*A[3]-A[1]*A[2];return[(u[0]*A[3]-u[1]*A[2]+A[2]*A[5]-A[4]*A[3])/T,(-u[0]*A[1]+u[1]*A[0]+A[4]*A[1]-A[5]*A[0])/T]}},{key:"getAxialAlignedBoundingBox",value:function(u,A){var T=Util.applyTransform(u,A),E=Util.applyTransform(u.slice(2,4),A),I=Util.applyTransform([u[0],u[3]],A),D=Util.applyTransform([u[2],u[1]],A);return[Math.min(T[0],E[0],I[0],D[0]),Math.min(T[1],E[1],I[1],D[1]),Math.max(T[0],E[0],I[0],D[0]),Math.max(T[1],E[1],I[1],D[1])]}},{key:"inverseTransform",value:function(u){var A=u[0]*u[3]-u[1]*u[2];return[u[3]/A,-u[1]/A,-u[2]/A,u[0]/A,(u[2]*u[5]-u[4]*u[3])/A,(u[4]*u[1]-u[5]*u[0])/A]}},{key:"apply3dTransform",value:function(u,A){return[u[0]*A[0]+u[1]*A[1]+u[2]*A[2],u[3]*A[0]+u[4]*A[1]+u[5]*A[2],u[6]*A[0]+u[7]*A[1]+u[8]*A[2]]}},{key:"singularValueDecompose2dScale",value:function(u){var A=[u[0],u[2],u[1],u[3]],T=u[0]*A[0]+u[1]*A[2],E=u[0]*A[1]+u[1]*A[3],I=u[2]*A[0]+u[3]*A[2],D=u[2]*A[1]+u[3]*A[3],L=(T+D)/2,W=Math.sqrt(Math.pow(T+D,2)-4*(T*D-I*E))/2;return[Math.sqrt(L+W||1),Math.sqrt(L-W||1)]}},{key:"normalizeRect",value:function(u){var A=u.slice(0);return u[0]>u[2]&&(A[0]=u[2],A[2]=u[0]),u[1]>u[3]&&(A[1]=u[3],A[3]=u[1]),A}},{key:"intersect",value:function(u,A){function compare(u,A){return u-A}var T=[u[0],u[2],A[0],A[2]].sort(compare),E=[u[1],u[3],A[1],A[3]].sort(compare),I=[];return(u=Util.normalizeRect(u),A=Util.normalizeRect(A),(T[0]!==u[0]||T[1]!==A[0])&&(T[0]!==A[0]||T[1]!==u[0]))?null:(I[0]=T[1],I[2]=T[2],(E[0]!==u[1]||E[1]!==A[1])&&(E[0]!==A[1]||E[1]!==u[1]))?null:(I[1]=E[1],I[3]=E[2],I)}},{key:"bezierBoundingBox",value:function(u,A,T,E,I,D,L,W){for(var N=[],U=[[],[]],H=0;H<2;++H){if(0===H?(K=6*u-12*T+6*I,Q=-3*u+9*T-9*I+3*L,J=3*T-3*u):(K=6*A-12*E+6*D,Q=-3*A+9*E-9*D+3*W,J=3*E-3*A),1e-12>Math.abs(Q)){if(1e-12>Math.abs(K))continue;0<(ee=-J/K)&&ee<1&&N.push(ee);continue}ea=Math.sqrt(en=K*K-4*J*Q),!(en<0)&&(0<(et=(-K+ea)/(2*Q))&&et<1&&N.push(et),0<(er=(-K-ea)/(2*Q))&&er<1&&N.push(er))}for(var Q,K,J,ee,et,er,en,ea,eo,ei=N.length,es=ei;ei--;)eo=1-(ee=N[ei]),U[0][ei]=eo*eo*eo*u+3*eo*eo*ee*T+3*eo*ee*ee*I+ee*ee*ee*L,U[1][ei]=eo*eo*eo*A+3*eo*eo*ee*E+3*eo*ee*ee*D+ee*ee*ee*W;return U[0][es]=u,U[1][es]=A,U[0][es+1]=L,U[1][es+1]=W,U[0].length=U[1].length=es+2,[Math.min.apply(Math,_toConsumableArray(U[0])),Math.min.apply(Math,_toConsumableArray(U[1])),Math.max.apply(Math,_toConsumableArray(U[0])),Math.max.apply(Math,_toConsumableArray(U[1]))]}}]),Util}();A.Util=eE;var eF=[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 stringToPDFString(u){var A=u.length,T=[];if("\xfe"===u[0]&&"\xff"===u[1])for(var E=2;E>8&255),String.fromCharCode(255&I))}return A.join("")}function stringToUTF8String(u){return decodeURIComponent(escape(u))}function utf8StringToString(u){return unescape(encodeURIComponent(u))}function isBool(u){return"boolean"==typeof u}function isNum(u){return"number"==typeof u}function isString(u){return"string"==typeof u}function isArrayBuffer(u){return"object"===_typeof(u)&&null!==u&&void 0!==u.byteLength}function isArrayEqual(u,A){if(u.length!==A.length)return!1;for(var T=0,E=u.length;T0&&void 0!==arguments[0]?arguments[0]:new Date;return[u.getUTCFullYear().toString(),(u.getUTCMonth()+1).toString().padStart(2,"0"),u.getUTCDate().toString().padStart(2,"0"),u.getUTCHours().toString().padStart(2,"0"),u.getUTCMinutes().toString().padStart(2,"0"),u.getUTCSeconds().toString().padStart(2,"0")].join("")}function createPromiseCapability(){var u=Object.create(null),A=!1;return Object.defineProperty(u,"settled",{get:function(){return A}}),u.promise=new Promise(function(T,E){u.resolve=function(u){A=!0,T(u)},u.reject=function(u){A=!0,E(u)}}),u}function createObjectURL(u){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",T=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!T)return URL.createObjectURL(new Blob([u],{type:A}));for(var E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",I="data:".concat(A,";base64,"),D=0,L=u.length;D>2,Q=(3&W)<<4|N>>4,K=D+1>6:64,J=D+2{"use strict";var E=T(6);"undefined"!=typeof globalThis&&globalThis._pdfjsCompatibilityChecked||(("undefined"==typeof globalThis||globalThis.Math!==Math)&&(globalThis=T(7)),globalThis._pdfjsCompatibilityChecked=!0,function(){!globalThis.btoa&&E.isNodeJS&&(globalThis.btoa=function(u){return Buffer.from(u,"binary").toString("base64")})}(),function(){!globalThis.atob&&E.isNodeJS&&(globalThis.atob=function(u){return Buffer.from(u,"base64").toString("binary")})}(),function(){!globalThis.DOMMatrix&&E.isNodeJS&&(globalThis.DOMMatrix=T(69))}(),function(){Object.fromEntries||T(70)}(),function(){globalThis.Promise.allSettled||(globalThis.Promise=T(97))}(),function(){!globalThis.ReadableStream&&E.isNodeJS&&(globalThis.ReadableStream=T(134).ReadableStream)}())},(u,A)=>{"use strict";function _typeof(u){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(u)}Object.defineProperty(A,"__esModule",{value:!0}),A.isNodeJS=void 0;var T=(void 0===process?"undefined":_typeof(process))==="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type);A.isNodeJS=T},(u,A,T)=>{T(8),u.exports=T(10)},(u,A,T)=>{T(9)({global:!0},{globalThis:T(10)})},(u,A,T)=>{var E=T(10),I=T(11).f,D=T(47),L=T(50),W=T(41),N=T(57),U=T(68);u.exports=function(u,A){var T,H,Q,K,J,ee=u.target,et=u.global,er=u.stat;if(T=et?E:er?E[ee]||W(ee,{}):(E[ee]||{}).prototype)for(H in A){if(K=A[H],Q=u.noTargetGet?(J=I(T,H))&&J.value:T[H],!U(et?H:ee+(er?".":"#")+H,u.forced)&&void 0!==Q){if(typeof K==typeof Q)continue;N(K,Q)}(u.sham||Q&&Q.sham)&&D(K,"sham",!0),L(T,H,K,u)}}},u=>{var check=function(u){return u&&u.Math==Math&&u};u.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof __webpack_require__.g&&__webpack_require__.g)||function(){return this}()||Function("return this")()},(u,A,T)=>{var E=T(12),I=T(14),D=T(15),L=T(16),W=T(17),N=T(22),U=T(42),H=T(45),Q=Object.getOwnPropertyDescriptor;A.f=E?Q:function(u,A){if(u=W(u),A=N(A),H)try{return Q(u,A)}catch(u){}if(U(u,A))return L(!I(D.f,u,A),u[A])}},(u,A,T)=>{var E=T(13);u.exports=!E(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},u=>{u.exports=function(u){try{return!!u()}catch(u){return!0}}},u=>{var A=Function.prototype.call;u.exports=A.bind?A.bind(A):function(){return A.apply(A,arguments)}},(u,A)=>{"use strict";var T={}.propertyIsEnumerable,E=Object.getOwnPropertyDescriptor,I=E&&!T.call({1:2},1);A.f=I?function(u){var A=E(this,u);return!!A&&A.enumerable}:T},u=>{u.exports=function(u,A){return{enumerable:!(1&u),configurable:!(2&u),writable:!(4&u),value:A}}},(u,A,T)=>{var E=T(18),I=T(21);u.exports=function(u){return E(I(u))}},(u,A,T)=>{var E=T(10),I=T(19),D=T(13),L=T(20),W=E.Object,N=I("".split);u.exports=D(function(){return!W("z").propertyIsEnumerable(0)})?function(u){return"String"==L(u)?N(u,""):W(u)}:W},u=>{var A=Function.prototype,T=A.bind,E=A.call,I=T&&T.bind(E);u.exports=T?function(u){return u&&I(E,u)}:function(u){return u&&function(){return E.apply(u,arguments)}}},(u,A,T)=>{var E=T(19),I=E({}.toString),D=E("".slice);u.exports=function(u){return D(I(u),8,-1)}},(u,A,T)=>{var E=T(10).TypeError;u.exports=function(u){if(void 0==u)throw E("Can't call method on "+u);return u}},(u,A,T)=>{var E=T(23),I=T(26);u.exports=function(u){var A=E(u,"string");return I(A)?A:A+""}},(u,A,T)=>{var E=T(10),I=T(14),D=T(24),L=T(26),W=T(33),N=T(36),U=T(37),H=E.TypeError,Q=U("toPrimitive");u.exports=function(u,A){if(!D(u)||L(u))return u;var T,E=W(u,Q);if(E){if(void 0===A&&(A="default"),!D(T=I(E,u,A))||L(T))return T;throw H("Can't convert object to primitive value")}return void 0===A&&(A="number"),N(u,A)}},(u,A,T)=>{var E=T(25);u.exports=function(u){return"object"==typeof u?null!==u:E(u)}},u=>{u.exports=function(u){return"function"==typeof u}},(u,A,T)=>{var E=T(10),I=T(27),D=T(25),L=T(28),W=T(29),N=E.Object;u.exports=W?function(u){return"symbol"==typeof u}:function(u){var A=I("Symbol");return D(A)&&L(A.prototype,N(u))}},(u,A,T)=>{var E=T(10),I=T(25),aFunction=function(u){return I(u)?u:void 0};u.exports=function(u,A){return arguments.length<2?aFunction(E[u]):E[u]&&E[u][A]}},(u,A,T)=>{var E=T(19);u.exports=E({}.isPrototypeOf)},(u,A,T)=>{var E=T(30);u.exports=E&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(u,A,T)=>{var E=T(31),I=T(13);u.exports=!!Object.getOwnPropertySymbols&&!I(function(){var u=Symbol();return!String(u)||!(Object(u) instanceof Symbol)||!Symbol.sham&&E&&E<41})},(u,A,T)=>{var E,I,D=T(10),L=T(32),W=D.process,N=D.Deno,U=W&&W.versions||N&&N.version,H=U&&U.v8;H&&(I=(E=H.split("."))[0]>0&&E[0]<4?1:+(E[0]+E[1])),!I&&L&&(!(E=L.match(/Edge\/(\d+)/))||E[1]>=74)&&(E=L.match(/Chrome\/(\d+)/))&&(I=+E[1]),u.exports=I},(u,A,T)=>{var E=T(27);u.exports=E("navigator","userAgent")||""},(u,A,T)=>{var E=T(34);u.exports=function(u,A){var T=u[A];return null==T?void 0:E(T)}},(u,A,T)=>{var E=T(10),I=T(25),D=T(35),L=E.TypeError;u.exports=function(u){if(I(u))return u;throw L(D(u)+" is not a function")}},(u,A,T)=>{var E=T(10).String;u.exports=function(u){try{return E(u)}catch(u){return"Object"}}},(u,A,T)=>{var E=T(10),I=T(14),D=T(25),L=T(24),W=E.TypeError;u.exports=function(u,A){var T,E;if("string"===A&&D(T=u.toString)&&!L(E=I(T,u))||D(T=u.valueOf)&&!L(E=I(T,u))||"string"!==A&&D(T=u.toString)&&!L(E=I(T,u)))return E;throw W("Can't convert object to primitive value")}},(u,A,T)=>{var E=T(10),I=T(38),D=T(42),L=T(44),W=T(30),N=T(29),U=I("wks"),H=E.Symbol,Q=H&&H.for,K=N?H:H&&H.withoutSetter||L;u.exports=function(u){if(!D(U,u)||!(W||"string"==typeof U[u])){var A="Symbol."+u;W&&D(H,u)?U[u]=H[u]:N&&Q?U[u]=Q(A):U[u]=K(A)}return U[u]}},(u,A,T)=>{var E=T(39),I=T(40);(u.exports=function(u,A){return I[u]||(I[u]=void 0!==A?A:{})})("versions",[]).push({version:"3.19.3",mode:E?"pure":"global",copyright:"\xa9 2021 Denis Pushkarev (zloirock.ru)"})},u=>{u.exports=!1},(u,A,T)=>{var E=T(10),I=T(41),D="__core-js_shared__",L=E[D]||I(D,{});u.exports=L},(u,A,T)=>{var E=T(10),I=Object.defineProperty;u.exports=function(u,A){try{I(E,u,{value:A,configurable:!0,writable:!0})}catch(T){E[u]=A}return A}},(u,A,T)=>{var E=T(19),I=T(43),D=E({}.hasOwnProperty);u.exports=Object.hasOwn||function(u,A){return D(I(u),A)}},(u,A,T)=>{var E=T(10),I=T(21),D=E.Object;u.exports=function(u){return D(I(u))}},(u,A,T)=>{var E=T(19),I=0,D=Math.random(),L=E(1..toString);u.exports=function(u){return"Symbol("+(void 0===u?"":u)+")_"+L(++I+D,36)}},(u,A,T)=>{var E=T(12),I=T(13),D=T(46);u.exports=!E&&!I(function(){return 7!=Object.defineProperty(D("div"),"a",{get:function(){return 7}}).a})},(u,A,T)=>{var E=T(10),I=T(24),D=E.document,L=I(D)&&I(D.createElement);u.exports=function(u){return L?D.createElement(u):{}}},(u,A,T)=>{var E=T(12),I=T(48),D=T(16);u.exports=E?function(u,A,T){return I.f(u,A,D(1,T))}:function(u,A,T){return u[A]=T,u}},(u,A,T)=>{var E=T(10),I=T(12),D=T(45),L=T(49),W=T(22),N=E.TypeError,U=Object.defineProperty;A.f=I?U:function(u,A,T){if(L(u),A=W(A),L(T),D)try{return U(u,A,T)}catch(u){}if("get"in T||"set"in T)throw N("Accessors not supported");return"value"in T&&(u[A]=T.value),u}},(u,A,T)=>{var E=T(10),I=T(24),D=E.String,L=E.TypeError;u.exports=function(u){if(I(u))return u;throw L(D(u)+" is not an object")}},(u,A,T)=>{var E=T(10),I=T(25),D=T(42),L=T(47),W=T(41),N=T(51),U=T(52),H=T(56).CONFIGURABLE,Q=U.get,K=U.enforce,J=String(String).split("String");(u.exports=function(u,A,T,N){var U,Q=!!N&&!!N.unsafe,ee=!!N&&!!N.enumerable,et=!!N&&!!N.noTargetGet,er=N&&void 0!==N.name?N.name:A;if(I(T)&&("Symbol("===String(er).slice(0,7)&&(er="["+String(er).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!D(T,"name")||H&&T.name!==er)&&L(T,"name",er),(U=K(T)).source||(U.source=J.join("string"==typeof er?er:""))),u===E){ee?u[A]=T:W(A,T);return}Q?!et&&u[A]&&(ee=!0):delete u[A],ee?u[A]=T:L(u,A,T)})(Function.prototype,"toString",function(){return I(this)&&Q(this).source||N(this)})},(u,A,T)=>{var E=T(19),I=T(25),D=T(40),L=E(Function.toString);I(D.inspectSource)||(D.inspectSource=function(u){return L(u)}),u.exports=D.inspectSource},(u,A,T)=>{var E,I,D,L=T(53),W=T(10),N=T(19),U=T(24),H=T(47),Q=T(42),K=T(40),J=T(54),ee=T(55),et="Object already initialized",er=W.TypeError,en=W.WeakMap,enforce=function(u){return D(u)?I(u):E(u,{})},getterFor=function(u){return function(A){var T;if(!U(A)||(T=I(A)).type!==u)throw er("Incompatible receiver, "+u+" required");return T}};if(L||K.state){var ea=K.state||(K.state=new en),eo=N(ea.get),ei=N(ea.has),es=N(ea.set);E=function(u,A){if(ei(ea,u))throw new er(et);return A.facade=u,es(ea,u,A),A},I=function(u){return eo(ea,u)||{}},D=function(u){return ei(ea,u)}}else{var eu=J("state");ee[eu]=!0,E=function(u,A){if(Q(u,eu))throw new er(et);return A.facade=u,H(u,eu,A),A},I=function(u){return Q(u,eu)?u[eu]:{}},D=function(u){return Q(u,eu)}}u.exports={set:E,get:I,has:D,enforce:enforce,getterFor:getterFor}},(u,A,T)=>{var E=T(10),I=T(25),D=T(51),L=E.WeakMap;u.exports=I(L)&&/native code/.test(D(L))},(u,A,T)=>{var E=T(38),I=T(44),D=E("keys");u.exports=function(u){return D[u]||(D[u]=I(u))}},u=>{u.exports={}},(u,A,T)=>{var E=T(12),I=T(42),D=Function.prototype,L=E&&Object.getOwnPropertyDescriptor,W=I(D,"name"),N=W&&"something"===(function(){}).name,U=W&&(!E||E&&L(D,"name").configurable);u.exports={EXISTS:W,PROPER:N,CONFIGURABLE:U}},(u,A,T)=>{var E=T(42),I=T(58),D=T(11),L=T(48);u.exports=function(u,A){for(var T=I(A),W=L.f,N=D.f,U=0;U{var E=T(27),I=T(19),D=T(59),L=T(67),W=T(49),N=I([].concat);u.exports=E("Reflect","ownKeys")||function(u){var A=D.f(W(u)),T=L.f;return T?N(A,T(u)):A}},(u,A,T)=>{var E=T(60),I=T(66).concat("length","prototype");A.f=Object.getOwnPropertyNames||function(u){return E(u,I)}},(u,A,T)=>{var E=T(19),I=T(42),D=T(17),L=T(61).indexOf,W=T(55),N=E([].push);u.exports=function(u,A){var T,E=D(u),U=0,H=[];for(T in E)!I(W,T)&&I(E,T)&&N(H,T);for(;A.length>U;)I(E,T=A[U++])&&(~L(H,T)||N(H,T));return H}},(u,A,T)=>{var E=T(17),I=T(62),D=T(64),createMethod=function(u){return function(A,T,L){var W,N=E(A),U=D(N),H=I(L,U);if(u&&T!=T){for(;U>H;)if((W=N[H++])!=W)return!0}else for(;U>H;H++)if((u||H in N)&&N[H]===T)return u||H||0;return!u&&-1}};u.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(u,A,T)=>{var E=T(63),I=Math.max,D=Math.min;u.exports=function(u,A){var T=E(u);return T<0?I(T+A,0):D(T,A)}},u=>{var A=Math.ceil,T=Math.floor;u.exports=function(u){var E=+u;return E!=E||0===E?0:(E>0?T:A)(E)}},(u,A,T)=>{var E=T(65);u.exports=function(u){return E(u.length)}},(u,A,T)=>{var E=T(63),I=Math.min;u.exports=function(u){return u>0?I(E(u),9007199254740991):0}},u=>{u.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(u,A)=>{A.f=Object.getOwnPropertySymbols},(u,A,T)=>{var E=T(13),I=T(25),D=/#|\.prototype\./,isForced=function(u,A){var T=W[L(u)];return T==U||T!=N&&(I(A)?E(A):!!A)},L=isForced.normalize=function(u){return String(u).replace(D,".").toLowerCase()},W=isForced.data={},N=isForced.NATIVE="N",U=isForced.POLYFILL="P";u.exports=isForced},(u,A,T)=>{"use strict";var E,I;function _typeof(u){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(u)}!function(D,L){"object"===_typeof(A)?u.exports=L():void 0!==(I="function"==typeof(E=L)?E.call(A,T,A,u):E)&&(u.exports=I)}(0,function(){function fromArray(u){var A=new CSSMatrix,T=Array.from(u);if(!T.every(function(u){return!Number.isNaN(u)}))throw TypeError('CSSMatrix: "'+u+'" must only have numbers.');if(16===T.length){var E=T[0],I=T[1],D=T[2],L=T[3],W=T[4],N=T[5],U=T[6],H=T[7],Q=T[8],K=T[9],J=T[10],ee=T[11],et=T[12],er=T[13],en=T[14],ea=T[15];A.m11=E,A.a=E,A.m21=W,A.c=W,A.m31=Q,A.m41=et,A.e=et,A.m12=I,A.b=I,A.m22=N,A.d=N,A.m32=K,A.m42=er,A.f=er,A.m13=D,A.m23=U,A.m33=J,A.m43=en,A.m14=L,A.m24=H,A.m34=ee,A.m44=ea}else if(6===T.length){var eo=T[0],ei=T[1],es=T[2],eu=T[3],ec=T[4],ed=T[5];A.m11=eo,A.a=eo,A.m12=ei,A.b=ei,A.m21=es,A.c=es,A.m22=eu,A.d=eu,A.m41=ec,A.e=ec,A.m42=ed,A.f=ed}else throw TypeError("CSSMatrix: expecting an Array of 6/16 values.");return A}function fromMatrix(u){var A=Object.keys(new CSSMatrix);if("object"===_typeof(u)&&A.every(function(A){return A in u}))return fromArray([u.m11,u.m12,u.m13,u.m14,u.m21,u.m22,u.m23,u.m24,u.m31,u.m32,u.m33,u.m34,u.m41,u.m42,u.m43,u.m44]);throw TypeError('CSSMatrix: "'+u+'" is not a DOMMatrix / CSSMatrix / JSON compatible object.')}function fromString(u){if("string"!=typeof u)throw TypeError('CSSMatrix: "'+u+'" is not a string.');var A=String(u).replace(/\s/g,""),T=new CSSMatrix,E='CSSMatrix: invalid transform string "'+u+'"';return A.split(")").filter(function(u){return u}).forEach(function(u){var A=u.split("("),I=A[0],D=A[1];if(!D)throw TypeError(E);var L=D.split(",").map(function(u){return u.includes("rad")?parseFloat(u)*(180/Math.PI):parseFloat(u)}),W=L[0],N=L[1],U=L[2],H=L[3],Q=[W,N,U],K=[W,N,U,H];if("perspective"===I&&W&&[N,U].every(function(u){return void 0===u}))T.m34=-1/W;else if(I.includes("matrix")&&[6,16].includes(L.length)&&L.every(function(u){return!Number.isNaN(+u)})){var J=L.map(function(u){return 1e-6>Math.abs(u)?0:u});T=T.multiply(fromArray(J))}else if("translate3d"===I&&Q.every(function(u){return!Number.isNaN(+u)}))T=T.translate(W,N,U);else if("translate"===I&&W&&void 0===U)T=T.translate(W,N||0,0);else if("rotate3d"===I&&K.every(function(u){return!Number.isNaN(+u)})&&H)T=T.rotateAxisAngle(W,N,U,H);else if("rotate"===I&&W&&[N,U].every(function(u){return void 0===u}))T=T.rotate(0,0,W);else if("scale3d"===I&&Q.every(function(u){return!Number.isNaN(+u)})&&Q.some(function(u){return 1!==u}))T=T.scale(W,N,U);else if("scale"!==I||Number.isNaN(W)||1===W||void 0!==U){if("skew"===I&&W&&void 0===U)T=T.skewX(W),T=N?T.skewY(N):T;else if(/[XYZ]/.test(I)&&W&&[N,U].every(function(u){return void 0===u})&&["translate","rotate","scale","skew"].some(function(u){return I.includes(u)})){if(["skewX","skewY"].includes(I))T=T[I](W);else{var ee=I.replace(/[XYZ]/,""),et=["X","Y","Z"].indexOf(I.replace(ee,"")),er=[0===et?W:0,1===et?W:0,2===et?W:0];T=T[ee].apply(T,er)}}else throw TypeError(E)}else{var en=Number.isNaN(+N)?W:N;T=T.scale(W,en,1)}}),T}function Translate(u,A,T){var E=new CSSMatrix;return E.m41=u,E.e=u,E.m42=A,E.f=A,E.m43=T,E}function Rotate(u,A,T){var E=new CSSMatrix,I=Math.PI/180,D=u*I,L=A*I,W=T*I,N=Math.cos(D),U=-Math.sin(D),H=Math.cos(L),Q=-Math.sin(L),K=Math.cos(W),J=-Math.sin(W),ee=H*K,et=-H*J;E.m11=ee,E.a=ee,E.m12=et,E.b=et,E.m13=Q;var er=U*Q*K+N*J;E.m21=er,E.c=er;var en=N*K-U*Q*J;return E.m22=en,E.d=en,E.m23=-U*H,E.m31=U*J-N*Q*K,E.m32=U*K+N*Q*J,E.m33=N*H,E}function RotateAxisAngle(u,A,T,E){var I=new CSSMatrix,D=E*(Math.PI/360),L=Math.sin(D),W=Math.cos(D),N=L*L,U=Math.sqrt(u*u+A*A+T*T),H=u,Q=A,K=T;0===U?(H=0,Q=0,K=1):(H/=U,Q/=U,K/=U);var J=H*H,ee=Q*Q,et=K*K,er=1-2*(ee+et)*N;I.m11=er,I.a=er;var en=2*(H*Q*N+K*L*W);I.m12=en,I.b=en,I.m13=2*(H*K*N-Q*L*W);var ea=2*(Q*H*N-K*L*W);I.m21=ea,I.c=ea;var eo=1-2*(et+J)*N;return I.m22=eo,I.d=eo,I.m23=2*(Q*K*N+H*L*W),I.m31=2*(K*H*N+Q*L*W),I.m32=2*(K*Q*N-H*L*W),I.m33=1-2*(J+ee)*N,I}function Scale(u,A,T){var E=new CSSMatrix;return E.m11=u,E.a=u,E.m22=A,E.d=A,E.m33=T,E}function SkewX(u){var A=new CSSMatrix,T=Math.tan(u*Math.PI/180);return A.m21=T,A.c=T,A}function SkewY(u){var A=new CSSMatrix,T=Math.tan(u*Math.PI/180);return A.m12=T,A.b=T,A}function Multiply(u,A){return fromArray([A.m11*u.m11+A.m12*u.m21+A.m13*u.m31+A.m14*u.m41,A.m11*u.m12+A.m12*u.m22+A.m13*u.m32+A.m14*u.m42,A.m11*u.m13+A.m12*u.m23+A.m13*u.m33+A.m14*u.m43,A.m11*u.m14+A.m12*u.m24+A.m13*u.m34+A.m14*u.m44,A.m21*u.m11+A.m22*u.m21+A.m23*u.m31+A.m24*u.m41,A.m21*u.m12+A.m22*u.m22+A.m23*u.m32+A.m24*u.m42,A.m21*u.m13+A.m22*u.m23+A.m23*u.m33+A.m24*u.m43,A.m21*u.m14+A.m22*u.m24+A.m23*u.m34+A.m24*u.m44,A.m31*u.m11+A.m32*u.m21+A.m33*u.m31+A.m34*u.m41,A.m31*u.m12+A.m32*u.m22+A.m33*u.m32+A.m34*u.m42,A.m31*u.m13+A.m32*u.m23+A.m33*u.m33+A.m34*u.m43,A.m31*u.m14+A.m32*u.m24+A.m33*u.m34+A.m34*u.m44,A.m41*u.m11+A.m42*u.m21+A.m43*u.m31+A.m44*u.m41,A.m41*u.m12+A.m42*u.m22+A.m43*u.m32+A.m44*u.m42,A.m41*u.m13+A.m42*u.m23+A.m43*u.m33+A.m44*u.m43,A.m41*u.m14+A.m42*u.m24+A.m43*u.m34+A.m44*u.m44])}var CSSMatrix=function(){for(var u=[],A=arguments.length;A--;)u[A]=arguments[A];var T=this;if(T.a=1,T.b=0,T.c=0,T.d=1,T.e=0,T.f=0,T.m11=1,T.m12=0,T.m13=0,T.m14=0,T.m21=0,T.m22=1,T.m23=0,T.m24=0,T.m31=0,T.m32=0,T.m33=1,T.m34=0,T.m41=0,T.m42=0,T.m43=0,T.m44=1,u&&u.length){var E=[16,6].some(function(A){return A===u.length})?u:u[0];return T.setMatrixValue(E)}return T},u={isIdentity:{configurable:!0},is2D:{configurable:!0}};return u.isIdentity.set=function(u){this.isIdentity=u},u.isIdentity.get=function(){var u=this;return 1===u.m11&&0===u.m12&&0===u.m13&&0===u.m14&&0===u.m21&&1===u.m22&&0===u.m23&&0===u.m24&&0===u.m31&&0===u.m32&&1===u.m33&&0===u.m34&&0===u.m41&&0===u.m42&&0===u.m43&&1===u.m44},u.is2D.get=function(){var u=this;return 0===u.m31&&0===u.m32&&1===u.m33&&0===u.m34&&0===u.m43&&1===u.m44},u.is2D.set=function(u){this.is2D=u},CSSMatrix.prototype.setMatrixValue=function(u){var A=this;return[Array,Float64Array,Float32Array].some(function(A){return u instanceof A})?fromArray(u):"string"==typeof u&&u.length&&"none"!==u?fromString(u):"object"===_typeof(u)?fromMatrix(u):A},CSSMatrix.prototype.toArray=function(){var u,A=this,T=1e6;return(u=A.is2D?[A.a,A.b,A.c,A.d,A.e,A.f]:[A.m11,A.m12,A.m13,A.m14,A.m21,A.m22,A.m23,A.m24,A.m31,A.m32,A.m33,A.m34,A.m41,A.m42,A.m43,A.m44]).map(function(u){return 1e-6>Math.abs(u)?0:(u*T>>0)/T})},CSSMatrix.prototype.toString=function(){var u=this,A=u.toArray();return(u.is2D?"matrix":"matrix3d")+"("+A+")"},CSSMatrix.prototype.toJSON=function(){var u=this,A=u.is2D,T=u.isIdentity;return Object.assign({},u,{is2D:A,isIdentity:T})},CSSMatrix.prototype.multiply=function(u){return Multiply(this,u)},CSSMatrix.prototype.translate=function(u,A,T){var E=A,I=T;return void 0===I&&(I=0),void 0===E&&(E=0),Multiply(this,Translate(u,E,I))},CSSMatrix.prototype.scale=function(u,A,T){var E=u,I=A,D=T;return void 0===I&&(I=u),void 0===D&&(D=1),Multiply(this,Scale(E,I,D))},CSSMatrix.prototype.rotate=function(u,A,T){var E=u,I=A,D=T;return void 0===I&&(I=0),void 0===D&&(D=E,E=0),Multiply(this,Rotate(E,I,D))},CSSMatrix.prototype.rotateAxisAngle=function(u,A,T,E){if([u,A,T,E].some(function(u){return Number.isNaN(u)}))throw TypeError("CSSMatrix: expecting 4 values");return Multiply(this,RotateAxisAngle(u,A,T,E))},CSSMatrix.prototype.skewX=function(u){return Multiply(this,SkewX(u))},CSSMatrix.prototype.skewY=function(u){return Multiply(this,SkewY(u))},CSSMatrix.prototype.transformPoint=function(u){var A=this,T=Translate(u.x,u.y,u.z);return T.m44=u.w||1,{x:(T=A.multiply(T)).m41,y:T.m42,z:T.m43,w:T.m44}},CSSMatrix.prototype.transform=function(u){var A=this,T=A.m11*u.x+A.m12*u.y+A.m13*u.z+A.m14*u.w,E=A.m21*u.x+A.m22*u.y+A.m23*u.z+A.m24*u.w,I=A.m31*u.x+A.m32*u.y+A.m33*u.z+A.m34*u.w,D=A.m41*u.x+A.m42*u.y+A.m43*u.z+A.m44*u.w;return{x:T/D,y:E/D,z:I/D,w:D}},Object.defineProperties(CSSMatrix.prototype,u),Object.assign(CSSMatrix,{Translate:Translate,Rotate:Rotate,RotateAxisAngle:RotateAxisAngle,Scale:Scale,SkewX:SkewX,SkewY:SkewY,Multiply:Multiply,fromArray:fromArray,fromMatrix:fromMatrix,fromString:fromString}),Object.assign(CSSMatrix,{Version:"0.0.24"}),CSSMatrix})},(u,A,T)=>{T(71),T(86);var E=T(96);u.exports=E.Object.fromEntries},(u,A,T)=>{"use strict";var E=T(17),I=T(72),D=T(77),L=T(52),W=T(78),N="Array Iterator",U=L.set,H=L.getterFor(N);u.exports=W(Array,"Array",function(u,A){U(this,{type:N,target:E(u),index:0,kind:A})},function(){var u=H(this),A=u.target,T=u.kind,E=u.index++;return!A||E>=A.length?(u.target=void 0,{value:void 0,done:!0}):"keys"==T?{value:E,done:!1}:"values"==T?{value:A[E],done:!1}:{value:[E,A[E]],done:!1}},"values"),D.Arguments=D.Array,I("keys"),I("values"),I("entries")},(u,A,T)=>{var E=T(37),I=T(73),D=T(48),L=E("unscopables"),W=Array.prototype;void 0==W[L]&&D.f(W,L,{configurable:!0,value:I(null)}),u.exports=function(u){W[L][u]=!0}},(u,A,T)=>{var E,I=T(49),D=T(74),L=T(66),W=T(55),N=T(76),U=T(46),H=T(54),Q=">",K="<",J="prototype",ee="script",et=H("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(u){return K+ee+Q+u+K+"/"+ee+Q},NullProtoObjectViaActiveX=function(u){u.write(scriptTag("")),u.close();var A=u.parentWindow.Object;return u=null,A},NullProtoObjectViaIFrame=function(){var u,A=U("iframe"),T="java"+ee+":";return A.style.display="none",N.appendChild(A),A.src=String(T),(u=A.contentWindow.document).open(),u.write(scriptTag("document.F=Object")),u.close(),u.F},NullProtoObject=function(){try{E=new ActiveXObject("htmlfile")}catch(u){}NullProtoObject="undefined"!=typeof document?document.domain&&E?NullProtoObjectViaActiveX(E):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(E);for(var u=L.length;u--;)delete NullProtoObject[J][L[u]];return NullProtoObject()};W[et]=!0,u.exports=Object.create||function(u,A){var T;return null!==u?(EmptyConstructor[J]=I(u),T=new EmptyConstructor,EmptyConstructor[J]=null,T[et]=u):T=NullProtoObject(),void 0===A?T:D(T,A)}},(u,A,T)=>{var E=T(12),I=T(48),D=T(49),L=T(17),W=T(75);u.exports=E?Object.defineProperties:function(u,A){D(u);for(var T,E=L(A),N=W(A),U=N.length,H=0;U>H;)I.f(u,T=N[H++],E[T]);return u}},(u,A,T)=>{var E=T(60),I=T(66);u.exports=Object.keys||function(u){return E(u,I)}},(u,A,T)=>{var E=T(27);u.exports=E("document","documentElement")},u=>{u.exports={}},(u,A,T)=>{"use strict";var E=T(9),I=T(14),D=T(39),L=T(56),W=T(25),N=T(79),U=T(81),H=T(84),Q=T(83),K=T(47),J=T(50),ee=T(37),et=T(77),er=T(80),en=L.PROPER,ea=L.CONFIGURABLE,eo=er.IteratorPrototype,ei=er.BUGGY_SAFARI_ITERATORS,es=ee("iterator"),eu="keys",ec="values",ed="entries",returnThis=function(){return this};u.exports=function(u,A,T,L,ee,er,ef){N(T,A,L);var eh,ep,em,getIterationMethod=function(u){if(u===ee&&e_)return e_;if(!ei&&u in eb)return eb[u];switch(u){case eu:case ec:case ed:return function(){return new T(this,u)}}return function(){return new T(this)}},ev=A+" Iterator",ey=!1,eb=u.prototype,eg=eb[es]||eb["@@iterator"]||ee&&eb[ee],e_=!ei&&eg||getIterationMethod(ee),eS="Array"==A&&eb.entries||eg;if(eS&&(eh=U(eS.call(new u)))!==Object.prototype&&eh.next&&(D||U(eh)===eo||(H?H(eh,eo):W(eh[es])||J(eh,es,returnThis)),Q(eh,ev,!0,!0),D&&(et[ev]=returnThis)),en&&ee==ec&&eg&&eg.name!==ec&&(!D&&ea?K(eb,"name",ec):(ey=!0,e_=function(){return I(eg,this)})),ee){if(ep={values:getIterationMethod(ec),keys:er?e_:getIterationMethod(eu),entries:getIterationMethod(ed)},ef)for(em in ep)!ei&&!ey&&em in eb||J(eb,em,ep[em]);else E({target:A,proto:!0,forced:ei||ey},ep)}return(!D||ef)&&eb[es]!==e_&&J(eb,es,e_,{name:ee}),et[A]=e_,ep}},(u,A,T)=>{"use strict";var E=T(80).IteratorPrototype,I=T(73),D=T(16),L=T(83),W=T(77),returnThis=function(){return this};u.exports=function(u,A,T,N){var U=A+" Iterator";return u.prototype=I(E,{next:D(+!N,T)}),L(u,U,!1,!0),W[U]=returnThis,u}},(u,A,T)=>{"use strict";var E,I,D,L=T(13),W=T(25),N=T(73),U=T(81),H=T(50),Q=T(37),K=T(39),J=Q("iterator"),ee=!1;[].keys&&("next"in(D=[].keys())?(I=U(U(D)))!==Object.prototype&&(E=I):ee=!0),void 0==E||L(function(){var u={};return E[J].call(u)!==u})?E={}:K&&(E=N(E)),W(E[J])||H(E,J,function(){return this}),u.exports={IteratorPrototype:E,BUGGY_SAFARI_ITERATORS:ee}},(u,A,T)=>{var E=T(10),I=T(42),D=T(25),L=T(43),W=T(54),N=T(82),U=W("IE_PROTO"),H=E.Object,Q=H.prototype;u.exports=N?H.getPrototypeOf:function(u){var A=L(u);if(I(A,U))return A[U];var T=A.constructor;return D(T)&&A instanceof T?T.prototype:A instanceof H?Q:null}},(u,A,T)=>{var E=T(13);u.exports=!E(function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})},(u,A,T)=>{var E=T(48).f,I=T(42),D=T(37)("toStringTag");u.exports=function(u,A,T){u&&!I(u=T?u:u.prototype,D)&&E(u,D,{configurable:!0,value:A})}},(u,A,T)=>{var E=T(19),I=T(49),D=T(85);u.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var u,A=!1,T={};try{(u=E(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(T,[]),A=T instanceof Array}catch(u){}return function(T,E){return I(T),D(E),A?u(T,E):T.__proto__=E,T}}():void 0)},(u,A,T)=>{var E=T(10),I=T(25),D=E.String,L=E.TypeError;u.exports=function(u){if("object"==typeof u||I(u))return u;throw L("Can't set "+D(u)+" as a prototype")}},(u,A,T)=>{var E=T(9),I=T(87),D=T(95);E({target:"Object",stat:!0},{fromEntries:function(u){var A={};return I(u,function(u,T){D(A,u,T)},{AS_ENTRIES:!0}),A}})},(u,A,T)=>{var E=T(10),I=T(88),D=T(14),L=T(49),W=T(35),N=T(89),U=T(64),H=T(28),Q=T(90),K=T(91),J=T(94),ee=E.TypeError,Result=function(u,A){this.stopped=u,this.result=A},et=Result.prototype;u.exports=function(u,A,T){var E,er,en,ea,eo,ei,es,eu=T&&T.that,ec=!!(T&&T.AS_ENTRIES),ed=!!(T&&T.IS_ITERATOR),ef=!!(T&&T.INTERRUPTED),eh=I(A,eu),stop=function(u){return E&&J(E,"normal",u),new Result(!0,u)},callFn=function(u){return ec?(L(u),ef?eh(u[0],u[1],stop):eh(u[0],u[1])):ef?eh(u,stop):eh(u)};if(ed)E=u;else{if(!(er=K(u)))throw ee(W(u)+" is not iterable");if(N(er)){for(en=0,ea=U(u);ea>en;en++)if((eo=callFn(u[en]))&&H(et,eo))return eo;return new Result(!1)}E=Q(u,er)}for(ei=E.next;!(es=D(ei,E)).done;){try{eo=callFn(es.value)}catch(u){J(E,"throw",u)}if("object"==typeof eo&&eo&&H(et,eo))return eo}return new Result(!1)}},(u,A,T)=>{var E=T(19),I=T(34),D=E(E.bind);u.exports=function(u,A){return I(u),void 0===A?u:D?D(u,A):function(){return u.apply(A,arguments)}}},(u,A,T)=>{var E=T(37),I=T(77),D=E("iterator"),L=Array.prototype;u.exports=function(u){return void 0!==u&&(I.Array===u||L[D]===u)}},(u,A,T)=>{var E=T(10),I=T(14),D=T(34),L=T(49),W=T(35),N=T(91),U=E.TypeError;u.exports=function(u,A){var T=arguments.length<2?N(u):A;if(D(T))return L(I(T,u));throw U(W(u)+" is not iterable")}},(u,A,T)=>{var E=T(92),I=T(33),D=T(77),L=T(37)("iterator");u.exports=function(u){if(void 0!=u)return I(u,L)||I(u,"@@iterator")||D[E(u)]}},(u,A,T)=>{var E=T(10),I=T(93),D=T(25),L=T(20),W=T(37)("toStringTag"),N=E.Object,U="Arguments"==L(function(){return arguments}()),tryGet=function(u,A){try{return u[A]}catch(u){}};u.exports=I?L:function(u){var A,T,E;return void 0===u?"Undefined":null===u?"Null":"string"==typeof(T=tryGet(A=N(u),W))?T:U?L(A):"Object"==(E=L(A))&&D(A.callee)?"Arguments":E}},(u,A,T)=>{var E=T(37)("toStringTag"),I={};I[E]="z",u.exports="[object z]"===String(I)},(u,A,T)=>{var E=T(14),I=T(49),D=T(33);u.exports=function(u,A,T){var L,W;I(u);try{if(!(L=D(u,"return"))){if("throw"===A)throw T;return T}L=E(L,u)}catch(u){W=!0,L=u}if("throw"===A)throw T;if(W)throw L;return I(L),T}},(u,A,T)=>{"use strict";var E=T(22),I=T(48),D=T(16);u.exports=function(u,A,T){var L=E(A);L in u?I.f(u,L,D(0,T)):u[L]=T}},(u,A,T)=>{var E=T(10);u.exports=E},(u,A,T)=>{T(98),T(71),T(105),T(107),T(129),T(130),T(131),T(132);var E=T(96);u.exports=E.Promise},(u,A,T)=>{"use strict";var E=T(9),I=T(10),D=T(28),L=T(81),W=T(84),N=T(57),U=T(73),H=T(47),Q=T(16),K=T(99),J=T(101),ee=T(87),et=T(102),er=T(37),en=T(104),ea=er("toStringTag"),eo=I.Error,ei=[].push,$AggregateError=function(u,A){var T,E=arguments.length>2?arguments[2]:void 0,I=D(es,this);W?T=W(new eo(void 0),I?L(this):es):H(T=I?this:U(es),ea,"Error"),H(T,"message",et(A,"")),en&&H(T,"stack",K(T.stack,1)),J(T,E);var N=[];return ee(u,ei,{that:N}),H(T,"errors",N),T};W?W($AggregateError,eo):N($AggregateError,eo);var es=$AggregateError.prototype=U(eo.prototype,{constructor:Q(1,$AggregateError),message:Q(1,""),name:Q(1,"AggregateError")});E({global:!0},{AggregateError:$AggregateError})},(u,A,T)=>{var E=T(19),I=T(100),D=E("".replace),L=E("".split),W=E([].join),N=function(u){return String(Error(u).stack)}("zxcasd"),U=/\n\s*at [^:]*:[^\n]*/,H=U.test(N),Q=/@[^\n]*\n/.test(N)&&!/zxcasd/.test(N);u.exports=function(u,A){if("string"!=typeof u)return u;if(H)for(;A--;)u=D(u,U,"");else if(Q)return W(I(L(u,"\n"),A),"\n");return u}},(u,A,T)=>{var E=T(10),I=T(62),D=T(64),L=T(95),W=E.Array,N=Math.max;u.exports=function(u,A,T){for(var E=D(u),U=I(A,E),H=I(void 0===T?E:T,E),Q=W(N(H-U,0)),K=0;U{var E=T(24),I=T(47);u.exports=function(u,A){E(A)&&"cause"in A&&I(u,"cause",A.cause)}},(u,A,T)=>{var E=T(103);u.exports=function(u,A){return void 0===u?arguments.length<2?"":A:E(u)}},(u,A,T)=>{var E=T(10),I=T(92),D=E.String;u.exports=function(u){if("Symbol"===I(u))throw TypeError("Cannot convert a Symbol value to a string");return D(u)}},(u,A,T)=>{var E=T(13),I=T(16);u.exports=!E(function(){var u=Error("a");return!("stack"in u)||(Object.defineProperty(u,"stack",I(1,7)),7!==u.stack)})},(u,A,T)=>{var E=T(93),I=T(50),D=T(106);E||I(Object.prototype,"toString",D,{unsafe:!0})},(u,A,T)=>{"use strict";var E=T(93),I=T(92);u.exports=E?({}).toString:function(){return"[object "+I(this)+"]"}},(u,A,T)=>{"use strict";var E,I,D,L,W=T(9),N=T(39),U=T(10),H=T(27),Q=T(14),K=T(108),J=T(50),ee=T(109),et=T(84),er=T(83),en=T(110),ea=T(34),eo=T(25),ei=T(24),es=T(111),eu=T(51),ec=T(87),ed=T(112),ef=T(113),eh=T(116).set,ep=T(121),em=T(124),ev=T(126),ey=T(125),eb=T(127),eg=T(52),e_=T(68),eS=T(37),eA=T(128),eC=T(120),eR=T(31),ek=eS("species"),eP="Promise",eT=eg.getterFor(eP),ew=eg.set,eE=eg.getterFor(eP),eF=K&&K.prototype,eO=K,eI=eF,eD=U.TypeError,eM=U.document,eL=U.process,ej=ey.f,eW=ej,eB=!!(eM&&eM.createEvent&&U.dispatchEvent),eN=eo(U.PromiseRejectionEvent),eq="unhandledrejection",eU="rejectionhandled",eG=0,eH=1,ez=2,eV=1,eY=2,eX=!1,eQ=e_(eP,function(){var u=eu(eO),A=u!==String(eO);if(!A&&66===eR||N&&!eI.finally)return!0;if(eR>=51&&/native code/.test(u))return!1;var T=new eO(function(u){u(1)}),FakePromise=function(u){u(function(){},function(){})};return(T.constructor={})[ek]=FakePromise,!(eX=T.then(function(){}) instanceof FakePromise)||!A&&eA&&!eN}),eK=eQ||!ed(function(u){eO.all(u).catch(function(){})}),isThenable=function(u){var A;return!!(ei(u)&&eo(A=u.then))&&A},notify=function(u,A){if(!u.notified){u.notified=!0;var T=u.reactions;ep(function(){for(var E=u.value,I=u.state==eH,D=0;T.length>D;){var L,W,N,U=T[D++],H=I?U.ok:U.fail,K=U.resolve,J=U.reject,ee=U.domain;try{H?(I||(u.rejection===eY&&onHandleUnhandled(u),u.rejection=eV),!0===H?L=E:(ee&&ee.enter(),L=H(E),ee&&(ee.exit(),N=!0)),L===U.promise?J(eD("Promise-chain cycle")):(W=isThenable(L))?Q(W,L,K,J):K(L)):J(E)}catch(u){ee&&!N&&ee.exit(),J(u)}}u.reactions=[],u.notified=!1,A&&!u.rejection&&onUnhandled(u)})}},dispatchEvent=function(u,A,T){var E,I;eB?((E=eM.createEvent("Event")).promise=A,E.reason=T,E.initEvent(u,!1,!0),U.dispatchEvent(E)):E={promise:A,reason:T},!eN&&(I=U["on"+u])?I(E):u===eq&&ev("Unhandled promise rejection",T)},onUnhandled=function(u){Q(eh,U,function(){var A,T=u.facade,E=u.value;if(isUnhandled(u)&&(A=eb(function(){eC?eL.emit("unhandledRejection",E,T):dispatchEvent(eq,T,E)}),u.rejection=eC||isUnhandled(u)?eY:eV,A.error))throw A.value})},isUnhandled=function(u){return u.rejection!==eV&&!u.parent},onHandleUnhandled=function(u){Q(eh,U,function(){var A=u.facade;eC?eL.emit("rejectionHandled",A):dispatchEvent(eU,A,u.value)})},bind=function(u,A,T){return function(E){u(A,E,T)}},internalReject=function(u,A,T){u.done||(u.done=!0,T&&(u=T),u.value=A,u.state=ez,notify(u,!0))},internalResolve=function(u,A,T){if(!u.done){u.done=!0,T&&(u=T);try{if(u.facade===A)throw eD("Promise can't be resolved itself");var E=isThenable(A);E?ep(function(){var T={done:!1};try{Q(E,A,bind(internalResolve,T,u),bind(internalReject,T,u))}catch(A){internalReject(T,A,u)}}):(u.value=A,u.state=eH,notify(u,!1))}catch(A){internalReject({done:!1},A,u)}}};if(eQ&&(eI=(eO=function(u){es(this,eI),ea(u),Q(E,this);var A=eT(this);try{u(bind(internalResolve,A),bind(internalReject,A))}catch(u){internalReject(A,u)}}).prototype,(E=function(u){ew(this,{type:eP,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:eG,value:void 0})}).prototype=ee(eI,{then:function(u,A){var T=eE(this),E=T.reactions,I=ej(ef(this,eO));return I.ok=!eo(u)||u,I.fail=eo(A)&&A,I.domain=eC?eL.domain:void 0,T.parent=!0,E[E.length]=I,T.state!=eG&¬ify(T,!1),I.promise},catch:function(u){return this.then(void 0,u)}}),I=function(){var u=new E,A=eT(u);this.promise=u,this.resolve=bind(internalResolve,A),this.reject=bind(internalReject,A)},ey.f=ej=function(u){return u===eO||u===D?new I(u):eW(u)},!N&&eo(K)&&eF!==Object.prototype)){L=eF.then,eX||(J(eF,"then",function(u,A){var T=this;return new eO(function(u,A){Q(L,T,u,A)}).then(u,A)},{unsafe:!0}),J(eF,"catch",eI.catch,{unsafe:!0}));try{delete eF.constructor}catch(u){}et&&et(eF,eI)}W({global:!0,wrap:!0,forced:eQ},{Promise:eO}),er(eO,eP,!1,!0),en(eP),D=H(eP),W({target:eP,stat:!0,forced:eQ},{reject:function(u){var A=ej(this);return Q(A.reject,void 0,u),A.promise}}),W({target:eP,stat:!0,forced:N||eQ},{resolve:function(u){return em(N&&this===D?eO:this,u)}}),W({target:eP,stat:!0,forced:eK},{all:function(u){var A=this,T=ej(A),E=T.resolve,I=T.reject,D=eb(function(){var T=ea(A.resolve),D=[],L=0,W=1;ec(u,function(u){var N=L++,U=!1;W++,Q(T,A,u).then(function(u){!U&&(U=!0,D[N]=u,--W||E(D))},I)}),--W||E(D)});return D.error&&I(D.value),T.promise},race:function(u){var A=this,T=ej(A),E=T.reject,I=eb(function(){var I=ea(A.resolve);ec(u,function(u){Q(I,A,u).then(T.resolve,E)})});return I.error&&E(I.value),T.promise}})},(u,A,T)=>{var E=T(10);u.exports=E.Promise},(u,A,T)=>{var E=T(50);u.exports=function(u,A,T){for(var I in A)E(u,I,A[I],T);return u}},(u,A,T)=>{"use strict";var E=T(27),I=T(48),D=T(37),L=T(12),W=D("species");u.exports=function(u){var A=E(u),T=I.f;L&&A&&!A[W]&&T(A,W,{configurable:!0,get:function(){return this}})}},(u,A,T)=>{var E=T(10),I=T(28),D=E.TypeError;u.exports=function(u,A){if(I(A,u))return u;throw D("Incorrect invocation")}},(u,A,T)=>{var E=T(37)("iterator"),I=!1;try{var D=0,L={next:function(){return{done:!!D++}},return:function(){I=!0}};L[E]=function(){return this},Array.from(L,function(){throw 2})}catch(u){}u.exports=function(u,A){if(!A&&!I)return!1;var T=!1;try{var D={};D[E]=function(){return{next:function(){return{done:T=!0}}}},u(D)}catch(u){}return T}},(u,A,T)=>{var E=T(49),I=T(114),D=T(37)("species");u.exports=function(u,A){var T,L=E(u).constructor;return void 0===L||void 0==(T=E(L)[D])?A:I(T)}},(u,A,T)=>{var E=T(10),I=T(115),D=T(35),L=E.TypeError;u.exports=function(u){if(I(u))return u;throw L(D(u)+" is not a constructor")}},(u,A,T)=>{var E=T(19),I=T(13),D=T(25),L=T(92),W=T(27),N=T(51),noop=function(){},U=[],H=W("Reflect","construct"),Q=/^\s*(?:class|function)\b/,K=E(Q.exec),J=!Q.exec(noop),isConstructorModern=function(u){if(!D(u))return!1;try{return H(noop,U,u),!0}catch(u){return!1}},isConstructorLegacy=function(u){if(!D(u))return!1;switch(L(u)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return J||!!K(Q,N(u))};u.exports=!H||I(function(){var u;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern(function(){u=!0})||u})?isConstructorLegacy:isConstructorModern},(u,A,T)=>{var E,I,D,L,W=T(10),N=T(117),U=T(88),H=T(25),Q=T(42),K=T(13),J=T(76),ee=T(118),et=T(46),er=T(119),en=T(120),ea=W.setImmediate,eo=W.clearImmediate,ei=W.process,es=W.Dispatch,eu=W.Function,ec=W.MessageChannel,ed=W.String,ef=0,eh={},ep="onreadystatechange";try{E=W.location}catch(u){}var run=function(u){if(Q(eh,u)){var A=eh[u];delete eh[u],A()}},runner=function(u){return function(){run(u)}},listener=function(u){run(u.data)},post=function(u){W.postMessage(ed(u),E.protocol+"//"+E.host)};ea&&eo||(ea=function(u){var A=ee(arguments,1);return eh[++ef]=function(){N(H(u)?u:eu(u),void 0,A)},I(ef),ef},eo=function(u){delete eh[u]},en?I=function(u){ei.nextTick(runner(u))}:es&&es.now?I=function(u){es.now(runner(u))}:ec&&!er?(L=(D=new ec).port2,D.port1.onmessage=listener,I=U(L.postMessage,L)):W.addEventListener&&H(W.postMessage)&&!W.importScripts&&E&&"file:"!==E.protocol&&!K(post)?(I=post,W.addEventListener("message",listener,!1)):I=ep in et("script")?function(u){J.appendChild(et("script"))[ep]=function(){J.removeChild(this),run(u)}}:function(u){setTimeout(runner(u),0)}),u.exports={set:ea,clear:eo}},u=>{var A=Function.prototype,T=A.apply,E=A.bind,I=A.call;u.exports="object"==typeof Reflect&&Reflect.apply||(E?I.bind(T):function(){return I.apply(T,arguments)})},(u,A,T)=>{var E=T(19);u.exports=E([].slice)},(u,A,T)=>{var E=T(32);u.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(E)},(u,A,T)=>{var E=T(20),I=T(10);u.exports="process"==E(I.process)},(u,A,T)=>{var E,I,D,L,W,N,U,H,Q=T(10),K=T(88),J=T(11).f,ee=T(116).set,et=T(119),er=T(122),en=T(123),ea=T(120),eo=Q.MutationObserver||Q.WebKitMutationObserver,ei=Q.document,es=Q.process,eu=Q.Promise,ec=J(Q,"queueMicrotask"),ed=ec&&ec.value;ed||(E=function(){var u,A;for(ea&&(u=es.domain)&&u.exit();I;){A=I.fn,I=I.next;try{A()}catch(u){throw I?L():D=void 0,u}}D=void 0,u&&u.enter()},et||ea||en||!eo||!ei?!er&&eu&&eu.resolve?((U=eu.resolve(void 0)).constructor=eu,H=K(U.then,U),L=function(){H(E)}):ea?L=function(){es.nextTick(E)}:(ee=K(ee,Q),L=function(){ee(E)}):(W=!0,N=ei.createTextNode(""),new eo(E).observe(N,{characterData:!0}),L=function(){N.data=W=!W})),u.exports=ed||function(u){var A={fn:u,next:void 0};D&&(D.next=A),I||(I=A,L()),D=A}},(u,A,T)=>{var E=T(32),I=T(10);u.exports=/ipad|iphone|ipod/i.test(E)&&void 0!==I.Pebble},(u,A,T)=>{var E=T(32);u.exports=/web0s(?!.*chrome)/i.test(E)},(u,A,T)=>{var E=T(49),I=T(24),D=T(125);u.exports=function(u,A){if(E(u),I(A)&&A.constructor===u)return A;var T=D.f(u);return(0,T.resolve)(A),T.promise}},(u,A,T)=>{"use strict";var E=T(34),PromiseCapability=function(u){var A,T;this.promise=new u(function(u,E){if(void 0!==A||void 0!==T)throw TypeError("Bad Promise constructor");A=u,T=E}),this.resolve=E(A),this.reject=E(T)};u.exports.f=function(u){return new PromiseCapability(u)}},(u,A,T)=>{var E=T(10);u.exports=function(u,A){var T=E.console;T&&T.error&&(1==arguments.length?T.error(u):T.error(u,A))}},u=>{u.exports=function(u){try{return{error:!1,value:u()}}catch(u){return{error:!0,value:u}}}},u=>{u.exports="object"==typeof window},(u,A,T)=>{"use strict";var E=T(9),I=T(14),D=T(34),L=T(125),W=T(127),N=T(87);E({target:"Promise",stat:!0},{allSettled:function(u){var A=this,T=L.f(A),E=T.resolve,U=T.reject,H=W(function(){var T=D(A.resolve),L=[],W=0,U=1;N(u,function(u){var D=W++,N=!1;U++,I(T,A,u).then(function(u){!N&&(N=!0,L[D]={status:"fulfilled",value:u},--U||E(L))},function(u){!N&&(N=!0,L[D]={status:"rejected",reason:u},--U||E(L))})}),--U||E(L)});return H.error&&U(H.value),T.promise}})},(u,A,T)=>{"use strict";var E=T(9),I=T(34),D=T(27),L=T(14),W=T(125),N=T(127),U=T(87),H="No one promise resolved";E({target:"Promise",stat:!0},{any:function(u){var A=this,T=D("AggregateError"),E=W.f(A),Q=E.resolve,K=E.reject,J=N(function(){var E=I(A.resolve),D=[],W=0,N=1,J=!1;U(u,function(u){var I=W++,U=!1;N++,L(E,A,u).then(function(u){U||J||(J=!0,Q(u))},function(u){!U&&!J&&(U=!0,D[I]=u,--N||K(new T(D,H)))})}),--N||K(new T(D,H))});return J.error&&K(J.value),E.promise}})},(u,A,T)=>{"use strict";var E=T(9),I=T(39),D=T(108),L=T(13),W=T(27),N=T(25),U=T(113),H=T(124),Q=T(50);if(E({target:"Promise",proto:!0,real:!0,forced:!!D&&L(function(){D.prototype.finally.call({then:function(){}},function(){})})},{finally:function(u){var A=U(this,W("Promise")),T=N(u);return this.then(T?function(T){return H(A,u()).then(function(){return T})}:u,T?function(T){return H(A,u()).then(function(){throw T})}:u)}}),!I&&N(D)){var K=W("Promise").prototype.finally;D.prototype.finally!==K&&Q(D.prototype,"finally",K,{unsafe:!0})}},(u,A,T)=>{"use strict";var E=T(133).charAt,I=T(103),D=T(52),L=T(78),W="String Iterator",N=D.set,U=D.getterFor(W);L(String,"String",function(u){N(this,{type:W,string:I(u),index:0})},function(){var u,A=U(this),T=A.string,I=A.index;return I>=T.length?{value:void 0,done:!0}:(u=E(T,I),A.index+=u.length,{value:u,done:!1})})},(u,A,T)=>{var E=T(19),I=T(63),D=T(103),L=T(21),W=E("".charAt),N=E("".charCodeAt),U=E("".slice),createMethod=function(u){return function(A,T){var E,H,Q=D(L(A)),K=I(T),J=Q.length;return K<0||K>=J?u?"":void 0:(E=N(Q,K))<55296||E>56319||K+1===J||(H=N(Q,K+1))<56320||H>57343?u?W(Q,K):E:u?U(Q,K,K+2):(E-55296<<10)+(H-56320)+65536}};u.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},function(u,A){!function(u,T){T(A)}(0,function(u){"use strict";var A,T,E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(u){return"Symbol("+u+")"};function noop(){}var I=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==__webpack_require__.g?__webpack_require__.g:void 0}();function typeIsObject(u){return"object"==typeof u&&null!==u||"function"==typeof u}var D=noop,L=Promise,W=Promise.prototype.then,N=Promise.resolve.bind(L),U=Promise.reject.bind(L);function newPromise(u){return new L(u)}function promiseResolvedWith(u){return N(u)}function promiseRejectedWith(u){return U(u)}function PerformPromiseThen(u,A,T){return W.call(u,A,T)}function uponPromise(u,A,T){PerformPromiseThen(PerformPromiseThen(u,A,T),void 0,D)}function uponFulfillment(u,A){uponPromise(u,A)}function uponRejection(u,A){uponPromise(u,void 0,A)}function transformPromiseWith(u,A,T){return PerformPromiseThen(u,A,T)}function setPromiseIsHandledToTrue(u){PerformPromiseThen(u,void 0,D)}var H=function(){var u=I&&I.queueMicrotask;if("function"==typeof u)return u;var A=promiseResolvedWith(void 0);return function(u){return PerformPromiseThen(A,u)}}();function reflectCall(u,A,T){if("function"!=typeof u)throw TypeError("Argument is not a function");return Function.prototype.apply.call(u,A,T)}function promiseCall(u,A,T){try{return promiseResolvedWith(reflectCall(u,A,T))}catch(u){return promiseRejectedWith(u)}}var Q=16384,K=function(){function SimpleQueue(){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(SimpleQueue.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0}),SimpleQueue.prototype.push=function(u){var A=this._back,T=A;A._elements.length===Q-1&&(T={_elements:[],_next:void 0}),A._elements.push(u),T!==A&&(this._back=T,A._next=T),++this._size},SimpleQueue.prototype.shift=function(){var u=this._front,A=u,T=this._cursor,E=T+1,I=u._elements,D=I[T];return E===Q&&(A=u._next,E=0),--this._size,this._cursor=E,u!==A&&(this._front=A),I[T]=void 0,D},SimpleQueue.prototype.forEach=function(u){for(var A=this._cursor,T=this._front,E=T._elements;(A!==E.length||void 0!==T._next)&&(A!==E.length||(E=(T=T._next)._elements,A=0,0!==E.length));)u(E[A]),++A},SimpleQueue.prototype.peek=function(){var u=this._front,A=this._cursor;return u._elements[A]},SimpleQueue}();function ReadableStreamReaderGenericInitialize(u,A){u._ownerReadableStream=A,A._reader=u,"readable"===A._state?defaultReaderClosedPromiseInitialize(u):"closed"===A._state?defaultReaderClosedPromiseInitializeAsResolved(u):defaultReaderClosedPromiseInitializeAsRejected(u,A._storedError)}function ReadableStreamReaderGenericCancel(u,A){return ReadableStreamCancel(u._ownerReadableStream,A)}function ReadableStreamReaderGenericRelease(u){"readable"===u._ownerReadableStream._state?defaultReaderClosedPromiseReject(u,TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):defaultReaderClosedPromiseResetToRejected(u,TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._ownerReadableStream._reader=void 0,u._ownerReadableStream=void 0}function readerLockException(u){return TypeError("Cannot "+u+" a stream using a released reader")}function defaultReaderClosedPromiseInitialize(u){u._closedPromise=newPromise(function(A,T){u._closedPromise_resolve=A,u._closedPromise_reject=T})}function defaultReaderClosedPromiseInitializeAsRejected(u,A){defaultReaderClosedPromiseInitialize(u),defaultReaderClosedPromiseReject(u,A)}function defaultReaderClosedPromiseInitializeAsResolved(u){defaultReaderClosedPromiseInitialize(u),defaultReaderClosedPromiseResolve(u)}function defaultReaderClosedPromiseReject(u,A){void 0!==u._closedPromise_reject&&(setPromiseIsHandledToTrue(u._closedPromise),u._closedPromise_reject(A),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0)}function defaultReaderClosedPromiseResetToRejected(u,A){defaultReaderClosedPromiseInitializeAsRejected(u,A)}function defaultReaderClosedPromiseResolve(u){void 0!==u._closedPromise_resolve&&(u._closedPromise_resolve(void 0),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0)}var J=E("[[AbortSteps]]"),ee=E("[[ErrorSteps]]"),et=E("[[CancelSteps]]"),er=E("[[PullSteps]]"),en=Number.isFinite||function(u){return"number"==typeof u&&isFinite(u)},ea=Math.trunc||function(u){return u<0?Math.ceil(u):Math.floor(u)};function isDictionary(u){return"object"==typeof u||"function"==typeof u}function assertDictionary(u,A){if(void 0!==u&&!isDictionary(u))throw TypeError(A+" is not an object.")}function assertFunction(u,A){if("function"!=typeof u)throw TypeError(A+" is not a function.")}function isObject(u){return"object"==typeof u&&null!==u||"function"==typeof u}function assertObject(u,A){if(!isObject(u))throw TypeError(A+" is not an object.")}function assertRequiredArgument(u,A,T){if(void 0===u)throw TypeError("Parameter "+A+" is required in '"+T+"'.")}function assertRequiredField(u,A,T){if(void 0===u)throw TypeError(A+" is required in '"+T+"'.")}function convertUnrestrictedDouble(u){return Number(u)}function censorNegativeZero(u){return 0===u?0:u}function integerPart(u){return censorNegativeZero(ea(u))}function convertUnsignedLongLongWithEnforceRange(u,A){var T=0,E=Number.MAX_SAFE_INTEGER,I=Number(u);if(!en(I=censorNegativeZero(I)))throw TypeError(A+" is not a finite number");if((I=integerPart(I))E)throw TypeError(A+" is outside the accepted range of "+T+" to "+E+", inclusive");return en(I)&&0!==I?I:0}function assertReadableStream(u,A){if(!IsReadableStream(u))throw TypeError(A+" is not a ReadableStream.")}function AcquireReadableStreamDefaultReader(u){return new eo(u)}function ReadableStreamAddReadRequest(u,A){u._reader._readRequests.push(A)}function ReadableStreamFulfillReadRequest(u,A,T){var E=u._reader._readRequests.shift();T?E._closeSteps():E._chunkSteps(A)}function ReadableStreamGetNumReadRequests(u){return u._reader._readRequests.length}function ReadableStreamHasDefaultReader(u){var A=u._reader;return!!(void 0!==A&&IsReadableStreamDefaultReader(A))}var eo=function(){function ReadableStreamDefaultReader(u){if(assertRequiredArgument(u,1,"ReadableStreamDefaultReader"),assertReadableStream(u,"First parameter"),IsReadableStreamLocked(u))throw TypeError("This stream has already been locked for exclusive reading by another reader");ReadableStreamReaderGenericInitialize(this,u),this._readRequests=new K}return Object.defineProperty(ReadableStreamDefaultReader.prototype,"closed",{get:function(){return IsReadableStreamDefaultReader(this)?this._closedPromise:promiseRejectedWith(defaultReaderBrandCheckException("closed"))},enumerable:!1,configurable:!0}),ReadableStreamDefaultReader.prototype.cancel=function(u){return(void 0===u&&(u=void 0),IsReadableStreamDefaultReader(this))?void 0===this._ownerReadableStream?promiseRejectedWith(readerLockException("cancel")):ReadableStreamReaderGenericCancel(this,u):promiseRejectedWith(defaultReaderBrandCheckException("cancel"))},ReadableStreamDefaultReader.prototype.read=function(){if(!IsReadableStreamDefaultReader(this))return promiseRejectedWith(defaultReaderBrandCheckException("read"));if(void 0===this._ownerReadableStream)return promiseRejectedWith(readerLockException("read from"));var u,A,T=newPromise(function(T,E){u=T,A=E});return ReadableStreamDefaultReaderRead(this,{_chunkSteps:function(A){return u({value:A,done:!1})},_closeSteps:function(){return u({value:void 0,done:!0})},_errorSteps:function(u){return A(u)}}),T},ReadableStreamDefaultReader.prototype.releaseLock=function(){if(!IsReadableStreamDefaultReader(this))throw defaultReaderBrandCheckException("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");ReadableStreamReaderGenericRelease(this)}},ReadableStreamDefaultReader}();function IsReadableStreamDefaultReader(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_readRequests"))&&u instanceof eo}function ReadableStreamDefaultReaderRead(u,A){var T=u._ownerReadableStream;T._disturbed=!0,"closed"===T._state?A._closeSteps():"errored"===T._state?A._errorSteps(T._storedError):T._readableStreamController[er](A)}function defaultReaderBrandCheckException(u){return TypeError("ReadableStreamDefaultReader.prototype."+u+" can only be used on a ReadableStreamDefaultReader")}Object.defineProperties(eo.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(eo.prototype,E.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof E.asyncIterator&&((A={})[E.asyncIterator]=function(){return this},Object.defineProperty(T=A,E.asyncIterator,{enumerable:!1}));var ei=function(){function ReadableStreamAsyncIteratorImpl(u,A){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=A}return ReadableStreamAsyncIteratorImpl.prototype.next=function(){var u=this,nextSteps=function(){return u._nextSteps()};return this._ongoingPromise=this._ongoingPromise?transformPromiseWith(this._ongoingPromise,nextSteps,nextSteps):nextSteps(),this._ongoingPromise},ReadableStreamAsyncIteratorImpl.prototype.return=function(u){var A=this,returnSteps=function(){return A._returnSteps(u)};return this._ongoingPromise?transformPromiseWith(this._ongoingPromise,returnSteps,returnSteps):returnSteps()},ReadableStreamAsyncIteratorImpl.prototype._nextSteps=function(){var u,A,T=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var E=this._reader;if(void 0===E._ownerReadableStream)return promiseRejectedWith(readerLockException("iterate"));var I=newPromise(function(T,E){u=T,A=E}),D={_chunkSteps:function(A){T._ongoingPromise=void 0,H(function(){return u({value:A,done:!1})})},_closeSteps:function(){T._ongoingPromise=void 0,T._isFinished=!0,ReadableStreamReaderGenericRelease(E),u({value:void 0,done:!0})},_errorSteps:function(u){T._ongoingPromise=void 0,T._isFinished=!0,ReadableStreamReaderGenericRelease(E),A(u)}};return ReadableStreamDefaultReaderRead(E,D),I},ReadableStreamAsyncIteratorImpl.prototype._returnSteps=function(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;var A=this._reader;if(void 0===A._ownerReadableStream)return promiseRejectedWith(readerLockException("finish iterating"));if(!this._preventCancel){var T=ReadableStreamReaderGenericCancel(A,u);return ReadableStreamReaderGenericRelease(A),transformPromiseWith(T,function(){return{value:u,done:!0}})}return ReadableStreamReaderGenericRelease(A),promiseResolvedWith({value:u,done:!0})},ReadableStreamAsyncIteratorImpl}(),es={next:function(){return IsReadableStreamAsyncIterator(this)?this._asyncIteratorImpl.next():promiseRejectedWith(streamAsyncIteratorBrandCheckException("next"))},return:function(u){return IsReadableStreamAsyncIterator(this)?this._asyncIteratorImpl.return(u):promiseRejectedWith(streamAsyncIteratorBrandCheckException("return"))}};function AcquireReadableStreamAsyncIterator(u,A){var T=AcquireReadableStreamDefaultReader(u),E=new ei(T,A),I=Object.create(es);return I._asyncIteratorImpl=E,I}function IsReadableStreamAsyncIterator(u){if(!typeIsObject(u)||!Object.prototype.hasOwnProperty.call(u,"_asyncIteratorImpl"))return!1;try{return u._asyncIteratorImpl instanceof ei}catch(u){return!1}}function streamAsyncIteratorBrandCheckException(u){return TypeError("ReadableStreamAsyncIterator."+u+" can only be used on a ReadableSteamAsyncIterator")}void 0!==T&&Object.setPrototypeOf(es,T);var eu=Number.isNaN||function(u){return u!=u};function CreateArrayFromList(u){return u.slice()}function CopyDataBlockBytes(u,A,T,E,I){new Uint8Array(u).set(new Uint8Array(T,E,I),A)}function TransferArrayBuffer(u){return u}function IsDetachedBuffer(u){return!1}function ArrayBufferSlice(u,A,T){if(u.slice)return u.slice(A,T);var E=T-A,I=new ArrayBuffer(E);return CopyDataBlockBytes(I,0,u,A,E),I}function IsNonNegativeNumber(u){return!("number"!=typeof u||eu(u))&&!(u<0)}function CloneAsUint8Array(u){var A=ArrayBufferSlice(u.buffer,u.byteOffset,u.byteOffset+u.byteLength);return new Uint8Array(A)}function DequeueValue(u){var A=u._queue.shift();return u._queueTotalSize-=A.size,u._queueTotalSize<0&&(u._queueTotalSize=0),A.value}function EnqueueValueWithSize(u,A,T){if(!IsNonNegativeNumber(T)||T===1/0)throw RangeError("Size must be a finite, non-NaN, non-negative number.");u._queue.push({value:A,size:T}),u._queueTotalSize+=T}function PeekQueueValue(u){return u._queue.peek().value}function ResetQueue(u){u._queue=new K,u._queueTotalSize=0}var ec=function(){function ReadableStreamBYOBRequest(){throw TypeError("Illegal constructor")}return Object.defineProperty(ReadableStreamBYOBRequest.prototype,"view",{get:function(){if(!IsReadableStreamBYOBRequest(this))throw byobRequestBrandCheckException("view");return this._view},enumerable:!1,configurable:!0}),ReadableStreamBYOBRequest.prototype.respond=function(u){if(!IsReadableStreamBYOBRequest(this))throw byobRequestBrandCheckException("respond");if(assertRequiredArgument(u,1,"respond"),u=convertUnsignedLongLongWithEnforceRange(u,"First parameter"),void 0===this._associatedReadableByteStreamController)throw TypeError("This BYOB request has been invalidated");IsDetachedBuffer(this._view.buffer),ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController,u)},ReadableStreamBYOBRequest.prototype.respondWithNewView=function(u){if(!IsReadableStreamBYOBRequest(this))throw byobRequestBrandCheckException("respondWithNewView");if(assertRequiredArgument(u,1,"respondWithNewView"),!ArrayBuffer.isView(u))throw TypeError("You can only respond with array buffer views");if(void 0===this._associatedReadableByteStreamController)throw TypeError("This BYOB request has been invalidated");IsDetachedBuffer(u.buffer),ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController,u)},ReadableStreamBYOBRequest}();Object.defineProperties(ec.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(ec.prototype,E.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var ed=function(){function ReadableByteStreamController(){throw TypeError("Illegal constructor")}return Object.defineProperty(ReadableByteStreamController.prototype,"byobRequest",{get:function(){if(!IsReadableByteStreamController(this))throw byteStreamControllerBrandCheckException("byobRequest");return ReadableByteStreamControllerGetBYOBRequest(this)},enumerable:!1,configurable:!0}),Object.defineProperty(ReadableByteStreamController.prototype,"desiredSize",{get:function(){if(!IsReadableByteStreamController(this))throw byteStreamControllerBrandCheckException("desiredSize");return ReadableByteStreamControllerGetDesiredSize(this)},enumerable:!1,configurable:!0}),ReadableByteStreamController.prototype.close=function(){if(!IsReadableByteStreamController(this))throw byteStreamControllerBrandCheckException("close");if(this._closeRequested)throw TypeError("The stream has already been closed; do not close it again!");var u=this._controlledReadableByteStream._state;if("readable"!==u)throw TypeError("The stream (in "+u+" state) is not in the readable state and cannot be closed");ReadableByteStreamControllerClose(this)},ReadableByteStreamController.prototype.enqueue=function(u){if(!IsReadableByteStreamController(this))throw byteStreamControllerBrandCheckException("enqueue");if(assertRequiredArgument(u,1,"enqueue"),!ArrayBuffer.isView(u))throw TypeError("chunk must be an array buffer view");if(0===u.byteLength)throw TypeError("chunk must have non-zero byteLength");if(0===u.buffer.byteLength)throw TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw TypeError("stream is closed or draining");var A=this._controlledReadableByteStream._state;if("readable"!==A)throw TypeError("The stream (in "+A+" state) is not in the readable state and cannot be enqueued to");ReadableByteStreamControllerEnqueue(this,u)},ReadableByteStreamController.prototype.error=function(u){if(void 0===u&&(u=void 0),!IsReadableByteStreamController(this))throw byteStreamControllerBrandCheckException("error");ReadableByteStreamControllerError(this,u)},ReadableByteStreamController.prototype[et]=function(u){ReadableByteStreamControllerClearPendingPullIntos(this),ResetQueue(this);var A=this._cancelAlgorithm(u);return ReadableByteStreamControllerClearAlgorithms(this),A},ReadableByteStreamController.prototype[er]=function(u){var A=this._controlledReadableByteStream;if(this._queueTotalSize>0){var T=this._queue.shift();this._queueTotalSize-=T.byteLength,ReadableByteStreamControllerHandleQueueDrain(this);var E=new Uint8Array(T.buffer,T.byteOffset,T.byteLength);u._chunkSteps(E);return}var I=this._autoAllocateChunkSize;if(void 0!==I){var D=void 0;try{D=new ArrayBuffer(I)}catch(A){u._errorSteps(A);return}var L={buffer:D,bufferByteLength:I,byteOffset:0,byteLength:I,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(L)}ReadableStreamAddReadRequest(A,u),ReadableByteStreamControllerCallPullIfNeeded(this)},ReadableByteStreamController}();function IsReadableByteStreamController(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_controlledReadableByteStream"))&&u instanceof ed}function IsReadableStreamBYOBRequest(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_associatedReadableByteStreamController"))&&u instanceof ec}function ReadableByteStreamControllerCallPullIfNeeded(u){if(ReadableByteStreamControllerShouldCallPull(u)){if(u._pulling){u._pullAgain=!0;return}u._pulling=!0,uponPromise(u._pullAlgorithm(),function(){u._pulling=!1,u._pullAgain&&(u._pullAgain=!1,ReadableByteStreamControllerCallPullIfNeeded(u))},function(A){ReadableByteStreamControllerError(u,A)})}}function ReadableByteStreamControllerClearPendingPullIntos(u){ReadableByteStreamControllerInvalidateBYOBRequest(u),u._pendingPullIntos=new K}function ReadableByteStreamControllerCommitPullIntoDescriptor(u,A){var T=!1;"closed"===u._state&&(T=!0);var E=ReadableByteStreamControllerConvertPullIntoDescriptor(A);"default"===A.readerType?ReadableStreamFulfillReadRequest(u,E,T):ReadableStreamFulfillReadIntoRequest(u,E,T)}function ReadableByteStreamControllerConvertPullIntoDescriptor(u){var A=u.bytesFilled,T=u.elementSize;return new u.viewConstructor(u.buffer,u.byteOffset,A/T)}function ReadableByteStreamControllerEnqueueChunkToQueue(u,A,T,E){u._queue.push({buffer:A,byteOffset:T,byteLength:E}),u._queueTotalSize+=E}function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(u,A){var T=A.elementSize,E=A.bytesFilled-A.bytesFilled%T,I=Math.min(u._queueTotalSize,A.byteLength-A.bytesFilled),D=A.bytesFilled+I,L=D-D%T,W=I,N=!1;L>E&&(W=L-A.bytesFilled,N=!0);for(var U=u._queue;W>0;){var H=U.peek(),Q=Math.min(W,H.byteLength),K=A.byteOffset+A.bytesFilled;CopyDataBlockBytes(A.buffer,K,H.buffer,H.byteOffset,Q),H.byteLength===Q?U.shift():(H.byteOffset+=Q,H.byteLength-=Q),u._queueTotalSize-=Q,ReadableByteStreamControllerFillHeadPullIntoDescriptor(u,Q,A),W-=Q}return N}function ReadableByteStreamControllerFillHeadPullIntoDescriptor(u,A,T){T.bytesFilled+=A}function ReadableByteStreamControllerHandleQueueDrain(u){0===u._queueTotalSize&&u._closeRequested?(ReadableByteStreamControllerClearAlgorithms(u),ReadableStreamClose(u._controlledReadableByteStream)):ReadableByteStreamControllerCallPullIfNeeded(u)}function ReadableByteStreamControllerInvalidateBYOBRequest(u){null!==u._byobRequest&&(u._byobRequest._associatedReadableByteStreamController=void 0,u._byobRequest._view=null,u._byobRequest=null)}function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(u){for(;u._pendingPullIntos.length>0;){if(0===u._queueTotalSize)return;var A=u._pendingPullIntos.peek();ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(u,A)&&(ReadableByteStreamControllerShiftPendingPullInto(u),ReadableByteStreamControllerCommitPullIntoDescriptor(u._controlledReadableByteStream,A))}}function ReadableByteStreamControllerPullInto(u,A,T){var E=u._controlledReadableByteStream,I=1;A.constructor!==DataView&&(I=A.constructor.BYTES_PER_ELEMENT);var D=A.constructor,L=TransferArrayBuffer(A.buffer),W={buffer:L,bufferByteLength:L.byteLength,byteOffset:A.byteOffset,byteLength:A.byteLength,bytesFilled:0,elementSize:I,viewConstructor:D,readerType:"byob"};if(u._pendingPullIntos.length>0){u._pendingPullIntos.push(W),ReadableStreamAddReadIntoRequest(E,T);return}if("closed"===E._state){var N=new D(W.buffer,W.byteOffset,0);T._closeSteps(N);return}if(u._queueTotalSize>0){if(ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(u,W)){var U=ReadableByteStreamControllerConvertPullIntoDescriptor(W);ReadableByteStreamControllerHandleQueueDrain(u),T._chunkSteps(U);return}if(u._closeRequested){var H=TypeError("Insufficient bytes to fill elements in the given buffer");ReadableByteStreamControllerError(u,H),T._errorSteps(H);return}}u._pendingPullIntos.push(W),ReadableStreamAddReadIntoRequest(E,T),ReadableByteStreamControllerCallPullIfNeeded(u)}function ReadableByteStreamControllerRespondInClosedState(u,A){var T=u._controlledReadableByteStream;if(ReadableStreamHasBYOBReader(T))for(;ReadableStreamGetNumReadIntoRequests(T)>0;)ReadableByteStreamControllerCommitPullIntoDescriptor(T,ReadableByteStreamControllerShiftPendingPullInto(u))}function ReadableByteStreamControllerRespondInReadableState(u,A,T){if(ReadableByteStreamControllerFillHeadPullIntoDescriptor(u,A,T),!(T.bytesFilled0){var I=T.byteOffset+T.bytesFilled,D=ArrayBufferSlice(T.buffer,I-E,I);ReadableByteStreamControllerEnqueueChunkToQueue(u,D,0,D.byteLength)}T.bytesFilled-=E,ReadableByteStreamControllerCommitPullIntoDescriptor(u._controlledReadableByteStream,T),ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(u)}}function ReadableByteStreamControllerRespondInternal(u,A){var T=u._pendingPullIntos.peek();ReadableByteStreamControllerInvalidateBYOBRequest(u),"closed"===u._controlledReadableByteStream._state?ReadableByteStreamControllerRespondInClosedState(u):ReadableByteStreamControllerRespondInReadableState(u,A,T),ReadableByteStreamControllerCallPullIfNeeded(u)}function ReadableByteStreamControllerShiftPendingPullInto(u){return u._pendingPullIntos.shift()}function ReadableByteStreamControllerShouldCallPull(u){var A=u._controlledReadableByteStream;return"readable"===A._state&&!u._closeRequested&&!!u._started&&!!(ReadableStreamHasDefaultReader(A)&&ReadableStreamGetNumReadRequests(A)>0||ReadableStreamHasBYOBReader(A)&&ReadableStreamGetNumReadIntoRequests(A)>0||ReadableByteStreamControllerGetDesiredSize(u)>0)}function ReadableByteStreamControllerClearAlgorithms(u){u._pullAlgorithm=void 0,u._cancelAlgorithm=void 0}function ReadableByteStreamControllerClose(u){var A=u._controlledReadableByteStream;if(!u._closeRequested&&"readable"===A._state){if(u._queueTotalSize>0){u._closeRequested=!0;return}if(u._pendingPullIntos.length>0&&u._pendingPullIntos.peek().bytesFilled>0){var T=TypeError("Insufficient bytes to fill elements in the given buffer");throw ReadableByteStreamControllerError(u,T),T}ReadableByteStreamControllerClearAlgorithms(u),ReadableStreamClose(A)}}function ReadableByteStreamControllerEnqueue(u,A){var T=u._controlledReadableByteStream;if(!u._closeRequested&&"readable"===T._state){var E=A.buffer,I=A.byteOffset,D=A.byteLength,L=TransferArrayBuffer(E);if(u._pendingPullIntos.length>0){var W=u._pendingPullIntos.peek();IsDetachedBuffer(W.buffer),W.buffer=TransferArrayBuffer(W.buffer)}ReadableByteStreamControllerInvalidateBYOBRequest(u),ReadableStreamHasDefaultReader(T)?0===ReadableStreamGetNumReadRequests(T)?ReadableByteStreamControllerEnqueueChunkToQueue(u,L,I,D):(u._pendingPullIntos.length>0&&ReadableByteStreamControllerShiftPendingPullInto(u),ReadableStreamFulfillReadRequest(T,new Uint8Array(L,I,D),!1)):ReadableStreamHasBYOBReader(T)?(ReadableByteStreamControllerEnqueueChunkToQueue(u,L,I,D),ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(u)):ReadableByteStreamControllerEnqueueChunkToQueue(u,L,I,D),ReadableByteStreamControllerCallPullIfNeeded(u)}}function ReadableByteStreamControllerError(u,A){var T=u._controlledReadableByteStream;"readable"===T._state&&(ReadableByteStreamControllerClearPendingPullIntos(u),ResetQueue(u),ReadableByteStreamControllerClearAlgorithms(u),ReadableStreamError(T,A))}function ReadableByteStreamControllerGetBYOBRequest(u){if(null===u._byobRequest&&u._pendingPullIntos.length>0){var A=u._pendingPullIntos.peek(),T=new Uint8Array(A.buffer,A.byteOffset+A.bytesFilled,A.byteLength-A.bytesFilled),E=Object.create(ec.prototype);SetUpReadableStreamBYOBRequest(E,u,T),u._byobRequest=E}return u._byobRequest}function ReadableByteStreamControllerGetDesiredSize(u){var A=u._controlledReadableByteStream._state;return"errored"===A?null:"closed"===A?0:u._strategyHWM-u._queueTotalSize}function ReadableByteStreamControllerRespond(u,A){var T=u._pendingPullIntos.peek();if("closed"===u._controlledReadableByteStream._state){if(0!==A)throw TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(0===A)throw TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(T.bytesFilled+A>T.byteLength)throw RangeError("bytesWritten out of range")}T.buffer=TransferArrayBuffer(T.buffer),ReadableByteStreamControllerRespondInternal(u,A)}function ReadableByteStreamControllerRespondWithNewView(u,A){var T=u._pendingPullIntos.peek();if("closed"===u._controlledReadableByteStream._state){if(0!==A.byteLength)throw TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(0===A.byteLength)throw TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(T.byteOffset+T.bytesFilled!==A.byteOffset)throw RangeError("The region specified by view does not match byobRequest");if(T.bufferByteLength!==A.buffer.byteLength)throw RangeError("The buffer of view has different capacity than byobRequest");if(T.bytesFilled+A.byteLength>T.byteLength)throw RangeError("The region specified by view is larger than byobRequest");var E=A.byteLength;T.buffer=TransferArrayBuffer(A.buffer),ReadableByteStreamControllerRespondInternal(u,E)}function SetUpReadableByteStreamController(u,A,T,E,I,D,L){A._controlledReadableByteStream=u,A._pullAgain=!1,A._pulling=!1,A._byobRequest=null,A._queue=A._queueTotalSize=void 0,ResetQueue(A),A._closeRequested=!1,A._started=!1,A._strategyHWM=D,A._pullAlgorithm=E,A._cancelAlgorithm=I,A._autoAllocateChunkSize=L,A._pendingPullIntos=new K,u._readableStreamController=A,uponPromise(promiseResolvedWith(T()),function(){A._started=!0,ReadableByteStreamControllerCallPullIfNeeded(A)},function(u){ReadableByteStreamControllerError(A,u)})}function SetUpReadableByteStreamControllerFromUnderlyingSource(u,A,T){var E=Object.create(ed.prototype),startAlgorithm=function(){},pullAlgorithm=function(){return promiseResolvedWith(void 0)},cancelAlgorithm=function(){return promiseResolvedWith(void 0)};void 0!==A.start&&(startAlgorithm=function(){return A.start(E)}),void 0!==A.pull&&(pullAlgorithm=function(){return A.pull(E)}),void 0!==A.cancel&&(cancelAlgorithm=function(u){return A.cancel(u)});var I=A.autoAllocateChunkSize;if(0===I)throw TypeError("autoAllocateChunkSize must be greater than 0");SetUpReadableByteStreamController(u,E,startAlgorithm,pullAlgorithm,cancelAlgorithm,T,I)}function SetUpReadableStreamBYOBRequest(u,A,T){u._associatedReadableByteStreamController=A,u._view=T}function byobRequestBrandCheckException(u){return TypeError("ReadableStreamBYOBRequest.prototype."+u+" can only be used on a ReadableStreamBYOBRequest")}function byteStreamControllerBrandCheckException(u){return TypeError("ReadableByteStreamController.prototype."+u+" can only be used on a ReadableByteStreamController")}function AcquireReadableStreamBYOBReader(u){return new ef(u)}function ReadableStreamAddReadIntoRequest(u,A){u._reader._readIntoRequests.push(A)}function ReadableStreamFulfillReadIntoRequest(u,A,T){var E=u._reader._readIntoRequests.shift();T?E._closeSteps(A):E._chunkSteps(A)}function ReadableStreamGetNumReadIntoRequests(u){return u._reader._readIntoRequests.length}function ReadableStreamHasBYOBReader(u){var A=u._reader;return!!(void 0!==A&&IsReadableStreamBYOBReader(A))}Object.defineProperties(ed.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(ed.prototype,E.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var ef=function(){function ReadableStreamBYOBReader(u){if(assertRequiredArgument(u,1,"ReadableStreamBYOBReader"),assertReadableStream(u,"First parameter"),IsReadableStreamLocked(u))throw TypeError("This stream has already been locked for exclusive reading by another reader");if(!IsReadableByteStreamController(u._readableStreamController))throw TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ReadableStreamReaderGenericInitialize(this,u),this._readIntoRequests=new K}return Object.defineProperty(ReadableStreamBYOBReader.prototype,"closed",{get:function(){return IsReadableStreamBYOBReader(this)?this._closedPromise:promiseRejectedWith(byobReaderBrandCheckException("closed"))},enumerable:!1,configurable:!0}),ReadableStreamBYOBReader.prototype.cancel=function(u){return(void 0===u&&(u=void 0),IsReadableStreamBYOBReader(this))?void 0===this._ownerReadableStream?promiseRejectedWith(readerLockException("cancel")):ReadableStreamReaderGenericCancel(this,u):promiseRejectedWith(byobReaderBrandCheckException("cancel"))},ReadableStreamBYOBReader.prototype.read=function(u){if(!IsReadableStreamBYOBReader(this))return promiseRejectedWith(byobReaderBrandCheckException("read"));if(!ArrayBuffer.isView(u))return promiseRejectedWith(TypeError("view must be an array buffer view"));if(0===u.byteLength)return promiseRejectedWith(TypeError("view must have non-zero byteLength"));if(0===u.buffer.byteLength)return promiseRejectedWith(TypeError("view's buffer must have non-zero byteLength"));if(IsDetachedBuffer(u.buffer),void 0===this._ownerReadableStream)return promiseRejectedWith(readerLockException("read from"));var A,T,E=newPromise(function(u,E){A=u,T=E});return ReadableStreamBYOBReaderRead(this,u,{_chunkSteps:function(u){return A({value:u,done:!1})},_closeSteps:function(u){return A({value:u,done:!0})},_errorSteps:function(u){return T(u)}}),E},ReadableStreamBYOBReader.prototype.releaseLock=function(){if(!IsReadableStreamBYOBReader(this))throw byobReaderBrandCheckException("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");ReadableStreamReaderGenericRelease(this)}},ReadableStreamBYOBReader}();function IsReadableStreamBYOBReader(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_readIntoRequests"))&&u instanceof ef}function ReadableStreamBYOBReaderRead(u,A,T){var E=u._ownerReadableStream;E._disturbed=!0,"errored"===E._state?T._errorSteps(E._storedError):ReadableByteStreamControllerPullInto(E._readableStreamController,A,T)}function byobReaderBrandCheckException(u){return TypeError("ReadableStreamBYOBReader.prototype."+u+" can only be used on a ReadableStreamBYOBReader")}function ExtractHighWaterMark(u,A){var T=u.highWaterMark;if(void 0===T)return A;if(eu(T)||T<0)throw RangeError("Invalid highWaterMark");return T}function ExtractSizeAlgorithm(u){return u.size||function(){return 1}}function convertQueuingStrategy(u,A){assertDictionary(u,A);var T=null==u?void 0:u.highWaterMark,E=null==u?void 0:u.size;return{highWaterMark:void 0===T?void 0:convertUnrestrictedDouble(T),size:void 0===E?void 0:convertQueuingStrategySize(E,A+" has member 'size' that")}}function convertQueuingStrategySize(u,A){return assertFunction(u,A),function(A){return convertUnrestrictedDouble(u(A))}}function convertUnderlyingSink(u,A){assertDictionary(u,A);var T=null==u?void 0:u.abort,E=null==u?void 0:u.close,I=null==u?void 0:u.start,D=null==u?void 0:u.type,L=null==u?void 0:u.write;return{abort:void 0===T?void 0:convertUnderlyingSinkAbortCallback(T,u,A+" has member 'abort' that"),close:void 0===E?void 0:convertUnderlyingSinkCloseCallback(E,u,A+" has member 'close' that"),start:void 0===I?void 0:convertUnderlyingSinkStartCallback(I,u,A+" has member 'start' that"),write:void 0===L?void 0:convertUnderlyingSinkWriteCallback(L,u,A+" has member 'write' that"),type:D}}function convertUnderlyingSinkAbortCallback(u,A,T){return assertFunction(u,T),function(T){return promiseCall(u,A,[T])}}function convertUnderlyingSinkCloseCallback(u,A,T){return assertFunction(u,T),function(){return promiseCall(u,A,[])}}function convertUnderlyingSinkStartCallback(u,A,T){return assertFunction(u,T),function(T){return reflectCall(u,A,[T])}}function convertUnderlyingSinkWriteCallback(u,A,T){return assertFunction(u,T),function(T,E){return promiseCall(u,A,[T,E])}}function assertWritableStream(u,A){if(!IsWritableStream(u))throw TypeError(A+" is not a WritableStream.")}function isAbortSignal(u){if("object"!=typeof u||null===u)return!1;try{return"boolean"==typeof u.aborted}catch(u){return!1}}Object.defineProperties(ef.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(ef.prototype,E.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var eh="function"==typeof AbortController;function createAbortController(){if(eh)return new AbortController}var ep=function(){function WritableStream(u,A){void 0===u&&(u={}),void 0===A&&(A={}),void 0===u?u=null:assertObject(u,"First parameter");var T=convertQueuingStrategy(A,"Second parameter"),E=convertUnderlyingSink(u,"First parameter");if(InitializeWritableStream(this),void 0!==E.type)throw RangeError("Invalid type is specified");var I=ExtractSizeAlgorithm(T);SetUpWritableStreamDefaultControllerFromUnderlyingSink(this,E,ExtractHighWaterMark(T,1),I)}return Object.defineProperty(WritableStream.prototype,"locked",{get:function(){if(!IsWritableStream(this))throw streamBrandCheckException$2("locked");return IsWritableStreamLocked(this)},enumerable:!1,configurable:!0}),WritableStream.prototype.abort=function(u){return(void 0===u&&(u=void 0),IsWritableStream(this))?IsWritableStreamLocked(this)?promiseRejectedWith(TypeError("Cannot abort a stream that already has a writer")):WritableStreamAbort(this,u):promiseRejectedWith(streamBrandCheckException$2("abort"))},WritableStream.prototype.close=function(){return IsWritableStream(this)?IsWritableStreamLocked(this)?promiseRejectedWith(TypeError("Cannot close a stream that already has a writer")):WritableStreamCloseQueuedOrInFlight(this)?promiseRejectedWith(TypeError("Cannot close an already-closing stream")):WritableStreamClose(this):promiseRejectedWith(streamBrandCheckException$2("close"))},WritableStream.prototype.getWriter=function(){if(!IsWritableStream(this))throw streamBrandCheckException$2("getWriter");return AcquireWritableStreamDefaultWriter(this)},WritableStream}();function AcquireWritableStreamDefaultWriter(u){return new em(u)}function CreateWritableStream(u,A,T,E,I,D){void 0===I&&(I=1),void 0===D&&(D=function(){return 1});var L=Object.create(ep.prototype);return InitializeWritableStream(L),SetUpWritableStreamDefaultController(L,Object.create(ey.prototype),u,A,T,E,I,D),L}function InitializeWritableStream(u){u._state="writable",u._storedError=void 0,u._writer=void 0,u._writableStreamController=void 0,u._writeRequests=new K,u._inFlightWriteRequest=void 0,u._closeRequest=void 0,u._inFlightCloseRequest=void 0,u._pendingAbortRequest=void 0,u._backpressure=!1}function IsWritableStream(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_writableStreamController"))&&u instanceof ep}function IsWritableStreamLocked(u){return void 0!==u._writer}function WritableStreamAbort(u,A){if("closed"===u._state||"errored"===u._state)return promiseResolvedWith(void 0);u._writableStreamController._abortReason=A,null===(T=u._writableStreamController._abortController)||void 0===T||T.abort();var T,E=u._state;if("closed"===E||"errored"===E)return promiseResolvedWith(void 0);if(void 0!==u._pendingAbortRequest)return u._pendingAbortRequest._promise;var I=!1;"erroring"===E&&(I=!0,A=void 0);var D=newPromise(function(T,E){u._pendingAbortRequest={_promise:void 0,_resolve:T,_reject:E,_reason:A,_wasAlreadyErroring:I}});return u._pendingAbortRequest._promise=D,I||WritableStreamStartErroring(u,A),D}function WritableStreamClose(u){var A=u._state;if("closed"===A||"errored"===A)return promiseRejectedWith(TypeError("The stream (in "+A+" state) is not in the writable state and cannot be closed"));var T=newPromise(function(A,T){var E={_resolve:A,_reject:T};u._closeRequest=E}),E=u._writer;return void 0!==E&&u._backpressure&&"writable"===A&&defaultWriterReadyPromiseResolve(E),WritableStreamDefaultControllerClose(u._writableStreamController),T}function WritableStreamAddWriteRequest(u){return newPromise(function(A,T){var E={_resolve:A,_reject:T};u._writeRequests.push(E)})}function WritableStreamDealWithRejection(u,A){if("writable"===u._state){WritableStreamStartErroring(u,A);return}WritableStreamFinishErroring(u)}function WritableStreamStartErroring(u,A){var T=u._writableStreamController;u._state="erroring",u._storedError=A;var E=u._writer;void 0!==E&&WritableStreamDefaultWriterEnsureReadyPromiseRejected(E,A),!WritableStreamHasOperationMarkedInFlight(u)&&T._started&&WritableStreamFinishErroring(u)}function WritableStreamFinishErroring(u){u._state="errored",u._writableStreamController[ee]();var A=u._storedError;if(u._writeRequests.forEach(function(u){u._reject(A)}),u._writeRequests=new K,void 0===u._pendingAbortRequest){WritableStreamRejectCloseAndClosedPromiseIfNeeded(u);return}var T=u._pendingAbortRequest;if(u._pendingAbortRequest=void 0,T._wasAlreadyErroring){T._reject(A),WritableStreamRejectCloseAndClosedPromiseIfNeeded(u);return}uponPromise(u._writableStreamController[J](T._reason),function(){T._resolve(),WritableStreamRejectCloseAndClosedPromiseIfNeeded(u)},function(A){T._reject(A),WritableStreamRejectCloseAndClosedPromiseIfNeeded(u)})}function WritableStreamFinishInFlightWrite(u){u._inFlightWriteRequest._resolve(void 0),u._inFlightWriteRequest=void 0}function WritableStreamFinishInFlightWriteWithError(u,A){u._inFlightWriteRequest._reject(A),u._inFlightWriteRequest=void 0,WritableStreamDealWithRejection(u,A)}function WritableStreamFinishInFlightClose(u){u._inFlightCloseRequest._resolve(void 0),u._inFlightCloseRequest=void 0,"erroring"===u._state&&(u._storedError=void 0,void 0!==u._pendingAbortRequest&&(u._pendingAbortRequest._resolve(),u._pendingAbortRequest=void 0)),u._state="closed";var A=u._writer;void 0!==A&&defaultWriterClosedPromiseResolve(A)}function WritableStreamFinishInFlightCloseWithError(u,A){u._inFlightCloseRequest._reject(A),u._inFlightCloseRequest=void 0,void 0!==u._pendingAbortRequest&&(u._pendingAbortRequest._reject(A),u._pendingAbortRequest=void 0),WritableStreamDealWithRejection(u,A)}function WritableStreamCloseQueuedOrInFlight(u){return void 0!==u._closeRequest||void 0!==u._inFlightCloseRequest}function WritableStreamHasOperationMarkedInFlight(u){return void 0!==u._inFlightWriteRequest||void 0!==u._inFlightCloseRequest}function WritableStreamMarkCloseRequestInFlight(u){u._inFlightCloseRequest=u._closeRequest,u._closeRequest=void 0}function WritableStreamMarkFirstWriteRequestInFlight(u){u._inFlightWriteRequest=u._writeRequests.shift()}function WritableStreamRejectCloseAndClosedPromiseIfNeeded(u){void 0!==u._closeRequest&&(u._closeRequest._reject(u._storedError),u._closeRequest=void 0);var A=u._writer;void 0!==A&&defaultWriterClosedPromiseReject(A,u._storedError)}function WritableStreamUpdateBackpressure(u,A){var T=u._writer;void 0!==T&&A!==u._backpressure&&(A?defaultWriterReadyPromiseReset(T):defaultWriterReadyPromiseResolve(T)),u._backpressure=A}Object.defineProperties(ep.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(ep.prototype,E.toStringTag,{value:"WritableStream",configurable:!0});var em=function(){function WritableStreamDefaultWriter(u){if(assertRequiredArgument(u,1,"WritableStreamDefaultWriter"),assertWritableStream(u,"First parameter"),IsWritableStreamLocked(u))throw TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;var A=u._state;if("writable"===A)!WritableStreamCloseQueuedOrInFlight(u)&&u._backpressure?defaultWriterReadyPromiseInitialize(this):defaultWriterReadyPromiseInitializeAsResolved(this),defaultWriterClosedPromiseInitialize(this);else if("erroring"===A)defaultWriterReadyPromiseInitializeAsRejected(this,u._storedError),defaultWriterClosedPromiseInitialize(this);else if("closed"===A)defaultWriterReadyPromiseInitializeAsResolved(this),defaultWriterClosedPromiseInitializeAsResolved(this);else{var T=u._storedError;defaultWriterReadyPromiseInitializeAsRejected(this,T),defaultWriterClosedPromiseInitializeAsRejected(this,T)}}return Object.defineProperty(WritableStreamDefaultWriter.prototype,"closed",{get:function(){return IsWritableStreamDefaultWriter(this)?this._closedPromise:promiseRejectedWith(defaultWriterBrandCheckException("closed"))},enumerable:!1,configurable:!0}),Object.defineProperty(WritableStreamDefaultWriter.prototype,"desiredSize",{get:function(){if(!IsWritableStreamDefaultWriter(this))throw defaultWriterBrandCheckException("desiredSize");if(void 0===this._ownerWritableStream)throw defaultWriterLockException("desiredSize");return WritableStreamDefaultWriterGetDesiredSize(this)},enumerable:!1,configurable:!0}),Object.defineProperty(WritableStreamDefaultWriter.prototype,"ready",{get:function(){return IsWritableStreamDefaultWriter(this)?this._readyPromise:promiseRejectedWith(defaultWriterBrandCheckException("ready"))},enumerable:!1,configurable:!0}),WritableStreamDefaultWriter.prototype.abort=function(u){return(void 0===u&&(u=void 0),IsWritableStreamDefaultWriter(this))?void 0===this._ownerWritableStream?promiseRejectedWith(defaultWriterLockException("abort")):WritableStreamDefaultWriterAbort(this,u):promiseRejectedWith(defaultWriterBrandCheckException("abort"))},WritableStreamDefaultWriter.prototype.close=function(){if(!IsWritableStreamDefaultWriter(this))return promiseRejectedWith(defaultWriterBrandCheckException("close"));var u=this._ownerWritableStream;return void 0===u?promiseRejectedWith(defaultWriterLockException("close")):WritableStreamCloseQueuedOrInFlight(u)?promiseRejectedWith(TypeError("Cannot close an already-closing stream")):WritableStreamDefaultWriterClose(this)},WritableStreamDefaultWriter.prototype.releaseLock=function(){if(!IsWritableStreamDefaultWriter(this))throw defaultWriterBrandCheckException("releaseLock");void 0!==this._ownerWritableStream&&WritableStreamDefaultWriterRelease(this)},WritableStreamDefaultWriter.prototype.write=function(u){return(void 0===u&&(u=void 0),IsWritableStreamDefaultWriter(this))?void 0===this._ownerWritableStream?promiseRejectedWith(defaultWriterLockException("write to")):WritableStreamDefaultWriterWrite(this,u):promiseRejectedWith(defaultWriterBrandCheckException("write"))},WritableStreamDefaultWriter}();function IsWritableStreamDefaultWriter(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_ownerWritableStream"))&&u instanceof em}function WritableStreamDefaultWriterAbort(u,A){return WritableStreamAbort(u._ownerWritableStream,A)}function WritableStreamDefaultWriterClose(u){return WritableStreamClose(u._ownerWritableStream)}function WritableStreamDefaultWriterCloseWithErrorPropagation(u){var A=u._ownerWritableStream,T=A._state;return WritableStreamCloseQueuedOrInFlight(A)||"closed"===T?promiseResolvedWith(void 0):"errored"===T?promiseRejectedWith(A._storedError):WritableStreamDefaultWriterClose(u)}function WritableStreamDefaultWriterEnsureClosedPromiseRejected(u,A){"pending"===u._closedPromiseState?defaultWriterClosedPromiseReject(u,A):defaultWriterClosedPromiseResetToRejected(u,A)}function WritableStreamDefaultWriterEnsureReadyPromiseRejected(u,A){"pending"===u._readyPromiseState?defaultWriterReadyPromiseReject(u,A):defaultWriterReadyPromiseResetToRejected(u,A)}function WritableStreamDefaultWriterGetDesiredSize(u){var A=u._ownerWritableStream,T=A._state;return"errored"===T||"erroring"===T?null:"closed"===T?0:WritableStreamDefaultControllerGetDesiredSize(A._writableStreamController)}function WritableStreamDefaultWriterRelease(u){var A=u._ownerWritableStream,T=TypeError("Writer was released and can no longer be used to monitor the stream's closedness");WritableStreamDefaultWriterEnsureReadyPromiseRejected(u,T),WritableStreamDefaultWriterEnsureClosedPromiseRejected(u,T),A._writer=void 0,u._ownerWritableStream=void 0}function WritableStreamDefaultWriterWrite(u,A){var T=u._ownerWritableStream,E=T._writableStreamController,I=WritableStreamDefaultControllerGetChunkSize(E,A);if(T!==u._ownerWritableStream)return promiseRejectedWith(defaultWriterLockException("write to"));var D=T._state;if("errored"===D)return promiseRejectedWith(T._storedError);if(WritableStreamCloseQueuedOrInFlight(T)||"closed"===D)return promiseRejectedWith(TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===D)return promiseRejectedWith(T._storedError);var L=WritableStreamAddWriteRequest(T);return WritableStreamDefaultControllerWrite(E,A,I),L}Object.defineProperties(em.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(em.prototype,E.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var ev={},ey=function(){function WritableStreamDefaultController(){throw TypeError("Illegal constructor")}return Object.defineProperty(WritableStreamDefaultController.prototype,"abortReason",{get:function(){if(!IsWritableStreamDefaultController(this))throw defaultControllerBrandCheckException$2("abortReason");return this._abortReason},enumerable:!1,configurable:!0}),Object.defineProperty(WritableStreamDefaultController.prototype,"signal",{get:function(){if(!IsWritableStreamDefaultController(this))throw defaultControllerBrandCheckException$2("signal");if(void 0===this._abortController)throw TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal},enumerable:!1,configurable:!0}),WritableStreamDefaultController.prototype.error=function(u){if(void 0===u&&(u=void 0),!IsWritableStreamDefaultController(this))throw defaultControllerBrandCheckException$2("error");"writable"===this._controlledWritableStream._state&&WritableStreamDefaultControllerError(this,u)},WritableStreamDefaultController.prototype[J]=function(u){var A=this._abortAlgorithm(u);return WritableStreamDefaultControllerClearAlgorithms(this),A},WritableStreamDefaultController.prototype[ee]=function(){ResetQueue(this)},WritableStreamDefaultController}();function IsWritableStreamDefaultController(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_controlledWritableStream"))&&u instanceof ey}function SetUpWritableStreamDefaultController(u,A,T,E,I,D,L,W){A._controlledWritableStream=u,u._writableStreamController=A,A._queue=void 0,A._queueTotalSize=void 0,ResetQueue(A),A._abortReason=void 0,A._abortController=createAbortController(),A._started=!1,A._strategySizeAlgorithm=W,A._strategyHWM=L,A._writeAlgorithm=E,A._closeAlgorithm=I,A._abortAlgorithm=D,WritableStreamUpdateBackpressure(u,WritableStreamDefaultControllerGetBackpressure(A)),uponPromise(promiseResolvedWith(T()),function(){A._started=!0,WritableStreamDefaultControllerAdvanceQueueIfNeeded(A)},function(T){A._started=!0,WritableStreamDealWithRejection(u,T)})}function SetUpWritableStreamDefaultControllerFromUnderlyingSink(u,A,T,E){var I=Object.create(ey.prototype),startAlgorithm=function(){},writeAlgorithm=function(){return promiseResolvedWith(void 0)},closeAlgorithm=function(){return promiseResolvedWith(void 0)},abortAlgorithm=function(){return promiseResolvedWith(void 0)};void 0!==A.start&&(startAlgorithm=function(){return A.start(I)}),void 0!==A.write&&(writeAlgorithm=function(u){return A.write(u,I)}),void 0!==A.close&&(closeAlgorithm=function(){return A.close()}),void 0!==A.abort&&(abortAlgorithm=function(u){return A.abort(u)}),SetUpWritableStreamDefaultController(u,I,startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,T,E)}function WritableStreamDefaultControllerClearAlgorithms(u){u._writeAlgorithm=void 0,u._closeAlgorithm=void 0,u._abortAlgorithm=void 0,u._strategySizeAlgorithm=void 0}function WritableStreamDefaultControllerClose(u){EnqueueValueWithSize(u,ev,0),WritableStreamDefaultControllerAdvanceQueueIfNeeded(u)}function WritableStreamDefaultControllerGetChunkSize(u,A){try{return u._strategySizeAlgorithm(A)}catch(A){return WritableStreamDefaultControllerErrorIfNeeded(u,A),1}}function WritableStreamDefaultControllerGetDesiredSize(u){return u._strategyHWM-u._queueTotalSize}function WritableStreamDefaultControllerWrite(u,A,T){try{EnqueueValueWithSize(u,A,T)}catch(A){WritableStreamDefaultControllerErrorIfNeeded(u,A);return}var E=u._controlledWritableStream;WritableStreamCloseQueuedOrInFlight(E)||"writable"!==E._state||WritableStreamUpdateBackpressure(E,WritableStreamDefaultControllerGetBackpressure(u)),WritableStreamDefaultControllerAdvanceQueueIfNeeded(u)}function WritableStreamDefaultControllerAdvanceQueueIfNeeded(u){var A=u._controlledWritableStream;if(u._started&&void 0===A._inFlightWriteRequest){if("erroring"===A._state){WritableStreamFinishErroring(A);return}if(0!==u._queue.length){var T=PeekQueueValue(u);T===ev?WritableStreamDefaultControllerProcessClose(u):WritableStreamDefaultControllerProcessWrite(u,T)}}}function WritableStreamDefaultControllerErrorIfNeeded(u,A){"writable"===u._controlledWritableStream._state&&WritableStreamDefaultControllerError(u,A)}function WritableStreamDefaultControllerProcessClose(u){var A=u._controlledWritableStream;WritableStreamMarkCloseRequestInFlight(A),DequeueValue(u);var T=u._closeAlgorithm();WritableStreamDefaultControllerClearAlgorithms(u),uponPromise(T,function(){WritableStreamFinishInFlightClose(A)},function(u){WritableStreamFinishInFlightCloseWithError(A,u)})}function WritableStreamDefaultControllerProcessWrite(u,A){var T=u._controlledWritableStream;WritableStreamMarkFirstWriteRequestInFlight(T),uponPromise(u._writeAlgorithm(A),function(){WritableStreamFinishInFlightWrite(T);var A=T._state;DequeueValue(u),WritableStreamCloseQueuedOrInFlight(T)||"writable"!==A||WritableStreamUpdateBackpressure(T,WritableStreamDefaultControllerGetBackpressure(u)),WritableStreamDefaultControllerAdvanceQueueIfNeeded(u)},function(A){"writable"===T._state&&WritableStreamDefaultControllerClearAlgorithms(u),WritableStreamFinishInFlightWriteWithError(T,A)})}function WritableStreamDefaultControllerGetBackpressure(u){return 0>=WritableStreamDefaultControllerGetDesiredSize(u)}function WritableStreamDefaultControllerError(u,A){var T=u._controlledWritableStream;WritableStreamDefaultControllerClearAlgorithms(u),WritableStreamStartErroring(T,A)}function streamBrandCheckException$2(u){return TypeError("WritableStream.prototype."+u+" can only be used on a WritableStream")}function defaultControllerBrandCheckException$2(u){return TypeError("WritableStreamDefaultController.prototype."+u+" can only be used on a WritableStreamDefaultController")}function defaultWriterBrandCheckException(u){return TypeError("WritableStreamDefaultWriter.prototype."+u+" can only be used on a WritableStreamDefaultWriter")}function defaultWriterLockException(u){return TypeError("Cannot "+u+" a stream using a released writer")}function defaultWriterClosedPromiseInitialize(u){u._closedPromise=newPromise(function(A,T){u._closedPromise_resolve=A,u._closedPromise_reject=T,u._closedPromiseState="pending"})}function defaultWriterClosedPromiseInitializeAsRejected(u,A){defaultWriterClosedPromiseInitialize(u),defaultWriterClosedPromiseReject(u,A)}function defaultWriterClosedPromiseInitializeAsResolved(u){defaultWriterClosedPromiseInitialize(u),defaultWriterClosedPromiseResolve(u)}function defaultWriterClosedPromiseReject(u,A){void 0!==u._closedPromise_reject&&(setPromiseIsHandledToTrue(u._closedPromise),u._closedPromise_reject(A),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0,u._closedPromiseState="rejected")}function defaultWriterClosedPromiseResetToRejected(u,A){defaultWriterClosedPromiseInitializeAsRejected(u,A)}function defaultWriterClosedPromiseResolve(u){void 0!==u._closedPromise_resolve&&(u._closedPromise_resolve(void 0),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0,u._closedPromiseState="resolved")}function defaultWriterReadyPromiseInitialize(u){u._readyPromise=newPromise(function(A,T){u._readyPromise_resolve=A,u._readyPromise_reject=T}),u._readyPromiseState="pending"}function defaultWriterReadyPromiseInitializeAsRejected(u,A){defaultWriterReadyPromiseInitialize(u),defaultWriterReadyPromiseReject(u,A)}function defaultWriterReadyPromiseInitializeAsResolved(u){defaultWriterReadyPromiseInitialize(u),defaultWriterReadyPromiseResolve(u)}function defaultWriterReadyPromiseReject(u,A){void 0!==u._readyPromise_reject&&(setPromiseIsHandledToTrue(u._readyPromise),u._readyPromise_reject(A),u._readyPromise_resolve=void 0,u._readyPromise_reject=void 0,u._readyPromiseState="rejected")}function defaultWriterReadyPromiseReset(u){defaultWriterReadyPromiseInitialize(u)}function defaultWriterReadyPromiseResetToRejected(u,A){defaultWriterReadyPromiseInitializeAsRejected(u,A)}function defaultWriterReadyPromiseResolve(u){void 0!==u._readyPromise_resolve&&(u._readyPromise_resolve(void 0),u._readyPromise_resolve=void 0,u._readyPromise_reject=void 0,u._readyPromiseState="fulfilled")}Object.defineProperties(ey.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(ey.prototype,E.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var eb="undefined"!=typeof DOMException?DOMException:void 0;function createDOMExceptionPolyfill(){var ctor=function(u,A){this.message=u||"",this.name=A||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return ctor.prototype=Object.create(Error.prototype),Object.defineProperty(ctor.prototype,"constructor",{value:ctor,writable:!0,configurable:!0}),ctor}var eg=!function(u){if(!("function"==typeof u||"object"==typeof u))return!1;try{return new u,!0}catch(u){return!1}}(eb)?createDOMExceptionPolyfill():eb;function ReadableStreamPipeTo(u,A,T,E,I,D){var L=AcquireReadableStreamDefaultReader(u),W=AcquireWritableStreamDefaultWriter(A);u._disturbed=!0;var N=!1,U=promiseResolvedWith(void 0);return newPromise(function(H,Q){var K;if(void 0!==D){if(K=function(){var T=new eg("Aborted","AbortError"),D=[];E||D.push(function(){return"writable"===A._state?WritableStreamAbort(A,T):promiseResolvedWith(void 0)}),I||D.push(function(){return"readable"===u._state?ReadableStreamCancel(u,T):promiseResolvedWith(void 0)}),shutdownWithAction(function(){return Promise.all(D.map(function(u){return u()}))},!0,T)},D.aborted){K();return}D.addEventListener("abort",K)}function pipeLoop(){return newPromise(function(u,A){function next(T){T?u():PerformPromiseThen(pipeStep(),next,A)}next(!1)})}function pipeStep(){return N?promiseResolvedWith(!0):PerformPromiseThen(W._readyPromise,function(){return newPromise(function(u,A){ReadableStreamDefaultReaderRead(L,{_chunkSteps:function(A){U=PerformPromiseThen(WritableStreamDefaultWriterWrite(W,A),void 0,noop),u(!1)},_closeSteps:function(){return u(!0)},_errorSteps:A})})})}if(isOrBecomesErrored(u,L._closedPromise,function(u){E?shutdown(!0,u):shutdownWithAction(function(){return WritableStreamAbort(A,u)},!0,u)}),isOrBecomesErrored(A,W._closedPromise,function(A){I?shutdown(!0,A):shutdownWithAction(function(){return ReadableStreamCancel(u,A)},!0,A)}),isOrBecomesClosed(u,L._closedPromise,function(){T?shutdown():shutdownWithAction(function(){return WritableStreamDefaultWriterCloseWithErrorPropagation(W)})}),WritableStreamCloseQueuedOrInFlight(A)||"closed"===A._state){var J=TypeError("the destination writable stream closed before all data could be piped to it");I?shutdown(!0,J):shutdownWithAction(function(){return ReadableStreamCancel(u,J)},!0,J)}function waitForWritesToFinish(){var u=U;return PerformPromiseThen(U,function(){return u!==U?waitForWritesToFinish():void 0})}function isOrBecomesErrored(u,A,T){"errored"===u._state?T(u._storedError):uponRejection(A,T)}function isOrBecomesClosed(u,A,T){"closed"===u._state?T():uponFulfillment(A,T)}function shutdownWithAction(u,T,E){N||(N=!0,"writable"!==A._state||WritableStreamCloseQueuedOrInFlight(A)?doTheRest():uponFulfillment(waitForWritesToFinish(),doTheRest));function doTheRest(){uponPromise(u(),function(){return finalize(T,E)},function(u){return finalize(!0,u)})}}function shutdown(u,T){N||(N=!0,"writable"!==A._state||WritableStreamCloseQueuedOrInFlight(A)?finalize(u,T):uponFulfillment(waitForWritesToFinish(),function(){return finalize(u,T)}))}function finalize(u,A){WritableStreamDefaultWriterRelease(W),ReadableStreamReaderGenericRelease(L),void 0!==D&&D.removeEventListener("abort",K),u?Q(A):H(void 0)}setPromiseIsHandledToTrue(pipeLoop())})}var e_=function(){function ReadableStreamDefaultController(){throw TypeError("Illegal constructor")}return Object.defineProperty(ReadableStreamDefaultController.prototype,"desiredSize",{get:function(){if(!IsReadableStreamDefaultController(this))throw defaultControllerBrandCheckException$1("desiredSize");return ReadableStreamDefaultControllerGetDesiredSize(this)},enumerable:!1,configurable:!0}),ReadableStreamDefaultController.prototype.close=function(){if(!IsReadableStreamDefaultController(this))throw defaultControllerBrandCheckException$1("close");if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(this))throw TypeError("The stream is not in a state that permits close");ReadableStreamDefaultControllerClose(this)},ReadableStreamDefaultController.prototype.enqueue=function(u){if(void 0===u&&(u=void 0),!IsReadableStreamDefaultController(this))throw defaultControllerBrandCheckException$1("enqueue");if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(this))throw TypeError("The stream is not in a state that permits enqueue");return ReadableStreamDefaultControllerEnqueue(this,u)},ReadableStreamDefaultController.prototype.error=function(u){if(void 0===u&&(u=void 0),!IsReadableStreamDefaultController(this))throw defaultControllerBrandCheckException$1("error");ReadableStreamDefaultControllerError(this,u)},ReadableStreamDefaultController.prototype[et]=function(u){ResetQueue(this);var A=this._cancelAlgorithm(u);return ReadableStreamDefaultControllerClearAlgorithms(this),A},ReadableStreamDefaultController.prototype[er]=function(u){var A=this._controlledReadableStream;if(this._queue.length>0){var T=DequeueValue(this);this._closeRequested&&0===this._queue.length?(ReadableStreamDefaultControllerClearAlgorithms(this),ReadableStreamClose(A)):ReadableStreamDefaultControllerCallPullIfNeeded(this),u._chunkSteps(T)}else ReadableStreamAddReadRequest(A,u),ReadableStreamDefaultControllerCallPullIfNeeded(this)},ReadableStreamDefaultController}();function IsReadableStreamDefaultController(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_controlledReadableStream"))&&u instanceof e_}function ReadableStreamDefaultControllerCallPullIfNeeded(u){if(ReadableStreamDefaultControllerShouldCallPull(u)){if(u._pulling){u._pullAgain=!0;return}u._pulling=!0,uponPromise(u._pullAlgorithm(),function(){u._pulling=!1,u._pullAgain&&(u._pullAgain=!1,ReadableStreamDefaultControllerCallPullIfNeeded(u))},function(A){ReadableStreamDefaultControllerError(u,A)})}}function ReadableStreamDefaultControllerShouldCallPull(u){var A=u._controlledReadableStream;return!!ReadableStreamDefaultControllerCanCloseOrEnqueue(u)&&!!u._started&&!!(IsReadableStreamLocked(A)&&ReadableStreamGetNumReadRequests(A)>0||ReadableStreamDefaultControllerGetDesiredSize(u)>0)}function ReadableStreamDefaultControllerClearAlgorithms(u){u._pullAlgorithm=void 0,u._cancelAlgorithm=void 0,u._strategySizeAlgorithm=void 0}function ReadableStreamDefaultControllerClose(u){if(ReadableStreamDefaultControllerCanCloseOrEnqueue(u)){var A=u._controlledReadableStream;u._closeRequested=!0,0===u._queue.length&&(ReadableStreamDefaultControllerClearAlgorithms(u),ReadableStreamClose(A))}}function ReadableStreamDefaultControllerEnqueue(u,A){if(ReadableStreamDefaultControllerCanCloseOrEnqueue(u)){var T=u._controlledReadableStream;if(IsReadableStreamLocked(T)&&ReadableStreamGetNumReadRequests(T)>0)ReadableStreamFulfillReadRequest(T,A,!1);else{var E=void 0;try{E=u._strategySizeAlgorithm(A)}catch(A){throw ReadableStreamDefaultControllerError(u,A),A}try{EnqueueValueWithSize(u,A,E)}catch(A){throw ReadableStreamDefaultControllerError(u,A),A}}ReadableStreamDefaultControllerCallPullIfNeeded(u)}}function ReadableStreamDefaultControllerError(u,A){var T=u._controlledReadableStream;"readable"===T._state&&(ResetQueue(u),ReadableStreamDefaultControllerClearAlgorithms(u),ReadableStreamError(T,A))}function ReadableStreamDefaultControllerGetDesiredSize(u){var A=u._controlledReadableStream._state;return"errored"===A?null:"closed"===A?0:u._strategyHWM-u._queueTotalSize}function ReadableStreamDefaultControllerHasBackpressure(u){return!ReadableStreamDefaultControllerShouldCallPull(u)}function ReadableStreamDefaultControllerCanCloseOrEnqueue(u){var A=u._controlledReadableStream._state;return!u._closeRequested&&"readable"===A}function SetUpReadableStreamDefaultController(u,A,T,E,I,D,L){A._controlledReadableStream=u,A._queue=void 0,A._queueTotalSize=void 0,ResetQueue(A),A._started=!1,A._closeRequested=!1,A._pullAgain=!1,A._pulling=!1,A._strategySizeAlgorithm=L,A._strategyHWM=D,A._pullAlgorithm=E,A._cancelAlgorithm=I,u._readableStreamController=A,uponPromise(promiseResolvedWith(T()),function(){A._started=!0,ReadableStreamDefaultControllerCallPullIfNeeded(A)},function(u){ReadableStreamDefaultControllerError(A,u)})}function SetUpReadableStreamDefaultControllerFromUnderlyingSource(u,A,T,E){var I=Object.create(e_.prototype),startAlgorithm=function(){},pullAlgorithm=function(){return promiseResolvedWith(void 0)},cancelAlgorithm=function(){return promiseResolvedWith(void 0)};void 0!==A.start&&(startAlgorithm=function(){return A.start(I)}),void 0!==A.pull&&(pullAlgorithm=function(){return A.pull(I)}),void 0!==A.cancel&&(cancelAlgorithm=function(u){return A.cancel(u)}),SetUpReadableStreamDefaultController(u,I,startAlgorithm,pullAlgorithm,cancelAlgorithm,T,E)}function defaultControllerBrandCheckException$1(u){return TypeError("ReadableStreamDefaultController.prototype."+u+" can only be used on a ReadableStreamDefaultController")}function ReadableStreamTee(u,A){return IsReadableByteStreamController(u._readableStreamController)?ReadableByteStreamTee(u):ReadableStreamDefaultTee(u)}function ReadableStreamDefaultTee(u,A){var T,E,I,D,L,W=AcquireReadableStreamDefaultReader(u),N=!1,U=!1,Q=!1,K=!1,J=newPromise(function(u){L=u});function pullAlgorithm(){return N?U=!0:(N=!0,ReadableStreamDefaultReaderRead(W,{_chunkSteps:function(u){H(function(){U=!1;var A=u,T=u;Q||ReadableStreamDefaultControllerEnqueue(I._readableStreamController,A),K||ReadableStreamDefaultControllerEnqueue(D._readableStreamController,T),N=!1,U&&pullAlgorithm()})},_closeSteps:function(){N=!1,Q||ReadableStreamDefaultControllerClose(I._readableStreamController),K||ReadableStreamDefaultControllerClose(D._readableStreamController),Q&&K||L(void 0)},_errorSteps:function(){N=!1}})),promiseResolvedWith(void 0)}function cancel2Algorithm(A){if(K=!0,E=A,Q){var I=ReadableStreamCancel(u,CreateArrayFromList([T,E]));L(I)}return J}function startAlgorithm(){}return I=CreateReadableStream(startAlgorithm,pullAlgorithm,function(A){if(Q=!0,T=A,K){var I=ReadableStreamCancel(u,CreateArrayFromList([T,E]));L(I)}return J}),D=CreateReadableStream(startAlgorithm,pullAlgorithm,cancel2Algorithm),uponRejection(W._closedPromise,function(u){ReadableStreamDefaultControllerError(I._readableStreamController,u),ReadableStreamDefaultControllerError(D._readableStreamController,u),Q&&K||L(void 0)}),[I,D]}function ReadableByteStreamTee(u){var A,T,E,I,D,L=AcquireReadableStreamDefaultReader(u),W=!1,N=!1,U=!1,Q=!1,K=!1,J=newPromise(function(u){D=u});function forwardReaderError(u){uponRejection(u._closedPromise,function(A){u===L&&(ReadableByteStreamControllerError(E._readableStreamController,A),ReadableByteStreamControllerError(I._readableStreamController,A),Q&&K||D(void 0))})}function pullWithDefaultReader(){IsReadableStreamBYOBReader(L)&&(ReadableStreamReaderGenericRelease(L),forwardReaderError(L=AcquireReadableStreamDefaultReader(u))),ReadableStreamDefaultReaderRead(L,{_chunkSteps:function(A){H(function(){N=!1,U=!1;var T=A,L=A;if(!Q&&!K)try{L=CloneAsUint8Array(A)}catch(A){ReadableByteStreamControllerError(E._readableStreamController,A),ReadableByteStreamControllerError(I._readableStreamController,A),D(ReadableStreamCancel(u,A));return}Q||ReadableByteStreamControllerEnqueue(E._readableStreamController,T),K||ReadableByteStreamControllerEnqueue(I._readableStreamController,L),W=!1,N?pull1Algorithm():U&&pull2Algorithm()})},_closeSteps:function(){W=!1,Q||ReadableByteStreamControllerClose(E._readableStreamController),K||ReadableByteStreamControllerClose(I._readableStreamController),E._readableStreamController._pendingPullIntos.length>0&&ReadableByteStreamControllerRespond(E._readableStreamController,0),I._readableStreamController._pendingPullIntos.length>0&&ReadableByteStreamControllerRespond(I._readableStreamController,0),Q&&K||D(void 0)},_errorSteps:function(){W=!1}})}function pullWithBYOBReader(A,T){IsReadableStreamDefaultReader(L)&&(ReadableStreamReaderGenericRelease(L),forwardReaderError(L=AcquireReadableStreamBYOBReader(u)));var J=T?I:E,ee=T?E:I;ReadableStreamBYOBReaderRead(L,A,{_chunkSteps:function(A){H(function(){N=!1,U=!1;var E=T?K:Q;if(T?Q:K)E||ReadableByteStreamControllerRespondWithNewView(J._readableStreamController,A);else{var I=void 0;try{I=CloneAsUint8Array(A)}catch(A){ReadableByteStreamControllerError(J._readableStreamController,A),ReadableByteStreamControllerError(ee._readableStreamController,A),D(ReadableStreamCancel(u,A));return}E||ReadableByteStreamControllerRespondWithNewView(J._readableStreamController,A),ReadableByteStreamControllerEnqueue(ee._readableStreamController,I)}W=!1,N?pull1Algorithm():U&&pull2Algorithm()})},_closeSteps:function(u){W=!1;var A=T?K:Q,E=T?Q:K;A||ReadableByteStreamControllerClose(J._readableStreamController),E||ReadableByteStreamControllerClose(ee._readableStreamController),void 0!==u&&(A||ReadableByteStreamControllerRespondWithNewView(J._readableStreamController,u),!E&&ee._readableStreamController._pendingPullIntos.length>0&&ReadableByteStreamControllerRespond(ee._readableStreamController,0)),A&&E||D(void 0)},_errorSteps:function(){W=!1}})}function pull1Algorithm(){if(W)return N=!0,promiseResolvedWith(void 0);W=!0;var u=ReadableByteStreamControllerGetBYOBRequest(E._readableStreamController);return null===u?pullWithDefaultReader():pullWithBYOBReader(u._view,!1),promiseResolvedWith(void 0)}function pull2Algorithm(){if(W)return U=!0,promiseResolvedWith(void 0);W=!0;var u=ReadableByteStreamControllerGetBYOBRequest(I._readableStreamController);return null===u?pullWithDefaultReader():pullWithBYOBReader(u._view,!0),promiseResolvedWith(void 0)}function cancel2Algorithm(E){if(K=!0,T=E,Q){var I=ReadableStreamCancel(u,CreateArrayFromList([A,T]));D(I)}return J}function startAlgorithm(){}return E=CreateReadableByteStream(startAlgorithm,pull1Algorithm,function(E){if(Q=!0,A=E,K){var I=ReadableStreamCancel(u,CreateArrayFromList([A,T]));D(I)}return J}),I=CreateReadableByteStream(startAlgorithm,pull2Algorithm,cancel2Algorithm),forwardReaderError(L),[E,I]}function convertUnderlyingDefaultOrByteSource(u,A){assertDictionary(u,A);var T=u,E=null==T?void 0:T.autoAllocateChunkSize,I=null==T?void 0:T.cancel,D=null==T?void 0:T.pull,L=null==T?void 0:T.start,W=null==T?void 0:T.type;return{autoAllocateChunkSize:void 0===E?void 0:convertUnsignedLongLongWithEnforceRange(E,A+" has member 'autoAllocateChunkSize' that"),cancel:void 0===I?void 0:convertUnderlyingSourceCancelCallback(I,T,A+" has member 'cancel' that"),pull:void 0===D?void 0:convertUnderlyingSourcePullCallback(D,T,A+" has member 'pull' that"),start:void 0===L?void 0:convertUnderlyingSourceStartCallback(L,T,A+" has member 'start' that"),type:void 0===W?void 0:convertReadableStreamType(W,A+" has member 'type' that")}}function convertUnderlyingSourceCancelCallback(u,A,T){return assertFunction(u,T),function(T){return promiseCall(u,A,[T])}}function convertUnderlyingSourcePullCallback(u,A,T){return assertFunction(u,T),function(T){return promiseCall(u,A,[T])}}function convertUnderlyingSourceStartCallback(u,A,T){return assertFunction(u,T),function(T){return reflectCall(u,A,[T])}}function convertReadableStreamType(u,A){if("bytes"!=(u=""+u))throw TypeError(A+" '"+u+"' is not a valid enumeration value for ReadableStreamType");return u}function convertReaderOptions(u,A){assertDictionary(u,A);var T=null==u?void 0:u.mode;return{mode:void 0===T?void 0:convertReadableStreamReaderMode(T,A+" has member 'mode' that")}}function convertReadableStreamReaderMode(u,A){if("byob"!=(u=""+u))throw TypeError(A+" '"+u+"' is not a valid enumeration value for ReadableStreamReaderMode");return u}function convertIteratorOptions(u,A){return assertDictionary(u,A),{preventCancel:!!(null==u?void 0:u.preventCancel)}}function convertPipeOptions(u,A){assertDictionary(u,A);var T=null==u?void 0:u.preventAbort,E=null==u?void 0:u.preventCancel,I=null==u?void 0:u.preventClose,D=null==u?void 0:u.signal;return void 0!==D&&assertAbortSignal(D,A+" has member 'signal' that"),{preventAbort:!!T,preventCancel:!!E,preventClose:!!I,signal:D}}function assertAbortSignal(u,A){if(!isAbortSignal(u))throw TypeError(A+" is not an AbortSignal.")}function convertReadableWritablePair(u,A){assertDictionary(u,A);var T=null==u?void 0:u.readable;assertRequiredField(T,"readable","ReadableWritablePair"),assertReadableStream(T,A+" has member 'readable' that");var E=null==u?void 0:u.writable;return assertRequiredField(E,"writable","ReadableWritablePair"),assertWritableStream(E,A+" has member 'writable' that"),{readable:T,writable:E}}Object.defineProperties(e_.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(e_.prototype,E.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var eS=function(){function ReadableStream(u,A){void 0===u&&(u={}),void 0===A&&(A={}),void 0===u?u=null:assertObject(u,"First parameter");var T=convertQueuingStrategy(A,"Second parameter"),E=convertUnderlyingDefaultOrByteSource(u,"First parameter");if(InitializeReadableStream(this),"bytes"===E.type){if(void 0!==T.size)throw RangeError("The strategy for a byte stream cannot have a size function");var I=ExtractHighWaterMark(T,0);SetUpReadableByteStreamControllerFromUnderlyingSource(this,E,I)}else{var D=ExtractSizeAlgorithm(T),I=ExtractHighWaterMark(T,1);SetUpReadableStreamDefaultControllerFromUnderlyingSource(this,E,I,D)}}return Object.defineProperty(ReadableStream.prototype,"locked",{get:function(){if(!IsReadableStream(this))throw streamBrandCheckException$1("locked");return IsReadableStreamLocked(this)},enumerable:!1,configurable:!0}),ReadableStream.prototype.cancel=function(u){return(void 0===u&&(u=void 0),IsReadableStream(this))?IsReadableStreamLocked(this)?promiseRejectedWith(TypeError("Cannot cancel a stream that already has a reader")):ReadableStreamCancel(this,u):promiseRejectedWith(streamBrandCheckException$1("cancel"))},ReadableStream.prototype.getReader=function(u){if(void 0===u&&(u=void 0),!IsReadableStream(this))throw streamBrandCheckException$1("getReader");return void 0===convertReaderOptions(u,"First parameter").mode?AcquireReadableStreamDefaultReader(this):AcquireReadableStreamBYOBReader(this)},ReadableStream.prototype.pipeThrough=function(u,A){if(void 0===A&&(A={}),!IsReadableStream(this))throw streamBrandCheckException$1("pipeThrough");assertRequiredArgument(u,1,"pipeThrough");var T=convertReadableWritablePair(u,"First parameter"),E=convertPipeOptions(A,"Second parameter");if(IsReadableStreamLocked(this))throw TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(IsWritableStreamLocked(T.writable))throw TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return setPromiseIsHandledToTrue(ReadableStreamPipeTo(this,T.writable,E.preventClose,E.preventAbort,E.preventCancel,E.signal)),T.readable},ReadableStream.prototype.pipeTo=function(u,A){var T;if(void 0===A&&(A={}),!IsReadableStream(this))return promiseRejectedWith(streamBrandCheckException$1("pipeTo"));if(void 0===u)return promiseRejectedWith("Parameter 1 is required in 'pipeTo'.");if(!IsWritableStream(u))return promiseRejectedWith(TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));try{T=convertPipeOptions(A,"Second parameter")}catch(u){return promiseRejectedWith(u)}return IsReadableStreamLocked(this)?promiseRejectedWith(TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):IsWritableStreamLocked(u)?promiseRejectedWith(TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):ReadableStreamPipeTo(this,u,T.preventClose,T.preventAbort,T.preventCancel,T.signal)},ReadableStream.prototype.tee=function(){if(!IsReadableStream(this))throw streamBrandCheckException$1("tee");return CreateArrayFromList(ReadableStreamTee(this))},ReadableStream.prototype.values=function(u){if(void 0===u&&(u=void 0),!IsReadableStream(this))throw streamBrandCheckException$1("values");return AcquireReadableStreamAsyncIterator(this,convertIteratorOptions(u,"First parameter").preventCancel)},ReadableStream}();function CreateReadableStream(u,A,T,E,I){void 0===E&&(E=1),void 0===I&&(I=function(){return 1});var D=Object.create(eS.prototype);return InitializeReadableStream(D),SetUpReadableStreamDefaultController(D,Object.create(e_.prototype),u,A,T,E,I),D}function CreateReadableByteStream(u,A,T){var E=Object.create(eS.prototype);return InitializeReadableStream(E),SetUpReadableByteStreamController(E,Object.create(ed.prototype),u,A,T,0,void 0),E}function InitializeReadableStream(u){u._state="readable",u._reader=void 0,u._storedError=void 0,u._disturbed=!1}function IsReadableStream(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_readableStreamController"))&&u instanceof eS}function IsReadableStreamLocked(u){return void 0!==u._reader}function ReadableStreamCancel(u,A){if(u._disturbed=!0,"closed"===u._state)return promiseResolvedWith(void 0);if("errored"===u._state)return promiseRejectedWith(u._storedError);ReadableStreamClose(u);var T=u._reader;return void 0!==T&&IsReadableStreamBYOBReader(T)&&(T._readIntoRequests.forEach(function(u){u._closeSteps(void 0)}),T._readIntoRequests=new K),transformPromiseWith(u._readableStreamController[et](A),noop)}function ReadableStreamClose(u){u._state="closed";var A=u._reader;void 0!==A&&(defaultReaderClosedPromiseResolve(A),IsReadableStreamDefaultReader(A)&&(A._readRequests.forEach(function(u){u._closeSteps()}),A._readRequests=new K))}function ReadableStreamError(u,A){u._state="errored",u._storedError=A;var T=u._reader;void 0!==T&&(defaultReaderClosedPromiseReject(T,A),IsReadableStreamDefaultReader(T)?(T._readRequests.forEach(function(u){u._errorSteps(A)}),T._readRequests=new K):(T._readIntoRequests.forEach(function(u){u._errorSteps(A)}),T._readIntoRequests=new K))}function streamBrandCheckException$1(u){return TypeError("ReadableStream.prototype."+u+" can only be used on a ReadableStream")}function convertQueuingStrategyInit(u,A){assertDictionary(u,A);var T=null==u?void 0:u.highWaterMark;return assertRequiredField(T,"highWaterMark","QueuingStrategyInit"),{highWaterMark:convertUnrestrictedDouble(T)}}Object.defineProperties(eS.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(eS.prototype,E.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof E.asyncIterator&&Object.defineProperty(eS.prototype,E.asyncIterator,{value:eS.prototype.values,writable:!0,configurable:!0});var byteLengthSizeFunction=function(u){return u.byteLength};Object.defineProperty(byteLengthSizeFunction,"name",{value:"size",configurable:!0});var eA=function(){function ByteLengthQueuingStrategy(u){assertRequiredArgument(u,1,"ByteLengthQueuingStrategy"),u=convertQueuingStrategyInit(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}return Object.defineProperty(ByteLengthQueuingStrategy.prototype,"highWaterMark",{get:function(){if(!IsByteLengthQueuingStrategy(this))throw byteLengthBrandCheckException("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(ByteLengthQueuingStrategy.prototype,"size",{get:function(){if(!IsByteLengthQueuingStrategy(this))throw byteLengthBrandCheckException("size");return byteLengthSizeFunction},enumerable:!1,configurable:!0}),ByteLengthQueuingStrategy}();function byteLengthBrandCheckException(u){return TypeError("ByteLengthQueuingStrategy.prototype."+u+" can only be used on a ByteLengthQueuingStrategy")}function IsByteLengthQueuingStrategy(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_byteLengthQueuingStrategyHighWaterMark"))&&u instanceof eA}Object.defineProperties(eA.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(eA.prototype,E.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var countSizeFunction=function(){return 1};Object.defineProperty(countSizeFunction,"name",{value:"size",configurable:!0});var eC=function(){function CountQueuingStrategy(u){assertRequiredArgument(u,1,"CountQueuingStrategy"),u=convertQueuingStrategyInit(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}return Object.defineProperty(CountQueuingStrategy.prototype,"highWaterMark",{get:function(){if(!IsCountQueuingStrategy(this))throw countBrandCheckException("highWaterMark");return this._countQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(CountQueuingStrategy.prototype,"size",{get:function(){if(!IsCountQueuingStrategy(this))throw countBrandCheckException("size");return countSizeFunction},enumerable:!1,configurable:!0}),CountQueuingStrategy}();function countBrandCheckException(u){return TypeError("CountQueuingStrategy.prototype."+u+" can only be used on a CountQueuingStrategy")}function IsCountQueuingStrategy(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_countQueuingStrategyHighWaterMark"))&&u instanceof eC}function convertTransformer(u,A){assertDictionary(u,A);var T=null==u?void 0:u.flush,E=null==u?void 0:u.readableType,I=null==u?void 0:u.start,D=null==u?void 0:u.transform,L=null==u?void 0:u.writableType;return{flush:void 0===T?void 0:convertTransformerFlushCallback(T,u,A+" has member 'flush' that"),readableType:E,start:void 0===I?void 0:convertTransformerStartCallback(I,u,A+" has member 'start' that"),transform:void 0===D?void 0:convertTransformerTransformCallback(D,u,A+" has member 'transform' that"),writableType:L}}function convertTransformerFlushCallback(u,A,T){return assertFunction(u,T),function(T){return promiseCall(u,A,[T])}}function convertTransformerStartCallback(u,A,T){return assertFunction(u,T),function(T){return reflectCall(u,A,[T])}}function convertTransformerTransformCallback(u,A,T){return assertFunction(u,T),function(T,E){return promiseCall(u,A,[T,E])}}Object.defineProperties(eC.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(eC.prototype,E.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var eR=function(){function TransformStream(u,A,T){void 0===u&&(u={}),void 0===A&&(A={}),void 0===T&&(T={}),void 0===u&&(u=null);var E,I=convertQueuingStrategy(A,"Second parameter"),D=convertQueuingStrategy(T,"Third parameter"),L=convertTransformer(u,"First parameter");if(void 0!==L.readableType)throw RangeError("Invalid readableType specified");if(void 0!==L.writableType)throw RangeError("Invalid writableType specified");var W=ExtractHighWaterMark(D,0),N=ExtractSizeAlgorithm(D),U=ExtractHighWaterMark(I,1),H=ExtractSizeAlgorithm(I);InitializeTransformStream(this,newPromise(function(u){E=u}),U,H,W,N),SetUpTransformStreamDefaultControllerFromTransformer(this,L),void 0!==L.start?E(L.start(this._transformStreamController)):E(void 0)}return Object.defineProperty(TransformStream.prototype,"readable",{get:function(){if(!IsTransformStream(this))throw streamBrandCheckException("readable");return this._readable},enumerable:!1,configurable:!0}),Object.defineProperty(TransformStream.prototype,"writable",{get:function(){if(!IsTransformStream(this))throw streamBrandCheckException("writable");return this._writable},enumerable:!1,configurable:!0}),TransformStream}();function InitializeTransformStream(u,A,T,E,I,D){function startAlgorithm(){return A}function writeAlgorithm(A){return TransformStreamDefaultSinkWriteAlgorithm(u,A)}function abortAlgorithm(A){return TransformStreamDefaultSinkAbortAlgorithm(u,A)}function closeAlgorithm(){return TransformStreamDefaultSinkCloseAlgorithm(u)}function pullAlgorithm(){return TransformStreamDefaultSourcePullAlgorithm(u)}function cancelAlgorithm(A){return TransformStreamErrorWritableAndUnblockWrite(u,A),promiseResolvedWith(void 0)}u._writable=CreateWritableStream(startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,T,E),u._readable=CreateReadableStream(startAlgorithm,pullAlgorithm,cancelAlgorithm,I,D),u._backpressure=void 0,u._backpressureChangePromise=void 0,u._backpressureChangePromise_resolve=void 0,TransformStreamSetBackpressure(u,!0),u._transformStreamController=void 0}function IsTransformStream(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_transformStreamController"))&&u instanceof eR}function TransformStreamError(u,A){ReadableStreamDefaultControllerError(u._readable._readableStreamController,A),TransformStreamErrorWritableAndUnblockWrite(u,A)}function TransformStreamErrorWritableAndUnblockWrite(u,A){TransformStreamDefaultControllerClearAlgorithms(u._transformStreamController),WritableStreamDefaultControllerErrorIfNeeded(u._writable._writableStreamController,A),u._backpressure&&TransformStreamSetBackpressure(u,!1)}function TransformStreamSetBackpressure(u,A){void 0!==u._backpressureChangePromise&&u._backpressureChangePromise_resolve(),u._backpressureChangePromise=newPromise(function(A){u._backpressureChangePromise_resolve=A}),u._backpressure=A}Object.defineProperties(eR.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(eR.prototype,E.toStringTag,{value:"TransformStream",configurable:!0});var ek=function(){function TransformStreamDefaultController(){throw TypeError("Illegal constructor")}return Object.defineProperty(TransformStreamDefaultController.prototype,"desiredSize",{get:function(){if(!IsTransformStreamDefaultController(this))throw defaultControllerBrandCheckException("desiredSize");return ReadableStreamDefaultControllerGetDesiredSize(this._controlledTransformStream._readable._readableStreamController)},enumerable:!1,configurable:!0}),TransformStreamDefaultController.prototype.enqueue=function(u){if(void 0===u&&(u=void 0),!IsTransformStreamDefaultController(this))throw defaultControllerBrandCheckException("enqueue");TransformStreamDefaultControllerEnqueue(this,u)},TransformStreamDefaultController.prototype.error=function(u){if(void 0===u&&(u=void 0),!IsTransformStreamDefaultController(this))throw defaultControllerBrandCheckException("error");TransformStreamDefaultControllerError(this,u)},TransformStreamDefaultController.prototype.terminate=function(){if(!IsTransformStreamDefaultController(this))throw defaultControllerBrandCheckException("terminate");TransformStreamDefaultControllerTerminate(this)},TransformStreamDefaultController}();function IsTransformStreamDefaultController(u){return!!(typeIsObject(u)&&Object.prototype.hasOwnProperty.call(u,"_controlledTransformStream"))&&u instanceof ek}function SetUpTransformStreamDefaultController(u,A,T,E){A._controlledTransformStream=u,u._transformStreamController=A,A._transformAlgorithm=T,A._flushAlgorithm=E}function SetUpTransformStreamDefaultControllerFromTransformer(u,A){var T=Object.create(ek.prototype),transformAlgorithm=function(u){try{return TransformStreamDefaultControllerEnqueue(T,u),promiseResolvedWith(void 0)}catch(u){return promiseRejectedWith(u)}},flushAlgorithm=function(){return promiseResolvedWith(void 0)};void 0!==A.transform&&(transformAlgorithm=function(u){return A.transform(u,T)}),void 0!==A.flush&&(flushAlgorithm=function(){return A.flush(T)}),SetUpTransformStreamDefaultController(u,T,transformAlgorithm,flushAlgorithm)}function TransformStreamDefaultControllerClearAlgorithms(u){u._transformAlgorithm=void 0,u._flushAlgorithm=void 0}function TransformStreamDefaultControllerEnqueue(u,A){var T=u._controlledTransformStream,E=T._readable._readableStreamController;if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(E))throw TypeError("Readable side is not in a state that permits enqueue");try{ReadableStreamDefaultControllerEnqueue(E,A)}catch(u){throw TransformStreamErrorWritableAndUnblockWrite(T,u),T._readable._storedError}ReadableStreamDefaultControllerHasBackpressure(E)!==T._backpressure&&TransformStreamSetBackpressure(T,!0)}function TransformStreamDefaultControllerError(u,A){TransformStreamError(u._controlledTransformStream,A)}function TransformStreamDefaultControllerPerformTransform(u,A){return transformPromiseWith(u._transformAlgorithm(A),void 0,function(A){throw TransformStreamError(u._controlledTransformStream,A),A})}function TransformStreamDefaultControllerTerminate(u){var A=u._controlledTransformStream;ReadableStreamDefaultControllerClose(A._readable._readableStreamController),TransformStreamErrorWritableAndUnblockWrite(A,TypeError("TransformStream terminated"))}function TransformStreamDefaultSinkWriteAlgorithm(u,A){var T=u._transformStreamController;return u._backpressure?transformPromiseWith(u._backpressureChangePromise,function(){var E=u._writable;if("erroring"===E._state)throw E._storedError;return TransformStreamDefaultControllerPerformTransform(T,A)}):TransformStreamDefaultControllerPerformTransform(T,A)}function TransformStreamDefaultSinkAbortAlgorithm(u,A){return TransformStreamError(u,A),promiseResolvedWith(void 0)}function TransformStreamDefaultSinkCloseAlgorithm(u){var A=u._readable,T=u._transformStreamController,E=T._flushAlgorithm();return TransformStreamDefaultControllerClearAlgorithms(T),transformPromiseWith(E,function(){if("errored"===A._state)throw A._storedError;ReadableStreamDefaultControllerClose(A._readableStreamController)},function(T){throw TransformStreamError(u,T),A._storedError})}function TransformStreamDefaultSourcePullAlgorithm(u){return TransformStreamSetBackpressure(u,!1),u._backpressureChangePromise}function defaultControllerBrandCheckException(u){return TypeError("TransformStreamDefaultController.prototype."+u+" can only be used on a TransformStreamDefaultController")}function streamBrandCheckException(u){return TypeError("TransformStream.prototype."+u+" can only be used on a TransformStream")}Object.defineProperties(ek.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof E.toStringTag&&Object.defineProperty(ek.prototype,E.toStringTag,{value:"TransformStreamDefaultController",configurable:!0}),u.ByteLengthQueuingStrategy=eA,u.CountQueuingStrategy=eC,u.ReadableByteStreamController=ed,u.ReadableStream=eS,u.ReadableStreamBYOBReader=ef,u.ReadableStreamBYOBRequest=ec,u.ReadableStreamDefaultController=e_,u.ReadableStreamDefaultReader=eo,u.TransformStream=eR,u.TransformStreamDefaultController=ek,u.WritableStream=ep,u.WritableStreamDefaultController=ey,u.WritableStreamDefaultWriter=em,Object.defineProperty(u,"__esModule",{value:!0})})},(u,A,T)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.BaseStandardFontDataFactory=A.BaseSVGFactory=A.BaseCanvasFactory=A.BaseCMapReaderFactory=void 0;var E=_interopRequireDefault(T(2)),I=T(4);function _interopRequireDefault(u){return u&&u.__esModule?u:{default:u}}function asyncGeneratorStep(u,A,T,E,I,D,L){try{var W=u[D](L),N=W.value}catch(u){T(u);return}W.done?A(N):Promise.resolve(N).then(E,I)}function _asyncToGenerator(u){return function(){var A=this,T=arguments;return new Promise(function(E,I){var D=u.apply(A,T);function _next(u){asyncGeneratorStep(D,E,I,_next,_throw,"next",u)}function _throw(u){asyncGeneratorStep(D,E,I,_next,_throw,"throw",u)}_next(void 0)})}}function _classCallCheck(u,A){if(!(u instanceof A))throw TypeError("Cannot call a class as a function")}function _defineProperties(u,A){for(var T=0;T{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.version=void 0;var _regenerator=_interopRequireDefault(__w_pdfjs_require__(2)),_util=__w_pdfjs_require__(4),_display_utils=__w_pdfjs_require__(1),_font_loader=__w_pdfjs_require__(137),_node_utils=__w_pdfjs_require__(138),_annotation_storage=__w_pdfjs_require__(139),_canvas=__w_pdfjs_require__(140),_worker_options=__w_pdfjs_require__(142),_is_node=__w_pdfjs_require__(6),_message_handler=__w_pdfjs_require__(143),_metadata=__w_pdfjs_require__(144),_optional_content_config=__w_pdfjs_require__(145),_transport_stream=__w_pdfjs_require__(146),_xfa_text=__w_pdfjs_require__(147);function _interopRequireDefault(u){return u&&u.__esModule?u:{default:u}}function _classPrivateFieldInitSpec(u,A,T){_checkPrivateRedeclaration(u,A),A.set(u,T)}function _checkPrivateRedeclaration(u,A){if(A.has(u))throw TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(u,A,T){var E=_classExtractFieldDescriptor(u,A,"set");return _classApplyDescriptorSet(u,E,T),T}function _classApplyDescriptorSet(u,A,T){if(A.set)A.set.call(u,T);else{if(!A.writable)throw TypeError("attempted to set read only private field");A.value=T}}function _classPrivateFieldGet(u,A){var T=_classExtractFieldDescriptor(u,A,"get");return _classApplyDescriptorGet(u,T)}function _classExtractFieldDescriptor(u,A,T){if(!A.has(u))throw TypeError("attempted to "+T+" private field on non-instance");return A.get(u)}function _classApplyDescriptorGet(u,A){return A.get?A.get.call(u):A.value}function _toConsumableArray(u){return _arrayWithoutHoles(u)||_iterableToArray(u)||_unsupportedIterableToArray(u)||_nonIterableSpread()}function _nonIterableSpread(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(u){if("undefined"!=typeof Symbol&&null!=u[Symbol.iterator]||null!=u["@@iterator"])return Array.from(u)}function _arrayWithoutHoles(u){if(Array.isArray(u))return _arrayLikeToArray(u)}function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _classCallCheck(u,A){if(!(u instanceof A))throw TypeError("Cannot call a class as a function")}function _defineProperties(u,A){for(var T=0;Tu.length)&&(A=u.length);for(var T=0,E=Array(A);T2&&void 0!==arguments[2]&&arguments[2],E=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;_classCallCheck(this,PDFDataRangeTransport),this.length=u,this.initialData=A,this.progressiveDone=T,this.contentDispositionFilename=E,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}return _createClass(PDFDataRangeTransport,[{key:"addRangeListener",value:function(u){this._rangeListeners.push(u)}},{key:"addProgressListener",value:function(u){this._progressListeners.push(u)}},{key:"addProgressiveReadListener",value:function(u){this._progressiveReadListeners.push(u)}},{key:"addProgressiveDoneListener",value:function(u){this._progressiveDoneListeners.push(u)}},{key:"onDataRange",value:function(u,A){var T,E=_createForOfIteratorHelper(this._rangeListeners);try{for(E.s();!(T=E.n()).done;)(0,T.value)(u,A)}catch(u){E.e(u)}finally{E.f()}}},{key:"onDataProgress",value:function(u,A){var T=this;this._readyCapability.promise.then(function(){var E,I=_createForOfIteratorHelper(T._progressListeners);try{for(I.s();!(E=I.n()).done;)(0,E.value)(u,A)}catch(u){I.e(u)}finally{I.f()}})}},{key:"onDataProgressiveRead",value:function(u){var A=this;this._readyCapability.promise.then(function(){var T,E=_createForOfIteratorHelper(A._progressiveReadListeners);try{for(E.s();!(T=E.n()).done;)(0,T.value)(u)}catch(u){E.e(u)}finally{E.f()}})}},{key:"onDataProgressiveDone",value:function(){var u=this;this._readyCapability.promise.then(function(){var A,T=_createForOfIteratorHelper(u._progressiveDoneListeners);try{for(T.s();!(A=T.n()).done;)(0,A.value)()}catch(u){T.e(u)}finally{T.f()}})}},{key:"transportReady",value:function(){this._readyCapability.resolve()}},{key:"requestDataRange",value:function(u,A){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}},{key:"abort",value:function(){}}]),PDFDataRangeTransport}();exports.PDFDataRangeTransport=PDFDataRangeTransport;var PDFDocumentProxy=function(){function PDFDocumentProxy(u,A){var T=this;_classCallCheck(this,PDFDocumentProxy),this._pdfInfo=u,this._transport=A,Object.defineProperty(this,"fingerprint",{get:function(){return(0,_display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, please use `PDFDocumentProxy.fingerprints` instead."),this.fingerprints[0]}}),Object.defineProperty(this,"getStats",{value:function(){var u=_asyncToGenerator(_regenerator.default.mark(function _callee2(){return _regenerator.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return(0,_display_utils.deprecated)("`PDFDocumentProxy.getStats`, please use the `PDFDocumentProxy.stats`-getter instead."),u.abrupt("return",T.stats||{streamTypes:{},fontTypes:{}});case 2:case"end":return u.stop()}},_callee2)}));return function(){return u.apply(this,arguments)}}()})}return _createClass(PDFDocumentProxy,[{key:"annotationStorage",get:function(){return this._transport.annotationStorage}},{key:"numPages",get:function(){return this._pdfInfo.numPages}},{key:"fingerprints",get:function(){return this._pdfInfo.fingerprints}},{key:"stats",get:function(){return this._transport.stats}},{key:"isPureXfa",get:function(){return!!this._transport._htmlForXfa}},{key:"allXfaHtml",get:function(){return this._transport._htmlForXfa}},{key:"getPage",value:function(u){return this._transport.getPage(u)}},{key:"getPageIndex",value:function(u){return this._transport.getPageIndex(u)}},{key:"getDestinations",value:function(){return this._transport.getDestinations()}},{key:"getDestination",value:function(u){return this._transport.getDestination(u)}},{key:"getPageLabels",value:function(){return this._transport.getPageLabels()}},{key:"getPageLayout",value:function(){return this._transport.getPageLayout()}},{key:"getPageMode",value:function(){return this._transport.getPageMode()}},{key:"getViewerPreferences",value:function(){return this._transport.getViewerPreferences()}},{key:"getOpenAction",value:function(){return this._transport.getOpenAction()}},{key:"getAttachments",value:function(){return this._transport.getAttachments()}},{key:"getJavaScript",value:function(){return this._transport.getJavaScript()}},{key:"getJSActions",value:function(){return this._transport.getDocJSActions()}},{key:"getOutline",value:function(){return this._transport.getOutline()}},{key:"getOptionalContentConfig",value:function(){return this._transport.getOptionalContentConfig()}},{key:"getPermissions",value:function(){return this._transport.getPermissions()}},{key:"getMetadata",value:function(){return this._transport.getMetadata()}},{key:"getMarkInfo",value:function(){return this._transport.getMarkInfo()}},{key:"getData",value:function(){return this._transport.getData()}},{key:"getDownloadInfo",value:function(){return this._transport.downloadInfoCapability.promise}},{key:"cleanup",value:function(){var u=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(u||this.isPureXfa)}},{key:"destroy",value:function(){return this.loadingTask.destroy()}},{key:"loadingParams",get:function(){return this._transport.loadingParams}},{key:"loadingTask",get:function(){return this._transport.loadingTask}},{key:"saveDocument",value:function(){return this._transport.annotationStorage.size<=0&&(0,_display_utils.deprecated)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this._transport.saveDocument()}},{key:"getFieldObjects",value:function(){return this._transport.getFieldObjects()}},{key:"hasJSActions",value:function(){return this._transport.hasJSActions()}},{key:"getCalculationOrderIds",value:function(){return this._transport.getCalculationOrderIds()}}]),PDFDocumentProxy}();exports.PDFDocumentProxy=PDFDocumentProxy;var PDFPageProxy=function(){function PDFPageProxy(u,A,T,E){var I=arguments.length>4&&void 0!==arguments[4]&&arguments[4];_classCallCheck(this,PDFPageProxy),this._pageIndex=u,this._pageInfo=A,this._ownerDocument=E,this._transport=T,this._stats=I?new _display_utils.StatTimer:null,this._pdfBug=I,this.commonObjs=T.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this._annotationPromises=new Map,this.destroyed=!1}return _createClass(PDFPageProxy,[{key:"pageNumber",get:function(){return this._pageIndex+1}},{key:"rotate",get:function(){return this._pageInfo.rotate}},{key:"ref",get:function(){return this._pageInfo.ref}},{key:"userUnit",get:function(){return this._pageInfo.userUnit}},{key:"view",get:function(){return this._pageInfo.view}},{key:"getViewport",value:function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},A=u.scale,T=u.rotation,E=void 0===T?this.rotate:T,I=u.offsetX,D=void 0===I?0:I,L=u.offsetY,W=void 0===L?0:L,N=u.dontFlip,U=void 0!==N&&N;return new _display_utils.PageViewport({viewBox:this.view,scale:A,rotation:E,offsetX:D,offsetY:W,dontFlip:U})}},{key:"getAnnotations",value:function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},A=u.intent,T=void 0===A?"display":A,E=this._transport.getRenderingIntent(T),I=this._annotationPromises.get(E.cacheKey);return I||(I=this._transport.getAnnotations(this._pageIndex,E.renderingIntent),this._annotationPromises.set(E.cacheKey,I),I=I.then(function(u){var A,T=_createForOfIteratorHelper(u);try{var _loop=function(){var u=A.value;void 0!==u.titleObj&&Object.defineProperty(u,"title",{get:function(){return(0,_display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead."),u.titleObj.str}}),void 0!==u.contentsObj&&Object.defineProperty(u,"contents",{get:function(){return(0,_display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead."),u.contentsObj.str}})};for(T.s();!(A=T.n()).done;)_loop()}catch(u){T.e(u)}finally{T.f()}return u})),I}},{key:"getJSActions",value:function(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))}},{key:"getXfa",value:function(){var u=_asyncToGenerator(_regenerator.default.mark(function _callee3(){var u;return _regenerator.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",(null===(u=this._transport._htmlForXfa)||void 0===u?void 0:u.children[this._pageIndex])||null);case 1:case"end":return A.stop()}},_callee3,this)}));return function(){return u.apply(this,arguments)}}()},{key:"render",value:function(u){var A,T,E,I=this,D=u.canvasContext,L=u.viewport,W=u.intent,N=void 0===W?"display":W,U=u.annotationMode,H=void 0===U?_util.AnnotationMode.ENABLE:U,Q=u.transform,K=void 0===Q?null:Q,J=u.imageLayer,ee=void 0===J?null:J,et=u.canvasFactory,er=void 0===et?null:et,en=u.background,ea=void 0===en?null:en,eo=u.optionalContentConfigPromise,ei=void 0===eo?null:eo,es=u.annotationCanvasMap,eu=void 0===es?null:es;(null===(A=arguments[0])||void 0===A?void 0:A.renderInteractiveForms)!==void 0&&((0,_display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, please use the `annotationMode`-option instead."),!0===arguments[0].renderInteractiveForms&&H===_util.AnnotationMode.ENABLE&&(H=_util.AnnotationMode.ENABLE_FORMS)),(null===(T=arguments[0])||void 0===T?void 0:T.includeAnnotationStorage)!==void 0&&((0,_display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, please use the `annotationMode`-option instead."),!0===arguments[0].includeAnnotationStorage&&H===_util.AnnotationMode.ENABLE&&(H=_util.AnnotationMode.ENABLE_STORAGE)),this._stats&&this._stats.time("Overall");var ec=this._transport.getRenderingIntent(N,H);this.pendingCleanup=!1,ei||(ei=this._transport.getOptionalContentConfig());var ed=this._intentStates.get(ec.cacheKey);ed||(ed=Object.create(null),this._intentStates.set(ec.cacheKey,ed)),ed.streamReaderCancelTimeout&&(clearTimeout(ed.streamReaderCancelTimeout),ed.streamReaderCancelTimeout=null);var ef=er||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),eh=!!(ec.renderingIntent&_util.RenderingIntentFlag.PRINT);ed.displayReadyCapability||(ed.displayReadyCapability=(0,_util.createPromiseCapability)(),ed.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(ec));var complete=function(u){ed.renderTasks.delete(ep),(I.cleanupAfterRender||eh)&&(I.pendingCleanup=!0),I._tryCleanup(),u?(ep.capability.reject(u),I._abortOperatorList({intentState:ed,reason:u instanceof Error?u:Error(u)})):ep.capability.resolve(),I._stats&&(I._stats.timeEnd("Rendering"),I._stats.timeEnd("Overall"))},ep=new InternalRenderTask({callback:complete,params:{canvasContext:D,viewport:L,transform:K,imageLayer:ee,background:ea},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:eu,operatorList:ed.operatorList,pageIndex:this._pageIndex,canvasFactory:ef,useRequestAnimationFrame:!eh,pdfBug:this._pdfBug});((E=ed).renderTasks||(E.renderTasks=new Set)).add(ep);var em=ep.task;return Promise.all([ed.displayReadyCapability.promise,ei]).then(function(u){var A=_slicedToArray(u,2),T=A[0],E=A[1];if(I.pendingCleanup){complete();return}I._stats&&I._stats.time("Rendering"),ep.initializeGraphics({transparency:T,optionalContentConfig:E}),ep.operatorListChanged()}).catch(complete),em}},{key:"getOperatorList",value:function(){var u,A,T=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},E=T.intent,I=void 0===E?"display":E,D=T.annotationMode,L=void 0===D?_util.AnnotationMode.ENABLE:D;function operatorListChanged(){N.operatorList.lastChunk&&(N.opListReadCapability.resolve(N.operatorList),N.renderTasks.delete(u))}var W=this._transport.getRenderingIntent(I,L,!0),N=this._intentStates.get(W.cacheKey);return N||(N=Object.create(null),this._intentStates.set(W.cacheKey,N)),N.opListReadCapability||((u=Object.create(null)).operatorListChanged=operatorListChanged,N.opListReadCapability=(0,_util.createPromiseCapability)(),((A=N).renderTasks||(A.renderTasks=new Set)).add(u),N.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(W)),N.opListReadCapability.promise}},{key:"streamTextContent",value:function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},A=u.normalizeWhitespace,T=void 0!==A&&A,E=u.disableCombineTextItems,I=void 0!==E&&E,D=u.includeMarkedContent,L=void 0!==D&&D,W=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:!0===T,combineTextItems:!0!==I,includeMarkedContent:!0===L},{highWaterMark:W,size:function(u){return u.items.length}})}},{key:"getTextContent",value:function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(function(u){return _xfa_text.XfaText.textContent(u)});var A=this.streamTextContent(u);return new Promise(function(u,T){function pump(){E.read().then(function(A){var T,E=A.value;if(A.done){u(I);return}Object.assign(I.styles,E.styles),(T=I.items).push.apply(T,_toConsumableArray(E.items)),pump()},T)}var E=A.getReader(),I={items:[],styles:Object.create(null)};pump()})}},{key:"getStructTree",value:function(){return this._structTreePromise||(this._structTreePromise=this._transport.getStructTree(this._pageIndex))}},{key:"_destroy",value:function(){this.destroyed=!0;var u,A=[],T=_createForOfIteratorHelper(this._intentStates.values());try{for(T.s();!(u=T.n()).done;){var E=u.value;if(this._abortOperatorList({intentState:E,reason:Error("Page was destroyed."),force:!0}),!E.opListReadCapability){var I,D=_createForOfIteratorHelper(E.renderTasks);try{for(D.s();!(I=D.n()).done;){var L=I.value;A.push(L.completed),L.cancel()}}catch(u){D.e(u)}finally{D.f()}}}}catch(u){T.e(u)}finally{T.f()}return this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all(A)}},{key:"cleanup",value:function(){var u=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.pendingCleanup=!0,this._tryCleanup(u)}},{key:"_tryCleanup",value:function(){var u=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.pendingCleanup)return!1;var A,T=_createForOfIteratorHelper(this._intentStates.values());try{for(T.s();!(A=T.n()).done;){var E=A.value,I=E.renderTasks,D=E.operatorList;if(I.size>0||!D.lastChunk)return!1}}catch(u){T.e(u)}finally{T.f()}return this._intentStates.clear(),this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,u&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0}},{key:"_startRenderPage",value:function(u,A){var T=this._intentStates.get(A);T&&(this._stats&&this._stats.timeEnd("Page Request"),T.displayReadyCapability&&T.displayReadyCapability.resolve(u))}},{key:"_renderPageChunk",value:function(u,A){for(var T=0,E=u.length;T0)return;if(E instanceof _display_utils.RenderingCancelledException){T.streamReaderCancelTimeout=setTimeout(function(){A._abortOperatorList({intentState:T,reason:E,force:!0}),T.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT);return}}if(T.streamReader.cancel(new _util.AbortException(E.message)).catch(function(){}),T.streamReader=null,!this._transport.destroyed){var L,W=_createForOfIteratorHelper(this._intentStates);try{for(W.s();!(L=W.n()).done;){var N=_slicedToArray(L.value,2),U=N[0];if(N[1]===T){this._intentStates.delete(U);break}}}catch(u){W.e(u)}finally{W.f()}this.cleanup()}}}},{key:"stats",get:function(){return this._stats}}]),PDFPageProxy}();exports.PDFPageProxy=PDFPageProxy;var LoopbackPort=function(){function LoopbackPort(){_classCallCheck(this,LoopbackPort),this._listeners=[],this._deferred=Promise.resolve()}return _createClass(LoopbackPort,[{key:"postMessage",value:function(u,A){var T=this,E={data:function(u){if(globalThis.structuredClone)return globalThis.structuredClone(u,A);function fallbackCloneValue(u){if("function"==typeof u||"symbol"===_typeof(u)||u instanceof URL)throw Error("LoopbackPort.postMessage - cannot clone: ".concat(null==u?void 0:u.toString()));if("object"!==_typeof(u)||null===u)return u;if(T.has(u))return T.get(u);if((E=u.buffer)&&(0,_util.isArrayBuffer)(E))return I=null!=A&&A.includes(E)?new u.constructor(E,u.byteOffset,u.byteLength):new u.constructor(u),T.set(u,I),I;if(u instanceof Map){I=new Map,T.set(u,I);var E,I,D,L=_createForOfIteratorHelper(u);try{for(L.s();!(D=L.n()).done;){var W=_slicedToArray(D.value,2),N=W[0],U=W[1];I.set(N,fallbackCloneValue(U))}}catch(u){L.e(u)}finally{L.f()}return I}if(u instanceof Set){I=new Set,T.set(u,I);var H,Q=_createForOfIteratorHelper(u);try{for(Q.s();!(H=Q.n()).done;){var K=H.value;I.add(fallbackCloneValue(K))}}catch(u){Q.e(u)}finally{Q.f()}return I}for(var J in I=Array.isArray(u)?[]:Object.create(null),T.set(u,I),u){for(var ee,et=void 0,er=u;!(et=Object.getOwnPropertyDescriptor(er,J));)er=Object.getPrototypeOf(er);void 0!==et.value&&("function"!=typeof et.value||null!==(ee=u.hasOwnProperty)&&void 0!==ee&&ee.call(u,J))&&(I[J]=fallbackCloneValue(et.value))}return I}var T=new WeakMap;return fallbackCloneValue(u)}(u)};this._deferred.then(function(){var u,A=_createForOfIteratorHelper(T._listeners);try{for(A.s();!(u=A.n()).done;)u.value.call(T,E)}catch(u){A.e(u)}finally{A.f()}})}},{key:"addEventListener",value:function(u,A){this._listeners.push(A)}},{key:"removeEventListener",value:function(u,A){var T=this._listeners.indexOf(A);this._listeners.splice(T,1)}},{key:"terminate",value:function(){this._listeners.length=0}}]),LoopbackPort}();exports.LoopbackPort=LoopbackPort;var PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(_is_node.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(("undefined"==typeof document?"undefined":_typeof(document))==="object"){var createPDFNetworkStream,_document,_document$currentScri,pdfjsFilePath=null===(_document=document)||void 0===_document?void 0:null===(_document$currentScri=_document.currentScript)||void 0===_document$currentScri?void 0:_document$currentScri.src;pdfjsFilePath&&(PDFWorkerUtil.fallbackWorkerSrc=pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.createCDNWrapper=function(u){var A='importScripts("'.concat(u,'");');return URL.createObjectURL(new Blob([A]))};var PDFWorker=function(){function PDFWorker(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},A=u.name,T=void 0===A?null:A,E=u.port,I=void 0===E?null:E,D=u.verbosity,L=void 0===D?(0,_util.getVerbosityLevel)():D;if(_classCallCheck(this,PDFWorker),I&&PDFWorker._workerPorts.has(I))throw Error("Cannot use more than one PDFWorker per port.");if(this.name=T,this.destroyed=!1,this.verbosity=L,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,I){PDFWorker._workerPorts.set(I,this),this._initializeFromPort(I);return}this._initialize()}return _createClass(PDFWorker,[{key:"promise",get:function(){return this._readyCapability.promise}},{key:"port",get:function(){return this._port}},{key:"messageHandler",get:function(){return this._messageHandler}},{key:"_initializeFromPort",value:function(u){this._port=u,this._messageHandler=new _message_handler.MessageHandler("main","worker",u),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()}},{key:"_initialize",value:function(){var u=this;if("undefined"!=typeof Worker&&!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){var A=PDFWorker.workerSrc;try{(0,_util.isSameOrigin)(window.location.href,A)||(A=PDFWorkerUtil.createCDNWrapper(new URL(A,window.location).href));var T=new Worker(A),E=new _message_handler.MessageHandler("main","worker",T),terminateEarly=function(){T.removeEventListener("error",onWorkerError),E.destroy(),T.terminate(),u.destroyed?u._readyCapability.reject(Error("Worker was destroyed")):u._setupFakeWorker()},onWorkerError=function(){u._webWorker||terminateEarly()};T.addEventListener("error",onWorkerError),E.on("test",function(A){if(T.removeEventListener("error",onWorkerError),u.destroyed){terminateEarly();return}A?(u._messageHandler=E,u._port=T,u._webWorker=T,u._readyCapability.resolve(),E.send("configure",{verbosity:u.verbosity})):(u._setupFakeWorker(),E.destroy(),T.terminate())}),E.on("ready",function(A){if(T.removeEventListener("error",onWorkerError),u.destroyed){terminateEarly();return}try{sendTest()}catch(A){u._setupFakeWorker()}});var sendTest=function(){var u=new Uint8Array([255]);try{E.send("test",u,[u.buffer])}catch(A){(0,_util.warn)("Cannot use postMessage transfers."),u[0]=0,E.send("test",u)}};sendTest();return}catch(u){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}},{key:"_setupFakeWorker",value:function(){var u=this;PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then(function(A){if(u.destroyed){u._readyCapability.reject(Error("Worker was destroyed"));return}var T=new LoopbackPort;u._port=T;var E="fake".concat(PDFWorkerUtil.fakeWorkerId++),I=new _message_handler.MessageHandler(E+"_worker",E,T);A.setup(I,T);var D=new _message_handler.MessageHandler(E,E+"_worker",T);u._messageHandler=D,u._readyCapability.resolve(),D.send("configure",{verbosity:u.verbosity})}).catch(function(A){u._readyCapability.reject(Error('Setting up fake worker failed: "'.concat(A.message,'".')))})}},{key:"destroy",value:function(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker._workerPorts.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}}],[{key:"_workerPorts",get:function(){return(0,_util.shadow)(this,"_workerPorts",new WeakMap)}},{key:"fromPort",value:function(u){if(!(null!=u&&u.port))throw Error("PDFWorker.fromPort - invalid method signature.");return this._workerPorts.has(u.port)?this._workerPorts.get(u.port):new PDFWorker(u)}},{key:"workerSrc",get:function(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw Error('No "GlobalWorkerOptions.workerSrc" specified.')}},{key:"_mainThreadWorkerMessageHandler",get:function(){try{var u;return(null===(u=globalThis.pdfjsWorker)||void 0===u?void 0:u.WorkerMessageHandler)||null}catch(u){return null}}},{key:"_setupFakeWorkerGlobal",get:function get(){var _this11=this,loader=function(){var _ref15=_asyncToGenerator(_regenerator.default.mark(function _callee4(){var mainWorkerMessageHandler,worker;return _regenerator.default.wrap(function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:if(mainWorkerMessageHandler=_this11._mainThreadWorkerMessageHandler,!mainWorkerMessageHandler){_context4.next=3;break}return _context4.abrupt("return",mainWorkerMessageHandler);case 3:if(!_is_node.isNodeJS){_context4.next=6;break}return worker=eval("require")(_this11.workerSrc),_context4.abrupt("return",worker.WorkerMessageHandler);case 6:return _context4.next=8,(0,_display_utils.loadScript)(_this11.workerSrc);case 8:return _context4.abrupt("return",window.pdfjsWorker.WorkerMessageHandler);case 9:case"end":return _context4.stop()}},_callee4)}));return function(){return _ref15.apply(this,arguments)}}();return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}]),PDFWorker}();exports.PDFWorker=PDFWorker,PDFWorker.getWorkerSrc=function(){return(0,_display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead."),this.workerSrc};var _docStats=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_metadataPromise=new WeakMap,WorkerTransport=function(){function WorkerTransport(u,A,T,E){_classCallCheck(this,WorkerTransport),_classPrivateFieldInitSpec(this,_docStats,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,_pageCache,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,_pagePromises,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,_metadataPromise,{writable:!0,value:null}),this.messageHandler=u,this.loadingTask=A,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:A.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:E.ownerDocument,styleElement:E.styleElement}),this._params=E,E.useWorkerFetch||(this.CMapReaderFactory=new E.CMapReaderFactory({baseUrl:E.cMapUrl,isCompressed:E.cMapPacked}),this.StandardFontDataFactory=new E.StandardFontDataFactory({baseUrl:E.standardFontDataUrl})),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=T,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}return _createClass(WorkerTransport,[{key:"annotationStorage",get:function(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}},{key:"stats",get:function(){return _classPrivateFieldGet(this,_docStats)}},{key:"getRenderingIntent",value:function(u){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,T=arguments.length>2&&void 0!==arguments[2]&&arguments[2],E=_util.RenderingIntentFlag.DISPLAY,I="";switch(u){case"any":E=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":E=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(u))}switch(A){case _util.AnnotationMode.DISABLE:E+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:E+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:E+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,I=this.annotationStorage.lastModified;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(A))}return T&&(E+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:E,cacheKey:"".concat(E,"_").concat(I)}}},{key:"destroy",value:function(){var u=this;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(Error("Worker was destroyed during onPassword callback"));var A,T=[],E=_createForOfIteratorHelper(_classPrivateFieldGet(this,_pageCache).values());try{for(E.s();!(A=E.n()).done;){var I=A.value;T.push(I._destroy())}}catch(u){E.e(u)}finally{E.f()}_classPrivateFieldGet(this,_pageCache).clear(),_classPrivateFieldGet(this,_pagePromises).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();var D=this.messageHandler.sendWithPromise("Terminate",null);return T.push(D),Promise.all(T).then(function(){u.commonObjs.clear(),u.fontLoader.clear(),_classPrivateFieldSet(u,_metadataPromise,null),u._getFieldObjectsPromise=null,u._hasJSActionsPromise=null,u._networkStream&&u._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),u.messageHandler&&(u.messageHandler.destroy(),u.messageHandler=null),u.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}},{key:"setupMessageHandler",value:function(){var u=this,A=this.messageHandler,T=this.loadingTask;A.on("GetReader",function(A,T){(0,_util.assert)(u._networkStream,"GetReader - no `IPDFStream` instance available."),u._fullReader=u._networkStream.getFullReader(),u._fullReader.onProgress=function(A){u._lastProgress={loaded:A.loaded,total:A.total}},T.onPull=function(){u._fullReader.read().then(function(u){var A=u.value;if(u.done){T.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(A),"GetReader - expected an ArrayBuffer."),T.enqueue(new Uint8Array(A),1,[A])}).catch(function(u){T.error(u)})},T.onCancel=function(A){u._fullReader.cancel(A),T.ready.catch(function(A){if(!u.destroyed)throw A})}}),A.on("ReaderHeadersReady",function(A){var E=(0,_util.createPromiseCapability)(),I=u._fullReader;return I.headersReady.then(function(){if(!I.isStreamingSupported||!I.isRangeSupported){if(u._lastProgress){var A;null===(A=T.onProgress)||void 0===A||A.call(T,u._lastProgress)}I.onProgress=function(u){var A;null===(A=T.onProgress)||void 0===A||A.call(T,{loaded:u.loaded,total:u.total})}}E.resolve({isStreamingSupported:I.isStreamingSupported,isRangeSupported:I.isRangeSupported,contentLength:I.contentLength})},E.reject),E.promise}),A.on("GetRangeReader",function(A,T){(0,_util.assert)(u._networkStream,"GetRangeReader - no `IPDFStream` instance available.");var E=u._networkStream.getRangeReader(A.begin,A.end);if(!E){T.close();return}T.onPull=function(){E.read().then(function(u){var A=u.value;if(u.done){T.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(A),"GetRangeReader - expected an ArrayBuffer."),T.enqueue(new Uint8Array(A),1,[A])}).catch(function(u){T.error(u)})},T.onCancel=function(A){E.cancel(A),T.ready.catch(function(A){if(!u.destroyed)throw A})}}),A.on("GetDoc",function(A){var E=A.pdfInfo;u._numPages=E.numPages,u._htmlForXfa=E.htmlForXfa,delete E.htmlForXfa,T._capability.resolve(new PDFDocumentProxy(E,u))}),A.on("DocException",function(u){var A;switch(u.name){case"PasswordException":A=new _util.PasswordException(u.message,u.code);break;case"InvalidPDFException":A=new _util.InvalidPDFException(u.message);break;case"MissingPDFException":A=new _util.MissingPDFException(u.message);break;case"UnexpectedResponseException":A=new _util.UnexpectedResponseException(u.message,u.status);break;case"UnknownErrorException":A=new _util.UnknownErrorException(u.message,u.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}T._capability.reject(A)}),A.on("PasswordRequest",function(A){if(u._passwordCapability=(0,_util.createPromiseCapability)(),T.onPassword){var updatePassword=function(A){u._passwordCapability.resolve({password:A})};try{T.onPassword(updatePassword,A.code)}catch(A){u._passwordCapability.reject(A)}}else u._passwordCapability.reject(new _util.PasswordException(A.message,A.code));return u._passwordCapability.promise}),A.on("DataLoaded",function(A){var E;null===(E=T.onProgress)||void 0===E||E.call(T,{loaded:A.length,total:A.length}),u.downloadInfoCapability.resolve(A)}),A.on("StartRenderPage",function(A){u.destroyed||_classPrivateFieldGet(u,_pageCache).get(A.pageIndex)._startRenderPage(A.transparency,A.cacheKey)}),A.on("commonobj",function(T){var E,I=_slicedToArray(T,3),D=I[0],L=I[1],W=I[2];if(!(u.destroyed||u.commonObjs.has(D)))switch(L){case"Font":var N=u._params;if("error"in W){var U=W.error;(0,_util.warn)("Error during font loading: ".concat(U)),u.commonObjs.resolve(D,U);break}var H=null;N.pdfBug&&null!==(E=globalThis.FontInspector)&&void 0!==E&&E.enabled&&(H={registerFont:function(u,A){globalThis.FontInspector.fontAdded(u,A)}});var Q=new _font_loader.FontFaceObject(W,{isEvalSupported:N.isEvalSupported,disableFontFace:N.disableFontFace,ignoreErrors:N.ignoreErrors,onUnsupportedFeature:u._onUnsupportedFeature.bind(u),fontRegistry:H});u.fontLoader.bind(Q).catch(function(u){return A.sendWithPromise("FontFallback",{id:D})}).finally(function(){!N.fontExtraProperties&&Q.data&&(Q.data=null),u.commonObjs.resolve(D,Q)});break;case"FontPath":case"Image":u.commonObjs.resolve(D,W);break;default:throw Error("Got unknown common object type ".concat(L))}}),A.on("obj",function(A){var T,E=_slicedToArray(A,4),I=E[0],D=E[1],L=E[2],W=E[3];if(!u.destroyed){var N=_classPrivateFieldGet(u,_pageCache).get(D);if(!N.objs.has(I))switch(L){case"Image":N.objs.resolve(I,W);var U=8e6;(null==W?void 0:null===(T=W.data)||void 0===T?void 0:T.length)>U&&(N.cleanupAfterRender=!0);break;case"Pattern":N.objs.resolve(I,W);break;default:throw Error("Got unknown object type ".concat(L))}}}),A.on("DocProgress",function(A){var E;u.destroyed||null===(E=T.onProgress)||void 0===E||E.call(T,{loaded:A.loaded,total:A.total})}),A.on("DocStats",function(A){u.destroyed||_classPrivateFieldSet(u,_docStats,Object.freeze({streamTypes:Object.freeze(A.streamTypes),fontTypes:Object.freeze(A.fontTypes)}))}),A.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),A.on("FetchBuiltInCMap",function(A){return u.destroyed?Promise.reject(Error("Worker was destroyed.")):u.CMapReaderFactory?u.CMapReaderFactory.fetch(A):Promise.reject(Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))}),A.on("FetchStandardFontData",function(A){return u.destroyed?Promise.reject(Error("Worker was destroyed.")):u.StandardFontDataFactory?u.StandardFontDataFactory.fetch(A):Promise.reject(Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))})}},{key:"_onUnsupportedFeature",value:function(u){var A,T,E=u.featureId;this.destroyed||null===(A=(T=this.loadingTask).onUnsupportedFeature)||void 0===A||A.call(T,E)}},{key:"getData",value:function(){return this.messageHandler.sendWithPromise("GetData",null)}},{key:"getPage",value:function(u){var A=this;if(!Number.isInteger(u)||u<=0||u>this._numPages)return Promise.reject(Error("Invalid page request"));var T=u-1,E=_classPrivateFieldGet(this,_pagePromises).get(T);if(E)return E;var I=this.messageHandler.sendWithPromise("GetPage",{pageIndex:T}).then(function(u){if(A.destroyed)throw Error("Transport destroyed");var E=new PDFPageProxy(T,u,A,A._params.ownerDocument,A._params.pdfBug);return _classPrivateFieldGet(A,_pageCache).set(T,E),E});return _classPrivateFieldGet(this,_pagePromises).set(T,I),I}},{key:"getPageIndex",value:function(u){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:u})}},{key:"getAnnotations",value:function(u,A){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:u,intent:A})}},{key:"saveDocument",value:function(){var u,A,T=this;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:null!==(u=null===(A=this._fullReader)||void 0===A?void 0:A.filename)&&void 0!==u?u:null}).finally(function(){T.annotationStorage.resetModified()})}},{key:"getFieldObjects",value:function(){return this._getFieldObjectsPromise||(this._getFieldObjectsPromise=this.messageHandler.sendWithPromise("GetFieldObjects",null))}},{key:"hasJSActions",value:function(){return this._hasJSActionsPromise||(this._hasJSActionsPromise=this.messageHandler.sendWithPromise("HasJSActions",null))}},{key:"getCalculationOrderIds",value:function(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}},{key:"getDestinations",value:function(){return this.messageHandler.sendWithPromise("GetDestinations",null)}},{key:"getDestination",value:function(u){return"string"!=typeof u?Promise.reject(Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:u})}},{key:"getPageLabels",value:function(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}},{key:"getPageLayout",value:function(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}},{key:"getPageMode",value:function(){return this.messageHandler.sendWithPromise("GetPageMode",null)}},{key:"getViewerPreferences",value:function(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}},{key:"getOpenAction",value:function(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}},{key:"getAttachments",value:function(){return this.messageHandler.sendWithPromise("GetAttachments",null)}},{key:"getJavaScript",value:function(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}},{key:"getDocJSActions",value:function(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}},{key:"getPageJSActions",value:function(u){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:u})}},{key:"getStructTree",value:function(u){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:u})}},{key:"getOutline",value:function(){return this.messageHandler.sendWithPromise("GetOutline",null)}},{key:"getOptionalContentConfig",value:function(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(function(u){return new _optional_content_config.OptionalContentConfig(u)})}},{key:"getPermissions",value:function(){return this.messageHandler.sendWithPromise("GetPermissions",null)}},{key:"getMetadata",value:function(){var u=this;return _classPrivateFieldGet(this,_metadataPromise)||_classPrivateFieldSet(this,_metadataPromise,this.messageHandler.sendWithPromise("GetMetadata",null).then(function(A){var T,E,I,D;return{info:A[0],metadata:A[1]?new _metadata.Metadata(A[1]):null,contentDispositionFilename:null!==(T=null===(E=u._fullReader)||void 0===E?void 0:E.filename)&&void 0!==T?T:null,contentLength:null!==(I=null===(D=u._fullReader)||void 0===D?void 0:D.contentLength)&&void 0!==I?I:null}}))}},{key:"getMarkInfo",value:function(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}},{key:"startCleanup",value:function(){var u=_asyncToGenerator(_regenerator.default.mark(function _callee5(){var u,A,T,E,I=arguments;return _regenerator.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return u=I.length>0&&void 0!==I[0]&&I[0],D.next=3,this.messageHandler.sendWithPromise("Cleanup",null);case 3:if(!this.destroyed){D.next=5;break}return D.abrupt("return");case 5:A=_createForOfIteratorHelper(_classPrivateFieldGet(this,_pageCache).values()),D.prev=6,A.s();case 8:if((T=A.n()).done){D.next=15;break}if((E=T.value).cleanup()){D.next=13;break}throw Error("startCleanup: Page ".concat(E.pageNumber," is currently rendering."));case 13:D.next=8;break;case 15:D.next=20;break;case 17:D.prev=17,D.t0=D.catch(6),A.e(D.t0);case 20:return D.prev=20,A.f(),D.finish(20);case 23:this.commonObjs.clear(),u||this.fontLoader.clear(),_classPrivateFieldSet(this,_metadataPromise,null),this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null;case 28:case"end":return D.stop()}},_callee5,this,[[6,17,20,23]])}));return function(){return u.apply(this,arguments)}}()},{key:"loadingParams",get:function(){var u=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:u.disableAutoFetch,enableXfa:u.enableXfa})}}]),WorkerTransport}(),PDFObjects=function(){function PDFObjects(){_classCallCheck(this,PDFObjects),this._objs=Object.create(null)}return _createClass(PDFObjects,[{key:"_ensureObj",value:function(u){return this._objs[u]?this._objs[u]:this._objs[u]={capability:(0,_util.createPromiseCapability)(),data:null,resolved:!1}}},{key:"get",value:function(u){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(A)return this._ensureObj(u).capability.promise.then(A),null;var T=this._objs[u];if(!T||!T.resolved)throw Error("Requesting object that isn't resolved yet ".concat(u,"."));return T.data}},{key:"has",value:function(u){var A=this._objs[u];return(null==A?void 0:A.resolved)||!1}},{key:"resolve",value:function(u,A){var T=this._ensureObj(u);T.resolved=!0,T.data=A,T.capability.resolve(A)}},{key:"clear",value:function(){this._objs=Object.create(null)}}]),PDFObjects}(),RenderTask=function(){function RenderTask(u){_classCallCheck(this,RenderTask),this._internalRenderTask=u,this.onContinue=null}return _createClass(RenderTask,[{key:"promise",get:function(){return this._internalRenderTask.capability.promise}},{key:"cancel",value:function(){this._internalRenderTask.cancel()}}]),RenderTask}();exports.RenderTask=RenderTask;var InternalRenderTask=function(){function InternalRenderTask(u){var A=u.callback,T=u.params,E=u.objs,I=u.commonObjs,D=u.annotationCanvasMap,L=u.operatorList,W=u.pageIndex,N=u.canvasFactory,U=u.useRequestAnimationFrame,H=void 0!==U&&U,Q=u.pdfBug,K=void 0!==Q&&Q;_classCallCheck(this,InternalRenderTask),this.callback=A,this.params=T,this.objs=E,this.commonObjs=I,this.annotationCanvasMap=D,this.operatorListIdx=null,this.operatorList=L,this._pageIndex=W,this.canvasFactory=N,this._pdfBug=K,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===H&&"undefined"!=typeof window,this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=T.canvasContext.canvas}return _createClass(InternalRenderTask,[{key:"completed",get:function(){return this.capability.promise.catch(function(){})}},{key:"initializeGraphics",value:function(u){var A,T=u.transparency,E=void 0!==T&&T,I=u.optionalContentConfig;if(!this.cancelled){if(this._canvas){if(InternalRenderTask.canvasInUse.has(this._canvas))throw Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.canvasInUse.add(this._canvas)}this._pdfBug&&null!==(A=globalThis.StepperManager)&&void 0!==A&&A.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());var D=this.params,L=D.canvasContext,W=D.viewport,N=D.transform,U=D.imageLayer,H=D.background;this.gfx=new _canvas.CanvasGraphics(L,this.commonObjs,this.objs,this.canvasFactory,U,I,this.annotationCanvasMap),this.gfx.beginDrawing({transform:N,viewport:W,transparency:E,background:H}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}}},{key:"cancel",value:function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&InternalRenderTask.canvasInUse.delete(this._canvas),this.callback(u||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),"canvas"))}},{key:"operatorListChanged",value:function(){if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}this.stepper&&this.stepper.updateOperatorList(this.operatorList),this.running||this._continue()}},{key:"_continue",value:function(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}},{key:"_scheduleNext",value:function(){var u=this;this._useRequestAnimationFrame?window.requestAnimationFrame(function(){u._nextBound().catch(u._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}},{key:"_next",value:function(){var u=_asyncToGenerator(_regenerator.default.mark(function _callee6(){return _regenerator.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!this.cancelled){u.next=2;break}return u.abrupt("return");case 2:this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&InternalRenderTask.canvasInUse.delete(this._canvas),this.callback()));case 4:case"end":return u.stop()}},_callee6,this)}));return function(){return u.apply(this,arguments)}}()}],[{key:"canvasInUse",get:function(){return(0,_util.shadow)(this,"canvasInUse",new WeakSet)}}]),InternalRenderTask}(),version="2.12.313";exports.version=version;var build="a2ae56f39";exports.build=build},(u,A,T)=>{"use strict";function _typeof(u){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(u)}Object.defineProperty(A,"__esModule",{value:!0}),A.FontLoader=A.FontFaceObject=void 0;var E,I=_interopRequireDefault(T(2)),D=T(4);function _interopRequireDefault(u){return u&&u.__esModule?u:{default:u}}function _inherits(u,A){if("function"!=typeof A&&null!==A)throw TypeError("Super expression must either be null or a function");u.prototype=Object.create(A&&A.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),A&&_setPrototypeOf(u,A)}function _setPrototypeOf(u,A){return(_setPrototypeOf=Object.setPrototypeOf||function(u,A){return u.__proto__=A,u})(u,A)}function _createSuper(u){var A=_isNativeReflectConstruct();return function(){var T,E=_getPrototypeOf(u);if(A){var I=_getPrototypeOf(this).constructor;T=Reflect.construct(E,arguments,I)}else T=E.apply(this,arguments);return _possibleConstructorReturn(this,T)}}function _possibleConstructorReturn(u,A){if(A&&("object"===_typeof(A)||"function"==typeof A))return A;if(void 0!==A)throw TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(u)}function _assertThisInitialized(u){if(void 0===u)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(u){return!1}}function _getPrototypeOf(u){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)})(u)}function asyncGeneratorStep(u,A,T,E,I,D,L){try{var W=u[D](L),N=W.value}catch(u){T(u);return}W.done?A(N):Promise.resolve(N).then(E,I)}function _asyncToGenerator(u){return function(){var A=this,T=arguments;return new Promise(function(E,I){var D=u.apply(A,T);function _next(u){asyncGeneratorStep(D,E,I,_next,_throw,"next",u)}function _throw(u){asyncGeneratorStep(D,E,I,_next,_throw,"throw",u)}_next(void 0)})}}function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T=14&&(u=!0)}return(0,D.shadow)(this,"isSyncFontLoadingSupported",u)}},{key:"_queueLoadingCallback",value:function(u){function completeRequest(){for((0,D.assert)(!T.done,"completeRequest() cannot be called twice."),T.done=!0;A.requests.length>0&&A.requests[0].done;)setTimeout(A.requests.shift().callback,0)}var A=this.loadingContext,T={id:"pdfjs-font-loading-".concat(A.nextRequestId++),done:!1,complete:completeRequest,callback:u};return A.requests.push(T),T}},{key:"_loadTestFont",get:function(){var getLoadTestFont=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,D.shadow)(this,"_loadTestFont",getLoadTestFont())}},{key:"_prepareFontLoadEvent",value:function(u,A,T){function int32(u,A){return u.charCodeAt(A)<<24|u.charCodeAt(A+1)<<16|u.charCodeAt(A+2)<<8|255&u.charCodeAt(A+3)}function spliceString(u,A,T,E){return u.substring(0,A)+E+u.substring(A+T)}var E=this._document.createElement("canvas");E.width=1,E.height=1;var I=E.getContext("2d"),L=0;function isFontReady(u,A){if(++L>30){(0,D.warn)("Load test font never loaded."),A();return}if(I.font="30px "+u,I.fillText(".",0,20),I.getImageData(0,0,1,1).data[3]>0){A();return}setTimeout(isFontReady.bind(null,u,A))}var W="lt".concat(Date.now()).concat(this.loadTestFontId++),N=this._loadTestFont;N=spliceString(N,976,W.length,W);var U=16,H=1482184792,Q=int32(N,16);for(ee=0,et=W.length-3;ee{"use strict";function _typeof(u){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(u)}Object.defineProperty(A,"__esModule",{value:!0}),A.NodeStandardFontDataFactory=A.NodeCanvasFactory=A.NodeCMapReaderFactory=void 0;var E=T(135),I=T(6),D=T(4);function _defineProperties(u,A){for(var T=0;T{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.AnnotationStorage=void 0;var E=T(4);function _slicedToArray(u,A){return _arrayWithHoles(u)||_iterableToArrayLimit(u,A)||_unsupportedIterableToArray(u,A)||_nonIterableRest()}function _nonIterableRest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T0?(0,E.objectFromMap)(this._storage):null}},{key:"size",get:function(){return this._storage.size}},{key:"_setModified",value:function(){this._modified||(this._modified=!0,"function"==typeof this.onSetModified&&this.onSetModified())}},{key:"resetModified",value:function(){this._modified&&(this._modified=!1,"function"==typeof this.onResetModified&&this.onResetModified())}},{key:"serializable",get:function(){return this._storage.size>0?this._storage:null}},{key:"lastModified",get:function(){return this._timeStamp.toString()}}]),AnnotationStorage}();A.AnnotationStorage=I},(u,A,T)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.CanvasGraphics=void 0;var E=T(4),I=T(141),D=T(1);function _typeof(u){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(u)}function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _classCallCheck(u,A){if(!(u instanceof A))throw TypeError("Cannot call a class as a function")}function _defineProperties(u,A){for(var T=0;Tu.length)&&(A=u.length);for(var T=0,E=Array(A);T0;)J[ee++]=et&er?0:255,er>>=1;var en=0;for(0!==J[ee=0]&&(H[0]=1,++en),E=1;E>2)+(J[ee+1]?4:0)+(J[ee-Q+1]?8:0)]&&(H[I+E]=L[ea],++en),ee++;if(J[ee-Q]!==J[ee]&&(H[I+E]=J[ee]?2:4,++en),en>D)return null}for(ee=Q*(N-1),I=A*U,0!==J[ee]&&(H[I]=8,++en),E=1;ED)return null;var eo=new Int32Array([0,U,-1,0,-U,0,0,0,1]),ei=[];for(A=0;en&&A<=N;A++){for(var es=A*U,eu=es+W;es>4,H[es]&=ef>>2|ef<<2),ec.push(es%U,es/U|0),!H[es]&&--en}while(ed!==es);ei.push(ec),--A}}return function(u){u.save(),u.scale(1/W,-1/N),u.translate(0,-N),u.beginPath();for(var A=0,T=ei.length;A0&&void 0!==arguments[0]?arguments[0]:I.PathType.FILL,A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,T=[this.minX,this.minY,this.maxX,this.maxY];if(u===I.PathType.STROKE){A||(0,E.unreachable)("Stroke bounding box must include transform.");var D=E.Util.singularValueDecompose2dScale(A),L=D[0]*this.lineWidth/2,W=D[1]*this.lineWidth/2;T[0]-=L,T[1]-=W,T[2]+=L,T[3]+=W}return T}},{key:"updateClipFromPath",value:function(){var u=E.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(u||[0,0,0,0])}},{key:"startNewPathAndClipBox",value:function(u){this.clipBox=u,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}},{key:"getClippedPathBoundingBox",value:function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:I.PathType.FILL,A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return E.Util.intersect(this.clipBox,this.getPathBoundingBox(u,A))}}]),CanvasExtraState}();function putBinaryImageData(u,A){var T,I,D,L,W,N,U,H,Q=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("undefined"!=typeof ImageData&&A instanceof ImageData){u.putImageData(A,0,0);return}var K,ee=A.height,et=A.width,er=ee%J,en=(ee-er)/J,ea=0===er?en:en+1,eo=u.createImageData(et,J),ei=0,es=A.data,eu=eo.data;if(Q)switch(Q.length){case 1:W=Q[0],N=Q[0],U=Q[0],H=Q[0];break;case 4:W=Q[0],N=Q[1],U=Q[2],H=Q[3]}if(A.kind===E.ImageKind.GRAYSCALE_1BPP){var ec=es.byteLength,ed=new Uint32Array(eu.buffer,0,eu.byteLength>>2),ef=ed.length,eh=et+7>>3,ep=4294967295,em=E.IsLittleEndianCached.value?4278190080:255;if(H&&255===H[0]&&0===H[255]){var ev=[em,ep];ep=ev[0],em=ev[1]}for(T=0;Teh?et:8*ey-7,e_=-8&eg,eS=0,eA=0;eb>=1}for(;K=en&&(L=et*(D=er)),K=0,I=L;I--;)eu[K++]=es[ei++],eu[K++]=es[ei++],eu[K++]=es[ei++],eu[K++]=255;if(eP)for(var eT=0;eT>=1;u.putImageData(W,0,Q*J)}}function copyCtxState(u,A){for(var T=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],E=0,I=T.length;E>8,u[D-2]=u[D-2]*L+T*W>>8,u[D-1]=u[D-1]*L+E*W>>8}}}function composeSMaskAlpha(u,A,T){for(var E=u.length,I=1/255,D=3;D>8]>>8:A[I]*D>>16}}function genericComposeSMask(u,A,T,E,I,D,L,W,N,U,H){var Q,K=!!D,J=K?D[0]:0,ee=K?D[1]:0,et=K?D[2]:0;Q="Luminosity"===I?composeSMaskLuminosity:composeSMaskAlpha;for(var er=Math.min(E,Math.ceil(1048576/T)),en=0;enH&&"function"==typeof T,K=Q?Date.now()+U:0,J=0,ee=this.commonObjs,et=this.objs;;){if(void 0!==I&&W===I.nextBreakPoint)return I.breakIt(W,T),W;if((er=L[W])!==E.OPS.dependency)this[er].apply(this,D[W]);else{var er,en,ea=_createForOfIteratorHelper(D[W]);try{for(ea.s();!(en=ea.n()).done;){var eo=en.value,ei=eo.startsWith("g_")?ee:et;if(!ei.has(eo))return ei.get(eo,T),W}}catch(u){ea.e(u)}finally{ea.f()}}if(++W===N)return W;if(Q&&++J>H){if(Date.now()>K)return T(),W;J=0}}}},{key:"endDrawing",value:function(){for(;this.stateStack.length||null!==this.current.activeSMask;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null),this.cachedCanvases.clear(),this.cachedPatterns.clear(),this.imageLayer&&this.imageLayer.endLayout()}},{key:"_scaleImage",value:function(u,A){for(var T,E,I=u.width,D=u.height,L=Math.max(Math.hypot(A[0],A[1]),1),W=Math.max(Math.hypot(A[2],A[3]),1),N=I,U=D,H="prescale1";L>2&&N>1||W>2&&U>1;){var Q=N,K=U;L>2&&N>1&&(Q=Math.ceil(N/2),L/=N/Q),W>2&&U>1&&(K=Math.ceil(U/2),W/=U/K),(E=(T=this.cachedCanvases.getCanvas(H,Q,K)).context).clearRect(0,0,Q,K),E.drawImage(u,0,0,N,U,0,0,Q,K),u=T.canvas,N=Q,U=K,H="prescale1"===H?"prescale2":"prescale1"}return{img:u,paintWidth:N,paintHeight:U}}},{key:"_createMaskCanvas",value:function(u){var A=this.ctx,T=u.width,D=u.height,L=this.current.fillColor,W=this.current.patternFill,N=this.cachedCanvases.getCanvas("maskCanvas",T,D);putBinaryImageMask(N.context,u);var U=A.mozCurrentTransform,H=E.Util.transform(U,[1/T,0,0,-1/D,0,0]);H=E.Util.transform(H,[1,0,0,1,0,-D]);var Q=E.Util.applyTransform([0,0],H),K=E.Util.applyTransform([T,D],H),J=E.Util.normalizeRect([Q[0],Q[1],K[0],K[1]]),ee=Math.ceil(J[2]-J[0]),et=Math.ceil(J[3]-J[1]),er=this.cachedCanvases.getCanvas("fillCanvas",ee,et,!0),en=er.context,ea=Math.min(Q[0],K[0]),eo=Math.min(Q[1],K[1]);en.translate(-ea,-eo),en.transform.apply(en,H);var ei=this._scaleImage(N.canvas,en.mozCurrentTransformInverse);en.imageSmoothingEnabled=getImageSmoothingEnabled(en.mozCurrentTransform,u.interpolate),en.drawImage(ei.img,0,0,ei.img.width,ei.img.height,0,0,T,D),en.globalCompositeOperation="source-in";var es=E.Util.transform(en.mozCurrentTransformInverse,[1,0,0,1,-ea,-eo]);return en.fillStyle=W?L.getPattern(A,this,es,I.PathType.FILL):L,en.fillRect(0,0,T,D),{canvas:er.canvas,offsetX:Math.round(ea),offsetY:Math.round(eo)}}},{key:"setLineWidth",value:function(u){this.current.lineWidth=u,this.ctx.lineWidth=u}},{key:"setLineCap",value:function(u){this.ctx.lineCap=en[u]}},{key:"setLineJoin",value:function(u){this.ctx.lineJoin=ea[u]}},{key:"setMiterLimit",value:function(u){this.ctx.miterLimit=u}},{key:"setDash",value:function(u,A){var T=this.ctx;void 0!==T.setLineDash&&(T.setLineDash(u),T.lineDashOffset=A)}},{key:"setRenderingIntent",value:function(u){}},{key:"setFlatness",value:function(u){}},{key:"setGState",value:function(u){for(var A=0,T=u.length;A=this.current.lineWidth?(A.save(),A.resetTransform(),A.lineWidth=Math.round(this._combinedScaleFactor),A.stroke(),A.restore()):(A.lineWidth=Math.max(D,this.current.lineWidth),A.stroke())}}u&&this.consumePath(this.current.getClippedPathBoundingBox()),A.globalAlpha=this.current.fillAlpha}},{key:"closeStroke",value:function(){this.closePath(),this.stroke()}},{key:"fill",value:function(u){u=void 0===u||u;var A=this.ctx,T=this.current.fillColor,E=this.current.patternFill,D=!1;E&&(A.save(),A.fillStyle=T.getPattern(A,this,A.mozCurrentTransformInverse,I.PathType.FILL),D=!0);var L=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==L&&(this.pendingEOFill?(A.fill("evenodd"),this.pendingEOFill=!1):A.fill()),D&&A.restore(),u&&this.consumePath(L)}},{key:"eoFill",value:function(){this.pendingEOFill=!0,this.fill()}},{key:"fillStroke",value:function(){this.fill(!1),this.stroke(!1),this.consumePath()}},{key:"eoFillStroke",value:function(){this.pendingEOFill=!0,this.fillStroke()}},{key:"closeFillStroke",value:function(){this.closePath(),this.fillStroke()}},{key:"closeEOFillStroke",value:function(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}},{key:"endPath",value:function(){this.consumePath()}},{key:"clip",value:function(){this.pendingClip=eo}},{key:"eoClip",value:function(){this.pendingClip=ei}},{key:"beginText",value:function(){this.current.textMatrix=E.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}},{key:"endText",value:function(){var u=this.pendingTextPaths,A=this.ctx;if(void 0===u){A.beginPath();return}A.save(),A.beginPath();for(var T=0;TW&&(Q=W),this.current.fontSizeScale=A/Q,this.ctx.font="".concat(U," ").concat(N," ").concat(Q,"px ").concat(H)}}},{key:"setTextRenderingMode",value:function(u){this.current.textRenderingMode=u}},{key:"setTextRise",value:function(u){this.current.textRise=u}},{key:"moveText",value:function(u,A){this.current.x=this.current.lineX+=u,this.current.y=this.current.lineY+=A}},{key:"setLeadingMoveText",value:function(u,A){this.setLeading(-A),this.moveText(u,A)}},{key:"setTextMatrix",value:function(u,A,T,E,I,D){this.current.textMatrix=[u,A,T,E,I,D],this.current.textMatrixScale=Math.hypot(u,A),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}},{key:"nextLine",value:function(){this.moveText(0,this.current.leading)}},{key:"paintChar",value:function(u,A,T,I,D){var L,W=this.ctx,N=this.current,U=N.font,H=N.textRenderingMode,Q=N.fontSize/N.fontSizeScale,K=H&E.TextRenderingMode.FILL_STROKE_MASK,J=!!(H&E.TextRenderingMode.ADD_TO_PATH_FLAG),ee=N.patternFill&&!U.missingFile;(U.disableFontFace||J||ee)&&(L=U.getPathGenerator(this.commonObjs,u)),U.disableFontFace||ee?(W.save(),W.translate(A,T),W.beginPath(),L(W,Q),I&&W.setTransform.apply(W,I),(K===E.TextRenderingMode.FILL||K===E.TextRenderingMode.FILL_STROKE)&&W.fill(),(K===E.TextRenderingMode.STROKE||K===E.TextRenderingMode.FILL_STROKE)&&(D&&(W.resetTransform(),W.lineWidth=Math.round(this._combinedScaleFactor)),W.stroke()),W.restore()):((K===E.TextRenderingMode.FILL||K===E.TextRenderingMode.FILL_STROKE)&&W.fillText(u,A,T),(K===E.TextRenderingMode.STROKE||K===E.TextRenderingMode.FILL_STROKE)&&(D?(W.save(),W.moveTo(A,T),W.resetTransform(),W.lineWidth=Math.round(this._combinedScaleFactor),W.strokeText(u,0,0),W.restore()):W.strokeText(u,A,T))),J&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:W.mozCurrentTransform,x:A,y:T,fontSize:Q,addToPath:L})}},{key:"isFontSubpixelAAEnabled",get:function(){var u=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10).context;u.scale(1.5,1),u.fillText("I",0,10);for(var A=u.getImageData(0,0,10,10).data,T=!1,I=3;I0&&A[I]<255){T=!0;break}return(0,E.shadow)(this,"isFontSubpixelAAEnabled",T)}},{key:"showText",value:function(u){var A=this.current,T=A.font;if(T.isType3Font)return this.showType3Text(u);var D=A.fontSize;if(0!==D){var L=this.ctx,W=A.fontSizeScale,N=A.charSpacing,U=A.wordSpacing,H=A.fontDirection,Q=A.textHScale*H,K=u.length,J=T.vertical,ee=J?1:-1,et=T.defaultVMetrics,er=D*A.fontMatrix[0],en=A.textRenderingMode===E.TextRenderingMode.FILL&&!T.disableFontFace&&!A.patternFill;if(L.save(),L.transform.apply(L,A.textMatrix),L.translate(A.x,A.y+A.textRise),H>0?L.scale(Q,-1):L.scale(Q,1),A.patternFill){L.save();var ea=A.fillColor.getPattern(L,this,L.mozCurrentTransformInverse,I.PathType.FILL);ec=L.mozCurrentTransform,L.restore(),L.fillStyle=ea}var eo=A.lineWidth,ei=!1,es=A.textMatrixScale;if(0===es||0===eo){var eu=A.textRenderingMode&E.TextRenderingMode.FILL_STROKE_MASK;(eu===E.TextRenderingMode.STROKE||eu===E.TextRenderingMode.FILL_STROKE)&&(this._cachedGetSinglePixelWidth=null,ei=(eo=this.getSinglePixelWidth())<0)}else eo/=es;1!==W&&(L.scale(W,W),eo/=W),L.lineWidth=eo;var ec,ed,ef=0;for(ed=0;ed0){var eR=1e3*L.measureText(ev).width/D*W;if(e_1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(u)?A=this.cachedPatterns.get(u):(A=(0,I.getShadingPattern)(this.objs.get(u)),this.cachedPatterns.set(u,A)),T&&(A.matrix=T),A}},{key:"shadingFill",value:function(u){if(this.contentVisible){var A=this.ctx;this.save();var T=this._getPattern(u);A.fillStyle=T.getPattern(A,this,A.mozCurrentTransformInverse,I.PathType.SHADING);var D=A.mozCurrentTransformInverse;if(D){var L=A.canvas,W=L.width,N=L.height,U=E.Util.applyTransform([0,0],D),H=E.Util.applyTransform([0,N],D),Q=E.Util.applyTransform([W,0],D),K=E.Util.applyTransform([W,N],D),J=Math.min(U[0],H[0],Q[0],K[0]),ee=Math.min(U[1],H[1],Q[1],K[1]),et=Math.max(U[0],H[0],Q[0],K[0]),er=Math.max(U[1],H[1],Q[1],K[1]);this.ctx.fillRect(J,ee,et-J,er-ee)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}}},{key:"beginInlineImage",value:function(){(0,E.unreachable)("Should not call beginInlineImage")}},{key:"beginImageData",value:function(){(0,E.unreachable)("Should not call beginImageData")}},{key:"paintFormXObjectBegin",value:function(u,A){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(u)&&6===u.length&&this.transform.apply(this,u),this.baseTransform=this.ctx.mozCurrentTransform,A)){var T=A[2]-A[0],E=A[3]-A[1];this.ctx.rect(A[0],A[1],T,E),this.current.updatePathMinMax(this.ctx.mozCurrentTransform,A[0],A[1]),this.current.updatePathMinMax(this.ctx.mozCurrentTransform,A[2],A[3]),this.clip(),this.endPath()}}},{key:"paintFormXObjectEnd",value:function(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}},{key:"beginGroup",value:function(u){if(this.contentVisible){this.save();var A=this.suspendedCtx;this.current.activeSMask&&(this.suspendedCtx=null,this.current.activeSMask=null);var T=this.ctx;u.isolated||(0,E.info)("TODO: Support non-isolated groups."),u.knockout&&(0,E.warn)("Knockout groups not supported.");var I=T.mozCurrentTransform;if(u.matrix&&T.transform.apply(T,u.matrix),!u.bbox)throw Error("Bounding box is required.");var D=E.Util.getAxialAlignedBoundingBox(u.bbox,T.mozCurrentTransform),L=[0,0,T.canvas.width,T.canvas.height],W=Math.floor((D=E.Util.intersect(D,L)||[0,0,0,0])[0]),U=Math.floor(D[1]),H=Math.max(Math.ceil(D[2])-W,1),Q=Math.max(Math.ceil(D[3])-U,1),K=1,J=1;H>N&&(K=H/N,H=N),Q>N&&(J=Q/N,Q=N),this.current.startNewPathAndClipBox([0,0,H,Q]);var ee="groupAt"+this.groupLevel;u.smask&&(ee+="_smask_"+this.smaskCounter++%2);var et=this.cachedCanvases.getCanvas(ee,H,Q,!0),er=et.context;er.scale(1/K,1/J),er.translate(-W,-U),er.transform.apply(er,I),u.smask?this.smaskStack.push({canvas:et.canvas,context:er,offsetX:W,offsetY:U,scaleX:K,scaleY:J,subtype:u.smask.subtype,backdrop:u.smask.backdrop,transferMap:u.smask.transferMap||null,startTransformInverse:null}):(T.setTransform(1,0,0,1,0,0),T.translate(W,U),T.scale(K,J),T.save()),copyCtxState(T,er),this.ctx=er,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push({ctx:T,suspendedCtx:A}),this.groupLevel++}}},{key:"endGroup",value:function(u){if(this.contentVisible){this.groupLevel--;var A=this.ctx,T=this.groupStack.pop(),I=T.ctx,D=T.suspendedCtx;if(this.ctx=I,this.ctx.imageSmoothingEnabled=!1,D&&(this.suspendedCtx=D),u.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();var L=this.ctx.mozCurrentTransform;this.restore(),this.ctx.save(),this.ctx.setTransform.apply(this.ctx,L);var W=E.Util.getAxialAlignedBoundingBox([0,0,A.canvas.width,A.canvas.height],L);this.ctx.drawImage(A.canvas,0,0),this.ctx.restore(),this.compose(W)}}}},{key:"beginAnnotations",value:function(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)}},{key:"endAnnotations",value:function(){this.restore()}},{key:"beginAnnotation",value:function(u,A,T,I,D){if(this.save(),Array.isArray(A)&&4===A.length){var L=A[2]-A[0],W=A[3]-A[1];if(D&&this.annotationCanvasMap){T=T.slice(),T[4]-=A[0],T[5]-=A[1],(A=A.slice())[0]=A[1]=0,A[2]=L,A[3]=W;var N=_slicedToArray(E.Util.singularValueDecompose2dScale(this.ctx.mozCurrentTransform),2),U=N[0],H=N[1],Q=this.viewportScale,K=Math.ceil(L*this.outputScaleX*Q),J=Math.ceil(W*this.outputScaleY*Q);this.annotationCanvas=this.canvasFactory.create(K,J);var ee=this.annotationCanvas,et=ee.canvas,en=ee.context;et.style.width="calc(".concat(L,"px * var(--viewport-scale-factor))"),et.style.height="calc(".concat(W,"px * var(--viewport-scale-factor))"),this.annotationCanvasMap.set(u,et),this.annotationCanvas.savedCtx=this.ctx,this.ctx=en,this.ctx.setTransform(U,0,0,-H,0,W*H),addContextCurrentTransform(this.ctx),resetCtxToDefault(this.ctx)}else resetCtxToDefault(this.ctx),this.ctx.rect(A[0],A[1],L,W),this.clip(),this.endPath()}this.current=new er(this.ctx.canvas.width,this.ctx.canvas.height),this.transform.apply(this,T),this.transform.apply(this,I)}},{key:"endAnnotation",value:function(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas),this.restore()}},{key:"paintImageMaskXObject",value:function(u){if(this.contentVisible){var A=this.ctx,T=u.width,E=u.height,I=this.processingType3;if(Q&&I&&void 0===I.compiled&&(T<=K&&E<=K?I.compiled=compileType3Glyph({data:u.data,width:T,height:E}):I.compiled=null),null!=I&&I.compiled){I.compiled(A);return}var D=this._createMaskCanvas(u),L=D.canvas;A.save(),A.setTransform(1,0,0,1,0,0),A.drawImage(L,D.offsetX,D.offsetY),A.restore(),this.compose()}}},{key:"paintImageMaskXObjectRepeat",value:function(u,A){var T=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,D=arguments.length>4?arguments[4]:void 0,L=arguments.length>5?arguments[5]:void 0;if(this.contentVisible){var W=this.ctx;W.save();var N=W.mozCurrentTransform;W.transform(A,T,I,D,0,0);var U=this._createMaskCanvas(u);W.setTransform(1,0,0,1,0,0);for(var H=0,Q=L.length;H1?this._cachedGetSinglePixelWidth=-(this._combinedScaleFactor*I):A>Number.EPSILON?this._cachedGetSinglePixelWidth=I:this._cachedGetSinglePixelWidth=1}return this._cachedGetSinglePixelWidth}},{key:"getCanvasPosition",value:function(u,A){var T=this.ctx.mozCurrentTransform;return[T[0]*u+T[2]*A+T[4],T[1]*u+T[3]*A+T[5]]}},{key:"isContentVisible",value:function(){for(var u=this.markedContentStack.length-1;u>=0;u--)if(!this.markedContentStack[u].visible)return!1;return!0}}]),CanvasGraphics}();for(var eu in A.CanvasGraphics=es,E.OPS)void 0!==es.prototype[eu]&&(es.prototype[E.OPS[eu]]=es.prototype[eu])},(u,A,T)=>{"use strict";function _typeof(u){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(u)}Object.defineProperty(A,"__esModule",{value:!0}),A.TilingPattern=A.PathType=void 0,A.getShadingPattern=getShadingPattern;var E=T(4);function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);Ten[E+1]&&(N=T,T=E,E=N,N=D,D=L,L=N),en[E+1]>en[I+1]&&(N=E,E=I,I=N,N=L,L=W,W=N),en[T+1]>en[E+1]&&(N=T,T=E,E=N,N=D,D=L,L=N);var es=(en[T]+A.offsetX)*A.scaleX,eu=(en[T+1]+A.offsetY)*A.scaleY,ec=(en[E]+A.offsetX)*A.scaleX,ed=(en[E+1]+A.offsetY)*A.scaleY,ef=(en[I]+A.offsetX)*A.scaleX,eh=(en[I+1]+A.offsetY)*A.scaleY;if(!(eu>=eh))for(var ep=ea[D],em=ea[D+1],ev=ea[D+2],ey=ea[L],eb=ea[L+1],eg=ea[L+2],e_=ea[W],eS=ea[W+1],eA=ea[W+2],eC=Math.round(eu),eR=Math.round(eh),ek=eC;ek<=eR;ek++){if(ekeh?1:ed===eh?0:(ed-ek)/(ed-eh)),H=ey-(ey-e_)*eT,Q=eb-(eb-eS)*eT,K=eg-(eg-eA)*eT}var ew=void 0;J=es-(es-ef)*(ew=ekeh?1:(eu-ek)/(eu-eh)),ee=ep-(ep-e_)*ew,et=em-(em-eS)*ew,er=ev-(ev-eA)*ew;for(var eE=Math.round(Math.min(U,J)),eF=Math.round(Math.max(U,J)),eO=ei*ek+4*eE,eI=eE;eI<=eF;eI++)(ew=(U-eI)/(U-J))<0?ew=0:ew>1&&(ew=1),eo[eO++]=H-(H-ee)*ew|0,eo[eO++]=Q-(Q-et)*ew|0,eo[eO++]=K-(K-er)*ew|0,eo[eO++]=255}}function drawFigure(u,A,T){var E,I,D=A.coords,L=A.colors;switch(A.type){case"lattice":var W=A.verticesPerRow,N=Math.floor(D.length/W)-1,U=W-1;for(E=0;E=E?I=E:T=I/u,{scale:T,size:I}}},{key:"clipBbox",value:function(u,A,T,E,I){var D=E-A,L=I-T;u.ctx.rect(A,T,D,L),u.clip(),u.endPath()}},{key:"setFillAndStrokeStyleToContext",value:function(u,A,T){var I=u.ctx,D=u.current;switch(A){case U.COLORED:var L=this.ctx;I.fillStyle=L.fillStyle,I.strokeStyle=L.strokeStyle,D.fillColor=L.fillStyle,D.strokeColor=L.strokeStyle;break;case U.UNCOLORED:var W=E.Util.makeHexColor(T[0],T[1],T[2]);I.fillStyle=W,I.strokeStyle=W,D.fillColor=W,D.strokeColor=W;break;default:throw new E.FormatError("Unsupported paint type: ".concat(A))}}},{key:"getPattern",value:function(u,A,T,D){var L=T;D!==I.SHADING&&(L=E.Util.transform(L,A.baseTransform),this.matrix&&(L=E.Util.transform(L,this.matrix)));var W=this.createPatternCanvas(A),N=new DOMMatrix(L);N=(N=N.translate(W.offsetX,W.offsetY)).scale(1/W.scaleX,1/W.scaleY);var U=u.createPattern(W.canvas,"repeat");try{U.setTransform(N)}catch(u){(0,E.warn)('TilingPattern.getPattern: "'.concat(null==u?void 0:u.message,'".'))}return U}}],[{key:"MAX_PATTERN_SIZE",get:function(){return(0,E.shadow)(this,"MAX_PATTERN_SIZE",3e3)}}]),TilingPattern}();A.TilingPattern=H},(u,A)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.GlobalWorkerOptions=void 0;var T=Object.create(null);A.GlobalWorkerOptions=T,T.workerPort=void 0===T.workerPort?null:T.workerPort,T.workerSrc=void 0===T.workerSrc?"":T.workerSrc},(u,A,T)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.MessageHandler=void 0;var E=_interopRequireDefault(T(2)),I=T(4);function _interopRequireDefault(u){return u&&u.__esModule?u:{default:u}}function asyncGeneratorStep(u,A,T,E,I,D,L){try{var W=u[D](L),N=W.value}catch(u){T(u);return}W.done?A(N):Promise.resolve(N).then(E,I)}function _asyncToGenerator(u){return function(){var A=this,T=arguments;return new Promise(function(E,I){var D=u.apply(A,T);function _next(u){asyncGeneratorStep(D,E,I,_next,_throw,"next",u)}function _throw(u){asyncGeneratorStep(D,E,I,_next,_throw,"throw",u)}_next(void 0)})}}function _classCallCheck(u,A){if(!(u instanceof A))throw TypeError("Cannot call a class as a function")}function _defineProperties(u,A){for(var T=0;T1&&void 0!==arguments[1]?arguments[1]:1,N=arguments.length>2?arguments[2]:void 0;if(!this.isCancelled){var U=this.desiredSize;this.desiredSize-=W,U>0&&this.desiredSize<=0&&(this.sinkCapability=(0,I.createPromiseCapability)(),this.ready=this.sinkCapability.promise),D.postMessage({sourceName:T,targetName:E,stream:L.ENQUEUE,streamId:A,chunk:u},N)}},close:function(){this.isCancelled||(this.isCancelled=!0,D.postMessage({sourceName:T,targetName:E,stream:L.CLOSE,streamId:A}),delete W.streamSinks[A])},error:function(u){(0,I.assert)(u instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,D.postMessage({sourceName:T,targetName:E,stream:L.ERROR,streamId:A,reason:wrapReason(u)}))},sinkCapability:(0,I.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:u.desiredSize,ready:null};U.sinkCapability.resolve(),U.ready=U.sinkCapability.promise,this.streamSinks[A]=U,new Promise(function(A){A(N(u.data,U))}).then(function(){D.postMessage({sourceName:T,targetName:E,stream:L.START_COMPLETE,streamId:A,success:!0})},function(u){D.postMessage({sourceName:T,targetName:E,stream:L.START_COMPLETE,streamId:A,reason:wrapReason(u)})})}},{key:"_processStreamMessage",value:function(u){var A=u.streamId,T=this.sourceName,E=u.sourceName,D=this.comObj,W=this.streamControllers[A],N=this.streamSinks[A];switch(u.stream){case L.START_COMPLETE:u.success?W.startCall.resolve():W.startCall.reject(wrapReason(u.reason));break;case L.PULL_COMPLETE:u.success?W.pullCall.resolve():W.pullCall.reject(wrapReason(u.reason));break;case L.PULL:if(!N){D.postMessage({sourceName:T,targetName:E,stream:L.PULL_COMPLETE,streamId:A,success:!0});break}N.desiredSize<=0&&u.desiredSize>0&&N.sinkCapability.resolve(),N.desiredSize=u.desiredSize,new Promise(function(u){u(N.onPull&&N.onPull())}).then(function(){D.postMessage({sourceName:T,targetName:E,stream:L.PULL_COMPLETE,streamId:A,success:!0})},function(u){D.postMessage({sourceName:T,targetName:E,stream:L.PULL_COMPLETE,streamId:A,reason:wrapReason(u)})});break;case L.ENQUEUE:if((0,I.assert)(W,"enqueue should have stream controller"),W.isClosed)break;W.controller.enqueue(u.chunk);break;case L.CLOSE:if((0,I.assert)(W,"close should have stream controller"),W.isClosed)break;W.isClosed=!0,W.controller.close(),this._deleteStreamController(W,A);break;case L.ERROR:(0,I.assert)(W,"error should have stream controller"),W.controller.error(wrapReason(u.reason)),this._deleteStreamController(W,A);break;case L.CANCEL_COMPLETE:u.success?W.cancelCall.resolve():W.cancelCall.reject(wrapReason(u.reason)),this._deleteStreamController(W,A);break;case L.CANCEL:if(!N)break;new Promise(function(A){A(N.onCancel&&N.onCancel(wrapReason(u.reason)))}).then(function(){D.postMessage({sourceName:T,targetName:E,stream:L.CANCEL_COMPLETE,streamId:A,success:!0})},function(u){D.postMessage({sourceName:T,targetName:E,stream:L.CANCEL_COMPLETE,streamId:A,reason:wrapReason(u)})}),N.sinkCapability.reject(wrapReason(u.reason)),N.isCancelled=!0,delete this.streamSinks[A];break;default:throw Error("Unexpected stream case")}}},{key:"_deleteStreamController",value:function(){var u=_asyncToGenerator(E.default.mark(function _callee(u,A){return E.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.next=2,Promise.allSettled([u.startCall&&u.startCall.promise,u.pullCall&&u.pullCall.promise,u.cancelCall&&u.cancelCall.promise]);case 2:delete this.streamControllers[A];case 3:case"end":return T.stop()}},_callee,this)}));return function(A,T){return u.apply(this,arguments)}}()},{key:"destroy",value:function(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}]),MessageHandler}();A.MessageHandler=W},(u,A,T)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.Metadata=void 0;var E=T(4);function _classCallCheck(u,A){if(!(u instanceof A))throw TypeError("Cannot call a class as a function")}function _defineProperties(u,A){for(var T=0;T{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.OptionalContentConfig=void 0;var E=T(4);function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T1)||void 0===arguments[1]||arguments[1];if(!this._groups.has(u)){(0,E.warn)("Optional content group not found: ".concat(u));return}this._groups.get(u).visible=!!A}},{key:"getOrder",value:function(){return this._groups.size?this._order?this._order.slice():Array.from(this._groups.keys()):null}},{key:"getGroups",value:function(){return this._groups.size>0?(0,E.objectFromMap)(this._groups):null}},{key:"getGroup",value:function(u){return this._groups.get(u)||null}}]),OptionalContentConfig}();A.OptionalContentConfig=I},(u,A,T)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.PDFDataTransportStream=void 0;var E=_interopRequireDefault(T(2)),I=T(4),D=T(1);function _interopRequireDefault(u){return u&&u.__esModule?u:{default:u}}function asyncGeneratorStep(u,A,T,E,I,D,L){try{var W=u[D](L),N=W.value}catch(u){T(u);return}W.done?A(N):Promise.resolve(N).then(E,I)}function _asyncToGenerator(u){return function(){var A=this,T=arguments;return new Promise(function(E,I){var D=u.apply(A,T);function _next(u){asyncGeneratorStep(D,E,I,_next,_throw,"next",u)}function _throw(u){asyncGeneratorStep(D,E,I,_next,_throw,"throw",u)}_next(void 0)})}}function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T0){var D=new Uint8Array(E).buffer;this._queuedChunks.push(D)}this._pdfDataRangeTransport=A,this._isStreamingSupported=!u.disableStream,this._isRangeSupported=!u.disableRange,this._contentLength=u.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(function(u,A){T._onReceiveData({begin:u,chunk:A})}),this._pdfDataRangeTransport.addProgressListener(function(u,A){T._onProgress({loaded:u,total:A})}),this._pdfDataRangeTransport.addProgressiveReadListener(function(u){T._onReceiveData({chunk:u})}),this._pdfDataRangeTransport.addProgressiveDoneListener(function(){T._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}return _createClass(PDFDataTransportStream,[{key:"_onReceiveData",value:function(u){var A=new Uint8Array(u.chunk).buffer;if(void 0===u.begin)this._fullRequestReader?this._fullRequestReader._enqueue(A):this._queuedChunks.push(A);else{var T=this._rangeReaders.some(function(T){return T._begin===u.begin&&(T._enqueue(A),!0)});(0,I.assert)(T,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}},{key:"_progressiveDataLength",get:function(){var u,A;return null!==(u=null===(A=this._fullRequestReader)||void 0===A?void 0:A._loaded)&&void 0!==u?u:0}},{key:"_onProgress",value:function(u){if(void 0===u.total){var A=this._rangeReaders[0];null!=A&&A.onProgress&&A.onProgress({loaded:u.loaded})}else{var T=this._fullRequestReader;null!=T&&T.onProgress&&T.onProgress({loaded:u.loaded,total:u.total})}}},{key:"_onProgressiveDone",value:function(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}},{key:"_removeRangeReader",value:function(u){var A=this._rangeReaders.indexOf(u);A>=0&&this._rangeReaders.splice(A,1)}},{key:"getFullReader",value:function(){(0,I.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var u=this._queuedChunks;return this._queuedChunks=null,new W(this,u,this._progressiveDone,this._contentDispositionFilename)}},{key:"getRangeReader",value:function(u,A){if(A<=this._progressiveDataLength)return null;var T=new N(this,u,A);return this._pdfDataRangeTransport.requestDataRange(u,A),this._rangeReaders.push(T),T}},{key:"cancelAllRequests",value:function(u){this._fullRequestReader&&this._fullRequestReader.cancel(u);var A,T=_createForOfIteratorHelper(this._rangeReaders.slice(0));try{for(T.s();!(A=T.n()).done;)A.value.cancel(u)}catch(u){T.e(u)}finally{T.f()}this._pdfDataRangeTransport.abort()}}]),PDFDataTransportStream}();A.PDFDataTransportStream=L;var W=function(){function PDFDataTransportStreamReader(u,A){var T=arguments.length>2&&void 0!==arguments[2]&&arguments[2],E=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;_classCallCheck(this,PDFDataTransportStreamReader),this._stream=u,this._done=T||!1,this._filename=(0,D.isPdfFile)(E)?E:null,this._queuedChunks=A||[],this._loaded=0;var I,L=_createForOfIteratorHelper(this._queuedChunks);try{for(L.s();!(I=L.n()).done;){var W=I.value;this._loaded+=W.byteLength}}catch(u){L.e(u)}finally{L.f()}this._requests=[],this._headersReady=Promise.resolve(),u._fullRequestReader=this,this.onProgress=null}return _createClass(PDFDataTransportStreamReader,[{key:"_enqueue",value:function(u){this._done||(this._requests.length>0?this._requests.shift().resolve({value:u,done:!1}):this._queuedChunks.push(u),this._loaded+=u.byteLength)}},{key:"headersReady",get:function(){return this._headersReady}},{key:"filename",get:function(){return this._filename}},{key:"isRangeSupported",get:function(){return this._stream._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._stream._isStreamingSupported}},{key:"contentLength",get:function(){return this._stream._contentLength}},{key:"read",value:function(){var u=_asyncToGenerator(E.default.mark(function _callee(){var u,A;return E.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(!(this._queuedChunks.length>0)){T.next=3;break}return u=this._queuedChunks.shift(),T.abrupt("return",{value:u,done:!1});case 3:if(!this._done){T.next=5;break}return T.abrupt("return",{value:void 0,done:!0});case 5:return A=(0,I.createPromiseCapability)(),this._requests.push(A),T.abrupt("return",A.promise);case 8:case"end":return T.stop()}},_callee,this)}));return function(){return u.apply(this,arguments)}}()},{key:"cancel",value:function(u){this._done=!0;var A,T=_createForOfIteratorHelper(this._requests);try{for(T.s();!(A=T.n()).done;)A.value.resolve({value:void 0,done:!0})}catch(u){T.e(u)}finally{T.f()}this._requests.length=0}},{key:"progressiveDone",value:function(){this._done||(this._done=!0)}}]),PDFDataTransportStreamReader}(),N=function(){function PDFDataTransportStreamRangeReader(u,A,T){_classCallCheck(this,PDFDataTransportStreamRangeReader),this._stream=u,this._begin=A,this._end=T,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}return _createClass(PDFDataTransportStreamRangeReader,[{key:"_enqueue",value:function(u){if(!this._done){if(0===this._requests.length)this._queuedChunk=u;else{this._requests.shift().resolve({value:u,done:!1});var A,T=_createForOfIteratorHelper(this._requests);try{for(T.s();!(A=T.n()).done;)A.value.resolve({value:void 0,done:!0})}catch(u){T.e(u)}finally{T.f()}this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}},{key:"isStreamingSupported",get:function(){return!1}},{key:"read",value:function(){var u=_asyncToGenerator(E.default.mark(function _callee2(){var u,A;return E.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(!this._queuedChunk){T.next=4;break}return u=this._queuedChunk,this._queuedChunk=null,T.abrupt("return",{value:u,done:!1});case 4:if(!this._done){T.next=6;break}return T.abrupt("return",{value:void 0,done:!0});case 6:return A=(0,I.createPromiseCapability)(),this._requests.push(A),T.abrupt("return",A.promise);case 9:case"end":return T.stop()}},_callee2,this)}));return function(){return u.apply(this,arguments)}}()},{key:"cancel",value:function(u){this._done=!0;var A,T=_createForOfIteratorHelper(this._requests);try{for(T.s();!(A=T.n()).done;)A.value.resolve({value:void 0,done:!0})}catch(u){T.e(u)}finally{T.f()}this._requests.length=0,this._stream._removeRangeReader(this)}}]),PDFDataTransportStreamRangeReader}()},(u,A)=>{"use strict";function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T{"use strict";function _typeof(u){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(u)}Object.defineProperty(A,"__esModule",{value:!0}),A.AnnotationLayer=void 0;var E=T(4),I=T(1),D=T(139),L=T(149),W=T(150);function _classStaticPrivateMethodGet(u,A,T){return _classCheckPrivateStaticAccess(u,A),T}function _classCheckPrivateStaticAccess(u,A){if(u!==A)throw TypeError("Private static access of wrong provenance")}function _get(u,A,T){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(u,A,T){var E=_superPropBase(u,A);if(E){var I=Object.getOwnPropertyDescriptor(E,A);return I.get?I.get.call(T):I.value}})(u,A,T||u)}function _superPropBase(u,A){for(;!Object.prototype.hasOwnProperty.call(u,A)&&null!==(u=_getPrototypeOf(u)););return u}function _defineProperty(u,A,T){return A in u?Object.defineProperty(u,A,{value:T,enumerable:!0,configurable:!0,writable:!0}):u[A]=T,u}function _toConsumableArray(u){return _arrayWithoutHoles(u)||_iterableToArray(u)||_unsupportedIterableToArray(u)||_nonIterableSpread()}function _nonIterableSpread(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(u){if("undefined"!=typeof Symbol&&null!=u[Symbol.iterator]||null!=u["@@iterator"])return Array.from(u)}function _arrayWithoutHoles(u){if(Array.isArray(u))return _arrayLikeToArray(u)}function _inherits(u,A){if("function"!=typeof A&&null!==A)throw TypeError("Super expression must either be null or a function");u.prototype=Object.create(A&&A.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),A&&_setPrototypeOf(u,A)}function _setPrototypeOf(u,A){return(_setPrototypeOf=Object.setPrototypeOf||function(u,A){return u.__proto__=A,u})(u,A)}function _createSuper(u){var A=_isNativeReflectConstruct();return function(){var T,E=_getPrototypeOf(u);if(A){var I=_getPrototypeOf(this).constructor;T=Reflect.construct(E,arguments,I)}else T=E.apply(this,arguments);return _possibleConstructorReturn(this,T)}}function _possibleConstructorReturn(u,A){if(A&&("object"===_typeof(A)||"function"==typeof A))return A;if(void 0!==A)throw TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(u)}function _assertThisInitialized(u){if(void 0===u)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(u){return!1}}function _getPrototypeOf(u){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)})(u)}function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _slicedToArray(u,A){return _arrayWithHoles(u)||_iterableToArrayLimit(u,A)||_unsupportedIterableToArray(u,A)||_nonIterableRest()}function _nonIterableRest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T1&&void 0!==arguments[1]?arguments[1]:{},T=A.isRenderable,E=void 0!==T&&T,I=A.ignoreBorder,D=void 0!==I&&I,L=A.createQuadrilaterals,W=void 0!==L&&L;_classCallCheck(this,AnnotationElement),this.isRenderable=E,this.data=u.data,this.layer=u.layer,this.page=u.page,this.viewport=u.viewport,this.linkService=u.linkService,this.downloadManager=u.downloadManager,this.imageResourcesPath=u.imageResourcesPath,this.renderForms=u.renderForms,this.svgFactory=u.svgFactory,this.annotationStorage=u.annotationStorage,this.enableScripting=u.enableScripting,this.hasJSActions=u.hasJSActions,this._fieldObjects=u.fieldObjects,this._mouseState=u.mouseState,E&&(this.container=this._createContainer(D)),W&&(this.quadrilaterals=this._createQuadrilaterals(D))}return _createClass(AnnotationElement,[{key:"_createContainer",value:function(){var u=arguments.length>0&&void 0!==arguments[0]&&arguments[0],A=this.data,T=this.page,I=this.viewport,D=document.createElement("section"),L=A.rect[2]-A.rect[0],W=A.rect[3]-A.rect[1];D.setAttribute("data-annotation-id",A.id);var N=E.Util.normalizeRect([A.rect[0],T.view[3]-A.rect[1]+T.view[1],A.rect[2],T.view[3]-A.rect[3]+T.view[1]]);if(A.hasOwnCanvas){var U=I.transform.slice(),H=_slicedToArray(E.Util.singularValueDecompose2dScale(U),2),Q=H[0],K=H[1];L=Math.ceil(L*Q),W=Math.ceil(W*K),N[0]*=Q,N[1]*=K;for(var J=0;J<4;J++)U[J]=Math.sign(U[J]);D.style.transform="matrix(".concat(U.join(","),")")}else D.style.transform="matrix(".concat(I.transform.join(","),")");if(D.style.transformOrigin="".concat(-N[0],"px ").concat(-N[1],"px"),!u&&A.borderStyle.width>0){D.style.borderWidth="".concat(A.borderStyle.width,"px"),A.borderStyle.style!==E.AnnotationBorderStyleType.UNDERLINE&&(L-=2*A.borderStyle.width,W-=2*A.borderStyle.width);var ee=A.borderStyle.horizontalCornerRadius,et=A.borderStyle.verticalCornerRadius;if(ee>0||et>0){var er="".concat(ee,"px / ").concat(et,"px");D.style.borderRadius=er}switch(A.borderStyle.style){case E.AnnotationBorderStyleType.SOLID:D.style.borderStyle="solid";break;case E.AnnotationBorderStyleType.DASHED:D.style.borderStyle="dashed";break;case E.AnnotationBorderStyleType.BEVELED:(0,E.warn)("Unimplemented border style: beveled");break;case E.AnnotationBorderStyleType.INSET:(0,E.warn)("Unimplemented border style: inset");break;case E.AnnotationBorderStyleType.UNDERLINE:D.style.borderBottomStyle="solid"}A.borderColor||A.color?D.style.borderColor=E.Util.makeHexColor(0|A.color[0],0|A.color[1],0|A.color[2]):D.style.borderWidth=0}return D.style.left="".concat(N[0],"px"),D.style.top="".concat(N[1],"px"),A.hasOwnCanvas?D.style.width=D.style.height="auto":(D.style.width="".concat(L,"px"),D.style.height="".concat(W,"px")),D}},{key:"_createQuadrilaterals",value:function(){var u=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;var A,T=[],E=this.data.rect,I=_createForOfIteratorHelper(this.data.quadPoints);try{for(I.s();!(A=I.n()).done;){var D=A.value;this.data.rect=[D[2].x,D[2].y,D[1].x,D[1].y],T.push(this._createContainer(u))}}catch(u){I.e(u)}finally{I.f()}return this.data.rect=E,T}},{key:"_createPopup",value:function(u,A){var T=this.container;this.quadrilaterals&&(u=u||this.quadrilaterals,T=this.quadrilaterals[0]),u||((u=document.createElement("div")).style.height=T.style.height,u.style.width=T.style.width,T.appendChild(u));var E=new es({container:T,trigger:u,color:A.color,titleObj:A.titleObj,modificationDate:A.modificationDate,contentsObj:A.contentsObj,richText:A.richText,hideWrapper:!0}).render();E.style.left=T.style.width,T.appendChild(E)}},{key:"_renderQuadrilaterals",value:function(u){var A,T=_createForOfIteratorHelper(this.quadrilaterals);try{for(T.s();!(A=T.n()).done;)A.value.className=u}catch(u){T.e(u)}finally{T.f()}return this.quadrilaterals}},{key:"render",value:function(){(0,E.unreachable)("Abstract method `AnnotationElement.render` called")}},{key:"_getElementsByName",value:function(u){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,T=[];if(this._fieldObjects){var I=this._fieldObjects[u];if(I){var D,L=_createForOfIteratorHelper(I);try{for(L.s();!(D=L.n()).done;){var W=D.value,N=W.page,H=W.id,Q=W.exportValues;if(-1!==N&&H!==A){var K="string"==typeof Q?Q:null,J=document.getElementById(H);if(J&&!U.has(J)){(0,E.warn)("_getElementsByName - element not allowed: ".concat(H));continue}T.push({id:H,exportValue:K,domElement:J})}}}catch(u){L.e(u)}finally{L.f()}}return T}var ee,et=_createForOfIteratorHelper(document.getElementsByName(u));try{for(et.s();!(ee=et.n()).done;){var er=ee.value,en=er.id,ea=er.exportValue;en!==A&&U.has(er)&&T.push({id:en,exportValue:ea,domElement:er})}}catch(u){et.e(u)}finally{et.f()}return T}}],[{key:"platform",get:function(){var u="undefined"!=typeof navigator?navigator.platform:"";return(0,E.shadow)(this,"platform",{isWin:u.includes("Win"),isMac:u.includes("Mac")})}}]),AnnotationElement}(),K=function(u){_inherits(LinkAnnotationElement,u);var A=_createSuper(LinkAnnotationElement);function LinkAnnotationElement(u){var T=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;_classCallCheck(this,LinkAnnotationElement);var E=!!(u.data.url||u.data.dest||u.data.action||u.data.isTooltipOnly||u.data.resetForm||u.data.actions&&(u.data.actions.Action||u.data.actions["Mouse Up"]||u.data.actions["Mouse Down"]));return A.call(this,u,{isRenderable:E,ignoreBorder:!!(null!=T&&T.ignoreBorder),createQuadrilaterals:!0})}return _createClass(LinkAnnotationElement,[{key:"render",value:function(){var u,A=this.data,T=this.linkService,I=document.createElement("a");if(A.url)T.addLinkAttributes||(0,E.warn)("LinkAnnotationElement.render - missing `addLinkAttributes`-method on the `linkService`-instance."),null===(u=T.addLinkAttributes)||void 0===u||u.call(T,I,A.url,A.newWindow);else if(A.action)this._bindNamedAction(I,A.action);else if(A.dest)this._bindLink(I,A.dest);else{var D=!1;A.actions&&(A.actions.Action||A.actions["Mouse Up"]||A.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(D=!0,this._bindJSAction(I,A)),A.resetForm?this._bindResetFormAction(I,A.resetForm):D||this._bindLink(I,"")}return this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map(function(u,A){var T=0===A?I:I.cloneNode();return u.appendChild(T),u}):(this.container.className="linkAnnotation",this.container.appendChild(I),this.container)}},{key:"_bindLink",value:function(u,A){var T=this;u.href=this.linkService.getDestinationHash(A),u.onclick=function(){return A&&T.linkService.goToDestination(A),!1},(A||""===A)&&(u.className="internalLink")}},{key:"_bindNamedAction",value:function(u,A){var T=this;u.href=this.linkService.getAnchorUrl(""),u.onclick=function(){return T.linkService.executeNamedAction(A),!1},u.className="internalLink"}},{key:"_bindJSAction",value:function(u,A){var T=this;u.href=this.linkService.getAnchorUrl("");for(var E=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]),_loop=function(){var L=D[I],W=E.get(L);if(!W)return"continue";u[W]=function(){var u;return null===(u=T.linkService.eventBus)||void 0===u||u.dispatch("dispatcheventinsandbox",{source:T,detail:{id:A.id,name:L}}),!1}},I=0,D=Object.keys(A.actions);I=0&&E0?this.data.fieldValue[0]:void 0});var E=this.data.defaultAppearanceData.fontSize;E||(E=9);var I="calc(".concat(E,"px * var(--zoom-factor))"),D=document.createElement("select");U.add(D),D.disabled=this.data.readOnly,D.name=this.data.fieldName,D.setAttribute("id",T),D.tabIndex=N,D.style.fontSize="".concat(E,"px"),!this.data.combo&&(D.size=this.data.options.length,this.data.multiSelect&&(D.multiple=!0)),D.addEventListener("resetform",function(A){var T,E=u.data.defaultFieldValue,I=_createForOfIteratorHelper(D.options);try{for(I.s();!(T=I.n()).done;){var L=T.value;L.selected=L.value===E}}catch(u){I.e(u)}finally{I.f()}});var L,W=_createForOfIteratorHelper(this.data.options);try{for(W.s();!(L=W.n()).done;){var H=L.value,Q=document.createElement("option");Q.textContent=H.displayValue,Q.value=H.exportValue,this.data.combo&&(Q.style.fontSize=I),this.data.fieldValue.includes(H.exportValue)&&Q.setAttribute("selected",!0),D.appendChild(Q)}}catch(u){W.e(u)}finally{W.f()}var getValue=function(u,A){var T=A?"value":"textContent",E=u.target.options;return u.target.multiple?Array.prototype.filter.call(E,function(u){return u.selected}).map(function(u){return u[T]}):-1===E.selectedIndex?null:E[E.selectedIndex][T]},getItems=function(u){var A=u.target.options;return Array.prototype.map.call(A,function(u){return{displayValue:u.textContent,exportValue:u.value}})};return this.enableScripting&&this.hasJSActions?(D.addEventListener("updatefromsandbox",function(E){var I={value:function(u){var E,I=u.detail.value,L=new Set(Array.isArray(I)?I:[I]),W=_createForOfIteratorHelper(D.options);try{for(W.s();!(E=W.n()).done;){var N=E.value;N.selected=L.has(N.value)}}catch(u){W.e(u)}finally{W.f()}A.setValue(T,{value:getValue(u,!0)})},multipleSelection:function(u){D.multiple=!0},remove:function(u){var E=D.options,I=u.detail.remove;E[I].selected=!1,D.remove(I),E.length>0&&-1===Array.prototype.findIndex.call(E,function(u){return u.selected})&&(E[0].selected=!0),A.setValue(T,{value:getValue(u,!0),items:getItems(u)})},clear:function(u){for(;0!==D.length;)D.remove(0);A.setValue(T,{value:null,items:[]})},insert:function(u){var E=u.detail.insert,I=E.index,L=E.displayValue,W=E.exportValue,N=document.createElement("option");N.textContent=L,N.value=W,D.insertBefore(N,D.children[I]),A.setValue(T,{value:getValue(u,!0),items:getItems(u)})},items:function(u){for(var E=u.detail.items;0!==D.length;)D.remove(0);var I,L=_createForOfIteratorHelper(E);try{for(L.s();!(I=L.n()).done;){var W=I.value,N=W.displayValue,U=W.exportValue,H=document.createElement("option");H.textContent=N,H.value=U,D.appendChild(H)}}catch(u){L.e(u)}finally{L.f()}D.options.length>0&&(D.options[0].selected=!0),A.setValue(T,{value:getValue(u,!0),items:getItems(u)})},indices:function(u){var E,I=new Set(u.detail.indices),D=_createForOfIteratorHelper(u.target.options);try{for(D.s();!(E=D.n()).done;){var L=E.value;L.selected=I.has(L.index)}}catch(u){D.e(u)}finally{D.f()}A.setValue(T,{value:getValue(u,!0)})},editable:function(u){u.target.disabled=!u.detail.editable}};u._dispatchEventFromSandbox(I,E)}),D.addEventListener("input",function(E){var I,D=getValue(E,!0),L=getValue(E,!1);A.setValue(T,{value:D}),null===(I=u.linkService.eventBus)||void 0===I||I.dispatch("dispatcheventinsandbox",{source:u,detail:{id:T,name:"Keystroke",value:L,changeEx:D,willCommit:!0,commitKey:1,keyDown:!1}})}),this._setEventListeners(D,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],function(u){return u.target.checked})):D.addEventListener("input",function(u){A.setValue(T,{value:getValue(u)})}),this._setBackgroundColor(D),this.container.appendChild(D),this.container}}]),ChoiceWidgetAnnotationElement}(ee),ei=function(u){_inherits(PopupAnnotationElement,u);var A=_createSuper(PopupAnnotationElement);function PopupAnnotationElement(u){_classCallCheck(this,PopupAnnotationElement);var T,E,I,D=!!(null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return A.call(this,u,{isRenderable:D})}return _createClass(PopupAnnotationElement,[{key:"render",value:function(){var u=["Line","Square","Circle","PolyLine","Polygon","Ink"];if(this.container.className="popupAnnotation",u.includes(this.data.parentType))return this.container;var A='[data-annotation-id="'.concat(this.data.parentId,'"]'),T=this.layer.querySelectorAll(A);if(0===T.length)return this.container;var I=new es({container:this.container,trigger:Array.from(T),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),D=this.page,L=E.Util.normalizeRect([this.data.parentRect[0],D.view[3]-this.data.parentRect[1]+D.view[1],this.data.parentRect[2],D.view[3]-this.data.parentRect[3]+D.view[1]]),W=L[0]+this.data.parentRect[2]-this.data.parentRect[0],N=L[1];return this.container.style.transformOrigin="".concat(-W,"px ").concat(-N,"px"),this.container.style.left="".concat(W,"px"),this.container.style.top="".concat(N,"px"),this.container.appendChild(I.render()),this.container}}]),PopupAnnotationElement}(Q),es=function(){function PopupElement(u){_classCallCheck(this,PopupElement),this.container=u.container,this.trigger=u.trigger,this.color=u.color,this.titleObj=u.titleObj,this.modificationDate=u.modificationDate,this.contentsObj=u.contentsObj,this.richText=u.richText,this.hideWrapper=u.hideWrapper||!1,this.pinned=!1}return _createClass(PopupElement,[{key:"render",value:function(){var u=.7,A=document.createElement("div");A.className="popupWrapper",this.hideElement=this.hideWrapper?A:this.container,this.hideElement.hidden=!0;var T=document.createElement("div");T.className="popup";var D=this.color;if(D){var L=u*(255-D[0])+D[0],N=u*(255-D[1])+D[1],U=u*(255-D[2])+D[2];T.style.backgroundColor=E.Util.makeHexColor(0|L,0|N,0|U)}var H=document.createElement("h1");H.dir=this.titleObj.dir,H.textContent=this.titleObj.str,T.appendChild(H);var Q=I.PDFDateString.toDateObject(this.modificationDate);if(Q){var K=document.createElement("span");K.className="popupDate",K.textContent="{{date}}, {{time}}",K.dataset.l10nId="annotation_date_string",K.dataset.l10nArgs=JSON.stringify({date:Q.toLocaleDateString(),time:Q.toLocaleTimeString()}),T.appendChild(K)}if(null!==(ee=this.richText)&&void 0!==ee&&ee.str&&(!(null!==(et=this.contentsObj)&&void 0!==et&&et.str)||this.contentsObj.str===this.richText.str))W.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:T}),T.lastChild.className="richText popupContent";else{var J=this._formatContents(this.contentsObj);T.appendChild(J)}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);var ee,et,er,en=_createForOfIteratorHelper(this.trigger);try{for(en.s();!(er=en.n()).done;){var ea=er.value;ea.addEventListener("click",this._toggle.bind(this)),ea.addEventListener("mouseover",this._show.bind(this,!1)),ea.addEventListener("mouseout",this._hide.bind(this,!1))}}catch(u){en.e(u)}finally{en.f()}return T.addEventListener("click",this._hide.bind(this,!0)),A.appendChild(T),A}},{key:"_formatContents",value:function(u){var A=u.str,T=u.dir,E=document.createElement("p");E.className="popupContent",E.dir=T;for(var I=A.split(/(?:\r\n?|\n)/),D=0,L=I.length;D0&&void 0!==arguments[0]&&arguments[0];u&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex+=1)}},{key:"_hide",value:function(){var u=!(arguments.length>0)||void 0===arguments[0]||arguments[0];u&&(this.pinned=!1),this.hideElement.hidden||this.pinned||(this.hideElement.hidden=!0,this.container.style.zIndex-=1)}}]),PopupElement}(),eu=function(u){_inherits(FreeTextAnnotationElement,u);var A=_createSuper(FreeTextAnnotationElement);function FreeTextAnnotationElement(u){_classCallCheck(this,FreeTextAnnotationElement);var T,E,I,D=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return A.call(this,u,{isRenderable:D,ignoreBorder:!0})}return _createClass(FreeTextAnnotationElement,[{key:"render",value:function(){return this.container.className="freeTextAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}]),FreeTextAnnotationElement}(Q),ec=function(u){_inherits(LineAnnotationElement,u);var A=_createSuper(LineAnnotationElement);function LineAnnotationElement(u){_classCallCheck(this,LineAnnotationElement);var T,E,I,D=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return A.call(this,u,{isRenderable:D,ignoreBorder:!0})}return _createClass(LineAnnotationElement,[{key:"render",value:function(){this.container.className="lineAnnotation";var u=this.data,A=u.rect[2]-u.rect[0],T=u.rect[3]-u.rect[1],E=this.svgFactory.create(A,T),I=this.svgFactory.createElement("svg:line");return I.setAttribute("x1",u.rect[2]-u.lineCoordinates[0]),I.setAttribute("y1",u.rect[3]-u.lineCoordinates[1]),I.setAttribute("x2",u.rect[2]-u.lineCoordinates[2]),I.setAttribute("y2",u.rect[3]-u.lineCoordinates[3]),I.setAttribute("stroke-width",u.borderStyle.width||1),I.setAttribute("stroke","transparent"),I.setAttribute("fill","transparent"),E.appendChild(I),this.container.append(E),this._createPopup(I,u),this.container}}]),LineAnnotationElement}(Q),ed=function(u){_inherits(SquareAnnotationElement,u);var A=_createSuper(SquareAnnotationElement);function SquareAnnotationElement(u){_classCallCheck(this,SquareAnnotationElement);var T,E,I,D=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return A.call(this,u,{isRenderable:D,ignoreBorder:!0})}return _createClass(SquareAnnotationElement,[{key:"render",value:function(){this.container.className="squareAnnotation";var u=this.data,A=u.rect[2]-u.rect[0],T=u.rect[3]-u.rect[1],E=this.svgFactory.create(A,T),I=u.borderStyle.width,D=this.svgFactory.createElement("svg:rect");return D.setAttribute("x",I/2),D.setAttribute("y",I/2),D.setAttribute("width",A-I),D.setAttribute("height",T-I),D.setAttribute("stroke-width",I||1),D.setAttribute("stroke","transparent"),D.setAttribute("fill","transparent"),E.appendChild(D),this.container.append(E),this._createPopup(D,u),this.container}}]),SquareAnnotationElement}(Q),ef=function(u){_inherits(CircleAnnotationElement,u);var A=_createSuper(CircleAnnotationElement);function CircleAnnotationElement(u){_classCallCheck(this,CircleAnnotationElement);var T,E,I,D=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return A.call(this,u,{isRenderable:D,ignoreBorder:!0})}return _createClass(CircleAnnotationElement,[{key:"render",value:function(){this.container.className="circleAnnotation";var u=this.data,A=u.rect[2]-u.rect[0],T=u.rect[3]-u.rect[1],E=this.svgFactory.create(A,T),I=u.borderStyle.width,D=this.svgFactory.createElement("svg:ellipse");return D.setAttribute("cx",A/2),D.setAttribute("cy",T/2),D.setAttribute("rx",A/2-I/2),D.setAttribute("ry",T/2-I/2),D.setAttribute("stroke-width",I||1),D.setAttribute("stroke","transparent"),D.setAttribute("fill","transparent"),E.appendChild(D),this.container.append(E),this._createPopup(D,u),this.container}}]),CircleAnnotationElement}(Q),eh=function(u){_inherits(PolylineAnnotationElement,u);var A=_createSuper(PolylineAnnotationElement);function PolylineAnnotationElement(u){_classCallCheck(this,PolylineAnnotationElement);var T,E,I,D,L=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return(D=A.call(this,u,{isRenderable:L,ignoreBorder:!0})).containerClassName="polylineAnnotation",D.svgElementName="svg:polyline",D}return _createClass(PolylineAnnotationElement,[{key:"render",value:function(){this.container.className=this.containerClassName;var u,A=this.data,T=A.rect[2]-A.rect[0],E=A.rect[3]-A.rect[1],I=this.svgFactory.create(T,E),D=[],L=_createForOfIteratorHelper(A.vertices);try{for(L.s();!(u=L.n()).done;){var W=u.value,N=W.x-A.rect[0],U=A.rect[3]-W.y;D.push(N+","+U)}}catch(u){L.e(u)}finally{L.f()}D=D.join(" ");var H=this.svgFactory.createElement(this.svgElementName);return H.setAttribute("points",D),H.setAttribute("stroke-width",A.borderStyle.width||1),H.setAttribute("stroke","transparent"),H.setAttribute("fill","transparent"),I.appendChild(H),this.container.append(I),this._createPopup(H,A),this.container}}]),PolylineAnnotationElement}(Q),ep=function(u){_inherits(PolygonAnnotationElement,u);var A=_createSuper(PolygonAnnotationElement);function PolygonAnnotationElement(u){var T;return _classCallCheck(this,PolygonAnnotationElement),(T=A.call(this,u)).containerClassName="polygonAnnotation",T.svgElementName="svg:polygon",T}return PolygonAnnotationElement}(eh),em=function(u){_inherits(CaretAnnotationElement,u);var A=_createSuper(CaretAnnotationElement);function CaretAnnotationElement(u){_classCallCheck(this,CaretAnnotationElement);var T,E,I,D=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return A.call(this,u,{isRenderable:D,ignoreBorder:!0})}return _createClass(CaretAnnotationElement,[{key:"render",value:function(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}]),CaretAnnotationElement}(Q),ev=function(u){_inherits(InkAnnotationElement,u);var A=_createSuper(InkAnnotationElement);function InkAnnotationElement(u){_classCallCheck(this,InkAnnotationElement);var T,E,I,D,L=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return(D=A.call(this,u,{isRenderable:L,ignoreBorder:!0})).containerClassName="inkAnnotation",D.svgElementName="svg:polyline",D}return _createClass(InkAnnotationElement,[{key:"render",value:function(){this.container.className=this.containerClassName;var u,A=this.data,T=A.rect[2]-A.rect[0],E=A.rect[3]-A.rect[1],I=this.svgFactory.create(T,E),D=_createForOfIteratorHelper(A.inkLists);try{for(D.s();!(u=D.n()).done;){var L,W=u.value,N=[],U=_createForOfIteratorHelper(W);try{for(U.s();!(L=U.n()).done;){var H=L.value,Q=H.x-A.rect[0],K=A.rect[3]-H.y;N.push("".concat(Q,",").concat(K))}}catch(u){U.e(u)}finally{U.f()}N=N.join(" ");var J=this.svgFactory.createElement(this.svgElementName);J.setAttribute("points",N),J.setAttribute("stroke-width",A.borderStyle.width||1),J.setAttribute("stroke","transparent"),J.setAttribute("fill","transparent"),this._createPopup(J,A),I.appendChild(J)}}catch(u){D.e(u)}finally{D.f()}return this.container.append(I),this.container}}]),InkAnnotationElement}(Q),ey=function(u){_inherits(HighlightAnnotationElement,u);var A=_createSuper(HighlightAnnotationElement);function HighlightAnnotationElement(u){_classCallCheck(this,HighlightAnnotationElement);var T,E,I,D=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return A.call(this,u,{isRenderable:D,ignoreBorder:!0,createQuadrilaterals:!0})}return _createClass(HighlightAnnotationElement,[{key:"render",value:function(){return(this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals)?this._renderQuadrilaterals("highlightAnnotation"):(this.container.className="highlightAnnotation",this.container)}}]),HighlightAnnotationElement}(Q),eb=function(u){_inherits(UnderlineAnnotationElement,u);var A=_createSuper(UnderlineAnnotationElement);function UnderlineAnnotationElement(u){_classCallCheck(this,UnderlineAnnotationElement);var T,E,I,D=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return A.call(this,u,{isRenderable:D,ignoreBorder:!0,createQuadrilaterals:!0})}return _createClass(UnderlineAnnotationElement,[{key:"render",value:function(){return(this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals)?this._renderQuadrilaterals("underlineAnnotation"):(this.container.className="underlineAnnotation",this.container)}}]),UnderlineAnnotationElement}(Q),eg=function(u){_inherits(SquigglyAnnotationElement,u);var A=_createSuper(SquigglyAnnotationElement);function SquigglyAnnotationElement(u){_classCallCheck(this,SquigglyAnnotationElement);var T,E,I,D=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return A.call(this,u,{isRenderable:D,ignoreBorder:!0,createQuadrilaterals:!0})}return _createClass(SquigglyAnnotationElement,[{key:"render",value:function(){return(this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals)?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.className="squigglyAnnotation",this.container)}}]),SquigglyAnnotationElement}(Q),e_=function(u){_inherits(StrikeOutAnnotationElement,u);var A=_createSuper(StrikeOutAnnotationElement);function StrikeOutAnnotationElement(u){_classCallCheck(this,StrikeOutAnnotationElement);var T,E,I,D=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return A.call(this,u,{isRenderable:D,ignoreBorder:!0,createQuadrilaterals:!0})}return _createClass(StrikeOutAnnotationElement,[{key:"render",value:function(){return(this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals)?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.className="strikeoutAnnotation",this.container)}}]),StrikeOutAnnotationElement}(Q),eS=function(u){_inherits(StampAnnotationElement,u);var A=_createSuper(StampAnnotationElement);function StampAnnotationElement(u){_classCallCheck(this,StampAnnotationElement);var T,E,I,D=!!(u.data.hasPopup||null!==(T=u.data.titleObj)&&void 0!==T&&T.str||null!==(E=u.data.contentsObj)&&void 0!==E&&E.str||null!==(I=u.data.richText)&&void 0!==I&&I.str);return A.call(this,u,{isRenderable:D,ignoreBorder:!0})}return _createClass(StampAnnotationElement,[{key:"render",value:function(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}]),StampAnnotationElement}(Q),eA=function(u){_inherits(FileAttachmentAnnotationElement,u);var A=_createSuper(FileAttachmentAnnotationElement);function FileAttachmentAnnotationElement(u){_classCallCheck(this,FileAttachmentAnnotationElement);var T,D,L=(D=A.call(this,u,{isRenderable:!0})).data.file,W=L.filename,N=L.content;return D.filename=(0,I.getFilenameFromUrl)(W),D.content=N,null===(T=D.linkService.eventBus)||void 0===T||T.dispatch("fileattachmentannotation",{source:_assertThisInitialized(D),id:(0,E.stringToPDFString)(W),filename:W,content:N}),D}return _createClass(FileAttachmentAnnotationElement,[{key:"render",value:function(){this.container.className="fileAttachmentAnnotation";var u,A,T=document.createElement("div");return T.style.height=this.container.style.height,T.style.width=this.container.style.width,T.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&(null!==(u=this.data.titleObj)&&void 0!==u&&u.str||null!==(A=this.data.contentsObj)&&void 0!==A&&A.str||this.data.richText)&&this._createPopup(T,this.data),this.container.appendChild(T),this.container}},{key:"_download",value:function(){var u;null===(u=this.downloadManager)||void 0===u||u.openOrDownloadData(this.container,this.content,this.filename)}}]),FileAttachmentAnnotationElement}(Q),eC=function(){function AnnotationLayer(){_classCallCheck(this,AnnotationLayer)}return _createClass(AnnotationLayer,null,[{key:"render",value:function(u){var A,T=[],L=[],W=_createForOfIteratorHelper(u.annotations);try{for(W.s();!(A=W.n()).done;){var N=A.value;if(N){if(N.annotationType===E.AnnotationType.POPUP){L.push(N);continue}T.push(N)}}}catch(u){W.e(u)}finally{W.f()}L.length&&T.push.apply(T,L);for(var U=u.div,Q=0,K=T;Q{"use strict";function _slicedToArray(u,A){return _arrayWithHoles(u)||_iterableToArrayLimit(u,A)||_unsupportedIterableToArray(u,A)||_nonIterableRest()}function _nonIterableRest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.XfaLayer=void 0;var E=T(4),I=T(147);function _slicedToArray(u,A){return _arrayWithHoles(u)||_iterableToArrayLimit(u,A)||_unsupportedIterableToArray(u,A)||_nonIterableRest()}function _nonIterableRest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(u,A){var T,E,I=null==u?null:"undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(null!=I){var D=[],L=!0,W=!1;try{for(I=I.call(u);!(L=(T=I.next()).done)&&(D.push(T.value),!A||D.length!==A);L=!0);}catch(u){W=!0,E=u}finally{try{L||null==I.return||I.return()}finally{if(W)throw E}}return D}}function _arrayWithHoles(u){if(Array.isArray(u))return u}function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T0;){var Q,K=_slicedToArray(W[W.length-1],3),J=K[0],ee=K[1],et=K[2];if(ee+1===J.children.length){W.pop();continue}var er=J.children[++W[W.length-1][1]];if(null!==er){var en=er.name;if("#text"===en){var ea=document.createTextNode(er.value);H.push(ea),et.appendChild(ea);continue}var eo=void 0;if(eo=null!=er&&null!==(Q=er.attributes)&&void 0!==Q&&Q.xmlns?document.createElementNS(er.attributes.xmlns,en):document.createElement(en),et.appendChild(eo),er.attributes&&this.setAttributes({html:eo,element:er,storage:A,intent:D,linkService:T}),er.children&&er.children.length>0)W.push([er,-1,eo]);else if(er.value){var ei=document.createTextNode(er.value);I.XfaText.shouldBuildText(en)&&H.push(ei),eo.appendChild(ei)}}}var es,eu=_createForOfIteratorHelper(N.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"));try{for(eu.s();!(es=eu.n()).done;)es.value.setAttribute("readOnly",!0)}catch(u){eu.e(u)}finally{eu.f()}return{textDivs:H}}},{key:"update",value:function(u){var A="matrix(".concat(u.viewport.transform.join(","),")");u.div.style.transform=A,u.div.hidden=!1}}]),XfaLayer}();A.XfaLayer=D},(u,A,T)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.renderTextLayer=renderTextLayer;var E=T(4);function _classCallCheck(u,A){if(!(u instanceof A))throw TypeError("Cannot call a class as a function")}function _defineProperties(u,A){for(var T=0;T=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T=0;Q-=4)if(H[Q]>0){N=Math.ceil(Q/4/D);break}A.clearRect(0,0,D,D),A.strokeText("A",0,D),H=A.getImageData(0,0,D,D).data,I=0;for(var K=0,J=H.length;K0){I=D-Math.floor(K/4/D);break}if(A.restore(),I){var ee=I/(I+N);return W.set(u,ee),ee}return W.set(u,L),L}function appendText(u,A,T,I){var D=document.createElement("span"),L=u._enhanceTextSelection?{angle:0,canvasWidth:0,hasText:""!==A.str,hasEOL:A.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1}:{angle:0,canvasWidth:0,hasText:""!==A.str,hasEOL:A.hasEOL};u._textDivs.push(D);var W=E.Util.transform(u._viewport.transform,A.transform),U=Math.atan2(W[1],W[0]),H=T[A.fontName];H.vertical&&(U+=Math.PI/2);var Q=Math.hypot(W[2],W[3]),K=Q*getAscent(H.fontFamily,I);0===U?(er=W[4],en=W[5]-K):(er=W[4]+K*Math.sin(U),en=W[5]-K*Math.cos(U)),D.style.left="".concat(er,"px"),D.style.top="".concat(en,"px"),D.style.fontSize="".concat(Q,"px"),D.style.fontFamily=H.fontFamily,D.setAttribute("role","presentation"),D.textContent=A.str,D.dir=A.dir,u._fontInspectorEnabled&&(D.dataset.fontName=A.fontName),0!==U&&(L.angle=U*(180/Math.PI));var J=!1;if(A.str.length>1||u._enhanceTextSelection&&N.test(A.str))J=!0;else if(" "!==A.str&&A.transform[0]!==A.transform[3]){var ee=Math.abs(A.transform[0]),et=Math.abs(A.transform[3]);ee!==et&&Math.max(ee,et)/Math.min(ee,et)>1.5&&(J=!0)}if(J&&(H.vertical?L.canvasWidth=A.height*u._viewport.scale:L.canvasWidth=A.width*u._viewport.scale),u._textDivProperties.set(D,L),u._textContentStream&&u._layoutText(D),u._enhanceTextSelection&&L.hasText){var er,en,ea,eo,ei=1,es=0;0!==U&&(ei=Math.cos(U),es=Math.sin(U));var eu=(H.vertical?A.height:A.width)*u._viewport.scale,ec=Q;0!==U?(ea=[ei,es,-es,ei,er,en],eo=E.Util.getAxialAlignedBoundingBox([0,0,eu,ec],ea)):eo=[er,en,er+eu,en+ec],u._bounds.push({left:eo[0],top:eo[1],right:eo[2],bottom:eo[3],div:D,size:[eu,ec],m:ea})}}function render(u){if(!u._canceled){var A=u._textDivs,T=u._capability,E=A.length;if(E>I){u._renderingDone=!0,T.resolve();return}if(!u._textContentStream)for(var D=0;D0&&(E=E?Math.min(D,E):D)}return E}function expand(u){for(var A=u._bounds,T=u._viewport,I=expandBounds(T.width,T.height,A),D=0;D=0&&E[W].start>=D.y2;)W--;var N=void 0,U=void 0,H=void 0,Q=void 0,K=-1/0;for(H=L;H<=W;H++){U=(N=E[H]).boundary;var J=void 0;(J=U.x2>D.x1?U.index>D.index?U.x1New:D.x1:void 0===U.x2New?(U.x2+D.x1)/2:U.x2New)>K&&(K=J)}for(D.x1New=K,H=L;H<=W;H++)U=(N=E[H]).boundary,void 0===U.x2New?U.x2>D.x1?U.index>D.index&&(U.x2New=U.x2):U.x2New=K:U.x2New>K&&(U.x2New=Math.max(K,U.x2));var ee=[],et=null;for(H=L;H<=W;H++){var er=(U=(N=E[H]).boundary).x2>D.x2?U:D;et===er?ee[ee.length-1].end=N.end:(ee.push({start:N.start,end:N.end,boundary:er}),et=er)}for(E[L].start=0&&E[Q].start>=U.y1;Q--)en=E[Q].boundary===U;for(Q=W+1;!en&&Q0){var W=A.canvasWidth/L;this._enhanceTextSelection&&(A.scale=W),T="scaleX(".concat(W,")")}}if(0!==A.angle&&(T="rotate(".concat(A.angle,"deg) ").concat(T)),T.length>0&&(this._enhanceTextSelection&&(A.originalTransform=T),u.style.transform=T),A.hasText&&this._container.appendChild(u),A.hasEOL){var N=document.createElement("br");N.setAttribute("role","presentation"),this._container.appendChild(N)}}},{key:"_render",value:function(){var u=this,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,T=(0,E.createPromiseCapability)(),I=Object.create(null),L=this._document.createElement("canvas");if(L.height=L.width=D,L.mozOpaque=!0,this._layoutTextCtx=L.getContext("2d",{alpha:!1}),this._textContent){var W=this._textContent.items,N=this._textContent.styles;this._processItems(W,N),T.resolve()}else if(this._textContentStream){var pump=function pump(){u._reader.read().then(function(A){var E=A.value;if(A.done){T.resolve();return}Object.assign(I,E.styles),u._processItems(E.items,I),pump()},T.reject)};this._reader=this._textContentStream.getReader(),pump()}else throw Error('Neither "textContent" nor "textContentStream" parameters specified.');T.promise.then(function(){I=null,A?u._renderTimer=setTimeout(function(){render(u),u._renderTimer=null},A):render(u)},this._capability.reject)}},{key:"expandTextDivs",value:function(){var u=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._enhanceTextSelection&&this._renderingDone){null!==this._bounds&&(expand(this),this._bounds=null);for(var A=[],T=[],E=0,I=this._textDivs.length;E0?(T.push("".concat(L.paddingTop,"px")),A.push("translateY(".concat(-L.paddingTop,"px)"))):T.push(0),L.paddingRight>0?T.push("".concat(L.paddingRight/L.scale,"px")):T.push(0),L.paddingBottom>0?T.push("".concat(L.paddingBottom,"px")):T.push(0),L.paddingLeft>0?(T.push("".concat(L.paddingLeft/L.scale,"px")),A.push("translateX(".concat(-L.paddingLeft/L.scale,"px)"))):T.push(0),D.style.padding=T.join(" "),A.length&&(D.style.transform=A.join(" "))):(D.style.padding=null,D.style.transform=L.originalTransform))}}}}]),TextLayerRenderTask}();function renderTextLayer(u){var A=new U({textContent:u.textContent,textContentStream:u.textContentStream,container:u.container,viewport:u.viewport,textDivs:u.textDivs,textContentItemsStr:u.textContentItemsStr,enhanceTextSelection:u.enhanceTextSelection});return A._render(u.timeout),A}},(u,A,T)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.SVGGraphics=void 0;var E=T(4),I=T(1),D=T(6);function _toConsumableArray(u){return _arrayWithoutHoles(u)||_iterableToArray(u)||_unsupportedIterableToArray(u)||_nonIterableSpread()}function _nonIterableSpread(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(u){if("undefined"!=typeof Symbol&&null!=u[Symbol.iterator]||null!=u["@@iterator"])return Array.from(u)}function _arrayWithoutHoles(u){if(Array.isArray(u))return _arrayLikeToArray(u)}function _slicedToArray(u,A){return _arrayWithHoles(u)||_iterableToArrayLimit(u,A)||_unsupportedIterableToArray(u,A)||_nonIterableRest()}function _nonIterableRest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(u,A){var T,E,I=null==u?null:"undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(null!=I){var D=[],L=!0,W=!1;try{for(I=I.call(u);!(L=(T=I.next()).done)&&(D.push(T.value),!A||D.length!==A);L=!0);}catch(u){W=!0,E=u}finally{try{L||null==I.return||I.return()}finally{if(W)throw E}}return D}}function _arrayWithHoles(u){if(Array.isArray(u))return u}function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T>1&2147483647:L>>1&2147483647;T[I]=L}function crc32(u,A,E){for(var I=-1,D=A;D>>8^L}return -1^I}function writePngChunk(u,A,T,E){var I=E,D=A.length;T[I]=D>>24&255,T[I+1]=D>>16&255,T[I+2]=D>>8&255,T[I+3]=255&D,T[I+=4]=255&u.charCodeAt(0),T[I+1]=255&u.charCodeAt(1),T[I+2]=255&u.charCodeAt(2),T[I+3]=255&u.charCodeAt(3),I+=4,T.set(A,I);var L=crc32(T,E+4,I+=A.length);T[I]=L>>24&255,T[I+1]=L>>16&255,T[I+2]=L>>8&255,T[I+3]=255&L}function adler32(u,A,T){for(var E=1,I=0,D=A;D=8?u:Buffer.from(u);var A,T=__webpack_require__(87324).deflateSync(A,{level:9});return T instanceof Uint8Array?T:new Uint8Array(T)}catch(u){(0,E.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+u)}return deflateSyncUncompressed(u)}function deflateSyncUncompressed(u){var A=u.length,T=65535,E=Math.ceil(A/65535),I=new Uint8Array(2+A+5*E+4),D=0;I[D++]=120,I[D++]=156;for(var L=0;A>T;)I[D++]=0,I[D++]=255,I[D++]=255,I[D++]=0,I[D++]=0,I.set(u.subarray(L,L+T),D),D+=T,L+=T,A-=T;I[D++]=1,I[D++]=255&A,I[D++]=A>>8&255,I[D++]=255&~A,I[D++]=(65535&~A)>>8&255,I.set(u.subarray(L),D),D+=u.length-L;var W=adler32(u,0,u.length);return I[D++]=W>>24&255,I[D++]=W>>16&255,I[D++]=W>>8&255,I[D++]=255&W,I}function encode(T,I,D,L){var W,N,U,H=T.width,Q=T.height,K=T.data;switch(I){case E.ImageKind.GRAYSCALE_1BPP:N=0,W=1,U=H+7>>3;break;case E.ImageKind.RGB_24BPP:N=2,W=8,U=3*H;break;case E.ImageKind.RGBA_32BPP:N=6,W=8,U=4*H;break;default:throw Error("invalid format")}for(var J=new Uint8Array((1+U)*Q),ee=0,et=0,er=0;er>24&255,H>>16&255,H>>8&255,255&H,Q>>24&255,Q>>16&255,Q>>8&255,255&Q,W,N,0,0,0]),ei=deflateSync(J),es=u.length+3*A+eo.length+ei.length,eu=new Uint8Array(es),ec=0;return eu.set(u,ec),writePngChunk("IHDR",eo,eu,ec+=u.length),writePngChunk("IDATA",ei,eu,ec+=A+eo.length),ec+=A+ei.length,writePngChunk("IEND",new Uint8Array(0),eu,ec),(0,E.createObjectURL)(eu,"image/png",D)}return function(u,A,T){var I=void 0===u.kind?E.ImageKind.GRAYSCALE_1BPP:u.kind;return encode(u,I,A,T)}}(),K=function(){function SVGExtraState(){_classCallCheck(this,SVGExtraState),this.fontSizeScale=1,this.fontWeight=L.fontWeight,this.fontSize=0,this.textMatrix=E.IDENTITY_MATRIX,this.fontMatrix=E.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=E.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=L.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}return _createClass(SVGExtraState,[{key:"clone",value:function(){return Object.create(this)}},{key:"setCurrentPoint",value:function(u,A){this.x=u,this.y=A}}]),SVGExtraState}(),J=0,ee=0,et=0;A.SVGGraphics=SVGGraphics=function(){function SVGGraphics(u,A){var T=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var D in _classCallCheck(this,SVGGraphics),this.svgFactory=new I.DOMSVGFactory,this.current=new K,this.transformMatrix=E.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=u,this.objs=A,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!T,this._operatorIdMapping=[],E.OPS)this._operatorIdMapping[E.OPS[D]]=D}return _createClass(SVGGraphics,[{key:"save",value:function(){this.transformStack.push(this.transformMatrix);var u=this.current;this.extraStack.push(u),this.current=u.clone()}},{key:"restore",value:function(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}},{key:"group",value:function(u){this.save(),this.executeOpTree(u),this.restore()}},{key:"loadDependencies",value:function(u){for(var A=this,T=u.fnArray,I=u.argsArray,D=0,L=T.length;D0&&(this.current.lineWidth=u)}},{key:"setLineCap",value:function(u){this.current.lineCap=U[u]}},{key:"setLineJoin",value:function(u){this.current.lineJoin=H[u]}},{key:"setMiterLimit",value:function(u){this.current.miterLimit=u}},{key:"setStrokeAlpha",value:function(u){this.current.strokeAlpha=u}},{key:"setStrokeRGBColor",value:function(u,A,T){this.current.strokeColor=E.Util.makeHexColor(u,A,T)}},{key:"setFillAlpha",value:function(u){this.current.fillAlpha=u}},{key:"setFillRGBColor",value:function(u,A,T){this.current.fillColor=E.Util.makeHexColor(u,A,T),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}},{key:"setStrokeColorN",value:function(u){this.current.strokeColor=this._makeColorN_Pattern(u)}},{key:"setFillColorN",value:function(u){this.current.fillColor=this._makeColorN_Pattern(u)}},{key:"shadingFill",value:function(u){var A=this.viewport.width,T=this.viewport.height,I=E.Util.inverseTransform(this.transformMatrix),D=E.Util.applyTransform([0,0],I),L=E.Util.applyTransform([0,T],I),W=E.Util.applyTransform([A,0],I),N=E.Util.applyTransform([A,T],I),U=Math.min(D[0],L[0],W[0],N[0]),H=Math.min(D[1],L[1],W[1],N[1]),Q=Math.max(D[0],L[0],W[0],N[0]),K=Math.max(D[1],L[1],W[1],N[1]),J=this.svgFactory.createElement("svg:rect");J.setAttributeNS(null,"x",U),J.setAttributeNS(null,"y",H),J.setAttributeNS(null,"width",Q-U),J.setAttributeNS(null,"height",K-H),J.setAttributeNS(null,"fill",this._makeShadingPattern(u)),this.current.fillAlpha<1&&J.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(J)}},{key:"_makeColorN_Pattern",value:function(u){return"TilingPattern"===u[0]?this._makeTilingPattern(u):this._makeShadingPattern(u)}},{key:"_makeTilingPattern",value:function(u){var A=u[1],T=u[2],I=u[3]||E.IDENTITY_MATRIX,D=_slicedToArray(u[4],4),L=D[0],W=D[1],N=D[2],U=D[3],H=u[5],Q=u[6],K=u[7],J="shading".concat(et++),ee=_slicedToArray(E.Util.normalizeRect([].concat(_toConsumableArray(E.Util.applyTransform([L,W],I)),_toConsumableArray(E.Util.applyTransform([N,U],I)))),4),er=ee[0],en=ee[1],ea=ee[2],eo=ee[3],ei=_slicedToArray(E.Util.singularValueDecompose2dScale(I),2),es=ei[0],eu=ei[1],ec=H*es,ed=Q*eu,ef=this.svgFactory.createElement("svg:pattern");ef.setAttributeNS(null,"id",J),ef.setAttributeNS(null,"patternUnits","userSpaceOnUse"),ef.setAttributeNS(null,"width",ec),ef.setAttributeNS(null,"height",ed),ef.setAttributeNS(null,"x","".concat(er)),ef.setAttributeNS(null,"y","".concat(en));var eh=this.svg,ep=this.transformMatrix,em=this.current.fillColor,ev=this.current.strokeColor,ey=this.svgFactory.create(ea-er,eo-en);if(this.svg=ey,this.transformMatrix=I,2===K){var eb=E.Util.makeHexColor.apply(E.Util,_toConsumableArray(A));this.current.fillColor=eb,this.current.strokeColor=eb}return this.executeOpTree(this.convertOpList(T)),this.svg=eh,this.transformMatrix=ep,this.current.fillColor=em,this.current.strokeColor=ev,ef.appendChild(ey.childNodes[0]),this.defs.appendChild(ef),"url(#".concat(J,")")}},{key:"_makeShadingPattern",value:function(u){switch("string"==typeof u&&(u=this.objs.get(u)),u[0]){case"RadialAxial":var A="shading".concat(et++),T=u[3];switch(u[1]){case"axial":var I=u[4],D=u[5];(H=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",A),H.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),H.setAttributeNS(null,"x1",I[0]),H.setAttributeNS(null,"y1",I[1]),H.setAttributeNS(null,"x2",D[0]),H.setAttributeNS(null,"y2",D[1]);break;case"radial":var L=u[4],W=u[5],N=u[6],U=u[7];(H=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",A),H.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),H.setAttributeNS(null,"cx",W[0]),H.setAttributeNS(null,"cy",W[1]),H.setAttributeNS(null,"r",U),H.setAttributeNS(null,"fx",L[0]),H.setAttributeNS(null,"fy",L[1]),H.setAttributeNS(null,"fr",N);break;default:throw Error("Unknown RadialAxial type: ".concat(u[1]))}var H,Q,K=_createForOfIteratorHelper(T);try{for(K.s();!(Q=K.n()).done;){var J=Q.value,ee=this.svgFactory.createElement("svg:stop");ee.setAttributeNS(null,"offset",J[0]),ee.setAttributeNS(null,"stop-color",J[1]),H.appendChild(ee)}}catch(u){K.e(u)}finally{K.f()}return this.defs.appendChild(H),"url(#".concat(A,")");case"Mesh":return(0,E.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw Error("Unknown IR type: ".concat(u[0]))}}},{key:"setDash",value:function(u,A){this.current.dashArray=u,this.current.dashPhase=A}},{key:"constructPath",value:function(u,A){var T,I=this.current,D=I.x,L=I.y,W=[],N=0,U=_createForOfIteratorHelper(u);try{for(U.s();!(T=U.n()).done;){var H=T.value;switch(0|H){case E.OPS.rectangle:D=A[N++],L=A[N++];var Q=A[N++],K=A[N++],J=D+Q,ee=L+K;W.push("M",pf(D),pf(L),"L",pf(J),pf(L),"L",pf(J),pf(ee),"L",pf(D),pf(ee),"Z");break;case E.OPS.moveTo:D=A[N++],L=A[N++],W.push("M",pf(D),pf(L));break;case E.OPS.lineTo:D=A[N++],L=A[N++],W.push("L",pf(D),pf(L));break;case E.OPS.curveTo:D=A[N+4],L=A[N+5],W.push("C",pf(A[N]),pf(A[N+1]),pf(A[N+2]),pf(A[N+3]),pf(D),pf(L)),N+=6;break;case E.OPS.curveTo2:W.push("C",pf(D),pf(L),pf(A[N]),pf(A[N+1]),pf(A[N+2]),pf(A[N+3])),D=A[N+2],L=A[N+3],N+=4;break;case E.OPS.curveTo3:D=A[N+2],L=A[N+3],W.push("C",pf(A[N]),pf(A[N+1]),pf(D),pf(L),pf(D),pf(L)),N+=4;break;case E.OPS.closePath:W.push("Z")}}}catch(u){U.e(u)}finally{U.f()}W=W.join(" "),I.path&&u.length>0&&u[0]!==E.OPS.rectangle&&u[0]!==E.OPS.moveTo?W=I.path.getAttributeNS(null,"d")+W:(I.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(I.path)),I.path.setAttributeNS(null,"d",W),I.path.setAttributeNS(null,"fill","none"),I.element=I.path,I.setCurrentPoint(D,L)}},{key:"endPath",value:function(){var u=this.current;if(u.path=null,this.pendingClip){if(!u.element){this.pendingClip=null;return}var A="clippath".concat(J++),T=this.svgFactory.createElement("svg:clipPath");T.setAttributeNS(null,"id",A),T.setAttributeNS(null,"transform",pm(this.transformMatrix));var E=u.element.cloneNode(!0);if("evenodd"===this.pendingClip?E.setAttributeNS(null,"clip-rule","evenodd"):E.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,T.appendChild(E),this.defs.appendChild(T),u.activeClipUrl){u.clipGroup=null;var I,D=_createForOfIteratorHelper(this.extraStack);try{for(D.s();!(I=D.n()).done;)I.value.clipGroup=null}catch(u){D.e(u)}finally{D.f()}T.setAttributeNS(null,"clip-path",u.activeClipUrl)}u.activeClipUrl="url(#".concat(A,")"),this.tgrp=null}}},{key:"clip",value:function(u){this.pendingClip=u}},{key:"closePath",value:function(){var u=this.current;if(u.path){var A="".concat(u.path.getAttributeNS(null,"d"),"Z");u.path.setAttributeNS(null,"d",A)}}},{key:"setLeading",value:function(u){this.current.leading=-u}},{key:"setTextRise",value:function(u){this.current.textRise=u}},{key:"setTextRenderingMode",value:function(u){this.current.textRenderingMode=u}},{key:"setHScale",value:function(u){this.current.textHScale=u/100}},{key:"setRenderingIntent",value:function(u){}},{key:"setFlatness",value:function(u){}},{key:"setGState",value:function(u){var A,T=_createForOfIteratorHelper(u);try{for(T.s();!(A=T.n()).done;){var I=_slicedToArray(A.value,2),D=I[0],L=I[1];switch(D){case"LW":this.setLineWidth(L);break;case"LC":this.setLineCap(L);break;case"LJ":this.setLineJoin(L);break;case"ML":this.setMiterLimit(L);break;case"D":this.setDash(L[0],L[1]);break;case"RI":this.setRenderingIntent(L);break;case"FL":this.setFlatness(L);break;case"Font":this.setFont(L);break;case"CA":this.setStrokeAlpha(L);break;case"ca":this.setFillAlpha(L);break;default:(0,E.warn)("Unimplemented graphic state operator ".concat(D))}}}catch(u){T.e(u)}finally{T.f()}}},{key:"fill",value:function(){var u=this.current;u.element&&(u.element.setAttributeNS(null,"fill",u.fillColor),u.element.setAttributeNS(null,"fill-opacity",u.fillAlpha),this.endPath())}},{key:"stroke",value:function(){var u=this.current;u.element&&(this._setStrokeAttributes(u.element),u.element.setAttributeNS(null,"fill","none"),this.endPath())}},{key:"_setStrokeAttributes",value:function(u){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,T=this.current,E=T.dashArray;1!==A&&E.length>0&&(E=E.map(function(u){return A*u})),u.setAttributeNS(null,"stroke",T.strokeColor),u.setAttributeNS(null,"stroke-opacity",T.strokeAlpha),u.setAttributeNS(null,"stroke-miterlimit",pf(T.miterLimit)),u.setAttributeNS(null,"stroke-linecap",T.lineCap),u.setAttributeNS(null,"stroke-linejoin",T.lineJoin),u.setAttributeNS(null,"stroke-width",pf(A*T.lineWidth)+"px"),u.setAttributeNS(null,"stroke-dasharray",E.map(pf).join(" ")),u.setAttributeNS(null,"stroke-dashoffset",pf(A*T.dashPhase)+"px")}},{key:"eoFill",value:function(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}},{key:"fillStroke",value:function(){this.stroke(),this.fill()}},{key:"eoFillStroke",value:function(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}},{key:"closeStroke",value:function(){this.closePath(),this.stroke()}},{key:"closeFillStroke",value:function(){this.closePath(),this.fillStroke()}},{key:"closeEOFillStroke",value:function(){this.closePath(),this.eoFillStroke()}},{key:"paintSolidColorImageMask",value:function(){var u=this.svgFactory.createElement("svg:rect");u.setAttributeNS(null,"x","0"),u.setAttributeNS(null,"y","0"),u.setAttributeNS(null,"width","1px"),u.setAttributeNS(null,"height","1px"),u.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(u)}},{key:"paintImageXObject",value:function(u){var A=u.startsWith("g_")?this.commonObjs.get(u):this.objs.get(u);if(!A){(0,E.warn)("Dependent image with object ID ".concat(u," is not ready yet"));return}this.paintInlineImageXObject(A)}},{key:"paintInlineImageXObject",value:function(u,A){var T=u.width,E=u.height,I=Q(u,this.forceDataSchema,!!A),D=this.svgFactory.createElement("svg:rect");D.setAttributeNS(null,"x","0"),D.setAttributeNS(null,"y","0"),D.setAttributeNS(null,"width",pf(T)),D.setAttributeNS(null,"height",pf(E)),this.current.element=D,this.clip("nonzero");var L=this.svgFactory.createElement("svg:image");L.setAttributeNS(N,"xlink:href",I),L.setAttributeNS(null,"x","0"),L.setAttributeNS(null,"y",pf(-E)),L.setAttributeNS(null,"width",pf(T)+"px"),L.setAttributeNS(null,"height",pf(E)+"px"),L.setAttributeNS(null,"transform","scale(".concat(pf(1/T)," ").concat(pf(-1/E),")")),A?A.appendChild(L):this._ensureTransformGroup().appendChild(L)}},{key:"paintImageMaskXObject",value:function(u){var A=this.current,T=u.width,E=u.height,I=A.fillColor;A.maskId="mask".concat(ee++);var D=this.svgFactory.createElement("svg:mask");D.setAttributeNS(null,"id",A.maskId);var L=this.svgFactory.createElement("svg:rect");L.setAttributeNS(null,"x","0"),L.setAttributeNS(null,"y","0"),L.setAttributeNS(null,"width",pf(T)),L.setAttributeNS(null,"height",pf(E)),L.setAttributeNS(null,"fill",I),L.setAttributeNS(null,"mask","url(#".concat(A.maskId,")")),this.defs.appendChild(D),this._ensureTransformGroup().appendChild(L),this.paintInlineImageXObject(u,D)}},{key:"paintFormXObjectBegin",value:function(u,A){if(Array.isArray(u)&&6===u.length&&this.transform(u[0],u[1],u[2],u[3],u[4],u[5]),A){var T=A[2]-A[0],E=A[3]-A[1],I=this.svgFactory.createElement("svg:rect");I.setAttributeNS(null,"x",A[0]),I.setAttributeNS(null,"y",A[1]),I.setAttributeNS(null,"width",pf(T)),I.setAttributeNS(null,"height",pf(E)),this.current.element=I,this.clip("nonzero"),this.endPath()}}},{key:"paintFormXObjectEnd",value:function(){}},{key:"_initialize",value:function(u){var A=this.svgFactory.create(u.width,u.height),T=this.svgFactory.createElement("svg:defs");A.appendChild(T),this.defs=T;var E=this.svgFactory.createElement("svg:g");return E.setAttributeNS(null,"transform",pm(u.transform)),A.appendChild(E),this.svg=E,A}},{key:"_ensureClipGroup",value:function(){if(!this.current.clipGroup){var u=this.svgFactory.createElement("svg:g");u.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(u),this.current.clipGroup=u}return this.current.clipGroup}},{key:"_ensureTransformGroup",value:function(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}]),SVGGraphics}()},(u,A,T)=>{"use strict";function _typeof(u){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(u)}Object.defineProperty(A,"__esModule",{value:!0}),A.PDFNodeStream=void 0;var E=_interopRequireDefault(T(2)),I=T(4),D=T(154);function _interopRequireDefault(u){return u&&u.__esModule?u:{default:u}}function _inherits(u,A){if("function"!=typeof A&&null!==A)throw TypeError("Super expression must either be null or a function");u.prototype=Object.create(A&&A.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),A&&_setPrototypeOf(u,A)}function _setPrototypeOf(u,A){return(_setPrototypeOf=Object.setPrototypeOf||function(u,A){return u.__proto__=A,u})(u,A)}function _createSuper(u){var A=_isNativeReflectConstruct();return function(){var T,E=_getPrototypeOf(u);if(A){var I=_getPrototypeOf(this).constructor;T=Reflect.construct(E,arguments,I)}else T=E.apply(this,arguments);return _possibleConstructorReturn(this,T)}}function _possibleConstructorReturn(u,A){if(A&&("object"===_typeof(A)||"function"==typeof A))return A;if(void 0!==A)throw TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(u)}function _assertThisInitialized(u){if(void 0===u)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(u){return!1}}function _getPrototypeOf(u){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)})(u)}function asyncGeneratorStep(u,A,T,E,I,D,L){try{var W=u[D](L),N=W.value}catch(u){T(u);return}W.done?A(N):Promise.resolve(N).then(E,I)}function _asyncToGenerator(u){return function(){var A=this,T=arguments;return new Promise(function(E,I){var D=u.apply(A,T);function _next(u){asyncGeneratorStep(D,E,I,_next,_throw,"next",u)}function _throw(u){asyncGeneratorStep(D,E,I,_next,_throw,"throw",u)}_next(void 0)})}}function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.createResponseStatusError=createResponseStatusError,A.extractFilenameFromHeader=extractFilenameFromHeader,A.validateRangeRequestCapabilities=validateRangeRequestCapabilities,A.validateResponseStatus=validateResponseStatus;var E=T(4),I=T(155),D=T(1);function validateRangeRequestCapabilities(u){var A=u.getResponseHeader,T=u.isHttp,I=u.rangeChunkSize,D=u.disableRange;(0,E.assert)(I>0,"Range chunk size must be larger than zero");var L={allowRangeRequests:!1,suggestedLength:void 0},W=parseInt(A("Content-Length"),10);return Number.isInteger(W)&&(L.suggestedLength=W,W<=2*I||D||!T||"bytes"!==A("Accept-Ranges")||"identity"!==(A("Content-Encoding")||"identity")||(L.allowRangeRequests=!0)),L}function extractFilenameFromHeader(u){var A=u("Content-Disposition");if(A){var T=(0,I.getFilenameFromContentDispositionHeader)(A);if(T.includes("%"))try{T=decodeURIComponent(T)}catch(u){}if((0,D.isPdfFile)(T))return T}return null}function createResponseStatusError(u,A){return 404===u||0===u&&A.startsWith("file:")?new E.MissingPDFException('Missing PDF "'+A+'".'):new E.UnexpectedResponseException("Unexpected server response (".concat(u,') while retrieving PDF "').concat(A,'".'),u)}function validateResponseStatus(u){return 200===u||206===u}},(u,A,T)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.getFilenameFromContentDispositionHeader=getFilenameFromContentDispositionHeader;var E=T(4);function _slicedToArray(u,A){return _arrayWithHoles(u)||_iterableToArrayLimit(u,A)||_unsupportedIterableToArray(u,A)||_nonIterableRest()}function _nonIterableRest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.PDFNetworkStream=void 0;var E=_interopRequireDefault(T(2)),I=T(4),D=T(154);function _interopRequireDefault(u){return u&&u.__esModule?u:{default:u}}function asyncGeneratorStep(u,A,T,E,I,D,L){try{var W=u[D](L),N=W.value}catch(u){T(u);return}W.done?A(N):Promise.resolve(N).then(E,I)}function _asyncToGenerator(u){return function(){var A=this,T=arguments;return new Promise(function(E,I){var D=u.apply(A,T);function _next(u){asyncGeneratorStep(D,E,I,_next,_throw,"next",u)}function _throw(u){asyncGeneratorStep(D,E,I,_next,_throw,"throw",u)}_next(void 0)})}}function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,NetworkManager),this.url=u,this.isHttp=/^https?:/i.test(u),this.httpHeaders=this.isHttp&&A.httpHeaders||Object.create(null),this.withCredentials=A.withCredentials||!1,this.getXhr=A.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}return _createClass(NetworkManager,[{key:"requestRange",value:function(u,A,T){var E={begin:u,end:A};for(var I in T)E[I]=T[I];return this.request(E)}},{key:"requestFull",value:function(u){return this.request(u)}},{key:"request",value:function(u){var A=this.getXhr(),T=this.currXhrId++,E=this.pendingRequests[T]={xhr:A};for(var I in A.open("GET",this.url),A.withCredentials=this.withCredentials,this.httpHeaders){var D=this.httpHeaders[I];void 0!==D&&A.setRequestHeader(I,D)}return this.isHttp&&"begin"in u&&"end"in u?(A.setRequestHeader("Range","bytes=".concat(u.begin,"-").concat(u.end-1)),E.expectedStatus=W):E.expectedStatus=L,A.responseType="arraybuffer",u.onError&&(A.onerror=function(T){u.onError(A.status)}),A.onreadystatechange=this.onStateChange.bind(this,T),A.onprogress=this.onProgress.bind(this,T),E.onHeadersReceived=u.onHeadersReceived,E.onDone=u.onDone,E.onError=u.onError,E.onProgress=u.onProgress,A.send(null),T}},{key:"onProgress",value:function(u,A){var T,E=this.pendingRequests[u];E&&(null===(T=E.onProgress)||void 0===T||T.call(E,A))}},{key:"onStateChange",value:function(u,A){var T,E,I,D=this.pendingRequests[u];if(D){var N=D.xhr;if(N.readyState>=2&&D.onHeadersReceived&&(D.onHeadersReceived(),delete D.onHeadersReceived),4===N.readyState&&u in this.pendingRequests){if(delete this.pendingRequests[u],0===N.status&&this.isHttp){null===(T=D.onError)||void 0===T||T.call(D,N.status);return}var U=N.status||L;if(!(U===L&&D.expectedStatus===W)&&U!==D.expectedStatus){null===(E=D.onError)||void 0===E||E.call(D,N.status);return}var H=getArrayBuffer(N);if(U===W){var Q=N.getResponseHeader("Content-Range"),K=/bytes (\d+)-(\d+)\/(\d+)/.exec(Q);D.onDone({begin:parseInt(K[1],10),chunk:H})}else H?D.onDone({begin:0,chunk:H}):null===(I=D.onError)||void 0===I||I.call(D,N.status)}}}},{key:"getRequestXhr",value:function(u){return this.pendingRequests[u].xhr}},{key:"isPendingRequest",value:function(u){return u in this.pendingRequests}},{key:"abortRequest",value:function(u){var A=this.pendingRequests[u].xhr;delete this.pendingRequests[u],A.abort()}}]),NetworkManager}(),U=function(){function PDFNetworkStream(u){_classCallCheck(this,PDFNetworkStream),this._source=u,this._manager=new N(u.url,{httpHeaders:u.httpHeaders,withCredentials:u.withCredentials}),this._rangeChunkSize=u.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}return _createClass(PDFNetworkStream,[{key:"_onRangeRequestReaderClosed",value:function(u){var A=this._rangeRequestReaders.indexOf(u);A>=0&&this._rangeRequestReaders.splice(A,1)}},{key:"getFullReader",value:function(){return(0,I.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new H(this._manager,this._source),this._fullRequestReader}},{key:"getRangeReader",value:function(u,A){var T=new Q(this._manager,u,A);return T.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(T),T}},{key:"cancelAllRequests",value:function(u){null===(A=this._fullRequestReader)||void 0===A||A.cancel(u);var A,T,E=_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(E.s();!(T=E.n()).done;)T.value.cancel(u)}catch(u){E.e(u)}finally{E.f()}}}]),PDFNetworkStream}();A.PDFNetworkStream=U;var H=function(){function PDFNetworkStreamFullRequestReader(u,A){_classCallCheck(this,PDFNetworkStreamFullRequestReader),this._manager=u;var T={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=A.url,this._fullRequestId=u.requestFull(T),this._headersReceivedCapability=(0,I.createPromiseCapability)(),this._disableRange=A.disableRange||!1,this._contentLength=A.length,this._rangeChunkSize=A.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}return _createClass(PDFNetworkStreamFullRequestReader,[{key:"_onHeadersReceived",value:function(){var u=this._fullRequestId,A=this._manager.getRequestXhr(u),getResponseHeader=function(u){return A.getResponseHeader(u)},T=(0,D.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),E=T.allowRangeRequests,I=T.suggestedLength;E&&(this._isRangeSupported=!0),this._contentLength=I||this._contentLength,this._filename=(0,D.extractFilenameFromHeader)(getResponseHeader),this._isRangeSupported&&this._manager.abortRequest(u),this._headersReceivedCapability.resolve()}},{key:"_onDone",value:function(u){if(u&&(this._requests.length>0?this._requests.shift().resolve({value:u.chunk,done:!1}):this._cachedChunks.push(u.chunk)),this._done=!0,!(this._cachedChunks.length>0)){var A,T=_createForOfIteratorHelper(this._requests);try{for(T.s();!(A=T.n()).done;)A.value.resolve({value:void 0,done:!0})}catch(u){T.e(u)}finally{T.f()}this._requests.length=0}}},{key:"_onError",value:function(u){this._storedError=(0,D.createResponseStatusError)(u,this._url),this._headersReceivedCapability.reject(this._storedError);var A,T=_createForOfIteratorHelper(this._requests);try{for(T.s();!(A=T.n()).done;)A.value.reject(this._storedError)}catch(u){T.e(u)}finally{T.f()}this._requests.length=0,this._cachedChunks.length=0}},{key:"_onProgress",value:function(u){var A;null===(A=this.onProgress)||void 0===A||A.call(this,{loaded:u.loaded,total:u.lengthComputable?u.total:this._contentLength})}},{key:"filename",get:function(){return this._filename}},{key:"isRangeSupported",get:function(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}},{key:"contentLength",get:function(){return this._contentLength}},{key:"headersReady",get:function(){return this._headersReceivedCapability.promise}},{key:"read",value:function(){var u=_asyncToGenerator(E.default.mark(function _callee(){var u,A;return E.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(!this._storedError){T.next=2;break}throw this._storedError;case 2:if(!(this._cachedChunks.length>0)){T.next=5;break}return u=this._cachedChunks.shift(),T.abrupt("return",{value:u,done:!1});case 5:if(!this._done){T.next=7;break}return T.abrupt("return",{value:void 0,done:!0});case 7:return A=(0,I.createPromiseCapability)(),this._requests.push(A),T.abrupt("return",A.promise);case 10:case"end":return T.stop()}},_callee,this)}));return function(){return u.apply(this,arguments)}}()},{key:"cancel",value:function(u){this._done=!0,this._headersReceivedCapability.reject(u);var A,T=_createForOfIteratorHelper(this._requests);try{for(T.s();!(A=T.n()).done;)A.value.resolve({value:void 0,done:!0})}catch(u){T.e(u)}finally{T.f()}this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}]),PDFNetworkStreamFullRequestReader}(),Q=function(){function PDFNetworkStreamRangeRequestReader(u,A,T){_classCallCheck(this,PDFNetworkStreamRangeRequestReader),this._manager=u;var E={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=u.url,this._requestId=u.requestRange(A,T,E),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}return _createClass(PDFNetworkStreamRangeRequestReader,[{key:"_close",value:function(){var u;null===(u=this.onClosed)||void 0===u||u.call(this,this)}},{key:"_onDone",value:function(u){var A=u.chunk;this._requests.length>0?this._requests.shift().resolve({value:A,done:!1}):this._queuedChunk=A,this._done=!0;var T,E=_createForOfIteratorHelper(this._requests);try{for(E.s();!(T=E.n()).done;)T.value.resolve({value:void 0,done:!0})}catch(u){E.e(u)}finally{E.f()}this._requests.length=0,this._close()}},{key:"_onError",value:function(u){this._storedError=(0,D.createResponseStatusError)(u,this._url);var A,T=_createForOfIteratorHelper(this._requests);try{for(T.s();!(A=T.n()).done;)A.value.reject(this._storedError)}catch(u){T.e(u)}finally{T.f()}this._requests.length=0,this._queuedChunk=null}},{key:"_onProgress",value:function(u){if(!this.isStreamingSupported){var A;null===(A=this.onProgress)||void 0===A||A.call(this,{loaded:u.loaded})}}},{key:"isStreamingSupported",get:function(){return!1}},{key:"read",value:function(){var u=_asyncToGenerator(E.default.mark(function _callee2(){var u,A;return E.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(!this._storedError){T.next=2;break}throw this._storedError;case 2:if(!(null!==this._queuedChunk)){T.next=6;break}return u=this._queuedChunk,this._queuedChunk=null,T.abrupt("return",{value:u,done:!1});case 6:if(!this._done){T.next=8;break}return T.abrupt("return",{value:void 0,done:!0});case 8:return A=(0,I.createPromiseCapability)(),this._requests.push(A),T.abrupt("return",A.promise);case 11:case"end":return T.stop()}},_callee2,this)}));return function(){return u.apply(this,arguments)}}()},{key:"cancel",value:function(u){this._done=!0;var A,T=_createForOfIteratorHelper(this._requests);try{for(T.s();!(A=T.n()).done;)A.value.resolve({value:void 0,done:!0})}catch(u){T.e(u)}finally{T.f()}this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}]),PDFNetworkStreamRangeRequestReader}()},(u,A,T)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.PDFFetchStream=void 0;var E=_interopRequireDefault(T(2)),I=T(4),D=T(154);function _interopRequireDefault(u){return u&&u.__esModule?u:{default:u}}function asyncGeneratorStep(u,A,T,E,I,D,L){try{var W=u[D](L),N=W.value}catch(u){T(u);return}W.done?A(N):Promise.resolve(N).then(E,I)}function _asyncToGenerator(u){return function(){var A=this,T=arguments;return new Promise(function(E,I){var D=u.apply(A,T);function _next(u){asyncGeneratorStep(D,E,I,_next,_throw,"next",u)}function _throw(u){asyncGeneratorStep(D,E,I,_next,_throw,"throw",u)}_next(void 0)})}}function _createForOfIteratorHelper(u,A){var T="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!T){if(Array.isArray(u)||(T=_unsupportedIterableToArray(u))||A&&u&&"number"==typeof u.length){T&&(u=T);var E=0,F=function(){};return{s:F,n:function(){return E>=u.length?{done:!0}:{done:!1,value:u[E++]}},e:function(u){throw u},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,D=!0,L=!1;return{s:function(){T=T.call(u)},n:function(){var u=T.next();return D=u.done,u},e:function(u){L=!0,I=u},f:function(){try{D||null==T.return||T.return()}finally{if(L)throw I}}}}function _unsupportedIterableToArray(u,A){if(u){if("string"==typeof u)return _arrayLikeToArray(u,A);var T=Object.prototype.toString.call(u).slice(8,-1);if("Object"===T&&u.constructor&&(T=u.constructor.name),"Map"===T||"Set"===T)return Array.from(u);if("Arguments"===T||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _arrayLikeToArray(u,A)}}function _arrayLikeToArray(u,A){(null==A||A>u.length)&&(A=u.length);for(var T=0,E=Array(A);T{__w_pdfjs_require__.nmd=u=>(u.paths=[],u.children||(u.children=[]),u)})();var __nested_webpack_exports__={};return(()=>{"use strict";var u=__nested_webpack_exports__;Object.defineProperty(u,"__esModule",{value:!0}),Object.defineProperty(u,"AnnotationLayer",{enumerable:!0,get:function(){return I.AnnotationLayer}}),Object.defineProperty(u,"AnnotationMode",{enumerable:!0,get:function(){return T.AnnotationMode}}),Object.defineProperty(u,"CMapCompressionType",{enumerable:!0,get:function(){return T.CMapCompressionType}}),Object.defineProperty(u,"GlobalWorkerOptions",{enumerable:!0,get:function(){return D.GlobalWorkerOptions}}),Object.defineProperty(u,"InvalidPDFException",{enumerable:!0,get:function(){return T.InvalidPDFException}}),Object.defineProperty(u,"LinkTarget",{enumerable:!0,get:function(){return A.LinkTarget}}),Object.defineProperty(u,"LoopbackPort",{enumerable:!0,get:function(){return E.LoopbackPort}}),Object.defineProperty(u,"MissingPDFException",{enumerable:!0,get:function(){return T.MissingPDFException}}),Object.defineProperty(u,"OPS",{enumerable:!0,get:function(){return T.OPS}}),Object.defineProperty(u,"PDFDataRangeTransport",{enumerable:!0,get:function(){return E.PDFDataRangeTransport}}),Object.defineProperty(u,"PDFDateString",{enumerable:!0,get:function(){return A.PDFDateString}}),Object.defineProperty(u,"PDFWorker",{enumerable:!0,get:function(){return E.PDFWorker}}),Object.defineProperty(u,"PasswordResponses",{enumerable:!0,get:function(){return T.PasswordResponses}}),Object.defineProperty(u,"PermissionFlag",{enumerable:!0,get:function(){return T.PermissionFlag}}),Object.defineProperty(u,"PixelsPerInch",{enumerable:!0,get:function(){return A.PixelsPerInch}}),Object.defineProperty(u,"RenderingCancelledException",{enumerable:!0,get:function(){return A.RenderingCancelledException}}),Object.defineProperty(u,"SVGGraphics",{enumerable:!0,get:function(){return N.SVGGraphics}}),Object.defineProperty(u,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return T.UNSUPPORTED_FEATURES}}),Object.defineProperty(u,"UnexpectedResponseException",{enumerable:!0,get:function(){return T.UnexpectedResponseException}}),Object.defineProperty(u,"Util",{enumerable:!0,get:function(){return T.Util}}),Object.defineProperty(u,"VerbosityLevel",{enumerable:!0,get:function(){return T.VerbosityLevel}}),Object.defineProperty(u,"XfaLayer",{enumerable:!0,get:function(){return U.XfaLayer}}),Object.defineProperty(u,"addLinkAttributes",{enumerable:!0,get:function(){return A.addLinkAttributes}}),Object.defineProperty(u,"build",{enumerable:!0,get:function(){return E.build}}),Object.defineProperty(u,"createObjectURL",{enumerable:!0,get:function(){return T.createObjectURL}}),Object.defineProperty(u,"createPromiseCapability",{enumerable:!0,get:function(){return T.createPromiseCapability}}),Object.defineProperty(u,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return T.createValidAbsoluteUrl}}),Object.defineProperty(u,"getDocument",{enumerable:!0,get:function(){return E.getDocument}}),Object.defineProperty(u,"getFilenameFromUrl",{enumerable:!0,get:function(){return A.getFilenameFromUrl}}),Object.defineProperty(u,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return A.getPdfFilenameFromUrl}}),Object.defineProperty(u,"getXfaPageViewport",{enumerable:!0,get:function(){return A.getXfaPageViewport}}),Object.defineProperty(u,"isPdfFile",{enumerable:!0,get:function(){return A.isPdfFile}}),Object.defineProperty(u,"loadScript",{enumerable:!0,get:function(){return A.loadScript}}),Object.defineProperty(u,"removeNullCharacters",{enumerable:!0,get:function(){return T.removeNullCharacters}}),Object.defineProperty(u,"renderTextLayer",{enumerable:!0,get:function(){return W.renderTextLayer}}),Object.defineProperty(u,"shadow",{enumerable:!0,get:function(){return T.shadow}}),Object.defineProperty(u,"version",{enumerable:!0,get:function(){return E.version}});var A=__w_pdfjs_require__(1),T=__w_pdfjs_require__(4),E=__w_pdfjs_require__(136),I=__w_pdfjs_require__(148),D=__w_pdfjs_require__(142),L=__w_pdfjs_require__(6),W=__w_pdfjs_require__(151),N=__w_pdfjs_require__(152),U=__w_pdfjs_require__(150);if(L.isNodeJS){var H=__w_pdfjs_require__(153).PDFNodeStream;(0,E.setPDFNetworkStreamFactory)(function(u){return new H(u)})}else{var Q=__w_pdfjs_require__(156).PDFNetworkStream,K=__w_pdfjs_require__(157).PDFFetchStream;(0,E.setPDFNetworkStreamFactory)(function(u){return(0,A.isValidFetchUrl)(u.url)?new K(u):new Q(u)})}})(),__nested_webpack_exports__})()})}}]); //# sourceMappingURL=906a09f8-000db4b896946e2c.js.map