Generic build of PDF.js library.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
225 KiB

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],t):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=t():e["pdfjs-dist/build/pdf"]=e.pdfjsDistBuildPdf=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=14)}([function(e,t,r){"use strict";(function(e){function n(e){le=e}function i(){return le}function a(e){le>=ae.infos&&console.log("Info: "+e)}function o(e){le>=ae.warnings&&console.log("Warning: "+e)}function s(e){console.log("Deprecated API usage: "+e)}function l(e){throw le>=ae.errors&&(console.log("Error: "+e),console.log(c())),new Error(e)}function c(){try{throw new Error}catch(e){return e.stack?e.stack.split("\n").slice(2).join("\n"):""}}function u(e,t){e||l(t)}function d(e,t){try{var r=new URL(e);if(!r.origin||"null"===r.origin)return!1}catch(e){return!1}var n=new URL(t,r);return r.origin===n.origin}function h(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function f(e,t){if(!e)return null;try{var r=t?new URL(e,t):new URL(e);if(h(r))return r}catch(e){}return null}function p(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1}),r}function m(e){var t;return function(){return e&&(t=Object.create(null),e(t),e=null),t}}function g(e){return"string"!=typeof e?(o("The argument for removeNullCharacters must be a string."),e):e.replace(ye,"")}function v(e){u(null!==e&&"object"===(void 0===e?"undefined":H(e))&&void 0!==e.length,"Invalid argument for bytesToString");var t=e.length;if(t<8192)return String.fromCharCode.apply(null,e);for(var r=[],n=0;n<t;n+=8192){var i=Math.min(n+8192,t),a=e.subarray(n,i);r.push(String.fromCharCode.apply(null,a))}return r.join("")}function b(e){u("string"==typeof e,"Invalid argument for stringToBytes");for(var t=e.length,r=new Uint8Array(t),n=0;n<t;++n)r[n]=255&e.charCodeAt(n);return r}function y(e){return void 0!==e.length?e.length:(u(void 0!==e.byteLength),e.byteLength)}function _(e){if(1===e.length&&e[0]instanceof Uint8Array)return e[0];var t,r,n,i=0,a=e.length;for(t=0;t<a;t++)r=e[t],n=y(r),i+=n;var o=0,s=new Uint8Array(i);for(t=0;t<a;t++)r=e[t],r instanceof Uint8Array||(r="string"==typeof r?b(r):new Uint8Array(r)),n=r.byteLength,s.set(r,o),o+=n;return s}function A(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function S(e){for(var t=1,r=0;e>t;)t<<=1,r++;return r}function w(e,t){return e[t]<<24>>24}function P(e,t){return e[t]<<8|e[t+1]}function C(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function x(){var e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}function k(){try{return new Function(""),!0}catch(e){return!1}}function T(e){var t,r=e.length,n=[];if("þ"===e[0]&&"ÿ"===e[1])for(t=2;t<r;t+=2)n.push(String.fromCharCode(e.charCodeAt(t)<<8|e.charCodeAt(t+1)));else for(t=0;t<r;++t){var i=we[e.charCodeAt(t)];n.push(i?String.fromCharCode(i):e.charAt(t))}return n.join("")}function R(e){return decodeURIComponent(escape(e))}function E(e){return unescape(encodeURIComponent(e))}function I(e){for(var t in e)return!1;return!0}function L(e){return"boolean"==typeof e}function O(e){return"number"==typeof e&&(0|e)===e}function j(e){return"number"==typeof e}function D(e){return"string"==typeof e}function F(e){return e instanceof Array}function N(e){return"object"===(void 0===e?"undefined":H(e))&&null!==e&&void 0!==e.byteLength}function M(e){return 32===e||9===e||13===e||10===e}function W(){return"undefined"==typeof __pdfjsdev_webpack__&&("object"===("undefined"==typeof proce
return a.Util.inherit(e,o,{render:function(){this.container.className="textAnnotation";var e=document.createElement("img");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,e,this.data),this.container.appendChild(e),this.container}}),e}(),c=function(){function e(e,t){o.call(this,e,t)}return a.Util.inherit(e,o,{render:function(){return this.container}}),e}(),u=function(){function e(e){var t=e.renderInteractiveForms||!e.data.hasAppearance&&!!e.data.fieldValue;c.call(this,e,t)}var t=["left","center","right"];return a.Util.inherit(e,c,{render:function(){this.container.className="textWidgetAnnotation";var e=null;if(this.renderInteractiveForms){if(this.data.multiLine?(e=document.createElement("textarea"),e.textContent=this.data.fieldValue):(e=document.createElement("input"),e.type="text",e.setAttribute("value",this.data.fieldValue)),e.disabled=this.data.readOnly,null!==this.data.maxLen&&(e.maxLength=this.data.maxLen),this.data.comb){var r=this.data.rect[2]-this.data.rect[0],n=r/this.data.maxLen;e.classList.add("comb"),e.style.letterSpacing="calc("+n+"px - 1ch)"}}else{e=document.createElement("div"),e.textContent=this.data.fieldValue,e.style.verticalAlign="middle",e.style.display="table-cell";var i=null;this.data.fontRefName&&(i=this.page.commonObjs.getData(this.data.fontRefName)),this._setTextStyle(e,i)}return null!==this.data.textAlignment&&(e.style.textAlign=t[this.data.textAlignment]),this.container.appendChild(e),this.container},_setTextStyle:function(e,t){var r=e.style;if(r.fontSize=this.data.fontSize+"px",r.direction=this.data.fontDirection<0?"rtl":"ltr",t){r.fontWeight=t.black?t.bold?"900":"bold":t.bold?"bold":"normal",r.fontStyle=t.italic?"italic":"normal";var n=t.loadedName?'"'+t.loadedName+'", ':"",i=t.fallbackName||"Helvetica, sans-serif";r.fontFamily=n+i}}}),e}(),d=function(){function e(e){c.call(this,e,e.renderInteractiveForms)}return a.Util.inherit(e,c,{render:function(){this.container.className="buttonWidgetAnnotation checkBox";var e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="checkbox",this.data.fieldValue&&"Off"!==this.data.fieldValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}),e}(),h=function(){function e(e){c.call(this,e,e.renderInteractiveForms)}return a.Util.inherit(e,c,{render:function(){this.container.className="buttonWidgetAnnotation radioButton";var e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="radio",e.name=this.data.fieldName,this.data.fieldValue===this.data.buttonValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}),e}(),f=function(){function e(e){c.call(this,e,e.renderInteractiveForms)}return a.Util.inherit(e,c,{render:function(){this.container.className="choiceWidgetAnnotation";var e=document.createElement("select");e.disabled=this.data.readOnly,this.data.combo||(e.size=this.data.options.length,this.data.multiSelect&&(e.multiple=!0));for(var t=0,r=this.data.options.length;t<r;t++){var n=this.data.options[t],i=document.createElement("option");i.textContent=n.displayValue,i.value=n.exportValue,this.data.fieldValue.indexOf(n.displayValue)>=0&&i.setAttribute("selected",!0),e.appendChild(i)}return this.container.appendChild(e),this.container}}),e}(),p=function(){function e(e){var t=!(!e.data.title&&!e.data.contents);o.call(this,e,t)}var t=["Line"];return a.Util.inherit(e,o,{render:function(){if(this.container.className="popupAnnotation",t.indexOf(this.data.parentType)>=0)return this.container;var e='[data-annotation-id="'+this.data.parentId+'"]',r=this.layer.querySelector(e);if(!r)return this.container;var n=new m({container:this.container,trigger:r,color:this.data.color,title:this.data.title,contents:this.data.contents}),a=parseFloat(r.style.left),o=parseFloat(r.style.width);re
var t=i.width,n=i.height,a=t*n,o=4*a,s=new Uint8Array(a*r),l=document.createElement("canvas");l.width=t,l.height=n;var c=l.getContext("2d");c.drawImage(i,0,0);var u,d,h=c.getImageData(0,0,t,n).data;if(3===r)for(u=0,d=0;u<o;u+=4,d+=3)s[d]=h[u],s[d+1]=h[u+1],s[d+2]=h[u+2];else if(1===r)for(u=0,d=0;u<o;u+=4,d++)s[d]=h[u];e({data:s,width:t,height:n})},i.onerror=function(){n(new Error("JpegDecode failed to load image"))},i.src=t})},this),e.on("FetchBuiltInCMap",function(e){return this.destroyed?Promise.reject(new Error("Worker was destroyed")):this.CMapReaderFactory.fetch({name:e.name})},this)},getData:function(){return this.messageHandler.sendWithPromise("GetData",null)},getPage:function(e,t){var r=this;if(!(0,c.isInt)(e)||e<=0||e>this.numPages)return Promise.reject(new Error("Invalid page request"));var n=e-1;if(n in this.pagePromises)return this.pagePromises[n];var i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(function(e){if(r.destroyed)throw new Error("Transport destroyed");var t=new x(n,e,r);return r.pageCache[n]=t,t});return this.pagePromises[n]=i,i},getPageIndex:function(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e}).catch(function(e){return Promise.reject(new Error(e))})},getAnnotations:function(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})},getDestinations:function(){return this.messageHandler.sendWithPromise("GetDestinations",null)},getDestination:function(e){return this.messageHandler.sendWithPromise("GetDestination",{id:e})},getPageLabels:function(){return this.messageHandler.sendWithPromise("GetPageLabels",null)},getAttachments:function(){return this.messageHandler.sendWithPromise("GetAttachments",null)},getJavaScript:function(){return this.messageHandler.sendWithPromise("GetJavaScript",null)},getOutline:function(){return this.messageHandler.sendWithPromise("GetOutline",null)},getMetadata:function(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(function(e){return{info:e[0],metadata:e[1]?new f.Metadata(e[1]):null}})},getStats:function(){return this.messageHandler.sendWithPromise("GetStats",null)},startCleanup:function(){var e=this;this.messageHandler.sendWithPromise("Cleanup",null).then(function(){for(var t=0,r=e.pageCache.length;t<r;t++){var n=e.pageCache[t];n&&n.cleanup()}e.commonObjs.clear(),e.fontLoader.clear()})}},e}(),E=function(){function e(){this.objs=Object.create(null)}return e.prototype={ensureObj:function(e){if(this.objs[e])return this.objs[e];var t={capability:(0,c.createPromiseCapability)(),data:null,resolved:!1};return this.objs[e]=t,t},get:function(e,t){if(t)return this.ensureObj(e).capability.promise.then(t),null;var r=this.objs[e];return r&&r.resolved||(0,c.error)("Requesting object that isn't resolved yet "+e),r.data},resolve:function(e,t){var r=this.ensureObj(e);r.resolved=!0,r.data=t,r.capability.resolve(t)},isResolved:function(e){var t=this.objs;return!!t[e]&&t[e].resolved},hasData:function(e){return this.isResolved(e)},getData:function(e){var t=this.objs;return t[e]&&t[e].resolved?t[e].data:null},clear:function(){this.objs=Object.create(null)}},e}(),I=function(){function e(e){this._internalRenderTask=e,this.onContinue=null}return e.prototype={get promise(){return this._internalRenderTask.capability.promise},cancel:function(){this._internalRenderTask.cancel()},then:function(e,t){return this.promise.then.apply(this.promise,arguments)}},e}(),L=function(){function e(e,t,r,n,i,a,o){this.callback=e,this.params=t,this.objs=r,this.commonObjs=n,this.operatorListIdx=null,this.operatorList=i,this.pageNumber=a,this.canvasFactory=o,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this.useRequestAnimationFrame=!1,this.cancelled=!1,this.capability=(0,c.createPromiseCapability)(),this.task=new I(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}var t=new WeakMap;return e.prototype={initializeGraphics:function(e){if(this._canvas){if(t.has(this._canvas
this._layoutTextCtx=o.getContext("2d",{alpha:!1}),this._textContent){var s=this._textContent.items,l=this._textContent.styles;this._processItems(s,l),i.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');this._reader=this._textContentStream.getReader(),function e(){t._reader.read().then(function(r){var o=r.value;if(r.done)return void i.resolve();n.Util.extendObj(a,o.styles),t._processItems(o.items,a),e()},i.reject)}()}i.promise.then(function(){a=null,e?t._renderTimer=setTimeout(function(){r(t),t._renderTimer=null},e):r(t)},this._capability.reject)},expandTextDivs:function(e){if(this._enhanceTextSelection&&this._renderingDone){null!==this._bounds&&(a(this),this._bounds=null);for(var t=0,r=this._textDivs.length;t<r;t++){var n=this._textDivs[t],o=this._textDivProperties.get(n);if(!o.isWhitespace)if(e){var s="",l="";1!==o.scale&&(s="scaleX("+o.scale+")"),0!==o.angle&&(s="rotate("+o.angle+"deg) "+s),0!==o.paddingLeft&&(l+=" padding-left: "+o.paddingLeft/o.scale+"px;",s+=" translateX("+-o.paddingLeft/o.scale+"px)"),0!==o.paddingTop&&(l+=" padding-top: "+o.paddingTop+"px;",s+=" translateY("+-o.paddingTop+"px)"),0!==o.paddingRight&&(l+=" padding-right: "+o.paddingRight/o.scale+"px;"),0!==o.paddingBottom&&(l+=" padding-bottom: "+o.paddingBottom+"px;"),""!==l&&n.setAttribute("style",o.style+l),""!==s&&i.CustomStyle.setProp("transform",n,s)}else n.style.padding=0,i.CustomStyle.setProp("transform",n,o.originalTransform||"")}}}},c}();t.renderTextLayer=a},function(e,t,r){"use strict";var n,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":i(window))&&(n=window)}e.exports=n},function(e,t,r){"use strict";function n(e){return e.replace(/>\\376\\377([^<]+)/g,function(e,t){for(var r=t.replace(/\\([0-3])([0-7])([0-7])/g,function(e,t,r,n){return String.fromCharCode(64*t+8*r+1*n)}),n="",i=0;i<r.length;i+=2){var a=256*r.charCodeAt(i)+r.charCodeAt(i+1);n+=a>=32&&a<127&&60!==a&&62!==a&&38!==a?String.fromCharCode(a):"&#x"+(65536+a).toString(16).substring(1)+";"}return">"+n})}function i(e){if("string"==typeof e){e=n(e);e=(new DOMParser).parseFromString(e,"application/xml")}else e instanceof Document||(0,a.error)("Metadata: Invalid metadata object");this.metaDocument=e,this.metadata=Object.create(null),this.parse()}Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var a=r(0);i.prototype={parse:function(){var e=this.metaDocument,t=e.documentElement;if("rdf:rdf"!==t.nodeName.toLowerCase())for(t=t.firstChild;t&&"rdf:rdf"!==t.nodeName.toLowerCase();)t=t.nextSibling;var r=t?t.nodeName.toLowerCase():null;if(t&&"rdf:rdf"===r&&t.hasChildNodes()){var n,i,a,o,s,l,c,u=t.childNodes;for(o=0,l=u.length;o<l;o++)if(n=u[o],"rdf:description"===n.nodeName.toLowerCase())for(s=0,c=n.childNodes.length;s<c;s++)"#text"!==n.childNodes[s].nodeName.toLowerCase()&&(i=n.childNodes[s],a=i.nodeName.toLowerCase(),this.metadata[a]=i.textContent.trim())}},get:function(e){return this.metadata[e]||null},has:function(e){return void 0!==this.metadata[e]}},t.Metadata=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLUtils=void 0;var n=r(1),i=r(0),a=function(){function e(e,t,r){var n=e.createShader(r);if(e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS)){var i=e.getShaderInfoLog(n);throw new Error("Error during shader compilation: "+i)}return n}function t(t,r){return e(t,r,t.VERTEX_SHADER)}function r(t,r){return e(t,r,t.FRAGMENT_SHADER)}function a(e,t){for(var r=e.createProgram(),n=0,i=t.length;n<i;++n)e.attachShader(r,t[n]);if(e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS)){var a=e.getProgramInfoLog(r);throw new Error("Error during program linking: "+a)}return r}function o(e,t,r){e.activeTexture(r);var n=e.createTexture();ret
return!1===a(this)?Promise.reject(B("abort")):!0===o(this)?Promise.reject(new TypeError("Cannot abort a stream that already has a writer")):s(this,e)}},{key:"getWriter",value:function(){if(!1===a(this))throw B("getWriter");return i(this)}},{key:"locked",get:function(){if(!1===a(this))throw B("locked");return o(this)}}]),e}();e.exports={AcquireWritableStreamDefaultWriter:i,IsWritableStream:a,IsWritableStreamLocked:o,WritableStream:be,WritableStreamAbort:s,WritableStreamDefaultControllerError:q,WritableStreamDefaultWriterCloseWithErrorPropagation:C,WritableStreamDefaultWriterRelease:R,WritableStreamDefaultWriterWrite:E,WritableStreamCloseQueuedOrInFlight:g};var ye=function(){function e(t){if(n(this,e),!1===a(t))throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===o(t))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=t,t._writer=this;var r=t._state;if("writable"===r)!1===g(t)&&!0===t._backpressure?K(this):$(this),X(this);else if("erroring"===r)Z(this,t._storedError),this._readyPromise.catch(function(){}),X(this);else if("closed"===r)$(this),Y(this);else{de("errored"===r,"state must be errored");var i=t._storedError;Z(this,i),this._readyPromise.catch(function(){}),H(this,i),this._closedPromise.catch(function(){})}}return ie(e,[{key:"abort",value:function(e){return!1===S(this)?Promise.reject(z("abort")):void 0===this._ownerWritableStream?Promise.reject(G("abort")):w(this,e)}},{key:"close",value:function(){if(!1===S(this))return Promise.reject(z("close"));var e=this._ownerWritableStream;return void 0===e?Promise.reject(G("close")):!0===g(e)?Promise.reject(new TypeError("cannot close an already-closing stream")):P(this)}},{key:"releaseLock",value:function(){if(!1===S(this))throw z("releaseLock");var e=this._ownerWritableStream;void 0!==e&&(de(void 0!==e._writer),R(this))}},{key:"write",value:function(e){return!1===S(this)?Promise.reject(z("write")):void 0===this._ownerWritableStream?Promise.reject(G("write to")):E(this,e)}},{key:"closed",get:function(){return!1===S(this)?Promise.reject(z("closed")):this._closedPromise}},{key:"desiredSize",get:function(){if(!1===S(this))throw z("desiredSize");if(void 0===this._ownerWritableStream)throw G("desiredSize");return T(this)}},{key:"ready",get:function(){return!1===S(this)?Promise.reject(z("ready")):this._readyPromise}}]),e}(),_e=function(){function e(t,r,i,o){if(n(this,e),!1===a(t))throw new TypeError("WritableStreamDefaultController can only be constructed with a WritableStream instance");if(void 0!==t._writableStreamController)throw new TypeError("WritableStreamDefaultController instances can only be created by the WritableStream constructor");this._controlledWritableStream=t,this._underlyingSink=r,this._queue=void 0,this._queueTotalSize=void 0,ve(this),this._started=!1;var s=le(i,o);this._strategySize=s.size,this._strategyHWM=s.highWaterMark,A(t,U(this))}return ie(e,[{key:"error",value:function(e){if(!1===D(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&q(this,e)}},{key:"__abortSteps",value:function(e){return se(this._underlyingSink,"abort",[e])}},{key:"__errorSteps",value:function(){ve(this)}},{key:"__startSteps",value:function(){var e=this,t=oe(this._underlyingSink,"start",[this]),r=this._controlledWritableStream;Promise.resolve(t).then(function(){de("writable"===r._state||"erroring"===r._state),e._started=!0,F(e)},function(t){de("writable"===r._state||"erroring"===r._state),e._started=!0,c(r,t)}).catch(he)}}]),e}()},function(e,t,r){var n=r(0),i=n.IsFiniteNonNegativeNumber,a=r(1),o=a.assert;t.DequeueValue=function(e){o("_queue"in e&&"_queueTotalSize"in e,"Spec-level failure: DequeueValue should only be used on containers with [[queue]] and [[queueTotalSize]]."),o(e._queue.length>0,"Spec-level failure: should never dequeue from an empty queue.");var t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTota
t.WritableStreamDefaultWriterCloseWithErrorPropagation=a.WritableStreamDefaultWriterCloseWithErrorPropagation,t.WritableStreamDefaultWriterRelease=a.WritableStreamDefaultWriterRelease,t.WritableStreamDefaultWriterWrite=a.WritableStreamDefaultWriterWrite},function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){if(!0===e._errored)throw new TypeError("TransformStream is already errored");if(!0===e._readableClosed)throw new TypeError("Readable side is already closed");s(e)}function a(e,t){if(!0===e._errored)throw new TypeError("TransformStream is already errored");if(!0===e._readableClosed)throw new TypeError("Readable side is already closed");var r=e._readableController;try{R(r,t)}catch(t){throw e._readableClosed=!0,l(e,t),e._storedError}!0==I(r)<=0&&!1===e._backpressure&&d(e,!0)}function o(e,t){if(!0===e._errored)throw new TypeError("TransformStream is already errored");c(e,t)}function s(e){_(!1===e._errored),_(!1===e._readableClosed);try{T(e._readableController)}catch(e){_(!1)}e._readableClosed=!0}function l(e,t){!1===e._errored&&c(e,t)}function c(e,t){_(!1===e._errored),e._errored=!0,e._storedError=t,!1===e._writableDone&&j(e._writableController,t),!1===e._readableClosed&&E(e._readableController,t)}function u(e){return _(void 0!==e._backpressureChangePromise,"_backpressureChangePromise should have been initialized"),!1===e._backpressure?Promise.resolve():(_(!0===e._backpressure,"_backpressure should have been initialized"),e._backpressureChangePromise)}function d(e,t){_(e._backpressure!==t,"TransformStreamSetBackpressure() should be called only when backpressure is changed"),void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(t),e._backpressureChangePromise=new Promise(function(t){e._backpressureChangePromise_resolve=t}),e._backpressureChangePromise.then(function(e){_(e!==t,"_backpressureChangePromise should be fulfilled only when backpressure is changed")}),e._backpressure=t}function h(e,t){return a(t._controlledTransformStream,e),Promise.resolve()}function f(e,t){_(!1===e._errored),_(!1===e._transforming),_(!1===e._backpressure),e._transforming=!0;var r=e._transformer,n=e._transformStreamController;return w(r,"transform",[t,n],h,[t,n]).then(function(){return e._transforming=!1,u(e)},function(t){return l(e,t),Promise.reject(t)})}function p(e){return!!C(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function m(e){return!!C(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function g(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function v(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}var b=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),y=r(1),_=y.assert,A=r(0),S=A.InvokeOrNoop,w=A.PromiseInvokeOrPerformFallback,P=A.PromiseInvokeOrNoop,C=A.typeIsObject,x=r(4),k=x.ReadableStream,T=x.ReadableStreamDefaultControllerClose,R=x.ReadableStreamDefaultControllerEnqueue,E=x.ReadableStreamDefaultControllerError,I=x.ReadableStreamDefaultControllerGetDesiredSize,L=r(2),O=L.WritableStream,j=L.WritableStreamDefaultControllerError,D=function(){function e(t,r){n(this,e),this._transformStream=t,this._startPromise=r}return b(e,[{key:"start",value:function(e){var t=this._transformStream;return t._writableController=e,this._startPromise.then(function(){return u(t)})}},{key:"write",value:function(e){return f(this._transformStream,e)}},{key:"abort",value:function(){var e=this._transformStream;e._writableDone=!0,c(e,new TypeError("Writable side aborted"))}},{key:"close",value:function(){var e=this._transformStream;return _(!1===e._transforming),e._writableDone=!0,P(e._transformer,"flush",[e._transformStreamController]).then(function(){return!0===e._errored?Promise.reject(e._st
u.fillStyle=s?o.getPattern(u,this):o,u.fillRect(0,0,n,a),u.restore(),this.paintInlineImageXObject(c.canvas)},paintImageMaskXObjectRepeat:function(e,t,n,i){var a=e.width,o=e.height,s=this.current.fillColor,l=this.current.patternFill,c=this.cachedCanvases.getCanvas("maskCanvas",a,o),u=c.context;u.save(),r(u,e),u.globalCompositeOperation="source-in",u.fillStyle=l?s.getPattern(u,this):s,u.fillRect(0,0,a,o),u.restore();for(var d=this.ctx,h=0,f=i.length;h<f;h+=2)d.save(),d.transform(t,0,0,n,i[h],i[h+1]),d.scale(1,-1),d.drawImage(c.canvas,0,0,a,o,0,-1,1,1),d.restore()},paintImageMaskXObjectGroup:function(e){for(var t=this.ctx,n=this.current.fillColor,i=this.current.patternFill,a=0,o=e.length;a<o;a++){var s=e[a],l=s.width,c=s.height,u=this.cachedCanvases.getCanvas("maskCanvas",l,c),d=u.context;d.save(),r(d,s),d.globalCompositeOperation="source-in",d.fillStyle=i?n.getPattern(d,this):n,d.fillRect(0,0,l,c),d.restore(),t.save(),t.transform.apply(t,s.transform),t.scale(1,-1),t.drawImage(u.canvas,0,0,l,c,0,-1,1,1),t.restore()}},paintImageXObject:function(e){var t=this.objs.get(e);if(!t)return void(0,a.warn)("Dependent image isn't ready yet");this.paintInlineImageXObject(t)},paintImageXObjectRepeat:function(e,t,r,n){var i=this.objs.get(e);if(!i)return void(0,a.warn)("Dependent image isn't ready yet");for(var o=i.width,s=i.height,l=[],c=0,u=n.length;c<u;c+=2)l.push({transform:[t,0,0,r,n[c],n[c+1]],x:0,y:0,w:o,h:s});this.paintInlineImageXObjectGroup(i,l)},paintInlineImageXObject:function(e){var r=e.width,n=e.height,i=this.ctx;this.save(),i.scale(1/r,-1/n);var a,o,s=i.mozCurrentTransformInverse,l=s[0],c=s[1],u=Math.max(Math.sqrt(l*l+c*c),1),d=s[2],h=s[3],f=Math.max(Math.sqrt(d*d+h*h),1);if(e instanceof HTMLElement||!e.data)a=e;else{o=this.cachedCanvases.getCanvas("inlineImage",r,n);var p=o.context;t(p,e),a=o.canvas}for(var m=r,g=n,v="prescale1";u>2&&m>1||f>2&&g>1;){var b=m,y=g;u>2&&m>1&&(b=Math.ceil(m/2),u/=m/b),f>2&&g>1&&(y=Math.ceil(g/2),f/=g/y),o=this.cachedCanvases.getCanvas(v,b,y),p=o.context,p.clearRect(0,0,b,y),p.drawImage(a,0,0,m,g,0,0,b,y),a=o.canvas,m=b,g=y,v="prescale1"===v?"prescale2":"prescale1"}if(i.drawImage(a,0,0,m,g,0,-n,r,n),this.imageLayer){var _=this.getCanvasPosition(0,-n);this.imageLayer.appendImage({imgData:e,left:_[0],top:_[1],width:r/s[0],height:n/s[3]})}this.restore()},paintInlineImageXObjectGroup:function(e,r){var n=this.ctx,i=e.width,a=e.height,o=this.cachedCanvases.getCanvas("inlineImage",i,a);t(o.context,e);for(var s=0,l=r.length;s<l;s++){var c=r[s];if(n.save(),n.transform.apply(n,c.transform),n.scale(1,-1),n.drawImage(o.canvas,c.x,c.y,c.w,c.h,0,-1,1,1),this.imageLayer){var u=this.getCanvasPosition(c.x,c.y);this.imageLayer.appendImage({imgData:e,left:u[0],top:u[1],width:i,height:a})}n.restore()}},paintSolidColorImageMask:function(){this.ctx.fillRect(0,0,1,1)},paintXObject:function(){(0,a.warn)("Unsupported 'paintXObject' command.")},markPoint:function(e){},markPointProps:function(e,t){},beginMarkedContent:function(e){},beginMarkedContentProps:function(e,t){},endMarkedContent:function(){},beginCompat:function(){},endCompat:function(){},consumePath:function(){var e=this.ctx;this.pendingClip&&(this.pendingClip===S?e.clip("evenodd"):e.clip(),this.pendingClip=null),e.beginPath()},getSinglePixelWidth:function(e){if(null===this.cachedGetSinglePixelWidth){this.ctx.save();var t=this.ctx.mozCurrentTransformInverse;this.ctx.restore(),this.cachedGetSinglePixelWidth=Math.sqrt(Math.max(t[0]*t[0]+t[1]*t[1],t[2]*t[2]+t[3]*t[3]))}return this.cachedGetSinglePixelWidth},getCanvasPosition:function(e,t){var r=this.ctx.mozCurrentTransform;return[r[0]*e+r[2]*t+r[4],r[1]*e+r[3]*t+r[5]]}};for(var w in a.OPS)e.prototype[a.OPS[w]]=e.prototype[w];return e}();t.CanvasGraphics=h},function(e,t,r){"use strict";function n(e){this.docId=e,this.styleElement=null,this.nativeFontFaces=[],this.loadTestFontId=0,this.loadingContext={requests:[],nextRequestId:0}}Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var i=r(0);n.prototype={insertRule:function(e){var t=this.styleElement;t||(t=this.styleElement=document
c="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!==this._scheme&&(this._scheme=s._scheme),_===p){this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._username=s._username,this._password=s._password;break e}if("/"===_||"\\"===_)"\\"===_&&l("\\ is an invalid code point."),c="relative slash";else if("?"===_)this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query="?",this._username=s._username,this._password=s._password,c="query";else{if("#"!==_){var A=t[u+1],S=t[u+2];("file"!==this._scheme||!m.test(_)||":"!==A&&"|"!==A||S!==p&&"/"!==S&&"\\"!==S&&"?"!==S&&"#"!==S)&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password,this._path=s._path.slice(),this._path.pop()),c="relative path";continue}this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._fragment="#",this._username=s._username,this._password=s._password,c="fragment"}break;case"relative slash":if("/"!==_&&"\\"!==_){"file"!==this._scheme&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password),c="relative path";continue}"\\"===_&&l("\\ is an invalid code point."),c="file"===this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!==_){l("Expected '/', got: "+_),c="authority ignore slashes";continue}c="authority second slash";break;case"authority second slash":if(c="authority ignore slashes","/"!==_){l("Expected '/', got: "+_);continue}break;case"authority ignore slashes":if("/"!==_&&"\\"!==_){c="authority";continue}l("Expected authority, got: "+_);break;case"authority":if("@"===_){v&&(l("@ already seen."),d+="%40"),v=!0;for(var w=0;w<d.length;w++){var P=d[w];if("\t"!==P&&"\n"!==P&&"\r"!==P)if(":"!==P||null!==this._password){var C=a(P);null!==this._password?this._password+=C:this._username+=C}else this._password="";else l("Invalid whitespace in authority.")}d=""}else{if(_===p||"/"===_||"\\"===_||"?"===_||"#"===_){u-=d.length,d="",c="host";continue}d+=_}break;case"file host":if(_===p||"/"===_||"\\"===_||"?"===_||"#"===_){2!==d.length||!m.test(d[0])||":"!==d[1]&&"|"!==d[1]?0===d.length?c="relative path start":(this._host=i.call(this,d),d="",c="relative path start"):c="relative path";continue}"\t"===_||"\n"===_||"\r"===_?l("Invalid whitespace in file host."):d+=_;break;case"host":case"hostname":if(":"!==_||b){if(_===p||"/"===_||"\\"===_||"?"===_||"#"===_){if(this._host=i.call(this,d),d="",c="relative path start",r)break e;continue}"\t"!==_&&"\n"!==_&&"\r"!==_?("["===_?b=!0:"]"===_&&(b=!1),d+=_):l("Invalid code point in host/hostname: "+_)}else if(this._host=i.call(this,d),d="",c="port","hostname"===r)break e;break;case"port":if(/[0-9]/.test(_))d+=_;else{if(_===p||"/"===_||"\\"===_||"?"===_||"#"===_||r){if(""!==d){var x=parseInt(d,10);x!==h[this._scheme]&&(this._port=x+""),d=""}if(r)break e;c="relative path start";continue}"\t"===_||"\n"===_||"\r"===_?l("Invalid code point in port: "+_):n.call(this)}break;case"relative path start":if("\\"===_&&l("'\\' not allowed in path."),c="relative path","/"!==_&&"\\"!==_)continue;break;case"relative path":if(_!==p&&"/"!==_&&"\\"!==_&&(r||"?"!==_&&"#"!==_))"\t"!==_&&"\n"!==_&&"\r"!==_&&(d+=a(_));else{"\\"===_&&l("\\ not allowed in relative path.");var k;(k=f[d.toLowerCase()])&&(d=k),".."===d?(this._path.pop(),"/"!==_&&"\\"!==_&&this._path.push("")):"."===d&&"/"!==_&&"\\"!==_?this._path.push(""):"."!==d&&("file"===this._scheme&&0===this._path.length&&2===d.length&&m.test(d[0])&&"|"===d[1]&&(d=d[0]+":"),this._path.push(d)),d="","?"===_?(this._query="?",c="query"):"#"===_&&(this._fragment="#",c="fragment")}break;case"query":r||"#"!==_?_!==p&&"\t"!==_&&"\n"!==_&&"\r"!==_&&(this._query+=o(_)):(this._fragment="#",c="fragment");break;case"fragment":_!==p&&"\t"!==_&&"\n"!==_&&"\r"!==_&&(this._fragment+=_)}u++}}function l(){this._scheme="",this._schemeData="",this._username="",this._password=null,this._host="",this._port="",this._path=[],this._query="",this._fragment="",this._isInvalid=!1,this._isRelative=!1}fu