!function(e,t){"object"==typeofexports&&"object"==typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define("pdfjs-dist/build/pdf.worker",[],t):"object"==typeofexports?exports["pdfjs-dist/build/pdf.worker"]=t():e["pdfjs-dist/build/pdf.worker"]=e.pdfjsDistBuildPdfWorker=t()}(this,function(){returnfunction(e){functiont(a){if(r[a])returnr[a].exports;vari=r[a]={i:a,l:!1,exports:{}};e[a].call(i.exports,i,i.exports,t);i.l=!0;returni.exports}varr={};t.m=e;t.c=r;t.i=function(e){returne};t.d=function(e,r,a){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:a})};t.n=function(e){varr=e&&e.__esModule?function(){returne.default}:function(){returne};t.d(r,"a",r);returnr};t.o=function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)};t.p="";returnt(t.s=103)}([function(e,t,r){"use strict";functiona(e){ce=e}functioni(){returnce}functionn(e){ce>=ne.infos&&console.log("Info: "+e)}functiono(e){ce>=ne.warnings&&console.log("Warning: "+e)}functions(e){console.log("Deprecated API usage: "+e)}functionc(e){thrownewError(e)}functionl(e,t){e||c(t)}functionu(e,t){try{varr=newURL(e);if(!r.origin||"null"===r.origin)return!1}catch(e){return!1}vara=newURL(t,r);returnr.origin===a.origin}functionh(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}functionf(e,t){if(!e)returnnull;try{varr=t?newURL(e,t):newURL(e);if(h(r))returnr}catch(e){}returnnull}functiond(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1});returnr}functiong(e){vart;returnfunction(){if(e){t=Object.create(null);e(t);e=null}returnt}}functionm(e){if("string"!=typeofe){o("The argument for removeNullCharacters must be a string.");returne}returne.replace(ke,"")}functionp(e){l(null!==e&&"object"===(void0===e?"undefined":X(e))&&void0!==e.length,"Invalid argument for bytesToString");vart=e.length;if(t<8192)returnString.fromCharCode.apply(null,e);for(varr=[],a=0;a<t;a+=8192){vari=Math.min(a+8192,t),n=e.subarray(a,i);r.push(String.fromCharCode.apply(null,n))}returnr.join("")}functionb(e){l("string"==typeofe,"Invalid argument for stringToBytes");for(vart=e.length,r=newUint8Array(t),a=0;a<t;++a)r[a]=255&e.charCodeAt(a);returnr}functionv(e){if(void0!==e.length)returne.length;l(void0!==e.byteLength);returne.byteLength}functiony(e){if(1===e.length&&e[0]instanceofUint8Array)returne[0];vart,r,a,i=0,n=e.length;for(t=0;t<n;t++){r=e[t];a=v(r);i+=a}varo=0,s=newUint8Array(i);for(t=0;t<n;t++){r=e[t];rinstanceofUint8Array||(r="string"==typeofr?b(r):newUint8Array(r));a=r.byteLength;s.set(r,o);o+=a}returns}functionw(e){returnString.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}functionk(e){for(vart=1,r=0;e>t;){t<<=1;r++}returnr}functionS(e,t){returne[t]<<24>>24}functionC(e,t){returne[t]<<8|e[t+1]}functionx(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}functionA(){vare=newUint8Array(4);e[0]=1;return1===newUint32Array(e.buffer,0,1)[0]}functionP(){try{newFunction("");return!0}catch(e){return!1}}functionI(e){vart,r=e.length,a=[];if("þ"===e[0]&&"ÿ"===e[1])for(t=2;t<r;t+=2)a.push(String.fromCharCode(e.charCodeAt(t)<<8|e.charCodeAt(t+1)));elsefor(t=0;t<r;++t){vari=Ae[e.charCodeAt(t)];a.push(i?String.fromCharCode(i):e.charAt(t))}returna.join("")}function_(e){returndecodeURIComponent(escape(e))}functionO(e){returnunescape(encodeURIComponent(e))}functionT(e){for(vartine)return!1;return!0}functionE(e){return"boolean"==typeofe}functionF(e){return"number"==typeofe&&(0|e)===e}functionR(e){return"number"==typeofe}functionB(e){return"string"==typeofe}functionM(e){returneinstanceofArray}functionD(e){return"object"===(void0===e?"undefined":X(e))&&null!==e&&void0!==e.byteLength}functionL(e){return32===e||9===e||13===e||10===e}functionN(){return"object"===("undefined"==typeofprocess?"undefined":X(process))&&process+""=="[object process]"}functionU(){vare={};e.promise=newPromise(function(t,r){e.resolve=t;e.reject=r});returne}functionj(e,t){
;this.getRgbItem(e,t,r,0);returnr},getRgbItem:function(e,t,r,a){thrownewError("Should not call ColorSpace.getRgbItem")},getRgbBuffer:function(e,t,r,a,i,n,o){thrownewError("Should not call ColorSpace.getRgbBuffer")},getOutputLength:function(e,t){thrownewError("Should not call ColorSpace.getOutputLength")},isPassthrough:function(e){return!1},fillRgb:function(t,r,a,i,n,o,s,c,l){varu,h,f=r*a,d=null,g=1<<s,m=a!==n||r!==i;if(this.isPassthrough(s))d=c;elseif(1===this.numComps&&f>g&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){varp,b=s<=8?newUint8Array(g):newUint16Array(g);for(u=0;u<g;u++)b[u]=u;varv=newUint8Array(3*g);this.getRgbBuffer(b,0,g,v,0,s,0);vary,w;if(m){d=newUint8Array(3*f);w=0;for(u=0;u<f;++u){p=3*c[u];d[w++]=v[p];d[w++]=v[p+1];d[w++]=v[p+2]}}else{y=0;for(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}}}elseif(m){d=newUint8Array(3*f);this.getRgbBuffer(c,0,f,d,0,s,0)}elsethis.getRgbBuffer(c,0,i*o,t,0,s,l);if(d)if(m)e(d,s,r,a,i,n,l,t);else{w=0;y=0;for(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){vari=t.parseToIR(e,r,a);returniinstanceofs?i:t.fromIR(i)};t.fromIR=function(e){varr,i,o,u=(0,a.isArray)(e)?e[0]:e;switch(u){case"DeviceGrayCS":returnthis.singletons.gray;case"DeviceRgbCS":returnthis.singletons.rgb;case"DeviceCmykCS":returnthis.singletons.cmyk;case"CalGrayCS":r=e[1];i=e[2];o=e[3];returnnewd(r,i,o);case"CalRGBCS":r=e[1];i=e[2];o=e[3];varh=e[4];returnnewg(r,i,o,h);case"PatternCS":varf=e[1];f&&(f=t.fromIR(f));returnnewc(f);case"IndexedCS":varp=e[1],b=e[2],v=e[3];returnnewl(t.fromIR(p),b,v);case"AlternateCS":vary=e[1],w=e[2],k=e[3];returnnews(y,t.fromIR(w),n.PDFFunction.fromIR(k));case"LabCS":r=e[1];i=e[2];varS=e[3];returnnewm(r,i,S);default:thrownewa.FormatError("Unknown colorspace name: "+u)}};t.parseToIR=function(e,r,o){if((0,i.isName)(e)){vars=o.get("ColorSpace");if((0,i.isDict)(s)){varc=s.get(e.name);c&&(e=c)}}e=r.fetchIfRef(e);if((0,i.isName)(e))switch(e.name){case"DeviceGray":case"G":return"DeviceGrayCS";case"DeviceRGB":case"RGB":return"DeviceRgbCS";case"DeviceCMYK":case"CMYK":return"DeviceCmykCS";case"Pattern":return["PatternCS",null];default:thrownewa.FormatError("unrecognized colorspace "+e.name)}if((0,a.isArray)(e)){varl,u,h,f,d,g,m=r.fetchIfRef(e[0]).name;switch(m){case"DeviceGray":case"G":return"DeviceGrayCS";case"DeviceRGB":case"RGB":return"DeviceRgbCS";case"DeviceCMYK":case"CMYK":return"DeviceCmykCS";case"CalGray":u=r.fetchIfRef(e[1]);f=u.getArray("WhitePoint");d=u.getArray("BlackPoint");g=u.get("Gamma");return["CalGrayCS",f,d,g];case"CalRGB":u=r.fetchIfRef(e[1]);f=u.getArray("WhitePoint");d=u.getArray("BlackPoint");g=u.getArray("Gamma");return["CalRGBCS",f,d,g,u.getArray("Matrix")];case"ICCBased":varp=r.fetchIfRef(e[1]),b=p.dict;l=b.get("N");h=b.get("Alternate");if(h){varv=t.parseToIR(h,r,o);if(t.fromIR(v).numComps===l)returnv;(0,a.warn)("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===l)return"DeviceGrayCS";if(3===l)return"DeviceRgbCS";if(4===l)return"DeviceCmykCS";break;case"Pattern":vary=e[1]||null;y&&(y=t.parseToIR(y,r,o));return["PatternCS",y];case"Indexed":case"I":varw=t.parseToIR(e[1],r,o),k=r.fetchIfRef(e[2])+1,S=r.fetchIfRef(e[3]);(0,i.isStream)(S)&&(S=S.getBytes());return["IndexedCS",w,k,S];case"Separation":case"DeviceN":varC=r.fetchIfRef(e[1]);l=(0,a.isArray)(C)?C.length:1;h=t.parseToIR(e[2],r,o);return["AlternateCS",l,h,n.PDFFunction.getIR(r,r.fetchIfRef(e[3]))];case"Lab":u=r.fetchIfRef(e[1]);f=u.getArray("WhitePoint");d=u.getArray("BlackPoint");return["LabCS",f,d,u.getArray("Range")];default:thrownewa.FormatError('unimplemented color space object "'+m+'"')}}thrownewa.FormatError('unrecognized color space object: "'+e+'"')};t.isDefaultDecode=function(e,t){if(!(0,a.isArray)(e))return!0;if(2*t!==e.length){(0,a.warn)("The decode map is not the correct length");return!0}for(varr=0,i=e.length;r<i;r+=2)if(0!==e[r]||1!==e[r+1])return!1;return!0};t.singletons={getgray(){return(0,a.shadow)(this,"gray",newu)},getrgb(){
;this.buf2=this.lexer.getObj()},shift:function(){if((0,n.isCmd)(this.buf2,"ID")){this.buf1=this.buf2;this.buf2=null}else{this.buf1=this.buf2;this.buf2=this.lexer.getObj()}},tryShift:function(){try{this.shift();return!0}catch(e){if(einstanceofi.MissingDataException)throwe;return!1}},getObj:function(e){vart=this.buf1;this.shift();if(tinstanceofn.Cmd)switch(t.cmd){case"BI":returnthis.makeInlineImage(e);case"[":for(varr=[];!(0,n.isCmd)(this.buf1,"]")&&!(0,n.isEOF)(this.buf1);)r.push(this.getObj(e));if((0,n.isEOF)(this.buf1)){if(!this.recoveryMode)thrownewi.FormatError("End of file inside array");returnr}this.shift();returnr;case"<<":for(vara=newn.Dict(this.xref);!(0,n.isCmd)(this.buf1,">>")&&!(0,n.isEOF)(this.buf1);)if((0,n.isName)(this.buf1)){varo=this.buf1.name;this.shift();if((0,n.isEOF)(this.buf1))break;a.set(o,this.getObj(e))}else{(0,i.info)("Malformed dictionary: key must be a name object");this.shift()}if((0,n.isEOF)(this.buf1)){if(!this.recoveryMode)thrownewi.FormatError("End of file inside dictionary");returna}if((0,n.isCmd)(this.buf2,"stream"))returnthis.allowStreams?this.makeStream(a,e):a;this.shift();returna;default:returnt}if((0,i.isInt)(t)){vars=t;if((0,i.isInt)(this.buf1)&&(0,n.isCmd)(this.buf2,"R")){varc=newn.Ref(s,this.buf1);this.shift();this.shift();returnc}returns}if((0,i.isString)(t)){varl=t;e&&(l=e.decryptString(l));returnl}returnt},findDefaultInlineStreamEnd:function(e){for(vart,r,a,n,o=e.pos,s=0;-1!==(t=e.getByte());)if(0===s)s=69===t?1:0;elseif(1===s)s=73===t?2:0;else{(0,i.assert)(2===s);if(32===t||10===t||13===t){a=5;n=e.peekBytes(a);for(r=0;r<a;r++){t=n[r];if(10!==t&&13!==t&&(t<32||t>127)){s=0;break}}if(2===s)break}elses=0}returne.pos-4-o},findDCTDecodeInlineStreamEnd:function(e){for(vart,r,a,n=e.pos,o=!1;-1!==(t=e.getByte());)if(255===t){switch(e.getByte()){case0:break;case255:e.skip(-1);break;case217:o=!0;break;case192:case193:case194:case195:case197:case198:case199:case201:case202:case203:case205:case206:case207:case196:case204:case218:case219:case220:case221:case222:case223:case224:case225:case226:case227:case228:case229:case230:case231:case232:case233:case234:case235:case236:case237:case238:case239:case254:r=e.getUint16();r>2?e.skip(r-2):e.skip(-2)}if(o)break}a=e.pos-n;if(-1===t){(0,i.warn)("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.");e.skip(-a);returnthis.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);returna},findASCII85DecodeInlineStreamEnd:function(e){for(vart,r,a=e.pos;-1!==(t=e.getByte());)if(126===t&&62===e.peekByte()){e.skip();break}r=e.pos-a;if(-1===t){(0,i.warn)("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-r);returnthis.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);returnr},findASCIIHexDecodeInlineStreamEnd:function(e){for(vart,r,a=e.pos;-1!==(t=e.getByte())&&62!==t;);r=e.pos-a;if(-1===t){(0,i.warn)("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-r);returnthis.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);returnr},inlineStreamSkipEI:function(e){for(vart,r=0;-1!==(t=e.getByte());)if(0===r)r=69===t?1:0;elseif(1===r)r=73===t?2:0;elseif(2===r)break},makeInlineImage:function(e){for(vart=this.lexer,r=t.stream,a=newn.Dict(this.xref);!(0,n.isCmd)(this.buf1,"ID")&&!(0,n.isEOF)(this.buf1);){if(!(0,n.isName)(this.buf1))thrownewi.FormatError("Dictionary key must be a name object");varo=this.buf1.name;this.shift();if((0,n.isEOF)(this.buf1))break;a.set(o,this.getObj(e))}vars,c=a.get("Filter","F");if((0,n.isName)(c))s=c.name;elseif((0,i.isArray)(c)){varl=this.xref.fetchIfRef(c[0]);(0,n.isName)(l)&&(s=l.name)}varu,h,f,d=r.pos;u="DCTDecode"===s||"DCT"===s?this.findDCTDecodeInlineStreamEnd(r):"ASCII85Decode"===s||"A85"===s?this.findASCII85DecodeInlineStreamEnd(r):"ASCIIHexDecode"===s||"AHx"===s?this.findASCIIHexDecodeInlineStreamEnd(r):this.findDefaultInlineStreamEnd(r);varg,m=r.makeSubStream(d,u,a);if(u<1e3){varp=m.getBytes();m.reset();v
min:2,stackDelta:-1},{id:"or",min:2,stackDelta:-1},{id:"not",min:1,stackDelta:0},null,null,null,{id:"abs",min:1,stackDelta:0},{id:"add",min:2,stackDelta:-1,stackFn:function(e,t){e[t-2]=e[t-2]+e[t-1]}},{id:"sub",min:2,stackDelta:-1,stackFn:function(e,t){e[t-2]=e[t-2]-e[t-1]}},{id:"div",min:2,stackDelta:-1,stackFn:function(e,t){e[t-2]=e[t-2]/e[t-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn:function(e,t){e[t-1]=-e[t-1]}},{id:"eq",min:2,stackDelta:-1},null,null,{id:"drop",min:1,stackDelta:-1},null,{id:"put",min:2,stackDelta:-2},{id:"get",min:1,stackDelta:0},{id:"ifelse",min:4,stackDelta:-3},{id:"random",min:0,stackDelta:1},{id:"mul",min:2,stackDelta:-1,stackFn:function(e,t){e[t-2]=e[t-2]*e[t-1]}},null,{id:"sqrt",min:1,stackDelta:0},{id:"dup",min:1,stackDelta:1},{id:"exch",min:2,stackDelta:0},{id:"index",min:2,stackDelta:0},{id:"roll",min:3,stackDelta:-2},null,null,null,{id:"hflex",min:7,resetStack:!0},{id:"flex",min:13,resetStack:!0},{id:"hflex1",min:9,resetStack:!0},{id:"flex1",min:11,resetStack:!0}];e.prototype={parse:function(){vare=this.properties,t=newc;this.cff=t;varr=this.parseHeader(),a=this.parseIndex(r.endPos),i=this.parseIndex(a.endPos),n=this.parseIndex(i.endPos),o=this.parseIndex(n.endPos),s=this.parseDict(i.obj.get(0)),l=this.createDict(d,s,t.strings);t.header=r.obj;t.names=this.parseNameIndex(a.obj);t.strings=this.parseStringIndex(n.obj);t.topDict=l;t.globalSubrIndex=o.obj;this.parsePrivateDict(t.topDict);t.isCIDFont=l.hasName("ROS");varu=l.getByName("CharStrings"),h=this.parseIndex(u).obj,f=l.getByName("FontMatrix");f&&(e.fontMatrix=f);varg=l.getByName("FontBBox");if(g){e.ascent=Math.max(g[3],g[1]);e.descent=Math.min(g[1],g[3]);e.ascentScaled=!0}varm,p;if(t.isCIDFont){for(varb=this.parseIndex(l.getByName("FDArray")).obj,v=0,y=b.count;v<y;++v){varw=b.get(v),k=this.createDict(d,this.parseDict(w),t.strings);this.parsePrivateDict(k);t.fdArray.push(k)}p=null;m=this.parseCharsets(l.getByName("charset"),h.count,t.strings,!0);t.fdSelect=this.parseFDSelect(l.getByName("FDSelect"),h.count)}else{m=this.parseCharsets(l.getByName("charset"),h.count,t.strings,!1);p=this.parseEncoding(l.getByName("Encoding"),e,t.strings,m.charset)}t.charset=m;t.encoding=p;varS=this.parseCharStrings({charStrings:h,localSubrIndex:l.privateDict.subrsIndex,globalSubrIndex:o.obj,fdSelect:t.fdSelect,fdArray:t.fdArray,privateDict:l.privateDict});t.charStrings=S.charStrings;t.seacs=S.seacs;t.widths=S.widths;returnt},parseHeader:function(){for(vare=this.bytes,t=e.length,r=0;r<t&&1!==e[r];)++r;if(r>=t)thrownewa.FormatError("Invalid CFF header");if(0!==r){(0,a.info)("cff data is shifted");e=e.subarray(r);this.bytes=e}vari=e[0],n=e[1],o=e[2],s=e[3];return{obj:newl(i,n,o,s),endPos:o}},parseDict:function(e){functiont(){for(vart="",a=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],i=e.length;r<i;){varn=e[r++],o=n>>4,s=15&n;if(15===o)break;t+=a[o];if(15===s)break;t+=a[s]}returnparseFloat(t)}varr=0,i=[],n=[];r=0;for(varo=e.length;r<o;){vars=e[r];if(s<=21){12===s&&(s=s<<8|e[++r]);n.push([s,i]);i=[];++r}elsei.push(function(){vari=e[r++];if(30===i)returnt();if(28===i){i=e[r++];i=(i<<24|e[r++]<<16)>>16;returni}if(29===i){i=e[r++];i=i<<8|e[r++];i=i<<8|e[r++];i=i<<8|e[r++];returni}if(i>=32&&i<=246)returni-139;if(i>=247&&i<=250)return256*(i-247)+e[r++]+108;if(i>=251&&i<=254)return-256*(i-251)-e[r++]-108;(0,a.warn)('CFFParser_parseDict: "'+i+'" is a reserved command.');returnNaN}())}returnn},parseIndex:function(e){vart,r,a=newh,i=this.bytes,n=i[e++]<<8|i[e++],o=[],s=e;if(0!==n){varc=i[e++],l=e+(n+1)*c-1;for(t=0,r=n+1;t<r;++t){for(varu=0,f=0;f<c;++f){u<<=8;u+=i[e++]}o.push(l+u)}s=o[n]}for(t=0,r=o.length-1;t<r;++t){vard=o[t],g=o[t+1];a.add(i.subarray(d,g))}return{obj:a,endPos:s}},parseNameIndex:function(e){for(vart=[],r=0,i=e.count;r<i;++r){for(varn=e.get(r),o=Math.min(n.length,127),s=[],c=0;c<o;++c){varl=n[c];0!==c||0!==l?s[c]=l<33||l>126||91===l||93===l||40===l||41===l||123===l||125===l||60===l||62===l||47===l||37===l||35===l?95:l:s[c]=l}t.push((0,a.bytesToString)(s))}returnt},parseStringIndex:function(e){f
returntinstanceofo.JpegStream&&e.isDecodable(t,this.xref,this.resources)},decode:function(e){vart=e.dict,r=t.get("ColorSpace","CS");r=p.ColorSpace.parse(r,this.xref,this.resources);vara=r.numComps;returnthis.handler.sendWithPromise("JpegDecode",[e.getIR(this.forceDataSchema),a]).then(function(t){varr=t.data;returnnewo.Stream(r,0,r.length,e.dict)})}};e.isSupported=function(e,t,r){vara=e.dict;if(a.has("DecodeParms")||a.has("DP"))return!1;vari=p.ColorSpace.parse(a.get("ColorSpace","CS"),t,r);return("DeviceGray"===i.name||"DeviceRGB"===i.name)&&i.isDefaultDecode(a.getArray("Decode","D"))};e.isDecodable=function(e,t,r){vara=e.dict;if(a.has("DecodeParms")||a.has("DP"))return!1;vari=p.ColorSpace.parse(a.get("ColorSpace","CS"),t,r);return(1===i.numComps||3===i.numComps)&&i.isDefaultDecode(a.getArray("Decode","D"))};r.prototype={check:function(){if(++this.checked<100)return!1;this.checked=0;returnthis.endTime<=Date.now()},reset:function(){this.endTime=Date.now()+20;this.checked=0}};var_=Promise.resolve();t.prototype={clone:function(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:k,t=Object.create(this);t.options=e;returnt},hasBlendModes:function(e){if(!(0,s.isDict)(e))return!1;vart=Object.create(null);e.objId&&(t[e.objId]=!0);for(varr=[e],a=this.xref;r.length;){vari,n,o,c=r.shift(),l=c.get("ExtGState");if((0,s.isDict)(l)){varu=l.getKeys();for(n=0,o=u.length;n<o;n++){i=u[n];varh=l.get(i),f=h.get("BM");if((0,s.isName)(f)&&"Normal"!==f.name)return!0}}vard=c.get("XObject");if((0,s.isDict)(d)){varg=d.getKeys();for(n=0,o=g.length;n<o;n++){i=g[n];varm=d.getRaw(i);if((0,s.isRef)(m)){if(t[m.toString()])continue;m=a.fetch(m)}if((0,s.isStream)(m)){if(m.dict.objId){if(t[m.dict.objId])continue;t[m.dict.objId]=!0}varp=m.dict.get("Resources");if((0,s.isDict)(p)&&(!p.objId||!t[p.objId])){r.push(p);p.objId&&(t[p.objId]=!0)}}}}}return!1},buildFormXObject:function(e,t,r,a,n,o){varc=t.dict,l=c.getArray("Matrix"),u=c.getArray("BBox"),h=c.get("Group");if(h){varf,d={matrix:l,bbox:u,smask:r,isolated:!1,knockout:!1},g=h.get("S");if((0,s.isName)(g,"Transparency")){d.isolated=h.get("I")||!1;d.knockout=h.get("K")||!1;f=h.has("CS")?p.ColorSpace.parse(h.get("CS"),this.xref,e):null}if(r&&r.backdrop){f=f||p.ColorSpace.singletons.rgb;r.backdrop=f.getRgb(r.backdrop,0)}a.addOp(i.OPS.beginGroup,[d])}a.addOp(i.OPS.paintFormXObjectBegin,[l,u]);returnthis.getOperatorList({stream:t,task:n,resources:c.get("Resources")||e,operatorList:a,initialState:o}).then(function(){a.addOp(i.OPS.paintFormXObjectEnd,[]);h&&a.addOp(i.OPS.endGroup,[d])})},buildPaintImageXObject:function(t,r,a,n,s,c){varl=this,u=r.dict,h=u.get("Width","W"),f=u.get("Height","H");if(h&&(0,i.isNum)(h)&&f&&(0,i.isNum)(f)){vard=this.options.maxImageSize;if(-1!==d&&h*f>d)(0,i.warn)("Image exceeded maximum allowed size and was removed.");else{varg,m,p=u.get("ImageMask","IM")||!1;if(p){varb=u.get("Width","W"),v=u.get("Height","H"),y=b+7>>3,k=r.getBytes(y*v),S=u.getArray("Decode","D"),C=!!S&&S[0]>0;g=w.PDFImage.createMask(k,b,v,rinstanceofo.DecodeStream,C);g.cached=!0;m=[g];n.addOp(i.OPS.paintImageMaskXObject,m);s&&(c[s]={fn:i.OPS.paintImageMaskXObject,args:m})}else{varx=u.get("SMask","SM")||!1,A=u.get("Mask")||!1;if(!a||x||A||rinstanceofo.JpegStream||!(h+f<200)){varP=this.options.nativeImageDecoderSupport,I="img_"+this.idFactory.createObjId();n.addDependency(I);m=[I,h,f];if(P!==i.NativeImageDecoding.NONE&&!x&&!A&&rinstanceofo.JpegStream&&e.isSupported(r,this.xref,t)){n.addOp(i.OPS.paintJpegXObject,m);this.handler.send("obj",[I,this.pageIndex,"JpegStream",r.getIR(this.options.forceDataSchema)]);s&&(c[s]={fn:i.OPS.paintJpegXObject,args:m})}else{var_=null;P===i.NativeImageDecoding.DECODE&&(rinstanceofo.JpegStream||Ainstanceofo.JpegStream||xinstanceofo.JpegStream)&&(_=newe(this.xref,t,this.handler,this.options.forceDataSchema));w.PDFImage.buildImage(this.handler,this.xref,t,r,a,_).then(function(e){vart=e.createImageData(!1);l.handler.send("obj",[I,l.pageIndex,"Image",t],[t.data.buffer])}).catch(function(e){(0,i.warn)("Unable to decode image: "+e);l.han
supportTypedArray:!0,supportTransfers:a}):e.send("test",!1)}elsee.send("test","main",!1)}});e.on("configure",function(e){(0,i.setVerbosityLevel)(e.verbosity)});e.on("GetDocRequest",function(e){returnl.createDocumentHandler(e,t)})},createDocumentHandler:function(e,t){functionr(){if(m)thrownewError("Worker was terminated")}functionl(e){b.push(e)}functionu(e){e.finish();vart=b.indexOf(e);b.splice(t,1)}functionh(e){vart=(0,i.createPromiseCapability)(),r=function(){vare=g.ensureDoc("numPages"),r=g.ensureDoc("fingerprint"),i=g.ensureXRef("encrypt");Promise.all([e,r,i]).then(function(e){varr={numPages:e[0],fingerprint:e[1],encrypted:!!e[2]};t.resolve(r)},a)},a=function(e){t.reject(e)};g.ensureDoc("checkHeader",[]).then(function(){g.ensureDoc("parseStartXRef",[]).then(function(){g.ensureDoc("parse",[e]).then(r,a)},a)},a);returnt.promise}functionf(e,t){vara,o=(0,i.createPromiseCapability)(),s=e.source;if(s.data){try{a=newn.LocalPdfManager(v,s.data,s.password,t,y);o.resolve(a)}catch(e){o.reject(e)}returno.promise}varl,u=[];try{l=newc(k)}catch(e){o.reject(e);returno.promise}varh=l.getFullReader();h.headersReady.then(function(){if(h.isRangeSupported){vare=s.disableAutoFetch||h.isStreamingSupported;a=newn.NetworkPdfManager(v,l,{msgHandler:k,url:s.url,password:s.password,length:h.contentLength,disableAutoFetch:e,rangeChunkSize:s.rangeChunkSize},t,y);for(varr=0;r<u.length;r++)a.sendProgressiveData(u[r]);u=[];o.resolve(a);p=null}}).catch(function(e){o.reject(e);p=null});varf=0,d=function(){vare=(0,i.arraysToBytes)(u);s.length&&e.length!==s.length&&(0,i.warn)("reported HTTP length is different from actual");try{a=newn.LocalPdfManager(v,e,s.password,t,y);o.resolve(a)}catch(e){o.reject(e)}u=[]};newPromise(function(e,t){varn=functione(n){try{r();if(n.done){a||d();p=null;return}varo=n.value;f+=(0,i.arrayByteLength)(o);h.isStreamingSupported||k.send("DocProgress",{loaded:f,total:Math.max(f,h.contentLength||0)});a?a.sendProgressiveData(o):u.push(o);h.read().then(e,t)}catch(e){t(e)}};h.read().then(n,t)}).catch(function(e){o.reject(e);p=null});p=function(){l.cancelAllRequests("abort")};returno.promise}functiond(e){functiont(e){r();k.send("GetDoc",{pdfInfo:e})}functiona(e){r();if(einstanceofi.PasswordException){vart=news("PasswordException: response "+e.code);l(t);k.sendWithPromise("PasswordRequest",e).then(function(e){u(t);g.updatePassword(e.password);n()}).catch(function(e){u(t);k.send("PasswordException",e)}.bind(null,e))}elseeinstanceofi.InvalidPDFException?k.send("InvalidPDF",e):einstanceofi.MissingPDFException?k.send("MissingPDF",e):einstanceofi.UnexpectedResponseException?k.send("UnexpectedResponse",e):k.send("UnknownError",newi.UnknownErrorException(e.message,e.toString()))}functionn(){r();h(!1).then(t,function(e){r();if(einstanceofi.XRefParseException){g.requestLoadedStream();g.onLoadedStream().then(function(){r();h(!0).then(t,a)})}elsea(e)},a)}r();f(e,{forceDataSchema:e.disableCreateObjectURL,maxImageSize:void0===e.maxImageSize?-1:e.maxImageSize,disableFontFace:e.disableFontFace,nativeImageDecoderSupport:e.nativeImageDecoderSupport,ignoreErrors:e.ignoreErrors}).then(function(e){if(m){e.terminate();thrownewError("Worker was terminated")}g=e;k.send("PDFManagerReady",null);g.onLoadedStream().then(function(e){k.send("DataLoaded",{length:e.bytes.byteLength})})}).then(n,a)}varg,m=!1,p=null,b=[],v=e.docId,y=e.docBaseUrl,w=e.docId+"_worker",k=newi.MessageHandler(w,v,t);k.postMessageTransfers=e.postMessageTransfers;k.on("GetPage",function(e){returng.getPage(e.pageIndex).then(function(e){vart=g.ensure(e,"rotate"),r=g.ensure(e,"ref"),a=g.ensure(e,"userUnit"),i=g.ensure(e,"view");returnPromise.all([t,r,a,i]).then(function(e){return{rotate:e[0],ref:e[1],userUnit:e[2],view:e[3]}})})});k.on("GetPageIndex",function(e){vart=newo.Ref(e.ref.num,e.ref.gen);returng.pdfDocument.catalog.getPageIndex(t)});k.on("GetDestinations",function(e){returng.ensureCatalog("destinations")});k.on("GetDestination",function(e){returng.ensureCatalog("getDestination",[e.id])});k.on("GetPageLabels",function(e){ret
;if("errored"===t._state)returnPromise.reject(t._storedError);Ne("readable"===t._state);returnt._readableStreamController.__pullSteps()}functionE(e){return!!De(e)&&!!Object.prototype.hasOwnProperty.call(e,"_underlyingSource")}functionF(e){if(!1!==R(e))if(!0!==e._pulling){Ne(!1===e._pullAgain);e._pulling=!0;vart=Oe(e._underlyingSource,"pull",[e]);t.then(function(){e._pulling=!1;if(!0===e._pullAgain){e._pullAgain=!1;returnF(e)}},function(t){L(e,t)}).catch(Ue)}elsee._pullAgain=!0}functionR(e){vart=e._controlledReadableStream;return"closed"!==t._state&&"errored"!==t._state&&(!0!==e._closeRequested&&(!1!==e._started&&(!0===c(t)&&k(t)>0||N(e)>0)))}functionB(e){vart=e._controlledReadableStream;Ne(!1===e._closeRequested);Ne("readable"===t._state);e._closeRequested=!0;0===e._queue.length&&p(t)}functionM(e,t){varr=e._controlledReadableStream;Ne(!1===e._closeRequested);Ne("readable"===r._state);if(!0===c(r)&&k(r)>0)y(r,t,!1);else{vara=1;if(void0!==e._strategySize){vari=e._strategySize;try{a=i(t)}catch(t){L(e,t);throwt}}try{ze(e,t,a)}catch(t){L(e,t);throwt}}F(e)}functionD(e,t){varr=e._controlledReadableStream;Ne("readable"===r._state);He(e);b(r,t)}functionL(e,t){"readable"===e._controlledReadableStream._state&&D(e,t)}functionN(e){vart=e._controlledReadableStream,r=t._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}functionU(e){return!!De(e)&&!!Object.prototype.hasOwnProperty.call(e,"_underlyingByteSource")}functionj(e){return!!De(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}functionq(e){if(!1!==re(e))if(!0!==e._pulling){Ne(!1===e._pullAgain);e._pulling=!0;vart=Oe(e._underlyingByteSource,"pull",[e]);t.then(function(){e._pulling=!1;if(!0===e._pullAgain){e._pullAgain=!1;q(e)}},function(t){"readable"===e._controlledReadableStream._state&&ne(e,t)}).catch(Ue)}elsee._pullAgain=!0}functionz(e){K(e);e._pendingPullIntos=[]}functionH(e,t){Ne("errored"!==e._state,"state must not be errored");varr=!1;if("closed"===e._state){Ne(0===t.bytesFilled);r=!0}vara=G(t);if("default"===t.readerType)y(e,a,r);else{Ne("byob"===t.readerType);v(e,a,r)}}functionG(e){vart=e.bytesFilled,r=e.elementSize;Ne(t<=e.byteLength);Ne(t%r==0);returnnewe.ctor(e.buffer,e.byteOffset,t/r)}functionW(e,t,r,a){e._queue.push({buffer:t,byteOffset:r,byteLength:a});e._queueTotalSize+=a}functionX(e,t){varr=t.elementSize,a=t.bytesFilled-t.bytesFilled%r,i=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),n=t.bytesFilled+i,o=n-n%r,s=i,c=!1;if(o>a){s=o-t.bytesFilled;c=!0}for(varl=e._queue;s>0;){varu=l[0],h=Math.min(s,u.byteLength),f=t.byteOffset+t.bytesFilled;Ae(t.buffer,f,u.buffer,u.byteOffset,h);if(u.byteLength===h)l.shift();else{u.byteOffset+=h;u.byteLength-=h}e._queueTotalSize-=h;V(e,h,t);s-=h}if(!1===c){Ne(0===e._queueTotalSize,"queue must be empty");Ne(t.bytesFilled>0);Ne(t.bytesFilled<t.elementSize)}returnc}functionV(e,t,r){Ne(0===e._pendingPullIntos.length||e._pendingPullIntos[0]===r);K(e);r.bytesFilled+=t}functionY(e){Ne("readable"===e._controlledReadableStream._state);0===e._queueTotalSize&&!0===e._closeRequested?p(e._controlledReadableStream):q(e)}functionK(e){if(void0!==e._byobRequest){e._byobRequest._associatedReadableByteStreamController=void0;e._byobRequest._view=void0;e._byobRequest=void0}}functionJ(e){Ne(!1===e._closeRequested);for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;vart=e._pendingPullIntos[0];if(!0===X(e,t)){te(e);H(e._controlledReadableStream,t)}}}functionZ(e,t){varr=e._controlledReadableStream,a=1;t.constructor!==DataView&&(a=t.constructor.BYTES_PER_ELEMENT);vari=t.constructor,n={buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:a,ctor:i,readerType:"byob"};if(e._pendingPullIntos.length>0){n.buffer=Te(n.buffer);e._pendingPullIntos.push(n);returnd(r)}if("closed"===r._state){varo=newt.constructor(n.buffer,n.byteOffset,0);returnPromise.resolve(Pe(o,!0))}if(e._queueTotalSize>0){if(!0===X(e,n)){vars=G(n);Y(e);returnPromise.resolve(Pe(s,!1))}if(!0===e._closeRequested){var
},function(e,t,r){"use strict";vara=r(2)("iterator"),i=!1;try{varn=[7][a]();n.return=function(){i=!0};Array.from(n,function(){throw2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;varr=!1;try{varn=[7],o=n[a]();o.next=function(){return{done:r=!0}};n[a]=function(){returno};e(n)}catch(e){}returnr}},function(e,t,r){"use strict";e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){"use strict";vara=r(9),i=r(17),n=r(78);e.exports=r(5)?Object.defineProperties:function(e,t){i(e);for(varr,o=n(t),s=o.length,c=0;s>c;)a.f(e,r=o[c++],t[r]);returne}},function(e,t,r){"use strict";vara=r(79),i=r(20),n=r(22),o=r(31),s=r(7),c=r(42),l=Object.getOwnPropertyDescriptor;t.f=r(5)?l:function(e,t){e=n(e);t=o(t,!0);if(c)try{returnl(e,t)}catch(e){}if(s(e,t))returni(!a.f.call(e,t),e[t])}},function(e,t,r){"use strict";vara=r(47),i=r(26);e.exports=Object.keys||function(e){returna(e,i)}},function(e,t,r){"use strict";t.f={}.propertyIsEnumerable},function(e,t,r){"use strict";vara=r(4),i=r(9),n=r(5),o=r(2)("species");e.exports=function(e){vart=a[e];n&&t&&!t[o]&&i.f(t,o,{configurable:!0,get:function(){returnthis}})}},function(e,t,r){"use strict";vara=r(17),i=r(34),n=r(2)("species");e.exports=function(e,t){varr,o=a(e).constructor;returnvoid0===o||void0==(r=a(o)[n])?t:i(r)}},function(e,t,r){"use strict";vara="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(e){returntypeofe}:function(e){returne&&"function"==typeofSymbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeofe};if(r(5)){vari=r(27),n=r(4),o=r(19),s=r(41),c=r(51),l=r(83),u=r(25),h=r(35),f=r(20),d=r(6),g=r(48),m=r(12),p=r(8),b=r(50),v=r(21),y=r(31),w=r(7),k=r(38),S=r(10),C=r(13),x=r(70),A=r(44),P=r(46),I=r(45).f,_=r(84),O=r(14),T=r(2),E=r(66),F=r(37),R=r(81),B=r(85),M=r(11),D=r(74),L=r(80),N=r(36),U=r(65),j=r(9),q=r(77),z=j.f,H=q.f,G=n.RangeError,W=n.TypeError,X=n.Uint8Array,V=Array.prototype,Y=l.ArrayBuffer,K=l.DataView,J=E(0),Z=E(2),Q=E(3),$=E(4),ee=E(5),te=E(6),re=F(!0),ae=F(!1),ie=B.values,ne=B.keys,oe=B.entries,se=V.lastIndexOf,ce=V.reduce,le=V.reduceRight,ue=V.join,he=V.sort,fe=V.slice,de=V.toString,ge=V.toLocaleString,me=T("iterator"),pe=T("toStringTag"),be=O("typed_constructor"),ve=O("def_constructor"),ye=c.CONSTR,we=c.TYPED,ke=c.VIEW,Se=E(1,function(e,t){returnIe(R(e,e[ve]),t)}),Ce=o(function(){return1===newX(newUint16Array([1]).buffer)[0]}),xe=!!X&&!!X.prototype.set&&o(function(){newX(1).set({})}),Ae=function(e,t){varr=m(e);if(r<0||r%t)throwG("Wrong offset!");returnr},Pe=function(e){if(S(e)&&weine)returne;throwW(e+" is not a typed array!")},Ie=function(e,t){if(!(S(e)&&beine))throwW("It is not a typed array constructor!");returnnewe(t)},_e=function(e,t){returnOe(R(e,e[ve]),t)},Oe=function(e,t){for(varr=0,a=t.length,i=Ie(e,a);a>r;)i[r]=t[r++];returni},Te=function(e,t,r){z(e,t,{get:function(){returnthis._d[r]}})},Ee=function(e){vart,r,a,i,n,o,s=C(e),c=arguments.length,l=c>1?arguments[1]:void0,h=void0!==l,f=_(s);if(void0!=f&&!x(f)){for(o=f.call(s),a=[],t=0;!(n=o.next()).done;t++)a.push(n.value);s=a}h&&c>2&&(l=u(l,arguments[2],2));for(t=0,r=p(s.length),i=Ie(this,r);r>t;t++)i[t]=h?l(s[t],t):s[t];returni},Fe=function(){for(vare=0,t=arguments.length,r=Ie(this,t);t>e;)r[e]=arguments[e++];returnr},Re=!!X&&o(function(){ge.call(newX(1))}),Be=function(){returnge.apply(Re?fe.call(Pe(this)):Pe(this),arguments)},Me={copyWithin:function(e,t){returnU.call(Pe(this),e,t,arguments.length>2?arguments[2]:void0)},every:function(e){return$(Pe(this),e,arguments.length>1?arguments[1]:void0)},fill:function(e){returnN.apply(Pe(this),arguments)},filter:function(e){return_e(this,Z(Pe(this),e,arguments.length>1?arguments[1]:void0))},find:function(e){returnee(Pe(this),e,arguments.length>1?arguments[1]:void0)},findIndex:function(e){returnte(Pe(this),e,arguments.length>1?arguments[1]:void0)},forEach:function(e){J(Pe(this),e,arguments.length>1?arguments[1]:void0)},indexOf:function(e){returnae(Pe(this),e,arguments.length>1?arguments[1]:void0)},includes:function(e){returnre(Pe(this),e,arguments.length>
;w*=O[E];if(0!=(k|S|C|x|A|P|I)){k*=O[E+1];S*=O[E+2];C*=O[E+3];x*=O[E+4];A*=O[E+5];P*=O[E+6];I*=O[E+7];a=b*w+128>>8;i=b*x+128>>8;o=S;s=P;c=v*(k-I)+128>>8;y=v*(k+I)+128>>8;l=C<<4;u=A<<4;a=a+i+1>>1;i=a-i;_=o*p+s*m+128>>8;o=o*m-s*p+128>>8;s=_;c=c+u+1>>1;u=c-u;y=y+l+1>>1;l=y-l;a=a+s+1>>1;s=a-s;i=i+o+1>>1;o=i-o;_=c*g+y*d+2048>>12;c=c*d-y*g+2048>>12;y=_;_=l*f+u*h+2048>>12;l=l*h-u*f+2048>>12;u=_;r[E]=a+y;r[E+7]=a-y;r[E+1]=i+u;r[E+6]=i-u;r[E+2]=o+l;r[E+5]=o-l;r[E+3]=s+c;r[E+4]=s-c}else{_=b*w+512>>10;r[E]=_;r[E+1]=_;r[E+2]=_;r[E+3]=_;r[E+4]=_;r[E+5]=_;r[E+6]=_;r[E+7]=_}}for(varF=0;F<8;++F){w=r[F];k=r[F+8];S=r[F+16];C=r[F+24];x=r[F+32];A=r[F+40];P=r[F+48];I=r[F+56];if(0!=(k|S|C|x|A|P|I)){a=b*w+2048>>12;i=b*x+2048>>12;o=S;s=P;c=v*(k-I)+2048>>12;y=v*(k+I)+2048>>12;l=C;u=A;a=4112+(a+i+1>>1);i=a-i;_=o*p+s*m+2048>>12;o=o*m-s*p+2048>>12;s=_;c=c+u+1>>1;u=c-u;y=y+l+1>>1;l=y-l;a=a+s+1>>1;s=a-s;i=i+o+1>>1;o=i-o;_=c*g+y*d+2048>>12;c=c*d-y*g+2048>>12;y=_;_=l*f+u*h+2048>>12;l=l*h-u*f+2048>>12;u=_;w=a+y;I=a-y;k=i+u;P=i-u;S=o+l;A=o-l;C=s+c;x=s-c;w=w<16?0:w>=4080?255:w>>4;k=k<16?0:k>=4080?255:k>>4;S=S<16?0:S>=4080?255:S>>4;C=C<16?0:C>=4080?255:C>>4;x=x<16?0:x>=4080?255:x>>4;A=A<16?0:A>=4080?255:A>>4;P=P<16?0:P>=4080?255:P>>4;I=I<16?0:I>=4080?255:I>>4;T[t+F]=w;T[t+F+8]=k;T[t+F+16]=S;T[t+F+24]=C;T[t+F+32]=x;T[t+F+40]=A;T[t+F+48]=P;T[t+F+56]=I}else{_=b*w+8192>>14;_=_<-2040?0:_>=2024?255:_+2056>>4;T[t+F]=_;T[t+F+8]=_;T[t+F+16]=_;T[t+F+24]=_;T[t+F+32]=_;T[t+F+40]=_;T[t+F+48]=_;T[t+F+56]=_}}}functionc(e,t){for(vara=t.blocksPerLine,i=t.blocksPerColumn,n=newInt16Array(64),o=0;o<i;o++)for(varc=0;c<a;c++){varl=r(t,o,c);s(t,l,n)}returnt.blockData}functionl(e,t,r){functiona(t){returne[t]<<8|e[t+1]}vari=e.length-1,n=r<t?r:t;if(t>=i)returnnull;varo=a(t);if(o>=65472&&o<=65534)return{invalid:null,marker:o,offset:t};for(vars=a(n);!(s>=65472&&s<=65534);){if(++n>=i)returnnull;s=a(n)}return{invalid:o.toString(16),marker:s,offset:n}}varu=newUint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),h=4017,f=799,d=3406,g=2276,m=1567,p=3784,b=5793,v=2896;e.prototype={parse:function(e){functionr(){vart=e[h]<<8|e[h+1];h+=2;returnt}vara,s,h=0,f=null,d=null,g=[],m=[],p=[],b=r();if(65496!==b)thrownewn("SOI not found");b=r();for(;65497!==b;){varv,y,w;switch(b){case65504:case65505:case65506:case65507:case65508:case65509:case65510:case65511:case65512:case65513:case65514:case65515:case65516:case65517:case65518:case65519:case65534:vark=function(){vart=r(),a=h+t-2,n=l(e,a,h);if(n&&n.invalid){(0,i.warn)("readDataBlock - incorrect length, next marker is: "+n.invalid);a=n.offset}varo=e.subarray(h,a);h+=o.length;returno}();65504===b&&74===k[0]&&70===k[1]&&73===k[2]&&70===k[3]&&0===k[4]&&(f={version:{major:k[5],minor:k[6]},densityUnits:k[7],xDensity:k[8]<<8|k[9],yDensity:k[10]<<8|k[11],thumbWidth:k[12],thumbHeight:k[13],thumbData:k.subarray(14,14+3*k[12]*k[13])});65518===b&&65===k[0]&&100===k[1]&&111===k[2]&&98===k[3]&&101===k[4]&&(d={version:k[5]<<8|k[6],flags0:k[7]<<8|k[8],flags1:k[9]<<8|k[10],transformCode:k[11]});break;case65499:for(varS,C=r(),x=C+h-2;h<x;){varA=e[h++],P=newUint16Array(64);if(A>>4==0)for(y=0;y<64;y++){S=u[y];P[S]=e[h++]}else{if(A>>4!=1)thrownewn("DQT - invalid table spec");for(y=0;y<64;y++){S=u[y];P[S]=r()}}g[15&A]=P}break;case65472:case65473:case65474:if(a)thrownewn("Only single frame JPEGs supported");r();a={};a.extended=65473===b;a.progressive=65474===b;a.precision=e[h++];a.scanLines=r();a.samplesPerLine=r();a.components=[];a.componentIds={};varI,_=e[h++],O=0,T=0;for(v=0;v<_;v++){I=e[h];varE=e[h+1]>>4,F=15&e[h+1];O<E&&(O=E);T<F&&(T=F);varR=e[h+2];w=a.components.push({h:E,v:F,quantizationId:R,quantizationTable:null});a.componentIds[I]=w-1;h+=3}a.maxH=O;a.maxV=T;!function(e){for(vart=Math.ceil(e.samplesPerLine/8/e.maxH),r=Math.ceil(e.scanLines/8/e.maxV),a=0;a<e.components.length;a++){U=e.components[a];vari=Math.ceil(Math.ceil(e.samplesPerLine/8)*U.h/e.maxH),n=Math.ceil