(function e(t,r){if(typeof exports==="object"&&typeof module==="object")module.exports=r();else if(typeof define==="function"&&define.amd)define("pdfjs-dist/build/pdf",[],r);else if(typeof exports==="object")exports["pdfjs-dist/build/pdf"]=r();else t["pdfjs-dist/build/pdf"]=t.pdfjsLib=r()})(this,function(){return function(e){var t={};function r(n){if(t[n]){return t[n].exports}var i=t[n]={i:n,l:false,exports:{}};e[n].call(i.exports,i,i.exports,r);i.l=true;return i.exports}r.m=e;r.c=t;r.d=function(e,t,n){if(!r.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:n})}};r.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})};r.t=function(e,t){if(t&1)e=r(e);if(t&8)return e;if(t&4&&typeof e==="object"&&e&&e.__esModule)return e;var n=Object.create(null);r.r(n);Object.defineProperty(n,"default",{enumerable:true,value:e});if(t&2&&typeof e!="string")for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n};r.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};r.d(t,"a",t);return t};r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};r.p="";return r(r.s=0)}([function(e,t,r){"use strict";var n="2.0.943";var i="dc98bf76";var a=r(1);var s=r(129);var o=r(145);var u=r(146);var l=r(130);var c=r(147);var f=r(135);var d=r(132);{var h=r(4);if(h()){var v=r(148).PDFNodeStream;s.setPDFNetworkStreamFactory(function(e){return new v(e)})}else if(typeof Response!=="undefined"&&"body"in Response.prototype&&typeof ReadableStream!=="undefined"){var p=r(151).PDFFetchStream;s.setPDFNetworkStreamFactory(function(e){return new p(e)})}else{var m=r(152).PDFNetworkStream;s.setPDFNetworkStreamFactory(function(e){return new m(e)})}}t.build=s.build;t.version=s.version;t.getDocument=s.getDocument;t.LoopbackPort=s.LoopbackPort;t.PDFDataRangeTransport=s.PDFDataRangeTransport;t.PDFWorker=s.PDFWorker;t.renderTextLayer=o.renderTextLayer;t.AnnotationLayer=u.AnnotationLayer;var g=r(153);t.SimpleLinkService=g;t.createPromiseCapability=a.createPromiseCapability;t.PasswordResponses=a.PasswordResponses;t.InvalidPDFException=a.InvalidPDFException;t.MissingPDFException=a.MissingPDFException;t.SVGGraphics=c.SVGGraphics;t.NativeImageDecoding=a.NativeImageDecoding;t.CMapCompressionType=a.CMapCompressionType;t.PermissionFlag=a.PermissionFlag;t.UnexpectedResponseException=a.UnexpectedResponseException;t.OPS=a.OPS;t.VerbosityLevel=a.VerbosityLevel;t.UNSUPPORTED_FEATURES=a.UNSUPPORTED_FEATURES;t.createValidAbsoluteUrl=a.createValidAbsoluteUrl;t.createObjectURL=a.createObjectURL;t.removeNullCharacters=a.removeNullCharacters;t.shadow=a.shadow;t.Util=a.Util;t.ReadableStream=a.ReadableStream;t.URL=a.URL;t.RenderingCancelledException=l.RenderingCancelledException;t.getFilenameFromUrl=l.getFilenameFromUrl;t.LinkTarget=l.LinkTarget;t.addLinkAttributes=l.addLinkAttributes;t.loadScript=l.loadScript;t.GlobalWorkerOptions=f.GlobalWorkerOptions;t.apiCompatibilityParams=d.apiCompatibilityParams},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.unreachable=t.warn=t.utf8StringToString=t.stringToUTF8String=t.stringToPDFString=t.stringToBytes=t.string32=t.shadow=t.setVerbosityLevel=t.URL=t.ReadableStream=t.removeNullCharacters=t.readUint32=t.readUint16=t.readInt8=t.log2=t.isEvalSupported=t.isLittleEndian=t.createValidAbsoluteUrl=t.isSameOrigin=t.isSpace=t.isString=t.isNum=t.isEmptyObj=t.isBool=t.isArrayBuffer=t.info=t.getVerbosityLevel=t.getLookupTableFactory=t.getInheritableProperty=t.deprecated=t.createObjectURL=t.createPromiseCapability=t.bytesToString=t.assert=t.arraysToBytes=t.arrayByteLength=t.FormatError=t.XRefParseException=t.toRomanNumerals=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.StreamType=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.NativeImageDecoding=t.MissingPDFException=t.MissingDataException=t.InvalidPDFException=t.AbortException=t.CMapCompressionType=t.ImageKind=t.FontType=t.AnnotationType=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationBorderStyleType=t.UNSUPPORTED_FEATURES=t.VerbosityLevel=t.OPS=t.IDENTITY_MATRIX=t.FONT_IDENTITY_MATRIX=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r(2);var i=r(125);var a=r(127);var s=[1,0,0,1,0,0];var o=[.001,0,0,.001,0,0];var u={NONE:"none",DECODE:"decode",DISPLAY:"display"};var l={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};var c={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};var f={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};var d={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};var h={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};var v={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};var p={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};var m={UNKNOWN:0,FLATE:1,LZW:2,DCT:3,JPX:4,JBIG:5,A85:6,AHX:7,CCF:8,RL:9};var g={UNKNOWN:0,TYPE1:1,TYPE1C:2,CIDFONTTYPE0:3,CIDFONTTYPE0C:4,TRUETYPE:5,CIDFONTTYPE2:6,TYPE3:7,OPENTYPE:8,TYPE0:9,MMTYPE1:10};var y={ERRORS:0,WARNINGS:1,INFOS:5};var b={NONE:0,BINARY:1,STREAM:2};var _={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};var A={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"};var S={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var w=y.WARNINGS;function k(e){if(Number.isInteger(e)){w=e}}function P(){return w}function C(e){if(w>=y.INFOS){console.log("Info: "+e)}}function x(e){if(w>=y.WARNINGS){console.log("Warning: "+e)}}function R(e){console.log("Deprecated API usage: "+e)}function E(e){throw new Error(e)}function T(e,t){if(!e){E(t)}}function O(e,t){try{var r=new a.URL(e);if(!r.origin||r.origin==="null"){return false}}catch(e){return false}var n=new a.URL(t,r);return r.origin===n.origin}function L(e){if(!e){return false}switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return true;default:return false}}function I(e,t){if(!e){return null}try{var r=t?new a.URL(e,t):new a.URL(e);if(L(r)){return r}}catch(e){}return null}function F(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:false});return r}function M(e){var t;return function(){if(e){t=Object.create(null);e(t);e=null}return t}}var j=function e(){function t(e,t){this.name="PasswordException";this.message=e;this.code=t}t.prototype=new Error;t.constructor=t;return t}();var D=function e(){function t(e,t){this.name="UnknownErrorException";this.message=e;this.details=t}t.prototype=new Error;t.constructor=t;return t}();var N=function e(){function t(e){this.name="InvalidPDFException";this.message=e}t.prototype=new Error;t.constructor=t;return t}();var q=function e(){function t(e){this.name="MissingPDFException";this.message=e}t.prototype=new Error;t.constructor=t;return t}();var W=function e(){function t(e,t){this.name="UnexpectedResponseException";this.message=e;this.status=t}t.prototype=new Error;t.constructor=t;return t}();var U=function e(){function t(e,t){this.begin=e;this.end=t;this.message="Missing data ["+e+", "+t+")"}t.prototype=new Error;t.prototype.name="MissingDataException";t.constructor=t;return t}();var B=function e(){function t(e){this.message=e}t.prototype=new Error;t.prototype.name="XRefParseException";t.constructor=t;return t}();var z=function e(){function t(e){this.message=e}t.prototype=new Error;t.prototype.name="FormatError";t.constructor=t;return t}();var G=function e(){function t(e){this.name="AbortException";this.message=e}t.prototype=new Error;t.constructor=t;return t}();var H=/\x00/g;function X(e){if(typeof e!=="string"){x("The argument for removeNullCharacters must be a string.");return e}return e.replace(H,"")}function Y(e){T(e!==null&&(typeof e==="undefined"?"undefined":n(e))==="object"&&e.length!==undefined,"Invalid argument for bytesToString");var t=e.length;var r=8192;if(t>24&255,e>>16&255,e>>8&255,e&255)}function Z(e){if(e<=0){return 0}return Math.ceil(Math.log2(e))}function $(e,t){return e[t]<<24>>24}function ee(e,t){return e[t]<<8|e[t+1]}function te(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function re(){var e=new Uint8Array(4);e[0]=1;var t=new Uint32Array(e.buffer,0,1);return t[0]===1}function ne(){try{new Function("");return true}catch(e){return false}}function ie(e){var t=e.dict,r=e.key,n=e.getArray,i=n===undefined?false:n,a=e.stopWhenFound,s=a===undefined?true:a;var o=100;var u=0;var l=void 0;while(t){var c=i?t.getArray(r):t.get(r);if(c!==undefined){if(s){return c}if(!l){l=[]}l.push(c)}if(++u>o){x('getInheritableProperty: maximum loop count exceeded for "'+r+'"');break}t=t.get("Parent")}return l}var ae=function e(){function t(){}var r=["rgb(",0,",",0,",",0,")"];t.makeCssRgb=function e(t,n,i){r[1]=t;r[3]=n;r[5]=i;return r.join("")};t.transform=function e(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]};t.applyTransform=function e(t,r){var n=t[0]*r[0]+t[1]*r[2]+r[4];var i=t[0]*r[1]+t[1]*r[3]+r[5];return[n,i]};t.applyInverseTransform=function e(t,r){var n=r[0]*r[3]-r[1]*r[2];var i=(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/n;var a=(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/n;return[i,a]};t.getAxialAlignedBoundingBox=function e(r,n){var i=t.applyTransform(r,n);var a=t.applyTransform(r.slice(2,4),n);var s=t.applyTransform([r[0],r[3]],n);var o=t.applyTransform([r[2],r[1]],n);return[Math.min(i[0],a[0],s[0],o[0]),Math.min(i[1],a[1],s[1],o[1]),Math.max(i[0],a[0],s[0],o[0]),Math.max(i[1],a[1],s[1],o[1])]};t.inverseTransform=function e(t){var r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]};t.apply3dTransform=function e(t,r){return[t[0]*r[0]+t[1]*r[1]+t[2]*r[2],t[3]*r[0]+t[4]*r[1]+t[5]*r[2],t[6]*r[0]+t[7]*r[1]+t[8]*r[2]]};t.singularValueDecompose2dScale=function e(t){var r=[t[0],t[2],t[1],t[3]];var n=t[0]*r[0]+t[1]*r[2];var i=t[0]*r[1]+t[1]*r[3];var a=t[2]*r[0]+t[3]*r[2];var s=t[2]*r[1]+t[3]*r[3];var o=(n+s)/2;var u=Math.sqrt((n+s)*(n+s)-4*(n*s-a*i))/2;var l=o+u||1;var c=o-u||1;return[Math.sqrt(l),Math.sqrt(c)]};t.normalizeRect=function e(t){var r=t.slice(0);if(t[0]>t[2]){r[0]=t[2];r[2]=t[0]}if(t[1]>t[3]){r[1]=t[3];r[3]=t[1]}return r};t.intersect=function e(r,n){function i(e,t){return e-t}var a=[r[0],r[2],n[0],n[2]].sort(i),s=[r[1],r[3],n[1],n[3]].sort(i),o=[];r=t.normalizeRect(r);n=t.normalizeRect(n);if(a[0]===r[0]&&a[1]===n[0]||a[0]===n[0]&&a[1]===r[0]){o[0]=a[1];o[2]=a[2]}else{return false}if(s[0]===r[1]&&s[1]===n[1]||s[0]===n[1]&&s[1]===r[1]){o[1]=s[1];o[3]=s[2]}else{return false}return o};return t}();var se=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function oe(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;T(Number.isInteger(e)&&e>0,"The number should be a positive integer.");var r=void 0,n=[];while(e>=1e3){e-=1e3;n.push("M")}r=e/100|0;e%=100;n.push(se[r]);r=e/10|0;e%=10;n.push(se[10+r]);n.push(se[20+e]);var i=n.join("");return t?i.toLowerCase():i}var ue=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function le(e){var t,r=e.length,n=[];if(e[0]==="þ"&&e[1]==="ÿ"){for(t=2;t2&&arguments[2]!==undefined?arguments[2]:false;if(!i&&a.URL.createObjectURL){var s=new Blob([r],{type:n});return a.URL.createObjectURL(s)}var o="data:"+n+";base64,";for(var u=0,l=r.length;u>2,v=(c&3)<<4|f>>4;var p=u+1>6:64;var m=u+21){var t=!!arguments[1];return this[t?"add":"remove"](e),t}return r(e)}})();(function e(){if(String.prototype.includes){return}r(5)})();(function e(){if(Array.prototype.includes){return}r(33)})();(function e(){if(Object.assign){return}r(42)})();(function e(){if(Math.log2){return}Math.log2=r(52)})();(function e(){if(Number.isNaN){return}Number.isNaN=r(54)})();(function e(){if(Number.isInteger){return}Number.isInteger=r(56)})();(function e(){if(i.Promise){return}i.Promise=r(59)})();(function e(){if(i.WeakMap){return}i.WeakMap=r(94)})();(function e(){if(String.codePointAt){return}String.codePointAt=r(111)})();(function e(){if(String.fromCodePoint){return}String.fromCodePoint=r(113)})();(function e(){if(i.Symbol){return}r(115)})();(function e(){if(Object.values){return}Object.values=r(122)})()}},function(e,t,r){"use strict";e.exports=typeof window!=="undefined"&&window.Math===Math?window:typeof global!=="undefined"&&global.Math===Math?global:typeof self!=="undefined"&&self.Math===Math?self:{}},function(e,t,r){"use strict";var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function e(){return(typeof process==="undefined"?"undefined":n(process))==="object"&&process+""==="[object process]"}},function(e,t,r){"use strict";r(6);e.exports=r(9).String.includes},function(e,t,r){"use strict";var n=r(7);var i=r(25);var a="includes";n(n.P+n.F*r(32)(a),"String",{includes:function e(t){return!!~i(this,t,a).indexOf(t,arguments.length>1?arguments[1]:undefined)}})},function(e,t,r){"use strict";var n=r(8);var i=r(9);var a=r(10);var s=r(20);var o=r(23);var u="prototype";var l=function e(t,r,l){var c=t&e.F;var f=t&e.G;var d=t&e.S;var h=t&e.P;var v=t&e.B;var p=f?n:d?n[r]||(n[r]={}):(n[r]||{})[u];var m=f?i:i[r]||(i[r]={});var g=m[u]||(m[u]={});var y,b,_,A;if(f)l=r;for(y in l){b=!c&&p&&p[y]!==undefined;_=(b?p:l)[y];A=v&&b?o(_,n):h&&typeof _=="function"?o(Function.call,_):_;if(p)s(p,y,_,t&e.U);if(m[y]!=_)a(m,y,A);if(h&&g[y]!=_)g[y]=_}};n.core=i;l.F=1;l.G=2;l.S=4;l.P=8;l.B=16;l.W=32;l.U=64;l.R=128;e.exports=l},function(e,t,r){"use strict";var n=e.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();if(typeof __g=="number")__g=n},function(e,t,r){"use strict";var n=e.exports={version:"2.6.2"};if(typeof __e=="number")__e=n},function(e,t,r){"use strict";var n=r(11);var i=r(19);e.exports=r(15)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){e[t]=r;return e}},function(e,t,r){"use strict";var n=r(12);var i=r(14);var a=r(18);var s=Object.defineProperty;t.f=r(15)?Object.defineProperty:function e(t,r,o){n(t);r=a(r,true);n(o);if(i)try{return s(t,r,o)}catch(e){}if("get"in o||"set"in o)throw TypeError("Accessors not supported!");if("value"in o)t[r]=o.value;return t}},function(e,t,r){"use strict";var n=r(13);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){"use strict";var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){return(typeof e==="undefined"?"undefined":n(e))==="object"?e!==null:typeof e==="function"}},function(e,t,r){"use strict";e.exports=!r(15)&&!r(16)(function(){return Object.defineProperty(r(17)("div"),"a",{get:function e(){return 7}}).a!=7})},function(e,t,r){"use strict";e.exports=!r(16)(function(){return Object.defineProperty({},"a",{get:function e(){return 7}}).a!=7})},function(e,t,r){"use strict";e.exports=function(e){try{return!!e()}catch(e){return true}}},function(e,t,r){"use strict";var n=r(13);var i=r(8).document;var a=n(i)&&n(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,r){"use strict";var n=r(13);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&typeof(r=e.toString)=="function"&&!n(i=r.call(e)))return i;if(typeof(r=e.valueOf)=="function"&&!n(i=r.call(e)))return i;if(!t&&typeof(r=e.toString)=="function"&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){"use strict";e.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}},function(e,t,r){"use strict";var n=r(8);var i=r(10);var a=r(21);var s=r(22)("src");var o="toString";var u=Function[o];var l=(""+u).split(o);r(9).inspectSource=function(e){return u.call(e)};(e.exports=function(e,t,r,o){var u=typeof r=="function";if(u)a(r,"name")||i(r,"name",t);if(e[t]===r)return;if(u)a(r,s)||i(r,s,e[t]?""+e[t]:l.join(String(t)));if(e===n){e[t]=r}else if(!o){delete e[t];i(e,t,r)}else if(e[t]){e[t]=r}else{i(e,t,r)}})(Function.prototype,o,function e(){return typeof this=="function"&&this[s]||u.call(this)})},function(e,t,r){"use strict";var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,r){"use strict";var n=0;var i=Math.random();e.exports=function(e){return"Symbol(".concat(e===undefined?"":e,")_",(++n+i).toString(36))}},function(e,t,r){"use strict";var n=r(24);e.exports=function(e,t,r){n(e);if(t===undefined)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,r){"use strict";e.exports=function(e){if(typeof e!="function")throw TypeError(e+" is not a function!");return e}},function(e,t,r){"use strict";var n=r(26);var i=r(31);e.exports=function(e,t,r){if(n(t))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(e))}},function(e,t,r){"use strict";var n=r(13);var i=r(27);var a=r(28)("match");e.exports=function(e){var t;return n(e)&&((t=e[a])!==undefined?!!t:i(e)=="RegExp")}},function(e,t,r){"use strict";var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,r){"use strict";var n=r(29)("wks");var i=r(22);var a=r(8).Symbol;var s=typeof a=="function";var o=e.exports=function(e){return n[e]||(n[e]=s&&a[e]||(s?a:i)("Symbol."+e))};o.store=n},function(e,t,r){"use strict";var n=r(9);var i=r(8);var a="__core-js_shared__";var s=i[a]||(i[a]={});(e.exports=function(e,t){return s[e]||(s[e]=t!==undefined?t:{})})("versions",[]).push({version:n.version,mode:r(30)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t,r){"use strict";e.exports=false},function(e,t,r){"use strict";e.exports=function(e){if(e==undefined)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){"use strict";var n=r(28)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{t[n]=false;return!"/./"[e](t)}catch(e){}}return true}},function(e,t,r){"use strict";r(34);e.exports=r(9).Array.includes},function(e,t,r){"use strict";var n=r(7);var i=r(35)(true);n(n.P,"Array",{includes:function e(t){return i(this,t,arguments.length>1?arguments[1]:undefined)}});r(41)("includes")},function(e,t,r){"use strict";var n=r(36);var i=r(38);var a=r(40);e.exports=function(e){return function(t,r,s){var o=n(t);var u=i(o.length);var l=a(s,u);var c;if(e&&r!=r)while(u>l){c=o[l++];if(c!=c)return true}else for(;u>l;l++){if(e||l in o){if(o[l]===r)return e||l||0}}return!e&&-1}}},function(e,t,r){"use strict";var n=r(37);var i=r(31);e.exports=function(e){return n(i(e))}},function(e,t,r){"use strict";var n=r(27);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return n(e)=="String"?e.split(""):Object(e)}},function(e,t,r){"use strict";var n=r(39);var i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){"use strict";var n=Math.ceil;var i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},function(e,t,r){"use strict";var n=r(39);var i=Math.max;var a=Math.min;e.exports=function(e,t){e=n(e);return e<0?i(e+t,0):a(e,t)}},function(e,t,r){"use strict";var n=r(28)("unscopables");var i=Array.prototype;if(i[n]==undefined)r(10)(i,n,{});e.exports=function(e){i[n][e]=true}},function(e,t,r){"use strict";r(43);e.exports=r(9).Object.assign},function(e,t,r){"use strict";var n=r(7);n(n.S+n.F,"Object",{assign:r(44)})},function(e,t,r){"use strict";var n=r(45);var i=r(49);var a=r(50);var s=r(51);var o=r(37);var u=Object.assign;e.exports=!u||r(16)(function(){var e={};var t={};var r=Symbol();var n="abcdefghijklmnopqrst";e[r]=7;n.split("").forEach(function(e){t[e]=e});return u({},e)[r]!=7||Object.keys(u({},t)).join("")!=n})?function e(t,r){var u=s(t);var l=arguments.length;var c=1;var f=i.f;var d=a.f;while(l>c){var h=o(arguments[c++]);var v=f?n(h).concat(f(h)):n(h);var p=v.length;var m=0;var g;while(p>m){if(d.call(h,g=v[m++]))u[g]=h[g]}}return u}:u},function(e,t,r){"use strict";var n=r(46);var i=r(48);e.exports=Object.keys||function e(t){return n(t,i)}},function(e,t,r){"use strict";var n=r(21);var i=r(36);var a=r(35)(false);var s=r(47)("IE_PROTO");e.exports=function(e,t){var r=i(e);var o=0;var u=[];var l;for(l in r){if(l!=s)n(r,l)&&u.push(l)}while(t.length>o){if(n(r,l=t[o++])){~a(u,l)||u.push(l)}}return u}},function(e,t,r){"use strict";var n=r(29)("keys");var i=r(22);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){"use strict";e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){"use strict";t.f=Object.getOwnPropertySymbols},function(e,t,r){"use strict";t.f={}.propertyIsEnumerable},function(e,t,r){"use strict";var n=r(31);e.exports=function(e){return Object(n(e))}},function(e,t,r){"use strict";r(53);e.exports=r(9).Math.log2},function(e,t,r){"use strict";var n=r(7);n(n.S,"Math",{log2:function e(t){return Math.log(t)/Math.LN2}})},function(e,t,r){"use strict";r(55);e.exports=r(9).Number.isNaN},function(e,t,r){"use strict";var n=r(7);n(n.S,"Number",{isNaN:function e(t){return t!=t}})},function(e,t,r){"use strict";r(57);e.exports=r(9).Number.isInteger},function(e,t,r){"use strict";var n=r(7);n(n.S,"Number",{isInteger:r(58)})},function(e,t,r){"use strict";var n=r(13);var i=Math.floor;e.exports=function e(t){return!n(t)&&isFinite(t)&&i(t)===t}},function(e,t,r){"use strict";r(60);r(62);r(72);r(75);r(92);r(93);e.exports=r(9).Promise},function(e,t,r){"use strict";var n=r(61);var i={};i[r(28)("toStringTag")]="z";if(i+""!="[object z]"){r(20)(Object.prototype,"toString",function e(){return"[object "+n(this)+"]"},true)}},function(e,t,r){"use strict";var n=r(27);var i=r(28)("toStringTag");var a=n(function(){return arguments}())=="Arguments";var s=function e(t,r){try{return t[r]}catch(e){}};e.exports=function(e){var t,r,o;return e===undefined?"Undefined":e===null?"Null":typeof(r=s(t=Object(e),i))=="string"?r:a?n(t):(o=n(t))=="Object"&&typeof t.callee=="function"?"Arguments":o}},function(e,t,r){"use strict";var n=r(63)(true);r(64)(String,"String",function(e){this._t=String(e);this._i=0},function(){var e=this._t;var t=this._i;var r;if(t>=e.length)return{value:undefined,done:true};r=n(e,t);this._i+=r.length;return{value:r,done:false}})},function(e,t,r){"use strict";var n=r(39);var i=r(31);e.exports=function(e){return function(t,r){var a=String(i(t));var s=n(r);var o=a.length;var u,l;if(s<0||s>=o)return e?"":undefined;u=a.charCodeAt(s);return u<55296||u>56319||s+1===o||(l=a.charCodeAt(s+1))<56320||l>57343?e?a.charAt(s):u:e?a.slice(s,s+2):(u-55296<<10)+(l-56320)+65536}}},function(e,t,r){"use strict";var n=r(30);var i=r(7);var a=r(20);var s=r(10);var o=r(65);var u=r(66);var l=r(70);var c=r(71);var f=r(28)("iterator");var d=!([].keys&&"next"in[].keys());var h="@@iterator";var v="keys";var p="values";var m=function e(){return this};e.exports=function(e,t,r,g,y,b,_){u(r,t,g);var A=function e(t){if(!d&&t in P)return P[t];switch(t){case v:return function e(){return new r(this,t)};case p:return function e(){return new r(this,t)}}return function e(){return new r(this,t)}};var S=t+" Iterator";var w=y==p;var k=false;var P=e.prototype;var C=P[f]||P[h]||y&&P[y];var x=C||A(y);var R=y?!w?x:A("entries"):undefined;var E=t=="Array"?P.entries||C:C;var T,O,L;if(E){L=c(E.call(new e));if(L!==Object.prototype&&L.next){l(L,S,true);if(!n&&typeof L[f]!="function")s(L,f,m)}}if(w&&C&&C.name!==p){k=true;x=function e(){return C.call(this)}}if((!n||_)&&(d||k||!P[f])){s(P,f,x)}o[t]=x;o[S]=m;if(y){T={values:w?x:A(p),keys:b?x:A(v),entries:R};if(_)for(O in T){if(!(O in P))a(P,O,T[O])}else i(i.P+i.F*(d||k),t,T)}return T}},function(e,t,r){"use strict";e.exports={}},function(e,t,r){"use strict";var n=r(67);var i=r(19);var a=r(70);var s={};r(10)(s,r(28)("iterator"),function(){return this});e.exports=function(e,t,r){e.prototype=n(s,{next:i(1,r)});a(e,t+" Iterator")}},function(e,t,r){"use strict";var n=r(12);var i=r(68);var a=r(48);var s=r(47)("IE_PROTO");var o=function e(){};var u="prototype";var l=function e(){var t=r(17)("iframe");var n=a.length;var i="<";var s=">";var o;t.style.display="none";r(69).appendChild(t);t.src="javascript:";o=t.contentWindow.document;o.open();o.write(i+"script"+s+"document.F=Object"+i+"/script"+s);o.close();l=o.F;while(n--){delete l[u][a[n]]}return l()};e.exports=Object.create||function e(t,r){var a;if(t!==null){o[u]=n(t);a=new o;o[u]=null;a[s]=t}else a=l();return r===undefined?a:i(a,r)}},function(e,t,r){"use strict";var n=r(11);var i=r(12);var a=r(45);e.exports=r(15)?Object.defineProperties:function e(t,r){i(t);var s=a(r);var o=s.length;var u=0;var l;while(o>u){n.f(t,l=s[u++],r[l])}return t}},function(e,t,r){"use strict";var n=r(8).document;e.exports=n&&n.documentElement},function(e,t,r){"use strict";var n=r(11).f;var i=r(21);var a=r(28)("toStringTag");e.exports=function(e,t,r){if(e&&!i(e=r?e:e.prototype,a))n(e,a,{configurable:true,value:t})}},function(e,t,r){"use strict";var n=r(21);var i=r(51);var a=r(47)("IE_PROTO");var s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){e=i(e);if(n(e,a))return e[a];if(typeof e.constructor=="function"&&e instanceof e.constructor){return e.constructor.prototype}return e instanceof Object?s:null}},function(e,t,r){"use strict";var n=r(73);var i=r(45);var a=r(20);var s=r(8);var o=r(10);var u=r(65);var l=r(28);var c=l("iterator");var f=l("toStringTag");var d=u.Array;var h={CSSRuleList:true,CSSStyleDeclaration:false,CSSValueList:false,ClientRectList:false,DOMRectList:false,DOMStringList:false,DOMTokenList:true,DataTransferItemList:false,FileList:false,HTMLAllCollection:false,HTMLCollection:false,HTMLFormElement:false,HTMLSelectElement:false,MediaList:true,MimeTypeArray:false,NamedNodeMap:false,NodeList:true,PaintRequestList:false,Plugin:false,PluginArray:false,SVGLengthList:false,SVGNumberList:false,SVGPathSegList:false,SVGPointList:false,SVGStringList:false,SVGTransformList:false,SourceBufferList:false,StyleSheetList:true,TextTrackCueList:false,TextTrackList:false,TouchList:false};for(var v=i(h),p=0;p=e.length){this._t=undefined;return i(1)}if(t=="keys")return i(0,r);if(t=="values")return i(0,e[r]);return i(0,[r,e[r]])},"values");a.Arguments=a.Array;n("keys");n("values");n("entries")},function(e,t,r){"use strict";e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){"use strict";var n=r(30);var i=r(8);var a=r(23);var s=r(61);var o=r(7);var u=r(13);var l=r(24);var c=r(76);var f=r(77);var d=r(81);var h=r(82).set;var v=r(84)();var p=r(85);var m=r(86);var g=r(87);var y=r(88);var b="Promise";var _=i.TypeError;var A=i.process;var S=A&&A.versions;var w=S&&S.v8||"";var k=i[b];var P=s(A)=="process";var C=function e(){};var x,R,E,T;var O=R=p.f;var L=!!function(){try{var e=k.resolve(1);var t=(e.constructor={})[r(28)("species")]=function(e){e(C,C)};return(P||typeof PromiseRejectionEvent=="function")&&e.then(C)instanceof t&&w.indexOf("6.6")!==0&&g.indexOf("Chrome/66")===-1}catch(e){}}();var I=function e(t){var r;return u(t)&&typeof(r=t.then)=="function"?r:false};var F=function e(t,r){if(t._n)return;t._n=true;var n=t._c;v(function(){var e=t._v;var i=t._s==1;var a=0;var s=function r(n){var a=i?n.ok:n.fail;var s=n.resolve;var o=n.reject;var u=n.domain;var l,c,f;try{if(a){if(!i){if(t._h==2)D(t);t._h=1}if(a===true)l=e;else{if(u)u.enter();l=a(e);if(u){u.exit();f=true}}if(l===n.promise){o(_("Promise-chain cycle"))}else if(c=I(l)){c.call(l,s,o)}else s(l)}else o(e)}catch(e){if(u&&!f)u.exit();o(e)}};while(n.length>a){s(n[a++])}t._c=[];t._n=false;if(r&&!t._h)M(t)})};var M=function e(t){h.call(i,function(){var e=t._v;var r=j(t);var n,a,s;if(r){n=m(function(){if(P){A.emit("unhandledRejection",e,t)}else if(a=i.onunhandledrejection){a({promise:t,reason:e})}else if((s=i.console)&&s.error){s.error("Unhandled promise rejection",e)}});t._h=P||j(t)?2:1}t._a=undefined;if(r&&n.e)throw n.v})};var j=function e(t){return t._h!==1&&(t._a||t._c).length===0};var D=function e(t){h.call(i,function(){var e;if(P){A.emit("rejectionHandled",t)}else if(e=i.onrejectionhandled){e({promise:t,reason:t._v})}})};var N=function e(t){var r=this;if(r._d)return;r._d=true;r=r._w||r;r._v=t;r._s=2;if(!r._a)r._a=r._c.slice();F(r,true)};var q=function e(t){var r=this;var n;if(r._d)return;r._d=true;r=r._w||r;try{if(r===t)throw _("Promise can't be resolved itself");if(n=I(t)){v(function(){var i={_w:r,_d:false};try{n.call(t,a(e,i,1),a(N,i,1))}catch(e){N.call(i,e)}})}else{r._v=t;r._s=1;F(r,false)}}catch(e){N.call({_w:r,_d:false},e)}};if(!L){k=function e(t){c(this,k,b,"_h");l(t);x.call(this);try{t(a(q,this,1),a(N,this,1))}catch(e){N.call(this,e)}};x=function e(t){this._c=[];this._a=undefined;this._s=0;this._d=false;this._v=undefined;this._h=0;this._n=false};x.prototype=r(89)(k.prototype,{then:function e(t,r){var n=O(d(this,k));n.ok=typeof t=="function"?t:true;n.fail=typeof r=="function"&&r;n.domain=P?A.domain:undefined;this._c.push(n);if(this._a)this._a.push(n);if(this._s)F(this,false);return n.promise},catch:function e(t){return this.then(undefined,t)}});E=function e(){var t=new x;this.promise=t;this.resolve=a(q,t,1);this.reject=a(N,t,1)};p.f=O=function e(t){return t===k||t===T?new E(t):R(t)}}o(o.G+o.W+o.F*!L,{Promise:k});r(70)(k,b);r(90)(b);T=r(9)[b];o(o.S+o.F*!L,b,{reject:function e(t){var r=O(this);var n=r.reject;n(t);return r.promise}});o(o.S+o.F*(n||!L),b,{resolve:function e(t){return y(n&&this===T?k:this,t)}});o(o.S+o.F*!(L&&r(91)(function(e){k.all(e)["catch"](C)})),b,{all:function e(t){var r=this;var n=O(r);var i=n.resolve;var a=n.reject;var s=m(function(){var e=[];var n=0;var s=1;f(t,false,function(t){var o=n++;var u=false;e.push(undefined);s++;r.resolve(t).then(function(t){if(u)return;u=true;e[o]=t;--s||i(e)},a)});--s||i(e)});if(s.e)a(s.v);return n.promise},race:function e(t){var r=this;var n=O(r);var i=n.reject;var a=m(function(){f(t,false,function(e){r.resolve(e).then(n.resolve,i)})});if(a.e)i(a.v);return n.promise}})},function(e,t,r){"use strict";e.exports=function(e,t,r,n){if(!(e instanceof t)||n!==undefined&&n in e){throw TypeError(r+": incorrect invocation!")}return e}},function(e,t,r){"use strict";var n=r(23);var i=r(78);var a=r(79);var s=r(12);var o=r(38);var u=r(80);var l={};var c={};var f=e.exports=function(e,t,r,f,d){var h=d?function(){return e}:u(e);var v=n(r,f,t?2:1);var p=0;var m,g,y,b;if(typeof h!="function")throw TypeError(e+" is not iterable!");if(a(h))for(m=o(e.length);m>p;p++){b=t?v(s(g=e[p])[0],g[1]):v(e[p]);if(b===l||b===c)return b}else for(y=h.call(e);!(g=y.next()).done;){b=i(y,v,g.value,t);if(b===l||b===c)return b}};f.BREAK=l;f.RETURN=c},function(e,t,r){"use strict";var n=r(12);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var a=e["return"];if(a!==undefined)n(a.call(e));throw t}}},function(e,t,r){"use strict";var n=r(65);var i=r(28)("iterator");var a=Array.prototype;e.exports=function(e){return e!==undefined&&(n.Array===e||a[i]===e)}},function(e,t,r){"use strict";var n=r(61);var i=r(28)("iterator");var a=r(65);e.exports=r(9).getIteratorMethod=function(e){if(e!=undefined)return e[i]||e["@@iterator"]||a[n(e)]}},function(e,t,r){"use strict";var n=r(12);var i=r(24);var a=r(28)("species");e.exports=function(e,t){var r=n(e).constructor;var s;return r===undefined||(s=n(r)[a])==undefined?t:i(s)}},function(e,t,r){"use strict";var n=r(23);var i=r(83);var a=r(69);var s=r(17);var o=r(8);var u=o.process;var l=o.setImmediate;var c=o.clearImmediate;var f=o.MessageChannel;var d=o.Dispatch;var h=0;var v={};var p="onreadystatechange";var m,g,y;var b=function e(){var t=+this;if(v.hasOwnProperty(t)){var r=v[t];delete v[t];r()}};var _=function e(t){b.call(t.data)};if(!l||!c){l=function e(t){var r=[];var n=1;while(arguments.length>n){r.push(arguments[n++])}v[++h]=function(){i(typeof t=="function"?t:Function(t),r)};m(h);return h};c=function e(t){delete v[t]};if(r(27)(u)=="process"){m=function e(t){u.nextTick(n(b,t,1))}}else if(d&&d.now){m=function e(t){d.now(n(b,t,1))}}else if(f){g=new f;y=g.port2;g.port1.onmessage=_;m=n(y.postMessage,y,1)}else if(o.addEventListener&&typeof postMessage=="function"&&!o.importScripts){m=function e(t){o.postMessage(t+"","*")};o.addEventListener("message",_,false)}else if(p in s("script")){m=function e(t){a.appendChild(s("script"))[p]=function(){a.removeChild(this);b.call(t)}}}else{m=function e(t){setTimeout(n(b,t,1),0)}}}e.exports={set:l,clear:c}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=r===undefined;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},function(e,t,r){"use strict";var n=r(8);var i=r(82).set;var a=n.MutationObserver||n.WebKitMutationObserver;var s=n.process;var o=n.Promise;var u=r(27)(s)=="process";e.exports=function(){var e,t,r;var l=function n(){var i,a;if(u&&(i=s.domain))i.exit();while(e){a=e.fn;e=e.next;try{a()}catch(n){if(e)r();else t=undefined;throw n}}t=undefined;if(i)i.enter()};if(u){r=function e(){s.nextTick(l)}}else if(a&&!(n.navigator&&n.navigator.standalone)){var c=true;var f=document.createTextNode("");new a(l).observe(f,{characterData:true});r=function e(){f.data=c=!c}}else if(o&&o.resolve){var d=o.resolve(undefined);r=function e(){d.then(l)}}else{r=function e(){i.call(n,l)}}return function(n){var i={fn:n,next:undefined};if(t)t.next=i;if(!e){e=i;r()}t=i}}},function(e,t,r){"use strict";var n=r(24);function i(e){var t,r;this.promise=new e(function(e,n){if(t!==undefined||r!==undefined)throw TypeError("Bad Promise constructor");t=e;r=n});this.resolve=n(t);this.reject=n(r)}e.exports.f=function(e){return new i(e)}},function(e,t,r){"use strict";e.exports=function(e){try{return{e:false,v:e()}}catch(e){return{e:true,v:e}}}},function(e,t,r){"use strict";var n=r(8);var i=n.navigator;e.exports=i&&i.userAgent||""},function(e,t,r){"use strict";var n=r(12);var i=r(13);var a=r(85);e.exports=function(e,t){n(e);if(i(t)&&t.constructor===e)return t;var r=a.f(e);var s=r.resolve;s(t);return r.promise}},function(e,t,r){"use strict";var n=r(20);e.exports=function(e,t,r){for(var i in t){n(e,i,t[i],r)}return e}},function(e,t,r){"use strict";var n=r(8);var i=r(11);var a=r(15);var s=r(28)("species");e.exports=function(e){var t=n[e];if(a&&t&&!t[s])i.f(t,s,{configurable:true,get:function e(){return this}})}},function(e,t,r){"use strict";var n=r(28)("iterator");var i=false;try{var a=[7][n]();a["return"]=function(){i=true};Array.from(a,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return false;var r=false;try{var a=[7];var s=a[n]();s.next=function(){return{done:r=true}};a[n]=function(){return s};e(a)}catch(e){}return r}},function(e,t,r){"use strict";var n=r(7);var i=r(9);var a=r(8);var s=r(81);var o=r(88);n(n.P+n.R,"Promise",{finally:function e(t){var r=s(this,i.Promise||a.Promise);var n=typeof t=="function";return this.then(n?function(e){return o(r,t()).then(function(){return e})}:t,n?function(e){return o(r,t()).then(function(){throw e})}:t)}})},function(e,t,r){"use strict";var n=r(7);var i=r(85);var a=r(86);n(n.S,"Promise",{try:function e(t){var r=i.f(this);var n=a(t);(n.e?r.reject:r.resolve)(n.v);return r.promise}})},function(e,t,r){"use strict";r(60);r(72);r(95);r(107);r(109);e.exports=r(9).WeakMap},function(e,t,r){"use strict";var n=r(96)(0);var i=r(20);var a=r(100);var s=r(44);var o=r(101);var u=r(13);var l=r(16);var c=r(102);var f="WeakMap";var d=a.getWeak;var h=Object.isExtensible;var v=o.ufstore;var p={};var m;var g=function e(t){return function e(){return t(this,arguments.length>0?arguments[0]:undefined)}};var y={get:function e(t){if(u(t)){var r=d(t);if(r===true)return v(c(this,f)).get(t);return r?r[this._i]:undefined}},set:function e(t,r){return o.def(c(this,f),t,r)}};var b=e.exports=r(103)(f,g,y,o,true,true);if(l(function(){return(new b).set((Object.freeze||Object)(p),7).get(p)!=7})){m=o.getConstructor(g,f);s(m.prototype,y);a.NEED=true;n(["delete","has","get","set"],function(e){var t=b.prototype;var r=t[e];i(t,e,function(t,n){if(u(t)&&!h(t)){if(!this._f)this._f=new m;var i=this._f[e](t,n);return e=="set"?this:i}return r.call(this,t,n)})})}},function(e,t,r){"use strict";var n=r(23);var i=r(37);var a=r(51);var s=r(38);var o=r(97);e.exports=function(e,t){var r=e==1;var u=e==2;var l=e==3;var c=e==4;var f=e==6;var d=e==5||f;var h=t||o;return function(t,o,v){var p=a(t);var m=i(p);var g=n(o,v,3);var y=s(m.length);var b=0;var _=r?h(t,y):u?h(t,0):undefined;var A,S;for(;y>b;b++){if(d||b in m){A=m[b];S=g(A,b,p);if(e){if(r)_[b]=S;else if(S)switch(e){case 3:return true;case 5:return A;case 6:return b;case 2:_.push(A)}else if(c)return false}}}return f?-1:l||c?c:_}}},function(e,t,r){"use strict";var n=r(98);e.exports=function(e,t){return new(n(e))(t)}},function(e,t,r){"use strict";var n=r(13);var i=r(99);var a=r(28)("species");e.exports=function(e){var t;if(i(e)){t=e.constructor;if(typeof t=="function"&&(t===Array||i(t.prototype)))t=undefined;if(n(t)){t=t[a];if(t===null)t=undefined}}return t===undefined?Array:t}},function(e,t,r){"use strict";var n=r(27);e.exports=Array.isArray||function e(t){return n(t)=="Array"}},function(e,t,r){"use strict";var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=r(22)("meta");var a=r(13);var s=r(21);var o=r(11).f;var u=0;var l=Object.isExtensible||function(){return true};var c=!r(16)(function(){return l(Object.preventExtensions({}))});var f=function e(t){o(t,i,{value:{i:"O"+ ++u,w:{}}})};var d=function e(t,r){if(!a(t))return(typeof t==="undefined"?"undefined":n(t))=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!s(t,i)){if(!l(t))return"F";if(!r)return"E";f(t)}return t[i].i};var h=function e(t,r){if(!s(t,i)){if(!l(t))return true;if(!r)return false;f(t)}return t[i].w};var v=function e(t){if(c&&p.NEED&&l(t)&&!s(t,i))f(t);return t};var p=e.exports={KEY:i,NEED:false,fastKey:d,getWeak:h,onFreeze:v}},function(e,t,r){"use strict";var n=r(89);var i=r(100).getWeak;var a=r(12);var s=r(13);var o=r(76);var u=r(77);var l=r(96);var c=r(21);var f=r(102);var d=l(5);var h=l(6);var v=0;var p=function e(t){return t._l||(t._l=new m)};var m=function e(){this.a=[]};var g=function e(t,r){return d(t.a,function(e){return e[0]===r})};m.prototype={get:function e(t){var r=g(this,t);if(r)return r[1]},has:function e(t){return!!g(this,t)},set:function e(t,r){var n=g(this,t);if(n)n[1]=r;else this.a.push([t,r])},delete:function e(t){var r=h(this.a,function(e){return e[0]===t});if(~r)this.a.splice(r,1);return!!~r}};e.exports={getConstructor:function e(t,r,a,l){var d=t(function(e,t){o(e,d,r,"_i");e._t=r;e._i=v++;e._l=undefined;if(t!=undefined)u(t,a,e[l],e)});n(d.prototype,{delete:function e(t){if(!s(t))return false;var n=i(t);if(n===true)return p(f(this,r))["delete"](t);return n&&c(n,this._i)&&delete n[this._i]},has:function e(t){if(!s(t))return false;var n=i(t);if(n===true)return p(f(this,r)).has(t);return n&&c(n,this._i)}});return d},def:function e(t,r,n){var s=i(a(r),true);if(s===true)p(t).set(r,n);else s[t._i]=n;return t},ufstore:p}},function(e,t,r){"use strict";var n=r(13);e.exports=function(e,t){if(!n(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,r){"use strict";var n=r(8);var i=r(7);var a=r(20);var s=r(89);var o=r(100);var u=r(77);var l=r(76);var c=r(13);var f=r(16);var d=r(91);var h=r(70);var v=r(104);e.exports=function(e,t,r,p,m,g){var y=n[e];var b=y;var _=m?"set":"add";var A=b&&b.prototype;var S={};var w=function e(t){var r=A[t];a(A,t,t=="delete"?function(e){return g&&!c(e)?false:r.call(this,e===0?0:e)}:t=="has"?function e(t){return g&&!c(t)?false:r.call(this,t===0?0:t)}:t=="get"?function e(t){return g&&!c(t)?undefined:r.call(this,t===0?0:t)}:t=="add"?function e(t){r.call(this,t===0?0:t);return this}:function e(t,n){r.call(this,t===0?0:t,n);return this})};if(typeof b!="function"||!(g||A.forEach&&!f(function(){(new b).entries().next()}))){b=p.getConstructor(t,e,m,_);s(b.prototype,r);o.NEED=true}else{var k=new b;var P=k[_](g?{}:-0,1)!=k;var C=f(function(){k.has(1)});var x=d(function(e){new b(e)});var R=!g&&f(function(){var e=new b;var t=5;while(t--){e[_](t,t)}return!e.has(-0)});if(!x){b=t(function(t,r){l(t,b,e);var n=v(new y,t,b);if(r!=undefined)u(r,m,n[_],n);return n});b.prototype=A;A.constructor=b}if(C||R){w("delete");w("has");m&&w("get")}if(R||P)w(_);if(g&&A.clear)delete A.clear}h(b,e);S[e]=b;i(i.G+i.W+i.F*(b!=y),S);if(!g)p.setStrong(b,e,m);return b}},function(e,t,r){"use strict";var n=r(13);var i=r(105).set;e.exports=function(e,t,r){var a=t.constructor;var s;if(a!==r&&typeof a=="function"&&(s=a.prototype)!==r.prototype&&n(s)&&i){i(e,s)}return e}},function(e,t,r){"use strict";var n=r(13);var i=r(12);var a=function e(t,r){i(t);if(!n(r)&&r!==null)throw TypeError(r+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{n=r(23)(Function.call,r(106).f(Object.prototype,"__proto__").set,2);n(e,[]);t=!(e instanceof Array)}catch(e){t=true}return function e(r,i){a(r,i);if(t)r.__proto__=i;else n(r,i);return r}}({},false):undefined),check:a}},function(e,t,r){"use strict";var n=r(50);var i=r(19);var a=r(36);var s=r(18);var o=r(21);var u=r(14);var l=Object.getOwnPropertyDescriptor;t.f=r(15)?l:function e(t,r){t=a(t);r=s(r,true);if(u)try{return l(t,r)}catch(e){}if(o(t,r))return i(!n.f.call(t,r),t[r])}},function(e,t,r){"use strict";r(108)("WeakMap")},function(e,t,r){"use strict";var n=r(7);e.exports=function(e){n(n.S,e,{of:function e(){var t=arguments.length;var r=new Array(t);while(t--){r[t]=arguments[t]}return new this(r)}})}},function(e,t,r){"use strict";r(110)("WeakMap")},function(e,t,r){"use strict";var n=r(7);var i=r(24);var a=r(23);var s=r(77);e.exports=function(e){n(n.S,e,{from:function e(t){var r=arguments[1];var n,o,u,l;i(this);n=r!==undefined;if(n)i(r);if(t==undefined)return new this;o=[];if(n){u=0;l=a(r,arguments[2],2);s(t,false,function(e){o.push(l(e,u++))})}else{s(t,false,o.push,o)}return new this(o)}})}},function(e,t,r){"use strict";r(112);e.exports=r(9).String.codePointAt},function(e,t,r){"use strict";var n=r(7);var i=r(63)(false);n(n.P,"String",{codePointAt:function e(t){return i(this,t)}})},function(e,t,r){"use strict";r(114);e.exports=r(9).String.fromCodePoint},function(e,t,r){"use strict";var n=r(7);var i=r(40);var a=String.fromCharCode;var s=String.fromCodePoint;n(n.S+n.F*(!!s&&s.length!=1),"String",{fromCodePoint:function e(t){var r=[];var n=arguments.length;var s=0;var o;while(n>s){o=+arguments[s++];if(i(o,1114111)!==o)throw RangeError(o+" is not a valid code point");r.push(o<65536?a(o):a(((o-=65536)>>10)+55296,o%1024+56320))}return r.join("")}})},function(e,t,r){"use strict";r(116);r(60);e.exports=r(9).Symbol},function(e,t,r){"use strict";var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=r(8);var a=r(21);var s=r(15);var o=r(7);var u=r(20);var l=r(100).KEY;var c=r(16);var f=r(29);var d=r(70);var h=r(22);var v=r(28);var p=r(117);var m=r(118);var g=r(119);var y=r(99);var b=r(12);var _=r(13);var A=r(36);var S=r(18);var w=r(19);var k=r(67);var P=r(120);var C=r(106);var x=r(11);var R=r(45);var E=C.f;var T=x.f;var O=P.f;var L=i.Symbol;var I=i.JSON;var F=I&&I.stringify;var M="prototype";var j=v("_hidden");var D=v("toPrimitive");var N={}.propertyIsEnumerable;var q=f("symbol-registry");var W=f("symbols");var U=f("op-symbols");var B=Object[M];var z=typeof L=="function";var G=i.QObject;var H=!G||!G[M]||!G[M].findChild;var X=s&&c(function(){return k(T({},"a",{get:function e(){return T(this,"a",{value:7}).a}})).a!=7})?function(e,t,r){var n=E(B,t);if(n)delete B[t];T(e,t,r);if(n&&e!==B)T(B,t,n)}:T;var Y=function e(t){var r=W[t]=k(L[M]);r._k=t;return r};var V=z&&n(L.iterator)=="symbol"?function(e){return(typeof e==="undefined"?"undefined":n(e))=="symbol"}:function(e){return e instanceof L};var Q=function e(t,r,n){if(t===B)Q(U,r,n);b(t);r=S(r,true);b(n);if(a(W,r)){if(!n.enumerable){if(!a(t,j))T(t,j,w(1,{}));t[j][r]=true}else{if(a(t,j)&&t[j][r])t[j][r]=false;n=k(n,{enumerable:w(0,false)})}return X(t,r,n)}return T(t,r,n)};var K=function e(t,r){b(t);var n=g(r=A(r));var i=0;var a=n.length;var s;while(a>i){Q(t,s=n[i++],r[s])}return t};var J=function e(t,r){return r===undefined?k(t):K(k(t),r)};var Z=function e(t){var r=N.call(this,t=S(t,true));if(this===B&&a(W,t)&&!a(U,t))return false;return r||!a(this,t)||!a(W,t)||a(this,j)&&this[j][t]?r:true};var $=function e(t,r){t=A(t);r=S(r,true);if(t===B&&a(W,r)&&!a(U,r))return;var n=E(t,r);if(n&&a(W,r)&&!(a(t,j)&&t[j][r]))n.enumerable=true;return n};var ee=function e(t){var r=O(A(t));var n=[];var i=0;var s;while(r.length>i){if(!a(W,s=r[i++])&&s!=j&&s!=l)n.push(s)}return n};var te=function e(t){var r=t===B;var n=O(r?U:A(t));var i=[];var s=0;var o;while(n.length>s){if(a(W,o=n[s++])&&(r?a(B,o):true))i.push(W[o])}return i};if(!z){L=function e(){if(this instanceof L)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:undefined);var r=function e(r){if(this===B)e.call(U,r);if(a(this,j)&&a(this[j],t))this[j][t]=false;X(this,t,w(1,r))};if(s&&H)X(B,t,{configurable:true,set:r});return Y(t)};u(L[M],"toString",function e(){return this._k});C.f=$;x.f=Q;r(121).f=P.f=ee;r(50).f=Z;r(49).f=te;if(s&&!r(30)){u(B,"propertyIsEnumerable",Z,true)}p.f=function(e){return Y(v(e))}}o(o.G+o.W+o.F*!z,{Symbol:L});for(var re="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;re.length>ne;){v(re[ne++])}for(var ie=R(v.store),ae=0;ie.length>ae;){m(ie[ae++])}o(o.S+o.F*!z,"Symbol",{for:function e(t){return a(q,t+="")?q[t]:q[t]=L(t)},keyFor:function e(t){if(!V(t))throw TypeError(t+" is not a symbol!");for(var r in q){if(q[r]===t)return r}},useSetter:function e(){H=true},useSimple:function e(){H=false}});o(o.S+o.F*!z,"Object",{create:J,defineProperty:Q,defineProperties:K,getOwnPropertyDescriptor:$,getOwnPropertyNames:ee,getOwnPropertySymbols:te});I&&o(o.S+o.F*(!z||c(function(){var e=L();return F([e])!="[null]"||F({a:e})!="{}"||F(Object(e))!="{}"})),"JSON",{stringify:function e(t){var r=[t];var n=1;var i,a;while(arguments.length>n){r.push(arguments[n++])}a=i=r[1];if(!_(i)&&t===undefined||V(t))return;if(!y(i))i=function e(t,r){if(typeof a=="function")r=a.call(this,t,r);if(!V(r))return r};r[1]=i;return F.apply(I,r)}});L[M][D]||r(10)(L[M],D,L[M].valueOf);d(L,"Symbol");d(Math,"Math",true);d(i.JSON,"JSON",true)},function(e,t,r){"use strict";t.f=r(28)},function(e,t,r){"use strict";var n=r(8);var i=r(9);var a=r(30);var s=r(117);var o=r(11).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=a?{}:n.Symbol||{});if(e.charAt(0)!="_"&&!(e in t))o(t,e,{value:s.f(e)})}},function(e,t,r){"use strict";var n=r(45);var i=r(49);var a=r(50);e.exports=function(e){var t=n(e);var r=i.f;if(r){var s=r(e);var o=a.f;var u=0;var l;while(s.length>u){if(o.call(e,l=s[u++]))t.push(l)}}return t}},function(e,t,r){"use strict";var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=r(36);var a=r(121).f;var s={}.toString;var o=(typeof window==="undefined"?"undefined":n(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];var u=function e(t){try{return a(t)}catch(e){return o.slice()}};e.exports.f=function e(t){return o&&s.call(t)=="[object Window]"?u(t):a(i(t))}},function(e,t,r){"use strict";var n=r(46);var i=r(48).concat("length","prototype");t.f=Object.getOwnPropertyNames||function e(t){return n(t,i)}},function(e,t,r){"use strict";r(123);e.exports=r(9).Object.values},function(e,t,r){"use strict";var n=r(7);var i=r(124)(false);n(n.S,"Object",{values:function e(t){return i(t)}})},function(e,t,r){"use strict";var n=r(45);var i=r(36);var a=r(50).f;e.exports=function(e){return function(t){var r=i(t);var s=n(r);var o=s.length;var u=0;var l=[];var c;while(o>u){if(a.call(r,c=s[u++])){l.push(e?[c,r[c]]:r[c])}}return l}}},function(e,t,r){"use strict";var n=false;if(typeof ReadableStream!=="undefined"){try{new ReadableStream({start:function e(t){t.close()}});n=true}catch(e){}}if(n){t.ReadableStream=ReadableStream}else{t.ReadableStream=r(126).ReadableStream}},function(e,t,r){"use strict";var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};(function(e,t){for(var r in t){e[r]=t[r]}})(t,function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:false,exports:{}};e[n].call(i.exports,i,i.exports,r);i.l=true;return i.exports}r.m=e;r.c=t;r.i=function(e){return e};r.d=function(e,t,n){if(!r.o(e,t)){Object.defineProperty(e,t,{configurable:false,enumerable:true,get:n})}};r.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};r.d(t,"a",t);return t};r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};r.p="";return r(r.s=7)}([function(e,t,r){"use strict";var i=typeof Symbol==="function"&&n(Symbol.iterator)==="symbol"?function(e){return typeof e==="undefined"?"undefined":n(e)}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e==="undefined"?"undefined":n(e)};var a=r(1),s=a.assert;function o(e){return typeof e==="string"||(typeof e==="undefined"?"undefined":i(e))==="symbol"}t.typeIsObject=function(e){return(typeof e==="undefined"?"undefined":i(e))==="object"&&e!==null||typeof e==="function"};t.createDataProperty=function(e,r,n){s(t.typeIsObject(e));Object.defineProperty(e,r,{value:n,writable:true,enumerable:true,configurable:true})};t.createArrayFromList=function(e){return e.slice()};t.ArrayBufferCopy=function(e,t,r,n,i){new Uint8Array(e).set(new Uint8Array(r,n,i),t)};t.CreateIterResultObject=function(e,t){s(typeof t==="boolean");var r={};Object.defineProperty(r,"value",{value:e,enumerable:true,writable:true,configurable:true});Object.defineProperty(r,"done",{value:t,enumerable:true,writable:true,configurable:true});return r};t.IsFiniteNonNegativeNumber=function(e){if(Number.isNaN(e)){return false}if(e===Infinity){return false}if(e<0){return false}return true};function u(e,t,r){if(typeof e!=="function"){throw new TypeError("Argument is not a function")}return Function.prototype.apply.call(e,t,r)}t.InvokeOrNoop=function(e,t,r){s(e!==undefined);s(o(t));s(Array.isArray(r));var n=e[t];if(n===undefined){return undefined}return u(n,e,r)};t.PromiseInvokeOrNoop=function(e,r,n){s(e!==undefined);s(o(r));s(Array.isArray(n));try{return Promise.resolve(t.InvokeOrNoop(e,r,n))}catch(e){return Promise.reject(e)}};t.PromiseInvokeOrPerformFallback=function(e,t,r,n,i){s(e!==undefined);s(o(t));s(Array.isArray(r));s(Array.isArray(i));var a=void 0;try{a=e[t]}catch(e){return Promise.reject(e)}if(a===undefined){return n.apply(null,i)}try{return Promise.resolve(u(a,e,r))}catch(e){return Promise.reject(e)}};t.TransferArrayBuffer=function(e){return e.slice()};t.ValidateAndNormalizeHighWaterMark=function(e){e=Number(e);if(Number.isNaN(e)||e<0){throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN")}return e};t.ValidateAndNormalizeQueuingStrategy=function(e,r){if(e!==undefined&&typeof e!=="function"){throw new TypeError("size property of a queuing strategy must be a function")}r=t.ValidateAndNormalizeHighWaterMark(r);return{size:e,highWaterMark:r}}},function(e,t,r){"use strict";function n(e){if(e&&e.constructor===i){setTimeout(function(){throw e},0)}}function i(e){this.name="AssertionError";this.message=e||"";this.stack=(new Error).stack}i.prototype=Object.create(Error.prototype);i.prototype.constructor=i;function a(e,t){if(!e){throw new i(t)}}e.exports={rethrowAssertionErrorRejection:n,AssertionError:i,assert:a}},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r0&&arguments[0]!==undefined?arguments[0]:{};var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.size,a=r.highWaterMark,s=a===undefined?1:a;i(this,e);this._state="writable";this._storedError=undefined;this._writer=undefined;this._writableStreamController=undefined;this._writeRequests=[];this._inFlightWriteRequest=undefined;this._closeRequest=undefined;this._inFlightCloseRequest=undefined;this._pendingAbortRequest=undefined;this._backpressure=false;var o=t.type;if(o!==undefined){throw new RangeError("Invalid type is specified")}this._writableStreamController=new Y(this,t,n,s);this._writableStreamController.__startSteps()}n(e,[{key:"abort",value:function e(t){if(_(this)===false){return Promise.reject(ae("abort"))}if(A(this)===true){return Promise.reject(new TypeError("Cannot abort a stream that already has a writer"))}return S(this,t)}},{key:"getWriter",value:function e(){if(_(this)===false){throw ae("getWriter")}return b(this)}},{key:"locked",get:function e(){if(_(this)===false){throw ae("locked")}return A(this)}}]);return e}();e.exports={AcquireWritableStreamDefaultWriter:b,IsWritableStream:_,IsWritableStreamLocked:A,WritableStream:y,WritableStreamAbort:S,WritableStreamDefaultControllerError:ie,WritableStreamDefaultWriterCloseWithErrorPropagation:U,WritableStreamDefaultWriterRelease:H,WritableStreamDefaultWriterWrite:X,WritableStreamCloseQueuedOrInFlight:O};function b(e){return new D(e)}function _(e){if(!l(e)){return false}if(!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")){return false}return true}function A(e){f(_(e)===true,"IsWritableStreamLocked should only be used on known writable streams");if(e._writer===undefined){return false}return true}function S(e,t){var r=e._state;if(r==="closed"){return Promise.resolve(undefined)}if(r==="errored"){return Promise.reject(e._storedError)}var n=new TypeError("Requested to abort");if(e._pendingAbortRequest!==undefined){return Promise.reject(n)}f(r==="writable"||r==="erroring","state must be writable or erroring");var i=false;if(r==="erroring"){i=true;t=undefined}var a=new Promise(function(r,n){e._pendingAbortRequest={_resolve:r,_reject:n,_reason:t,_wasAlreadyErroring:i}});if(i===false){P(e,n)}return a}function w(e){f(A(e)===true);f(e._state==="writable");var t=new Promise(function(t,r){var n={_resolve:t,_reject:r};e._writeRequests.push(n)});return t}function k(e,t){var r=e._state;if(r==="writable"){P(e,t);return}f(r==="erroring");C(e)}function P(e,t){f(e._storedError===undefined,"stream._storedError === undefined");f(e._state==="writable","state must be writable");var r=e._writableStreamController;f(r!==undefined,"controller must not be undefined");e._state="erroring";e._storedError=t;var n=e._writer;if(n!==undefined){z(n,t)}if(L(e)===false&&r._started===true){C(e)}}function C(e){f(e._state==="erroring","stream._state === erroring");f(L(e)===false,"WritableStreamHasOperationMarkedInFlight(stream) === false");e._state="errored";e._writableStreamController.__errorSteps();var t=e._storedError;for(var r=0;r0,"Spec-level failure: should never dequeue from an empty queue.");var t=e._queue.shift();e._queueTotalSize-=t.size;if(e._queueTotalSize<0){e._queueTotalSize=0}return t.value};t.EnqueueValueWithSize=function(e,t,r){s("_queue"in e&&"_queueTotalSize"in e,"Spec-level failure: EnqueueValueWithSize should only be used on containers with [[queue]] and "+"[[queueTotalSize]].");r=Number(r);if(!i(r)){throw new RangeError("Size must be a finite, non-NaN, non-negative number.")}e._queue.push({value:t,size:r});e._queueTotalSize+=r};t.PeekQueueValue=function(e){s("_queue"in e&&"_queueTotalSize"in e,"Spec-level failure: PeekQueueValue should only be used on containers with [[queue]] and [[queueTotalSize]].");s(e._queue.length>0,"Spec-level failure: should never peek at an empty queue.");var t=e._queue[0];return t.value};t.ResetQueue=function(e){s("_queue"in e&&"_queueTotalSize"in e,"Spec-level failure: ResetQueue should only be used on containers with [[queue]] and [[queueTotalSize]].");e._queue=[];e._queueTotalSize=0}},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r0&&arguments[0]!==undefined?arguments[0]:{};var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.size,a=r.highWaterMark;i(this,e);this._state="readable";this._reader=undefined;this._storedError=undefined;this._disturbed=false;this._readableStreamController=undefined;var s=t.type;var o=String(s);if(o==="bytes"){if(a===undefined){a=0}this._readableStreamController=new _e(this,t,a)}else if(s===undefined){if(a===undefined){a=1}this._readableStreamController=new ce(this,t,n,a)}else{throw new RangeError("Invalid type is specified")}}n(e,[{key:"cancel",value:function e(t){if(D(this)===false){return Promise.reject(He("cancel"))}if(q(this)===true){return Promise.reject(new TypeError("Cannot cancel a stream that already has a reader"))}return X(this,t)}},{key:"getReader",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},r=t.mode;if(D(this)===false){throw He("getReader")}if(r===undefined){return j(this)}r=String(r);if(r==="byob"){return M(this)}throw new RangeError("Invalid mode is specified")}},{key:"pipeThrough",value:function e(t,r){var n=t.writable,i=t.readable;var a=this.pipeTo(n,r);it(a);return i}},{key:"pipeTo",value:function e(t){var r=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},i=n.preventClose,a=n.preventAbort,s=n.preventCancel;if(D(this)===false){return Promise.reject(He("pipeTo"))}if(x(t)===false){return Promise.reject(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"))}i=Boolean(i);a=Boolean(a);s=Boolean(s);if(q(this)===true){return Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream"))}if(R(t)===true){return Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream"))}var o=j(this);var u=C(t);var l=false;var c=Promise.resolve();return new Promise(function(e,n){function f(){c=Promise.resolve();if(l===true){return Promise.resolve()}return u._readyPromise.then(function(){return le(o).then(function(e){var t=e.value,r=e.done;if(r===true){return}c=L(u,t).catch(function(){})})}).then(f)}v(r,o._closedPromise,function(e){if(a===false){m(function(){return E(t,e)},true,e)}else{g(true,e)}});v(t,u._closedPromise,function(e){if(s===false){m(function(){return X(r,e)},true,e)}else{g(true,e)}});p(r,o._closedPromise,function(){if(i===false){m(function(){return T(u)})}else{g()}});if(I(t)===true||t._state==="closed"){var d=new TypeError("the destination writable stream closed before all data could be piped to it");if(s===false){m(function(){return X(r,d)},true,d)}else{g(true,d)}}f().catch(function(e){c=Promise.resolve();_(e)});function h(){var e=c;return c.then(function(){return e!==c?h():undefined})}function v(e,t,r){if(e._state==="errored"){r(e._storedError)}else{t.catch(r).catch(_)}}function p(e,t,r){if(e._state==="closed"){r()}else{t.then(r).catch(_)}}function m(e,r,n){if(l===true){return}l=true;if(t._state==="writable"&&I(t)===false){h().then(i)}else{i()}function i(){e().then(function(){return y(r,n)},function(e){return y(true,e)}).catch(_)}}function g(e,r){if(l===true){return}l=true;if(t._state==="writable"&&I(t)===false){h().then(function(){return y(e,r)}).catch(_)}else{y(e,r)}}function y(t,r){O(u);oe(o);if(t){n(r)}else{e(undefined)}}})}},{key:"tee",value:function e(){if(D(this)===false){throw He("tee")}var t=W(this,false);return p(t)}},{key:"locked",get:function e(){if(D(this)===false){throw He("locked")}return q(this)}}]);return e}();e.exports={ReadableStream:F,IsReadableStreamDisturbed:N,ReadableStreamDefaultControllerClose:ve,ReadableStreamDefaultControllerEnqueue:pe,ReadableStreamDefaultControllerError:me,ReadableStreamDefaultControllerGetDesiredSize:ye};function M(e){return new re(e)}function j(e){return new te(e)}function D(e){if(!g(e)){return false}if(!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")){return false}return true}function N(e){b(D(e)===true,"IsReadableStreamDisturbed should only be used on known readable streams");return e._disturbed}function q(e){b(D(e)===true,"IsReadableStreamLocked should only be used on known readable streams");if(e._reader===undefined){return false}return true}function W(e,t){b(D(e)===true);b(typeof t==="boolean");var r=j(e);var n={closedOrErrored:false,canceled1:false,canceled2:false,reason1:undefined,reason2:undefined};n.promise=new Promise(function(e){n._resolve=e});var i=U();i._reader=r;i._teeState=n;i._cloneForBranch2=t;var a=B();a._stream=e;a._teeState=n;var s=z();s._stream=e;s._teeState=n;var o=Object.create(Object.prototype);m(o,"pull",i);m(o,"cancel",a);var u=new F(o);var l=Object.create(Object.prototype);m(l,"pull",i);m(l,"cancel",s);var c=new F(l);i._branch1=u._readableStreamController;i._branch2=c._readableStreamController;r._closedPromise.catch(function(e){if(n.closedOrErrored===true){return}me(i._branch1,e);me(i._branch2,e);n.closedOrErrored=true});return[u,c]}function U(){function e(){var t=e._reader,r=e._branch1,n=e._branch2,i=e._teeState;return le(t).then(function(e){b(g(e));var t=e.value;var a=e.done;b(typeof a==="boolean");if(a===true&&i.closedOrErrored===false){if(i.canceled1===false){ve(r)}if(i.canceled2===false){ve(n)}i.closedOrErrored=true}if(i.closedOrErrored===true){return}var s=t;var o=t;if(i.canceled1===false){pe(r,s)}if(i.canceled2===false){pe(n,o)}})}return e}function B(){function e(t){var r=e._stream,n=e._teeState;n.canceled1=true;n.reason1=t;if(n.canceled2===true){var i=p([n.reason1,n.reason2]);var a=X(r,i);n._resolve(a)}return n.promise}return e}function z(){function e(t){var r=e._stream,n=e._teeState;n.canceled2=true;n.reason2=t;if(n.canceled1===true){var i=p([n.reason1,n.reason2]);var a=X(r,i);n._resolve(a)}return n.promise}return e}function G(e){b(ne(e._reader)===true);b(e._state==="readable"||e._state==="closed");var t=new Promise(function(t,r){var n={_resolve:t,_reject:r};e._reader._readIntoRequests.push(n)});return t}function H(e){b(ie(e._reader)===true);b(e._state==="readable");var t=new Promise(function(t,r){var n={_resolve:t,_reject:r};e._reader._readRequests.push(n)});return t}function X(e,t){e._disturbed=true;if(e._state==="closed"){return Promise.resolve(undefined)}if(e._state==="errored"){return Promise.reject(e._storedError)}Y(e);var r=e._readableStreamController.__cancelSteps(t);return r.then(function(){return undefined})}function Y(e){b(e._state==="readable");e._state="closed";var t=e._reader;if(t===undefined){return undefined}if(ie(t)===true){for(var r=0;r0);var i=n._readIntoRequests.shift();i._resolve(o(t,r))}function K(e,t,r){var n=e._reader;b(n._readRequests.length>0);var i=n._readRequests.shift();i._resolve(o(t,r))}function J(e){return e._reader._readIntoRequests.length}function Z(e){return e._reader._readRequests.length}function $(e){var t=e._reader;if(t===undefined){return false}if(ne(t)===false){return false}return true}function ee(e){var t=e._reader;if(t===undefined){return false}if(ie(t)===false){return false}return true}var te=function(){function e(t){i(this,e);if(D(t)===false){throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance")}if(q(t)===true){throw new TypeError("This stream has already been locked for exclusive reading by another reader")}ae(this,t);this._readRequests=[]}n(e,[{key:"cancel",value:function e(t){if(ie(this)===false){return Promise.reject(Ye("cancel"))}if(this._ownerReadableStream===undefined){return Promise.reject(Xe("cancel"))}return se(this,t)}},{key:"read",value:function e(){if(ie(this)===false){return Promise.reject(Ye("read"))}if(this._ownerReadableStream===undefined){return Promise.reject(Xe("read from"))}return le(this)}},{key:"releaseLock",value:function e(){if(ie(this)===false){throw Ye("releaseLock")}if(this._ownerReadableStream===undefined){return}if(this._readRequests.length>0){throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled")}oe(this)}},{key:"closed",get:function e(){if(ie(this)===false){return Promise.reject(Ye("closed"))}return this._closedPromise}}]);return e}();var re=function(){function e(t){i(this,e);if(!D(t)){throw new TypeError("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a "+"byte source")}if(Ae(t._readableStreamController)===false){throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte "+"source")}if(q(t)){throw new TypeError("This stream has already been locked for exclusive reading by another reader")}ae(this,t);this._readIntoRequests=[]}n(e,[{key:"cancel",value:function e(t){if(!ne(this)){return Promise.reject(et("cancel"))}if(this._ownerReadableStream===undefined){return Promise.reject(Xe("cancel"))}return se(this,t)}},{key:"read",value:function e(t){if(!ne(this)){return Promise.reject(et("read"))}if(this._ownerReadableStream===undefined){return Promise.reject(Xe("read from"))}if(!ArrayBuffer.isView(t)){return Promise.reject(new TypeError("view must be an array buffer view"))}if(t.byteLength===0){return Promise.reject(new TypeError("view must have non-zero byteLength"))}return ue(this,t)}},{key:"releaseLock",value:function e(){if(!ne(this)){throw et("releaseLock")}if(this._ownerReadableStream===undefined){return}if(this._readIntoRequests.length>0){throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled")}oe(this)}},{key:"closed",get:function e(){if(!ne(this)){return Promise.reject(et("closed"))}return this._closedPromise}}]);return e}();function ne(e){if(!g(e)){return false}if(!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")){return false}return true}function ie(e){if(!g(e)){return false}if(!Object.prototype.hasOwnProperty.call(e,"_readRequests")){return false}return true}function ae(e,t){e._ownerReadableStream=t;t._reader=e;if(t._state==="readable"){Ve(e)}else if(t._state==="closed"){Ke(e)}else{b(t._state==="errored","state must be errored");Qe(e,t._storedError);e._closedPromise.catch(function(){})}}function se(e,t){var r=e._ownerReadableStream;b(r!==undefined);return X(r,t)}function oe(e){b(e._ownerReadableStream!==undefined);b(e._ownerReadableStream._reader===e);if(e._ownerReadableStream._state==="readable"){Je(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))}else{Ze(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))}e._closedPromise.catch(function(){});e._ownerReadableStream._reader=undefined;e._ownerReadableStream=undefined}function ue(e,t){var r=e._ownerReadableStream;b(r!==undefined);r._disturbed=true;if(r._state==="errored"){return Promise.reject(r._storedError)}return Ie(r._readableStreamController,t)}function le(e){var t=e._ownerReadableStream;b(t!==undefined);t._disturbed=true;if(t._state==="closed"){return Promise.resolve(o(undefined,true))}if(t._state==="errored"){return Promise.reject(t._storedError)}b(t._state==="readable");return t._readableStreamController.__pullSteps()}var ce=function(){function e(t,r,n,a){i(this,e);if(D(t)===false){throw new TypeError("ReadableStreamDefaultController can only be constructed with a ReadableStream instance")}if(t._readableStreamController!==undefined){throw new TypeError("ReadableStreamDefaultController instances can only be created by the ReadableStream constructor")}this._controlledReadableStream=t;this._underlyingSource=r;this._queue=undefined;this._queueTotalSize=undefined;k(this);this._started=false;this._closeRequested=false;this._pullAgain=false;this._pulling=false;var s=d(n,a);this._strategySize=s.size;this._strategyHWM=s.highWaterMark;var o=this;var u=l(r,"start",[this]);Promise.resolve(u).then(function(){o._started=true;b(o._pulling===false);b(o._pullAgain===false);de(o)},function(e){ge(o,e)}).catch(_)}n(e,[{key:"close",value:function e(){if(fe(this)===false){throw tt("close")}if(this._closeRequested===true){throw new TypeError("The stream has already been closed; do not close it again!")}var t=this._controlledReadableStream._state;if(t!=="readable"){throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be closed")}ve(this)}},{key:"enqueue",value:function e(t){if(fe(this)===false){throw tt("enqueue")}if(this._closeRequested===true){throw new TypeError("stream is closed or draining")}var r=this._controlledReadableStream._state;if(r!=="readable"){throw new TypeError("The stream (in "+r+" state) is not in the readable state and cannot be enqueued to")}return pe(this,t)}},{key:"error",value:function e(t){if(fe(this)===false){throw tt("error")}var r=this._controlledReadableStream;if(r._state!=="readable"){throw new TypeError("The stream is "+r._state+" and so cannot be errored")}me(this,t)}},{key:"__cancelSteps",value:function e(t){k(this);return c(this._underlyingSource,"cancel",[t])}},{key:"__pullSteps",value:function e(){var t=this._controlledReadableStream;if(this._queue.length>0){var r=S(this);if(this._closeRequested===true&&this._queue.length===0){Y(t)}else{de(this)}return Promise.resolve(o(r,false))}var n=H(t);de(this);return n}},{key:"desiredSize",get:function e(){if(fe(this)===false){throw tt("desiredSize")}return ye(this)}}]);return e}();function fe(e){if(!g(e)){return false}if(!Object.prototype.hasOwnProperty.call(e,"_underlyingSource")){return false}return true}function de(e){var t=he(e);if(t===false){return undefined}if(e._pulling===true){e._pullAgain=true;return undefined}b(e._pullAgain===false);e._pulling=true;var r=c(e._underlyingSource,"pull",[e]);r.then(function(){e._pulling=false;if(e._pullAgain===true){e._pullAgain=false;return de(e)}return undefined},function(t){ge(e,t)}).catch(_);return undefined}function he(e){var t=e._controlledReadableStream;if(t._state==="closed"||t._state==="errored"){return false}if(e._closeRequested===true){return false}if(e._started===false){return false}if(q(t)===true&&Z(t)>0){return true}var r=ye(e);if(r>0){return true}return false}function ve(e){var t=e._controlledReadableStream;b(e._closeRequested===false);b(t._state==="readable");e._closeRequested=true;if(e._queue.length===0){Y(t)}}function pe(e,t){var r=e._controlledReadableStream;b(e._closeRequested===false);b(r._state==="readable");if(q(r)===true&&Z(r)>0){K(r,t,false)}else{var n=1;if(e._strategySize!==undefined){var i=e._strategySize;try{n=i(t)}catch(t){ge(e,t);throw t}}try{w(e,t,n)}catch(t){ge(e,t);throw t}}de(e);return undefined}function me(e,t){var r=e._controlledReadableStream;b(r._state==="readable");k(e);V(r,t)}function ge(e,t){if(e._controlledReadableStream._state==="readable"){me(e,t)}}function ye(e){var t=e._controlledReadableStream;var r=t._state;if(r==="errored"){return null}if(r==="closed"){return 0}return e._strategyHWM-e._queueTotalSize}var be=function(){function e(t,r){i(this,e);this._associatedReadableByteStreamController=t;this._view=r}n(e,[{key:"respond",value:function e(t){if(Se(this)===false){throw rt("respond")}if(this._associatedReadableByteStreamController===undefined){throw new TypeError("This BYOB request has been invalidated")}ze(this._associatedReadableByteStreamController,t)}},{key:"respondWithNewView",value:function e(t){if(Se(this)===false){throw rt("respond")}if(this._associatedReadableByteStreamController===undefined){throw new TypeError("This BYOB request has been invalidated")}if(!ArrayBuffer.isView(t)){throw new TypeError("You can only respond with array buffer views")}Ge(this._associatedReadableByteStreamController,t)}},{key:"view",get:function e(){return this._view}}]);return e}();var _e=function(){function e(t,r,n){i(this,e);if(D(t)===false){throw new TypeError("ReadableByteStreamController can only be constructed with a ReadableStream instance given "+"a byte source")}if(t._readableStreamController!==undefined){throw new TypeError("ReadableByteStreamController instances can only be created by the ReadableStream constructor given a byte "+"source")}this._controlledReadableStream=t;this._underlyingByteSource=r;this._pullAgain=false;this._pulling=false;ke(this);this._queue=this._queueTotalSize=undefined;k(this);this._closeRequested=false;this._started=false;this._strategyHWM=h(n);var a=r.autoAllocateChunkSize;if(a!==undefined){if(Number.isInteger(a)===false||a<=0){throw new RangeError("autoAllocateChunkSize must be a positive integer")}}this._autoAllocateChunkSize=a;this._pendingPullIntos=[];var s=this;var o=l(r,"start",[this]);Promise.resolve(o).then(function(){s._started=true;b(s._pulling===false);b(s._pullAgain===false);we(s)},function(e){if(t._state==="readable"){Ue(s,e)}}).catch(_)}n(e,[{key:"close",value:function e(){if(Ae(this)===false){throw nt("close")}if(this._closeRequested===true){throw new TypeError("The stream has already been closed; do not close it again!")}var t=this._controlledReadableStream._state;if(t!=="readable"){throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be closed")}qe(this)}},{key:"enqueue",value:function e(t){if(Ae(this)===false){throw nt("enqueue")}if(this._closeRequested===true){throw new TypeError("stream is closed or draining")}var r=this._controlledReadableStream._state;if(r!=="readable"){throw new TypeError("The stream (in "+r+" state) is not in the readable state and cannot be enqueued to")}if(!ArrayBuffer.isView(t)){throw new TypeError("You can only enqueue array buffer views when using a ReadableByteStreamController")}We(this,t)}},{key:"error",value:function e(t){if(Ae(this)===false){throw nt("error")}var r=this._controlledReadableStream;if(r._state!=="readable"){throw new TypeError("The stream is "+r._state+" and so cannot be errored")}Ue(this,t)}},{key:"__cancelSteps",value:function e(t){if(this._pendingPullIntos.length>0){var r=this._pendingPullIntos[0];r.bytesFilled=0}k(this);return c(this._underlyingByteSource,"cancel",[t])}},{key:"__pullSteps",value:function e(){var t=this._controlledReadableStream;b(ee(t)===true);if(this._queueTotalSize>0){b(Z(t)===0);var r=this._queue.shift();this._queueTotalSize-=r.byteLength;Te(this);var n=void 0;try{n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}catch(e){return Promise.reject(e)}return Promise.resolve(o(n,false))}var i=this._autoAllocateChunkSize;if(i!==undefined){var a=void 0;try{a=new ArrayBuffer(i)}catch(e){return Promise.reject(e)}var s={buffer:a,byteOffset:0,byteLength:i,bytesFilled:0,elementSize:1,ctor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(s)}var u=H(t);we(this);return u}},{key:"byobRequest",get:function e(){if(Ae(this)===false){throw nt("byobRequest")}if(this._byobRequest===undefined&&this._pendingPullIntos.length>0){var t=this._pendingPullIntos[0];var r=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled);this._byobRequest=new be(this,r)}return this._byobRequest}},{key:"desiredSize",get:function e(){if(Ae(this)===false){throw nt("desiredSize")}return Be(this)}}]);return e}();function Ae(e){if(!g(e)){return false}if(!Object.prototype.hasOwnProperty.call(e,"_underlyingByteSource")){return false}return true}function Se(e){if(!g(e)){return false}if(!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")){return false}return true}function we(e){var t=Ne(e);if(t===false){return undefined}if(e._pulling===true){e._pullAgain=true;return undefined}b(e._pullAgain===false);e._pulling=true;var r=c(e._underlyingByteSource,"pull",[e]);r.then(function(){e._pulling=false;if(e._pullAgain===true){e._pullAgain=false;we(e)}},function(t){if(e._controlledReadableStream._state==="readable"){Ue(e,t)}}).catch(_);return undefined}function ke(e){Oe(e);e._pendingPullIntos=[]}function Pe(e,t){b(e._state!=="errored","state must not be errored");var r=false;if(e._state==="closed"){b(t.bytesFilled===0);r=true}var n=Ce(t);if(t.readerType==="default"){K(e,n,r)}else{b(t.readerType==="byob");Q(e,n,r)}}function Ce(e){var t=e.bytesFilled;var r=e.elementSize;b(t<=e.byteLength);b(t%r===0);return new e.ctor(e.buffer,e.byteOffset,t/r)}function xe(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n});e._queueTotalSize+=n}function Re(e,t){var r=t.elementSize;var n=t.bytesFilled-t.bytesFilled%r;var i=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled);var a=t.bytesFilled+i;var o=a-a%r;var u=i;var l=false;if(o>n){u=o-t.bytesFilled;l=true}var c=e._queue;while(u>0){var f=c[0];var d=Math.min(u,f.byteLength);var h=t.byteOffset+t.bytesFilled;s(t.buffer,h,f.buffer,f.byteOffset,d);if(f.byteLength===d){c.shift()}else{f.byteOffset+=d;f.byteLength-=d}e._queueTotalSize-=d;Ee(e,d,t);u-=d}if(l===false){b(e._queueTotalSize===0,"queue must be empty");b(t.bytesFilled>0);b(t.bytesFilled0){if(e._queueTotalSize===0){return}var t=e._pendingPullIntos[0];if(Re(e,t)===true){De(e);Pe(e._controlledReadableStream,t)}}}function Ie(e,t){var r=e._controlledReadableStream;var n=1;if(t.constructor!==DataView){n=t.constructor.BYTES_PER_ELEMENT}var i=t.constructor;var a={buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:n,ctor:i,readerType:"byob"};if(e._pendingPullIntos.length>0){a.buffer=f(a.buffer);e._pendingPullIntos.push(a);return G(r)}if(r._state==="closed"){var s=new t.constructor(a.buffer,a.byteOffset,0);return Promise.resolve(o(s,true))}if(e._queueTotalSize>0){if(Re(e,a)===true){var u=Ce(a);Te(e);return Promise.resolve(o(u,false))}if(e._closeRequested===true){var l=new TypeError("Insufficient bytes to fill elements in the given buffer");Ue(e,l);return Promise.reject(l)}}a.buffer=f(a.buffer);e._pendingPullIntos.push(a);var c=G(r);we(e);return c}function Fe(e,t){t.buffer=f(t.buffer);b(t.bytesFilled===0,"bytesFilled must be 0");var r=e._controlledReadableStream;if($(r)===true){while(J(r)>0){var n=De(e);Pe(r,n)}}}function Me(e,t,r){if(r.bytesFilled+t>r.byteLength){throw new RangeError("bytesWritten out of range")}Ee(e,t,r);if(r.bytesFilled0){var i=r.byteOffset+r.bytesFilled;var a=r.buffer.slice(i-n,i);xe(e,a,0,a.byteLength)}r.buffer=f(r.buffer);r.bytesFilled-=n;Pe(e._controlledReadableStream,r);Le(e)}function je(e,t){var r=e._pendingPullIntos[0];var n=e._controlledReadableStream;if(n._state==="closed"){if(t!==0){throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}Fe(e,r)}else{b(n._state==="readable");Me(e,t,r)}}function De(e){var t=e._pendingPullIntos.shift();Oe(e);return t}function Ne(e){var t=e._controlledReadableStream;if(t._state!=="readable"){return false}if(e._closeRequested===true){return false}if(e._started===false){return false}if(ee(t)===true&&Z(t)>0){return true}if($(t)===true&&J(t)>0){return true}if(Be(e)>0){return true}return false}function qe(e){var t=e._controlledReadableStream;b(e._closeRequested===false);b(t._state==="readable");if(e._queueTotalSize>0){e._closeRequested=true;return}if(e._pendingPullIntos.length>0){var r=e._pendingPullIntos[0];if(r.bytesFilled>0){var n=new TypeError("Insufficient bytes to fill elements in the given buffer");Ue(e,n);throw n}}Y(t)}function We(e,t){var r=e._controlledReadableStream;b(e._closeRequested===false);b(r._state==="readable");var n=t.buffer;var i=t.byteOffset;var a=t.byteLength;var s=f(n);if(ee(r)===true){if(Z(r)===0){xe(e,s,i,a)}else{b(e._queue.length===0);var o=new Uint8Array(s,i,a);K(r,o,false)}}else if($(r)===true){xe(e,s,i,a);Le(e)}else{b(q(r)===false,"stream must not be locked");xe(e,s,i,a)}}function Ue(e,t){var r=e._controlledReadableStream;b(r._state==="readable");ke(e);k(e);V(r,t)}function Be(e){var t=e._controlledReadableStream;var r=t._state;if(r==="errored"){return null}if(r==="closed"){return 0}return e._strategyHWM-e._queueTotalSize}function ze(e,t){t=Number(t);if(u(t)===false){throw new RangeError("bytesWritten must be a finite")}b(e._pendingPullIntos.length>0);je(e,t)}function Ge(e,t){b(e._pendingPullIntos.length>0);var r=e._pendingPullIntos[0];if(r.byteOffset+r.bytesFilled!==t.byteOffset){throw new RangeError("The region specified by view does not match byobRequest")}if(r.byteLength!==t.byteLength){throw new RangeError("The buffer of view has different capacity than byobRequest")}r.buffer=t.buffer;je(e,t.byteLength)}function He(e){return new TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}function Xe(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function Ye(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}function Ve(e){e._closedPromise=new Promise(function(t,r){e._closedPromise_resolve=t;e._closedPromise_reject=r})}function Qe(e,t){e._closedPromise=Promise.reject(t);e._closedPromise_resolve=undefined;e._closedPromise_reject=undefined}function Ke(e){e._closedPromise=Promise.resolve(undefined);e._closedPromise_resolve=undefined;e._closedPromise_reject=undefined}function Je(e,t){b(e._closedPromise_resolve!==undefined);b(e._closedPromise_reject!==undefined);e._closedPromise_reject(t);e._closedPromise_resolve=undefined;e._closedPromise_reject=undefined}function Ze(e,t){b(e._closedPromise_resolve===undefined);b(e._closedPromise_reject===undefined);e._closedPromise=Promise.reject(t)}function $e(e){b(e._closedPromise_resolve!==undefined);b(e._closedPromise_reject!==undefined);e._closedPromise_resolve(undefined);e._closedPromise_resolve=undefined;e._closedPromise_reject=undefined}function et(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}function tt(e){return new TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function rt(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function nt(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}function it(e){try{Promise.prototype.then.call(e,undefined,function(){})}catch(e){}}},function(e,t,r){"use strict";var n=r(6);var i=r(4);var a=r(2);t.TransformStream=n.TransformStream;t.ReadableStream=i.ReadableStream;t.IsReadableStreamDisturbed=i.IsReadableStreamDisturbed;t.ReadableStreamDefaultControllerClose=i.ReadableStreamDefaultControllerClose;t.ReadableStreamDefaultControllerEnqueue=i.ReadableStreamDefaultControllerEnqueue;t.ReadableStreamDefaultControllerError=i.ReadableStreamDefaultControllerError;t.ReadableStreamDefaultControllerGetDesiredSize=i.ReadableStreamDefaultControllerGetDesiredSize;t.AcquireWritableStreamDefaultWriter=a.AcquireWritableStreamDefaultWriter;t.IsWritableStream=a.IsWritableStream;t.IsWritableStreamLocked=a.IsWritableStreamLocked;t.WritableStream=a.WritableStream;t.WritableStreamAbort=a.WritableStreamAbort;t.WritableStreamDefaultControllerError=a.WritableStreamDefaultControllerError;t.WritableStreamDefaultWriterCloseWithErrorPropagation=a.WritableStreamDefaultWriterCloseWithErrorPropagation;t.WritableStreamDefaultWriterRelease=a.WritableStreamDefaultWriterRelease;t.WritableStreamDefaultWriterWrite=a.WritableStreamDefaultWriterWrite},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r0&&arguments[0]!==undefined?arguments[0]:{};i(this,e);this._transformer=t;var r=t.readableStrategy,n=t.writableStrategy;this._transforming=false;this._errored=false;this._storedError=undefined;this._writableController=undefined;this._readableController=undefined;this._transformStreamController=undefined;this._writableDone=false;this._readableClosed=false;this._backpressure=undefined;this._backpressureChangePromise=undefined;this._backpressureChangePromise_resolve=undefined;this._transformStreamController=new M(this);var a=void 0;var o=new Promise(function(e){a=e});var l=new F(this,o);this._readable=new h(l,r);var c=new I(this,o);this._writable=new b(c,n);s(this._writableController!==undefined);s(this._readableController!==undefined);var f=g(this._readableController);R(this,f<=0);var d=this;var v=u(t,"start",[d._transformStreamController]);a(v);o.catch(function(e){if(d._errored===false){d._errored=true;d._storedError=e}})}n(e,[{key:"readable",get:function e(){if(L(this)===false){throw N("readable")}return this._readable}},{key:"writable",get:function e(){if(L(this)===false){throw N("writable")}return this._writable}}]);return e}();e.exports={TransformStream:j};function D(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function N(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}},function(e,t,r){e.exports=r(5)}]))},function(e,t,r){"use strict";var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};{var i=false;try{if(typeof URL==="function"&&n(URL.prototype)==="object"&&"origin"in URL.prototype){var a=new URL("b","http://a");a.pathname="c%20d";i=a.href==="http://a/c%20d"}}catch(e){}if(i){t.URL=URL}else{var s=r(128).URL;var o=r(3).URL;if(o){s.createObjectURL=function(e){return o.createObjectURL.apply(o,arguments)};s.revokeObjectURL=function(e){o.revokeObjectURL(e)}}t.URL=s}}},function(e,t,r){"use strict";(function e(){"use strict";var r=Object.create(null);r["ftp"]=21;r["file"]=0;r["gopher"]=70;r["http"]=80;r["https"]=443;r["ws"]=80;r["wss"]=443;var n=Object.create(null);n["%2e"]=".";n[".%2e"]="..";n["%2e."]="..";n["%2e%2e"]="..";function i(e){return r[e]!==undefined}function a(){h.call(this);this._isInvalid=true}function s(e){if(e===""){a.call(this)}return e.toLowerCase()}function o(e){var t=e.charCodeAt(0);if(t>32&&t<127&&[34,35,60,62,63,96].indexOf(t)===-1){return e}return encodeURIComponent(e)}function u(e){var t=e.charCodeAt(0);if(t>32&&t<127&&[34,35,60,62,96].indexOf(t)===-1){return e}return encodeURIComponent(e)}var l,c=/[a-zA-Z]/,f=/[a-zA-Z0-9\+\-\.]/;function d(e,t,d){function h(e){b.push(e)}var v=t||"scheme start",p=0,m="",g=false,y=false,b=[];e:while((e[p-1]!==l||p===0)&&!this._isInvalid){var _=e[p];switch(v){case"scheme start":if(_&&c.test(_)){m+=_.toLowerCase();v="scheme"}else if(!t){m="";v="no scheme";continue}else{h("Invalid scheme.");break e}break;case"scheme":if(_&&f.test(_)){m+=_.toLowerCase()}else if(_===":"){this._scheme=m;m="";if(t){break e}if(i(this._scheme)){this._isRelative=true}if(this._scheme==="file"){v="relative"}else if(this._isRelative&&d&&d._scheme===this._scheme){v="relative or authority"}else if(this._isRelative){v="authority first slash"}else{v="scheme data"}}else if(!t){m="";p=0;v="no scheme";continue}else if(_===l){break e}else{h("Code point not allowed in scheme: "+_);break e}break;case"scheme data":if(_==="?"){this._query="?";v="query"}else if(_==="#"){this._fragment="#";v="fragment"}else{if(_!==l&&_!=="\t"&&_!=="\n"&&_!=="\r"){this._schemeData+=o(_)}}break;case"no scheme":if(!d||!i(d._scheme)){h("Missing scheme.");a.call(this)}else{v="relative";continue}break;case"relative or authority":if(_==="/"&&e[p+1]==="/"){v="authority ignore slashes"}else{h("Expected /, got: "+_);v="relative";continue}break;case"relative":this._isRelative=true;if(this._scheme!=="file"){this._scheme=d._scheme}if(_===l){this._host=d._host;this._port=d._port;this._path=d._path.slice();this._query=d._query;this._username=d._username;this._password=d._password;break e}else if(_==="/"||_==="\\"){if(_==="\\"){h("\\ is an invalid code point.")}v="relative slash"}else if(_==="?"){this._host=d._host;this._port=d._port;this._path=d._path.slice();this._query="?";this._username=d._username;this._password=d._password;v="query"}else if(_==="#"){this._host=d._host;this._port=d._port;this._path=d._path.slice();this._query=d._query;this._fragment="#";this._username=d._username;this._password=d._password;v="fragment"}else{var A=e[p+1];var S=e[p+2];if(this._scheme!=="file"||!c.test(_)||A!==":"&&A!=="|"||S!==l&&S!=="/"&&S!=="\\"&&S!=="?"&&S!=="#"){this._host=d._host;this._port=d._port;this._username=d._username;this._password=d._password;this._path=d._path.slice();this._path.pop()}v="relative path";continue}break;case"relative slash":if(_==="/"||_==="\\"){if(_==="\\"){h("\\ is an invalid code point.")}if(this._scheme==="file"){v="file host"}else{v="authority ignore slashes"}}else{if(this._scheme!=="file"){this._host=d._host;this._port=d._port;this._username=d._username;this._password=d._password}v="relative path";continue}break;case"authority first slash":if(_==="/"){v="authority second slash"}else{h("Expected '/', got: "+_);v="authority ignore slashes";continue}break;case"authority second slash":v="authority ignore slashes";if(_!=="/"){h("Expected '/', got: "+_);continue}break;case"authority ignore slashes":if(_!=="/"&&_!=="\\"){v="authority";continue}else{h("Expected authority, got: "+_)}break;case"authority":if(_==="@"){if(g){h("@ already seen.");m+="%40"}g=true;for(var w=0;w3&&arguments[3]!==undefined?arguments[3]:false;this.pageIndex=e;this._pageInfo=t;this.transport=r;this._stats=n?new o.StatTimer:o.DummyStatTimer;this._pdfBug=n;this.commonObjs=r.commonObjs;this.objs=new q;this.cleanupAfterRender=false;this.pendingCleanup=false;this.intentStates=Object.create(null);this.destroyed=false}t.prototype={get pageNumber(){return this.pageIndex+1},get rotate(){return this._pageInfo.rotate},get ref(){return this._pageInfo.ref},get userUnit(){return this._pageInfo.userUnit},get view(){return this._pageInfo.view},getViewport:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.rotate;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;return new o.PageViewport({viewBox:this.view,scale:t,rotation:r,dontFlip:n})},getAnnotations:function e(t){var r=t&&t.intent||null;if(!this.annotationsPromise||this.annotationsIntent!==r){this.annotationsPromise=this.transport.getAnnotations(this.pageIndex,r);this.annotationsIntent=r}return this.annotationsPromise},render:function e(t){var r=this;var n=this._stats;n.time("Overall");this.pendingCleanup=false;var i=t.intent==="print"?"print":"display";var a=t.canvasFactory||new o.DOMCanvasFactory;var u=new g.WebGLContext({enable:t.enableWebGL});if(!this.intentStates[i]){this.intentStates[i]=Object.create(null)}var l=this.intentStates[i];if(!l.displayReadyCapability){l.receivingOperatorList=true;l.displayReadyCapability=(0,s.createPromiseCapability)();l.operatorList={fnArray:[],argsArray:[],lastChunk:false};n.time("Page Request");this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageNumber-1,intent:i,renderInteractiveForms:t.renderInteractiveForms===true})}var c=function e(t){var i=l.renderTasks.indexOf(f);if(i>=0){l.renderTasks.splice(i,1)}if(r.cleanupAfterRender){r.pendingCleanup=true}r._tryCleanup();if(t){f.capability.reject(t)}else{f.capability.resolve()}n.timeEnd("Rendering");n.timeEnd("Overall")};var f=new U(c,t,this.objs,this.commonObjs,l.operatorList,this.pageNumber,a,u,this._pdfBug);f.useRequestAnimationFrame=i!=="print";if(!l.renderTasks){l.renderTasks=[]}l.renderTasks.push(f);var d=f.task;l.displayReadyCapability.promise.then(function(e){if(r.pendingCleanup){c();return}n.time("Rendering");f.initializeGraphics(e);f.operatorListChanged()}).catch(c);return d},getOperatorList:function e(){function t(){if(n.operatorList.lastChunk){n.opListReadCapability.resolve(n.operatorList);var e=n.renderTasks.indexOf(i);if(e>=0){n.renderTasks.splice(e,1)}}}var r="oplist";if(!this.intentStates[r]){this.intentStates[r]=Object.create(null)}var n=this.intentStates[r];var i;if(!n.opListReadCapability){i={};i.operatorListChanged=t;n.receivingOperatorList=true;n.opListReadCapability=(0,s.createPromiseCapability)();n.renderTasks=[];n.renderTasks.push(i);n.operatorList={fnArray:[],argsArray:[],lastChunk:false};this._stats.time("Page Request");this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageIndex,intent:r})}return n.opListReadCapability.promise},streamTextContent:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=100;return this.transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this.pageNumber-1,normalizeWhitespace:t.normalizeWhitespace===true,combineTextItems:t.disableCombineTextItems!==true},{highWaterMark:r,size:function e(t){return t.items.length}})},getTextContent:function e(t){t=t||{};var r=this.streamTextContent(t);return new Promise(function(e,t){function n(){i.read().then(function(t){var r;var i=t.value,s=t.done;if(s){e(a);return}Object.assign(a.styles,i.styles);(r=a.items).push.apply(r,b(i.items));n()},t)}var i=r.getReader();var a={items:[],styles:Object.create(null)};n()})},_destroy:function e(){this.destroyed=true;this.transport.pageCache[this.pageIndex]=null;var t=[];Object.keys(this.intentStates).forEach(function(e){if(e==="oplist"){return}var r=this.intentStates[e];r.renderTasks.forEach(function(e){var r=e.capability.promise.catch(function(){});t.push(r);e.cancel()})},this);this.objs.clear();this.annotationsPromise=null;this.pendingCleanup=false;return Promise.all(t)},cleanup:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;this.pendingCleanup=true;this._tryCleanup(t)},_tryCleanup:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(!this.pendingCleanup||Object.keys(this.intentStates).some(function(e){var t=this.intentStates[e];return t.renderTasks.length!==0||t.receivingOperatorList},this)){return}Object.keys(this.intentStates).forEach(function(e){delete this.intentStates[e]},this);this.objs.clear();this.annotationsPromise=null;if(t&&this._stats instanceof o.StatTimer){this._stats=new o.StatTimer}this.pendingCleanup=false},_startRenderPage:function e(t,r){var n=this.intentStates[r];if(n.displayReadyCapability){n.displayReadyCapability.resolve(t)}},_renderPageChunk:function e(t,r){var n=this.intentStates[r];var i,a;for(i=0,a=t.length;i0&&arguments[0]!==undefined?arguments[0]:true;_(this,e);this._listeners=[];this._defer=t;this._deferred=Promise.resolve(undefined)}i(e,[{key:"postMessage",value:function e(t,r){var n=this;function i(e){if((typeof e==="undefined"?"undefined":a(e))!=="object"||e===null){return e}if(o.has(e)){return o.get(e)}var t;var n;if((n=e.buffer)&&(0,s.isArrayBuffer)(n)){var u=r&&r.includes(n);if(e===n){t=e}else if(u){t=new e.constructor(n,e.byteOffset,e.byteLength)}else{t=new e.constructor(e)}o.set(e,t);return t}t=Array.isArray(e)?[]:{};o.set(e,t);for(var l in e){var c,f=e;while(!(c=Object.getOwnPropertyDescriptor(f,l))){f=Object.getPrototypeOf(f)}if(typeof c.value==="undefined"||typeof c.value==="function"){continue}t[l]=i(c.value)}return t}if(!this._defer){this._listeners.forEach(function(e){e.call(this,{data:t})},this);return}var o=new WeakMap;var u={data:i(t)};this._deferred.then(function(){n._listeners.forEach(function(e){e.call(this,u)},n)})}},{key:"addEventListener",value:function e(t,r){this._listeners.push(r)}},{key:"removeEventListener",value:function e(t,r){var n=this._listeners.indexOf(r);this._listeners.splice(n,1)}},{key:"terminate",value:function e(){this._listeners=[]}}]);return e}();var D=function e(){var t=0;function r(){if(h.GlobalWorkerOptions.workerSrc){return h.GlobalWorkerOptions.workerSrc}if(typeof w!=="undefined"){return w}throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function n(){try{if(typeof window!=="undefined"){return window.pdfjsWorker&&window.pdfjsWorker.WorkerMessageHandler}}catch(e){}return null}var i=void 0;function a(){if(i){return i.promise}i=(0,s.createPromiseCapability)();var e=n();if(e){i.resolve(e);return i.promise}var t=k||function(){return(0,o.loadScript)(r()).then(function(){return window.pdfjsWorker.WorkerMessageHandler})};t().then(i.resolve,i.reject);return i.promise}function u(e){var t="importScripts('"+e+"');";return s.URL.createObjectURL(new Blob([t]))}var l=new WeakMap;function c(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},t=e.name,r=t===undefined?null:t,n=e.port,i=n===undefined?null:n,a=e.postMessageTransfers,o=a===undefined?true:a,u=e.verbosity,c=u===undefined?(0,s.getVerbosityLevel)():u;if(i&&l.has(i)){throw new Error("Cannot use more than one PDFWorker per port")}this.name=r;this.destroyed=false;this.postMessageTransfers=o!==false;this.verbosity=c;this._readyCapability=(0,s.createPromiseCapability)();this._port=null;this._webWorker=null;this._messageHandler=null;if(i){l.set(i,this);this._initializeFromPort(i);return}this._initialize()}c.prototype={get promise(){return this._readyCapability.promise},get port(){return this._port},get messageHandler(){return this._messageHandler},_initializeFromPort:function e(t){this._port=t;this._messageHandler=new v.MessageHandler("main","worker",t);this._messageHandler.on("ready",function(){});this._readyCapability.resolve()},_initialize:function e(){var t=this;if(typeof Worker!=="undefined"&&!S&&!n()){var i=r();try{if(!(0,s.isSameOrigin)(window.location.href,i)){i=u(new s.URL(i,window.location).href)}var a=new Worker(i);var o=new v.MessageHandler("main","worker",a);var l=function e(){a.removeEventListener("error",c);o.destroy();a.terminate();if(t.destroyed){t._readyCapability.reject(new Error("Worker was destroyed"))}else{t._setupFakeWorker()}};var c=function e(){if(!t._webWorker){l()}};a.addEventListener("error",c);o.on("test",function(e){a.removeEventListener("error",c);if(t.destroyed){l();return}if(e&&e.supportTypedArray){t._messageHandler=o;t._port=a;t._webWorker=a;if(!e.supportTransfers){t.postMessageTransfers=false}t._readyCapability.resolve();o.send("configure",{verbosity:t.verbosity})}else{t._setupFakeWorker();o.destroy();a.terminate()}});o.on("ready",function(e){a.removeEventListener("error",c);if(t.destroyed){l();return}try{f()}catch(e){t._setupFakeWorker()}});var f=function e(){var r=new Uint8Array([t.postMessageTransfers?255:0]);try{o.send("test",r,[r.buffer])}catch(e){(0,s.info)("Cannot use postMessage transfers");r[0]=0;o.send("test",r)}};f();return}catch(e){(0,s.info)("The worker has been disabled.")}}this._setupFakeWorker()},_setupFakeWorker:function e(){var r=this;if(!S){(0,s.warn)("Setting up fake worker.");S=true}a().then(function(e){if(r.destroyed){r._readyCapability.reject(new Error("Worker was destroyed"));return}var n=new j;r._port=n;var i="fake"+t++;var a=new v.MessageHandler(i+"_worker",i,n);e.setup(a,n);var s=new v.MessageHandler(i,i+"_worker",n);r._messageHandler=s;r._readyCapability.resolve()}).catch(function(e){r._readyCapability.reject(new Error('Setting up fake worker failed: "'+e.message+'".'))})},destroy:function e(){this.destroyed=true;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}l.delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}};c.fromPort=function(e){if(!e||!e.port){throw new Error("PDFWorker.fromPort - invalid method signature.")}if(l.has(e.port)){return l.get(e.port)}return new c(e)};c.getWorkerSrc=function(){return r()};return c}();var N=function(){function e(t,r,n,i){_(this,e);this.messageHandler=t;this.loadingTask=r;this.commonObjs=new q;this.fontLoader=new u.FontLoader(r.docId);this._params=i;this.CMapReaderFactory=new i.CMapReaderFactory({baseUrl:i.cMapUrl,isCompressed:i.cMapPacked});this.destroyed=false;this.destroyCapability=null;this._passwordCapability=null;this._networkStream=n;this._fullReader=null;this._lastProgress=null;this.pageCache=[];this.pagePromises=[];this.downloadInfoCapability=(0,s.createPromiseCapability)();this.setupMessageHandler()}i(e,[{key:"destroy",value:function e(){var t=this;if(this.destroyCapability){return this.destroyCapability.promise}this.destroyed=true;this.destroyCapability=(0,s.createPromiseCapability)();if(this._passwordCapability){this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"))}var r=[];this.pageCache.forEach(function(e){if(e){r.push(e._destroy())}});this.pageCache=[];this.pagePromises=[];var n=this.messageHandler.sendWithPromise("Terminate",null);r.push(n);Promise.all(r).then(function(){t.fontLoader.clear();if(t._networkStream){t._networkStream.cancelAllRequests()}if(t.messageHandler){t.messageHandler.destroy();t.messageHandler=null}t.destroyCapability.resolve()},this.destroyCapability.reject);return this.destroyCapability.promise}},{key:"setupMessageHandler",value:function e(){var t=this.messageHandler,r=this.loadingTask;t.on("GetReader",function(e,t){var r=this;(0,s.assert)(this._networkStream);this._fullReader=this._networkStream.getFullReader();this._fullReader.onProgress=function(e){r._lastProgress={loaded:e.loaded,total:e.total}};t.onPull=function(){r._fullReader.read().then(function(e){var r=e.value,n=e.done;if(n){t.close();return}(0,s.assert)((0,s.isArrayBuffer)(r));t.enqueue(new Uint8Array(r),1,[r])}).catch(function(e){t.error(e)})};t.onCancel=function(e){r._fullReader.cancel(e)}},this);t.on("ReaderHeadersReady",function(e){var t=this;var n=(0,s.createPromiseCapability)();var i=this._fullReader;i.headersReady.then(function(){if(!i.isStreamingSupported||!i.isRangeSupported){if(t._lastProgress&&r.onProgress){r.onProgress(t._lastProgress)}i.onProgress=function(e){if(r.onProgress){r.onProgress({loaded:e.loaded,total:e.total})}}}n.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})},n.reject);return n.promise},this);t.on("GetRangeReader",function(e,t){(0,s.assert)(this._networkStream);var r=this._networkStream.getRangeReader(e.begin,e.end);t.onPull=function(){r.read().then(function(e){var r=e.value,n=e.done;if(n){t.close();return}(0,s.assert)((0,s.isArrayBuffer)(r));t.enqueue(new Uint8Array(r),1,[r])}).catch(function(e){t.error(e)})};t.onCancel=function(e){r.cancel(e)}},this);t.on("GetDoc",function(e){var t=e.pdfInfo;this.numPages=t.numPages;this.pdfDocument=new F(t,this,r);r._capability.resolve(this.pdfDocument)},this);t.on("PasswordRequest",function(e){var t=this;this._passwordCapability=(0,s.createPromiseCapability)();if(r.onPassword){var n=function e(r){t._passwordCapability.resolve({password:r})};try{r.onPassword(n,e.code)}catch(e){this._passwordCapability.reject(e)}}else{this._passwordCapability.reject(new s.PasswordException(e.message,e.code))}return this._passwordCapability.promise},this);t.on("PasswordException",function(e){r._capability.reject(new s.PasswordException(e.message,e.code))},this);t.on("InvalidPDF",function(e){r._capability.reject(new s.InvalidPDFException(e.message))},this);t.on("MissingPDF",function(e){r._capability.reject(new s.MissingPDFException(e.message))},this);t.on("UnexpectedResponse",function(e){r._capability.reject(new s.UnexpectedResponseException(e.message,e.status))},this);t.on("UnknownError",function(e){r._capability.reject(new s.UnknownErrorException(e.message,e.details))},this);t.on("DataLoaded",function(e){if(r.onProgress){r.onProgress({loaded:e.length,total:e.length})}this.downloadInfoCapability.resolve(e)},this);t.on("StartRenderPage",function(e){if(this.destroyed){return}var t=this.pageCache[e.pageIndex];t._stats.timeEnd("Page Request");t._startRenderPage(e.transparency,e.intent)},this);t.on("RenderPageChunk",function(e){if(this.destroyed){return}var t=this.pageCache[e.pageIndex];t._renderPageChunk(e.operatorList,e.intent)},this);t.on("commonobj",function(e){var t=this;if(this.destroyed){return}var r=n(e,3),i=r[0],a=r[1],o=r[2];if(this.commonObjs.hasData(i)){return}switch(a){case"Font":var l=this._params;if("error"in o){var c=o.error;(0,s.warn)("Error during font loading: "+c);this.commonObjs.resolve(i,c);break}var f=null;if(l.pdfBug&&d.default.FontInspector&&d.default.FontInspector.enabled){f={registerFont:function e(t,r){d.default["FontInspector"].fontAdded(t,r)}}}var h=new u.FontFaceObject(o,{isEvalSupported:l.isEvalSupported,disableFontFace:l.disableFontFace,ignoreErrors:l.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:f});var v=function e(r){t.commonObjs.resolve(i,h)};this.fontLoader.bind([h],v);break;case"FontPath":this.commonObjs.resolve(i,o);break;default:throw new Error("Got unknown common object type "+a)}},this);t.on("obj",function(e){if(this.destroyed){return}var t=n(e,4),r=t[0],i=t[1],a=t[2],s=t[3];var o=this.pageCache[i];if(o.objs.hasData(r)){return}switch(a){case"JpegStream":return new Promise(function(e,t){var r=new Image;r.onload=function(){e(r)};r.onerror=function(){t(new Error("Error during JPEG image loading"))};r.src=s}).then(function(e){o.objs.resolve(r,e)});case"Image":o.objs.resolve(r,s);var u=8e6;if(s&&"data"in s&&s.data.length>u){o.cleanupAfterRender=true}break;default:throw new Error("Got unknown object type "+a)}},this);t.on("DocProgress",function(e){if(this.destroyed){return}if(r.onProgress){r.onProgress({loaded:e.loaded,total:e.total})}},this);t.on("PageError",function(e){if(this.destroyed){return}var t=this.pageCache[e.pageNum-1];var r=t.intentStates[e.intent];if(r.displayReadyCapability){r.displayReadyCapability.reject(e.error)}else{throw new Error(e.error)}if(r.operatorList){r.operatorList.lastChunk=true;for(var n=0;nthis.numPages){return Promise.reject(new Error("Invalid page request"))}var n=t-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 M(n,e,r,r._params.pdfBug);r.pageCache[n]=t;return t});this.pagePromises[n]=i;return i}},{key:"getPageIndex",value:function e(t){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:t}).catch(function(e){return Promise.reject(new Error(e))})}},{key:"getAnnotations",value:function e(t,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:r})}},{key:"getDestinations",value:function e(){return this.messageHandler.sendWithPromise("GetDestinations",null)}},{key:"getDestination",value:function e(t){if(typeof t!=="string"){return Promise.reject(new Error("Invalid destination request."))}return this.messageHandler.sendWithPromise("GetDestination",{id:t})}},{key:"getPageLabels",value:function e(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}},{key:"getPageMode",value:function e(){return this.messageHandler.sendWithPromise("GetPageMode",null)}},{key:"getAttachments",value:function e(){return this.messageHandler.sendWithPromise("GetAttachments",null)}},{key:"getJavaScript",value:function e(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}},{key:"getOutline",value:function e(){return this.messageHandler.sendWithPromise("GetOutline",null)}},{key:"getPermissions",value:function e(){return this.messageHandler.sendWithPromise("GetPermissions",null)}},{key:"getMetadata",value:function e(){var t=this;return this.messageHandler.sendWithPromise("GetMetadata",null).then(function(e){return{info:e[0],metadata:e[1]?new p.Metadata(e[1]):null,contentDispositionFilename:t._fullReader?t._fullReader.filename:null}})}},{key:"getStats",value:function e(){return this.messageHandler.sendWithPromise("GetStats",null)}},{key:"startCleanup",value:function e(){var t=this;this.messageHandler.sendWithPromise("Cleanup",null).then(function(){for(var e=0,r=t.pageCache.length;e8&&arguments[8]!==undefined?arguments[8]:false;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.webGLContext=u;this._pdfBug=l;this.running=false;this.graphicsReadyCallback=null;this.graphicsReady=false;this.useRequestAnimationFrame=false;this.cancelled=false;this.capability=(0,s.createPromiseCapability)();this.task=new W(this);this._continueBound=this._continue.bind(this);this._scheduleNextBound=this._scheduleNext.bind(this);this._nextBound=this._next.bind(this);this._canvas=t.canvasContext.canvas}r.prototype={initializeGraphics:function e(r){if(this.cancelled){return}if(this._canvas){if(t.has(this._canvas)){throw new Error("Cannot use the same canvas during multiple render() operations. "+"Use different canvas or ensure previous operations were "+"cancelled or completed.")}t.set(this._canvas,this)}if(this._pdfBug&&d.default.StepperManager&&d.default.StepperManager.enabled){this.stepper=d.default.StepperManager.create(this.pageNumber-1);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}var n=this.params;this.gfx=new c.CanvasGraphics(n.canvasContext,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext,n.imageLayer);this.gfx.beginDrawing({transform:n.transform,viewport:n.viewport,transparency:r,background:n.background});this.operatorListIdx=0;this.graphicsReady=true;if(this.graphicsReadyCallback){this.graphicsReadyCallback()}},cancel:function e(){this.running=false;this.cancelled=true;if(this._canvas){t.delete(this._canvas)}this.callback(new o.RenderingCancelledException("Rendering cancelled, page "+this.pageNumber,"canvas"))},operatorListChanged:function e(){if(!this.graphicsReady){if(!this.graphicsReadyCallback){this.graphicsReadyCallback=this._continueBound}return}if(this.stepper){this.stepper.updateOperatorList(this.operatorList)}if(this.running){return}this._continue()},_continue:function e(){this.running=true;if(this.cancelled){return}if(this.task.onContinue){this.task.onContinue(this._scheduleNextBound)}else{this._scheduleNext()}},_scheduleNext:function e(){var t=this;if(this.useRequestAnimationFrame&&typeof window!=="undefined"){window.requestAnimationFrame(function(){t._nextBound().catch(t.callback)})}else{Promise.resolve().then(this._nextBound).catch(this.callback)}},_next:function e(){var r=this;return new Promise(function(){if(r.cancelled){return}r.operatorListIdx=r.gfx.executeOperatorList(r.operatorList,r.operatorListIdx,r._continueBound,r.stepper);if(r.operatorListIdx===r.operatorList.argsArray.length){r.running=false;if(r.operatorList.lastChunk){r.gfx.endDrawing();if(r._canvas){t.delete(r._canvas)}r.callback()}}})}};return r}();var B,z;{t.version=B="2.0.943";t.build=z="dc98bf76"}t.getDocument=T;t.LoopbackPort=j;t.PDFDataRangeTransport=I;t.PDFWorker=D;t.PDFDocumentProxy=F;t.PDFPageProxy=M;t.setPDFNetworkStreamFactory=E;t.version=B;t.build=z},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.loadScript=t.DummyStatTimer=t.StatTimer=t.DOMSVGFactory=t.DOMCMapReaderFactory=t.DOMCanvasFactory=t.DEFAULT_LINK_REL=t.LinkTarget=t.getFilenameFromUrl=t.addLinkAttributes=t.RenderingCancelledException=t.PageViewport=undefined;var n=function(){function e(e,t){for(var r=0;r0&&r>0,"Invalid SVG dimensions");var n=document.createElementNS(o,"svg:svg");n.setAttribute("version","1.1");n.setAttribute("width",t+"px");n.setAttribute("height",r+"px");n.setAttribute("preserveAspectRatio","none");n.setAttribute("viewBox","0 0 "+t+" "+r);return n}},{key:"createElement",value:function e(t){(0,i.assert)(typeof t==="string","Invalid SVG element type");return document.createElementNS(o,t)}}]);return e}();var f=function(){function e(t){var r=t.viewBox,n=t.scale,i=t.rotation,s=t.offsetX,o=s===undefined?0:s,u=t.offsetY,l=u===undefined?0:u,c=t.dontFlip,f=c===undefined?false:c;a(this,e);this.viewBox=r;this.scale=n;this.rotation=i;this.offsetX=o;this.offsetY=l;var d=(r[2]+r[0])/2;var h=(r[3]+r[1])/2;var v=void 0,p=void 0,m=void 0,g=void 0;i=i%360;i=i<0?i+360:i;switch(i){case 180:v=-1;p=0;m=0;g=1;break;case 90:v=0;p=1;m=1;g=0;break;case 270:v=0;p=-1;m=-1;g=0;break;default:v=1;p=0;m=0;g=-1;break}if(f){m=-m;g=-g}var y=void 0,b=void 0;var _=void 0,A=void 0;if(v===0){y=Math.abs(h-r[1])*n+o;b=Math.abs(d-r[0])*n+l;_=Math.abs(r[3]-r[1])*n;A=Math.abs(r[2]-r[0])*n}else{y=Math.abs(d-r[0])*n+o;b=Math.abs(h-r[1])*n+l;_=Math.abs(r[2]-r[0])*n;A=Math.abs(r[3]-r[1])*n}this.transform=[v*n,p*n,m*n,g*n,y-v*n*d-m*n*h,b-p*n*d-g*n*h];this.width=_;this.height=A}n(e,[{key:"clone",value:function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=r.scale,i=n===undefined?this.scale:n,a=r.rotation,s=a===undefined?this.rotation:a,o=r.dontFlip,u=o===undefined?false:o;return new e({viewBox:this.viewBox.slice(),scale:i,rotation:s,offsetX:this.offsetX,offsetY:this.offsetY,dontFlip:u})}},{key:"convertToViewportPoint",value:function e(t,r){return i.Util.applyTransform([t,r],this.transform)}},{key:"convertToViewportRectangle",value:function e(t){var r=i.Util.applyTransform([t[0],t[1]],this.transform);var n=i.Util.applyTransform([t[2],t[3]],this.transform);return[r[0],r[1],n[0],n[1]]}},{key:"convertToPdfPoint",value:function e(t,r){return i.Util.applyInverseTransform([t,r],this.transform)}}]);return e}();var d=function e(){function e(e,t){this.message=e;this.type=t}e.prototype=new Error;e.prototype.name="RenderingCancelledException";e.constructor=e;return e}();var h={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};var v=["","_self","_blank","_parent","_top"];function p(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},r=t.url,n=t.target,a=t.rel;e.href=e.title=r?(0,i.removeNullCharacters)(r):"";if(r){var o=Object.values(h);var u=o.includes(n)?n:h.NONE;e.target=v[u];e.rel=typeof a==="string"?a:s}}function m(e){var t=e.indexOf("#");var r=e.indexOf("?");var n=Math.min(t>0?t:e.length,r>0?r:e.length);return e.substring(e.lastIndexOf("/",n)+1,n)}var g=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;a(this,e);this.enabled=!!t;this.started=Object.create(null);this.times=[]}n(e,[{key:"time",value:function e(t){if(!this.enabled){return}if(t in this.started){(0,i.warn)("Timer is already running for "+t)}this.started[t]=Date.now()}},{key:"timeEnd",value:function e(t){if(!this.enabled){return}if(!(t in this.started)){(0,i.warn)("Timer has not been started for "+t)}this.times.push({name:t,start:this.started[t],end:Date.now()});delete this.started[t]}},{key:"toString",value:function e(){var t=this.times;var r="",n=0;for(var i=0,a=t.length;in){n=s.length}}for(var o=0,u=t.length;o0&&!this.isSyncFontLoadingSupported){this._prepareFontLoadEvent(n,a,m)}else{m.complete()}}},{key:"_queueLoadingCallback",value:function e(t){function r(){(0,i.assert)(!a.done,"completeRequest() cannot be called twice.");a.done=true;while(n.requests.length>0&&n.requests[0].done){var e=n.requests.shift();setTimeout(e.callback,0)}}var n=this.loadingContext;var a={id:"pdfjs-font-loading-"+n.nextRequestId++,done:false,complete:r,callback:t};n.requests.push(a);return a}},{key:"_prepareFontLoadEvent",value:function e(t,r,n){(0,i.unreachable)("Abstract method `_prepareFontLoadEvent`.")}},{key:"isFontLoadingAPISupported",get:function e(){(0,i.unreachable)("Abstract method `isFontLoadingAPISupported`.")}},{key:"isSyncFontLoadingSupported",get:function e(){(0,i.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}},{key:"_loadTestFont",get:function e(){(0,i.unreachable)("Abstract method `_loadTestFont`.")}}]);return e}();var l=void 0;{t.FontLoader=l=function(e){s(t,e);function t(e){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.loadTestFontId=0;return r}n(t,[{key:"_prepareFontLoadEvent",value:function e(t,r,n){function a(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3)&255}function s(e,t,r,n){var i=e.substring(0,t);var a=e.substring(t+r);return i+n+a}var o=void 0,u=void 0;var l=document.createElement("canvas");l.width=1;l.height=1;var c=l.getContext("2d");var f=0;function d(e,t){f++;if(f>30){(0,i.warn)("Load test font never loaded.");t();return}c.font="30px "+e;c.fillText(".",0,20);var r=c.getImageData(0,0,1,1);if(r.data[3]>0){t();return}setTimeout(d.bind(null,e,t))}var h="lt"+Date.now()+this.loadTestFontId++;var v=this._loadTestFont;var p=976;v=s(v,p,h.length,h);var m=16;var g=1482184792;var y=a(v,m);for(o=0,u=h.length-3;o=14){t=true}}return(0,i.shadow)(this,"isSyncFontLoadingSupported",t)}},{key:"_loadTestFont",get:function e(){var t=function e(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA"+"FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA"+"ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA"+"AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1"+"AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD"+"6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACM"+"AooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4D"+"IP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAA"+"AAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUA"+"AQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgAB"+"AAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABY"+"AAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAA"+"AC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+"AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA"+"AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC"+"AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3"+"Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj"+"FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,i.shadow)(this,"_loadTestFont",t())}}]);return t}(u)}var c={get value(){return(0,i.shadow)(this,"value",(0,i.isEvalSupported)())}};var f=function(){function e(t,r){var n=r.isEvalSupported,i=n===undefined?true:n,a=r.disableFontFace,s=a===undefined?false:a,u=r.ignoreErrors,l=u===undefined?false:u,c=r.onUnsupportedFeature,f=c===undefined?null:c,d=r.fontRegistry,h=d===undefined?null:d;o(this,e);this.compiledGlyphs=Object.create(null);for(var v in t){this[v]=t[v]}this.isEvalSupported=i!==false;this.disableFontFace=s===true;this.ignoreErrors=l===true;this._onUnsupportedFeature=f;this.fontRegistry=h}n(e,[{key:"createNativeFontFace",value:function e(){if(!this.data||this.disableFontFace){return null}var t=new FontFace(this.loadedName,this.data,{});if(this.fontRegistry){this.fontRegistry.registerFont(this)}return t}},{key:"createFontFaceRule",value:function e(){if(!this.data||this.disableFontFace){return null}var t=(0,i.bytesToString)(new Uint8Array(this.data));var r="url(data:"+this.mimetype+";base64,"+btoa(t)+");";var n='@font-face {font-family:"'+this.loadedName+'";src:'+r+"}";if(this.fontRegistry){this.fontRegistry.registerFont(this,r)}return n}},{key:"getPathGenerator",value:function e(t,r){if(this.compiledGlyphs[r]!==undefined){return this.compiledGlyphs[r]}var n=void 0,a=void 0;try{n=t.get(this.loadedName+"_path_"+r)}catch(e){if(!this.ignoreErrors){throw e}if(this._onUnsupportedFeature){this._onUnsupportedFeature({featureId:i.UNSUPPORTED_FEATURES.font})}(0,i.warn)('getPathGenerator - ignoring character: "'+e+'".');return this.compiledGlyphs[r]=function(e,t){}}if(this.isEvalSupported&&c.value){var s=void 0,o="";for(var u=0,l=n.length;u0){d[h++]=m&p?0:255;p>>=1}}var g=0;h=0;if(d[h]!==0){u[0]=1;++g}for(a=1;a>2)+(d[h+1]?4:0)+(d[h-c+1]?8:0);if(l[y]){u[s+a]=l[y];++g}h++}if(d[h-c]!==d[h]){u[s+a]=d[h]?2:4;++g}if(g>t){return null}}h=c*(n-1);s=i*o;if(d[h]!==0){u[s]=8;++g}for(a=1;at){return null}var b=new Int32Array([0,o,-1,0,-o,0,0,0,1]);var _=[];for(i=0;g&&i<=n;i++){var A=i*o;var S=A+r;while(A>4;u[A]&=k>>2|k<<2}w.push(A%o);w.push(A/o|0);--g}while(P!==A);_.push(w);--i}var R=function e(t){t.save();t.scale(1/r,-1/n);t.translate(0,-n);t.beginPath();for(var i=0,a=_.length;i>2);var A=_.length;var S=i+7>>3;var w=4294967295;var k=d.value?4278190080:255;for(p=0;pS?i:P*8-7;var R=x&~7;var E=0;var T=0;for(;C>=1}}while(c=s){g=a;y=i*g}c=0;for(m=y;m--;){v[c++]=h[l++];v[c++]=h[l++];v[c++]=h[l++];v[c++]=255}e.putImageData(u,0,p*f)}}else{throw new Error("bad image kind: "+t.kind)}}function b(e,t){var r=t.height,n=t.width;var i=r%f;var a=(r-i)/f;var s=i===0?a:a+1;var o=e.createImageData(n,f);var u=0;var l=t.data;var c=o.data;for(var d=0;d>=1}}e.putImageData(o,0,d*f)}}function _(e,t){var r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(var n=0,i=r.length;n>8;e[a-2]=e[a-2]*s+r*o>>8;e[a-1]=e[a-1]*s+n*o>>8}}}function w(e,t,r){var n=e.length;var i=1/255;for(var a=3;a>8]>>8:t[i]*a>>16}}function P(e,t,r,n,i,a,s){var o=!!a;var u=o?a[0]:0;var l=o?a[1]:0;var c=o?a[2]:0;var f;if(i==="Luminosity"){f=k}else{f=w}var d=1048576;var h=Math.min(n,Math.ceil(d/r));for(var v=0;vr&&typeof s==="function";var h=d?Date.now()+t:0;var v=0;var p=this.commonObjs;var m=this.objs;var g;while(true){if(o!==undefined&&c===o.nextBreakPoint){o.breakIt(c,s);return c}g=l[c];if(g!==n.OPS.dependency){this[g].apply(this,u[c])}else{var y=u[c];for(var b=0,_=y.length;b<_;b++){var A=y[b];var S=A[0]==="g"&&A[1]==="_";var w=S?p:m;if(!w.isResolved(A)){w.get(A,s);return c}}}c++;if(c===f){return c}if(d&&++v>r){if(Date.now()>h){s();return c}v=0}}},endDrawing:function e(){if(this.current.activeSMask!==null){this.endSMaskGroup()}this.ctx.restore();if(this.transparentCanvas){this.ctx=this.compositeCtx;this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.drawImage(this.transparentCanvas,0,0);this.ctx.restore();this.transparentCanvas=null}this.cachedCanvases.clear();this.webGLContext.clear();if(this.imageLayer){this.imageLayer.endLayout()}},setLineWidth:function e(t){this.current.lineWidth=t;this.ctx.lineWidth=t},setLineCap:function e(t){this.ctx.lineCap=x[t]},setLineJoin:function e(t){this.ctx.lineJoin=R[t]},setMiterLimit:function e(t){this.ctx.miterLimit=t},setDash:function e(t,r){var n=this.ctx;if(n.setLineDash!==undefined){n.setLineDash(t);n.lineDashOffset=r}},setRenderingIntent:function e(t){},setFlatness:function e(t){},setGState:function e(t){for(var r=0,n=t.length;r0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask){this.suspendSMaskGroup()}else{this.endSMaskGroup()}}this.current.activeSMask=s?this.tempSMask:null;if(this.current.activeSMask){this.beginSMaskGroup()}this.tempSMask=null;break}}},beginSMaskGroup:function e(){var t=this.current.activeSMask;var r=t.canvas.width;var n=t.canvas.height;var i="smaskGroupAt"+this.groupLevel;var a=this.cachedCanvases.getCanvas(i,r,n,true);var s=this.ctx;var o=s.mozCurrentTransform;this.ctx.save();var u=a.context;u.scale(1/t.scaleX,1/t.scaleY);u.translate(-t.offsetX,-t.offsetY);u.transform.apply(u,o);t.startTransformInverse=u.mozCurrentTransformInverse;_(s,u);this.ctx=u;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(s);this.groupLevel++},suspendSMaskGroup:function e(){var t=this.ctx;this.groupLevel--;this.ctx=this.groupStack.pop();C(this.ctx,this.current.activeSMask,t,this.webGLContext);this.ctx.restore();this.ctx.save();_(t,this.ctx);this.current.resumeSMaskCtx=t;var r=n.Util.transform(this.current.activeSMask.startTransformInverse,t.mozCurrentTransform);this.ctx.transform.apply(this.ctx,r);t.save();t.setTransform(1,0,0,1,0,0);t.clearRect(0,0,t.canvas.width,t.canvas.height);t.restore()},resumeSMaskGroup:function e(){var t=this.current.resumeSMaskCtx;var r=this.ctx;this.ctx=t;this.groupStack.push(r);this.groupLevel++},endSMaskGroup:function e(){var t=this.ctx;this.groupLevel--;this.ctx=this.groupStack.pop();C(this.ctx,this.current.activeSMask,t,this.webGLContext);this.ctx.restore();_(t,this.ctx);var r=n.Util.transform(this.current.activeSMask.startTransformInverse,t.mozCurrentTransform);this.ctx.transform.apply(this.ctx,r)},save:function e(){this.ctx.save();var t=this.current;this.stateStack.push(t);this.current=t.clone();this.current.resumeSMaskCtx=null},restore:function e(){if(this.current.resumeSMaskCtx){this.resumeSMaskGroup()}if(this.current.activeSMask!==null&&(this.stateStack.length===0||this.stateStack[this.stateStack.length-1].activeSMask!==this.current.activeSMask)){this.endSMaskGroup()}if(this.stateStack.length!==0){this.current=this.stateStack.pop();this.ctx.restore();this.pendingClip=null;this._cachedGetSinglePixelWidth=null}},transform:function e(t,r,n,i,a,s){this.ctx.transform(t,r,n,i,a,s);this._cachedGetSinglePixelWidth=null},constructPath:function e(t,r){var i=this.ctx;var a=this.current;var s=a.x,o=a.y;for(var u=0,l=0,c=t.length;us?s:r;this.current.fontSizeScale=r/d;var h=c+" "+l+" "+d+"px "+f;this.ctx.font=h},setTextRenderingMode:function e(t){this.current.textRenderingMode=t},setTextRise:function e(t){this.current.textRise=t},moveText:function e(t,r){this.current.x=this.current.lineX+=t;this.current.y=this.current.lineY+=r},setLeadingMoveText:function e(t,r){this.setLeading(-r);this.moveText(t,r)},setTextMatrix:function e(t,r,n,i,a,s){this.current.textMatrix=[t,r,n,i,a,s];this.current.textMatrixScale=Math.sqrt(t*t+r*r);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0},nextLine:function e(){this.moveText(0,this.current.leading)},paintChar:function e(t,r,i,a){var s=this.ctx;var o=this.current;var u=o.font;var l=o.textRenderingMode;var c=o.fontSize/o.fontSizeScale;var f=l&n.TextRenderingMode.FILL_STROKE_MASK;var d=!!(l&n.TextRenderingMode.ADD_TO_PATH_FLAG);var h=o.patternFill&&u.data;var v;if(u.disableFontFace||d||h){v=u.getPathGenerator(this.commonObjs,t)}if(u.disableFontFace||h){s.save();s.translate(r,i);s.beginPath();v(s,c);if(a){s.setTransform.apply(s,a)}if(f===n.TextRenderingMode.FILL||f===n.TextRenderingMode.FILL_STROKE){s.fill()}if(f===n.TextRenderingMode.STROKE||f===n.TextRenderingMode.FILL_STROKE){s.stroke()}s.restore()}else{if(f===n.TextRenderingMode.FILL||f===n.TextRenderingMode.FILL_STROKE){s.fillText(t,r,i)}if(f===n.TextRenderingMode.STROKE||f===n.TextRenderingMode.FILL_STROKE){s.strokeText(t,r,i)}}if(d){var p=this.pendingTextPaths||(this.pendingTextPaths=[]);p.push({transform:s.mozCurrentTransform,x:r,y:i,fontSize:c,addToPath:v})}},get isFontSubpixelAAEnabled(){var e=this.canvasFactory.create(10,10).context;e.scale(1.5,1);e.fillText("I",0,10);var t=e.getImageData(0,0,10,10).data;var r=false;for(var i=3;i0&&t[i]<255){r=true;break}}return(0,n.shadow)(this,"isFontSubpixelAAEnabled",r)},showText:function e(t){var r=this.current;var i=r.font;if(i.isType3Font){return this.showType3Text(t)}var a=r.fontSize;if(a===0){return}var s=this.ctx;var o=r.fontSizeScale;var l=r.charSpacing;var c=r.wordSpacing;var f=r.fontDirection;var d=r.textHScale*f;var h=t.length;var v=i.vertical;var p=v?1:-1;var m=i.defaultVMetrics;var g=a*r.fontMatrix[0];var y=r.textRenderingMode===n.TextRenderingMode.FILL&&!i.disableFontFace&&!r.patternFill;s.save();var b=void 0;if(r.patternFill){s.save();var _=r.fillColor.getPattern(s,this);b=s.mozCurrentTransform;s.restore();s.fillStyle=_}s.transform.apply(s,r.textMatrix);s.translate(r.x,r.y+r.textRise);if(f>0){s.scale(d,-1)}else{s.scale(d,1)}var A=r.lineWidth;var S=r.textMatrixScale;if(S===0||A===0){var w=r.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(w===n.TextRenderingMode.STROKE||w===n.TextRenderingMode.FILL_STROKE){this._cachedGetSinglePixelWidth=null;A=this.getSinglePixelWidth()*u}}else{A/=S}if(o!==1){s.scale(o,o);A/=o}s.lineWidth=A;var k=0,P;for(P=0;P0){var q=s.measureText(E).width*1e3/a*o;if(Mo){d=c/o;c=o}if(f>o){h=f/o;f=o}var v="groupAt"+this.groupLevel;if(t.smask){v+="_smask_"+this.smaskCounter++%2}var p=this.cachedCanvases.getCanvas(v,c,f,true);var m=p.context;m.scale(1/d,1/h);m.translate(-u,-l);m.transform.apply(m,i);if(t.smask){this.smaskStack.push({canvas:p.canvas,context:m,offsetX:u,offsetY:l,scaleX:d,scaleY:h,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null})}else{r.setTransform(1,0,0,1,0,0);r.translate(u,l);r.scale(d,h)}_(r,m);this.ctx=m;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(r);this.groupLevel++;this.current.activeSMask=null},endGroup:function e(t){this.groupLevel--;var r=this.ctx;this.ctx=this.groupStack.pop();if(this.ctx.imageSmoothingEnabled!==undefined){this.ctx.imageSmoothingEnabled=false}else{this.ctx.mozImageSmoothingEnabled=false}if(t.smask){this.tempSMask=this.smaskStack.pop()}else{this.ctx.drawImage(r.canvas,0,0)}this.restore()},beginAnnotations:function e(){this.save();if(this.baseTransform){this.ctx.setTransform.apply(this.ctx,this.baseTransform)}},endAnnotations:function e(){this.restore()},beginAnnotation:function e(t,r,n){this.save();A(this.ctx);this.current=new m;if(Array.isArray(t)&&t.length===4){var i=t[2]-t[0];var a=t[3]-t[1];this.ctx.rect(t[0],t[1],i,a);this.clip();this.endPath()}this.transform.apply(this,r);this.transform.apply(this,n)},endAnnotation:function e(){this.restore()},paintJpegXObject:function e(t,r,i){var a=this.objs.get(t);if(!a){(0,n.warn)("Dependent image isn't ready yet");return}this.save();var s=this.ctx;s.scale(1/r,-1/i);s.drawImage(a,0,0,a.width,a.height,0,-i,r,i);if(this.imageLayer){var o=s.mozCurrentTransformInverse;var u=this.getCanvasPosition(0,0);this.imageLayer.appendImage({objId:t,left:u[0],top:u[1],width:r/o[0],height:i/o[3]})}this.restore()},paintImageMaskXObject:function e(t){var r=this.ctx;var n=t.width,i=t.height;var a=this.current.fillColor;var s=this.current.patternFill;var o=this.processingType3;if(l&&o&&o.compiled===undefined){if(n<=c&&i<=c){o.compiled=p({data:t.data,width:n,height:i})}else{o.compiled=null}}if(o&&o.compiled){o.compiled(r);return}var u=this.cachedCanvases.getCanvas("maskCanvas",n,i);var f=u.context;f.save();b(f,t);f.globalCompositeOperation="source-in";f.fillStyle=s?a.getPattern(f,this):a;f.fillRect(0,0,n,i);f.restore();this.paintInlineImageXObject(u.canvas)},paintImageMaskXObjectRepeat:function e(t,r,n,i){var a=t.width;var s=t.height;var o=this.current.fillColor;var u=this.current.patternFill;var l=this.cachedCanvases.getCanvas("maskCanvas",a,s);var c=l.context;c.save();b(c,t);c.globalCompositeOperation="source-in";c.fillStyle=u?o.getPattern(c,this):o;c.fillRect(0,0,a,s);c.restore();var f=this.ctx;for(var d=0,h=i.length;d2&&p>1||f>2&&m>1){var b=p,_=m;if(u>2&&p>1){b=Math.ceil(p/2);u/=p/b}if(f>2&&m>1){_=Math.ceil(m/2);f/=m/_}h=this.cachedCanvases.getCanvas(g,b,_);v=h.context;v.clearRect(0,0,b,_);v.drawImage(d,0,0,p,m,0,0,b,_);d=h.canvas;p=b;m=_;g=g==="prescale1"?"prescale2":"prescale1"}i.drawImage(d,0,0,p,m,0,-n,r,n);if(this.imageLayer){var A=this.getCanvasPosition(0,-n);this.imageLayer.appendImage({imgData:t,left:A[0],top:A[1],width:r/a[0],height:n/a[3]})}this.restore()},paintInlineImageXObjectGroup:function e(t,r){var n=this.ctx;var i=t.width;var a=t.height;var s=this.cachedCanvases.getCanvas("inlineImage",i,a);var o=s.context;y(o,t);for(var u=0,l=r.length;uu[n+1]){d=r;r=n;n=d;d=a;a=s;s=d}if(u[n+1]>u[i+1]){d=n;n=i;i=d;d=s;s=o;o=d}if(u[r+1]>u[n+1]){d=r;r=n;n=d;d=a;a=s;s=d}var h=(u[r]+t.offsetX)*t.scaleX;var v=(u[r+1]+t.offsetY)*t.scaleY;var p=(u[n]+t.offsetX)*t.scaleX;var m=(u[n+1]+t.offsetY)*t.scaleY;var g=(u[i]+t.offsetX)*t.scaleX;var y=(u[i+1]+t.offsetY)*t.scaleY;if(v>=y){return}var b=l[a],_=l[a+1],A=l[a+2];var S=l[s],w=l[s+1],k=l[s+2];var P=l[o],C=l[o+1],x=l[o+2];var R=Math.round(v),E=Math.round(y);var T,O,L,I;var F,M,j,D;var N;for(var q=R;q<=E;q++){if(qy?1:m===y?0:(m-q)/(m-y);T=p-(p-g)*N;O=S-(S-P)*N;L=w-(w-C)*N;I=k-(k-x)*N}N=qy?1:(v-q)/(v-y);F=h-(h-g)*N;M=b-(b-P)*N;j=_-(_-C)*N;D=A-(A-x)*N;var W=Math.round(Math.min(T,F));var U=Math.round(Math.max(T,F));var B=f*q+W*4;for(var z=W;z<=U;z++){N=(T-z)/(T-F);N=N<0?0:N>1?1:N;c[B++]=O-(O-M)*N|0;c[B++]=L-(L-j)*N|0;c[B++]=I-(I-D)*N|0;c[B++]=255}}}function r(e,r,n){var i=r.coords;var a=r.colors;var s,o;switch(r.type){case"lattice":var u=r.verticesPerRow;var l=Math.floor(i.length/u)-1;var c=u-1;for(s=0;s2&&arguments[2]!==undefined?arguments[2]:null;return i.default.wrap(function e(i){while(1){switch(i.prev=i.next){case 0:if(t){i.next=2;break}return i.abrupt("return");case 2:return i.abrupt("return",t.apply(n,r));case 3:case"end":return i.stop()}}},e,this)}));return function t(r,n){return e.apply(this,arguments)}}();var o=r(1);function u(e){return e&&e.__esModule?e:{default:e}}function l(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(i,a){try{var s=t[i](a);var o=s.value}catch(e){r(e);return}if(s.done){e(o)}else{return Promise.resolve(o).then(function(e){n("next",e)},function(e){n("throw",e)})}}return n("next")})}}function c(e){if((typeof e==="undefined"?"undefined":a(e))!=="object"){return e}switch(e.name){case"AbortException":return new o.AbortException(e.message);case"MissingPDFException":return new o.MissingPDFException(e.message);case"UnexpectedResponseException":return new o.UnexpectedResponseException(e.message,e.status);default:return new o.UnknownErrorException(e.message,e.details)}}function f(e){if(!(e instanceof Error)||e instanceof o.AbortException||e instanceof o.MissingPDFException||e instanceof o.UnexpectedResponseException||e instanceof o.UnknownErrorException){return e}return new o.UnknownErrorException(e.message,e.toString())}function d(e,t,r){if(t){e.resolve()}else{e.reject(r)}}function h(e){return Promise.resolve(e).catch(function(){})}function v(e,t,r){var n=this;this.sourceName=e;this.targetName=t;this.comObj=r;this.callbackId=1;this.streamId=1;this.postMessageTransfers=true;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);var i=this.callbacksCapabilities=Object.create(null);var a=this.actionHandler=Object.create(null);this._onComObjOnMessage=function(e){var t=e.data;if(t.targetName!==n.sourceName){return}if(t.stream){n._processStreamMessage(t)}else if(t.isReply){var s=t.callbackId;if(t.callbackId in i){var o=i[s];delete i[s];if("error"in t){o.reject(c(t.error))}else{o.resolve(t.data)}}else{throw new Error("Cannot resolve callback "+s)}}else if(t.action in a){var u=a[t.action];if(t.callbackId){var l=n.sourceName;var d=t.sourceName;Promise.resolve().then(function(){return u[0].call(u[1],t.data)}).then(function(e){r.postMessage({sourceName:l,targetName:d,isReply:true,callbackId:t.callbackId,data:e})},function(e){r.postMessage({sourceName:l,targetName:d,isReply:true,callbackId:t.callbackId,error:f(e)})})}else if(t.streamId){n._createStreamSink(t)}else{u[0].call(u[1],t.data)}}else{throw new Error("Unknown action from worker: "+t.action)}};r.addEventListener("message",this._onComObjOnMessage)}v.prototype={on:function e(t,r,n){var i=this.actionHandler;if(i[t]){throw new Error('There is already an actionName called "'+t+'"')}i[t]=[r,n]},send:function e(t,r,n){var i={sourceName:this.sourceName,targetName:this.targetName,action:t,data:r};this.postMessage(i,n)},sendWithPromise:function e(t,r,n){var i=this.callbackId++;var a={sourceName:this.sourceName,targetName:this.targetName,action:t,data:r,callbackId:i};var s=(0,o.createPromiseCapability)();this.callbacksCapabilities[i]=s;try{this.postMessage(a,n)}catch(e){s.reject(e)}return s.promise},sendWithStream:function e(t,r,n,i){var a=this;var s=this.streamId++;var u=this.sourceName;var l=this.targetName;return new o.ReadableStream({start:function e(n){var i=(0,o.createPromiseCapability)();a.streamControllers[s]={controller:n,startCall:i,isClosed:false};a.postMessage({sourceName:u,targetName:l,action:t,streamId:s,data:r,desiredSize:n.desiredSize});return i.promise},pull:function e(t){var r=(0,o.createPromiseCapability)();a.streamControllers[s].pullCall=r;a.postMessage({sourceName:u,targetName:l,stream:"pull",streamId:s,desiredSize:t.desiredSize});return r.promise},cancel:function e(t){var r=(0,o.createPromiseCapability)();a.streamControllers[s].cancelCall=r;a.streamControllers[s].isClosed=true;a.postMessage({sourceName:u,targetName:l,stream:"cancel",reason:t,streamId:s});return r.promise}},n)},_createStreamSink:function e(t){var r=this;var n=this;var i=this.actionHandler[t.action];var a=t.streamId;var u=t.desiredSize;var l=this.sourceName;var c=t.sourceName;var f=(0,o.createPromiseCapability)();var d=function e(t){var n=t.stream,i=t.chunk,s=t.transfers,o=t.success,u=t.reason;r.postMessage({sourceName:l,targetName:c,stream:n,streamId:a,chunk:i,success:o,reason:u},s)};var h={enqueue:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var n=arguments[2];if(this.isCancelled){return}var i=this.desiredSize;this.desiredSize-=r;if(i>0&&this.desiredSize<=0){this.sinkCapability=(0,o.createPromiseCapability)();this.ready=this.sinkCapability.promise}d({stream:"enqueue",chunk:t,transfers:n})},close:function e(){if(this.isCancelled){return}this.isCancelled=true;d({stream:"close"});delete n.streamSinks[a]},error:function e(t){if(this.isCancelled){return}this.isCancelled=true;d({stream:"error",reason:t})},sinkCapability:f,onPull:null,onCancel:null,isCancelled:false,desiredSize:u,ready:null};h.sinkCapability.resolve();h.ready=h.sinkCapability.promise;this.streamSinks[a]=h;s(i[0],[t.data,h],i[1]).then(function(){d({stream:"start_complete",success:true})},function(e){d({stream:"start_complete",success:false,reason:e})})},_processStreamMessage:function e(t){var r=this;var n=this.sourceName;var i=t.sourceName;var a=t.streamId;var u=function e(t){var s=t.stream,o=t.success,u=t.reason;r.comObj.postMessage({sourceName:n,targetName:i,stream:s,success:o,streamId:a,reason:u})};var l=function e(){Promise.all([r.streamControllers[t.streamId].startCall,r.streamControllers[t.streamId].pullCall,r.streamControllers[t.streamId].cancelCall].map(function(e){return e&&h(e.promise)})).then(function(){delete r.streamControllers[t.streamId]})};switch(t.stream){case"start_complete":d(this.streamControllers[t.streamId].startCall,t.success,c(t.reason));break;case"pull_complete":d(this.streamControllers[t.streamId].pullCall,t.success,c(t.reason));break;case"pull":if(!this.streamSinks[t.streamId]){u({stream:"pull_complete",success:true});break}if(this.streamSinks[t.streamId].desiredSize<=0&&t.desiredSize>0){this.streamSinks[t.streamId].sinkCapability.resolve()}this.streamSinks[t.streamId].desiredSize=t.desiredSize;s(this.streamSinks[t.streamId].onPull).then(function(){u({stream:"pull_complete",success:true})},function(e){u({stream:"pull_complete",success:false,reason:e})});break;case"enqueue":(0,o.assert)(this.streamControllers[t.streamId],"enqueue should have stream controller");if(!this.streamControllers[t.streamId].isClosed){this.streamControllers[t.streamId].controller.enqueue(t.chunk)}break;case"close":(0,o.assert)(this.streamControllers[t.streamId],"close should have stream controller");if(this.streamControllers[t.streamId].isClosed){break}this.streamControllers[t.streamId].isClosed=true;this.streamControllers[t.streamId].controller.close();l();break;case"error":(0,o.assert)(this.streamControllers[t.streamId],"error should have stream controller");this.streamControllers[t.streamId].controller.error(c(t.reason));l();break;case"cancel_complete":d(this.streamControllers[t.streamId].cancelCall,t.success,c(t.reason));l();break;case"cancel":if(!this.streamSinks[t.streamId]){break}s(this.streamSinks[t.streamId].onCancel,[c(t.reason)]).then(function(){u({stream:"cancel_complete",success:true})},function(e){u({stream:"cancel_complete",success:false,reason:e})});this.streamSinks[t.streamId].sinkCapability.reject(c(t.reason));this.streamSinks[t.streamId].isCancelled=true;delete this.streamSinks[t.streamId];break;default:throw new Error("Unexpected stream case")}},postMessage:function e(t,r){if(r&&this.postMessageTransfers){this.comObj.postMessage(t,r)}else{this.comObj.postMessage(t)}},destroy:function e(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}};t.MessageHandler=v},function(e,t,r){"use strict";e.exports=r(138)},function(e,t,r){"use strict";var n=function(){return this}()||Function("return this")();var i=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0;var a=i&&n.regeneratorRuntime;n.regeneratorRuntime=undefined;e.exports=r(139);if(i){n.regeneratorRuntime=a}else{try{delete n.regeneratorRuntime}catch(e){n.regeneratorRuntime=undefined}}},function(e,t,r){"use strict";(function(e){var t=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(r){"use strict";var n=Object.prototype;var i=n.hasOwnProperty;var a;var s=typeof Symbol==="function"?Symbol:{};var o=s.iterator||"@@iterator";var u=s.asyncIterator||"@@asyncIterator";var l=s.toStringTag||"@@toStringTag";var c=(false?a:t(e))==="object";var f=r.regeneratorRuntime;if(f){if(c){e.exports=f}return}f=r.regeneratorRuntime=c?e.exports:{};function d(e,t,r,n){var i=t&&t.prototype instanceof b?t:b;var a=Object.create(i.prototype);var s=new L(n||[]);a._invoke=R(e,r,s);return a}f.wrap=d;function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}var v="suspendedStart";var p="suspendedYield";var m="executing";var g="completed";var y={};function b(){}function _(){}function A(){}var S={};S[o]=function(){return this};var w=Object.getPrototypeOf;var k=w&&w(w(I([])));if(k&&k!==n&&i.call(k,o)){S=k}var P=A.prototype=b.prototype=Object.create(S);_.prototype=P.constructor=A;A.constructor=_;A[l]=_.displayName="GeneratorFunction";function C(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}f.isGeneratorFunction=function(e){var t=typeof e==="function"&&e.constructor;return t?t===_||(t.displayName||t.name)==="GeneratorFunction":false};f.mark=function(e){if(Object.setPrototypeOf){Object.setPrototypeOf(e,A)}else{e.__proto__=A;if(!(l in e)){e[l]="GeneratorFunction"}}e.prototype=Object.create(P);return e};f.awrap=function(e){return{__await:e}};function x(e){function r(n,a,s,o){var u=h(e[n],e,a);if(u.type==="throw"){o(u.arg)}else{var l=u.arg;var c=l.value;if(c&&(typeof c==="undefined"?"undefined":t(c))==="object"&&i.call(c,"__await")){return Promise.resolve(c.__await).then(function(e){r("next",e,s,o)},function(e){r("throw",e,s,o)})}return Promise.resolve(c).then(function(e){l.value=e;s(l)},o)}}var n;function a(e,t){function i(){return new Promise(function(n,i){r(e,t,n,i)})}return n=n?n.then(i,i):i()}this._invoke=a}C(x.prototype);x.prototype[u]=function(){return this};f.AsyncIterator=x;f.async=function(e,t,r,n){var i=new x(d(e,t,r,n));return f.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})};function R(e,t,r){var n=v;return function i(a,s){if(n===m){throw new Error("Generator is already running")}if(n===g){if(a==="throw"){throw s}return F()}r.method=a;r.arg=s;while(true){var o=r.delegate;if(o){var u=E(o,r);if(u){if(u===y)continue;return u}}if(r.method==="next"){r.sent=r._sent=r.arg}else if(r.method==="throw"){if(n===v){n=g;throw r.arg}r.dispatchException(r.arg)}else if(r.method==="return"){r.abrupt("return",r.arg)}n=m;var l=h(e,t,r);if(l.type==="normal"){n=r.done?g:p;if(l.arg===y){continue}return{value:l.arg,done:r.done}}else if(l.type==="throw"){n=g;r.method="throw";r.arg=l.arg}}}}function E(e,t){var r=e.iterator[t.method];if(r===a){t.delegate=null;if(t.method==="throw"){if(e.iterator.return){t.method="return";t.arg=a;E(e,t);if(t.method==="throw"){return y}}t.method="throw";t.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var n=h(r,e.iterator,t.arg);if(n.type==="throw"){t.method="throw";t.arg=n.arg;t.delegate=null;return y}var i=n.arg;if(!i){t.method="throw";t.arg=new TypeError("iterator result is not an object");t.delegate=null;return y}if(i.done){t[e.resultName]=i.value;t.next=e.nextLoc;if(t.method!=="return"){t.method="next";t.arg=a}}else{return i}t.delegate=null;return y}C(P);P[l]="Generator";P[o]=function(){return this};P.toString=function(){return"[object Generator]"};function T(e){var t={tryLoc:e[0]};if(1 in e){t.catchLoc=e[1]}if(2 in e){t.finallyLoc=e[2];t.afterLoc=e[3]}this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal";delete t.arg;e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}];e.forEach(T,this);this.reset(true)}f.keys=function(e){var t=[];for(var r in e){t.push(r)}t.reverse();return function r(){while(t.length){var n=t.pop();if(n in e){r.value=n;r.done=false;return r}}r.done=true;return r}};function I(e){if(e){var t=e[o];if(t){return t.call(e)}if(typeof e.next==="function"){return e}if(!isNaN(e.length)){var r=-1,n=function t(){while(++r=0;--s){var o=this.tryEntries[s];var u=o.completion;if(o.tryLoc==="root"){return n("end")}if(o.tryLoc<=this.prev){var l=i.call(o,"catchLoc");var c=i.call(o,"finallyLoc");if(l&&c){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&i.call(a,"finallyLoc")&&this.prev=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===t){this.complete(n.completion,n.afterLoc);O(n);return y}}},catch:function e(t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===t){var i=n.completion;if(i.type==="throw"){var a=i.arg;O(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function e(t,r,n){this.delegate={iterator:I(t),resultName:r,nextLoc:n};if(this.method==="next"){this.arg=a}return y}}}(function(){return this}()||Function("return this")())}).call(this,r(140)(e))},function(e,t,r){"use strict";e.exports=function(e){if(!e.webpackPolyfill){e.deprecate=function(){};e.paths=[];if(!e.children)e.children=[];Object.defineProperty(e,"loaded",{enumerable:true,get:function t(){return e.l}});Object.defineProperty(e,"id",{enumerable:true,get:function t(){return e.i}});e.webpackPolyfill=1}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Metadata=undefined;var n=function(){function e(e,t){for(var r=0;r\\376\\377([^<]+)/g,function(e,t){var r=t.replace(/\\([0-3])([0-7])([0-7])/g,function(e,t,r,n){return String.fromCharCode(t*64+r*8+n*1)}).replace(/&(amp|apos|gt|lt|quot);/g,function(e,t){switch(t){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error("_repair: "+t+" isn't defined.")});var n="";for(var i=0,a=r.length;i=32&&s<127&&s!==60&&s!==62&&s!==38){n+=String.fromCharCode(s)}else{n+="&#x"+(65536+s).toString(16).substring(1)+";"}}return">"+n})}},{key:"_parse",value:function e(t){var r=t.documentElement;if(r.nodeName.toLowerCase()!=="rdf:rdf"){r=r.firstChild;while(r&&r.nodeName.toLowerCase()!=="rdf:rdf"){r=r.nextSibling}}var n=r?r.nodeName.toLowerCase():null;if(!r||n!=="rdf:rdf"||!r.hasChildNodes()){return}var i=r.childNodes;for(var a=0,s=i.length;a";case"amp":return"&";case"quot":return'"'}return this.onResolveEntity(t)})}},{key:"_parseContent",value:function e(t,r){var n=r,i=void 0,a=[];function s(){while(n"&&t[n]!=="/"){++n}i=t.substring(r,n);s();while(n"&&t[n]!=="/"&&t[n]!=="?"){s();var o="",u="";while(n"&&t[n]!=="/"){++n}i=t.substring(r,n);s();var o=n;while(n")){++n}a=t.substring(o,n);return{name:i,value:a,parsed:n-r}}},{key:"parseXml",value:function e(t){var r=0;while(r",i);if(s<0){this.onError(l.UnterminatedElement);return}this.onEndElement(t.substring(i,s));i=s+1;break;case"?":++i;var o=this._parseProcessingInstruction(t,i);if(t.substring(i+o.parsed,i+o.parsed+2)!=="?>"){this.onError(l.UnterminatedXmlDeclaration);return}this.onPi(o.name,o.value);i+=o.parsed+2;break;case"!":if(t.substring(i+1,i+3)==="--"){s=t.indexOf("--\x3e",i+3);if(s<0){this.onError(l.UnterminatedComment);return}this.onComment(t.substring(i+3,s));i=s+3}else if(t.substring(i+1,i+8)==="[CDATA["){s=t.indexOf("]]>",i+8);if(s<0){this.onError(l.UnterminatedCdat);return}this.onCdata(t.substring(i+8,s));i=s+3}else if(t.substring(i+1,i+8)==="DOCTYPE"){var u=t.indexOf("[",i+8);var c=false;s=t.indexOf(">",i+8);if(s<0){this.onError(l.UnterminatedDoctypeDeclaration);return}if(u>0&&s>u){s=t.indexOf("]>",i+8);if(s<0){this.onError(l.UnterminatedDoctypeDeclaration);return}c=true}var f=t.substring(i+8,s+(c?1:0));this.onDoctype(f);i=s+(c?2:1)}else{this.onError(l.MalformedElement);return}break;default:var d=this._parseContent(t,i);if(d===null){this.onError(l.MalformedElement);return}var h=false;if(t.substring(i+d.parsed,i+d.parsed+2)==="/>"){h=true}else if(t.substring(i+d.parsed,i+d.parsed+1)!==">"){this.onError(l.UnterminatedElement);return}this.onBeginElement(d.name,d.attributes,h);i+=d.parsed+(h?2:1);break}}else{while(i0}},{key:"firstChild",get:function e(){return this.childNodes[0]}},{key:"nextSibling",get:function e(){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]}},{key:"textContent",get:function e(){if(!this.childNodes){return this.nodeValue||""}return this.childNodes.map(function(e){return e.textContent}).join("")}}]);return e}();var v=function(e){o(t,e);function t(){u(this,t);var e=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e._currentFragment=null;e._stack=null;e._errorCode=l.NoError;return e}a(t,[{key:"parseFromString",value:function e(t){this._currentFragment=[];this._stack=[];this._errorCode=l.NoError;this.parseXml(t);if(this._errorCode!==l.NoError){return undefined}var r=n(this._currentFragment,1),i=r[0];if(!i){return undefined}return{documentElement:i}}},{key:"onResolveEntity",value:function e(r){switch(r){case"apos":return"'"}return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onResolveEntity",this).call(this,r)}},{key:"onText",value:function e(t){if(f(t)){return}var r=new h("#text",t);this._currentFragment.push(r)}},{key:"onCdata",value:function e(t){var r=new h("#text",t);this._currentFragment.push(r)}},{key:"onBeginElement",value:function e(t,r,n){var i=new h(t);i.childNodes=[];this._currentFragment.push(i);if(n){return}this._stack.push(this._currentFragment);this._currentFragment=i.childNodes}},{key:"onEndElement",value:function e(t){this._currentFragment=this._stack.pop();var r=this._currentFragment[this._currentFragment.length-1];for(var n=0,i=r.childNodes.length;n0){var i=new Uint8Array(n).buffer;this._queuedChunks.push(i)}this._pdfDataRangeTransport=t;this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._contentLength=e.length;this._fullRequestReader=null;this._rangeReaders=[];this._pdfDataRangeTransport.addRangeListener(function(e,t){r._onReceiveData({begin:e,chunk:t})});this._pdfDataRangeTransport.addProgressListener(function(e){r._onProgress({loaded:e})});this._pdfDataRangeTransport.addProgressiveReadListener(function(e){r._onReceiveData({chunk:e})});this._pdfDataRangeTransport.transportReady()}t.prototype={_onReceiveData:function e(t){var r=new Uint8Array(t.chunk).buffer;if(t.begin===undefined){if(this._fullRequestReader){this._fullRequestReader._enqueue(r)}else{this._queuedChunks.push(r)}}else{var n=this._rangeReaders.some(function(e){if(e._begin!==t.begin){return false}e._enqueue(r);return true});(0,a.assert)(n)}},_onProgress:function e(t){if(this._rangeReaders.length>0){var r=this._rangeReaders[0];if(r.onProgress){r.onProgress({loaded:t.loaded})}}},_removeRangeReader:function e(t){var r=this._rangeReaders.indexOf(t);if(r>=0){this._rangeReaders.splice(r,1)}},getFullReader:function e(){(0,a.assert)(!this._fullRequestReader);var t=this._queuedChunks;this._queuedChunks=null;return new r(this,t)},getRangeReader:function e(t,r){var i=new n(this,t,r);this._pdfDataRangeTransport.requestDataRange(t,r);this._rangeReaders.push(i);return i},cancelAllRequests:function e(t){if(this._fullRequestReader){this._fullRequestReader.cancel(t)}var r=this._rangeReaders.slice(0);r.forEach(function(e){e.cancel(t)});this._pdfDataRangeTransport.abort()}};function r(e,t){this._stream=e;this._done=false;this._filename=null;this._queuedChunks=t||[];this._requests=[];this._headersReady=Promise.resolve();e._fullRequestReader=this;this.onProgress=null}r.prototype={_enqueue:function e(t){if(this._done){return}if(this._requests.length>0){var r=this._requests.shift();r.resolve({value:t,done:false});return}this._queuedChunks.push(t)},get headersReady(){return this._headersReady},get filename(){return this._filename},get isRangeSupported(){return this._stream._isRangeSupported},get isStreamingSupported(){return this._stream._isStreamingSupported},get contentLength(){return this._stream._contentLength},read:function(){var e=o(i.default.mark(function e(){var t,r;return i.default.wrap(function e(n){while(1){switch(n.prev=n.next){case 0:if(!(this._queuedChunks.length>0)){n.next=3;break}t=this._queuedChunks.shift();return n.abrupt("return",{value:t,done:false});case 3:if(!this._done){n.next=5;break}return n.abrupt("return",{value:undefined,done:true});case 5:r=(0,a.createPromiseCapability)();this._requests.push(r);return n.abrupt("return",r.promise);case 8:case"end":return n.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),cancel:function e(t){this._done=true;this._requests.forEach(function(e){e.resolve({value:undefined,done:true})});this._requests=[]}};function n(e,t,r){this._stream=e;this._begin=t;this._end=r;this._queuedChunk=null;this._requests=[];this._done=false;this.onProgress=null}n.prototype={_enqueue:function e(t){if(this._done){return}if(this._requests.length===0){this._queuedChunk=t}else{var r=this._requests.shift();r.resolve({value:t,done:false});this._requests.forEach(function(e){e.resolve({value:undefined,done:true})});this._requests=[]}this._done=true;this._stream._removeRangeReader(this)},get isStreamingSupported(){return false},read:function(){var e=o(i.default.mark(function e(){var t,r;return i.default.wrap(function e(n){while(1){switch(n.prev=n.next){case 0:if(!this._queuedChunk){n.next=4;break}t=this._queuedChunk;this._queuedChunk=null;return n.abrupt("return",{value:t,done:false});case 4:if(!this._done){n.next=6;break}return n.abrupt("return",{value:undefined,done:true});case 6:r=(0,a.createPromiseCapability)();this._requests.push(r);return n.abrupt("return",r.promise);case 9:case"end":return n.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),cancel:function e(t){this._done=true;this._requests.forEach(function(e){e.resolve({value:undefined,done:true})});this._requests=[];this._stream._removeRangeReader(this)}};return t}();t.PDFDataTransportStream=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.WebGLContext=undefined;var n=function(){function e(e,t){for(var r=0;r1){if(c.vertical){o.canvasWidth=t.height*e._viewport.scale}else{o.canvasWidth=t.width*e._viewport.scale}}e._textDivProperties.set(a,o);if(e._textContentStream){e._layoutText(a)}if(e._enhanceTextSelection){var p=1,m=0;if(l!==0){p=Math.cos(l);m=Math.sin(l)}var g=(c.vertical?t.height:t.width)*e._viewport.scale;var y=f;var b,_;if(l!==0){b=[p,m,-m,p,h,v];_=n.Util.getAxialAlignedBoundingBox([0,0,g,y],b)}else{_=[h,v,h+g,v+y]}e._bounds.push({left:_[0],top:_[1],right:_[2],bottom:_[3],div:a,size:[g,y],m:b})}}function u(e){if(e._canceled){return}var r=e._textDivs;var n=e._capability;var i=r.length;if(i>t){e._renderingDone=true;n.resolve();return}if(!e._textContentStream){for(var a=0;a0){i=i?Math.min(s,i):s}}return i};var g=1+Math.min(Math.abs(d),Math.abs(h));o.paddingLeft=m(p,32,16)/g;o.paddingTop=m(p,48,16)/g;o.paddingRight=m(p,0,16)/g;o.paddingBottom=m(p,16,16)/g;e._textDivProperties.set(s,o)}}function c(e,t,r){var n=r.map(function(e,t){return{x1:e.left,y1:e.top,x2:e.right,y2:e.bottom,index:t,x1New:undefined,x2New:undefined}});f(e,n);var i=new Array(r.length);n.forEach(function(e){var t=e.index;i[t]={left:e.x1New,top:0,right:e.x2New,bottom:0}});r.map(function(t,r){var a=i[r],s=n[r];s.x1=t.top;s.y1=e-a.right;s.x2=t.bottom;s.y2=e-a.left;s.index=r;s.x1New=undefined;s.x2New=undefined});f(t,n);n.forEach(function(e){var t=e.index;i[t].top=e.x1New;i[t].bottom=e.x2New});return i}function f(e,t){t.sort(function(e,t){return e.x1-t.x1||e.index-t.index});var r={x1:-Infinity,y1:-Infinity,x2:0,y2:Infinity,index:-1,x1New:0,x2New:0};var n=[{start:-Infinity,end:Infinity,boundary:r}];t.forEach(function(e){var t=0;while(t=0&&n[r].start>=e.y2){r--}var i,a;var s,o,u=-Infinity;for(s=t;s<=r;s++){i=n[s];a=i.boundary;var l;if(a.x2>e.x1){l=a.index>e.index?a.x1New:e.x1}else if(a.x2New===undefined){l=(a.x2+e.x1)/2}else{l=a.x2New}if(l>u){u=l}}e.x1New=u;for(s=t;s<=r;s++){i=n[s];a=i.boundary;if(a.x2New===undefined){if(a.x2>e.x1){if(a.index>e.index){a.x2New=a.x2}}else{a.x2New=u}}else if(a.x2New>u){a.x2New=Math.max(u,a.x2)}}var c=[],f=null;for(s=t;s<=r;s++){i=n[s];a=i.boundary;var d=a.x2>e.x2?a:e;if(f===d){c[c.length-1].end=i.end}else{c.push({start:i.start,end:i.end,boundary:d});f=d}}if(n[t].start=0&&n[o].start>=a.y1;o--){h=n[o].boundary===a}for(o=r+1;!h&&o0){n.scale=n.canvasWidth/s;o="scaleX("+n.scale+")"}if(n.angle!==0){o="rotate("+n.angle+"deg) "+o}if(o!==""){n.originalTransform=o;t.style.transform=o}this._textDivProperties.set(t,n);r.appendChild(t)},_render:function e(t){var r=this;var i=(0,n.createPromiseCapability)();var a=Object.create(null);var s=document.createElement("canvas");s.mozOpaque=true;this._layoutTextCtx=s.getContext("2d",{alpha:false});if(this._textContent){var o=this._textContent.items;var l=this._textContent.styles;this._processItems(o,l);i.resolve()}else if(this._textContentStream){var c=function e(){r._reader.read().then(function(t){var n=t.value,s=t.done;if(s){i.resolve();return}Object.assign(a,n.styles);r._processItems(n.items,a);e()},i.reject)};this._reader=this._textContentStream.getReader();c()}else{throw new Error('Neither "textContent" nor "textContentStream"'+" parameters specified.")}i.promise.then(function(){a=null;if(!t){u(r)}else{r._renderTimer=setTimeout(function(){u(r);r._renderTimer=null},t)}},this._capability.reject)},expandTextDivs:function e(t){if(!this._enhanceTextSelection||!this._renderingDone){return}if(this._bounds!==null){l(this);this._bounds=null}for(var r=0,n=this._textDivs.length;r1&&arguments[1]!==undefined?arguments[1]:false;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;l(this,e);this.isRenderable=r;this.data=t.data;this.layer=t.layer;this.page=t.page;this.viewport=t.viewport;this.linkService=t.linkService;this.downloadManager=t.downloadManager;this.imageResourcesPath=t.imageResourcesPath;this.renderInteractiveForms=t.renderInteractiveForms;this.svgFactory=t.svgFactory;if(r){this.container=this._createContainer(n)}}i(e,[{key:"_createContainer",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var r=this.data,n=this.page,i=this.viewport;var a=document.createElement("section");var o=r.rect[2]-r.rect[0];var u=r.rect[3]-r.rect[1];a.setAttribute("data-annotation-id",r.id);var l=s.Util.normalizeRect([r.rect[0],n.view[3]-r.rect[1]+n.view[1],r.rect[2],n.view[3]-r.rect[3]+n.view[1]]);a.style.transform="matrix("+i.transform.join(",")+")";a.style.transformOrigin=-l[0]+"px "+-l[1]+"px";if(!t&&r.borderStyle.width>0){a.style.borderWidth=r.borderStyle.width+"px";if(r.borderStyle.style!==s.AnnotationBorderStyleType.UNDERLINE){o=o-2*r.borderStyle.width;u=u-2*r.borderStyle.width}var c=r.borderStyle.horizontalCornerRadius;var f=r.borderStyle.verticalCornerRadius;if(c>0||f>0){var d=c+"px / "+f+"px";a.style.borderRadius=d}switch(r.borderStyle.style){case s.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case s.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case s.AnnotationBorderStyleType.BEVELED:(0,s.warn)("Unimplemented border style: beveled");break;case s.AnnotationBorderStyleType.INSET:(0,s.warn)("Unimplemented border style: inset");break;case s.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid";break;default:break}if(r.color){a.style.borderColor=s.Util.makeCssRgb(r.color[0]|0,r.color[1]|0,r.color[2]|0)}else{a.style.borderWidth=0}}a.style.left=l[0]+"px";a.style.top=l[1]+"px";a.style.width=o+"px";a.style.height=u+"px";return a}},{key:"_createPopup",value:function e(t,r,n){if(!r){r=document.createElement("div");r.style.height=t.style.height;r.style.width=t.style.width;t.appendChild(r)}var i=new A({container:t,trigger:r,color:n.color,title:n.title,contents:n.contents,hideWrapper:true});var a=i.render();a.style.left=t.style.width;t.appendChild(a)}},{key:"render",value:function e(){(0,s.unreachable)("Abstract method `AnnotationElement.render` called")}}]);return e}();var d=function(e){u(t,e);function t(e){l(this,t);var r=!!(e.data.url||e.data.dest||e.data.action);return o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}i(t,[{key:"render",value:function e(){this.container.className="linkAnnotation";var t=this.data,r=this.linkService;var n=document.createElement("a");(0,a.addLinkAttributes)(n,{url:t.url,target:t.newWindow?a.LinkTarget.BLANK:r.externalLinkTarget,rel:r.externalLinkRel});if(!t.url){if(t.action){this._bindNamedAction(n,t.action)}else{this._bindLink(n,t.dest)}}this.container.appendChild(n);return this.container}},{key:"_bindLink",value:function e(t,r){var n=this;t.href=this.linkService.getDestinationHash(r);t.onclick=function(){if(r){n.linkService.navigateTo(r)}return false};if(r){t.className="internalLink"}}},{key:"_bindNamedAction",value:function e(t,r){var n=this;t.href=this.linkService.getAnchorUrl("");t.onclick=function(){n.linkService.executeNamedAction(r);return false};t.className="internalLink"}}]);return t}(f);var h=function(e){u(t,e);function t(e){l(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}i(t,[{key:"render",value:function e(){this.container.className="textAnnotation";var t=document.createElement("img");t.style.height=this.container.style.height;t.style.width=this.container.style.width;t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";t.alt="[{{type}} Annotation]";t.dataset.l10nId="text_annotation_type";t.dataset.l10nArgs=JSON.stringify({type:this.data.name});if(!this.data.hasPopup){this._createPopup(this.container,t,this.data)}this.container.appendChild(t);return this.container}}]);return t}(f);var v=function(e){u(t,e);function t(){l(this,t);return o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}i(t,[{key:"render",value:function e(){return this.container}}]);return t}(f);var p=function(e){u(t,e);function t(e){l(this,t);var r=e.renderInteractiveForms||!e.data.hasAppearance&&!!e.data.fieldValue;return o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}i(t,[{key:"render",value:function e(){var t=["left","center","right"];this.container.className="textWidgetAnnotation";var r=null;if(this.renderInteractiveForms){if(this.data.multiLine){r=document.createElement("textarea");r.textContent=this.data.fieldValue}else{r=document.createElement("input");r.type="text";r.setAttribute("value",this.data.fieldValue)}r.disabled=this.data.readOnly;if(this.data.maxLen!==null){r.maxLength=this.data.maxLen}if(this.data.comb){var n=this.data.rect[2]-this.data.rect[0];var i=n/this.data.maxLen;r.classList.add("comb");r.style.letterSpacing="calc("+i+"px - 1ch)"}}else{r=document.createElement("div");r.textContent=this.data.fieldValue;r.style.verticalAlign="middle";r.style.display="table-cell";var a=null;if(this.data.fontRefName){a=this.page.commonObjs.getData(this.data.fontRefName)}this._setTextStyle(r,a)}if(this.data.textAlignment!==null){r.style.textAlign=t[this.data.textAlignment]}this.container.appendChild(r);return this.container}},{key:"_setTextStyle",value:function e(t,r){var n=t.style;n.fontSize=this.data.fontSize+"px";n.direction=this.data.fontDirection<0?"rtl":"ltr";if(!r){return}n.fontWeight=r.black?r.bold?"900":"bold":r.bold?"bold":"normal";n.fontStyle=r.italic?"italic":"normal";var i=r.loadedName?'"'+r.loadedName+'", ':"";var a=r.fallbackName||"Helvetica, sans-serif";n.fontFamily=i+a}}]);return t}(v);var m=function(e){u(t,e);function t(e){l(this,t);return o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,e.renderInteractiveForms))}i(t,[{key:"render",value:function e(){this.container.className="buttonWidgetAnnotation checkBox";var t=document.createElement("input");t.disabled=this.data.readOnly;t.type="checkbox";if(this.data.fieldValue&&this.data.fieldValue!=="Off"){t.setAttribute("checked",true)}this.container.appendChild(t);return this.container}}]);return t}(v);var g=function(e){u(t,e);function t(e){l(this,t);return o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,e.renderInteractiveForms))}i(t,[{key:"render",value:function e(){this.container.className="buttonWidgetAnnotation radioButton";var t=document.createElement("input");t.disabled=this.data.readOnly;t.type="radio";t.name=this.data.fieldName;if(this.data.fieldValue===this.data.buttonValue){t.setAttribute("checked",true)}this.container.appendChild(t);return this.container}}]);return t}(v);var y=function(e){u(t,e);function t(){l(this,t);return o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}i(t,[{key:"render",value:function e(){var r=n(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"render",this).call(this);r.className="buttonWidgetAnnotation pushButton";return r}}]);return t}(d);var b=function(e){u(t,e);function t(e){l(this,t);return o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,e.renderInteractiveForms))}i(t,[{key:"render",value:function e(){this.container.className="choiceWidgetAnnotation";var t=document.createElement("select");t.disabled=this.data.readOnly;if(!this.data.combo){t.size=this.data.options.length;if(this.data.multiSelect){t.multiple=true}}for(var r=0,n=this.data.options.length;r0&&arguments[0]!==undefined?arguments[0]:false;if(t){this.pinned=true}if(this.hideElement.hasAttribute("hidden")){this.hideElement.removeAttribute("hidden");this.container.style.zIndex+=1}}},{key:"_hide",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;if(t){this.pinned=false}if(!this.hideElement.hasAttribute("hidden")&&!this.pinned){this.hideElement.setAttribute("hidden",true);this.container.style.zIndex-=1}}}]);return e}();var S=function(e){u(t,e);function t(e){l(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,true))}i(t,[{key:"render",value:function e(){this.container.className="lineAnnotation";var t=this.data;var r=t.rect[2]-t.rect[0];var n=t.rect[3]-t.rect[1];var i=this.svgFactory.create(r,n);var a=this.svgFactory.createElement("svg:line");a.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]);a.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]);a.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]);a.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]);a.setAttribute("stroke-width",t.borderStyle.width);a.setAttribute("stroke","transparent");i.appendChild(a);this.container.append(i);this._createPopup(this.container,a,t);return this.container}}]);return t}(f);var w=function(e){u(t,e);function t(e){l(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,true))}i(t,[{key:"render",value:function e(){this.container.className="squareAnnotation";var t=this.data;var r=t.rect[2]-t.rect[0];var n=t.rect[3]-t.rect[1];var i=this.svgFactory.create(r,n);var a=t.borderStyle.width;var s=this.svgFactory.createElement("svg:rect");s.setAttribute("x",a/2);s.setAttribute("y",a/2);s.setAttribute("width",r-a);s.setAttribute("height",n-a);s.setAttribute("stroke-width",a);s.setAttribute("stroke","transparent");s.setAttribute("fill","none");i.appendChild(s);this.container.append(i);this._createPopup(this.container,s,t);return this.container}}]);return t}(f);var k=function(e){u(t,e);function t(e){l(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,true))}i(t,[{key:"render",value:function e(){this.container.className="circleAnnotation";var t=this.data;var r=t.rect[2]-t.rect[0];var n=t.rect[3]-t.rect[1];var i=this.svgFactory.create(r,n);var a=t.borderStyle.width;var s=this.svgFactory.createElement("svg:ellipse");s.setAttribute("cx",r/2);s.setAttribute("cy",n/2);s.setAttribute("rx",r/2-a/2);s.setAttribute("ry",n/2-a/2);s.setAttribute("stroke-width",a);s.setAttribute("stroke","transparent");s.setAttribute("fill","none");i.appendChild(s);this.container.append(i);this._createPopup(this.container,s,t);return this.container}}]);return t}(f);var P=function(e){u(t,e);function t(e){l(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,true));n.containerClassName="polylineAnnotation";n.svgElementName="svg:polyline";return n}i(t,[{key:"render",value:function e(){this.container.className=this.containerClassName;var t=this.data;var r=t.rect[2]-t.rect[0];var n=t.rect[3]-t.rect[1];var i=this.svgFactory.create(r,n);var a=t.vertices;var s=[];for(var o=0,u=a.length;o>1&2147483647}else{o=o>>1&2147483647}}i[a]=o}function l(e,t,r){var n=-1;for(var a=t;a>>8^o}return n^-1}function c(e,t,r,n){var i=n;var a=t.length;r[i]=a>>24&255;r[i+1]=a>>16&255;r[i+2]=a>>8&255;r[i+3]=a&255;i+=4;r[i]=e.charCodeAt(0)&255;r[i+1]=e.charCodeAt(1)&255;r[i+2]=e.charCodeAt(2)&255;r[i+3]=e.charCodeAt(3)&255;i+=4;r.set(t,i);i+=t.length;var s=l(r,n+4,i);r[i]=s>>24&255;r[i+1]=s>>16&255;r[i+2]=s>>8&255;r[i+3]=s&255}function f(e,t,r){var n=1;var i=0;for(var a=t;a=8){t=e}else{t=new Buffer(e)}var r=require("zlib").deflateSync(t,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(e){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return h(e)}function h(e){var t=e.length;var r=65535;var n=Math.ceil(t/r);var i=new Uint8Array(2+t+n*5+4);var a=0;i[a++]=120;i[a++]=156;var s=0;while(t>r){i[a++]=0;i[a++]=255;i[a++]=255;i[a++]=0;i[a++]=0;i.set(e.subarray(s,s+r),a);a+=r;s+=r;t-=r}i[a++]=1;i[a++]=t&255;i[a++]=t>>8&255;i[a++]=~t&65535&255;i[a++]=(~t&65535)>>8&255;i.set(e.subarray(s),a);a+=e.length-s;var o=f(e,0,e.length);i[a++]=o>>24&255;i[a++]=o>>16&255;i[a++]=o>>8&255;i[a++]=o&255;return i}function v(e,i,a,s){var o=e.width;var u=e.height;var l,f,h;var v=e.data;switch(i){case n.ImageKind.GRAYSCALE_1BPP:f=0;l=1;h=o+7>>3;break;case n.ImageKind.RGB_24BPP:f=2;l=8;h=o*3;break;case n.ImageKind.RGBA_32BPP:f=6;l=8;h=o*4;break;default:throw new Error("invalid format")}var p=new Uint8Array((1+h)*u);var m=0,g=0;var y,b;for(y=0;y>24&255,o>>16&255,o>>8&255,o&255,u>>24&255,u>>16&255,u>>8&255,u&255,l,f,0,0,0]);var A=d(p);var S=t.length+r*3+_.length+A.length;var w=new Uint8Array(S);var k=0;w.set(t,k);k+=t.length;c("IHDR",_,w,k);k+=r+_.length;c("IDATA",A,w,k);k+=r+A.length;c("IEND",new Uint8Array(0),w,k);return(0,n.createObjectURL)(w,"image/png",a)}return function e(t,r,i){var a=t.kind===undefined?n.ImageKind.GRAYSCALE_1BPP:t.kind;return v(t,a,r,i)}}();var f=function e(){function t(){this.fontSizeScale=1;this.fontWeight=l.fontWeight;this.fontSize=0;this.textMatrix=n.IDENTITY_MATRIX;this.fontMatrix=n.FONT_IDENTITY_MATRIX;this.leading=0;this.textRenderingMode=n.TextRenderingMode.FILL;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRise=0;this.fillColor=l.fillColor;this.strokeColor="#000000";this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.lineJoin="";this.lineCap="";this.miterLimit=0;this.dashArray=[];this.dashPhase=0;this.dependencies=[];this.activeClipUrl=null;this.clipGroup=null;this.maskId=""}t.prototype={clone:function e(){return Object.create(this)},setCurrentPoint:function e(t,r){this.x=t;this.y=r}};return t}();t.SVGGraphics=u=function e(){function t(e){var t=[];var r=[];var n=e.length;for(var i=0;i0,"Range chunk size must be larger than zero");var s={allowRangeRequests:false,suggestedLength:undefined};var o=parseInt(t("Content-Length"),10);if(!Number.isInteger(o)){return s}s.suggestedLength=o;if(o<=2*i){return s}if(a||!r){return s}if(t("Accept-Ranges")!=="bytes"){return s}var u=t("Content-Encoding")||"identity";if(u!=="identity"){return s}s.allowRangeRequests=true;return s}function s(e){var t=e("Content-Disposition");if(t){var r=(0,i.getFilenameFromContentDispositionHeader)(t);if(/\.pdf$/i.test(r)){return r}}return null}function o(e,t){if(e===404||e===0&&/^file:/.test(t)){return new n.MissingPDFException('Missing PDF "'+t+'".')}return new n.UnexpectedResponseException("Unexpected server response ("+e+') while retrieving PDF "'+t+'".',e)}function u(e){return e===200||e===206}t.createResponseStatusError=o;t.extractFilenameFromHeader=s;t.validateRangeRequestCapabilities=a;t.validateResponseStatus=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){var r=[];var n=true;var i=false;var a=undefined;try{for(var s=e[Symbol.iterator](),o;!(n=(o=s.next()).done);n=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw a}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function i(e){var t=true;var r=o("filename\\*","i").exec(e);if(r){r=r[1];var i=f(r);i=unescape(i);i=d(i);i=h(i);return l(i)}r=c(e);if(r){var a=h(r);return l(a)}r=o("filename","i").exec(e);if(r){r=r[1];var s=f(r);s=h(s);return l(s)}function o(e,t){return new RegExp("(?:^|;)\\s*"+e+"\\s*=\\s*"+"("+'[^";\\s][^;\\s]*'+"|"+'"(?:[^"\\\\]|\\\\"?)+"?'+")",t)}function u(e,r){if(e){if(!/^[\x00-\xFF]+$/.test(r)){return r}try{var n=new TextDecoder(e,{fatal:true});var i=new Array(r.length);for(var a=0;a=2&&n.onHeadersReceived){n.onHeadersReceived();delete n.onHeadersReceived}if(i.readyState!==4){return}if(!(t in this.pendingRequests)){return}delete this.pendingRequests[t];if(i.status===0&&this.isHttp){if(n.onError){n.onError(i.status)}return}var a=i.status||f;var s=a===f&&n.expectedStatus===d;if(!s&&a!==n.expectedStatus){if(n.onError){n.onError(i.status)}return}this.loadedRequests[t]=true;var o=v(i);if(a===d){var u=i.getResponseHeader("Content-Range");var l=/bytes (\d+)-(\d+)\/(\d+)/.exec(u);var c=parseInt(l[1],10);n.onDone({begin:c,chunk:o})}else if(n.onProgressiveData){n.onDone(null)}else if(o){n.onDone({begin:0,chunk:o})}else if(n.onError){n.onError(i.status)}},hasPendingRequests:function e(){for(var t in this.pendingRequests){return true}return false},getRequestXhr:function e(t){return this.pendingRequests[t].xhr},isStreamingRequest:function e(t){return!!this.pendingRequests[t].onProgressiveData},isPendingRequest:function e(t){return t in this.pendingRequests},isLoadedRequest:function e(t){return t in this.loadedRequests},abortAllRequests:function e(){for(var t in this.pendingRequests){this.abortRequest(t|0)}},abortRequest:function e(t){var r=this.pendingRequests[t].xhr;delete this.pendingRequests[t];r.abort()}};function m(e){this._source=e;this._manager=new h(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials});this._rangeChunkSize=e.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}m.prototype={_onRangeRequestReaderClosed:function e(t){var r=this._rangeRequestReaders.indexOf(t);if(r>=0){this._rangeRequestReaders.splice(r,1)}},getFullReader:function e(){(0,a.assert)(!this._fullRequestReader);this._fullRequestReader=new g(this._manager,this._source);return this._fullRequestReader},getRangeReader:function e(t,r){var n=new y(this._manager,t,r);n.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(n);return n},cancelAllRequests:function e(t){if(this._fullRequestReader){this._fullRequestReader.cancel(t)}var r=this._rangeRequestReaders.slice(0);r.forEach(function(e){e.cancel(t)})}};function g(e,t){this._manager=e;var r={onHeadersReceived:this._onHeadersReceived.bind(this),onProgressiveData:t.disableStream?null:this._onProgressiveData.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._fullRequestId=e.requestFull(r);this._headersReceivedCapability=(0,a.createPromiseCapability)();this._disableRange=t.disableRange||false;this._contentLength=t.length;this._rangeChunkSize=t.rangeChunkSize;if(!this._rangeChunkSize&&!this._disableRange){this._disableRange=true}this._isStreamingSupported=false;this._isRangeSupported=false;this._cachedChunks=[];this._requests=[];this._done=false;this._storedError=undefined;this._filename=null;this.onProgress=null}g.prototype={_onHeadersReceived:function e(){var t=this._fullRequestId;var r=this._manager.getRequestXhr(t);var n=function e(t){return r.getResponseHeader(t)};var i=(0,s.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),a=i.allowRangeRequests,o=i.suggestedLength;if(a){this._isRangeSupported=true}this._contentLength=o||this._contentLength;this._filename=(0,s.extractFilenameFromHeader)(n);var u=this._manager;if(u.isStreamingRequest(t)){this._isStreamingSupported=true}else if(this._isRangeSupported){u.abortRequest(t)}this._headersReceivedCapability.resolve()},_onProgressiveData:function e(t){if(this._requests.length>0){var r=this._requests.shift();r.resolve({value:t,done:false})}else{this._cachedChunks.push(t)}},_onDone:function e(t){if(t){this._onProgressiveData(t.chunk)}this._done=true;if(this._cachedChunks.length>0){return}this._requests.forEach(function(e){e.resolve({value:undefined,done:true})});this._requests=[]},_onError:function e(t){var r=this._url;var n=(0,s.createResponseStatusError)(t,r);this._storedError=n;this._headersReceivedCapability.reject(n);this._requests.forEach(function(e){e.reject(n)});this._requests=[];this._cachedChunks=[]},_onProgress:function e(t){if(this.onProgress){this.onProgress({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}},get filename(){return this._filename},get isRangeSupported(){return this._isRangeSupported},get isStreamingSupported(){return this._isStreamingSupported},get contentLength(){return this._contentLength},get headersReady(){return this._headersReceivedCapability.promise},read:function(){var e=c(i.default.mark(function e(){var t,r;return i.default.wrap(function e(n){while(1){switch(n.prev=n.next){case 0:if(!this._storedError){n.next=2;break}throw this._storedError;case 2:if(!(this._cachedChunks.length>0)){n.next=5;break}t=this._cachedChunks.shift();return n.abrupt("return",{value:t,done:false});case 5:if(!this._done){n.next=7;break}return n.abrupt("return",{value:undefined,done:true});case 7:r=(0,a.createPromiseCapability)();this._requests.push(r);return n.abrupt("return",r.promise);case 10:case"end":return n.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),cancel:function e(t){this._done=true;this._headersReceivedCapability.reject(t);this._requests.forEach(function(e){e.resolve({value:undefined,done:true})});this._requests=[];if(this._manager.isPendingRequest(this._fullRequestId)){this._manager.abortRequest(this._fullRequestId)}this._fullRequestReader=null}};function y(e,t,r){this._manager=e;var n={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=e.requestRange(t,r,n);this._requests=[];this._queuedChunk=null;this._done=false;this.onProgress=null;this.onClosed=null}y.prototype={_close:function e(){if(this.onClosed){this.onClosed(this)}},_onDone:function e(t){var r=t.chunk;if(this._requests.length>0){var n=this._requests.shift();n.resolve({value:r,done:false})}else{this._queuedChunk=r}this._done=true;this._requests.forEach(function(e){e.resolve({value:undefined,done:true})});this._requests=[];this._close()},_onProgress:function e(t){if(!this.isStreamingSupported&&this.onProgress){this.onProgress({loaded:t.loaded})}},get isStreamingSupported(){return false},read:function(){var e=c(i.default.mark(function e(){var t,r;return i.default.wrap(function e(n){while(1){switch(n.prev=n.next){case 0:if(!(this._queuedChunk!==null)){n.next=4;break}t=this._queuedChunk;this._queuedChunk=null;return n.abrupt("return",{value:t,done:false});case 4:if(!this._done){n.next=6;break}return n.abrupt("return",{value:undefined,done:true});case 6:r=(0,a.createPromiseCapability)();this._requests.push(r);return n.abrupt("return",r.promise);case 9:case"end":return n.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),cancel:function e(t){this._done=true;this._requests.forEach(function(e){e.resolve({value:undefined,done:true})});this._requests=[];if(this._manager.isPendingRequest(this._requestId)){this._manager.abortRequest(this._requestId)}this._close()}};t.PDFNetworkStream=m;t.NetworkManager=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SimpleLinkService=t.PDFLinkService=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){function e(e,t){for(var r=0;r0&&arguments[0]!==undefined?arguments[0]:{},r=t.eventBus,n=t.externalLinkTarget,i=n===undefined?null:n,s=t.externalLinkRel,u=s===undefined?null:s;o(this,e);this.eventBus=r||(0,a.getGlobalEventBus)();this.externalLinkTarget=i;this.externalLinkRel=u;this.baseUrl=null;this.pdfDocument=null;this.pdfViewer=null;this.pdfHistory=null;this._pagesRefCache=null}i(e,[{key:"setDocument",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;this.baseUrl=r;this.pdfDocument=t;this._pagesRefCache=Object.create(null)}},{key:"setViewer",value:function e(t){this.pdfViewer=t}},{key:"setHistory",value:function e(t){this.pdfHistory=t}},{key:"navigateTo",value:function e(t){var r=this;var n=function e(n){var i=n.namedDest,a=n.explicitDest;var s=a[0],o=void 0;if(s instanceof Object){o=r._cachedPageNumber(s);if(o===null){r.pdfDocument.getPageIndex(s).then(function(t){r.cachePageRef(t+1,s);e({namedDest:i,explicitDest:a})}).catch(function(){console.error('PDFLinkService.navigateTo: "'+s+'" is not '+('a valid page reference, for dest="'+t+'".'))});return}}else if(Number.isInteger(s)){o=s+1}else{console.error('PDFLinkService.navigateTo: "'+s+'" is not '+('a valid destination reference, for dest="'+t+'".'));return}if(!o||o<1||o>r.pagesCount){console.error('PDFLinkService.navigateTo: "'+o+'" is not '+('a valid page number, for dest="'+t+'".'));return}if(r.pdfHistory){r.pdfHistory.pushCurrentPosition();r.pdfHistory.push({namedDest:i,explicitDest:a,pageNumber:o})}r.pdfViewer.scrollPageIntoView({pageNumber:o,destArray:a})};new Promise(function(e,n){if(typeof t==="string"){r.pdfDocument.getDestination(t).then(function(r){e({namedDest:t,explicitDest:r})});return}e({namedDest:"",explicitDest:t})}).then(function(e){if(!Array.isArray(e.explicitDest)){console.error('PDFLinkService.navigateTo: "'+e.explicitDest+'" is'+(' not a valid destination array, for dest="'+t+'".'));return}n(e)})}},{key:"getDestinationHash",value:function e(t){if(typeof t==="string"){return this.getAnchorUrl("#"+escape(t))}if(Array.isArray(t)){var r=JSON.stringify(t);return this.getAnchorUrl("#"+escape(r))}return this.getAnchorUrl("")}},{key:"getAnchorUrl",value:function e(t){return(this.baseUrl||"")+t}},{key:"setHash",value:function e(t){var r=void 0,n=void 0;if(t.includes("=")){var i=(0,s.parseQueryString)(t);if("search"in i){this.eventBus.dispatch("findfromurlhash",{source:this,query:i["search"].replace(/"/g,""),phraseSearch:i["phrase"]==="true"})}if("nameddest"in i){this.navigateTo(i.nameddest);return}if("page"in i){r=i.page|0||1}if("zoom"in i){var a=i.zoom.split(",");var o=a[0];var u=parseFloat(o);if(!o.includes("Fit")){n=[null,{name:"XYZ"},a.length>1?a[1]|0:null,a.length>2?a[2]|0:null,u?u/100:o]}else{if(o==="Fit"||o==="FitB"){n=[null,{name:o}]}else if(o==="FitH"||o==="FitBH"||o==="FitV"||o==="FitBV"){n=[null,{name:o},a.length>1?a[1]|0:null]}else if(o==="FitR"){if(a.length!==5){console.error('PDFLinkService.setHash: Not enough parameters for "FitR".')}else{n=[null,{name:o},a[1]|0,a[2]|0,a[3]|0,a[4]|0]}}else{console.error('PDFLinkService.setHash: "'+o+'" is not '+"a valid zoom value.")}}}if(n){this.pdfViewer.scrollPageIntoView({pageNumber:r||this.page,destArray:n,allowNegativeOffset:true})}else if(r){this.page=r}if("pagemode"in i){this.eventBus.dispatch("pagemode",{source:this,mode:i.pagemode})}}else{n=unescape(t);try{n=JSON.parse(n);if(!Array.isArray(n)){n=n.toString()}}catch(e){}if(typeof n==="string"||l(n)){this.navigateTo(n);return}console.error('PDFLinkService.setHash: "'+unescape(t)+'" is not '+"a valid destination.")}}},{key:"executeNamedAction",value:function e(t){switch(t){case"GoBack":if(this.pdfHistory){this.pdfHistory.back()}break;case"GoForward":if(this.pdfHistory){this.pdfHistory.forward()}break;case"NextPage":if(this.page1){this.page--}break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break;default:break}this.eventBus.dispatch("namedaction",{source:this,action:t})}},{key:"cachePageRef",value:function e(t,r){if(!r){return}var n=r.num+" "+r.gen+" R";this._pagesRefCache[n]=t}},{key:"_cachedPageNumber",value:function e(t){var r=t.num+" "+t.gen+" R";return this._pagesRefCache&&this._pagesRefCache[r]||null}},{key:"pagesCount",get:function e(){return this.pdfDocument?this.pdfDocument.numPages:0}},{key:"page",get:function e(){return this.pdfViewer.currentPageNumber},set:function e(t){this.pdfViewer.currentPageNumber=t}},{key:"rotation",get:function e(){return this.pdfViewer.pagesRotation},set:function e(t){this.pdfViewer.pagesRotation=t}}]);return e}();function l(e){if(!Array.isArray(e)){return false}var t=e.length,r=true;if(t<2){return false}var i=e[0];if(!((typeof i==="undefined"?"undefined":n(i))==="object"&&Number.isInteger(i.num)&&Number.isInteger(i.gen))&&!(Number.isInteger(i)&&i>=0)){return false}var a=e[1];if(!((typeof a==="undefined"?"undefined":n(a))==="object"&&typeof a.name==="string")){return false}switch(a.name){case"XYZ":if(t!==5){return false}break;case"Fit":case"FitB":return t===2;case"FitH":case"FitBH":case"FitV":case"FitBV":if(t!==3){return false}break;case"FitR":if(t!==6){return false}r=false;break;default:return false}for(var s=2;s0&&arguments[0]!==undefined?arguments[0]:false;if(!a){a=new n.EventBus({dispatchToDOM:e});if(!e){i(a)}}return a}t.attachDOMEventsToEventBus=i;t.getGlobalEventBus=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.moveToEndOfArray=t.waitOnEventOrTimeout=t.WaitOnType=t.animationStarted=t.normalizeWheelEventDelta=t.binarySearchFirstItem=t.watchScroll=t.scrollIntoView=t.getOutputScale=t.approximateFraction=t.getPageSizeInches=t.roundToDivide=t.getVisibleElements=t.backtrackBeforeAllVisibleElements=t.parseQueryString=t.noContextMenuHandler=t.getPDFFileNameFromURL=t.ProgressBar=t.EventBus=t.NullL10n=t.TextLayerMode=t.RendererType=t.PresentationModeState=t.isPortraitOrientation=t.isValidRotation=t.VERTICAL_PADDING=t.SCROLLBAR_PADDING=t.MAX_AUTO_SCALE=t.UNKNOWN_SCALE=t.MAX_SCALE=t.MIN_SCALE=t.DEFAULT_SCALE=t.DEFAULT_SCALE_VALUE=t.CSS_UNITS=undefined;var n=r(137);var i=u(n);var a=function(){function e(e,t){for(var r=0;r2&&arguments[2]!==undefined?arguments[2]:false;var n=e.offsetParent;if(!n){console.error("offsetParent is not set -- cannot scroll");return}var i=e.offsetTop+e.clientTop;var a=e.offsetLeft+e.clientLeft;while(n.clientHeight===n.scrollHeight&&n.clientWidth===n.scrollWidth||r&&getComputedStyle(n).overflow==="hidden"){if(n.dataset._scaleY){i/=n.dataset._scaleY;a/=n.dataset._scaleX}i+=n.offsetTop;a+=n.offsetLeft;n=n.offsetParent;if(!n){return}}if(t){if(t.top!==undefined){i+=t.top}if(t.left!==undefined){a+=t.left;n.scrollLeft=a}}n.scrollTop=i}function x(e,t){var r=function r(a){if(i){return}i=window.requestAnimationFrame(function r(){i=null;var a=e.scrollLeft;var s=n.lastX;if(a!==s){n.right=a>s}n.lastX=a;var o=e.scrollTop;var u=n.lastY;if(o!==u){n.down=o>u}n.lastY=o;t(n)})};var n={right:true,down:true,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:r};var i=null;e.addEventListener("scroll",r,true);return n}function R(e){var t=e.split("&");var r=Object.create(null);for(var n=0,i=t.length;n1?a[1]:null;r[decodeURIComponent(s)]=decodeURIComponent(o)}return r}function E(e,t){var r=0;var n=e.length-1;if(e.length===0||!t(e[n])){return e.length}if(t(e[r])){return r}while(r>1;var a=e[i];if(t(a)){n=i}else{r=i+1}}return r}function T(e){if(Math.floor(e)===e){return[e,1]}var t=1/e;var r=8;if(t>r){return[1,r]}else if(Math.floor(t)===t){return[1,t]}var n=e>1?t:e;var i=0,a=1,s=1,o=1;while(true){var u=i+s,l=a+o;if(l>r){break}if(n<=u/l){s=u;o=l}else{i=u;a=l}}var c=void 0;if(n-i/a=r){n=t[e-1].div;i=n.offsetTop+n.clientTop}for(var a=e-2;a>=0;--a){n=t[a].div;if(n.offsetTop+n.clientTop+n.clientHeight<=i){break}e=a}return e}function F(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var i=e.scrollTop,a=i+e.clientHeight;var s=e.scrollLeft,o=s+e.clientWidth;function u(e){var t=e.div;var r=t.offsetTop+t.clientTop+t.clientHeight;return r>i}function l(e){var t=e.div;var r=t.offsetLeft+t.clientLeft+t.clientWidth;return r>s}var c=[],f=void 0,d=void 0;var h=void 0,v=void 0,p=void 0,m=void 0;var g=void 0,y=void 0,b=void 0,_=void 0;var A=void 0;var S=t.length===0?0:E(t,n?l:u);if(t.length>0&&!n){S=I(S,t,i)}var w=n?o:-1;for(var k=S,P=t.length;k=a){w=p}}else if((n?g:h)>w){break}if(p<=i||h>=a||b<=s||g>=o){continue}m=Math.max(0,i-h)+Math.max(0,p-a);_=Math.max(0,s-g)+Math.max(0,b-o);A=(v-m)*(y-_)*100/v/y|0;c.push({id:f.id,x:g,y:h,view:f,percent:A})}var C=c[0];var x=c[c.length-1];if(r){c.sort(function(e,t){var r=e.percent-t.percent;if(Math.abs(r)>.001){return-r}return e.id-t.id})}return{first:C,last:x,views:c}}function M(e){e.preventDefault()}function j(e){var t=0,r=e.length;while(t1&&arguments[1]!==undefined?arguments[1]:"document.pdf";if(typeof e!=="string"){return t}if(j(e)){console.warn("getPDFFileNameFromURL: "+'ignoring "data:" URL for performance reasons.');return t}var r=/^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/;var n=/[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i;var i=r.exec(e);var a=n.exec(i[1])||n.exec(i[2])||n.exec(i[3]);if(a){a=a[0];if(a.includes("%")){try{a=n.exec(decodeURIComponent(a))[0]}catch(e){}}}return a||t}function N(e){var t=Math.sqrt(e.deltaX*e.deltaX+e.deltaY*e.deltaY);var r=Math.atan2(e.deltaY,e.deltaX);if(-.25*Math.PI=0)){throw new Error("waitOnEventOrTimeout - invalid parameters.")}function a(n){if(t instanceof G){t.off(r,o)}else{t.removeEventListener(r,o)}if(l){clearTimeout(l)}e(n)}var o=a.bind(null,U.EVENT);if(t instanceof G){t.on(r,o)}else{t.addEventListener(r,o)}var u=a.bind(null,U.TIMEOUT);var l=setTimeout(u,i)})}var z=new Promise(function(e){window.requestAnimationFrame(e)});var G=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},r=t.dispatchToDOM,n=r===undefined?false:r;l(this,e);this._listeners=Object.create(null);this._dispatchToDOM=n===true}a(e,[{key:"on",value:function e(t,r){var n=this._listeners[t];if(!n){n=[];this._listeners[t]=n}n.push(r)}},{key:"off",value:function e(t,r){var n=this._listeners[t];var i=void 0;if(!n||(i=n.indexOf(r))<0){return}n.splice(i,1)}},{key:"dispatch",value:function e(t){var r=this._listeners[t];if(!r||r.length===0){if(this._dispatchToDOM){var n=Array.prototype.slice.call(arguments,1);this._dispatchDOMEvent(t,n)}return}var i=Array.prototype.slice.call(arguments,1);r.slice(0).forEach(function(e){e.apply(null,i)});if(this._dispatchToDOM){this._dispatchDOMEvent(t,i)}}},{key:"_dispatchDOMEvent",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(!this._dispatchToDOM){return}var n=Object.create(null);if(r&&r.length>0){var i=r[0];for(var a in i){var s=i[a];if(a==="source"){if(s===window||s===document){return}continue}n[a]=s}}var o=document.createEvent("CustomEvent");o.initCustomEvent(t,true,true,n);document.dispatchEvent(o)}}]);return e}();function H(e,t,r){return Math.min(Math.max(e,t),r)}var X=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.height,i=r.width,a=r.units;l(this,e);this.visible=true;this.div=document.querySelector(t+" .progress");this.bar=this.div.parentNode;this.height=n||100;this.width=i||100;this.units=a||"%";this.div.style.height=this.height+this.units;this.percent=0}a(e,[{key:"_updateBar",value:function e(){if(this._indeterminate){this.div.classList.add("indeterminate");this.div.style.width=this.width+this.units;return}this.div.classList.remove("indeterminate");var t=this.width*this._percent/100;this.div.style.width=t+this.units}},{key:"setWidth",value:function e(t){if(!t){return}var r=t.parentNode;var n=r.offsetWidth-t.offsetWidth;if(n>0){this.bar.setAttribute("style","width: calc(100% - "+n+"px);")}}},{key:"hide",value:function e(){if(!this.visible){return}this.visible=false;this.bar.classList.add("hidden");document.body.classList.remove("loadingInProgress")}},{key:"show",value:function e(){if(this.visible){return}this.visible=true;document.body.classList.add("loadingInProgress");this.bar.classList.remove("hidden")}},{key:"percent",get:function e(){return this._percent},set:function e(t){this._indeterminate=isNaN(t);this._percent=H(t,0,100);this._updateBar()}}]);return e}();function Y(e,t){var r=[],n=e.length;var i=0;for(var a=0;a