UNPKG

react-typescript-pdf-reader-built

Version:
1 lines 726 kB
webpackJsonp([0],{64:function(e,t,r){(function(t,r){!function(t,r){e.exports=r()}(0,function(){return function(e){function t(a){if(r[a])return r[a].exports;var i=r[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,a){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:a})},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=71)}([function(e,r,a){"use strict";function i(e){se=e}function n(){return se}function o(e){se>=ie.infos&&console.log("Info: "+e)}function s(e){se>=ie.warnings&&console.log("Warning: "+e)}function c(e){console.log("Deprecated API usage: "+e)}function l(e){throw new Error(e)}function u(e,t){e||l(t)}function h(e,t){try{var r=new URL(e);if(!r.origin||"null"===r.origin)return!1}catch(e){return!1}var a=new URL(t,r);return r.origin===a.origin}function f(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function d(e,t){if(!e)return null;try{var r=t?new URL(e,t):new URL(e);if(f(r))return r}catch(e){}return null}function g(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 p(e){return"string"!==typeof e?(s("The argument for removeNullCharacters must be a string."),e):e.replace(we,"")}function b(e){u(null!==e&&"object"===("undefined"===typeof e?"undefined":X(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=[],a=0;a<t;a+=8192){var i=Math.min(a+8192,t),n=e.subarray(a,i);r.push(String.fromCharCode.apply(null,n))}return r.join("")}function v(e){u("string"===typeof e,"Invalid argument for stringToBytes");for(var t=e.length,r=new Uint8Array(t),a=0;a<t;++a)r[a]=255&e.charCodeAt(a);return r}function y(e){return void 0!==e.length?e.length:(u(void 0!==e.byteLength),e.byteLength)}function w(e){if(1===e.length&&e[0]instanceof Uint8Array)return e[0];var t,r,a,i=0,n=e.length;for(t=0;t<n;t++)r=e[t],a=y(r),i+=a;var o=0,s=new Uint8Array(i);for(t=0;t<n;t++)r=e[t],r instanceof Uint8Array||(r="string"===typeof r?v(r):new Uint8Array(r)),a=r.byteLength,s.set(r,o),o+=a;return s}function k(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 C(e,t){return e[t]<<24>>24}function x(e,t){return e[t]<<8|e[t+1]}function A(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function _(){var e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}function P(){try{return new Function(""),!0}catch(e){return!1}}function I(e){var t,r=e.length,a=[];if("\xfe"===e[0]&&"\xff"===e[1])for(t=2;t<r;t+=2)a.push(String.fromCharCode(e.charCodeAt(t)<<8|e.charCodeAt(t+1)));else for(t=0;t<r;++t){var i=xe[e.charCodeAt(t)];a.push(i?String.fromCharCode(i):e.charAt(t))}return a.join("")}function O(e){return decodeURIComponent(escape(e))}function T(e){return unescape(encodeURIComponent(e))}function E(e){for(var t in e)return!1;return!0}function F(e){return"boolean"===typeof e}function R(e){return"number"===typeof e}function B(e){return"string"===typeof e}function M(e){return"object"===("undefined"===typeof e?"undefined":X(e))&&null!==e&&void 0!==e.byteLength}function D(e){return 32===e||9===e||13===e||10===e}function N(){return"object"===("undefined"===typeof t?"undefined":X(t))&&t+""==="[object process]"}function L(){var e={};return e.promise=new Promise(function(t,r){e.resolve=t,e.reject=r}),e}function j(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return e?new Promise(function(a,i){a(e.apply(r,t))}):Promise.resolve(void 0)}function U(e){if("object"!==("undefined"===typeof e?"undefined":X(e)))return e;switch(e.name){case"AbortException":return new ye(e.message);case"MissingPDFException":return new de(e.message);case"UnexpectedResponseException":return new ge(e.message,e.status);default:return new he(e.message,e.details)}}function q(e){return!(e instanceof Error)||e instanceof ye||e instanceof de||e instanceof ge||e instanceof he?e:new he(e.message,e.toString())}function z(e,t,r){t?e.resolve():e.reject(r)}function H(e){return Promise.resolve(e).catch(function(){})}function G(e,t,r){var a=this;this.sourceName=e,this.targetName=t,this.comObj=r,this.callbackId=1,this.streamId=1,this.postMessageTransfers=!0,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null);var i=this.callbacksCapabilities=Object.create(null),n=this.actionHandler=Object.create(null);this._onComObjOnMessage=function(e){var t=e.data;if(t.targetName===a.sourceName)if(t.stream)a._processStreamMessage(t);else if(t.isReply){var o=t.callbackId;if(!(t.callbackId in i))throw new Error("Cannot resolve callback "+o);var s=i[o];delete i[o],"error"in t?s.reject(U(t.error)):s.resolve(t.data)}else{if(!(t.action in n))throw new Error("Unknown action from worker: "+t.action);var c=n[t.action];if(t.callbackId){var l=a.sourceName,u=t.sourceName;Promise.resolve().then(function(){return c[0].call(c[1],t.data)}).then(function(e){r.postMessage({sourceName:l,targetName:u,isReply:!0,callbackId:t.callbackId,data:e})},function(e){r.postMessage({sourceName:l,targetName:u,isReply:!0,callbackId:t.callbackId,error:q(e)})})}else t.streamId?a._createStreamSink(t):c[0].call(c[1],t.data)}},r.addEventListener("message",this._onComObjOnMessage)}function W(e,t,r){var a=new Image;a.onload=function(){r.resolve(e,a)},a.onerror=function(){r.resolve(e,null),s("Error during JPEG image loading")},a.src=t}Object.defineProperty(r,"__esModule",{value:!0}),r.unreachable=r.warn=r.utf8StringToString=r.stringToUTF8String=r.stringToPDFString=r.stringToBytes=r.string32=r.shadow=r.setVerbosityLevel=r.ReadableStream=r.removeNullCharacters=r.readUint32=r.readUint16=r.readInt8=r.log2=r.loadJpegStream=r.isEvalSupported=r.isLittleEndian=r.createValidAbsoluteUrl=r.isSameOrigin=r.isNodeJS=r.isSpace=r.isString=r.isNum=r.isEmptyObj=r.isBool=r.isArrayBuffer=r.info=r.getVerbosityLevel=r.getLookupTableFactory=r.deprecated=r.createObjectURL=r.createPromiseCapability=r.createBlob=r.bytesToString=r.assert=r.arraysToBytes=r.arrayByteLength=r.FormatError=r.XRefParseException=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.StreamType=r.StatTimer=r.PasswordResponses=r.PasswordException=r.PageViewport=r.NotImplementedException=r.NativeImageDecoding=r.MissingPDFException=r.MissingDataException=r.MessageHandler=r.InvalidPDFException=r.AbortException=r.CMapCompressionType=r.ImageKind=r.FontType=r.AnnotationType=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationBorderStyleType=r.UNSUPPORTED_FEATURES=r.VERBOSITY_LEVELS=r.OPS=r.IDENTITY_MATRIX=r.FONT_IDENTITY_MATRIX=void 0;var X="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};a(73);var V=a(121),Y=[.001,0,0,.001,0,0],K={NONE:"none",DECODE:"decode",DISPLAY:"display"},J={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Z={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Q={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},$={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},ee={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},te={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},re={UNKNOWN:0,FLATE:1,LZW:2,DCT:3,JPX:4,JBIG:5,A85:6,AHX:7,CCF:8,RL:9},ae={UNKNOWN:0,TYPE1:1,TYPE1C:2,CIDFONTTYPE0:3,CIDFONTTYPE0C:4,TRUETYPE:5,CIDFONTTYPE2:6,TYPE3:7,OPENTYPE:8,TYPE0:9,MMTYPE1:10},ie={errors:0,warnings:1,infos:5},ne={NONE:0,BINARY:1,STREAM:2},oe={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},se=ie.warnings,ce={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"},le={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},ue=function(){function e(e,t){this.name="PasswordException",this.message=e,this.code=t}return e.prototype=new Error,e.constructor=e,e}(),he=function(){function e(e,t){this.name="UnknownErrorException",this.message=e,this.details=t}return e.prototype=new Error,e.constructor=e,e}(),fe=function(){function e(e){this.name="InvalidPDFException",this.message=e}return e.prototype=new Error,e.constructor=e,e}(),de=function(){function e(e){this.name="MissingPDFException",this.message=e}return e.prototype=new Error,e.constructor=e,e}(),ge=function(){function e(e,t){this.name="UnexpectedResponseException",this.message=e,this.status=t}return e.prototype=new Error,e.constructor=e,e}(),me=function(){function e(e){this.message=e}return e.prototype=new Error,e.prototype.name="NotImplementedException",e.constructor=e,e}(),pe=function(){function e(e,t){this.begin=e,this.end=t,this.message="Missing data ["+e+", "+t+")"}return e.prototype=new Error,e.prototype.name="MissingDataException",e.constructor=e,e}(),be=function(){function e(e){this.message=e}return e.prototype=new Error,e.prototype.name="XRefParseException",e.constructor=e,e}(),ve=function(){function e(e){this.message=e}return e.prototype=new Error,e.prototype.name="FormatError",e.constructor=e,e}(),ye=function(){function e(e){this.name="AbortException",this.message=e}return e.prototype=new Error,e.constructor=e,e}(),we=/\x00/g,ke=[1,0,0,1,0,0],Se=function(){function e(){}var t=["rgb(",0,",",0,",",0,")"];e.makeCssRgb=function(e,r,a){return t[1]=e,t[3]=r,t[5]=a,t.join("")},e.transform=function(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]},e.applyTransform=function(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]},e.applyInverseTransform=function(e,t){var r=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/r,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/r]},e.getAxialAlignedBoundingBox=function(t,r){var a=e.applyTransform(t,r),i=e.applyTransform(t.slice(2,4),r),n=e.applyTransform([t[0],t[3]],r),o=e.applyTransform([t[2],t[1]],r);return[Math.min(a[0],i[0],n[0],o[0]),Math.min(a[1],i[1],n[1],o[1]),Math.max(a[0],i[0],n[0],o[0]),Math.max(a[1],i[1],n[1],o[1])]},e.inverseTransform=function(e){var t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]},e.apply3dTransform=function(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]},e.singularValueDecompose2dScale=function(e){var t=[e[0],e[2],e[1],e[3]],r=e[0]*t[0]+e[1]*t[2],a=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],n=e[2]*t[1]+e[3]*t[3],o=(r+n)/2,s=Math.sqrt((r+n)*(r+n)-4*(r*n-i*a))/2,c=o+s||1,l=o-s||1;return[Math.sqrt(c),Math.sqrt(l)]},e.normalizeRect=function(e){var t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t},e.intersect=function(t,r){function a(e,t){return e-t}var i=[t[0],t[2],r[0],r[2]].sort(a),n=[t[1],t[3],r[1],r[3]].sort(a),o=[];return t=e.normalizeRect(t),r=e.normalizeRect(r),(i[0]===t[0]&&i[1]===r[0]||i[0]===r[0]&&i[1]===t[0])&&(o[0]=i[1],o[2]=i[2],(n[0]===t[1]&&n[1]===r[1]||n[0]===r[1]&&n[1]===t[1])&&(o[1]=n[1],o[3]=n[2],o))};var r=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];return e.toRoman=function(e,t){u(Number.isInteger(e)&&e>0,"The number should be a positive integer.");for(var a,i=[];e>=1e3;)e-=1e3,i.push("M");a=e/100|0,e%=100,i.push(r[a]),a=e/10|0,e%=10,i.push(r[10+a]),i.push(r[20+e]);var n=i.join("");return t?n.toLowerCase():n},e.appendToArray=function(e,t){Array.prototype.push.apply(e,t)},e.prependToArray=function(e,t){Array.prototype.unshift.apply(e,t)},e.extendObj=function(e,t){for(var r in t)e[r]=t[r]},e.getInheritableProperty=function(e,t,r){for(;e&&!e.has(t);)e=e.get("Parent");return e?r?e.getArray(t):e.get(t):null},e.inherit=function(e,t,r){e.prototype=Object.create(t.prototype),e.prototype.constructor=e;for(var a in r)e.prototype[a]=r[a]},e.loadScript=function(e,t){var r=document.createElement("script"),a=!1;r.setAttribute("src",e),t&&(r.onload=function(){a||t(),a=!0}),document.getElementsByTagName("head")[0].appendChild(r)},e}(),Ce=function(){function e(e,t,r,a,i,n){this.viewBox=e,this.scale=t,this.rotation=r,this.offsetX=a,this.offsetY=i;var o,s,c,l,u=(e[2]+e[0])/2,h=(e[3]+e[1])/2;switch(r%=360,r=r<0?r+360:r){case 180:o=-1,s=0,c=0,l=1;break;case 90:o=0,s=1,c=1,l=0;break;case 270:o=0,s=-1,c=-1,l=0;break;default:o=1,s=0,c=0,l=-1}n&&(c=-c,l=-l);var f,d,g,m;0===o?(f=Math.abs(h-e[1])*t+a,d=Math.abs(u-e[0])*t+i,g=Math.abs(e[3]-e[1])*t,m=Math.abs(e[2]-e[0])*t):(f=Math.abs(u-e[0])*t+a,d=Math.abs(h-e[1])*t+i,g=Math.abs(e[2]-e[0])*t,m=Math.abs(e[3]-e[1])*t),this.transform=[o*t,s*t,c*t,l*t,f-o*t*u-c*t*h,d-s*t*u-l*t*h],this.width=g,this.height=m,this.fontScale=t}return e.prototype={clone:function(t){t=t||{};var r="scale"in t?t.scale:this.scale,a="rotation"in t?t.rotation:this.rotation;return new e(this.viewBox.slice(),r,a,this.offsetX,this.offsetY,t.dontFlip)},convertToViewportPoint:function(e,t){return Se.applyTransform([e,t],this.transform)},convertToViewportRectangle:function(e){var t=Se.applyTransform([e[0],e[1]],this.transform),r=Se.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],r[0],r[1]]},convertToPdfPoint:function(e,t){return Se.applyInverseTransform([e,t],this.transform)}},e}(),xe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364],Ae=function(){function e(e,t,r){for(;e.length<r;)e+=t;return e}function t(){this.started=Object.create(null),this.times=[],this.enabled=!0}return t.prototype={time:function(e){this.enabled&&(e in this.started&&s("Timer is already running for "+e),this.started[e]=Date.now())},timeEnd:function(e){this.enabled&&(e in this.started||s("Timer has not been started for "+e),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e])},toString:function(){var t,r,a=this.times,i="",n=0;for(t=0,r=a.length;t<r;++t){var o=a[t].name;o.length>n&&(n=o.length)}for(t=0,r=a.length;t<r;++t){var s=a[t],c=s.end-s.start;i+=e(s.name," ",n)+" "+c+"ms\n"}return i}},t}(),_e=function(e,t){if("undefined"!==typeof Blob)return new Blob([e],{type:t});throw new Error('The "Blob" constructor is not supported.')},Pe=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,r){if(!(arguments.length>2&&void 0!==arguments[2]&&arguments[2])&&URL.createObjectURL){var a=_e(t,r);return URL.createObjectURL(a)}for(var i="data:"+r+";base64,",n=0,o=t.length;n<o;n+=3){var s=255&t[n],c=255&t[n+1],l=255&t[n+2];i+=e[s>>2]+e[(3&s)<<4|c>>4]+e[n+1<o?(15&c)<<2|l>>6:64]+e[n+2<o?63&l:64]}return i}}();G.prototype={on:function(e,t,r){var a=this.actionHandler;if(a[e])throw new Error('There is already an actionName called "'+e+'"');a[e]=[t,r]},send:function(e,t,r){var a={sourceName:this.sourceName,targetName:this.targetName,action:e,data:t};this.postMessage(a,r)},sendWithPromise:function(e,t,r){var a=this.callbackId++,i={sourceName:this.sourceName,targetName:this.targetName,action:e,data:t,callbackId:a},n=L();this.callbacksCapabilities[a]=n;try{this.postMessage(i,r)}catch(e){n.reject(e)}return n.promise},sendWithStream:function(e,t,r,a){var i=this,n=this.streamId++,o=this.sourceName,s=this.targetName;return new V.ReadableStream({start:function(r){var a=L();return i.streamControllers[n]={controller:r,startCall:a,isClosed:!1},i.postMessage({sourceName:o,targetName:s,action:e,streamId:n,data:t,desiredSize:r.desiredSize}),a.promise},pull:function(e){var t=L();return i.streamControllers[n].pullCall=t,i.postMessage({sourceName:o,targetName:s,stream:"pull",streamId:n,desiredSize:e.desiredSize}),t.promise},cancel:function(e){var t=L();return i.streamControllers[n].cancelCall=t,i.streamControllers[n].isClosed=!0,i.postMessage({sourceName:o,targetName:s,stream:"cancel",reason:e,streamId:n}),t.promise}},r)},_createStreamSink:function(e){var t=this,r=this,a=this.actionHandler[e.action],i=e.streamId,n=e.desiredSize,o=this.sourceName,s=e.sourceName,c=L(),l=function(e){var r=e.stream,a=e.chunk,n=e.transfers,c=e.success,l=e.reason;t.postMessage({sourceName:o,targetName:s,stream:r,streamId:i,chunk:a,success:c,reason:l},n)},u={enqueue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments[2];if(!this.isCancelled){var a=this.desiredSize;this.desiredSize-=t,a>0&&this.desiredSize<=0&&(this.sinkCapability=L(),this.ready=this.sinkCapability.promise),l({stream:"enqueue",chunk:e,transfers:r})}},close:function(){this.isCancelled||(this.isCancelled=!0,l({stream:"close"}),delete r.streamSinks[i])},error:function(e){this.isCancelled||(this.isCancelled=!0,l({stream:"error",reason:e}))},sinkCapability:c,onPull:null,onCancel:null,isCancelled:!1,desiredSize:n,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[i]=u,j(a[0],[e.data,u],a[1]).then(function(){l({stream:"start_complete",success:!0})},function(e){l({stream:"start_complete",success:!1,reason:e})})},_processStreamMessage:function(e){var t=this,r=this.sourceName,a=e.sourceName,i=e.streamId,n=function(e){var n=e.stream,o=e.success,s=e.reason;t.comObj.postMessage({sourceName:r,targetName:a,stream:n,success:o,streamId:i,reason:s})},o=function(){Promise.all([t.streamControllers[e.streamId].startCall,t.streamControllers[e.streamId].pullCall,t.streamControllers[e.streamId].cancelCall].map(function(e){return e&&H(e.promise)})).then(function(){delete t.streamControllers[e.streamId]})};switch(e.stream){case"start_complete":z(this.streamControllers[e.streamId].startCall,e.success,U(e.reason));break;case"pull_complete":z(this.streamControllers[e.streamId].pullCall,e.success,U(e.reason));break;case"pull":if(!this.streamSinks[e.streamId]){n({stream:"pull_complete",success:!0});break}this.streamSinks[e.streamId].desiredSize<=0&&e.desiredSize>0&&this.streamSinks[e.streamId].sinkCapability.resolve(),this.streamSinks[e.streamId].desiredSize=e.desiredSize,j(this.streamSinks[e.streamId].onPull).then(function(){n({stream:"pull_complete",success:!0})},function(e){n({stream:"pull_complete",success:!1,reason:e})});break;case"enqueue":u(this.streamControllers[e.streamId],"enqueue should have stream controller"),this.streamControllers[e.streamId].isClosed||this.streamControllers[e.streamId].controller.enqueue(e.chunk);break;case"close":if(u(this.streamControllers[e.streamId],"close should have stream controller"),this.streamControllers[e.streamId].isClosed)break;this.streamControllers[e.streamId].isClosed=!0,this.streamControllers[e.streamId].controller.close(),o();break;case"error":u(this.streamControllers[e.streamId],"error should have stream controller"),this.streamControllers[e.streamId].controller.error(U(e.reason)),o();break;case"cancel_complete":z(this.streamControllers[e.streamId].cancelCall,e.success,U(e.reason)),o();break;case"cancel":if(!this.streamSinks[e.streamId])break;j(this.streamSinks[e.streamId].onCancel,[U(e.reason)]).then(function(){n({stream:"cancel_complete",success:!0})},function(e){n({stream:"cancel_complete",success:!1,reason:e})}),this.streamSinks[e.streamId].sinkCapability.reject(U(e.reason)),this.streamSinks[e.streamId].isCancelled=!0,delete this.streamSinks[e.streamId];break;default:throw new Error("Unexpected stream case")}},postMessage:function(e,t){t&&this.postMessageTransfers?this.comObj.postMessage(e,t):this.comObj.postMessage(e)},destroy:function(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}},r.FONT_IDENTITY_MATRIX=Y,r.IDENTITY_MATRIX=ke,r.OPS=oe,r.VERBOSITY_LEVELS=ie,r.UNSUPPORTED_FEATURES=ce,r.AnnotationBorderStyleType=te,r.AnnotationFieldFlag=ee,r.AnnotationFlag=$,r.AnnotationType=Q,r.FontType=ae,r.ImageKind=Z,r.CMapCompressionType=ne,r.AbortException=ye,r.InvalidPDFException=fe,r.MessageHandler=G,r.MissingDataException=pe,r.MissingPDFException=de,r.NativeImageDecoding=K,r.NotImplementedException=me,r.PageViewport=Ce,r.PasswordException=ue,r.PasswordResponses=le,r.StatTimer=Ae,r.StreamType=re,r.TextRenderingMode=J,r.UnexpectedResponseException=ge,r.UnknownErrorException=he,r.Util=Se,r.XRefParseException=be,r.FormatError=ve,r.arrayByteLength=y,r.arraysToBytes=w,r.assert=u,r.bytesToString=b,r.createBlob=_e,r.createPromiseCapability=L,r.createObjectURL=Pe,r.deprecated=c,r.getLookupTableFactory=m,r.getVerbosityLevel=n,r.info=o,r.isArrayBuffer=M,r.isBool=F,r.isEmptyObj=E,r.isNum=R,r.isString=B,r.isSpace=D,r.isNodeJS=N,r.isSameOrigin=h,r.createValidAbsoluteUrl=d,r.isLittleEndian=_,r.isEvalSupported=P,r.loadJpegStream=W,r.log2=S,r.readInt8=C,r.readUint16=x,r.readUint32=A,r.removeNullCharacters=p,r.ReadableStream=V.ReadableStream,r.setVerbosityLevel=i,r.shadow=g,r.string32=k,r.stringToBytes=v,r.stringToPDFString=I,r.stringToUTF8String=O,r.utf8StringToString=T,r.warn=s,r.unreachable=l},function(e,t,r){"use strict";function a(e){return e===h}function i(e,t){return e instanceof f&&(void 0===t||e.name===t)}function n(e,t){return e instanceof d&&(void 0===t||e.cmd===t)}function o(e,t){return e instanceof g&&(void 0===t||i(e.get("Type"),t))}function s(e){return e instanceof m}function c(e,t){return e.num===t.num&&e.gen===t.gen}function l(e){return"object"===("undefined"===typeof e?"undefined":u(e))&&null!==e&&void 0!==e.getBytes}Object.defineProperty(t,"__esModule",{value:!0});var u="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h={},f=function(){function e(e){this.name=e}e.prototype={};var t=Object.create(null);return e.get=function(r){var a=t[r];return a||(t[r]=new e(r))},e}(),d=function(){function e(e){this.cmd=e}e.prototype={};var t=Object.create(null);return e.get=function(r){var a=t[r];return a||(t[r]=new e(r))},e}(),g=function(){function e(e){this._map=Object.create(null),this.xref=e,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=t}var t=function(){return t};return e.prototype={assignXref:function(e){this.xref=e},get:function(e,t,r){var a,i=this.xref,n=this.suppressEncryption;return"undefined"!==typeof(a=this._map[e])||e in this._map||"undefined"===typeof t?i?i.fetchIfRef(a,n):a:"undefined"!==typeof(a=this._map[t])||t in this._map||"undefined"===typeof r?i?i.fetchIfRef(a,n):a:(a=this._map[r]||null,i?i.fetchIfRef(a,n):a)},getAsync:function(e,t,r){var a,i=this.xref,n=this.suppressEncryption;return"undefined"!==typeof(a=this._map[e])||e in this._map||"undefined"===typeof t?i?i.fetchIfRefAsync(a,n):Promise.resolve(a):"undefined"!==typeof(a=this._map[t])||t in this._map||"undefined"===typeof r?i?i.fetchIfRefAsync(a,n):Promise.resolve(a):(a=this._map[r]||null,i?i.fetchIfRefAsync(a,n):Promise.resolve(a))},getArray:function(e,t,r){var a=this.get(e,t,r),i=this.xref,n=this.suppressEncryption;if(!Array.isArray(a)||!i)return a;a=a.slice();for(var o=0,c=a.length;o<c;o++)s(a[o])&&(a[o]=i.fetch(a[o],n));return a},getRaw:function(e){return this._map[e]},getKeys:function(){return Object.keys(this._map)},set:function(e,t){this._map[e]=t},has:function(e){return e in this._map},forEach:function(e){for(var t in this._map)e(t,this.get(t))}},e.empty=new e(null),e.merge=function(t,r){for(var a=new e(t),i=0,n=r.length;i<n;i++){var s=r[i];if(o(s))for(var c in s._map)void 0===a._map[c]&&(a._map[c]=s._map[c])}return a},e}(),m=function(){function e(e,t){this.num=e,this.gen=t}return e.prototype={toString:function(){var e=this.num+"R";return 0!==this.gen&&(e+=this.gen),e}},e}(),p=function(){function e(){this.dict=Object.create(null)}return e.prototype={has:function(e){return e.toString()in this.dict},put:function(e){this.dict[e.toString()]=!0},remove:function(e){delete this.dict[e.toString()]}},e}(),b=function(){function e(){this.dict=Object.create(null)}return e.prototype={get:function(e){return this.dict[e.toString()]},has:function(e){return e.toString()in this.dict},put:function(e,t){this.dict[e.toString()]=t},putAlias:function(e,t){this.dict[e.toString()]=this.get(t)},forEach:function(e,t){for(var r in this.dict)e.call(t,this.dict[r])},clear:function(){this.dict=Object.create(null)}},e}();t.EOF=h,t.Cmd=d,t.Dict=g,t.Name=f,t.Ref=m,t.RefSet=p,t.RefSetCache=b,t.isEOF=a,t.isCmd=n,t.isDict=o,t.isName=i,t.isRef=s,t.isRefsEqual=c,t.isStream=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LZWStream=t.StringStream=t.StreamsSequenceStream=t.Stream=t.RunLengthStream=t.PredictorStream=t.NullStream=t.FlateStream=t.DecodeStream=t.DecryptStream=t.AsciiHexStream=t.Ascii85Stream=void 0;var a=r(0),i=r(1),n=function(){function e(e,t,r,a){this.bytes=e instanceof Uint8Array?e:new Uint8Array(e),this.start=t||0,this.pos=this.start,this.end=t+r||this.bytes.length,this.dict=a}return e.prototype={get length(){return this.end-this.start},get isEmpty(){return 0===this.length},getByte:function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},getUint16:function(){var e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t},getInt32:function(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()},getBytes:function(e){var t=this.bytes,r=this.pos,a=this.end;if(!e)return t.subarray(r,a);var i=r+e;return i>a&&(i=a),this.pos=i,t.subarray(r,i)},peekByte:function(){var e=this.getByte();return this.pos--,e},peekBytes:function(e){var t=this.getBytes(e);return this.pos-=t.length,t},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=this.start},moveStart:function(){this.start=this.pos},makeSubStream:function(t,r,a){return new e(this.bytes.buffer,t,r,a)}},e}(),o=function(){function e(e){var t=(0,a.stringToBytes)(e);n.call(this,t)}return e.prototype=n.prototype,e}(),s=function(){function e(e){if(this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=t,this.minBufferLength=512,e)for(;this.minBufferLength<e;)this.minBufferLength*=2}var t=new Uint8Array(0);return e.prototype={get isEmpty(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength},ensureBuffer:function(e){var t=this.buffer;if(e<=t.byteLength)return t;for(var r=this.minBufferLength;r<e;)r*=2;var a=new Uint8Array(r);return a.set(t),this.buffer=a},getByte:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]},getUint16:function(){var e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t},getInt32:function(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()},getBytes:function(e){var t,r=this.pos;if(e){for(this.ensureBuffer(r+e),t=r+e;!this.eof&&this.bufferLength<t;)this.readBlock();var a=this.bufferLength;t>a&&(t=a)}else{for(;!this.eof;)this.readBlock();t=this.bufferLength}return this.pos=t,this.buffer.subarray(r,t)},peekByte:function(){var e=this.getByte();return this.pos--,e},peekBytes:function(e){var t=this.getBytes(e);return this.pos-=t.length,t},makeSubStream:function(e,t,r){for(var a=e+t;this.bufferLength<=a&&!this.eof;)this.readBlock();return new n(this.buffer,e,t,r)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0},getBaseStreams:function(){return this.str&&this.str.getBaseStreams?this.str.getBaseStreams():[]}},e}(),c=function(){function e(e){this.streams=e,s.call(this,null)}return e.prototype=Object.create(s.prototype),e.prototype.readBlock=function(){var e=this.streams;if(0===e.length)return void(this.eof=!0);var t=e.shift(),r=t.getBytes(),a=this.bufferLength,i=a+r.length;this.ensureBuffer(i).set(r,a),this.bufferLength=i},e.prototype.getBaseStreams=function(){for(var e=[],t=0,r=this.streams.length;t<r;t++){var i=this.streams[t];i.getBaseStreams&&a.Util.appendToArray(e,i.getBaseStreams())}return e},e}(),l=function(){function e(e,t){this.str=e,this.dict=e.dict;var r=e.getByte(),i=e.getByte();if(-1===r||-1===i)throw new a.FormatError("Invalid header in flate stream: "+r+", "+i);if(8!==(15&r))throw new a.FormatError("Unknown compression method in flate stream: "+r+", "+i);if(((r<<8)+i)%31!==0)throw new a.FormatError("Bad FCHECK in flate stream: "+r+", "+i);if(32&i)throw new a.FormatError("FDICT bit set in flate stream: "+r+", "+i);this.codeSize=0,this.codeBuf=0,s.call(this,t)}var t=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),r=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),i=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),n=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],o=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];return e.prototype=Object.create(s.prototype),e.prototype.getBits=function(e){for(var t,r=this.str,i=this.codeSize,n=this.codeBuf;i<e;){if(-1===(t=r.getByte()))throw new a.FormatError("Bad encoding in flate stream");n|=t<<i,i+=8}return t=n&(1<<e)-1,this.codeBuf=n>>e,this.codeSize=i-=e,t},e.prototype.getCode=function(e){for(var t,r=this.str,i=e[0],n=e[1],o=this.codeSize,s=this.codeBuf;o<n&&-1!==(t=r.getByte());)s|=t<<o,o+=8;var c=i[s&(1<<n)-1],l=c>>16,u=65535&c;if(l<1||o<l)throw new a.FormatError("Bad encoding in flate stream");return this.codeBuf=s>>l,this.codeSize=o-l,u},e.prototype.generateHuffmanTable=function(e){var t,r=e.length,a=0;for(t=0;t<r;++t)e[t]>a&&(a=e[t]);for(var i=1<<a,n=new Int32Array(i),o=1,s=0,c=2;o<=a;++o,s<<=1,c<<=1)for(var l=0;l<r;++l)if(e[l]===o){var u=0,h=s;for(t=0;t<o;++t)u=u<<1|1&h,h>>=1;for(t=u;t<i;t+=c)n[t]=o<<16|l;++s}return[n,a]},e.prototype.readBlock=function(){var e,s,c=this.str,l=this.getBits(3);if(1&l&&(this.eof=!0),0!==(l>>=1)){var u,h;if(1===l)u=n,h=o;else{if(2!==l)throw new a.FormatError("Unknown block type in flate stream");var f,d=this.getBits(5)+257,g=this.getBits(5)+1,m=this.getBits(4)+4,p=new Uint8Array(t.length);for(f=0;f<m;++f)p[t[f]]=this.getBits(3);var b=this.generateHuffmanTable(p);s=0,f=0;for(var v,y,w,k=d+g,S=new Uint8Array(k);f<k;){var C=this.getCode(b);if(16===C)v=2,y=3,w=s;else if(17===C)v=3,y=3,w=s=0;else{if(18!==C){S[f++]=s=C;continue}v=7,y=11,w=s=0}for(var x=this.getBits(v)+y;x-- >0;)S[f++]=w}u=this.generateHuffmanTable(S.subarray(0,d)),h=this.generateHuffmanTable(S.subarray(d,k))}e=this.buffer;for(var A=e?e.length:0,_=this.bufferLength;;){var P=this.getCode(u);if(P<256)_+1>=A&&(e=this.ensureBuffer(_+1),A=e.length),e[_++]=P;else{if(256===P)return void(this.bufferLength=_);P-=257,P=r[P];var I=P>>16;I>0&&(I=this.getBits(I)),s=(65535&P)+I,P=this.getCode(h),P=i[P],I=P>>16,I>0&&(I=this.getBits(I));var O=(65535&P)+I;_+s>=A&&(e=this.ensureBuffer(_+s),A=e.length);for(var T=0;T<s;++T,++_)e[_]=e[_-O]}}}else{var E;if(-1===(E=c.getByte()))throw new a.FormatError("Bad block header in flate stream");var F=E;if(-1===(E=c.getByte()))throw new a.FormatError("Bad block header in flate stream");if(F|=E<<8,-1===(E=c.getByte()))throw new a.FormatError("Bad block header in flate stream");var R=E;if(-1===(E=c.getByte()))throw new a.FormatError("Bad block header in flate stream");if((R|=E<<8)!==(65535&~F)&&(0!==F||0!==R))throw new a.FormatError("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;var B=this.bufferLength;e=this.ensureBuffer(B+F);var M=B+F;if(this.bufferLength=M,0===F)-1===c.peekByte()&&(this.eof=!0);else for(var D=B;D<M;++D){if(-1===(E=c.getByte())){this.eof=!0;break}e[D]=E}}},e}(),u=function(){function e(e,t,r){if(!(0,i.isDict)(r))return e;var n=this.predictor=r.get("Predictor")||1;if(n<=1)return e;if(2!==n&&(n<10||n>15))throw new a.FormatError("Unsupported predictor: "+n);this.readBlock=2===n?this.readBlockTiff:this.readBlockPng,this.str=e,this.dict=e.dict;var o=this.colors=r.get("Colors")||1,c=this.bits=r.get("BitsPerComponent")||8,l=this.columns=r.get("Columns")||1;return this.pixBytes=o*c+7>>3,this.rowBytes=l*o*c+7>>3,s.call(this,t),this}return e.prototype=Object.create(s.prototype),e.prototype.readBlockTiff=function(){var e=this.rowBytes,t=this.bufferLength,r=this.ensureBuffer(t+e),a=this.bits,i=this.colors,n=this.str.getBytes(e);if(this.eof=!n.length,!this.eof){var o,s=0,c=0,l=0,u=0,h=t;if(1===a&&1===i)for(o=0;o<e;++o){var f=n[o]^s;f^=f>>1,f^=f>>2,f^=f>>4,s=(1&f)<<7,r[h++]=f}else if(8===a){for(o=0;o<i;++o)r[h++]=n[o];for(;o<e;++o)r[h]=r[h-i]+n[o],h++}else if(16===a){var d=2*i;for(o=0;o<d;++o)r[h++]=n[o];for(;o<e;o+=2){var g=((255&n[o])<<8)+(255&n[o+1])+((255&r[h-d])<<8)+(255&r[h-d+1]);r[h++]=g>>8&255,r[h++]=255&g}}else{var m=new Uint8Array(i+1),p=(1<<a)-1,b=0,v=t,y=this.columns;for(o=0;o<y;++o)for(var w=0;w<i;++w)l<a&&(s=s<<8|255&n[b++],l+=8),m[w]=m[w]+(s>>l-a)&p,l-=a,c=c<<a|m[w],(u+=a)>=8&&(r[v++]=c>>u-8&255,u-=8);u>0&&(r[v++]=(c<<8-u)+(s&(1<<8-u)-1))}this.bufferLength+=e}},e.prototype.readBlockPng=function(){var e=this.rowBytes,t=this.pixBytes,r=this.str.getByte(),i=this.str.getBytes(e);if(this.eof=!i.length,!this.eof){var n=this.bufferLength,o=this.ensureBuffer(n+e),s=o.subarray(n-e,n);0===s.length&&(s=new Uint8Array(e));var c,l,u,h=n;switch(r){case 0:for(c=0;c<e;++c)o[h++]=i[c];break;case 1:for(c=0;c<t;++c)o[h++]=i[c];for(;c<e;++c)o[h]=o[h-t]+i[c]&255,h++;break;case 2:for(c=0;c<e;++c)o[h++]=s[c]+i[c]&255;break;case 3:for(c=0;c<t;++c)o[h++]=(s[c]>>1)+i[c];for(;c<e;++c)o[h]=(s[c]+o[h-t]>>1)+i[c]&255,h++;break;case 4:for(c=0;c<t;++c)l=s[c],u=i[c],o[h++]=l+u;for(;c<e;++c){l=s[c];var f=s[c-t],d=o[h-t],g=d+l-f,m=g-d;m<0&&(m=-m);var p=g-l;p<0&&(p=-p);var b=g-f;b<0&&(b=-b),u=i[c],o[h++]=m<=p&&m<=b?d+u:p<=b?l+u:f+u}break;default:throw new a.FormatError("Unsupported predictor: "+r)}this.bufferLength+=e}},e}(),h=function(){function e(e,t,r){this.str=e,this.dict=e.dict,this.decrypt=r,this.nextChunk=null,this.initialized=!1,s.call(this,t)}return e.prototype=Object.create(s.prototype),e.prototype.readBlock=function(){var e;if(this.initialized?e=this.nextChunk:(e=this.str.getBytes(512),this.initialized=!0),!e||0===e.length)return void(this.eof=!0);this.nextChunk=this.str.getBytes(512);var t=this.nextChunk&&this.nextChunk.length>0;e=(0,this.decrypt)(e,!t);var r,a=this.bufferLength,i=e.length,n=this.ensureBuffer(a+i);for(r=0;r<i;r++)n[a++]=e[r];this.bufferLength=a},e}(),f=function(){function e(e,t){this.str=e,this.dict=e.dict,this.input=new Uint8Array(5),t&&(t*=.8),s.call(this,t)}return e.prototype=Object.create(s.prototype),e.prototype.readBlock=function(){for(var e=this.str,t=e.getByte();(0,a.isSpace)(t);)t=e.getByte();if(-1===t||126===t)return void(this.eof=!0);var r,i,n=this.bufferLength;if(122===t){for(r=this.ensureBuffer(n+4),i=0;i<4;++i)r[n+i]=0;this.bufferLength+=4}else{var o=this.input;for(o[0]=t,i=1;i<5;++i){for(t=e.getByte();(0,a.isSpace)(t);)t=e.getByte();if(o[i]=t,-1===t||126===t)break}if(r=this.ensureBuffer(n+i-1),this.bufferLength+=i-1,i<5){for(;i<5;++i)o[i]=117;this.eof=!0}var s=0;for(i=0;i<5;++i)s=85*s+(o[i]-33);for(i=3;i>=0;--i)r[n+i]=255&s,s>>=8}},e}(),d=function(){function e(e,t){this.str=e,this.dict=e.dict,this.firstDigit=-1,t&&(t*=.5),s.call(this,t)}return e.prototype=Object.create(s.prototype),e.prototype.readBlock=function(){var e=this.str.getBytes(8e3);if(!e.length)return void(this.eof=!0);for(var t=e.length+1>>1,r=this.ensureBuffer(this.bufferLength+t),a=this.bufferLength,i=this.firstDigit,n=0,o=e.length;n<o;n++){var s,c=e[n];if(c>=48&&c<=57)s=15&c;else{if(!(c>=65&&c<=70||c>=97&&c<=102)){if(62===c){this.eof=!0;break}continue}s=9+(15&c)}i<0?i=s:(r[a++]=i<<4|s,i=-1)}i>=0&&this.eof&&(r[a++]=i<<4,i=-1),this.firstDigit=i,this.bufferLength=a},e}(),g=function(){function e(e,t){this.str=e,this.dict=e.dict,s.call(this,t)}return e.prototype=Object.create(s.prototype),e.prototype.readBlock=function(){var e=this.str.getBytes(2);if(!e||e.length<2||128===e[0])return void(this.eof=!0);var t,r=this.bufferLength,a=e[0];if(a<128){if(t=this.ensureBuffer(r+a+1),t[r++]=e[1],a>0){var i=this.str.getBytes(a);t.set(i,r),r+=a}}else{a=257-a;var n=e[1];t=this.ensureBuffer(r+a+1);for(var o=0;o<a;o++)t[r++]=n}this.bufferLength=r},e}(),m=function(){function e(e,t,r){this.str=e,this.dict=e.dict,this.cachedData=0,this.bitsCached=0;for(var a={earlyChange:r,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(4096),dictionaryLengths:new Uint16Array(4096),dictionaryPrevCodes:new Uint16Array(4096),currentSequence:new Uint8Array(4096),currentSequenceLength:0},i=0;i<256;++i)a.dictionaryValues[i]=i,a.dictionaryLengths[i]=1;this.lzwState=a,s.call(this,t)}return e.prototype=Object.create(s.prototype),e.prototype.readBits=function(e){for(var t=this.bitsCached,r=this.cachedData;t<e;){var a=this.str.getByte();if(-1===a)return this.eof=!0,null;r=r<<8|a,t+=8}return this.bitsCached=t-=e,this.cachedData=r,this.lastCode=null,r>>>t&(1<<e)-1},e.prototype.readBlock=function(){var e,t,r,a=1024,i=this.lzwState;if(i){var n=i.earlyChange,o=i.nextCode,s=i.dictionaryValues,c=i.dictionaryLengths,l=i.dictionaryPrevCodes,u=i.codeLength,h=i.prevCode,f=i.currentSequence,d=i.currentSequenceLength,g=0,m=this.bufferLength,p=this.ensureBuffer(this.bufferLength+a);for(e=0;e<512;e++){var b=this.readBits(u),v=d>0;if(b<256)f[0]=b,d=1;else{if(!(b>=258)){if(256===b){u=9,o=258,d=0;continue}this.eof=!0,delete this.lzwState;break}if(b<o)for(d=c[b],t=d-1,r=b;t>=0;t--)f[t]=s[r],r=l[r];else f[d++]=f[0]}if(v&&(l[o]=h,c[o]=c[h]+1,s[o]=f[0],o++,u=o+n&o+n-1?u:0|Math.min(Math.log(o+n)/.6931471805599453+1,12)),h=b,g+=d,a<g){do{a+=512}while(a<g);p=this.ensureBuffer(this.bufferLength+a)}for(t=0;t<d;t++)p[m++]=f[t]}i.nextCode=o,i.codeLength=u,i.prevCode=h,i.currentSequenceLength=d,this.bufferLength=m}},e}(),p=function(){function e(){n.call(this,new Uint8Array(0))}return e.prototype=n.prototype,e}();t.Ascii85Stream=f,t.AsciiHexStream=d,t.DecryptStream=h,t.DecodeStream=s,t.FlateStream=l,t.NullStream=p,t.PredictorStream=u,t.RunLengthStream=g,t.Stream=n,t.StreamsSequenceStream=c,t.StringStream=o,t.LZWStream=m},function(e,t,r){"use strict";var a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){return"object"===("undefined"===typeof e?"undefined":a(e))?null!==e:"function"===typeof e}},function(e,t,r){"use strict";var a=r(47)("wks"),i=r(22),n=r(5).Symbol,o="function"==typeof n;(e.exports=function(e){return a[e]||(a[e]=o&&n[e]||(o?n:i)("Symbol."+e))}).store=a},function(e,t,r){"use strict";var a=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=a)},function(e,t,r){"use strict";var a=r(5),i=r(7),n=r(12),o=r(10),s=r(11),c=function e(t,r,c){var l,u,h,f,d=t&e.F,g=t&e.G,m=t&e.S,p=t&e.P,b=t&e.B,v=g?a:m?a[r]||(a[r]={}):(a[r]||{}).prototype,y=g?i:i[r]||(i[r]={}),w=y.prototype||(y.prototype={});g&&(c=r);for(l in c)u=!d&&v&&void 0!==v[l],h=(u?v:c)[l],f=b&&u?s(h,a):p&&"function"==typeof h?s(Function.call,h):h,v&&o(v,l,h,t&e.U),y[l]!=h&&n(y,l,f),p&&w[l]!=h&&(w[l]=h)};a.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,r){"use strict";var a=e.exports={version:"2.5.1"};"number"==typeof __e&&(__e=a)},function(e,t,r){"use strict";var a=r(3);e.exports=function(e){if(!a(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){"use strict";var a={}.hasOwnProperty;e.exports=function(e,t){return a.call(e,t)}},function(e,t,r){"use strict";var a=r(5),i=r(12),n=r(9),o=r(22)("src"),s=Function.toString,c=(""+s).split("toString");r(7).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,r,s){var l="function"==typeof r;l&&(n(r,"name")||i(r,"name",t)),e[t]!==r&&(l&&(n(r,o)||i(r,o,e[t]?""+e[t]:c.join(String(t)))),e===a?e[t]=r:s?e[t]?e[t]=r:i(e,t,r):(delete e[t],i(e,t,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[o]||s.call(this)})},function(e,t,r){"use strict";var a=r(16);e.exports=function(e,t,r){if(a(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,a){return e.call(t,r,a)};case 3:return function(r,a,i){return e.call(t,r,a,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,r){"use strict";var a=r(15),i=r(28);e.exports=r(13)?function(e,t,r){return a.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){"use strict";e.exports=!r(14)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,r){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){"use strict";var a=r(8),i=r(44),n=r(45),o=Object.defineProperty;t.f=r(13)?Object.defineProperty:function(e,t,r){if(a(e),t=n(t,!0),a(r),i)try{return o(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){"use strict";e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){"use strict";var a=r(29),i=r(30);e.exports=function(e){return a(i(e))}},function(e,t,r){"use strict";var a={}.toString;e.exports=function(e){return a.call(e).slice(8,-1)}},function(e,t,r){"use strict";e.exports={}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorSpace=void 0;var a=r(0),i=r(1),n=function(){function e(e,t,r,a,i,n,o,s){o=1!==o?0:o;var c,l,u,h,f=r/i,d=a/n,g=0,m=new Uint16Array(i),p=3*r;for(c=0;c<i;c++)m[c]=3*Math.floor(c*f);for(c=0;c<n;c++)for(u=Math.floor(c*d)*p,l=0;l<i;l++)h=u+m[l],s[g++]=e[h++],s[g++]=e[h++],s[g++]=e[h++],g+=o}function t(){throw new Error("should not call ColorSpace constructor")}return t.prototype={getRgb:function(e,t){var r=new Uint8Array(3);return this.getRgbItem(e,t,r,0),r},getRgbItem:function(e,t,r,a){throw new Error("Should not call ColorSpace.getRgbItem")},getRgbBuffer:function(e,t,r,a,i,n,o){throw new Error("Should not call ColorSpace.getRgbBuffer")},getOutputLength:function(e,t){throw new Error("Should not call ColorSpace.getOutputLength")},isPassthrough:function(e){return!1},fillRgb:function(t,r,a,i,n,o,s,c,l){var u,h,f=r*a,d=null,g=1<<s,m=a!==n||r!==i;if(this.isPassthrough(s))d=c;else if(1===this.numComps&&f>g&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){var p,b=s<=8?new Uint8Array(g):new Uint16Array(g);for(u=0;u<g;u++)b[u]=u;var v=new Uint8Array(3*g);this.getRgbBuffer(b,0,g,v,0,s,0);var y,w;if(m)for(d=new Uint8Array(3*f),w=0,u=0;u<f;++u)p=3*c[u],d[w++]=v[p],d[w++]=v[p+1],d[w++]=v[p+2];else for(y=0,u=0;u<f;++u)p=3*c[u],t[y++]=v[p],t[y++]=v[p+1],t[y++]=v[p+2],y+=l}else m?(d=new Uint8Array(3*f),this.getRgbBuffer(c,0,f,d,0,s,0)):this.getRgbBuffer(c,0,i*o,t,0,s,l);if(d)if(m)e(d,s,r,a,i,n,l,t);else for(w=0,y=0,u=0,h=i*o;u<h;u++)t[y++]=d[w++],t[y++]=d[w++],t[y++]=d[w++],y+=l},usesZeroToOneRange:!0},t.parse=function(e,r,a,i){var n=t.parseToIR(e,r,a,i);return t.fromIR(n,i)},t.fromIR=function(e,r){var i,n,l,u=Array.isArray(e)?e[0]:e;switch(u){case"DeviceGrayCS":return this.singletons.gray;case"DeviceRgbCS":return this.singletons.rgb;case"DeviceCmykCS":return this.singletons.cmyk;case"CalGrayCS":return i=e[1],n=e[2],l=e[3],new f(i,n,l);case"CalRGBCS":i=e[1],n=e[2],l=e[3];var h=e[4];return new d(i,n,l,h);case"PatternCS":var m=e[1];return m&&(m=t.fromIR(m,r)),new s(m);case"IndexedCS":var p=e[1],b=e[2],v=e[3];return new c(t.fromIR(p,r),b,v);case"AlternateCS":var y=e[1],w=e[2],k=e[3];return new o(y,t.fromIR(w,r),r.createFromIR(k));case"LabCS":i=e[1],n=e[2];var S=e[3];return new g(i,n,S);default:throw new a.FormatError("Unknown colorspace name: "+u)}},t.parseToIR=function(e,r,n,o){if((0,i.isName)(e)){var s=n.get("ColorSpace");if((0