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

1 lines
606 KiB

{"version":3,"sources":["webpack://pdfjs-dist/image_decoders/pdf.image_decoders/webpack/universalModuleDefinition","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/webpack/bootstrap","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/pdf.image_decoders.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/shared/util.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/shared/compatibility.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/shared/global_scope.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/shared/is_node.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/string/starts-with.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.string.starts-with.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_export.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_global.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_core.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_hide.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-dp.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_an-object.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_is-object.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_ie8-dom-define.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_descriptors.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_fails.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_dom-create.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_to-primitive.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_property-desc.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_redefine.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_has.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_uid.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_function-to-string.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_shared.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_library.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_ctx.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_a-function.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_to-length.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_to-integer.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_string-context.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_is-regexp.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_cof.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_wks.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_defined.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_fails-is-regexp.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/string/ends-with.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.string.ends-with.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/string/includes.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.string.includes.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/array/includes.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es7.array.includes.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_array-includes.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_to-iobject.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_iobject.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_to-absolute-index.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_add-to-unscopables.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/array/from.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.string.iterator.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_string-at.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_iter-define.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_iterators.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_iter-create.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-create.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-dps.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-keys.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-keys-internal.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_shared-key.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_enum-bug-keys.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_html.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_set-to-string-tag.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-gpo.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_to-object.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.array.from.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_iter-call.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_is-array-iter.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_create-property.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/core.get-iterator-method.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_classof.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_iter-detect.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/object/assign.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.object.assign.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-assign.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-gops.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-pie.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/math/log2.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.math.log2.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/number/is-nan.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.number.is-nan.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/number/is-integer.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.number.is-integer.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_is-integer.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/weak-map.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.object.to-string.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/web.dom.iterable.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.array.iterator.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_iter-step.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.weak-map.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_array-methods.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_array-species-create.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_array-species-constructor.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_is-array.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_meta.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_collection-weak.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_redefine-all.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_an-instance.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_for-of.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_validate-collection.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_collection.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_inherit-if-required.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_set-proto.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-gopd.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es7.weak-map.of.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_set-collection-of.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es7.weak-map.from.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_set-collection-from.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/weak-set.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.weak-set.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es7.weak-set.of.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es7.weak-set.from.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/string/code-point-at.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.string.code-point-at.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/string/from-code-point.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.string.from-code-point.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/es6/symbol.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es6.symbol.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_wks-ext.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_wks-define.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_enum-keys.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-gopn-ext.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-gopn.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/string/pad-start.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es7.string.pad-start.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_string-pad.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_string-repeat.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_user-agent.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/string/pad-end.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es7.string.pad-end.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/fn/object/values.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/es7.object.values.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/node_modules/core-js/modules/_object-to-array.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/shared/streams_polyfill.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/shared/url_polyfill.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/core/jbig2.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/core/arithmetic_decoder.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/core/ccitt.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/core/jpg.js","webpack://pdfjs-dist/image_decoders/pdf.image_decoders/src/core/jpx.js"],"names":["pdfjsVersion","pdfjsBuild","IDENTITY_MATRIX","FONT_IDENTITY_MATRIX","NativeImageDecoding","NONE","DECODE","DISPLAY","PermissionFlag","PRINT","MODIFY_CONTENTS","COPY","MODIFY_ANNOTATIONS","FILL_INTERACTIVE_FORMS","COPY_FOR_ACCESSIBILITY","ASSEMBLE","PRINT_HIGH_QUALITY","TextRenderingMode","FILL","STROKE","FILL_STROKE","INVISIBLE","FILL_ADD_TO_PATH","STROKE_ADD_TO_PATH","FILL_STROKE_ADD_TO_PATH","ADD_TO_PATH","FILL_STROKE_MASK","ADD_TO_PATH_FLAG","ImageKind","GRAYSCALE_1BPP","RGB_24BPP","RGBA_32BPP","AnnotationType","TEXT","LINK","FREETEXT","LINE","SQUARE","CIRCLE","POLYGON","POLYLINE","HIGHLIGHT","UNDERLINE","SQUIGGLY","STRIKEOUT","STAMP","CARET","INK","POPUP","FILEATTACHMENT","SOUND","MOVIE","WIDGET","SCREEN","PRINTERMARK","TRAPNET","WATERMARK","THREED","REDACT","AnnotationFlag","HIDDEN","NOZOOM","NOROTATE","NOVIEW","READONLY","LOCKED","TOGGLENOVIEW","LOCKEDCONTENTS","AnnotationFieldFlag","REQUIRED","NOEXPORT","MULTILINE","PASSWORD","NOTOGGLETOOFF","RADIO","PUSHBUTTON","COMBO","EDIT","SORT","FILESELECT","MULTISELECT","DONOTSPELLCHECK","DONOTSCROLL","COMB","RICHTEXT","RADIOSINUNISON","COMMITONSELCHANGE","AnnotationBorderStyleType","SOLID","DASHED","BEVELED","INSET","StreamType","UNKNOWN","FLATE","LZW","DCT","JPX","JBIG","A85","AHX","CCF","RL","FontType","TYPE1","TYPE1C","CIDFONTTYPE0","CIDFONTTYPE0C","TRUETYPE","CIDFONTTYPE2","TYPE3","OPENTYPE","TYPE0","MMTYPE1","VerbosityLevel","ERRORS","WARNINGS","INFOS","CMapCompressionType","BINARY","STREAM","OPS","dependency","setLineWidth","setLineCap","setLineJoin","setMiterLimit","setDash","setRenderingIntent","setFlatness","setGState","save","restore","transform","moveTo","lineTo","curveTo","curveTo2","curveTo3","closePath","rectangle","stroke","closeStroke","fill","eoFill","fillStroke","eoFillStroke","closeFillStroke","closeEOFillStroke","endPath","clip","eoClip","beginText","endText","setCharSpacing","setWordSpacing","setHScale","setLeading","setFont","setTextRenderingMode","setTextRise","moveText","setLeadingMoveText","setTextMatrix","nextLine","showText","showSpacedText","nextLineShowText","nextLineSetSpacingShowText","setCharWidth","setCharWidthAndBounds","setStrokeColorSpace","setFillColorSpace","setStrokeColor","setStrokeColorN","setFillColor","setFillColorN","setStrokeGray","setFillGray","setStrokeRGBColor","setFillRGBColor","setStrokeCMYKColor","setFillCMYKColor","shadingFill","beginInlineImage","beginImageData","endInlineImage","paintXObject","markPoint","markPointProps","beginMarkedContent","beginMarkedContentProps","endMarkedContent","beginCompat","endCompat","paintFormXObjectBegin","paintFormXObjectEnd","beginGroup","endGroup","beginAnnotations","endAnnotations","beginAnnotation","endAnnotation","paintJpegXObject","paintImageMaskXObject","paintImageMaskXObjectGroup","paintImageXObject","paintInlineImageXObject","paintInlineImageXObjectGroup","paintImageXObjectRepeat","paintImageMaskXObjectRepeat","paintSolidColorImageMask","constructPath","UNSUPPORTED_FEATURES","unknown","forms","javaScript","smask","shadingPattern","font","PasswordResponses","NEED_PASSWORD","INCORRECT_PASSWORD","verbosity","Number","console","unreachable","base","other","url","absoluteUrl","baseUrl","_isValidProtocol","Object","value","enumerable","configurable","writable","PasswordException","UnknownErrorException","InvalidPDFException","MissingPDFException","UnexpectedResponseException","FormatError","AbortException","NullCharactersRegExp","warn","str","assert","bytes","length","MAX_ARGUMENT_COUNT","String","strBuf","i","chunkEnd","Math","chunk","arr","resultLength","ii","item","itemLength","arrayByteLength","pos","data","stringToBytes","x","offset","buffer8","view32","Util","rgbBuf","m1","m2","xt","p","m","yt","d","p1","p2","r","p3","p4","v","transpose","a","b","c","first","second","sx","sy","rect","orderedX","rect1","rect2","orderedY","result","PDFStringTranslateTable","n","code","decodeURIComponent","escape","unescape","encodeURIComponent","arr1","arr2","element","ch","capability","isSettled","get","resolve","reject","createObjectURL","digits","forceDataSchema","URL","blob","type","buffer","b1","b2","b3","d1","d2","d3","d4","globalScope","require","isNodeJS","hasDOM","Buffer","Element","div","document","OriginalDOMTokenListAdd","DOMTokenList","OriginalDOMTokenListRemove","token","force","arguments","Array","module","window","global","self","process","$export","toLength","context","STARTS_WITH","$startsWith","startsWith","that","index","search","core","hide","redefine","ctx","PROTOTYPE","IS_FORCED","IS_GLOBAL","IS_STATIC","IS_PROTO","IS_BIND","target","exports","expProto","source","own","out","exp","Function","__g","version","__e","dP","createDesc","object","anObject","IE8_DOM_DEFINE","toPrimitive","P","TypeError","O","Attributes","isObject","it","exec","is","S","val","fn","has","SRC","$toString","TO_STRING","TPL","isFunction","hasOwnProperty","id","px","key","SHARED","store","mode","copyright","aFunction","toInteger","min","ceil","floor","isNaN","isRegExp","defined","cof","MATCH","toString","uid","Symbol","USE_SYMBOL","$exports","re","ENDS_WITH","$endsWith","endsWith","endPosition","len","end","INCLUDES","includes","$includes","toIObject","toAbsoluteIndex","IS_INCLUDES","el","IObject","max","UNSCOPABLES","ArrayProto","$at","done","point","s","l","LIBRARY","Iterators","$iterCreate","setToStringTag","getPrototypeOf","ITERATOR","BUGGY","FF_ITERATOR","KEYS","VALUES","returnThis","getMethod","kind","proto","TAG","NAME","DEF_VALUES","DEFAULT","VALUES_BUG","Base","$native","$default","$entries","$anyNative","IteratorPrototype","methods","values","keys","IS_SET","entries","create","descriptor","Constructor","next","dPs","enumBugKeys","IE_PROTO","Empty","createDict","iframe","lt","gt","iframeDocument","Properties","getKeys","$keys","arrayIndexOf","names","shared","def","stat","toObject","ObjectProto","call","isArrayIter","createProperty","getIterFn","from","C","aLen","mapfn","mapping","iterFn","iterator","step","ret","$defineProperty","classof","ARG","tryGet","SAFE_CLOSING","riter","safe","iter","assign","DESCRIPTORS","gOPS","pIE","$assign","A","B","K","T","getSymbols","isEnum","j","log2","number","isInteger","isFinite","test","$iterators","wks","TO_STRING_TAG","ArrayValues","DOMIterables","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","collections","explicit","Collection","addToUnscopables","each","meta","weak","validate","NATIVE_WEAK_MAP","IS_IE11","WEAK_MAP","getWeak","isExtensible","uncaughtFrozenStore","wrapper","set","$WeakMap","InternalMap","method","asc","IS_MAP","TYPE","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","$create","f","res","speciesConstructor","isArray","SPECIES","original","META","setDesc","FREEZE","setMeta","w","fastKey","onFreeze","KEY","NEED","redefineAll","anInstance","forOf","createArrayMethod","$has","arrayFind","arrayFindIndex","UncaughtFrozenStore","findUncaughtFrozen","entry","getConstructor","iterable","ufstore","src","forbiddenField","name","BREAK","RETURN","fails","$iterDetect","inheritIfRequired","ADDER","fixMethod","IS_WEAK","common","instance","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","BUGGY_ZERO","$instance","setPrototypeOf","check","buggy","gOPD","of","mapFn","cb","WEAK_SET","add","codePointAt","fromCharCode","$fromCodePoint","fromCodePoint","RangeError","$fails","wksExt","wksDefine","enumKeys","_create","gOPNExt","$GOPD","$GOPS","$DP","gOPN","$Symbol","$JSON","_stringify","TO_PRIMITIVE","SymbolRegistry","AllSymbols","OPSymbols","USE_NATIVE","QObject","setter","setSymbolDesc","protoDesc","wrap","sym","isSymbol","D","$defineProperties","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","tag","$set","es6Symbols","wellKnownSymbols","k","keyFor","useSetter","useSimple","defineProperty","defineProperties","getOwnPropertyDescriptor","getOwnPropertyNames","getOwnPropertySymbols","FAILS_ON_PRIMITIVES","stringify","args","$replacer","replacer","symbols","windowNames","getWindowNames","hiddenKeys","$pad","userAgent","WEBKIT_BUG","padStart","repeat","stringLength","fillStr","fillString","intMaxLength","fillLen","stringFiller","left","navigator","padEnd","$values","isReadableStreamSupported","start","controller","constructor","isURLSupported","u","Jbig2Error","Jbig2Image","ContextCache","getContexts","DecodingContext","decoder","shadow","cache","contexts","contextCache","prev","bit","sign","readBits","codeLength","SegmentTypes","CodingTemplates","y","RefinementTemplates","coding","reference","ReusedContexts","RefinementReusedContexts","decodingContext","bitmap","OLD_PIXEL_MASK","row","row1","row2","contextLabel","pixel","input","decodeMMRBitmap","templateIndex","at","decodeBitmapTemplate0","useskip","template","templateLength","templateX","templateY","changingTemplateEntries","reuseMask","minX","maxX","minY","changingEntriesLength","changingTemplateX","changingTemplateY","changingTemplateBit","sbb_left","sbb_top","sbb_right","width","pseudoPixelContext","ltp","sltp","skip","i0","j0","shift","codingTemplate","codingTemplateLength","codingTemplateX","codingTemplateY","referenceTemplate","referenceTemplateLength","referenceTemplateX","referenceTemplateY","referenceWidth","referenceBitmap","referenceHeight","huffman","newSymbols","currentHeight","symbolCodeLength","tableB1","getStandardTable","symbolWidths","deltaHeight","huffmanTables","decodeInteger","currentWidth","totalWidth","firstSymbol","deltaWidth","numberOfInstances","decodeTextRegion","symbolId","decodeIAID","rdx","rdy","symbol","decodeRefinement","decodeBitmap","bitmapSize","huffmanInput","collectiveBitmap","readUncompressedBitmap","originalEnd","bitmapEnd","numberOfSymbolsDecoded","xMin","xMax","bitmapWidth","symbolBitmap","exportedSymbols","flags","currentFlag","totalSymbolsLength","runLength","stripT","firstS","deltaT","deltaFirstS","currentS","currentT","stripSize","t","applyRefinement","refinement","inputSymbols","symbolWidth","symbolHeight","rdw","rdh","offsetT","referenceCorner","offsetS","s2","symbolRow","maxWidth","t2","deltaS","collectiveWidth","patterns","patternBitmap","patternWidth","combinationOperator","regionBitmap","numberOfPatterns","pattern0","patternHeight","bitsPerValue","grayScaleBitPlanes","mmrInput","mg","ng","patternIndex","gridOffsetX","gridOffsetY","regionRow","patternRow","regionX","regionY","segmentHeader","readUint32","segmentType","pageAssociationFieldSize","referredFlags","referredToCount","retainBits","position","referredToSegmentNumberSize","referredTo","readUint16","genericRegionInfo","readRegionSegmentInformation","genericRegionSegmentFlags","genericRegionMmr","searchPatternLength","searchPattern","segments","readSegmentHeader","segment","header","height","RegionSegmentInformationFieldLength","dictionary","dictionaryFlags","atLength","readInt8","textRegion","textRegionSegmentFlags","textRegionHuffmanFlags","patternDictionary","patternDictionaryFlags","halftoneRegion","halftoneRegionFlags","genericRegion","pageInfo","resolutionX","resolutionY","pageSegmentFlags","callbackName","visitor","processSegment","chunks","readSegments","processSegments","bitPacked","imgData","q","mask","SimpleSegmentVisitor","onPageInformation","rowSize","info","drawBitmap","regionInfo","mask0","offset0","onImmediateGenericRegion","region","onImmediateLosslessGenericRegion","onSymbolDictionary","getSymbolDictionaryHuffmanTables","referredSegments","referredSymbols","decodeSymbolDictionary","onImmediateTextRegion","getTextRegionHuffmanTables","onImmediateLosslessTextRegion","onPatternDictionary","decodePatternDictionary","onImmediateHalftoneRegion","decodeHalftoneRegion","onImmediateLosslessHalftoneRegion","onTables","customTables","decodeTablesSegment","lineData","line","HuffmanTreeNode","buildTree","node","decodeNode","htOffset","reader","lines","HuffmanTable","decode","assignPrefixCodes","linesLength","prefixLengthMax","histogram","currentLength","firstCode","currentCode","currentTemp","lowestValue","highestValue","prefixSizeBits","rangeSizeBits","currentRangeLow","prefixLength","rangeLength","standardTablesCache","table","Reader","readBit","numBits","byteAlign","currentIndex","codes","runCodesTable","repeatedLength","numberOfRepeats","symbolIDTable","customIndex","tableFirstS","getCustomHuffmanTable","tableDeltaS","tableDeltaT","tableDeltaHeight","tableDeltaWidth","tableBitmapSize","tableAggregateInstances","params","Columns","Rows","BlackIs1","EndOfBlock","eof","currentByte","endOfBlock","lookForEOFLimit","parseChunks","parseJbig2Chunks","parse","parseJbig2","QeTable","qe","nmps","nlps","switchFlag","bp","cx_index","cx_mps","qeTableIcx","qeIcx","CCITTFaxDecoder","ccittEOL","ccittEOF","twoDimPass","twoDimHoriz","twoDimVert0","twoDimVertR1","twoDimVertL1","twoDimVertR2","twoDimVertL2","twoDimVertR3","twoDimVertL3","twoDimTable","whiteTable1","whiteTable2","blackTable1","blackTable2","blackTable3","options","eoblock","code1","readNextChar","refLine","codingLine","columns","refPos","blackPixels","code2","code3","gotEOL","bits","_addPixels","codingPos","a1","_addPixelsNeg","_findTableCode","limitValue","limit","_getTwoDimCode","_getWhiteCode","_getBlackCode","_lookBits","_eatBits","JpegError","DNLMarkerError","EOIMarkerError","JpegImage","dctZigZag","dctCos1","dctSin1","dctCos3","dctSin3","dctCos6","dctSin6","dctSqrt2","dctSqrt1d2","decodeTransform","colorTransform","codeLengths","children","parseDNLMarker","mcusPerLine","frame","progressive","startOffset","bitsData","bitsCount","nextByte","scanLines","receive","decodeHuffman","component","diff","receiveAndExtend","rs","z","eobrun","e","successiveACState","offsetZ","successiveACNextValue","mcuRow","mcu","mcuCol","blockRow","blockCol","getBlockBufferOffset","componentsLength","components","spectralStart","decodeFn","successivePrev","mcuExpected","mcuToRead","resetInterval","decodeBlock","h","decodeMcu","fileMarker","findNextFileMarker","marker","qt","blockData","p0","blockBufferOffset","p5","p6","p7","v0","v1","v2","v3","v4","v7","v5","v6","col","blocksPerLine","blocksPerColumn","computationBuffer","quantizeAndInverse","startPos","maxPos","newPos","currentPos","currentMarker","peekUint16","invalid","newMarker","dnlScanLines","endOffset","array","mcusPerColumn","blocksPerLineForMcu","blocksPerColumnForMcu","blocksBufferSize","jfif","adobe","numSOSMarkers","quantizationTables","huffmanTablesAC","huffmanTablesDC","appData","readDataBlock","major","minor","densityUnits","xDensity","yDensity","thumbWidth","thumbHeight","thumbData","flags0","flags1","transformCode","quantizationTablesLength","quantizationTablesEnd","quantizationTableSpec","tableData","sofScanLines","componentsCount","maxH","maxV","componentId","qId","quantizationId","quantizationTable","prepareComponents","huffmanLength","huffmanTableSpec","codeLengthSum","huffmanValues","buildHuffmanTable","selectorsCount","componentIndex","tableSpec","spectralEnd","successiveApproximation","processed","decodeScan","ex","nextFileMarker","output","buildComponentData","scaleX","scaleY","_getLinearizedBlockData","isSourcePDF","numComponents","dataLength","xScaleBlockOffset","mask3LSB","componentScaleX","componentScaleY","blocksPerScanline","_convertYccToRgb","Y","Cb","Cr","_convertYcckToRgb","_convertYcckToCmyk","_convertCmykToRgb","scale","getData","forceRGB","rgbData","grayColor","JpxError","JpxImage","SubbandsGainLog2","head","headerSize","lbox","tbox","jumpDataLength","colorspace","headerType","parseImageProperties","newByte","stream","oldByte","Xsiz","Ysiz","XOsiz","YOsiz","Csiz","parseCodestream","doNotRecover","siz","precision","isSigned","XRsiz","YRsiz","calculateComponentDimensions","calculateTileGrids","qcd","sqcd","spqcdSize","scalarExpounded","spqcds","spqcd","qcc","cqcc","cod","scod","blockStyle","precinctsSizes","precinctsSize","PPx","PPy","unsupported","tile","initializeTile","buildPackets","parseTilePackets","transformComponents","tiles","numXtiles","numYtiles","jj","tileComponent","codOrCoc","precinctWidth","dimensions","precinctHeight","isZeroRes","resolution","precinctWidthInSubband","precinctHeightInSubband","numprecinctswide","numprecinctshigh","numprecincts","xcb_","ycb_","codeblockWidth","codeblockHeight","cbx0","subband","cby0","cbx1","cby1","precinctParameters","codeblocks","precincts","codeblock","cbx","cby","tbx0","tby0","tbx1","tby1","pi","pj","precinctNumber","precinct","cbxMin","cbyMin","cbxMax","cbyMax","numcodeblockwide","numcodeblockhigh","precinctCodeblocks","subbands","layerNumber","tileIndex","layersCount","maxDecompositionLevelsCount","packet","createPacket","maxNumPrecinctsInLevel","maxNumPrecincts","resolutions","getPrecinctSizesInImageScale","precinctsIterationSizes","py","decompositionLevelsCount","sizeInImageScale","getPrecinctIndexIfExist","posX","pxIndex","precinctIterationSizes","posY","pyIndex","startPrecinctRowIndex","minWidth","minHeight","maxNumWide","maxNumHigh","sizePerComponent","sizePerResolution","minWidthCurrentComponent","minHeightCurrentComponent","maxNumWideCurrentComponent","maxNumHighCurrentComponent","widthCurrentResolution","heightCurrentResolution","blocksDimensions","getBlocksDimensions","buildPrecincts","buildCodeblocks","bscale","resolutionSubbands","progressionOrder","bufferSize","skipNextBit","skipBytes","sopMarkerUsed","ephMarkerUsed","packetsIterator","alignToByte","skipMarkerIfEqual","queue","codeblockColumn","codeblockRow","codeblockIncluded","firstTimeInclusion","inclusionTree","zeroBitPlanesTree","valueReady","codingpasses","readCodingpasses","codingpassesLog2","codedDataLength","packetItem","x0","y0","right","bottom","blockWidth","blockHeight","bitModel","currentCodingpassType","totalLength","dataItem","encodedData","magnitude","bitsDecoded","magnitudeCorrection","reversible","interleave","levelOffset","nb","coefficients","mb","codingStyleParameters","quantizationParameters","guardBits","segmentationSymbolUsed","subbandCoefficients","mu","epsilon","gainLog2","delta","copyCoefficients","items","top","resultImages","transformedTiles","transformTile","tile0","fourComponents","y0items","y1items","y2items","y3items","component0","alpha01","y1","y2","g","qcdOrQcc","TagTree","levelsLength","level","reset","currentLevel","incrementValue","nextLevel","InclusionTree","stopValue","propagateValues","levelIndex","currentValue","BitModel","UNIFORM_CONTEXT","RUNLENGTH_CONTEXT","LLAndLHContextsLabel","HLContextLabel","HHContextLabel","coefficientCount","zeroBitPlanes","setDecoder","setNeighborsSignificance","neighborsSignificance","column","runSignificancePropagationPass","coefficentsMagnitude","coefficentsSign","processingFlags","labels","processedInverseMask","processedMask","firstMagnitudeBitMask","i1","decision","decodeSignBit","significance1","sign1","sign0","contribution","horizontalContribution","decoded","runMagnitudeRefinementPass","width4","index0","indexNext","significance","runCleanupPass","oneRowDown","twoRowsDown","threeRowsDown","iNext","indexBase","checkAllEmpty","allEmpty","hasSignificantCoefficent","i2","checkSegmentationSymbol","Transform","ll","j1","j2","llWidth","llHeight","llItems","hl_lh_hh","bufferPadding","rowBuffer","numBuffers","colBuffers","currentBuffer","IrreversibleTransform","alpha","beta","gamma","K_","current","ReversibleTransform"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;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if(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"pdfjs-dist/image_decoders/pdf.image_decoders\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pdfjs-dist/image_decoders/pdf.image_decoders\"] = factory();\n\telse\n\t\troot[\"pdfjs-dist/image_decoders/pdf.image_decoders\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __w_pdfjs_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__w_pdfjs_require__.m = modules;\n\n \t// expose the module cache\n \t__w_pdfjs_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__w_pdfjs_require__.d = function(exports, name, getter) {\n \t\tif(!__w_pdfjs_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__w_pdfjs_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__w_pdfjs_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __w_pdfjs_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__w_pdfjs_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __w_pdfjs_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__w_pdfjs_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__w_pdfjs_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__w_pdfjs_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__w_pdfjs_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __w_pdfjs_require__(__w_pdfjs_require__.s = 0);\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable no-unused-vars */\n\nimport { getVerbosityLevel, setVerbosityLevel } from './shared/util';\nimport { Jbig2mage } from './core/jbig2';\nimport { JpegImage } from './core/jpg';\nimport { JpxImage } from './core/jpx';\n\n// To ensure that the standalone PDF.js image decoders have the same\n// browser/environment compatibility as the regular PDF.js library,\n// the standard set of polyfills are thus included in this build as well.\n//\n// Given that the (current) image decoders don't use all of the features\n// of the complete PDF.js library, e.g. they are completely synchronous,\n// some of the larger polyfills are thus unnecessary.\n//\n// In an attempt to reduce the size of the standalone PDF.js image decoders,\n// the following polyfills are currently being excluded:\n// - ReadableStream\n// - Promise\n// - URL\n\nconst pdfjsVersion = PDFJSDev.eval('BUNDLE_VERSION');\nconst pdfjsBuild = PDFJSDev.eval('BUNDLE_BUILD');\n\nexport {\n Jbig2mage,\n JpegImage,\n JpxImage,\n getVerbosityLevel,\n setVerbosityLevel,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport './compatibility';\nimport { ReadableStream } from './streams_polyfill';\nimport { URL } from './url_polyfill';\n\nconst IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\n\nconst NativeImageDecoding = {\n NONE: 'none',\n DECODE: 'decode',\n DISPLAY: 'display',\n};\n\n// Permission flags from Table 22, Section 7.6.3.2 of the PDF specification.\nconst PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800,\n};\n\nconst TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4,\n};\n\nconst ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3,\n};\n\nconst AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26,\n};\n\nconst AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200,\n};\n\nconst AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000,\n};\n\nconst AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5,\n};\n\nconst StreamType = {\n UNKNOWN: 0,\n FLATE: 1,\n LZW: 2,\n DCT: 3,\n JPX: 4,\n JBIG: 5,\n A85: 6,\n AHX: 7,\n CCF: 8,\n RL: 9,\n};\n\nconst FontType = {\n UNKNOWN: 0,\n TYPE1: 1,\n TYPE1C: 2,\n CIDFONTTYPE0: 3,\n CIDFONTTYPE0C: 4,\n TRUETYPE: 5,\n CIDFONTTYPE2: 6,\n TYPE3: 7,\n OPENTYPE: 8,\n TYPE0: 9,\n MMTYPE1: 10,\n};\n\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5,\n};\n\nconst CMapCompressionType = {\n NONE: 0,\n BINARY: 1,\n STREAM: 2,\n};\n\n// All the possible operations for an operator list.\nconst OPS = {\n // Intentionally start from 1 so it is easy to spot bad operators that will be\n // 0's.\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n beginAnnotations: 78,\n endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91,\n};\n\nconst UNSUPPORTED_FEATURES = {\n unknown: 'unknown',\n forms: 'forms',\n javaScript: 'javaScript',\n smask: 'smask',\n shadingPattern: 'shadingPattern',\n font: 'font',\n};\n\nconst PasswordResponses = {\n NEED_PASSWORD: 1,\n INCORRECT_PASSWORD: 2,\n};\n\nlet verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n if (Number.isInteger(level)) {\n verbosity = level;\n }\n}\n\nfunction getVerbosityLevel() {\n return verbosity;\n}\n\n// A notice for devs. These are good for things that are helpful to devs, such\n// as warning that Workers were disabled, which is important to devs but not\n// end users.\nfunction info(msg) {\n if (verbosity >= VerbosityLevel.INFOS) {\n console.log('Info: ' + msg);\n }\n}\n\n// Non-fatal warnings.\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n console.log('Warning: ' + msg);\n }\n}\n\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\n// Checks if URLs have the same origin. For non-HTTP based URLs, returns false.\nfunction isSameOrigin(baseUrl, otherUrl) {\n try {\n var base = new URL(baseUrl);\n if (!base.origin || base.origin === 'null') {\n return false; // non-HTTP url\n }\n } catch (e) {\n return false;\n }\n\n var other = new URL(otherUrl, base);\n return base.origin === other.origin;\n}\n\n// Checks if URLs use one of the whitelisted protocols, e.g. to avoid XSS.\nfunction _isValidProtocol(url) {\n if (!url) {\n return false;\n }\n switch (url.protocol) {\n case 'http:':\n case 'https:':\n case 'ftp:':\n case 'mailto:':\n case 'tel:':\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Attempts to create a valid absolute URL.\n *\n * @param {URL|string} url - An absolute, or relative, URL.\n * @param {URL|string} baseUrl - An absolute URL.\n * @returns Either a valid {URL}, or `null` otherwise.\n */\nfunction createValidAbsoluteUrl(url, baseUrl) {\n if (!url) {\n return null;\n }\n try {\n var absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n if (_isValidProtocol(absoluteUrl)) {\n return absoluteUrl;\n }\n } catch (ex) { /* `new URL()` will throw on incorrect data. */ }\n return null;\n}\n\nfunction shadow(obj, prop, value) {\n Object.defineProperty(obj, prop, { value,\n enumerable: true,\n configurable: true,\n writable: false, });\n return value;\n}\n\nvar PasswordException = (function PasswordExceptionClosure() {\n function PasswordException(msg, code) {\n this.name = 'PasswordException';\n this.message = msg;\n this.code = code;\n }\n\n PasswordException.prototype = new Error();\n PasswordException.constructor = PasswordException;\n\n return PasswordException;\n})();\n\nvar UnknownErrorException = (function UnknownErrorExceptionClosure() {\n function UnknownErrorException(msg, details) {\n this.name = 'UnknownErrorException';\n this.message = msg;\n this.details = details;\n }\n\n UnknownErrorException.prototype = new Error();\n UnknownErrorException.constructor = UnknownErrorException;\n\n return UnknownErrorException;\n})();\n\nvar InvalidPDFException = (function InvalidPDFExceptionClosure() {\n function InvalidPDFException(msg) {\n this.name = 'InvalidPDFException';\n this.message = msg;\n }\n\n InvalidPDFException.prototype = new Error();\n InvalidPDFException.constructor = InvalidPDFException;\n\n return InvalidPDFException;\n})();\n\nvar MissingPDFException = (function MissingPDFExceptionClosure() {\n function MissingPDFException(msg) {\n this.name = 'MissingPDFException';\n this.message = msg;\n }\n\n MissingPDFException.prototype = new Error();\n MissingPDFException.constructor = MissingPDFException;\n\n return MissingPDFException;\n})();\n\nvar UnexpectedResponseException =\n (function UnexpectedResponseExceptionClosure() {\n function UnexpectedResponseException(msg, status) {\n this.name = 'UnexpectedResponseException';\n this.message = msg;\n this.status = status;\n }\n\n UnexpectedResponseException.prototype = new Error();\n UnexpectedResponseException.constructor = UnexpectedResponseException;\n\n return UnexpectedResponseException;\n})();\n\n/**\n * Error caused during parsing PDF data.\n */\nlet FormatError = (function FormatErrorClosure() {\n function FormatError(msg) {\n this.message = msg;\n }\n\n FormatError.prototype = new Error();\n FormatError.prototype.name = 'FormatError';\n FormatError.constructor = FormatError;\n\n return FormatError;\n})();\n\n/**\n * Error used to indicate task cancellation.\n */\nlet AbortException = (function AbortExceptionClosure() {\n function AbortException(msg) {\n this.name = 'AbortException';\n this.message = msg;\n }\n\n AbortException.prototype = new Error();\n AbortException.constructor = AbortException;\n\n return AbortException;\n})();\n\nvar NullCharactersRegExp = /\\x00/g;\n\nfunction removeNullCharacters(str) {\n if (typeof str !== 'string') {\n warn('The argument for removeNullCharacters must be a string.');\n return str;\n }\n return str.replace(NullCharactersRegExp, '');\n}\n\nfunction bytesToString(bytes) {\n assert(bytes !== null && typeof bytes === 'object' &&\n bytes.length !== undefined, 'Invalid argument for bytesToString');\n var length = bytes.length;\n var MAX_ARGUMENT_COUNT = 8192;\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n var strBuf = [];\n for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n var chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n return strBuf.join('');\n}\n\nfunction stringToBytes(str) {\n assert(typeof str === 'string', 'Invalid argument for stringToBytes');\n var length = str.length;\n var bytes = new Uint8Array(length);\n for (var i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xFF;\n }\n return bytes;\n}\n\n/**\n * Gets length of the array (Array, Uint8Array, or string) in bytes.\n * @param {Array|Uint8Array|string} arr\n * @returns {number}\n */\nfunction arrayByteLength(arr) {\n if (arr.length !== undefined) {\n return arr.length;\n }\n assert(arr.byteLength !== undefined);\n return arr.byteLength;\n}\n\n/**\n * Combines array items (arrays) into single Uint8Array object.\n * @param {Array} arr - the array of the arrays (Array, Uint8Array, or string).\n * @returns {Uint8Array}\n */\nfunction arraysToBytes(arr) {\n // Shortcut: if first and only item is Uint8Array, return it.\n if (arr.length === 1 && (arr[0] instanceof Uint8Array)) {\n return arr[0];\n }\n var resultLength = 0;\n var i, ii = arr.length;\n var item, itemLength;\n for (i = 0; i < ii; i++) {\n item = arr[i];\n itemLength = arrayByteLength(item);\n resultLength += itemLength;\n }\n var pos = 0;\n var data = new Uint8Array(resultLength);\n for (i = 0; i < ii; i++) {\n item = arr[i];\n if (!(item instanceof Uint8Array)) {\n if (typeof item === 'string') {\n item = stringToBytes(item);\n } else {\n item = new Uint8Array(item);\n }\n }\n itemLength = item.byteLength;\n data.set(item, pos);\n pos += itemLength;\n }\n return data;\n}\n\nfunction string32(value) {\n return String.fromCharCode((value >> 24) & 0xff, (value >> 16) & 0xff,\n (value >> 8) & 0xff, value & 0xff);\n}\n\n// Calculate the base 2 logarithm of the number `x`. This differs from the\n// native function in the sense that it returns the ceiling value and that it\n// returns 0 instead of `Infinity`/`NaN` for `x` values smaller than/equal to 0.\nfunction log2(x) {\n if (x <= 0) {\n return 0;\n }\n return Math.ceil(Math.log2(x));\n}\n\nfunction readInt8(data, start) {\n return (data[start] << 24) >> 24;\n}\n\nfunction readUint16(data, offset) {\n return (data[offset] << 8) | data[offset + 1];\n}\n\nfunction readUint32(data, offset) {\n return ((data[offset] << 24) | (data[offset + 1] << 16) |\n (data[offset + 2] << 8) | data[offset + 3]) >>> 0;\n}\n\n// Lazy test the endianness of the platform\n// NOTE: This will be 'true' for simulated TypedArrays\nfunction isLittleEndian() {\n var buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n var view32 = new Uint32Array(buffer8.buffer, 0, 1);\n return (view32[0] === 1);\n}\n\n// Checks if it's possible to eval JS expressions.\nfunction isEvalSupported() {\n try {\n new Function(''); // eslint-disable-line no-new, no-new-func\n return true;\n } catch (e) {\n return false;\n }\n}\n\nvar Util = (function UtilClosure() {\n function Util() {}\n\n var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')'];\n\n // makeCssRgb() can be called thousands of times. Using |rgbBuf| avoids\n // creating many intermediate strings.\n Util.makeCssRgb = function Util_makeCssRgb(r, g, b) {\n rgbBuf[1] = r;\n rgbBuf[3] = g;\n rgbBuf[5] = b;\n return rgbBuf.join('');\n };\n\n // Concatenates two transformation matrices together and returns the result.\n Util.transform = function Util_transform(m1, m2) {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5]\n ];\n };\n\n // For 2d affine transforms\n Util.applyTransform = function Util_applyTransform(p, m) {\n var xt = p[0] * m[0] + p[1] * m[2] + m[4];\n var yt = p[0] * m[1] + p[1] * m[3] + m[5];\n return [xt, yt];\n };\n\n Util.applyInverseTransform = function Util_applyInverseTransform(p, m) {\n var d = m[0] * m[3] - m[1] * m[2];\n var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n return [xt, yt];\n };\n\n // Applies the transform to the rectangle and finds the minimum axially\n // aligned bounding box.\n Util.getAxialAlignedBoundingBox =\n function Util_getAxialAlignedBoundingBox(r, m) {\n\n var p1 = Util.applyTransform(r, m);\n var p2 = Util.applyTransform(r.slice(2, 4), m);\n var p3 = Util.applyTransform([r[0], r[3]], m);\n var p4 = Util.applyTransform([r[2], r[1]], m);\n return [\n Math.min(p1[0], p2[0], p3[0], p4[0]),\n Math.min(p1[1], p2[1], p3[1], p4[1]),\n Math.max(p1[0], p2[0], p3[0], p4[0]),\n Math.max(p1[1], p2[1], p3[1], p4[1])\n ];\n };\n\n Util.inverseTransform = function Util_inverseTransform(m) {\n var d = m[0] * m[3] - m[1] * m[2];\n return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d,\n (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d];\n };\n\n // Apply a generic 3d matrix M on a 3-vector v:\n // | a b c | | X |\n // | d e f | x | Y |\n // | g h i | | Z |\n // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i],\n // with v as [X,Y,Z]\n Util.apply3dTransform = function Util_apply3dTransform(m, v) {\n return [\n m[0] * v[0] + m[1] * v[1] + m[2] * v[2],\n m[3] * v[0] + m[4] * v[1] + m[5] * v[2],\n m[6] * v[0] + m[7] * v[1] + m[8] * v[2]\n ];\n };\n\n // This calculation uses Singular Value Decomposition.\n // The SVD can be represented with formula A = USV. We are interested in the\n // matrix S here because it represents the scale values.\n Util.singularValueDecompose2dScale =\n function Util_singularValueDecompose2dScale(m) {\n\n var transpose = [m[0], m[2], m[1], m[3]];\n\n // Multiply matrix m with its transpose.\n var a = m[0] * transpose[0] + m[1] * transpose[2];\n var b = m[0] * transpose[1] + m[1] * transpose[3];\n var c = m[2] * transpose[0] + m[3] * transpose[2];\n var d = m[2] * transpose[1] + m[3] * transpose[3];\n\n // Solve the second degree polynomial to get roots.\n var first = (a + d) / 2;\n var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2;\n var sx = first + second || 1;\n var sy = first - second || 1;\n\n // Scale values are the square roots of the eigenvalues.\n return [Math.sqrt(sx), Math.sqrt(sy)];\n };\n\n // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2)\n // For coordinate systems whose origin lies in the bottom-left, this\n // means normalization to (BL,TR) ordering. For systems with origin in the\n // top-left, this means (TL,BR) ordering.\n Util.normalizeRect = function Util_normalizeRect(rect) {\n var r = rect.slice(0); // clone rect\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n return r;\n };\n\n // Returns a rectangle [x1, y1, x2, y2] corresponding to the\n // intersection of rect1 and rect2. If no intersection, returns 'false'\n // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2]\n Util.intersect = function Util_intersect(rect1, rect2) {\n function compare(a, b) {\n return a - b;\n }\n\n // Order points along the axes\n var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare),\n orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare),\n result = [];\n\n rect1 = Util.normalizeRect(rect1);\n rect2 = Util.normalizeRect(rect2);\n\n // X: first and second points belong to different rectangles?\n if ((orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) ||\n (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])) {\n // Intersection must be between second and third points\n result[0] = orderedX[1];\n result[2] = orderedX[2];\n } else {\n return false;\n }\n\n // Y: first and second points belong to different rectangles?\n if ((orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) ||\n (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])) {\n // Intersection must be between second and third points\n result[1] = orderedY[1];\n result[3] = orderedY[2];\n } else {\n return false;\n }\n\n return result;\n };\n\n return Util;\n})();\n\nconst PDFStringTranslateTable = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0,\n 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,\n 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,\n 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,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014,\n 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C,\n 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160,\n 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC\n];\n\nfunction stringToPDFString(str) {\n var i, n = str.length, strBuf = [];\n if (str[0] === '\\xFE' && str[1] === '\\xFF') {\n // UTF16BE BOM\n for (i = 2; i < n; i += 2) {\n strBuf.push(String.fromCharCode(\n (str.charCodeAt(i) << 8) | str.charCodeAt(i + 1)));\n }\n } else {\n for (i = 0; i < n; ++i) {\n var code = PDFStringTranslateTable[str.charCodeAt(i)];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n }\n return strBuf.join('');\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isEmptyObj(obj) {\n for (var key in obj) {\n return false;\n }\n return true;\n}\n\nfunction isBool(v) {\n return typeof v === 'boolean';\n}\n\nfunction isNum(v) {\n return typeof v === 'number';\n}\n\nfunction isString(v) {\n return typeof v === 'string';\n}\n\nfunction isArrayBuffer(v) {\n return typeof v === 'object' && v !== null && v.byteLength !== undefined;\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n return arr1.every(function(element, index) {\n return element === arr2[index];\n });\n}\n\n// Checks if ch is one of the following characters: SPACE, TAB, CR or LF.\nfunction isSpace(ch) {\n return (ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A);\n}\n\n/**\n * Promise Capability object.\n *\n * @typedef {Object} PromiseCapability\n * @property {Promise} promise - A Promise object.\n * @property {boolean} settled - If the Promise has been fulfilled/rejected.\n * @property {function} resolve - Fulfills the Promise.\n * @property {function} reject - Rejects the Promise.\n */\n\n/**\n * Creates a promise capability object.\n * @alias createPromiseCapability\n *\n * @return {PromiseCapability}\n */\nfunction createPromiseCapability() {\n const capability = Object.create(null);\n let isSettled = false;\n\n Object.defineProperty(capability, 'settled', {\n get() {\n return isSettled;\n },\n });\n capability.promise = new Promise(function(resolve, reject) {\n capability.resolve = function(data) {\n isSettled = true;\n resolve(data);\n };\n capability.reject = function(reason) {\n isSettled = true;\n reject(reason);\n };\n });\n return capability;\n}\n\nvar createObjectURL = (function createObjectURLClosure() {\n // Blob/createObjectURL is not available, falling back to data schema.\n var digits =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n return function createObjectURL(data, contentType, forceDataSchema = false) {\n if (!forceDataSchema && URL.createObjectURL) {\n const blob = new Blob([data], { type: contentType, });\n return URL.createObjectURL(blob);\n }\n\n var buffer = 'data:' + contentType + ';base64,';\n for (var i = 0, ii = data.length; i < ii; i += 3) {\n var b1 = data[i] & 0xFF;\n var b2 = data[i + 1] & 0xFF;\n var b3 = data[i + 2] & 0xFF;\n var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4);\n var d3 = i + 1 < ii ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64;\n var d4 = i + 2 < ii ? (b3 & 0x3F) : 64;\n buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4];\n }\n return buffer;\n };\n})();\n\nexport {\n FONT_IDENTITY_MATRIX,\n IDENTITY_MATRIX,\n OPS,\n VerbosityLevel,\n UNSUPPORTED_FEATURES,\n AnnotationBorderStyleType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationType,\n FontType,\n ImageKind,\n CMapCompressionType,\n AbortException,\n InvalidPDFException,\n MissingPDFException,\n NativeImageDecoding,\n PasswordException,\n PasswordResponses,\n PermissionFlag,\n StreamType,\n TextRenderingMode,\n UnexpectedResponseException,\n UnknownErrorException,\n Util,\n FormatError,\n arrayByteLength,\n arraysToBytes,\n assert,\n bytesToString,\n createPromiseCapability,\n createObjectURL,\n getVerbosityLevel,\n info,\n isArrayBuffer,\n isArrayEqual,\n isBool,\n isEmptyObj,\n isNum,\n isString,\n isSpace,\n isSameOrigin,\n createValidAbsoluteUrl,\n isLittleEndian,\n isEvalSupported,\n log2,\n readInt8,\n readUint16,\n readUint32,\n removeNullCharacters,\n ReadableStream,\n URL,\n setVerbosityLevel,\n shadow,\n string32,\n stringToBytes,\n stringToPDFString,\n stringToUTF8String,\n utf8StringToString,\n warn,\n unreachable,\n};\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst globalScope = require('./global_scope');\n\n// Skip compatibility checks for the extensions and if we already ran\n// this module.\nif ((typeof PDFJSDev === 'undefined' ||\n !PDFJSDev.test('FIREFOX || MOZCENTRAL')) &&\n !globalScope._pdfjsCompatibilityChecked) {\n\nglobalScope._pdfjsCompatibilityChecked = true;\n\nconst isNodeJS = require('./is_node');\n\nconst hasDOM = typeof window === 'object' && typeof document === 'object';\n\n// Support: Node.js\n(function checkNodeBtoa() {\n if (globalScope.btoa || !isNodeJS()) {\n return;\n }\n globalScope.btoa = function(chars) {\n // eslint-disable-next-line no-undef\n return Buffer.from(chars, 'binary').toString('base64');\n };\n})();\n\n// Support: Node.js\n(function checkNodeAtob() {\n if (globalScope.atob || !isNodeJS()) {\n return;\n }\n globalScope.atob = function(input) {\n // eslint-disable-next-line no-undef\n return Buffer.from(input, 'base64').toString('binary');\n };\n})();\n\n// Provides support for ChildNode.remove in legacy browsers.\n// Support: IE.\n(function checkChildNodeRemove() {\n if (!hasDOM) {\n return;\n }\n if (typeof Element.prototype.remove !== 'undefined') {\n return;\n }\n Element.prototype.remove = function () {\n if (this.parentNode) {\n // eslint-disable-next-line mozilla/avoid-removeChild\n this.parentNode.removeChild(this);\n }\n };\n})();\n\n// Provides support for DOMTokenList.prototype.{add, remove}, with more than\n// one parameter, in legacy browsers.\n// Support: IE\n(function checkDOMTokenListAddRemove() {\n if (!hasDOM || isNodeJS()) {\n return;\n }\n const div = document.createElement('div');\n div.classList.add('testOne', 'testTwo');\n\n if (div.classList.contains('testOne') === true &&\n div.classList.contains('testTwo') === true) {\n return;\n }\n const OriginalDOMTokenListAdd = DOMTokenList.prototype.add;\n const OriginalDOMTokenListRemove = DOMTokenList.prototype.remove;\n\n DOMTokenList.prototype.add = function(...tokens) {\n for (let token of tokens) {\n OriginalDOMTokenListAdd.call(this, token);\n }\n };\n DOMTokenList.prototype.remove = function(...tokens) {\n for (let token of tokens) {\n OriginalDOMTokenListRemove.call(this, token);\n }\n };\n})();\n\n// Provides support for DOMTokenList.prototype.toggle, with the optional\n// \"force\" parameter, in legacy browsers.\n// Support: IE\n(function checkDOMTokenListToggle() {\n if (!hasDOM || isNodeJS()) {\n return;\n }\n const div = document.createElement('div');\n if (div.classList.toggle('test', 0) === false) {\n return;\n }\n\n DOMTokenList.prototype.toggle = function(token) {\n let force = (arguments.length > 1 ? !!arguments[1] : !this.contains(token));\n return (this[force ? 'add' : 'remove'](token), force);\n };\n})();\n\n// Provides support for String.prototype.startsWith in legacy browsers.\n// Support: IE, Chrome<41\n(function checkStringStartsWith() {\n if (String.prototype.startsWith) {\n return;\n }\n require('core-js/fn/string/starts-with');\n})();\n\n// Provides support for String.prototype.endsWith in legacy browsers.\n// Support: IE, Chrome<41\n(function checkStringEndsWith() {\n if (String.prototype.endsWith) {\n return;\n }\n require('core-js/fn/string/ends-with');\n})();\n\n// Provides support for String.prototype.includes in legacy browsers.\n// Support: IE, Chrome<41\n(function checkStringIncludes() {\n if (String.prototype.includes) {\n return;\n }\n require('core-js/fn/string/includes');\n})();\n\n// Provides support for Array.prototype.includes in legacy browsers.\n// Support: IE, Chrome<47\n(function checkArrayIncludes() {\n if (Array.prototype.includes) {\n return;\n }\n require('core-js/fn/array/includes');\n})();\n\n// Provides support for Array.from in legacy browsers.\n// Support: IE\n(function checkArrayFrom() {\n if (Array.from) {\n return;\n }\n require('core-js/fn/array/from');\n})();\n\n// Provides support for Object.assign in legacy browsers.\n// Support: IE\n(function checkObjectAssign() {\n if (Object.assign) {\n return;\n }\n require('core-js/fn/object/assign');\n})();\n\n// Provides support for Math.log2 in legacy browsers.\n// Support: IE, Chrome<38\n(function checkMathLog2() {\n if (Math.log2) {\n return;\n }\n Math.log2 = require('core-js/fn/math/log2');\n})();\n\n// Provides support for Number.isNaN in legacy browsers.\n// Support: IE.\n(function checkNumberIsNaN() {\n if (Number.isNaN) {\n return;\n }\n Number.isNaN = require('core-js/fn/number/is-nan');\n})();\n\n// Provides support for Number.isInteger in legacy browsers.\n// Support: IE, Chrome<34\n(function checkNumberIsInteger() {\n if (Number.isInteger) {\n return;\n }\n Number.isInteger = require('core-js/fn/number/is-integer');\n})();\n\n// Support: IE, Safari<11, Chrome<63\n(function checkPromise() {\n if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('IMAGE_DECODERS')) {\n // The current image decoders are synchronous, hence `Promise` shouldn't\n // need to be polyfilled for the IMAGE_DECODERS build target.\n return;\n }\n if (globalScope.Promise && (globalScope.Promise.prototype &&\n globalScope.Promise.prototype.finally)) {\n return;\n }\n globalScope.Promise = require('core-js/fn/promise');\n})();\n\n// Support: IE<11, Safari<8, Chrome<36\n(function checkWeakMap() {\n if (globalScope.WeakMap) {\n return;\n }\n globalScope.WeakMap = require('core-js/fn/weak-map');\n})();\n\n// Support: IE11\n(function checkWeakSet() {\n if (globalScope.WeakSet) {\n return;\n }\n globalScope.WeakSet = require('core-js/fn/weak-set');\n})();\n\n// Provides support for String.codePointAt in legacy browsers.\n// Support: IE11.\n(function checkStringCodePointAt() {\n if (String.codePointAt) {\n return;\n }\n String.codePointAt = require('core-js/fn/string/code-point-at');\n})();\n\n// Provides support for String.fromCodePoint in legacy browsers.\n// Support: IE11.\n(function checkStringFromCodePoint() {\n if (String.fromCodePoint) {\n return;\n }\n String.fromCodePoint = require('core-js/fn/string/from-code-point');\n})();\n\n// Support: IE\n(function checkSymbol() {\n if (globalScope.Symbol) {\n return;\n }\n require('core-js/es6/symbol');\n})();\n\n// Provides support for String.prototype.padStart in legacy browsers.\n// Support: IE, Chrome<57\n(function checkStringPadStart() {\n if (String.prototype.padStart) {\n return;\n }\n require('core-js/fn/string/pad-start');\n})();\n\n// Provides support for String.prototype.padEnd in legacy browsers.\n// Support: IE, Chrome<57\n(function checkStringPadEnd() {\n if (String.prototype.padEnd) {\n return;\n }\n require('core-js/fn/string/pad-end');\n})();\n\n// Provides support for Object.values in legacy browsers.\n// Support: IE, Chrome<54\n(function checkObjectValues() {\n if (Object.values) {\n return;\n }\n Object.values = require('core-js/fn/object/values');\n})();\n\n}\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals module */\n\nmodule.exports =\n (typeof window !== 'undefined' && window.Math === Math) ? window :\n // eslint-disable-next-line no-undef\n (typeof global !== 'undefined' && global.Math === Math) ? global :\n (typeof self !== 'undefined' && self.Math === Math) ? self : {};\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals module, process */\n\nmodule.exports = function isNodeJS() {\n // NW.js / Electron is a browser context, but copies some Node.js objects; see\n // http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context\n // https://electronjs.org/docs/api/process#processversionselectron\n return typeof process === 'object' &&\n process + '' === '[object process]' &&\n !process.versions['nw'] && !process.versions['electron'];\n};\n","require('../../modules/es6.string.starts-with');\nmodule.exports = require('../../modules/_core').String.startsWith;\n","// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = context(this, searchString, STARTS_WITH);\n var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var core = module.exports = { version: '2.6.9' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar $toString = require('./_function-to-string');\nvar TO_STRING = 'toString';\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","module.exports = require('./_shared')('native-function-to-string', Function.toString);\n","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2019 Denis Pushkarev (zloirock.ru)'\n});\n","module.exports = false;\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = require('./_is-regexp');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var MATCH = require('./_wks')('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n","require('../../modules/es6.string.ends-with');\nmodule.exports = require('../../modules/_core').String.endsWith;\n","// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar ENDS_WITH = 'endsWith';\nvar $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = context(this, searchString, ENDS_WITH);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n","require('../../modules/es6.string.includes');\nmodule.exports = require('../../modules/_core').String.includes;\n","// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n'use strict';\nvar $export = require('./_export');\nvar context = require('./_string-context');\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../modules/es7.array.includes');\nmodule.exports = require('../../modules/_core').Array.includes;\n","'use strict';\n// https://github.com/tc39/Array.prototype.includes\nvar $export = require('./_export');\nvar $includes = require('./_array-includes')(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\nrequire('./_add-to-unscopables')('includes');\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","require('../../modules/es6.string.iterator');\nrequire('../../modules/es6.array.from');\nmodule.exports = require('../../modules/_core').Array.from;\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","module.exports = {};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n","require('../../modules/es6.object.assign');\nmodule.exports = require('../../modules/_core').Object.assign;\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n","exports.f = Object.getOwnPropertySymbols;\n","exports.f = {}.propertyIsEnumerable;\n","require('../../modules/es6.math.log2');\nmodule.exports = require('../../modules/_core').Math.log2;\n","// 20.2.2.22 Math.log2(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log2: function log2(x) {\n return Math.log(x) / Math.LN2;\n }\n});\n","require('../../modules/es6.number.is-nan');\nmodule.exports = require('../../modules/_core').Number.isNaN;\n","// 20.1.2.4 Number.isNaN(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n","require('../../modules/es6.number.is-integer');\nmodule.exports = require('../../modules/_core').Number.isInteger;\n","// 20.1.2.3 Number.isInteger(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { isInteger: require('./_is-integer') });\n","// 20.1.2.3 Number.isInteger(number)\nvar isObject = require('./_is-object');\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","require('../modules/es6.object.to-string');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.weak-map');\nrequire('../modules/es7.weak-map.of');\nrequire('../modules/es7.weak-map.from');\nmodule.exports = require('../modules/_core').WeakMap;\n","'use strict';\n// 19.1.3.6 Object.prototype.toString()\nvar classof = require('./_classof');\nvar test = {};\ntest[require('./_wks')('toStringTag')] = 'z';\nif (test + '' != '[object z]') {\n require('./_redefine')(Object.prototype, 'toString', function toString() {\n return '[object ' + classof(this) + ']';\n }, true);\n}\n","var $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","'use strict';\nvar global = require('./_global');\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar validate = require('./_validate-collection');\nvar NATIVE_WEAK_MAP = require('./_validate-collection');\nvar IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (NATIVE_WEAK_MAP && IS_IE11) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n","var redefine = require('./_redefine');\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar redefineAll = require('./_redefine-all');\nvar meta = require('./_meta');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar $iterDetect = require('./_iter-detect');\nvar setToStringTag = require('./_set-to-string-tag');\nvar inheritIfRequired = require('./_inherit-if-required');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n","var isObject = require('./_is-object');\nvar setPrototypeOf = require('./_set-proto').set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of\nrequire('./_set-collection-of')('WeakMap');\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { of: function of() {\n var length = arguments.length;\n var A = new Array(length);\n while (length--) A[length] = arguments[length];\n return new this(A);\n } });\n};\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from\nrequire('./_set-collection-from')('WeakMap');\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar ctx = require('./_ctx');\nvar forOf = require('./_for-of');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n var mapFn = arguments[1];\n var mapping, A, n, cb;\n aFunction(this);\n mapping = mapFn !== undefined;\n if (mapping) aFunction(mapFn);\n if (source == undefined) return new this();\n A = [];\n if (mapping) {\n n = 0;\n cb = ctx(mapFn, arguments[2], 2);\n forOf(source, false, function (nextItem) {\n A.push(cb(nextItem, n++));\n });\n } else {\n forOf(source, false, A.push, A);\n }\n return new this(A);\n } });\n};\n","require('../modules/es6.object.to-string');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.weak-set');\nrequire('../modules/es7.weak-set.of');\nrequire('../modules/es7.weak-set.from');\nmodule.exports = require('../modules/_core').WeakSet;\n","'use strict';\nvar weak = require('./_collection-weak');\nvar validate = require('./_validate-collection');\nvar WEAK_SET = 'WeakSet';\n\n// 23.4 WeakSet Objects\nrequire('./_collection')(WEAK_SET, function (get) {\n return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return weak.def(validate(this, WEAK_SET), value, true);\n }\n}, weak, false, true);\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of\nrequire('./_set-collection-of')('WeakSet');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from\nrequire('./_set-collection-from')('WeakSet');\n","require('../../modules/es6.string.code-point-at');\nmodule.exports = require('../../modules/_core').String.codePointAt;\n","'use strict';\nvar $export = require('./_export');\nvar $at = require('./_string-at')(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos) {\n return $at(this, pos);\n }\n});\n","require('../../modules/es6.string.from-code-point');\nmodule.exports = require('../../modules/_core').String.fromCodePoint;\n","var $export = require('./_export');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar fromCharCode = String.fromCharCode;\nvar $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var res = [];\n var aLen = arguments.length;\n var i = 0;\n var code;\n while (aLen > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n","require('../modules/es6.symbol');\nrequire('../modules/es6.object.to-string');\nmodule.exports = require('../modules/_core').Symbol;\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar toObject = require('./_to-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $GOPS = require('./_object-gops');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n $GOPS.f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\nvar FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });\n\n$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n return $GOPS.f(toObject(it));\n }\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","exports.f = require('./_wks');\n","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","require('../../modules/es7.string.pad-start');\nmodule.exports = require('../../modules/_core').String.padStart;\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\nvar WEBKIT_BUG = /Version\\/10\\.\\d+(\\.\\d+)?( Mobile\\/\\w+)? Safari\\//.test(userAgent);\n\n$export($export.P + $export.F * WEBKIT_BUG, 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length');\nvar repeat = require('./_string-repeat');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\nvar toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n","var global = require('./_global');\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n","require('../../modules/es7.string.pad-end');\nmodule.exports = require('../../modules/_core').String.padEnd;\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\nvar WEBKIT_BUG = /Version\\/10\\.\\d+(\\.\\d+)?( Mobile\\/\\w+)? Safari\\//.test(userAgent);\n\n$export($export.P + $export.F * WEBKIT_BUG, 'String', {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n","require('../../modules/es7.object.values');\nmodule.exports = require('../../modules/_core').Object.values;\n","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $values = require('./_object-to-array')(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n","var DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar toIObject = require('./_to-iobject');\nvar isEnum = require('./_object-pie').f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || isEnum.call(O, key)) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable no-restricted-globals */\n\nif (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('MOZCENTRAL')) {\n if (typeof ReadableStream === 'undefined') {\n throw new Error('Please enable ReadableStream support by resetting the ' +\n '\"javascript.options.streams\" preference to \"true\" in about:config.');\n }\n exports.ReadableStream = ReadableStream;\n} else {\n let isReadableStreamSupported = false;\n if (typeof ReadableStream !== 'undefined') {\n // MS Edge may say it has ReadableStream but they are not up to spec yet.\n try {\n // eslint-disable-next-line no-new\n new ReadableStream({\n start(controller) {\n controller.close();\n },\n });\n isReadableStreamSupported = true;\n } catch (e) {\n // The ReadableStream constructor cannot be used.\n }\n }\n if (isReadableStreamSupported) {\n exports.ReadableStream = ReadableStream;\n } else if (typeof PDFJSDev !== 'undefined' &&\n PDFJSDev.test('IMAGE_DECODERS')) {\n class DummyReadableStream {\n constructor() {\n throw new Error('The current image decoders are synchronous, ' +\n 'hence `ReadableStream` shouldn\\'t need to be ' +\n 'polyfilled for the IMAGE_DECODERS build target.');\n }\n }\n exports.ReadableStream = DummyReadableStream;\n } else {\n exports.ReadableStream =\n require('../../external/streams/streams-lib').ReadableStream;\n }\n}\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable no-restricted-globals */\n\nif (typeof PDFJSDev !== 'undefined' && !PDFJSDev.test('GENERIC')) {\n // The `URL` constructor is assumed to be available in the extension builds.\n exports.URL = URL;\n} else {\n let isURLSupported = false;\n try {\n if (typeof URL === 'function' && typeof URL.prototype === 'object' &&\n ('origin' in URL.prototype)) {\n const u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n isURLSupported = (u.href === 'http://a/c%20d');\n }\n } catch (ex) {\n // The `URL` constructor cannot be used.\n }\n\n if (isURLSupported) {\n exports.URL = URL;\n } else if (typeof PDFJSDev !== 'undefined' &&\n PDFJSDev.test('IMAGE_DECODERS')) {\n class DummyURL {\n constructor() {\n throw new Error('The current image decoders doesn\\'t utilize the ' +\n '`URL` constructor, hence it shouldn\\'t need to be ' +\n 'polyfilled for the IMAGE_DECODERS build target.');\n }\n }\n exports.URL = DummyURL;\n } else {\n const PolyfillURL = require('../../external/url/url-lib').URL;\n\n // Attempt to copy over the static methods.\n const OriginalURL = require('./global_scope').URL;\n if (OriginalURL) {\n PolyfillURL.createObjectURL = function(blob) {\n // IE extension allows a second optional options argument, see\n // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx\n return OriginalURL.createObjectURL.apply(OriginalURL, arguments);\n };\n PolyfillURL.revokeObjectURL = function(url) {\n OriginalURL.revokeObjectURL(url);\n };\n }\n exports.URL = PolyfillURL;\n }\n}\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { log2, readInt8, readUint16, readUint32, shadow } from '../shared/util';\nimport { ArithmeticDecoder } from './arithmetic_decoder';\nimport { CCITTFaxDecoder } from './ccitt';\n\nlet Jbig2Error = (function Jbig2ErrorClosure() {\n function Jbig2Error(msg) {\n this.message = 'JBIG2 error: ' + msg;\n }\n\n Jbig2Error.prototype = new Error();\n Jbig2Error.prototype.name = 'Jbig2Error';\n Jbig2Error.constructor = Jbig2Error;\n\n return Jbig2Error;\n})();\n\nvar Jbig2Image = (function Jbig2ImageClosure() {\n // Utility data structures\n function ContextCache() {}\n\n ContextCache.prototype = {\n getContexts(id) {\n if (id in this) {\n return this[id];\n }\n return (this[id] = new Int8Array(1 << 16));\n },\n };\n\n function DecodingContext(data, start, end) {\n this.data = data;\n this.start = start;\n this.end = end;\n }\n\n DecodingContext.prototype = {\n get decoder() {\n var decoder = new ArithmeticDecoder(this.data, this.start, this.end);\n return shadow(this, 'decoder', decoder);\n },\n get contextCache() {\n var cache = new ContextCache();\n return shadow(this, 'contextCache', cache);\n },\n };\n\n // Annex A. Arithmetic Integer Decoding Procedure\n // A.2 Procedure for decoding values\n function decodeInteger(contextCache, procedure, decoder) {\n var contexts = contextCache.getContexts(procedure);\n var prev = 1;\n\n function readBits(length) {\n var v = 0;\n for (var i = 0; i < length; i++) {\n var bit = decoder.readBit(contexts, prev);\n prev = (prev < 256 ? (prev << 1) | bit :\n (((prev << 1) | bit) & 511) | 256);\n v = (v << 1) | bit;\n }\n return v >>> 0;\n }\n\n var sign = readBits(1);\n var value = readBits(1) ?\n (readBits(1) ?\n (readBits(1) ?\n (readBits(1) ?\n (readBits(1) ?\n (readBits(32) + 4436) :\n readBits(12) + 340) :\n readBits(8) + 84) :\n readBits(6) + 20) :\n readBits(4) + 4) :\n readBits(2);\n return (sign === 0 ? value : (value > 0 ? -value : null));\n }\n\n // A.3 The IAID decoding procedure\n function decodeIAID(contextCache, decoder, codeLength) {\n var contexts = contextCache.getContexts('IAID');\n\n var prev = 1;\n for (var i = 0; i < codeLength; i++) {\n var bit = decoder.readBit(contexts, prev);\n prev = (prev << 1) | bit;\n }\n if (codeLength < 31) {\n return prev & ((1 << codeLength) - 1);\n }\n return prev & 0x7FFFFFFF;\n }\n\n // 7.3 Segment types\n var SegmentTypes = [\n 'SymbolDictionary', null, null, null, 'IntermediateTextRegion', null,\n 'ImmediateTextRegion', 'ImmediateLosslessTextRegion', null, null, null,\n null, null, null, null, null, 'PatternDictionary', null, null, null,\n 'IntermediateHalftoneRegion', null, 'ImmediateHalftoneRegion',\n 'ImmediateLosslessHalftoneRegion', null, null, null, null, null, null, null,\n null, null, null, null, null, 'IntermediateGenericRegion', null,\n 'ImmediateGenericRegion', 'ImmediateLosslessGenericRegion',\n 'IntermediateGenericRefinementRegion', null,\n 'ImmediateGenericRefinementRegion',\n 'ImmediateLosslessGenericRefinementRegion', null, null, null, null,\n 'PageInformation', 'EndOfPage', 'EndOfStripe', 'EndOfFile', 'Profiles',\n 'Tables', null, null, null, null, null, null, null, null,\n 'Extension'\n ];\n\n var CodingTemplates = [\n [{ x: -1, y: -2, }, { x: 0, y: -2, }, { x: 1, y: -2, }, { x: -2, y: -1, },\n { x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, }, { x: 2, y: -1, },\n { x: -4, y: 0, }, { x: -3, y: 0, }, { x: -2, y: 0, }, { x: -1, y: 0, }],\n [{ x: -1, y: -2, }, { x: 0, y: -2, }, { x: 1, y: -2, }, { x: 2, y: -2, },\n { x: -2, y: -1, }, { x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, },\n { x: 2, y: -1, }, { x: -3, y: 0, }, { x: -2, y: 0, }, { x: -1, y: 0, }],\n [{ x: -1, y: -2, }, { x: 0, y: -2, }, { x: 1, y: -2, }, { x: -2, y: -1, },\n { x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, }, { x: -2, y: 0, },\n { x: -1, y: 0, }],\n [{ x: -3, y: -1, }, { x: -2, y: -1, }, { x: -1, y: -1, }, { x: 0, y: -1, },\n { x: 1, y: -1, }, { x: -4, y: 0, }, { x: -3, y: 0, }, { x: -2, y: 0, },\n { x: -1, y: 0, }]\n ];\n\n var RefinementTemplates = [\n {\n coding: [{ x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, }],\n reference: [{ x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, },\n { x: 0, y: 0, }, { x: 1, y: 0, }, { x: -1, y: 1, },\n { x: 0, y: 1, }, { x: 1, y: 1, }],\n },\n {\n coding: [{ x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, },\n { x: -1, y: 0, }],\n reference: [{ x: 0, y: -1, }, { x: -1, y: 0, }, { x: 0, y: 0, },\n { x: 1, y: 0, }, { x: 0, y: 1, }, { x: 1, y: 1, }],\n }\n ];\n\n // See 6.2.5.7 Decoding the bitmap.\n var ReusedContexts = [\n 0x9B25, // 10011 0110010 0101\n 0x0795, // 0011 110010 101\n 0x00E5, // 001 11001 01\n 0x0195 // 011001 0101\n ];\n\n var RefinementReusedContexts = [\n 0x0020, // '000' + '0' (coding) + '00010000' + '0' (reference)\n 0x0008 // '0000' + '001000'\n ];\n\n function decodeBitmapTemplate0(width, height, decodingContext) {\n var decoder = decodingContext.decoder;\n var contexts = decodingContext.contextCache.getContexts('GB');\n var contextLabel, i, j, pixel, row, row1, row2, bitmap = [];\n\n // ...ooooo....\n // ..ooooooo... Context template for current pixel (X)\n // .ooooX...... (concatenate values of 'o'-pixels to get contextLabel)\n var OLD_PIXEL_MASK = 0x7BF7; // 01111 0111111 0111\n\n for (i = 0; i < height; i++) {\n row = bitmap[i] = new Uint8Array(width);\n row1 = (i < 1) ? row : bitmap[i - 1];\n row2 = (i < 2) ? row : bitmap[i - 2];\n\n // At the beginning of each row:\n // Fill contextLabel with pixels that are above/right of (X)\n contextLabel = (row2[0] << 13) | (row2[1] << 12) | (row2[2] << 11) |\n (row1[0] << 7) | (row1[1] << 6) | (row1[2] << 5) |\n (row1[3] << 4);\n\n for (j = 0; j < width; j++) {\n row[j] = pixel = decoder.readBit(contexts, contextLabel);\n\n // At each pixel: Clear contextLabel pixels that are shifted\n // out of the context, then add new ones.\n contextLabel = ((contextLabel & OLD_PIXEL_MASK) << 1) |\n (j + 3 < width ? row2[j + 3] << 11 : 0) |\n (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel;\n }\n }\n\n return bitmap;\n }\n\n // 6.2 Generic Region Decoding Procedure\n function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at,\n decodingContext) {\n if (mmr) {\n let input = new Reader(decodingContext.data, decodingContext.start,\n decodingContext.end);\n return decodeMMRBitmap(input, width, height, false);\n }\n\n // Use optimized version for the most common case\n if (templateIndex === 0 && !skip && !prediction && at.length === 4 &&\n at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 &&\n at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) {\n return decodeBitmapTemplate0(width, height, decodingContext);\n }\n\n var useskip = !!skip;\n var template = CodingTemplates[templateIndex].concat(at);\n\n // Sorting is non-standard, and it is not required. But sorting increases\n // the number of template bits that can be reused from the previous\n // contextLabel in the main loop.\n template.sort(function (a, b) {\n return (a.y - b.y) || (a.x - b.x);\n });\n\n var templateLength = template.length;\n var templateX = new Int8Array(templateLength);\n var templateY = new Int8Array(templateLength);\n var changingTemplateEntries = [];\n var reuseMask = 0, minX = 0, maxX = 0, minY = 0;\n var c, k;\n\n for (k = 0; k < templateLength; k++) {\n templateX[k] = template[k].x;\n templateY[k] = template[k].y;\n minX = Math.min(minX, template[k].x);\n maxX = Math.max(maxX, template[k].x);\n minY = Math.min(minY, template[k].y);\n // Check if the template pixel appears in two consecutive context labels,\n // so it can be reused. Otherwise, we add it to the list of changing\n // template entries.\n if (k < templateLength - 1 &&\n template[k].y === template[k + 1].y &&\n template[k].x === template[k + 1].x - 1) {\n reuseMask |= 1 << (templateLength - 1 - k);\n } else {\n changingTemplateEntries.push(k);\n }\n }\n var changingEntriesLength = changingTemplateEntries.length;\n\n var changingTemplateX = new Int8Array(changingEntriesLength);\n var changingTemplateY = new Int8Array(changingEntriesLength);\n var changingTemplateBit = new Uint16Array(changingEntriesLength);\n for (c = 0; c < changingEntriesLength; c++) {\n k = changingTemplateEntries[c];\n changingTemplateX[c] = template[k].x;\n changingTemplateY[c] = template[k].y;\n changingTemplateBit[c] = 1 << (templateLength - 1 - k);\n }\n\n // Get the safe bounding box edges from the width, height, minX, maxX, minY\n var sbb_left = -minX;\n var sbb_top = -minY;\n var sbb_right = width - maxX;\n\n var pseudoPixelContext = ReusedContexts[templateIndex];\n var row = new Uint8Array(width);\n var bitmap = [];\n\n var decoder = decodingContext.decoder;\n var contexts = decodingContext.contextCache.getContexts('GB');\n\n var ltp = 0, j, i0, j0, contextLabel = 0, bit, shift;\n for (var i = 0; i < height; i++) {\n if (prediction) {\n var sltp = decoder.readBit(contexts, pseudoPixelContext);\n ltp ^= sltp;\n if (ltp) {\n bitmap.push(row); // duplicate previous row\n continue;\n }\n }\n row = new Uint8Array(row);\n bitmap.push(row);\n for (j = 0; j < width; j++) {\n if (useskip && skip[i][j]) {\n row[j] = 0;\n continue;\n }\n // Are we in the middle of a scanline, so we can reuse contextLabel\n // bits?\n if (j >= sbb_left && j < sbb_right && i >= sbb_top) {\n // If yes, we can just shift the bits that are reusable and only\n // fetch the remaining ones.\n contextLabel = (contextLabel << 1) & reuseMask;\n for (k = 0; k < changingEntriesLength; k++) {\n i0 = i + changingTemplateY[k];\n j0 = j + changingTemplateX[k];\n bit = bitmap[i0][j0];\n if (bit) {\n bit = changingTemplateBit[k];\n contextLabel |= bit;\n }\n }\n } else {\n // compute the contextLabel from scratch\n contextLabel = 0;\n shift = templateLength - 1;\n for (k = 0; k < templateLength; k++, shift--) {\n j0 = j + templateX[k];\n if (j0 >= 0 && j0 < width) {\n i0 = i + templateY[k];\n if (i0 >= 0) {\n bit = bitmap[i0][j0];\n if (bit) {\n contextLabel |= bit << shift;\n }\n }\n }\n }\n }\n var pixel = decoder.readBit(contexts, contextLabel);\n row[j] = pixel;\n }\n }\n return bitmap;\n }\n\n // 6.3.2 Generic Refinement Region Decoding Procedure\n function decodeRefinement(width, height, templateIndex, referenceBitmap,\n offsetX, offsetY, prediction, at,\n decodingContext) {\n var codingTemplate = RefinementTemplates[templateIndex].coding;\n if (templateIndex === 0) {\n codingTemplate = codingTemplate.concat([at[0]]);\n }\n var codingTemplateLength = codingTemplate.length;\n var codingTemplateX = new Int32Array(codingTemplateLength);\n var codingTemplateY = new Int32Array(codingTemplateLength);\n var k;\n for (k = 0; k < codingTemplateLength; k++) {\n codingTemplateX[k] = codingTemplate[k].x;\n codingTemplateY[k] = codingTemplate[k].y;\n }\n\n var referenceTemplate = RefinementTemplates[templateIndex].reference;\n if (templateIndex === 0) {\n referenceTemplate = referenceTemplate.concat([at[1]]);\n }\n var referenceTemplateLength = referenceTemplate.length;\n var referenceTemplateX = new Int32Array(referenceTemplateLength);\n var referenceTemplateY = new Int32Array(referenceTemplateLength);\n for (k = 0; k < referenceTemplateLength; k++) {\n referenceTemplateX[k] = referenceTemplate[k].x;\n referenceTemplateY[k] = referenceTemplate[k].y;\n }\n var referenceWidth = referenceBitmap[0].length;\n var referenceHeight = referenceBitmap.length;\n\n var pseudoPixelContext = RefinementReusedContexts[templateIndex];\n var bitmap = [];\n\n var decoder = decodingContext.decoder;\n var contexts = decodingContext.contextCache.getContexts('GR');\n\n var ltp = 0;\n for (var i = 0; i < height; i++) {\n if (prediction) {\n var sltp = decoder.readBit(contexts, pseudoPixelContext);\n ltp ^= sltp;\n if (ltp) {\n throw new Jbig2Error('prediction is not supported');\n }\n }\n var row = new Uint8Array(width);\n bitmap.push(row);\n for (var j = 0; j < width; j++) {\n var i0, j0;\n var contextLabel = 0;\n for (k = 0; k < codingTemplateLength; k++) {\n i0 = i + codingTemplateY[k];\n j0 = j + codingTemplateX[k];\n if (i0 < 0 || j0 < 0 || j0 >= width) {\n contextLabel <<= 1; // out of bound pixel\n } else {\n contextLabel = (contextLabel << 1) | bitmap[i0][j0];\n }\n }\n for (k = 0; k < referenceTemplateLength; k++) {\n i0 = i + referenceTemplateY[k] - offsetY;\n j0 = j + referenceTemplateX[k] - offsetX;\n if (i0 < 0 || i0 >= referenceHeight || j0 < 0 ||\n j0 >= referenceWidth) {\n contextLabel <<= 1; // out of bound pixel\n } else {\n contextLabel = (contextLabel << 1) | referenceBitmap[i0][j0];\n }\n }\n var pixel = decoder.readBit(contexts, contextLabel);\n row[j] = pixel;\n }\n }\n\n return bitmap;\n }\n\n // 6.5.5 Decoding the symbol dictionary\n function decodeSymbolDictionary(huffman, refinement, symbols,\n numberOfNewSymbols, numberOfExportedSymbols,\n huffmanTables, templateIndex, at,\n refinementTemplateIndex, refinementAt,\n decodingContext, huffmanInput) {\n if (huffman && refinement) {\n throw new Jbig2Error('symbol refinement with Huffman is not supported');\n }\n\n var newSymbols = [];\n var currentHeight = 0;\n var symbolCodeLength = log2(symbols.length + numberOfNewSymbols);\n\n var decoder = decodingContext.decoder;\n var contextCache = decodingContext.contextCache;\n let tableB1, symbolWidths;\n if (huffman) {\n tableB1 = getStandardTable(1); // standard table B.1\n symbolWidths = [];\n symbolCodeLength = Math.max(symbolCodeLength, 1); // 6.5.8.2.3\n }\n\n while (newSymbols.length < numberOfNewSymbols) {\n var deltaHeight = huffman ?\n huffmanTables.tableDeltaHeight.decode(huffmanInput) :\n decodeInteger(contextCache, 'IADH', decoder); // 6.5.6\n currentHeight += deltaHeight;\n let currentWidth = 0, totalWidth = 0;\n let firstSymbol = huffman ? symbolWidths.length : 0;\n while (true) {\n var deltaWidth = huffman ?\n huffmanTables.tableDeltaWidth.decode(huffmanInput) :\n decodeInteger(contextCache, 'IADW', decoder); // 6.5.7\n if (deltaWidth === null) {\n break; // OOB\n }\n currentWidth += deltaWidth;\n totalWidth += currentWidth;\n var bitmap;\n if (refinement) {\n // 6.5.8.2 Refinement/aggregate-coded symbol bitmap\n var numberOfInstances = decodeInteger(contextCache, 'IAAI', decoder);\n if (numberOfInstances > 1) {\n bitmap = decodeTextRegion(huffman, refinement,\n currentWidth, currentHeight, 0,\n numberOfInstances, 1, // strip size\n symbols.concat(newSymbols),\n symbolCodeLength,\n 0, // transposed\n 0, // ds offset\n 1, // top left 7.4.3.1.1\n 0, // OR operator\n huffmanTables,\n refinementTemplateIndex, refinementAt,\n decodingContext, 0, huffmanInput);\n } else {\n var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength);\n var rdx = decodeInteger(contextCache, 'IARDX', decoder); // 6.4.11.3\n var rdy = decodeInteger(contextCache, 'IARDY', decoder); // 6.4.11.4\n var symbol = (symbolId < symbols.length ? symbols[symbolId] :\n newSymbols[symbolId - symbols.length]);\n bitmap = decodeRefinement(currentWidth, currentHeight,\n refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt,\n decodingContext);\n }\n newSymbols.push(bitmap);\n } else if (huffman) {\n // Store only symbol width and decode a collective bitmap when the\n // height class is done.\n symbolWidths.push(currentWidth);\n } else {\n // 6.5.8.1 Direct-coded symbol bitmap\n bitmap = decodeBitmap(false, currentWidth, currentHeight,\n templateIndex, false, null, at, decodingContext);\n newSymbols.push(bitmap);\n }\n }\n if (huffman && !refinement) {\n // 6.5.9 Height class collective bitmap\n let bitmapSize = huffmanTables.tableBitmapSize.decode(huffmanInput);\n huffmanInput.byteAlign();\n let collectiveBitmap;\n if (bitmapSize === 0) {\n // Uncompressed collective bitmap\n collectiveBitmap = readUncompressedBitmap(huffmanInput, totalWidth,\n currentHeight);\n } else {\n // MMR collective bitmap\n let originalEnd = huffmanInput.end;\n let bitmapEnd = huffmanInput.position + bitmapSize;\n huffmanInput.end = bitmapEnd;\n collectiveBitmap = decodeMMRBitmap(huffmanInput, totalWidth,\n currentHeight, false);\n huffmanInput.end = originalEnd;\n huffmanInput.position = bitmapEnd;\n }\n let numberOfSymbolsDecoded = symbolWidths.length;\n if (firstSymbol === numberOfSymbolsDecoded - 1) {\n // collectiveBitmap is a single symbol.\n newSymbols.push(collectiveBitmap);\n } else {\n // Divide collectiveBitmap into symbols.\n let i, y, xMin = 0, xMax, bitmapWidth, symbolBitmap;\n for (i = firstSymbol; i < numberOfSymbolsDecoded; i++) {\n bitmapWidth = symbolWidths[i];\n xMax = xMin + bitmapWidth;\n symbolBitmap = [];\n for (y = 0; y < currentHeight; y++) {\n symbolBitmap.push(collectiveBitmap[y].subarray(xMin, xMax));\n }\n newSymbols.push(symbolBitmap);\n xMin = xMax;\n }\n }\n }\n }\n\n // 6.5.10 Exported symbols\n var exportedSymbols = [];\n var flags = [], currentFlag = false;\n var totalSymbolsLength = symbols.length + numberOfNewSymbols;\n while (flags.length < totalSymbolsLength) {\n var runLength = huffman ? tableB1.decode(huffmanInput) :\n decodeInteger(contextCache, 'IAEX', decoder);\n while (runLength--) {\n flags.push(currentFlag);\n }\n currentFlag = !currentFlag;\n }\n for (var i = 0, ii = symbols.length; i < ii; i++) {\n if (flags[i]) {\n exportedSymbols.push(symbols[i]);\n }\n }\n for (var j = 0; j < numberOfNewSymbols; i++, j++) {\n if (flags[i]) {\n exportedSymbols.push(newSymbols[j]);\n }\n }\n return exportedSymbols;\n }\n\n function decodeTextRegion(huffman, refinement, width, height,\n defaultPixelValue, numberOfSymbolInstances,\n stripSize, inputSymbols, symbolCodeLength,\n transposed, dsOffset, referenceCorner,\n combinationOperator, huffmanTables,\n refinementTemplateIndex, refinementAt,\n decodingContext, logStripSize, huffmanInput) {\n if (huffman && refinement) {\n throw new Jbig2Error('refinement with Huffman is not supported');\n }\n\n // Prepare bitmap\n var bitmap = [];\n var i, row;\n for (i = 0; i < height; i++) {\n row = new Uint8Array(width);\n if (defaultPixelValue) {\n for (var j = 0; j < width; j++) {\n row[j] = defaultPixelValue;\n }\n }\n bitmap.push(row);\n }\n\n var decoder = decodingContext.decoder;\n var contextCache = decodingContext.contextCache;\n\n var stripT = huffman ? -huffmanTables.tableDeltaT.decode(huffmanInput) :\n -decodeInteger(contextCache, 'IADT', decoder); // 6.4.6\n var firstS = 0;\n i = 0;\n while (i < numberOfSymbolInstances) {\n var deltaT = huffman ? huffmanTables.tableDeltaT.decode(huffmanInput) :\n decodeInteger(contextCache, 'IADT', decoder); // 6.4.6\n stripT += deltaT;\n\n var deltaFirstS = huffman ?\n huffmanTables.tableFirstS.decode(huffmanInput) :\n decodeInteger(contextCache, 'IAFS', decoder); // 6.4.7\n firstS += deltaFirstS;\n var currentS = firstS;\n do {\n let currentT = 0; // 6.4.9\n if (stripSize > 1) {\n currentT = huffman ? huffmanInput.readBits(logStripSize) :\n decodeInteger(contextCache, 'IAIT', decoder);\n }\n var t = stripSize * stripT + currentT;\n var symbolId = huffman ?\n huffmanTables.symbolIDTable.decode(huffmanInput) :\n decodeIAID(contextCache, decoder, symbolCodeLength);\n var applyRefinement = (refinement && (huffman ? huffmanInput.readBit() :\n decodeInteger(contextCache, 'IARI', decoder)));\n var symbolBitmap = inputSymbols[symbolId];\n var symbolWidth = symbolBitmap[0].length;\n var symbolHeight = symbolBitmap.length;\n if (applyRefinement) {\n var rdw = decodeInteger(contextCache, 'IARDW', decoder); // 6.4.11.1\n var rdh = decodeInteger(contextCache, 'IARDH', decoder); // 6.4.11.2\n var rdx = decodeInteger(contextCache, 'IARDX', decoder); // 6.4.11.3\n var rdy = decodeInteger(contextCache, 'IARDY', decoder); // 6.4.11.4\n symbolWidth += rdw;\n symbolHeight += rdh;\n symbolBitmap = decodeRefinement(symbolWidth, symbolHeight,\n refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx,\n (rdh >> 1) + rdy, false, refinementAt,\n decodingContext);\n }\n var offsetT = t - ((referenceCorner & 1) ? 0 : (symbolHeight - 1));\n var offsetS = currentS -\n ((referenceCorner & 2) ? (symbolWidth - 1) : 0);\n var s2, t2, symbolRow;\n if (transposed) {\n // Place Symbol Bitmap from T1,S1\n for (s2 = 0; s2 < symbolHeight; s2++) {\n row = bitmap[offsetS + s2];\n if (!row) {\n continue;\n }\n symbolRow = symbolBitmap[s2];\n // To ignore Parts of Symbol bitmap which goes\n // outside bitmap region\n var maxWidth = Math.min(width - offsetT, symbolWidth);\n switch (combinationOperator) {\n case 0: // OR\n for (t2 = 0; t2 < maxWidth; t2++) {\n row[offsetT + t2] |= symbolRow[t2];\n }\n break;\n case 2: // XOR\n for (t2 = 0; t2 < maxWidth; t2++) {\n row[offsetT + t2] ^= symbolRow[t2];\n }\n break;\n default:\n throw new Jbig2Error(\n `operator ${combinationOperator} is not supported`);\n }\n }\n currentS += symbolHeight - 1;\n } else {\n for (t2 = 0; t2 < symbolHeight; t2++) {\n row = bitmap[offsetT + t2];\n if (!row) {\n continue;\n }\n symbolRow = symbolBitmap[t2];\n switch (combinationOperator) {\n case 0: // OR\n for (s2 = 0; s2 < symbolWidth; s2++) {\n row[offsetS + s2] |= symbolRow[s2];\n }\n break;\n case 2: // XOR\n for (s2 = 0; s2 < symbolWidth; s2++) {\n row[offsetS + s2] ^= symbolRow[s2];\n }\n break;\n default:\n throw new Jbig2Error(\n `operator ${combinationOperator} is not supported`);\n }\n }\n currentS += symbolWidth - 1;\n }\n i++;\n var deltaS = huffman ? huffmanTables.tableDeltaS.decode(huffmanInput) :\n decodeInteger(contextCache, 'IADS', decoder); // 6.4.8\n if (deltaS === null) {\n break; // OOB\n }\n currentS += deltaS + dsOffset;\n } while (true);\n }\n return bitmap;\n }\n\n function decodePatternDictionary(mmr, patternWidth, patternHeight,\n maxPatternIndex, template, decodingContext) {\n let at = [];\n if (!mmr) {\n at.push({\n x: -patternWidth,\n y: 0,\n });\n if (template === 0) {\n at.push({\n x: -3,\n y: -1,\n });\n at.push({\n x: 2,\n y: -2,\n });\n at.push({\n x: -2,\n y: -2,\n });\n }\n }\n let collectiveWidth = (maxPatternIndex + 1) * patternWidth;\n let collectiveBitmap = decodeBitmap(mmr, collectiveWidth, patternHeight,\n template, false, null, at,\n decodingContext);\n // Divide collective bitmap into patterns.\n let patterns = [], i = 0, patternBitmap, xMin, xMax, y;\n while (i <= maxPatternIndex) {\n patternBitmap = [];\n xMin = patternWidth * i;\n xMax = xMin + patternWidth;\n for (y = 0; y < patternHeight; y++) {\n patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax));\n }\n patterns.push(patternBitmap);\n i++;\n }\n return patterns;\n }\n\n function decodeHalftoneRegion(mmr, patterns, template, regionWidth,\n regionHeight, defaultPixelValue, enableSkip,\n combinationOperator, gridWidth, gridHeight,\n gridOffsetX, gridOffsetY, gridVectorX,\n gridVectorY, decodingContext) {\n let skip = null;\n if (enableSkip) {\n throw new Jbig2Error('skip is not supported');\n }\n if (combinationOperator !== 0) {\n throw new Jbig2Error('operator ' + combinationOperator +\n ' is not supported in halftone region');\n }\n\n // Prepare bitmap.\n let regionBitmap = [];\n let i, j, row;\n for (i = 0; i < regionHeight; i++) {\n row = new Uint8Array(regionWidth);\n if (defaultPixelValue) {\n for (j = 0; j < regionWidth; j++) {\n row[j] = defaultPixelValue;\n }\n }\n regionBitmap.push(row);\n }\n\n let numberOfPatterns = patterns.length;\n let pattern0 = patterns[0];\n let patternWidth = pattern0[0].length, patternHeight = pattern0.length;\n let bitsPerValue = log2(numberOfPatterns);\n let at = [];\n if (!mmr) {\n at.push({\n x: (template <= 1) ? 3 : 2,\n y: -1,\n });\n if (template === 0) {\n at.push({\n x: -3,\n y: -1,\n });\n at.push({\n x: 2,\n y: -2,\n });\n at.push({\n x: -2,\n y: -2,\n });\n }\n }\n // Annex C. Gray-scale Image Decoding Procedure.\n let grayScaleBitPlanes = [], mmrInput, bitmap;\n if (mmr) {\n // MMR bit planes are in one continuous stream. Only EOFB codes indicate\n // the end of each bitmap, so EOFBs must be decoded.\n mmrInput = new Reader(decodingContext.data, decodingContext.start,\n decodingContext.end);\n }\n for (i = bitsPerValue - 1; i >= 0; i--) {\n if (mmr) {\n bitmap = decodeMMRBitmap(mmrInput, gridWidth, gridHeight, true);\n } else {\n bitmap = decodeBitmap(false, gridWidth, gridHeight, template, false,\n skip, at, decodingContext);\n }\n grayScaleBitPlanes[i] = bitmap;\n }\n // 6.6.5.2 Rendering the patterns.\n let mg, ng, bit, patternIndex, patternBitmap, x, y, patternRow, regionRow;\n for (mg = 0; mg < gridHeight; mg++) {\n for (ng = 0; ng < gridWidth; ng++) {\n bit = 0;\n patternIndex = 0;\n for (j = bitsPerValue - 1; j >= 0; j--) {\n bit = grayScaleBitPlanes[j][mg][ng] ^ bit; // Gray decoding\n patternIndex |= bit << j;\n }\n patternBitmap = patterns[patternIndex];\n x = (gridOffsetX + mg * gridVectorY + ng * gridVectorX) >> 8;\n y = (gridOffsetY + mg * gridVectorX - ng * gridVectorY) >> 8;\n // Draw patternBitmap at (x, y).\n if (x >= 0 && x + patternWidth <= regionWidth && y >= 0 &&\n y + patternHeight <= regionHeight) {\n for (i = 0; i < patternHeight; i++) {\n regionRow = regionBitmap[y + i];\n patternRow = patternBitmap[i];\n for (j = 0; j < patternWidth; j++) {\n regionRow[x + j] |= patternRow[j];\n }\n }\n } else {\n let regionX, regionY;\n for (i = 0; i < patternHeight; i++) {\n regionY = y + i;\n if (regionY < 0 || regionY >= regionHeight) {\n continue;\n }\n regionRow = regionBitmap[regionY];\n patternRow = patternBitmap[i];\n for (j = 0; j < patternWidth; j++) {\n regionX = x + j;\n if (regionX >= 0 && regionX < regionWidth) {\n regionRow[regionX] |= patternRow[j];\n }\n }\n }\n }\n }\n }\n return regionBitmap;\n }\n\n function readSegmentHeader(data, start) {\n var segmentHeader = {};\n segmentHeader.number = readUint32(data, start);\n var flags = data[start + 4];\n var segmentType = flags & 0x3F;\n if (!SegmentTypes[segmentType]) {\n throw new Jbig2Error('invalid segment type: ' + segmentType);\n }\n segmentHeader.type = segmentType;\n segmentHeader.typeName = SegmentTypes[segmentType];\n segmentHeader.deferredNonRetain = !!(flags & 0x80);\n\n var pageAssociationFieldSize = !!(flags & 0x40);\n var referredFlags = data[start + 5];\n var referredToCount = (referredFlags >> 5) & 7;\n var retainBits = [referredFlags & 31];\n var position = start + 6;\n if (referredFlags === 7) {\n referredToCount = readUint32(data, position - 1) & 0x1FFFFFFF;\n position += 3;\n var bytes = (referredToCount + 7) >> 3;\n retainBits[0] = data[position++];\n while (--bytes > 0) {\n retainBits.push(data[position++]);\n }\n } else if (referredFlags === 5 || referredFlags === 6) {\n throw new Jbig2Error('invalid referred-to flags');\n }\n\n segmentHeader.retainBits = retainBits;\n var referredToSegmentNumberSize = (segmentHeader.number <= 256 ? 1 :\n (segmentHeader.number <= 65536 ? 2 : 4));\n var referredTo = [];\n var i, ii;\n for (i = 0; i < referredToCount; i++) {\n var number = (referredToSegmentNumberSize === 1 ? data[position] :\n (referredToSegmentNumberSize === 2 ? readUint16(data, position) :\n readUint32(data, position)));\n referredTo.push(number);\n position += referredToSegmentNumberSize;\n }\n segmentHeader.referredTo = referredTo;\n if (!pageAssociationFieldSize) {\n segmentHeader.pageAssociation = data[position++];\n } else {\n segmentHeader.pageAssociation = readUint32(data, position);\n position += 4;\n }\n segmentHeader.length = readUint32(data, position);\n position += 4;\n\n if (segmentHeader.length === 0xFFFFFFFF) {\n // 7.2.7 Segment data length, unknown segment length\n if (segmentType === 38) { // ImmediateGenericRegion\n var genericRegionInfo = readRegionSegmentInformation(data, position);\n var genericRegionSegmentFlags = data[position +\n RegionSegmentInformationFieldLength];\n var genericRegionMmr = !!(genericRegionSegmentFlags & 1);\n // searching for the segment end\n var searchPatternLength = 6;\n var searchPattern = new Uint8Array(searchPatternLength);\n if (!genericRegionMmr) {\n searchPattern[0] = 0xFF;\n searchPattern[1] = 0xAC;\n }\n searchPattern[2] = (genericRegionInfo.height >>> 24) & 0xFF;\n searchPattern[3] = (genericRegionInfo.height >> 16) & 0xFF;\n searchPattern[4] = (genericRegionInfo.height >> 8) & 0xFF;\n searchPattern[5] = genericRegionInfo.height & 0xFF;\n for (i = position, ii = data.length; i < ii; i++) {\n var j = 0;\n while (j < searchPatternLength && searchPattern[j] === data[i + j]) {\n j++;\n }\n if (j === searchPatternLength) {\n segmentHeader.length = i + searchPatternLength;\n break;\n }\n }\n if (segmentHeader.length === 0xFFFFFFFF) {\n throw new Jbig2Error('segment end was not found');\n }\n } else {\n throw new Jbig2Error('invalid unknown segment length');\n }\n }\n segmentHeader.headerEnd = position;\n return segmentHeader;\n }\n\n function readSegments(header, data, start, end) {\n var segments = [];\n var position = start;\n while (position < end) {\n var segmentHeader = readSegmentHeader(data, position);\n position = segmentHeader.headerEnd;\n var segment = {\n header: segmentHeader,\n data,\n };\n if (!header.randomAccess) {\n segment.start = position;\n position += segmentHeader.length;\n segment.end = position;\n }\n segments.push(segment);\n if (segmentHeader.type === 51) {\n break; // end of file is found\n }\n }\n if (header.randomAccess) {\n for (var i = 0, ii = segments.length; i < ii; i++) {\n segments[i].start = position;\n position += segments[i].header.length;\n segments[i].end = position;\n }\n }\n return segments;\n }\n\n // 7.4.1 Region segment information field\n function readRegionSegmentInformation(data, start) {\n return {\n width: readUint32(data, start),\n height: readUint32(data, start + 4),\n x: readUint32(data, start + 8),\n y: readUint32(data, start + 12),\n combinationOperator: data[start + 16] & 7,\n };\n }\n var RegionSegmentInformationFieldLength = 17;\n\n function processSegment(segment, visitor) {\n var header = segment.header;\n\n var data = segment.data, position = segment.start, end = segment.end;\n var args, at, i, atLength;\n switch (header.type) {\n case 0: // SymbolDictionary\n // 7.4.2 Symbol dictionary segment syntax\n var dictionary = {};\n var dictionaryFlags = readUint16(data, position); // 7.4.2.1.1\n dictionary.huffman = !!(dictionaryFlags & 1);\n dictionary.refinement = !!(dictionaryFlags & 2);\n dictionary.huffmanDHSelector = (dictionaryFlags >> 2) & 3;\n dictionary.huffmanDWSelector = (dictionaryFlags >> 4) & 3;\n dictionary.bitmapSizeSelector = (dictionaryFlags >> 6) & 1;\n dictionary.aggregationInstancesSelector = (dictionaryFlags >> 7) & 1;\n dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256);\n dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512);\n dictionary.template = (dictionaryFlags >> 10) & 3;\n dictionary.refinementTemplate = (dictionaryFlags >> 12) & 1;\n position += 2;\n if (!dictionary.huffman) {\n atLength = dictionary.template === 0 ? 4 : 1;\n at = [];\n for (i = 0; i < atLength; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n dictionary.at = at;\n }\n if (dictionary.refinement && !dictionary.refinementTemplate) {\n at = [];\n for (i = 0; i < 2; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n dictionary.refinementAt = at;\n }\n dictionary.numberOfExportedSymbols = readUint32(data, position);\n position += 4;\n dictionary.numberOfNewSymbols = readUint32(data, position);\n position += 4;\n args = [dictionary, header.number, header.referredTo,\n data, position, end];\n break;\n case 6: // ImmediateTextRegion\n case 7: // ImmediateLosslessTextRegion\n var textRegion = {};\n textRegion.info = readRegionSegmentInformation(data, position);\n position += RegionSegmentInformationFieldLength;\n var textRegionSegmentFlags = readUint16(data, position);\n position += 2;\n textRegion.huffman = !!(textRegionSegmentFlags & 1);\n textRegion.refinement = !!(textRegionSegmentFlags & 2);\n textRegion.logStripSize = (textRegionSegmentFlags >> 2) & 3;\n textRegion.stripSize = 1 << textRegion.logStripSize;\n textRegion.referenceCorner = (textRegionSegmentFlags >> 4) & 3;\n textRegion.transposed = !!(textRegionSegmentFlags & 64);\n textRegion.combinationOperator = (textRegionSegmentFlags >> 7) & 3;\n textRegion.defaultPixelValue = (textRegionSegmentFlags >> 9) & 1;\n textRegion.dsOffset = (textRegionSegmentFlags << 17) >> 27;\n textRegion.refinementTemplate = (textRegionSegmentFlags >> 15) & 1;\n if (textRegion.huffman) {\n var textRegionHuffmanFlags = readUint16(data, position);\n position += 2;\n textRegion.huffmanFS = (textRegionHuffmanFlags) & 3;\n textRegion.huffmanDS = (textRegionHuffmanFlags >> 2) & 3;\n textRegion.huffmanDT = (textRegionHuffmanFlags >> 4) & 3;\n textRegion.huffmanRefinementDW = (textRegionHuffmanFlags >> 6) & 3;\n textRegion.huffmanRefinementDH = (textRegionHuffmanFlags >> 8) & 3;\n textRegion.huffmanRefinementDX = (textRegionHuffmanFlags >> 10) & 3;\n textRegion.huffmanRefinementDY = (textRegionHuffmanFlags >> 12) & 3;\n textRegion.huffmanRefinementSizeSelector =\n !!(textRegionHuffmanFlags & 0x4000);\n }\n if (textRegion.refinement && !textRegion.refinementTemplate) {\n at = [];\n for (i = 0; i < 2; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n textRegion.refinementAt = at;\n }\n textRegion.numberOfSymbolInstances = readUint32(data, position);\n position += 4;\n args = [textRegion, header.referredTo, data, position, end];\n break;\n case 16: // PatternDictionary\n // 7.4.4. Pattern dictionary segment syntax\n let patternDictionary = {};\n let patternDictionaryFlags = data[position++];\n patternDictionary.mmr = !!(patternDictionaryFlags & 1);\n patternDictionary.template = (patternDictionaryFlags >> 1) & 3;\n patternDictionary.patternWidth = data[position++];\n patternDictionary.patternHeight = data[position++];\n patternDictionary.maxPatternIndex = readUint32(data, position);\n position += 4;\n args = [patternDictionary, header.number, data, position, end];\n break;\n case 22: // ImmediateHalftoneRegion\n case 23: // ImmediateLosslessHalftoneRegion\n // 7.4.5 Halftone region segment syntax\n let halftoneRegion = {};\n halftoneRegion.info = readRegionSegmentInformation(data, position);\n position += RegionSegmentInformationFieldLength;\n let halftoneRegionFlags = data[position++];\n halftoneRegion.mmr = !!(halftoneRegionFlags & 1);\n halftoneRegion.template = (halftoneRegionFlags >> 1) & 3;\n halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8);\n halftoneRegion.combinationOperator = (halftoneRegionFlags >> 4) & 7;\n halftoneRegion.defaultPixelValue = (halftoneRegionFlags >> 7) & 1;\n halftoneRegion.gridWidth = readUint32(data, position);\n position += 4;\n halftoneRegion.gridHeight = readUint32(data, position);\n position += 4;\n halftoneRegion.gridOffsetX = readUint32(data, position) & 0xFFFFFFFF;\n position += 4;\n halftoneRegion.gridOffsetY = readUint32(data, position) & 0xFFFFFFFF;\n position += 4;\n halftoneRegion.gridVectorX = readUint16(data, position);\n position += 2;\n halftoneRegion.gridVectorY = readUint16(data, position);\n position += 2;\n args = [halftoneRegion, header.referredTo, data, position, end];\n break;\n case 38: // ImmediateGenericRegion\n case 39: // ImmediateLosslessGenericRegion\n var genericRegion = {};\n genericRegion.info = readRegionSegmentInformation(data, position);\n position += RegionSegmentInformationFieldLength;\n var genericRegionSegmentFlags = data[position++];\n genericRegion.mmr = !!(genericRegionSegmentFlags & 1);\n genericRegion.template = (genericRegionSegmentFlags >> 1) & 3;\n genericRegion.prediction = !!(genericRegionSegmentFlags & 8);\n if (!genericRegion.mmr) {\n atLength = genericRegion.template === 0 ? 4 : 1;\n at = [];\n for (i = 0; i < atLength; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n genericRegion.at = at;\n }\n args = [genericRegion, data, position, end];\n break;\n case 48: // PageInformation\n var pageInfo = {\n width: readUint32(data, position),\n height: readUint32(data, position + 4),\n resolutionX: readUint32(data, position + 8),\n resolutionY: readUint32(data, position + 12),\n };\n if (pageInfo.height === 0xFFFFFFFF) {\n delete pageInfo.height;\n }\n var pageSegmentFlags = data[position + 16];\n readUint16(data, position + 17); // pageStripingInformation\n pageInfo.lossless = !!(pageSegmentFlags & 1);\n pageInfo.refinement = !!(pageSegmentFlags & 2);\n pageInfo.defaultPixelValue = (pageSegmentFlags >> 2) & 1;\n pageInfo.combinationOperator = (pageSegmentFlags >> 3) & 3;\n pageInfo.requiresBuffer = !!(pageSegmentFlags & 32);\n pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64);\n args = [pageInfo];\n break;\n case 49: // EndOfPage\n break;\n case 50: // EndOfStripe\n break;\n case 51: // EndOfFile\n break;\n case 53: // Tables\n args = [header.number, data, position, end];\n break;\n case 62: // 7.4.15 defines 2 extension types which\n // are comments and can be ignored.\n break;\n default:\n throw new Jbig2Error(`segment type ${header.typeName}(${header.type})` +\n ' is not implemented');\n }\n var callbackName = 'on' + header.typeName;\n if (callbackName in visitor) {\n visitor[callbackName].apply(visitor, args);\n }\n }\n\n function processSegments(segments, visitor) {\n for (var i = 0, ii = segments.length; i < ii; i++) {\n processSegment(segments[i], visitor);\n }\n }\n\n function parseJbig2Chunks(chunks) {\n var visitor = new SimpleSegmentVisitor();\n for (var i = 0, ii = chunks.length; i < ii; i++) {\n var chunk = chunks[i];\n var segments = readSegments({}, chunk.data, chunk.start, chunk.end);\n processSegments(segments, visitor);\n }\n return visitor.buffer;\n }\n\n function parseJbig2(data) {\n let position = 0, end = data.length;\n\n if (data[position] !== 0x97 || data[position + 1] !== 0x4A ||\n data[position + 2] !== 0x42 || data[position + 3] !== 0x32 ||\n data[position + 4] !== 0x0D || data[position + 5] !== 0x0A ||\n data[position + 6] !== 0x1A || data[position + 7] !== 0x0A) {\n throw new Jbig2Error('parseJbig2 - invalid header.');\n }\n\n let header = Object.create(null);\n position += 8;\n const flags = data[position++];\n header.randomAccess = !(flags & 1);\n if (!(flags & 2)) {\n header.numberOfPages = readUint32(data, position);\n position += 4;\n }\n\n let segments = readSegments(header, data, position, end);\n let visitor = new SimpleSegmentVisitor();\n processSegments(segments, visitor);\n\n const { width, height, } = visitor.currentPageInfo;\n const bitPacked = visitor.buffer;\n let imgData = new Uint8ClampedArray(width * height);\n let q = 0, k = 0;\n for (let i = 0; i < height; i++) {\n let mask = 0, buffer;\n for (let j = 0; j < width; j++) {\n if (!mask) {\n mask = 128; buffer = bitPacked[k++];\n }\n imgData[q++] = (buffer & mask) ? 0 : 255;\n mask >>= 1;\n }\n }\n\n return { imgData, width, height, };\n }\n\n function SimpleSegmentVisitor() {}\n\n SimpleSegmentVisitor.prototype = {\n onPageInformation: function SimpleSegmentVisitor_onPageInformation(info) {\n this.currentPageInfo = info;\n var rowSize = (info.width + 7) >> 3;\n var buffer = new Uint8ClampedArray(rowSize * info.height);\n // The contents of ArrayBuffers are initialized to 0.\n // Fill the buffer with 0xFF only if info.defaultPixelValue is set\n if (info.defaultPixelValue) {\n for (var i = 0, ii = buffer.length; i < ii; i++) {\n buffer[i] = 0xFF;\n }\n }\n this.buffer = buffer;\n },\n drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) {\n var pageInfo = this.currentPageInfo;\n var width = regionInfo.width, height = regionInfo.height;\n var rowSize = (pageInfo.width + 7) >> 3;\n var combinationOperator = pageInfo.combinationOperatorOverride ?\n regionInfo.combinationOperator : pageInfo.combinationOperator;\n var buffer = this.buffer;\n var mask0 = 128 >> (regionInfo.x & 7);\n var offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3);\n var i, j, mask, offset;\n switch (combinationOperator) {\n case 0: // OR\n for (i = 0; i < height; i++) {\n mask = mask0;\n offset = offset0;\n for (j = 0; j < width; j++) {\n if (bitmap[i][j]) {\n buffer[offset] |= mask;\n }\n mask >>= 1;\n if (!mask) {\n mask = 128;\n offset++;\n }\n }\n offset0 += rowSize;\n }\n break;\n case 2: // XOR\n for (i = 0; i < height; i++) {\n mask = mask0;\n offset = offset0;\n for (j = 0; j < width; j++) {\n if (bitmap[i][j]) {\n buffer[offset] ^= mask;\n }\n mask >>= 1;\n if (!mask) {\n mask = 128;\n offset++;\n }\n }\n offset0 += rowSize;\n }\n break;\n default:\n throw new Jbig2Error(\n `operator ${combinationOperator} is not supported`);\n }\n },\n onImmediateGenericRegion:\n function SimpleSegmentVisitor_onImmediateGenericRegion(region, data,\n start, end) {\n var regionInfo = region.info;\n var decodingContext = new DecodingContext(data, start, end);\n var bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height,\n region.template, region.prediction, null,\n region.at, decodingContext);\n this.drawBitmap(regionInfo, bitmap);\n },\n onImmediateLosslessGenericRegion:\n function SimpleSegmentVisitor_onImmediateLosslessGenericRegion() {\n this.onImmediateGenericRegion.apply(this, arguments);\n },\n onSymbolDictionary:\n function SimpleSegmentVisitor_onSymbolDictionary(dictionary,\n currentSegment,\n referredSegments,\n data, start, end) {\n let huffmanTables, huffmanInput;\n if (dictionary.huffman) {\n huffmanTables = getSymbolDictionaryHuffmanTables(dictionary,\n referredSegments, this.customTables);\n huffmanInput = new Reader(data, start, end);\n }\n\n // Combines exported symbols from all referred segments\n var symbols = this.symbols;\n if (!symbols) {\n this.symbols = symbols = {};\n }\n\n var inputSymbols = [];\n for (var i = 0, ii = referredSegments.length; i < ii; i++) {\n let referredSymbols = symbols[referredSegments[i]];\n // referredSymbols is undefined when we have a reference to a Tables\n // segment instead of a SymbolDictionary.\n if (referredSymbols) {\n inputSymbols = inputSymbols.concat(referredSymbols);\n }\n }\n\n var decodingContext = new DecodingContext(data, start, end);\n symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman,\n dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols,\n dictionary.numberOfExportedSymbols, huffmanTables,\n dictionary.template, dictionary.at,\n dictionary.refinementTemplate, dictionary.refinementAt,\n decodingContext, huffmanInput);\n },\n onImmediateTextRegion:\n function SimpleSegmentVisitor_onImmediateTextRegion(region,\n referredSegments,\n data, start, end) {\n var regionInfo = region.info;\n let huffmanTables, huffmanInput;\n\n // Combines exported symbols from all referred segments\n var symbols = this.symbols;\n var inputSymbols = [];\n for (var i = 0, ii = referredSegments.length; i < ii; i++) {\n let referredSymbols = symbols[referredSegments[i]];\n // referredSymbols is undefined when we have a reference to a Tables\n // segment instead of a SymbolDictionary.\n if (referredSymbols) {\n inputSymbols = inputSymbols.concat(referredSymbols);\n }\n }\n var symbolCodeLength = log2(inputSymbols.length);\n if (region.huffman) {\n huffmanInput = new Reader(data, start, end);\n huffmanTables = getTextRegionHuffmanTables(region, referredSegments,\n this.customTables, inputSymbols.length, huffmanInput);\n }\n\n var decodingContext = new DecodingContext(data, start, end);\n var bitmap = decodeTextRegion(region.huffman, region.refinement,\n regionInfo.width, regionInfo.height, region.defaultPixelValue,\n region.numberOfSymbolInstances, region.stripSize, inputSymbols,\n symbolCodeLength, region.transposed, region.dsOffset,\n region.referenceCorner, region.combinationOperator, huffmanTables,\n region.refinementTemplate, region.refinementAt, decodingContext,\n region.logStripSize, huffmanInput);\n this.drawBitmap(regionInfo, bitmap);\n },\n onImmediateLosslessTextRegion:\n function SimpleSegmentVisitor_onImmediateLosslessTextRegion() {\n this.onImmediateTextRegion.apply(this, arguments);\n },\n onPatternDictionary(dictionary, currentSegment, data, start, end) {\n let patterns = this.patterns;\n if (!patterns) {\n this.patterns = patterns = {};\n }\n let decodingContext = new DecodingContext(data, start, end);\n patterns[currentSegment] = decodePatternDictionary(dictionary.mmr,\n dictionary.patternWidth, dictionary.patternHeight,\n dictionary.maxPatternIndex, dictionary.template, decodingContext);\n },\n onImmediateHalftoneRegion(region, referredSegments, data, start, end) {\n // HalftoneRegion refers to exactly one PatternDictionary.\n let patterns = this.patterns[referredSegments[0]];\n let regionInfo = region.info;\n let decodingContext = new DecodingContext(data, start, end);\n let bitmap = decodeHalftoneRegion(region.mmr, patterns,\n region.template, regionInfo.width, regionInfo.height,\n region.defaultPixelValue, region.enableSkip, region.combinationOperator,\n region.gridWidth, region.gridHeight, region.gridOffsetX,\n region.gridOffsetY, region.gridVectorX, region.gridVectorY,\n decodingContext);\n this.drawBitmap(regionInfo, bitmap);\n },\n onImmediateLosslessHalftoneRegion() {\n this.onImmediateHalftoneRegion.apply(this, arguments);\n },\n onTables(currentSegment, data, start, end) {\n let customTables = this.customTables;\n if (!customTables) {\n this.customTables = customTables = {};\n }\n customTables[currentSegment] = decodeTablesSegment(data, start, end);\n },\n };\n\n function HuffmanLine(lineData) {\n if (lineData.length === 2) {\n // OOB line.\n this.isOOB = true;\n this.rangeLow = 0;\n this.prefixLength = lineData[0];\n this.rangeLength = 0;\n this.prefixCode = lineData[1];\n this.isLowerRange = false;\n } else {\n // Normal, upper range or lower range line.\n // Upper range lines are processed like normal lines.\n this.isOOB = false;\n this.rangeLow = lineData[0];\n this.prefixLength = lineData[1];\n this.rangeLength = lineData[2];\n this.prefixCode = lineData[3];\n this.isLowerRange = (lineData[4] === 'lower');\n }\n }\n\n function HuffmanTreeNode(line) {\n this.children = [];\n if (line) {\n // Leaf node\n this.isLeaf = true;\n this.rangeLength = line.rangeLength;\n this.rangeLow = line.rangeLow;\n this.isLowerRange = line.isLowerRange;\n this.isOOB = line.isOOB;\n } else {\n // Intermediate or root node\n this.isLeaf = false;\n }\n }\n\n HuffmanTreeNode.prototype = {\n buildTree(line, shift) {\n let bit = (line.prefixCode >> shift) & 1;\n if (shift <= 0) {\n // Create a leaf node.\n this.children[bit] = new HuffmanTreeNode(line);\n } else {\n // Create an intermediate node and continue recursively.\n let node = this.children[bit];\n if (!node) {\n this.children[bit] = node = new HuffmanTreeNode(null);\n }\n node.buildTree(line, shift - 1);\n }\n },\n decodeNode(reader) {\n if (this.isLeaf) {\n if (this.isOOB) {\n return null;\n }\n let htOffset = reader.readBits(this.rangeLength);\n return this.rangeLow + (this.isLowerRange ? -htOffset : htOffset);\n }\n let node = this.children[reader.readBit()];\n if (!node) {\n throw new Jbig2Error('invalid Huffman data');\n }\n return node.decodeNode(reader);\n },\n };\n\n function HuffmanTable(lines, prefixCodesDone) {\n if (!prefixCodesDone) {\n this.assignPrefixCodes(lines);\n }\n // Create Huffman tree.\n this.rootNode = new HuffmanTreeNode(null);\n let i, ii = lines.length, line;\n for (i = 0; i < ii; i++) {\n line = lines[i];\n if (line.prefixLength > 0) {\n this.rootNode.buildTree(line, line.prefixLength - 1);\n }\n }\n }\n\n HuffmanTable.prototype = {\n decode(reader) {\n return this.rootNode.decodeNode(reader);\n },\n assignPrefixCodes(lines) {\n // Annex B.3 Assigning the prefix codes.\n let linesLength = lines.length, prefixLengthMax = 0, i;\n for (i = 0; i < linesLength; i++) {\n prefixLengthMax = Math.max(prefixLengthMax, lines[i].prefixLength);\n }\n\n let histogram = new Uint32Array(prefixLengthMax + 1);\n for (i = 0; i < linesLength; i++) {\n histogram[lines[i].prefixLength]++;\n }\n let currentLength = 1, firstCode = 0, currentCode, currentTemp, line;\n histogram[0] = 0;\n\n while (currentLength <= prefixLengthMax) {\n firstCode = (firstCode + histogram[currentLength - 1]) << 1;\n currentCode = firstCode;\n currentTemp = 0;\n while (currentTemp < linesLength) {\n line = lines[currentTemp];\n if (line.prefixLength === currentLength) {\n line.prefixCode = currentCode;\n currentCode++;\n }\n currentTemp++;\n }\n currentLength++;\n }\n },\n };\n\n function decodeTablesSegment(data, start, end) {\n // Decodes a Tables segment, i.e., a custom Huffman table.\n // Annex B.2 Code table structure.\n let flags = data[start];\n let lowestValue = readUint32(data, start + 1) & 0xFFFFFFFF;\n let highestValue = readUint32(data, start + 5) & 0xFFFFFFFF;\n let reader = new Reader(data, start + 9, end);\n\n let prefixSizeBits = ((flags >> 1) & 7) + 1;\n let rangeSizeBits = ((flags >> 4) & 7) + 1;\n let lines = [];\n let prefixLength, rangeLength, currentRangeLow = lowestValue;\n\n // Normal table lines\n do {\n prefixLength = reader.readBits(prefixSizeBits);\n rangeLength = reader.readBits(rangeSizeBits);\n lines.push(new HuffmanLine(\n [currentRangeLow, prefixLength, rangeLength, 0]));\n currentRangeLow += 1 << rangeLength;\n } while (currentRangeLow < highestValue);\n\n // Lower range table line\n prefixLength = reader.readBits(prefixSizeBits);\n lines.push(\n new HuffmanLine([lowestValue - 1, prefixLength, 32, 0, 'lower']));\n\n // Upper range table line\n prefixLength = reader.readBits(prefixSizeBits);\n lines.push(new HuffmanLine([highestValue, prefixLength, 32, 0]));\n\n if (flags & 1) {\n // Out-of-band table line\n prefixLength = reader.readBits(prefixSizeBits);\n lines.push(new HuffmanLine([prefixLength, 0]));\n }\n\n return new HuffmanTable(lines, false);\n }\n\n let standardTablesCache = {};\n\n function getStandardTable(number) {\n // Annex B.5 Standard Huffman tables.\n let table = standardTablesCache[number];\n if (table) {\n return table;\n }\n let lines;\n switch (number) {\n case 1:\n lines = [\n [0, 1, 4, 0x0],\n [16, 2, 8, 0x2],\n [272, 3, 16, 0x6],\n [65808, 3, 32, 0x7] // upper\n ];\n break;\n case 2:\n lines = [\n [0, 1, 0, 0x0],\n [1, 2, 0, 0x2],\n [2, 3, 0, 0x6],\n [3, 4, 3, 0xE],\n [11, 5, 6, 0x1E],\n [75, 6, 32, 0x3E], // upper\n [6, 0x3F] // OOB\n ];\n break;\n case 3:\n lines = [\n [-256, 8, 8, 0xFE],\n [0, 1, 0, 0x0],\n [1, 2, 0, 0x2],\n [2, 3, 0, 0x6],\n [3, 4, 3, 0xE],\n [11, 5, 6, 0x1E],\n [-257, 8, 32, 0xFF, 'lower'],\n [75, 7, 32, 0x7E], // upper\n [6, 0x3E] // OOB\n ];\n break;\n case 4:\n lines = [\n [1, 1, 0, 0x0],\n [2, 2, 0, 0x2],\n [3, 3, 0, 0x6],\n [4, 4, 3, 0xE],\n [12, 5, 6, 0x1E],\n [76, 5, 32, 0x1F] // upper\n ];\n break;\n case 5:\n lines = [\n [-255, 7, 8, 0x7E],\n [1, 1, 0, 0x0],\n [2, 2, 0, 0x2],\n [3, 3, 0, 0x6],\n [4, 4, 3, 0xE],\n [12, 5, 6, 0x1E],\n [-256, 7, 32, 0x7F, 'lower'],\n [76, 6, 32, 0x3E] // upper\n ];\n break;\n case 6:\n lines = [\n [-2048, 5, 10, 0x1C],\n [-1024, 4, 9, 0x8],\n [-512, 4, 8, 0x9],\n [-256, 4, 7, 0xA],\n [-128, 5, 6, 0x1D],\n [-64, 5, 5, 0x1E],\n [-32, 4, 5, 0xB],\n [0, 2, 7, 0x0],\n [128, 3, 7, 0x2],\n [256, 3, 8, 0x3],\n [512, 4, 9, 0xC],\n [1024, 4, 10, 0xD],\n [-2049, 6, 32, 0x3E, 'lower'],\n [2048, 6, 32, 0x3F] // upper\n ];\n break;\n case 7:\n lines = [\n [-1024, 4, 9, 0x8],\n [-512, 3, 8, 0x0],\n [-256, 4, 7, 0x9],\n [-128, 5, 6, 0x1A],\n [-64, 5, 5, 0x1B],\n [-32, 4, 5, 0xA],\n [0, 4, 5, 0xB],\n [32, 5, 5, 0x1C],\n [64, 5, 6, 0x1D],\n [128, 4, 7, 0xC],\n [256, 3, 8, 0x1],\n [512, 3, 9, 0x2],\n [1024, 3, 10, 0x3],\n [-1025, 5, 32, 0x1E, 'lower'],\n [2048, 5, 32, 0x1F] // upper\n ];\n break;\n case 8:\n lines = [\n [-15, 8, 3, 0xFC],\n [-7, 9, 1, 0x1FC],\n [-5, 8, 1, 0xFD],\n [-3, 9, 0, 0x1FD],\n [-2, 7, 0, 0x7C],\n [-1, 4, 0, 0xA],\n [0, 2, 1, 0x0],\n [2, 5, 0, 0x1A],\n [3, 6, 0, 0x3A],\n [4, 3, 4, 0x4],\n [20, 6, 1, 0x3B],\n [22, 4, 4, 0xB],\n [38, 4, 5, 0xC],\n [70, 5, 6, 0x1B],\n [134, 5, 7, 0x1C],\n [262, 6, 7, 0x3C],\n [390, 7, 8, 0x7D],\n [646, 6, 10, 0x3D],\n [-16, 9, 32, 0x1FE, 'lower'],\n [1670, 9, 32, 0x1FF], // upper\n [2, 0x1] // OOB\n ];\n break;\n case 9:\n lines = [\n [-31, 8, 4, 0xFC],\n [-15, 9, 2, 0x1FC],\n [-11, 8, 2, 0xFD],\n [-7, 9, 1, 0x1FD],\n [-5, 7, 1, 0x7C],\n [-3, 4, 1, 0xA],\n [-1, 3, 1, 0x2],\n [1, 3, 1, 0x3],\n [3, 5, 1, 0x1A],\n [5, 6, 1, 0x3A],\n [7, 3, 5, 0x4],\n [39, 6, 2, 0x3B],\n [43, 4, 5, 0xB],\n [75, 4, 6, 0xC],\n [139, 5, 7, 0x1B],\n [267, 5, 8, 0x1C],\n [523, 6, 8, 0x3C],\n [779, 7, 9, 0x7D],\n [1291, 6, 11, 0x3D],\n [-32, 9, 32, 0x1FE, 'lower'],\n [3339, 9, 32, 0x1FF], // upper\n [2, 0x0] // OOB\n ];\n break;\n case 10:\n lines = [\n [-21, 7, 4, 0x7A],\n [-5, 8, 0, 0xFC],\n [-4, 7, 0, 0x7B],\n [-3, 5, 0, 0x18],\n [-2, 2, 2, 0x0],\n [2, 5, 0, 0x19],\n [3, 6, 0, 0x36],\n [4, 7, 0, 0x7C],\n [5, 8, 0, 0xFD],\n [6, 2, 6, 0x1],\n [70, 5, 5, 0x1A],\n [102, 6, 5, 0x37],\n [134, 6, 6, 0x38],\n [198, 6, 7, 0x39],\n [326, 6, 8, 0x3A],\n [582, 6, 9, 0x3B],\n [1094, 6, 10, 0x3C],\n [2118, 7, 11, 0x7D],\n [-22, 8, 32, 0xFE, 'lower'],\n [4166, 8, 32, 0xFF], // upper\n [2, 0x2] // OOB\n ];\n break;\n case 11:\n lines = [\n [1, 1, 0, 0x0],\n [2, 2, 1, 0x2],\n [4, 4, 0, 0xC],\n [5, 4, 1, 0xD],\n [7, 5, 1, 0x1C],\n [9, 5, 2, 0x1D],\n [13, 6, 2, 0x3C],\n [17, 7, 2, 0x7A],\n [21, 7, 3, 0x7B],\n [29, 7, 4, 0x7C],\n [45, 7, 5, 0x7D],\n [77, 7, 6, 0x7E],\n [141, 7, 32, 0x7F] // upper\n ];\n break;\n case 12:\n lines = [\n [1, 1, 0, 0x0],\n [2, 2, 0, 0x2],\n [3, 3, 1, 0x6],\n [5, 5, 0, 0x1C],\n [6, 5, 1, 0x1D],\n [8, 6, 1, 0x3C],\n [10, 7, 0, 0x7A],\n [11, 7, 1, 0x7B],\n [13, 7, 2, 0x7C],\n [17, 7, 3, 0x7D],\n [25, 7, 4, 0x7E],\n [41, 8, 5, 0xFE],\n [73, 8, 32, 0xFF] // upper\n ];\n break;\n case 13:\n lines = [\n [1, 1, 0, 0x0],\n [2, 3, 0, 0x4],\n [3, 4, 0, 0xC],\n [4, 5, 0, 0x1C],\n [5, 4, 1, 0xD],\n [7, 3, 3, 0x5],\n [15, 6, 1, 0x3A],\n [17, 6, 2, 0x3B],\n [21, 6, 3, 0x3C],\n [29, 6, 4, 0x3D],\n [45, 6, 5, 0x3E],\n [77, 7, 6, 0x7E],\n [141, 7, 32, 0x7F] // upper\n ];\n break;\n case 14:\n lines = [\n [-2, 3, 0, 0x4],\n [-1, 3, 0, 0x5],\n [0, 1, 0, 0x0],\n [1, 3, 0, 0x6],\n [2, 3, 0, 0x7]\n ];\n break;\n case 15:\n lines = [\n [-24, 7, 4, 0x7C],\n [-8, 6, 2, 0x3C],\n [-4, 5, 1, 0x1C],\n [-2, 4, 0, 0xC],\n [-1, 3, 0, 0x4],\n [0, 1, 0, 0x0],\n [1, 3, 0, 0x5],\n [2, 4, 0, 0xD],\n [3, 5, 1, 0x1D],\n [5, 6, 2, 0x3D],\n [9, 7, 4, 0x7D],\n [-25, 7, 32, 0x7E, 'lower'],\n [25, 7, 32, 0x7F] // upper\n ];\n break;\n default:\n throw new Jbig2Error(`standard table B.${number} does not exist`);\n }\n\n let length = lines.length, i;\n for (i = 0; i < length; i++) {\n lines[i] = new HuffmanLine(lines[i]);\n }\n table = new HuffmanTable(lines, true);\n standardTablesCache[number] = table;\n return table;\n }\n\n function Reader(data, start, end) {\n this.data = data;\n this.start = start;\n this.end = end;\n this.position = start;\n this.shift = -1;\n this.currentByte = 0;\n }\n\n Reader.prototype = {\n readBit() {\n if (this.shift < 0) {\n if (this.position >= this.end) {\n throw new Jbig2Error('end of data while reading bit');\n }\n this.currentByte = this.data[this.position++];\n this.shift = 7;\n }\n let bit = (this.currentByte >> this.shift) & 1;\n this.shift--;\n return bit;\n },\n\n readBits(numBits) {\n let result = 0, i;\n for (i = numBits - 1; i >= 0; i--) {\n result |= this.readBit() << i;\n }\n return result;\n },\n\n byteAlign() {\n this.shift = -1;\n },\n\n next() {\n if (this.position >= this.end) {\n return -1;\n }\n return this.data[this.position++];\n },\n };\n\n function getCustomHuffmanTable(index, referredTo, customTables) {\n // Returns a Tables segment that has been earlier decoded.\n // See 7.4.2.1.6 (symbol dictionary) or 7.4.3.1.6 (text region).\n let currentIndex = 0, i, ii = referredTo.length, table;\n for (i = 0; i < ii; i++) {\n table = customTables[referredTo[i]];\n if (table) {\n if (index === currentIndex) {\n return table;\n }\n currentIndex++;\n }\n }\n throw new Jbig2Error('can\\'t find custom Huffman table');\n }\n\n function getTextRegionHuffmanTables(textRegion, referredTo, customTables,\n numberOfSymbols, reader) {\n // 7.4.3.1.7 Symbol ID Huffman table decoding\n\n // Read code lengths for RUNCODEs 0...34.\n let codes = [], i, codeLength;\n for (i = 0; i <= 34; i++) {\n codeLength = reader.readBits(4);\n codes.push(new HuffmanLine([i, codeLength, 0, 0]));\n }\n // Assign Huffman codes for RUNCODEs.\n let runCodesTable = new HuffmanTable(codes, false);\n\n // Read a Huffman code using the assignment above.\n // Interpret the RUNCODE codes and the additional bits (if any).\n codes.length = 0;\n for (i = 0; i < numberOfSymbols;) {\n codeLength = runCodesTable.decode(reader);\n if (codeLength >= 32) {\n let repeatedLength, numberOfRepeats, j;\n switch (codeLength) {\n case 32:\n if (i === 0) {\n throw new Jbig2Error('no previous value in symbol ID table');\n }\n numberOfRepeats = reader.readBits(2) + 3;\n repeatedLength = codes[i - 1].prefixLength;\n break;\n case 33:\n numberOfRepeats = reader.readBits(3) + 3;\n repeatedLength = 0;\n break;\n case 34:\n numberOfRepeats = reader.readBits(7) + 11;\n repeatedLength = 0;\n break;\n default:\n throw new Jbig2Error('invalid code length in symbol ID table');\n }\n for (j = 0; j < numberOfRepeats; j++) {\n codes.push(new HuffmanLine([i, repeatedLength, 0, 0]));\n i++;\n }\n } else {\n codes.push(new HuffmanLine([i, codeLength, 0, 0]));\n i++;\n }\n }\n reader.byteAlign();\n let symbolIDTable = new HuffmanTable(codes, false);\n\n // 7.4.3.1.6 Text region segment Huffman table selection\n\n let customIndex = 0, tableFirstS, tableDeltaS, tableDeltaT;\n\n switch (textRegion.huffmanFS) {\n case 0:\n case 1:\n tableFirstS = getStandardTable(textRegion.huffmanFS + 6);\n break;\n case 3:\n tableFirstS = getCustomHuffmanTable(customIndex, referredTo,\n customTables);\n customIndex++;\n break;\n default:\n throw new Jbig2Error('invalid Huffman FS selector');\n }\n\n switch (textRegion.huffmanDS) {\n case 0:\n case 1:\n case 2:\n tableDeltaS = getStandardTable(textRegion.huffmanDS + 8);\n break;\n case 3:\n tableDeltaS = getCustomHuffmanTable(customIndex, referredTo,\n customTables);\n customIndex++;\n break;\n default:\n throw new Jbig2Error('invalid Huffman DS selector');\n }\n\n switch (textRegion.huffmanDT) {\n case 0:\n case 1:\n case 2:\n tableDeltaT = getStandardTable(textRegion.huffmanDT + 11);\n break;\n case 3:\n tableDeltaT = getCustomHuffmanTable(customIndex, referredTo,\n customTables);\n customIndex++;\n break;\n default:\n throw new Jbig2Error('invalid Huffman DT selector');\n }\n\n if (textRegion.refinement) {\n // Load tables RDW, RDH, RDX and RDY.\n throw new Jbig2Error('refinement with Huffman is not supported');\n }\n\n return {\n symbolIDTable,\n tableFirstS,\n tableDeltaS,\n tableDeltaT,\n };\n }\n\n function getSymbolDictionaryHuffmanTables(dictionary, referredTo,\n customTables) {\n // 7.4.2.1.6 Symbol dictionary segment Huffman table selection\n\n let customIndex = 0, tableDeltaHeight, tableDeltaWidth;\n switch (dictionary.huffmanDHSelector) {\n case 0:\n case 1:\n tableDeltaHeight = getStandardTable(dictionary.huffmanDHSelector + 4);\n break;\n case 3:\n tableDeltaHeight = getCustomHuffmanTable(customIndex, referredTo,\n customTables);\n customIndex++;\n break;\n default:\n throw new Jbig2Error('invalid Huffman DH selector');\n }\n\n switch (dictionary.huffmanDWSelector) {\n case 0:\n case 1:\n tableDeltaWidth = getStandardTable(dictionary.huffmanDWSelector + 2);\n break;\n case 3:\n tableDeltaWidth = getCustomHuffmanTable(customIndex, referredTo,\n customTables);\n customIndex++;\n break;\n default:\n throw new Jbig2Error('invalid Huffman DW selector');\n }\n\n let tableBitmapSize, tableAggregateInstances;\n if (dictionary.bitmapSizeSelector) {\n tableBitmapSize = getCustomHuffmanTable(customIndex, referredTo,\n customTables);\n customIndex++;\n } else {\n tableBitmapSize = getStandardTable(1);\n }\n\n if (dictionary.aggregationInstancesSelector) {\n tableAggregateInstances = getCustomHuffmanTable(customIndex, referredTo,\n customTables);\n } else {\n tableAggregateInstances = getStandardTable(1);\n }\n\n return {\n tableDeltaHeight,\n tableDeltaWidth,\n tableBitmapSize,\n tableAggregateInstances,\n };\n }\n\n function readUncompressedBitmap(reader, width, height) {\n let bitmap = [], x, y, row;\n for (y = 0; y < height; y++) {\n row = new Uint8Array(width);\n bitmap.push(row);\n for (x = 0; x < width; x++) {\n row[x] = reader.readBit();\n }\n reader.byteAlign();\n }\n return bitmap;\n }\n\n function decodeMMRBitmap(input, width, height, endOfBlock) {\n // MMR is the same compression algorithm as the PDF filter\n // CCITTFaxDecode with /K -1.\n let params = {\n K: -1,\n Columns: width,\n Rows: height,\n BlackIs1: true,\n EndOfBlock: endOfBlock,\n };\n let decoder = new CCITTFaxDecoder(input, params);\n let bitmap = [], x, y, row, currentByte, shift, eof = false;\n\n for (y = 0; y < height; y++) {\n row = new Uint8Array(width);\n bitmap.push(row);\n shift = -1;\n for (x = 0; x < width; x++) {\n if (shift < 0) {\n currentByte = decoder.readNextChar();\n if (currentByte === -1) {\n // Set the rest of the bits to zero.\n currentByte = 0;\n eof = true;\n }\n shift = 7;\n }\n row[x] = (currentByte >> shift) & 1;\n shift--;\n }\n }\n\n if (endOfBlock && !eof) {\n // Read until EOFB has been consumed.\n const lookForEOFLimit = 5;\n for (let i = 0; i < lookForEOFLimit; i++) {\n if (decoder.readNextChar() === -1) {\n break;\n }\n }\n }\n\n return bitmap;\n }\n\n function Jbig2Image() {}\n\n Jbig2Image.prototype = {\n parseChunks(chunks) {\n return parseJbig2Chunks(chunks);\n },\n\n parse(data) {\n const { imgData, width, height, } = parseJbig2(data);\n this.width = width;\n this.height = height;\n return imgData;\n },\n };\n\n return Jbig2Image;\n})();\n\nexport {\n Jbig2Image,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint no-var: error */\n\n// Table C-2\nconst QeTable = [\n { qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1, },\n { qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0, },\n { qe: 0x1801, nmps: 3, nlps: 9, switchFlag: 0, },\n { qe: 0x0AC1, nmps: 4, nlps: 12, switchFlag: 0, },\n { qe: 0x0521, nmps: 5, nlps: 29, switchFlag: 0, },\n { qe: 0x0221, nmps: 38, nlps: 33, switchFlag: 0, },\n { qe: 0x5601, nmps: 7, nlps: 6, switchFlag: 1, },\n { qe: 0x5401, nmps: 8, nlps: 14, switchFlag: 0, },\n { qe: 0x4801, nmps: 9, nlps: 14, switchFlag: 0, },\n { qe: 0x3801, nmps: 10, nlps: 14, switchFlag: 0, },\n { qe: 0x3001, nmps: 11, nlps: 17, switchFlag: 0, },\n { qe: 0x2401, nmps: 12, nlps: 18, switchFlag: 0, },\n { qe: 0x1C01, nmps: 13, nlps: 20, switchFlag: 0, },\n { qe: 0x1601, nmps: 29, nlps: 21, switchFlag: 0, },\n { qe: 0x5601, nmps: 15, nlps: 14, switchFlag: 1, },\n { qe: 0x5401, nmps: 16, nlps: 14, switchFlag: 0, },\n { qe: 0x5101, nmps: 17, nlps: 15, switchFlag: 0, },\n { qe: 0x4801, nmps: 18, nlps: 16, switchFlag: 0, },\n { qe: 0x3801, nmps: 19, nlps: 17, switchFlag: 0, },\n { qe: 0x3401, nmps: 20, nlps: 18, switchFlag: 0, },\n { qe: 0x3001, nmps: 21, nlps: 19, switchFlag: 0, },\n { qe: 0x2801, nmps: 22, nlps: 19, switchFlag: 0, },\n { qe: 0x2401, nmps: 23, nlps: 20, switchFlag: 0, },\n { qe: 0x2201, nmps: 24, nlps: 21, switchFlag: 0, },\n { qe: 0x1C01, nmps: 25, nlps: 22, switchFlag: 0, },\n { qe: 0x1801, nmps: 26, nlps: 23, switchFlag: 0, },\n { qe: 0x1601, nmps: 27, nlps: 24, switchFlag: 0, },\n { qe: 0x1401, nmps: 28, nlps: 25, switchFlag: 0, },\n { qe: 0x1201, nmps: 29, nlps: 26, switchFlag: 0, },\n { qe: 0x1101, nmps: 30, nlps: 27, switchFlag: 0, },\n { qe: 0x0AC1, nmps: 31, nlps: 28, switchFlag: 0, },\n { qe: 0x09C1, nmps: 32, nlps: 29, switchFlag: 0, },\n { qe: 0x08A1, nmps: 33, nlps: 30, switchFlag: 0, },\n { qe: 0x0521, nmps: 34, nlps: 31, switchFlag: 0, },\n { qe: 0x0441, nmps: 35, nlps: 32, switchFlag: 0, },\n { qe: 0x02A1, nmps: 36, nlps: 33, switchFlag: 0, },\n { qe: 0x0221, nmps: 37, nlps: 34, switchFlag: 0, },\n { qe: 0x0141, nmps: 38, nlps: 35, switchFlag: 0, },\n { qe: 0x0111, nmps: 39, nlps: 36, switchFlag: 0, },\n { qe: 0x0085, nmps: 40, nlps: 37, switchFlag: 0, },\n { qe: 0x0049, nmps: 41, nlps: 38, switchFlag: 0, },\n { qe: 0x0025, nmps: 42, nlps: 39, switchFlag: 0, },\n { qe: 0x0015, nmps: 43, nlps: 40, switchFlag: 0, },\n { qe: 0x0009, nmps: 44, nlps: 41, switchFlag: 0, },\n { qe: 0x0005, nmps: 45, nlps: 42, switchFlag: 0, },\n { qe: 0x0001, nmps: 45, nlps: 43, switchFlag: 0, },\n { qe: 0x5601, nmps: 46, nlps: 46, switchFlag: 0, },\n];\n\n/**\n * This class implements the QM Coder decoding as defined in\n * JPEG 2000 Part I Final Committee Draft Version 1.0\n * Annex C.3 Arithmetic decoding procedure\n * available at http://www.jpeg.org/public/fcd15444-1.pdf\n *\n * The arithmetic decoder is used in conjunction with context models to decode\n * JPEG2000 and JBIG2 streams.\n */\nclass ArithmeticDecoder {\n // C.3.5 Initialisation of the decoder (INITDEC)\n constructor(data, start, end) {\n this.data = data;\n this.bp = start;\n this.dataEnd = end;\n\n this.chigh = data[start];\n this.clow = 0;\n\n this.byteIn();\n\n this.chigh = ((this.chigh << 7) & 0xFFFF) | ((this.clow >> 9) & 0x7F);\n this.clow = (this.clow << 7) & 0xFFFF;\n this.ct -= 7;\n this.a = 0x8000;\n }\n\n // C.3.4 Compressed data input (BYTEIN)\n byteIn() {\n const data = this.data;\n let bp = this.bp;\n\n if (data[bp] === 0xFF) {\n if (data[bp + 1] > 0x8F) {\n this.clow += 0xFF00;\n this.ct = 8;\n } else {\n bp++;\n this.clow += (data[bp] << 9);\n this.ct = 7;\n this.bp = bp;\n }\n } else {\n bp++;\n this.clow += bp < this.dataEnd ? (data[bp] << 8) : 0xFF00;\n this.ct = 8;\n this.bp = bp;\n }\n if (this.clow > 0xFFFF) {\n this.chigh += (this.clow >> 16);\n this.clow &= 0xFFFF;\n }\n }\n\n // C.3.2 Decoding a decision (DECODE)\n readBit(contexts, pos) {\n // Contexts are packed into 1 byte:\n // highest 7 bits carry cx.index, lowest bit carries cx.mps\n let cx_index = contexts[pos] >> 1, cx_mps = contexts[pos] & 1;\n const qeTableIcx = QeTable[cx_index];\n const qeIcx = qeTableIcx.qe;\n let d;\n let a = this.a - qeIcx;\n\n if (this.chigh < qeIcx) {\n // exchangeLps\n if (a < qeIcx) {\n a = qeIcx;\n d = cx_mps;\n cx_index = qeTableIcx.nmps;\n } else {\n a = qeIcx;\n d = 1 ^ cx_mps;\n if (qeTableIcx.switchFlag === 1) {\n cx_mps = d;\n }\n cx_index = qeTableIcx.nlps;\n }\n } else {\n this.chigh -= qeIcx;\n if ((a & 0x8000) !== 0) {\n this.a = a;\n return cx_mps;\n }\n // exchangeMps\n if (a < qeIcx) {\n d = 1 ^ cx_mps;\n if (qeTableIcx.switchFlag === 1) {\n cx_mps = d;\n }\n cx_index = qeTableIcx.nlps;\n } else {\n d = cx_mps;\n cx_index = qeTableIcx.nmps;\n }\n }\n // C.3.3 renormD;\n do {\n if (this.ct === 0) {\n this.byteIn();\n }\n\n a <<= 1;\n this.chigh = ((this.chigh << 1) & 0xFFFF) | ((this.clow >> 15) & 1);\n this.clow = (this.clow << 1) & 0xFFFF;\n this.ct--;\n } while ((a & 0x8000) === 0);\n this.a = a;\n\n contexts[pos] = cx_index << 1 | cx_mps;\n return d;\n }\n}\n\nexport {\n ArithmeticDecoder,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* Copyright 1996-2003 Glyph & Cog, LLC\n *\n * The CCITT stream implementation contained in this file is a JavaScript port\n * of XPDF's implementation, made available under the Apache 2.0 open source\n * license.\n */\n\n/**\n * @typedef {Object} CCITTFaxDecoderSource\n * @property {function} next - Method that return one byte of data for decoding,\n * or -1 when EOF is reached.\n */\n\nimport { info } from '../shared/util';\n\nlet CCITTFaxDecoder = (function CCITTFaxDecoder() {\n\n const ccittEOL = -2;\n const ccittEOF = -1;\n const twoDimPass = 0;\n const twoDimHoriz = 1;\n const twoDimVert0 = 2;\n const twoDimVertR1 = 3;\n const twoDimVertL1 = 4;\n const twoDimVertR2 = 5;\n const twoDimVertL2 = 6;\n const twoDimVertR3 = 7;\n const twoDimVertL3 = 8;\n\n const twoDimTable = [\n [-1, -1], [-1, -1], // 000000x\n [7, twoDimVertL3], // 0000010\n [7, twoDimVertR3], // 0000011\n [6, twoDimVertL2], [6, twoDimVertL2], // 000010x\n [6, twoDimVertR2], [6, twoDimVertR2], // 000011x\n [4, twoDimPass], [4, twoDimPass], // 0001xxx\n [4, twoDimPass], [4, twoDimPass],\n [4, twoDimPass], [4, twoDimPass],\n [4, twoDimPass], [4, twoDimPass],\n [3, twoDimHoriz], [3, twoDimHoriz], // 001xxxx\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimVertL1], [3, twoDimVertL1], // 010xxxx\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertR1], [3, twoDimVertR1], // 011xxxx\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [1, twoDimVert0], [1, twoDimVert0], // 1xxxxxx\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0]\n ];\n\n const whiteTable1 = [\n [-1, -1], // 00000\n [12, ccittEOL], // 00001\n [-1, -1], [-1, -1], // 0001x\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 001xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 010xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 011xx\n [11, 1792], [11, 1792], // 1000x\n [12, 1984], // 10010\n [12, 2048], // 10011\n [12, 2112], // 10100\n [12, 2176], // 10101\n [12, 2240], // 10110\n [12, 2304], // 10111\n [11, 1856], [11, 1856], // 1100x\n [11, 1920], [11, 1920], // 1101x\n [12, 2368], // 11100\n [12, 2432], // 11101\n [12, 2496], // 11110\n [12, 2560] // 11111\n ];\n\n const whiteTable2 = [\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000000xx\n [8, 29], [8, 29], // 00000010x\n [8, 30], [8, 30], // 00000011x\n [8, 45], [8, 45], // 00000100x\n [8, 46], [8, 46], // 00000101x\n [7, 22], [7, 22], [7, 22], [7, 22], // 0000011xx\n [7, 23], [7, 23], [7, 23], [7, 23], // 0000100xx\n [8, 47], [8, 47], // 00001010x\n [8, 48], [8, 48], // 00001011x\n [6, 13], [6, 13], [6, 13], [6, 13], // 000011xxx\n [6, 13], [6, 13], [6, 13], [6, 13],\n [7, 20], [7, 20], [7, 20], [7, 20], // 0001000xx\n [8, 33], [8, 33], // 00010010x\n [8, 34], [8, 34], // 00010011x\n [8, 35], [8, 35], // 00010100x\n [8, 36], [8, 36], // 00010101x\n [8, 37], [8, 37], // 00010110x\n [8, 38], [8, 38], // 00010111x\n [7, 19], [7, 19], [7, 19], [7, 19], // 0001100xx\n [8, 31], [8, 31], // 00011010x\n [8, 32], [8, 32], // 00011011x\n [6, 1], [6, 1], [6, 1], [6, 1], // 000111xxx\n [6, 1], [6, 1], [6, 1], [6, 1],\n [6, 12], [6, 12], [6, 12], [6, 12], // 001000xxx\n [6, 12], [6, 12], [6, 12], [6, 12],\n [8, 53], [8, 53], // 00100100x\n [8, 54], [8, 54], // 00100101x\n [7, 26], [7, 26], [7, 26], [7, 26], // 0010011xx\n [8, 39], [8, 39], // 00101000x\n [8, 40], [8, 40], // 00101001x\n [8, 41], [8, 41], // 00101010x\n [8, 42], [8, 42], // 00101011x\n [8, 43], [8, 43], // 00101100x\n [8, 44], [8, 44], // 00101101x\n [7, 21], [7, 21], [7, 21], [7, 21], // 0010111xx\n [7, 28], [7, 28], [7, 28], [7, 28], // 0011000xx\n [8, 61], [8, 61], // 00110010x\n [8, 62], [8, 62], // 00110011x\n [8, 63], [8, 63], // 00110100x\n [8, 0], [8, 0], // 00110101x\n [8, 320], [8, 320], // 00110110x\n [8, 384], [8, 384], // 00110111x\n [5, 10], [5, 10], [5, 10], [5, 10], // 00111xxxx\n [5, 10], [5, 10], [5, 10], [5, 10],\n [5, 10], [5, 10], [5, 10], [5, 10],\n [5, 10], [5, 10], [5, 10], [5, 10],\n [5, 11], [5, 11], [5, 11], [5, 11], // 01000xxxx\n [5, 11], [5, 11], [5, 11], [5, 11],\n [5, 11], [5, 11], [5, 11], [5, 11],\n [5, 11], [5, 11], [5, 11], [5, 11],\n [7, 27], [7, 27], [7, 27], [7, 27], // 0100100xx\n [8, 59], [8, 59], // 01001010x\n [8, 60], [8, 60], // 01001011x\n [9, 1472], // 010011000\n [9, 1536], // 010011001\n [9, 1600], // 010011010\n [9, 1728], // 010011011\n [7, 18], [7, 18], [7, 18], [7, 18], // 0100111xx\n [7, 24], [7, 24], [7, 24], [7, 24], // 0101000xx\n [8, 49], [8, 49], // 01010010x\n [8, 50], [8, 50], // 01010011x\n [8, 51], [8, 51], // 01010100x\n [8, 52], [8, 52], // 01010101x\n [7, 25], [7, 25], [7, 25], [7, 25], // 0101011xx\n [8, 55], [8, 55], // 01011000x\n [8, 56], [8, 56], // 01011001x\n [8, 57], [8, 57], // 01011010x\n [8, 58], [8, 58], // 01011011x\n [6, 192], [6, 192], [6, 192], [6, 192], // 010111xxx\n [6, 192], [6, 192], [6, 192], [6, 192],\n [6, 1664], [6, 1664], [6, 1664], [6, 1664], // 011000xxx\n [6, 1664], [6, 1664], [6, 1664], [6, 1664],\n [8, 448], [8, 448], // 01100100x\n [8, 512], [8, 512], // 01100101x\n [9, 704], // 011001100\n [9, 768], // 011001101\n [8, 640], [8, 640], // 01100111x\n [8, 576], [8, 576], // 01101000x\n [9, 832], // 011010010\n [9, 896], // 011010011\n [9, 960], // 011010100\n [9, 1024], // 011010101\n [9, 1088], // 011010110\n [9, 1152], // 011010111\n [9, 1216], // 011011000\n [9, 1280], // 011011001\n [9, 1344], // 011011010\n [9, 1408], // 011011011\n [7, 256], [7, 256], [7, 256], [7, 256], // 0110111xx\n [4, 2], [4, 2], [4, 2], [4, 2], // 0111xxxxx\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 3], [4, 3], [4, 3], [4, 3], // 1000xxxxx\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [5, 128], [5, 128], [5, 128], [5, 128], // 10010xxxx\n [5, 128], [5, 128], [5, 128], [5, 128],\n [5, 128], [5, 128], [5, 128], [5, 128],\n [5, 128], [5, 128], [5, 128], [5, 128],\n [5, 8], [5, 8], [5, 8], [5, 8], // 10011xxxx\n [5, 8], [5, 8], [5, 8], [5, 8],\n [5, 8], [5, 8], [5, 8], [5, 8],\n [5, 8], [5, 8], [5, 8], [5, 8],\n [5, 9], [5, 9], [5, 9], [5, 9], // 10100xxxx\n [5, 9], [5, 9], [5, 9], [5, 9],\n [5, 9], [5, 9], [5, 9], [5, 9],\n [5, 9], [5, 9], [5, 9], [5, 9],\n [6, 16], [6, 16], [6, 16], [6, 16], // 101010xxx\n [6, 16], [6, 16], [6, 16], [6, 16],\n [6, 17], [6, 17], [6, 17], [6, 17], // 101011xxx\n [6, 17], [6, 17], [6, 17], [6, 17],\n [4, 4], [4, 4], [4, 4], [4, 4], // 1011xxxxx\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 5], [4, 5], [4, 5], [4, 5], // 1100xxxxx\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [6, 14], [6, 14], [6, 14], [6, 14], // 110100xxx\n [6, 14], [6, 14], [6, 14], [6, 14],\n [6, 15], [6, 15], [6, 15], [6, 15], // 110101xxx\n [6, 15], [6, 15], [6, 15], [6, 15],\n [5, 64], [5, 64], [5, 64], [5, 64], // 11011xxxx\n [5, 64], [5, 64], [5, 64], [5, 64],\n [5, 64], [5, 64], [5, 64], [5, 64],\n [5, 64], [5, 64], [5, 64], [5, 64],\n [4, 6], [4, 6], [4, 6], [4, 6], // 1110xxxxx\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 7], [4, 7], [4, 7], [4, 7], // 1111xxxxx\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7]\n ];\n\n const blackTable1 = [\n [-1, -1], [-1, -1], // 000000000000x\n [12, ccittEOL], [12, ccittEOL], // 000000000001x\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000001xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000010xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000011xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000100xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000101xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000110xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000111xx\n [11, 1792], [11, 1792], [11, 1792], [11, 1792], // 00000001000xx\n [12, 1984], [12, 1984], // 000000010010x\n [12, 2048], [12, 2048], // 000000010011x\n [12, 2112], [12, 2112], // 000000010100x\n [12, 2176], [12, 2176], // 000000010101x\n [12, 2240], [12, 2240], // 000000010110x\n [12, 2304], [12, 2304], // 000000010111x\n [11, 1856], [11, 1856], [11, 1856], [11, 1856], // 00000001100xx\n [11, 1920], [11, 1920], [11, 1920], [11, 1920], // 00000001101xx\n [12, 2368], [12, 2368], // 000000011100x\n [12, 2432], [12, 2432], // 000000011101x\n [12, 2496], [12, 2496], // 000000011110x\n [12, 2560], [12, 2560], // 000000011111x\n [10, 18], [10, 18], [10, 18], [10, 18], // 0000001000xxx\n [10, 18], [10, 18], [10, 18], [10, 18],\n [12, 52], [12, 52], // 000000100100x\n [13, 640], // 0000001001010\n [13, 704], // 0000001001011\n [13, 768], // 0000001001100\n [13, 832], // 0000001001101\n [12, 55], [12, 55], // 000000100111x\n [12, 56], [12, 56], // 000000101000x\n [13, 1280], // 0000001010010\n [13, 1344], // 0000001010011\n [13, 1408], // 0000001010100\n [13, 1472], // 0000001010101\n [12, 59], [12, 59], // 000000101011x\n [12, 60], [12, 60], // 000000101100x\n [13, 1536], // 0000001011010\n [13, 1600], // 0000001011011\n [11, 24], [11, 24], [11, 24], [11, 24], // 00000010111xx\n [11, 25], [11, 25], [11, 25], [11, 25], // 00000011000xx\n [13, 1664], // 0000001100100\n [13, 1728], // 0000001100101\n [12, 320], [12, 320], // 000000110011x\n [12, 384], [12, 384], // 000000110100x\n [12, 448], [12, 448], // 000000110101x\n [13, 512], // 0000001101100\n [13, 576], // 0000001101101\n [12, 53], [12, 53], // 000000110111x\n [12, 54], [12, 54], // 000000111000x\n [13, 896], // 0000001110010\n [13, 960], // 0000001110011\n [13, 1024], // 0000001110100\n [13, 1088], // 0000001110101\n [13, 1152], // 0000001110110\n [13, 1216], // 0000001110111\n [10, 64], [10, 64], [10, 64], [10, 64], // 0000001111xxx\n [10, 64], [10, 64], [10, 64], [10, 64]\n ];\n\n const blackTable2 = [\n [8, 13], [8, 13], [8, 13], [8, 13], // 00000100xxxx\n [8, 13], [8, 13], [8, 13], [8, 13],\n [8, 13], [8, 13], [8, 13], [8, 13],\n [8, 13], [8, 13], [8, 13], [8, 13],\n [11, 23], [11, 23], // 00000101000x\n [12, 50], // 000001010010\n [12, 51], // 000001010011\n [12, 44], // 000001010100\n [12, 45], // 000001010101\n [12, 46], // 000001010110\n [12, 47], // 000001010111\n [12, 57], // 000001011000\n [12, 58], // 000001011001\n [12, 61], // 000001011010\n [12, 256], // 000001011011\n [10, 16], [10, 16], [10, 16], [10, 16], // 0000010111xx\n [10, 17], [10, 17], [10, 17], [10, 17], // 0000011000xx\n [12, 48], // 000001100100\n [12, 49], // 000001100101\n [12, 62], // 000001100110\n [12, 63], // 000001100111\n [12, 30], // 000001101000\n [12, 31], // 000001101001\n [12, 32], // 000001101010\n [12, 33], // 000001101011\n [12, 40], // 000001101100\n [12, 41], // 000001101101\n [11, 22], [11, 22], // 00000110111x\n [8, 14], [8, 14], [8, 14], [8, 14], // 00000111xxxx\n [8, 14], [8, 14], [8, 14], [8, 14],\n [8, 14], [8, 14], [8, 14], [8, 14],\n [8, 14], [8, 14], [8, 14], [8, 14],\n [7, 10], [7, 10], [7, 10], [7, 10], // 0000100xxxxx\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 11], [7, 11], [7, 11], [7, 11], // 0000101xxxxx\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [9, 15], [9, 15], [9, 15], [9, 15], // 000011000xxx\n [9, 15], [9, 15], [9, 15], [9, 15],\n [12, 128], // 000011001000\n [12, 192], // 000011001001\n [12, 26], // 000011001010\n [12, 27], // 000011001011\n [12, 28], // 000011001100\n [12, 29], // 000011001101\n [11, 19], [11, 19], // 00001100111x\n [11, 20], [11, 20], // 00001101000x\n [12, 34], // 000011010010\n [12, 35], // 000011010011\n [12, 36], // 000011010100\n [12, 37], // 000011010101\n [12, 38], // 000011010110\n [12, 39], // 000011010111\n [11, 21], [11, 21], // 00001101100x\n [12, 42], // 000011011010\n [12, 43], // 000011011011\n [10, 0], [10, 0], [10, 0], [10, 0], // 0000110111xx\n [7, 12], [7, 12], [7, 12], [7, 12], // 0000111xxxxx\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12]\n ];\n\n const blackTable3 = [\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000xx\n [6, 9], // 000100\n [6, 8], // 000101\n [5, 7], [5, 7], // 00011x\n [4, 6], [4, 6], [4, 6], [4, 6], // 0010xx\n [4, 5], [4, 5], [4, 5], [4, 5], // 0011xx\n [3, 1], [3, 1], [3, 1], [3, 1], // 010xxx\n [3, 1], [3, 1], [3, 1], [3, 1],\n [3, 4], [3, 4], [3, 4], [3, 4], // 011xxx\n [3, 4], [3, 4], [3, 4], [3, 4],\n [2, 3], [2, 3], [2, 3], [2, 3], // 10xxxx\n [2, 3], [2, 3], [2, 3], [2, 3],\n [2, 3], [2, 3], [2, 3], [2, 3],\n [2, 3], [2, 3], [2, 3], [2, 3],\n [2, 2], [2, 2], [2, 2], [2, 2], // 11xxxx\n [2, 2], [2, 2], [2, 2], [2, 2],\n [2, 2], [2, 2], [2, 2], [2, 2],\n [2, 2], [2, 2], [2, 2], [2, 2]\n ];\n\n /**\n * @param {CCITTFaxDecoderSource} source - The data which should be decoded.\n * @param {Object} options - (optional) Decoding options.\n */\n function CCITTFaxDecoder(source, options = {}) {\n if (!source || typeof source.next !== 'function') {\n throw new Error('CCITTFaxDecoder - invalid \"source\" parameter.');\n }\n this.source = source;\n this.eof = false;\n\n this.encoding = options['K'] || 0;\n this.eoline = options['EndOfLine'] || false;\n this.byteAlign = options['EncodedByteAlign'] || false;\n this.columns = options['Columns'] || 1728;\n this.rows = options['Rows'] || 0;\n let eoblock = options['EndOfBlock'];\n if (eoblock === null || eoblock === undefined) {\n eoblock = true;\n }\n this.eoblock = eoblock;\n this.black = options['BlackIs1'] || false;\n\n this.codingLine = new Uint32Array(this.columns + 1);\n this.refLine = new Uint32Array(this.columns + 2);\n\n this.codingLine[0] = this.columns;\n this.codingPos = 0;\n\n this.row = 0;\n this.nextLine2D = this.encoding < 0;\n this.inputBits = 0;\n this.inputBuf = 0;\n this.outputBits = 0;\n this.rowsDone = false;\n\n let code1;\n while ((code1 = this._lookBits(12)) === 0) {\n this._eatBits(1);\n }\n if (code1 === 1) {\n this._eatBits(12);\n }\n if (this.encoding > 0) {\n this.nextLine2D = !this._lookBits(1);\n this._eatBits(1);\n }\n }\n\n CCITTFaxDecoder.prototype = {\n readNextChar() {\n if (this.eof) {\n return -1;\n }\n let refLine = this.refLine;\n let codingLine = this.codingLine;\n let columns = this.columns;\n\n let refPos, blackPixels, bits, i;\n\n if (this.outputBits === 0) {\n if (this.rowsDone) {\n this.eof = true;\n }\n if (this.eof) {\n return -1;\n }\n this.err = false;\n\n let code1, code2, code3;\n if (this.nextLine2D) {\n for (i = 0; codingLine[i] < columns; ++i) {\n refLine[i] = codingLine[i];\n }\n refLine[i++] = columns;\n refLine[i] = columns;\n codingLine[0] = 0;\n this.codingPos = 0;\n refPos = 0;\n blackPixels = 0;\n\n while (codingLine[this.codingPos] < columns) {\n code1 = this._getTwoDimCode();\n switch (code1) {\n case twoDimPass:\n this._addPixels(refLine[refPos + 1], blackPixels);\n if (refLine[refPos + 1] < columns) {\n refPos += 2;\n }\n break;\n case twoDimHoriz:\n code1 = code2 = 0;\n if (blackPixels) {\n do {\n code1 += (code3 = this._getBlackCode());\n } while (code3 >= 64);\n do {\n code2 += (code3 = this._getWhiteCode());\n } while (code3 >= 64);\n } else {\n do {\n code1 += (code3 = this._getWhiteCode());\n } while (code3 >= 64);\n do {\n code2 += (code3 = this._getBlackCode());\n } while (code3 >= 64);\n }\n this._addPixels(codingLine[this.codingPos] +\n code1, blackPixels);\n if (codingLine[this.codingPos] < columns) {\n this._addPixels(codingLine[this.codingPos] + code2,\n blackPixels ^ 1);\n }\n while (refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns) {\n refPos += 2;\n }\n break;\n case twoDimVertR3:\n this._addPixels(refLine[refPos] + 3, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertR2:\n this._addPixels(refLine[refPos] + 2, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertR1:\n this._addPixels(refLine[refPos] + 1, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns) {\n refPos += 2;\n }\n }\n break;\n case twoDimVert0:\n this._addPixels(refLine[refPos], blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertL3:\n this._addPixelsNeg(refLine[refPos] - 3, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n if (refPos > 0) {\n --refPos;\n } else {\n ++refPos;\n }\n while (refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertL2:\n this._addPixelsNeg(refLine[refPos] - 2, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n if (refPos > 0) {\n --refPos;\n } else {\n ++refPos;\n }\n while (refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertL1:\n this._addPixelsNeg(refLine[refPos] - 1, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n if (refPos > 0) {\n --refPos;\n } else {\n ++refPos;\n }\n while (refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns) {\n refPos += 2;\n }\n }\n break;\n case ccittEOF:\n this._addPixels(columns, 0);\n this.eof = true;\n break;\n default:\n info('bad 2d code');\n this._addPixels(columns, 0);\n this.err = true;\n }\n }\n } else {\n codingLine[0] = 0;\n this.codingPos = 0;\n blackPixels = 0;\n while (codingLine[this.codingPos] < columns) {\n code1 = 0;\n if (blackPixels) {\n do {\n code1 += (code3 = this._getBlackCode());\n } while (code3 >= 64);\n } else {\n do {\n code1 += (code3 = this._getWhiteCode());\n } while (code3 >= 64);\n }\n this._addPixels(codingLine[this.codingPos] + code1, blackPixels);\n blackPixels ^= 1;\n }\n }\n\n let gotEOL = false;\n\n if (this.byteAlign) {\n this.inputBits &= ~7;\n }\n\n if (!this.eoblock && this.row === this.rows - 1) {\n this.rowsDone = true;\n } else {\n code1 = this._lookBits(12);\n if (this.eoline) {\n while (code1 !== ccittEOF && code1 !== 1) {\n this._eatBits(1);\n code1 = this._lookBits(12);\n }\n } else {\n while (code1 === 0) {\n this._eatBits(1);\n code1 = this._lookBits(12);\n }\n }\n if (code1 === 1) {\n this._eatBits(12);\n gotEOL = true;\n } else if (code1 === ccittEOF) {\n this.eof = true;\n }\n }\n\n if (!this.eof && this.encoding > 0 && !this.rowsDone) {\n this.nextLine2D = !this._lookBits(1);\n this._eatBits(1);\n }\n\n if (this.eoblock && gotEOL && this.byteAlign) {\n code1 = this._lookBits(12);\n if (code1 === 1) {\n this._eatBits(12);\n if (this.encoding > 0) {\n this._lookBits(1);\n this._eatBits(1);\n }\n if (this.encoding >= 0) {\n for (i = 0; i < 4; ++i) {\n code1 = this._lookBits(12);\n if (code1 !== 1) {\n info('bad rtc code: ' + code1);\n }\n this._eatBits(12);\n if (this.encoding > 0) {\n this._lookBits(1);\n this._eatBits(1);\n }\n }\n }\n this.eof = true;\n }\n } else if (this.err && this.eoline) {\n while (true) {\n code1 = this._lookBits(13);\n if (code1 === ccittEOF) {\n this.eof = true;\n return -1;\n }\n if ((code1 >> 1) === 1) {\n break;\n }\n this._eatBits(1);\n }\n this._eatBits(12);\n if (this.encoding > 0) {\n this._eatBits(1);\n this.nextLine2D = !(code1 & 1);\n }\n }\n\n if (codingLine[0] > 0) {\n this.outputBits = codingLine[this.codingPos = 0];\n } else {\n this.outputBits = codingLine[this.codingPos = 1];\n }\n this.row++;\n }\n\n let c;\n if (this.outputBits >= 8) {\n c = (this.codingPos & 1) ? 0 : 0xFF;\n this.outputBits -= 8;\n if (this.outputBits === 0 && codingLine[this.codingPos] < columns) {\n this.codingPos++;\n this.outputBits = (codingLine[this.codingPos] -\n codingLine[this.codingPos - 1]);\n }\n } else {\n bits = 8;\n c = 0;\n do {\n if (this.outputBits > bits) {\n c <<= bits;\n if (!(this.codingPos & 1)) {\n c |= 0xFF >> (8 - bits);\n }\n this.outputBits -= bits;\n bits = 0;\n } else {\n c <<= this.outputBits;\n if (!(this.codingPos & 1)) {\n c |= 0xFF >> (8 - this.outputBits);\n }\n bits -= this.outputBits;\n this.outputBits = 0;\n if (codingLine[this.codingPos] < columns) {\n this.codingPos++;\n this.outputBits = (codingLine[this.codingPos] -\n codingLine[this.codingPos - 1]);\n } else if (bits > 0) {\n c <<= bits;\n bits = 0;\n }\n }\n } while (bits);\n }\n if (this.black) {\n c ^= 0xFF;\n }\n return c;\n },\n\n /**\n * @private\n */\n _addPixels(a1, blackPixels) {\n let codingLine = this.codingLine;\n let codingPos = this.codingPos;\n\n if (a1 > codingLine[codingPos]) {\n if (a1 > this.columns) {\n info('row is wrong length');\n this.err = true;\n a1 = this.columns;\n }\n if ((codingPos & 1) ^ blackPixels) {\n ++codingPos;\n }\n\n codingLine[codingPos] = a1;\n }\n this.codingPos = codingPos;\n },\n\n /**\n * @private\n */\n _addPixelsNeg(a1, blackPixels) {\n let codingLine = this.codingLine;\n let codingPos = this.codingPos;\n\n if (a1 > codingLine[codingPos]) {\n if (a1 > this.columns) {\n info('row is wrong length');\n this.err = true;\n a1 = this.columns;\n }\n if ((codingPos & 1) ^ blackPixels) {\n ++codingPos;\n }\n\n codingLine[codingPos] = a1;\n } else if (a1 < codingLine[codingPos]) {\n if (a1 < 0) {\n info('invalid code');\n this.err = true;\n a1 = 0;\n }\n while (codingPos > 0 && a1 < codingLine[codingPos - 1]) {\n --codingPos;\n }\n codingLine[codingPos] = a1;\n }\n\n this.codingPos = codingPos;\n },\n\n /**\n * This function returns the code found from the table.\n * The start and end parameters set the boundaries for searching the table.\n * The limit parameter is optional. Function returns an array with three\n * values. The first array element indicates whether a valid code is being\n * returned. The second array element is the actual code. The third array\n * element indicates whether EOF was reached.\n * @private\n */\n _findTableCode(start, end, table, limit) {\n let limitValue = limit || 0;\n for (let i = start; i <= end; ++i) {\n let code = this._lookBits(i);\n if (code === ccittEOF) {\n return [true, 1, false];\n }\n if (i < end) {\n code <<= end - i;\n }\n if (!limitValue || code >= limitValue) {\n let p = table[code - limitValue];\n if (p[0] === i) {\n this._eatBits(i);\n return [true, p[1], true];\n }\n }\n }\n return [false, 0, false];\n },\n\n /**\n * @private\n */\n _getTwoDimCode() {\n let code = 0;\n let p;\n if (this.eoblock) {\n code = this._lookBits(7);\n p = twoDimTable[code];\n if (p && p[0] > 0) {\n this._eatBits(p[0]);\n return p[1];\n }\n } else {\n let result = this._findTableCode(1, 7, twoDimTable);\n if (result[0] && result[2]) {\n return result[1];\n }\n }\n info('Bad two dim code');\n return ccittEOF;\n },\n\n /**\n * @private\n */\n _getWhiteCode() {\n let code = 0;\n let p;\n if (this.eoblock) {\n code = this._lookBits(12);\n if (code === ccittEOF) {\n return 1;\n }\n\n if ((code >> 5) === 0) {\n p = whiteTable1[code];\n } else {\n p = whiteTable2[code >> 3];\n }\n\n if (p[0] > 0) {\n this._eatBits(p[0]);\n return p[1];\n }\n } else {\n let result = this._findTableCode(1, 9, whiteTable2);\n if (result[0]) {\n return result[1];\n }\n\n result = this._findTableCode(11, 12, whiteTable1);\n if (result[0]) {\n return result[1];\n }\n }\n info('bad white code');\n this._eatBits(1);\n return 1;\n },\n\n /**\n * @private\n */\n _getBlackCode() {\n let code, p;\n if (this.eoblock) {\n code = this._lookBits(13);\n if (code === ccittEOF) {\n return 1;\n }\n if ((code >> 7) === 0) {\n p = blackTable1[code];\n } else if ((code >> 9) === 0 && (code >> 7) !== 0) {\n p = blackTable2[(code >> 1) - 64];\n } else {\n p = blackTable3[code >> 7];\n }\n\n if (p[0] > 0) {\n this._eatBits(p[0]);\n return p[1];\n }\n } else {\n let result = this._findTableCode(2, 6, blackTable3);\n if (result[0]) {\n return result[1];\n }\n\n result = this._findTableCode(7, 12, blackTable2, 64);\n if (result[0]) {\n return result[1];\n }\n\n result = this._findTableCode(10, 13, blackTable1);\n if (result[0]) {\n return result[1];\n }\n }\n info('bad black code');\n this._eatBits(1);\n return 1;\n },\n\n /**\n * @private\n */\n _lookBits(n) {\n let c;\n while (this.inputBits < n) {\n if ((c = this.source.next()) === -1) {\n if (this.inputBits === 0) {\n return ccittEOF;\n }\n return ((this.inputBuf << (n - this.inputBits)) &\n (0xFFFF >> (16 - n)));\n }\n this.inputBuf = (this.inputBuf << 8) | c;\n this.inputBits += 8;\n }\n return (this.inputBuf >> (this.inputBits - n)) & (0xFFFF >> (16 - n));\n },\n\n /**\n * @private\n */\n _eatBits(n) {\n if ((this.inputBits -= n) < 0) {\n this.inputBits = 0;\n }\n },\n };\n\n return CCITTFaxDecoder;\n})();\n\nexport {\n CCITTFaxDecoder,\n};\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable no-multi-spaces */\n\nimport { assert, warn } from '../shared/util';\n\nlet JpegError = (function JpegErrorClosure() {\n function JpegError(msg) {\n this.message = 'JPEG error: ' + msg;\n }\n\n JpegError.prototype = new Error();\n JpegError.prototype.name = 'JpegError';\n JpegError.constructor = JpegError;\n\n return JpegError;\n})();\n\nlet DNLMarkerError = (function DNLMarkerErrorClosure() {\n function DNLMarkerError(message, scanLines) {\n this.message = message;\n this.scanLines = scanLines;\n }\n\n DNLMarkerError.prototype = new Error();\n DNLMarkerError.prototype.name = 'DNLMarkerError';\n DNLMarkerError.constructor = DNLMarkerError;\n\n return DNLMarkerError;\n})();\n\nlet EOIMarkerError = (function EOIMarkerErrorClosure() {\n function EOIMarkerError(message) {\n this.message = message;\n }\n\n EOIMarkerError.prototype = new Error();\n EOIMarkerError.prototype.name = 'EOIMarkerError';\n EOIMarkerError.constructor = EOIMarkerError;\n\n return EOIMarkerError;\n})();\n\n/**\n * This code was forked from https://github.com/notmasteryet/jpgjs.\n * The original version was created by GitHub user notmasteryet.\n *\n * - The JPEG specification can be found in the ITU CCITT Recommendation T.81\n * (www.w3.org/Graphics/JPEG/itu-t81.pdf)\n * - The JFIF specification can be found in the JPEG File Interchange Format\n * (www.w3.org/Graphics/JPEG/jfif3.pdf)\n * - The Adobe Application-Specific JPEG markers in the\n * Supporting the DCT Filters in PostScript Level 2, Technical Note #5116\n * (partners.adobe.com/public/developer/en/ps/sdk/5116.DCT_Filter.pdf)\n */\n\nvar JpegImage = (function JpegImageClosure() {\n var dctZigZag = new Uint8Array([\n 0,\n 1, 8,\n 16, 9, 2,\n 3, 10, 17, 24,\n 32, 25, 18, 11, 4,\n 5, 12, 19, 26, 33, 40,\n 48, 41, 34, 27, 20, 13, 6,\n 7, 14, 21, 28, 35, 42, 49, 56,\n 57, 50, 43, 36, 29, 22, 15,\n 23, 30, 37, 44, 51, 58,\n 59, 52, 45, 38, 31,\n 39, 46, 53, 60,\n 61, 54, 47,\n 55, 62,\n 63\n ]);\n\n var dctCos1 = 4017; // cos(pi/16)\n var dctSin1 = 799; // sin(pi/16)\n var dctCos3 = 3406; // cos(3*pi/16)\n var dctSin3 = 2276; // sin(3*pi/16)\n var dctCos6 = 1567; // cos(6*pi/16)\n var dctSin6 = 3784; // sin(6*pi/16)\n var dctSqrt2 = 5793; // sqrt(2)\n var dctSqrt1d2 = 2896; // sqrt(2) / 2\n\n function JpegImage({ decodeTransform = null, colorTransform = -1, } = {}) {\n this._decodeTransform = decodeTransform;\n this._colorTransform = colorTransform;\n }\n\n function buildHuffmanTable(codeLengths, values) {\n var k = 0, code = [], i, j, length = 16;\n while (length > 0 && !codeLengths[length - 1]) {\n length--;\n }\n code.push({ children: [], index: 0, });\n var p = code[0], q;\n for (i = 0; i < length; i++) {\n for (j = 0; j < codeLengths[i]; j++) {\n p = code.pop();\n p.children[p.index] = values[k];\n while (p.index > 0) {\n p = code.pop();\n }\n p.index++;\n code.push(p);\n while (code.length <= i) {\n code.push(q = { children: [], index: 0, });\n p.children[p.index] = q.children;\n p = q;\n }\n k++;\n }\n if (i + 1 < length) {\n // p here points to last code\n code.push(q = { children: [], index: 0, });\n p.children[p.index] = q.children;\n p = q;\n }\n }\n return code[0].children;\n }\n\n function getBlockBufferOffset(component, row, col) {\n return 64 * ((component.blocksPerLine + 1) * row + col);\n }\n\n function decodeScan(data, offset, frame, components, resetInterval,\n spectralStart, spectralEnd, successivePrev, successive,\n parseDNLMarker = false) {\n var mcusPerLine = frame.mcusPerLine;\n var progressive = frame.progressive;\n\n var startOffset = offset, bitsData = 0, bitsCount = 0;\n\n function readBit() {\n if (bitsCount > 0) {\n bitsCount--;\n return (bitsData >> bitsCount) & 1;\n }\n bitsData = data[offset++];\n if (bitsData === 0xFF) {\n var nextByte = data[offset++];\n if (nextByte) {\n if (nextByte === 0xDC && parseDNLMarker) { // DNL == 0xFFDC\n offset += 2; // Skip data length.\n const scanLines = (data[offset++] << 8) | data[offset++];\n if (scanLines > 0 && scanLines !== frame.scanLines) {\n throw new DNLMarkerError(\n 'Found DNL marker (0xFFDC) while parsing scan data', scanLines);\n }\n } else if (nextByte === 0xD9) { // EOI == 0xFFD9\n throw new EOIMarkerError(\n 'Found EOI marker (0xFFD9) while parsing scan data');\n }\n throw new JpegError(\n `unexpected marker ${((bitsData << 8) | nextByte).toString(16)}`);\n }\n // unstuff 0\n }\n bitsCount = 7;\n return bitsData >>> 7;\n }\n\n function decodeHuffman(tree) {\n var node = tree;\n while (true) {\n node = node[readBit()];\n if (typeof node === 'number') {\n return node;\n }\n if (typeof node !== 'object') {\n throw new JpegError('invalid huffman sequence');\n }\n }\n }\n\n function receive(length) {\n var n = 0;\n while (length > 0) {\n n = (n << 1) | readBit();\n length--;\n }\n return n;\n }\n\n function receiveAndExtend(length) {\n if (length === 1) {\n return readBit() === 1 ? 1 : -1;\n }\n var n = receive(length);\n if (n >= 1 << (length - 1)) {\n return n;\n }\n return n + (-1 << length) + 1;\n }\n\n function decodeBaseline(component, offset) {\n var t = decodeHuffman(component.huffmanTableDC);\n var diff = t === 0 ? 0 : receiveAndExtend(t);\n component.blockData[offset] = (component.pred += diff);\n var k = 1;\n while (k < 64) {\n var rs = decodeHuffman(component.huffmanTableAC);\n var s = rs & 15, r = rs >> 4;\n if (s === 0) {\n if (r < 15) {\n break;\n }\n k += 16;\n continue;\n }\n k += r;\n var z = dctZigZag[k];\n component.blockData[offset + z] = receiveAndExtend(s);\n k++;\n }\n }\n\n function decodeDCFirst(component, offset) {\n var t = decodeHuffman(component.huffmanTableDC);\n var diff = t === 0 ? 0 : (receiveAndExtend(t) << successive);\n component.blockData[offset] = (component.pred += diff);\n }\n\n function decodeDCSuccessive(component, offset) {\n component.blockData[offset] |= readBit() << successive;\n }\n\n var eobrun = 0;\n function decodeACFirst(component, offset) {\n if (eobrun > 0) {\n eobrun--;\n return;\n }\n var k = spectralStart, e = spectralEnd;\n while (k <= e) {\n var rs = decodeHuffman(component.huffmanTableAC);\n var s = rs & 15, r = rs >> 4;\n if (s === 0) {\n if (r < 15) {\n eobrun = receive(r) + (1 << r) - 1;\n break;\n }\n k += 16;\n continue;\n }\n k += r;\n var z = dctZigZag[k];\n component.blockData[offset + z] =\n receiveAndExtend(s) * (1 << successive);\n k++;\n }\n }\n\n var successiveACState = 0, successiveACNextValue;\n function decodeACSuccessive(component, offset) {\n var k = spectralStart;\n var e = spectralEnd;\n var r = 0;\n var s;\n var rs;\n while (k <= e) {\n let offsetZ = offset + dctZigZag[k];\n let sign = component.blockData[offsetZ] < 0 ? -1 : 1;\n switch (successiveACState) {\n case 0: // initial state\n rs = decodeHuffman(component.huffmanTableAC);\n s = rs & 15;\n r = rs >> 4;\n if (s === 0) {\n if (r < 15) {\n eobrun = receive(r) + (1 << r);\n successiveACState = 4;\n } else {\n r = 16;\n successiveACState = 1;\n }\n } else {\n if (s !== 1) {\n throw new JpegError('invalid ACn encoding');\n }\n successiveACNextValue = receiveAndExtend(s);\n successiveACState = r ? 2 : 3;\n }\n continue;\n case 1: // skipping r zero items\n case 2:\n if (component.blockData[offsetZ]) {\n component.blockData[offsetZ] += sign * (readBit() << successive);\n } else {\n r--;\n if (r === 0) {\n successiveACState = successiveACState === 2 ? 3 : 0;\n }\n }\n break;\n case 3: // set value for a zero item\n if (component.blockData[offsetZ]) {\n component.blockData[offsetZ] += sign * (readBit() << successive);\n } else {\n component.blockData[offsetZ] =\n successiveACNextValue << successive;\n successiveACState = 0;\n }\n break;\n case 4: // eob\n if (component.blockData[offsetZ]) {\n component.blockData[offsetZ] += sign * (readBit() << successive);\n }\n break;\n }\n k++;\n }\n if (successiveACState === 4) {\n eobrun--;\n if (eobrun === 0) {\n successiveACState = 0;\n }\n }\n }\n\n function decodeMcu(component, decode, mcu, row, col) {\n var mcuRow = (mcu / mcusPerLine) | 0;\n var mcuCol = mcu % mcusPerLine;\n var blockRow = mcuRow * component.v + row;\n var blockCol = mcuCol * component.h + col;\n var offset = getBlockBufferOffset(component, blockRow, blockCol);\n decode(component, offset);\n }\n\n function decodeBlock(component, decode, mcu) {\n var blockRow = (mcu / component.blocksPerLine) | 0;\n var blockCol = mcu % component.blocksPerLine;\n var offset = getBlockBufferOffset(component, blockRow, blockCol);\n decode(component, offset);\n }\n\n var componentsLength = components.length;\n var component, i, j, k, n;\n var decodeFn;\n if (progressive) {\n if (spectralStart === 0) {\n decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive;\n } else {\n decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive;\n }\n } else {\n decodeFn = decodeBaseline;\n }\n\n var mcu = 0, fileMarker;\n var mcuExpected;\n if (componentsLength === 1) {\n mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn;\n } else {\n mcuExpected = mcusPerLine * frame.mcusPerColumn;\n }\n\n var h, v;\n while (mcu < mcuExpected) {\n // reset interval stuff\n var mcuToRead = resetInterval ?\n Math.min(mcuExpected - mcu, resetInterval) : mcuExpected;\n for (i = 0; i < componentsLength; i++) {\n components[i].pred = 0;\n }\n eobrun = 0;\n\n if (componentsLength === 1) {\n component = components[0];\n for (n = 0; n < mcuToRead; n++) {\n decodeBlock(component, decodeFn, mcu);\n mcu++;\n }\n } else {\n for (n = 0; n < mcuToRead; n++) {\n for (i = 0; i < componentsLength; i++) {\n component = components[i];\n h = component.h;\n v = component.v;\n for (j = 0; j < v; j++) {\n for (k = 0; k < h; k++) {\n decodeMcu(component, decodeFn, mcu, j, k);\n }\n }\n }\n mcu++;\n }\n }\n\n // find marker\n bitsCount = 0;\n fileMarker = findNextFileMarker(data, offset);\n // Some bad images seem to pad Scan blocks with e.g. zero bytes, skip past\n // those to attempt to find a valid marker (fixes issue4090.pdf).\n if (fileMarker && fileMarker.invalid) {\n warn('decodeScan - unexpected MCU data, current marker is: ' +\n fileMarker.invalid);\n offset = fileMarker.offset;\n }\n var marker = fileMarker && fileMarker.marker;\n if (!marker || marker <= 0xFF00) {\n throw new JpegError('marker was not found');\n }\n\n if (marker >= 0xFFD0 && marker <= 0xFFD7) { // RSTx\n offset += 2;\n } else {\n break;\n }\n }\n\n fileMarker = findNextFileMarker(data, offset);\n // Some images include more Scan blocks than expected, skip past those and\n // attempt to find the next valid marker (fixes issue8182.pdf).\n if (fileMarker && fileMarker.invalid) {\n warn('decodeScan - unexpected Scan data, current marker is: ' +\n fileMarker.invalid);\n offset = fileMarker.offset;\n }\n\n return offset - startOffset;\n }\n\n // A port of poppler's IDCT method which in turn is taken from:\n // Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz,\n // 'Practical Fast 1-D DCT Algorithms with 11 Multiplications',\n // IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989,\n // 988-991.\n function quantizeAndInverse(component, blockBufferOffset, p) {\n var qt = component.quantizationTable, blockData = component.blockData;\n var v0, v1, v2, v3, v4, v5, v6, v7;\n var p0, p1, p2, p3, p4, p5, p6, p7;\n var t;\n\n if (!qt) {\n throw new JpegError('missing required Quantization Table.');\n }\n\n // inverse DCT on rows\n for (var row = 0; row < 64; row += 8) {\n // gather block data\n p0 = blockData[blockBufferOffset + row];\n p1 = blockData[blockBufferOffset + row + 1];\n p2 = blockData[blockBufferOffset + row + 2];\n p3 = blockData[blockBufferOffset + row + 3];\n p4 = blockData[blockBufferOffset + row + 4];\n p5 = blockData[blockBufferOffset + row + 5];\n p6 = blockData[blockBufferOffset + row + 6];\n p7 = blockData[blockBufferOffset + row + 7];\n\n // dequant p0\n p0 *= qt[row];\n\n // check for all-zero AC coefficients\n if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) {\n t = (dctSqrt2 * p0 + 512) >> 10;\n p[row] = t;\n p[row + 1] = t;\n p[row + 2] = t;\n p[row + 3] = t;\n p[row + 4] = t;\n p[row + 5] = t;\n p[row + 6] = t;\n p[row + 7] = t;\n continue;\n }\n // dequant p1 ... p7\n p1 *= qt[row + 1];\n p2 *= qt[row + 2];\n p3 *= qt[row + 3];\n p4 *= qt[row + 4];\n p5 *= qt[row + 5];\n p6 *= qt[row + 6];\n p7 *= qt[row + 7];\n\n // stage 4\n v0 = (dctSqrt2 * p0 + 128) >> 8;\n v1 = (dctSqrt2 * p4 + 128) >> 8;\n v2 = p2;\n v3 = p6;\n v4 = (dctSqrt1d2 * (p1 - p7) + 128) >> 8;\n v7 = (dctSqrt1d2 * (p1 + p7) + 128) >> 8;\n v5 = p3 << 4;\n v6 = p5 << 4;\n\n // stage 3\n v0 = (v0 + v1 + 1) >> 1;\n v1 = v0 - v1;\n t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8;\n v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8;\n v3 = t;\n v4 = (v4 + v6 + 1) >> 1;\n v6 = v4 - v6;\n v7 = (v7 + v5 + 1) >> 1;\n v5 = v7 - v5;\n\n // stage 2\n v0 = (v0 + v3 + 1) >> 1;\n v3 = v0 - v3;\n v1 = (v1 + v2 + 1) >> 1;\n v2 = v1 - v2;\n t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;\n v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;\n v7 = t;\n t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;\n v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;\n v6 = t;\n\n // stage 1\n p[row] = v0 + v7;\n p[row + 7] = v0 - v7;\n p[row + 1] = v1 + v6;\n p[row + 6] = v1 - v6;\n p[row + 2] = v2 + v5;\n p[row + 5] = v2 - v5;\n p[row + 3] = v3 + v4;\n p[row + 4] = v3 - v4;\n }\n\n // inverse DCT on columns\n for (var col = 0; col < 8; ++col) {\n p0 = p[col];\n p1 = p[col + 8];\n p2 = p[col + 16];\n p3 = p[col + 24];\n p4 = p[col + 32];\n p5 = p[col + 40];\n p6 = p[col + 48];\n p7 = p[col + 56];\n\n // check for all-zero AC coefficients\n if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) {\n t = (dctSqrt2 * p0 + 8192) >> 14;\n // convert to 8 bit\n t = (t < -2040) ? 0 : (t >= 2024) ? 255 : (t + 2056) >> 4;\n blockData[blockBufferOffset + col] = t;\n blockData[blockBufferOffset + col + 8] = t;\n blockData[blockBufferOffset + col + 16] = t;\n blockData[blockBufferOffset + col + 24] = t;\n blockData[blockBufferOffset + col + 32] = t;\n blockData[blockBufferOffset + col + 40] = t;\n blockData[blockBufferOffset + col + 48] = t;\n blockData[blockBufferOffset + col + 56] = t;\n continue;\n }\n\n // stage 4\n v0 = (dctSqrt2 * p0 + 2048) >> 12;\n v1 = (dctSqrt2 * p4 + 2048) >> 12;\n v2 = p2;\n v3 = p6;\n v4 = (dctSqrt1d2 * (p1 - p7) + 2048) >> 12;\n v7 = (dctSqrt1d2 * (p1 + p7) + 2048) >> 12;\n v5 = p3;\n v6 = p5;\n\n // stage 3\n // Shift v0 by 128.5 << 5 here, so we don't need to shift p0...p7 when\n // converting to UInt8 range later.\n v0 = ((v0 + v1 + 1) >> 1) + 4112;\n v1 = v0 - v1;\n t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12;\n v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12;\n v3 = t;\n v4 = (v4 + v6 + 1) >> 1;\n v6 = v4 - v6;\n v7 = (v7 + v5 + 1) >> 1;\n v5 = v7 - v5;\n\n // stage 2\n v0 = (v0 + v3 + 1) >> 1;\n v3 = v0 - v3;\n v1 = (v1 + v2 + 1) >> 1;\n v2 = v1 - v2;\n t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;\n v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;\n v7 = t;\n t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;\n v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;\n v6 = t;\n\n // stage 1\n p0 = v0 + v7;\n p7 = v0 - v7;\n p1 = v1 + v6;\n p6 = v1 - v6;\n p2 = v2 + v5;\n p5 = v2 - v5;\n p3 = v3 + v4;\n p4 = v3 - v4;\n\n // convert to 8-bit integers\n p0 = (p0 < 16) ? 0 : (p0 >= 4080) ? 255 : p0 >> 4;\n p1 = (p1 < 16) ? 0 : (p1 >= 4080) ? 255 : p1 >> 4;\n p2 = (p2 < 16) ? 0 : (p2 >= 4080) ? 255 : p2 >> 4;\n p3 = (p3 < 16) ? 0 : (p3 >= 4080) ? 255 : p3 >> 4;\n p4 = (p4 < 16) ? 0 : (p4 >= 4080) ? 255 : p4 >> 4;\n p5 = (p5 < 16) ? 0 : (p5 >= 4080) ? 255 : p5 >> 4;\n p6 = (p6 < 16) ? 0 : (p6 >= 4080) ? 255 : p6 >> 4;\n p7 = (p7 < 16) ? 0 : (p7 >= 4080) ? 255 : p7 >> 4;\n\n // store block data\n blockData[blockBufferOffset + col] = p0;\n blockData[blockBufferOffset + col + 8] = p1;\n blockData[blockBufferOffset + col + 16] = p2;\n blockData[blockBufferOffset + col + 24] = p3;\n blockData[blockBufferOffset + col + 32] = p4;\n blockData[blockBufferOffset + col + 40] = p5;\n blockData[blockBufferOffset + col + 48] = p6;\n blockData[blockBufferOffset + col + 56] = p7;\n }\n }\n\n function buildComponentData(frame, component) {\n var blocksPerLine = component.blocksPerLine;\n var blocksPerColumn = component.blocksPerColumn;\n var computationBuffer = new Int16Array(64);\n\n for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) {\n for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) {\n var offset = getBlockBufferOffset(component, blockRow, blockCol);\n quantizeAndInverse(component, offset, computationBuffer);\n }\n }\n return component.blockData;\n }\n\n function findNextFileMarker(data, currentPos, startPos = currentPos) {\n function peekUint16(pos) {\n return (data[pos] << 8) | data[pos + 1];\n }\n\n const maxPos = data.length - 1;\n var newPos = startPos < currentPos ? startPos : currentPos;\n\n if (currentPos >= maxPos) {\n return null; // Don't attempt to read non-existent data and just return.\n }\n var currentMarker = peekUint16(currentPos);\n if (currentMarker >= 0xFFC0 && currentMarker <= 0xFFFE) {\n return {\n invalid: null,\n marker: currentMarker,\n offset: currentPos,\n };\n }\n var newMarker = peekUint16(newPos);\n while (!(newMarker >= 0xFFC0 && newMarker <= 0xFFFE)) {\n if (++newPos >= maxPos) {\n return null; // Don't attempt to read non-existent data and just return.\n }\n newMarker = peekUint16(newPos);\n }\n return {\n invalid: currentMarker.toString(16),\n marker: newMarker,\n offset: newPos,\n };\n }\n\n JpegImage.prototype = {\n parse(data, { dnlScanLines = null, } = {}) {\n\n function readUint16() {\n var value = (data[offset] << 8) | data[offset + 1];\n offset += 2;\n return value;\n }\n\n function readDataBlock() {\n var length = readUint16();\n var endOffset = offset + length - 2;\n\n var fileMarker = findNextFileMarker(data, endOffset, offset);\n if (fileMarker && fileMarker.invalid) {\n warn('readDataBlock - incorrect length, current marker is: ' +\n fileMarker.invalid);\n endOffset = fileMarker.offset;\n }\n\n var array = data.subarray(offset, endOffset);\n offset += array.length;\n return array;\n }\n\n function prepareComponents(frame) {\n var mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH);\n var mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV);\n for (var i = 0; i < frame.components.length; i++) {\n component = frame.components[i];\n var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) *\n component.h / frame.maxH);\n var blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) *\n component.v / frame.maxV);\n var blocksPerLineForMcu = mcusPerLine * component.h;\n var blocksPerColumnForMcu = mcusPerColumn * component.v;\n\n var blocksBufferSize = 64 * blocksPerColumnForMcu *\n (blocksPerLineForMcu + 1);\n component.blockData = new Int16Array(blocksBufferSize);\n component.blocksPerLine = blocksPerLine;\n component.blocksPerColumn = blocksPerColumn;\n }\n frame.mcusPerLine = mcusPerLine;\n frame.mcusPerColumn = mcusPerColumn;\n }\n\n var offset = 0;\n var jfif = null;\n var adobe = null;\n var frame, resetInterval;\n let numSOSMarkers = 0;\n var quantizationTables = [];\n var huffmanTablesAC = [], huffmanTablesDC = [];\n var fileMarker = readUint16();\n if (fileMarker !== 0xFFD8) { // SOI (Start of Image)\n throw new JpegError('SOI not found');\n }\n\n fileMarker = readUint16();\n markerLoop: while (fileMarker !== 0xFFD9) { // EOI (End of image)\n var i, j, l;\n switch (fileMarker) {\n case 0xFFE0: // APP0 (Application Specific)\n case 0xFFE1: // APP1\n case 0xFFE2: // APP2\n case 0xFFE3: // APP3\n case 0xFFE4: // APP4\n case 0xFFE5: // APP5\n case 0xFFE6: // APP6\n case 0xFFE7: // APP7\n case 0xFFE8: // APP8\n case 0xFFE9: // APP9\n case 0xFFEA: // APP10\n case 0xFFEB: // APP11\n case 0xFFEC: // APP12\n case 0xFFED: // APP13\n case 0xFFEE: // APP14\n case 0xFFEF: // APP15\n case 0xFFFE: // COM (Comment)\n var appData = readDataBlock();\n\n if (fileMarker === 0xFFE0) {\n if (appData[0] === 0x4A && appData[1] === 0x46 &&\n appData[2] === 0x49 && appData[3] === 0x46 &&\n appData[4] === 0) { // 'JFIF\\x00'\n jfif = {\n version: { major: appData[5], minor: appData[6], },\n densityUnits: appData[7],\n xDensity: (appData[8] << 8) | appData[9],\n yDensity: (appData[10] << 8) | appData[11],\n thumbWidth: appData[12],\n thumbHeight: appData[13],\n thumbData: appData.subarray(14, 14 +\n 3 * appData[12] * appData[13]),\n };\n }\n }\n // TODO APP1 - Exif\n if (fileMarker === 0xFFEE) {\n if (appData[0] === 0x41 && appData[1] === 0x64 &&\n appData[2] === 0x6F && appData[3] === 0x62 &&\n appData[4] === 0x65) { // 'Adobe'\n adobe = {\n version: (appData[5] << 8) | appData[6],\n flags0: (appData[7] << 8) | appData[8],\n flags1: (appData[9] << 8) | appData[10],\n transformCode: appData[11],\n };\n }\n }\n break;\n\n case 0xFFDB: // DQT (Define Quantization Tables)\n var quantizationTablesLength = readUint16();\n var quantizationTablesEnd = quantizationTablesLength + offset - 2;\n var z;\n while (offset < quantizationTablesEnd) {\n var quantizationTableSpec = data[offset++];\n var tableData = new Uint16Array(64);\n if ((quantizationTableSpec >> 4) === 0) { // 8 bit values\n for (j = 0; j < 64; j++) {\n z = dctZigZag[j];\n tableData[z] = data[offset++];\n }\n } else if ((quantizationTableSpec >> 4) === 1) { // 16 bit values\n for (j = 0; j < 64; j++) {\n z = dctZigZag[j];\n tableData[z] = readUint16();\n }\n } else {\n throw new JpegError('DQT - invalid table spec');\n }\n quantizationTables[quantizationTableSpec & 15] = tableData;\n }\n break;\n\n case 0xFFC0: // SOF0 (Start of Frame, Baseline DCT)\n case 0xFFC1: // SOF1 (Start of Frame, Extended DCT)\n case 0xFFC2: // SOF2 (Start of Frame, Progressive DCT)\n if (frame) {\n throw new JpegError('Only single frame JPEGs supported');\n }\n readUint16(); // skip data length\n frame = {};\n frame.extended = (fileMarker === 0xFFC1);\n frame.progressive = (fileMarker === 0xFFC2);\n frame.precision = data[offset++];\n const sofScanLines = readUint16();\n frame.scanLines = dnlScanLines || sofScanLines;\n frame.samplesPerLine = readUint16();\n frame.components = [];\n frame.componentIds = {};\n var componentsCount = data[offset++], componentId;\n var maxH = 0, maxV = 0;\n for (i = 0; i < componentsCount; i++) {\n componentId = data[offset];\n var h = data[offset + 1] >> 4;\n var v = data[offset + 1] & 15;\n if (maxH < h) {\n maxH = h;\n }\n if (maxV < v) {\n maxV = v;\n }\n var qId = data[offset + 2];\n l = frame.components.push({\n h,\n v,\n quantizationId: qId,\n quantizationTable: null, // See comment below.\n });\n frame.componentIds[componentId] = l - 1;\n offset += 3;\n }\n frame.maxH = maxH;\n frame.maxV = maxV;\n prepareComponents(frame);\n break;\n\n case 0xFFC4: // DHT (Define Huffman Tables)\n var huffmanLength = readUint16();\n for (i = 2; i < huffmanLength;) {\n var huffmanTableSpec = data[offset++];\n var codeLengths = new Uint8Array(16);\n var codeLengthSum = 0;\n for (j = 0; j < 16; j++, offset++) {\n codeLengthSum += (codeLengths[j] = data[offset]);\n }\n var huffmanValues = new Uint8Array(codeLengthSum);\n for (j = 0; j < codeLengthSum; j++, offset++) {\n huffmanValues[j] = data[offset];\n }\n i += 17 + codeLengthSum;\n\n ((huffmanTableSpec >> 4) === 0 ?\n huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] =\n buildHuffmanTable(codeLengths, huffmanValues);\n }\n break;\n\n case 0xFFDD: // DRI (Define Restart Interval)\n readUint16(); // skip data length\n resetInterval = readUint16();\n break;\n\n case 0xFFDA: // SOS (Start of Scan)\n // A DNL marker (0xFFDC), if it exists, is only allowed at the end\n // of the first scan segment and may only occur once in an image.\n // Furthermore, to prevent an infinite loop, do *not* attempt to\n // parse DNL markers during re-parsing of the JPEG scan data.\n const parseDNLMarker = (++numSOSMarkers) === 1 && !dnlScanLines;\n\n readUint16(); // scanLength\n var selectorsCount = data[offset++];\n var components = [], component;\n for (i = 0; i < selectorsCount; i++) {\n var componentIndex = frame.componentIds[data[offset++]];\n component = frame.components[componentIndex];\n var tableSpec = data[offset++];\n component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4];\n component.huffmanTableAC = huffmanTablesAC[tableSpec & 15];\n components.push(component);\n }\n var spectralStart = data[offset++];\n var spectralEnd = data[offset++];\n var successiveApproximation = data[offset++];\n try {\n var processed = decodeScan(data, offset,\n frame, components, resetInterval,\n spectralStart, spectralEnd,\n successiveApproximation >> 4, successiveApproximation & 15,\n parseDNLMarker);\n offset += processed;\n } catch (ex) {\n if (ex instanceof DNLMarkerError) {\n warn(`${ex.message} -- attempting to re-parse the JPEG image.`);\n return this.parse(data, { dnlScanLines: ex.scanLines, });\n } else if (ex instanceof EOIMarkerError) {\n warn(`${ex.message} -- ignoring the rest of the image data.`);\n break markerLoop;\n }\n throw ex;\n }\n break;\n\n case 0xFFDC: // DNL (Define Number of Lines)\n // Ignore the marker, since it's being handled in `decodeScan`.\n offset += 4;\n break;\n\n case 0xFFFF: // Fill bytes\n if (data[offset] !== 0xFF) { // Avoid skipping a valid marker.\n offset--;\n }\n break;\n\n default:\n if (data[offset - 3] === 0xFF &&\n data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) {\n // could be incorrect encoding -- last 0xFF byte of the previous\n // block was eaten by the encoder\n offset -= 3;\n break;\n }\n let nextFileMarker = findNextFileMarker(data, offset - 2);\n if (nextFileMarker && nextFileMarker.invalid) {\n warn('JpegImage.parse - unexpected data, current marker is: ' +\n nextFileMarker.invalid);\n offset = nextFileMarker.offset;\n break;\n }\n throw new JpegError('unknown marker ' + fileMarker.toString(16));\n }\n fileMarker = readUint16();\n }\n\n this.width = frame.samplesPerLine;\n this.height = frame.scanLines;\n this.jfif = jfif;\n this.adobe = adobe;\n this.components = [];\n for (i = 0; i < frame.components.length; i++) {\n component = frame.components[i];\n\n // Prevent errors when DQT markers are placed after SOF{n} markers,\n // by assigning the `quantizationTable` entry after the entire image\n // has been parsed (fixes issue7406.pdf).\n var quantizationTable = quantizationTables[component.quantizationId];\n if (quantizationTable) {\n component.quantizationTable = quantizationTable;\n }\n\n this.components.push({\n output: buildComponentData(frame, component),\n scaleX: component.h / frame.maxH,\n scaleY: component.v / frame.maxV,\n blocksPerLine: component.blocksPerLine,\n blocksPerColumn: component.blocksPerColumn,\n });\n }\n this.numComponents = this.components.length;\n return undefined;\n },\n\n _getLinearizedBlockData(width, height, isSourcePDF = false) {\n var scaleX = this.width / width, scaleY = this.height / height;\n\n var component, componentScaleX, componentScaleY, blocksPerScanline;\n var x, y, i, j, k;\n var index;\n var offset = 0;\n var output;\n var numComponents = this.components.length;\n var dataLength = width * height * numComponents;\n var data = new Uint8ClampedArray(dataLength);\n var xScaleBlockOffset = new Uint32Array(width);\n var mask3LSB = 0xfffffff8; // used to clear the 3 LSBs\n\n for (i = 0; i < numComponents; i++) {\n component = this.components[i];\n componentScaleX = component.scaleX * scaleX;\n componentScaleY = component.scaleY * scaleY;\n offset = i;\n output = component.output;\n blocksPerScanline = (component.blocksPerLine + 1) << 3;\n // precalculate the xScaleBlockOffset\n for (x = 0; x < width; x++) {\n j = 0 | (x * componentScaleX);\n xScaleBlockOffset[x] = ((j & mask3LSB) << 3) | (j & 7);\n }\n // linearize the blocks of the component\n for (y = 0; y < height; y++) {\n j = 0 | (y * componentScaleY);\n index = blocksPerScanline * (j & mask3LSB) | ((j & 7) << 3);\n for (x = 0; x < width; x++) {\n data[offset] = output[index + xScaleBlockOffset[x]];\n offset += numComponents;\n }\n }\n }\n\n // decodeTransform contains pairs of multiplier (-256..256) and additive\n let transform = this._decodeTransform;\n\n // In PDF files, JPEG images with CMYK colour spaces are usually inverted\n // (this can be observed by extracting the raw image data).\n // Since the conversion algorithms (see below) were written primarily for\n // the PDF use-cases, attempting to use `JpegImage` to parse standalone\n // JPEG (CMYK) images may thus result in inverted images (see issue 9513).\n //\n // Unfortunately it's not (always) possible to tell, from the image data\n // alone, if it needs to be inverted. Thus in an attempt to provide better\n // out-of-box behaviour when `JpegImage` is used standalone, default to\n // inverting JPEG (CMYK) images if and only if the image data does *not*\n // come from a PDF file and no `decodeTransform` was passed by the user.\n if (!isSourcePDF && numComponents === 4 && !transform) {\n transform = new Int32Array([\n -256, 255, -256, 255, -256, 255, -256, 255]);\n }\n\n if (transform) {\n for (i = 0; i < dataLength;) {\n for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) {\n data[i] = ((data[i] * transform[k]) >> 8) + transform[k + 1];\n }\n }\n }\n return data;\n },\n\n get _isColorConversionNeeded() {\n if (this.adobe) {\n // The adobe transform marker overrides any previous setting.\n return !!this.adobe.transformCode;\n }\n if (this.numComponents === 3) {\n if (this._colorTransform === 0) {\n // If the Adobe transform marker is not present and the image\n // dictionary has a 'ColorTransform' entry, explicitly set to `0`,\n // then the colours should *not* be transformed.\n return false;\n }\n return true;\n }\n // `this.numComponents !== 3`\n if (this._colorTransform === 1) {\n // If the Adobe transform marker is not present and the image\n // dictionary has a 'ColorTransform' entry, explicitly set to `1`,\n // then the colours should be transformed.\n return true;\n }\n return false;\n },\n\n _convertYccToRgb: function convertYccToRgb(data) {\n var Y, Cb, Cr;\n for (var i = 0, length = data.length; i < length; i += 3) {\n Y = data[i];\n Cb = data[i + 1];\n Cr = data[i + 2];\n data[i] = Y - 179.456 + 1.402 * Cr;\n data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr;\n data[i + 2] = Y - 226.816 + 1.772 * Cb;\n }\n return data;\n },\n\n _convertYcckToRgb: function convertYcckToRgb(data) {\n var Y, Cb, Cr, k;\n var offset = 0;\n for (var i = 0, length = data.length; i < length; i += 4) {\n Y = data[i];\n Cb = data[i + 1];\n Cr = data[i + 2];\n k = data[i + 3];\n\n data[offset++] = -122.67195406894 +\n Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr -\n 5.4080610064599e-5 * Y + 0.00048449797120281 * k -\n 0.154362151871126) +\n Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y -\n 0.00477271405408747 * k + 1.53380253221734) +\n Y * (0.000961250184130688 * Y - 0.00266257332283933 * k +\n 0.48357088451265) +\n k * (-0.000336197177618394 * k + 0.484791561490776);\n\n data[offset++] = 107.268039397724 +\n Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr +\n 0.000659397001245577 * Y + 0.000426105652938837 * k -\n 0.176491792462875) +\n Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y +\n 0.000770482631801132 * k - 0.151051492775562) +\n Y * (0.00126935368114843 * Y - 0.00265090189010898 * k +\n 0.25802910206845) +\n k * (-0.000318913117588328 * k - 0.213742400323665);\n\n data[offset++] = -20.810012546947 +\n Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr +\n 0.0020741088115012 * Y - 0.00288260236853442 * k +\n 0.814272968359295) +\n Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y +\n 0.000560833691242812 * k - 0.195152027534049) +\n Y * (0.00174418132927582 * Y - 0.00255243321439347 * k +\n 0.116935020465145) +\n k * (-0.000343531996510555 * k + 0.24165260232407);\n }\n // Ensure that only the converted RGB data is returned.\n return data.subarray(0, offset);\n },\n\n _convertYcckToCmyk: function convertYcckToCmyk(data) {\n var Y, Cb, Cr;\n for (var i = 0, length = data.length; i < length; i += 4) {\n Y = data[i];\n Cb = data[i + 1];\n Cr = data[i + 2];\n data[i] = 434.456 - Y - 1.402 * Cr;\n data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr;\n data[i + 2] = 481.816 - Y - 1.772 * Cb;\n // K in data[i + 3] is unchanged\n }\n return data;\n },\n\n _convertCmykToRgb: function convertCmykToRgb(data) {\n var c, m, y, k;\n var offset = 0;\n var scale = 1 / 255;\n for (var i = 0, length = data.length; i < length; i += 4) {\n c = data[i] * scale;\n m = data[i + 1] * scale;\n y = data[i + 2] * scale;\n k = data[i + 3] * scale;\n\n data[offset++] = 255 +\n c * (-4.387332384609988 * c + 54.48615194189176 * m +\n 18.82290502165302 * y + 212.25662451639585 * k -\n 285.2331026137004) +\n m * (1.7149763477362134 * m - 5.6096736904047315 * y -\n 17.873870861415444 * k - 5.497006427196366) +\n y * (-2.5217340131683033 * y - 21.248923337353073 * k +\n 17.5119270841813) -\n k * (21.86122147463605 * k + 189.48180835922747);\n\n data[offset++] = 255 +\n c * (8.841041422036149 * c + 60.118027045597366 * m +\n 6.871425592049007 * y + 31.159100130055922 * k -\n 79.2970844816548) +\n m * (-15.310361306967817 * m + 17.575251261109482 * y +\n 131.35250912493976 * k - 190.9453302588951) +\n y * (4.444339102852739 * y + 9.8632861493405 * k -\n 24.86741582555878) -\n k * (20.737325471181034 * k + 187.80453709719578);\n\n data[offset++] = 255 +\n c * (0.8842522430003296 * c + 8.078677503112928 * m +\n 30.89978309703729 * y - 0.23883238689178934 * k -\n 14.183576799673286) +\n m * (10.49593273432072 * m + 63.02378494754052 * y +\n 50.606957656360734 * k - 112.23884253719248) +\n y * (0.03296041114873217 * y + 115.60384449646641 * k -\n 193.58209356861505) -\n k * (22.33816807309886 * k + 180.12613974708367);\n }\n // Ensure that only the converted RGB data is returned.\n return data.subarray(0, offset);\n },\n\n getData({ width, height, forceRGB = false, isSourcePDF = false, }) {\n if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('TESTING && !LIB')) {\n assert(isSourcePDF === true,\n 'JpegImage.getData: Unexpected \"isSourcePDF\" value for PDF files.');\n }\n if (this.numComponents > 4) {\n throw new JpegError('Unsupported color mode');\n }\n // Type of data: Uint8ClampedArray(width * height * numComponents)\n var data = this._getLinearizedBlockData(width, height, isSourcePDF);\n\n if (this.numComponents === 1 && forceRGB) {\n var dataLength = data.length;\n var rgbData = new Uint8ClampedArray(dataLength * 3);\n var offset = 0;\n for (var i = 0; i < dataLength; i++) {\n var grayColor = data[i];\n rgbData[offset++] = grayColor;\n rgbData[offset++] = grayColor;\n rgbData[offset++] = grayColor;\n }\n return rgbData;\n } else if (this.numComponents === 3 && this._isColorConversionNeeded) {\n return this._convertYccToRgb(data);\n } else if (this.numComponents === 4) {\n if (this._isColorConversionNeeded) {\n if (forceRGB) {\n return this._convertYcckToRgb(data);\n }\n return this._convertYcckToCmyk(data);\n } else if (forceRGB) {\n return this._convertCmykToRgb(data);\n }\n }\n return data;\n },\n };\n\n return JpegImage;\n})();\n\nexport {\n JpegImage,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n info, log2, readUint16, readUint32, warn\n} from '../shared/util';\nimport { ArithmeticDecoder } from './arithmetic_decoder';\n\nlet JpxError = (function JpxErrorClosure() {\n function JpxError(msg) {\n this.message = 'JPX error: ' + msg;\n }\n\n JpxError.prototype = new Error();\n JpxError.prototype.name = 'JpxError';\n JpxError.constructor = JpxError;\n\n return JpxError;\n})();\n\nvar JpxImage = (function JpxImageClosure() {\n // Table E.1\n var SubbandsGainLog2 = {\n 'LL': 0,\n 'LH': 1,\n 'HL': 1,\n 'HH': 2,\n };\n function JpxImage() {\n this.failOnCorruptedImage = false;\n }\n JpxImage.prototype = {\n parse: function JpxImage_parse(data) {\n\n var head = readUint16(data, 0);\n // No box header, immediate start of codestream (SOC)\n if (head === 0xFF4F) {\n this.parseCodestream(data, 0, data.length);\n return;\n }\n\n var position = 0, length = data.length;\n while (position < length) {\n var headerSize = 8;\n var lbox = readUint32(data, position);\n var tbox = readUint32(data, position + 4);\n position += headerSize;\n if (lbox === 1) {\n // XLBox: read UInt64 according to spec.\n // JavaScript's int precision of 53 bit should be sufficient here.\n lbox = readUint32(data, position) * 4294967296 +\n readUint32(data, position + 4);\n position += 8;\n headerSize += 8;\n }\n if (lbox === 0) {\n lbox = length - position + headerSize;\n }\n if (lbox < headerSize) {\n throw new JpxError('Invalid box field size');\n }\n var dataLength = lbox - headerSize;\n var jumpDataLength = true;\n switch (tbox) {\n case 0x6A703268: // 'jp2h'\n jumpDataLength = false; // parsing child boxes\n break;\n case 0x636F6C72: // 'colr'\n // Colorspaces are not used, the CS from the PDF is used.\n var method = data[position];\n if (method === 1) {\n // enumerated colorspace\n var colorspace = readUint32(data, position + 3);\n switch (colorspace) {\n case 16: // this indicates a sRGB colorspace\n case 17: // this indicates a grayscale colorspace\n case 18: // this indicates a YUV colorspace\n break;\n default:\n warn('Unknown colorspace ' + colorspace);\n break;\n }\n } else if (method === 2) {\n info('ICC profile not supported');\n }\n break;\n case 0x6A703263: // 'jp2c'\n this.parseCodestream(data, position, position + dataLength);\n break;\n case 0x6A502020: // 'jP\\024\\024'\n if (readUint32(data, position) !== 0x0d0a870a) {\n warn('Invalid JP2 signature');\n }\n break;\n // The following header types are valid but currently not used:\n case 0x6A501A1A: // 'jP\\032\\032'\n case 0x66747970: // 'ftyp'\n case 0x72726571: // 'rreq'\n case 0x72657320: // 'res '\n case 0x69686472: // 'ihdr'\n break;\n default:\n var headerType = String.fromCharCode((tbox >> 24) & 0xFF,\n (tbox >> 16) & 0xFF,\n (tbox >> 8) & 0xFF,\n tbox & 0xFF);\n warn('Unsupported header type ' + tbox + ' (' + headerType + ')');\n break;\n }\n if (jumpDataLength) {\n position += dataLength;\n }\n }\n },\n parseImageProperties: function JpxImage_parseImageProperties(stream) {\n var newByte = stream.getByte();\n while (newByte >= 0) {\n var oldByte = newByte;\n newByte = stream.getByte();\n var code = (oldByte << 8) | newByte;\n // Image and tile size (SIZ)\n if (code === 0xFF51) {\n stream.skip(4);\n var Xsiz = stream.getInt32() >>> 0; // Byte 4\n var Ysiz = stream.getInt32() >>> 0; // Byte 8\n var XOsiz = stream.getInt32() >>> 0; // Byte 12\n var YOsiz = stream.getInt32() >>> 0; // Byte 16\n stream.skip(16);\n var Csiz = stream.getUint16(); // Byte 36\n this.width = Xsiz - XOsiz;\n this.height = Ysiz - YOsiz;\n this.componentsCount = Csiz;\n // Results are always returned as `Uint8ClampedArray`s.\n this.bitsPerComponent = 8;\n return;\n }\n }\n throw new JpxError('No size marker found in JPX stream');\n },\n parseCodestream: function JpxImage_parseCodestream(data, start, end) {\n var context = {};\n var doNotRecover = false;\n try {\n var position = start;\n while (position + 1 < end) {\n var code = readUint16(data, position);\n position += 2;\n\n var length = 0, j, sqcd, spqcds, spqcdSize, scalarExpounded, tile;\n switch (code) {\n case 0xFF4F: // Start of codestream (SOC)\n context.mainHeader = true;\n break;\n case 0xFFD9: // End of codestream (EOC)\n break;\n case 0xFF51: // Image and tile size (SIZ)\n length = readUint16(data, position);\n var siz = {};\n siz.Xsiz = readUint32(data, position + 4);\n siz.Ysiz = readUint32(data, position + 8);\n siz.XOsiz = readUint32(data, position + 12);\n siz.YOsiz = readUint32(data, position + 16);\n siz.XTsiz = readUint32(data, position + 20);\n siz.YTsiz = readUint32(data, position + 24);\n siz.XTOsiz = readUint32(data, position + 28);\n siz.YTOsiz = readUint32(data, position + 32);\n var componentsCount = readUint16(data, position + 36);\n siz.Csiz = componentsCount;\n var components = [];\n j = position + 38;\n for (var i = 0; i < componentsCount; i++) {\n var component = {\n precision: (data[j] & 0x7F) + 1,\n isSigned: !!(data[j] & 0x80),\n XRsiz: data[j + 1],\n YRsiz: data[j + 2],\n };\n j += 3;\n calculateComponentDimensions(component, siz);\n components.push(component);\n }\n context.SIZ = siz;\n context.components = components;\n calculateTileGrids(context, components);\n context.QCC = [];\n context.COC = [];\n break;\n case 0xFF5C: // Quantization default (QCD)\n length = readUint16(data, position);\n var qcd = {};\n j = position + 2;\n sqcd = data[j++];\n switch (sqcd & 0x1F) {\n case 0:\n spqcdSize = 8;\n scalarExpounded = true;\n break;\n case 1:\n spqcdSize = 16;\n scalarExpounded = false;\n break;\n case 2:\n spqcdSize = 16;\n scalarExpounded = true;\n break;\n default:\n throw new Error('Invalid SQcd value ' + sqcd);\n }\n qcd.noQuantization = (spqcdSize === 8);\n qcd.scalarExpounded = scalarExpounded;\n qcd.guardBits = sqcd >> 5;\n spqcds = [];\n while (j < length + position) {\n var spqcd = {};\n if (spqcdSize === 8) {\n spqcd.epsilon = data[j++] >> 3;\n spqcd.mu = 0;\n } else {\n spqcd.epsilon = data[j] >> 3;\n spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1];\n j += 2;\n }\n spqcds.push(spqcd);\n }\n qcd.SPqcds = spqcds;\n if (context.mainHeader) {\n context.QCD = qcd;\n } else {\n context.currentTile.QCD = qcd;\n context.currentTile.QCC = [];\n }\n break;\n case 0xFF5D: // Quantization component (QCC)\n length = readUint16(data, position);\n var qcc = {};\n j = position + 2;\n var cqcc;\n if (context.SIZ.Csiz < 257) {\n cqcc = data[j++];\n } else {\n cqcc = readUint16(data, j);\n j += 2;\n }\n sqcd = data[j++];\n switch (sqcd & 0x1F) {\n case 0:\n spqcdSize = 8;\n scalarExpounded = true;\n break;\n case 1:\n spqcdSize = 16;\n scalarExpounded = false;\n break;\n case 2:\n spqcdSize = 16;\n scalarExpounded = true;\n break;\n default:\n throw new Error('Invalid SQcd value ' + sqcd);\n }\n qcc.noQuantization = (spqcdSize === 8);\n qcc.scalarExpounded = scalarExpounded;\n qcc.guardBits = sqcd >> 5;\n spqcds = [];\n while (j < (length + position)) {\n spqcd = {};\n if (spqcdSize === 8) {\n spqcd.epsilon = data[j++] >> 3;\n spqcd.mu = 0;\n } else {\n spqcd.epsilon = data[j] >> 3;\n spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1];\n j += 2;\n }\n spqcds.push(spqcd);\n }\n qcc.SPqcds = spqcds;\n if (context.mainHeader) {\n context.QCC[cqcc] = qcc;\n } else {\n context.currentTile.QCC[cqcc] = qcc;\n }\n break;\n case 0xFF52: // Coding style default (COD)\n length = readUint16(data, position);\n var cod = {};\n j = position + 2;\n var scod = data[j++];\n cod.entropyCoderWithCustomPrecincts = !!(scod & 1);\n cod.sopMarkerUsed = !!(scod & 2);\n cod.ephMarkerUsed = !!(scod & 4);\n cod.progressionOrder = data[j++];\n cod.layersCount = readUint16(data, j);\n j += 2;\n cod.multipleComponentTransform = data[j++];\n\n cod.decompositionLevelsCount = data[j++];\n cod.xcb = (data[j++] & 0xF) + 2;\n cod.ycb = (data[j++] & 0xF) + 2;\n var blockStyle = data[j++];\n cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1);\n cod.resetContextProbabilities = !!(blockStyle & 2);\n cod.terminationOnEachCodingPass = !!(blockStyle & 4);\n cod.verticallyStripe = !!(blockStyle & 8);\n cod.predictableTermination = !!(blockStyle & 16);\n cod.segmentationSymbolUsed = !!(blockStyle & 32);\n cod.reversibleTransformation = data[j++];\n if (cod.entropyCoderWithCustomPrecincts) {\n var precinctsSizes = [];\n while (j < length + position) {\n var precinctsSize = data[j++];\n precinctsSizes.push({\n PPx: precinctsSize & 0xF,\n PPy: precinctsSize >> 4,\n });\n }\n cod.precinctsSizes = precinctsSizes;\n }\n var unsupported = [];\n if (cod.selectiveArithmeticCodingBypass) {\n unsupported.push('selectiveArithmeticCodingBypass');\n }\n if (cod.resetContextProbabilities) {\n unsupported.push('resetContextProbabilities');\n }\n if (cod.terminationOnEachCodingPass) {\n unsupported.push('terminationOnEachCodingPass');\n }\n if (cod.verticallyStripe) {\n unsupported.push('verticallyStripe');\n }\n if (cod.predictableTermination) {\n unsupported.push('predictableTermination');\n }\n if (unsupported.length > 0) {\n doNotRecover = true;\n throw new Error('Unsupported COD options (' +\n unsupported.join(', ') + ')');\n }\n if (context.mainHeader) {\n context.COD = cod;\n } else {\n context.currentTile.COD = cod;\n context.currentTile.COC = [];\n }\n break;\n case 0xFF90: // Start of tile-part (SOT)\n length = readUint16(data, position);\n tile = {};\n tile.index = readUint16(data, position + 2);\n tile.length = readUint32(data, position + 4);\n tile.dataEnd = tile.length + position - 2;\n tile.partIndex = data[position + 8];\n tile.partsCount = data[position + 9];\n\n context.mainHeader = false;\n if (tile.partIndex === 0) {\n // reset component specific settings\n tile.COD = context.COD;\n tile.COC = context.COC.slice(0); // clone of the global COC\n tile.QCD = context.QCD;\n tile.QCC = context.QCC.slice(0); // clone of the global COC\n }\n context.currentTile = tile;\n break;\n case 0xFF93: // Start of data (SOD)\n tile = context.currentTile;\n if (tile.partIndex === 0) {\n initializeTile(context, tile.index);\n buildPackets(context);\n }\n\n // moving to the end of the data\n length = tile.dataEnd - position;\n parseTilePackets(context, data, position, length);\n break;\n case 0xFF55: // Tile-part lengths, main header (TLM)\n case 0xFF57: // Packet length, main header (PLM)\n case 0xFF58: // Packet length, tile-part header (PLT)\n case 0xFF64: // Comment (COM)\n length = readUint16(data, position);\n // skipping content\n break;\n case 0xFF53: // Coding style component (COC)\n throw new Error('Codestream code 0xFF53 (COC) is ' +\n 'not implemented');\n default:\n throw new Error('Unknown codestream code: ' + code.toString(16));\n }\n position += length;\n }\n } catch (e) {\n if (doNotRecover || this.failOnCorruptedImage) {\n throw new JpxError(e.message);\n } else {\n warn('JPX: Trying to recover from: ' + e.message);\n }\n }\n this.tiles = transformComponents(context);\n this.width = context.SIZ.Xsiz - context.SIZ.XOsiz;\n this.height = context.SIZ.Ysiz - context.SIZ.YOsiz;\n this.componentsCount = context.SIZ.Csiz;\n },\n };\n function calculateComponentDimensions(component, siz) {\n // Section B.2 Component mapping\n component.x0 = Math.ceil(siz.XOsiz / component.XRsiz);\n component.x1 = Math.ceil(siz.Xsiz / component.XRsiz);\n component.y0 = Math.ceil(siz.YOsiz / component.YRsiz);\n component.y1 = Math.ceil(siz.Ysiz / component.YRsiz);\n component.width = component.x1 - component.x0;\n component.height = component.y1 - component.y0;\n }\n function calculateTileGrids(context, components) {\n var siz = context.SIZ;\n // Section B.3 Division into tile and tile-components\n var tile, tiles = [];\n var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz);\n var numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz);\n for (var q = 0; q < numYtiles; q++) {\n for (var p = 0; p < numXtiles; p++) {\n tile = {};\n tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz);\n tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz);\n tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz);\n tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz);\n tile.width = tile.tx1 - tile.tx0;\n tile.height = tile.ty1 - tile.ty0;\n tile.components = [];\n tiles.push(tile);\n }\n }\n context.tiles = tiles;\n\n var componentsCount = siz.Csiz;\n for (var i = 0, ii = componentsCount; i < ii; i++) {\n var component = components[i];\n for (var j = 0, jj = tiles.length; j < jj; j++) {\n var tileComponent = {};\n tile = tiles[j];\n tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz);\n tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz);\n tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz);\n tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz);\n tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0;\n tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0;\n tile.components[i] = tileComponent;\n }\n }\n }\n function getBlocksDimensions(context, component, r) {\n var codOrCoc = component.codingStyleParameters;\n var result = {};\n if (!codOrCoc.entropyCoderWithCustomPrecincts) {\n result.PPx = 15;\n result.PPy = 15;\n } else {\n result.PPx = codOrCoc.precinctsSizes[r].PPx;\n result.PPy = codOrCoc.precinctsSizes[r].PPy;\n }\n // calculate codeblock size as described in section B.7\n result.xcb_ = (r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) :\n Math.min(codOrCoc.xcb, result.PPx));\n result.ycb_ = (r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) :\n Math.min(codOrCoc.ycb, result.PPy));\n return result;\n }\n function buildPrecincts(context, resolution, dimensions) {\n // Section B.6 Division resolution to precincts\n var precinctWidth = 1 << dimensions.PPx;\n var precinctHeight = 1 << dimensions.PPy;\n // Jasper introduces codeblock groups for mapping each subband codeblocks\n // to precincts. Precinct partition divides a resolution according to width\n // and height parameters. The subband that belongs to the resolution level\n // has a different size than the level, unless it is the zero resolution.\n\n // From Jasper documentation: jpeg2000.pdf, section K: Tier-2 coding:\n // The precinct partitioning for a particular subband is derived from a\n // partitioning of its parent LL band (i.e., the LL band at the next higher\n // resolution level)... The LL band associated with each resolution level is\n // divided into precincts... Each of the resulting precinct regions is then\n // mapped into its child subbands (if any) at the next lower resolution\n // level. This is accomplished by using the coordinate transformation\n // (u, v) = (ceil(x/2), ceil(y/2)) where (x, y) and (u, v) are the\n // coordinates of a point in the LL band and child subband, respectively.\n var isZeroRes = resolution.resLevel === 0;\n var precinctWidthInSubband = 1 << (dimensions.PPx + (isZeroRes ? 0 : -1));\n var precinctHeightInSubband = 1 << (dimensions.PPy + (isZeroRes ? 0 : -1));\n var numprecinctswide = (resolution.trx1 > resolution.trx0 ?\n Math.ceil(resolution.trx1 / precinctWidth) -\n Math.floor(resolution.trx0 / precinctWidth) : 0);\n var numprecinctshigh = (resolution.try1 > resolution.try0 ?\n Math.ceil(resolution.try1 / precinctHeight) -\n Math.floor(resolution.try0 / precinctHeight) : 0);\n var numprecincts = numprecinctswide * numprecinctshigh;\n\n resolution.precinctParameters = {\n precinctWidth,\n precinctHeight,\n numprecinctswide,\n numprecinctshigh,\n numprecincts,\n precinctWidthInSubband,\n precinctHeightInSubband,\n };\n }\n function buildCodeblocks(context, subband, dimensions) {\n // Section B.7 Division sub-band into code-blocks\n var xcb_ = dimensions.xcb_;\n var ycb_ = dimensions.ycb_;\n var codeblockWidth = 1 << xcb_;\n var codeblockHeight = 1 << ycb_;\n var cbx0 = subband.tbx0 >> xcb_;\n var cby0 = subband.tby0 >> ycb_;\n var cbx1 = (subband.tbx1 + codeblockWidth - 1) >> xcb_;\n var cby1 = (subband.tby1 + codeblockHeight - 1) >> ycb_;\n var precinctParameters = subband.resolution.precinctParameters;\n var codeblocks = [];\n var precincts = [];\n var i, j, codeblock, precinctNumber;\n for (j = cby0; j < cby1; j++) {\n for (i = cbx0; i < cbx1; i++) {\n codeblock = {\n cbx: i,\n cby: j,\n tbx0: codeblockWidth * i,\n tby0: codeblockHeight * j,\n tbx1: codeblockWidth * (i + 1),\n tby1: codeblockHeight * (j + 1),\n };\n\n codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0);\n codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0);\n codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1);\n codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1);\n\n // Calculate precinct number for this codeblock, codeblock position\n // should be relative to its subband, use actual dimension and position\n // See comment about codeblock group width and height\n var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) /\n precinctParameters.precinctWidthInSubband);\n var pj = Math.floor((codeblock.tby0_ - subband.tby0) /\n precinctParameters.precinctHeightInSubband);\n precinctNumber = pi + (pj * precinctParameters.numprecinctswide);\n\n codeblock.precinctNumber = precinctNumber;\n codeblock.subbandType = subband.type;\n codeblock.Lblock = 3;\n\n if (codeblock.tbx1_ <= codeblock.tbx0_ ||\n codeblock.tby1_ <= codeblock.tby0_) {\n continue;\n }\n codeblocks.push(codeblock);\n // building precinct for the sub-band\n var precinct = precincts[precinctNumber];\n if (precinct !== undefined) {\n if (i < precinct.cbxMin) {\n precinct.cbxMin = i;\n } else if (i > precinct.cbxMax) {\n precinct.cbxMax = i;\n }\n if (j < precinct.cbyMin) {\n precinct.cbxMin = j;\n } else if (j > precinct.cbyMax) {\n precinct.cbyMax = j;\n }\n } else {\n precincts[precinctNumber] = precinct = {\n cbxMin: i,\n cbyMin: j,\n cbxMax: i,\n cbyMax: j,\n };\n }\n codeblock.precinct = precinct;\n }\n }\n subband.codeblockParameters = {\n codeblockWidth: xcb_,\n codeblockHeight: ycb_,\n numcodeblockwide: cbx1 - cbx0 + 1,\n numcodeblockhigh: cby1 - cby0 + 1,\n };\n subband.codeblocks = codeblocks;\n subband.precincts = precincts;\n }\n function createPacket(resolution, precinctNumber, layerNumber) {\n var precinctCodeblocks = [];\n // Section B.10.8 Order of info in packet\n var subbands = resolution.subbands;\n // sub-bands already ordered in 'LL', 'HL', 'LH', and 'HH' sequence\n for (var i = 0, ii = subbands.length; i < ii; i++) {\n var subband = subbands[i];\n var codeblocks = subband.codeblocks;\n for (var j = 0, jj = codeblocks.length; j < jj; j++) {\n var codeblock = codeblocks[j];\n if (codeblock.precinctNumber !== precinctNumber) {\n continue;\n }\n precinctCodeblocks.push(codeblock);\n }\n }\n return {\n layerNumber,\n codeblocks: precinctCodeblocks,\n };\n }\n function LayerResolutionComponentPositionIterator(context) {\n var siz = context.SIZ;\n var tileIndex = context.currentTile.index;\n var tile = context.tiles[tileIndex];\n var layersCount = tile.codingStyleDefaultParameters.layersCount;\n var componentsCount = siz.Csiz;\n var maxDecompositionLevelsCount = 0;\n for (var q = 0; q < componentsCount; q++) {\n maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount,\n tile.components[q].codingStyleParameters.decompositionLevelsCount);\n }\n\n var l = 0, r = 0, i = 0, k = 0;\n\n this.nextPacket = function JpxImage_nextPacket() {\n // Section B.12.1.1 Layer-resolution-component-position\n for (; l < layersCount; l++) {\n for (; r <= maxDecompositionLevelsCount; r++) {\n for (; i < componentsCount; i++) {\n var component = tile.components[i];\n if (r > component.codingStyleParameters.decompositionLevelsCount) {\n continue;\n }\n\n var resolution = component.resolutions[r];\n var numprecincts = resolution.precinctParameters.numprecincts;\n for (; k < numprecincts;) {\n var packet = createPacket(resolution, k, l);\n k++;\n return packet;\n }\n k = 0;\n }\n i = 0;\n }\n r = 0;\n }\n throw new JpxError('Out of packets');\n };\n }\n function ResolutionLayerComponentPositionIterator(context) {\n var siz = context.SIZ;\n var tileIndex = context.currentTile.index;\n var tile = context.tiles[tileIndex];\n var layersCount = tile.codingStyleDefaultParameters.layersCount;\n var componentsCount = siz.Csiz;\n var maxDecompositionLevelsCount = 0;\n for (var q = 0; q < componentsCount; q++) {\n maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount,\n tile.components[q].codingStyleParameters.decompositionLevelsCount);\n }\n\n var r = 0, l = 0, i = 0, k = 0;\n\n this.nextPacket = function JpxImage_nextPacket() {\n // Section B.12.1.2 Resolution-layer-component-position\n for (; r <= maxDecompositionLevelsCount; r++) {\n for (; l < layersCount; l++) {\n for (; i < componentsCount; i++) {\n var component = tile.components[i];\n if (r > component.codingStyleParameters.decompositionLevelsCount) {\n continue;\n }\n\n var resolution = component.resolutions[r];\n var numprecincts = resolution.precinctParameters.numprecincts;\n for (; k < numprecincts;) {\n var packet = createPacket(resolution, k, l);\n k++;\n return packet;\n }\n k = 0;\n }\n i = 0;\n }\n l = 0;\n }\n throw new JpxError('Out of packets');\n };\n }\n function ResolutionPositionComponentLayerIterator(context) {\n var siz = context.SIZ;\n var tileIndex = context.currentTile.index;\n var tile = context.tiles[tileIndex];\n var layersCount = tile.codingStyleDefaultParameters.layersCount;\n var componentsCount = siz.Csiz;\n var l, r, c, p;\n var maxDecompositionLevelsCount = 0;\n for (c = 0; c < componentsCount; c++) {\n var component = tile.components[c];\n maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount,\n component.codingStyleParameters.decompositionLevelsCount);\n }\n var maxNumPrecinctsInLevel = new Int32Array(\n maxDecompositionLevelsCount + 1);\n for (r = 0; r <= maxDecompositionLevelsCount; ++r) {\n var maxNumPrecincts = 0;\n for (c = 0; c < componentsCount; ++c) {\n var resolutions = tile.components[c].resolutions;\n if (r < resolutions.length) {\n maxNumPrecincts = Math.max(maxNumPrecincts,\n resolutions[r].precinctParameters.numprecincts);\n }\n }\n maxNumPrecinctsInLevel[r] = maxNumPrecincts;\n }\n l = 0;\n r = 0;\n c = 0;\n p = 0;\n\n this.nextPacket = function JpxImage_nextPacket() {\n // Section B.12.1.3 Resolution-position-component-layer\n for (; r <= maxDecompositionLevelsCount; r++) {\n for (; p < maxNumPrecinctsInLevel[r]; p++) {\n for (; c < componentsCount; c++) {\n var component = tile.components[c];\n if (r > component.codingStyleParameters.decompositionLevelsCount) {\n continue;\n }\n var resolution = component.resolutions[r];\n var numprecincts = resolution.precinctParameters.numprecincts;\n if (p >= numprecincts) {\n continue;\n }\n for (; l < layersCount;) {\n var packet = createPacket(resolution, p, l);\n l++;\n return packet;\n }\n l = 0;\n }\n c = 0;\n }\n p = 0;\n }\n throw new JpxError('Out of packets');\n };\n }\n function PositionComponentResolutionLayerIterator(context) {\n var siz = context.SIZ;\n var tileIndex = context.currentTile.index;\n var tile = context.tiles[tileIndex];\n var layersCount = tile.codingStyleDefaultParameters.layersCount;\n var componentsCount = siz.Csiz;\n var precinctsSizes = getPrecinctSizesInImageScale(tile);\n var precinctsIterationSizes = precinctsSizes;\n var l = 0, r = 0, c = 0, px = 0, py = 0;\n\n this.nextPacket = function JpxImage_nextPacket() {\n // Section B.12.1.4 Position-component-resolution-layer\n for (; py < precinctsIterationSizes.maxNumHigh; py++) {\n for (; px < precinctsIterationSizes.maxNumWide; px++) {\n for (; c < componentsCount; c++) {\n var component = tile.components[c];\n var decompositionLevelsCount =\n component.codingStyleParameters.decompositionLevelsCount;\n for (; r <= decompositionLevelsCount; r++) {\n var resolution = component.resolutions[r];\n var sizeInImageScale =\n precinctsSizes.components[c].resolutions[r];\n var k = getPrecinctIndexIfExist(\n px,\n py,\n sizeInImageScale,\n precinctsIterationSizes,\n resolution);\n if (k === null) {\n continue;\n }\n for (; l < layersCount;) {\n var packet = createPacket(resolution, k, l);\n l++;\n return packet;\n }\n l = 0;\n }\n r = 0;\n }\n c = 0;\n }\n px = 0;\n }\n throw new JpxError('Out of packets');\n };\n }\n function ComponentPositionResolutionLayerIterator(context) {\n var siz = context.SIZ;\n var tileIndex = context.currentTile.index;\n var tile = context.tiles[tileIndex];\n var layersCount = tile.codingStyleDefaultParameters.layersCount;\n var componentsCount = siz.Csiz;\n var precinctsSizes = getPrecinctSizesInImageScale(tile);\n var l = 0, r = 0, c = 0, px = 0, py = 0;\n\n this.nextPacket = function JpxImage_nextPacket() {\n // Section B.12.1.5 Component-position-resolution-layer\n for (; c < componentsCount; ++c) {\n var component = tile.components[c];\n var precinctsIterationSizes = precinctsSizes.components[c];\n var decompositionLevelsCount =\n component.codingStyleParameters.decompositionLevelsCount;\n for (; py < precinctsIterationSizes.maxNumHigh; py++) {\n for (; px < precinctsIterationSizes.maxNumWide; px++) {\n for (; r <= decompositionLevelsCount; r++) {\n var resolution = component.resolutions[r];\n var sizeInImageScale = precinctsIterationSizes.resolutions[r];\n var k = getPrecinctIndexIfExist(\n px,\n py,\n sizeInImageScale,\n precinctsIterationSizes,\n resolution);\n if (k === null) {\n continue;\n }\n for (; l < layersCount;) {\n var packet = createPacket(resolution, k, l);\n l++;\n return packet;\n }\n l = 0;\n }\n r = 0;\n }\n px = 0;\n }\n py = 0;\n }\n throw new JpxError('Out of packets');\n };\n }\n function getPrecinctIndexIfExist(\n pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) {\n var posX = pxIndex * precinctIterationSizes.minWidth;\n var posY = pyIndex * precinctIterationSizes.minHeight;\n if (posX % sizeInImageScale.width !== 0 ||\n posY % sizeInImageScale.height !== 0) {\n return null;\n }\n var startPrecinctRowIndex =\n (posY / sizeInImageScale.width) *\n resolution.precinctParameters.numprecinctswide;\n return (posX / sizeInImageScale.height) + startPrecinctRowIndex;\n }\n function getPrecinctSizesInImageScale(tile) {\n var componentsCount = tile.components.length;\n var minWidth = Number.MAX_VALUE;\n var minHeight = Number.MAX_VALUE;\n var maxNumWide = 0;\n var maxNumHigh = 0;\n var sizePerComponent = new Array(componentsCount);\n for (var c = 0; c < componentsCount; c++) {\n var component = tile.components[c];\n var decompositionLevelsCount =\n component.codingStyleParameters.decompositionLevelsCount;\n var sizePerResolution = new Array(decompositionLevelsCount + 1);\n var minWidthCurrentComponent = Number.MAX_VALUE;\n var minHeightCurrentComponent = Number.MAX_VALUE;\n var maxNumWideCurrentComponent = 0;\n var maxNumHighCurrentComponent = 0;\n var scale = 1;\n for (var r = decompositionLevelsCount; r >= 0; --r) {\n var resolution = component.resolutions[r];\n var widthCurrentResolution =\n scale * resolution.precinctParameters.precinctWidth;\n var heightCurrentResolution =\n scale * resolution.precinctParameters.precinctHeight;\n minWidthCurrentComponent = Math.min(\n minWidthCurrentComponent,\n widthCurrentResolution);\n minHeightCurrentComponent = Math.min(\n minHeightCurrentComponent,\n heightCurrentResolution);\n maxNumWideCurrentComponent = Math.max(maxNumWideCurrentComponent,\n resolution.precinctParameters.numprecinctswide);\n maxNumHighCurrentComponent = Math.max(maxNumHighCurrentComponent,\n resolution.precinctParameters.numprecinctshigh);\n sizePerResolution[r] = {\n width: widthCurrentResolution,\n height: heightCurrentResolution,\n };\n scale <<= 1;\n }\n minWidth = Math.min(minWidth, minWidthCurrentComponent);\n minHeight = Math.min(minHeight, minHeightCurrentComponent);\n maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent);\n maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent);\n sizePerComponent[c] = {\n resolutions: sizePerResolution,\n minWidth: minWidthCurrentComponent,\n minHeight: minHeightCurrentComponent,\n maxNumWide: maxNumWideCurrentComponent,\n maxNumHigh: maxNumHighCurrentComponent,\n };\n }\n return {\n components: sizePerComponent,\n minWidth,\n minHeight,\n maxNumWide,\n maxNumHigh,\n };\n }\n function buildPackets(context) {\n var siz = context.SIZ;\n var tileIndex = context.currentTile.index;\n var tile = context.tiles[tileIndex];\n var componentsCount = siz.Csiz;\n // Creating resolutions and sub-bands for each component\n for (var c = 0; c < componentsCount; c++) {\n var component = tile.components[c];\n var decompositionLevelsCount =\n component.codingStyleParameters.decompositionLevelsCount;\n // Section B.5 Resolution levels and sub-bands\n var resolutions = [];\n var subbands = [];\n for (var r = 0; r <= decompositionLevelsCount; r++) {\n var blocksDimensions = getBlocksDimensions(context, component, r);\n var resolution = {};\n var scale = 1 << (decompositionLevelsCount - r);\n resolution.trx0 = Math.ceil(component.tcx0 / scale);\n resolution.try0 = Math.ceil(component.tcy0 / scale);\n resolution.trx1 = Math.ceil(component.tcx1 / scale);\n resolution.try1 = Math.ceil(component.tcy1 / scale);\n resolution.resLevel = r;\n buildPrecincts(context, resolution, blocksDimensions);\n resolutions.push(resolution);\n\n var subband;\n if (r === 0) {\n // one sub-band (LL) with last decomposition\n subband = {};\n subband.type = 'LL';\n subband.tbx0 = Math.ceil(component.tcx0 / scale);\n subband.tby0 = Math.ceil(component.tcy0 / scale);\n subband.tbx1 = Math.ceil(component.tcx1 / scale);\n subband.tby1 = Math.ceil(component.tcy1 / scale);\n subband.resolution = resolution;\n buildCodeblocks(context, subband, blocksDimensions);\n subbands.push(subband);\n resolution.subbands = [subband];\n } else {\n var bscale = 1 << (decompositionLevelsCount - r + 1);\n var resolutionSubbands = [];\n // three sub-bands (HL, LH and HH) with rest of decompositions\n subband = {};\n subband.type = 'HL';\n subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5);\n subband.tby0 = Math.ceil(component.tcy0 / bscale);\n subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5);\n subband.tby1 = Math.ceil(component.tcy1 / bscale);\n subband.resolution = resolution;\n buildCodeblocks(context, subband, blocksDimensions);\n subbands.push(subband);\n resolutionSubbands.push(subband);\n\n subband = {};\n subband.type = 'LH';\n subband.tbx0 = Math.ceil(component.tcx0 / bscale);\n subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5);\n subband.tbx1 = Math.ceil(component.tcx1 / bscale);\n subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5);\n subband.resolution = resolution;\n buildCodeblocks(context, subband, blocksDimensions);\n subbands.push(subband);\n resolutionSubbands.push(subband);\n\n subband = {};\n subband.type = 'HH';\n subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5);\n subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5);\n subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5);\n subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5);\n subband.resolution = resolution;\n buildCodeblocks(context, subband, blocksDimensions);\n subbands.push(subband);\n resolutionSubbands.push(subband);\n\n resolution.subbands = resolutionSubbands;\n }\n }\n component.resolutions = resolutions;\n component.subbands = subbands;\n }\n // Generate the packets sequence\n var progressionOrder = tile.codingStyleDefaultParameters.progressionOrder;\n switch (progressionOrder) {\n case 0:\n tile.packetsIterator =\n new LayerResolutionComponentPositionIterator(context);\n break;\n case 1:\n tile.packetsIterator =\n new ResolutionLayerComponentPositionIterator(context);\n break;\n case 2:\n tile.packetsIterator =\n new ResolutionPositionComponentLayerIterator(context);\n break;\n case 3:\n tile.packetsIterator =\n new PositionComponentResolutionLayerIterator(context);\n break;\n case 4:\n tile.packetsIterator =\n new ComponentPositionResolutionLayerIterator(context);\n break;\n default:\n throw new JpxError(`Unsupported progression order ${progressionOrder}`);\n }\n }\n function parseTilePackets(context, data, offset, dataLength) {\n var position = 0;\n var buffer, bufferSize = 0, skipNextBit = false;\n function readBits(count) {\n while (bufferSize < count) {\n var b = data[offset + position];\n position++;\n if (skipNextBit) {\n buffer = (buffer << 7) | b;\n bufferSize += 7;\n skipNextBit = false;\n } else {\n buffer = (buffer << 8) | b;\n bufferSize += 8;\n }\n if (b === 0xFF) {\n skipNextBit = true;\n }\n }\n bufferSize -= count;\n return (buffer >>> bufferSize) & ((1 << count) - 1);\n }\n function skipMarkerIfEqual(value) {\n if (data[offset + position - 1] === 0xFF &&\n data[offset + position] === value) {\n skipBytes(1);\n return true;\n } else if (data[offset + position] === 0xFF &&\n data[offset + position + 1] === value) {\n skipBytes(2);\n return true;\n }\n return false;\n }\n function skipBytes(count) {\n position += count;\n }\n function alignToByte() {\n bufferSize = 0;\n if (skipNextBit) {\n position++;\n skipNextBit = false;\n }\n }\n function readCodingpasses() {\n if (readBits(1) === 0) {\n return 1;\n }\n if (readBits(1) === 0) {\n return 2;\n }\n var value = readBits(2);\n if (value < 3) {\n return value + 3;\n }\n value = readBits(5);\n if (value < 31) {\n return value + 6;\n }\n value = readBits(7);\n return value + 37;\n }\n var tileIndex = context.currentTile.index;\n var tile = context.tiles[tileIndex];\n var sopMarkerUsed = context.COD.sopMarkerUsed;\n var ephMarkerUsed = context.COD.ephMarkerUsed;\n var packetsIterator = tile.packetsIterator;\n while (position < dataLength) {\n alignToByte();\n if (sopMarkerUsed && skipMarkerIfEqual(0x91)) {\n // Skip also marker segment length and packet sequence ID\n skipBytes(4);\n }\n var packet = packetsIterator.nextPacket();\n if (!readBits(1)) {\n continue;\n }\n var layerNumber = packet.layerNumber;\n var queue = [], codeblock;\n for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) {\n codeblock = packet.codeblocks[i];\n var precinct = codeblock.precinct;\n var codeblockColumn = codeblock.cbx - precinct.cbxMin;\n var codeblockRow = codeblock.cby - precinct.cbyMin;\n var codeblockIncluded = false;\n var firstTimeInclusion = false;\n var valueReady;\n if (codeblock['included'] !== undefined) {\n codeblockIncluded = !!readBits(1);\n } else {\n // reading inclusion tree\n precinct = codeblock.precinct;\n var inclusionTree, zeroBitPlanesTree;\n if (precinct['inclusionTree'] !== undefined) {\n inclusionTree = precinct.inclusionTree;\n } else {\n // building inclusion and zero bit-planes trees\n var width = precinct.cbxMax - precinct.cbxMin + 1;\n var height = precinct.cbyMax - precinct.cbyMin + 1;\n inclusionTree = new InclusionTree(width, height, layerNumber);\n zeroBitPlanesTree = new TagTree(width, height);\n precinct.inclusionTree = inclusionTree;\n precinct.zeroBitPlanesTree = zeroBitPlanesTree;\n }\n\n if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) {\n while (true) {\n if (readBits(1)) {\n valueReady = !inclusionTree.nextLevel();\n if (valueReady) {\n codeblock.included = true;\n codeblockIncluded = firstTimeInclusion = true;\n break;\n }\n } else {\n inclusionTree.incrementValue(layerNumber);\n break;\n }\n }\n }\n }\n if (!codeblockIncluded) {\n continue;\n }\n if (firstTimeInclusion) {\n zeroBitPlanesTree = precinct.zeroBitPlanesTree;\n zeroBitPlanesTree.reset(codeblockColumn, codeblockRow);\n while (true) {\n if (readBits(1)) {\n valueReady = !zeroBitPlanesTree.nextLevel();\n if (valueReady) {\n break;\n }\n } else {\n zeroBitPlanesTree.incrementValue();\n }\n }\n codeblock.zeroBitPlanes = zeroBitPlanesTree.value;\n }\n var codingpasses = readCodingpasses();\n while (readBits(1)) {\n codeblock.Lblock++;\n }\n var codingpassesLog2 = log2(codingpasses);\n // rounding down log2\n var bits = ((codingpasses < (1 << codingpassesLog2)) ?\n codingpassesLog2 - 1 : codingpassesLog2) + codeblock.Lblock;\n var codedDataLength = readBits(bits);\n queue.push({\n codeblock,\n codingpasses,\n dataLength: codedDataLength,\n });\n }\n alignToByte();\n if (ephMarkerUsed) {\n skipMarkerIfEqual(0x92);\n }\n while (queue.length > 0) {\n var packetItem = queue.shift();\n codeblock = packetItem.codeblock;\n if (codeblock['data'] === undefined) {\n codeblock.data = [];\n }\n codeblock.data.push({\n data,\n start: offset + position,\n end: offset + position + packetItem.dataLength,\n codingpasses: packetItem.codingpasses,\n });\n position += packetItem.dataLength;\n }\n }\n return position;\n }\n function copyCoefficients(coefficients, levelWidth, levelHeight, subband,\n delta, mb, reversible, segmentationSymbolUsed) {\n var x0 = subband.tbx0;\n var y0 = subband.tby0;\n var width = subband.tbx1 - subband.tbx0;\n var codeblocks = subband.codeblocks;\n var right = subband.type.charAt(0) === 'H' ? 1 : 0;\n var bottom = subband.type.charAt(1) === 'H' ? levelWidth : 0;\n\n for (var i = 0, ii = codeblocks.length; i < ii; ++i) {\n var codeblock = codeblocks[i];\n var blockWidth = codeblock.tbx1_ - codeblock.tbx0_;\n var blockHeight = codeblock.tby1_ - codeblock.tby0_;\n if (blockWidth === 0 || blockHeight === 0) {\n continue;\n }\n if (codeblock['data'] === undefined) {\n continue;\n }\n\n var bitModel, currentCodingpassType;\n bitModel = new BitModel(blockWidth, blockHeight, codeblock.subbandType,\n codeblock.zeroBitPlanes, mb);\n currentCodingpassType = 2; // first bit plane starts from cleanup\n\n // collect data\n var data = codeblock.data, totalLength = 0, codingpasses = 0;\n var j, jj, dataItem;\n for (j = 0, jj = data.length; j < jj; j++) {\n dataItem = data[j];\n totalLength += dataItem.end - dataItem.start;\n codingpasses += dataItem.codingpasses;\n }\n var encodedData = new Uint8Array(totalLength);\n var position = 0;\n for (j = 0, jj = data.length; j < jj; j++) {\n dataItem = data[j];\n var chunk = dataItem.data.subarray(dataItem.start, dataItem.end);\n encodedData.set(chunk, position);\n position += chunk.length;\n }\n // decoding the item\n var decoder = new ArithmeticDecoder(encodedData, 0, totalLength);\n bitModel.setDecoder(decoder);\n\n for (j = 0; j < codingpasses; j++) {\n switch (currentCodingpassType) {\n case 0:\n bitModel.runSignificancePropagationPass();\n break;\n case 1:\n bitModel.runMagnitudeRefinementPass();\n break;\n case 2:\n bitModel.runCleanupPass();\n if (segmentationSymbolUsed) {\n bitModel.checkSegmentationSymbol();\n }\n break;\n }\n currentCodingpassType = (currentCodingpassType + 1) % 3;\n }\n\n var offset = (codeblock.tbx0_ - x0) + (codeblock.tby0_ - y0) * width;\n var sign = bitModel.coefficentsSign;\n var magnitude = bitModel.coefficentsMagnitude;\n var bitsDecoded = bitModel.bitsDecoded;\n var magnitudeCorrection = reversible ? 0 : 0.5;\n var k, n, nb;\n position = 0;\n // Do the interleaving of Section F.3.3 here, so we do not need\n // to copy later. LL level is not interleaved, just copied.\n var interleave = (subband.type !== 'LL');\n for (j = 0; j < blockHeight; j++) {\n var row = (offset / width) | 0; // row in the non-interleaved subband\n var levelOffset = 2 * row * (levelWidth - width) + right + bottom;\n for (k = 0; k < blockWidth; k++) {\n n = magnitude[position];\n if (n !== 0) {\n n = (n + magnitudeCorrection) * delta;\n if (sign[position] !== 0) {\n n = -n;\n }\n nb = bitsDecoded[position];\n var pos = interleave ? (levelOffset + (offset << 1)) : offset;\n if (reversible && (nb >= mb)) {\n coefficients[pos] = n;\n } else {\n coefficients[pos] = n * (1 << (mb - nb));\n }\n }\n offset++;\n position++;\n }\n offset += width - blockWidth;\n }\n }\n }\n function transformTile(context, tile, c) {\n var component = tile.components[c];\n var codingStyleParameters = component.codingStyleParameters;\n var quantizationParameters = component.quantizationParameters;\n var decompositionLevelsCount =\n codingStyleParameters.decompositionLevelsCount;\n var spqcds = quantizationParameters.SPqcds;\n var scalarExpounded = quantizationParameters.scalarExpounded;\n var guardBits = quantizationParameters.guardBits;\n var segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed;\n var precision = context.components[c].precision;\n\n var reversible = codingStyleParameters.reversibleTransformation;\n var transform = (reversible ? new ReversibleTransform() :\n new IrreversibleTransform());\n\n var subbandCoefficients = [];\n var b = 0;\n for (var i = 0; i <= decompositionLevelsCount; i++) {\n var resolution = component.resolutions[i];\n\n var width = resolution.trx1 - resolution.trx0;\n var height = resolution.try1 - resolution.try0;\n // Allocate space for the whole sublevel.\n var coefficients = new Float32Array(width * height);\n\n for (var j = 0, jj = resolution.subbands.length; j < jj; j++) {\n var mu, epsilon;\n if (!scalarExpounded) {\n // formula E-5\n mu = spqcds[0].mu;\n epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0);\n } else {\n mu = spqcds[b].mu;\n epsilon = spqcds[b].epsilon;\n b++;\n }\n\n var subband = resolution.subbands[j];\n var gainLog2 = SubbandsGainLog2[subband.type];\n\n // calculate quantization coefficient (Section E.1.1.1)\n var delta = (reversible ? 1 :\n Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048));\n var mb = (guardBits + epsilon - 1);\n\n // In the first resolution level, copyCoefficients will fill the\n // whole array with coefficients. In the succeeding passes,\n // copyCoefficients will consecutively fill in the values that belong\n // to the interleaved positions of the HL, LH, and HH coefficients.\n // The LL coefficients will then be interleaved in Transform.iterate().\n copyCoefficients(coefficients, width, height, subband, delta, mb,\n reversible, segmentationSymbolUsed);\n }\n subbandCoefficients.push({\n width,\n height,\n items: coefficients,\n });\n }\n\n var result = transform.calculate(subbandCoefficients,\n component.tcx0, component.tcy0);\n return {\n left: component.tcx0,\n top: component.tcy0,\n width: result.width,\n height: result.height,\n items: result.items,\n };\n }\n function transformComponents(context) {\n var siz = context.SIZ;\n var components = context.components;\n var componentsCount = siz.Csiz;\n var resultImages = [];\n for (var i = 0, ii = context.tiles.length; i < ii; i++) {\n var tile = context.tiles[i];\n var transformedTiles = [];\n var c;\n for (c = 0; c < componentsCount; c++) {\n transformedTiles[c] = transformTile(context, tile, c);\n }\n var tile0 = transformedTiles[0];\n var out = new Uint8ClampedArray(tile0.items.length * componentsCount);\n var result = {\n left: tile0.left,\n top: tile0.top,\n width: tile0.width,\n height: tile0.height,\n items: out,\n };\n\n // Section G.2.2 Inverse multi component transform\n var shift, offset;\n var pos = 0, j, jj, y0, y1, y2;\n if (tile.codingStyleDefaultParameters.multipleComponentTransform) {\n var fourComponents = componentsCount === 4;\n var y0items = transformedTiles[0].items;\n var y1items = transformedTiles[1].items;\n var y2items = transformedTiles[2].items;\n var y3items = fourComponents ? transformedTiles[3].items : null;\n\n // HACK: The multiple component transform formulas below assume that\n // all components have the same precision. With this in mind, we\n // compute shift and offset only once.\n shift = components[0].precision - 8;\n offset = (128 << shift) + 0.5;\n\n var component0 = tile.components[0];\n var alpha01 = componentsCount - 3;\n jj = y0items.length;\n if (!component0.codingStyleParameters.reversibleTransformation) {\n // inverse irreversible multiple component transform\n for (j = 0; j < jj; j++, pos += alpha01) {\n y0 = y0items[j] + offset;\n y1 = y1items[j];\n y2 = y2items[j];\n out[pos++] = (y0 + 1.402 * y2) >> shift;\n out[pos++] = (y0 - 0.34413 * y1 - 0.71414 * y2) >> shift;\n out[pos++] = (y0 + 1.772 * y1) >> shift;\n }\n } else {\n // inverse reversible multiple component transform\n for (j = 0; j < jj; j++, pos += alpha01) {\n y0 = y0items[j] + offset;\n y1 = y1items[j];\n y2 = y2items[j];\n let g = y0 - ((y2 + y1) >> 2);\n\n out[pos++] = (g + y2) >> shift;\n out[pos++] = g >> shift;\n out[pos++] = (g + y1) >> shift;\n }\n }\n if (fourComponents) {\n for (j = 0, pos = 3; j < jj; j++, pos += 4) {\n out[pos] = (y3items[j] + offset) >> shift;\n }\n }\n } else { // no multi-component transform\n for (c = 0; c < componentsCount; c++) {\n var items = transformedTiles[c].items;\n shift = components[c].precision - 8;\n offset = (128 << shift) + 0.5;\n for (pos = c, j = 0, jj = items.length; j < jj; j++) {\n out[pos] = (items[j] + offset) >> shift;\n pos += componentsCount;\n }\n }\n }\n resultImages.push(result);\n }\n return resultImages;\n }\n function initializeTile(context, tileIndex) {\n var siz = context.SIZ;\n var componentsCount = siz.Csiz;\n var tile = context.tiles[tileIndex];\n for (var c = 0; c < componentsCount; c++) {\n var component = tile.components[c];\n var qcdOrQcc = (context.currentTile.QCC[c] !== undefined ?\n context.currentTile.QCC[c] : context.currentTile.QCD);\n component.quantizationParameters = qcdOrQcc;\n var codOrCoc = (context.currentTile.COC[c] !== undefined ?\n context.currentTile.COC[c] : context.currentTile.COD);\n component.codingStyleParameters = codOrCoc;\n }\n tile.codingStyleDefaultParameters = context.currentTile.COD;\n }\n\n // Section B.10.2 Tag trees\n var TagTree = (function TagTreeClosure() {\n function TagTree(width, height) {\n var levelsLength = log2(Math.max(width, height)) + 1;\n this.levels = [];\n for (var i = 0; i < levelsLength; i++) {\n var level = {\n width,\n height,\n items: [],\n };\n this.levels.push(level);\n width = Math.ceil(width / 2);\n height = Math.ceil(height / 2);\n }\n }\n TagTree.prototype = {\n reset: function TagTree_reset(i, j) {\n var currentLevel = 0, value = 0, level;\n while (currentLevel < this.levels.length) {\n level = this.levels[currentLevel];\n var index = i + j * level.width;\n if (level.items[index] !== undefined) {\n value = level.items[index];\n break;\n }\n level.index = index;\n i >>= 1;\n j >>= 1;\n currentLevel++;\n }\n currentLevel--;\n level = this.levels[currentLevel];\n level.items[level.index] = value;\n this.currentLevel = currentLevel;\n delete this.value;\n },\n incrementValue: function TagTree_incrementValue() {\n var level = this.levels[this.currentLevel];\n level.items[level.index]++;\n },\n nextLevel: function TagTree_nextLevel() {\n var currentLevel = this.currentLevel;\n var level = this.levels[currentLevel];\n var value = level.items[level.index];\n currentLevel--;\n if (currentLevel < 0) {\n this.value = value;\n return false;\n }\n\n this.currentLevel = currentLevel;\n level = this.levels[currentLevel];\n level.items[level.index] = value;\n return true;\n },\n };\n return TagTree;\n })();\n\n var InclusionTree = (function InclusionTreeClosure() {\n function InclusionTree(width, height, defaultValue) {\n var levelsLength = log2(Math.max(width, height)) + 1;\n this.levels = [];\n for (var i = 0; i < levelsLength; i++) {\n var items = new Uint8Array(width * height);\n for (var j = 0, jj = items.length; j < jj; j++) {\n items[j] = defaultValue;\n }\n\n var level = {\n width,\n height,\n items,\n };\n this.levels.push(level);\n\n width = Math.ceil(width / 2);\n height = Math.ceil(height / 2);\n }\n }\n InclusionTree.prototype = {\n reset: function InclusionTree_reset(i, j, stopValue) {\n var currentLevel = 0;\n while (currentLevel < this.levels.length) {\n var level = this.levels[currentLevel];\n var index = i + j * level.width;\n level.index = index;\n var value = level.items[index];\n\n if (value === 0xFF) {\n break;\n }\n\n if (value > stopValue) {\n this.currentLevel = currentLevel;\n // already know about this one, propagating the value to top levels\n this.propagateValues();\n return false;\n }\n\n i >>= 1;\n j >>= 1;\n currentLevel++;\n }\n this.currentLevel = currentLevel - 1;\n return true;\n },\n incrementValue: function InclusionTree_incrementValue(stopValue) {\n var level = this.levels[this.currentLevel];\n level.items[level.index] = stopValue + 1;\n this.propagateValues();\n },\n propagateValues: function InclusionTree_propagateValues() {\n var levelIndex = this.currentLevel;\n var level = this.levels[levelIndex];\n var currentValue = level.items[level.index];\n while (--levelIndex >= 0) {\n level = this.levels[levelIndex];\n level.items[level.index] = currentValue;\n }\n },\n nextLevel: function InclusionTree_nextLevel() {\n var currentLevel = this.currentLevel;\n var level = this.levels[currentLevel];\n var value = level.items[level.index];\n level.items[level.index] = 0xFF;\n currentLevel--;\n if (currentLevel < 0) {\n return false;\n }\n\n this.currentLevel = currentLevel;\n level = this.levels[currentLevel];\n level.items[level.index] = value;\n return true;\n },\n };\n return InclusionTree;\n })();\n\n // Section D. Coefficient bit modeling\n var BitModel = (function BitModelClosure() {\n var UNIFORM_CONTEXT = 17;\n var RUNLENGTH_CONTEXT = 18;\n // Table D-1\n // The index is binary presentation: 0dddvvhh, ddd - sum of Di (0..4),\n // vv - sum of Vi (0..2), and hh - sum of Hi (0..2)\n var LLAndLHContextsLabel = new Uint8Array([\n 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,\n 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,\n 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\n ]);\n var HLContextLabel = new Uint8Array([\n 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,\n 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,\n 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\n ]);\n var HHContextLabel = new Uint8Array([\n 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,\n 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,\n 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\n ]);\n\n function BitModel(width, height, subband, zeroBitPlanes, mb) {\n this.width = width;\n this.height = height;\n\n this.contextLabelTable = (subband === 'HH' ? HHContextLabel :\n (subband === 'HL' ? HLContextLabel : LLAndLHContextsLabel));\n\n var coefficientCount = width * height;\n\n // coefficients outside the encoding region treated as insignificant\n // add border state cells for significanceState\n this.neighborsSignificance = new Uint8Array(coefficientCount);\n this.coefficentsSign = new Uint8Array(coefficientCount);\n this.coefficentsMagnitude = mb > 14 ? new Uint32Array(coefficientCount) :\n mb > 6 ? new Uint16Array(coefficientCount) :\n new Uint8Array(coefficientCount);\n this.processingFlags = new Uint8Array(coefficientCount);\n\n var bitsDecoded = new Uint8Array(coefficientCount);\n if (zeroBitPlanes !== 0) {\n for (var i = 0; i < coefficientCount; i++) {\n bitsDecoded[i] = zeroBitPlanes;\n }\n }\n this.bitsDecoded = bitsDecoded;\n\n this.reset();\n }\n\n BitModel.prototype = {\n setDecoder: function BitModel_setDecoder(decoder) {\n this.decoder = decoder;\n },\n reset: function BitModel_reset() {\n // We have 17 contexts that are accessed via context labels,\n // plus the uniform and runlength context.\n this.contexts = new Int8Array(19);\n\n // Contexts are packed into 1 byte:\n // highest 7 bits carry the index, lowest bit carries mps\n this.contexts[0] = (4 << 1) | 0;\n this.contexts[UNIFORM_CONTEXT] = (46 << 1) | 0;\n this.contexts[RUNLENGTH_CONTEXT] = (3 << 1) | 0;\n },\n setNeighborsSignificance:\n function BitModel_setNeighborsSignificance(row, column, index) {\n var neighborsSignificance = this.neighborsSignificance;\n var width = this.width, height = this.height;\n var left = (column > 0);\n var right = (column + 1 < width);\n var i;\n\n if (row > 0) {\n i = index - width;\n if (left) {\n neighborsSignificance[i - 1] += 0x10;\n }\n if (right) {\n neighborsSignificance[i + 1] += 0x10;\n }\n neighborsSignificance[i] += 0x04;\n }\n\n if (row + 1 < height) {\n i = index + width;\n if (left) {\n neighborsSignificance[i - 1] += 0x10;\n }\n if (right) {\n neighborsSignificance[i + 1] += 0x10;\n }\n neighborsSignificance[i] += 0x04;\n }\n\n if (left) {\n neighborsSignificance[index - 1] += 0x01;\n }\n if (right) {\n neighborsSignificance[index + 1] += 0x01;\n }\n neighborsSignificance[index] |= 0x80;\n },\n runSignificancePropagationPass:\n function BitModel_runSignificancePropagationPass() {\n var decoder = this.decoder;\n var width = this.width, height = this.height;\n var coefficentsMagnitude = this.coefficentsMagnitude;\n var coefficentsSign = this.coefficentsSign;\n var neighborsSignificance = this.neighborsSignificance;\n var processingFlags = this.processingFlags;\n var contexts = this.contexts;\n var labels = this.contextLabelTable;\n var bitsDecoded = this.bitsDecoded;\n var processedInverseMask = ~1;\n var processedMask = 1;\n var firstMagnitudeBitMask = 2;\n\n for (var i0 = 0; i0 < height; i0 += 4) {\n for (var j = 0; j < width; j++) {\n var index = i0 * width + j;\n for (var i1 = 0; i1 < 4; i1++, index += width) {\n var i = i0 + i1;\n if (i >= height) {\n break;\n }\n // clear processed flag first\n processingFlags[index] &= processedInverseMask;\n\n if (coefficentsMagnitude[index] ||\n !neighborsSignificance[index]) {\n continue;\n }\n\n var contextLabel = labels[neighborsSignificance[index]];\n var decision = decoder.readBit(contexts, contextLabel);\n if (decision) {\n var sign = this.decodeSignBit(i, j, index);\n coefficentsSign[index] = sign;\n coefficentsMagnitude[index] = 1;\n this.setNeighborsSignificance(i, j, index);\n processingFlags[index] |= firstMagnitudeBitMask;\n }\n bitsDecoded[index]++;\n processingFlags[index] |= processedMask;\n }\n }\n }\n },\n decodeSignBit: function BitModel_decodeSignBit(row, column, index) {\n var width = this.width, height = this.height;\n var coefficentsMagnitude = this.coefficentsMagnitude;\n var coefficentsSign = this.coefficentsSign;\n var contribution, sign0, sign1, significance1;\n var contextLabel, decoded;\n\n // calculate horizontal contribution\n significance1 = (column > 0 && coefficentsMagnitude[index - 1] !== 0);\n if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) {\n sign1 = coefficentsSign[index + 1];\n if (significance1) {\n sign0 = coefficentsSign[index - 1];\n contribution = 1 - sign1 - sign0;\n } else {\n contribution = 1 - sign1 - sign1;\n }\n } else if (significance1) {\n sign0 = coefficentsSign[index - 1];\n contribution = 1 - sign0 - sign0;\n } else {\n contribution = 0;\n }\n var horizontalContribution = 3 * contribution;\n\n // calculate vertical contribution and combine with the horizontal\n significance1 = (row > 0 && coefficentsMagnitude[index - width] !== 0);\n if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) {\n sign1 = coefficentsSign[index + width];\n if (significance1) {\n sign0 = coefficentsSign[index - width];\n contribution = 1 - sign1 - sign0 + horizontalContribution;\n } else {\n contribution = 1 - sign1 - sign1 + horizontalContribution;\n }\n } else if (significance1) {\n sign0 = coefficentsSign[index - width];\n contribution = 1 - sign0 - sign0 + horizontalContribution;\n } else {\n contribution = horizontalContribution;\n }\n\n if (contribution >= 0) {\n contextLabel = 9 + contribution;\n decoded = this.decoder.readBit(this.contexts, contextLabel);\n } else {\n contextLabel = 9 - contribution;\n decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1;\n }\n return decoded;\n },\n runMagnitudeRefinementPass:\n function BitModel_runMagnitudeRefinementPass() {\n var decoder = this.decoder;\n var width = this.width, height = this.height;\n var coefficentsMagnitude = this.coefficentsMagnitude;\n var neighborsSignificance = this.neighborsSignificance;\n var contexts = this.contexts;\n var bitsDecoded = this.bitsDecoded;\n var processingFlags = this.processingFlags;\n var processedMask = 1;\n var firstMagnitudeBitMask = 2;\n var length = width * height;\n var width4 = width * 4;\n\n for (var index0 = 0, indexNext; index0 < length; index0 = indexNext) {\n indexNext = Math.min(length, index0 + width4);\n for (var j = 0; j < width; j++) {\n for (var index = index0 + j; index < indexNext; index += width) {\n\n // significant but not those that have just become\n if (!coefficentsMagnitude[index] ||\n (processingFlags[index] & processedMask) !== 0) {\n continue;\n }\n\n var contextLabel = 16;\n if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) {\n processingFlags[index] ^= firstMagnitudeBitMask;\n // first refinement\n var significance = neighborsSignificance[index] & 127;\n contextLabel = significance === 0 ? 15 : 14;\n }\n\n var bit = decoder.readBit(contexts, contextLabel);\n coefficentsMagnitude[index] =\n (coefficentsMagnitude[index] << 1) | bit;\n bitsDecoded[index]++;\n processingFlags[index] |= processedMask;\n }\n }\n }\n },\n runCleanupPass: function BitModel_runCleanupPass() {\n var decoder = this.decoder;\n var width = this.width, height = this.height;\n var neighborsSignificance = this.neighborsSignificance;\n var coefficentsMagnitude = this.coefficentsMagnitude;\n var coefficentsSign = this.coefficentsSign;\n var contexts = this.contexts;\n var labels = this.contextLabelTable;\n var bitsDecoded = this.bitsDecoded;\n var processingFlags = this.processingFlags;\n var processedMask = 1;\n var firstMagnitudeBitMask = 2;\n var oneRowDown = width;\n var twoRowsDown = width * 2;\n var threeRowsDown = width * 3;\n var iNext;\n for (var i0 = 0; i0 < height; i0 = iNext) {\n iNext = Math.min(i0 + 4, height);\n var indexBase = i0 * width;\n var checkAllEmpty = i0 + 3 < height;\n for (var j = 0; j < width; j++) {\n var index0 = indexBase + j;\n // using the property: labels[neighborsSignificance[index]] === 0\n // when neighborsSignificance[index] === 0\n var allEmpty = (checkAllEmpty &&\n processingFlags[index0] === 0 &&\n processingFlags[index0 + oneRowDown] === 0 &&\n processingFlags[index0 + twoRowsDown] === 0 &&\n processingFlags[index0 + threeRowsDown] === 0 &&\n neighborsSignificance[index0] === 0 &&\n neighborsSignificance[index0 + oneRowDown] === 0 &&\n neighborsSignificance[index0 + twoRowsDown] === 0 &&\n neighborsSignificance[index0 + threeRowsDown] === 0);\n var i1 = 0, index = index0;\n var i = i0, sign;\n if (allEmpty) {\n var hasSignificantCoefficent =\n decoder.readBit(contexts, RUNLENGTH_CONTEXT);\n if (!hasSignificantCoefficent) {\n bitsDecoded[index0]++;\n bitsDecoded[index0 + oneRowDown]++;\n bitsDecoded[index0 + twoRowsDown]++;\n bitsDecoded[index0 + threeRowsDown]++;\n continue; // next column\n }\n i1 = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) |\n decoder.readBit(contexts, UNIFORM_CONTEXT);\n if (i1 !== 0) {\n i = i0 + i1;\n index += i1 * width;\n }\n\n sign = this.decodeSignBit(i, j, index);\n coefficentsSign[index] = sign;\n coefficentsMagnitude[index] = 1;\n this.setNeighborsSignificance(i, j, index);\n processingFlags[index] |= firstMagnitudeBitMask;\n\n index = index0;\n for (var i2 = i0; i2 <= i; i2++, index += width) {\n bitsDecoded[index]++;\n }\n\n i1++;\n }\n for (i = i0 + i1; i < iNext; i++, index += width) {\n if (coefficentsMagnitude[index] ||\n (processingFlags[index] & processedMask) !== 0) {\n continue;\n }\n\n var contextLabel = labels[neighborsSignificance[index]];\n var decision = decoder.readBit(contexts, contextLabel);\n if (decision === 1) {\n sign = this.decodeSignBit(i, j, index);\n coefficentsSign[index] = sign;\n coefficentsMagnitude[index] = 1;\n this.setNeighborsSignificance(i, j, index);\n processingFlags[index] |= firstMagnitudeBitMask;\n }\n bitsDecoded[index]++;\n }\n }\n }\n },\n checkSegmentationSymbol: function BitModel_checkSegmentationSymbol() {\n var decoder = this.decoder;\n var contexts = this.contexts;\n var symbol = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 3) |\n (decoder.readBit(contexts, UNIFORM_CONTEXT) << 2) |\n (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) |\n decoder.readBit(contexts, UNIFORM_CONTEXT);\n if (symbol !== 0xA) {\n throw new JpxError('Invalid segmentation symbol');\n }\n },\n };\n\n return BitModel;\n })();\n\n // Section F, Discrete wavelet transformation\n var Transform = (function TransformClosure() {\n function Transform() {}\n\n Transform.prototype.calculate =\n function transformCalculate(subbands, u0, v0) {\n var ll = subbands[0];\n for (var i = 1, ii = subbands.length; i < ii; i++) {\n ll = this.iterate(ll, subbands[i], u0, v0);\n }\n return ll;\n };\n Transform.prototype.extend = function extend(buffer, offset, size) {\n // Section F.3.7 extending... using max extension of 4\n var i1 = offset - 1, j1 = offset + 1;\n var i2 = offset + size - 2, j2 = offset + size;\n buffer[i1--] = buffer[j1++];\n buffer[j2++] = buffer[i2--];\n buffer[i1--] = buffer[j1++];\n buffer[j2++] = buffer[i2--];\n buffer[i1--] = buffer[j1++];\n buffer[j2++] = buffer[i2--];\n buffer[i1] = buffer[j1];\n buffer[j2] = buffer[i2];\n };\n Transform.prototype.iterate = function Transform_iterate(ll, hl_lh_hh,\n u0, v0) {\n var llWidth = ll.width, llHeight = ll.height, llItems = ll.items;\n var width = hl_lh_hh.width;\n var height = hl_lh_hh.height;\n var items = hl_lh_hh.items;\n var i, j, k, l, u, v;\n\n // Interleave LL according to Section F.3.3\n for (k = 0, i = 0; i < llHeight; i++) {\n l = i * 2 * width;\n for (j = 0; j < llWidth; j++, k++, l += 2) {\n items[l] = llItems[k];\n }\n }\n // The LL band is not needed anymore.\n llItems = ll.items = null;\n\n var bufferPadding = 4;\n var rowBuffer = new Float32Array(width + 2 * bufferPadding);\n\n // Section F.3.4 HOR_SR\n if (width === 1) {\n // if width = 1, when u0 even keep items as is, when odd divide by 2\n if ((u0 & 1) !== 0) {\n for (v = 0, k = 0; v < height; v++, k += width) {\n items[k] *= 0.5;\n }\n }\n } else {\n for (v = 0, k = 0; v < height; v++, k += width) {\n rowBuffer.set(items.subarray(k, k + width), bufferPadding);\n\n this.extend(rowBuffer, bufferPadding, width);\n this.filter(rowBuffer, bufferPadding, width);\n\n items.set(\n rowBuffer.subarray(bufferPadding, bufferPadding + width),\n k);\n }\n }\n\n // Accesses to the items array can take long, because it may not fit into\n // CPU cache and has to be fetched from main memory. Since subsequent\n // accesses to the items array are not local when reading columns, we\n // have a cache miss every time. To reduce cache misses, get up to\n // 'numBuffers' items at a time and store them into the individual\n // buffers. The colBuffers should be small enough to fit into CPU cache.\n var numBuffers = 16;\n var colBuffers = [];\n for (i = 0; i < numBuffers; i++) {\n colBuffers.push(new Float32Array(height + 2 * bufferPadding));\n }\n var b, currentBuffer = 0;\n ll = bufferPadding + height;\n\n // Section F.3.5 VER_SR\n if (height === 1) {\n // if height = 1, when v0 even keep items as is, when odd divide by 2\n if ((v0 & 1) !== 0) {\n for (u = 0; u < width; u++) {\n items[u] *= 0.5;\n }\n }\n } else {\n for (u = 0; u < width; u++) {\n // if we ran out of buffers, copy several image columns at once\n if (currentBuffer === 0) {\n numBuffers = Math.min(width - u, numBuffers);\n for (k = u, l = bufferPadding; l < ll; k += width, l++) {\n for (b = 0; b < numBuffers; b++) {\n colBuffers[b][l] = items[k + b];\n }\n }\n currentBuffer = numBuffers;\n }\n\n currentBuffer--;\n var buffer = colBuffers[currentBuffer];\n this.extend(buffer, bufferPadding, height);\n this.filter(buffer, bufferPadding, height);\n\n // If this is last buffer in this group of buffers, flush all buffers.\n if (currentBuffer === 0) {\n k = u - numBuffers + 1;\n for (l = bufferPadding; l < ll; k += width, l++) {\n for (b = 0; b < numBuffers; b++) {\n items[k + b] = colBuffers[b][l];\n }\n }\n }\n }\n }\n\n return {\n width,\n height,\n items,\n };\n };\n return Transform;\n })();\n\n // Section 3.8.2 Irreversible 9-7 filter\n var IrreversibleTransform = (function IrreversibleTransformClosure() {\n function IrreversibleTransform() {\n Transform.call(this);\n }\n\n IrreversibleTransform.prototype = Object.create(Transform.prototype);\n IrreversibleTransform.prototype.filter =\n function irreversibleTransformFilter(x, offset, length) {\n var len = length >> 1;\n offset = offset | 0;\n var j, n, current, next;\n\n var alpha = -1.586134342059924;\n var beta = -0.052980118572961;\n var gamma = 0.882911075530934;\n var delta = 0.443506852043971;\n var K = 1.230174104914001;\n var K_ = 1 / K;\n\n // step 1 is combined with step 3\n\n // step 2\n j = offset - 3;\n for (n = len + 4; n--; j += 2) {\n x[j] *= K_;\n }\n\n // step 1 & 3\n j = offset - 2;\n current = delta * x[j - 1];\n for (n = len + 3; n--; j += 2) {\n next = delta * x[j + 1];\n x[j] = K * x[j] - current - next;\n if (n--) {\n j += 2;\n current = delta * x[j + 1];\n x[j] = K * x[j] - current - next;\n } else {\n break;\n }\n }\n\n // step 4\n j = offset - 1;\n current = gamma * x[j - 1];\n for (n = len + 2; n--; j += 2) {\n next = gamma * x[j + 1];\n x[j] -= current + next;\n if (n--) {\n j += 2;\n current = gamma * x[j + 1];\n x[j] -= current + next;\n } else {\n break;\n }\n }\n\n // step 5\n j = offset;\n current = beta * x[j - 1];\n for (n = len + 1; n--; j += 2) {\n next = beta * x[j + 1];\n x[j] -= current + next;\n if (n--) {\n j += 2;\n current = beta * x[j + 1];\n x[j] -= current + next;\n } else {\n break;\n }\n }\n\n // step 6\n if (len !== 0) {\n j = offset + 1;\n current = alpha * x[j - 1];\n for (n = len; n--; j += 2) {\n next = alpha * x[j + 1];\n x[j] -= current + next;\n if (n--) {\n j += 2;\n current = alpha * x[j + 1];\n x[j] -= current + next;\n } else {\n break;\n }\n }\n }\n };\n\n return IrreversibleTransform;\n })();\n\n // Section 3.8.1 Reversible 5-3 filter\n var ReversibleTransform = (function ReversibleTransformClosure() {\n function ReversibleTransform() {\n Transform.call(this);\n }\n\n ReversibleTransform.prototype = Object.create(Transform.prototype);\n ReversibleTransform.prototype.filter =\n function reversibleTransformFilter(x, offset, length) {\n var len = length >> 1;\n offset = offset | 0;\n var j, n;\n\n for (j = offset, n = len + 1; n--; j += 2) {\n x[j] -= (x[j - 1] + x[j + 1] + 2) >> 2;\n }\n\n for (j = offset + 1, n = len; n--; j += 2) {\n x[j] += (x[j - 1] + x[j + 1]) >> 1;\n }\n };\n\n return ReversibleTransform;\n })();\n\n return JpxImage;\n})();\n\nexport {\n JpxImage,\n};\n"],"sourceRoot":""}