/** * @licstart The following is the entire license notice for the * Javascript code in this page * * Copyright 2022 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @licend The above is the entire license notice for the * Javascript code in this page */ !function webpackUniversalModuleDefinition(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("pdfjs-dist/image_decoders/pdf.image_decoders",[],r):"object"==typeof exports?exports["pdfjs-dist/image_decoders/pdf.image_decoders"]=r():t["pdfjs-dist/image_decoders/pdf.image_decoders"]=t.pdfjsImageDecoders=r()}(this,(function(){return(()=>{"use strict";var t=[,(t,r,i)=>{Object.defineProperty(r,"__esModule",{value:!0});r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.UNSUPPORTED_FEATURES=r.TextRenderingMode=r.StreamType=r.RenderingIntentFlag=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.IsLittleEndianCached=r.IsEvalSupportedCached=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FontType=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.AnnotationType=r.AnnotationStateModelType=r.AnnotationReviewState=r.AnnotationReplyType=r.AnnotationMode=r.AnnotationMarkedState=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0;r.arrayByteLength=arrayByteLength;r.arraysToBytes=function arraysToBytes(t){var r=t.length;if(1===r&&t[0]instanceof Uint8Array)return t[0];for(var i=0,o=0;o1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){var o=t.match(/\./g);o&&o.length>=2&&(t="http://".concat(t))}if(i.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}var a=r?new URL(t,r):new URL(t);if(_isValidProtocol(a))return a}catch(t){}return null};r.escapeString=function escapeString(t){return t.replace(/([()\\\n\r])/g,(function(t){return"\n"===t?"\\n":"\r"===t?"\\r":"\\".concat(t)}))};r.getModificationDate=function getModificationDate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")];return r.join("")};r.getVerbosityLevel=function getVerbosityLevel(){return a};r.info=function info(t){a>=o.INFOS&&console.log("Info: ".concat(t))};r.isArrayBuffer=function isArrayBuffer(t){return"object"===_typeof(t)&&null!==t&&void 0!==t.byteLength};r.isArrayEqual=function isArrayEqual(t,r){if(t.length!==r.length)return!1;for(var i=0,o=t.length;i=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,l=!0,u=!1;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();l=t.done;return t},e:function e(t){u=!0;c=t},f:function f(){try{l||null==i.return||i.return()}finally{if(u)throw c}}}}(t);try{for(o.s();!(r=o.n()).done;){var a=(u=r.value,h=2,function _arrayWithHoles(t){if(Array.isArray(t))return t}(u)||function _iterableToArrayLimit(t,r){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var o,a,c=[],l=!0,u=!1;try{for(i=i.call(t);!(l=(o=i.next()).done);l=!0){c.push(o.value);if(r&&c.length===r)break}}catch(t){u=!0;a=t}finally{try{l||null==i.return||i.return()}finally{if(u)throw a}}return c}(u,h)||_unsupportedIterableToArray(u,h)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=a[0],l=a[1];i[c]=l}}catch(t){o.e(t)}finally{o.f()}var u,h;return i};r.objectSize=function objectSize(t){return Object.keys(t).length};r.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(a=t)};r.shadow=shadow;r.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};r.stringToBytes=stringToBytes;r.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){var r;"þ"===t[0]&&"ÿ"===t[1]?r="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?r="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(r="utf-8");if(r)try{var i=new TextDecoder(r,{fatal:!0}),o=stringToBytes(t);return i.decode(o)}catch(t){warn('stringToPDFString: "'.concat(t,'".'))}}for(var a=[],c=0,l=t.length;c>8&255),String.fromCharCode(255&a))}return r.join("")};r.stringToUTF8String=stringToUTF8String;r.unreachable=unreachable;r.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};r.warn=warn;i(2);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);return"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i=o.WARNINGS&&console.log("Warning: ".concat(t))}function unreachable(t){throw new Error(t)}function _isValidProtocol(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function shadow(t,r,i){Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!1});return i}var c=function BaseExceptionClosure(){function BaseException(t,r){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=r}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();r.BaseException=c;var l=function(t){_inherits(PasswordException,t);var r=_createSuper(PasswordException);function PasswordException(t,i){var o;_classCallCheck(this,PasswordException);(o=r.call(this,t,"PasswordException")).code=i;return o}return _createClass(PasswordException)}(c);r.PasswordException=l;var u=function(t){_inherits(UnknownErrorException,t);var r=_createSuper(UnknownErrorException);function UnknownErrorException(t,i){var o;_classCallCheck(this,UnknownErrorException);(o=r.call(this,t,"UnknownErrorException")).details=i;return o}return _createClass(UnknownErrorException)}(c);r.UnknownErrorException=u;var h=function(t){_inherits(InvalidPDFException,t);var r=_createSuper(InvalidPDFException);function InvalidPDFException(t){_classCallCheck(this,InvalidPDFException);return r.call(this,t,"InvalidPDFException")}return _createClass(InvalidPDFException)}(c);r.InvalidPDFException=h;var d=function(t){_inherits(MissingPDFException,t);var r=_createSuper(MissingPDFException);function MissingPDFException(t){_classCallCheck(this,MissingPDFException);return r.call(this,t,"MissingPDFException")}return _createClass(MissingPDFException)}(c);r.MissingPDFException=d;var p=function(t){_inherits(UnexpectedResponseException,t);var r=_createSuper(UnexpectedResponseException);function UnexpectedResponseException(t,i){var o;_classCallCheck(this,UnexpectedResponseException);(o=r.call(this,t,"UnexpectedResponseException")).status=i;return o}return _createClass(UnexpectedResponseException)}(c);r.UnexpectedResponseException=p;var m=function(t){_inherits(FormatError,t);var r=_createSuper(FormatError);function FormatError(t){_classCallCheck(this,FormatError);return r.call(this,t,"FormatError")}return _createClass(FormatError)}(c);r.FormatError=m;var y=function(t){_inherits(AbortException,t);var r=_createSuper(AbortException);function AbortException(t){_classCallCheck(this,AbortException);return r.call(this,t,"AbortException")}return _createClass(AbortException)}(c);r.AbortException=y;function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");for(var r=t.length,i=new Uint8Array(r),o=0;ot[2]){r[0]=t[2];r[2]=t[0]}if(t[1]>t[3]){r[1]=t[3];r[3]=t[1]}return r}},{key:"intersect",value:function intersect(t,r){function compare(t,r){return t-r}var i=[t[0],t[2],r[0],r[2]].sort(compare),o=[t[1],t[3],r[1],r[3]].sort(compare),a=[];t=Util.normalizeRect(t);r=Util.normalizeRect(r);if(!(i[0]===t[0]&&i[1]===r[0]||i[0]===r[0]&&i[1]===t[0]))return null;a[0]=i[1];a[2]=i[2];if(!(o[0]===t[1]&&o[1]===r[1]||o[0]===r[1]&&o[1]===t[1]))return null;a[1]=o[1];a[3]=o[2];return a}},{key:"bezierBoundingBox",value:function bezierBoundingBox(t,r,i,o,a,c,l,u){for(var h,d,p,m,y,v,g,b,_=[],x=[[],[]],w=0;w<2;++w){if(0===w){d=6*t-12*i+6*a;h=-3*t+9*i-9*a+3*l;p=3*i-3*t}else{d=6*r-12*o+6*c;h=-3*r+9*o-9*c+3*u;p=3*o-3*r}if(Math.abs(h)<1e-12){if(Math.abs(d)<1e-12)continue;0<(m=-p/d)&&m<1&&_.push(m)}else{g=d*d-4*p*h;b=Math.sqrt(g);if(!(g<0)){0<(y=(-d+b)/(2*h))&&y<1&&_.push(y);0<(v=(-d-b)/(2*h))&&v<1&&_.push(v)}}}for(var C,k=_.length,S=k;k--;){C=1-(m=_[k]);x[0][k]=C*C*C*t+3*C*C*m*i+3*C*m*m*a+m*m*m*l;x[1][k]=C*C*C*r+3*C*C*m*o+3*C*m*m*c+m*m*m*u}x[0][S]=t;x[1][S]=r;x[0][S+1]=l;x[1][S+1]=u;x[0].length=x[1].length=S+2;return[Math.min.apply(Math,_toConsumableArray(x[0])),Math.min.apply(Math,_toConsumableArray(x[1])),Math.max.apply(Math,_toConsumableArray(x[0])),Math.max.apply(Math,_toConsumableArray(x[1]))]}}]);return Util}();r.Util=_;var x=[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 stringToUTF8String(t){return decodeURIComponent(escape(t))}},(t,r,i)=>{var o=i(3);if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;!function checkNodeBtoa(){!globalThis.btoa&&o.isNodeJS&&(globalThis.btoa=function(t){return Buffer.from(t,"binary").toString("base64")})}();!function checkNodeAtob(){!globalThis.atob&&o.isNodeJS&&(globalThis.atob=function(t){return Buffer.from(t,"base64").toString("binary")})}();!function checkDOMMatrix(){!globalThis.DOMMatrix&&o.isNodeJS&&(globalThis.DOMMatrix=i(4))}();!function checkReadableStream(){!globalThis.ReadableStream&&o.isNodeJS&&(globalThis.ReadableStream=require("web-streams-polyfill/dist/ponyfill.js").ReadableStream)}()}},(t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});r.isNodeJS=void 0;function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var i=!("object"!==("undefined"==typeof process?"undefined":_typeof(process))||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);r.isNodeJS=i},(t,r,i)=>{var o,a,c;function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}c=function(){function fromArray(r){var i=new t,o=Array.from(r);if(!o.every((function(t){return!Number.isNaN(t)})))throw TypeError('CSSMatrix: "'+r+'" must only have numbers.');if(16===o.length){var a=o[0],c=o[1],l=o[2],u=o[3],h=o[4],d=o[5],p=o[6],m=o[7],y=o[8],v=o[9],g=o[10],b=o[11],_=o[12],x=o[13],w=o[14],C=o[15];i.m11=a;i.a=a;i.m21=h;i.c=h;i.m31=y;i.m41=_;i.e=_;i.m12=c;i.b=c;i.m22=d;i.d=d;i.m32=v;i.m42=x;i.f=x;i.m13=l;i.m23=p;i.m33=g;i.m43=w;i.m14=u;i.m24=m;i.m34=b;i.m44=C}else{if(6!==o.length)throw new TypeError("CSSMatrix: expecting an Array of 6/16 values.");var k=o[0],S=o[1],P=o[2],T=o[3],I=o[4],E=o[5];i.m11=k;i.a=k;i.m12=S;i.b=S;i.m21=P;i.c=P;i.m22=T;i.d=T;i.m41=I;i.e=I;i.m42=E;i.f=E}return i}function fromMatrix(r){var i=Object.keys(new t);if("object"===_typeof(r)&&i.every((function(t){return t in r})))return fromArray([r.m11,r.m12,r.m13,r.m14,r.m21,r.m22,r.m23,r.m24,r.m31,r.m32,r.m33,r.m34,r.m41,r.m42,r.m43,r.m44]);throw TypeError('CSSMatrix: "'+r+'" is not a DOMMatrix / CSSMatrix / JSON compatible object.')}function fromString(r){if("string"!=typeof r)throw TypeError('CSSMatrix: "'+r+'" is not a string.');var i=String(r).replace(/\s/g,""),o=new t,a='CSSMatrix: invalid transform string "'+r+'"';i.split(")").filter((function(t){return t})).forEach((function(t){var r=t.split("("),i=r[0],c=r[1];if(!c)throw TypeError(a);var l=c.split(",").map((function(t){return t.includes("rad")?parseFloat(t)*(180/Math.PI):parseFloat(t)})),u=l[0],h=l[1],d=l[2],p=l[3],m=[u,h,d],y=[u,h,d,p];if("perspective"===i&&u&&[h,d].every((function(t){return void 0===t})))o.m34=-1/u;else if(i.includes("matrix")&&[6,16].includes(l.length)&&l.every((function(t){return!Number.isNaN(+t)}))){var v=l.map((function(t){return Math.abs(t)<1e-6?0:t}));o=o.multiply(fromArray(v))}else if("translate3d"===i&&m.every((function(t){return!Number.isNaN(+t)})))o=o.translate(u,h,d);else if("translate"===i&&u&&void 0===d)o=o.translate(u,h||0,0);else if("rotate3d"===i&&y.every((function(t){return!Number.isNaN(+t)}))&&p)o=o.rotateAxisAngle(u,h,d,p);else if("rotate"===i&&u&&[h,d].every((function(t){return void 0===t})))o=o.rotate(0,0,u);else if("scale3d"===i&&m.every((function(t){return!Number.isNaN(+t)}))&&m.some((function(t){return 1!==t})))o=o.scale(u,h,d);else if("scale"!==i||Number.isNaN(u)||1===u||void 0!==d)if("skew"===i&&u&&void 0===d){o=o.skewX(u);o=h?o.skewY(h):o}else{if(!(/[XYZ]/.test(i)&&u&&[h,d].every((function(t){return void 0===t}))&&["translate","rotate","scale","skew"].some((function(t){return i.includes(t)}))))throw TypeError(a);if(["skewX","skewY"].includes(i))o=o[i](u);else{var g=i.replace(/[XYZ]/,""),b=i.replace(g,""),_=["X","Y","Z"].indexOf(b),x=[0===_?u:0,1===_?u:0,2===_?u:0];o=o[g].apply(o,x)}}else{var w=Number.isNaN(+h)?u:h;o=o.scale(u,w,1)}}));return o}function Translate(r,i,o){var a=new t;a.m41=r;a.e=r;a.m42=i;a.f=i;a.m43=o;return a}function Rotate(r,i,o){var a=new t,c=Math.PI/180,l=r*c,u=i*c,h=o*c,d=Math.cos(l),p=-Math.sin(l),m=Math.cos(u),y=-Math.sin(u),v=Math.cos(h),g=-Math.sin(h),b=m*v,_=-m*g;a.m11=b;a.a=b;a.m12=_;a.b=_;a.m13=y;var x=p*y*v+d*g;a.m21=x;a.c=x;var w=d*v-p*y*g;a.m22=w;a.d=w;a.m23=-p*m;a.m31=p*g-d*y*v;a.m32=p*v+d*y*g;a.m33=d*m;return a}function RotateAxisAngle(r,i,o,a){var c=new t,l=a*(Math.PI/360),u=Math.sin(l),h=Math.cos(l),d=u*u,p=Math.sqrt(r*r+i*i+o*o),m=r,y=i,v=o;if(0===p){m=0;y=0;v=1}else{m/=p;y/=p;v/=p}var g=m*m,b=y*y,_=v*v,x=1-2*(b+_)*d;c.m11=x;c.a=x;var w=2*(m*y*d+v*u*h);c.m12=w;c.b=w;c.m13=2*(m*v*d-y*u*h);var C=2*(y*m*d-v*u*h);c.m21=C;c.c=C;var k=1-2*(_+g)*d;c.m22=k;c.d=k;c.m23=2*(y*v*d+m*u*h);c.m31=2*(v*m*d+y*u*h);c.m32=2*(v*y*d-m*u*h);c.m33=1-2*(g+b)*d;return c}function Scale(r,i,o){var a=new t;a.m11=r;a.a=r;a.m22=i;a.d=i;a.m33=o;return a}function SkewX(r){var i=new t,o=r*Math.PI/180,a=Math.tan(o);i.m21=a;i.c=a;return i}function SkewY(r){var i=new t,o=r*Math.PI/180,a=Math.tan(o);i.m12=a;i.b=a;return i}function Multiply(t,r){return fromArray([r.m11*t.m11+r.m12*t.m21+r.m13*t.m31+r.m14*t.m41,r.m11*t.m12+r.m12*t.m22+r.m13*t.m32+r.m14*t.m42,r.m11*t.m13+r.m12*t.m23+r.m13*t.m33+r.m14*t.m43,r.m11*t.m14+r.m12*t.m24+r.m13*t.m34+r.m14*t.m44,r.m21*t.m11+r.m22*t.m21+r.m23*t.m31+r.m24*t.m41,r.m21*t.m12+r.m22*t.m22+r.m23*t.m32+r.m24*t.m42,r.m21*t.m13+r.m22*t.m23+r.m23*t.m33+r.m24*t.m43,r.m21*t.m14+r.m22*t.m24+r.m23*t.m34+r.m24*t.m44,r.m31*t.m11+r.m32*t.m21+r.m33*t.m31+r.m34*t.m41,r.m31*t.m12+r.m32*t.m22+r.m33*t.m32+r.m34*t.m42,r.m31*t.m13+r.m32*t.m23+r.m33*t.m33+r.m34*t.m43,r.m31*t.m14+r.m32*t.m24+r.m33*t.m34+r.m34*t.m44,r.m41*t.m11+r.m42*t.m21+r.m43*t.m31+r.m44*t.m41,r.m41*t.m12+r.m42*t.m22+r.m43*t.m32+r.m44*t.m42,r.m41*t.m13+r.m42*t.m23+r.m43*t.m33+r.m44*t.m43,r.m41*t.m14+r.m42*t.m24+r.m43*t.m34+r.m44*t.m44])}var t=function CSSMatrix(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var i=this;i.a=1;i.b=0;i.c=0;i.d=1;i.e=0;i.f=0;i.m11=1;i.m12=0;i.m13=0;i.m14=0;i.m21=0;i.m22=1;i.m23=0;i.m24=0;i.m31=0;i.m32=0;i.m33=1;i.m34=0;i.m41=0;i.m42=0;i.m43=0;i.m44=1;if(t&&t.length){var o=[16,6].some((function(r){return r===t.length}))?t:t[0];return i.setMatrixValue(o)}return i},r={isIdentity:{configurable:!0},is2D:{configurable:!0}};r.isIdentity.set=function(t){this.isIdentity=t};r.isIdentity.get=function(){var t=this;return 1===t.m11&&0===t.m12&&0===t.m13&&0===t.m14&&0===t.m21&&1===t.m22&&0===t.m23&&0===t.m24&&0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m41&&0===t.m42&&0===t.m43&&1===t.m44};r.is2D.get=function(){var t=this;return 0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m43&&1===t.m44};r.is2D.set=function(t){this.is2D=t};t.prototype.setMatrixValue=function setMatrixValue(t){return[Array,Float64Array,Float32Array].some((function(r){return t instanceof r}))?fromArray(t):"string"==typeof t&&t.length&&"none"!==t?fromString(t):"object"===_typeof(t)?fromMatrix(t):this};t.prototype.toArray=function toArray(){var t=this,r=Math.pow(10,6);return(t.is2D?[t.a,t.b,t.c,t.d,t.e,t.f]:[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44]).map((function(t){return Math.abs(t)<1e-6?0:(t*r>>0)/r}))};t.prototype.toString=function toString(){var t=this.toArray();return(this.is2D?"matrix":"matrix3d")+"("+t+")"};t.prototype.toJSON=function toJSON(){var t=this,r=t.is2D,i=t.isIdentity;return Object.assign({},t,{is2D:r,isIdentity:i})};t.prototype.multiply=function multiply(t){return Multiply(this,t)};t.prototype.translate=function translate(t,r,i){var o=r,a=i;void 0===a&&(a=0);void 0===o&&(o=0);return Multiply(this,Translate(t,o,a))};t.prototype.scale=function scale(t,r,i){var o=r,a=i;void 0===o&&(o=t);void 0===a&&(a=1);return Multiply(this,Scale(t,o,a))};t.prototype.rotate=function rotate(t,r,i){var o=t,a=r,c=i;void 0===a&&(a=0);if(void 0===c){c=o;o=0}return Multiply(this,Rotate(o,a,c))};t.prototype.rotateAxisAngle=function rotateAxisAngle(t,r,i,o){if([t,r,i,o].some((function(t){return Number.isNaN(t)})))throw new TypeError("CSSMatrix: expecting 4 values");return Multiply(this,RotateAxisAngle(t,r,i,o))};t.prototype.skewX=function skewX(t){return Multiply(this,SkewX(t))};t.prototype.skewY=function skewY(t){return Multiply(this,SkewY(t))};t.prototype.transformPoint=function transformPoint(t){var r=Translate(t.x,t.y,t.z);r.m44=t.w||1;return{x:(r=this.multiply(r)).m41,y:r.m42,z:r.m43,w:r.m44}};t.prototype.transform=function transform(t){var r=this,i=r.m11*t.x+r.m12*t.y+r.m13*t.z+r.m14*t.w,o=r.m21*t.x+r.m22*t.y+r.m23*t.z+r.m24*t.w,a=r.m31*t.x+r.m32*t.y+r.m33*t.z+r.m34*t.w,c=r.m41*t.x+r.m42*t.y+r.m43*t.z+r.m44*t.w;return{x:i/c,y:o/c,z:a/c,w:c}};Object.defineProperties(t.prototype,r);Object.assign(t,{Translate:Translate,Rotate:Rotate,RotateAxisAngle:RotateAxisAngle,Scale:Scale,SkewX:SkewX,SkewY:SkewY,Multiply:Multiply,fromArray:fromArray,fromMatrix:fromMatrix,fromString:fromString});Object.assign(t,{Version:"0.0.24"});return t},"object"===_typeof(r)?t.exports=c():void 0!==(a="function"==typeof(o=c)?o.call(r,i,r,t):o)&&(t.exports=a)},(t,r,i)=>{function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.Jbig2Image=void 0;var o=i(1),a=i(6),c=i(11),l=i(12);function _defineProperties(t,r){for(var i=0;i>>0}var c=readBits(1),l=readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(32)+4436:readBits(12)+340:readBits(8)+84:readBits(6)+20:readBits(4)+4:readBits(2);return 0===c?l:l>0?-l:null}function decodeIAID(t,r,i){for(var o=t.getContexts("IAID"),a=1,c=0;c=L&&A=N){J=J<<1&w;for(y=0;y=0&&B=0&&(D=z[R][B])&&(J|=D<=t?N<<=1:N=N<<1|I[M][L]}for(m=0;m=P||L<0||L>=S?N<<=1:N=N<<1|o[M][L]}var U=E.readBit(O,N);B[D]=U}}return I}function decodeTextRegion(t,r,i,o,a,c,l,h,d,p,m,y,v,g,b,_,x,w,C){if(t&&r)throw new u("refinement with Huffman is not supported");var k,S,P=[];for(k=0;k1&&(B=t?C.readBits(w):decodeInteger(E,"IAIT",I));var D=l*O+B,M=t?g.symbolIDTable.decode(C):decodeIAID(E,I,d),L=r&&(t?C.readBit():decodeInteger(E,"IARI",I)),N=h[M],U=N[0].length,j=N.length;if(L){var H=decodeInteger(E,"IARDW",I),z=decodeInteger(E,"IARDH",I);N=decodeRefinement(U+=H,j+=z,b,N,(H>>1)+decodeInteger(E,"IARDX",I),(z>>1)+decodeInteger(E,"IARDY",I),!1,_,x)}var X=D-(1&y?0:j-1),Y=R-(2&y?U-1:0),G=void 0,J=void 0,q=void 0;if(p){for(G=0;G>5&7,m=[31&h],y=r+6;if(7===h){d=536870911&(0,a.readUint32)(t,y-1);y+=3;var v=d+7>>3;m[0]=t[y++];for(;--v>0;)m.push(t[y++])}else if(5===h||6===h)throw new u("invalid referred-to flags");i.retainBits=m;var g=4;i.number<=256?g=1:i.number<=65536&&(g=2);var _,x,w=[];for(_=0;_>>24&255;P[3]=k.height>>16&255;P[4]=k.height>>8&255;P[5]=255&k.height;for(_=y,x=t.length;_>2&3;y.huffmanDWSelector=v>>4&3;y.bitmapSizeSelector=v>>6&1;y.aggregationInstancesSelector=v>>7&1;y.bitmapCodingContextUsed=!!(256&v);y.bitmapCodingContextRetained=!!(512&v);y.template=v>>10&3;y.refinementTemplate=v>>12&1;m+=2;if(!y.huffman){l=0===y.template?4:1;o=[];for(c=0;c>2&3;g.stripSize=1<>4&3;g.transposed=!!(64&_);g.combinationOperator=_>>7&3;g.defaultPixelValue=_>>9&1;g.dsOffset=_<<17>>27;g.refinementTemplate=_>>15&1;if(g.huffman){var x=(0,a.readUint16)(d,m);m+=2;g.huffmanFS=3&x;g.huffmanDS=x>>2&3;g.huffmanDT=x>>4&3;g.huffmanRefinementDW=x>>6&3;g.huffmanRefinementDH=x>>8&3;g.huffmanRefinementDX=x>>10&3;g.huffmanRefinementDY=x>>12&3;g.huffmanRefinementSizeSelector=!!(16384&x)}if(g.refinement&&!g.refinementTemplate){o=[];for(c=0;c<2;c++){o.push({x:(0,a.readInt8)(d,m),y:(0,a.readInt8)(d,m+1)});m+=2}g.refinementAt=o}g.numberOfSymbolInstances=(0,a.readUint32)(d,m);m+=4;i=[g,h.referredTo,d,m,p];break;case 16:var w={},C=d[m++];w.mmr=!!(1&C);w.template=C>>1&3;w.patternWidth=d[m++];w.patternHeight=d[m++];w.maxPatternIndex=(0,a.readUint32)(d,m);m+=4;i=[w,h.number,d,m,p];break;case 22:case 23:var k={};k.info=readRegionSegmentInformation(d,m);m+=b;var S=d[m++];k.mmr=!!(1&S);k.template=S>>1&3;k.enableSkip=!!(8&S);k.combinationOperator=S>>4&7;k.defaultPixelValue=S>>7&1;k.gridWidth=(0,a.readUint32)(d,m);m+=4;k.gridHeight=(0,a.readUint32)(d,m);m+=4;k.gridOffsetX=4294967295&(0,a.readUint32)(d,m);m+=4;k.gridOffsetY=4294967295&(0,a.readUint32)(d,m);m+=4;k.gridVectorX=(0,a.readUint16)(d,m);m+=2;k.gridVectorY=(0,a.readUint16)(d,m);m+=2;i=[k,h.referredTo,d,m,p];break;case 38:case 39:var P={};P.info=readRegionSegmentInformation(d,m);m+=b;var T=d[m++];P.mmr=!!(1&T);P.template=T>>1&3;P.prediction=!!(8&T);if(!P.mmr){l=0===P.template?4:1;o=[];for(c=0;c>2&1;I.combinationOperator=E>>3&3;I.requiresBuffer=!!(32&E);I.combinationOperatorOverride=!!(64&E);i=[I];break;case 49:case 50:case 51:case 62:break;case 53:i=[h.number,d,m,p];break;default:throw new u("segment type ".concat(h.typeName,"(").concat(h.type,")")+" is not implemented")}var O="on"+h.typeName;O in r&&r[O].apply(r,i)}function processSegments(t,r){for(var i=0,o=t.length;i>3,i=new Uint8ClampedArray(r*t.height);if(t.defaultPixelValue)for(var o=0,a=i.length;o>3,m=l.combinationOperatorOverride?t.combinationOperator:l.combinationOperator,y=this.buffer,v=128>>(7&t.x),g=t.y*p+(t.x>>3);switch(m){case 0:for(i=0;i>=1)){a=128;c++}}g+=p}break;case 2:for(i=0;i>=1)){a=128;c++}}g+=p}break;default:throw new u("operator ".concat(m," is not supported"))}}},{key:"onImmediateGenericRegion",value:function onImmediateGenericRegion(t,r,i,o){var a=t.info,c=new d(r,i,o),l=decodeBitmap(t.mmr,a.width,a.height,t.template,t.prediction,null,t.at,c);this.drawBitmap(a,l)}},{key:"onImmediateLosslessGenericRegion",value:function onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion.apply(this,arguments)}},{key:"onSymbolDictionary",value:function onSymbolDictionary(t,r,i,o,c,l){var h,p;if(t.huffman){h=function getSymbolDictionaryHuffmanTables(t,r,i){var o,a,c,l,h=0;switch(t.huffmanDHSelector){case 0:case 1:o=getStandardTable(t.huffmanDHSelector+4);break;case 3:o=getCustomHuffmanTable(h,r,i);h++;break;default:throw new u("invalid Huffman DH selector")}switch(t.huffmanDWSelector){case 0:case 1:a=getStandardTable(t.huffmanDWSelector+2);break;case 3:a=getCustomHuffmanTable(h,r,i);h++;break;default:throw new u("invalid Huffman DW selector")}if(t.bitmapSizeSelector){c=getCustomHuffmanTable(h,r,i);h++}else c=getStandardTable(1);l=t.aggregationInstancesSelector?getCustomHuffmanTable(h,r,i):getStandardTable(1);return{tableDeltaHeight:o,tableDeltaWidth:a,tableBitmapSize:c,tableAggregateInstances:l}}(t,i,this.customTables);p=new S(o,c,l)}var m=this.symbols;m||(this.symbols=m={});for(var y=[],v=0,g=i.length;v1)E=decodeTextRegion(t,r,S,x,0,O,1,i.concat(_),w,0,0,1,0,l,p,m,y,0,v);else{var A=decodeIAID(k,C,w),R=decodeInteger(k,"IARDX",C),B=decodeInteger(k,"IARDY",C);E=decodeRefinement(S,x,p,A=32){var y=void 0,v=void 0,g=void 0;switch(m){case 32:if(0===p)throw new u("no previous value in symbol ID table");v=a.readBits(2)+3;y=c[p-1].prefixLength;break;case 33:v=a.readBits(3)+3;y=0;break;case 34:v=a.readBits(7)+11;y=0;break;default:throw new u("invalid code length in symbol ID table")}for(g=0;g=0;x--){B=t?decodeMMRBitmap(R,p,m,!0):decodeBitmap(!1,p,m,i,!1,null,A,_);Y[x]=B}for(D=0;D=0;w--)N|=(L^=Y[w][D][M])<>8;if((j=y+D*b+M*g>>8)>=0&&j+I<=o&&H>=0&&H+E<=c)for(x=0;x=c)){X=k[J];z=U[x];for(w=0;w=0&&G>1&7),m=1+(l>>4&7),y=[],v=u;do{o=d.readBits(p);c=d.readBits(m);y.push(new x([v,o,c,0]));v+=1<>r&1;if(r<=0)this.children[i]=new HuffmanTreeNode(t);else{var o=this.children[i];o||(this.children[i]=o=new HuffmanTreeNode(null));o.buildTree(t,r-1)}}},{key:"decodeNode",value:function decodeNode(t){if(this.isLeaf){if(this.isOOB)return null;var r=t.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-r:r)}var i=this.children[t.readBit()];if(!i)throw new u("invalid Huffman data");return i.decodeNode(t)}}]);return HuffmanTreeNode}(),C=function(){function HuffmanTable(t,r){_classCallCheck(this,HuffmanTable);r||this.assignPrefixCodes(t);this.rootNode=new w(null);for(var i=0,o=t.length;i0&&this.rootNode.buildTree(a,a.prefixLength-1)}}_createClass(HuffmanTable,[{key:"decode",value:function decode(t){return this.rootNode.decodeNode(t)}},{key:"assignPrefixCodes",value:function assignPrefixCodes(t){for(var r=t.length,i=0,o=0;o=this.end)throw new u("end of data while reading bit");this.currentByte=this.data[this.position++];this.shift=7}var t=this.currentByte>>this.shift&1;this.shift--;return t}},{key:"readBits",value:function readBits(t){var r,i=0;for(r=t-1;r>=0;r--)i|=this.readBit()<=this.end?-1:this.data[this.position++]}}]);return Reader}();function getCustomHuffmanTable(t,r,i){for(var o=0,a=0,c=r.length;a>y&1;y--}}if(o&&!d)for(var g=0;g<5&&-1!==u.readNextChar();g++);return h}var P=function(){function Jbig2Image(){_classCallCheck(this,Jbig2Image)}_createClass(Jbig2Image,[{key:"parseChunks",value:function parseChunks(t){return function parseJbig2Chunks(t){for(var r=new _,i=0,o=t.length;i>=1}return{imgData:v,width:p,height:m}}(t),i=r.imgData,o=r.width,c=r.height;this.width=o;this.height=c;return i}}]);return Jbig2Image}();r.Jbig2Image=P},(t,r,i)=>{function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.XRefParseException=r.XRefEntryException=r.ParserEOFException=r.MissingDataException=r.DocStats=void 0;r.collectActions=function collectActions(t,r,i){var c=Object.create(null),l=getInheritableProperty({dict:r,key:"AA",stopWhenFound:!1});if(l)for(var u=l.length-1;u>=0;u--){var h=l[u];if(h instanceof a.Dict){var d,p=_createForOfIteratorHelper(h.getKeys());try{for(p.s();!(d=p.n()).done;){var m=d.value,y=i[m];if(y){var v=h.getRaw(m),g=new a.RefSet,b=[];_collectJS(v,t,b,g);b.length>0&&(c[y]=b)}}}catch(t){p.e(t)}finally{p.f()}}}if(r.has("A")){var _=r.get("A"),x=new a.RefSet,w=[];_collectJS(_,t,w,x);w.length>0&&(c.Action=w)}return(0,o.objectSize)(c)>0?c:null};r.encodeToXmlString=function encodeToXmlString(t){for(var r=[],i=0,o=0,a=t.length;o55295&&(c<57344||c>65533)&&o++;i=o+1}}if(0===r.length)return t;i126||35===c||40===c||41===c||60===c||62===c||91===c||93===c||123===c||125===c||47===c||37===c){i>24};r.readUint16=function readUint16(t,r){return t[r]<<8|t[r+1]};r.readUint32=function readUint32(t,r){return(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0};r.recoverJsURL=function recoverJsURL(t){var r=new RegExp("^\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").split(".").join("\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec(t);if(r&&r[2]){var i=r[2],o=!1;"true"===r[3]&&"app.launchURL"===r[1]&&(o=!0);return{url:i,newWindow:o}}return null};r.toRomanNumerals=function toRomanNumerals(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,o.assert)(Number.isInteger(t)&&t>0,"The number should be a positive integer.");var i,a=[];for(;t>=1e3;){t-=1e3;a.push("M")}i=t/100|0;t%=100;a.push(m[i]);i=t/10|0;t%=10;a.push(m[10+i]);a.push(m[20+t]);var c=a.join("");return r?c.toLowerCase():c};r.validateCSSFont=function validateCSSFont(t){var r=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),i=t.fontFamily,a=t.fontWeight,c=t.italicAngle;if(/^".*"$/.test(i)){if(/[^\\]"/.test(i.slice(1,i.length-1))){(0,o.warn)('XFA - FontFamily contains some unescaped ": '.concat(i,"."));return!1}}else if(/^'.*'$/.test(i)){if(/[^\\]'/.test(i.slice(1,i.length-1))){(0,o.warn)("XFA - FontFamily contains some unescaped ': ".concat(i,"."));return!1}}else{var l,u=_createForOfIteratorHelper(i.split(/[ \t]+/));try{for(u.s();!(l=u.n()).done;){var h=l.value;if(/^(\d|(-(\d|-)))/.test(h)||!/^[\w-\\]+$/.test(h)){(0,o.warn)("XFA - FontFamily contains some invalid : ".concat(i,"."));return!1}}}catch(t){u.e(t)}finally{u.f()}}var d=a?a.toString():"";t.fontWeight=r.has(d)?d:"400";var p=parseFloat(c);t.italicAngle=isNaN(p)||p<-90||p>90?"14":c.toString();return!0};var o=i(1),a=i(7),c=i(10);function _createForOfIteratorHelper(t,r){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){i&&(t=i);var o=0,a=function F(){};return{s:a,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,l=!0,u=!1;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();l=t.done;return t},e:function e(t){u=!0;c=t},f:function f(){try{l||null==i.return||i.return()}finally{if(u)throw c}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i{Object.defineProperty(r,"__esModule",{value:!0});r.RefSetCache=r.RefSet=r.Ref=r.Name=r.EOF=r.Dict=r.Cmd=r.CIRCULAR_REF=void 0;r.clearPrimitiveCaches=function clearPrimitiveCaches(){h._clearCache();u._clearCache();m._clearCache()};r.isCmd=function isCmd(t,r){return t instanceof h&&(void 0===r||t.cmd===r)};r.isDict=function isDict(t,r){return t instanceof p&&(void 0===r||isName(t.get("Type"),r))};r.isName=isName;r.isRefsEqual=function isRefsEqual(t,r){return t.num===r.num&&t.gen===r.gen};var o=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(i(8)),a=i(1);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var o,a,c=[],l=!0,u=!1;try{for(i=i.call(t);!(l=(o=i.next()).done);l=!0){c.push(o.value);if(r&&c.length===r)break}}catch(t){u=!0;a=t}finally{try{l||null==i.return||i.return()}finally{if(u)throw a}}return c}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){i&&(t=i);var o=0,a=function F(){};return{s:a,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,l=!0,u=!1;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();l=t.done;return t},e:function e(t){u=!0;c=t},f:function f(){try{l||null==i.return||i.return()}finally{if(u)throw c}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);return"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i0&&void 0!==arguments[0]?arguments[0]:null;_classCallCheck(this,Dict);this._map=Object.create(null);this.xref=t;this.objId=null;this.suppressEncryption=!1;this.__nonSerializable__=d}_createClass(Dict,[{key:"assignXref",value:function assignXref(t){this.xref=t}},{key:"size",get:function get(){return Object.keys(this._map).length}},{key:"get",value:function get(t,r,i){var o=this._map[t];void 0===o&&void 0!==r&&void 0===(o=this._map[r])&&void 0!==i&&(o=this._map[i]);return o instanceof m&&this.xref?this.xref.fetch(o,this.suppressEncryption):o}},{key:"getAsync",value:(t=function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(void 0)}))}}(o.default.mark((function _callee(t,r,i){var a;return o.default.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:void 0===(a=this._map[t])&&void 0!==r&&void 0===(a=this._map[r])&&void 0!==i&&(a=this._map[i]);if(!(a instanceof m&&this.xref)){o.next=4;break}return o.abrupt("return",this.xref.fetchAsync(a,this.suppressEncryption));case 4:return o.abrupt("return",a);case 5:case"end":return o.stop()}}),_callee,this)}))),function getAsync(r,i,o){return t.apply(this,arguments)})},{key:"getArray",value:function getArray(t,r,i){var o=this._map[t];void 0===o&&void 0!==r&&void 0===(o=this._map[r])&&void 0!==i&&(o=this._map[i]);o instanceof m&&this.xref&&(o=this.xref.fetch(o,this.suppressEncryption));if(Array.isArray(o))for(var a=0,c=(o=o.slice()).length;a0&&(l._map[C]=P)}else l._map[C]=k[0]}}catch(t){x.e(t)}finally{x.f()}u.clear();return l.size>0?l:Dict.empty}}]);var t;return Dict}();r.Dict=p;var m=function RefClosure(){var t=Object.create(null);return function(){function Ref(t,r){_classCallCheck(this,Ref);this.num=t;this.gen=r}_createClass(Ref,[{key:"toString",value:function toString(){return 0===this.gen?"".concat(this.num,"R"):"".concat(this.num,"R").concat(this.gen)}}],[{key:"get",value:function get(r,i){var o=0===i?"".concat(r,"R"):"".concat(r,"R").concat(i),a=t[o];return a||(t[o]=new Ref(r,i))}},{key:"_clearCache",value:function _clearCache(){t=Object.create(null)}}]);return Ref}()}();r.Ref=m;var y=function(){function RefSet(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_classCallCheck(this,RefSet);this._set=new Set(t&&t._set)}_createClass(RefSet,[{key:"has",value:function has(t){return this._set.has(t.toString())}},{key:"put",value:function put(t){this._set.add(t.toString())}},{key:"remove",value:function remove(t){this._set.delete(t.toString())}},{key:"forEach",value:function forEach(t){var r,i=_createForOfIteratorHelper(this._set.values());try{for(i.s();!(r=i.n()).done;){t(r.value)}}catch(t){i.e(t)}finally{i.f()}}},{key:"clear",value:function clear(){this._set.clear()}}]);return RefSet}();r.RefSet=y;var v=function(){function RefSetCache(){_classCallCheck(this,RefSetCache);this._map=new Map}_createClass(RefSetCache,[{key:"size",get:function get(){return this._map.size}},{key:"get",value:function get(t){return this._map.get(t.toString())}},{key:"has",value:function has(t){return this._map.has(t.toString())}},{key:"put",value:function put(t,r){this._map.set(t.toString(),r)}},{key:"putAlias",value:function putAlias(t,r){this._map.set(t.toString(),this.get(r))}},{key:"forEach",value:function forEach(t){var r,i=_createForOfIteratorHelper(this._map.values());try{for(i.s();!(r=i.n()).done;){t(r.value)}}catch(t){i.e(t)}finally{i.f()}}},{key:"clear",value:function clear(){this._map.clear()}}]);return RefSetCache}();r.RefSetCache=v;function isName(t,r){return t instanceof u&&(void 0===r||t.name===r)}},(t,r,i)=>{t.exports=i(9)},(t,r,i)=>{function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var o=function(t){var r,i=Object.prototype,o=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function define(t,r,i){Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0});return t[r]}try{define({},"")}catch(t){define=function define(t,r,i){return t[r]=i}}function wrap(t,r,i,o){var a=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(a.prototype),l=new Context(o||[]);c._invoke=function makeInvokeMethod(t,r,i){var o=h;return function invoke(a,c){if(o===p)throw new Error("Generator is already running");if(o===m){if("throw"===a)throw c;return doneResult()}i.method=a;i.arg=c;for(;;){var l=i.delegate;if(l){var u=maybeInvokeDelegate(l,i);if(u){if(u===y)continue;return u}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===h){o=m;throw i.arg}i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=p;var v=tryCatch(t,r,i);if("normal"===v.type){o=i.done?m:d;if(v.arg===y)continue;return{value:v.arg,done:i.done}}if("throw"===v.type){o=m;i.method="throw";i.arg=v.arg}}}}(t,i,l);return c}t.wrap=wrap;function tryCatch(t,r,i){try{return{type:"normal",arg:t.call(r,i)}}catch(t){return{type:"throw",arg:t}}}var h="suspendedStart",d="suspendedYield",p="executing",m="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var v={};define(v,c,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(values([])));b&&b!==i&&o.call(b,c)&&(v=b);var _=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(v);GeneratorFunction.prototype=GeneratorFunctionPrototype;define(_,"constructor",GeneratorFunctionPrototype);define(GeneratorFunctionPrototype,"constructor",GeneratorFunction);GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction");function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))};t.mark=function(t){if(Object.setPrototypeOf)Object.setPrototypeOf(t,GeneratorFunctionPrototype);else{t.__proto__=GeneratorFunctionPrototype;define(t,u,"GeneratorFunction")}t.prototype=Object.create(_);return t};t.awrap=function(t){return{__await:t}};function AsyncIterator(t,r){function invoke(i,a,c,l){var u=tryCatch(t[i],t,a);if("throw"!==u.type){var h=u.arg,d=h.value;return d&&"object"===_typeof(d)&&o.call(d,"__await")?r.resolve(d.__await).then((function(t){invoke("next",t,c,l)}),(function(t){invoke("throw",t,c,l)})):r.resolve(d).then((function(t){h.value=t;c(h)}),(function(t){return invoke("throw",t,c,l)}))}l(u.arg)}var i;this._invoke=function enqueue(t,o){function callInvokeWithMethodAndArg(){return new r((function(r,i){invoke(t,o,r,i)}))}return i=i?i.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}defineIteratorMethods(AsyncIterator.prototype);define(AsyncIterator.prototype,l,(function(){return this}));t.AsyncIterator=AsyncIterator;t.async=function(r,i,o,a,c){void 0===c&&(c=Promise);var l=new AsyncIterator(wrap(r,i,o,a),c);return t.isGeneratorFunction(i)?l:l.next().then((function(t){return t.done?t.value:l.next()}))};function maybeInvokeDelegate(t,i){var o=t.iterator[i.method];if(o===r){i.delegate=null;if("throw"===i.method){if(t.iterator.return){i.method="return";i.arg=r;maybeInvokeDelegate(t,i);if("throw"===i.method)return y}i.method="throw";i.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var a=tryCatch(o,t.iterator,i.arg);if("throw"===a.type){i.method="throw";i.arg=a.arg;i.delegate=null;return y}var c=a.arg;if(!c){i.method="throw";i.arg=new TypeError("iterator result is not an object");i.delegate=null;return y}if(!c.done)return c;i[t.resultName]=c.value;i.next=t.nextLoc;if("return"!==i.method){i.method="next";i.arg=r}i.delegate=null;return y}defineIteratorMethods(_);define(_,u,"Generator");define(_,c,(function(){return this}));define(_,"toString",(function(){return"[object Generator]"}));function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]);if(2 in t){r.finallyLoc=t[2];r.afterLoc=t[3]}this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal";delete r.arg;t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}];t.forEach(pushTryEntry,this);this.reset(!0)}t.keys=function(t){var r=[];for(var i in t)r.push(i);r.reverse();return function next(){for(;r.length;){var i=r.pop();if(i in t){next.value=i;next.done=!1;return next}}next.done=!0;return next}};function values(t){if(t){var i=t[c];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,l=function next(){for(;++a=0;--a){var c=this.tryEntries[a],l=c.completion;if("root"===c.tryLoc)return handle("end");if(c.tryLoc<=this.prev){var u=o.call(c,"catchLoc"),h=o.call(c,"finallyLoc");if(u&&h){if(this.prev=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&o.call(a,"finallyLoc")&&this.prev=0;--r){var i=this.tryEntries[r];if(i.finallyLoc===t){this.complete(i.completion,i.afterLoc);resetTryEntry(i);return y}}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc===t){var o=i.completion;if("throw"===o.type){var a=o.arg;resetTryEntry(i)}return a}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,i,o){this.delegate={iterator:values(t),resultName:i,nextLoc:o};"next"===this.method&&(this.arg=r);return y}};return t}("object"===_typeof(t=i.nmd(t))?t.exports:{});try{regeneratorRuntime=o}catch(t){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},(t,r,i)=>{Object.defineProperty(r,"__esModule",{value:!0});r.BaseStream=void 0;var o=i(1);function _defineProperties(t,r){for(var i=0;i1&&void 0!==arguments[1]&&arguments[1],i=this.getBytes(t,r);this.pos-=i.length;return i}},{key:"getUint16",value:function getUint16(){var t=this.getByte(),r=this.getByte();return-1===t||-1===r?-1:(t<<8)+r}},{key:"getInt32",value:function getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}},{key:"getByteRange",value:function getByteRange(t,r){(0,o.unreachable)("Abstract method `getByteRange` called")}},{key:"getString",value:function getString(t){return(0,o.bytesToString)(this.getBytes(t,!1))}},{key:"skip",value:function skip(t){this.pos+=t||1}},{key:"reset",value:function reset(){(0,o.unreachable)("Abstract method `reset` called")}},{key:"moveStart",value:function moveStart(){(0,o.unreachable)("Abstract method `moveStart` called")}},{key:"makeSubStream",value:function makeSubStream(t,r){(0,o.unreachable)("Abstract method `makeSubStream` called")}},{key:"getBaseStreams",value:function getBaseStreams(){return null}}]);return BaseStream}();r.BaseStream=a},(t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});r.ArithmeticDecoder=void 0;function _defineProperties(t,r){for(var i=0;i>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}!function _createClass(t,r,i){r&&_defineProperties(t.prototype,r);i&&_defineProperties(t,i);Object.defineProperty(t,"prototype",{writable:!1});return t}(ArithmeticDecoder,[{key:"byteIn",value:function byteIn(){var t=this.data,r=this.bp;if(255===t[r])if(t[r+1]>143){this.clow+=65280;this.ct=8}else{r++;this.clow+=t[r]<<9;this.ct=7;this.bp=r}else{r++;this.clow+=r65535){this.chigh+=this.clow>>16;this.clow&=65535}}},{key:"readBit",value:function readBit(t,r){var o,a=t[r]>>1,c=1&t[r],l=i[a],u=l.qe,h=this.a-u;if(this.chigh>15&1;this.clow=this.clow<<1&65535;this.ct--}while(0==(32768&h));this.a=h;t[r]=a<<1|c;return o}}]);return ArithmeticDecoder}();r.ArithmeticDecoder=o},(t,r,i)=>{Object.defineProperty(r,"__esModule",{value:!0});r.CCITTFaxDecoder=void 0;var o=i(1);function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,CCITTFaxDecoder);if(!t||"function"!=typeof t.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=t;this.eof=!1;this.encoding=r.K||0;this.eoline=r.EndOfLine||!1;this.byteAlign=r.EncodedByteAlign||!1;this.columns=r.Columns||1728;this.rows=r.Rows||0;var i,o=r.EndOfBlock;null==o&&(o=!0);this.eoblock=o;this.black=r.BlackIs1||!1;this.codingLine=new Uint32Array(this.columns+1);this.refLine=new Uint32Array(this.columns+2);this.codingLine[0]=this.columns;this.codingPos=0;this.row=0;this.nextLine2D=this.encoding<0;this.inputBits=0;this.inputBuf=0;this.outputBits=0;this.rowsDone=!1;for(;0===(i=this._lookBits(12));)this._eatBits(1);1===i&&this._eatBits(12);if(this.encoding>0){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}}!function _createClass(t,r,i){r&&_defineProperties(t.prototype,r);i&&_defineProperties(t,i);Object.defineProperty(t,"prototype",{writable:!1});return t}(CCITTFaxDecoder,[{key:"readNextChar",value:function readNextChar(){if(this.eof)return-1;var t,r,i,c,l,u=this.refLine,h=this.codingLine,d=this.columns;if(0===this.outputBits){this.rowsDone&&(this.eof=!0);if(this.eof)return-1;this.err=!1;var p,m,y;if(this.nextLine2D){for(c=0;h[c]=64);do{m+=y=this._getWhiteCode()}while(y>=64)}else{do{p+=y=this._getWhiteCode()}while(y>=64);do{m+=y=this._getBlackCode()}while(y>=64)}this._addPixels(h[this.codingPos]+p,r);h[this.codingPos]0?--t:++t;for(;u[t]<=h[this.codingPos]&&u[t]0?--t:++t;for(;u[t]<=h[this.codingPos]&&u[t]0?--t:++t;for(;u[t]<=h[this.codingPos]&&u[t]=64);else do{p+=y=this._getWhiteCode()}while(y>=64);this._addPixels(h[this.codingPos]+p,r);r^=1}}var v=!1;this.byteAlign&&(this.inputBits&=-8);if(this.eoblock||this.row!==this.rows-1){p=this._lookBits(12);if(this.eoline)for(;p!==a&&1!==p;){this._eatBits(1);p=this._lookBits(12)}else for(;0===p;){this._eatBits(1);p=this._lookBits(12)}if(1===p){this._eatBits(12);v=!0}else p===a&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}if(this.eoblock&&v&&this.byteAlign){if(1===(p=this._lookBits(12))){this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}if(this.encoding>=0)for(c=0;c<4;++c){1!==(p=this._lookBits(12))&&(0,o.info)("bad rtc code: "+p);this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}}this.eof=!0}}else if(this.err&&this.eoline){for(;;){if((p=this._lookBits(13))===a){this.eof=!0;return-1}if(p>>1==1)break;this._eatBits(1)}this._eatBits(12);if(this.encoding>0){this._eatBits(1);this.nextLine2D=!(1&p)}}h[0]>0?this.outputBits=h[this.codingPos=0]:this.outputBits=h[this.codingPos=1];this.row++}if(this.outputBits>=8){l=1&this.codingPos?0:255;this.outputBits-=8;if(0===this.outputBits&&h[this.codingPos]i){l<<=i;1&this.codingPos||(l|=255>>8-i);this.outputBits-=i;i=0}else{l<<=this.outputBits;1&this.codingPos||(l|=255>>8-this.outputBits);i-=this.outputBits;this.outputBits=0;if(h[this.codingPos]0){l<<=i;i=0}}}while(i)}this.black&&(l^=255);return l}},{key:"_addPixels",value:function _addPixels(t,r){var i=this.codingLine,a=this.codingPos;if(t>i[a]){if(t>this.columns){(0,o.info)("row is wrong length");this.err=!0;t=this.columns}1&a^r&&++a;i[a]=t}this.codingPos=a}},{key:"_addPixelsNeg",value:function _addPixelsNeg(t,r){var i=this.codingLine,a=this.codingPos;if(t>i[a]){if(t>this.columns){(0,o.info)("row is wrong length");this.err=!0;t=this.columns}1&a^r&&++a;i[a]=t}else if(t0&&t=c){var h=i[u-c];if(h[0]===l){this._eatBits(l);return[!0,h[1],!0]}}}return[!1,0,!1]}},{key:"_getTwoDimCode",value:function _getTwoDimCode(){var t,r=0;if(this.eoblock){r=this._lookBits(7);if((t=c[r])&&t[0]>0){this._eatBits(t[0]);return t[1]}}else{var i=this._findTableCode(1,7,c);if(i[0]&&i[2])return i[1]}(0,o.info)("Bad two dim code");return a}},{key:"_getWhiteCode",value:function _getWhiteCode(){var t,r=0;if(this.eoblock){if((r=this._lookBits(12))===a)return 1;if((t=r>>5==0?l[r]:u[r>>3])[0]>0){this._eatBits(t[0]);return t[1]}}else{var i=this._findTableCode(1,9,u);if(i[0])return i[1];if((i=this._findTableCode(11,12,l))[0])return i[1]}(0,o.info)("bad white code");this._eatBits(1);return 1}},{key:"_getBlackCode",value:function _getBlackCode(){var t,r;if(this.eoblock){if((t=this._lookBits(13))===a)return 1;if((r=t>>7==0?h[t]:t>>9==0&&t>>7!=0?d[(t>>1)-64]:p[t>>7])[0]>0){this._eatBits(r[0]);return r[1]}}else{var i=this._findTableCode(2,6,p);if(i[0])return i[1];if((i=this._findTableCode(7,12,d,64))[0])return i[1];if((i=this._findTableCode(10,13,h))[0])return i[1]}(0,o.info)("bad black code");this._eatBits(1);return 1}},{key:"_lookBits",value:function _lookBits(t){for(var r;this.inputBits>16-t;this.inputBuf=this.inputBuf<<8|r;this.inputBits+=8}return this.inputBuf>>this.inputBits-t&65535>>16-t}},{key:"_eatBits",value:function _eatBits(t){(this.inputBits-=t)<0&&(this.inputBits=0)}}]);return CCITTFaxDecoder}();r.CCITTFaxDecoder=m},(t,r,i)=>{Object.defineProperty(r,"__esModule",{value:!0});r.JpegImage=void 0;var o=i(1),a=i(6);function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _defineProperties(t,r){for(var i=0;i0&&!t[c-1];)c--;var l,u=[{children:[],index:0}],h=u[0];for(i=0;i0;)h=u.pop();h.index++;u.push(h);for(;u.length<=i;){u.push(l={children:[],index:0});h.children[h.index]=l.children;h=l}a++}if(i+19&&void 0!==arguments[9]&&arguments[9],_=i.mcusPerLine,x=i.progressive,w=r,C=0,k=0;function readBit(){if(k>0){k--;return C>>k&1}if(255===(C=t[r++])){var o=t[r++];if(o){if(220===o&&b){r+=2;var h=(0,a.readUint16)(t,r);r+=2;if(h>0&&h!==i.scanLines)throw new l("Found DNL marker (0xFFDC) while parsing scan data",h)}else if(217===o){if(b){var d=I*(8===i.precision?8:0);if(d>0&&Math.round(i.scanLines/d)>=10)throw new l("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",d)}throw new u("Found EOI marker (0xFFD9) while parsing scan data")}throw new c("unexpected marker ".concat((C<<8|o).toString(16)))}}k=7;return C>>>7}function decodeHuffman(t){for(var r=t;;){switch(_typeof(r=r[readBit()])){case"number":return r;case"object":continue}throw new c("invalid huffman sequence")}}function receive(t){for(var r=0;t>0;){r=r<<1|readBit();t--}return r}function receiveAndExtend(t){if(1===t)return 1===readBit()?1:-1;var r=receive(t);return r>=1<>4;if(0!==l){var d=h[a+=u];t.blockData[r+d]=receiveAndExtend(l);a++}else{if(u<15)break;a+=16}}}function decodeDCFirst(t,r){var i=decodeHuffman(t.huffmanTableDC),o=0===i?0:receiveAndExtend(i)<0)S--;else for(var i=m,o=y;i<=o;){var a=decodeHuffman(t.huffmanTableAC),c=15&a,l=a>>4;if(0!==c){var u=h[i+=l];t.blockData[r+u]=receiveAndExtend(c)*(1<>4;if(0===(i=15&o))if(u<15){S=receive(u)+(1<0){for(O=0;O0?"unexpected":"excessive";(0,o.warn)("decodeScan - ".concat(X," MCU data, current marker is: ").concat(L.invalid));r=L.offset}if(!(L.marker>=65488&&L.marker<=65495))break;r+=2}return r-w}function quantizeAndInverse(t,r,i){var o,a,l,u,h,x,w,C,k,S,P,T,I,E,O,A,R,B=t.quantizationTable,D=t.blockData;if(!B)throw new c("missing required Quantization Table.");for(var M=0;M<64;M+=8){k=D[r+M];S=D[r+M+1];P=D[r+M+2];T=D[r+M+3];I=D[r+M+4];E=D[r+M+5];O=D[r+M+6];A=D[r+M+7];k*=B[M];if(0!=(S|P|T|I|E|O|A)){S*=B[M+1];P*=B[M+2];T*=B[M+3];I*=B[M+4];E*=B[M+5];O*=B[M+6];A*=B[M+7];a=(o=(o=b*k+128>>8)+(a=b*I+128>>8)+1>>1)-a;R=(l=P)*g+(u=O)*v+128>>8;l=l*v-u*g+128>>8;w=(h=(h=_*(S-A)+128>>8)+(w=E<<4)+1>>1)-w;x=(C=(C=_*(S+A)+128>>8)+(x=T<<4)+1>>1)-x;u=(o=o+(u=R)+1>>1)-u;l=(a=a+l+1>>1)-l;R=h*y+C*m+2048>>12;h=h*m-C*y+2048>>12;C=R;R=x*p+w*d+2048>>12;x=x*d-w*p+2048>>12;w=R;i[M]=o+C;i[M+7]=o-C;i[M+1]=a+w;i[M+6]=a-w;i[M+2]=l+x;i[M+5]=l-x;i[M+3]=u+h;i[M+4]=u-h}else{R=b*k+512>>10;i[M]=R;i[M+1]=R;i[M+2]=R;i[M+3]=R;i[M+4]=R;i[M+5]=R;i[M+6]=R;i[M+7]=R}}for(var L=0;L<8;++L){k=i[L];if(0!=((S=i[L+8])|(P=i[L+16])|(T=i[L+24])|(I=i[L+32])|(E=i[L+40])|(O=i[L+48])|(A=i[L+56]))){a=(o=4112+((o=b*k+2048>>12)+(a=b*I+2048>>12)+1>>1))-a;R=(l=P)*g+(u=O)*v+2048>>12;l=l*v-u*g+2048>>12;u=R;w=(h=(h=_*(S-A)+2048>>12)+(w=E)+1>>1)-w;x=(C=(C=_*(S+A)+2048>>12)+(x=T)+1>>1)-x;R=h*y+C*m+2048>>12;h=h*m-C*y+2048>>12;C=R;R=x*p+w*d+2048>>12;x=x*d-w*p+2048>>12;(k=(o=o+u+1>>1)+C)<16?k=0:k>=4080?k=255:k>>=4;(S=(a=a+l+1>>1)+(w=R))<16?S=0:S>=4080?S=255:S>>=4;(P=(l=a-l)+x)<16?P=0:P>=4080?P=255:P>>=4;(T=(u=o-u)+h)<16?T=0:T>=4080?T=255:T>>=4;(I=u-h)<16?I=0:I>=4080?I=255:I>>=4;(E=l-x)<16?E=0:E>=4080?E=255:E>>=4;(O=a-w)<16?O=0:O>=4080?O=255:O>>=4;(A=o-C)<16?A=0:A>=4080?A=255:A>>=4;D[r+L]=k;D[r+L+8]=S;D[r+L+16]=P;D[r+L+24]=T;D[r+L+32]=I;D[r+L+40]=E;D[r+L+48]=O;D[r+L+56]=A}else{R=(R=b*k+8192>>14)<-2040?0:R>=2024?255:R+2056>>4;D[r+L]=R;D[r+L+8]=R;D[r+L+16]=R;D[r+L+24]=R;D[r+L+32]=R;D[r+L+40]=R;D[r+L+48]=R;D[r+L+56]=R}}}function buildComponentData(t,r){for(var i=r.blocksPerLine,o=r.blocksPerColumn,a=new Int16Array(64),c=0;c2&&void 0!==arguments[2]?arguments[2]:r,o=t.length-1,c=i=o)return null;var l=(0,a.readUint16)(t,r);if(l>=65472&&l<=65534)return{invalid:null,marker:l,offset:r};for(var u=(0,a.readUint16)(t,c);!(u>=65472&&u<=65534);){if(++c>=o)return null;u=(0,a.readUint16)(t,c)}return{invalid:l.toString(16),marker:u,offset:c}}var x=function(){function JpegImage(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.decodeTransform,i=void 0===r?null:r,o=t.colorTransform,a=void 0===o?-1:o;_classCallCheck(this,JpegImage);this._decodeTransform=i;this._colorTransform=a}_createClass(JpegImage,[{key:"parse",value:function parse(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.dnlScanLines,d=void 0===i?null:i;function readDataBlock(){var r=(0,a.readUint16)(t,y),i=(y+=2)+r-2,c=findNextFileMarker(t,i,y);if(c&&c.invalid){(0,o.warn)("readDataBlock - incorrect length, current marker is: "+c.invalid);i=c.offset}var l=t.subarray(y,i);y+=l.length;return l}function prepareComponents(t){for(var r=Math.ceil(t.samplesPerLine/8/t.maxH),i=Math.ceil(t.scanLines/8/t.maxV),o=0,a=t.components.length;o>4==0)for(S=0;S<64;S++)A[h[S]]=t[y++];else{if(O>>4!=1)throw new c("DQT - invalid table spec");for(S=0;S<64;S++){A[h[S]]=(0,a.readUint16)(t,y);y+=2}}_[15&O]=A}break;case 65472:case 65473:case 65474:if(p)throw new c("Only single frame JPEGs supported");y+=2;(p={}).extended=65473===C;p.progressive=65474===C;p.precision=t[y++];var R=(0,a.readUint16)(t,y);y+=2;p.scanLines=d||R;p.samplesPerLine=(0,a.readUint16)(t,y);y+=2;p.components=[];p.componentIds={};var B=t[y++],D=0,M=0;for(k=0;k>4,U=15&t[y+1];D>4==0?w:x)[15&z]=buildHuffmanTable(X,G)}break;case 65501:y+=2;m=(0,a.readUint16)(t,y);y+=2;break;case 65498:var J=1==++b&&!d;y+=2;var q=t[y++],W=[];for(k=0;k>4];Q.huffmanTableAC=x[15&Z];W.push(Q)}var $=t[y++],ee=t[y++],te=t[y++];try{var re=decodeScan(t,y,p,W,m,$,ee,te>>4,15&te,J);y+=re}catch(r){if(r instanceof l){(0,o.warn)("".concat(r.message," -- attempting to re-parse the JPEG image."));return this.parse(t,{dnlScanLines:r.scanLines})}if(r instanceof u){(0,o.warn)("".concat(r.message," -- ignoring the rest of the image data."));break e}throw r}break;case 65500:y+=4;break;case 65535:255!==t[y]&&y--;break;default:var ne=findNextFileMarker(t,y-2,y-3);if(ne&&ne.invalid){(0,o.warn)("JpegImage.parse - unexpected data, current marker is: "+ne.invalid);y=ne.offset;break}if(!ne||y>=t.length-1){(0,o.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new c("JpegImage.parse - unknown marker: "+C.toString(16))}C=(0,a.readUint16)(t,y);y+=2}this.width=p.samplesPerLine;this.height=p.scanLines;this.jfif=v;this.adobe=g;this.components=[];for(var ie=0,oe=p.components.length;ie2&&void 0!==arguments[2]&&arguments[2],b=this.width/t,_=this.height/r,x=0,w=this.components.length,C=t*r*w,k=new Uint8ClampedArray(C),S=new Uint32Array(t),P=4294967288;for(h=0;h>8)+T[p+1];return k}},{key:"_isColorConversionNeeded",get:function get(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform}},{key:"_convertYccToRgb",value:function _convertYccToRgb(t){for(var r,i,o,a=0,c=t.length;a4)throw new c("Unsupported color mode");var h=this._getLinearizedBlockData(r,i,u);if(1===this.numComponents&&a){for(var d=h.length,p=new Uint8ClampedArray(3*d),m=0,y=0;y{function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.JpxImage=void 0;var o=i(1),a=i(6),c=i(11);function _defineProperties(t,r){for(var i=0;i>24&255,h>>16&255,h>>8&255,255&h);(0,o.warn)("Unsupported header type ".concat(h," (").concat(v,")."))}p&&(i+=d)}else this.parseCodestream(t,0,t.length)}},{key:"parseImageProperties",value:function parseImageProperties(t){for(var r=t.getByte();r>=0;){if(65361===(r<<8|(r=t.getByte()))){t.skip(4);var i=t.getInt32()>>>0,o=t.getInt32()>>>0,a=t.getInt32()>>>0,c=t.getInt32()>>>0;t.skip(16);var u=t.getUint16();this.width=i-a;this.height=o-c;this.componentsCount=u;this.bitsPerComponent=8;return}}throw new l("No size marker found in JPX stream")}},{key:"parseCodestream",value:function parseCodestream(t,r,i){var c={},u=!1;try{for(var h=r;h+1>5;v=[];for(;m>3;T.mu=0}else{T.epsilon=t[m]>>3;T.mu=(7&t[m])<<8|t[m+1];m+=2}v.push(T)}P.SPqcds=v;if(c.mainHeader)c.QCD=P;else{c.currentTile.QCD=P;c.currentTile.QCC=[]}break;case 65373:p=(0,a.readUint16)(t,h);var I={};m=h+2;var E=void 0;if(c.SIZ.Csiz<257)E=t[m++];else{E=(0,a.readUint16)(t,m);m+=2}switch(31&(y=t[m++])){case 0:g=8;b=!0;break;case 1:g=16;b=!1;break;case 2:g=16;b=!0;break;default:throw new Error("Invalid SQcd value "+y)}I.noQuantization=8===g;I.scalarExpounded=b;I.guardBits=y>>5;v=[];for(;m>3;O.mu=0}else{O.epsilon=t[m]>>3;O.mu=(7&t[m])<<8|t[m+1];m+=2}v.push(O)}I.SPqcds=v;c.mainHeader?c.QCC[E]=I:c.currentTile.QCC[E]=I;break;case 65362:p=(0,a.readUint16)(t,h);var A={};m=h+2;var R=t[m++];A.entropyCoderWithCustomPrecincts=!!(1&R);A.sopMarkerUsed=!!(2&R);A.ephMarkerUsed=!!(4&R);A.progressionOrder=t[m++];A.layersCount=(0,a.readUint16)(t,m);m+=2;A.multipleComponentTransform=t[m++];A.decompositionLevelsCount=t[m++];A.xcb=2+(15&t[m++]);A.ycb=2+(15&t[m++]);var B=t[m++];A.selectiveArithmeticCodingBypass=!!(1&B);A.resetContextProbabilities=!!(2&B);A.terminationOnEachCodingPass=!!(4&B);A.verticallyStripe=!!(8&B);A.predictableTermination=!!(16&B);A.segmentationSymbolUsed=!!(32&B);A.reversibleTransformation=t[m++];if(A.entropyCoderWithCustomPrecincts){for(var D=[];m>4})}A.precinctsSizes=D}var L=[];A.selectiveArithmeticCodingBypass&&L.push("selectiveArithmeticCodingBypass");A.terminationOnEachCodingPass&&L.push("terminationOnEachCodingPass");A.verticallyStripe&&L.push("verticallyStripe");A.predictableTermination&&L.push("predictableTermination");if(L.length>0){u=!0;(0,o.warn)("JPX: Unsupported COD options (".concat(L.join(", "),")."))}if(c.mainHeader)c.COD=A;else{c.currentTile.COD=A;c.currentTile.COC=[]}break;case 65424:p=(0,a.readUint16)(t,h);(_={}).index=(0,a.readUint16)(t,h+2);_.length=(0,a.readUint32)(t,h+4);_.dataEnd=_.length+h-2;_.partIndex=t[h+8];_.partsCount=t[h+9];c.mainHeader=!1;if(0===_.partIndex){_.COD=c.COD;_.COC=c.COC.slice(0);_.QCD=c.QCD;_.QCC=c.QCC.slice(0)}c.currentTile=_;break;case 65427:if(0===(_=c.currentTile).partIndex){initializeTile(c,_.index);buildPackets(c)}parseTilePackets(c,t,h,p=_.dataEnd-h);break;case 65363:(0,o.warn)("JPX: Codestream code 0xFF53 (COC) is not implemented.");case 65365:case 65367:case 65368:case 65380:p=(0,a.readUint16)(t,h);break;default:throw new Error("Unknown codestream code: "+d.toString(16))}h+=p}}catch(t){if(u||this.failOnCorruptedImage)throw new l(t.message);(0,o.warn)('JPX: Trying to recover from: "'.concat(t.message,'".'))}this.tiles=function transformComponents(t){for(var r=t.SIZ,i=t.components,o=r.Csiz,a=[],c=0,l=t.tiles.length;c>2);m[b++]=R+k>>v;m[b++]=R>>v;m[b++]=R+C>>v}else for(_=0;_>v;m[b++]=w-.34413*C-.71414*k>>v;m[b++]=w+1.772*C>>v}if(S)for(_=0,b=3;_>v}else for(var B=0;B>v;b+=o}}a.push(y)}return a}(c);this.width=c.SIZ.Xsiz-c.SIZ.XOsiz;this.height=c.SIZ.Ysiz-c.SIZ.YOsiz;this.componentsCount=c.SIZ.Csiz}}]);return JpxImage}();r.JpxImage=h;function calculateComponentDimensions(t,r){t.x0=Math.ceil(r.XOsiz/t.XRsiz);t.x1=Math.ceil(r.Xsiz/t.XRsiz);t.y0=Math.ceil(r.YOsiz/t.YRsiz);t.y1=Math.ceil(r.Ysiz/t.YRsiz);t.width=t.x1-t.x0;t.height=t.y1-t.y0}function calculateTileGrids(t,r){for(var i,o=t.SIZ,a=[],c=Math.ceil((o.Xsiz-o.XTOsiz)/o.XTsiz),l=Math.ceil((o.Ysiz-o.YTOsiz)/o.YTsiz),u=0;u0?Math.min(o.xcb,a.PPx-1):Math.min(o.xcb,a.PPx);a.ycb_=i>0?Math.min(o.ycb,a.PPy-1):Math.min(o.ycb,a.PPy);return a}function buildPrecincts(t,r,i){var o=1<r.trx0?Math.ceil(r.trx1/o)-Math.floor(r.trx0/o):0,d=r.try1>r.try0?Math.ceil(r.try1/a)-Math.floor(r.try0/a):0,p=h*d;r.precinctParameters={precinctWidth:o,precinctHeight:a,numprecinctswide:h,numprecinctshigh:d,numprecincts:p,precinctWidthInSubband:l,precinctHeightInSubband:u}}function buildCodeblocks(t,r,i){var o,a,c,l,u=i.xcb_,h=i.ycb_,d=1<>u,y=r.tby0>>h,v=r.tbx1+d-1>>u,g=r.tby1+p-1>>h,b=r.resolution.precinctParameters,_=[],x=[];for(a=y;aw.cbxMax&&(w.cbxMax=o);aw.cbyMax&&(w.cbyMax=a)}else x[l]=w={cbxMin:o,cbyMin:a,cbxMax:o,cbyMax:a};c.precinct=w}}r.codeblockParameters={codeblockWidth:u,codeblockHeight:h,numcodeblockwide:v-m+1,numcodeblockhigh:g-y+1};r.codeblocks=_;r.precincts=x}function createPacket(t,r,i){for(var o=[],a=t.subbands,c=0,l=a.length;ct.codingStyleParameters.decompositionLevelsCount)){for(var r=t.resolutions[p],i=r.precinctParameters.numprecincts;yt.codingStyleParameters.decompositionLevelsCount)){for(var r=t.resolutions[d],i=r.precinctParameters.numprecincts;yt.codingStyleParameters.decompositionLevelsCount)){var c=t.resolutions[i],u=c.precinctParameters.numprecincts;if(!(a>=u)){for(;r=0;--_){var x=h.resolutions[_],w=b*x.precinctParameters.precinctWidth,C=b*x.precinctParameters.precinctHeight;m=Math.min(m,w);y=Math.min(y,C);v=Math.max(v,x.precinctParameters.numprecinctswide);g=Math.max(g,x.precinctParameters.numprecinctshigh);p[_]={width:w,height:C};b<<=1}i=Math.min(i,m);o=Math.min(o,y);a=Math.max(a,v);c=Math.max(c,g);l[u]={resolutions:p,minWidth:m,minHeight:y,maxNumWide:v,maxNumHigh:g}}return{components:l,minWidth:i,minHeight:o,maxNumWide:a,maxNumHigh:c}}function buildPackets(t){for(var r=t.SIZ,i=t.currentTile.index,o=t.tiles[i],a=r.Csiz,c=0;c>>(h-=t)&(1<0;){var H=C.shift();void 0===(k=H.codeblock).data&&(k.data=[]);k.data.push({data:r,start:i+u,end:i+u+H.dataLength,codingpasses:H.codingpasses});u+=H.dataLength}}}return u}function copyCoefficients(t,r,i,o,a,l,u,h,d){for(var p=o.tbx0,y=o.tby0,v=o.tbx1-o.tbx0,g=o.codeblocks,b="H"===o.type.charAt(0)?1:0,_="H"===o.type.charAt(1)?r:0,x=0,w=g.length;x=l?G:G*(1<0?1-k:0)}var B=S.subbands[E],D=u[B.type];copyCoefficients(I,P,0,B,_?1:Math.pow(2,b+D-R)*(1+A/2048),p+R-1,_,m,y)}w.push({width:P,height:T,items:I})}var M=x.calculate(w,o.tcx0,o.tcy0);return{left:o.tcx0,top:o.tcy0,width:M.width,height:M.height,items:M.items}}function initializeTile(t,r){for(var i=t.SIZ.Csiz,o=t.tiles[r],a=0;a>=1;r>>=1;o++}o--;(i=this.levels[o]).items[i.index]=a;this.currentLevel=o;delete this.value}},{key:"incrementValue",value:function incrementValue(){var t=this.levels[this.currentLevel];t.items[t.index]++}},{key:"nextLevel",value:function nextLevel(){var t=this.currentLevel,r=this.levels[t],i=r.items[r.index];if(--t<0){this.value=i;return!1}this.currentLevel=t;(r=this.levels[t]).items[r.index]=i;return!0}}]);return TagTree}(),p=function(){function InclusionTree(t,r,i){_classCallCheck(this,InclusionTree);var o=(0,a.log2)(Math.max(t,r))+1;this.levels=[];for(var c=0;ci){this.currentLevel=o;this.propagateValues();return!1}t>>=1;r>>=1;o++}this.currentLevel=o-1;return!0}},{key:"incrementValue",value:function incrementValue(t){var r=this.levels[this.currentLevel];r.items[r.index]=t+1;this.propagateValues()}},{key:"propagateValues",value:function propagateValues(){for(var t=this.currentLevel,r=this.levels[t],i=r.items[r.index];--t>=0;)(r=this.levels[t]).items[r.index]=i}},{key:"nextLevel",value:function nextLevel(){var t=this.currentLevel,r=this.levels[t],i=r.items[r.index];r.items[r.index]=255;if(--t<0)return!1;this.currentLevel=t;(r=this.levels[t]).items[r.index]=i;return!0}}]);return InclusionTree}(),m=function BitModelClosure(){var t=17,r=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),i=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),o=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);return function(){function BitModel(t,a,c,l,u){_classCallCheck(this,BitModel);this.width=t;this.height=a;var h;h="HH"===c?o:"HL"===c?i:r;this.contextLabelTable=h;var d,p=t*a;this.neighborsSignificance=new Uint8Array(p);this.coefficentsSign=new Uint8Array(p);d=u>14?new Uint32Array(p):u>6?new Uint16Array(p):new Uint8Array(p);this.coefficentsMagnitude=d;this.processingFlags=new Uint8Array(p);var m=new Uint8Array(p);if(0!==l)for(var y=0;y0,h=r+10){o=i-c;u&&(a[o-1]+=16);h&&(a[o+1]+=16);a[o]+=4}if(t+1=i)break;l[y]&=-2;if(!o[y]&&c[y]){var b=h[c[y]];if(t.readBit(u,b)){var _=this.decodeSignBit(g,m,y);a[y]=_;o[y]=1;this.setNeighborsSignificance(g,m,y);l[y]|=2}d[y]++;l[y]|=1}}}},{key:"decodeSignBit",value:function decodeSignBit(t,r,i){var o,a,c,l,u,h,d=this.width,p=this.height,m=this.coefficentsMagnitude,y=this.coefficentsSign;l=r>0&&0!==m[i-1];if(r+10&&0!==m[i-d];if(t+1=0){u=9+o;h=this.decoder.readBit(this.contexts,u)}else{u=9-o;h=1^this.decoder.readBit(this.contexts,u)}return h}},{key:"runMagnitudeRefinementPass",value:function runMagnitudeRefinementPass(){for(var t,r=this.decoder,i=this.width,o=this.height,a=this.coefficentsMagnitude,c=this.neighborsSignificance,l=this.contexts,u=this.bitsDecoded,h=this.processingFlags,d=i*o,p=4*i,m=0;m>1,h=-1.586134342059924,d=-.052980118572961,p=.882911075530934,m=.443506852043971,y=1.230174104914001;o=(r|=0)-3;for(a=u+4;a--;o+=2)t[o]*=.8128930661159609;c=m*t[(o=r-2)-1];for(a=u+3;a--;o+=2){l=m*t[o+1];t[o]=y*t[o]-c-l;if(!a--)break;c=m*t[(o+=2)+1];t[o]=y*t[o]-c-l}c=p*t[(o=r-1)-1];for(a=u+2;a--;o+=2){l=p*t[o+1];t[o]-=c+l;if(!a--)break;c=p*t[(o+=2)+1];t[o]-=c+l}c=d*t[(o=r)-1];for(a=u+1;a--;o+=2){l=d*t[o+1];t[o]-=c+l;if(!a--)break;c=d*t[(o+=2)+1];t[o]-=c+l}if(0!==u){c=h*t[(o=r+1)-1];for(a=u;a--;o+=2){l=h*t[o+1];t[o]-=c+l;if(!a--)break;c=h*t[(o+=2)+1];t[o]-=c+l}}}}]);return IrreversibleTransform}(y),g=function(t){_inherits(ReversibleTransform,t);var r=_createSuper(ReversibleTransform);function ReversibleTransform(){_classCallCheck(this,ReversibleTransform);return r.apply(this,arguments)}_createClass(ReversibleTransform,[{key:"filter",value:function filter(t,r,i){var o,a,c=i>>1;for(o=r|=0,a=c+1;a--;o+=2)t[o]-=t[o-1]+t[o+1]+2>>2;for(o=r+1,a=c;a--;o+=2)t[o]+=t[o-1]+t[o+1]>>1}}]);return ReversibleTransform}(y)}],r={};function __w_pdfjs_require__(i){var o=r[i];if(void 0!==o)return o.exports;var a=r[i]={id:i,loaded:!1,exports:{}};t[i](a,a.exports,__w_pdfjs_require__);a.loaded=!0;return a.exports}__w_pdfjs_require__.nmd=t=>{t.paths=[];t.children||(t.children=[]);return t};var i={};(()=>{var t=i;Object.defineProperty(t,"__esModule",{value:!0});Object.defineProperty(t,"Jbig2Image",{enumerable:!0,get:function get(){return o.Jbig2Image}});Object.defineProperty(t,"JpegImage",{enumerable:!0,get:function get(){return a.JpegImage}});Object.defineProperty(t,"JpxImage",{enumerable:!0,get:function get(){return c.JpxImage}});Object.defineProperty(t,"getVerbosityLevel",{enumerable:!0,get:function get(){return r.getVerbosityLevel}});Object.defineProperty(t,"setVerbosityLevel",{enumerable:!0,get:function get(){return r.setVerbosityLevel}});var r=__w_pdfjs_require__(1),o=__w_pdfjs_require__(5),a=__w_pdfjs_require__(13),c=__w_pdfjs_require__(14)})();return i})()}));