{"version":3,"sources":["webpack:///./node_modules/@zxing/library/umd/index.js","webpack:///./src/components/system/BarcodeScanner.vue?16d5","webpack:///./src/components/system/BarcodeScanner.vue?5886","webpack:///./src/components/system/BarcodeScanner.vue","webpack:///./src/components/system/BarcodeScanner.vue?d421","webpack:///./src/components/system/BarcodeScanner.vue?6735"],"names":["factory","exports","this","extendStatics","Object","setPrototypeOf","__proto__","Array","d","b","p","hasOwnProperty","__extends","__","constructor","prototype","create","fixProto","target","fixStack","fn","captureStackTrace","Error","DecodeHintType","CustomError","_super","message","_newTarget","_this","call","defineProperty","value","name","enumerable","Exception","super","ex","kind","ArgumentException","IllegalArgumentException","BinaryBitmap","binarizer","getWidth","getHeight","y","row","getBlackRow","matrix","undefined","getBlackMatrix","getLuminanceSource","isCropSupported","left","top","width","height","newSource","crop","createBinarizer","isRotateSupported","rotateCounterClockwise","rotateCounterClockwise45","toString","e","ChecksumException","Binarizer","source","System","src","srcPos","dest","destPos","length","Date","now","IndexOutOfBoundsException","ArrayIndexOutOfBoundsException","index","Arrays","a","val","i","len","fromIndex","toIndex","rangeCheck","arrayLength","args","rows","cols","arr","from","map","x","fill","Int32Array","first","second","result","element","original","newLength","slice","newArray","Uint8Array","set","to","copy","arraycopy","ar","el","comparator","numberComparator","m","n","k","cmp","Integer","intNumber","String","parseInt","dividend","divisor","Math","trunc","num","radix","MIN_VALUE_32_BITS","MAX_VALUE","Number","MAX_SAFE_INTEGER","BitArray","size","bits","makeArray","floor","newBits","bitsOffset","currentBits","numberOfTrailingZeros","start","end","firstInt","lastInt","firstBit","lastBit","mask","max","bit","ensureCapacity","numBits","numBitsLeft","appendBit","other","otherSize","get","bitOffset","array","offset","numBytes","theByte","j","oldBitsLen","leftOffset","currentInt","nextInt","o","equals","hashCode","CharacterSetValueIdentifiers","DecodeHintType$1","FormatException","CharacterSetECI","valueIdentifier","valuesParam","otherEncodingNames","values","VALUE_IDENTIFIER_TO_ECI","NAME_TO_ECI","v","VALUES_TO_ECI","otherName","characterSet","getName","Map","Cp437","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","SJIS","Cp1250","Cp1251","Cp1252","Cp1256","UnicodeBigUnmarked","UTF8","ASCII","Big5","GB18030","EUC_KR","UnsupportedOperationException","StringEncoding","bytes","encoding","encodingName","customDecoder","TextDecoder","shouldDecodeOnFallback","decodeFallback","decode","isBrowser","s","customEncoder","TextEncoder","encodeFallback","encode","window","getCharacterSetECIByName","encodingCharacterSet","isDecodeFallbackSupported","h","decodeURIComponent","fromCharCode","apply","Uint16Array","buffer","encodedURIstring","btoa","unescape","encodeURIComponent","charList","split","uintArray","push","charCodeAt","StringUtils","code","ISO88591","hints","CHARACTER_SET","canBeISO88591","canBeShiftJIS","canBeUTF8","utf8BytesLeft","utf2BytesChars","utf3BytesChars","utf4BytesChars","sjisBytesLeft","sjisKatakanaChars","sjisCurKatakanaWordLength","sjisCurDoubleBytesWordLength","sjisMaxKatakanaWordLength","sjisMaxDoubleBytesWordLength","isoHighOther","utf8bom","ASSUME_SHIFT_JIS","SHIFT_JIS","PLATFORM_DEFAULT_ENCODING","append","callback","exp","p0","p1","p2","p3","p4","substr","base","parseFloat","toFixed","toPrecision","toExponential","JSON","stringify","ch","regex","replace","str","charCode","GB2312","EUC_JP","StringBuilder","castAsNonUtf8Char","charAt","substring","c","BitMatrix","rowSize","image","imageI","stringRepresentation","setString","unsetString","bitsPos","rowStartPos","rowLength","nRows","pos","getRowSize","rowArray","getRow","getBitArray","right","bottom","getSize","clear","setBulk","topRow","bottomRow","reverse","setRow","x32","theBits","hash","lineSeparator","buildToString","NotFoundException","GlobalHistogramBinarizer","luminances","EMPTY","buckets","LUMINANCE_BUCKETS","initArrays","localLuminances","localBuckets","LUMINANCE_SHIFT","blackPoint","estimateBlackPoint","center","pixel","getMatrix","luminanceSize","Uint8ClampedArray","numBuckets","maxBucketCount","firstPeak","firstPeakSize","secondPeak","secondPeakScore","distanceToBiggest","score","temp","bestValley","bestValleyScore","fromFirst","LUMINANCE_BITS","HybridBinarizer","MINIMUM_DIMENSION","subWidth","BLOCK_SIZE_POWER","BLOCK_SIZE_MASK","subHeight","blackPoints","calculateBlackPoints","newMatrix","calculateThresholdForBlock","maxYOffset","BLOCK_SIZE","maxXOffset","yoffset","cap","xoffset","sum","z","blackRow","average","thresholdBlock","min","threshold","stride","yy","xx","MIN_DYNAMIC_RANGE","averageNeighborBlackPoint","LuminanceSource","sourceRow","luminance","InvertedLuminanceSource","delegate","invertedMatrix","HTMLCanvasElementLuminanceSource","canvas","tempCanvasElement","makeBufferFromCanvasImageData","imageData","getContext","getImageData","toGrayscaleBuffer","data","imageBuffer","grayscaleBuffer","gray","alpha","pixelR","pixelG","pixelB","rotate","ownerDocument","createElement","angle","getTempCanvasElement","tempContext","angleRadians","DEGREE_TO_RADIANS","newWidth","ceil","abs","cos","sin","newHeight","translate","drawImage","PI","VideoInputDevice","deviceId","label","groupId","BarcodeFormat","__awaiter","globalThis","global","self","thisArg","_arguments","P","generator","adopt","resolve","Promise","reject","fulfilled","step","next","rejected","done","then","BrowserCodeReader","reader","timeBetweenScansMillis","_hints","_stopContinuousDecode","_stopAsyncDecode","_timeBetweenDecodingAttempts","navigator","hasNavigator","mediaDevices","isMediaDevicesSuported","enumerateDevices","millis","canEnumerateDevices","devices","videoDevices","device","id","videoDevice","listVideoInputDevices","find","videoSource","decodeOnceFromVideoDevice","videoConstraints","reset","exact","facingMode","constraints","video","decodeOnceFromConstraints","stream","getUserMedia","decodeOnceFromStream","attachStreamToVideo","decodeOnce","callbackFn","decodeFromVideoDevice","decodeFromConstraints","decodeFromStream","decodeContinuously","videoElement","prepareVideoElement","addVideoSource","playVideoOnLoadAsync","playVideoOnLoad","videoEndedListener","stopStreams","videoCanPlayListener","tryPlayVideo","addEventListener","currentTime","paused","ended","readyState","isVideoPlaying","console","warn","play","_a","mediaElementId","type","mediaElement","document","getElementById","nodeName","toLowerCase","url","decodeFromImageUrl","decodeFromImageElement","decodeFromVideoUrl","decodeFromVideoElement","decodeFromVideoUrlContinuously","decodeFromVideoElementContinuously","prepareImageElement","task","imageElement","isImageLoaded","_decodeOnLoadImage","_decodeFromVideoElementSetup","_decodeOnLoadVideo","_decodeOnLoadVideoContinuously","decodeTask","imageLoadedListener","img","complete","naturalWidth","imageSource","getMediaElement","HTMLImageElement","HTMLVideoElement","setAttribute","retryIfNotFound","retryIfChecksumOrFormatError","loop","ifNotFound","isChecksumOrFormatError","ifChecksumOrFormat","setTimeout","isNotFound","binaryBitmap","createBinaryBitmap","decodeBitmap","ctx","getCaptureCanvasContext","drawImageOnCanvas","getCaptureCanvas","luminanceSource","hybridBinarizer","captureCanvasContext","elem","captureCanvas","createCaptureCanvas","canvasElementContext","srcElement","_destroyCaptureCanvas","canvasElement","videoWidth","videoHeight","naturalHeight","style","getVideoTracks","forEach","t","stop","stopAsyncDecode","stopContinuousDecode","_destroyVideoElement","_destroyImageElement","removeEventListener","videoPlayingEventListener","cleanVideoSource","removeAttribute","srcObject","err","URL","createObjectURL","Result","text","rawBytes","resultPoints","format","timestamp","currentTimeMillis","resultMetadata","metadata","newPoints","oldPoints","allPoints","ResultMetadataType","BarcodeFormat$1","Table","Mode","ErrorCorrectionLevelValues","DataMaskValues","ModeValues","Mode$2","ResultMetadataType$1","DecoderResult","byteSegments","ecLevel","structuredAppendSequenceNumber","structuredAppendParity","errorsCorrected","erasures","AbstractGenericGF","expTable","logTable","GenericGFPoly","field","coefficients","coefficientsLength","firstNonZero","degree","getCoefficient","coefficient","addOrSubtract","multiply","isZero","smallerCoefficients","largerCoefficients","sumDiff","lengthDiff","getZero","aCoefficients","aLength","bCoefficients","bLength","product","aCoeff","scalar","quotient","remainder","denominatorLeadingTerm","getDegree","inverseDenominatorLeadingTerm","inverse","degreeDifference","scale","term","multiplyByMonomial","iterationQuotient","buildMonomial","alphaPower","log","ArithmeticException","GenericGF","primitive","generatorBase","zero","one","toHexString","AZTEC_DATA_12","AZTEC_DATA_10","AZTEC_DATA_6","AZTEC_PARAM","QR_CODE_FIELD_256","DATA_MATRIX_FIELD_256","AZTEC_DATA_8","MAXICODE_FIELD_64","ReedSolomonException","IllegalStateException","ReedSolomonDecoder","received","twoS","poly","syndromeCoefficients","noError","evalResult","evaluateAt","getGeneratorBase","syndrome","sigmaOmega","runEuclideanAlgorithm","sigma","omega","errorLocations","findErrorLocations","errorMagnitudes","findErrorMagnitudes","position","R","rLast","r","tLast","getOne","rLastLast","tLastLast","q","dltInverse","degreeDiff","sigmaTildeAtZero","multiplyScalar","errorLocator","numErrors","errorEvaluator","xiInverse","denominator","termPlus1","Decoder","detectorResult","ddata","getBits","rawbits","extractBits","correctedBits","correctBits","convertBoolArrayToByteArray","getEncodedData","decoderResult","setNumBits","endIndex","latchTable","UPPER","shiftTable","BINARY","readCode","charCount","DIGIT","getCharacter","startsWith","getTable","LOWER","PUNCT","MIXED","table","UPPER_TABLE","LOWER_TABLE","MIXED_TABLE","PUNCT_TABLE","DIGIT_TABLE","gf","codewordSize","getNbLayers","numDataCodewords","getNbDatablocks","numCodewords","dataWords","rsDecoder","stuffedBits","dataWord","compact","isCompact","layers","baseMatrixSize","alignmentMap","totalBitsInLayer","matrixSize","truncDivision","origCenter","newOffset","rowOffset","low","high","columnOffset","startIndex","res","boolArr","byteArr","readByte","MathUtils","NaN","MIN_SAFE_INTEGER","aX","aY","bX","bY","xDiff","yDiff","sqrt","count","Float","f","ResultPoint","otherPoint","floatToIntBits","patterns","zeroOneDistance","distance","oneTwoDistance","zeroTwoDistance","pointA","pointB","pointC","crossProductZ","pattern1","pattern2","DetectorResult","points","AztecDetectorResult","nbDatablocks","nbLayers","WhiteRectangleDetector","initSize","INIT_SIZE","halfsize","leftInit","rightInit","upInit","downInit","up","down","sizeExceeded","aBlackPointFoundOnBorder","atLeastOneBlackPointFoundOnBorder","atLeastOneBlackPointFoundOnRight","atLeastOneBlackPointFoundOnBottom","atLeastOneBlackPointFoundOnLeft","atLeastOneBlackPointFoundOnTop","rightBorderNotWhite","containsBlackPoint","bottomBorderNotWhite","leftBorderNotWhite","topBorderNotWhite","maxSize","getBlackPointOnSegment","centerEdges","dist","round","xStep","yStep","yi","getX","yj","getY","zi","zj","xi","xj","ti","tj","CORR","fixed","horizontal","GridSampler","nudged","PerspectiveTransform","a11","a21","a31","a12","a22","a32","a13","a23","a33","x0","y0","x1","y1","x2","y2","x3","y3","x0p","y0p","x1p","y1p","x2p","y2p","x3p","y3p","qToS","quadrilateralToSquare","sToQ","squareToQuadrilateral","times","xValues","yValues","dx3","dy3","dx1","dx2","dy1","dy2","buildAdjoint","DefaultGridSampler","dimensionX","dimensionY","p1ToX","p1ToY","p2ToX","p2ToY","p3ToX","p3ToY","p4ToX","p4ToY","p1FromX","p1FromY","p2FromX","p2FromY","p3FromX","p3FromY","p4FromX","p4FromY","transform","quadrilateralToQuadrilateral","sampleGridWithTransform","Float32Array","iValue","transformPoints","checkAndNudgePoints","aioobe","GridSamplerInstance","newGridSampler","gridSampler","Point","Detector","EXPECTED_CORNER_BITS","detectMirror","isMirror","pCenter","getMatrixCenter","bullsEyeCorners","getBullsEyeCorners","extractParameters","sampleGrid","shift","corners","getMatrixCornerPoints","nbDataBlocks","isValidPoint","nbCenterLayers","sides","sampleLine","getRotation","parameterData","side","correctedData","getCorrectedParameterData","cornerBits","idx","bitCount","numECCodewords","parameterWords","ignored","pina","pinb","pinc","pind","color","pouta","getFirstDifferent","poutb","poutc","poutd","distancePoint","isWhiteOrBlackRectangle","pinax","pinbx","pincx","pindx","expandSquare","pointD","cornerPoints","detect","cx","cy","toResultPoint","getDimension","topLeft","topRight","bottomRight","bottomLeft","sampler","getInstance","dimension","distanceResultPoint","moduleSize","px","py","dx","dy","corr","cInit","getColor","error","colorModel","iMax","errRatio","init","isValid","oldSide","newSide","ratio","centerx","centery","result0","result2","result1","result3","results","point","AztecReader","exception","detector","getPoints","reportFoundResultPoints","getText","getRawBytes","getNumBits","AZTEC","getByteSegments","putMetadata","BYTE_SEGMENTS","getECLevel","ERROR_CORRECTION_LEVEL","rpcb","NEED_RESULT_POINT_CALLBACK","foundPossibleResultPoint","BrowserAztecCodeReader","OneDReader","doDecode","nfe","tryHarder","TRY_HARDER","rotatedImage","getResultMetadata","orientation","ORIENTATION","getResultPoints","rowStep","maxLines","middle","rowStepsAboveOrBelow","isAbove","rowNumber","attempt","newHints","hint","key","delete","decodeRow","re","counters","numCounters","isWhite","counterPosition","numTransitionsLeft","last","recordPattern","pattern","maxIndividualVariance","total","patternLength","POSITIVE_INFINITY","unitBarWidth","totalVariance","counter","scaledPattern","variance","Code128Reader","getNextSet","patternStart","bestVariance","MAX_AVG_VARIANCE","bestMatch","startCode","CODE_START_A","CODE_START_C","patternMatchVariance","CODE_PATTERNS","MAX_INDIVIDUAL_VARIANCE","isRange","convertFNC1","ASSUME_GS1","startPatternInfo","findStartPattern","currentRawCodesIndex","rawCodes","codeSet","CODE_CODE_A","CODE_START_B","CODE_CODE_B","CODE_CODE_C","isNextShifted","lastStart","nextStart","lastCode","checksumTotal","multiplier","lastCharacterWasPrintable","upperMode","shiftUpperMode","unshift","decodeCode","CODE_STOP","reduce","previous","current","CODE_FNC_1","CODE_FNC_2","CODE_FNC_3","CODE_FNC_4_A","CODE_SHIFT","CODE_FNC_4_B","lastPatternSize","getNextUnset","resultLength","rawCodesSize","CODE_128","getTime","Code39Reader","usingCheckDigit","extendedMode","decodeRowResult","theCounters","decodedChar","findAsteriskPattern","toNarrowWidePattern","patternToChar","resultString","whiteSpaceAfterEnd","ALPHABET_STRING","indexOf","decodeExtended","CODE_39","ASTERISK_ENCODING","copyWithin","wideCounters","maxNarrowCounter","minCounter","totalWideCountersWidth","CHARACTER_ENCODINGS","encoded","decoded","ITFReader","arguments","narrowLineWidth","startRange","decodeStart","endRange","decodeEnd","decodeMiddle","allowedLengths","ALLOWED_LENGTHS","DEFAULT_ALLOWED_LENGTHS","lengthOK","maxAllowedLength","resultReturn","ITF","payloadStart","payloadEnd","counterDigitPair","counterBlack","counterWhite","twoK","decodeDigit","counterDigit","endStart","skipWhiteSpace","startPattern","findGuardPattern","START_PATTERN","validateQuietZone","quietCount","endPattern","END_PATTERN_REVERSED","PATTERNS","AbstractUPCEANReader","decodeRowStringBuffer","foundStart","START_END_PATTERN","quietStart","checkStandardUPCEANChecksum","check","getStandardUPCEANChecksum","digit","whiteFirst","MIDDLE_PATTERN","END_PATTERN","L_PATTERNS","UPCEANExtension5Support","CHECK_DIGIT_ENCODINGS","decodeMiddleCounters","extensionStartRange","extensionData","parseExtensionString","extensionResult","UPC_EAN_EXTENSION","putAllMetadata","lgPatternFound","L_AND_G_PATTERNS","checkDigit","determineCheckDigit","extensionChecksum","raw","parseExtension5String","SUGGESTED_PRICE","currency","rawAmount","unitsString","hundredths","hundredthsString","UPCEANExtension2Support","checkParity","ISSUE_NUMBER","UPCEANExtensionSupport","EXTENSION_START_PATTERN","fiveSupport","twoSupport","UPCEANReader","widths","reversedWidths","startGuardRange","findStartGuardPattern","resultPointCallback","resultPoint","budello","quietEnd","checkChecksum","getBarcodeFormat","decodeResult","extensionLength","addResultPoints","allowedExtensions","ALLOWED_EAN_EXTENSIONS","valid","EAN_13","UPC_A","EAN13Reader","determineFirstDigit","middleRange","FIRST_DIGIT_ENCODINGS","EAN8Reader","EAN_8","UPCAReader","ean13Reader","maybeReturnResult","upcaResult","UPCEReader","determineNumSysAndCheckDigit","findGuardPatternWithoutCounters","MIDDLE_END_PATTERN","convertUPCEtoUPCA","numSys","NUMSYS_AND_CHECK_DIGIT_PATTERNS","insert","getNotFoundInstance","UPC_E","upce","upceChars","lastChar","appendChars","MultiFormatUPCEANReader","possibleFormats","POSSIBLE_FORMATS","readers","ean13MayBeUPCA","canReturnUPCA","includes","resultUPCA","AbstractRSSReader","decodeFinderCounters","dataCharacterCounters","oddRoundingErrors","evenRoundingErrors","oddCounts","evenCounts","finderPatterns","errors","biggestError","firstTwoSum","MIN_FINDER_PATTERN_RATIO","MAX_FINDER_PATTERN_RATIO","maxCounter","DataCharacter","checksumPortion","that","FinderPattern","startEnd","RSSUtils","maxWidth","noNarrow","narrowMask","elements","bar","elmWidth","subVal","combins","lessVal","mxwElement","maxDenom","minDenom","BitArrayBuilder","pairs","charNumber","getRightChar","binary","accPos","firstPair","firstValue","getValue","currentPair","leftValue","getLeftChar","rightValue","BlockParsedResult","finished","decodedInformation","DecodedObject","newPosition","DecodedChar","FNC1","DecodedInformation","newString","remainingValue","remaining","DecodedNumeric","firstDigit","secondDigit","FieldParser","rawInformation","firstTwoDigits","dataLength","TWO_DIGIT_DATA_LENGTH","VARIABLE_LENGTH","processVariableAI","processFixedAI","firstThreeDigits","THREE_DIGIT_DATA_LENGTH","THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH","firstFourDigits","FOUR_DIGIT_DATA_LENGTH","aiSize","fieldSize","ai","parsedAI","parseFieldsInGeneralPurpose","variableFieldSize","GeneralAppIdDecoder","information","buff","initialPosition","currentPosition","info","decodeGeneralPurposeField","parsedFields","getNewString","isRemaining","getRemainingValue","getNewPosition","numeric","extractNumericValueFromBitArray","digit1","digit2","setLengthToZero","setPosition","lastDecoded","parseBlocks","getPosition","isFinished","isAlpha","parseAlphaBlock","isIsoIec646","parseIsoIec646Block","parseNumericBlock","positionChanged","getDecodedInformation","isStillNumeric","decodeNumeric","isFirstDigitFNC1","isSecondDigitFNC1","getSecondDigit","getFirstDigit","isNumericToAlphaNumericLatch","setAlpha","incrementPosition","isStillIsoIec646","iso","decodeIsoIec646","isFNC1","isAlphaOr646ToNumericLatch","setNumeric","isAlphaTo646ToAlphaLatch","isStillAlpha","decodeAlphanumeric","setIsoIec646","fiveBitValue","sevenBitValue","eightBitValue","sixBitValue","AbstractExpandedDecoder","generalDecoder","AI01decoder","buf","currentPos","encodeCompressedGtinWithoutAI","initialBufferPosition","currentBlock","getGeneralDecoder","appendCheckDigit","GTIN_SIZE","AI01AndOtherAIs","initialGtinPosition","firstGtinDigit","HEADER_SIZE","decodeAllCodes","AnyAIDecoder","AI01weightDecoder","weightSize","originalWeightNumeric","addWeightCode","weightNumeric","checkWeight","currentDivisor","AI013x0xDecoder","getInformation","WEIGHT_SIZE","encodeCompressedGtin","encodeCompressedWeight","AI013103decoder","weight","AI01320xDecoder","AI01392xDecoder","lastAIdigit","LAST_DIGIT_SIZE","AI01393xDecoder","FIRST_THREE_DIGITS_SIZE","generalInformation","AI013x0x1xDecoder","firstAIdigits","dateCode","DATE_SIZE","encodeCompressedDate","numericDate","day","month","year","createDecoder","fourBitEncodationMethod","fiveBitEncodationMethod","sevenBitEncodationMethod","ExpandedPair","leftChar","rightChar","finderPatter","mayBeLast","leftchar","rightchar","finderpattern","maybeLast","o1","o2","equalsOrNull","ExpandedRow","wasReversed","otherPairs","checkEqualitity","pair1","pair2","e1","e2","getFinderPatter","RSSExpandedReader","MAX_PAIRS","startFromEven","constructResult","decodeRow2pairs","tryStackedDecode","retrieveNextPair","storeRow","ps","checkRowsBoolean","checkRows","collectedRows","currentRow","collectedRow","getPairs","isValidSequence","rs","sequence","FINDER_PATTERN_SEQUENCES","getFinderPattern","insertPos","prevIsSame","nextIsSame","erow","getRowNumber","isEquivalent","isPartialRow","removePartialRows","pp","allFound","found","buildBitArray","decoder","resultingString","parseInformation","firstPoints","lastPoints","RSS_EXPANDED","checkCharacter","firstCharacter","checksum","getChecksumPortion","currentRightChar","checkCharacterValue","initialPos","previousPairs","isOddPattern","keepFinding","forcedOffset","findNextPair","parseFoundFinderPattern","getNextSecondBar","decodeDataCharacter","isEmptyPair","mustBeLast","getDecodeFinderCounters","lastPair","getStartEnd","searchingEvenPair","reverseCounters","isFinderPattern","tmp","oddPattern","firstCounter","firstElementStart","parseFinderValue","FINDER_PATTERNS","getDataCharacterCounters","recordPatternInReverse","numModules","elementWidth","expectedElementWidth","getOddCounts","getEvenCounts","getOddRoundingErrors","getEvenRoundingErrors","adjustOddEvenCounts","weightRowNumber","oddSum","oddChecksumPortion","isNotA1left","WEIGHTS","evenChecksumPortion","group","oddWidest","SYMBOL_WIDEST","evenWidest","vOdd","getRSSvalue","vEven","tEven","EVEN_TOTAL_SUBSET","gSum","GSUM","evenSum","incrementOdd","decrementOdd","incrementEven","decrementEven","mismatch","oddParityBad","evenParityBad","increment","decrement","FINDER_PAT_A","FINDER_PAT_B","FINDER_PAT_C","FINDER_PAT_D","FINDER_PAT_E","FINDER_PAT_F","Pair","finderPattern","RSS14Reader","possibleLeftPairs","possibleRightPairs","leftPair","decodePair","addOrTally","rightPair","getCount","possiblePairs","pair","incrementCount","symbolValue","leftPoints","rightPoints","RSS_14","checkValue","targetCheckValue","findFinderPattern","outside","inside","outsideChar","OUTSIDE_ODD_WIDEST","OUTSIDE_EVEN_TOTAL_SUBSET","OUTSIDE_GSUM","INSIDE_ODD_WIDEST","tOdd","INSIDE_ODD_TOTAL_SUBSET","INSIDE_GSUM","rightFinderPattern","firstIsBlack","MultiFormatOneDReader","useCode39CheckDigit","ASSUME_CODE_39_CHECK_DIGIT","BrowserBarcodeReader","ECBlocks","ecCodewords","ecBlocks1","ecBlocks2","ecBlocks","ECB","dataCodewords","Version","versionNumber","symbolSizeRows","symbolSizeColumns","dataRegionSizeRows","dataRegionSizeColumns","getECCodewords","ecbArray","getECBlocks","ecBlock","getDataCodewords","totalCodewords","numRows","numColumns","version","VERSIONS","buildVersions","BitMatrixParser","bitMatrix","readVersion","mappingBitMatrix","extractDataRegion","readMappingMatrix","getVersionForDimensions","Int8Array","getTotalCodewords","resultOffset","column","corner1Read","corner2Read","corner3Read","corner4Read","readUtah","readCorner4","readCorner3","readCorner2","readCorner1","currentByte","readModule","getSymbolSizeRows","getSymbolSizeColumns","getDataRegionSizeRows","getDataRegionSizeColumns","numDataRegionsRow","numDataRegionsColumn","sizeDataRegionRow","sizeDataRegionColumn","bitMatrixWithoutAlignment","dataRegionRow","dataRegionRowOffset","dataRegionColumn","dataRegionColumnOffset","readRowOffset","writeRowOffset","readColumnOffset","writeColumnOffset","DataBlock","codewords","rawCodewords","totalBlocks","ecBlockArray","numResultBlocks","numBlockCodewords","longerBlocksTotalCodewords","longerBlocksNumDataCodewords","shorterBlocksNumDataCodewords","rawCodewordsOffset","specialVersion","getVersionNumber","numLongerBlocks","jOffset","iOffset","BitSource","byteOffset","available","bitsLeft","toRead","bitsToNotRead","DecodedBitStreamParser","resultTrailer","mode","ASCII_ENCODE","decodeAsciiSegment","C40_ENCODE","decodeC40Segment","TEXT_ENCODE","decodeTextSegment","ANSIX12_ENCODE","decodeAnsiX12Segment","EDIFACT_ENCODE","decodeEdifactSegment","BASE256_ENCODE","decodeBase256Segment","PAD_ENCODE","upperShift","oneByte","readBits","cValues","firstByte","parseTwoBytes","cValue","C40_BASIC_SET_CHARS","c40char","C40_SHIFT2_SET_CHARS","TEXT_BASIC_SET_CHARS","textChar","TEXT_SHIFT2_SET_CHARS","TEXT_SHIFT3_SET_CHARS","secondByte","fullBitValue","edifactValue","getBitOffset","codewordPosition","getByteOffset","d1","unrandomize255State","uee","randomizedBase256Codeword","base256CodewordPosition","pseudoRandomNumber","tempVariable","Decoder$1","parser","getVersion","readCodewords","dataBlocks","getDataBlocks","totalBytes","db","getNumDataCodewords","resultBytes","dataBlocksCount","dataBlock","codewordBytes","getCodewords","correctErrors","codewordsInts","Detector$1","rectangleDetector","detectSolid1","detectSolid2","correctTopRight","shiftToModuleCenter","dimensionTop","transitionsBetween","dimensionRight","div","fromX","fromY","trAB","trBC","trCD","trDA","tr","pointBs","shiftPoint","pointCs","trBA","trTop","trRight","pointAs","candidate1","candidate2","sumc1","sumc2","dimH","dimV","pointDs","centerX","centerY","moveAway","toX","toY","steep","ystep","xstep","transitions","inBlack","isBlack","DataMatrixReader","has","PURE_BARCODE","extractPureBits","NO_POINTS","DATA_MATRIX","leftTopBlack","getTopLeftOnBit","rightBottomBlack","getBottomRightOnBit","matrixWidth","matrixHeight","nudge","BrowserDatamatrixCodeReader","ErrorCorrectionLevel","stringValue","FOR_BITS","FOR_VALUE","L","M","Q","H","FormatInformation","formatInfo","errorCorrectionLevel","forBits","dataMask","maskedFormatInfo1","maskedFormatInfo2","doDecodeFormatInformation","FORMAT_INFO_MASK_QR","bestDifference","bestFormatInfo","decodeInfo","FORMAT_INFO_DECODE_LOOKUP","targetInfo","bitsDifference","numBitsDiffering","ECBlocks$1","ecCodewordsPerBlock","getNumBlocks","ECB$1","Version$1","alignmentPatternCenters","getECCodewordsPerBlock","getVersionForNumber","versionBits","bestVersion","VERSION_DECODE_INFO","targetVersion","getDimensionForVersion","setRegion","DataMask","isMasked","flip","DATA_MASK_000","DATA_MASK_001","DATA_MASK_010","DATA_MASK_011","DATA_MASK_100","DATA_MASK_101","DATA_MASK_110","DATA_MASK_111","BitMatrixParser$1","parsedFormatInfo","formatInfoBits1","copyBit","formatInfoBits2","jMin","decodeFormatInformation","parsedVersion","provisionalVersion","ijMin","theParsedVersion","decodeVersionInformation","readFormatInformation","getDataMask","unmaskBitMatrix","functionPattern","buildFunctionPattern","readingUp","bitsRead","col","DataBlock$1","getECBlocksForLevel","shorterBlocksTotalCodewords","longerBlocksStartAt","Mode$1","characterCountBitsForVersions","TERMINATOR","NUMERIC","ALPHANUMERIC","STRUCTURED_APPEND","BYTE","ECI","KANJI","FNC1_FIRST_POSITION","FNC1_SECOND_POSITION","HANZI","DecodedBitStreamParser$1","symbolSequence","parityData","currentCharacterSetECI","fc1InEffect","modeBits","parseECIValue","getCharacterSetECIByValue","subset","countHanzi","getCharacterCountBits","GB2312_SUBSET","decodeHanziSegment","decodeNumericSegment","decodeAlphanumericSegment","decodeByteSegment","decodeKanjiSegment","iae","twoBytes","assembledTwoBytes","readBytes","guessEncoding","ALPHANUMERIC_CHARS","nextTwoCharsBits","toAlphaNumericChar","deleteCharAt","setCharAt","threeDigitsBits","twoDigitsBits","digitBits","secondThirdBytes","QRCodeDecoderMetaData","mirrored","Decoder$2","decodeBitMatrix","parseFromBooleanArray","decodeBitMatrixParser","remask","setMirror","mirror","setOther","getErrorCorrectionLevel","AlignmentPattern","posX","posY","estimatedModuleSize","moduleSizeDiff","newModuleSize","combinedX","combinedY","combinedModuleSize","AlignmentPatternFinder","startX","startY","possibleCenters","crossCheckStateCount","maxJ","middleI","stateCount","iGen","currentState","foundPatternCross","confirmed","handlePossibleCenter","maxVariance","startI","centerJ","maxCount","originalStateCountTotal","maxI","stateCountTotal","centerFromEnd","centerI","crossCheckVertical","isNaN","aboutEquals","combineEstimate","FinderPattern$1","combinedCount","FinderPatternInfo","patternCenters","FinderPatternFinder","pureBarcode","iSkip","MAX_MODULES","MIN_SKIP","hasSkipped","haveMultiplyConfirmedCenters","rowSkip","findRowSkip","patternInfo","selectBestPatterns","orderBestPatterns","totalModuleSize","getCrossCheckStateCount","startJ","crossCheckHorizontal","crossCheckDiagonal","firstConfirmedCenter","CENTER_QUORUM","confirmedCount","getEstimatedModuleSize","totalDeviation","startSize","square","stdDev","sort","center1","center2","dA","dB","limit","splice","possibleCenter","Detector$2","finder","processFinderPatternInfo","getTopLeft","getTopRight","getBottomLeft","calculateModuleSize","computeDimension","getProvisionalVersionForDimension","modulesBetweenFPCenters","alignmentPattern","getAlignmentPatternCenters","bottomRightX","bottomRightY","correctionToTopLeft","estAlignmentX","estAlignmentY","findAlignmentInRegion","createTransform","dimMinusThree","sourceBottomRightX","sourceBottomRightY","tltrCentersDimension","tlblCentersDimension","calculateModuleSizeOneWay","otherPattern","moduleSizeEst1","sizeOfBlackWhiteBlackRunBothWays","moduleSizeEst2","sizeOfBlackWhiteBlackRun","otherToX","otherToY","state","xLimit","realX","realY","overallEstModuleSize","allowanceFactor","allowance","alignmentAreaLeftX","alignmentAreaRightX","alignmentAreaTopY","alignmentAreaBottomY","alignmentFinder","QRCodeReader","getOther","applyMirroredCorrection","QR_CODE","hasStructuredAppend","STRUCTURED_APPEND_SEQUENCE","getStructuredAppendSequenceNumber","STRUCTURED_APPEND_PARITY","getStructuredAppendParity","nudgedTooFarRight","nudgedTooFarDown","PDF417Common","moduleBitCount","list","EMPTY_INT_ARRAY","integer","symbol","binarySearch","SYMBOL_TABLE","CODEWORD_TABLE","NUMBER_OF_CODEWORDS","MAX_CODEWORDS_IN_BARCODE","MIN_ROWS_IN_BARCODE","MAX_ROWS_IN_BARCODE","MODULES_IN_CODEWORD","MODULES_IN_STOP_PATTERN","BARS_IN_MODULE","PDF417DetectorResult","Detector$3","multiple","barcodeCoordinates","clone","rotate180","foundBarcodeInRow","vertices","findVertices","barcodeCoordinate","ROW_STEP","startRow","startColumn","copyToResult","findRowsWithPattern","INDEXES_START_PATTERN","STOP_PATTERN","INDEXES_STOP_PATTERN","tmpResult","destinationIndexes","loc","previousRowLoc","stopRow","skippedRowCount","MAX_PATTERN_DRIFT","SKIPPED_ROW_COUNT_MAX","BARCODE_MIN_HEIGHT","fillWithin","pixelDrift","MAX_PIXEL_DRIFT","Infinity","ModulusPoly","add","negative","multiplyOther","negativeCoefficients","subtract","ModulusBase","modulus","ModulusGF","PDF417_GF","ErrorCorrection","S","evaluation","knownErrors","erasure","getChecksumInstance","errorLocatorDegree","formalDerivativeCoefficients","formalDerivative","numerator","BoundingBox","constructor_2","constructor_1","leftUnspecified","rightUnspecified","minX","maxX","minY","maxY","boundingBox","getBottomRight","getMinX","getMaxX","getMinY","getMaxY","leftBox","rightBox","missingStartRows","missingEndRows","isLeft","newTopLeft","newBottomLeft","newTopRight","newBottomRight","newMinY","newTop","newMaxY","newBottom","BarcodeMetadata","columnCount","rowCountUpperPart","rowCountLowerPart","rowCount","Formatter","form","DetectionResultColumn","imageRow","codeword","getCodeword","MAX_NEARBY_DISTANCE","nearImageRow","imageRowToCodewordIndex","formatter","BarcodeValue","confidence","maxConfidence","entries","entry","getKey","toIntArray","DetectionResultRowIndicatorColumn","_isLeft","setRowNumberAsRowIndicatorColumn","barcodeMetadata","setRowNumbers","removeIncorrectCodewords","getBoundingBox","firstRow","lastRow","barcodeRow","maxRowHeight","currentRowHeight","codewordsRow","rowDifference","getRowCount","checkedRows","closePreviousCodewordFound","getBarcodeMetadata","adjustIncompleteIndicatorColumnRowNumbers","barcodeColumnCount","barcodeRowCountUpperPart","barcodeRowCountLowerPart","barcodeECLevel","rowIndicatorValue","codewordRowNumber","setValue","codewordRow","getRowCountUpperPart","getRowCountLowerPart","getColumnCount","DetectionResult","ADJUST_ROW_NUMBER_SKIP","detectionResultColumns","adjustIndicatorColumnRowNumbers","previousUnadjustedCount","unadjustedCodewordCount","adjustRowNumbersAndGetCount","detectionResultColumn","adjustCompleteIndicatorColumnRowNumbers","unadjustedCount","adjustRowNumbersByRow","barcodeColumn","hasValidRowNumber","adjustRowNumbers","adjustRowNumbersFromBothRI","adjustRowNumbersFromLRI","adjustRowNumbersFromRRI","LRIcodewords","RRIcodewords","setRowNumber","rowIndicatorRowNumber","invalidRowCounts","adjustRowNumberIfValid","isValidRowNumber","previousColumnCodewords","nextColumnCodewords","otherCodewords","otherCodeword","adjustRowNumber","getBucket","rowIndicatorColumn","Codeword","endX","bucket","BARCODE_ROW_UNKNOWN","PDF417CodewordDecoder","currentSymbol","currentBit","RATIOS_TABLE","fround","bSymbolTableReady","decodedValue","getDecodedCodewordValue","sampleBitCounts","getClosestDecodedValue","bitCountSum","bitCountIndex","sumPreviousBits","sampleIndex","getBitValue","bitCountRatios","bestMatchError","initialize","ratioTableRow","diff","PDF417ResultMetadata","segmentCount","fileSize","segmentIndex","fileId","optionalData","lastSegment","sender","addressee","fileName","Long","NullPointerException","OutputStream","writeBytesOffset","off","write","OutOfMemoryError","ByteArrayOutputStream","minCapacity","grow","oldCapacity","newCapacity","copyOfUint8Array","out","param","toString_string","toString_number","toString_void","charsetName","hibyte","getBigIntConstructor","BigInteger","createBigInt","getEXP900","EXP900","nineHundred","DecodedBitStreamParser$2","enableDecoding","codeIndex","TEXT_COMPACTION_MODE_LATCH","textCompaction","BYTE_COMPACTION_MODE_LATCH","BYTE_COMPACTION_MODE_LATCH_6","byteCompaction","MODE_SHIFT_TO_BYTE_COMPACTION_MODE","NUMERIC_COMPACTION_MODE_LATCH","numericCompaction","ECI_CHARSET","ECI_GENERAL_PURPOSE","ECI_USER_DEFINED","BEGIN_MACRO_PDF417_CONTROL_BLOCK","decodeMacroBlock","BEGIN_MACRO_PDF417_OPTIONAL_FIELD","MACRO_PDF417_TERMINATOR","getFormatInstance","NUMBER_OF_SEQUENCE_CODEWORDS","segmentIndexArray","setSegmentIndex","decodeBase900toBase10","setFileId","optionalFieldsStart","MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME","setFileName","MACRO_PDF417_OPTIONAL_FIELD_SENDER","setSender","MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE","setAddressee","MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT","setSegmentCount","MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP","setTimestamp","parseLong","MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM","setChecksum","MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE","setFileSize","setLastSegment","optionalFieldsLength","isLastSegment","setOptionalData","copyOfRange","textCompactionData","byteCompactionData","decodeTextCompaction","subMode","ALPHA","priorToShiftMode","subModeCh","LL","ML","PS","PUNCT_SHIFT","AS","ALPHA_SHIFT","PL","MIXED_CHARS","AL","PAL","PUNCT_CHARS","decodedBytes","byteCompactedCodewords","nextCode","toByteArray","numericCodewords","MAX_NUMERIC_CODEWORDS","PDF417ScanningDecoder","imageTopLeft","imageBottomLeft","imageTopRight","imageBottomRight","minCodewordWidth","maxCodewordWidth","detectionResult","leftRowIndicatorColumn","rightRowIndicatorColumn","firstPass","getRowIndicatorColumn","merge","resultBox","setBoundingBox","maxBarcodeColumn","getBarcodeColumnCount","setDetectionResultColumn","leftToRight","getDetectionResultColumn","previousStartColumn","getStartColumn","detectCodeword","setCodeword","createDecoderResult","adjustBoundingBox","rowHeights","getRowHeights","getMax","rowHeight","addMissingRows","maxValue","leftBarcodeMetadata","rightBarcodeMetadata","startPoint","getStartX","getEndX","barcodeMatrix","barcodeMatrix01","numberOfCodewords","calculatedNumberOfCodewords","getBarcodeRowCount","getNumberOfECCodeWords","getBarcodeECLevel","createBarcodeMatrix","adjustCodewordCount","ambiguousIndexValuesList","ambiguousIndexesList","codewordIndex","ambiguousIndexValues","createDecoderResultFromAmbiguousValues","erasureArray","ambiguousIndexes","ambiguousIndexCount","tries","decodeCodewords","getDetectionResultColumns","isValidBarcodeColumn","getCodewordNearby","skippedColumns","previousRowCodeword","minColumn","maxColumn","adjustCodewordStartColumn","endColumn","getModuleBitCount","codewordBitCount","tmpCount","checkCodewordSkew","getDecodedValue","getCodewordBucketNumber","imageColumn","moduleNumber","previousPixelValue","codewordStartColumn","correctedStartColumn","CODEWORD_SKEW_SIZE","correctedErrorsCount","verifyCodewordCount","setErrorsCorrected","setErasures","MAX_ERRORS","MAX_EC_CODEWORDS","errorCorrection","previousValue","getCodewordBucketNumber_Int32Array","getCodewordBucketNumber_number","getBitCountForCodeword","barcodeValue","getConfidence","PDF417Reader","detectMultiple","getMinCodewordWidth","getMaxCodewordWidth","PDF_417","pdf417ResultMetadata","PDF417_EXTRA_METADATA","getMaxWidth","getMinWidth","ReaderException","MultiFormatReader","setHints","decodeInternal","formats","addOneDReader","some","CODABAR","CODE_93","BrowserMultiFormatReader","decodeWithState","BrowserPDF417Reader","BrowserQRCodeReader","EncodeHintType","EncodeHintType$1","ReedSolomonEncoder","cachedGenerators","lastGenerator","nextGenerator","toEncode","ecBytes","dataBytes","buildGenerator","infoCoefficients","divide","getCoefficients","numZeroCoefficients","MaskUtil","applyMaskPenaltyRule1Internal","penalty","getArray","arrayY","N2","numPenalties","isWhiteHorizontal","isWhiteVertical","N3","numDarkCells","numTotalCells","fivePercentVariances","N4","maskPattern","intermediate","isHorizontal","iLimit","jLimit","numSameBitCells","prevBit","N1","ByteMatrix","aByte","bytesY","otherBytesY","QRCode","NUM_MASK_PATTERNS","WriterException","MatrixUtil","dataBits","clearMatrix","embedBasicPatterns","embedTypeInfo","maybeEmbedVersionInfo","embedDataBits","embedPositionDetectionPatternsAndSeparators","embedDarkDotAtLeftBottomCorner","maybeEmbedPositionAdjustmentPatterns","embedTimingPatterns","typeInfoBits","makeTypeInfoBits","coordinates","TYPE_INFO_COORDINATES","setBoolean","versionInfoBits","makeVersionInfoBits","bitIndex","direction","isEmpty","getDataMaskBit","numberOfLeadingZeros","msbSetInPoly","findMSBSet","isValidMaskPattern","typeInfo","appendBits","bchCode","calculateBCHCode","TYPE_INFO_POLY","maskBits","TYPE_INFO_MASK_PATTERN","xor","VERSION_INFO_POLY","setNumber","xStart","yStart","patternY","POSITION_ADJUSTMENT_PATTERN","POSITION_DETECTION_PATTERN","pdpWidth","embedPositionDetectionPattern","hspWidth","embedHorizontalSeparationPattern","vspSize","embedVerticalSeparationPattern","POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE","embedPositionAdjustmentPattern","BlockPair","errorCorrectionBytes","Encoder","applyMaskPenaltyRule1","applyMaskPenaltyRule2","applyMaskPenaltyRule3","applyMaskPenaltyRule4","content","DEFAULT_BYTE_MODE_ENCODING","hasEncodingHint","chooseMode","headerBits","eci","appendECI","appendModeInfo","appendBytes","QR_VERSION","bitsNeeded","calculateBitsNeeded","willFit","recommendVersion","headerAndDataBits","appendBitArray","numLetters","getSizeInBytes","appendLengthInfo","numDataBytes","getTotalECCodewords","terminateBits","finalBits","interleaveWithECBytes","qrCode","setECLevel","setMode","setVersion","chooseMaskPattern","setMaskPattern","buildMatrix","setMatrix","provisionalBitsNeeded","chooseVersion","ALPHANUMERIC_TABLE","isOnlyDoubleByteKanji","hasNumeric","hasAlphanumeric","isDigit","getAlphanumericCode","byte1","minPenalty","bestMaskPattern","calculateMaskPenalty","numInputBits","versionNum","numEcBytes","totalInputBytes","capacity","numBitsInLastByte","numPaddingBytes","numTotalBytes","numRSBlocks","blockID","numDataBytesInBlock","numECBytesInBlock","numRsBlocksInGroup2","numRsBlocksInGroup1","numTotalBytesInGroup1","numTotalBytesInGroup2","numDataBytesInGroup1","numDataBytesInGroup2","numEcBytesInGroup1","numEcBytesInGroup2","dataBytesOffset","maxNumDataBytes","maxNumEcBytes","blocks","numEcBytesInBlock","getNumDataBytesAndNumECBytesForBlockID","toBytes","generateECBytes","block","getDataBytes","getErrorCorrectionBytes","appendNumericBytes","appendAlphanumericBytes","append8BitBytes","appendKanjiBytes","singleCharacter","cn","getDigit","num1","num2","num3","code1","code2","byte2","subtracted","BrowserQRCodeSvgWriter","contents","quietZone","QUIET_ZONE_SIZE","ERROR_CORRECTION","fromString","MARGIN","renderResult","containerElement","querySelector","svgElement","appendChild","input","inputWidth","inputHeight","qrWidth","qrHeight","outputWidth","outputHeight","leftPadding","topPadding","createSVGElement","inputY","outputY","inputX","outputX","svgRectElement","createSvgRectElement","w","createElementNS","SVG_NS","setAttributeNS","rect","QRCodeWriter","output","MultiFormatWriter","writer","PlanarYUVLuminanceSource","yuvData","dataWidth","dataHeight","reverseHorizontal","area","inputOffset","outputOffset","THUMBNAIL_SCALE_FACTOR","pixels","yuv","grey","rowStart","RGBLuminanceSource","BYTES_PER_ELEMENT","luminancesUint8Array","g2","Charset","StandardCharsets","ISO_8859_1","AztecCode","codeWords","Collections","item","collection","Token","SimpleToken","bitArray","byteCount","toBinaryString","BinaryShiftToken","binaryShiftStart","binaryShiftByteCount","addBinaryShift","token","MODE_NAMES","MODE_UPPER","MODE_LOWER","MODE_DIGIT","MODE_MIXED","MODE_PUNCT","EMPTY_TOKEN","LATCH_TABLE","static_SHIFT_TABLE","SHIFT_TABLE","createInt32Array","State","binaryBytes","latch","latchModeBitCount","thisModeBitCount","deltaBitCount","endBinaryShift","newModeBitCount","calculateBinaryShiftCost","symbols","getPrevious","appendTo","static_CHAR_MAP","CHAR_MAP","spaceCharCode","getCharCode","pointCharCode","commaCharCode","zUpperCharCode","aUpperCharCode","zLowerCharCode","aLowerCharCode","nineCharCode","zeroCharCode","mixedTable","punctTable","INITIAL_STATE","HighLevelEncoder","lineBreakCharCode","states","singletonList","pairCode","nextChar","updateStateListForPair","updateStateListForChar","minState","getBitCount","toBitArray","updateStateForChar","simplifyStates","charInCurrentTable","getMode","stateNoBinary","charInMode","latchState","latchAndAppend","shiftState","shiftAndAppend","getBinaryShiftByteCount","binaryState","addBinaryShiftChar","updateStateForPair","digitState","newState","oldState","isBetterThanOrEqualTo","filter","Encoder$1","DEFAULT_EC_PERCENT","DEFAULT_AZTEC_LAYERS","minECCPercent","userSpecifiedLayers","wordSize","eccBits","totalSizeBits","MAX_NB_BITS_COMPACT","MAX_NB_BITS","WORD_SIZE","usableBitsInLayers","stuffBits","messageBits","generateCheckWords","messageSizeInWords","modeMessage","generateModeMessage","drawModeMessage","drawBullsEye","aztec","setCompact","setSize","setLayers","setCodeWords","totalBits","getGF","totalWords","messageWords","bitsToWords","startPad","messageWord","word","AztecWriter","encodeWithHints","charset","eccPercent","forName","AZTEC_LAYERS","encodeLayers","getBytes","AztecCodeReader","AztecCodeWriter","AztecDecoder","AztecDetector","AztecEncoder","AztecHighLevelEncoder","AztecPoint","DataMatrixDecodedBitStreamParser","PDF417DecodedBitStreamParser","PDF417DecoderErrorCorrection","QRCodeByteMatrix","QRCodeDataMask","QRCodeDecodedBitStreamParser","QRCodeDecoderErrorCorrectionLevel","QRCodeDecoderFormatInformation","QRCodeEncoder","QRCodeEncoderQRCode","QRCodeMaskUtil","QRCodeMatrixUtil","QRCodeMode","QRCodeVersion","ZXingArrays","ZXingCharset","ZXingInteger","ZXingStandardCharsets","ZXingStringBuilder","ZXingStringEncoding","ZXingSystem","createAbstractExpandedDecoder","render","_vm","_h","$createElement","_c","_self","staticStyle","_t","attrs","on","startScan","videoVisible","stopVideoHandler","_e","_v","staticRenderFns","codeReader","matchMedia","matches","lockScreenPortrait","inLandscape","startVideoHandler","$emit","pushBarcode","catch","fullScreenCheck","screen","lock","fullscreenElement","exitFullscreen","lockScreenFail","documentElement","requestFullscreen","inPortrait","alert","unlock","barcode","components","component","VBtn"],"mappings":"oGAAA,2BACmEA,EAAQC,IAD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,MACIzd,SAAS41E,mBACX51E,SAAS61E,iBAEXz1F,KAAK01F,iBAdT,mBAeW,GAfX,gEAjCF,sFAoDE,WACE,IAAI91E,SAAS41E,kBACb,OAAO51E,SAAS+1E,gBAAgBC,sBAtDpC,4BAyDE,WACE,IAAMC,EAAa3nF,OAAO2mF,WAAW,2BACjCgB,EAAWf,QACbgB,MACE,iHAGFA,MACE,2GAjER,8BAsEE,WACE91F,KAAK40F,WAAWt3E,QAChBtd,KAAKu0F,cAAe,EACf30E,SAAS41E,oBACdF,OAAOv1D,YAAYg2D,SACnBn2E,SAAS61E,oBA3Eb,yBA8EE,SAAYO,GACVh2F,KAAKk1F,MAAM,aAAcc,EAAQr3D,WACjC3+B,KAAKw0F,uBAhFT,GAA4C,QAAvB,EAAc,gBAHlC,eAAU,CACTyB,WAAY,MAEO,WChCsY,I,yDCQvZC,EAAY,eACd,EACAtC,EACAe,GACA,EACA,KACA,WACA,MAIa,aAAAuB,EAAiB,QAKhC,IAAkBA,EAAW,CAACC,OAAA,Q","file":"js/chunk-2eb8fffd.2f657c51.js","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ZXing = {}));\n}(this, (function (exports) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\n\n function fixProto(target, prototype) {\n var setPrototypeOf = Object.setPrototypeOf;\n setPrototypeOf ? setPrototypeOf(target, prototype) : (target.__proto__ = prototype);\n }\n\n function fixStack(target, fn) {\n if (fn === void 0) {\n fn = target.constructor;\n }\n var captureStackTrace = Error.captureStackTrace;\n captureStackTrace && captureStackTrace(target, fn);\n }\n\n\n\n\n\n var CustomError = (function (_super) {\n __extends(CustomError, _super);\n function CustomError(message) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, message) || this;\n Object.defineProperty(_this, 'name', {\n value: _newTarget.name,\n enumerable: false\n });\n fixProto(_this, _newTarget.prototype);\n fixStack(_this);\n return _this;\n }\n \n return CustomError;\n })(Error);\n\n /**\n * Custom Error class of type Exception.\n */\n class Exception extends CustomError {\n /**\n * Allows Exception to be constructed directly\n * with some message and prototype definition.\n */\n constructor(message = undefined) {\n super(message);\n this.message = message;\n }\n getKind() {\n const ex = this.constructor;\n return ex.kind;\n }\n }\n /**\n * It's typed as string so it can be extended and overriden.\n */\n Exception.kind = 'Exception';\n\n /**\n * Custom Error class of type Exception.\n */\n class ArgumentException extends Exception {\n }\n ArgumentException.kind = 'ArgumentException';\n\n /**\n * Custom Error class of type Exception.\n */\n class IllegalArgumentException extends Exception {\n }\n IllegalArgumentException.kind = 'IllegalArgumentException';\n\n /*\n * Copyright 2009 ZXing authors\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 class BinaryBitmap {\n constructor(binarizer) {\n this.binarizer = binarizer;\n if (binarizer === null) {\n throw new IllegalArgumentException('Binarizer must be non-null.');\n }\n }\n /**\n * @return The width of the bitmap.\n */\n getWidth() {\n return this.binarizer.getWidth();\n }\n /**\n * @return The height of the bitmap.\n */\n getHeight() {\n return this.binarizer.getHeight();\n }\n /**\n * Converts one row of luminance data to 1 bit data. May actually do the conversion, or return\n * cached data. Callers should assume this method is expensive and call it as seldom as possible.\n * This method is intended for decoding 1D barcodes and may choose to apply sharpening.\n *\n * @param y The row to fetch, which must be in [0, bitmap height)\n * @param row An optional preallocated array. If null or too small, it will be ignored.\n * If used, the Binarizer will call BitArray.clear(). Always use the returned object.\n * @return The array of bits for this row (true means black).\n * @throws NotFoundException if row can't be binarized\n */\n getBlackRow(y /*int*/, row) {\n return this.binarizer.getBlackRow(y, row);\n }\n /**\n * Converts a 2D array of luminance data to 1 bit. As above, assume this method is expensive\n * and do not call it repeatedly. This method is intended for decoding 2D barcodes and may or\n * may not apply sharpening. Therefore, a row from this matrix may not be identical to one\n * fetched using getBlackRow(), so don't mix and match between them.\n *\n * @return The 2D array of bits for the image (true means black).\n * @throws NotFoundException if image can't be binarized to make a matrix\n */\n getBlackMatrix() {\n // The matrix is created on demand the first time it is requested, then cached. There are two\n // reasons for this:\n // 1. This work will never be done if the caller only installs 1D Reader objects, or if a\n // 1D Reader finds a barcode before the 2D Readers run.\n // 2. This work will only be done once even if the caller installs multiple 2D Readers.\n if (this.matrix === null || this.matrix === undefined) {\n this.matrix = this.binarizer.getBlackMatrix();\n }\n return this.matrix;\n }\n /**\n * @return Whether this bitmap can be cropped.\n */\n isCropSupported() {\n return this.binarizer.getLuminanceSource().isCropSupported();\n }\n /**\n * Returns a new object with cropped image data. Implementations may keep a reference to the\n * original data rather than a copy. Only callable if isCropSupported() is true.\n *\n * @param left The left coordinate, which must be in [0,getWidth())\n * @param top The top coordinate, which must be in [0,getHeight())\n * @param width The width of the rectangle to crop.\n * @param height The height of the rectangle to crop.\n * @return A cropped version of this object.\n */\n crop(left /*int*/, top /*int*/, width /*int*/, height /*int*/) {\n const newSource = this.binarizer.getLuminanceSource().crop(left, top, width, height);\n return new BinaryBitmap(this.binarizer.createBinarizer(newSource));\n }\n /**\n * @return Whether this bitmap supports counter-clockwise rotation.\n */\n isRotateSupported() {\n return this.binarizer.getLuminanceSource().isRotateSupported();\n }\n /**\n * Returns a new object with rotated image data by 90 degrees counterclockwise.\n * Only callable if {@link #isRotateSupported()} is true.\n *\n * @return A rotated version of this object.\n */\n rotateCounterClockwise() {\n const newSource = this.binarizer.getLuminanceSource().rotateCounterClockwise();\n return new BinaryBitmap(this.binarizer.createBinarizer(newSource));\n }\n /**\n * Returns a new object with rotated image data by 45 degrees counterclockwise.\n * Only callable if {@link #isRotateSupported()} is true.\n *\n * @return A rotated version of this object.\n */\n rotateCounterClockwise45() {\n const newSource = this.binarizer.getLuminanceSource().rotateCounterClockwise45();\n return new BinaryBitmap(this.binarizer.createBinarizer(newSource));\n }\n /*@Override*/\n toString() {\n try {\n return this.getBlackMatrix().toString();\n }\n catch (e /*: NotFoundException*/) {\n return '';\n }\n }\n }\n\n /**\n * Custom Error class of type Exception.\n */\n class ChecksumException extends Exception {\n static getChecksumInstance() {\n return new ChecksumException();\n }\n }\n ChecksumException.kind = 'ChecksumException';\n\n /*\n * Copyright 2009 ZXing authors\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 /**\n * This class hierarchy provides a set of methods to convert luminance data to 1 bit data.\n * It allows the algorithm to vary polymorphically, for example allowing a very expensive\n * thresholding technique for servers and a fast one for mobile. It also permits the implementation\n * to vary, e.g. a JNI version for Android and a Java fallback version for other platforms.\n *\n * @author dswitkin@google.com (Daniel Switkin)\n */\n class Binarizer {\n constructor(source) {\n this.source = source;\n }\n getLuminanceSource() {\n return this.source;\n }\n getWidth() {\n return this.source.getWidth();\n }\n getHeight() {\n return this.source.getHeight();\n }\n }\n\n class System {\n // public static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)\n /**\n * Makes a copy of a array.\n */\n static arraycopy(src, srcPos, dest, destPos, length) {\n // TODO: better use split or set?\n while (length--) {\n dest[destPos++] = src[srcPos++];\n }\n }\n /**\n * Returns the current time in milliseconds.\n */\n static currentTimeMillis() {\n return Date.now();\n }\n }\n\n /**\n * Custom Error class of type Exception.\n */\n class IndexOutOfBoundsException extends Exception {\n }\n IndexOutOfBoundsException.kind = 'IndexOutOfBoundsException';\n\n /**\n * Custom Error class of type Exception.\n */\n class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {\n constructor(index = undefined, message = undefined) {\n super(message);\n this.index = index;\n this.message = message;\n }\n }\n ArrayIndexOutOfBoundsException.kind = 'ArrayIndexOutOfBoundsException';\n\n class Arrays {\n /**\n * Assigns the specified int value to each element of the specified array\n * of ints.\n *\n * @param a the array to be filled\n * @param val the value to be stored in all elements of the array\n */\n static fill(a, val) {\n for (let i = 0, len = a.length; i < len; i++)\n a[i] = val;\n }\n /**\n * Assigns the specified int value to each element of the specified\n * range of the specified array of ints. The range to be filled\n * extends from index {@code fromIndex}, inclusive, to index\n * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the\n * range to be filled is empty.)\n *\n * @param a the array to be filled\n * @param fromIndex the index of the first element (inclusive) to be\n * filled with the specified value\n * @param toIndex the index of the last element (exclusive) to be\n * filled with the specified value\n * @param val the value to be stored in all elements of the array\n * @throws IllegalArgumentException if {@code fromIndex > toIndex}\n * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or\n * {@code toIndex > a.length}\n */\n static fillWithin(a, fromIndex, toIndex, val) {\n Arrays.rangeCheck(a.length, fromIndex, toIndex);\n for (let i = fromIndex; i < toIndex; i++)\n a[i] = val;\n }\n /**\n * Checks that {@code fromIndex} and {@code toIndex} are in\n * the range and throws an exception if they aren't.\n */\n static rangeCheck(arrayLength, fromIndex, toIndex) {\n if (fromIndex > toIndex) {\n throw new IllegalArgumentException('fromIndex(' + fromIndex + ') > toIndex(' + toIndex + ')');\n }\n if (fromIndex < 0) {\n throw new ArrayIndexOutOfBoundsException(fromIndex);\n }\n if (toIndex > arrayLength) {\n throw new ArrayIndexOutOfBoundsException(toIndex);\n }\n }\n static asList(...args) {\n return args;\n }\n static create(rows, cols, value) {\n let arr = Array.from({ length: rows });\n return arr.map(x => Array.from({ length: cols }).fill(value));\n }\n static createInt32Array(rows, cols, value) {\n let arr = Array.from({ length: rows });\n return arr.map(x => Int32Array.from({ length: cols }).fill(value));\n }\n static equals(first, second) {\n if (!first) {\n return false;\n }\n if (!second) {\n return false;\n }\n if (!first.length) {\n return false;\n }\n if (!second.length) {\n return false;\n }\n if (first.length !== second.length) {\n return false;\n }\n for (let i = 0, length = first.length; i < length; i++) {\n if (first[i] !== second[i]) {\n return false;\n }\n }\n return true;\n }\n static hashCode(a) {\n if (a === null) {\n return 0;\n }\n let result = 1;\n for (const element of a) {\n result = 31 * result + element;\n }\n return result;\n }\n static fillUint8Array(a, value) {\n for (let i = 0; i !== a.length; i++) {\n a[i] = value;\n }\n }\n static copyOf(original, newLength) {\n return original.slice(0, newLength);\n }\n static copyOfUint8Array(original, newLength) {\n if (original.length <= newLength) {\n const newArray = new Uint8Array(newLength);\n newArray.set(original);\n return newArray;\n }\n return original.slice(0, newLength);\n }\n static copyOfRange(original, from, to) {\n const newLength = to - from;\n const copy = new Int32Array(newLength);\n System.arraycopy(original, from, copy, 0, newLength);\n return copy;\n }\n /*\n * Returns the index of of the element in a sorted array or (-n-1) where n is the insertion point\n * for the new element.\n * Parameters:\n * ar - A sorted array\n * el - An element to search for\n * comparator - A comparator function. The function takes two arguments: (a, b) and returns:\n * a negative number if a is less than b;\n * 0 if a is equal to b;\n * a positive number of a is greater than b.\n * The array may contain duplicate elements. If there are more than one equal elements in the array,\n * the returned value can be the index of any one of the equal elements.\n *\n * http://jsfiddle.net/aryzhov/pkfst550/\n */\n static binarySearch(ar, el, comparator) {\n if (undefined === comparator) {\n comparator = Arrays.numberComparator;\n }\n let m = 0;\n let n = ar.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = comparator(el, ar[k]);\n if (cmp > 0) {\n m = k + 1;\n }\n else if (cmp < 0) {\n n = k - 1;\n }\n else {\n return k;\n }\n }\n return -m - 1;\n }\n static numberComparator(a, b) {\n return a - b;\n }\n }\n\n /**\n * Ponyfill for Java's Integer class.\n */\n class Integer {\n static numberOfTrailingZeros(i) {\n let y;\n if (i === 0)\n return 32;\n let n = 31;\n y = i << 16;\n if (y !== 0) {\n n -= 16;\n i = y;\n }\n y = i << 8;\n if (y !== 0) {\n n -= 8;\n i = y;\n }\n y = i << 4;\n if (y !== 0) {\n n -= 4;\n i = y;\n }\n y = i << 2;\n if (y !== 0) {\n n -= 2;\n i = y;\n }\n return n - ((i << 1) >>> 31);\n }\n static numberOfLeadingZeros(i) {\n // HD, Figure 5-6\n if (i === 0) {\n return 32;\n }\n let n = 1;\n if (i >>> 16 === 0) {\n n += 16;\n i <<= 16;\n }\n if (i >>> 24 === 0) {\n n += 8;\n i <<= 8;\n }\n if (i >>> 28 === 0) {\n n += 4;\n i <<= 4;\n }\n if (i >>> 30 === 0) {\n n += 2;\n i <<= 2;\n }\n n -= i >>> 31;\n return n;\n }\n static toHexString(i) {\n return i.toString(16);\n }\n static toBinaryString(intNumber) {\n return String(parseInt(String(intNumber), 2));\n }\n // Returns the number of one-bits in the two's complement binary representation of the specified int value. This function is sometimes referred to as the population count.\n // Returns:\n // the number of one-bits in the two's complement binary representation of the specified int value.\n static bitCount(i) {\n // HD, Figure 5-2\n i = i - ((i >>> 1) & 0x55555555);\n i = (i & 0x33333333) + ((i >>> 2) & 0x33333333);\n i = (i + (i >>> 4)) & 0x0f0f0f0f;\n i = i + (i >>> 8);\n i = i + (i >>> 16);\n return i & 0x3f;\n }\n static truncDivision(dividend, divisor) {\n return Math.trunc(dividend / divisor);\n }\n /**\n * Converts A string to an integer.\n * @param s A string to convert into a number.\n * @param radix A value between 2 and 36 that specifies the base of the number in numString. If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. All other strings are considered decimal.\n */\n static parseInt(num, radix = undefined) {\n return parseInt(num, radix);\n }\n }\n Integer.MIN_VALUE_32_BITS = -2147483648;\n Integer.MAX_VALUE = Number.MAX_SAFE_INTEGER;\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *
A simple, fast array of bits, represented compactly by an array of ints internally.
\n *\n * @author Sean Owen\n */\n class BitArray /*implements Cloneable*/ {\n // public constructor() {\n // this.size = 0\n // this.bits = new Int32Array(1)\n // }\n // public constructor(size?: number /*int*/) {\n // if (undefined === size) {\n // this.size = 0\n // } else {\n // this.size = size\n // }\n // this.bits = this.makeArray(size)\n // }\n // For testing only\n constructor(size /*int*/, bits) {\n if (undefined === size) {\n this.size = 0;\n this.bits = new Int32Array(1);\n }\n else {\n this.size = size;\n if (undefined === bits || null === bits) {\n this.bits = BitArray.makeArray(size);\n }\n else {\n this.bits = bits;\n }\n }\n }\n getSize() {\n return this.size;\n }\n getSizeInBytes() {\n return Math.floor((this.size + 7) / 8);\n }\n ensureCapacity(size /*int*/) {\n if (size > this.bits.length * 32) {\n const newBits = BitArray.makeArray(size);\n System.arraycopy(this.bits, 0, newBits, 0, this.bits.length);\n this.bits = newBits;\n }\n }\n /**\n * @param i bit to get\n * @return true iff bit i is set\n */\n get(i /*int*/) {\n return (this.bits[Math.floor(i / 32)] & (1 << (i & 0x1F))) !== 0;\n }\n /**\n * Sets bit i.\n *\n * @param i bit to set\n */\n set(i /*int*/) {\n this.bits[Math.floor(i / 32)] |= 1 << (i & 0x1F);\n }\n /**\n * Flips bit i.\n *\n * @param i bit to set\n */\n flip(i /*int*/) {\n this.bits[Math.floor(i / 32)] ^= 1 << (i & 0x1F);\n }\n /**\n * @param from first bit to check\n * @return index of first bit that is set, starting from the given index, or size if none are set\n * at or beyond this given index\n * @see #getNextUnset(int)\n */\n getNextSet(from /*int*/) {\n const size = this.size;\n if (from >= size) {\n return size;\n }\n const bits = this.bits;\n let bitsOffset = Math.floor(from / 32);\n let currentBits = bits[bitsOffset];\n // mask off lesser bits first\n currentBits &= ~((1 << (from & 0x1F)) - 1);\n const length = bits.length;\n while (currentBits === 0) {\n if (++bitsOffset === length) {\n return size;\n }\n currentBits = bits[bitsOffset];\n }\n const result = (bitsOffset * 32) + Integer.numberOfTrailingZeros(currentBits);\n return result > size ? size : result;\n }\n /**\n * @param from index to start looking for unset bit\n * @return index of next unset bit, or {@code size} if none are unset until the end\n * @see #getNextSet(int)\n */\n getNextUnset(from /*int*/) {\n const size = this.size;\n if (from >= size) {\n return size;\n }\n const bits = this.bits;\n let bitsOffset = Math.floor(from / 32);\n let currentBits = ~bits[bitsOffset];\n // mask off lesser bits first\n currentBits &= ~((1 << (from & 0x1F)) - 1);\n const length = bits.length;\n while (currentBits === 0) {\n if (++bitsOffset === length) {\n return size;\n }\n currentBits = ~bits[bitsOffset];\n }\n const result = (bitsOffset * 32) + Integer.numberOfTrailingZeros(currentBits);\n return result > size ? size : result;\n }\n /**\n * Sets a block of 32 bits, starting at bit i.\n *\n * @param i first bit to set\n * @param newBits the new value of the next 32 bits. Note again that the least-significant bit\n * corresponds to bit i, the next-least-significant to i+1, and so on.\n */\n setBulk(i /*int*/, newBits /*int*/) {\n this.bits[Math.floor(i / 32)] = newBits;\n }\n /**\n * Sets a range of bits.\n *\n * @param start start of range, inclusive.\n * @param end end of range, exclusive\n */\n setRange(start /*int*/, end /*int*/) {\n if (end < start || start < 0 || end > this.size) {\n throw new IllegalArgumentException();\n }\n if (end === start) {\n return;\n }\n end--; // will be easier to treat this as the last actually set bit -- inclusive\n const firstInt = Math.floor(start / 32);\n const lastInt = Math.floor(end / 32);\n const bits = this.bits;\n for (let i = firstInt; i <= lastInt; i++) {\n const firstBit = i > firstInt ? 0 : start & 0x1F;\n const lastBit = i < lastInt ? 31 : end & 0x1F;\n // Ones from firstBit to lastBit, inclusive\n const mask = (2 << lastBit) - (1 << firstBit);\n bits[i] |= mask;\n }\n }\n /**\n * Clears all bits (sets to false).\n */\n clear() {\n const max = this.bits.length;\n const bits = this.bits;\n for (let i = 0; i < max; i++) {\n bits[i] = 0;\n }\n }\n /**\n * Efficient method to check if a range of bits is set, or not set.\n *\n * @param start start of range, inclusive.\n * @param end end of range, exclusive\n * @param value if true, checks that bits in range are set, otherwise checks that they are not set\n * @return true iff all bits are set or not set in range, according to value argument\n * @throws IllegalArgumentException if end is less than start or the range is not contained in the array\n */\n isRange(start /*int*/, end /*int*/, value) {\n if (end < start || start < 0 || end > this.size) {\n throw new IllegalArgumentException();\n }\n if (end === start) {\n return true; // empty range matches\n }\n end--; // will be easier to treat this as the last actually set bit -- inclusive\n const firstInt = Math.floor(start / 32);\n const lastInt = Math.floor(end / 32);\n const bits = this.bits;\n for (let i = firstInt; i <= lastInt; i++) {\n const firstBit = i > firstInt ? 0 : start & 0x1F;\n const lastBit = i < lastInt ? 31 : end & 0x1F;\n // Ones from firstBit to lastBit, inclusive\n const mask = (2 << lastBit) - (1 << firstBit) & 0xFFFFFFFF;\n // TYPESCRIPTPORT: & 0xFFFFFFFF added to discard anything after 32 bits, as ES has 53 bits\n // Return false if we're looking for 1s and the masked bits[i] isn't all 1s (is: that,\n // equals the mask, or we're looking for 0s and the masked portion is not all 0s\n if ((bits[i] & mask) !== (value ? mask : 0)) {\n return false;\n }\n }\n return true;\n }\n appendBit(bit) {\n this.ensureCapacity(this.size + 1);\n if (bit) {\n this.bits[Math.floor(this.size / 32)] |= 1 << (this.size & 0x1F);\n }\n this.size++;\n }\n /**\n * Appends the least-significant bits, from value, in order from most-significant to\n * least-significant. For example, appending 6 bits from 0x000001E will append the bits\n * 0, 1, 1, 1, 1, 0 in that order.\n *\n * @param value {@code int} containing bits to append\n * @param numBits bits from value to append\n */\n appendBits(value /*int*/, numBits /*int*/) {\n if (numBits < 0 || numBits > 32) {\n throw new IllegalArgumentException('Num bits must be between 0 and 32');\n }\n this.ensureCapacity(this.size + numBits);\n // const appendBit = this.appendBit;\n for (let numBitsLeft = numBits; numBitsLeft > 0; numBitsLeft--) {\n this.appendBit(((value >> (numBitsLeft - 1)) & 0x01) === 1);\n }\n }\n appendBitArray(other) {\n const otherSize = other.size;\n this.ensureCapacity(this.size + otherSize);\n // const appendBit = this.appendBit;\n for (let i = 0; i < otherSize; i++) {\n this.appendBit(other.get(i));\n }\n }\n xor(other) {\n if (this.size !== other.size) {\n throw new IllegalArgumentException('Sizes don\\'t match');\n }\n const bits = this.bits;\n for (let i = 0, length = bits.length; i < length; i++) {\n // The last int could be incomplete (i.e. not have 32 bits in\n // it) but there is no problem since 0 XOR 0 == 0.\n bits[i] ^= other.bits[i];\n }\n }\n /**\n *\n * @param bitOffset first bit to start writing\n * @param array array to write into. Bytes are written most-significant byte first. This is the opposite\n * of the internal representation, which is exposed by {@link #getBitArray()}\n * @param offset position in array to start writing\n * @param numBytes how many bytes to write\n */\n toBytes(bitOffset /*int*/, array, offset /*int*/, numBytes /*int*/) {\n for (let i = 0; i < numBytes; i++) {\n let theByte = 0;\n for (let j = 0; j < 8; j++) {\n if (this.get(bitOffset)) {\n theByte |= 1 << (7 - j);\n }\n bitOffset++;\n }\n array[offset + i] = /*(byte)*/ theByte;\n }\n }\n /**\n * @return underlying array of ints. The first element holds the first 32 bits, and the least\n * significant bit is bit 0.\n */\n getBitArray() {\n return this.bits;\n }\n /**\n * Reverses all bits in the array.\n */\n reverse() {\n const newBits = new Int32Array(this.bits.length);\n // reverse all int's first\n const len = Math.floor((this.size - 1) / 32);\n const oldBitsLen = len + 1;\n const bits = this.bits;\n for (let i = 0; i < oldBitsLen; i++) {\n let x = bits[i];\n x = ((x >> 1) & 0x55555555) | ((x & 0x55555555) << 1);\n x = ((x >> 2) & 0x33333333) | ((x & 0x33333333) << 2);\n x = ((x >> 4) & 0x0f0f0f0f) | ((x & 0x0f0f0f0f) << 4);\n x = ((x >> 8) & 0x00ff00ff) | ((x & 0x00ff00ff) << 8);\n x = ((x >> 16) & 0x0000ffff) | ((x & 0x0000ffff) << 16);\n newBits[len - i] = /*(int)*/ x;\n }\n // now correct the int's if the bit size isn't a multiple of 32\n if (this.size !== oldBitsLen * 32) {\n const leftOffset = oldBitsLen * 32 - this.size;\n let currentInt = newBits[0] >>> leftOffset;\n for (let i = 1; i < oldBitsLen; i++) {\n const nextInt = newBits[i];\n currentInt |= nextInt << (32 - leftOffset);\n newBits[i - 1] = currentInt;\n currentInt = nextInt >>> leftOffset;\n }\n newBits[oldBitsLen - 1] = currentInt;\n }\n this.bits = newBits;\n }\n static makeArray(size /*int*/) {\n return new Int32Array(Math.floor((size + 31) / 32));\n }\n /*@Override*/\n equals(o) {\n if (!(o instanceof BitArray)) {\n return false;\n }\n const other = o;\n return this.size === other.size && Arrays.equals(this.bits, other.bits);\n }\n /*@Override*/\n hashCode() {\n return 31 * this.size + Arrays.hashCode(this.bits);\n }\n /*@Override*/\n toString() {\n let result = '';\n for (let i = 0, size = this.size; i < size; i++) {\n if ((i & 0x07) === 0) {\n result += ' ';\n }\n result += this.get(i) ? 'X' : '.';\n }\n return result;\n }\n /*@Override*/\n clone() {\n return new BitArray(this.size, this.bits.slice());\n }\n }\n\n /*\n * Copyright 2009 ZXing authors\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 /*namespace com.google.zxing {*/\n /**\n * Encapsulates a type of hint that a caller may pass to a barcode reader to help it\n * more quickly or accurately decode it. It is up to implementations to decide what,\n * if anything, to do with the information that is supplied.\n *\n * @author Sean Owen\n * @author dswitkin@google.com (Daniel Switkin)\n * @see Reader#decode(BinaryBitmap,java.util.Map)\n */\n var DecodeHintType;\n (function (DecodeHintType) {\n /**\n * Unspecified, application-specific hint. Maps to an unspecified {@link Object}.\n */\n DecodeHintType[DecodeHintType[\"OTHER\"] = 0] = \"OTHER\"; /*(Object.class)*/\n /**\n * Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;\n * use {@link Boolean#TRUE}.\n */\n DecodeHintType[DecodeHintType[\"PURE_BARCODE\"] = 1] = \"PURE_BARCODE\"; /*(Void.class)*/\n /**\n * Image is known to be of one of a few possible formats.\n * Maps to a {@link List} of {@link BarcodeFormat}s.\n */\n DecodeHintType[DecodeHintType[\"POSSIBLE_FORMATS\"] = 2] = \"POSSIBLE_FORMATS\"; /*(List.class)*/\n /**\n * Spend more time to try to find a barcode; optimize for accuracy, not speed.\n * Doesn't matter what it maps to; use {@link Boolean#TRUE}.\n */\n DecodeHintType[DecodeHintType[\"TRY_HARDER\"] = 3] = \"TRY_HARDER\"; /*(Void.class)*/\n /**\n * Specifies what character encoding to use when decoding, where applicable (type String)\n */\n DecodeHintType[DecodeHintType[\"CHARACTER_SET\"] = 4] = \"CHARACTER_SET\"; /*(String.class)*/\n /**\n * Allowed lengths of encoded data -- reject anything else. Maps to an {@code Int32Array}.\n */\n DecodeHintType[DecodeHintType[\"ALLOWED_LENGTHS\"] = 5] = \"ALLOWED_LENGTHS\"; /*(Int32Array.class)*/\n /**\n * Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;\n * use {@link Boolean#TRUE}.\n */\n DecodeHintType[DecodeHintType[\"ASSUME_CODE_39_CHECK_DIGIT\"] = 6] = \"ASSUME_CODE_39_CHECK_DIGIT\"; /*(Void.class)*/\n /**\n * Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.\n * For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to;\n * use {@link Boolean#TRUE}.\n */\n DecodeHintType[DecodeHintType[\"ASSUME_GS1\"] = 7] = \"ASSUME_GS1\"; /*(Void.class)*/\n /**\n * If true, return the start and end digits in a Codabar barcode instead of stripping them. They\n * are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them\n * to not be. Doesn't matter what it maps to; use {@link Boolean#TRUE}.\n */\n DecodeHintType[DecodeHintType[\"RETURN_CODABAR_START_END\"] = 8] = \"RETURN_CODABAR_START_END\"; /*(Void.class)*/\n /**\n * The caller needs to be notified via callback when a possible {@link ResultPoint}\n * is found. Maps to a {@link ResultPointCallback}.\n */\n DecodeHintType[DecodeHintType[\"NEED_RESULT_POINT_CALLBACK\"] = 9] = \"NEED_RESULT_POINT_CALLBACK\"; /*(ResultPointCallback.class)*/\n /**\n * Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.\n * Maps to an {@code Int32Array} of the allowed extension lengths, for example [2], [5], or [2, 5].\n * If it is optional to have an extension, do not set this hint. If this is set,\n * and a UPC or EAN barcode is found but an extension is not, then no result will be returned\n * at all.\n */\n DecodeHintType[DecodeHintType[\"ALLOWED_EAN_EXTENSIONS\"] = 10] = \"ALLOWED_EAN_EXTENSIONS\"; /*(Int32Array.class)*/\n // End of enumeration values.\n /**\n * Data type the hint is expecting.\n * Among the possible values the {@link Void} stands out as being used for\n * hints that do not expect a value to be supplied (flag hints). Such hints\n * will possibly have their value ignored, or replaced by a\n * {@link Boolean#TRUE}. Hint suppliers should probably use\n * {@link Boolean#TRUE} as directed by the actual hint documentation.\n */\n // private valueType: Class>\n // DecodeHintType(valueType: Class>) {\n // this.valueType = valueType\n // }\n // public getValueType(): Class> {\n // return valueType\n // }\n })(DecodeHintType || (DecodeHintType = {}));\n var DecodeHintType$1 = DecodeHintType;\n\n /**\n * Custom Error class of type Exception.\n */\n class FormatException extends Exception {\n static getFormatInstance() {\n return new FormatException();\n }\n }\n FormatException.kind = 'FormatException';\n\n /*\n * Copyright 2008 ZXing authors\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 /*import java.util.HashMap;*/\n /*import java.util.Map;*/\n var CharacterSetValueIdentifiers;\n (function (CharacterSetValueIdentifiers) {\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"Cp437\"] = 0] = \"Cp437\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_1\"] = 1] = \"ISO8859_1\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_2\"] = 2] = \"ISO8859_2\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_3\"] = 3] = \"ISO8859_3\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_4\"] = 4] = \"ISO8859_4\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_5\"] = 5] = \"ISO8859_5\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_6\"] = 6] = \"ISO8859_6\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_7\"] = 7] = \"ISO8859_7\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_8\"] = 8] = \"ISO8859_8\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_9\"] = 9] = \"ISO8859_9\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_10\"] = 10] = \"ISO8859_10\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_11\"] = 11] = \"ISO8859_11\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_13\"] = 12] = \"ISO8859_13\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_14\"] = 13] = \"ISO8859_14\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_15\"] = 14] = \"ISO8859_15\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ISO8859_16\"] = 15] = \"ISO8859_16\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"SJIS\"] = 16] = \"SJIS\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"Cp1250\"] = 17] = \"Cp1250\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"Cp1251\"] = 18] = \"Cp1251\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"Cp1252\"] = 19] = \"Cp1252\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"Cp1256\"] = 20] = \"Cp1256\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"UnicodeBigUnmarked\"] = 21] = \"UnicodeBigUnmarked\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"UTF8\"] = 22] = \"UTF8\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"ASCII\"] = 23] = \"ASCII\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"Big5\"] = 24] = \"Big5\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"GB18030\"] = 25] = \"GB18030\";\n CharacterSetValueIdentifiers[CharacterSetValueIdentifiers[\"EUC_KR\"] = 26] = \"EUC_KR\";\n })(CharacterSetValueIdentifiers || (CharacterSetValueIdentifiers = {}));\n /**\n * Encapsulates a Character Set ECI, according to \"Extended Channel Interpretations\" 5.3.1.1\n * of ISO 18004.\n *\n * @author Sean Owen\n */\n class CharacterSetECI {\n constructor(valueIdentifier, valuesParam, name, ...otherEncodingNames) {\n this.valueIdentifier = valueIdentifier;\n this.name = name;\n if (typeof valuesParam === 'number') {\n this.values = Int32Array.from([valuesParam]);\n }\n else {\n this.values = valuesParam;\n }\n this.otherEncodingNames = otherEncodingNames;\n CharacterSetECI.VALUE_IDENTIFIER_TO_ECI.set(valueIdentifier, this);\n CharacterSetECI.NAME_TO_ECI.set(name, this);\n const values = this.values;\n for (let i = 0, length = values.length; i !== length; i++) {\n const v = values[i];\n CharacterSetECI.VALUES_TO_ECI.set(v, this);\n }\n for (const otherName of otherEncodingNames) {\n CharacterSetECI.NAME_TO_ECI.set(otherName, this);\n }\n }\n // CharacterSetECI(value: number /*int*/) {\n // this(new Int32Array {value})\n // }\n // CharacterSetECI(value: number /*int*/, String... otherEncodingNames) {\n // this.values = new Int32Array {value}\n // this.otherEncodingNames = otherEncodingNames\n // }\n // CharacterSetECI(values: Int32Array, String... otherEncodingNames) {\n // this.values = values\n // this.otherEncodingNames = otherEncodingNames\n // }\n getValueIdentifier() {\n return this.valueIdentifier;\n }\n getName() {\n return this.name;\n }\n getValue() {\n return this.values[0];\n }\n /**\n * @param value character set ECI value\n * @return {@code CharacterSetECI} representing ECI of given value, or null if it is legal but\n * unsupported\n * @throws FormatException if ECI value is invalid\n */\n static getCharacterSetECIByValue(value /*int*/) {\n if (value < 0 || value >= 900) {\n throw new FormatException('incorect value');\n }\n const characterSet = CharacterSetECI.VALUES_TO_ECI.get(value);\n if (undefined === characterSet) {\n throw new FormatException('incorect value');\n }\n return characterSet;\n }\n /**\n * @param name character set ECI encoding name\n * @return CharacterSetECI representing ECI for character encoding, or null if it is legal\n * but unsupported\n */\n static getCharacterSetECIByName(name) {\n const characterSet = CharacterSetECI.NAME_TO_ECI.get(name);\n if (undefined === characterSet) {\n throw new FormatException('incorect value');\n }\n return characterSet;\n }\n equals(o) {\n if (!(o instanceof CharacterSetECI)) {\n return false;\n }\n const other = o;\n return this.getName() === other.getName();\n }\n }\n CharacterSetECI.VALUE_IDENTIFIER_TO_ECI = new Map();\n CharacterSetECI.VALUES_TO_ECI = new Map();\n CharacterSetECI.NAME_TO_ECI = new Map();\n // Enum name is a Java encoding valid for java.lang and java.io\n // TYPESCRIPTPORT: changed the main label for ISO as the TextEncoder did not recognized them in the form from java\n // (eg ISO8859_1 must be ISO88591 or ISO8859-1 or ISO-8859-1)\n // later on: well, except 16 wich does not work with ISO885916 so used ISO-8859-1 form for default\n CharacterSetECI.Cp437 = new CharacterSetECI(CharacterSetValueIdentifiers.Cp437, Int32Array.from([0, 2]), 'Cp437');\n CharacterSetECI.ISO8859_1 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_1, Int32Array.from([1, 3]), 'ISO-8859-1', 'ISO88591', 'ISO8859_1');\n CharacterSetECI.ISO8859_2 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_2, 4, 'ISO-8859-2', 'ISO88592', 'ISO8859_2');\n CharacterSetECI.ISO8859_3 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_3, 5, 'ISO-8859-3', 'ISO88593', 'ISO8859_3');\n CharacterSetECI.ISO8859_4 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_4, 6, 'ISO-8859-4', 'ISO88594', 'ISO8859_4');\n CharacterSetECI.ISO8859_5 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_5, 7, 'ISO-8859-5', 'ISO88595', 'ISO8859_5');\n CharacterSetECI.ISO8859_6 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_6, 8, 'ISO-8859-6', 'ISO88596', 'ISO8859_6');\n CharacterSetECI.ISO8859_7 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_7, 9, 'ISO-8859-7', 'ISO88597', 'ISO8859_7');\n CharacterSetECI.ISO8859_8 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_8, 10, 'ISO-8859-8', 'ISO88598', 'ISO8859_8');\n CharacterSetECI.ISO8859_9 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_9, 11, 'ISO-8859-9', 'ISO88599', 'ISO8859_9');\n CharacterSetECI.ISO8859_10 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_10, 12, 'ISO-8859-10', 'ISO885910', 'ISO8859_10');\n CharacterSetECI.ISO8859_11 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_11, 13, 'ISO-8859-11', 'ISO885911', 'ISO8859_11');\n CharacterSetECI.ISO8859_13 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_13, 15, 'ISO-8859-13', 'ISO885913', 'ISO8859_13');\n CharacterSetECI.ISO8859_14 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_14, 16, 'ISO-8859-14', 'ISO885914', 'ISO8859_14');\n CharacterSetECI.ISO8859_15 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_15, 17, 'ISO-8859-15', 'ISO885915', 'ISO8859_15');\n CharacterSetECI.ISO8859_16 = new CharacterSetECI(CharacterSetValueIdentifiers.ISO8859_16, 18, 'ISO-8859-16', 'ISO885916', 'ISO8859_16');\n CharacterSetECI.SJIS = new CharacterSetECI(CharacterSetValueIdentifiers.SJIS, 20, 'SJIS', 'Shift_JIS');\n CharacterSetECI.Cp1250 = new CharacterSetECI(CharacterSetValueIdentifiers.Cp1250, 21, 'Cp1250', 'windows-1250');\n CharacterSetECI.Cp1251 = new CharacterSetECI(CharacterSetValueIdentifiers.Cp1251, 22, 'Cp1251', 'windows-1251');\n CharacterSetECI.Cp1252 = new CharacterSetECI(CharacterSetValueIdentifiers.Cp1252, 23, 'Cp1252', 'windows-1252');\n CharacterSetECI.Cp1256 = new CharacterSetECI(CharacterSetValueIdentifiers.Cp1256, 24, 'Cp1256', 'windows-1256');\n CharacterSetECI.UnicodeBigUnmarked = new CharacterSetECI(CharacterSetValueIdentifiers.UnicodeBigUnmarked, 25, 'UnicodeBigUnmarked', 'UTF-16BE', 'UnicodeBig');\n CharacterSetECI.UTF8 = new CharacterSetECI(CharacterSetValueIdentifiers.UTF8, 26, 'UTF8', 'UTF-8');\n CharacterSetECI.ASCII = new CharacterSetECI(CharacterSetValueIdentifiers.ASCII, Int32Array.from([27, 170]), 'ASCII', 'US-ASCII');\n CharacterSetECI.Big5 = new CharacterSetECI(CharacterSetValueIdentifiers.Big5, 28, 'Big5');\n CharacterSetECI.GB18030 = new CharacterSetECI(CharacterSetValueIdentifiers.GB18030, 29, 'GB18030', 'GB2312', 'EUC_CN', 'GBK');\n CharacterSetECI.EUC_KR = new CharacterSetECI(CharacterSetValueIdentifiers.EUC_KR, 30, 'EUC_KR', 'EUC-KR');\n\n /**\n * Custom Error class of type Exception.\n */\n class UnsupportedOperationException extends Exception {\n }\n UnsupportedOperationException.kind = 'UnsupportedOperationException';\n\n /**\n * Responsible for en/decoding strings.\n */\n class StringEncoding {\n /**\n * Decodes some Uint8Array to a string format.\n */\n static decode(bytes, encoding) {\n const encodingName = this.encodingName(encoding);\n if (this.customDecoder) {\n return this.customDecoder(bytes, encodingName);\n }\n // Increases browser support.\n if (typeof TextDecoder === 'undefined' || this.shouldDecodeOnFallback(encodingName)) {\n return this.decodeFallback(bytes, encodingName);\n }\n return new TextDecoder(encodingName).decode(bytes);\n }\n /**\n * Checks if the decoding method should use the fallback for decoding\n * once Node TextDecoder doesn't support all encoding formats.\n *\n * @param encodingName\n */\n static shouldDecodeOnFallback(encodingName) {\n return !StringEncoding.isBrowser() && encodingName === 'ISO-8859-1';\n }\n /**\n * Encodes some string into a Uint8Array.\n */\n static encode(s, encoding) {\n const encodingName = this.encodingName(encoding);\n if (this.customEncoder) {\n return this.customEncoder(s, encodingName);\n }\n // Increases browser support.\n if (typeof TextEncoder === 'undefined') {\n return this.encodeFallback(s);\n }\n // TextEncoder only encodes to UTF8 by default as specified by encoding.spec.whatwg.org\n return new TextEncoder().encode(s);\n }\n static isBrowser() {\n return (typeof window !== 'undefined' && {}.toString.call(window) === '[object Window]');\n }\n /**\n * Returns the string value from some encoding character set.\n */\n static encodingName(encoding) {\n return typeof encoding === 'string'\n ? encoding\n : encoding.getName();\n }\n /**\n * Returns character set from some encoding character set.\n */\n static encodingCharacterSet(encoding) {\n if (encoding instanceof CharacterSetECI) {\n return encoding;\n }\n return CharacterSetECI.getCharacterSetECIByName(encoding);\n }\n /**\n * Runs a fallback for the native decoding funcion.\n */\n static decodeFallback(bytes, encoding) {\n const characterSet = this.encodingCharacterSet(encoding);\n if (StringEncoding.isDecodeFallbackSupported(characterSet)) {\n let s = '';\n for (let i = 0, length = bytes.length; i < length; i++) {\n let h = bytes[i].toString(16);\n if (h.length < 2) {\n h = '0' + h;\n }\n s += '%' + h;\n }\n return decodeURIComponent(s);\n }\n if (characterSet.equals(CharacterSetECI.UnicodeBigUnmarked)) {\n return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer));\n }\n throw new UnsupportedOperationException(`Encoding ${this.encodingName(encoding)} not supported by fallback.`);\n }\n static isDecodeFallbackSupported(characterSet) {\n return characterSet.equals(CharacterSetECI.UTF8) ||\n characterSet.equals(CharacterSetECI.ISO8859_1) ||\n characterSet.equals(CharacterSetECI.ASCII);\n }\n /**\n * Runs a fallback for the native encoding funcion.\n *\n * @see https://stackoverflow.com/a/17192845/4367683\n */\n static encodeFallback(s) {\n const encodedURIstring = btoa(unescape(encodeURIComponent(s)));\n const charList = encodedURIstring.split('');\n const uintArray = [];\n for (let i = 0; i < charList.length; i++) {\n uintArray.push(charList[i].charCodeAt(0));\n }\n return new Uint8Array(uintArray);\n }\n }\n\n /*\n * Copyright (C) 2010 ZXing authors\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 /**\n * Common string-related functions.\n *\n * @author Sean Owen\n * @author Alex Dupre\n */\n class StringUtils {\n // SHIFT_JIS.equalsIgnoreCase(PLATFORM_DEFAULT_ENCODING) ||\n // EUC_JP.equalsIgnoreCase(PLATFORM_DEFAULT_ENCODING);\n static castAsNonUtf8Char(code, encoding = null) {\n // ISO 8859-1 is the Java default as UTF-8 is JavaScripts\n // you can see this method as a Java version of String.fromCharCode\n const e = encoding ? encoding.getName() : this.ISO88591;\n // use passed format (fromCharCode will return UTF8 encoding)\n return StringEncoding.decode(new Uint8Array([code]), e);\n }\n /**\n * @param bytes bytes encoding a string, whose encoding should be guessed\n * @param hints decode hints if applicable\n * @return name of guessed encoding; at the moment will only guess one of:\n * {@link #SHIFT_JIS}, {@link #UTF8}, {@link #ISO88591}, or the platform\n * default encoding if none of these can possibly be correct\n */\n static guessEncoding(bytes, hints) {\n if (hints !== null && hints !== undefined && undefined !== hints.get(DecodeHintType$1.CHARACTER_SET)) {\n return hints.get(DecodeHintType$1.CHARACTER_SET).toString();\n }\n // For now, merely tries to distinguish ISO-8859-1, UTF-8 and Shift_JIS,\n // which should be by far the most common encodings.\n const length = bytes.length;\n let canBeISO88591 = true;\n let canBeShiftJIS = true;\n let canBeUTF8 = true;\n let utf8BytesLeft = 0;\n // int utf8LowChars = 0\n let utf2BytesChars = 0;\n let utf3BytesChars = 0;\n let utf4BytesChars = 0;\n let sjisBytesLeft = 0;\n // int sjisLowChars = 0\n let sjisKatakanaChars = 0;\n // int sjisDoubleBytesChars = 0\n let sjisCurKatakanaWordLength = 0;\n let sjisCurDoubleBytesWordLength = 0;\n let sjisMaxKatakanaWordLength = 0;\n let sjisMaxDoubleBytesWordLength = 0;\n // int isoLowChars = 0\n // int isoHighChars = 0\n let isoHighOther = 0;\n const utf8bom = bytes.length > 3 &&\n bytes[0] === /*(byte) */ 0xEF &&\n bytes[1] === /*(byte) */ 0xBB &&\n bytes[2] === /*(byte) */ 0xBF;\n for (let i = 0; i < length && (canBeISO88591 || canBeShiftJIS || canBeUTF8); i++) {\n const value = bytes[i] & 0xFF;\n // UTF-8 stuff\n if (canBeUTF8) {\n if (utf8BytesLeft > 0) {\n if ((value & 0x80) === 0) {\n canBeUTF8 = false;\n }\n else {\n utf8BytesLeft--;\n }\n }\n else if ((value & 0x80) !== 0) {\n if ((value & 0x40) === 0) {\n canBeUTF8 = false;\n }\n else {\n utf8BytesLeft++;\n if ((value & 0x20) === 0) {\n utf2BytesChars++;\n }\n else {\n utf8BytesLeft++;\n if ((value & 0x10) === 0) {\n utf3BytesChars++;\n }\n else {\n utf8BytesLeft++;\n if ((value & 0x08) === 0) {\n utf4BytesChars++;\n }\n else {\n canBeUTF8 = false;\n }\n }\n }\n }\n } // else {\n // utf8LowChars++\n // }\n }\n // ISO-8859-1 stuff\n if (canBeISO88591) {\n if (value > 0x7F && value < 0xA0) {\n canBeISO88591 = false;\n }\n else if (value > 0x9F) {\n if (value < 0xC0 || value === 0xD7 || value === 0xF7) {\n isoHighOther++;\n } // else {\n // isoHighChars++\n // }\n } // else {\n // isoLowChars++\n // }\n }\n // Shift_JIS stuff\n if (canBeShiftJIS) {\n if (sjisBytesLeft > 0) {\n if (value < 0x40 || value === 0x7F || value > 0xFC) {\n canBeShiftJIS = false;\n }\n else {\n sjisBytesLeft--;\n }\n }\n else if (value === 0x80 || value === 0xA0 || value > 0xEF) {\n canBeShiftJIS = false;\n }\n else if (value > 0xA0 && value < 0xE0) {\n sjisKatakanaChars++;\n sjisCurDoubleBytesWordLength = 0;\n sjisCurKatakanaWordLength++;\n if (sjisCurKatakanaWordLength > sjisMaxKatakanaWordLength) {\n sjisMaxKatakanaWordLength = sjisCurKatakanaWordLength;\n }\n }\n else if (value > 0x7F) {\n sjisBytesLeft++;\n // sjisDoubleBytesChars++\n sjisCurKatakanaWordLength = 0;\n sjisCurDoubleBytesWordLength++;\n if (sjisCurDoubleBytesWordLength > sjisMaxDoubleBytesWordLength) {\n sjisMaxDoubleBytesWordLength = sjisCurDoubleBytesWordLength;\n }\n }\n else {\n // sjisLowChars++\n sjisCurKatakanaWordLength = 0;\n sjisCurDoubleBytesWordLength = 0;\n }\n }\n }\n if (canBeUTF8 && utf8BytesLeft > 0) {\n canBeUTF8 = false;\n }\n if (canBeShiftJIS && sjisBytesLeft > 0) {\n canBeShiftJIS = false;\n }\n // Easy -- if there is BOM or at least 1 valid not-single byte character (and no evidence it can't be UTF-8), done\n if (canBeUTF8 && (utf8bom || utf2BytesChars + utf3BytesChars + utf4BytesChars > 0)) {\n return StringUtils.UTF8;\n }\n // Easy -- if assuming Shift_JIS or at least 3 valid consecutive not-ascii characters (and no evidence it can't be), done\n if (canBeShiftJIS && (StringUtils.ASSUME_SHIFT_JIS || sjisMaxKatakanaWordLength >= 3 || sjisMaxDoubleBytesWordLength >= 3)) {\n return StringUtils.SHIFT_JIS;\n }\n // Distinguishing Shift_JIS and ISO-8859-1 can be a little tough for short words. The crude heuristic is:\n // - If we saw\n // - only two consecutive katakana chars in the whole text, or\n // - at least 10% of bytes that could be \"upper\" not-alphanumeric Latin1,\n // - then we conclude Shift_JIS, else ISO-8859-1\n if (canBeISO88591 && canBeShiftJIS) {\n return (sjisMaxKatakanaWordLength === 2 && sjisKatakanaChars === 2) || isoHighOther * 10 >= length\n ? StringUtils.SHIFT_JIS : StringUtils.ISO88591;\n }\n // Otherwise, try in order ISO-8859-1, Shift JIS, UTF-8 and fall back to default platform encoding\n if (canBeISO88591) {\n return StringUtils.ISO88591;\n }\n if (canBeShiftJIS) {\n return StringUtils.SHIFT_JIS;\n }\n if (canBeUTF8) {\n return StringUtils.UTF8;\n }\n // Otherwise, we take a wild guess with platform encoding\n return StringUtils.PLATFORM_DEFAULT_ENCODING;\n }\n /**\n *\n * @see https://stackoverflow.com/a/13439711/4367683\n *\n * @param append The new string to append.\n * @param args Argumets values to be formated.\n */\n static format(append, ...args) {\n let i = -1;\n function callback(exp, p0, p1, p2, p3, p4) {\n if (exp === '%%')\n return '%';\n if (args[++i] === undefined)\n return undefined;\n exp = p2 ? parseInt(p2.substr(1)) : undefined;\n let base = p3 ? parseInt(p3.substr(1)) : undefined;\n let val;\n switch (p4) {\n case 's':\n val = args[i];\n break;\n case 'c':\n val = args[i][0];\n break;\n case 'f':\n val = parseFloat(args[i]).toFixed(exp);\n break;\n case 'p':\n val = parseFloat(args[i]).toPrecision(exp);\n break;\n case 'e':\n val = parseFloat(args[i]).toExponential(exp);\n break;\n case 'x':\n val = parseInt(args[i]).toString(base ? base : 16);\n break;\n case 'd':\n val = parseFloat(parseInt(args[i], base ? base : 10).toPrecision(exp)).toFixed(0);\n break;\n }\n val = typeof val === 'object' ? JSON.stringify(val) : (+val).toString(base);\n let size = parseInt(p1); /* padding size */\n let ch = p1 && (p1[0] + '') === '0' ? '0' : ' '; /* isnull? */\n while (val.length < size)\n val = p0 !== undefined ? val + ch : ch + val; /* isminus? */\n return val;\n }\n let regex = /%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;\n return append.replace(regex, callback);\n }\n /**\n *\n */\n static getBytes(str, encoding) {\n return StringEncoding.encode(str, encoding);\n }\n /**\n * Returns the charcode at the specified index or at index zero.\n */\n static getCharCode(str, index = 0) {\n return str.charCodeAt(index);\n }\n /**\n * Returns char for given charcode\n */\n static getCharAt(charCode) {\n return String.fromCharCode(charCode);\n }\n }\n StringUtils.SHIFT_JIS = CharacterSetECI.SJIS.getName(); // \"SJIS\"\n StringUtils.GB2312 = 'GB2312';\n StringUtils.ISO88591 = CharacterSetECI.ISO8859_1.getName(); // \"ISO8859_1\"\n StringUtils.EUC_JP = 'EUC_JP';\n StringUtils.UTF8 = CharacterSetECI.UTF8.getName(); // \"UTF8\"\n StringUtils.PLATFORM_DEFAULT_ENCODING = StringUtils.UTF8; // \"UTF8\"//Charset.defaultCharset().name()\n StringUtils.ASSUME_SHIFT_JIS = false;\n\n class StringBuilder {\n constructor(value = '') {\n this.value = value;\n }\n enableDecoding(encoding) {\n this.encoding = encoding;\n return this;\n }\n append(s) {\n if (typeof s === 'string') {\n this.value += s.toString();\n }\n else if (this.encoding) {\n // use passed format (fromCharCode will return UTF8 encoding)\n this.value += StringUtils.castAsNonUtf8Char(s, this.encoding);\n }\n else {\n // correctly converts from UTF-8, but not other encodings\n this.value += String.fromCharCode(s);\n }\n return this;\n }\n appendChars(str, offset, len) {\n for (let i = offset; offset < offset + len; i++) {\n this.append(str[i]);\n }\n return this;\n }\n length() {\n return this.value.length;\n }\n charAt(n) {\n return this.value.charAt(n);\n }\n deleteCharAt(n) {\n this.value = this.value.substr(0, n) + this.value.substring(n + 1);\n }\n setCharAt(n, c) {\n this.value = this.value.substr(0, n) + c + this.value.substr(n + 1);\n }\n substring(start, end) {\n return this.value.substring(start, end);\n }\n /**\n * @note helper method for RSS Expanded\n */\n setLengthToZero() {\n this.value = '';\n }\n toString() {\n return this.value;\n }\n insert(n, c) {\n this.value = this.value.substr(0, n) + c + this.value.substr(n + c.length);\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *Represents a 2D matrix of bits. In function arguments below, and throughout the common\n * module, x is the column position, and y is the row position. The ordering is always x, y.\n * The origin is at the top-left.
\n *\n *Internally the bits are represented in a 1-D array of 32-bit ints. However, each row begins\n * with a new int. This is done intentionally so that we can copy out a row into a BitArray very\n * efficiently.
\n *\n *The ordering of bits is row-major. Within each int, the least significant bits are used first,\n * meaning they represent lower x values. This is compatible with BitArray's implementation.
\n *\n * @author Sean Owen\n * @author dswitkin@google.com (Daniel Switkin)\n */\n class BitMatrix /*implements Cloneable*/ {\n /**\n * Creates an empty square {@link BitMatrix}.\n *\n * @param dimension height and width\n */\n // public constructor(dimension: number /*int*/) {\n // this(dimension, dimension)\n // }\n /**\n * Creates an empty {@link BitMatrix}.\n *\n * @param width bit matrix width\n * @param height bit matrix height\n */\n // public constructor(width: number /*int*/, height: number /*int*/) {\n // if (width < 1 || height < 1) {\n // throw new IllegalArgumentException(\"Both dimensions must be greater than 0\")\n // }\n // this.width = width\n // this.height = height\n // this.rowSize = (width + 31) / 32\n // bits = new int[rowSize * height];\n // }\n constructor(width /*int*/, height /*int*/, rowSize /*int*/, bits) {\n this.width = width;\n this.height = height;\n this.rowSize = rowSize;\n this.bits = bits;\n if (undefined === height || null === height) {\n height = width;\n }\n this.height = height;\n if (width < 1 || height < 1) {\n throw new IllegalArgumentException('Both dimensions must be greater than 0');\n }\n if (undefined === rowSize || null === rowSize) {\n rowSize = Math.floor((width + 31) / 32);\n }\n this.rowSize = rowSize;\n if (undefined === bits || null === bits) {\n this.bits = new Int32Array(this.rowSize * this.height);\n }\n }\n /**\n * Interprets a 2D array of booleans as a {@link BitMatrix}, where \"true\" means an \"on\" bit.\n *\n * @function parse\n * @param image bits of the image, as a row-major 2D array. Elements are arrays representing rows\n * @return {@link BitMatrix} representation of image\n */\n static parseFromBooleanArray(image) {\n const height = image.length;\n const width = image[0].length;\n const bits = new BitMatrix(width, height);\n for (let i = 0; i < height; i++) {\n const imageI = image[i];\n for (let j = 0; j < width; j++) {\n if (imageI[j]) {\n bits.set(j, i);\n }\n }\n }\n return bits;\n }\n /**\n *\n * @function parse\n * @param stringRepresentation\n * @param setString\n * @param unsetString\n */\n static parseFromString(stringRepresentation, setString, unsetString) {\n if (stringRepresentation === null) {\n throw new IllegalArgumentException('stringRepresentation cannot be null');\n }\n const bits = new Array(stringRepresentation.length);\n let bitsPos = 0;\n let rowStartPos = 0;\n let rowLength = -1;\n let nRows = 0;\n let pos = 0;\n while (pos < stringRepresentation.length) {\n if (stringRepresentation.charAt(pos) === '\\n' ||\n stringRepresentation.charAt(pos) === '\\r') {\n if (bitsPos > rowStartPos) {\n if (rowLength === -1) {\n rowLength = bitsPos - rowStartPos;\n }\n else if (bitsPos - rowStartPos !== rowLength) {\n throw new IllegalArgumentException('row lengths do not match');\n }\n rowStartPos = bitsPos;\n nRows++;\n }\n pos++;\n }\n else if (stringRepresentation.substring(pos, pos + setString.length) === setString) {\n pos += setString.length;\n bits[bitsPos] = true;\n bitsPos++;\n }\n else if (stringRepresentation.substring(pos, pos + unsetString.length) === unsetString) {\n pos += unsetString.length;\n bits[bitsPos] = false;\n bitsPos++;\n }\n else {\n throw new IllegalArgumentException('illegal character encountered: ' + stringRepresentation.substring(pos));\n }\n }\n // no EOL at end?\n if (bitsPos > rowStartPos) {\n if (rowLength === -1) {\n rowLength = bitsPos - rowStartPos;\n }\n else if (bitsPos - rowStartPos !== rowLength) {\n throw new IllegalArgumentException('row lengths do not match');\n }\n nRows++;\n }\n const matrix = new BitMatrix(rowLength, nRows);\n for (let i = 0; i < bitsPos; i++) {\n if (bits[i]) {\n matrix.set(Math.floor(i % rowLength), Math.floor(i / rowLength));\n }\n }\n return matrix;\n }\n /**\n *Gets the requested bit, where true means black.
\n *\n * @param x The horizontal component (i.e. which column)\n * @param y The vertical component (i.e. which row)\n * @return value of given bit in matrix\n */\n get(x /*int*/, y /*int*/) {\n const offset = y * this.rowSize + Math.floor(x / 32);\n return ((this.bits[offset] >>> (x & 0x1f)) & 1) !== 0;\n }\n /**\n *Sets the given bit to true.
\n *\n * @param x The horizontal component (i.e. which column)\n * @param y The vertical component (i.e. which row)\n */\n set(x /*int*/, y /*int*/) {\n const offset = y * this.rowSize + Math.floor(x / 32);\n this.bits[offset] |= (1 << (x & 0x1f)) & 0xFFFFFFFF;\n }\n unset(x /*int*/, y /*int*/) {\n const offset = y * this.rowSize + Math.floor(x / 32);\n this.bits[offset] &= ~((1 << (x & 0x1f)) & 0xFFFFFFFF);\n }\n /**\n *Flips the given bit.
\n *\n * @param x The horizontal component (i.e. which column)\n * @param y The vertical component (i.e. which row)\n */\n flip(x /*int*/, y /*int*/) {\n const offset = y * this.rowSize + Math.floor(x / 32);\n this.bits[offset] ^= ((1 << (x & 0x1f)) & 0xFFFFFFFF);\n }\n /**\n * Exclusive-or (XOR): Flip the bit in this {@code BitMatrix} if the corresponding\n * mask bit is set.\n *\n * @param mask XOR mask\n */\n xor(mask) {\n if (this.width !== mask.getWidth() || this.height !== mask.getHeight()\n || this.rowSize !== mask.getRowSize()) {\n throw new IllegalArgumentException('input matrix dimensions do not match');\n }\n const rowArray = new BitArray(Math.floor(this.width / 32) + 1);\n const rowSize = this.rowSize;\n const bits = this.bits;\n for (let y = 0, height = this.height; y < height; y++) {\n const offset = y * rowSize;\n const row = mask.getRow(y, rowArray).getBitArray();\n for (let x = 0; x < rowSize; x++) {\n bits[offset + x] ^= row[x];\n }\n }\n }\n /**\n * Clears all bits (sets to false).\n */\n clear() {\n const bits = this.bits;\n const max = bits.length;\n for (let i = 0; i < max; i++) {\n bits[i] = 0;\n }\n }\n /**\n *Sets a square region of the bit matrix to true.
\n *\n * @param left The horizontal position to begin at (inclusive)\n * @param top The vertical position to begin at (inclusive)\n * @param width The width of the region\n * @param height The height of the region\n */\n setRegion(left /*int*/, top /*int*/, width /*int*/, height /*int*/) {\n if (top < 0 || left < 0) {\n throw new IllegalArgumentException('Left and top must be nonnegative');\n }\n if (height < 1 || width < 1) {\n throw new IllegalArgumentException('Height and width must be at least 1');\n }\n const right = left + width;\n const bottom = top + height;\n if (bottom > this.height || right > this.width) {\n throw new IllegalArgumentException('The region must fit inside the matrix');\n }\n const rowSize = this.rowSize;\n const bits = this.bits;\n for (let y = top; y < bottom; y++) {\n const offset = y * rowSize;\n for (let x = left; x < right; x++) {\n bits[offset + Math.floor(x / 32)] |= ((1 << (x & 0x1f)) & 0xFFFFFFFF);\n }\n }\n }\n /**\n * A fast method to retrieve one row of data from the matrix as a BitArray.\n *\n * @param y The row to retrieve\n * @param row An optional caller-allocated BitArray, will be allocated if null or too small\n * @return The resulting BitArray - this reference should always be used even when passing\n * your own row\n */\n getRow(y /*int*/, row) {\n if (row === null || row === undefined || row.getSize() < this.width) {\n row = new BitArray(this.width);\n }\n else {\n row.clear();\n }\n const rowSize = this.rowSize;\n const bits = this.bits;\n const offset = y * rowSize;\n for (let x = 0; x < rowSize; x++) {\n row.setBulk(x * 32, bits[offset + x]);\n }\n return row;\n }\n /**\n * @param y row to set\n * @param row {@link BitArray} to copy from\n */\n setRow(y /*int*/, row) {\n System.arraycopy(row.getBitArray(), 0, this.bits, y * this.rowSize, this.rowSize);\n }\n /**\n * Modifies this {@code BitMatrix} to represent the same but rotated 180 degrees\n */\n rotate180() {\n const width = this.getWidth();\n const height = this.getHeight();\n let topRow = new BitArray(width);\n let bottomRow = new BitArray(width);\n for (let i = 0, length = Math.floor((height + 1) / 2); i < length; i++) {\n topRow = this.getRow(i, topRow);\n bottomRow = this.getRow(height - 1 - i, bottomRow);\n topRow.reverse();\n bottomRow.reverse();\n this.setRow(i, bottomRow);\n this.setRow(height - 1 - i, topRow);\n }\n }\n /**\n * This is useful in detecting the enclosing rectangle of a 'pure' barcode.\n *\n * @return {@code left,top,width,height} enclosing rectangle of all 1 bits, or null if it is all white\n */\n getEnclosingRectangle() {\n const width = this.width;\n const height = this.height;\n const rowSize = this.rowSize;\n const bits = this.bits;\n let left = width;\n let top = height;\n let right = -1;\n let bottom = -1;\n for (let y = 0; y < height; y++) {\n for (let x32 = 0; x32 < rowSize; x32++) {\n const theBits = bits[y * rowSize + x32];\n if (theBits !== 0) {\n if (y < top) {\n top = y;\n }\n if (y > bottom) {\n bottom = y;\n }\n if (x32 * 32 < left) {\n let bit = 0;\n while (((theBits << (31 - bit)) & 0xFFFFFFFF) === 0) {\n bit++;\n }\n if ((x32 * 32 + bit) < left) {\n left = x32 * 32 + bit;\n }\n }\n if (x32 * 32 + 31 > right) {\n let bit = 31;\n while ((theBits >>> bit) === 0) {\n bit--;\n }\n if ((x32 * 32 + bit) > right) {\n right = x32 * 32 + bit;\n }\n }\n }\n }\n }\n if (right < left || bottom < top) {\n return null;\n }\n return Int32Array.from([left, top, right - left + 1, bottom - top + 1]);\n }\n /**\n * This is useful in detecting a corner of a 'pure' barcode.\n *\n * @return {@code x,y} coordinate of top-left-most 1 bit, or null if it is all white\n */\n getTopLeftOnBit() {\n const rowSize = this.rowSize;\n const bits = this.bits;\n let bitsOffset = 0;\n while (bitsOffset < bits.length && bits[bitsOffset] === 0) {\n bitsOffset++;\n }\n if (bitsOffset === bits.length) {\n return null;\n }\n const y = bitsOffset / rowSize;\n let x = (bitsOffset % rowSize) * 32;\n const theBits = bits[bitsOffset];\n let bit = 0;\n while (((theBits << (31 - bit)) & 0xFFFFFFFF) === 0) {\n bit++;\n }\n x += bit;\n return Int32Array.from([x, y]);\n }\n getBottomRightOnBit() {\n const rowSize = this.rowSize;\n const bits = this.bits;\n let bitsOffset = bits.length - 1;\n while (bitsOffset >= 0 && bits[bitsOffset] === 0) {\n bitsOffset--;\n }\n if (bitsOffset < 0) {\n return null;\n }\n const y = Math.floor(bitsOffset / rowSize);\n let x = Math.floor(bitsOffset % rowSize) * 32;\n const theBits = bits[bitsOffset];\n let bit = 31;\n while ((theBits >>> bit) === 0) {\n bit--;\n }\n x += bit;\n return Int32Array.from([x, y]);\n }\n /**\n * @return The width of the matrix\n */\n getWidth() {\n return this.width;\n }\n /**\n * @return The height of the matrix\n */\n getHeight() {\n return this.height;\n }\n /**\n * @return The row size of the matrix\n */\n getRowSize() {\n return this.rowSize;\n }\n /*@Override*/\n equals(o) {\n if (!(o instanceof BitMatrix)) {\n return false;\n }\n const other = o;\n return this.width === other.width && this.height === other.height && this.rowSize === other.rowSize &&\n Arrays.equals(this.bits, other.bits);\n }\n /*@Override*/\n hashCode() {\n let hash = this.width;\n hash = 31 * hash + this.width;\n hash = 31 * hash + this.height;\n hash = 31 * hash + this.rowSize;\n hash = 31 * hash + Arrays.hashCode(this.bits);\n return hash;\n }\n /**\n * @return string representation using \"X\" for set and \" \" for unset bits\n */\n /*@Override*/\n // public toString(): string {\n // return toString(\": \"X, \" \")\n // }\n /**\n * @param setString representation of a set bit\n * @param unsetString representation of an unset bit\n * @return string representation of entire matrix utilizing given strings\n */\n // public toString(setString: string = \"X \", unsetString: string = \" \"): string {\n // return this.buildToString(setString, unsetString, \"\\n\")\n // }\n /**\n * @param setString representation of a set bit\n * @param unsetString representation of an unset bit\n * @param lineSeparator newline character in string representation\n * @return string representation of entire matrix utilizing given strings and line separator\n * @deprecated call {@link #toString(String,String)} only, which uses \\n line separator always\n */\n // @Deprecated\n toString(setString = 'X ', unsetString = ' ', lineSeparator = '\\n') {\n return this.buildToString(setString, unsetString, lineSeparator);\n }\n buildToString(setString, unsetString, lineSeparator) {\n let result = new StringBuilder();\n // result.append(lineSeparator);\n for (let y = 0, height = this.height; y < height; y++) {\n for (let x = 0, width = this.width; x < width; x++) {\n result.append(this.get(x, y) ? setString : unsetString);\n }\n result.append(lineSeparator);\n }\n return result.toString();\n }\n /*@Override*/\n clone() {\n return new BitMatrix(this.width, this.height, this.rowSize, this.bits.slice());\n }\n }\n\n /**\n * Custom Error class of type Exception.\n */\n class NotFoundException extends Exception {\n static getNotFoundInstance() {\n return new NotFoundException();\n }\n }\n NotFoundException.kind = 'NotFoundException';\n\n /*\n * Copyright 2009 ZXing authors\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 /**\n * This Binarizer implementation uses the old ZXing global histogram approach. It is suitable\n * for low-end mobile devices which don't have enough CPU or memory to use a local thresholding\n * algorithm. However, because it picks a global black point, it cannot handle difficult shadows\n * and gradients.\n *\n * Faster mobile devices and all desktop applications should probably use HybridBinarizer instead.\n *\n * @author dswitkin@google.com (Daniel Switkin)\n * @author Sean Owen\n */\n class GlobalHistogramBinarizer extends Binarizer {\n constructor(source) {\n super(source);\n this.luminances = GlobalHistogramBinarizer.EMPTY;\n this.buckets = new Int32Array(GlobalHistogramBinarizer.LUMINANCE_BUCKETS);\n }\n // Applies simple sharpening to the row data to improve performance of the 1D Readers.\n /*@Override*/\n getBlackRow(y /*int*/, row) {\n const source = this.getLuminanceSource();\n const width = source.getWidth();\n if (row === undefined || row === null || row.getSize() < width) {\n row = new BitArray(width);\n }\n else {\n row.clear();\n }\n this.initArrays(width);\n const localLuminances = source.getRow(y, this.luminances);\n const localBuckets = this.buckets;\n for (let x = 0; x < width; x++) {\n localBuckets[(localLuminances[x] & 0xff) >> GlobalHistogramBinarizer.LUMINANCE_SHIFT]++;\n }\n const blackPoint = GlobalHistogramBinarizer.estimateBlackPoint(localBuckets);\n if (width < 3) {\n // Special case for very small images\n for (let x = 0; x < width; x++) {\n if ((localLuminances[x] & 0xff) < blackPoint) {\n row.set(x);\n }\n }\n }\n else {\n let left = localLuminances[0] & 0xff;\n let center = localLuminances[1] & 0xff;\n for (let x = 1; x < width - 1; x++) {\n const right = localLuminances[x + 1] & 0xff;\n // A simple -1 4 -1 box filter with a weight of 2.\n if (((center * 4) - left - right) / 2 < blackPoint) {\n row.set(x);\n }\n left = center;\n center = right;\n }\n }\n return row;\n }\n // Does not sharpen the data, as this call is intended to only be used by 2D Readers.\n /*@Override*/\n getBlackMatrix() {\n const source = this.getLuminanceSource();\n const width = source.getWidth();\n const height = source.getHeight();\n const matrix = new BitMatrix(width, height);\n // Quickly calculates the histogram by sampling four rows from the image. This proved to be\n // more robust on the blackbox tests than sampling a diagonal as we used to do.\n this.initArrays(width);\n const localBuckets = this.buckets;\n for (let y = 1; y < 5; y++) {\n const row = Math.floor((height * y) / 5);\n const localLuminances = source.getRow(row, this.luminances);\n const right = Math.floor((width * 4) / 5);\n for (let x = Math.floor(width / 5); x < right; x++) {\n const pixel = localLuminances[x] & 0xff;\n localBuckets[pixel >> GlobalHistogramBinarizer.LUMINANCE_SHIFT]++;\n }\n }\n const blackPoint = GlobalHistogramBinarizer.estimateBlackPoint(localBuckets);\n // We delay reading the entire image luminance until the black point estimation succeeds.\n // Although we end up reading four rows twice, it is consistent with our motto of\n // \"fail quickly\" which is necessary for continuous scanning.\n const localLuminances = source.getMatrix();\n for (let y = 0; y < height; y++) {\n const offset = y * width;\n for (let x = 0; x < width; x++) {\n const pixel = localLuminances[offset + x] & 0xff;\n if (pixel < blackPoint) {\n matrix.set(x, y);\n }\n }\n }\n return matrix;\n }\n /*@Override*/\n createBinarizer(source) {\n return new GlobalHistogramBinarizer(source);\n }\n initArrays(luminanceSize /*int*/) {\n if (this.luminances.length < luminanceSize) {\n this.luminances = new Uint8ClampedArray(luminanceSize);\n }\n const buckets = this.buckets;\n for (let x = 0; x < GlobalHistogramBinarizer.LUMINANCE_BUCKETS; x++) {\n buckets[x] = 0;\n }\n }\n static estimateBlackPoint(buckets) {\n // Find the tallest peak in the histogram.\n const numBuckets = buckets.length;\n let maxBucketCount = 0;\n let firstPeak = 0;\n let firstPeakSize = 0;\n for (let x = 0; x < numBuckets; x++) {\n if (buckets[x] > firstPeakSize) {\n firstPeak = x;\n firstPeakSize = buckets[x];\n }\n if (buckets[x] > maxBucketCount) {\n maxBucketCount = buckets[x];\n }\n }\n // Find the second-tallest peak which is somewhat far from the tallest peak.\n let secondPeak = 0;\n let secondPeakScore = 0;\n for (let x = 0; x < numBuckets; x++) {\n const distanceToBiggest = x - firstPeak;\n // Encourage more distant second peaks by multiplying by square of distance.\n const score = buckets[x] * distanceToBiggest * distanceToBiggest;\n if (score > secondPeakScore) {\n secondPeak = x;\n secondPeakScore = score;\n }\n }\n // Make sure firstPeak corresponds to the black peak.\n if (firstPeak > secondPeak) {\n const temp = firstPeak;\n firstPeak = secondPeak;\n secondPeak = temp;\n }\n // If there is too little contrast in the image to pick a meaningful black point, throw rather\n // than waste time trying to decode the image, and risk false positives.\n if (secondPeak - firstPeak <= numBuckets / 16) {\n throw new NotFoundException();\n }\n // Find a valley between them that is low and closer to the white peak.\n let bestValley = secondPeak - 1;\n let bestValleyScore = -1;\n for (let x = secondPeak - 1; x > firstPeak; x--) {\n const fromFirst = x - firstPeak;\n const score = fromFirst * fromFirst * (secondPeak - x) * (maxBucketCount - buckets[x]);\n if (score > bestValleyScore) {\n bestValley = x;\n bestValleyScore = score;\n }\n }\n return bestValley << GlobalHistogramBinarizer.LUMINANCE_SHIFT;\n }\n }\n GlobalHistogramBinarizer.LUMINANCE_BITS = 5;\n GlobalHistogramBinarizer.LUMINANCE_SHIFT = 8 - GlobalHistogramBinarizer.LUMINANCE_BITS;\n GlobalHistogramBinarizer.LUMINANCE_BUCKETS = 1 << GlobalHistogramBinarizer.LUMINANCE_BITS;\n GlobalHistogramBinarizer.EMPTY = Uint8ClampedArray.from([0]);\n\n /*\n * Copyright 2009 ZXing authors\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 /**\n * This class implements a local thresholding algorithm, which while slower than the\n * GlobalHistogramBinarizer, is fairly efficient for what it does. It is designed for\n * high frequency images of barcodes with black data on white backgrounds. For this application,\n * it does a much better job than a global blackpoint with severe shadows and gradients.\n * However it tends to produce artifacts on lower frequency images and is therefore not\n * a good general purpose binarizer for uses outside ZXing.\n *\n * This class extends GlobalHistogramBinarizer, using the older histogram approach for 1D readers,\n * and the newer local approach for 2D readers. 1D decoding using a per-row histogram is already\n * inherently local, and only fails for horizontal gradients. We can revisit that problem later,\n * but for now it was not a win to use local blocks for 1D.\n *\n * This Binarizer is the default for the unit tests and the recommended class for library users.\n *\n * @author dswitkin@google.com (Daniel Switkin)\n */\n class HybridBinarizer extends GlobalHistogramBinarizer {\n constructor(source) {\n super(source);\n this.matrix = null;\n }\n /**\n * Calculates the final BitMatrix once for all requests. This could be called once from the\n * constructor instead, but there are some advantages to doing it lazily, such as making\n * profiling easier, and not doing heavy lifting when callers don't expect it.\n */\n /*@Override*/\n getBlackMatrix() {\n if (this.matrix !== null) {\n return this.matrix;\n }\n const source = this.getLuminanceSource();\n const width = source.getWidth();\n const height = source.getHeight();\n if (width >= HybridBinarizer.MINIMUM_DIMENSION && height >= HybridBinarizer.MINIMUM_DIMENSION) {\n const luminances = source.getMatrix();\n let subWidth = width >> HybridBinarizer.BLOCK_SIZE_POWER;\n if ((width & HybridBinarizer.BLOCK_SIZE_MASK) !== 0) {\n subWidth++;\n }\n let subHeight = height >> HybridBinarizer.BLOCK_SIZE_POWER;\n if ((height & HybridBinarizer.BLOCK_SIZE_MASK) !== 0) {\n subHeight++;\n }\n const blackPoints = HybridBinarizer.calculateBlackPoints(luminances, subWidth, subHeight, width, height);\n const newMatrix = new BitMatrix(width, height);\n HybridBinarizer.calculateThresholdForBlock(luminances, subWidth, subHeight, width, height, blackPoints, newMatrix);\n this.matrix = newMatrix;\n }\n else {\n // If the image is too small, fall back to the global histogram approach.\n this.matrix = super.getBlackMatrix();\n }\n return this.matrix;\n }\n /*@Override*/\n createBinarizer(source) {\n return new HybridBinarizer(source);\n }\n /**\n * For each block in the image, calculate the average black point using a 5x5 grid\n * of the blocks around it. Also handles the corner cases (fractional blocks are computed based\n * on the last pixels in the row/column which are also used in the previous block).\n */\n static calculateThresholdForBlock(luminances, subWidth /*int*/, subHeight /*int*/, width /*int*/, height /*int*/, blackPoints, matrix) {\n const maxYOffset = height - HybridBinarizer.BLOCK_SIZE;\n const maxXOffset = width - HybridBinarizer.BLOCK_SIZE;\n for (let y = 0; y < subHeight; y++) {\n let yoffset = y << HybridBinarizer.BLOCK_SIZE_POWER;\n if (yoffset > maxYOffset) {\n yoffset = maxYOffset;\n }\n const top = HybridBinarizer.cap(y, 2, subHeight - 3);\n for (let x = 0; x < subWidth; x++) {\n let xoffset = x << HybridBinarizer.BLOCK_SIZE_POWER;\n if (xoffset > maxXOffset) {\n xoffset = maxXOffset;\n }\n const left = HybridBinarizer.cap(x, 2, subWidth - 3);\n let sum = 0;\n for (let z = -2; z <= 2; z++) {\n const blackRow = blackPoints[top + z];\n sum += blackRow[left - 2] + blackRow[left - 1] + blackRow[left] + blackRow[left + 1] + blackRow[left + 2];\n }\n const average = sum / 25;\n HybridBinarizer.thresholdBlock(luminances, xoffset, yoffset, average, width, matrix);\n }\n }\n }\n static cap(value /*int*/, min /*int*/, max /*int*/) {\n return value < min ? min : value > max ? max : value;\n }\n /**\n * Applies a single threshold to a block of pixels.\n */\n static thresholdBlock(luminances, xoffset /*int*/, yoffset /*int*/, threshold /*int*/, stride /*int*/, matrix) {\n for (let y = 0, offset = yoffset * stride + xoffset; y < HybridBinarizer.BLOCK_SIZE; y++, offset += stride) {\n for (let x = 0; x < HybridBinarizer.BLOCK_SIZE; x++) {\n // Comparison needs to be <= so that black == 0 pixels are black even if the threshold is 0.\n if ((luminances[offset + x] & 0xFF) <= threshold) {\n matrix.set(xoffset + x, yoffset + y);\n }\n }\n }\n }\n /**\n * Calculates a single black point for each block of pixels and saves it away.\n * See the following thread for a discussion of this algorithm:\n * http://groups.google.com/group/zxing/browse_thread/thread/d06efa2c35a7ddc0\n */\n static calculateBlackPoints(luminances, subWidth /*int*/, subHeight /*int*/, width /*int*/, height /*int*/) {\n const maxYOffset = height - HybridBinarizer.BLOCK_SIZE;\n const maxXOffset = width - HybridBinarizer.BLOCK_SIZE;\n // tslint:disable-next-line:whitespace\n const blackPoints = new Array(subHeight); // subWidth\n for (let y = 0; y < subHeight; y++) {\n blackPoints[y] = new Int32Array(subWidth);\n let yoffset = y << HybridBinarizer.BLOCK_SIZE_POWER;\n if (yoffset > maxYOffset) {\n yoffset = maxYOffset;\n }\n for (let x = 0; x < subWidth; x++) {\n let xoffset = x << HybridBinarizer.BLOCK_SIZE_POWER;\n if (xoffset > maxXOffset) {\n xoffset = maxXOffset;\n }\n let sum = 0;\n let min = 0xFF;\n let max = 0;\n for (let yy = 0, offset = yoffset * width + xoffset; yy < HybridBinarizer.BLOCK_SIZE; yy++, offset += width) {\n for (let xx = 0; xx < HybridBinarizer.BLOCK_SIZE; xx++) {\n const pixel = luminances[offset + xx] & 0xFF;\n sum += pixel;\n // still looking for good contrast\n if (pixel < min) {\n min = pixel;\n }\n if (pixel > max) {\n max = pixel;\n }\n }\n // short-circuit min/max tests once dynamic range is met\n if (max - min > HybridBinarizer.MIN_DYNAMIC_RANGE) {\n // finish the rest of the rows quickly\n for (yy++, offset += width; yy < HybridBinarizer.BLOCK_SIZE; yy++, offset += width) {\n for (let xx = 0; xx < HybridBinarizer.BLOCK_SIZE; xx++) {\n sum += luminances[offset + xx] & 0xFF;\n }\n }\n }\n }\n // The default estimate is the average of the values in the block.\n let average = sum >> (HybridBinarizer.BLOCK_SIZE_POWER * 2);\n if (max - min <= HybridBinarizer.MIN_DYNAMIC_RANGE) {\n // If variation within the block is low, assume this is a block with only light or only\n // dark pixels. In that case we do not want to use the average, as it would divide this\n // low contrast area into black and white pixels, essentially creating data out of noise.\n //\n // The default assumption is that the block is light/background. Since no estimate for\n // the level of dark pixels exists locally, use half the min for the block.\n average = min / 2;\n if (y > 0 && x > 0) {\n // Correct the \"white background\" assumption for blocks that have neighbors by comparing\n // the pixels in this block to the previously calculated black points. This is based on\n // the fact that dark barcode symbology is always surrounded by some amount of light\n // background for which reasonable black point estimates were made. The bp estimated at\n // the boundaries is used for the interior.\n // The (min < bp) is arbitrary but works better than other heuristics that were tried.\n const averageNeighborBlackPoint = (blackPoints[y - 1][x] + (2 * blackPoints[y][x - 1]) + blackPoints[y - 1][x - 1]) / 4;\n if (min < averageNeighborBlackPoint) {\n average = averageNeighborBlackPoint;\n }\n }\n }\n blackPoints[y][x] = average;\n }\n }\n return blackPoints;\n }\n }\n // This class uses 5x5 blocks to compute local luminance, where each block is 8x8 pixels.\n // So this is the smallest dimension in each axis we can accept.\n HybridBinarizer.BLOCK_SIZE_POWER = 3;\n HybridBinarizer.BLOCK_SIZE = 1 << HybridBinarizer.BLOCK_SIZE_POWER; // ...0100...00\n HybridBinarizer.BLOCK_SIZE_MASK = HybridBinarizer.BLOCK_SIZE - 1; // ...0011...11\n HybridBinarizer.MINIMUM_DIMENSION = HybridBinarizer.BLOCK_SIZE * 5;\n HybridBinarizer.MIN_DYNAMIC_RANGE = 24;\n\n /*\n * Copyright 2009 ZXing authors\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 /*namespace com.google.zxing {*/\n /**\n * The purpose of this class hierarchy is to abstract different bitmap implementations across\n * platforms into a standard interface for requesting greyscale luminance values. The interface\n * only provides immutable methods; therefore crop and rotation create copies. This is to ensure\n * that one Reader does not modify the original luminance source and leave it in an unknown state\n * for other Readers in the chain.\n *\n * @author dswitkin@google.com (Daniel Switkin)\n */\n class LuminanceSource {\n constructor(width /*int*/, height /*int*/) {\n this.width = width;\n this.height = height;\n }\n /**\n * @return The width of the bitmap.\n */\n getWidth() {\n return this.width;\n }\n /**\n * @return The height of the bitmap.\n */\n getHeight() {\n return this.height;\n }\n /**\n * @return Whether this subclass supports cropping.\n */\n isCropSupported() {\n return false;\n }\n /**\n * Returns a new object with cropped image data. Implementations may keep a reference to the\n * original data rather than a copy. Only callable if isCropSupported() is true.\n *\n * @param left The left coordinate, which must be in [0,getWidth())\n * @param top The top coordinate, which must be in [0,getHeight())\n * @param width The width of the rectangle to crop.\n * @param height The height of the rectangle to crop.\n * @return A cropped version of this object.\n */\n crop(left /*int*/, top /*int*/, width /*int*/, height /*int*/) {\n throw new UnsupportedOperationException('This luminance source does not support cropping.');\n }\n /**\n * @return Whether this subclass supports counter-clockwise rotation.\n */\n isRotateSupported() {\n return false;\n }\n /**\n * Returns a new object with rotated image data by 90 degrees counterclockwise.\n * Only callable if {@link #isRotateSupported()} is true.\n *\n * @return A rotated version of this object.\n */\n rotateCounterClockwise() {\n throw new UnsupportedOperationException('This luminance source does not support rotation by 90 degrees.');\n }\n /**\n * Returns a new object with rotated image data by 45 degrees counterclockwise.\n * Only callable if {@link #isRotateSupported()} is true.\n *\n * @return A rotated version of this object.\n */\n rotateCounterClockwise45() {\n throw new UnsupportedOperationException('This luminance source does not support rotation by 45 degrees.');\n }\n /*@Override*/\n toString() {\n const row = new Uint8ClampedArray(this.width);\n let result = new StringBuilder();\n for (let y = 0; y < this.height; y++) {\n const sourceRow = this.getRow(y, row);\n for (let x = 0; x < this.width; x++) {\n const luminance = sourceRow[x] & 0xFF;\n let c;\n if (luminance < 0x40) {\n c = '#';\n }\n else if (luminance < 0x80) {\n c = '+';\n }\n else if (luminance < 0xC0) {\n c = '.';\n }\n else {\n c = ' ';\n }\n result.append(c);\n }\n result.append('\\n');\n }\n return result.toString();\n }\n }\n\n /*\n * Copyright 2009 ZXing authors\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 /*namespace com.google.zxing {*/\n /**\n * A wrapper implementation of {@link LuminanceSource} which inverts the luminances it returns -- black becomes\n * white and vice versa, and each value becomes (255-value).\n *\n * @author Sean Owen\n */\n class InvertedLuminanceSource extends LuminanceSource {\n constructor(delegate) {\n super(delegate.getWidth(), delegate.getHeight());\n this.delegate = delegate;\n }\n /*@Override*/\n getRow(y /*int*/, row) {\n const sourceRow = this.delegate.getRow(y, row);\n const width = this.getWidth();\n for (let i = 0; i < width; i++) {\n sourceRow[i] = /*(byte)*/ (255 - (sourceRow[i] & 0xFF));\n }\n return sourceRow;\n }\n /*@Override*/\n getMatrix() {\n const matrix = this.delegate.getMatrix();\n const length = this.getWidth() * this.getHeight();\n const invertedMatrix = new Uint8ClampedArray(length);\n for (let i = 0; i < length; i++) {\n invertedMatrix[i] = /*(byte)*/ (255 - (matrix[i] & 0xFF));\n }\n return invertedMatrix;\n }\n /*@Override*/\n isCropSupported() {\n return this.delegate.isCropSupported();\n }\n /*@Override*/\n crop(left /*int*/, top /*int*/, width /*int*/, height /*int*/) {\n return new InvertedLuminanceSource(this.delegate.crop(left, top, width, height));\n }\n /*@Override*/\n isRotateSupported() {\n return this.delegate.isRotateSupported();\n }\n /**\n * @return original delegate {@link LuminanceSource} since invert undoes itself\n */\n /*@Override*/\n invert() {\n return this.delegate;\n }\n /*@Override*/\n rotateCounterClockwise() {\n return new InvertedLuminanceSource(this.delegate.rotateCounterClockwise());\n }\n /*@Override*/\n rotateCounterClockwise45() {\n return new InvertedLuminanceSource(this.delegate.rotateCounterClockwise45());\n }\n }\n\n /**\n * @deprecated Moving to @zxing/browser\n */\n class HTMLCanvasElementLuminanceSource extends LuminanceSource {\n constructor(canvas) {\n super(canvas.width, canvas.height);\n this.canvas = canvas;\n this.tempCanvasElement = null;\n this.buffer = HTMLCanvasElementLuminanceSource.makeBufferFromCanvasImageData(canvas);\n }\n static makeBufferFromCanvasImageData(canvas) {\n const imageData = canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height);\n return HTMLCanvasElementLuminanceSource.toGrayscaleBuffer(imageData.data, canvas.width, canvas.height);\n }\n static toGrayscaleBuffer(imageBuffer, width, height) {\n const grayscaleBuffer = new Uint8ClampedArray(width * height);\n for (let i = 0, j = 0, length = imageBuffer.length; i < length; i += 4, j++) {\n let gray;\n const alpha = imageBuffer[i + 3];\n // The color of fully-transparent pixels is irrelevant. They are often, technically, fully-transparent\n // black (0 alpha, and then 0 RGB). They are often used, of course as the \"white\" area in a\n // barcode image. Force any such pixel to be white:\n if (alpha === 0) {\n gray = 0xFF;\n }\n else {\n const pixelR = imageBuffer[i];\n const pixelG = imageBuffer[i + 1];\n const pixelB = imageBuffer[i + 2];\n // .299R + 0.587G + 0.114B (YUV/YIQ for PAL and NTSC),\n // (306*R) >> 10 is approximately equal to R*0.299, and so on.\n // 0x200 >> 10 is 0.5, it implements rounding.\n gray = (306 * pixelR +\n 601 * pixelG +\n 117 * pixelB +\n 0x200) >> 10;\n }\n grayscaleBuffer[j] = gray;\n }\n return grayscaleBuffer;\n }\n getRow(y /*int*/, row) {\n if (y < 0 || y >= this.getHeight()) {\n throw new IllegalArgumentException('Requested row is outside the image: ' + y);\n }\n const width = this.getWidth();\n const start = y * width;\n if (row === null) {\n row = this.buffer.slice(start, start + width);\n }\n else {\n if (row.length < width) {\n row = new Uint8ClampedArray(width);\n }\n // The underlying raster of image consists of bytes with the luminance values\n // TODO: can avoid set/slice?\n row.set(this.buffer.slice(start, start + width));\n }\n return row;\n }\n getMatrix() {\n return this.buffer;\n }\n isCropSupported() {\n return true;\n }\n crop(left /*int*/, top /*int*/, width /*int*/, height /*int*/) {\n super.crop(left, top, width, height);\n return this;\n }\n /**\n * This is always true, since the image is a gray-scale image.\n *\n * @return true\n */\n isRotateSupported() {\n return true;\n }\n rotateCounterClockwise() {\n this.rotate(-90);\n return this;\n }\n rotateCounterClockwise45() {\n this.rotate(-45);\n return this;\n }\n getTempCanvasElement() {\n if (null === this.tempCanvasElement) {\n const tempCanvasElement = this.canvas.ownerDocument.createElement('canvas');\n tempCanvasElement.width = this.canvas.width;\n tempCanvasElement.height = this.canvas.height;\n this.tempCanvasElement = tempCanvasElement;\n }\n return this.tempCanvasElement;\n }\n rotate(angle) {\n const tempCanvasElement = this.getTempCanvasElement();\n const tempContext = tempCanvasElement.getContext('2d');\n const angleRadians = angle * HTMLCanvasElementLuminanceSource.DEGREE_TO_RADIANS;\n // Calculate and set new dimensions for temp canvas\n const width = this.canvas.width;\n const height = this.canvas.height;\n const newWidth = Math.ceil(Math.abs(Math.cos(angleRadians)) * width + Math.abs(Math.sin(angleRadians)) * height);\n const newHeight = Math.ceil(Math.abs(Math.sin(angleRadians)) * width + Math.abs(Math.cos(angleRadians)) * height);\n tempCanvasElement.width = newWidth;\n tempCanvasElement.height = newHeight;\n // Draw at center of temp canvas to prevent clipping of image data\n tempContext.translate(newWidth / 2, newHeight / 2);\n tempContext.rotate(angleRadians);\n tempContext.drawImage(this.canvas, width / -2, height / -2);\n this.buffer = HTMLCanvasElementLuminanceSource.makeBufferFromCanvasImageData(tempCanvasElement);\n return this;\n }\n invert() {\n return new InvertedLuminanceSource(this);\n }\n }\n HTMLCanvasElementLuminanceSource.DEGREE_TO_RADIANS = Math.PI / 180;\n\n /**\n * @deprecated Moving to @zxing/browser\n *\n * Video input device metadata containing the id and label of the device if available.\n */\n class VideoInputDevice {\n /**\n * Creates an instance of VideoInputDevice.\n *\n * @param {string} deviceId the video input device id\n * @param {string} label the label of the device if available\n */\n constructor(deviceId, label, groupId) {\n this.deviceId = deviceId;\n this.label = label;\n /** @inheritdoc */\n this.kind = 'videoinput';\n this.groupId = groupId || undefined;\n }\n /** @inheritdoc */\n toJSON() {\n return {\n kind: this.kind,\n groupId: this.groupId,\n deviceId: this.deviceId,\n label: this.label,\n };\n }\n }\n\n var __awaiter = ((globalThis || global || self || window || undefined) && (globalThis || global || self || window || undefined).__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };\n /**\n * @deprecated Moving to @zxing/browser\n *\n * Base class for browser code reader.\n */\n class BrowserCodeReader {\n /**\n * Creates an instance of BrowserCodeReader.\n * @param {Reader} reader The reader instance to decode the barcode\n * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent successful decode tries\n *\n * @memberOf BrowserCodeReader\n */\n constructor(reader, timeBetweenScansMillis = 500, _hints) {\n this.reader = reader;\n this.timeBetweenScansMillis = timeBetweenScansMillis;\n this._hints = _hints;\n /**\n * This will break the loop.\n */\n this._stopContinuousDecode = false;\n /**\n * This will break the loop.\n */\n this._stopAsyncDecode = false;\n /**\n * Delay time between decode attempts made by the scanner.\n */\n this._timeBetweenDecodingAttempts = 0;\n }\n /**\n * If navigator is present.\n */\n get hasNavigator() {\n return typeof navigator !== 'undefined';\n }\n /**\n * If mediaDevices under navigator is supported.\n */\n get isMediaDevicesSuported() {\n return this.hasNavigator && !!navigator.mediaDevices;\n }\n /**\n * If enumerateDevices under navigator is supported.\n */\n get canEnumerateDevices() {\n return !!(this.isMediaDevicesSuported && navigator.mediaDevices.enumerateDevices);\n }\n /** Time between two decoding tries in milli seconds. */\n get timeBetweenDecodingAttempts() {\n return this._timeBetweenDecodingAttempts;\n }\n /**\n * Change the time span the decoder waits between two decoding tries.\n *\n * @param {number} millis Time between two decoding tries in milli seconds.\n */\n set timeBetweenDecodingAttempts(millis) {\n this._timeBetweenDecodingAttempts = millis < 0 ? 0 : millis;\n }\n /**\n * Sets the hints.\n */\n set hints(hints) {\n this._hints = hints || null;\n }\n /**\n * Sets the hints.\n */\n get hints() {\n return this._hints;\n }\n /**\n * Lists all the available video input devices.\n */\n listVideoInputDevices() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.hasNavigator) {\n throw new Error('Can\\'t enumerate devices, navigator is not present.');\n }\n if (!this.canEnumerateDevices) {\n throw new Error('Can\\'t enumerate devices, method not supported.');\n }\n const devices = yield navigator.mediaDevices.enumerateDevices();\n const videoDevices = [];\n for (const device of devices) {\n const kind = device.kind === 'video' ? 'videoinput' : device.kind;\n if (kind !== 'videoinput') {\n continue;\n }\n const deviceId = device.deviceId || device.id;\n const label = device.label || `Video device ${videoDevices.length + 1}`;\n const groupId = device.groupId;\n const videoDevice = { deviceId, label, kind, groupId };\n videoDevices.push(videoDevice);\n }\n return videoDevices;\n });\n }\n /**\n * Obtain the list of available devices with type 'videoinput'.\n *\n * @returns {PromiseEncapsulates the result of decoding a barcode within an image.
\n *\n * @author Sean Owen\n */\n class Result {\n // public constructor(private text: string,\n // Uint8Array rawBytes,\n // ResultPoconst resultPoints: Int32Array,\n // BarcodeFormat format) {\n // this(text, rawBytes, resultPoints, format, System.currentTimeMillis())\n // }\n // public constructor(text: string,\n // Uint8Array rawBytes,\n // ResultPoconst resultPoints: Int32Array,\n // BarcodeFormat format,\n // long timestamp) {\n // this(text, rawBytes, rawBytes == null ? 0 : 8 * rawBytes.length,\n // resultPoints, format, timestamp)\n // }\n constructor(text, rawBytes, numBits = rawBytes == null ? 0 : 8 * rawBytes.length, resultPoints, format, timestamp = System.currentTimeMillis()) {\n this.text = text;\n this.rawBytes = rawBytes;\n this.numBits = numBits;\n this.resultPoints = resultPoints;\n this.format = format;\n this.timestamp = timestamp;\n this.text = text;\n this.rawBytes = rawBytes;\n if (undefined === numBits || null === numBits) {\n this.numBits = (rawBytes === null || rawBytes === undefined) ? 0 : 8 * rawBytes.length;\n }\n else {\n this.numBits = numBits;\n }\n this.resultPoints = resultPoints;\n this.format = format;\n this.resultMetadata = null;\n if (undefined === timestamp || null === timestamp) {\n this.timestamp = System.currentTimeMillis();\n }\n else {\n this.timestamp = timestamp;\n }\n }\n /**\n * @return raw text encoded by the barcode\n */\n getText() {\n return this.text;\n }\n /**\n * @return raw bytes encoded by the barcode, if applicable, otherwise {@code null}\n */\n getRawBytes() {\n return this.rawBytes;\n }\n /**\n * @return how many bits of {@link #getRawBytes()} are valid; typically 8 times its length\n * @since 3.3.0\n */\n getNumBits() {\n return this.numBits;\n }\n /**\n * @return points related to the barcode in the image. These are typically points\n * identifying finder patterns or the corners of the barcode. The exact meaning is\n * specific to the type of barcode that was decoded.\n */\n getResultPoints() {\n return this.resultPoints;\n }\n /**\n * @return {@link BarcodeFormat} representing the format of the barcode that was decoded\n */\n getBarcodeFormat() {\n return this.format;\n }\n /**\n * @return {@link Map} mapping {@link ResultMetadataType} keys to values. May be\n * {@code null}. This contains optional metadata about what was detected about the barcode,\n * like orientation.\n */\n getResultMetadata() {\n return this.resultMetadata;\n }\n putMetadata(type, value) {\n if (this.resultMetadata === null) {\n this.resultMetadata = new Map();\n }\n this.resultMetadata.set(type, value);\n }\n putAllMetadata(metadata) {\n if (metadata !== null) {\n if (this.resultMetadata === null) {\n this.resultMetadata = metadata;\n }\n else {\n this.resultMetadata = new Map(metadata);\n }\n }\n }\n addResultPoints(newPoints) {\n const oldPoints = this.resultPoints;\n if (oldPoints === null) {\n this.resultPoints = newPoints;\n }\n else if (newPoints !== null && newPoints.length > 0) {\n const allPoints = new Array(oldPoints.length + newPoints.length);\n System.arraycopy(oldPoints, 0, allPoints, 0, oldPoints.length);\n System.arraycopy(newPoints, 0, allPoints, oldPoints.length, newPoints.length);\n this.resultPoints = allPoints;\n }\n }\n getTimestamp() {\n return this.timestamp;\n }\n /*@Override*/\n toString() {\n return this.text;\n }\n }\n\n /*\n * Direct port to TypeScript of ZXing by Adrian Toșcă\n */\n /*\n * Copyright 2009 ZXing authors\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 /*namespace com.google.zxing {*/\n /**\n * Enumerates barcode formats known to this package. Please keep alphabetized.\n *\n * @author Sean Owen\n */\n var BarcodeFormat;\n (function (BarcodeFormat) {\n /** Aztec 2D barcode format. */\n BarcodeFormat[BarcodeFormat[\"AZTEC\"] = 0] = \"AZTEC\";\n /** CODABAR 1D format. */\n BarcodeFormat[BarcodeFormat[\"CODABAR\"] = 1] = \"CODABAR\";\n /** Code 39 1D format. */\n BarcodeFormat[BarcodeFormat[\"CODE_39\"] = 2] = \"CODE_39\";\n /** Code 93 1D format. */\n BarcodeFormat[BarcodeFormat[\"CODE_93\"] = 3] = \"CODE_93\";\n /** Code 128 1D format. */\n BarcodeFormat[BarcodeFormat[\"CODE_128\"] = 4] = \"CODE_128\";\n /** Data Matrix 2D barcode format. */\n BarcodeFormat[BarcodeFormat[\"DATA_MATRIX\"] = 5] = \"DATA_MATRIX\";\n /** EAN-8 1D format. */\n BarcodeFormat[BarcodeFormat[\"EAN_8\"] = 6] = \"EAN_8\";\n /** EAN-13 1D format. */\n BarcodeFormat[BarcodeFormat[\"EAN_13\"] = 7] = \"EAN_13\";\n /** ITF (Interleaved Two of Five) 1D format. */\n BarcodeFormat[BarcodeFormat[\"ITF\"] = 8] = \"ITF\";\n /** MaxiCode 2D barcode format. */\n BarcodeFormat[BarcodeFormat[\"MAXICODE\"] = 9] = \"MAXICODE\";\n /** PDF417 format. */\n BarcodeFormat[BarcodeFormat[\"PDF_417\"] = 10] = \"PDF_417\";\n /** QR Code 2D barcode format. */\n BarcodeFormat[BarcodeFormat[\"QR_CODE\"] = 11] = \"QR_CODE\";\n /** RSS 14 */\n BarcodeFormat[BarcodeFormat[\"RSS_14\"] = 12] = \"RSS_14\";\n /** RSS EXPANDED */\n BarcodeFormat[BarcodeFormat[\"RSS_EXPANDED\"] = 13] = \"RSS_EXPANDED\";\n /** UPC-A 1D format. */\n BarcodeFormat[BarcodeFormat[\"UPC_A\"] = 14] = \"UPC_A\";\n /** UPC-E 1D format. */\n BarcodeFormat[BarcodeFormat[\"UPC_E\"] = 15] = \"UPC_E\";\n /** UPC/EAN extension format. Not a stand-alone format. */\n BarcodeFormat[BarcodeFormat[\"UPC_EAN_EXTENSION\"] = 16] = \"UPC_EAN_EXTENSION\";\n })(BarcodeFormat || (BarcodeFormat = {}));\n var BarcodeFormat$1 = BarcodeFormat;\n\n /*\n * Copyright 2008 ZXing authors\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 /*namespace com.google.zxing {*/\n /**\n * Represents some type of metadata about the result of the decoding that the decoder\n * wishes to communicate back to the caller.\n *\n * @author Sean Owen\n */\n var ResultMetadataType;\n (function (ResultMetadataType) {\n /**\n * Unspecified, application-specific metadata. Maps to an unspecified {@link Object}.\n */\n ResultMetadataType[ResultMetadataType[\"OTHER\"] = 0] = \"OTHER\";\n /**\n * Denotes the likely approximate orientation of the barcode in the image. This value\n * is given as degrees rotated clockwise from the normal, upright orientation.\n * For example a 1D barcode which was found by reading top-to-bottom would be\n * said to have orientation \"90\". This key maps to an {@link Integer} whose\n * value is in the range [0,360).\n */\n ResultMetadataType[ResultMetadataType[\"ORIENTATION\"] = 1] = \"ORIENTATION\";\n /**\n *2D barcode formats typically encode text, but allow for a sort of 'byte mode'\n * which is sometimes used to encode binary data. While {@link Result} makes available\n * the complete raw bytes in the barcode for these formats, it does not offer the bytes\n * from the byte segments alone.
\n *\n *This maps to a {@link java.util.List} of byte arrays corresponding to the\n * raw bytes in the byte segments in the barcode, in order.
\n */\n ResultMetadataType[ResultMetadataType[\"BYTE_SEGMENTS\"] = 2] = \"BYTE_SEGMENTS\";\n /**\n * Error correction level used, if applicable. The value type depends on the\n * format, but is typically a String.\n */\n ResultMetadataType[ResultMetadataType[\"ERROR_CORRECTION_LEVEL\"] = 3] = \"ERROR_CORRECTION_LEVEL\";\n /**\n * For some periodicals, indicates the issue number as an {@link Integer}.\n */\n ResultMetadataType[ResultMetadataType[\"ISSUE_NUMBER\"] = 4] = \"ISSUE_NUMBER\";\n /**\n * For some products, indicates the suggested retail price in the barcode as a\n * formatted {@link String}.\n */\n ResultMetadataType[ResultMetadataType[\"SUGGESTED_PRICE\"] = 5] = \"SUGGESTED_PRICE\";\n /**\n * For some products, the possible country of manufacture as a {@link String} denoting the\n * ISO country code. Some map to multiple possible countries, like \"US/CA\".\n */\n ResultMetadataType[ResultMetadataType[\"POSSIBLE_COUNTRY\"] = 6] = \"POSSIBLE_COUNTRY\";\n /**\n * For some products, the extension text\n */\n ResultMetadataType[ResultMetadataType[\"UPC_EAN_EXTENSION\"] = 7] = \"UPC_EAN_EXTENSION\";\n /**\n * PDF417-specific metadata\n */\n ResultMetadataType[ResultMetadataType[\"PDF417_EXTRA_METADATA\"] = 8] = \"PDF417_EXTRA_METADATA\";\n /**\n * If the code format supports structured append and the current scanned code is part of one then the\n * sequence number is given with it.\n */\n ResultMetadataType[ResultMetadataType[\"STRUCTURED_APPEND_SEQUENCE\"] = 9] = \"STRUCTURED_APPEND_SEQUENCE\";\n /**\n * If the code format supports structured append and the current scanned code is part of one then the\n * parity is given with it.\n */\n ResultMetadataType[ResultMetadataType[\"STRUCTURED_APPEND_PARITY\"] = 10] = \"STRUCTURED_APPEND_PARITY\";\n })(ResultMetadataType || (ResultMetadataType = {}));\n var ResultMetadataType$1 = ResultMetadataType;\n\n /*\n * Copyright 2007 ZXing authors\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 /*namespace com.google.zxing.common {*/\n /*import java.util.List;*/\n /**\n *Encapsulates the result of decoding a matrix of bits. This typically\n * applies to 2D barcode formats. For now it contains the raw bytes obtained,\n * as well as a String interpretation of those bytes, if applicable.
\n *\n * @author Sean Owen\n */\n class DecoderResult {\n // public constructor(rawBytes: Uint8Array,\n // text: string,\n // ListThis class contains utility methods for performing mathematical operations over\n * the Galois Fields. Operations use a given primitive polynomial in calculations.
\n *\n *Throughout this package, elements of the GF are represented as an {@code int}\n * for convenience and speed (but at the cost of memory).\n *
\n *\n * @author Sean Owen\n * @author David Olivier\n */\n class AbstractGenericGF {\n /**\n * @return 2 to the power of a in GF(size)\n */\n exp(a) {\n return this.expTable[a];\n }\n /**\n * @return base 2 log of a in GF(size)\n */\n log(a /*int*/) {\n if (a === 0) {\n throw new IllegalArgumentException();\n }\n return this.logTable[a];\n }\n /**\n * Implements both addition and subtraction -- they are the same in GF(size).\n *\n * @return sum/difference of a and b\n */\n static addOrSubtract(a /*int*/, b /*int*/) {\n return a ^ b;\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *Represents a polynomial whose coefficients are elements of a GF.\n * Instances of this class are immutable.
\n *\n *Much credit is due to William Rucklidge since portions of this code are an indirect\n * port of his C++ Reed-Solomon implementation.
\n *\n * @author Sean Owen\n */\n class GenericGFPoly {\n /**\n * @param field the {@link GenericGF} instance representing the field to use\n * to perform computations\n * @param coefficients coefficients as ints representing elements of GF(size), arranged\n * from most significant (highest-power term) coefficient to least significant\n * @throws IllegalArgumentException if argument is null or empty,\n * or if leading coefficient is 0 and this is not a\n * constant polynomial (that is, it is not the monomial \"0\")\n */\n constructor(field, coefficients) {\n if (coefficients.length === 0) {\n throw new IllegalArgumentException();\n }\n this.field = field;\n const coefficientsLength = coefficients.length;\n if (coefficientsLength > 1 && coefficients[0] === 0) {\n // Leading term must be non-zero for anything except the constant polynomial \"0\"\n let firstNonZero = 1;\n while (firstNonZero < coefficientsLength && coefficients[firstNonZero] === 0) {\n firstNonZero++;\n }\n if (firstNonZero === coefficientsLength) {\n this.coefficients = Int32Array.from([0]);\n }\n else {\n this.coefficients = new Int32Array(coefficientsLength - firstNonZero);\n System.arraycopy(coefficients, firstNonZero, this.coefficients, 0, this.coefficients.length);\n }\n }\n else {\n this.coefficients = coefficients;\n }\n }\n getCoefficients() {\n return this.coefficients;\n }\n /**\n * @return degree of this polynomial\n */\n getDegree() {\n return this.coefficients.length - 1;\n }\n /**\n * @return true iff this polynomial is the monomial \"0\"\n */\n isZero() {\n return this.coefficients[0] === 0;\n }\n /**\n * @return coefficient of x^degree term in this polynomial\n */\n getCoefficient(degree /*int*/) {\n return this.coefficients[this.coefficients.length - 1 - degree];\n }\n /**\n * @return evaluation of this polynomial at a given point\n */\n evaluateAt(a /*int*/) {\n if (a === 0) {\n // Just return the x^0 coefficient\n return this.getCoefficient(0);\n }\n const coefficients = this.coefficients;\n let result;\n if (a === 1) {\n // Just the sum of the coefficients\n result = 0;\n for (let i = 0, length = coefficients.length; i !== length; i++) {\n const coefficient = coefficients[i];\n result = AbstractGenericGF.addOrSubtract(result, coefficient);\n }\n return result;\n }\n result = coefficients[0];\n const size = coefficients.length;\n const field = this.field;\n for (let i = 1; i < size; i++) {\n result = AbstractGenericGF.addOrSubtract(field.multiply(a, result), coefficients[i]);\n }\n return result;\n }\n addOrSubtract(other) {\n if (!this.field.equals(other.field)) {\n throw new IllegalArgumentException('GenericGFPolys do not have same GenericGF field');\n }\n if (this.isZero()) {\n return other;\n }\n if (other.isZero()) {\n return this;\n }\n let smallerCoefficients = this.coefficients;\n let largerCoefficients = other.coefficients;\n if (smallerCoefficients.length > largerCoefficients.length) {\n const temp = smallerCoefficients;\n smallerCoefficients = largerCoefficients;\n largerCoefficients = temp;\n }\n let sumDiff = new Int32Array(largerCoefficients.length);\n const lengthDiff = largerCoefficients.length - smallerCoefficients.length;\n // Copy high-order terms only found in higher-degree polynomial's coefficients\n System.arraycopy(largerCoefficients, 0, sumDiff, 0, lengthDiff);\n for (let i = lengthDiff; i < largerCoefficients.length; i++) {\n sumDiff[i] = AbstractGenericGF.addOrSubtract(smallerCoefficients[i - lengthDiff], largerCoefficients[i]);\n }\n return new GenericGFPoly(this.field, sumDiff);\n }\n multiply(other) {\n if (!this.field.equals(other.field)) {\n throw new IllegalArgumentException('GenericGFPolys do not have same GenericGF field');\n }\n if (this.isZero() || other.isZero()) {\n return this.field.getZero();\n }\n const aCoefficients = this.coefficients;\n const aLength = aCoefficients.length;\n const bCoefficients = other.coefficients;\n const bLength = bCoefficients.length;\n const product = new Int32Array(aLength + bLength - 1);\n const field = this.field;\n for (let i = 0; i < aLength; i++) {\n const aCoeff = aCoefficients[i];\n for (let j = 0; j < bLength; j++) {\n product[i + j] = AbstractGenericGF.addOrSubtract(product[i + j], field.multiply(aCoeff, bCoefficients[j]));\n }\n }\n return new GenericGFPoly(field, product);\n }\n multiplyScalar(scalar /*int*/) {\n if (scalar === 0) {\n return this.field.getZero();\n }\n if (scalar === 1) {\n return this;\n }\n const size = this.coefficients.length;\n const field = this.field;\n const product = new Int32Array(size);\n const coefficients = this.coefficients;\n for (let i = 0; i < size; i++) {\n product[i] = field.multiply(coefficients[i], scalar);\n }\n return new GenericGFPoly(field, product);\n }\n multiplyByMonomial(degree /*int*/, coefficient /*int*/) {\n if (degree < 0) {\n throw new IllegalArgumentException();\n }\n if (coefficient === 0) {\n return this.field.getZero();\n }\n const coefficients = this.coefficients;\n const size = coefficients.length;\n const product = new Int32Array(size + degree);\n const field = this.field;\n for (let i = 0; i < size; i++) {\n product[i] = field.multiply(coefficients[i], coefficient);\n }\n return new GenericGFPoly(field, product);\n }\n divide(other) {\n if (!this.field.equals(other.field)) {\n throw new IllegalArgumentException('GenericGFPolys do not have same GenericGF field');\n }\n if (other.isZero()) {\n throw new IllegalArgumentException('Divide by 0');\n }\n const field = this.field;\n let quotient = field.getZero();\n let remainder = this;\n const denominatorLeadingTerm = other.getCoefficient(other.getDegree());\n const inverseDenominatorLeadingTerm = field.inverse(denominatorLeadingTerm);\n while (remainder.getDegree() >= other.getDegree() && !remainder.isZero()) {\n const degreeDifference = remainder.getDegree() - other.getDegree();\n const scale = field.multiply(remainder.getCoefficient(remainder.getDegree()), inverseDenominatorLeadingTerm);\n const term = other.multiplyByMonomial(degreeDifference, scale);\n const iterationQuotient = field.buildMonomial(degreeDifference, scale);\n quotient = quotient.addOrSubtract(iterationQuotient);\n remainder = remainder.addOrSubtract(term);\n }\n return [quotient, remainder];\n }\n /*@Override*/\n toString() {\n let result = '';\n for (let degree = this.getDegree(); degree >= 0; degree--) {\n let coefficient = this.getCoefficient(degree);\n if (coefficient !== 0) {\n if (coefficient < 0) {\n result += ' - ';\n coefficient = -coefficient;\n }\n else {\n if (result.length > 0) {\n result += ' + ';\n }\n }\n if (degree === 0 || coefficient !== 1) {\n const alphaPower = this.field.log(coefficient);\n if (alphaPower === 0) {\n result += '1';\n }\n else if (alphaPower === 1) {\n result += 'a';\n }\n else {\n result += 'a^';\n result += alphaPower;\n }\n }\n if (degree !== 0) {\n if (degree === 1) {\n result += 'x';\n }\n else {\n result += 'x^';\n result += degree;\n }\n }\n }\n }\n return result;\n }\n }\n\n /**\n * Custom Error class of type Exception.\n */\n class ArithmeticException extends Exception {\n }\n ArithmeticException.kind = 'ArithmeticException';\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *This class contains utility methods for performing mathematical operations over\n * the Galois Fields. Operations use a given primitive polynomial in calculations.
\n *\n *Throughout this package, elements of the GF are represented as an {@code int}\n * for convenience and speed (but at the cost of memory).\n *
\n *\n * @author Sean Owen\n * @author David Olivier\n */\n class GenericGF extends AbstractGenericGF {\n /**\n * Create a representation of GF(size) using the given primitive polynomial.\n *\n * @param primitive irreducible polynomial whose coefficients are represented by\n * the bits of an int, where the least-significant bit represents the constant\n * coefficient\n * @param size the size of the field\n * @param b the factor b in the generator polynomial can be 0- or 1-based\n * (g(x) = (x+a^b)(x+a^(b+1))...(x+a^(b+2t-1))).\n * In most cases it should be 1, but for QR code it is 0.\n */\n constructor(primitive /*int*/, size /*int*/, generatorBase /*int*/) {\n super();\n this.primitive = primitive;\n this.size = size;\n this.generatorBase = generatorBase;\n const expTable = new Int32Array(size);\n let x = 1;\n for (let i = 0; i < size; i++) {\n expTable[i] = x;\n x *= 2; // we're assuming the generator alpha is 2\n if (x >= size) {\n x ^= primitive;\n x &= size - 1;\n }\n }\n this.expTable = expTable;\n const logTable = new Int32Array(size);\n for (let i = 0; i < size - 1; i++) {\n logTable[expTable[i]] = i;\n }\n this.logTable = logTable;\n // logTable[0] == 0 but this should never be used\n this.zero = new GenericGFPoly(this, Int32Array.from([0]));\n this.one = new GenericGFPoly(this, Int32Array.from([1]));\n }\n getZero() {\n return this.zero;\n }\n getOne() {\n return this.one;\n }\n /**\n * @return the monomial representing coefficient * x^degree\n */\n buildMonomial(degree /*int*/, coefficient /*int*/) {\n if (degree < 0) {\n throw new IllegalArgumentException();\n }\n if (coefficient === 0) {\n return this.zero;\n }\n const coefficients = new Int32Array(degree + 1);\n coefficients[0] = coefficient;\n return new GenericGFPoly(this, coefficients);\n }\n /**\n * @return multiplicative inverse of a\n */\n inverse(a /*int*/) {\n if (a === 0) {\n throw new ArithmeticException();\n }\n return this.expTable[this.size - this.logTable[a] - 1];\n }\n /**\n * @return product of a and b in GF(size)\n */\n multiply(a /*int*/, b /*int*/) {\n if (a === 0 || b === 0) {\n return 0;\n }\n return this.expTable[(this.logTable[a] + this.logTable[b]) % (this.size - 1)];\n }\n getSize() {\n return this.size;\n }\n getGeneratorBase() {\n return this.generatorBase;\n }\n /*@Override*/\n toString() {\n return ('GF(0x' + Integer.toHexString(this.primitive) + ',' + this.size + ')');\n }\n equals(o) {\n return o === this;\n }\n }\n GenericGF.AZTEC_DATA_12 = new GenericGF(0x1069, 4096, 1); // x^12 + x^6 + x^5 + x^3 + 1\n GenericGF.AZTEC_DATA_10 = new GenericGF(0x409, 1024, 1); // x^10 + x^3 + 1\n GenericGF.AZTEC_DATA_6 = new GenericGF(0x43, 64, 1); // x^6 + x + 1\n GenericGF.AZTEC_PARAM = new GenericGF(0x13, 16, 1); // x^4 + x + 1\n GenericGF.QR_CODE_FIELD_256 = new GenericGF(0x011d, 256, 0); // x^8 + x^4 + x^3 + x^2 + 1\n GenericGF.DATA_MATRIX_FIELD_256 = new GenericGF(0x012d, 256, 1); // x^8 + x^5 + x^3 + x^2 + 1\n GenericGF.AZTEC_DATA_8 = GenericGF.DATA_MATRIX_FIELD_256;\n GenericGF.MAXICODE_FIELD_64 = GenericGF.AZTEC_DATA_6;\n\n /**\n * Custom Error class of type Exception.\n */\n class ReedSolomonException extends Exception {\n }\n ReedSolomonException.kind = 'ReedSolomonException';\n\n /**\n * Custom Error class of type Exception.\n */\n class IllegalStateException extends Exception {\n }\n IllegalStateException.kind = 'IllegalStateException';\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *Implements Reed-Solomon decoding, as the name implies.
\n *\n *The algorithm will not be explained here, but the following references were helpful\n * in creating this implementation:
\n *\n *Much credit is due to William Rucklidge since portions of this code are an indirect\n * port of his C++ Reed-Solomon implementation.
\n *\n * @author Sean Owen\n * @author William Rucklidge\n * @author sanfordsquires\n */\n class ReedSolomonDecoder {\n constructor(field) {\n this.field = field;\n }\n /**\n *Decodes given set of received codewords, which include both data and error-correction\n * codewords. Really, this means it uses Reed-Solomon to detect and correct errors, in-place,\n * in the input.
\n *\n * @param received data and error-correction codewords\n * @param twoS number of error-correction codewords available\n * @throws ReedSolomonException if decoding fails for any reason\n */\n decode(received, twoS /*int*/) {\n const field = this.field;\n const poly = new GenericGFPoly(field, received);\n const syndromeCoefficients = new Int32Array(twoS);\n let noError = true;\n for (let i = 0; i < twoS; i++) {\n const evalResult = poly.evaluateAt(field.exp(i + field.getGeneratorBase()));\n syndromeCoefficients[syndromeCoefficients.length - 1 - i] = evalResult;\n if (evalResult !== 0) {\n noError = false;\n }\n }\n if (noError) {\n return;\n }\n const syndrome = new GenericGFPoly(field, syndromeCoefficients);\n const sigmaOmega = this.runEuclideanAlgorithm(field.buildMonomial(twoS, 1), syndrome, twoS);\n const sigma = sigmaOmega[0];\n const omega = sigmaOmega[1];\n const errorLocations = this.findErrorLocations(sigma);\n const errorMagnitudes = this.findErrorMagnitudes(omega, errorLocations);\n for (let i = 0; i < errorLocations.length; i++) {\n const position = received.length - 1 - field.log(errorLocations[i]);\n if (position < 0) {\n throw new ReedSolomonException('Bad error location');\n }\n received[position] = GenericGF.addOrSubtract(received[position], errorMagnitudes[i]);\n }\n }\n runEuclideanAlgorithm(a, b, R /*int*/) {\n // Assume a's degree is >= b's\n if (a.getDegree() < b.getDegree()) {\n const temp = a;\n a = b;\n b = temp;\n }\n const field = this.field;\n let rLast = a;\n let r = b;\n let tLast = field.getZero();\n let t = field.getOne();\n // Run Euclidean algorithm until r's degree is less than R/2\n while (r.getDegree() >= (R / 2 | 0)) {\n let rLastLast = rLast;\n let tLastLast = tLast;\n rLast = r;\n tLast = t;\n // Divide rLastLast by rLast, with quotient in q and remainder in r\n if (rLast.isZero()) {\n // Oops, Euclidean algorithm already terminated?\n throw new ReedSolomonException('r_{i-1} was zero');\n }\n r = rLastLast;\n let q = field.getZero();\n const denominatorLeadingTerm = rLast.getCoefficient(rLast.getDegree());\n const dltInverse = field.inverse(denominatorLeadingTerm);\n while (r.getDegree() >= rLast.getDegree() && !r.isZero()) {\n const degreeDiff = r.getDegree() - rLast.getDegree();\n const scale = field.multiply(r.getCoefficient(r.getDegree()), dltInverse);\n q = q.addOrSubtract(field.buildMonomial(degreeDiff, scale));\n r = r.addOrSubtract(rLast.multiplyByMonomial(degreeDiff, scale));\n }\n t = q.multiply(tLast).addOrSubtract(tLastLast);\n if (r.getDegree() >= rLast.getDegree()) {\n throw new IllegalStateException('Division algorithm failed to reduce polynomial?');\n }\n }\n const sigmaTildeAtZero = t.getCoefficient(0);\n if (sigmaTildeAtZero === 0) {\n throw new ReedSolomonException('sigmaTilde(0) was zero');\n }\n const inverse = field.inverse(sigmaTildeAtZero);\n const sigma = t.multiplyScalar(inverse);\n const omega = r.multiplyScalar(inverse);\n return [sigma, omega];\n }\n findErrorLocations(errorLocator) {\n // This is a direct application of Chien's search\n const numErrors = errorLocator.getDegree();\n if (numErrors === 1) { // shortcut\n return Int32Array.from([errorLocator.getCoefficient(1)]);\n }\n const result = new Int32Array(numErrors);\n let e = 0;\n const field = this.field;\n for (let i = 1; i < field.getSize() && e < numErrors; i++) {\n if (errorLocator.evaluateAt(i) === 0) {\n result[e] = field.inverse(i);\n e++;\n }\n }\n if (e !== numErrors) {\n throw new ReedSolomonException('Error locator degree does not match number of roots');\n }\n return result;\n }\n findErrorMagnitudes(errorEvaluator, errorLocations) {\n // This is directly applying Forney's Formula\n const s = errorLocations.length;\n const result = new Int32Array(s);\n const field = this.field;\n for (let i = 0; i < s; i++) {\n const xiInverse = field.inverse(errorLocations[i]);\n let denominator = 1;\n for (let j = 0; j < s; j++) {\n if (i !== j) {\n // denominator = field.multiply(denominator,\n // GenericGF.addOrSubtract(1, field.multiply(errorLocations[j], xiInverse)))\n // Above should work but fails on some Apple and Linux JDKs due to a Hotspot bug.\n // Below is a funny-looking workaround from Steven Parkes\n const term = field.multiply(errorLocations[j], xiInverse);\n const termPlus1 = (term & 0x1) === 0 ? term | 1 : term & ~1;\n denominator = field.multiply(denominator, termPlus1);\n }\n }\n result[i] = field.multiply(errorEvaluator.evaluateAt(xiInverse), field.inverse(denominator));\n if (field.getGeneratorBase() !== 0) {\n result[i] = field.multiply(result[i], xiInverse);\n }\n }\n return result;\n }\n }\n\n /*\n * Copyright 2010 ZXing authors\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 // import java.util.Arrays;\n var Table;\n (function (Table) {\n Table[Table[\"UPPER\"] = 0] = \"UPPER\";\n Table[Table[\"LOWER\"] = 1] = \"LOWER\";\n Table[Table[\"MIXED\"] = 2] = \"MIXED\";\n Table[Table[\"DIGIT\"] = 3] = \"DIGIT\";\n Table[Table[\"PUNCT\"] = 4] = \"PUNCT\";\n Table[Table[\"BINARY\"] = 5] = \"BINARY\";\n })(Table || (Table = {}));\n /**\n *The main class which implements Aztec Code decoding -- as opposed to locating and extracting\n * the Aztec Code from an image.
\n *\n * @author David Olivier\n */\n class Decoder {\n decode(detectorResult) {\n this.ddata = detectorResult;\n let matrix = detectorResult.getBits();\n let rawbits = this.extractBits(matrix);\n let correctedBits = this.correctBits(rawbits);\n let rawBytes = Decoder.convertBoolArrayToByteArray(correctedBits);\n let result = Decoder.getEncodedData(correctedBits);\n let decoderResult = new DecoderResult(rawBytes, result, null, null);\n decoderResult.setNumBits(correctedBits.length);\n return decoderResult;\n }\n // This method is used for testing the high-level encoder\n static highLevelDecode(correctedBits) {\n return this.getEncodedData(correctedBits);\n }\n /**\n * Gets the string encoded in the aztec code bits\n *\n * @return the decoded string\n */\n static getEncodedData(correctedBits) {\n let endIndex = correctedBits.length;\n let latchTable = Table.UPPER; // table most recently latched to\n let shiftTable = Table.UPPER; // table to use for the next read\n let result = '';\n let index = 0;\n while (index < endIndex) {\n if (shiftTable === Table.BINARY) {\n if (endIndex - index < 5) {\n break;\n }\n let length = Decoder.readCode(correctedBits, index, 5);\n index += 5;\n if (length === 0) {\n if (endIndex - index < 11) {\n break;\n }\n length = Decoder.readCode(correctedBits, index, 11) + 31;\n index += 11;\n }\n for (let charCount = 0; charCount < length; charCount++) {\n if (endIndex - index < 8) {\n index = endIndex; // Force outer loop to exit\n break;\n }\n const code = Decoder.readCode(correctedBits, index, 8);\n result += /*(char)*/ StringUtils.castAsNonUtf8Char(code);\n index += 8;\n }\n // Go back to whatever mode we had been in\n shiftTable = latchTable;\n }\n else {\n let size = shiftTable === Table.DIGIT ? 4 : 5;\n if (endIndex - index < size) {\n break;\n }\n let code = Decoder.readCode(correctedBits, index, size);\n index += size;\n let str = Decoder.getCharacter(shiftTable, code);\n if (str.startsWith('CTRL_')) {\n // Table changes\n // ISO/IEC 24778:2008 prescribes ending a shift sequence in the mode from which it was invoked.\n // That's including when that mode is a shift.\n // Our test case dlusbs.png for issue #642 exercises that.\n latchTable = shiftTable; // Latch the current mode, so as to return to Upper after U/S B/S\n shiftTable = Decoder.getTable(str.charAt(5));\n if (str.charAt(6) === 'L') {\n latchTable = shiftTable;\n }\n }\n else {\n result += str;\n // Go back to whatever mode we had been in\n shiftTable = latchTable;\n }\n }\n }\n return result;\n }\n /**\n * gets the table corresponding to the char passed\n */\n static getTable(t) {\n switch (t) {\n case 'L':\n return Table.LOWER;\n case 'P':\n return Table.PUNCT;\n case 'M':\n return Table.MIXED;\n case 'D':\n return Table.DIGIT;\n case 'B':\n return Table.BINARY;\n case 'U':\n default:\n return Table.UPPER;\n }\n }\n /**\n * Gets the character (or string) corresponding to the passed code in the given table\n *\n * @param table the table used\n * @param code the code of the character\n */\n static getCharacter(table, code) {\n switch (table) {\n case Table.UPPER:\n return Decoder.UPPER_TABLE[code];\n case Table.LOWER:\n return Decoder.LOWER_TABLE[code];\n case Table.MIXED:\n return Decoder.MIXED_TABLE[code];\n case Table.PUNCT:\n return Decoder.PUNCT_TABLE[code];\n case Table.DIGIT:\n return Decoder.DIGIT_TABLE[code];\n default:\n // Should not reach here.\n throw new IllegalStateException('Bad table');\n }\n }\n /**\n *Performs RS error correction on an array of bits.
\n *\n * @return the corrected array\n * @throws FormatException if the input contains too many errors\n */\n correctBits(rawbits) {\n let gf;\n let codewordSize;\n if (this.ddata.getNbLayers() <= 2) {\n codewordSize = 6;\n gf = GenericGF.AZTEC_DATA_6;\n }\n else if (this.ddata.getNbLayers() <= 8) {\n codewordSize = 8;\n gf = GenericGF.AZTEC_DATA_8;\n }\n else if (this.ddata.getNbLayers() <= 22) {\n codewordSize = 10;\n gf = GenericGF.AZTEC_DATA_10;\n }\n else {\n codewordSize = 12;\n gf = GenericGF.AZTEC_DATA_12;\n }\n let numDataCodewords = this.ddata.getNbDatablocks();\n let numCodewords = rawbits.length / codewordSize;\n if (numCodewords < numDataCodewords) {\n throw new FormatException();\n }\n let offset = rawbits.length % codewordSize;\n let dataWords = new Int32Array(numCodewords);\n for (let i = 0; i < numCodewords; i++, offset += codewordSize) {\n dataWords[i] = Decoder.readCode(rawbits, offset, codewordSize);\n }\n try {\n let rsDecoder = new ReedSolomonDecoder(gf);\n rsDecoder.decode(dataWords, numCodewords - numDataCodewords);\n }\n catch (ex) {\n throw new FormatException(ex);\n }\n // Now perform the unstuffing operation.\n // First, count how many bits are going to be thrown out as stuffing\n let mask = (1 << codewordSize) - 1;\n let stuffedBits = 0;\n for (let i = 0; i < numDataCodewords; i++) {\n let dataWord = dataWords[i];\n if (dataWord === 0 || dataWord === mask) {\n throw new FormatException();\n }\n else if (dataWord === 1 || dataWord === mask - 1) {\n stuffedBits++;\n }\n }\n // Now, actually unpack the bits and remove the stuffing\n let correctedBits = new Array(numDataCodewords * codewordSize - stuffedBits);\n let index = 0;\n for (let i = 0; i < numDataCodewords; i++) {\n let dataWord = dataWords[i];\n if (dataWord === 1 || dataWord === mask - 1) {\n // next codewordSize-1 bits are all zeros or all ones\n correctedBits.fill(dataWord > 1, index, index + codewordSize - 1);\n // Arrays.fill(correctedBits, index, index + codewordSize - 1, dataWord > 1);\n index += codewordSize - 1;\n }\n else {\n for (let bit = codewordSize - 1; bit >= 0; --bit) {\n correctedBits[index++] = (dataWord & (1 << bit)) !== 0;\n }\n }\n }\n return correctedBits;\n }\n /**\n * Gets the array of bits from an Aztec Code matrix\n *\n * @return the array of bits\n */\n extractBits(matrix) {\n let compact = this.ddata.isCompact();\n let layers = this.ddata.getNbLayers();\n let baseMatrixSize = (compact ? 11 : 14) + layers * 4; // not including alignment lines\n let alignmentMap = new Int32Array(baseMatrixSize);\n let rawbits = new Array(this.totalBitsInLayer(layers, compact));\n if (compact) {\n for (let i = 0; i < alignmentMap.length; i++) {\n alignmentMap[i] = i;\n }\n }\n else {\n let matrixSize = baseMatrixSize + 1 + 2 * Integer.truncDivision((Integer.truncDivision(baseMatrixSize, 2) - 1), 15);\n let origCenter = baseMatrixSize / 2;\n let center = Integer.truncDivision(matrixSize, 2);\n for (let i = 0; i < origCenter; i++) {\n let newOffset = i + Integer.truncDivision(i, 15);\n alignmentMap[origCenter - i - 1] = center - newOffset - 1;\n alignmentMap[origCenter + i] = center + newOffset + 1;\n }\n }\n for (let i = 0, rowOffset = 0; i < layers; i++) {\n let rowSize = (layers - i) * 4 + (compact ? 9 : 12);\n // The top-left most point of this layer isEncapsulates a point of interest in an image containing a barcode. Typically, this\n * would be the location of a finder pattern or the corner of the barcode, for example.
\n *\n * @author Sean Owen\n */\n class ResultPoint {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n }\n getX() {\n return this.x;\n }\n getY() {\n return this.y;\n }\n /*@Override*/\n equals(other) {\n if (other instanceof ResultPoint) {\n const otherPoint = other;\n return this.x === otherPoint.x && this.y === otherPoint.y;\n }\n return false;\n }\n /*@Override*/\n hashCode() {\n return 31 * Float.floatToIntBits(this.x) + Float.floatToIntBits(this.y);\n }\n /*@Override*/\n toString() {\n return '(' + this.x + ',' + this.y + ')';\n }\n /**\n * Orders an array of three ResultPoints in an order [A,B,C] such that AB is less than AC\n * and BC is less than AC, and the angle between BC and BA is less than 180 degrees.\n *\n * @param patterns array of three {@code ResultPoint} to order\n */\n static orderBestPatterns(patterns) {\n // Find distances between pattern centers\n const zeroOneDistance = this.distance(patterns[0], patterns[1]);\n const oneTwoDistance = this.distance(patterns[1], patterns[2]);\n const zeroTwoDistance = this.distance(patterns[0], patterns[2]);\n let pointA;\n let pointB;\n let pointC;\n // Assume one closest to other two is B; A and C will just be guesses at first\n if (oneTwoDistance >= zeroOneDistance && oneTwoDistance >= zeroTwoDistance) {\n pointB = patterns[0];\n pointA = patterns[1];\n pointC = patterns[2];\n }\n else if (zeroTwoDistance >= oneTwoDistance && zeroTwoDistance >= zeroOneDistance) {\n pointB = patterns[1];\n pointA = patterns[0];\n pointC = patterns[2];\n }\n else {\n pointB = patterns[2];\n pointA = patterns[0];\n pointC = patterns[1];\n }\n // Use cross product to figure out whether A and C are correct or flipped.\n // This asks whether BC x BA has a positive z component, which is the arrangement\n // we want for A, B, C. If it's negative, then we've got it flipped around and\n // should swap A and C.\n if (this.crossProductZ(pointA, pointB, pointC) < 0.0) {\n const temp = pointA;\n pointA = pointC;\n pointC = temp;\n }\n patterns[0] = pointA;\n patterns[1] = pointB;\n patterns[2] = pointC;\n }\n /**\n * @param pattern1 first pattern\n * @param pattern2 second pattern\n * @return distance between two points\n */\n static distance(pattern1, pattern2) {\n return MathUtils.distance(pattern1.x, pattern1.y, pattern2.x, pattern2.y);\n }\n /**\n * Returns the z component of the cross product between vectors BC and BA.\n */\n static crossProductZ(pointA, pointB, pointC) {\n const bX = pointB.x;\n const bY = pointB.y;\n return ((pointC.x - bX) * (pointA.y - bY)) - ((pointC.y - bY) * (pointA.x - bX));\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *Encapsulates the result of detecting a barcode in an image. This includes the raw\n * matrix of black/white pixels corresponding to the barcode, and possibly points of interest\n * in the image, like the location of finder patterns or corners of the barcode in the image.
\n *\n * @author Sean Owen\n */\n class DetectorResult {\n constructor(bits, points) {\n this.bits = bits;\n this.points = points;\n }\n getBits() {\n return this.bits;\n }\n getPoints() {\n return this.points;\n }\n }\n\n /*\n * Copyright 2010 ZXing authors\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 /**\n *Extends {@link DetectorResult} with more information specific to the Aztec format,\n * like the number of layers and whether it's compact.
\n *\n * @author Sean Owen\n */\n class AztecDetectorResult extends DetectorResult {\n constructor(bits, points, compact, nbDatablocks, nbLayers) {\n super(bits, points);\n this.compact = compact;\n this.nbDatablocks = nbDatablocks;\n this.nbLayers = nbLayers;\n }\n getNbLayers() {\n return this.nbLayers;\n }\n getNbDatablocks() {\n return this.nbDatablocks;\n }\n isCompact() {\n return this.compact;\n }\n }\n\n /*\n * Copyright 2010 ZXing authors\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 /**\n *\n * Detects a candidate barcode-like rectangular region within an image. It\n * starts around the center of the image, increases the size of the candidate\n * region until it finds a white rectangular region. By keeping track of the\n * last black points it encountered, it determines the corners of the barcode.\n *
\n *\n * @author David Olivier\n */\n class WhiteRectangleDetector {\n // public constructor(private image: BitMatrix) /*throws NotFoundException*/ {\n // this(image, INIT_SIZE, image.getWidth() / 2, image.getHeight() / 2)\n // }\n /**\n * @param image barcode image to find a rectangle in\n * @param initSize initial size of search area around center\n * @param x x position of search center\n * @param y y position of search center\n * @throws NotFoundException if image is too small to accommodate {@code initSize}\n */\n constructor(image, initSize /*int*/, x /*int*/, y /*int*/) {\n this.image = image;\n this.height = image.getHeight();\n this.width = image.getWidth();\n if (undefined === initSize || null === initSize) {\n initSize = WhiteRectangleDetector.INIT_SIZE;\n }\n if (undefined === x || null === x) {\n x = image.getWidth() / 2 | 0;\n }\n if (undefined === y || null === y) {\n y = image.getHeight() / 2 | 0;\n }\n const halfsize = initSize / 2 | 0;\n this.leftInit = x - halfsize;\n this.rightInit = x + halfsize;\n this.upInit = y - halfsize;\n this.downInit = y + halfsize;\n if (this.upInit < 0 || this.leftInit < 0 || this.downInit >= this.height || this.rightInit >= this.width) {\n throw new NotFoundException();\n }\n }\n /**\n *\n * Detects a candidate barcode-like rectangular region within an image. It\n * starts around the center of the image, increases the size of the candidate\n * region until it finds a white rectangular region.\n *
\n *\n * @return {@link ResultPoint}[] describing the corners of the rectangular\n * region. The first and last points are opposed on the diagonal, as\n * are the second and third. The first point will be the topmost\n * point and the last, the bottommost. The second point will be\n * leftmost and the third, the rightmost\n * @throws NotFoundException if no Data Matrix Code can be found\n */\n detect() {\n let left = this.leftInit;\n let right = this.rightInit;\n let up = this.upInit;\n let down = this.downInit;\n let sizeExceeded = false;\n let aBlackPointFoundOnBorder = true;\n let atLeastOneBlackPointFoundOnBorder = false;\n let atLeastOneBlackPointFoundOnRight = false;\n let atLeastOneBlackPointFoundOnBottom = false;\n let atLeastOneBlackPointFoundOnLeft = false;\n let atLeastOneBlackPointFoundOnTop = false;\n const width = this.width;\n const height = this.height;\n while (aBlackPointFoundOnBorder) {\n aBlackPointFoundOnBorder = false;\n // .....\n // . |\n // .....\n let rightBorderNotWhite = true;\n while ((rightBorderNotWhite || !atLeastOneBlackPointFoundOnRight) && right < width) {\n rightBorderNotWhite = this.containsBlackPoint(up, down, right, false);\n if (rightBorderNotWhite) {\n right++;\n aBlackPointFoundOnBorder = true;\n atLeastOneBlackPointFoundOnRight = true;\n }\n else if (!atLeastOneBlackPointFoundOnRight) {\n right++;\n }\n }\n if (right >= width) {\n sizeExceeded = true;\n break;\n }\n // .....\n // . .\n // .___.\n let bottomBorderNotWhite = true;\n while ((bottomBorderNotWhite || !atLeastOneBlackPointFoundOnBottom) && down < height) {\n bottomBorderNotWhite = this.containsBlackPoint(left, right, down, true);\n if (bottomBorderNotWhite) {\n down++;\n aBlackPointFoundOnBorder = true;\n atLeastOneBlackPointFoundOnBottom = true;\n }\n else if (!atLeastOneBlackPointFoundOnBottom) {\n down++;\n }\n }\n if (down >= height) {\n sizeExceeded = true;\n break;\n }\n // .....\n // | .\n // .....\n let leftBorderNotWhite = true;\n while ((leftBorderNotWhite || !atLeastOneBlackPointFoundOnLeft) && left >= 0) {\n leftBorderNotWhite = this.containsBlackPoint(up, down, left, false);\n if (leftBorderNotWhite) {\n left--;\n aBlackPointFoundOnBorder = true;\n atLeastOneBlackPointFoundOnLeft = true;\n }\n else if (!atLeastOneBlackPointFoundOnLeft) {\n left--;\n }\n }\n if (left < 0) {\n sizeExceeded = true;\n break;\n }\n // .___.\n // . .\n // .....\n let topBorderNotWhite = true;\n while ((topBorderNotWhite || !atLeastOneBlackPointFoundOnTop) && up >= 0) {\n topBorderNotWhite = this.containsBlackPoint(left, right, up, true);\n if (topBorderNotWhite) {\n up--;\n aBlackPointFoundOnBorder = true;\n atLeastOneBlackPointFoundOnTop = true;\n }\n else if (!atLeastOneBlackPointFoundOnTop) {\n up--;\n }\n }\n if (up < 0) {\n sizeExceeded = true;\n break;\n }\n if (aBlackPointFoundOnBorder) {\n atLeastOneBlackPointFoundOnBorder = true;\n }\n }\n if (!sizeExceeded && atLeastOneBlackPointFoundOnBorder) {\n const maxSize = right - left;\n let z = null;\n for (let i = 1; z === null && i < maxSize; i++) {\n z = this.getBlackPointOnSegment(left, down - i, left + i, down);\n }\n if (z == null) {\n throw new NotFoundException();\n }\n let t = null;\n // go down right\n for (let i = 1; t === null && i < maxSize; i++) {\n t = this.getBlackPointOnSegment(left, up + i, left + i, up);\n }\n if (t == null) {\n throw new NotFoundException();\n }\n let x = null;\n // go down left\n for (let i = 1; x === null && i < maxSize; i++) {\n x = this.getBlackPointOnSegment(right, up + i, right - i, up);\n }\n if (x == null) {\n throw new NotFoundException();\n }\n let y = null;\n // go up left\n for (let i = 1; y === null && i < maxSize; i++) {\n y = this.getBlackPointOnSegment(right, down - i, right - i, down);\n }\n if (y == null) {\n throw new NotFoundException();\n }\n return this.centerEdges(y, z, x, t);\n }\n else {\n throw new NotFoundException();\n }\n }\n getBlackPointOnSegment(aX /*float*/, aY /*float*/, bX /*float*/, bY /*float*/) {\n const dist = MathUtils.round(MathUtils.distance(aX, aY, bX, bY));\n const xStep = (bX - aX) / dist;\n const yStep = (bY - aY) / dist;\n const image = this.image;\n for (let i = 0; i < dist; i++) {\n const x = MathUtils.round(aX + i * xStep);\n const y = MathUtils.round(aY + i * yStep);\n if (image.get(x, y)) {\n return new ResultPoint(x, y);\n }\n }\n return null;\n }\n /**\n * recenters the points of a constant distance towards the center\n *\n * @param y bottom most point\n * @param z left most point\n * @param x right most point\n * @param t top most point\n * @return {@link ResultPoint}[] describing the corners of the rectangular\n * region. The first and last points are opposed on the diagonal, as\n * are the second and third. The first point will be the topmost\n * point and the last, the bottommost. The second point will be\n * leftmost and the third, the rightmost\n */\n centerEdges(y, z, x, t) {\n //\n // t t\n // z x\n // x OR z\n // y y\n //\n const yi = y.getX();\n const yj = y.getY();\n const zi = z.getX();\n const zj = z.getY();\n const xi = x.getX();\n const xj = x.getY();\n const ti = t.getX();\n const tj = t.getY();\n const CORR = WhiteRectangleDetector.CORR;\n if (yi < this.width / 2.0) {\n return [\n new ResultPoint(ti - CORR, tj + CORR),\n new ResultPoint(zi + CORR, zj + CORR),\n new ResultPoint(xi - CORR, xj - CORR),\n new ResultPoint(yi + CORR, yj - CORR)\n ];\n }\n else {\n return [\n new ResultPoint(ti + CORR, tj + CORR),\n new ResultPoint(zi + CORR, zj - CORR),\n new ResultPoint(xi - CORR, xj + CORR),\n new ResultPoint(yi - CORR, yj - CORR)\n ];\n }\n }\n /**\n * Determines whether a segment contains a black point\n *\n * @param a min value of the scanned coordinate\n * @param b max value of the scanned coordinate\n * @param fixed value of fixed coordinate\n * @param horizontal set to true if scan must be horizontal, false if vertical\n * @return true if a black point has been found, else false.\n */\n containsBlackPoint(a /*int*/, b /*int*/, fixed /*int*/, horizontal) {\n const image = this.image;\n if (horizontal) {\n for (let x = a; x <= b; x++) {\n if (image.get(x, fixed)) {\n return true;\n }\n }\n }\n else {\n for (let y = a; y <= b; y++) {\n if (image.get(fixed, y)) {\n return true;\n }\n }\n }\n return false;\n }\n }\n WhiteRectangleDetector.INIT_SIZE = 10;\n WhiteRectangleDetector.CORR = 1;\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n * Implementations of this class can, given locations of finder patterns for a QR code in an\n * image, sample the right points in the image to reconstruct the QR code, accounting for\n * perspective distortion. It is abstracted since it is relatively expensive and should be allowed\n * to take advantage of platform-specific optimized implementations, like Sun's Java Advanced\n * Imaging library, but which may not be available in other environments such as J2ME, and vice\n * versa.\n *\n * The implementation used can be controlled by calling {@link #setGridSampler(GridSampler)}\n * with an instance of a class which implements this interface.\n *\n * @author Sean Owen\n */\n class GridSampler {\n /**\n *Checks a set of points that have been transformed to sample points on an image against\n * the image's dimensions to see if the point are even within the image.
\n *\n *This method will actually \"nudge\" the endpoints back onto the image if they are found to be\n * barely (less than 1 pixel) off the image. This accounts for imperfect detection of finder\n * patterns in an image where the QR Code runs all the way to the image border.
\n *\n *For efficiency, the method will check points from either end of the line until one is found\n * to be within the image. Because the set of points are assumed to be linear, this is valid.
\n *\n * @param image image into which the points should map\n * @param points actual points in x1,y1,...,xn,yn form\n * @throws NotFoundException if an endpoint is lies outside the image boundaries\n */\n static checkAndNudgePoints(image, points) {\n const width = image.getWidth();\n const height = image.getHeight();\n // Check and nudge points from start until we see some that are OK:\n let nudged = true;\n for (let offset = 0; offset < points.length && nudged; offset += 2) {\n const x = Math.floor(points[offset]);\n const y = Math.floor(points[offset + 1]);\n if (x < -1 || x > width || y < -1 || y > height) {\n throw new NotFoundException();\n }\n nudged = false;\n if (x === -1) {\n points[offset] = 0.0;\n nudged = true;\n }\n else if (x === width) {\n points[offset] = width - 1;\n nudged = true;\n }\n if (y === -1) {\n points[offset + 1] = 0.0;\n nudged = true;\n }\n else if (y === height) {\n points[offset + 1] = height - 1;\n nudged = true;\n }\n }\n // Check and nudge points from end:\n nudged = true;\n for (let offset = points.length - 2; offset >= 0 && nudged; offset -= 2) {\n const x = Math.floor(points[offset]);\n const y = Math.floor(points[offset + 1]);\n if (x < -1 || x > width || y < -1 || y > height) {\n throw new NotFoundException();\n }\n nudged = false;\n if (x === -1) {\n points[offset] = 0.0;\n nudged = true;\n }\n else if (x === width) {\n points[offset] = width - 1;\n nudged = true;\n }\n if (y === -1) {\n points[offset + 1] = 0.0;\n nudged = true;\n }\n else if (y === height) {\n points[offset + 1] = height - 1;\n nudged = true;\n }\n }\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /*namespace com.google.zxing.common {*/\n /**\n *This class implements a perspective transform in two dimensions. Given four source and four\n * destination points, it will compute the transformation implied between them. The code is based\n * directly upon section 3.4.2 of George Wolberg's \"Digital Image Warping\"; see pages 54-56.
\n *\n * @author Sean Owen\n */\n class PerspectiveTransform {\n constructor(a11 /*float*/, a21 /*float*/, a31 /*float*/, a12 /*float*/, a22 /*float*/, a32 /*float*/, a13 /*float*/, a23 /*float*/, a33 /*float*/) {\n this.a11 = a11;\n this.a21 = a21;\n this.a31 = a31;\n this.a12 = a12;\n this.a22 = a22;\n this.a32 = a32;\n this.a13 = a13;\n this.a23 = a23;\n this.a33 = a33;\n }\n static quadrilateralToQuadrilateral(x0 /*float*/, y0 /*float*/, x1 /*float*/, y1 /*float*/, x2 /*float*/, y2 /*float*/, x3 /*float*/, y3 /*float*/, x0p /*float*/, y0p /*float*/, x1p /*float*/, y1p /*float*/, x2p /*float*/, y2p /*float*/, x3p /*float*/, y3p /*float*/) {\n const qToS = PerspectiveTransform.quadrilateralToSquare(x0, y0, x1, y1, x2, y2, x3, y3);\n const sToQ = PerspectiveTransform.squareToQuadrilateral(x0p, y0p, x1p, y1p, x2p, y2p, x3p, y3p);\n return sToQ.times(qToS);\n }\n transformPoints(points) {\n const max = points.length;\n const a11 = this.a11;\n const a12 = this.a12;\n const a13 = this.a13;\n const a21 = this.a21;\n const a22 = this.a22;\n const a23 = this.a23;\n const a31 = this.a31;\n const a32 = this.a32;\n const a33 = this.a33;\n for (let i = 0; i < max; i += 2) {\n const x = points[i];\n const y = points[i + 1];\n const denominator = a13 * x + a23 * y + a33;\n points[i] = (a11 * x + a21 * y + a31) / denominator;\n points[i + 1] = (a12 * x + a22 * y + a32) / denominator;\n }\n }\n transformPointsWithValues(xValues, yValues) {\n const a11 = this.a11;\n const a12 = this.a12;\n const a13 = this.a13;\n const a21 = this.a21;\n const a22 = this.a22;\n const a23 = this.a23;\n const a31 = this.a31;\n const a32 = this.a32;\n const a33 = this.a33;\n const n = xValues.length;\n for (let i = 0; i < n; i++) {\n const x = xValues[i];\n const y = yValues[i];\n const denominator = a13 * x + a23 * y + a33;\n xValues[i] = (a11 * x + a21 * y + a31) / denominator;\n yValues[i] = (a12 * x + a22 * y + a32) / denominator;\n }\n }\n static squareToQuadrilateral(x0 /*float*/, y0 /*float*/, x1 /*float*/, y1 /*float*/, x2 /*float*/, y2 /*float*/, x3 /*float*/, y3 /*float*/) {\n const dx3 = x0 - x1 + x2 - x3;\n const dy3 = y0 - y1 + y2 - y3;\n if (dx3 === 0.0 && dy3 === 0.0) {\n // Affine\n return new PerspectiveTransform(x1 - x0, x2 - x1, x0, y1 - y0, y2 - y1, y0, 0.0, 0.0, 1.0);\n }\n else {\n const dx1 = x1 - x2;\n const dx2 = x3 - x2;\n const dy1 = y1 - y2;\n const dy2 = y3 - y2;\n const denominator = dx1 * dy2 - dx2 * dy1;\n const a13 = (dx3 * dy2 - dx2 * dy3) / denominator;\n const a23 = (dx1 * dy3 - dx3 * dy1) / denominator;\n return new PerspectiveTransform(x1 - x0 + a13 * x1, x3 - x0 + a23 * x3, x0, y1 - y0 + a13 * y1, y3 - y0 + a23 * y3, y0, a13, a23, 1.0);\n }\n }\n static quadrilateralToSquare(x0 /*float*/, y0 /*float*/, x1 /*float*/, y1 /*float*/, x2 /*float*/, y2 /*float*/, x3 /*float*/, y3 /*float*/) {\n // Here, the adjoint serves as the inverse:\n return PerspectiveTransform.squareToQuadrilateral(x0, y0, x1, y1, x2, y2, x3, y3).buildAdjoint();\n }\n buildAdjoint() {\n // Adjoint is the transpose of the cofactor matrix:\n return new PerspectiveTransform(this.a22 * this.a33 - this.a23 * this.a32, this.a23 * this.a31 - this.a21 * this.a33, this.a21 * this.a32 - this.a22 * this.a31, this.a13 * this.a32 - this.a12 * this.a33, this.a11 * this.a33 - this.a13 * this.a31, this.a12 * this.a31 - this.a11 * this.a32, this.a12 * this.a23 - this.a13 * this.a22, this.a13 * this.a21 - this.a11 * this.a23, this.a11 * this.a22 - this.a12 * this.a21);\n }\n times(other) {\n return new PerspectiveTransform(this.a11 * other.a11 + this.a21 * other.a12 + this.a31 * other.a13, this.a11 * other.a21 + this.a21 * other.a22 + this.a31 * other.a23, this.a11 * other.a31 + this.a21 * other.a32 + this.a31 * other.a33, this.a12 * other.a11 + this.a22 * other.a12 + this.a32 * other.a13, this.a12 * other.a21 + this.a22 * other.a22 + this.a32 * other.a23, this.a12 * other.a31 + this.a22 * other.a32 + this.a32 * other.a33, this.a13 * other.a11 + this.a23 * other.a12 + this.a33 * other.a13, this.a13 * other.a21 + this.a23 * other.a22 + this.a33 * other.a23, this.a13 * other.a31 + this.a23 * other.a32 + this.a33 * other.a33);\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n * @author Sean Owen\n */\n class DefaultGridSampler extends GridSampler {\n /*@Override*/\n sampleGrid(image, dimensionX /*int*/, dimensionY /*int*/, p1ToX /*float*/, p1ToY /*float*/, p2ToX /*float*/, p2ToY /*float*/, p3ToX /*float*/, p3ToY /*float*/, p4ToX /*float*/, p4ToY /*float*/, p1FromX /*float*/, p1FromY /*float*/, p2FromX /*float*/, p2FromY /*float*/, p3FromX /*float*/, p3FromY /*float*/, p4FromX /*float*/, p4FromY /*float*/) {\n const transform = PerspectiveTransform.quadrilateralToQuadrilateral(p1ToX, p1ToY, p2ToX, p2ToY, p3ToX, p3ToY, p4ToX, p4ToY, p1FromX, p1FromY, p2FromX, p2FromY, p3FromX, p3FromY, p4FromX, p4FromY);\n return this.sampleGridWithTransform(image, dimensionX, dimensionY, transform);\n }\n /*@Override*/\n sampleGridWithTransform(image, dimensionX /*int*/, dimensionY /*int*/, transform) {\n if (dimensionX <= 0 || dimensionY <= 0) {\n throw new NotFoundException();\n }\n const bits = new BitMatrix(dimensionX, dimensionY);\n const points = new Float32Array(2 * dimensionX);\n for (let y = 0; y < dimensionY; y++) {\n const max = points.length;\n const iValue = y + 0.5;\n for (let x = 0; x < max; x += 2) {\n points[x] = (x / 2) + 0.5;\n points[x + 1] = iValue;\n }\n transform.transformPoints(points);\n // Quick check to see if points transformed to something inside the image\n // sufficient to check the endpoints\n GridSampler.checkAndNudgePoints(image, points);\n try {\n for (let x = 0; x < max; x += 2) {\n if (image.get(Math.floor(points[x]), Math.floor(points[x + 1]))) {\n // Black(-ish) pixel\n bits.set(x / 2, y);\n }\n }\n }\n catch (aioobe /*: ArrayIndexOutOfBoundsException*/) {\n // This feels wrong, but, sometimes if the finder patterns are misidentified, the resulting\n // transform gets \"twisted\" such that it maps a straight line of points to a set of points\n // whose endpoints are in bounds, but others are not. There is probably some mathematical\n // way to detect this about the transformation that I don't know yet.\n // This results in an ugly runtime exception despite our clever checks above -- can't have\n // that. We could check each point's coordinates but that feels duplicative. We settle for\n // catching and wrapping ArrayIndexOutOfBoundsException.\n throw new NotFoundException();\n }\n }\n return bits;\n }\n }\n\n class GridSamplerInstance {\n /**\n * Sets the implementation of GridSampler used by the library. One global\n * instance is stored, which may sound problematic. But, the implementation provided\n * ought to be appropriate for the entire platform, and all uses of this library\n * in the whole lifetime of the JVM. For instance, an Android activity can swap in\n * an implementation that takes advantage of native platform libraries.\n *\n * @param newGridSampler The platform-specific object to install.\n */\n static setGridSampler(newGridSampler) {\n GridSamplerInstance.gridSampler = newGridSampler;\n }\n /**\n * @return the current implementation of GridSampler\n */\n static getInstance() {\n return GridSamplerInstance.gridSampler;\n }\n }\n GridSamplerInstance.gridSampler = new DefaultGridSampler();\n\n /*\n * Copyright 2010 ZXing authors\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 class Point {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n }\n toResultPoint() {\n return new ResultPoint(this.getX(), this.getY());\n }\n getX() {\n return this.x;\n }\n getY() {\n return this.y;\n }\n }\n /**\n * Encapsulates logic that can detect an Aztec Code in an image, even if the Aztec Code\n * is rotated or skewed, or partially obscured.\n *\n * @author David Olivier\n * @author Frank Yellin\n */\n class Detector {\n constructor(image) {\n this.EXPECTED_CORNER_BITS = new Int32Array([\n 0xee0,\n 0x1dc,\n 0x83b,\n 0x707,\n ]);\n this.image = image;\n }\n detect() {\n return this.detectMirror(false);\n }\n /**\n * Detects an Aztec Code in an image.\n *\n * @param isMirror if true, image is a mirror-image of original\n * @return {@link AztecDetectorResult} encapsulating results of detecting an Aztec Code\n * @throws NotFoundException if no Aztec Code can be found\n */\n detectMirror(isMirror) {\n // 1. Get the center of the aztec matrix\n let pCenter = this.getMatrixCenter();\n // 2. Get the center points of the four diagonal points just outside the bull's eye\n // [topRight, bottomRight, bottomLeft, topLeft]\n let bullsEyeCorners = this.getBullsEyeCorners(pCenter);\n if (isMirror) {\n let temp = bullsEyeCorners[0];\n bullsEyeCorners[0] = bullsEyeCorners[2];\n bullsEyeCorners[2] = temp;\n }\n // 3. Get the size of the matrix and other parameters from the bull's eye\n this.extractParameters(bullsEyeCorners);\n // 4. Sample the grid\n let bits = this.sampleGrid(this.image, bullsEyeCorners[this.shift % 4], bullsEyeCorners[(this.shift + 1) % 4], bullsEyeCorners[(this.shift + 2) % 4], bullsEyeCorners[(this.shift + 3) % 4]);\n // 5. Get the corners of the matrix.\n let corners = this.getMatrixCornerPoints(bullsEyeCorners);\n return new AztecDetectorResult(bits, corners, this.compact, this.nbDataBlocks, this.nbLayers);\n }\n /**\n * Extracts the number of data layers and data blocks from the layer around the bull's eye.\n *\n * @param bullsEyeCorners the array of bull's eye corners\n * @throws NotFoundException in case of too many errors or invalid parameters\n */\n extractParameters(bullsEyeCorners) {\n if (!this.isValidPoint(bullsEyeCorners[0]) || !this.isValidPoint(bullsEyeCorners[1]) ||\n !this.isValidPoint(bullsEyeCorners[2]) || !this.isValidPoint(bullsEyeCorners[3])) {\n throw new NotFoundException();\n }\n let length = 2 * this.nbCenterLayers;\n // Get the bits around the bull's eye\n let sides = new Int32Array([\n this.sampleLine(bullsEyeCorners[0], bullsEyeCorners[1], length),\n this.sampleLine(bullsEyeCorners[1], bullsEyeCorners[2], length),\n this.sampleLine(bullsEyeCorners[2], bullsEyeCorners[3], length),\n this.sampleLine(bullsEyeCorners[3], bullsEyeCorners[0], length) // Top\n ]);\n // bullsEyeCorners[shift] is the corner of the bulls'eye that has three\n // orientation marks.\n // sides[shift] is the row/column that goes from the corner with three\n // orientation marks to the corner with two.\n this.shift = this.getRotation(sides, length);\n // Flatten the parameter bits into a single 28- or 40-bit long\n let parameterData = 0;\n for (let i = 0; i < 4; i++) {\n let side = sides[(this.shift + i) % 4];\n if (this.compact) {\n // Each side of the form ..XXXXXXX. where Xs are parameter data\n parameterData <<= 7;\n parameterData += (side >> 1) & 0x7F;\n }\n else {\n // Each side of the form ..XXXXX.XXXXX. where Xs are parameter data\n parameterData <<= 10;\n parameterData += ((side >> 2) & (0x1f << 5)) + ((side >> 1) & 0x1F);\n }\n }\n // Corrects parameter data using RS. Returns just the data portion\n // without the error correction.\n let correctedData = this.getCorrectedParameterData(parameterData, this.compact);\n if (this.compact) {\n // 8 bits: 2 bits layers and 6 bits data blocks\n this.nbLayers = (correctedData >> 6) + 1;\n this.nbDataBlocks = (correctedData & 0x3F) + 1;\n }\n else {\n // 16 bits: 5 bits layers and 11 bits data blocks\n this.nbLayers = (correctedData >> 11) + 1;\n this.nbDataBlocks = (correctedData & 0x7FF) + 1;\n }\n }\n getRotation(sides, length) {\n // In a normal pattern, we expect to See\n // ** .* D A\n // * *\n //\n // . *\n // .. .. C B\n //\n // Grab the 3 bits from each of the sides the form the locator pattern and concatenate\n // into a 12-bit integer. Start with the bit at A\n let cornerBits = 0;\n sides.forEach((side, idx, arr) => {\n // XX......X where X's are orientation marks\n let t = ((side >> (length - 2)) << 1) + (side & 1);\n cornerBits = (cornerBits << 3) + t;\n });\n // for (var side in sides) {\n // // XX......X where X's are orientation marks\n // var t = ((side >> (length - 2)) << 1) + (side & 1);\n // cornerBits = (cornerBits << 3) + t;\n // }\n // Mov the bottom bit to the top, so that the three bits of the locator pattern at A are\n // together. cornerBits is now:\n // 3 orientation bits at A || 3 orientation bits at B || ... || 3 orientation bits at D\n cornerBits = ((cornerBits & 1) << 11) + (cornerBits >> 1);\n // The result shift indicates which element of BullsEyeCorners[] goes into the top-left\n // corner. Since the four rotation values have a Hamming distance of 8, we\n // can easily tolerate two errors.\n for (let shift = 0; shift < 4; shift++) {\n if (Integer.bitCount(cornerBits ^ this.EXPECTED_CORNER_BITS[shift]) <= 2) {\n return shift;\n }\n }\n throw new NotFoundException();\n }\n /**\n * Corrects the parameter bits using Reed-Solomon algorithm.\n *\n * @param parameterData parameter bits\n * @param compact true if this is a compact Aztec code\n * @throws NotFoundException if the array contains too many errors\n */\n getCorrectedParameterData(parameterData, compact) {\n let numCodewords;\n let numDataCodewords;\n if (compact) {\n numCodewords = 7;\n numDataCodewords = 2;\n }\n else {\n numCodewords = 10;\n numDataCodewords = 4;\n }\n let numECCodewords = numCodewords - numDataCodewords;\n let parameterWords = new Int32Array(numCodewords);\n for (let i = numCodewords - 1; i >= 0; --i) {\n parameterWords[i] = parameterData & 0xF;\n parameterData >>= 4;\n }\n try {\n let rsDecoder = new ReedSolomonDecoder(GenericGF.AZTEC_PARAM);\n rsDecoder.decode(parameterWords, numECCodewords);\n }\n catch (ignored) {\n throw new NotFoundException();\n }\n // Toss the error correction. Just return the data as an integer\n let result = 0;\n for (let i = 0; i < numDataCodewords; i++) {\n result = (result << 4) + parameterWords[i];\n }\n return result;\n }\n /**\n * Finds the corners of a bull-eye centered on the passed point.\n * This returns the centers of the diagonal points just outside the bull's eye\n * Returns [topRight, bottomRight, bottomLeft, topLeft]\n *\n * @param pCenter Center point\n * @return The corners of the bull-eye\n * @throws NotFoundException If no valid bull-eye can be found\n */\n getBullsEyeCorners(pCenter) {\n let pina = pCenter;\n let pinb = pCenter;\n let pinc = pCenter;\n let pind = pCenter;\n let color = true;\n for (this.nbCenterLayers = 1; this.nbCenterLayers < 9; this.nbCenterLayers++) {\n let pouta = this.getFirstDifferent(pina, color, 1, -1);\n let poutb = this.getFirstDifferent(pinb, color, 1, 1);\n let poutc = this.getFirstDifferent(pinc, color, -1, 1);\n let poutd = this.getFirstDifferent(pind, color, -1, -1);\n // d a\n //\n // c b\n if (this.nbCenterLayers > 2) {\n let q = (this.distancePoint(poutd, pouta) * this.nbCenterLayers) / (this.distancePoint(pind, pina) * (this.nbCenterLayers + 2));\n if (q < 0.75 || q > 1.25 || !this.isWhiteOrBlackRectangle(pouta, poutb, poutc, poutd)) {\n break;\n }\n }\n pina = pouta;\n pinb = poutb;\n pinc = poutc;\n pind = poutd;\n color = !color;\n }\n if (this.nbCenterLayers !== 5 && this.nbCenterLayers !== 7) {\n throw new NotFoundException();\n }\n this.compact = this.nbCenterLayers === 5;\n // Expand the square by .5 pixel in each direction so that we're on the border\n // between the white square and the black square\n let pinax = new ResultPoint(pina.getX() + 0.5, pina.getY() - 0.5);\n let pinbx = new ResultPoint(pinb.getX() + 0.5, pinb.getY() + 0.5);\n let pincx = new ResultPoint(pinc.getX() - 0.5, pinc.getY() + 0.5);\n let pindx = new ResultPoint(pind.getX() - 0.5, pind.getY() - 0.5);\n // Expand the square so that its corners are the centers of the points\n // just outside the bull's eye.\n return this.expandSquare([pinax, pinbx, pincx, pindx], 2 * this.nbCenterLayers - 3, 2 * this.nbCenterLayers);\n }\n /**\n * Finds a candidate center point of an Aztec code from an image\n *\n * @return the center point\n */\n getMatrixCenter() {\n let pointA;\n let pointB;\n let pointC;\n let pointD;\n // Get a white rectangle that can be the border of the matrix in center bull's eye or\n try {\n let cornerPoints = new WhiteRectangleDetector(this.image).detect();\n pointA = cornerPoints[0];\n pointB = cornerPoints[1];\n pointC = cornerPoints[2];\n pointD = cornerPoints[3];\n }\n catch (e) {\n // This exception can be in case the initial rectangle is white\n // In that case, surely in the bull's eye, we try to expand the rectangle.\n let cx = this.image.getWidth() / 2;\n let cy = this.image.getHeight() / 2;\n pointA = this.getFirstDifferent(new Point(cx + 7, cy - 7), false, 1, -1).toResultPoint();\n pointB = this.getFirstDifferent(new Point(cx + 7, cy + 7), false, 1, 1).toResultPoint();\n pointC = this.getFirstDifferent(new Point(cx - 7, cy + 7), false, -1, 1).toResultPoint();\n pointD = this.getFirstDifferent(new Point(cx - 7, cy - 7), false, -1, -1).toResultPoint();\n }\n // Compute the center of the rectangle\n let cx = MathUtils.round((pointA.getX() + pointD.getX() + pointB.getX() + pointC.getX()) / 4.0);\n let cy = MathUtils.round((pointA.getY() + pointD.getY() + pointB.getY() + pointC.getY()) / 4.0);\n // Redetermine the white rectangle starting from previously computed center.\n // This will ensure that we end up with a white rectangle in center bull's eye\n // in order to compute a more accurate center.\n try {\n let cornerPoints = new WhiteRectangleDetector(this.image, 15, cx, cy).detect();\n pointA = cornerPoints[0];\n pointB = cornerPoints[1];\n pointC = cornerPoints[2];\n pointD = cornerPoints[3];\n }\n catch (e) {\n // This exception can be in case the initial rectangle is white\n // In that case we try to expand the rectangle.\n pointA = this.getFirstDifferent(new Point(cx + 7, cy - 7), false, 1, -1).toResultPoint();\n pointB = this.getFirstDifferent(new Point(cx + 7, cy + 7), false, 1, 1).toResultPoint();\n pointC = this.getFirstDifferent(new Point(cx - 7, cy + 7), false, -1, 1).toResultPoint();\n pointD = this.getFirstDifferent(new Point(cx - 7, cy - 7), false, -1, -1).toResultPoint();\n }\n // Recompute the center of the rectangle\n cx = MathUtils.round((pointA.getX() + pointD.getX() + pointB.getX() + pointC.getX()) / 4.0);\n cy = MathUtils.round((pointA.getY() + pointD.getY() + pointB.getY() + pointC.getY()) / 4.0);\n return new Point(cx, cy);\n }\n /**\n * Gets the Aztec code corners from the bull's eye corners and the parameters.\n *\n * @param bullsEyeCorners the array of bull's eye corners\n * @return the array of aztec code corners\n */\n getMatrixCornerPoints(bullsEyeCorners) {\n return this.expandSquare(bullsEyeCorners, 2 * this.nbCenterLayers, this.getDimension());\n }\n /**\n * Creates a BitMatrix by sampling the provided image.\n * topLeft, topRight, bottomRight, and bottomLeft are the centers of the squares on the\n * diagonal just outside the bull's eye.\n */\n sampleGrid(image, topLeft, topRight, bottomRight, bottomLeft) {\n let sampler = GridSamplerInstance.getInstance();\n let dimension = this.getDimension();\n let low = dimension / 2 - this.nbCenterLayers;\n let high = dimension / 2 + this.nbCenterLayers;\n return sampler.sampleGrid(image, dimension, dimension, low, low, // topleft\n high, low, // topright\n high, high, // bottomright\n low, high, // bottomleft\n topLeft.getX(), topLeft.getY(), topRight.getX(), topRight.getY(), bottomRight.getX(), bottomRight.getY(), bottomLeft.getX(), bottomLeft.getY());\n }\n /**\n * Samples a line.\n *\n * @param p1 start point (inclusive)\n * @param p2 end point (exclusive)\n * @param size number of bits\n * @return the array of bits as an int (first bit is high-order bit of result)\n */\n sampleLine(p1, p2, size) {\n let result = 0;\n let d = this.distanceResultPoint(p1, p2);\n let moduleSize = d / size;\n let px = p1.getX();\n let py = p1.getY();\n let dx = moduleSize * (p2.getX() - p1.getX()) / d;\n let dy = moduleSize * (p2.getY() - p1.getY()) / d;\n for (let i = 0; i < size; i++) {\n if (this.image.get(MathUtils.round(px + i * dx), MathUtils.round(py + i * dy))) {\n result |= 1 << (size - i - 1);\n }\n }\n return result;\n }\n /**\n * @return true if the border of the rectangle passed in parameter is compound of white points only\n * or black points only\n */\n isWhiteOrBlackRectangle(p1, p2, p3, p4) {\n let corr = 3;\n p1 = new Point(p1.getX() - corr, p1.getY() + corr);\n p2 = new Point(p2.getX() - corr, p2.getY() - corr);\n p3 = new Point(p3.getX() + corr, p3.getY() - corr);\n p4 = new Point(p4.getX() + corr, p4.getY() + corr);\n let cInit = this.getColor(p4, p1);\n if (cInit === 0) {\n return false;\n }\n let c = this.getColor(p1, p2);\n if (c !== cInit) {\n return false;\n }\n c = this.getColor(p2, p3);\n if (c !== cInit) {\n return false;\n }\n c = this.getColor(p3, p4);\n return c === cInit;\n }\n /**\n * Gets the color of a segment\n *\n * @return 1 if segment more than 90% black, -1 if segment is more than 90% white, 0 else\n */\n getColor(p1, p2) {\n let d = this.distancePoint(p1, p2);\n let dx = (p2.getX() - p1.getX()) / d;\n let dy = (p2.getY() - p1.getY()) / d;\n let error = 0;\n let px = p1.getX();\n let py = p1.getY();\n let colorModel = this.image.get(p1.getX(), p1.getY());\n let iMax = Math.ceil(d);\n for (let i = 0; i < iMax; i++) {\n px += dx;\n py += dy;\n if (this.image.get(MathUtils.round(px), MathUtils.round(py)) !== colorModel) {\n error++;\n }\n }\n let errRatio = error / d;\n if (errRatio > 0.1 && errRatio < 0.9) {\n return 0;\n }\n return (errRatio <= 0.1) === colorModel ? 1 : -1;\n }\n /**\n * Gets the coordinate of the first point with a different color in the given direction\n */\n getFirstDifferent(init, color, dx, dy) {\n let x = init.getX() + dx;\n let y = init.getY() + dy;\n while (this.isValid(x, y) && this.image.get(x, y) === color) {\n x += dx;\n y += dy;\n }\n x -= dx;\n y -= dy;\n while (this.isValid(x, y) && this.image.get(x, y) === color) {\n x += dx;\n }\n x -= dx;\n while (this.isValid(x, y) && this.image.get(x, y) === color) {\n y += dy;\n }\n y -= dy;\n return new Point(x, y);\n }\n /**\n * Expand the square represented by the corner points by pushing out equally in all directions\n *\n * @param cornerPoints the corners of the square, which has the bull's eye at its center\n * @param oldSide the original length of the side of the square in the target bit matrix\n * @param newSide the new length of the size of the square in the target bit matrix\n * @return the corners of the expanded square\n */\n expandSquare(cornerPoints, oldSide, newSide) {\n let ratio = newSide / (2.0 * oldSide);\n let dx = cornerPoints[0].getX() - cornerPoints[2].getX();\n let dy = cornerPoints[0].getY() - cornerPoints[2].getY();\n let centerx = (cornerPoints[0].getX() + cornerPoints[2].getX()) / 2.0;\n let centery = (cornerPoints[0].getY() + cornerPoints[2].getY()) / 2.0;\n let result0 = new ResultPoint(centerx + ratio * dx, centery + ratio * dy);\n let result2 = new ResultPoint(centerx - ratio * dx, centery - ratio * dy);\n dx = cornerPoints[1].getX() - cornerPoints[3].getX();\n dy = cornerPoints[1].getY() - cornerPoints[3].getY();\n centerx = (cornerPoints[1].getX() + cornerPoints[3].getX()) / 2.0;\n centery = (cornerPoints[1].getY() + cornerPoints[3].getY()) / 2.0;\n let result1 = new ResultPoint(centerx + ratio * dx, centery + ratio * dy);\n let result3 = new ResultPoint(centerx - ratio * dx, centery - ratio * dy);\n let results = [result0, result1, result2, result3];\n return results;\n }\n isValid(x, y) {\n return x >= 0 && x < this.image.getWidth() && y > 0 && y < this.image.getHeight();\n }\n isValidPoint(point) {\n let x = MathUtils.round(point.getX());\n let y = MathUtils.round(point.getY());\n return this.isValid(x, y);\n }\n distancePoint(a, b) {\n return MathUtils.distance(a.getX(), a.getY(), b.getX(), b.getY());\n }\n distanceResultPoint(a, b) {\n return MathUtils.distance(a.getX(), a.getY(), b.getX(), b.getY());\n }\n getDimension() {\n if (this.compact) {\n return 4 * this.nbLayers + 11;\n }\n if (this.nbLayers <= 4) {\n return 4 * this.nbLayers + 15;\n }\n return 4 * this.nbLayers + 2 * (Integer.truncDivision((this.nbLayers - 4), 8) + 1) + 15;\n }\n }\n\n /*\n * Copyright 2010 ZXing authors\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 // import java.util.List;\n // import java.util.Map;\n /**\n * This implementation can detect and decode Aztec codes in an image.\n *\n * @author David Olivier\n */\n class AztecReader {\n /**\n * Locates and decodes a Data Matrix code in an image.\n *\n * @return a String representing the content encoded by the Data Matrix code\n * @throws NotFoundException if a Data Matrix code cannot be found\n * @throws FormatException if a Data Matrix code cannot be decoded\n */\n decode(image, hints = null) {\n let exception = null;\n let detector = new Detector(image.getBlackMatrix());\n let points = null;\n let decoderResult = null;\n try {\n let detectorResult = detector.detectMirror(false);\n points = detectorResult.getPoints();\n this.reportFoundResultPoints(hints, points);\n decoderResult = new Decoder().decode(detectorResult);\n }\n catch (e) {\n exception = e;\n }\n if (decoderResult == null) {\n try {\n let detectorResult = detector.detectMirror(true);\n points = detectorResult.getPoints();\n this.reportFoundResultPoints(hints, points);\n decoderResult = new Decoder().decode(detectorResult);\n }\n catch (e) {\n if (exception != null) {\n throw exception;\n }\n throw e;\n }\n }\n let result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), decoderResult.getNumBits(), points, BarcodeFormat$1.AZTEC, System.currentTimeMillis());\n let byteSegments = decoderResult.getByteSegments();\n if (byteSegments != null) {\n result.putMetadata(ResultMetadataType$1.BYTE_SEGMENTS, byteSegments);\n }\n let ecLevel = decoderResult.getECLevel();\n if (ecLevel != null) {\n result.putMetadata(ResultMetadataType$1.ERROR_CORRECTION_LEVEL, ecLevel);\n }\n return result;\n }\n reportFoundResultPoints(hints, points) {\n if (hints != null) {\n let rpcb = hints.get(DecodeHintType$1.NEED_RESULT_POINT_CALLBACK);\n if (rpcb != null) {\n points.forEach((point, idx, arr) => {\n rpcb.foundPossibleResultPoint(point);\n });\n }\n }\n }\n // @Override\n reset() {\n // do nothing\n }\n }\n\n /**\n * Aztec Code reader to use from browser.\n *\n * @class BrowserAztecCodeReader\n * @extends {BrowserCodeReader}\n */\n class BrowserAztecCodeReader extends BrowserCodeReader {\n /**\n * Creates an instance of BrowserAztecCodeReader.\n * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries\n *\n * @memberOf BrowserAztecCodeReader\n */\n constructor(timeBetweenScansMillis = 500) {\n super(new AztecReader(), timeBetweenScansMillis);\n }\n }\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n * Encapsulates functionality and implementation that is common to all families\n * of one-dimensional barcodes.\n *\n * @author dswitkin@google.com (Daniel Switkin)\n * @author Sean Owen\n */\n class OneDReader {\n /*\n @Override\n public Result decode(BinaryBitmap image) throws NotFoundException, FormatException {\n return decode(image, null);\n }\n */\n // Note that we don't try rotation without the try harder flag, even if rotation was supported.\n // @Override\n decode(image, hints) {\n try {\n return this.doDecode(image, hints);\n }\n catch (nfe) {\n const tryHarder = hints && (hints.get(DecodeHintType$1.TRY_HARDER) === true);\n if (tryHarder && image.isRotateSupported()) {\n const rotatedImage = image.rotateCounterClockwise();\n const result = this.doDecode(rotatedImage, hints);\n // Record that we found it rotated 90 degrees CCW / 270 degrees CW\n const metadata = result.getResultMetadata();\n let orientation = 270;\n if (metadata !== null && (metadata.get(ResultMetadataType$1.ORIENTATION) === true)) {\n // But if we found it reversed in doDecode(), add in that result here:\n orientation = (orientation + metadata.get(ResultMetadataType$1.ORIENTATION) % 360);\n }\n result.putMetadata(ResultMetadataType$1.ORIENTATION, orientation);\n // Update result points\n const points = result.getResultPoints();\n if (points !== null) {\n const height = rotatedImage.getHeight();\n for (let i = 0; i < points.length; i++) {\n points[i] = new ResultPoint(height - points[i].getY() - 1, points[i].getX());\n }\n }\n return result;\n }\n else {\n throw new NotFoundException();\n }\n }\n }\n // @Override\n reset() {\n // do nothing\n }\n /**\n * We're going to examine rows from the middle outward, searching alternately above and below the\n * middle, and farther out each time. rowStep is the number of rows between each successive\n * attempt above and below the middle. So we'd scan row middle, then middle - rowStep, then\n * middle + rowStep, then middle - (2 * rowStep), etc.\n * rowStep is bigger as the image is taller, but is always at least 1. We've somewhat arbitrarily\n * decided that moving up and down by about 1/16 of the image is pretty good; we try more of the\n * image if \"trying harder\".\n *\n * @param image The image to decode\n * @param hints Any hints that were requested\n * @return The contents of the decoded barcode\n * @throws NotFoundException Any spontaneous errors which occur\n */\n doDecode(image, hints) {\n const width = image.getWidth();\n const height = image.getHeight();\n let row = new BitArray(width);\n const tryHarder = hints && (hints.get(DecodeHintType$1.TRY_HARDER) === true);\n const rowStep = Math.max(1, height >> (tryHarder ? 8 : 5));\n let maxLines;\n if (tryHarder) {\n maxLines = height; // Look at the whole image, not just the center\n }\n else {\n maxLines = 15; // 15 rows spaced 1/32 apart is roughly the middle half of the image\n }\n const middle = Math.trunc(height / 2);\n for (let x = 0; x < maxLines; x++) {\n // Scanning from the middle out. Determine which row we're looking at next:\n const rowStepsAboveOrBelow = Math.trunc((x + 1) / 2);\n const isAbove = (x & 0x01) === 0; // i.e. is x even?\n const rowNumber = middle + rowStep * (isAbove ? rowStepsAboveOrBelow : -rowStepsAboveOrBelow);\n if (rowNumber < 0 || rowNumber >= height) {\n // Oops, if we run off the top or bottom, stop\n break;\n }\n // Estimate black point for this row and load it:\n try {\n row = image.getBlackRow(rowNumber, row);\n }\n catch (ignored) {\n continue;\n }\n // While we have the image data in a BitArray, it's fairly cheap to reverse it in place to\n // handle decoding upside down barcodes.\n for (let attempt = 0; attempt < 2; attempt++) {\n if (attempt === 1) { // trying again?\n row.reverse(); // reverse the row and continue\n // This means we will only ever draw result points *once* in the life of this method\n // since we want to avoid drawing the wrong points after flipping the row, and,\n // don't want to clutter with noise from every single row scan -- just the scans\n // that start on the center line.\n if (hints && (hints.get(DecodeHintType$1.NEED_RESULT_POINT_CALLBACK) === true)) {\n const newHints = new Map();\n hints.forEach((hint, key) => newHints.set(key, hint));\n newHints.delete(DecodeHintType$1.NEED_RESULT_POINT_CALLBACK);\n hints = newHints;\n }\n }\n try {\n // Look for a barcode\n const result = this.decodeRow(rowNumber, row, hints);\n // We found our barcode\n if (attempt === 1) {\n // But it was upside down, so note that\n result.putMetadata(ResultMetadataType$1.ORIENTATION, 180);\n // And remember to flip the result points horizontally.\n const points = result.getResultPoints();\n if (points !== null) {\n points[0] = new ResultPoint(width - points[0].getX() - 1, points[0].getY());\n points[1] = new ResultPoint(width - points[1].getX() - 1, points[1].getY());\n }\n }\n return result;\n }\n catch (re) {\n // continue -- just couldn't decode this row\n }\n }\n }\n throw new NotFoundException();\n }\n /**\n * Records the size of successive runs of white and black pixels in a row, starting at a given point.\n * The values are recorded in the given array, and the number of runs recorded is equal to the size\n * of the array. If the row starts on a white pixel at the given start point, then the first count\n * recorded is the run of white pixels starting from that point; likewise it is the count of a run\n * of black pixels if the row begin on a black pixels at that point.\n *\n * @param row row to count from\n * @param start offset into row to start at\n * @param counters array into which to record counts\n * @throws NotFoundException if counters cannot be filled entirely from row before running out\n * of pixels\n */\n static recordPattern(row, start, counters) {\n const numCounters = counters.length;\n for (let index = 0; index < numCounters; index++)\n counters[index] = 0;\n const end = row.getSize();\n if (start >= end) {\n throw new NotFoundException();\n }\n let isWhite = !row.get(start);\n let counterPosition = 0;\n let i = start;\n while (i < end) {\n if (row.get(i) !== isWhite) {\n counters[counterPosition]++;\n }\n else {\n if (++counterPosition === numCounters) {\n break;\n }\n else {\n counters[counterPosition] = 1;\n isWhite = !isWhite;\n }\n }\n i++;\n }\n // If we read fully the last section of pixels and filled up our counters -- or filled\n // the last counter but ran off the side of the image, OK. Otherwise, a problem.\n if (!(counterPosition === numCounters || (counterPosition === numCounters - 1 && i === end))) {\n throw new NotFoundException();\n }\n }\n static recordPatternInReverse(row, start, counters) {\n // This could be more efficient I guess\n let numTransitionsLeft = counters.length;\n let last = row.get(start);\n while (start > 0 && numTransitionsLeft >= 0) {\n if (row.get(--start) !== last) {\n numTransitionsLeft--;\n last = !last;\n }\n }\n if (numTransitionsLeft >= 0) {\n throw new NotFoundException();\n }\n OneDReader.recordPattern(row, start + 1, counters);\n }\n /**\n * Determines how closely a set of observed counts of runs of black/white values matches a given\n * target pattern. This is reported as the ratio of the total variance from the expected pattern\n * proportions across all pattern elements, to the length of the pattern.\n *\n * @param counters observed counters\n * @param pattern expected pattern\n * @param maxIndividualVariance The most any counter can differ before we give up\n * @return ratio of total variance between counters and pattern compared to total pattern size\n */\n static patternMatchVariance(counters, pattern, maxIndividualVariance) {\n const numCounters = counters.length;\n let total = 0;\n let patternLength = 0;\n for (let i = 0; i < numCounters; i++) {\n total += counters[i];\n patternLength += pattern[i];\n }\n if (total < patternLength) {\n // If we don't even have one pixel per unit of bar width, assume this is too small\n // to reliably match, so fail:\n return Number.POSITIVE_INFINITY;\n }\n const unitBarWidth = total / patternLength;\n maxIndividualVariance *= unitBarWidth;\n let totalVariance = 0.0;\n for (let x = 0; x < numCounters; x++) {\n const counter = counters[x];\n const scaledPattern = pattern[x] * unitBarWidth;\n const variance = counter > scaledPattern ? counter - scaledPattern : scaledPattern - counter;\n if (variance > maxIndividualVariance) {\n return Number.POSITIVE_INFINITY;\n }\n totalVariance += variance;\n }\n return totalVariance / total;\n }\n }\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n *Decodes Code 128 barcodes.
\n *\n * @author Sean Owen\n */\n class Code128Reader extends OneDReader {\n static findStartPattern(row) {\n const width = row.getSize();\n const rowOffset = row.getNextSet(0);\n let counterPosition = 0;\n let counters = Int32Array.from([0, 0, 0, 0, 0, 0]);\n let patternStart = rowOffset;\n let isWhite = false;\n const patternLength = 6;\n for (let i = rowOffset; i < width; i++) {\n if (row.get(i) !== isWhite) {\n counters[counterPosition]++;\n }\n else {\n if (counterPosition === (patternLength - 1)) {\n let bestVariance = Code128Reader.MAX_AVG_VARIANCE;\n let bestMatch = -1;\n for (let startCode = Code128Reader.CODE_START_A; startCode <= Code128Reader.CODE_START_C; startCode++) {\n const variance = OneDReader.patternMatchVariance(counters, Code128Reader.CODE_PATTERNS[startCode], Code128Reader.MAX_INDIVIDUAL_VARIANCE);\n if (variance < bestVariance) {\n bestVariance = variance;\n bestMatch = startCode;\n }\n }\n // Look for whitespace before start pattern, >= 50% of width of start pattern\n if (bestMatch >= 0 &&\n row.isRange(Math.max(0, patternStart - (i - patternStart) / 2), patternStart, false)) {\n return Int32Array.from([patternStart, i, bestMatch]);\n }\n patternStart += counters[0] + counters[1];\n counters = counters.slice(2, counters.length - 1);\n counters[counterPosition - 1] = 0;\n counters[counterPosition] = 0;\n counterPosition--;\n }\n else {\n counterPosition++;\n }\n counters[counterPosition] = 1;\n isWhite = !isWhite;\n }\n }\n throw new NotFoundException();\n }\n static decodeCode(row, counters, rowOffset) {\n OneDReader.recordPattern(row, rowOffset, counters);\n let bestVariance = Code128Reader.MAX_AVG_VARIANCE; // worst variance we'll accept\n let bestMatch = -1;\n for (let d = 0; d < Code128Reader.CODE_PATTERNS.length; d++) {\n const pattern = Code128Reader.CODE_PATTERNS[d];\n const variance = this.patternMatchVariance(counters, pattern, Code128Reader.MAX_INDIVIDUAL_VARIANCE);\n if (variance < bestVariance) {\n bestVariance = variance;\n bestMatch = d;\n }\n }\n // TODO We're overlooking the fact that the STOP pattern has 7 values, not 6.\n if (bestMatch >= 0) {\n return bestMatch;\n }\n else {\n throw new NotFoundException();\n }\n }\n decodeRow(rowNumber, row, hints) {\n const convertFNC1 = hints && (hints.get(DecodeHintType$1.ASSUME_GS1) === true);\n const startPatternInfo = Code128Reader.findStartPattern(row);\n const startCode = startPatternInfo[2];\n let currentRawCodesIndex = 0;\n const rawCodes = new Uint8Array(20);\n rawCodes[currentRawCodesIndex++] = startCode;\n let codeSet;\n switch (startCode) {\n case Code128Reader.CODE_START_A:\n codeSet = Code128Reader.CODE_CODE_A;\n break;\n case Code128Reader.CODE_START_B:\n codeSet = Code128Reader.CODE_CODE_B;\n break;\n case Code128Reader.CODE_START_C:\n codeSet = Code128Reader.CODE_CODE_C;\n break;\n default:\n throw new FormatException();\n }\n let done = false;\n let isNextShifted = false;\n let result = '';\n let lastStart = startPatternInfo[0];\n let nextStart = startPatternInfo[1];\n const counters = Int32Array.from([0, 0, 0, 0, 0, 0]);\n let lastCode = 0;\n let code = 0;\n let checksumTotal = startCode;\n let multiplier = 0;\n let lastCharacterWasPrintable = true;\n let upperMode = false;\n let shiftUpperMode = false;\n while (!done) {\n const unshift = isNextShifted;\n isNextShifted = false;\n // Save off last code\n lastCode = code;\n // Decode another code from image\n code = Code128Reader.decodeCode(row, counters, nextStart);\n rawCodes[currentRawCodesIndex++] = code;\n // Remember whether the last code was printable or not (excluding CODE_STOP)\n if (code !== Code128Reader.CODE_STOP) {\n lastCharacterWasPrintable = true;\n }\n // Add to checksum computation (if not CODE_STOP of course)\n if (code !== Code128Reader.CODE_STOP) {\n multiplier++;\n checksumTotal += multiplier * code;\n }\n // Advance to where the next code will to start\n lastStart = nextStart;\n nextStart += counters.reduce((previous, current) => previous + current, 0);\n // Take care of illegal start codes\n switch (code) {\n case Code128Reader.CODE_START_A:\n case Code128Reader.CODE_START_B:\n case Code128Reader.CODE_START_C:\n throw new FormatException();\n }\n switch (codeSet) {\n case Code128Reader.CODE_CODE_A:\n if (code < 64) {\n if (shiftUpperMode === upperMode) {\n result += String.fromCharCode((' '.charCodeAt(0) + code));\n }\n else {\n result += String.fromCharCode((' '.charCodeAt(0) + code + 128));\n }\n shiftUpperMode = false;\n }\n else if (code < 96) {\n if (shiftUpperMode === upperMode) {\n result += String.fromCharCode((code - 64));\n }\n else {\n result += String.fromCharCode((code + 64));\n }\n shiftUpperMode = false;\n }\n else {\n // Don't let CODE_STOP, which always appears, affect whether whether we think the last\n // code was printable or not.\n if (code !== Code128Reader.CODE_STOP) {\n lastCharacterWasPrintable = false;\n }\n switch (code) {\n case Code128Reader.CODE_FNC_1:\n if (convertFNC1) {\n if (result.length === 0) {\n // GS1 specification 5.4.3.7. and 5.4.6.4. If the first char after the start code\n // is FNC1 then this is GS1-128. We add the symbology identifier.\n result += ']C1';\n }\n else {\n // GS1 specification 5.4.7.5. Every subsequent FNC1 is returned as ASCII 29 (GS)\n result += String.fromCharCode(29);\n }\n }\n break;\n case Code128Reader.CODE_FNC_2:\n case Code128Reader.CODE_FNC_3:\n // do nothing?\n break;\n case Code128Reader.CODE_FNC_4_A:\n if (!upperMode && shiftUpperMode) {\n upperMode = true;\n shiftUpperMode = false;\n }\n else if (upperMode && shiftUpperMode) {\n upperMode = false;\n shiftUpperMode = false;\n }\n else {\n shiftUpperMode = true;\n }\n break;\n case Code128Reader.CODE_SHIFT:\n isNextShifted = true;\n codeSet = Code128Reader.CODE_CODE_B;\n break;\n case Code128Reader.CODE_CODE_B:\n codeSet = Code128Reader.CODE_CODE_B;\n break;\n case Code128Reader.CODE_CODE_C:\n codeSet = Code128Reader.CODE_CODE_C;\n break;\n case Code128Reader.CODE_STOP:\n done = true;\n break;\n }\n }\n break;\n case Code128Reader.CODE_CODE_B:\n if (code < 96) {\n if (shiftUpperMode === upperMode) {\n result += String.fromCharCode((' '.charCodeAt(0) + code));\n }\n else {\n result += String.fromCharCode((' '.charCodeAt(0) + code + 128));\n }\n shiftUpperMode = false;\n }\n else {\n if (code !== Code128Reader.CODE_STOP) {\n lastCharacterWasPrintable = false;\n }\n switch (code) {\n case Code128Reader.CODE_FNC_1:\n if (convertFNC1) {\n if (result.length === 0) {\n // GS1 specification 5.4.3.7. and 5.4.6.4. If the first char after the start code\n // is FNC1 then this is GS1-128. We add the symbology identifier.\n result += ']C1';\n }\n else {\n // GS1 specification 5.4.7.5. Every subsequent FNC1 is returned as ASCII 29 (GS)\n result += String.fromCharCode(29);\n }\n }\n break;\n case Code128Reader.CODE_FNC_2:\n case Code128Reader.CODE_FNC_3:\n // do nothing?\n break;\n case Code128Reader.CODE_FNC_4_B:\n if (!upperMode && shiftUpperMode) {\n upperMode = true;\n shiftUpperMode = false;\n }\n else if (upperMode && shiftUpperMode) {\n upperMode = false;\n shiftUpperMode = false;\n }\n else {\n shiftUpperMode = true;\n }\n break;\n case Code128Reader.CODE_SHIFT:\n isNextShifted = true;\n codeSet = Code128Reader.CODE_CODE_A;\n break;\n case Code128Reader.CODE_CODE_A:\n codeSet = Code128Reader.CODE_CODE_A;\n break;\n case Code128Reader.CODE_CODE_C:\n codeSet = Code128Reader.CODE_CODE_C;\n break;\n case Code128Reader.CODE_STOP:\n done = true;\n break;\n }\n }\n break;\n case Code128Reader.CODE_CODE_C:\n if (code < 100) {\n if (code < 10) {\n result += '0';\n }\n result += code;\n }\n else {\n if (code !== Code128Reader.CODE_STOP) {\n lastCharacterWasPrintable = false;\n }\n switch (code) {\n case Code128Reader.CODE_FNC_1:\n if (convertFNC1) {\n if (result.length === 0) {\n // GS1 specification 5.4.3.7. and 5.4.6.4. If the first char after the start code\n // is FNC1 then this is GS1-128. We add the symbology identifier.\n result += ']C1';\n }\n else {\n // GS1 specification 5.4.7.5. Every subsequent FNC1 is returned as ASCII 29 (GS)\n result += String.fromCharCode(29);\n }\n }\n break;\n case Code128Reader.CODE_CODE_A:\n codeSet = Code128Reader.CODE_CODE_A;\n break;\n case Code128Reader.CODE_CODE_B:\n codeSet = Code128Reader.CODE_CODE_B;\n break;\n case Code128Reader.CODE_STOP:\n done = true;\n break;\n }\n }\n break;\n }\n // Unshift back to another code set if we were shifted\n if (unshift) {\n codeSet = codeSet === Code128Reader.CODE_CODE_A ? Code128Reader.CODE_CODE_B : Code128Reader.CODE_CODE_A;\n }\n }\n const lastPatternSize = nextStart - lastStart;\n // Check for ample whitespace following pattern, but, to do this we first need to remember that\n // we fudged decoding CODE_STOP since it actually has 7 bars, not 6. There is a black bar left\n // to read off. Would be slightly better to properly read. Here we just skip it:\n nextStart = row.getNextUnset(nextStart);\n if (!row.isRange(nextStart, Math.min(row.getSize(), nextStart + (nextStart - lastStart) / 2), false)) {\n throw new NotFoundException();\n }\n // Pull out from sum the value of the penultimate check code\n checksumTotal -= multiplier * lastCode;\n // lastCode is the checksum then:\n if (checksumTotal % 103 !== lastCode) {\n throw new ChecksumException();\n }\n // Need to pull out the check digits from string\n const resultLength = result.length;\n if (resultLength === 0) {\n // false positive\n throw new NotFoundException();\n }\n // Only bother if the result had at least one character, and if the checksum digit happened to\n // be a printable character. If it was just interpreted as a control code, nothing to remove.\n if (resultLength > 0 && lastCharacterWasPrintable) {\n if (codeSet === Code128Reader.CODE_CODE_C) {\n result = result.substring(0, resultLength - 2);\n }\n else {\n result = result.substring(0, resultLength - 1);\n }\n }\n const left = (startPatternInfo[1] + startPatternInfo[0]) / 2.0;\n const right = lastStart + lastPatternSize / 2.0;\n const rawCodesSize = rawCodes.length;\n const rawBytes = new Uint8Array(rawCodesSize);\n for (let i = 0; i < rawCodesSize; i++) {\n rawBytes[i] = rawCodes[i];\n }\n const points = [new ResultPoint(left, rowNumber), new ResultPoint(right, rowNumber)];\n return new Result(result, rawBytes, 0, points, BarcodeFormat$1.CODE_128, new Date().getTime());\n }\n }\n Code128Reader.CODE_PATTERNS = [\n Int32Array.from([2, 1, 2, 2, 2, 2]),\n Int32Array.from([2, 2, 2, 1, 2, 2]),\n Int32Array.from([2, 2, 2, 2, 2, 1]),\n Int32Array.from([1, 2, 1, 2, 2, 3]),\n Int32Array.from([1, 2, 1, 3, 2, 2]),\n Int32Array.from([1, 3, 1, 2, 2, 2]),\n Int32Array.from([1, 2, 2, 2, 1, 3]),\n Int32Array.from([1, 2, 2, 3, 1, 2]),\n Int32Array.from([1, 3, 2, 2, 1, 2]),\n Int32Array.from([2, 2, 1, 2, 1, 3]),\n Int32Array.from([2, 2, 1, 3, 1, 2]),\n Int32Array.from([2, 3, 1, 2, 1, 2]),\n Int32Array.from([1, 1, 2, 2, 3, 2]),\n Int32Array.from([1, 2, 2, 1, 3, 2]),\n Int32Array.from([1, 2, 2, 2, 3, 1]),\n Int32Array.from([1, 1, 3, 2, 2, 2]),\n Int32Array.from([1, 2, 3, 1, 2, 2]),\n Int32Array.from([1, 2, 3, 2, 2, 1]),\n Int32Array.from([2, 2, 3, 2, 1, 1]),\n Int32Array.from([2, 2, 1, 1, 3, 2]),\n Int32Array.from([2, 2, 1, 2, 3, 1]),\n Int32Array.from([2, 1, 3, 2, 1, 2]),\n Int32Array.from([2, 2, 3, 1, 1, 2]),\n Int32Array.from([3, 1, 2, 1, 3, 1]),\n Int32Array.from([3, 1, 1, 2, 2, 2]),\n Int32Array.from([3, 2, 1, 1, 2, 2]),\n Int32Array.from([3, 2, 1, 2, 2, 1]),\n Int32Array.from([3, 1, 2, 2, 1, 2]),\n Int32Array.from([3, 2, 2, 1, 1, 2]),\n Int32Array.from([3, 2, 2, 2, 1, 1]),\n Int32Array.from([2, 1, 2, 1, 2, 3]),\n Int32Array.from([2, 1, 2, 3, 2, 1]),\n Int32Array.from([2, 3, 2, 1, 2, 1]),\n Int32Array.from([1, 1, 1, 3, 2, 3]),\n Int32Array.from([1, 3, 1, 1, 2, 3]),\n Int32Array.from([1, 3, 1, 3, 2, 1]),\n Int32Array.from([1, 1, 2, 3, 1, 3]),\n Int32Array.from([1, 3, 2, 1, 1, 3]),\n Int32Array.from([1, 3, 2, 3, 1, 1]),\n Int32Array.from([2, 1, 1, 3, 1, 3]),\n Int32Array.from([2, 3, 1, 1, 1, 3]),\n Int32Array.from([2, 3, 1, 3, 1, 1]),\n Int32Array.from([1, 1, 2, 1, 3, 3]),\n Int32Array.from([1, 1, 2, 3, 3, 1]),\n Int32Array.from([1, 3, 2, 1, 3, 1]),\n Int32Array.from([1, 1, 3, 1, 2, 3]),\n Int32Array.from([1, 1, 3, 3, 2, 1]),\n Int32Array.from([1, 3, 3, 1, 2, 1]),\n Int32Array.from([3, 1, 3, 1, 2, 1]),\n Int32Array.from([2, 1, 1, 3, 3, 1]),\n Int32Array.from([2, 3, 1, 1, 3, 1]),\n Int32Array.from([2, 1, 3, 1, 1, 3]),\n Int32Array.from([2, 1, 3, 3, 1, 1]),\n Int32Array.from([2, 1, 3, 1, 3, 1]),\n Int32Array.from([3, 1, 1, 1, 2, 3]),\n Int32Array.from([3, 1, 1, 3, 2, 1]),\n Int32Array.from([3, 3, 1, 1, 2, 1]),\n Int32Array.from([3, 1, 2, 1, 1, 3]),\n Int32Array.from([3, 1, 2, 3, 1, 1]),\n Int32Array.from([3, 3, 2, 1, 1, 1]),\n Int32Array.from([3, 1, 4, 1, 1, 1]),\n Int32Array.from([2, 2, 1, 4, 1, 1]),\n Int32Array.from([4, 3, 1, 1, 1, 1]),\n Int32Array.from([1, 1, 1, 2, 2, 4]),\n Int32Array.from([1, 1, 1, 4, 2, 2]),\n Int32Array.from([1, 2, 1, 1, 2, 4]),\n Int32Array.from([1, 2, 1, 4, 2, 1]),\n Int32Array.from([1, 4, 1, 1, 2, 2]),\n Int32Array.from([1, 4, 1, 2, 2, 1]),\n Int32Array.from([1, 1, 2, 2, 1, 4]),\n Int32Array.from([1, 1, 2, 4, 1, 2]),\n Int32Array.from([1, 2, 2, 1, 1, 4]),\n Int32Array.from([1, 2, 2, 4, 1, 1]),\n Int32Array.from([1, 4, 2, 1, 1, 2]),\n Int32Array.from([1, 4, 2, 2, 1, 1]),\n Int32Array.from([2, 4, 1, 2, 1, 1]),\n Int32Array.from([2, 2, 1, 1, 1, 4]),\n Int32Array.from([4, 1, 3, 1, 1, 1]),\n Int32Array.from([2, 4, 1, 1, 1, 2]),\n Int32Array.from([1, 3, 4, 1, 1, 1]),\n Int32Array.from([1, 1, 1, 2, 4, 2]),\n Int32Array.from([1, 2, 1, 1, 4, 2]),\n Int32Array.from([1, 2, 1, 2, 4, 1]),\n Int32Array.from([1, 1, 4, 2, 1, 2]),\n Int32Array.from([1, 2, 4, 1, 1, 2]),\n Int32Array.from([1, 2, 4, 2, 1, 1]),\n Int32Array.from([4, 1, 1, 2, 1, 2]),\n Int32Array.from([4, 2, 1, 1, 1, 2]),\n Int32Array.from([4, 2, 1, 2, 1, 1]),\n Int32Array.from([2, 1, 2, 1, 4, 1]),\n Int32Array.from([2, 1, 4, 1, 2, 1]),\n Int32Array.from([4, 1, 2, 1, 2, 1]),\n Int32Array.from([1, 1, 1, 1, 4, 3]),\n Int32Array.from([1, 1, 1, 3, 4, 1]),\n Int32Array.from([1, 3, 1, 1, 4, 1]),\n Int32Array.from([1, 1, 4, 1, 1, 3]),\n Int32Array.from([1, 1, 4, 3, 1, 1]),\n Int32Array.from([4, 1, 1, 1, 1, 3]),\n Int32Array.from([4, 1, 1, 3, 1, 1]),\n Int32Array.from([1, 1, 3, 1, 4, 1]),\n Int32Array.from([1, 1, 4, 1, 3, 1]),\n Int32Array.from([3, 1, 1, 1, 4, 1]),\n Int32Array.from([4, 1, 1, 1, 3, 1]),\n Int32Array.from([2, 1, 1, 4, 1, 2]),\n Int32Array.from([2, 1, 1, 2, 1, 4]),\n Int32Array.from([2, 1, 1, 2, 3, 2]),\n Int32Array.from([2, 3, 3, 1, 1, 1, 2]),\n ];\n Code128Reader.MAX_AVG_VARIANCE = 0.25;\n Code128Reader.MAX_INDIVIDUAL_VARIANCE = 0.7;\n Code128Reader.CODE_SHIFT = 98;\n Code128Reader.CODE_CODE_C = 99;\n Code128Reader.CODE_CODE_B = 100;\n Code128Reader.CODE_CODE_A = 101;\n Code128Reader.CODE_FNC_1 = 102;\n Code128Reader.CODE_FNC_2 = 97;\n Code128Reader.CODE_FNC_3 = 96;\n Code128Reader.CODE_FNC_4_A = 101;\n Code128Reader.CODE_FNC_4_B = 100;\n Code128Reader.CODE_START_A = 103;\n Code128Reader.CODE_START_B = 104;\n Code128Reader.CODE_START_C = 105;\n Code128Reader.CODE_STOP = 106;\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n *Decodes Code 39 barcodes. Supports \"Full ASCII Code 39\" if USE_CODE_39_EXTENDED_MODE is set.
\n *\n * @author Sean Owen\n * @see Code93Reader\n */\n class Code39Reader extends OneDReader {\n /**\n * Creates a reader that assumes all encoded data is data, and does not treat the final\n * character as a check digit. It will not decoded \"extended Code 39\" sequences.\n */\n // public Code39Reader() {\n // this(false);\n // }\n /**\n * Creates a reader that can be configured to check the last character as a check digit.\n * It will not decoded \"extended Code 39\" sequences.\n *\n * @param usingCheckDigit if true, treat the last data character as a check digit, not\n * data, and verify that the checksum passes.\n */\n // public Code39Reader(boolean usingCheckDigit) {\n // this(usingCheckDigit, false);\n // }\n /**\n * Creates a reader that can be configured to check the last character as a check digit,\n * or optionally attempt to decode \"extended Code 39\" sequences that are used to encode\n * the full ASCII character set.\n *\n * @param usingCheckDigit if true, treat the last data character as a check digit, not\n * data, and verify that the checksum passes.\n * @param extendedMode if true, will attempt to decode extended Code 39 sequences in the\n * text.\n */\n constructor(usingCheckDigit = false, extendedMode = false) {\n super();\n this.usingCheckDigit = usingCheckDigit;\n this.extendedMode = extendedMode;\n this.decodeRowResult = '';\n this.counters = new Int32Array(9);\n }\n decodeRow(rowNumber, row, hints) {\n let theCounters = this.counters;\n theCounters.fill(0);\n this.decodeRowResult = '';\n let start = Code39Reader.findAsteriskPattern(row, theCounters);\n // Read off white space\n let nextStart = row.getNextSet(start[1]);\n let end = row.getSize();\n let decodedChar;\n let lastStart;\n do {\n Code39Reader.recordPattern(row, nextStart, theCounters);\n let pattern = Code39Reader.toNarrowWidePattern(theCounters);\n if (pattern < 0) {\n throw new NotFoundException();\n }\n decodedChar = Code39Reader.patternToChar(pattern);\n this.decodeRowResult += decodedChar;\n lastStart = nextStart;\n for (let counter of theCounters) {\n nextStart += counter;\n }\n // Read off white space\n nextStart = row.getNextSet(nextStart);\n } while (decodedChar !== '*');\n this.decodeRowResult = this.decodeRowResult.substring(0, this.decodeRowResult.length - 1); // remove asterisk\n // Look for whitespace after pattern:\n let lastPatternSize = 0;\n for (let counter of theCounters) {\n lastPatternSize += counter;\n }\n let whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize;\n // If 50% of last pattern size, following last pattern, is not whitespace, fail\n // (but if it's whitespace to the very end of the image, that's OK)\n if (nextStart !== end && (whiteSpaceAfterEnd * 2) < lastPatternSize) {\n throw new NotFoundException();\n }\n if (this.usingCheckDigit) {\n let max = this.decodeRowResult.length - 1;\n let total = 0;\n for (let i = 0; i < max; i++) {\n total += Code39Reader.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(i));\n }\n if (this.decodeRowResult.charAt(max) !== Code39Reader.ALPHABET_STRING.charAt(total % 43)) {\n throw new ChecksumException();\n }\n this.decodeRowResult = this.decodeRowResult.substring(0, max);\n }\n if (this.decodeRowResult.length === 0) {\n // false positive\n throw new NotFoundException();\n }\n let resultString;\n if (this.extendedMode) {\n resultString = Code39Reader.decodeExtended(this.decodeRowResult);\n }\n else {\n resultString = this.decodeRowResult;\n }\n let left = (start[1] + start[0]) / 2.0;\n let right = lastStart + lastPatternSize / 2.0;\n return new Result(resultString, null, 0, [new ResultPoint(left, rowNumber), new ResultPoint(right, rowNumber)], BarcodeFormat$1.CODE_39, new Date().getTime());\n }\n static findAsteriskPattern(row, counters) {\n let width = row.getSize();\n let rowOffset = row.getNextSet(0);\n let counterPosition = 0;\n let patternStart = rowOffset;\n let isWhite = false;\n let patternLength = counters.length;\n for (let i = rowOffset; i < width; i++) {\n if (row.get(i) !== isWhite) {\n counters[counterPosition]++;\n }\n else {\n if (counterPosition === patternLength - 1) {\n // Look for whitespace before start pattern, >= 50% of width of start pattern\n if (this.toNarrowWidePattern(counters) === Code39Reader.ASTERISK_ENCODING &&\n row.isRange(Math.max(0, patternStart - Math.floor((i - patternStart) / 2)), patternStart, false)) {\n return [patternStart, i];\n }\n patternStart += counters[0] + counters[1];\n counters.copyWithin(0, 2, 2 + counterPosition - 1);\n counters[counterPosition - 1] = 0;\n counters[counterPosition] = 0;\n counterPosition--;\n }\n else {\n counterPosition++;\n }\n counters[counterPosition] = 1;\n isWhite = !isWhite;\n }\n }\n throw new NotFoundException();\n }\n // For efficiency, returns -1 on failure. Not throwing here saved as many as 700 exceptions\n // per image when using some of our blackbox images.\n static toNarrowWidePattern(counters) {\n let numCounters = counters.length;\n let maxNarrowCounter = 0;\n let wideCounters;\n do {\n let minCounter = 0x7fffffff;\n for (let counter of counters) {\n if (counter < minCounter && counter > maxNarrowCounter) {\n minCounter = counter;\n }\n }\n maxNarrowCounter = minCounter;\n wideCounters = 0;\n let totalWideCountersWidth = 0;\n let pattern = 0;\n for (let i = 0; i < numCounters; i++) {\n let counter = counters[i];\n if (counter > maxNarrowCounter) {\n pattern |= 1 << (numCounters - 1 - i);\n wideCounters++;\n totalWideCountersWidth += counter;\n }\n }\n if (wideCounters === 3) {\n // Found 3 wide counters, but are they close enough in width?\n // We can perform a cheap, conservative check to see if any individual\n // counter is more than 1.5 times the average:\n for (let i = 0; i < numCounters && wideCounters > 0; i++) {\n let counter = counters[i];\n if (counter > maxNarrowCounter) {\n wideCounters--;\n // totalWideCountersWidth = 3 * average, so this checks if counter >= 3/2 * average\n if ((counter * 2) >= totalWideCountersWidth) {\n return -1;\n }\n }\n }\n return pattern;\n }\n } while (wideCounters > 3);\n return -1;\n }\n static patternToChar(pattern) {\n for (let i = 0; i < Code39Reader.CHARACTER_ENCODINGS.length; i++) {\n if (Code39Reader.CHARACTER_ENCODINGS[i] === pattern) {\n return Code39Reader.ALPHABET_STRING.charAt(i);\n }\n }\n if (pattern === Code39Reader.ASTERISK_ENCODING) {\n return '*';\n }\n throw new NotFoundException();\n }\n static decodeExtended(encoded) {\n let length = encoded.length;\n let decoded = '';\n for (let i = 0; i < length; i++) {\n let c = encoded.charAt(i);\n if (c === '+' || c === '$' || c === '%' || c === '/') {\n let next = encoded.charAt(i + 1);\n let decodedChar = '\\0';\n switch (c) {\n case '+':\n // +A to +Z map to a to z\n if (next >= 'A' && next <= 'Z') {\n decodedChar = String.fromCharCode(next.charCodeAt(0) + 32);\n }\n else {\n throw new FormatException();\n }\n break;\n case '$':\n // $A to $Z map to control codes SH to SB\n if (next >= 'A' && next <= 'Z') {\n decodedChar = String.fromCharCode(next.charCodeAt(0) - 64);\n }\n else {\n throw new FormatException();\n }\n break;\n case '%':\n // %A to %E map to control codes ESC to US\n if (next >= 'A' && next <= 'E') {\n decodedChar = String.fromCharCode(next.charCodeAt(0) - 38);\n }\n else if (next >= 'F' && next <= 'J') {\n decodedChar = String.fromCharCode(next.charCodeAt(0) - 11);\n }\n else if (next >= 'K' && next <= 'O') {\n decodedChar = String.fromCharCode(next.charCodeAt(0) + 16);\n }\n else if (next >= 'P' && next <= 'T') {\n decodedChar = String.fromCharCode(next.charCodeAt(0) + 43);\n }\n else if (next === 'U') {\n decodedChar = '\\0';\n }\n else if (next === 'V') {\n decodedChar = '@';\n }\n else if (next === 'W') {\n decodedChar = '`';\n }\n else if (next === 'X' || next === 'Y' || next === 'Z') {\n decodedChar = '\\x7f';\n }\n else {\n throw new FormatException();\n }\n break;\n case '/':\n // /A to /O map to ! to , and /Z maps to :\n if (next >= 'A' && next <= 'O') {\n decodedChar = String.fromCharCode(next.charCodeAt(0) - 32);\n }\n else if (next === 'Z') {\n decodedChar = ':';\n }\n else {\n throw new FormatException();\n }\n break;\n }\n decoded += decodedChar;\n // bump up i again since we read two characters\n i++;\n }\n else {\n decoded += c;\n }\n }\n return decoded;\n }\n }\n Code39Reader.ALPHABET_STRING = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%';\n /**\n * These represent the encodings of characters, as patterns of wide and narrow bars.\n * The 9 least-significant bits of each int correspond to the pattern of wide and narrow,\n * with 1s representing \"wide\" and 0s representing narrow.\n */\n Code39Reader.CHARACTER_ENCODINGS = [\n 0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124, 0x064,\n 0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00D, 0x10C, 0x04C, 0x01C,\n 0x103, 0x043, 0x142, 0x013, 0x112, 0x052, 0x007, 0x106, 0x046, 0x016,\n 0x181, 0x0C1, 0x1C0, 0x091, 0x190, 0x0D0, 0x085, 0x184, 0x0C4, 0x0A8,\n 0x0A2, 0x08A, 0x02A // /-%\n ];\n Code39Reader.ASTERISK_ENCODING = 0x094;\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n *Decodes ITF barcodes.
\n *\n * @author Tjieco\n */\n class ITFReader extends OneDReader {\n constructor() {\n // private static W = 3; // Pixel width of a 3x wide line\n // private static w = 2; // Pixel width of a 2x wide line\n // private static N = 1; // Pixed width of a narrow line\n super(...arguments);\n // Stores the actual narrow line width of the image being decoded.\n this.narrowLineWidth = -1;\n }\n // See ITFWriter.PATTERNS\n /*\n \n /!**\n * Patterns of Wide / Narrow lines to indicate each digit\n *!/\n */\n decodeRow(rowNumber, row, hints) {\n // Find out where the Middle section (payload) starts & ends\n let startRange = this.decodeStart(row);\n let endRange = this.decodeEnd(row);\n let result = new StringBuilder();\n ITFReader.decodeMiddle(row, startRange[1], endRange[0], result);\n let resultString = result.toString();\n let allowedLengths = null;\n if (hints != null) {\n allowedLengths = hints.get(DecodeHintType$1.ALLOWED_LENGTHS);\n }\n if (allowedLengths == null) {\n allowedLengths = ITFReader.DEFAULT_ALLOWED_LENGTHS;\n }\n // To avoid false positives with 2D barcodes (and other patterns), make\n // an assumption that the decoded string must be a 'standard' length if it's short\n let length = resultString.length;\n let lengthOK = false;\n let maxAllowedLength = 0;\n for (let value of allowedLengths) {\n if (length === value) {\n lengthOK = true;\n break;\n }\n if (value > maxAllowedLength) {\n maxAllowedLength = value;\n }\n }\n if (!lengthOK && length > maxAllowedLength) {\n lengthOK = true;\n }\n if (!lengthOK) {\n throw new FormatException();\n }\n const points = [new ResultPoint(startRange[1], rowNumber), new ResultPoint(endRange[0], rowNumber)];\n let resultReturn = new Result(resultString, null, // no natural byte representation for these barcodes\n 0, points, BarcodeFormat$1.ITF, new Date().getTime());\n return resultReturn;\n }\n /*\n /!**\n * @param row row of black/white values to search\n * @param payloadStart offset of start pattern\n * @param resultString {@link StringBuilder} to append decoded chars to\n * @throws NotFoundException if decoding could not complete successfully\n *!/*/\n static decodeMiddle(row, payloadStart, payloadEnd, resultString) {\n // Digits are interleaved in pairs - 5 black lines for one digit, and the\n // 5\n // interleaved white lines for the second digit.\n // Therefore, need to scan 10 lines and then\n // split these into two arrays\n let counterDigitPair = new Int32Array(10); // 10\n let counterBlack = new Int32Array(5); // 5\n let counterWhite = new Int32Array(5); // 5\n counterDigitPair.fill(0);\n counterBlack.fill(0);\n counterWhite.fill(0);\n while (payloadStart < payloadEnd) {\n // Get 10 runs of black/white.\n OneDReader.recordPattern(row, payloadStart, counterDigitPair);\n // Split them into each array\n for (let k = 0; k < 5; k++) {\n let twoK = 2 * k;\n counterBlack[k] = counterDigitPair[twoK];\n counterWhite[k] = counterDigitPair[twoK + 1];\n }\n let bestMatch = ITFReader.decodeDigit(counterBlack);\n resultString.append(bestMatch.toString());\n bestMatch = this.decodeDigit(counterWhite);\n resultString.append(bestMatch.toString());\n counterDigitPair.forEach(function (counterDigit) {\n payloadStart += counterDigit;\n });\n }\n }\n /*/!**\n * Identify where the start of the middle / payload section starts.\n *\n * @param row row of black/white values to search\n * @return Array, containing index of start of 'start block' and end of\n * 'start block'\n *!/*/\n decodeStart(row) {\n let endStart = ITFReader.skipWhiteSpace(row);\n let startPattern = ITFReader.findGuardPattern(row, endStart, ITFReader.START_PATTERN);\n // Determine the width of a narrow line in pixels. We can do this by\n // getting the width of the start pattern and dividing by 4 because its\n // made up of 4 narrow lines.\n this.narrowLineWidth = (startPattern[1] - startPattern[0]) / 4;\n this.validateQuietZone(row, startPattern[0]);\n return startPattern;\n }\n /*/!**\n * The start & end patterns must be pre/post fixed by a quiet zone. This\n * zone must be at least 10 times the width of a narrow line. Scan back until\n * we either get to the start of the barcode or match the necessary number of\n * quiet zone pixels.\n *\n * Note: Its assumed the row is reversed when using this method to find\n * quiet zone after the end pattern.\n *\n * ref: http://www.barcode-1.net/i25code.html\n *\n * @param row bit array representing the scanned barcode.\n * @param startPattern index into row of the start or end pattern.\n * @throws NotFoundException if the quiet zone cannot be found\n *!/*/\n validateQuietZone(row, startPattern) {\n let quietCount = this.narrowLineWidth * 10; // expect to find this many pixels of quiet zone\n // if there are not so many pixel at all let's try as many as possible\n quietCount = quietCount < startPattern ? quietCount : startPattern;\n for (let i = startPattern - 1; quietCount > 0 && i >= 0; i--) {\n if (row.get(i)) {\n break;\n }\n quietCount--;\n }\n if (quietCount !== 0) {\n // Unable to find the necessary number of quiet zone pixels.\n throw new NotFoundException();\n }\n }\n /*\n /!**\n * Skip all whitespace until we get to the first black line.\n *\n * @param row row of black/white values to search\n * @return index of the first black line.\n * @throws NotFoundException Throws exception if no black lines are found in the row\n *!/*/\n static skipWhiteSpace(row) {\n const width = row.getSize();\n const endStart = row.getNextSet(0);\n if (endStart === width) {\n throw new NotFoundException();\n }\n return endStart;\n }\n /*/!**\n * Identify where the end of the middle / payload section ends.\n *\n * @param row row of black/white values to search\n * @return Array, containing index of start of 'end block' and end of 'end\n * block'\n *!/*/\n decodeEnd(row) {\n // For convenience, reverse the row and then\n // search from 'the start' for the end block\n row.reverse();\n try {\n let endStart = ITFReader.skipWhiteSpace(row);\n let endPattern;\n try {\n endPattern = ITFReader.findGuardPattern(row, endStart, ITFReader.END_PATTERN_REVERSED[0]);\n }\n catch (error) {\n if (error instanceof NotFoundException) {\n endPattern = ITFReader.findGuardPattern(row, endStart, ITFReader.END_PATTERN_REVERSED[1]);\n }\n }\n // The start & end patterns must be pre/post fixed by a quiet zone. This\n // zone must be at least 10 times the width of a narrow line.\n // ref: http://www.barcode-1.net/i25code.html\n this.validateQuietZone(row, endPattern[0]);\n // Now recalculate the indices of where the 'endblock' starts & stops to\n // accommodate\n // the reversed nature of the search\n let temp = endPattern[0];\n endPattern[0] = row.getSize() - endPattern[1];\n endPattern[1] = row.getSize() - temp;\n return endPattern;\n }\n finally {\n // Put the row back the right way.\n row.reverse();\n }\n }\n /*\n /!**\n * @param row row of black/white values to search\n * @param rowOffset position to start search\n * @param pattern pattern of counts of number of black and white pixels that are\n * being searched for as a pattern\n * @return start/end horizontal offset of guard pattern, as an array of two\n * ints\n * @throws NotFoundException if pattern is not found\n *!/*/\n static findGuardPattern(row, rowOffset, pattern) {\n let patternLength = pattern.length;\n let counters = new Int32Array(patternLength);\n let width = row.getSize();\n let isWhite = false;\n let counterPosition = 0;\n let patternStart = rowOffset;\n counters.fill(0);\n for (let x = rowOffset; x < width; x++) {\n if (row.get(x) !== isWhite) {\n counters[counterPosition]++;\n }\n else {\n if (counterPosition === patternLength - 1) {\n if (OneDReader.patternMatchVariance(counters, pattern, ITFReader.MAX_INDIVIDUAL_VARIANCE) < ITFReader.MAX_AVG_VARIANCE) {\n return [patternStart, x];\n }\n patternStart += counters[0] + counters[1];\n System.arraycopy(counters, 2, counters, 0, counterPosition - 1);\n counters[counterPosition - 1] = 0;\n counters[counterPosition] = 0;\n counterPosition--;\n }\n else {\n counterPosition++;\n }\n counters[counterPosition] = 1;\n isWhite = !isWhite;\n }\n }\n throw new NotFoundException();\n }\n /*/!**\n * Attempts to decode a sequence of ITF black/white lines into single\n * digit.\n *\n * @param counters the counts of runs of observed black/white/black/... values\n * @return The decoded digit\n * @throws NotFoundException if digit cannot be decoded\n *!/*/\n static decodeDigit(counters) {\n let bestVariance = ITFReader.MAX_AVG_VARIANCE; // worst variance we'll accept\n let bestMatch = -1;\n let max = ITFReader.PATTERNS.length;\n for (let i = 0; i < max; i++) {\n let pattern = ITFReader.PATTERNS[i];\n let variance = OneDReader.patternMatchVariance(counters, pattern, ITFReader.MAX_INDIVIDUAL_VARIANCE);\n if (variance < bestVariance) {\n bestVariance = variance;\n bestMatch = i;\n }\n else if (variance === bestVariance) {\n // if we find a second 'best match' with the same variance, we can not reliably report to have a suitable match\n bestMatch = -1;\n }\n }\n if (bestMatch >= 0) {\n return bestMatch % 10;\n }\n else {\n throw new NotFoundException();\n }\n }\n }\n ITFReader.PATTERNS = [\n Int32Array.from([1, 1, 2, 2, 1]),\n Int32Array.from([2, 1, 1, 1, 2]),\n Int32Array.from([1, 2, 1, 1, 2]),\n Int32Array.from([2, 2, 1, 1, 1]),\n Int32Array.from([1, 1, 2, 1, 2]),\n Int32Array.from([2, 1, 2, 1, 1]),\n Int32Array.from([1, 2, 2, 1, 1]),\n Int32Array.from([1, 1, 1, 2, 2]),\n Int32Array.from([2, 1, 1, 2, 1]),\n Int32Array.from([1, 2, 1, 2, 1]),\n Int32Array.from([1, 1, 3, 3, 1]),\n Int32Array.from([3, 1, 1, 1, 3]),\n Int32Array.from([1, 3, 1, 1, 3]),\n Int32Array.from([3, 3, 1, 1, 1]),\n Int32Array.from([1, 1, 3, 1, 3]),\n Int32Array.from([3, 1, 3, 1, 1]),\n Int32Array.from([1, 3, 3, 1, 1]),\n Int32Array.from([1, 1, 1, 3, 3]),\n Int32Array.from([3, 1, 1, 3, 1]),\n Int32Array.from([1, 3, 1, 3, 1]) // 9\n ];\n ITFReader.MAX_AVG_VARIANCE = 0.38;\n ITFReader.MAX_INDIVIDUAL_VARIANCE = 0.5;\n /* /!** Valid ITF lengths. Anything longer than the largest value is also allowed. *!/*/\n ITFReader.DEFAULT_ALLOWED_LENGTHS = [6, 8, 10, 12, 14];\n /*/!**\n * Start/end guard pattern.\n *\n * Note: The end pattern is reversed because the row is reversed before\n * searching for the END_PATTERN\n *!/*/\n ITFReader.START_PATTERN = Int32Array.from([1, 1, 1, 1]);\n ITFReader.END_PATTERN_REVERSED = [\n Int32Array.from([1, 1, 2]),\n Int32Array.from([1, 1, 3]) // 3x\n ];\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n *Encapsulates functionality and implementation that is common to UPC and EAN families\n * of one-dimensional barcodes.
\n *\n * @author dswitkin@google.com (Daniel Switkin)\n * @author Sean Owen\n * @author alasdair@google.com (Alasdair Mackintosh)\n */\n class AbstractUPCEANReader extends OneDReader {\n constructor() {\n super(...arguments);\n this.decodeRowStringBuffer = '';\n }\n // private final UPCEANExtensionSupport extensionReader;\n // private final EANManufacturerOrgSupport eanManSupport;\n /*\n protected UPCEANReader() {\n decodeRowStringBuffer = new StringBuilder(20);\n extensionReader = new UPCEANExtensionSupport();\n eanManSupport = new EANManufacturerOrgSupport();\n }\n */\n static findStartGuardPattern(row) {\n let foundStart = false;\n let startRange;\n let nextStart = 0;\n let counters = Int32Array.from([0, 0, 0]);\n while (!foundStart) {\n counters = Int32Array.from([0, 0, 0]);\n startRange = AbstractUPCEANReader.findGuardPattern(row, nextStart, false, this.START_END_PATTERN, counters);\n let start = startRange[0];\n nextStart = startRange[1];\n let quietStart = start - (nextStart - start);\n if (quietStart >= 0) {\n foundStart = row.isRange(quietStart, start, false);\n }\n }\n return startRange;\n }\n static checkChecksum(s) {\n return AbstractUPCEANReader.checkStandardUPCEANChecksum(s);\n }\n static checkStandardUPCEANChecksum(s) {\n let length = s.length;\n if (length === 0)\n return false;\n let check = parseInt(s.charAt(length - 1), 10);\n return AbstractUPCEANReader.getStandardUPCEANChecksum(s.substring(0, length - 1)) === check;\n }\n static getStandardUPCEANChecksum(s) {\n let length = s.length;\n let sum = 0;\n for (let i = length - 1; i >= 0; i -= 2) {\n let digit = s.charAt(i).charCodeAt(0) - '0'.charCodeAt(0);\n if (digit < 0 || digit > 9) {\n throw new FormatException();\n }\n sum += digit;\n }\n sum *= 3;\n for (let i = length - 2; i >= 0; i -= 2) {\n let digit = s.charAt(i).charCodeAt(0) - '0'.charCodeAt(0);\n if (digit < 0 || digit > 9) {\n throw new FormatException();\n }\n sum += digit;\n }\n return (1000 - sum) % 10;\n }\n static decodeEnd(row, endStart) {\n return AbstractUPCEANReader.findGuardPattern(row, endStart, false, AbstractUPCEANReader.START_END_PATTERN, new Int32Array(AbstractUPCEANReader.START_END_PATTERN.length).fill(0));\n }\n /**\n * @throws NotFoundException\n */\n static findGuardPatternWithoutCounters(row, rowOffset, whiteFirst, pattern) {\n return this.findGuardPattern(row, rowOffset, whiteFirst, pattern, new Int32Array(pattern.length));\n }\n /**\n * @param row row of black/white values to search\n * @param rowOffset position to start search\n * @param whiteFirst if true, indicates that the pattern specifies white/black/white/...\n * pixel counts, otherwise, it is interpreted as black/white/black/...\n * @param pattern pattern of counts of number of black and white pixels that are being\n * searched for as a pattern\n * @param counters array of counters, as long as pattern, to re-use\n * @return start/end horizontal offset of guard pattern, as an array of two ints\n * @throws NotFoundException if pattern is not found\n */\n static findGuardPattern(row, rowOffset, whiteFirst, pattern, counters) {\n let width = row.getSize();\n rowOffset = whiteFirst ? row.getNextUnset(rowOffset) : row.getNextSet(rowOffset);\n let counterPosition = 0;\n let patternStart = rowOffset;\n let patternLength = pattern.length;\n let isWhite = whiteFirst;\n for (let x = rowOffset; x < width; x++) {\n if (row.get(x) !== isWhite) {\n counters[counterPosition]++;\n }\n else {\n if (counterPosition === patternLength - 1) {\n if (OneDReader.patternMatchVariance(counters, pattern, AbstractUPCEANReader.MAX_INDIVIDUAL_VARIANCE) < AbstractUPCEANReader.MAX_AVG_VARIANCE) {\n return Int32Array.from([patternStart, x]);\n }\n patternStart += counters[0] + counters[1];\n let slice = counters.slice(2, counters.length - 1);\n for (let i = 0; i < counterPosition - 1; i++) {\n counters[i] = slice[i];\n }\n counters[counterPosition - 1] = 0;\n counters[counterPosition] = 0;\n counterPosition--;\n }\n else {\n counterPosition++;\n }\n counters[counterPosition] = 1;\n isWhite = !isWhite;\n }\n }\n throw new NotFoundException();\n }\n static decodeDigit(row, counters, rowOffset, patterns) {\n this.recordPattern(row, rowOffset, counters);\n let bestVariance = this.MAX_AVG_VARIANCE;\n let bestMatch = -1;\n let max = patterns.length;\n for (let i = 0; i < max; i++) {\n let pattern = patterns[i];\n let variance = OneDReader.patternMatchVariance(counters, pattern, AbstractUPCEANReader.MAX_INDIVIDUAL_VARIANCE);\n if (variance < bestVariance) {\n bestVariance = variance;\n bestMatch = i;\n }\n }\n if (bestMatch >= 0) {\n return bestMatch;\n }\n else {\n throw new NotFoundException();\n }\n }\n }\n // These two values are critical for determining how permissive the decoding will be.\n // We've arrived at these values through a lot of trial and error. Setting them any higher\n // lets false positives creep in quickly.\n AbstractUPCEANReader.MAX_AVG_VARIANCE = 0.48;\n AbstractUPCEANReader.MAX_INDIVIDUAL_VARIANCE = 0.7;\n /**\n * Start/end guard pattern.\n */\n AbstractUPCEANReader.START_END_PATTERN = Int32Array.from([1, 1, 1]);\n /**\n * Pattern marking the middle of a UPC/EAN pattern, separating the two halves.\n */\n AbstractUPCEANReader.MIDDLE_PATTERN = Int32Array.from([1, 1, 1, 1, 1]);\n /**\n * end guard pattern.\n */\n AbstractUPCEANReader.END_PATTERN = Int32Array.from([1, 1, 1, 1, 1, 1]);\n /**\n * \"Odd\", or \"L\" patterns used to encode UPC/EAN digits.\n */\n AbstractUPCEANReader.L_PATTERNS = [\n Int32Array.from([3, 2, 1, 1]),\n Int32Array.from([2, 2, 2, 1]),\n Int32Array.from([2, 1, 2, 2]),\n Int32Array.from([1, 4, 1, 1]),\n Int32Array.from([1, 1, 3, 2]),\n Int32Array.from([1, 2, 3, 1]),\n Int32Array.from([1, 1, 1, 4]),\n Int32Array.from([1, 3, 1, 2]),\n Int32Array.from([1, 2, 1, 3]),\n Int32Array.from([3, 1, 1, 2]),\n ];\n\n /*\n * Copyright (C) 2010 ZXing authors\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 /**\n * @see UPCEANExtension2Support\n */\n class UPCEANExtension5Support {\n constructor() {\n this.CHECK_DIGIT_ENCODINGS = [0x18, 0x14, 0x12, 0x11, 0x0C, 0x06, 0x03, 0x0A, 0x09, 0x05];\n this.decodeMiddleCounters = Int32Array.from([0, 0, 0, 0]);\n this.decodeRowStringBuffer = '';\n }\n decodeRow(rowNumber, row, extensionStartRange) {\n let result = this.decodeRowStringBuffer;\n let end = this.decodeMiddle(row, extensionStartRange, result);\n let resultString = result.toString();\n let extensionData = UPCEANExtension5Support.parseExtensionString(resultString);\n let resultPoints = [\n new ResultPoint((extensionStartRange[0] + extensionStartRange[1]) / 2.0, rowNumber),\n new ResultPoint(end, rowNumber)\n ];\n let extensionResult = new Result(resultString, null, 0, resultPoints, BarcodeFormat$1.UPC_EAN_EXTENSION, new Date().getTime());\n if (extensionData != null) {\n extensionResult.putAllMetadata(extensionData);\n }\n return extensionResult;\n }\n decodeMiddle(row, startRange, resultString) {\n let counters = this.decodeMiddleCounters;\n counters[0] = 0;\n counters[1] = 0;\n counters[2] = 0;\n counters[3] = 0;\n let end = row.getSize();\n let rowOffset = startRange[1];\n let lgPatternFound = 0;\n for (let x = 0; x < 5 && rowOffset < end; x++) {\n let bestMatch = AbstractUPCEANReader.decodeDigit(row, counters, rowOffset, AbstractUPCEANReader.L_AND_G_PATTERNS);\n resultString += String.fromCharCode(('0'.charCodeAt(0) + bestMatch % 10));\n for (let counter of counters) {\n rowOffset += counter;\n }\n if (bestMatch >= 10) {\n lgPatternFound |= 1 << (4 - x);\n }\n if (x !== 4) {\n // Read off separator if not last\n rowOffset = row.getNextSet(rowOffset);\n rowOffset = row.getNextUnset(rowOffset);\n }\n }\n if (resultString.length !== 5) {\n throw new NotFoundException();\n }\n let checkDigit = this.determineCheckDigit(lgPatternFound);\n if (UPCEANExtension5Support.extensionChecksum(resultString.toString()) !== checkDigit) {\n throw new NotFoundException();\n }\n return rowOffset;\n }\n static extensionChecksum(s) {\n let length = s.length;\n let sum = 0;\n for (let i = length - 2; i >= 0; i -= 2) {\n sum += s.charAt(i).charCodeAt(0) - '0'.charCodeAt(0);\n }\n sum *= 3;\n for (let i = length - 1; i >= 0; i -= 2) {\n sum += s.charAt(i).charCodeAt(0) - '0'.charCodeAt(0);\n }\n sum *= 3;\n return sum % 10;\n }\n determineCheckDigit(lgPatternFound) {\n for (let d = 0; d < 10; d++) {\n if (lgPatternFound === this.CHECK_DIGIT_ENCODINGS[d]) {\n return d;\n }\n }\n throw new NotFoundException();\n }\n static parseExtensionString(raw) {\n if (raw.length !== 5) {\n return null;\n }\n let value = UPCEANExtension5Support.parseExtension5String(raw);\n if (value == null) {\n return null;\n }\n return new Map([[ResultMetadataType$1.SUGGESTED_PRICE, value]]);\n }\n static parseExtension5String(raw) {\n let currency;\n switch (raw.charAt(0)) {\n case '0':\n currency = '£';\n break;\n case '5':\n currency = '$';\n break;\n case '9':\n // Reference: http://www.jollytech.com\n switch (raw) {\n case '90000':\n // No suggested retail price\n return null;\n case '99991':\n // Complementary\n return '0.00';\n case '99990':\n return 'Used';\n }\n // Otherwise... unknown currency?\n currency = '';\n break;\n default:\n currency = '';\n break;\n }\n let rawAmount = parseInt(raw.substring(1));\n let unitsString = (rawAmount / 100).toString();\n let hundredths = rawAmount % 100;\n let hundredthsString = hundredths < 10 ? '0' + hundredths : hundredths.toString(); // fixme\n return currency + unitsString + '.' + hundredthsString;\n }\n }\n\n /*\n * Copyright (C) 2012 ZXing authors\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 /**\n * @see UPCEANExtension5Support\n */\n class UPCEANExtension2Support {\n constructor() {\n this.decodeMiddleCounters = Int32Array.from([0, 0, 0, 0]);\n this.decodeRowStringBuffer = '';\n }\n decodeRow(rowNumber, row, extensionStartRange) {\n let result = this.decodeRowStringBuffer;\n let end = this.decodeMiddle(row, extensionStartRange, result);\n let resultString = result.toString();\n let extensionData = UPCEANExtension2Support.parseExtensionString(resultString);\n let resultPoints = [\n new ResultPoint((extensionStartRange[0] + extensionStartRange[1]) / 2.0, rowNumber),\n new ResultPoint(end, rowNumber)\n ];\n let extensionResult = new Result(resultString, null, 0, resultPoints, BarcodeFormat$1.UPC_EAN_EXTENSION, new Date().getTime());\n if (extensionData != null) {\n extensionResult.putAllMetadata(extensionData);\n }\n return extensionResult;\n }\n decodeMiddle(row, startRange, resultString) {\n let counters = this.decodeMiddleCounters;\n counters[0] = 0;\n counters[1] = 0;\n counters[2] = 0;\n counters[3] = 0;\n let end = row.getSize();\n let rowOffset = startRange[1];\n let checkParity = 0;\n for (let x = 0; x < 2 && rowOffset < end; x++) {\n let bestMatch = AbstractUPCEANReader.decodeDigit(row, counters, rowOffset, AbstractUPCEANReader.L_AND_G_PATTERNS);\n resultString += String.fromCharCode(('0'.charCodeAt(0) + bestMatch % 10));\n for (let counter of counters) {\n rowOffset += counter;\n }\n if (bestMatch >= 10) {\n checkParity |= 1 << (1 - x);\n }\n if (x !== 1) {\n // Read off separator if not last\n rowOffset = row.getNextSet(rowOffset);\n rowOffset = row.getNextUnset(rowOffset);\n }\n }\n if (resultString.length !== 2) {\n throw new NotFoundException();\n }\n if (parseInt(resultString.toString()) % 4 !== checkParity) {\n throw new NotFoundException();\n }\n return rowOffset;\n }\n static parseExtensionString(raw) {\n if (raw.length !== 2) {\n return null;\n }\n return new Map([[ResultMetadataType$1.ISSUE_NUMBER, parseInt(raw)]]);\n }\n }\n\n /*\n * Copyright (C) 2010 ZXing authors\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 class UPCEANExtensionSupport {\n static decodeRow(rowNumber, row, rowOffset) {\n let extensionStartRange = AbstractUPCEANReader.findGuardPattern(row, rowOffset, false, this.EXTENSION_START_PATTERN, new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));\n try {\n // return null;\n let fiveSupport = new UPCEANExtension5Support();\n return fiveSupport.decodeRow(rowNumber, row, extensionStartRange);\n }\n catch (err) {\n // return null;\n let twoSupport = new UPCEANExtension2Support();\n return twoSupport.decodeRow(rowNumber, row, extensionStartRange);\n }\n }\n }\n UPCEANExtensionSupport.EXTENSION_START_PATTERN = Int32Array.from([1, 1, 2]);\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n *Encapsulates functionality and implementation that is common to UPC and EAN families\n * of one-dimensional barcodes.
\n *\n * @author dswitkin@google.com (Daniel Switkin)\n * @author Sean Owen\n * @author alasdair@google.com (Alasdair Mackintosh)\n */\n class UPCEANReader extends AbstractUPCEANReader {\n constructor() {\n super();\n this.decodeRowStringBuffer = '';\n UPCEANReader.L_AND_G_PATTERNS = UPCEANReader.L_PATTERNS.map(arr => Int32Array.from(arr));\n for (let i = 10; i < 20; i++) {\n let widths = UPCEANReader.L_PATTERNS[i - 10];\n let reversedWidths = new Int32Array(widths.length);\n for (let j = 0; j < widths.length; j++) {\n reversedWidths[j] = widths[widths.length - j - 1];\n }\n UPCEANReader.L_AND_G_PATTERNS[i] = reversedWidths;\n }\n }\n decodeRow(rowNumber, row, hints) {\n let startGuardRange = UPCEANReader.findStartGuardPattern(row);\n let resultPointCallback = hints == null ? null : hints.get(DecodeHintType$1.NEED_RESULT_POINT_CALLBACK);\n if (resultPointCallback != null) {\n const resultPoint = new ResultPoint((startGuardRange[0] + startGuardRange[1]) / 2.0, rowNumber);\n resultPointCallback.foundPossibleResultPoint(resultPoint);\n }\n let budello = this.decodeMiddle(row, startGuardRange, this.decodeRowStringBuffer);\n let endStart = budello.rowOffset;\n let result = budello.resultString;\n if (resultPointCallback != null) {\n const resultPoint = new ResultPoint(endStart, rowNumber);\n resultPointCallback.foundPossibleResultPoint(resultPoint);\n }\n let endRange = UPCEANReader.decodeEnd(row, endStart);\n if (resultPointCallback != null) {\n const resultPoint = new ResultPoint((endRange[0] + endRange[1]) / 2.0, rowNumber);\n resultPointCallback.foundPossibleResultPoint(resultPoint);\n }\n // Make sure there is a quiet zone at least as big as the end pattern after the barcode. The\n // spec might want more whitespace, but in practice this is the maximum we can count on.\n let end = endRange[1];\n let quietEnd = end + (end - endRange[0]);\n if (quietEnd >= row.getSize() || !row.isRange(end, quietEnd, false)) {\n throw new NotFoundException();\n }\n let resultString = result.toString();\n // UPC/EAN should never be less than 8 chars anyway\n if (resultString.length < 8) {\n throw new FormatException();\n }\n if (!UPCEANReader.checkChecksum(resultString)) {\n throw new ChecksumException();\n }\n let left = (startGuardRange[1] + startGuardRange[0]) / 2.0;\n let right = (endRange[1] + endRange[0]) / 2.0;\n let format = this.getBarcodeFormat();\n let resultPoint = [new ResultPoint(left, rowNumber), new ResultPoint(right, rowNumber)];\n let decodeResult = new Result(resultString, null, 0, resultPoint, format, new Date().getTime());\n let extensionLength = 0;\n try {\n let extensionResult = UPCEANExtensionSupport.decodeRow(rowNumber, row, endRange[1]);\n decodeResult.putMetadata(ResultMetadataType$1.UPC_EAN_EXTENSION, extensionResult.getText());\n decodeResult.putAllMetadata(extensionResult.getResultMetadata());\n decodeResult.addResultPoints(extensionResult.getResultPoints());\n extensionLength = extensionResult.getText().length;\n }\n catch (err) {\n }\n let allowedExtensions = hints == null ? null : hints.get(DecodeHintType$1.ALLOWED_EAN_EXTENSIONS);\n if (allowedExtensions != null) {\n let valid = false;\n for (let length in allowedExtensions) {\n if (extensionLength.toString() === length) { // check me\n valid = true;\n break;\n }\n }\n if (!valid) {\n throw new NotFoundException();\n }\n }\n if (format === BarcodeFormat$1.EAN_13 || format === BarcodeFormat$1.UPC_A) ;\n return decodeResult;\n }\n static checkChecksum(s) {\n return UPCEANReader.checkStandardUPCEANChecksum(s);\n }\n static checkStandardUPCEANChecksum(s) {\n let length = s.length;\n if (length === 0)\n return false;\n let check = parseInt(s.charAt(length - 1), 10);\n return UPCEANReader.getStandardUPCEANChecksum(s.substring(0, length - 1)) === check;\n }\n static getStandardUPCEANChecksum(s) {\n let length = s.length;\n let sum = 0;\n for (let i = length - 1; i >= 0; i -= 2) {\n let digit = s.charAt(i).charCodeAt(0) - '0'.charCodeAt(0);\n if (digit < 0 || digit > 9) {\n throw new FormatException();\n }\n sum += digit;\n }\n sum *= 3;\n for (let i = length - 2; i >= 0; i -= 2) {\n let digit = s.charAt(i).charCodeAt(0) - '0'.charCodeAt(0);\n if (digit < 0 || digit > 9) {\n throw new FormatException();\n }\n sum += digit;\n }\n return (1000 - sum) % 10;\n }\n static decodeEnd(row, endStart) {\n return UPCEANReader.findGuardPattern(row, endStart, false, UPCEANReader.START_END_PATTERN, new Int32Array(UPCEANReader.START_END_PATTERN.length).fill(0));\n }\n }\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n *Implements decoding of the EAN-13 format.
\n *\n * @author dswitkin@google.com (Daniel Switkin)\n * @author Sean Owen\n * @author alasdair@google.com (Alasdair Mackintosh)\n */\n class EAN13Reader extends UPCEANReader {\n constructor() {\n super();\n this.decodeMiddleCounters = Int32Array.from([0, 0, 0, 0]);\n }\n decodeMiddle(row, startRange, resultString) {\n let counters = this.decodeMiddleCounters;\n counters[0] = 0;\n counters[1] = 0;\n counters[2] = 0;\n counters[3] = 0;\n let end = row.getSize();\n let rowOffset = startRange[1];\n let lgPatternFound = 0;\n for (let x = 0; x < 6 && rowOffset < end; x++) {\n let bestMatch = UPCEANReader.decodeDigit(row, counters, rowOffset, UPCEANReader.L_AND_G_PATTERNS);\n resultString += String.fromCharCode(('0'.charCodeAt(0) + bestMatch % 10));\n for (let counter of counters) {\n rowOffset += counter;\n }\n if (bestMatch >= 10) {\n lgPatternFound |= 1 << (5 - x);\n }\n }\n resultString = EAN13Reader.determineFirstDigit(resultString, lgPatternFound);\n let middleRange = UPCEANReader.findGuardPattern(row, rowOffset, true, UPCEANReader.MIDDLE_PATTERN, new Int32Array(UPCEANReader.MIDDLE_PATTERN.length).fill(0));\n rowOffset = middleRange[1];\n for (let x = 0; x < 6 && rowOffset < end; x++) {\n let bestMatch = UPCEANReader.decodeDigit(row, counters, rowOffset, UPCEANReader.L_PATTERNS);\n resultString += String.fromCharCode(('0'.charCodeAt(0) + bestMatch));\n for (let counter of counters) {\n rowOffset += counter;\n }\n }\n return { rowOffset, resultString };\n }\n getBarcodeFormat() {\n return BarcodeFormat$1.EAN_13;\n }\n static determineFirstDigit(resultString, lgPatternFound) {\n for (let d = 0; d < 10; d++) {\n if (lgPatternFound === this.FIRST_DIGIT_ENCODINGS[d]) {\n resultString = String.fromCharCode(('0'.charCodeAt(0) + d)) + resultString;\n return resultString;\n }\n }\n throw new NotFoundException();\n }\n }\n EAN13Reader.FIRST_DIGIT_ENCODINGS = [0x00, 0x0B, 0x0D, 0xE, 0x13, 0x19, 0x1C, 0x15, 0x16, 0x1A];\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n *Implements decoding of the EAN-8 format.
\n *\n * @author Sean Owen\n */\n class EAN8Reader extends UPCEANReader {\n constructor() {\n super();\n this.decodeMiddleCounters = Int32Array.from([0, 0, 0, 0]);\n }\n decodeMiddle(row, startRange, resultString) {\n const counters = this.decodeMiddleCounters;\n counters[0] = 0;\n counters[1] = 0;\n counters[2] = 0;\n counters[3] = 0;\n let end = row.getSize();\n let rowOffset = startRange[1];\n for (let x = 0; x < 4 && rowOffset < end; x++) {\n let bestMatch = UPCEANReader.decodeDigit(row, counters, rowOffset, UPCEANReader.L_PATTERNS);\n resultString += String.fromCharCode(('0'.charCodeAt(0) + bestMatch));\n for (let counter of counters) {\n rowOffset += counter;\n }\n }\n let middleRange = UPCEANReader.findGuardPattern(row, rowOffset, true, UPCEANReader.MIDDLE_PATTERN, new Int32Array(UPCEANReader.MIDDLE_PATTERN.length).fill(0));\n rowOffset = middleRange[1];\n for (let x = 0; x < 4 && rowOffset < end; x++) {\n let bestMatch = UPCEANReader.decodeDigit(row, counters, rowOffset, UPCEANReader.L_PATTERNS);\n resultString += String.fromCharCode(('0'.charCodeAt(0) + bestMatch));\n for (let counter of counters) {\n rowOffset += counter;\n }\n }\n return { rowOffset, resultString };\n }\n getBarcodeFormat() {\n return BarcodeFormat$1.EAN_8;\n }\n }\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n * Encapsulates functionality and implementation that is common to all families\n * of one-dimensional barcodes.\n *\n * @author dswitkin@google.com (Daniel Switkin)\n * @author Sean Owen\n * @author sam2332 (Sam Rudloff)\n *\n * @source https://github.com/zxing/zxing/blob/3c96923276dd5785d58eb970b6ba3f80d36a9505/core/src/main/java/com/google/zxing/oned/UPCAReader.java\n *\n * @experimental\n */\n class UPCAReader extends UPCEANReader {\n constructor() {\n super(...arguments);\n this.ean13Reader = new EAN13Reader();\n }\n // @Override\n getBarcodeFormat() {\n return BarcodeFormat$1.UPC_A;\n }\n // Note that we don't try rotation without the try harder flag, even if rotation was supported.\n // @Override\n decode(image, hints) {\n return this.maybeReturnResult(this.ean13Reader.decode(image));\n }\n // @Override\n decodeRow(rowNumber, row, hints) {\n return this.maybeReturnResult(this.ean13Reader.decodeRow(rowNumber, row, hints));\n }\n // @Override\n decodeMiddle(row, startRange, resultString) {\n return this.ean13Reader.decodeMiddle(row, startRange, resultString);\n }\n maybeReturnResult(result) {\n let text = result.getText();\n if (text.charAt(0) === '0') {\n let upcaResult = new Result(text.substring(1), null, null, result.getResultPoints(), BarcodeFormat$1.UPC_A);\n if (result.getResultMetadata() != null) {\n upcaResult.putAllMetadata(result.getResultMetadata());\n }\n return upcaResult;\n }\n else {\n throw new NotFoundException();\n }\n }\n reset() {\n this.ean13Reader.reset();\n }\n }\n\n /*\n * Copyright 2008 ZXing authors\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 // package com.google.zxing.oned;\n // import com.google.zxing.BarcodeFormat;\n // import com.google.zxing.FormatException;\n // import com.google.zxing.NotFoundException;\n // import com.google.zxing.common.BitArray;\n /**\n *Implements decoding of the UPC-E format.
\n *This is a great reference for\n * UPC-E information.
\n *\n * @author Sean Owen\n *\n * @source https://github.com/zxing/zxing/blob/3c96923276dd5785d58eb970b6ba3f80d36a9505/core/src/main/java/com/google/zxing/oned/UPCEReader.java\n *\n * @experimental\n */\n /* final */ class UPCEReader extends UPCEANReader {\n constructor() {\n super();\n this.decodeMiddleCounters = new Int32Array(4);\n }\n /**\n * @throws NotFoundException\n */\n // @Override\n decodeMiddle(row, startRange, result) {\n const counters = this.decodeMiddleCounters.map(x => x);\n counters[0] = 0;\n counters[1] = 0;\n counters[2] = 0;\n counters[3] = 0;\n const end = row.getSize();\n let rowOffset = startRange[1];\n let lgPatternFound = 0;\n for (let x = 0; x < 6 && rowOffset < end; x++) {\n const bestMatch = UPCEReader.decodeDigit(row, counters, rowOffset, UPCEReader.L_AND_G_PATTERNS);\n result += String.fromCharCode(('0'.charCodeAt(0) + bestMatch % 10));\n for (let counter of counters) {\n rowOffset += counter;\n }\n if (bestMatch >= 10) {\n lgPatternFound |= 1 << (5 - x);\n }\n }\n UPCEReader.determineNumSysAndCheckDigit(new StringBuilder(result), lgPatternFound);\n return rowOffset;\n }\n /**\n * @throws NotFoundException\n */\n // @Override\n decodeEnd(row, endStart) {\n return UPCEReader.findGuardPatternWithoutCounters(row, endStart, true, UPCEReader.MIDDLE_END_PATTERN);\n }\n /**\n * @throws FormatException\n */\n // @Override\n checkChecksum(s) {\n return UPCEANReader.checkChecksum(UPCEReader.convertUPCEtoUPCA(s));\n }\n /**\n * @throws NotFoundException\n */\n static determineNumSysAndCheckDigit(resultString, lgPatternFound) {\n for (let numSys = 0; numSys <= 1; numSys++) {\n for (let d = 0; d < 10; d++) {\n if (lgPatternFound === this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[numSys][d]) {\n resultString.insert(0, /*(char)*/ ('0' + numSys));\n resultString.append(/*(char)*/ ('0' + d));\n return;\n }\n }\n }\n throw NotFoundException.getNotFoundInstance();\n }\n // @Override\n getBarcodeFormat() {\n return BarcodeFormat$1.UPC_E;\n }\n /**\n * Expands a UPC-E value back into its full, equivalent UPC-A code value.\n *\n * @param upce UPC-E code as string of digits\n * @return equivalent UPC-A code as string of digits\n */\n static convertUPCEtoUPCA(upce) {\n // the following line is equivalent to upce.getChars(1, 7, upceChars, 0);\n const upceChars = upce.slice(1, 7).split('').map(x => x.charCodeAt(0));\n const result = new StringBuilder( /*12*/);\n result.append(upce.charAt(0));\n let lastChar = upceChars[5];\n switch (lastChar) {\n case 0:\n case 1:\n case 2:\n result.appendChars(upceChars, 0, 2);\n result.append(lastChar);\n result.append('0000');\n result.appendChars(upceChars, 2, 3);\n break;\n case 3:\n result.appendChars(upceChars, 0, 3);\n result.append('00000');\n result.appendChars(upceChars, 3, 2);\n break;\n case 4:\n result.appendChars(upceChars, 0, 4);\n result.append('00000');\n result.append(upceChars[4]);\n break;\n default:\n result.appendChars(upceChars, 0, 5);\n result.append('0000');\n result.append(lastChar);\n break;\n }\n // Only append check digit in conversion if supplied\n if (upce.length >= 8) {\n result.append(upce.charAt(7));\n }\n return result.toString();\n }\n }\n /**\n * The pattern that marks the middle, and end, of a UPC-E pattern.\n * There is no \"second half\" to a UPC-E barcode.\n */\n UPCEReader.MIDDLE_END_PATTERN = Int32Array.from([1, 1, 1, 1, 1, 1]);\n // For an UPC-E barcode, the final digit is represented by the parities used\n // to encode the middle six digits, according to the table below.\n //\n // Parity of next 6 digits\n // Digit 0 1 2 3 4 5\n // 0 Even Even Even Odd Odd Odd\n // 1 Even Even Odd Even Odd Odd\n // 2 Even Even Odd Odd Even Odd\n // 3 Even Even Odd Odd Odd Even\n // 4 Even Odd Even Even Odd Odd\n // 5 Even Odd Odd Even Even Odd\n // 6 Even Odd Odd Odd Even Even\n // 7 Even Odd Even Odd Even Odd\n // 8 Even Odd Even Odd Odd Even\n // 9 Even Odd Odd Even Odd Even\n //\n // The encoding is represented by the following array, which is a bit pattern\n // using Odd = 0 and Even = 1. For example, 5 is represented by:\n //\n // Odd Even Even Odd Odd Even\n // in binary:\n // 0 1 1 0 0 1 == 0x19\n //\n /**\n * See {@link #L_AND_G_PATTERNS}; these values similarly represent patterns of\n * even-odd parity encodings of digits that imply both the number system (0 or 1)\n * used, and the check digit.\n */\n UPCEReader.NUMSYS_AND_CHECK_DIGIT_PATTERNS = [\n Int32Array.from([0x38, 0x34, 0x32, 0x31, 0x2C, 0x26, 0x23, 0x2A, 0x29, 0x25]),\n Int32Array.from([0x07, 0x0B, 0x0D, 0x0E, 0x13, 0x19, 0x1C, 0x15, 0x16, 0x1]),\n ];\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n *A reader that can read all available UPC/EAN formats. If a caller wants to try to\n * read all such formats, it is most efficient to use this implementation rather than invoke\n * individual readers.
\n *\n * @author Sean Owen\n */\n class MultiFormatUPCEANReader extends OneDReader {\n constructor(hints) {\n super();\n let possibleFormats = hints == null ? null : hints.get(DecodeHintType$1.POSSIBLE_FORMATS);\n let readers = [];\n if (possibleFormats != null) {\n if (possibleFormats.indexOf(BarcodeFormat$1.EAN_13) > -1) {\n readers.push(new EAN13Reader());\n }\n else if (possibleFormats.indexOf(BarcodeFormat$1.UPC_A) > -1) {\n readers.push(new UPCAReader());\n }\n if (possibleFormats.indexOf(BarcodeFormat$1.EAN_8) > -1) {\n readers.push(new EAN8Reader());\n }\n if (possibleFormats.indexOf(BarcodeFormat$1.UPC_E) > -1) {\n readers.push(new UPCEReader());\n }\n }\n if (readers.length === 0) {\n readers.push(new EAN13Reader());\n // UPC-A is covered by EAN-13\n readers.push(new EAN8Reader());\n readers.push(new UPCEReader());\n }\n this.readers = readers;\n }\n decodeRow(rowNumber, row, hints) {\n for (let reader of this.readers) {\n try {\n // const result: Result = reader.decodeRow(rowNumber, row, startGuardPattern, hints);\n const result = reader.decodeRow(rowNumber, row, hints);\n // Special case: a 12-digit code encoded in UPC-A is identical to a \"0\"\n // followed by those 12 digits encoded as EAN-13. Each will recognize such a code,\n // UPC-A as a 12-digit string and EAN-13 as a 13-digit string starting with \"0\".\n // Individually these are correct and their readers will both read such a code\n // and correctly call it EAN-13, or UPC-A, respectively.\n //\n // In this case, if we've been looking for both types, we'd like to call it\n // a UPC-A code. But for efficiency we only run the EAN-13 decoder to also read\n // UPC-A. So we special case it here, and convert an EAN-13 result to a UPC-A\n // result if appropriate.\n //\n // But, don't return UPC-A if UPC-A was not a requested format!\n const ean13MayBeUPCA = result.getBarcodeFormat() === BarcodeFormat$1.EAN_13 &&\n result.getText().charAt(0) === '0';\n // @SuppressWarnings(\"unchecked\")\n const possibleFormats = hints == null ? null : hints.get(DecodeHintType$1.POSSIBLE_FORMATS);\n const canReturnUPCA = possibleFormats == null || possibleFormats.includes(BarcodeFormat$1.UPC_A);\n if (ean13MayBeUPCA && canReturnUPCA) {\n const rawBytes = result.getRawBytes();\n // Transfer the metadata across\n const resultUPCA = new Result(result.getText().substring(1), rawBytes, rawBytes.length, result.getResultPoints(), BarcodeFormat$1.UPC_A);\n resultUPCA.putAllMetadata(result.getResultMetadata());\n return resultUPCA;\n }\n return result;\n }\n catch (err) {\n // continue;\n }\n }\n throw new NotFoundException();\n }\n reset() {\n for (let reader of this.readers) {\n reader.reset();\n }\n }\n }\n\n // import Integer from '../../util/Integer';\n // import Float from '../../util/Float';\n class AbstractRSSReader extends OneDReader {\n constructor() {\n super();\n this.decodeFinderCounters = new Int32Array(4);\n this.dataCharacterCounters = new Int32Array(8);\n this.oddRoundingErrors = new Array(4);\n this.evenRoundingErrors = new Array(4);\n this.oddCounts = new Array(this.dataCharacterCounters.length / 2);\n this.evenCounts = new Array(this.dataCharacterCounters.length / 2);\n }\n getDecodeFinderCounters() {\n return this.decodeFinderCounters;\n }\n getDataCharacterCounters() {\n return this.dataCharacterCounters;\n }\n getOddRoundingErrors() {\n return this.oddRoundingErrors;\n }\n getEvenRoundingErrors() {\n return this.evenRoundingErrors;\n }\n getOddCounts() {\n return this.oddCounts;\n }\n getEvenCounts() {\n return this.evenCounts;\n }\n parseFinderValue(counters, finderPatterns) {\n for (let value = 0; value < finderPatterns.length; value++) {\n if (OneDReader.patternMatchVariance(counters, finderPatterns[value], AbstractRSSReader.MAX_INDIVIDUAL_VARIANCE) < AbstractRSSReader.MAX_AVG_VARIANCE) {\n return value;\n }\n }\n throw new NotFoundException();\n }\n /**\n * @param array values to sum\n * @return sum of values\n * @deprecated call {@link MathUtils#sum(int[])}\n */\n static count(array) {\n return MathUtils.sum(new Int32Array(array));\n }\n static increment(array, errors) {\n let index = 0;\n let biggestError = errors[0];\n for (let i = 1; i < array.length; i++) {\n if (errors[i] > biggestError) {\n biggestError = errors[i];\n index = i;\n }\n }\n array[index]++;\n }\n static decrement(array, errors) {\n let index = 0;\n let biggestError = errors[0];\n for (let i = 1; i < array.length; i++) {\n if (errors[i] < biggestError) {\n biggestError = errors[i];\n index = i;\n }\n }\n array[index]--;\n }\n static isFinderPattern(counters) {\n let firstTwoSum = counters[0] + counters[1];\n let sum = firstTwoSum + counters[2] + counters[3];\n let ratio = firstTwoSum / sum;\n if (ratio >= AbstractRSSReader.MIN_FINDER_PATTERN_RATIO && ratio <= AbstractRSSReader.MAX_FINDER_PATTERN_RATIO) {\n // passes ratio test in spec, but see if the counts are unreasonable\n let minCounter = Number.MAX_SAFE_INTEGER;\n let maxCounter = Number.MIN_SAFE_INTEGER;\n for (let counter of counters) {\n if (counter > maxCounter) {\n maxCounter = counter;\n }\n if (counter < minCounter) {\n minCounter = counter;\n }\n }\n return maxCounter < 10 * minCounter;\n }\n return false;\n }\n }\n AbstractRSSReader.MAX_AVG_VARIANCE = 0.2;\n AbstractRSSReader.MAX_INDIVIDUAL_VARIANCE = 0.45;\n AbstractRSSReader.MIN_FINDER_PATTERN_RATIO = 9.5 / 12.0;\n AbstractRSSReader.MAX_FINDER_PATTERN_RATIO = 12.5 / 14.0;\n\n class DataCharacter {\n constructor(value, checksumPortion) {\n this.value = value;\n this.checksumPortion = checksumPortion;\n }\n getValue() {\n return this.value;\n }\n getChecksumPortion() {\n return this.checksumPortion;\n }\n toString() {\n return this.value + '(' + this.checksumPortion + ')';\n }\n equals(o) {\n if (!(o instanceof DataCharacter)) {\n return false;\n }\n const that = o;\n return this.value === that.value && this.checksumPortion === that.checksumPortion;\n }\n hashCode() {\n return this.value ^ this.checksumPortion;\n }\n }\n\n class FinderPattern {\n constructor(value, startEnd, start, end, rowNumber) {\n this.value = value;\n this.startEnd = startEnd;\n this.value = value;\n this.startEnd = startEnd;\n this.resultPoints = new Array();\n this.resultPoints.push(new ResultPoint(start, rowNumber));\n this.resultPoints.push(new ResultPoint(end, rowNumber));\n }\n getValue() {\n return this.value;\n }\n getStartEnd() {\n return this.startEnd;\n }\n getResultPoints() {\n return this.resultPoints;\n }\n equals(o) {\n if (!(o instanceof FinderPattern)) {\n return false;\n }\n const that = o;\n return this.value === that.value;\n }\n hashCode() {\n return this.value;\n }\n }\n\n /**\n * RSS util functions.\n */\n class RSSUtils {\n constructor() { }\n static getRSSvalue(widths, maxWidth, noNarrow) {\n let n = 0;\n for (let width of widths) {\n n += width;\n }\n let val = 0;\n let narrowMask = 0;\n let elements = widths.length;\n for (let bar = 0; bar < elements - 1; bar++) {\n let elmWidth;\n for (elmWidth = 1, narrowMask |= 1 << bar; elmWidth < widths[bar]; elmWidth++, narrowMask &= ~(1 << bar)) {\n let subVal = RSSUtils.combins(n - elmWidth - 1, elements - bar - 2);\n if (noNarrow && (narrowMask === 0) && (n - elmWidth - (elements - bar - 1) >= elements - bar - 1)) {\n subVal -= RSSUtils.combins(n - elmWidth - (elements - bar), elements - bar - 2);\n }\n if (elements - bar - 1 > 1) {\n let lessVal = 0;\n for (let mxwElement = n - elmWidth - (elements - bar - 2); mxwElement > maxWidth; mxwElement--) {\n lessVal += RSSUtils.combins(n - elmWidth - mxwElement - 1, elements - bar - 3);\n }\n subVal -= lessVal * (elements - 1 - bar);\n }\n else if (n - elmWidth > maxWidth) {\n subVal--;\n }\n val += subVal;\n }\n n -= elmWidth;\n }\n return val;\n }\n static combins(n, r) {\n let maxDenom;\n let minDenom;\n if (n - r > r) {\n minDenom = r;\n maxDenom = n - r;\n }\n else {\n minDenom = n - r;\n maxDenom = r;\n }\n let val = 1;\n let j = 1;\n for (let i = n; i > maxDenom; i--) {\n val *= i;\n if (j <= minDenom) {\n val /= j;\n j++;\n }\n }\n while ((j <= minDenom)) {\n val /= j;\n j++;\n }\n return val;\n }\n }\n\n class BitArrayBuilder {\n static buildBitArray(pairs) {\n let charNumber = (pairs.length * 2) - 1;\n if (pairs[pairs.length - 1].getRightChar() == null) {\n charNumber -= 1;\n }\n let size = 12 * charNumber;\n let binary = new BitArray(size);\n let accPos = 0;\n let firstPair = pairs[0];\n let firstValue = firstPair.getRightChar().getValue();\n for (let i = 11; i >= 0; --i) {\n if ((firstValue & (1 << i)) != 0) {\n binary.set(accPos);\n }\n accPos++;\n }\n for (let i = 1; i < pairs.length; ++i) {\n let currentPair = pairs[i];\n let leftValue = currentPair.getLeftChar().getValue();\n for (let j = 11; j >= 0; --j) {\n if ((leftValue & (1 << j)) != 0) {\n binary.set(accPos);\n }\n accPos++;\n }\n if (currentPair.getRightChar() != null) {\n let rightValue = currentPair.getRightChar().getValue();\n for (let j = 11; j >= 0; --j) {\n if ((rightValue & (1 << j)) != 0) {\n binary.set(accPos);\n }\n accPos++;\n }\n }\n }\n return binary;\n }\n }\n\n class BlockParsedResult {\n constructor(finished, decodedInformation) {\n if (decodedInformation) {\n this.decodedInformation = null;\n }\n else {\n this.finished = finished;\n this.decodedInformation = decodedInformation;\n }\n }\n getDecodedInformation() {\n return this.decodedInformation;\n }\n isFinished() {\n return this.finished;\n }\n }\n\n class DecodedObject {\n constructor(newPosition) {\n this.newPosition = newPosition;\n }\n getNewPosition() {\n return this.newPosition;\n }\n }\n\n class DecodedChar extends DecodedObject {\n constructor(newPosition, value) {\n super(newPosition);\n this.value = value;\n }\n getValue() {\n return this.value;\n }\n isFNC1() {\n return this.value === DecodedChar.FNC1;\n }\n }\n DecodedChar.FNC1 = '$';\n\n class DecodedInformation extends DecodedObject {\n constructor(newPosition, newString, remainingValue) {\n super(newPosition);\n if (remainingValue) {\n this.remaining = true;\n this.remainingValue = this.remainingValue;\n }\n else {\n this.remaining = false;\n this.remainingValue = 0;\n }\n this.newString = newString;\n }\n getNewString() {\n return this.newString;\n }\n isRemaining() {\n return this.remaining;\n }\n getRemainingValue() {\n return this.remainingValue;\n }\n }\n\n class DecodedNumeric extends DecodedObject {\n constructor(newPosition, firstDigit, secondDigit) {\n super(newPosition);\n if (firstDigit < 0 || firstDigit > 10 || secondDigit < 0 || secondDigit > 10) {\n throw new FormatException();\n }\n this.firstDigit = firstDigit;\n this.secondDigit = secondDigit;\n }\n getFirstDigit() {\n return this.firstDigit;\n }\n getSecondDigit() {\n return this.secondDigit;\n }\n getValue() {\n return this.firstDigit * 10 + this.secondDigit;\n }\n isFirstDigitFNC1() {\n return this.firstDigit === DecodedNumeric.FNC1;\n }\n isSecondDigitFNC1() {\n return this.secondDigit === DecodedNumeric.FNC1;\n }\n isAnyFNC1() {\n return this.firstDigit === DecodedNumeric.FNC1 || this.secondDigit === DecodedNumeric.FNC1;\n }\n }\n DecodedNumeric.FNC1 = 10;\n\n class FieldParser {\n constructor() {\n }\n static parseFieldsInGeneralPurpose(rawInformation) {\n if (!rawInformation) {\n return null;\n }\n // Processing 2-digit AIs\n if (rawInformation.length < 2) {\n throw new NotFoundException();\n }\n let firstTwoDigits = rawInformation.substring(0, 2);\n for (let dataLength of FieldParser.TWO_DIGIT_DATA_LENGTH) {\n if (dataLength[0] === firstTwoDigits) {\n if (dataLength[1] === FieldParser.VARIABLE_LENGTH) {\n return FieldParser.processVariableAI(2, dataLength[2], rawInformation);\n }\n return FieldParser.processFixedAI(2, dataLength[1], rawInformation);\n }\n }\n if (rawInformation.length < 3) {\n throw new NotFoundException();\n }\n let firstThreeDigits = rawInformation.substring(0, 3);\n for (let dataLength of FieldParser.THREE_DIGIT_DATA_LENGTH) {\n if (dataLength[0] === firstThreeDigits) {\n if (dataLength[1] === FieldParser.VARIABLE_LENGTH) {\n return FieldParser.processVariableAI(3, dataLength[2], rawInformation);\n }\n return FieldParser.processFixedAI(3, dataLength[1], rawInformation);\n }\n }\n for (let dataLength of FieldParser.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH) {\n if (dataLength[0] === firstThreeDigits) {\n if (dataLength[1] === FieldParser.VARIABLE_LENGTH) {\n return FieldParser.processVariableAI(4, dataLength[2], rawInformation);\n }\n return FieldParser.processFixedAI(4, dataLength[1], rawInformation);\n }\n }\n if (rawInformation.length < 4) {\n throw new NotFoundException();\n }\n let firstFourDigits = rawInformation.substring(0, 4);\n for (let dataLength of FieldParser.FOUR_DIGIT_DATA_LENGTH) {\n if (dataLength[0] === firstFourDigits) {\n if (dataLength[1] === FieldParser.VARIABLE_LENGTH) {\n return FieldParser.processVariableAI(4, dataLength[2], rawInformation);\n }\n return FieldParser.processFixedAI(4, dataLength[1], rawInformation);\n }\n }\n throw new NotFoundException();\n }\n static processFixedAI(aiSize, fieldSize, rawInformation) {\n if (rawInformation.length < aiSize) {\n throw new NotFoundException();\n }\n let ai = rawInformation.substring(0, aiSize);\n if (rawInformation.length < aiSize + fieldSize) {\n throw new NotFoundException();\n }\n let field = rawInformation.substring(aiSize, aiSize + fieldSize);\n let remaining = rawInformation.substring(aiSize + fieldSize);\n let result = '(' + ai + ')' + field;\n let parsedAI = FieldParser.parseFieldsInGeneralPurpose(remaining);\n return parsedAI == null ? result : result + parsedAI;\n }\n static processVariableAI(aiSize, variableFieldSize, rawInformation) {\n let ai = rawInformation.substring(0, aiSize);\n let maxSize;\n if (rawInformation.length < aiSize + variableFieldSize) {\n maxSize = rawInformation.length;\n }\n else {\n maxSize = aiSize + variableFieldSize;\n }\n let field = rawInformation.substring(aiSize, maxSize);\n let remaining = rawInformation.substring(maxSize);\n let result = '(' + ai + ')' + field;\n let parsedAI = FieldParser.parseFieldsInGeneralPurpose(remaining);\n return parsedAI == null ? result : result + parsedAI;\n }\n }\n FieldParser.VARIABLE_LENGTH = [];\n FieldParser.TWO_DIGIT_DATA_LENGTH = [\n ['00', 18],\n ['01', 14],\n ['02', 14],\n ['10', FieldParser.VARIABLE_LENGTH, 20],\n ['11', 6],\n ['12', 6],\n ['13', 6],\n ['15', 6],\n ['17', 6],\n ['20', 2],\n ['21', FieldParser.VARIABLE_LENGTH, 20],\n ['22', FieldParser.VARIABLE_LENGTH, 29],\n ['30', FieldParser.VARIABLE_LENGTH, 8],\n ['37', FieldParser.VARIABLE_LENGTH, 8],\n // internal company codes\n ['90', FieldParser.VARIABLE_LENGTH, 30],\n ['91', FieldParser.VARIABLE_LENGTH, 30],\n ['92', FieldParser.VARIABLE_LENGTH, 30],\n ['93', FieldParser.VARIABLE_LENGTH, 30],\n ['94', FieldParser.VARIABLE_LENGTH, 30],\n ['95', FieldParser.VARIABLE_LENGTH, 30],\n ['96', FieldParser.VARIABLE_LENGTH, 30],\n ['97', FieldParser.VARIABLE_LENGTH, 3],\n ['98', FieldParser.VARIABLE_LENGTH, 30],\n ['99', FieldParser.VARIABLE_LENGTH, 30],\n ];\n FieldParser.THREE_DIGIT_DATA_LENGTH = [\n // Same format as above\n ['240', FieldParser.VARIABLE_LENGTH, 30],\n ['241', FieldParser.VARIABLE_LENGTH, 30],\n ['242', FieldParser.VARIABLE_LENGTH, 6],\n ['250', FieldParser.VARIABLE_LENGTH, 30],\n ['251', FieldParser.VARIABLE_LENGTH, 30],\n ['253', FieldParser.VARIABLE_LENGTH, 17],\n ['254', FieldParser.VARIABLE_LENGTH, 20],\n ['400', FieldParser.VARIABLE_LENGTH, 30],\n ['401', FieldParser.VARIABLE_LENGTH, 30],\n ['402', 17],\n ['403', FieldParser.VARIABLE_LENGTH, 30],\n ['410', 13],\n ['411', 13],\n ['412', 13],\n ['413', 13],\n ['414', 13],\n ['420', FieldParser.VARIABLE_LENGTH, 20],\n ['421', FieldParser.VARIABLE_LENGTH, 15],\n ['422', 3],\n ['423', FieldParser.VARIABLE_LENGTH, 15],\n ['424', 3],\n ['425', 3],\n ['426', 3],\n ];\n FieldParser.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH = [\n // Same format as above\n ['310', 6],\n ['311', 6],\n ['312', 6],\n ['313', 6],\n ['314', 6],\n ['315', 6],\n ['316', 6],\n ['320', 6],\n ['321', 6],\n ['322', 6],\n ['323', 6],\n ['324', 6],\n ['325', 6],\n ['326', 6],\n ['327', 6],\n ['328', 6],\n ['329', 6],\n ['330', 6],\n ['331', 6],\n ['332', 6],\n ['333', 6],\n ['334', 6],\n ['335', 6],\n ['336', 6],\n ['340', 6],\n ['341', 6],\n ['342', 6],\n ['343', 6],\n ['344', 6],\n ['345', 6],\n ['346', 6],\n ['347', 6],\n ['348', 6],\n ['349', 6],\n ['350', 6],\n ['351', 6],\n ['352', 6],\n ['353', 6],\n ['354', 6],\n ['355', 6],\n ['356', 6],\n ['357', 6],\n ['360', 6],\n ['361', 6],\n ['362', 6],\n ['363', 6],\n ['364', 6],\n ['365', 6],\n ['366', 6],\n ['367', 6],\n ['368', 6],\n ['369', 6],\n ['390', FieldParser.VARIABLE_LENGTH, 15],\n ['391', FieldParser.VARIABLE_LENGTH, 18],\n ['392', FieldParser.VARIABLE_LENGTH, 15],\n ['393', FieldParser.VARIABLE_LENGTH, 18],\n ['703', FieldParser.VARIABLE_LENGTH, 30],\n ];\n FieldParser.FOUR_DIGIT_DATA_LENGTH = [\n // Same format as above\n ['7001', 13],\n ['7002', FieldParser.VARIABLE_LENGTH, 30],\n ['7003', 10],\n ['8001', 14],\n ['8002', FieldParser.VARIABLE_LENGTH, 20],\n ['8003', FieldParser.VARIABLE_LENGTH, 30],\n ['8004', FieldParser.VARIABLE_LENGTH, 30],\n ['8005', 6],\n ['8006', 18],\n ['8007', FieldParser.VARIABLE_LENGTH, 30],\n ['8008', FieldParser.VARIABLE_LENGTH, 12],\n ['8018', 18],\n ['8020', FieldParser.VARIABLE_LENGTH, 25],\n ['8100', 6],\n ['8101', 10],\n ['8102', 2],\n ['8110', FieldParser.VARIABLE_LENGTH, 70],\n ['8200', FieldParser.VARIABLE_LENGTH, 70],\n ];\n\n class GeneralAppIdDecoder {\n constructor(information) {\n this.buffer = new StringBuilder();\n this.information = information;\n }\n decodeAllCodes(buff, initialPosition) {\n let currentPosition = initialPosition;\n let remaining = null;\n do {\n let info = this.decodeGeneralPurposeField(currentPosition, remaining);\n let parsedFields = FieldParser.parseFieldsInGeneralPurpose(info.getNewString());\n if (parsedFields != null) {\n buff.append(parsedFields);\n }\n if (info.isRemaining()) {\n remaining = '' + info.getRemainingValue();\n }\n else {\n remaining = null;\n }\n if (currentPosition === info.getNewPosition()) { // No step forward!\n break;\n }\n currentPosition = info.getNewPosition();\n } while (true);\n return buff.toString();\n }\n isStillNumeric(pos) {\n // It's numeric if it still has 7 positions\n // and one of the first 4 bits is \"1\".\n if (pos + 7 > this.information.getSize()) {\n return pos + 4 <= this.information.getSize();\n }\n for (let i = pos; i < pos + 3; ++i) {\n if (this.information.get(i)) {\n return true;\n }\n }\n return this.information.get(pos + 3);\n }\n decodeNumeric(pos) {\n if (pos + 7 > this.information.getSize()) {\n let numeric = this.extractNumericValueFromBitArray(pos, 4);\n if (numeric === 0) {\n return new DecodedNumeric(this.information.getSize(), DecodedNumeric.FNC1, DecodedNumeric.FNC1);\n }\n return new DecodedNumeric(this.information.getSize(), numeric - 1, DecodedNumeric.FNC1);\n }\n let numeric = this.extractNumericValueFromBitArray(pos, 7);\n let digit1 = (numeric - 8) / 11;\n let digit2 = (numeric - 8) % 11;\n return new DecodedNumeric(pos + 7, digit1, digit2);\n }\n extractNumericValueFromBitArray(pos, bits) {\n return GeneralAppIdDecoder.extractNumericValueFromBitArray(this.information, pos, bits);\n }\n static extractNumericValueFromBitArray(information, pos, bits) {\n let value = 0;\n for (let i = 0; i < bits; ++i) {\n if (information.get(pos + i)) {\n value |= 1 << (bits - i - 1);\n }\n }\n return value;\n }\n decodeGeneralPurposeField(pos, remaining) {\n // this.buffer.setLength(0);\n this.buffer.setLengthToZero();\n if (remaining != null) {\n this.buffer.append(remaining);\n }\n this.current.setPosition(pos);\n let lastDecoded = this.parseBlocks();\n if (lastDecoded != null && lastDecoded.isRemaining()) {\n return new DecodedInformation(this.current.getPosition(), this.buffer.toString(), lastDecoded.getRemainingValue());\n }\n return new DecodedInformation(this.current.getPosition(), this.buffer.toString());\n }\n parseBlocks() {\n let isFinished;\n let result;\n do {\n let initialPosition = this.current.getPosition();\n if (this.current.isAlpha()) {\n result = this.parseAlphaBlock();\n isFinished = result.isFinished();\n }\n else if (this.current.isIsoIec646()) {\n result = this.parseIsoIec646Block();\n isFinished = result.isFinished();\n }\n else { // it must be numeric\n result = this.parseNumericBlock();\n isFinished = result.isFinished();\n }\n let positionChanged = initialPosition !== this.current.getPosition();\n if (!positionChanged && !isFinished) {\n break;\n }\n } while (!isFinished);\n return result.getDecodedInformation();\n }\n parseNumericBlock() {\n while (this.isStillNumeric(this.current.getPosition())) {\n let numeric = this.decodeNumeric(this.current.getPosition());\n this.current.setPosition(numeric.getNewPosition());\n if (numeric.isFirstDigitFNC1()) {\n let information;\n if (numeric.isSecondDigitFNC1()) {\n information = new DecodedInformation(this.current.getPosition(), this.buffer.toString());\n }\n else {\n information = new DecodedInformation(this.current.getPosition(), this.buffer.toString(), numeric.getSecondDigit());\n }\n return new BlockParsedResult(true, information);\n }\n this.buffer.append(numeric.getFirstDigit());\n if (numeric.isSecondDigitFNC1()) {\n let information = new DecodedInformation(this.current.getPosition(), this.buffer.toString());\n return new BlockParsedResult(true, information);\n }\n this.buffer.append(numeric.getSecondDigit());\n }\n if (this.isNumericToAlphaNumericLatch(this.current.getPosition())) {\n this.current.setAlpha();\n this.current.incrementPosition(4);\n }\n return new BlockParsedResult(false);\n }\n parseIsoIec646Block() {\n while (this.isStillIsoIec646(this.current.getPosition())) {\n let iso = this.decodeIsoIec646(this.current.getPosition());\n this.current.setPosition(iso.getNewPosition());\n if (iso.isFNC1()) {\n let information = new DecodedInformation(this.current.getPosition(), this.buffer.toString());\n return new BlockParsedResult(true, information);\n }\n this.buffer.append(iso.getValue());\n }\n if (this.isAlphaOr646ToNumericLatch(this.current.getPosition())) {\n this.current.incrementPosition(3);\n this.current.setNumeric();\n }\n else if (this.isAlphaTo646ToAlphaLatch(this.current.getPosition())) {\n if (this.current.getPosition() + 5 < this.information.getSize()) {\n this.current.incrementPosition(5);\n }\n else {\n this.current.setPosition(this.information.getSize());\n }\n this.current.setAlpha();\n }\n return new BlockParsedResult(false);\n }\n parseAlphaBlock() {\n while (this.isStillAlpha(this.current.getPosition())) {\n let alpha = this.decodeAlphanumeric(this.current.getPosition());\n this.current.setPosition(alpha.getNewPosition());\n if (alpha.isFNC1()) {\n let information = new DecodedInformation(this.current.getPosition(), this.buffer.toString());\n return new BlockParsedResult(true, information); // end of the char block\n }\n this.buffer.append(alpha.getValue());\n }\n if (this.isAlphaOr646ToNumericLatch(this.current.getPosition())) {\n this.current.incrementPosition(3);\n this.current.setNumeric();\n }\n else if (this.isAlphaTo646ToAlphaLatch(this.current.getPosition())) {\n if (this.current.getPosition() + 5 < this.information.getSize()) {\n this.current.incrementPosition(5);\n }\n else {\n this.current.setPosition(this.information.getSize());\n }\n this.current.setIsoIec646();\n }\n return new BlockParsedResult(false);\n }\n isStillIsoIec646(pos) {\n if (pos + 5 > this.information.getSize()) {\n return false;\n }\n let fiveBitValue = this.extractNumericValueFromBitArray(pos, 5);\n if (fiveBitValue >= 5 && fiveBitValue < 16) {\n return true;\n }\n if (pos + 7 > this.information.getSize()) {\n return false;\n }\n let sevenBitValue = this.extractNumericValueFromBitArray(pos, 7);\n if (sevenBitValue >= 64 && sevenBitValue < 116) {\n return true;\n }\n if (pos + 8 > this.information.getSize()) {\n return false;\n }\n let eightBitValue = this.extractNumericValueFromBitArray(pos, 8);\n return eightBitValue >= 232 && eightBitValue < 253;\n }\n decodeIsoIec646(pos) {\n let fiveBitValue = this.extractNumericValueFromBitArray(pos, 5);\n if (fiveBitValue === 15) {\n return new DecodedChar(pos + 5, DecodedChar.FNC1);\n }\n if (fiveBitValue >= 5 && fiveBitValue < 15) {\n return new DecodedChar(pos + 5, ('0' + (fiveBitValue - 5)));\n }\n let sevenBitValue = this.extractNumericValueFromBitArray(pos, 7);\n if (sevenBitValue >= 64 && sevenBitValue < 90) {\n return new DecodedChar(pos + 7, ('' + (sevenBitValue + 1)));\n }\n if (sevenBitValue >= 90 && sevenBitValue < 116) {\n return new DecodedChar(pos + 7, ('' + (sevenBitValue + 7)));\n }\n let eightBitValue = this.extractNumericValueFromBitArray(pos, 8);\n let c;\n switch (eightBitValue) {\n case 232:\n c = '!';\n break;\n case 233:\n c = '\"';\n break;\n case 234:\n c = '%';\n break;\n case 235:\n c = '&';\n break;\n case 236:\n c = '\\'';\n break;\n case 237:\n c = '(';\n break;\n case 238:\n c = ')';\n break;\n case 239:\n c = '*';\n break;\n case 240:\n c = '+';\n break;\n case 241:\n c = ',';\n break;\n case 242:\n c = '-';\n break;\n case 243:\n c = '.';\n break;\n case 244:\n c = '/';\n break;\n case 245:\n c = ':';\n break;\n case 246:\n c = ';';\n break;\n case 247:\n c = '<';\n break;\n case 248:\n c = '=';\n break;\n case 249:\n c = '>';\n break;\n case 250:\n c = '?';\n break;\n case 251:\n c = '_';\n break;\n case 252:\n c = ' ';\n break;\n default:\n throw new FormatException();\n }\n return new DecodedChar(pos + 8, c);\n }\n isStillAlpha(pos) {\n if (pos + 5 > this.information.getSize()) {\n return false;\n }\n // We now check if it's a valid 5-bit value (0..9 and FNC1)\n let fiveBitValue = this.extractNumericValueFromBitArray(pos, 5);\n if (fiveBitValue >= 5 && fiveBitValue < 16) {\n return true;\n }\n if (pos + 6 > this.information.getSize()) {\n return false;\n }\n let sixBitValue = this.extractNumericValueFromBitArray(pos, 6);\n return sixBitValue >= 16 && sixBitValue < 63; // 63 not included\n }\n decodeAlphanumeric(pos) {\n let fiveBitValue = this.extractNumericValueFromBitArray(pos, 5);\n if (fiveBitValue === 15) {\n return new DecodedChar(pos + 5, DecodedChar.FNC1);\n }\n if (fiveBitValue >= 5 && fiveBitValue < 15) {\n return new DecodedChar(pos + 5, ('0' + (fiveBitValue - 5)));\n }\n let sixBitValue = this.extractNumericValueFromBitArray(pos, 6);\n if (sixBitValue >= 32 && sixBitValue < 58) {\n return new DecodedChar(pos + 6, ('' + (sixBitValue + 33)));\n }\n let c;\n switch (sixBitValue) {\n case 58:\n c = '*';\n break;\n case 59:\n c = ',';\n break;\n case 60:\n c = '-';\n break;\n case 61:\n c = '.';\n break;\n case 62:\n c = '/';\n break;\n default:\n throw new IllegalStateException('Decoding invalid alphanumeric value: ' + sixBitValue);\n }\n return new DecodedChar(pos + 6, c);\n }\n isAlphaTo646ToAlphaLatch(pos) {\n if (pos + 1 > this.information.getSize()) {\n return false;\n }\n for (let i = 0; i < 5 && i + pos < this.information.getSize(); ++i) {\n if (i === 2) {\n if (!this.information.get(pos + 2)) {\n return false;\n }\n }\n else if (this.information.get(pos + i)) {\n return false;\n }\n }\n return true;\n }\n isAlphaOr646ToNumericLatch(pos) {\n // Next is alphanumeric if there are 3 positions and they are all zeros\n if (pos + 3 > this.information.getSize()) {\n return false;\n }\n for (let i = pos; i < pos + 3; ++i) {\n if (this.information.get(i)) {\n return false;\n }\n }\n return true;\n }\n isNumericToAlphaNumericLatch(pos) {\n // Next is alphanumeric if there are 4 positions and they are all zeros, or\n // if there is a subset of this just before the end of the symbol\n if (pos + 1 > this.information.getSize()) {\n return false;\n }\n for (let i = 0; i < 4 && i + pos < this.information.getSize(); ++i) {\n if (this.information.get(pos + i)) {\n return false;\n }\n }\n return true;\n }\n }\n\n class AbstractExpandedDecoder {\n constructor(information) {\n this.information = information;\n this.generalDecoder = new GeneralAppIdDecoder(information);\n }\n getInformation() {\n return this.information;\n }\n getGeneralDecoder() {\n return this.generalDecoder;\n }\n }\n\n class AI01decoder extends AbstractExpandedDecoder {\n constructor(information) {\n super(information);\n }\n encodeCompressedGtin(buf, currentPos) {\n buf.append('(01)');\n let initialPosition = buf.length();\n buf.append('9');\n this.encodeCompressedGtinWithoutAI(buf, currentPos, initialPosition);\n }\n encodeCompressedGtinWithoutAI(buf, currentPos, initialBufferPosition) {\n for (let i = 0; i < 4; ++i) {\n let currentBlock = this.getGeneralDecoder().extractNumericValueFromBitArray(currentPos + 10 * i, 10);\n if (currentBlock / 100 === 0) {\n buf.append('0');\n }\n if (currentBlock / 10 === 0) {\n buf.append('0');\n }\n buf.append(currentBlock);\n }\n AI01decoder.appendCheckDigit(buf, initialBufferPosition);\n }\n static appendCheckDigit(buf, currentPos) {\n let checkDigit = 0;\n for (let i = 0; i < 13; i++) {\n // let digit = buf.charAt(i + currentPos) - '0';\n // To be checked\n let digit = buf.charAt(i + currentPos).charCodeAt(0) - '0'.charCodeAt(0);\n checkDigit += (i & 0x01) === 0 ? 3 * digit : digit;\n }\n checkDigit = 10 - (checkDigit % 10);\n if (checkDigit === 10) {\n checkDigit = 0;\n }\n buf.append(checkDigit);\n }\n }\n AI01decoder.GTIN_SIZE = 40;\n\n class AI01AndOtherAIs extends AI01decoder {\n // the second one is the encodation method, and the other two are for the variable length\n constructor(information) {\n super(information);\n }\n parseInformation() {\n let buff = new StringBuilder();\n buff.append('(01)');\n let initialGtinPosition = buff.length();\n let firstGtinDigit = this.getGeneralDecoder().extractNumericValueFromBitArray(AI01AndOtherAIs.HEADER_SIZE, 4);\n buff.append(firstGtinDigit);\n this.encodeCompressedGtinWithoutAI(buff, AI01AndOtherAIs.HEADER_SIZE + 4, initialGtinPosition);\n return this.getGeneralDecoder().decodeAllCodes(buff, AI01AndOtherAIs.HEADER_SIZE + 44);\n }\n }\n AI01AndOtherAIs.HEADER_SIZE = 1 + 1 + 2; // first bit encodes the linkage flag,\n\n class AnyAIDecoder extends AbstractExpandedDecoder {\n constructor(information) {\n super(information);\n }\n parseInformation() {\n let buf = new StringBuilder();\n return this.getGeneralDecoder().decodeAllCodes(buf, AnyAIDecoder.HEADER_SIZE);\n }\n }\n AnyAIDecoder.HEADER_SIZE = 2 + 1 + 2;\n\n class AI01weightDecoder extends AI01decoder {\n constructor(information) {\n super(information);\n }\n encodeCompressedWeight(buf, currentPos, weightSize) {\n let originalWeightNumeric = this.getGeneralDecoder().extractNumericValueFromBitArray(currentPos, weightSize);\n this.addWeightCode(buf, originalWeightNumeric);\n let weightNumeric = this.checkWeight(originalWeightNumeric);\n let currentDivisor = 100000;\n for (let i = 0; i < 5; ++i) {\n if (weightNumeric / currentDivisor === 0) {\n buf.append('0');\n }\n currentDivisor /= 10;\n }\n buf.append(weightNumeric);\n }\n }\n\n class AI013x0xDecoder extends AI01weightDecoder {\n constructor(information) {\n super(information);\n }\n parseInformation() {\n if (this.getInformation().getSize() != AI013x0xDecoder.HEADER_SIZE + AI01weightDecoder.GTIN_SIZE + AI013x0xDecoder.WEIGHT_SIZE) {\n throw new NotFoundException();\n }\n let buf = new StringBuilder();\n this.encodeCompressedGtin(buf, AI013x0xDecoder.HEADER_SIZE);\n this.encodeCompressedWeight(buf, AI013x0xDecoder.HEADER_SIZE + AI01weightDecoder.GTIN_SIZE, AI013x0xDecoder.WEIGHT_SIZE);\n return buf.toString();\n }\n }\n AI013x0xDecoder.HEADER_SIZE = 4 + 1;\n AI013x0xDecoder.WEIGHT_SIZE = 15;\n\n class AI013103decoder extends AI013x0xDecoder {\n constructor(information) {\n super(information);\n }\n addWeightCode(buf, weight) {\n buf.append('(3103)');\n }\n checkWeight(weight) {\n return weight;\n }\n }\n\n class AI01320xDecoder extends AI013x0xDecoder {\n constructor(information) {\n super(information);\n }\n addWeightCode(buf, weight) {\n if (weight < 10000) {\n buf.append('(3202)');\n }\n else {\n buf.append('(3203)');\n }\n }\n checkWeight(weight) {\n if (weight < 10000) {\n return weight;\n }\n return weight - 10000;\n }\n }\n\n class AI01392xDecoder extends AI01decoder {\n constructor(information) {\n super(information);\n }\n parseInformation() {\n if (this.getInformation().getSize() < AI01392xDecoder.HEADER_SIZE + AI01decoder.GTIN_SIZE) {\n throw new NotFoundException();\n }\n let buf = new StringBuilder();\n this.encodeCompressedGtin(buf, AI01392xDecoder.HEADER_SIZE);\n let lastAIdigit = this.getGeneralDecoder().extractNumericValueFromBitArray(AI01392xDecoder.HEADER_SIZE + AI01decoder.GTIN_SIZE, AI01392xDecoder.LAST_DIGIT_SIZE);\n buf.append('(392');\n buf.append(lastAIdigit);\n buf.append(')');\n let decodedInformation = this.getGeneralDecoder().decodeGeneralPurposeField(AI01392xDecoder.HEADER_SIZE + AI01decoder.GTIN_SIZE + AI01392xDecoder.LAST_DIGIT_SIZE, null);\n buf.append(decodedInformation.getNewString());\n return buf.toString();\n }\n }\n AI01392xDecoder.HEADER_SIZE = 5 + 1 + 2;\n AI01392xDecoder.LAST_DIGIT_SIZE = 2;\n\n class AI01393xDecoder extends AI01decoder {\n constructor(information) {\n super(information);\n }\n parseInformation() {\n if (this.getInformation().getSize() < AI01393xDecoder.HEADER_SIZE + AI01decoder.GTIN_SIZE) {\n throw new NotFoundException();\n }\n let buf = new StringBuilder();\n this.encodeCompressedGtin(buf, AI01393xDecoder.HEADER_SIZE);\n let lastAIdigit = this.getGeneralDecoder().extractNumericValueFromBitArray(AI01393xDecoder.HEADER_SIZE + AI01decoder.GTIN_SIZE, AI01393xDecoder.LAST_DIGIT_SIZE);\n buf.append('(393');\n buf.append(lastAIdigit);\n buf.append(')');\n let firstThreeDigits = this.getGeneralDecoder().extractNumericValueFromBitArray(AI01393xDecoder.HEADER_SIZE + AI01decoder.GTIN_SIZE + AI01393xDecoder.LAST_DIGIT_SIZE, AI01393xDecoder.FIRST_THREE_DIGITS_SIZE);\n if (firstThreeDigits / 100 == 0) {\n buf.append('0');\n }\n if (firstThreeDigits / 10 == 0) {\n buf.append('0');\n }\n buf.append(firstThreeDigits);\n let generalInformation = this.getGeneralDecoder().decodeGeneralPurposeField(AI01393xDecoder.HEADER_SIZE + AI01decoder.GTIN_SIZE + AI01393xDecoder.LAST_DIGIT_SIZE + AI01393xDecoder.FIRST_THREE_DIGITS_SIZE, null);\n buf.append(generalInformation.getNewString());\n return buf.toString();\n }\n }\n AI01393xDecoder.HEADER_SIZE = 5 + 1 + 2;\n AI01393xDecoder.LAST_DIGIT_SIZE = 2;\n AI01393xDecoder.FIRST_THREE_DIGITS_SIZE = 10;\n\n class AI013x0x1xDecoder extends AI01weightDecoder {\n constructor(information, firstAIdigits, dateCode) {\n super(information);\n this.dateCode = dateCode;\n this.firstAIdigits = firstAIdigits;\n }\n parseInformation() {\n if (this.getInformation().getSize() != AI013x0x1xDecoder.HEADER_SIZE + AI013x0x1xDecoder.GTIN_SIZE + AI013x0x1xDecoder.WEIGHT_SIZE + AI013x0x1xDecoder.DATE_SIZE) {\n throw new NotFoundException();\n }\n let buf = new StringBuilder();\n this.encodeCompressedGtin(buf, AI013x0x1xDecoder.HEADER_SIZE);\n this.encodeCompressedWeight(buf, AI013x0x1xDecoder.HEADER_SIZE + AI013x0x1xDecoder.GTIN_SIZE, AI013x0x1xDecoder.WEIGHT_SIZE);\n this.encodeCompressedDate(buf, AI013x0x1xDecoder.HEADER_SIZE + AI013x0x1xDecoder.GTIN_SIZE + AI013x0x1xDecoder.WEIGHT_SIZE);\n return buf.toString();\n }\n encodeCompressedDate(buf, currentPos) {\n let numericDate = this.getGeneralDecoder().extractNumericValueFromBitArray(currentPos, AI013x0x1xDecoder.DATE_SIZE);\n if (numericDate == 38400) {\n return;\n }\n buf.append('(');\n buf.append(this.dateCode);\n buf.append(')');\n let day = numericDate % 32;\n numericDate /= 32;\n let month = numericDate % 12 + 1;\n numericDate /= 12;\n let year = numericDate;\n if (year / 10 == 0) {\n buf.append('0');\n }\n buf.append(year);\n if (month / 10 == 0) {\n buf.append('0');\n }\n buf.append(month);\n if (day / 10 == 0) {\n buf.append('0');\n }\n buf.append(day);\n }\n addWeightCode(buf, weight) {\n buf.append('(');\n buf.append(this.firstAIdigits);\n buf.append(weight / 100000);\n buf.append(')');\n }\n checkWeight(weight) {\n return weight % 100000;\n }\n }\n AI013x0x1xDecoder.HEADER_SIZE = 7 + 1;\n AI013x0x1xDecoder.WEIGHT_SIZE = 20;\n AI013x0x1xDecoder.DATE_SIZE = 16;\n\n function createDecoder(information) {\n try {\n if (information.get(1)) {\n return new AI01AndOtherAIs(information);\n }\n if (!information.get(2)) {\n return new AnyAIDecoder(information);\n }\n let fourBitEncodationMethod = GeneralAppIdDecoder.extractNumericValueFromBitArray(information, 1, 4);\n switch (fourBitEncodationMethod) {\n case 4: return new AI013103decoder(information);\n case 5: return new AI01320xDecoder(information);\n }\n let fiveBitEncodationMethod = GeneralAppIdDecoder.extractNumericValueFromBitArray(information, 1, 5);\n switch (fiveBitEncodationMethod) {\n case 12: return new AI01392xDecoder(information);\n case 13: return new AI01393xDecoder(information);\n }\n let sevenBitEncodationMethod = GeneralAppIdDecoder.extractNumericValueFromBitArray(information, 1, 7);\n switch (sevenBitEncodationMethod) {\n case 56: return new AI013x0x1xDecoder(information, '310', '11');\n case 57: return new AI013x0x1xDecoder(information, '320', '11');\n case 58: return new AI013x0x1xDecoder(information, '310', '13');\n case 59: return new AI013x0x1xDecoder(information, '320', '13');\n case 60: return new AI013x0x1xDecoder(information, '310', '15');\n case 61: return new AI013x0x1xDecoder(information, '320', '15');\n case 62: return new AI013x0x1xDecoder(information, '310', '17');\n case 63: return new AI013x0x1xDecoder(information, '320', '17');\n }\n }\n catch (e) {\n console.log(e);\n throw new IllegalStateException('unknown decoder: ' + information);\n }\n }\n\n class ExpandedPair {\n constructor(leftChar, rightChar, finderPatter, mayBeLast) {\n this.leftchar = leftChar;\n this.rightchar = rightChar;\n this.finderpattern = finderPatter;\n this.maybeLast = mayBeLast;\n }\n mayBeLast() {\n return this.maybeLast;\n }\n getLeftChar() {\n return this.leftchar;\n }\n getRightChar() {\n return this.rightchar;\n }\n getFinderPattern() {\n return this.finderpattern;\n }\n mustBeLast() {\n return this.rightchar == null;\n }\n toString() {\n return '[ ' + this.leftchar + ', ' + this.rightchar + ' : ' + (this.finderpattern == null ? 'null' : this.finderpattern.getValue()) + ' ]';\n }\n static equals(o1, o2) {\n if (!(o1 instanceof ExpandedPair)) {\n return false;\n }\n return ExpandedPair.equalsOrNull(o1.leftchar, o2.leftchar) &&\n ExpandedPair.equalsOrNull(o1.rightchar, o2.rightchar) &&\n ExpandedPair.equalsOrNull(o1.finderpattern, o2.finderpattern);\n }\n static equalsOrNull(o1, o2) {\n return o1 === null ? o2 === null : ExpandedPair.equals(o1, o2);\n }\n hashCode() {\n // return ExpandedPair.hashNotNull(leftChar) ^ hashNotNull(rightChar) ^ hashNotNull(finderPattern);\n let value = this.leftchar.getValue() ^ this.rightchar.getValue() ^ this.finderpattern.getValue();\n return value;\n }\n }\n\n class ExpandedRow {\n constructor(pairs, rowNumber, wasReversed) {\n this.pairs = pairs;\n this.rowNumber = rowNumber;\n this.wasReversed = wasReversed;\n }\n getPairs() {\n return this.pairs;\n }\n getRowNumber() {\n return this.rowNumber;\n }\n isReversed() {\n return this.wasReversed;\n }\n // check implementation\n isEquivalent(otherPairs) {\n return this.checkEqualitity(this, otherPairs);\n }\n // @Override\n toString() {\n return '{ ' + this.pairs + ' }';\n }\n /**\n * Two rows are equal if they contain the same pairs in the same order.\n */\n // @Override\n // check implementation\n equals(o1, o2) {\n if (!(o1 instanceof ExpandedRow)) {\n return false;\n }\n return this.checkEqualitity(o1, o2) && o1.wasReversed === o2.wasReversed;\n }\n checkEqualitity(pair1, pair2) {\n if (!pair1 || !pair2)\n return;\n let result;\n pair1.forEach((e1, i) => {\n pair2.forEach(e2 => {\n if (e1.getLeftChar().getValue() === e2.getLeftChar().getValue() && e1.getRightChar().getValue() === e2.getRightChar().getValue() && e1.getFinderPatter().getValue() === e2.getFinderPatter().getValue()) {\n result = true;\n }\n });\n });\n return result;\n }\n }\n\n // import java.util.ArrayList;\n // import java.util.Iterator;\n // import java.util.List;\n // import java.util.Map;\n // import java.util.Collections;\n /** @experimental */\n class RSSExpandedReader extends AbstractRSSReader {\n constructor() {\n super(...arguments);\n this.pairs = new Array(RSSExpandedReader.MAX_PAIRS);\n this.rows = new Array();\n this.startEnd = [2];\n }\n decodeRow(rowNumber, row, hints) {\n // Rows can start with even pattern in case in prev rows there where odd number of patters.\n // So lets try twice\n // this.pairs.clear();\n this.pairs.length = 0;\n this.startFromEven = false;\n try {\n return RSSExpandedReader.constructResult(this.decodeRow2pairs(rowNumber, row));\n }\n catch (e) {\n // OK\n // console.log(e);\n }\n this.pairs.length = 0;\n this.startFromEven = true;\n return RSSExpandedReader.constructResult(this.decodeRow2pairs(rowNumber, row));\n }\n reset() {\n this.pairs.length = 0;\n this.rows.length = 0;\n }\n // Not private for testing\n decodeRow2pairs(rowNumber, row) {\n let done = false;\n while (!done) {\n try {\n this.pairs.push(this.retrieveNextPair(row, this.pairs, rowNumber));\n }\n catch (error) {\n if (error instanceof NotFoundException) {\n if (!this.pairs.length) {\n throw new NotFoundException();\n }\n // exit this loop when retrieveNextPair() fails and throws\n done = true;\n }\n }\n }\n // TODO: verify sequence of finder patterns as in checkPairSequence()\n if (this.checkChecksum()) {\n return this.pairs;\n }\n let tryStackedDecode;\n if (this.rows.length) {\n tryStackedDecode = true;\n }\n else {\n tryStackedDecode = false;\n }\n // let tryStackedDecode = !this.rows.isEmpty();\n this.storeRow(rowNumber, false); // TODO: deal with reversed rows\n if (tryStackedDecode) {\n // When the image is 180-rotated, then rows are sorted in wrong direction.\n // Try twice with both the directions.\n let ps = this.checkRowsBoolean(false);\n if (ps != null) {\n return ps;\n }\n ps = this.checkRowsBoolean(true);\n if (ps != null) {\n return ps;\n }\n }\n throw new NotFoundException();\n }\n // Need to Verify\n checkRowsBoolean(reverse) {\n // Limit number of rows we are checking\n // We use recursive algorithm with pure complexity and don't want it to take forever\n // Stacked barcode can have up to 11 rows, so 25 seems reasonable enough\n if (this.rows.length > 25) {\n this.rows.length = 0; // We will never have a chance to get result, so clear it\n return null;\n }\n this.pairs.length = 0;\n if (reverse) {\n this.rows = this.rows.reverse();\n // Collections.reverse(this.rows);\n }\n let ps = null;\n try {\n ps = this.checkRows(new Array(), 0);\n }\n catch (e) {\n // OK\n console.log(e);\n }\n if (reverse) {\n this.rows = this.rows.reverse();\n // Collections.reverse(this.rows);\n }\n return ps;\n }\n // Try to construct a valid rows sequence\n // Recursion is used to implement backtracking\n checkRows(collectedRows, currentRow) {\n for (let i = currentRow; i < this.rows.length; i++) {\n let row = this.rows[i];\n this.pairs.length = 0;\n for (let collectedRow of collectedRows) {\n this.pairs.push(collectedRow.getPairs());\n }\n this.pairs.push(row.getPairs());\n if (!RSSExpandedReader.isValidSequence(this.pairs)) {\n continue;\n }\n if (this.checkChecksum()) {\n return this.pairs;\n }\n let rs = new Array(collectedRows);\n rs.push(row);\n try {\n // Recursion: try to add more rows\n return this.checkRows(rs, i + 1);\n }\n catch (e) {\n // We failed, try the next candidate\n console.log(e);\n }\n }\n throw new NotFoundException();\n }\n // Whether the pairs form a valid find pattern sequence,\n // either complete or a prefix\n static isValidSequence(pairs) {\n for (let sequence of RSSExpandedReader.FINDER_PATTERN_SEQUENCES) {\n if (pairs.length > sequence.length) {\n continue;\n }\n let stop = true;\n for (let j = 0; j < pairs.length; j++) {\n if (pairs[j].getFinderPattern().getValue() != sequence[j]) {\n stop = false;\n break;\n }\n }\n if (stop) {\n return true;\n }\n }\n return false;\n }\n storeRow(rowNumber, wasReversed) {\n // Discard if duplicate above or below; otherwise insert in order by row number.\n let insertPos = 0;\n let prevIsSame = false;\n let nextIsSame = false;\n while (insertPos < this.rows.length) {\n let erow = this.rows[insertPos];\n if (erow.getRowNumber() > rowNumber) {\n nextIsSame = erow.isEquivalent(this.pairs);\n break;\n }\n prevIsSame = erow.isEquivalent(this.pairs);\n insertPos++;\n }\n if (nextIsSame || prevIsSame) {\n return;\n }\n // When the row was partially decoded (e.g. 2 pairs found instead of 3),\n // it will prevent us from detecting the barcode.\n // Try to merge partial rows\n // Check whether the row is part of an allready detected row\n if (RSSExpandedReader.isPartialRow(this.pairs, this.rows)) {\n return;\n }\n this.rows.push(insertPos, new ExpandedRow(this.pairs, rowNumber, wasReversed));\n this.removePartialRows(this.pairs, this.rows);\n }\n // Remove all the rows that contains only specified pairs\n removePartialRows(pairs, rows) {\n // for (IteratorEncapsulates a set of error-correction blocks in one symbol version. Most versions will\n * use blocks of differing sizes within one version, so, this encapsulates the parameters for\n * each set of blocks. It also holds the number of error-correction codewords per block since it\n * will be the same across all blocks within one version.
\n */\n class ECBlocks {\n constructor(ecCodewords, ecBlocks1, ecBlocks2) {\n this.ecCodewords = ecCodewords;\n this.ecBlocks = [ecBlocks1];\n ecBlocks2 && this.ecBlocks.push(ecBlocks2);\n }\n getECCodewords() {\n return this.ecCodewords;\n }\n getECBlocks() {\n return this.ecBlocks;\n }\n }\n /**\n *Encapsulates the parameters for one error-correction block in one symbol version.\n * This includes the number of data codewords, and the number of times a block with these\n * parameters is used consecutively in the Data Matrix code version's format.
\n */\n class ECB {\n constructor(count, dataCodewords) {\n this.count = count;\n this.dataCodewords = dataCodewords;\n }\n getCount() {\n return this.count;\n }\n getDataCodewords() {\n return this.dataCodewords;\n }\n }\n /**\n * The Version object encapsulates attributes about a particular\n * size Data Matrix Code.\n *\n * @author bbrown@google.com (Brian Brown)\n */\n class Version {\n constructor(versionNumber, symbolSizeRows, symbolSizeColumns, dataRegionSizeRows, dataRegionSizeColumns, ecBlocks) {\n this.versionNumber = versionNumber;\n this.symbolSizeRows = symbolSizeRows;\n this.symbolSizeColumns = symbolSizeColumns;\n this.dataRegionSizeRows = dataRegionSizeRows;\n this.dataRegionSizeColumns = dataRegionSizeColumns;\n this.ecBlocks = ecBlocks;\n // Calculate the total number of codewords\n let total = 0;\n const ecCodewords = ecBlocks.getECCodewords();\n const ecbArray = ecBlocks.getECBlocks();\n for (let ecBlock of ecbArray) {\n total += ecBlock.getCount() * (ecBlock.getDataCodewords() + ecCodewords);\n }\n this.totalCodewords = total;\n }\n getVersionNumber() {\n return this.versionNumber;\n }\n getSymbolSizeRows() {\n return this.symbolSizeRows;\n }\n getSymbolSizeColumns() {\n return this.symbolSizeColumns;\n }\n getDataRegionSizeRows() {\n return this.dataRegionSizeRows;\n }\n getDataRegionSizeColumns() {\n return this.dataRegionSizeColumns;\n }\n getTotalCodewords() {\n return this.totalCodewords;\n }\n getECBlocks() {\n return this.ecBlocks;\n }\n /**\n *Deduces version information from Data Matrix dimensions.
\n *\n * @param numRows Number of rows in modules\n * @param numColumns Number of columns in modules\n * @return Version for a Data Matrix Code of those dimensions\n * @throws FormatException if dimensions do correspond to a valid Data Matrix size\n */\n static getVersionForDimensions(numRows, numColumns) {\n if ((numRows & 0x01) !== 0 || (numColumns & 0x01) !== 0) {\n throw new FormatException();\n }\n for (let version of Version.VERSIONS) {\n if (version.symbolSizeRows === numRows && version.symbolSizeColumns === numColumns) {\n return version;\n }\n }\n throw new FormatException();\n }\n // @Override\n toString() {\n return '' + this.versionNumber;\n }\n /**\n * See ISO 16022:2006 5.5.1 Table 7\n */\n static buildVersions() {\n return [\n new Version(1, 10, 10, 8, 8, new ECBlocks(5, new ECB(1, 3))),\n new Version(2, 12, 12, 10, 10, new ECBlocks(7, new ECB(1, 5))),\n new Version(3, 14, 14, 12, 12, new ECBlocks(10, new ECB(1, 8))),\n new Version(4, 16, 16, 14, 14, new ECBlocks(12, new ECB(1, 12))),\n new Version(5, 18, 18, 16, 16, new ECBlocks(14, new ECB(1, 18))),\n new Version(6, 20, 20, 18, 18, new ECBlocks(18, new ECB(1, 22))),\n new Version(7, 22, 22, 20, 20, new ECBlocks(20, new ECB(1, 30))),\n new Version(8, 24, 24, 22, 22, new ECBlocks(24, new ECB(1, 36))),\n new Version(9, 26, 26, 24, 24, new ECBlocks(28, new ECB(1, 44))),\n new Version(10, 32, 32, 14, 14, new ECBlocks(36, new ECB(1, 62))),\n new Version(11, 36, 36, 16, 16, new ECBlocks(42, new ECB(1, 86))),\n new Version(12, 40, 40, 18, 18, new ECBlocks(48, new ECB(1, 114))),\n new Version(13, 44, 44, 20, 20, new ECBlocks(56, new ECB(1, 144))),\n new Version(14, 48, 48, 22, 22, new ECBlocks(68, new ECB(1, 174))),\n new Version(15, 52, 52, 24, 24, new ECBlocks(42, new ECB(2, 102))),\n new Version(16, 64, 64, 14, 14, new ECBlocks(56, new ECB(2, 140))),\n new Version(17, 72, 72, 16, 16, new ECBlocks(36, new ECB(4, 92))),\n new Version(18, 80, 80, 18, 18, new ECBlocks(48, new ECB(4, 114))),\n new Version(19, 88, 88, 20, 20, new ECBlocks(56, new ECB(4, 144))),\n new Version(20, 96, 96, 22, 22, new ECBlocks(68, new ECB(4, 174))),\n new Version(21, 104, 104, 24, 24, new ECBlocks(56, new ECB(6, 136))),\n new Version(22, 120, 120, 18, 18, new ECBlocks(68, new ECB(6, 175))),\n new Version(23, 132, 132, 20, 20, new ECBlocks(62, new ECB(8, 163))),\n new Version(24, 144, 144, 22, 22, new ECBlocks(62, new ECB(8, 156), new ECB(2, 155))),\n new Version(25, 8, 18, 6, 16, new ECBlocks(7, new ECB(1, 5))),\n new Version(26, 8, 32, 6, 14, new ECBlocks(11, new ECB(1, 10))),\n new Version(27, 12, 26, 10, 24, new ECBlocks(14, new ECB(1, 16))),\n new Version(28, 12, 36, 10, 16, new ECBlocks(18, new ECB(1, 22))),\n new Version(29, 16, 36, 14, 16, new ECBlocks(24, new ECB(1, 32))),\n new Version(30, 16, 48, 14, 22, new ECBlocks(28, new ECB(1, 49)))\n ];\n }\n }\n Version.VERSIONS = Version.buildVersions();\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n * @author bbrown@google.com (Brian Brown)\n */\n class BitMatrixParser {\n /**\n * @param bitMatrix {@link BitMatrix} to parse\n * @throws FormatException if dimension is < 8 or > 144 or not 0 mod 2\n */\n constructor(bitMatrix) {\n const dimension = bitMatrix.getHeight();\n if (dimension < 8 || dimension > 144 || (dimension & 0x01) !== 0) {\n throw new FormatException();\n }\n this.version = BitMatrixParser.readVersion(bitMatrix);\n this.mappingBitMatrix = this.extractDataRegion(bitMatrix);\n this.readMappingMatrix = new BitMatrix(this.mappingBitMatrix.getWidth(), this.mappingBitMatrix.getHeight());\n }\n getVersion() {\n return this.version;\n }\n /**\n *Creates the version object based on the dimension of the original bit matrix from\n * the datamatrix code.
\n *\n *See ISO 16022:2006 Table 7 - ECC 200 symbol attributes
\n *\n * @param bitMatrix Original {@link BitMatrix} including alignment patterns\n * @return {@link Version} encapsulating the Data Matrix Code's \"version\"\n * @throws FormatException if the dimensions of the mapping matrix are not valid\n * Data Matrix dimensions.\n */\n static readVersion(bitMatrix) {\n const numRows = bitMatrix.getHeight();\n const numColumns = bitMatrix.getWidth();\n return Version.getVersionForDimensions(numRows, numColumns);\n }\n /**\n *Reads the bits in the {@link BitMatrix} representing the mapping matrix (No alignment patterns)\n * in the correct order in order to reconstitute the codewords bytes contained within the\n * Data Matrix Code.
\n *\n * @return bytes encoded within the Data Matrix Code\n * @throws FormatException if the exact number of bytes expected is not read\n */\n readCodewords() {\n const result = new Int8Array(this.version.getTotalCodewords());\n let resultOffset = 0;\n let row = 4;\n let column = 0;\n const numRows = this.mappingBitMatrix.getHeight();\n const numColumns = this.mappingBitMatrix.getWidth();\n let corner1Read = false;\n let corner2Read = false;\n let corner3Read = false;\n let corner4Read = false;\n // Read all of the codewords\n do {\n // Check the four corner cases\n if ((row === numRows) && (column === 0) && !corner1Read) {\n result[resultOffset++] = this.readCorner1(numRows, numColumns) & 0xff;\n row -= 2;\n column += 2;\n corner1Read = true;\n }\n else if ((row === numRows - 2) && (column === 0) && ((numColumns & 0x03) !== 0) && !corner2Read) {\n result[resultOffset++] = this.readCorner2(numRows, numColumns) & 0xff;\n row -= 2;\n column += 2;\n corner2Read = true;\n }\n else if ((row === numRows + 4) && (column === 2) && ((numColumns & 0x07) === 0) && !corner3Read) {\n result[resultOffset++] = this.readCorner3(numRows, numColumns) & 0xff;\n row -= 2;\n column += 2;\n corner3Read = true;\n }\n else if ((row === numRows - 2) && (column === 0) && ((numColumns & 0x07) === 4) && !corner4Read) {\n result[resultOffset++] = this.readCorner4(numRows, numColumns) & 0xff;\n row -= 2;\n column += 2;\n corner4Read = true;\n }\n else {\n // Sweep upward diagonally to the right\n do {\n if ((row < numRows) && (column >= 0) && !this.readMappingMatrix.get(column, row)) {\n result[resultOffset++] = this.readUtah(row, column, numRows, numColumns) & 0xff;\n }\n row -= 2;\n column += 2;\n } while ((row >= 0) && (column < numColumns));\n row += 1;\n column += 3;\n // Sweep downward diagonally to the left\n do {\n if ((row >= 0) && (column < numColumns) && !this.readMappingMatrix.get(column, row)) {\n result[resultOffset++] = this.readUtah(row, column, numRows, numColumns) & 0xff;\n }\n row += 2;\n column -= 2;\n } while ((row < numRows) && (column >= 0));\n row += 3;\n column += 1;\n }\n } while ((row < numRows) || (column < numColumns));\n if (resultOffset !== this.version.getTotalCodewords()) {\n throw new FormatException();\n }\n return result;\n }\n /**\n *Reads a bit of the mapping matrix accounting for boundary wrapping.
\n *\n * @param row Row to read in the mapping matrix\n * @param column Column to read in the mapping matrix\n * @param numRows Number of rows in the mapping matrix\n * @param numColumns Number of columns in the mapping matrix\n * @return value of the given bit in the mapping matrix\n */\n readModule(row, column, numRows, numColumns) {\n // Adjust the row and column indices based on boundary wrapping\n if (row < 0) {\n row += numRows;\n column += 4 - ((numRows + 4) & 0x07);\n }\n if (column < 0) {\n column += numColumns;\n row += 4 - ((numColumns + 4) & 0x07);\n }\n this.readMappingMatrix.set(column, row);\n return this.mappingBitMatrix.get(column, row);\n }\n /**\n *Reads the 8 bits of the standard Utah-shaped pattern.
\n *\n *See ISO 16022:2006, 5.8.1 Figure 6
\n *\n * @param row Current row in the mapping matrix, anchored at the 8th bit (LSB) of the pattern\n * @param column Current column in the mapping matrix, anchored at the 8th bit (LSB) of the pattern\n * @param numRows Number of rows in the mapping matrix\n * @param numColumns Number of columns in the mapping matrix\n * @return byte from the utah shape\n */\n readUtah(row, column, numRows, numColumns) {\n let currentByte = 0;\n if (this.readModule(row - 2, column - 2, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(row - 2, column - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(row - 1, column - 2, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(row - 1, column - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(row - 1, column, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(row, column - 2, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(row, column - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(row, column, numRows, numColumns)) {\n currentByte |= 1;\n }\n return currentByte;\n }\n /**\n *Reads the 8 bits of the special corner condition 1.
\n *\n *See ISO 16022:2006, Figure F.3
\n *\n * @param numRows Number of rows in the mapping matrix\n * @param numColumns Number of columns in the mapping matrix\n * @return byte from the Corner condition 1\n */\n readCorner1(numRows, numColumns) {\n let currentByte = 0;\n if (this.readModule(numRows - 1, 0, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(numRows - 1, 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(numRows - 1, 2, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(0, numColumns - 2, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(0, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(1, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(2, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(3, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n return currentByte;\n }\n /**\n *Reads the 8 bits of the special corner condition 2.
\n *\n *See ISO 16022:2006, Figure F.4
\n *\n * @param numRows Number of rows in the mapping matrix\n * @param numColumns Number of columns in the mapping matrix\n * @return byte from the Corner condition 2\n */\n readCorner2(numRows, numColumns) {\n let currentByte = 0;\n if (this.readModule(numRows - 3, 0, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(numRows - 2, 0, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(numRows - 1, 0, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(0, numColumns - 4, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(0, numColumns - 3, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(0, numColumns - 2, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(0, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(1, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n return currentByte;\n }\n /**\n *Reads the 8 bits of the special corner condition 3.
\n *\n *See ISO 16022:2006, Figure F.5
\n *\n * @param numRows Number of rows in the mapping matrix\n * @param numColumns Number of columns in the mapping matrix\n * @return byte from the Corner condition 3\n */\n readCorner3(numRows, numColumns) {\n let currentByte = 0;\n if (this.readModule(numRows - 1, 0, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(numRows - 1, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(0, numColumns - 3, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(0, numColumns - 2, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(0, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(1, numColumns - 3, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(1, numColumns - 2, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(1, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n return currentByte;\n }\n /**\n *Reads the 8 bits of the special corner condition 4.
\n *\n *See ISO 16022:2006, Figure F.6
\n *\n * @param numRows Number of rows in the mapping matrix\n * @param numColumns Number of columns in the mapping matrix\n * @return byte from the Corner condition 4\n */\n readCorner4(numRows, numColumns) {\n let currentByte = 0;\n if (this.readModule(numRows - 3, 0, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(numRows - 2, 0, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(numRows - 1, 0, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(0, numColumns - 2, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(0, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(1, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(2, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n currentByte <<= 1;\n if (this.readModule(3, numColumns - 1, numRows, numColumns)) {\n currentByte |= 1;\n }\n return currentByte;\n }\n /**\n *Extracts the data region from a {@link BitMatrix} that contains\n * alignment patterns.
\n *\n * @param bitMatrix Original {@link BitMatrix} with alignment patterns\n * @return BitMatrix that has the alignment patterns removed\n */\n extractDataRegion(bitMatrix) {\n const symbolSizeRows = this.version.getSymbolSizeRows();\n const symbolSizeColumns = this.version.getSymbolSizeColumns();\n if (bitMatrix.getHeight() !== symbolSizeRows) {\n throw new IllegalArgumentException('Dimension of bitMatrix must match the version size');\n }\n const dataRegionSizeRows = this.version.getDataRegionSizeRows();\n const dataRegionSizeColumns = this.version.getDataRegionSizeColumns();\n const numDataRegionsRow = symbolSizeRows / dataRegionSizeRows | 0;\n const numDataRegionsColumn = symbolSizeColumns / dataRegionSizeColumns | 0;\n const sizeDataRegionRow = numDataRegionsRow * dataRegionSizeRows;\n const sizeDataRegionColumn = numDataRegionsColumn * dataRegionSizeColumns;\n const bitMatrixWithoutAlignment = new BitMatrix(sizeDataRegionColumn, sizeDataRegionRow);\n for (let dataRegionRow = 0; dataRegionRow < numDataRegionsRow; ++dataRegionRow) {\n const dataRegionRowOffset = dataRegionRow * dataRegionSizeRows;\n for (let dataRegionColumn = 0; dataRegionColumn < numDataRegionsColumn; ++dataRegionColumn) {\n const dataRegionColumnOffset = dataRegionColumn * dataRegionSizeColumns;\n for (let i = 0; i < dataRegionSizeRows; ++i) {\n const readRowOffset = dataRegionRow * (dataRegionSizeRows + 2) + 1 + i;\n const writeRowOffset = dataRegionRowOffset + i;\n for (let j = 0; j < dataRegionSizeColumns; ++j) {\n const readColumnOffset = dataRegionColumn * (dataRegionSizeColumns + 2) + 1 + j;\n if (bitMatrix.get(readColumnOffset, readRowOffset)) {\n const writeColumnOffset = dataRegionColumnOffset + j;\n bitMatrixWithoutAlignment.set(writeColumnOffset, writeRowOffset);\n }\n }\n }\n }\n }\n return bitMatrixWithoutAlignment;\n }\n }\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n *Encapsulates a block of data within a Data Matrix Code. Data Matrix Codes may split their data into\n * multiple blocks, each of which is a unit of data and error-correction codewords. Each\n * is represented by an instance of this class.
\n *\n * @author bbrown@google.com (Brian Brown)\n */\n class DataBlock {\n constructor(numDataCodewords, codewords) {\n this.numDataCodewords = numDataCodewords;\n this.codewords = codewords;\n }\n /**\n *When Data Matrix Codes use multiple data blocks, they actually interleave the bytes of each of them.\n * That is, the first byte of data block 1 to n is written, then the second bytes, and so on. This\n * method will separate the data into original blocks.
\n *\n * @param rawCodewords bytes as read directly from the Data Matrix Code\n * @param version version of the Data Matrix Code\n * @return DataBlocks containing original bytes, \"de-interleaved\" from representation in the\n * Data Matrix Code\n */\n static getDataBlocks(rawCodewords, version) {\n // Figure out the number and size of data blocks used by this version\n const ecBlocks = version.getECBlocks();\n // First count the total number of data blocks\n let totalBlocks = 0;\n const ecBlockArray = ecBlocks.getECBlocks();\n for (let ecBlock of ecBlockArray) {\n totalBlocks += ecBlock.getCount();\n }\n // Now establish DataBlocks of the appropriate size and number of data codewords\n const result = new Array(totalBlocks);\n let numResultBlocks = 0;\n for (let ecBlock of ecBlockArray) {\n for (let i = 0; i < ecBlock.getCount(); i++) {\n const numDataCodewords = ecBlock.getDataCodewords();\n const numBlockCodewords = ecBlocks.getECCodewords() + numDataCodewords;\n result[numResultBlocks++] = new DataBlock(numDataCodewords, new Uint8Array(numBlockCodewords));\n }\n }\n // All blocks have the same amount of data, except that the last n\n // (where n may be 0) have 1 less byte. Figure out where these start.\n // TODO(bbrown): There is only one case where there is a difference for Data Matrix for size 144\n const longerBlocksTotalCodewords = result[0].codewords.length;\n // int shorterBlocksTotalCodewords = longerBlocksTotalCodewords - 1;\n const longerBlocksNumDataCodewords = longerBlocksTotalCodewords - ecBlocks.getECCodewords();\n const shorterBlocksNumDataCodewords = longerBlocksNumDataCodewords - 1;\n // The last elements of result may be 1 element shorter for 144 matrix\n // first fill out as many elements as all of them have minus 1\n let rawCodewordsOffset = 0;\n for (let i = 0; i < shorterBlocksNumDataCodewords; i++) {\n for (let j = 0; j < numResultBlocks; j++) {\n result[j].codewords[i] = rawCodewords[rawCodewordsOffset++];\n }\n }\n // Fill out the last data block in the longer ones\n const specialVersion = version.getVersionNumber() === 24;\n const numLongerBlocks = specialVersion ? 8 : numResultBlocks;\n for (let j = 0; j < numLongerBlocks; j++) {\n result[j].codewords[longerBlocksNumDataCodewords - 1] = rawCodewords[rawCodewordsOffset++];\n }\n // Now add in error correction blocks\n const max = result[0].codewords.length;\n for (let i = longerBlocksNumDataCodewords; i < max; i++) {\n for (let j = 0; j < numResultBlocks; j++) {\n const jOffset = specialVersion ? (j + 8) % numResultBlocks : j;\n const iOffset = specialVersion && jOffset > 7 ? i - 1 : i;\n result[jOffset].codewords[iOffset] = rawCodewords[rawCodewordsOffset++];\n }\n }\n if (rawCodewordsOffset !== rawCodewords.length) {\n throw new IllegalArgumentException();\n }\n return result;\n }\n getNumDataCodewords() {\n return this.numDataCodewords;\n }\n getCodewords() {\n return this.codewords;\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *This provides an easy abstraction to read bits at a time from a sequence of bytes, where the\n * number of bits read is not often a multiple of 8.
\n *\n *This class is thread-safe but not reentrant -- unless the caller modifies the bytes array\n * it passed in, in which case all bets are off.
\n *\n * @author Sean Owen\n */\n class BitSource {\n /**\n * @param bytes bytes from which this will read bits. Bits will be read from the first byte first.\n * Bits are read within a byte from most-significant to least-significant bit.\n */\n constructor(bytes) {\n this.bytes = bytes;\n this.byteOffset = 0;\n this.bitOffset = 0;\n }\n /**\n * @return index of next bit in current byte which would be read by the next call to {@link #readBits(int)}.\n */\n getBitOffset() {\n return this.bitOffset;\n }\n /**\n * @return index of next byte in input byte array which would be read by the next call to {@link #readBits(int)}.\n */\n getByteOffset() {\n return this.byteOffset;\n }\n /**\n * @param numBits number of bits to read\n * @return int representing the bits read. The bits will appear as the least-significant\n * bits of the int\n * @throws IllegalArgumentException if numBits isn't in [1,32] or more than is available\n */\n readBits(numBits /*int*/) {\n if (numBits < 1 || numBits > 32 || numBits > this.available()) {\n throw new IllegalArgumentException('' + numBits);\n }\n let result = 0;\n let bitOffset = this.bitOffset;\n let byteOffset = this.byteOffset;\n const bytes = this.bytes;\n // First, read remainder from current byte\n if (bitOffset > 0) {\n const bitsLeft = 8 - bitOffset;\n const toRead = numBits < bitsLeft ? numBits : bitsLeft;\n const bitsToNotRead = bitsLeft - toRead;\n const mask = (0xFF >> (8 - toRead)) << bitsToNotRead;\n result = (bytes[byteOffset] & mask) >> bitsToNotRead;\n numBits -= toRead;\n bitOffset += toRead;\n if (bitOffset === 8) {\n bitOffset = 0;\n byteOffset++;\n }\n }\n // Next read whole bytes\n if (numBits > 0) {\n while (numBits >= 8) {\n result = (result << 8) | (bytes[byteOffset] & 0xFF);\n byteOffset++;\n numBits -= 8;\n }\n // Finally read a partial byte\n if (numBits > 0) {\n const bitsToNotRead = 8 - numBits;\n const mask = (0xFF >> bitsToNotRead) << bitsToNotRead;\n result = (result << numBits) | ((bytes[byteOffset] & mask) >> bitsToNotRead);\n bitOffset += numBits;\n }\n }\n this.bitOffset = bitOffset;\n this.byteOffset = byteOffset;\n return result;\n }\n /**\n * @return number of bits that can be read successfully\n */\n available() {\n return 8 * (this.bytes.length - this.byteOffset) - this.bitOffset;\n }\n }\n\n /*\n * Copyright 2008 ZXing authors\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 var Mode;\n (function (Mode) {\n Mode[Mode[\"PAD_ENCODE\"] = 0] = \"PAD_ENCODE\";\n Mode[Mode[\"ASCII_ENCODE\"] = 1] = \"ASCII_ENCODE\";\n Mode[Mode[\"C40_ENCODE\"] = 2] = \"C40_ENCODE\";\n Mode[Mode[\"TEXT_ENCODE\"] = 3] = \"TEXT_ENCODE\";\n Mode[Mode[\"ANSIX12_ENCODE\"] = 4] = \"ANSIX12_ENCODE\";\n Mode[Mode[\"EDIFACT_ENCODE\"] = 5] = \"EDIFACT_ENCODE\";\n Mode[Mode[\"BASE256_ENCODE\"] = 6] = \"BASE256_ENCODE\";\n })(Mode || (Mode = {}));\n /**\n *Data Matrix Codes can encode text as bits in one of several modes, and can use multiple modes\n * in one Data Matrix Code. This class decodes the bits back into text.
\n *\n *See ISO 16022:2006, 5.2.1 - 5.2.9.2
\n *\n * @author bbrown@google.com (Brian Brown)\n * @author Sean Owen\n */\n class DecodedBitStreamParser {\n static decode(bytes) {\n const bits = new BitSource(bytes);\n const result = new StringBuilder();\n const resultTrailer = new StringBuilder();\n const byteSegments = new Array();\n let mode = Mode.ASCII_ENCODE;\n do {\n if (mode === Mode.ASCII_ENCODE) {\n mode = this.decodeAsciiSegment(bits, result, resultTrailer);\n }\n else {\n switch (mode) {\n case Mode.C40_ENCODE:\n this.decodeC40Segment(bits, result);\n break;\n case Mode.TEXT_ENCODE:\n this.decodeTextSegment(bits, result);\n break;\n case Mode.ANSIX12_ENCODE:\n this.decodeAnsiX12Segment(bits, result);\n break;\n case Mode.EDIFACT_ENCODE:\n this.decodeEdifactSegment(bits, result);\n break;\n case Mode.BASE256_ENCODE:\n this.decodeBase256Segment(bits, result, byteSegments);\n break;\n default:\n throw new FormatException();\n }\n mode = Mode.ASCII_ENCODE;\n }\n } while (mode !== Mode.PAD_ENCODE && bits.available() > 0);\n if (resultTrailer.length() > 0) {\n result.append(resultTrailer.toString());\n }\n return new DecoderResult(bytes, result.toString(), byteSegments.length === 0 ? null : byteSegments, null);\n }\n /**\n * See ISO 16022:2006, 5.2.3 and Annex C, Table C.2\n */\n static decodeAsciiSegment(bits, result, resultTrailer) {\n let upperShift = false;\n do {\n let oneByte = bits.readBits(8);\n if (oneByte === 0) {\n throw new FormatException();\n }\n else if (oneByte <= 128) { // ASCII data (ASCII value + 1)\n if (upperShift) {\n oneByte += 128;\n // upperShift = false;\n }\n result.append(String.fromCharCode(oneByte - 1));\n return Mode.ASCII_ENCODE;\n }\n else if (oneByte === 129) { // Pad\n return Mode.PAD_ENCODE;\n }\n else if (oneByte <= 229) { // 2-digit data 00-99 (Numeric Value + 130)\n const value = oneByte - 130;\n if (value < 10) { // pad with '0' for single digit values\n result.append('0');\n }\n result.append('' + value);\n }\n else {\n switch (oneByte) {\n case 230: // Latch to C40 encodation\n return Mode.C40_ENCODE;\n case 231: // Latch to Base 256 encodation\n return Mode.BASE256_ENCODE;\n case 232: // FNC1\n result.append(String.fromCharCode(29)); // translate as ASCII 29\n break;\n case 233: // Structured Append\n case 234: // Reader Programming\n // Ignore these symbols for now\n // throw ReaderException.getInstance();\n break;\n case 235: // Upper Shift (shift to Extended ASCII)\n upperShift = true;\n break;\n case 236: // 05 Macro\n result.append('[)>\\u001E05\\u001D');\n resultTrailer.insert(0, '\\u001E\\u0004');\n break;\n case 237: // 06 Macro\n result.append('[)>\\u001E06\\u001D');\n resultTrailer.insert(0, '\\u001E\\u0004');\n break;\n case 238: // Latch to ANSI X12 encodation\n return Mode.ANSIX12_ENCODE;\n case 239: // Latch to Text encodation\n return Mode.TEXT_ENCODE;\n case 240: // Latch to EDIFACT encodation\n return Mode.EDIFACT_ENCODE;\n case 241: // ECI Character\n // TODO(bbrown): I think we need to support ECI\n // throw ReaderException.getInstance();\n // Ignore this symbol for now\n break;\n default:\n // Not to be used in ASCII encodation\n // but work around encoders that end with 254, latch back to ASCII\n if (oneByte !== 254 || bits.available() !== 0) {\n throw new FormatException();\n }\n break;\n }\n }\n } while (bits.available() > 0);\n return Mode.ASCII_ENCODE;\n }\n /**\n * See ISO 16022:2006, 5.2.5 and Annex C, Table C.1\n */\n static decodeC40Segment(bits, result) {\n // Three C40 values are encoded in a 16-bit value as\n // (1600 * C1) + (40 * C2) + C3 + 1\n // TODO(bbrown): The Upper Shift with C40 doesn't work in the 4 value scenario all the time\n let upperShift = false;\n const cValues = [];\n let shift = 0;\n do {\n // If there is only one byte left then it will be encoded as ASCII\n if (bits.available() === 8) {\n return;\n }\n const firstByte = bits.readBits(8);\n if (firstByte === 254) { // Unlatch codeword\n return;\n }\n this.parseTwoBytes(firstByte, bits.readBits(8), cValues);\n for (let i = 0; i < 3; i++) {\n const cValue = cValues[i];\n switch (shift) {\n case 0:\n if (cValue < 3) {\n shift = cValue + 1;\n }\n else if (cValue < this.C40_BASIC_SET_CHARS.length) {\n const c40char = this.C40_BASIC_SET_CHARS[cValue];\n if (upperShift) {\n result.append(String.fromCharCode(c40char.charCodeAt(0) + 128));\n upperShift = false;\n }\n else {\n result.append(c40char);\n }\n }\n else {\n throw new FormatException();\n }\n break;\n case 1:\n if (upperShift) {\n result.append(String.fromCharCode(cValue + 128));\n upperShift = false;\n }\n else {\n result.append(String.fromCharCode(cValue));\n }\n shift = 0;\n break;\n case 2:\n if (cValue < this.C40_SHIFT2_SET_CHARS.length) {\n const c40char = this.C40_SHIFT2_SET_CHARS[cValue];\n if (upperShift) {\n result.append(String.fromCharCode(c40char.charCodeAt(0) + 128));\n upperShift = false;\n }\n else {\n result.append(c40char);\n }\n }\n else {\n switch (cValue) {\n case 27: // FNC1\n result.append(String.fromCharCode(29)); // translate as ASCII 29\n break;\n case 30: // Upper Shift\n upperShift = true;\n break;\n default:\n throw new FormatException();\n }\n }\n shift = 0;\n break;\n case 3:\n if (upperShift) {\n result.append(String.fromCharCode(cValue + 224));\n upperShift = false;\n }\n else {\n result.append(String.fromCharCode(cValue + 96));\n }\n shift = 0;\n break;\n default:\n throw new FormatException();\n }\n }\n } while (bits.available() > 0);\n }\n /**\n * See ISO 16022:2006, 5.2.6 and Annex C, Table C.2\n */\n static decodeTextSegment(bits, result) {\n // Three Text values are encoded in a 16-bit value as\n // (1600 * C1) + (40 * C2) + C3 + 1\n // TODO(bbrown): The Upper Shift with Text doesn't work in the 4 value scenario all the time\n let upperShift = false;\n let cValues = [];\n let shift = 0;\n do {\n // If there is only one byte left then it will be encoded as ASCII\n if (bits.available() === 8) {\n return;\n }\n const firstByte = bits.readBits(8);\n if (firstByte === 254) { // Unlatch codeword\n return;\n }\n this.parseTwoBytes(firstByte, bits.readBits(8), cValues);\n for (let i = 0; i < 3; i++) {\n const cValue = cValues[i];\n switch (shift) {\n case 0:\n if (cValue < 3) {\n shift = cValue + 1;\n }\n else if (cValue < this.TEXT_BASIC_SET_CHARS.length) {\n const textChar = this.TEXT_BASIC_SET_CHARS[cValue];\n if (upperShift) {\n result.append(String.fromCharCode(textChar.charCodeAt(0) + 128));\n upperShift = false;\n }\n else {\n result.append(textChar);\n }\n }\n else {\n throw new FormatException();\n }\n break;\n case 1:\n if (upperShift) {\n result.append(String.fromCharCode(cValue + 128));\n upperShift = false;\n }\n else {\n result.append(String.fromCharCode(cValue));\n }\n shift = 0;\n break;\n case 2:\n // Shift 2 for Text is the same encoding as C40\n if (cValue < this.TEXT_SHIFT2_SET_CHARS.length) {\n const textChar = this.TEXT_SHIFT2_SET_CHARS[cValue];\n if (upperShift) {\n result.append(String.fromCharCode(textChar.charCodeAt(0) + 128));\n upperShift = false;\n }\n else {\n result.append(textChar);\n }\n }\n else {\n switch (cValue) {\n case 27: // FNC1\n result.append(String.fromCharCode(29)); // translate as ASCII 29\n break;\n case 30: // Upper Shift\n upperShift = true;\n break;\n default:\n throw new FormatException();\n }\n }\n shift = 0;\n break;\n case 3:\n if (cValue < this.TEXT_SHIFT3_SET_CHARS.length) {\n const textChar = this.TEXT_SHIFT3_SET_CHARS[cValue];\n if (upperShift) {\n result.append(String.fromCharCode(textChar.charCodeAt(0) + 128));\n upperShift = false;\n }\n else {\n result.append(textChar);\n }\n shift = 0;\n }\n else {\n throw new FormatException();\n }\n break;\n default:\n throw new FormatException();\n }\n }\n } while (bits.available() > 0);\n }\n /**\n * See ISO 16022:2006, 5.2.7\n */\n static decodeAnsiX12Segment(bits, result) {\n // Three ANSI X12 values are encoded in a 16-bit value as\n // (1600 * C1) + (40 * C2) + C3 + 1\n const cValues = [];\n do {\n // If there is only one byte left then it will be encoded as ASCII\n if (bits.available() === 8) {\n return;\n }\n const firstByte = bits.readBits(8);\n if (firstByte === 254) { // Unlatch codeword\n return;\n }\n this.parseTwoBytes(firstByte, bits.readBits(8), cValues);\n for (let i = 0; i < 3; i++) {\n const cValue = cValues[i];\n switch (cValue) {\n case 0: // X12 segment terminatorThe main class which implements Data Matrix Code decoding -- as opposed to locating and extracting\n * the Data Matrix Code from an image.
\n *\n * @author bbrown@google.com (Brian Brown)\n */\n class Decoder$1 {\n constructor() {\n this.rsDecoder = new ReedSolomonDecoder(GenericGF.DATA_MATRIX_FIELD_256);\n }\n /**\n *Decodes a Data Matrix Code represented as a {@link BitMatrix}. A 1 or \"true\" is taken\n * to mean a black module.
\n *\n * @param bits booleans representing white/black Data Matrix Code modules\n * @return text and bytes encoded within the Data Matrix Code\n * @throws FormatException if the Data Matrix Code cannot be decoded\n * @throws ChecksumException if error correction fails\n */\n decode(bits) {\n // Construct a parser and read version, error-correction level\n const parser = new BitMatrixParser(bits);\n const version = parser.getVersion();\n // Read codewords\n const codewords = parser.readCodewords();\n // Separate into data blocks\n const dataBlocks = DataBlock.getDataBlocks(codewords, version);\n // Count total number of data bytes\n let totalBytes = 0;\n for (let db of dataBlocks) {\n totalBytes += db.getNumDataCodewords();\n }\n const resultBytes = new Uint8Array(totalBytes);\n const dataBlocksCount = dataBlocks.length;\n // Error-correct and copy data blocks together into a stream of bytes\n for (let j = 0; j < dataBlocksCount; j++) {\n const dataBlock = dataBlocks[j];\n const codewordBytes = dataBlock.getCodewords();\n const numDataCodewords = dataBlock.getNumDataCodewords();\n this.correctErrors(codewordBytes, numDataCodewords);\n for (let i = 0; i < numDataCodewords; i++) {\n // De-interlace data blocks.\n resultBytes[i * dataBlocksCount + j] = codewordBytes[i];\n }\n }\n // Decode the contents of that stream of bytes\n return DecodedBitStreamParser.decode(resultBytes);\n }\n /**\n *Given data and error-correction codewords received, possibly corrupted by errors, attempts to\n * correct the errors in-place using Reed-Solomon error correction.
\n *\n * @param codewordBytes data and error correction codewords\n * @param numDataCodewords number of codewords that are data bytes\n * @throws ChecksumException if error correction fails\n */\n correctErrors(codewordBytes, numDataCodewords) {\n // const numCodewords = codewordBytes.length;\n // First read into an array of ints\n const codewordsInts = new Int32Array(codewordBytes);\n // for (let i = 0; i < numCodewords; i++) {\n // codewordsInts[i] = codewordBytes[i] & 0xFF;\n // }\n try {\n this.rsDecoder.decode(codewordsInts, codewordBytes.length - numDataCodewords);\n }\n catch (ignored /* ReedSolomonException */) {\n throw new ChecksumException();\n }\n // Copy back into array of bytes -- only need to worry about the bytes that were data\n // We don't care about errors in the error-correction codewords\n for (let i = 0; i < numDataCodewords; i++) {\n codewordBytes[i] = codewordsInts[i];\n }\n }\n }\n\n /*\n * Copyright 2008 ZXing authors\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 /**\n *Encapsulates logic that can detect a Data Matrix Code in an image, even if the Data Matrix Code\n * is rotated or skewed, or partially obscured.
\n *\n * @author Sean Owen\n */\n class Detector$1 {\n constructor(image) {\n this.image = image;\n this.rectangleDetector = new WhiteRectangleDetector(this.image);\n }\n /**\n *Detects a Data Matrix Code in an image.
\n *\n * @return {@link DetectorResult} encapsulating results of detecting a Data Matrix Code\n * @throws NotFoundException if no Data Matrix Code can be found\n */\n detect() {\n const cornerPoints = this.rectangleDetector.detect();\n let points = this.detectSolid1(cornerPoints);\n points = this.detectSolid2(points);\n points[3] = this.correctTopRight(points);\n if (!points[3]) {\n throw new NotFoundException();\n }\n points = this.shiftToModuleCenter(points);\n const topLeft = points[0];\n const bottomLeft = points[1];\n const bottomRight = points[2];\n const topRight = points[3];\n let dimensionTop = this.transitionsBetween(topLeft, topRight) + 1;\n let dimensionRight = this.transitionsBetween(bottomRight, topRight) + 1;\n if ((dimensionTop & 0x01) === 1) {\n dimensionTop += 1;\n }\n if ((dimensionRight & 0x01) === 1) {\n dimensionRight += 1;\n }\n if (4 * dimensionTop < 7 * dimensionRight && 4 * dimensionRight < 7 * dimensionTop) {\n // The matrix is square\n dimensionTop = dimensionRight = Math.max(dimensionTop, dimensionRight);\n }\n let bits = Detector$1.sampleGrid(this.image, topLeft, bottomLeft, bottomRight, topRight, dimensionTop, dimensionRight);\n return new DetectorResult(bits, [topLeft, bottomLeft, bottomRight, topRight]);\n }\n static shiftPoint(point, to, div) {\n let x = (to.getX() - point.getX()) / (div + 1);\n let y = (to.getY() - point.getY()) / (div + 1);\n return new ResultPoint(point.getX() + x, point.getY() + y);\n }\n static moveAway(point, fromX, fromY) {\n let x = point.getX();\n let y = point.getY();\n if (x < fromX) {\n x -= 1;\n }\n else {\n x += 1;\n }\n if (y < fromY) {\n y -= 1;\n }\n else {\n y += 1;\n }\n return new ResultPoint(x, y);\n }\n /**\n * Detect a solid side which has minimum transition.\n */\n detectSolid1(cornerPoints) {\n // 0 2\n // 1 3\n let pointA = cornerPoints[0];\n let pointB = cornerPoints[1];\n let pointC = cornerPoints[3];\n let pointD = cornerPoints[2];\n let trAB = this.transitionsBetween(pointA, pointB);\n let trBC = this.transitionsBetween(pointB, pointC);\n let trCD = this.transitionsBetween(pointC, pointD);\n let trDA = this.transitionsBetween(pointD, pointA);\n // 0..3\n // : :\n // 1--2\n let min = trAB;\n let points = [pointD, pointA, pointB, pointC];\n if (min > trBC) {\n min = trBC;\n points[0] = pointA;\n points[1] = pointB;\n points[2] = pointC;\n points[3] = pointD;\n }\n if (min > trCD) {\n min = trCD;\n points[0] = pointB;\n points[1] = pointC;\n points[2] = pointD;\n points[3] = pointA;\n }\n if (min > trDA) {\n points[0] = pointC;\n points[1] = pointD;\n points[2] = pointA;\n points[3] = pointB;\n }\n return points;\n }\n /**\n * Detect a second solid side next to first solid side.\n */\n detectSolid2(points) {\n // A..D\n // : :\n // B--C\n let pointA = points[0];\n let pointB = points[1];\n let pointC = points[2];\n let pointD = points[3];\n // Transition detection on the edge is not stable.\n // To safely detect, shift the points to the module center.\n let tr = this.transitionsBetween(pointA, pointD);\n let pointBs = Detector$1.shiftPoint(pointB, pointC, (tr + 1) * 4);\n let pointCs = Detector$1.shiftPoint(pointC, pointB, (tr + 1) * 4);\n let trBA = this.transitionsBetween(pointBs, pointA);\n let trCD = this.transitionsBetween(pointCs, pointD);\n // 0..3\n // | :\n // 1--2\n if (trBA < trCD) {\n // solid sides: A-B-C\n points[0] = pointA;\n points[1] = pointB;\n points[2] = pointC;\n points[3] = pointD;\n }\n else {\n // solid sides: B-C-D\n points[0] = pointB;\n points[1] = pointC;\n points[2] = pointD;\n points[3] = pointA;\n }\n return points;\n }\n /**\n * Calculates the corner position of the white top right module.\n */\n correctTopRight(points) {\n // A..D\n // | :\n // B--C\n let pointA = points[0];\n let pointB = points[1];\n let pointC = points[2];\n let pointD = points[3];\n // shift points for safe transition detection.\n let trTop = this.transitionsBetween(pointA, pointD);\n let trRight = this.transitionsBetween(pointB, pointD);\n let pointAs = Detector$1.shiftPoint(pointA, pointB, (trRight + 1) * 4);\n let pointCs = Detector$1.shiftPoint(pointC, pointB, (trTop + 1) * 4);\n trTop = this.transitionsBetween(pointAs, pointD);\n trRight = this.transitionsBetween(pointCs, pointD);\n let candidate1 = new ResultPoint(pointD.getX() + (pointC.getX() - pointB.getX()) / (trTop + 1), pointD.getY() + (pointC.getY() - pointB.getY()) / (trTop + 1));\n let candidate2 = new ResultPoint(pointD.getX() + (pointA.getX() - pointB.getX()) / (trRight + 1), pointD.getY() + (pointA.getY() - pointB.getY()) / (trRight + 1));\n if (!this.isValid(candidate1)) {\n if (this.isValid(candidate2)) {\n return candidate2;\n }\n return null;\n }\n if (!this.isValid(candidate2)) {\n return candidate1;\n }\n let sumc1 = this.transitionsBetween(pointAs, candidate1) + this.transitionsBetween(pointCs, candidate1);\n let sumc2 = this.transitionsBetween(pointAs, candidate2) + this.transitionsBetween(pointCs, candidate2);\n if (sumc1 > sumc2) {\n return candidate1;\n }\n else {\n return candidate2;\n }\n }\n /**\n * Shift the edge points to the module center.\n */\n shiftToModuleCenter(points) {\n // A..D\n // | :\n // B--C\n let pointA = points[0];\n let pointB = points[1];\n let pointC = points[2];\n let pointD = points[3];\n // calculate pseudo dimensions\n let dimH = this.transitionsBetween(pointA, pointD) + 1;\n let dimV = this.transitionsBetween(pointC, pointD) + 1;\n // shift points for safe dimension detection\n let pointAs = Detector$1.shiftPoint(pointA, pointB, dimV * 4);\n let pointCs = Detector$1.shiftPoint(pointC, pointB, dimH * 4);\n // calculate more precise dimensions\n dimH = this.transitionsBetween(pointAs, pointD) + 1;\n dimV = this.transitionsBetween(pointCs, pointD) + 1;\n if ((dimH & 0x01) === 1) {\n dimH += 1;\n }\n if ((dimV & 0x01) === 1) {\n dimV += 1;\n }\n // WhiteRectangleDetector returns points inside of the rectangle.\n // I want points on the edges.\n let centerX = (pointA.getX() + pointB.getX() + pointC.getX() + pointD.getX()) / 4;\n let centerY = (pointA.getY() + pointB.getY() + pointC.getY() + pointD.getY()) / 4;\n pointA = Detector$1.moveAway(pointA, centerX, centerY);\n pointB = Detector$1.moveAway(pointB, centerX, centerY);\n pointC = Detector$1.moveAway(pointC, centerX, centerY);\n pointD = Detector$1.moveAway(pointD, centerX, centerY);\n let pointBs;\n let pointDs;\n // shift points to the center of each modules\n pointAs = Detector$1.shiftPoint(pointA, pointB, dimV * 4);\n pointAs = Detector$1.shiftPoint(pointAs, pointD, dimH * 4);\n pointBs = Detector$1.shiftPoint(pointB, pointA, dimV * 4);\n pointBs = Detector$1.shiftPoint(pointBs, pointC, dimH * 4);\n pointCs = Detector$1.shiftPoint(pointC, pointD, dimV * 4);\n pointCs = Detector$1.shiftPoint(pointCs, pointB, dimH * 4);\n pointDs = Detector$1.shiftPoint(pointD, pointC, dimV * 4);\n pointDs = Detector$1.shiftPoint(pointDs, pointA, dimH * 4);\n return [pointAs, pointBs, pointCs, pointDs];\n }\n isValid(p) {\n return p.getX() >= 0 && p.getX() < this.image.getWidth() && p.getY() > 0 && p.getY() < this.image.getHeight();\n }\n static sampleGrid(image, topLeft, bottomLeft, bottomRight, topRight, dimensionX, dimensionY) {\n const sampler = GridSamplerInstance.getInstance();\n return sampler.sampleGrid(image, dimensionX, dimensionY, 0.5, 0.5, dimensionX - 0.5, 0.5, dimensionX - 0.5, dimensionY - 0.5, 0.5, dimensionY - 0.5, topLeft.getX(), topLeft.getY(), topRight.getX(), topRight.getY(), bottomRight.getX(), bottomRight.getY(), bottomLeft.getX(), bottomLeft.getY());\n }\n /**\n * Counts the number of black/white transitions between two points, using something like Bresenham's algorithm.\n */\n transitionsBetween(from, to) {\n // See QR Code Detector, sizeOfBlackWhiteBlackRun()\n let fromX = Math.trunc(from.getX());\n let fromY = Math.trunc(from.getY());\n let toX = Math.trunc(to.getX());\n let toY = Math.trunc(to.getY());\n let steep = Math.abs(toY - fromY) > Math.abs(toX - fromX);\n if (steep) {\n let temp = fromX;\n fromX = fromY;\n fromY = temp;\n temp = toX;\n toX = toY;\n toY = temp;\n }\n let dx = Math.abs(toX - fromX);\n let dy = Math.abs(toY - fromY);\n let error = -dx / 2;\n let ystep = fromY < toY ? 1 : -1;\n let xstep = fromX < toX ? 1 : -1;\n let transitions = 0;\n let inBlack = this.image.get(steep ? fromY : fromX, steep ? fromX : fromY);\n for (let x = fromX, y = fromY; x !== toX; x += xstep) {\n let isBlack = this.image.get(steep ? y : x, steep ? x : y);\n if (isBlack !== inBlack) {\n transitions++;\n inBlack = isBlack;\n }\n error += dy;\n if (error > 0) {\n if (y === toY) {\n break;\n }\n y += ystep;\n error -= dx;\n }\n }\n return transitions;\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n * This implementation can detect and decode Data Matrix codes in an image.\n *\n * @author bbrown@google.com (Brian Brown)\n */\n class DataMatrixReader {\n constructor() {\n this.decoder = new Decoder$1();\n }\n /**\n * Locates and decodes a Data Matrix code in an image.\n *\n * @return a String representing the content encoded by the Data Matrix code\n * @throws NotFoundException if a Data Matrix code cannot be found\n * @throws FormatException if a Data Matrix code cannot be decoded\n * @throws ChecksumException if error correction fails\n */\n // @Override\n // public Result decode(BinaryBitmap image) throws NotFoundException, ChecksumException, FormatException {\n // return decode(image, null);\n // }\n // @Override\n decode(image, hints = null) {\n let decoderResult;\n let points;\n if (hints != null && hints.has(DecodeHintType$1.PURE_BARCODE)) {\n const bits = DataMatrixReader.extractPureBits(image.getBlackMatrix());\n decoderResult = this.decoder.decode(bits);\n points = DataMatrixReader.NO_POINTS;\n }\n else {\n const detectorResult = new Detector$1(image.getBlackMatrix()).detect();\n decoderResult = this.decoder.decode(detectorResult.getBits());\n points = detectorResult.getPoints();\n }\n const rawBytes = decoderResult.getRawBytes();\n const result = new Result(decoderResult.getText(), rawBytes, 8 * rawBytes.length, points, BarcodeFormat$1.DATA_MATRIX, System.currentTimeMillis());\n const byteSegments = decoderResult.getByteSegments();\n if (byteSegments != null) {\n result.putMetadata(ResultMetadataType$1.BYTE_SEGMENTS, byteSegments);\n }\n const ecLevel = decoderResult.getECLevel();\n if (ecLevel != null) {\n result.putMetadata(ResultMetadataType$1.ERROR_CORRECTION_LEVEL, ecLevel);\n }\n return result;\n }\n // @Override\n reset() {\n // do nothing\n }\n /**\n * This method detects a code in a \"pure\" image -- that is, pure monochrome image\n * which contains only an unrotated, unskewed, image of a code, with some white border\n * around it. This is a specialized method that works exceptionally fast in this special\n * case.\n *\n * @see com.google.zxing.qrcode.QRCodeReader#extractPureBits(BitMatrix)\n */\n static extractPureBits(image) {\n const leftTopBlack = image.getTopLeftOnBit();\n const rightBottomBlack = image.getBottomRightOnBit();\n if (leftTopBlack == null || rightBottomBlack == null) {\n throw new NotFoundException();\n }\n const moduleSize = this.moduleSize(leftTopBlack, image);\n let top = leftTopBlack[1];\n const bottom = rightBottomBlack[1];\n let left = leftTopBlack[0];\n const right = rightBottomBlack[0];\n const matrixWidth = (right - left + 1) / moduleSize;\n const matrixHeight = (bottom - top + 1) / moduleSize;\n if (matrixWidth <= 0 || matrixHeight <= 0) {\n throw new NotFoundException();\n }\n // Push in the \"border\" by half the module width so that we start\n // sampling in the middle of the module. Just in case the image is a\n // little off, this will help recover.\n const nudge = moduleSize / 2;\n top += nudge;\n left += nudge;\n // Now just read off the bits\n const bits = new BitMatrix(matrixWidth, matrixHeight);\n for (let y = 0; y < matrixHeight; y++) {\n const iOffset = top + y * moduleSize;\n for (let x = 0; x < matrixWidth; x++) {\n if (image.get(left + x * moduleSize, iOffset)) {\n bits.set(x, y);\n }\n }\n }\n return bits;\n }\n static moduleSize(leftTopBlack, image) {\n const width = image.getWidth();\n let x = leftTopBlack[0];\n const y = leftTopBlack[1];\n while (x < width && image.get(x, y)) {\n x++;\n }\n if (x === width) {\n throw new NotFoundException();\n }\n const moduleSize = x - leftTopBlack[0];\n if (moduleSize === 0) {\n throw new NotFoundException();\n }\n return moduleSize;\n }\n }\n DataMatrixReader.NO_POINTS = [];\n\n /**\n * @deprecated Moving to @zxing/browser\n *\n * QR Code reader to use from browser.\n */\n class BrowserDatamatrixCodeReader extends BrowserCodeReader {\n /**\n * Creates an instance of BrowserQRCodeReader.\n * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries\n */\n constructor(timeBetweenScansMillis = 500) {\n super(new DataMatrixReader(), timeBetweenScansMillis);\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 var ErrorCorrectionLevelValues;\n (function (ErrorCorrectionLevelValues) {\n ErrorCorrectionLevelValues[ErrorCorrectionLevelValues[\"L\"] = 0] = \"L\";\n ErrorCorrectionLevelValues[ErrorCorrectionLevelValues[\"M\"] = 1] = \"M\";\n ErrorCorrectionLevelValues[ErrorCorrectionLevelValues[\"Q\"] = 2] = \"Q\";\n ErrorCorrectionLevelValues[ErrorCorrectionLevelValues[\"H\"] = 3] = \"H\";\n })(ErrorCorrectionLevelValues || (ErrorCorrectionLevelValues = {}));\n /**\n *See ISO 18004:2006, 6.5.1. This enum encapsulates the four error correction levels\n * defined by the QR code standard.
\n *\n * @author Sean Owen\n */\n class ErrorCorrectionLevel {\n constructor(value, stringValue, bits /*int*/) {\n this.value = value;\n this.stringValue = stringValue;\n this.bits = bits;\n ErrorCorrectionLevel.FOR_BITS.set(bits, this);\n ErrorCorrectionLevel.FOR_VALUE.set(value, this);\n }\n getValue() {\n return this.value;\n }\n getBits() {\n return this.bits;\n }\n static fromString(s) {\n switch (s) {\n case 'L': return ErrorCorrectionLevel.L;\n case 'M': return ErrorCorrectionLevel.M;\n case 'Q': return ErrorCorrectionLevel.Q;\n case 'H': return ErrorCorrectionLevel.H;\n default: throw new ArgumentException(s + 'not available');\n }\n }\n toString() {\n return this.stringValue;\n }\n equals(o) {\n if (!(o instanceof ErrorCorrectionLevel)) {\n return false;\n }\n const other = o;\n return this.value === other.value;\n }\n /**\n * @param bits int containing the two bits encoding a QR Code's error correction level\n * @return ErrorCorrectionLevel representing the encoded error correction level\n */\n static forBits(bits /*int*/) {\n if (bits < 0 || bits >= ErrorCorrectionLevel.FOR_BITS.size) {\n throw new IllegalArgumentException();\n }\n return ErrorCorrectionLevel.FOR_BITS.get(bits);\n }\n }\n ErrorCorrectionLevel.FOR_BITS = new Map();\n ErrorCorrectionLevel.FOR_VALUE = new Map();\n /** L = ~7% correction */\n ErrorCorrectionLevel.L = new ErrorCorrectionLevel(ErrorCorrectionLevelValues.L, 'L', 0x01);\n /** M = ~15% correction */\n ErrorCorrectionLevel.M = new ErrorCorrectionLevel(ErrorCorrectionLevelValues.M, 'M', 0x00);\n /** Q = ~25% correction */\n ErrorCorrectionLevel.Q = new ErrorCorrectionLevel(ErrorCorrectionLevelValues.Q, 'Q', 0x03);\n /** H = ~30% correction */\n ErrorCorrectionLevel.H = new ErrorCorrectionLevel(ErrorCorrectionLevelValues.H, 'H', 0x02);\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *Encapsulates a QR Code's format information, including the data mask used and\n * error correction level.
\n *\n * @author Sean Owen\n * @see DataMask\n * @see ErrorCorrectionLevel\n */\n class FormatInformation {\n constructor(formatInfo /*int*/) {\n // Bits 3,4\n this.errorCorrectionLevel = ErrorCorrectionLevel.forBits((formatInfo >> 3) & 0x03);\n // Bottom 3 bits\n this.dataMask = /*(byte) */ (formatInfo & 0x07);\n }\n static numBitsDiffering(a /*int*/, b /*int*/) {\n return Integer.bitCount(a ^ b);\n }\n /**\n * @param maskedFormatInfo1 format info indicator, with mask still applied\n * @param maskedFormatInfo2 second copy of same info; both are checked at the same time\n * to establish best match\n * @return information about the format it specifies, or {@code null}\n * if doesn't seem to match any known pattern\n */\n static decodeFormatInformation(maskedFormatInfo1 /*int*/, maskedFormatInfo2 /*int*/) {\n const formatInfo = FormatInformation.doDecodeFormatInformation(maskedFormatInfo1, maskedFormatInfo2);\n if (formatInfo !== null) {\n return formatInfo;\n }\n // Should return null, but, some QR codes apparently\n // do not mask this info. Try again by actually masking the pattern\n // first\n return FormatInformation.doDecodeFormatInformation(maskedFormatInfo1 ^ FormatInformation.FORMAT_INFO_MASK_QR, maskedFormatInfo2 ^ FormatInformation.FORMAT_INFO_MASK_QR);\n }\n static doDecodeFormatInformation(maskedFormatInfo1 /*int*/, maskedFormatInfo2 /*int*/) {\n // Find the int in FORMAT_INFO_DECODE_LOOKUP with fewest bits differing\n let bestDifference = Number.MAX_SAFE_INTEGER;\n let bestFormatInfo = 0;\n for (const decodeInfo of FormatInformation.FORMAT_INFO_DECODE_LOOKUP) {\n const targetInfo = decodeInfo[0];\n if (targetInfo === maskedFormatInfo1 || targetInfo === maskedFormatInfo2) {\n // Found an exact match\n return new FormatInformation(decodeInfo[1]);\n }\n let bitsDifference = FormatInformation.numBitsDiffering(maskedFormatInfo1, targetInfo);\n if (bitsDifference < bestDifference) {\n bestFormatInfo = decodeInfo[1];\n bestDifference = bitsDifference;\n }\n if (maskedFormatInfo1 !== maskedFormatInfo2) {\n // also try the other option\n bitsDifference = FormatInformation.numBitsDiffering(maskedFormatInfo2, targetInfo);\n if (bitsDifference < bestDifference) {\n bestFormatInfo = decodeInfo[1];\n bestDifference = bitsDifference;\n }\n }\n }\n // Hamming distance of the 32 masked codes is 7, by construction, so <= 3 bits\n // differing means we found a match\n if (bestDifference <= 3) {\n return new FormatInformation(bestFormatInfo);\n }\n return null;\n }\n getErrorCorrectionLevel() {\n return this.errorCorrectionLevel;\n }\n getDataMask() {\n return this.dataMask;\n }\n /*@Override*/\n hashCode() {\n return (this.errorCorrectionLevel.getBits() << 3) | this.dataMask;\n }\n /*@Override*/\n equals(o) {\n if (!(o instanceof FormatInformation)) {\n return false;\n }\n const other = o;\n return this.errorCorrectionLevel === other.errorCorrectionLevel &&\n this.dataMask === other.dataMask;\n }\n }\n FormatInformation.FORMAT_INFO_MASK_QR = 0x5412;\n /**\n * See ISO 18004:2006, Annex C, Table C.1\n */\n FormatInformation.FORMAT_INFO_DECODE_LOOKUP = [\n Int32Array.from([0x5412, 0x00]),\n Int32Array.from([0x5125, 0x01]),\n Int32Array.from([0x5E7C, 0x02]),\n Int32Array.from([0x5B4B, 0x03]),\n Int32Array.from([0x45F9, 0x04]),\n Int32Array.from([0x40CE, 0x05]),\n Int32Array.from([0x4F97, 0x06]),\n Int32Array.from([0x4AA0, 0x07]),\n Int32Array.from([0x77C4, 0x08]),\n Int32Array.from([0x72F3, 0x09]),\n Int32Array.from([0x7DAA, 0x0A]),\n Int32Array.from([0x789D, 0x0B]),\n Int32Array.from([0x662F, 0x0C]),\n Int32Array.from([0x6318, 0x0D]),\n Int32Array.from([0x6C41, 0x0E]),\n Int32Array.from([0x6976, 0x0F]),\n Int32Array.from([0x1689, 0x10]),\n Int32Array.from([0x13BE, 0x11]),\n Int32Array.from([0x1CE7, 0x12]),\n Int32Array.from([0x19D0, 0x13]),\n Int32Array.from([0x0762, 0x14]),\n Int32Array.from([0x0255, 0x15]),\n Int32Array.from([0x0D0C, 0x16]),\n Int32Array.from([0x083B, 0x17]),\n Int32Array.from([0x355F, 0x18]),\n Int32Array.from([0x3068, 0x19]),\n Int32Array.from([0x3F31, 0x1A]),\n Int32Array.from([0x3A06, 0x1B]),\n Int32Array.from([0x24B4, 0x1C]),\n Int32Array.from([0x2183, 0x1D]),\n Int32Array.from([0x2EDA, 0x1E]),\n Int32Array.from([0x2BED, 0x1F]),\n ];\n\n /**\n *Encapsulates a set of error-correction blocks in one symbol version. Most versions will\n * use blocks of differing sizes within one version, so, this encapsulates the parameters for\n * each set of blocks. It also holds the number of error-correction codewords per block since it\n * will be the same across all blocks within one version.
\n */\n class ECBlocks$1 {\n constructor(ecCodewordsPerBlock /*int*/, ...ecBlocks) {\n this.ecCodewordsPerBlock = ecCodewordsPerBlock;\n this.ecBlocks = ecBlocks;\n }\n getECCodewordsPerBlock() {\n return this.ecCodewordsPerBlock;\n }\n getNumBlocks() {\n let total = 0;\n const ecBlocks = this.ecBlocks;\n for (const ecBlock of ecBlocks) {\n total += ecBlock.getCount();\n }\n return total;\n }\n getTotalECCodewords() {\n return this.ecCodewordsPerBlock * this.getNumBlocks();\n }\n getECBlocks() {\n return this.ecBlocks;\n }\n }\n\n /**\n *Encapsulates the parameters for one error-correction block in one symbol version.\n * This includes the number of data codewords, and the number of times a block with these\n * parameters is used consecutively in the QR code version's format.
\n */\n class ECB$1 {\n constructor(count /*int*/, dataCodewords /*int*/) {\n this.count = count;\n this.dataCodewords = dataCodewords;\n }\n getCount() {\n return this.count;\n }\n getDataCodewords() {\n return this.dataCodewords;\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n * See ISO 18004:2006 Annex D\n *\n * @author Sean Owen\n */\n class Version$1 {\n constructor(versionNumber /*int*/, alignmentPatternCenters, ...ecBlocks) {\n this.versionNumber = versionNumber;\n this.alignmentPatternCenters = alignmentPatternCenters;\n this.ecBlocks = ecBlocks;\n let total = 0;\n const ecCodewords = ecBlocks[0].getECCodewordsPerBlock();\n const ecbArray = ecBlocks[0].getECBlocks();\n for (const ecBlock of ecbArray) {\n total += ecBlock.getCount() * (ecBlock.getDataCodewords() + ecCodewords);\n }\n this.totalCodewords = total;\n }\n getVersionNumber() {\n return this.versionNumber;\n }\n getAlignmentPatternCenters() {\n return this.alignmentPatternCenters;\n }\n getTotalCodewords() {\n return this.totalCodewords;\n }\n getDimensionForVersion() {\n return 17 + 4 * this.versionNumber;\n }\n getECBlocksForLevel(ecLevel) {\n return this.ecBlocks[ecLevel.getValue()];\n // TYPESCRIPTPORT: original was using ordinal, and using the order of levels as defined in ErrorCorrectionLevel enum (LMQH)\n // I will use the direct value from ErrorCorrectionLevelValues enum which in typescript goes to a number\n }\n /**\n *Deduces version information purely from QR Code dimensions.
\n *\n * @param dimension dimension in modules\n * @return Version for a QR Code of that dimension\n * @throws FormatException if dimension is not 1 mod 4\n */\n static getProvisionalVersionForDimension(dimension /*int*/) {\n if (dimension % 4 !== 1) {\n throw new FormatException();\n }\n try {\n return this.getVersionForNumber((dimension - 17) / 4);\n }\n catch (ignored /*: IllegalArgumentException*/) {\n throw new FormatException();\n }\n }\n static getVersionForNumber(versionNumber /*int*/) {\n if (versionNumber < 1 || versionNumber > 40) {\n throw new IllegalArgumentException();\n }\n return Version$1.VERSIONS[versionNumber - 1];\n }\n static decodeVersionInformation(versionBits /*int*/) {\n let bestDifference = Number.MAX_SAFE_INTEGER;\n let bestVersion = 0;\n for (let i = 0; i < Version$1.VERSION_DECODE_INFO.length; i++) {\n const targetVersion = Version$1.VERSION_DECODE_INFO[i];\n // Do the version info bits match exactly? done.\n if (targetVersion === versionBits) {\n return Version$1.getVersionForNumber(i + 7);\n }\n // Otherwise see if this is the closest to a real version info bit string\n // we have seen so far\n const bitsDifference = FormatInformation.numBitsDiffering(versionBits, targetVersion);\n if (bitsDifference < bestDifference) {\n bestVersion = i + 7;\n bestDifference = bitsDifference;\n }\n }\n // We can tolerate up to 3 bits of error since no two version info codewords will\n // differ in less than 8 bits.\n if (bestDifference <= 3) {\n return Version$1.getVersionForNumber(bestVersion);\n }\n // If we didn't find a close enough match, fail\n return null;\n }\n /**\n * See ISO 18004:2006 Annex E\n */\n buildFunctionPattern() {\n const dimension = this.getDimensionForVersion();\n const bitMatrix = new BitMatrix(dimension);\n // Top left finder pattern + separator + format\n bitMatrix.setRegion(0, 0, 9, 9);\n // Top right finder pattern + separator + format\n bitMatrix.setRegion(dimension - 8, 0, 8, 9);\n // Bottom left finder pattern + separator + format\n bitMatrix.setRegion(0, dimension - 8, 9, 8);\n // Alignment patterns\n const max = this.alignmentPatternCenters.length;\n for (let x = 0; x < max; x++) {\n const i = this.alignmentPatternCenters[x] - 2;\n for (let y = 0; y < max; y++) {\n if ((x === 0 && (y === 0 || y === max - 1)) || (x === max - 1 && y === 0)) {\n // No alignment patterns near the three finder patterns\n continue;\n }\n bitMatrix.setRegion(this.alignmentPatternCenters[y] - 2, i, 5, 5);\n }\n }\n // Vertical timing pattern\n bitMatrix.setRegion(6, 9, 1, dimension - 17);\n // Horizontal timing pattern\n bitMatrix.setRegion(9, 6, dimension - 17, 1);\n if (this.versionNumber > 6) {\n // Version info, top right\n bitMatrix.setRegion(dimension - 11, 0, 3, 6);\n // Version info, bottom left\n bitMatrix.setRegion(0, dimension - 11, 6, 3);\n }\n return bitMatrix;\n }\n /*@Override*/\n toString() {\n return '' + this.versionNumber;\n }\n }\n /**\n * See ISO 18004:2006 Annex D.\n * Element i represents the raw version bits that specify version i + 7\n */\n Version$1.VERSION_DECODE_INFO = Int32Array.from([\n 0x07C94, 0x085BC, 0x09A99, 0x0A4D3, 0x0BBF6,\n 0x0C762, 0x0D847, 0x0E60D, 0x0F928, 0x10B78,\n 0x1145D, 0x12A17, 0x13532, 0x149A6, 0x15683,\n 0x168C9, 0x177EC, 0x18EC4, 0x191E1, 0x1AFAB,\n 0x1B08E, 0x1CC1A, 0x1D33F, 0x1ED75, 0x1F250,\n 0x209D5, 0x216F0, 0x228BA, 0x2379F, 0x24B0B,\n 0x2542E, 0x26A64, 0x27541, 0x28C69\n ]);\n /**\n * See ISO 18004:2006 6.5.1 Table 9\n */\n Version$1.VERSIONS = [\n new Version$1(1, new Int32Array(0), new ECBlocks$1(7, new ECB$1(1, 19)), new ECBlocks$1(10, new ECB$1(1, 16)), new ECBlocks$1(13, new ECB$1(1, 13)), new ECBlocks$1(17, new ECB$1(1, 9))),\n new Version$1(2, Int32Array.from([6, 18]), new ECBlocks$1(10, new ECB$1(1, 34)), new ECBlocks$1(16, new ECB$1(1, 28)), new ECBlocks$1(22, new ECB$1(1, 22)), new ECBlocks$1(28, new ECB$1(1, 16))),\n new Version$1(3, Int32Array.from([6, 22]), new ECBlocks$1(15, new ECB$1(1, 55)), new ECBlocks$1(26, new ECB$1(1, 44)), new ECBlocks$1(18, new ECB$1(2, 17)), new ECBlocks$1(22, new ECB$1(2, 13))),\n new Version$1(4, Int32Array.from([6, 26]), new ECBlocks$1(20, new ECB$1(1, 80)), new ECBlocks$1(18, new ECB$1(2, 32)), new ECBlocks$1(26, new ECB$1(2, 24)), new ECBlocks$1(16, new ECB$1(4, 9))),\n new Version$1(5, Int32Array.from([6, 30]), new ECBlocks$1(26, new ECB$1(1, 108)), new ECBlocks$1(24, new ECB$1(2, 43)), new ECBlocks$1(18, new ECB$1(2, 15), new ECB$1(2, 16)), new ECBlocks$1(22, new ECB$1(2, 11), new ECB$1(2, 12))),\n new Version$1(6, Int32Array.from([6, 34]), new ECBlocks$1(18, new ECB$1(2, 68)), new ECBlocks$1(16, new ECB$1(4, 27)), new ECBlocks$1(24, new ECB$1(4, 19)), new ECBlocks$1(28, new ECB$1(4, 15))),\n new Version$1(7, Int32Array.from([6, 22, 38]), new ECBlocks$1(20, new ECB$1(2, 78)), new ECBlocks$1(18, new ECB$1(4, 31)), new ECBlocks$1(18, new ECB$1(2, 14), new ECB$1(4, 15)), new ECBlocks$1(26, new ECB$1(4, 13), new ECB$1(1, 14))),\n new Version$1(8, Int32Array.from([6, 24, 42]), new ECBlocks$1(24, new ECB$1(2, 97)), new ECBlocks$1(22, new ECB$1(2, 38), new ECB$1(2, 39)), new ECBlocks$1(22, new ECB$1(4, 18), new ECB$1(2, 19)), new ECBlocks$1(26, new ECB$1(4, 14), new ECB$1(2, 15))),\n new Version$1(9, Int32Array.from([6, 26, 46]), new ECBlocks$1(30, new ECB$1(2, 116)), new ECBlocks$1(22, new ECB$1(3, 36), new ECB$1(2, 37)), new ECBlocks$1(20, new ECB$1(4, 16), new ECB$1(4, 17)), new ECBlocks$1(24, new ECB$1(4, 12), new ECB$1(4, 13))),\n new Version$1(10, Int32Array.from([6, 28, 50]), new ECBlocks$1(18, new ECB$1(2, 68), new ECB$1(2, 69)), new ECBlocks$1(26, new ECB$1(4, 43), new ECB$1(1, 44)), new ECBlocks$1(24, new ECB$1(6, 19), new ECB$1(2, 20)), new ECBlocks$1(28, new ECB$1(6, 15), new ECB$1(2, 16))),\n new Version$1(11, Int32Array.from([6, 30, 54]), new ECBlocks$1(20, new ECB$1(4, 81)), new ECBlocks$1(30, new ECB$1(1, 50), new ECB$1(4, 51)), new ECBlocks$1(28, new ECB$1(4, 22), new ECB$1(4, 23)), new ECBlocks$1(24, new ECB$1(3, 12), new ECB$1(8, 13))),\n new Version$1(12, Int32Array.from([6, 32, 58]), new ECBlocks$1(24, new ECB$1(2, 92), new ECB$1(2, 93)), new ECBlocks$1(22, new ECB$1(6, 36), new ECB$1(2, 37)), new ECBlocks$1(26, new ECB$1(4, 20), new ECB$1(6, 21)), new ECBlocks$1(28, new ECB$1(7, 14), new ECB$1(4, 15))),\n new Version$1(13, Int32Array.from([6, 34, 62]), new ECBlocks$1(26, new ECB$1(4, 107)), new ECBlocks$1(22, new ECB$1(8, 37), new ECB$1(1, 38)), new ECBlocks$1(24, new ECB$1(8, 20), new ECB$1(4, 21)), new ECBlocks$1(22, new ECB$1(12, 11), new ECB$1(4, 12))),\n new Version$1(14, Int32Array.from([6, 26, 46, 66]), new ECBlocks$1(30, new ECB$1(3, 115), new ECB$1(1, 116)), new ECBlocks$1(24, new ECB$1(4, 40), new ECB$1(5, 41)), new ECBlocks$1(20, new ECB$1(11, 16), new ECB$1(5, 17)), new ECBlocks$1(24, new ECB$1(11, 12), new ECB$1(5, 13))),\n new Version$1(15, Int32Array.from([6, 26, 48, 70]), new ECBlocks$1(22, new ECB$1(5, 87), new ECB$1(1, 88)), new ECBlocks$1(24, new ECB$1(5, 41), new ECB$1(5, 42)), new ECBlocks$1(30, new ECB$1(5, 24), new ECB$1(7, 25)), new ECBlocks$1(24, new ECB$1(11, 12), new ECB$1(7, 13))),\n new Version$1(16, Int32Array.from([6, 26, 50, 74]), new ECBlocks$1(24, new ECB$1(5, 98), new ECB$1(1, 99)), new ECBlocks$1(28, new ECB$1(7, 45), new ECB$1(3, 46)), new ECBlocks$1(24, new ECB$1(15, 19), new ECB$1(2, 20)), new ECBlocks$1(30, new ECB$1(3, 15), new ECB$1(13, 16))),\n new Version$1(17, Int32Array.from([6, 30, 54, 78]), new ECBlocks$1(28, new ECB$1(1, 107), new ECB$1(5, 108)), new ECBlocks$1(28, new ECB$1(10, 46), new ECB$1(1, 47)), new ECBlocks$1(28, new ECB$1(1, 22), new ECB$1(15, 23)), new ECBlocks$1(28, new ECB$1(2, 14), new ECB$1(17, 15))),\n new Version$1(18, Int32Array.from([6, 30, 56, 82]), new ECBlocks$1(30, new ECB$1(5, 120), new ECB$1(1, 121)), new ECBlocks$1(26, new ECB$1(9, 43), new ECB$1(4, 44)), new ECBlocks$1(28, new ECB$1(17, 22), new ECB$1(1, 23)), new ECBlocks$1(28, new ECB$1(2, 14), new ECB$1(19, 15))),\n new Version$1(19, Int32Array.from([6, 30, 58, 86]), new ECBlocks$1(28, new ECB$1(3, 113), new ECB$1(4, 114)), new ECBlocks$1(26, new ECB$1(3, 44), new ECB$1(11, 45)), new ECBlocks$1(26, new ECB$1(17, 21), new ECB$1(4, 22)), new ECBlocks$1(26, new ECB$1(9, 13), new ECB$1(16, 14))),\n new Version$1(20, Int32Array.from([6, 34, 62, 90]), new ECBlocks$1(28, new ECB$1(3, 107), new ECB$1(5, 108)), new ECBlocks$1(26, new ECB$1(3, 41), new ECB$1(13, 42)), new ECBlocks$1(30, new ECB$1(15, 24), new ECB$1(5, 25)), new ECBlocks$1(28, new ECB$1(15, 15), new ECB$1(10, 16))),\n new Version$1(21, Int32Array.from([6, 28, 50, 72, 94]), new ECBlocks$1(28, new ECB$1(4, 116), new ECB$1(4, 117)), new ECBlocks$1(26, new ECB$1(17, 42)), new ECBlocks$1(28, new ECB$1(17, 22), new ECB$1(6, 23)), new ECBlocks$1(30, new ECB$1(19, 16), new ECB$1(6, 17))),\n new Version$1(22, Int32Array.from([6, 26, 50, 74, 98]), new ECBlocks$1(28, new ECB$1(2, 111), new ECB$1(7, 112)), new ECBlocks$1(28, new ECB$1(17, 46)), new ECBlocks$1(30, new ECB$1(7, 24), new ECB$1(16, 25)), new ECBlocks$1(24, new ECB$1(34, 13))),\n new Version$1(23, Int32Array.from([6, 30, 54, 78, 102]), new ECBlocks$1(30, new ECB$1(4, 121), new ECB$1(5, 122)), new ECBlocks$1(28, new ECB$1(4, 47), new ECB$1(14, 48)), new ECBlocks$1(30, new ECB$1(11, 24), new ECB$1(14, 25)), new ECBlocks$1(30, new ECB$1(16, 15), new ECB$1(14, 16))),\n new Version$1(24, Int32Array.from([6, 28, 54, 80, 106]), new ECBlocks$1(30, new ECB$1(6, 117), new ECB$1(4, 118)), new ECBlocks$1(28, new ECB$1(6, 45), new ECB$1(14, 46)), new ECBlocks$1(30, new ECB$1(11, 24), new ECB$1(16, 25)), new ECBlocks$1(30, new ECB$1(30, 16), new ECB$1(2, 17))),\n new Version$1(25, Int32Array.from([6, 32, 58, 84, 110]), new ECBlocks$1(26, new ECB$1(8, 106), new ECB$1(4, 107)), new ECBlocks$1(28, new ECB$1(8, 47), new ECB$1(13, 48)), new ECBlocks$1(30, new ECB$1(7, 24), new ECB$1(22, 25)), new ECBlocks$1(30, new ECB$1(22, 15), new ECB$1(13, 16))),\n new Version$1(26, Int32Array.from([6, 30, 58, 86, 114]), new ECBlocks$1(28, new ECB$1(10, 114), new ECB$1(2, 115)), new ECBlocks$1(28, new ECB$1(19, 46), new ECB$1(4, 47)), new ECBlocks$1(28, new ECB$1(28, 22), new ECB$1(6, 23)), new ECBlocks$1(30, new ECB$1(33, 16), new ECB$1(4, 17))),\n new Version$1(27, Int32Array.from([6, 34, 62, 90, 118]), new ECBlocks$1(30, new ECB$1(8, 122), new ECB$1(4, 123)), new ECBlocks$1(28, new ECB$1(22, 45), new ECB$1(3, 46)), new ECBlocks$1(30, new ECB$1(8, 23), new ECB$1(26, 24)), new ECBlocks$1(30, new ECB$1(12, 15), new ECB$1(28, 16))),\n new Version$1(28, Int32Array.from([6, 26, 50, 74, 98, 122]), new ECBlocks$1(30, new ECB$1(3, 117), new ECB$1(10, 118)), new ECBlocks$1(28, new ECB$1(3, 45), new ECB$1(23, 46)), new ECBlocks$1(30, new ECB$1(4, 24), new ECB$1(31, 25)), new ECBlocks$1(30, new ECB$1(11, 15), new ECB$1(31, 16))),\n new Version$1(29, Int32Array.from([6, 30, 54, 78, 102, 126]), new ECBlocks$1(30, new ECB$1(7, 116), new ECB$1(7, 117)), new ECBlocks$1(28, new ECB$1(21, 45), new ECB$1(7, 46)), new ECBlocks$1(30, new ECB$1(1, 23), new ECB$1(37, 24)), new ECBlocks$1(30, new ECB$1(19, 15), new ECB$1(26, 16))),\n new Version$1(30, Int32Array.from([6, 26, 52, 78, 104, 130]), new ECBlocks$1(30, new ECB$1(5, 115), new ECB$1(10, 116)), new ECBlocks$1(28, new ECB$1(19, 47), new ECB$1(10, 48)), new ECBlocks$1(30, new ECB$1(15, 24), new ECB$1(25, 25)), new ECBlocks$1(30, new ECB$1(23, 15), new ECB$1(25, 16))),\n new Version$1(31, Int32Array.from([6, 30, 56, 82, 108, 134]), new ECBlocks$1(30, new ECB$1(13, 115), new ECB$1(3, 116)), new ECBlocks$1(28, new ECB$1(2, 46), new ECB$1(29, 47)), new ECBlocks$1(30, new ECB$1(42, 24), new ECB$1(1, 25)), new ECBlocks$1(30, new ECB$1(23, 15), new ECB$1(28, 16))),\n new Version$1(32, Int32Array.from([6, 34, 60, 86, 112, 138]), new ECBlocks$1(30, new ECB$1(17, 115)), new ECBlocks$1(28, new ECB$1(10, 46), new ECB$1(23, 47)), new ECBlocks$1(30, new ECB$1(10, 24), new ECB$1(35, 25)), new ECBlocks$1(30, new ECB$1(19, 15), new ECB$1(35, 16))),\n new Version$1(33, Int32Array.from([6, 30, 58, 86, 114, 142]), new ECBlocks$1(30, new ECB$1(17, 115), new ECB$1(1, 116)), new ECBlocks$1(28, new ECB$1(14, 46), new ECB$1(21, 47)), new ECBlocks$1(30, new ECB$1(29, 24), new ECB$1(19, 25)), new ECBlocks$1(30, new ECB$1(11, 15), new ECB$1(46, 16))),\n new Version$1(34, Int32Array.from([6, 34, 62, 90, 118, 146]), new ECBlocks$1(30, new ECB$1(13, 115), new ECB$1(6, 116)), new ECBlocks$1(28, new ECB$1(14, 46), new ECB$1(23, 47)), new ECBlocks$1(30, new ECB$1(44, 24), new ECB$1(7, 25)), new ECBlocks$1(30, new ECB$1(59, 16), new ECB$1(1, 17))),\n new Version$1(35, Int32Array.from([6, 30, 54, 78, 102, 126, 150]), new ECBlocks$1(30, new ECB$1(12, 121), new ECB$1(7, 122)), new ECBlocks$1(28, new ECB$1(12, 47), new ECB$1(26, 48)), new ECBlocks$1(30, new ECB$1(39, 24), new ECB$1(14, 25)), new ECBlocks$1(30, new ECB$1(22, 15), new ECB$1(41, 16))),\n new Version$1(36, Int32Array.from([6, 24, 50, 76, 102, 128, 154]), new ECBlocks$1(30, new ECB$1(6, 121), new ECB$1(14, 122)), new ECBlocks$1(28, new ECB$1(6, 47), new ECB$1(34, 48)), new ECBlocks$1(30, new ECB$1(46, 24), new ECB$1(10, 25)), new ECBlocks$1(30, new ECB$1(2, 15), new ECB$1(64, 16))),\n new Version$1(37, Int32Array.from([6, 28, 54, 80, 106, 132, 158]), new ECBlocks$1(30, new ECB$1(17, 122), new ECB$1(4, 123)), new ECBlocks$1(28, new ECB$1(29, 46), new ECB$1(14, 47)), new ECBlocks$1(30, new ECB$1(49, 24), new ECB$1(10, 25)), new ECBlocks$1(30, new ECB$1(24, 15), new ECB$1(46, 16))),\n new Version$1(38, Int32Array.from([6, 32, 58, 84, 110, 136, 162]), new ECBlocks$1(30, new ECB$1(4, 122), new ECB$1(18, 123)), new ECBlocks$1(28, new ECB$1(13, 46), new ECB$1(32, 47)), new ECBlocks$1(30, new ECB$1(48, 24), new ECB$1(14, 25)), new ECBlocks$1(30, new ECB$1(42, 15), new ECB$1(32, 16))),\n new Version$1(39, Int32Array.from([6, 26, 54, 82, 110, 138, 166]), new ECBlocks$1(30, new ECB$1(20, 117), new ECB$1(4, 118)), new ECBlocks$1(28, new ECB$1(40, 47), new ECB$1(7, 48)), new ECBlocks$1(30, new ECB$1(43, 24), new ECB$1(22, 25)), new ECBlocks$1(30, new ECB$1(10, 15), new ECB$1(67, 16))),\n new Version$1(40, Int32Array.from([6, 30, 58, 86, 114, 142, 170]), new ECBlocks$1(30, new ECB$1(19, 118), new ECB$1(6, 119)), new ECBlocks$1(28, new ECB$1(18, 47), new ECB$1(31, 48)), new ECBlocks$1(30, new ECB$1(34, 24), new ECB$1(34, 25)), new ECBlocks$1(30, new ECB$1(20, 15), new ECB$1(61, 16)))\n ];\n\n /*\n * Copyright 2007 ZXing authors\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 var DataMaskValues;\n (function (DataMaskValues) {\n DataMaskValues[DataMaskValues[\"DATA_MASK_000\"] = 0] = \"DATA_MASK_000\";\n DataMaskValues[DataMaskValues[\"DATA_MASK_001\"] = 1] = \"DATA_MASK_001\";\n DataMaskValues[DataMaskValues[\"DATA_MASK_010\"] = 2] = \"DATA_MASK_010\";\n DataMaskValues[DataMaskValues[\"DATA_MASK_011\"] = 3] = \"DATA_MASK_011\";\n DataMaskValues[DataMaskValues[\"DATA_MASK_100\"] = 4] = \"DATA_MASK_100\";\n DataMaskValues[DataMaskValues[\"DATA_MASK_101\"] = 5] = \"DATA_MASK_101\";\n DataMaskValues[DataMaskValues[\"DATA_MASK_110\"] = 6] = \"DATA_MASK_110\";\n DataMaskValues[DataMaskValues[\"DATA_MASK_111\"] = 7] = \"DATA_MASK_111\";\n })(DataMaskValues || (DataMaskValues = {}));\n /**\n *Encapsulates data masks for the data bits in a QR code, per ISO 18004:2006 6.8. Implementations\n * of this class can un-mask a raw BitMatrix. For simplicity, they will unmask the entire BitMatrix,\n * including areas used for finder patterns, timing patterns, etc. These areas should be unused\n * after the point they are unmasked anyway.
\n *\n *Note that the diagram in section 6.8.1 is misleading since it indicates that i is column position\n * and j is row position. In fact, as the text says, i is row position and j is column position.
\n *\n * @author Sean Owen\n */\n class DataMask {\n // See ISO 18004:2006 6.8.1\n constructor(value, isMasked) {\n this.value = value;\n this.isMasked = isMasked;\n }\n // End of enum constants.\n /**\n *Implementations of this method reverse the data masking process applied to a QR Code and\n * make its bits ready to read.
\n *\n * @param bits representation of QR Code bits\n * @param dimension dimension of QR Code, represented by bits, being unmasked\n */\n unmaskBitMatrix(bits, dimension /*int*/) {\n for (let i = 0; i < dimension; i++) {\n for (let j = 0; j < dimension; j++) {\n if (this.isMasked(i, j)) {\n bits.flip(j, i);\n }\n }\n }\n }\n }\n DataMask.values = new Map([\n /**\n * 000: mask bits for which (x + y) mod 2 == 0\n */\n [DataMaskValues.DATA_MASK_000, new DataMask(DataMaskValues.DATA_MASK_000, (i /*int*/, j /*int*/) => { return ((i + j) & 0x01) === 0; })],\n /**\n * 001: mask bits for which x mod 2 == 0\n */\n [DataMaskValues.DATA_MASK_001, new DataMask(DataMaskValues.DATA_MASK_001, (i /*int*/, j /*int*/) => { return (i & 0x01) === 0; })],\n /**\n * 010: mask bits for which y mod 3 == 0\n */\n [DataMaskValues.DATA_MASK_010, new DataMask(DataMaskValues.DATA_MASK_010, (i /*int*/, j /*int*/) => { return j % 3 === 0; })],\n /**\n * 011: mask bits for which (x + y) mod 3 == 0\n */\n [DataMaskValues.DATA_MASK_011, new DataMask(DataMaskValues.DATA_MASK_011, (i /*int*/, j /*int*/) => { return (i + j) % 3 === 0; })],\n /**\n * 100: mask bits for which (x/2 + y/3) mod 2 == 0\n */\n [DataMaskValues.DATA_MASK_100, new DataMask(DataMaskValues.DATA_MASK_100, (i /*int*/, j /*int*/) => { return ((Math.floor(i / 2) + Math.floor(j / 3)) & 0x01) === 0; })],\n /**\n * 101: mask bits for which xy mod 2 + xy mod 3 == 0\n * equivalently, such that xy mod 6 == 0\n */\n [DataMaskValues.DATA_MASK_101, new DataMask(DataMaskValues.DATA_MASK_101, (i /*int*/, j /*int*/) => { return (i * j) % 6 === 0; })],\n /**\n * 110: mask bits for which (xy mod 2 + xy mod 3) mod 2 == 0\n * equivalently, such that xy mod 6 < 3\n */\n [DataMaskValues.DATA_MASK_110, new DataMask(DataMaskValues.DATA_MASK_110, (i /*int*/, j /*int*/) => { return ((i * j) % 6) < 3; })],\n /**\n * 111: mask bits for which ((x+y)mod 2 + xy mod 3) mod 2 == 0\n * equivalently, such that (x + y + xy mod 3) mod 2 == 0\n */\n [DataMaskValues.DATA_MASK_111, new DataMask(DataMaskValues.DATA_MASK_111, (i /*int*/, j /*int*/) => { return ((i + j + ((i * j) % 3)) & 0x01) === 0; })],\n ]);\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n * @author Sean Owen\n */\n class BitMatrixParser$1 {\n /**\n * @param bitMatrix {@link BitMatrix} to parse\n * @throws FormatException if dimension is not >= 21 and 1 mod 4\n */\n constructor(bitMatrix) {\n const dimension = bitMatrix.getHeight();\n if (dimension < 21 || (dimension & 0x03) !== 1) {\n throw new FormatException();\n }\n this.bitMatrix = bitMatrix;\n }\n /**\n *Reads format information from one of its two locations within the QR Code.
\n *\n * @return {@link FormatInformation} encapsulating the QR Code's format info\n * @throws FormatException if both format information locations cannot be parsed as\n * the valid encoding of format information\n */\n readFormatInformation() {\n if (this.parsedFormatInfo !== null && this.parsedFormatInfo !== undefined) {\n return this.parsedFormatInfo;\n }\n // Read top-left format info bits\n let formatInfoBits1 = 0;\n for (let i = 0; i < 6; i++) {\n formatInfoBits1 = this.copyBit(i, 8, formatInfoBits1);\n }\n // .. and skip a bit in the timing pattern ...\n formatInfoBits1 = this.copyBit(7, 8, formatInfoBits1);\n formatInfoBits1 = this.copyBit(8, 8, formatInfoBits1);\n formatInfoBits1 = this.copyBit(8, 7, formatInfoBits1);\n // .. and skip a bit in the timing pattern ...\n for (let j = 5; j >= 0; j--) {\n formatInfoBits1 = this.copyBit(8, j, formatInfoBits1);\n }\n // Read the top-right/bottom-left pattern too\n const dimension = this.bitMatrix.getHeight();\n let formatInfoBits2 = 0;\n const jMin = dimension - 7;\n for (let j = dimension - 1; j >= jMin; j--) {\n formatInfoBits2 = this.copyBit(8, j, formatInfoBits2);\n }\n for (let i = dimension - 8; i < dimension; i++) {\n formatInfoBits2 = this.copyBit(i, 8, formatInfoBits2);\n }\n this.parsedFormatInfo = FormatInformation.decodeFormatInformation(formatInfoBits1, formatInfoBits2);\n if (this.parsedFormatInfo !== null) {\n return this.parsedFormatInfo;\n }\n throw new FormatException();\n }\n /**\n *Reads version information from one of its two locations within the QR Code.
\n *\n * @return {@link Version} encapsulating the QR Code's version\n * @throws FormatException if both version information locations cannot be parsed as\n * the valid encoding of version information\n */\n readVersion() {\n if (this.parsedVersion !== null && this.parsedVersion !== undefined) {\n return this.parsedVersion;\n }\n const dimension = this.bitMatrix.getHeight();\n const provisionalVersion = Math.floor((dimension - 17) / 4);\n if (provisionalVersion <= 6) {\n return Version$1.getVersionForNumber(provisionalVersion);\n }\n // Read top-right version info: 3 wide by 6 tall\n let versionBits = 0;\n const ijMin = dimension - 11;\n for (let j = 5; j >= 0; j--) {\n for (let i = dimension - 9; i >= ijMin; i--) {\n versionBits = this.copyBit(i, j, versionBits);\n }\n }\n let theParsedVersion = Version$1.decodeVersionInformation(versionBits);\n if (theParsedVersion !== null && theParsedVersion.getDimensionForVersion() === dimension) {\n this.parsedVersion = theParsedVersion;\n return theParsedVersion;\n }\n // Hmm, failed. Try bottom left: 6 wide by 3 tall\n versionBits = 0;\n for (let i = 5; i >= 0; i--) {\n for (let j = dimension - 9; j >= ijMin; j--) {\n versionBits = this.copyBit(i, j, versionBits);\n }\n }\n theParsedVersion = Version$1.decodeVersionInformation(versionBits);\n if (theParsedVersion !== null && theParsedVersion.getDimensionForVersion() === dimension) {\n this.parsedVersion = theParsedVersion;\n return theParsedVersion;\n }\n throw new FormatException();\n }\n copyBit(i /*int*/, j /*int*/, versionBits /*int*/) {\n const bit = this.isMirror ? this.bitMatrix.get(j, i) : this.bitMatrix.get(i, j);\n return bit ? (versionBits << 1) | 0x1 : versionBits << 1;\n }\n /**\n *Reads the bits in the {@link BitMatrix} representing the finder pattern in the\n * correct order in order to reconstruct the codewords bytes contained within the\n * QR Code.
\n *\n * @return bytes encoded within the QR Code\n * @throws FormatException if the exact number of bytes expected is not read\n */\n readCodewords() {\n const formatInfo = this.readFormatInformation();\n const version = this.readVersion();\n // Get the data mask for the format used in this QR Code. This will exclude\n // some bits from reading as we wind through the bit matrix.\n const dataMask = DataMask.values.get(formatInfo.getDataMask());\n const dimension = this.bitMatrix.getHeight();\n dataMask.unmaskBitMatrix(this.bitMatrix, dimension);\n const functionPattern = version.buildFunctionPattern();\n let readingUp = true;\n const result = new Uint8Array(version.getTotalCodewords());\n let resultOffset = 0;\n let currentByte = 0;\n let bitsRead = 0;\n // Read columns in pairs, from right to left\n for (let j = dimension - 1; j > 0; j -= 2) {\n if (j === 6) {\n // Skip whole column with vertical alignment pattern\n // saves time and makes the other code proceed more cleanly\n j--;\n }\n // Read alternatingly from bottom to top then top to bottom\n for (let count = 0; count < dimension; count++) {\n const i = readingUp ? dimension - 1 - count : count;\n for (let col = 0; col < 2; col++) {\n // Ignore bits covered by the function pattern\n if (!functionPattern.get(j - col, i)) {\n // Read a bit\n bitsRead++;\n currentByte <<= 1;\n if (this.bitMatrix.get(j - col, i)) {\n currentByte |= 1;\n }\n // If we've made a whole byte, save it off\n if (bitsRead === 8) {\n result[resultOffset++] = /*(byte) */ currentByte;\n bitsRead = 0;\n currentByte = 0;\n }\n }\n }\n }\n readingUp = !readingUp; // readingUp ^= true; // readingUp = !readingUp; // switch directions\n }\n if (resultOffset !== version.getTotalCodewords()) {\n throw new FormatException();\n }\n return result;\n }\n /**\n * Revert the mask removal done while reading the code words. The bit matrix should revert to its original state.\n */\n remask() {\n if (this.parsedFormatInfo === null) {\n return; // We have no format information, and have no data mask\n }\n const dataMask = DataMask.values[this.parsedFormatInfo.getDataMask()];\n const dimension = this.bitMatrix.getHeight();\n dataMask.unmaskBitMatrix(this.bitMatrix, dimension);\n }\n /**\n * Prepare the parser for a mirrored operation.\n * This flag has effect only on the {@link #readFormatInformation()} and the\n * {@link #readVersion()}. Before proceeding with {@link #readCodewords()} the\n * {@link #mirror()} method should be called.\n *\n * @param mirror Whether to read version and format information mirrored.\n */\n setMirror(isMirror) {\n this.parsedVersion = null;\n this.parsedFormatInfo = null;\n this.isMirror = isMirror;\n }\n /** Mirror the bit matrix in order to attempt a second reading. */\n mirror() {\n const bitMatrix = this.bitMatrix;\n for (let x = 0, width = bitMatrix.getWidth(); x < width; x++) {\n for (let y = x + 1, height = bitMatrix.getHeight(); y < height; y++) {\n if (bitMatrix.get(x, y) !== bitMatrix.get(y, x)) {\n bitMatrix.flip(y, x);\n bitMatrix.flip(x, y);\n }\n }\n }\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *Encapsulates a block of data within a QR Code. QR Codes may split their data into\n * multiple blocks, each of which is a unit of data and error-correction codewords. Each\n * is represented by an instance of this class.
\n *\n * @author Sean Owen\n */\n class DataBlock$1 {\n constructor(numDataCodewords /*int*/, codewords) {\n this.numDataCodewords = numDataCodewords;\n this.codewords = codewords;\n }\n /**\n *When QR Codes use multiple data blocks, they are actually interleaved.\n * That is, the first byte of data block 1 to n is written, then the second bytes, and so on. This\n * method will separate the data into original blocks.
\n *\n * @param rawCodewords bytes as read directly from the QR Code\n * @param version version of the QR Code\n * @param ecLevel error-correction level of the QR Code\n * @return DataBlocks containing original bytes, \"de-interleaved\" from representation in the\n * QR Code\n */\n static getDataBlocks(rawCodewords, version, ecLevel) {\n if (rawCodewords.length !== version.getTotalCodewords()) {\n throw new IllegalArgumentException();\n }\n // Figure out the number and size of data blocks used by this version and\n // error correction level\n const ecBlocks = version.getECBlocksForLevel(ecLevel);\n // First count the total number of data blocks\n let totalBlocks = 0;\n const ecBlockArray = ecBlocks.getECBlocks();\n for (const ecBlock of ecBlockArray) {\n totalBlocks += ecBlock.getCount();\n }\n // Now establish DataBlocks of the appropriate size and number of data codewords\n const result = new Array(totalBlocks);\n let numResultBlocks = 0;\n for (const ecBlock of ecBlockArray) {\n for (let i = 0; i < ecBlock.getCount(); i++) {\n const numDataCodewords = ecBlock.getDataCodewords();\n const numBlockCodewords = ecBlocks.getECCodewordsPerBlock() + numDataCodewords;\n result[numResultBlocks++] = new DataBlock$1(numDataCodewords, new Uint8Array(numBlockCodewords));\n }\n }\n // All blocks have the same amount of data, except that the last n\n // (where n may be 0) have 1 more byte. Figure out where these start.\n const shorterBlocksTotalCodewords = result[0].codewords.length;\n let longerBlocksStartAt = result.length - 1;\n // TYPESCRIPTPORT: check length is correct here\n while (longerBlocksStartAt >= 0) {\n const numCodewords = result[longerBlocksStartAt].codewords.length;\n if (numCodewords === shorterBlocksTotalCodewords) {\n break;\n }\n longerBlocksStartAt--;\n }\n longerBlocksStartAt++;\n const shorterBlocksNumDataCodewords = shorterBlocksTotalCodewords - ecBlocks.getECCodewordsPerBlock();\n // The last elements of result may be 1 element longer\n // first fill out as many elements as all of them have\n let rawCodewordsOffset = 0;\n for (let i = 0; i < shorterBlocksNumDataCodewords; i++) {\n for (let j = 0; j < numResultBlocks; j++) {\n result[j].codewords[i] = rawCodewords[rawCodewordsOffset++];\n }\n }\n // Fill out the last data block in the longer ones\n for (let j = longerBlocksStartAt; j < numResultBlocks; j++) {\n result[j].codewords[shorterBlocksNumDataCodewords] = rawCodewords[rawCodewordsOffset++];\n }\n // Now add in error correction blocks\n const max = result[0].codewords.length;\n for (let i = shorterBlocksNumDataCodewords; i < max; i++) {\n for (let j = 0; j < numResultBlocks; j++) {\n const iOffset = j < longerBlocksStartAt ? i : i + 1;\n result[j].codewords[iOffset] = rawCodewords[rawCodewordsOffset++];\n }\n }\n return result;\n }\n getNumDataCodewords() {\n return this.numDataCodewords;\n }\n getCodewords() {\n return this.codewords;\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 var ModeValues;\n (function (ModeValues) {\n ModeValues[ModeValues[\"TERMINATOR\"] = 0] = \"TERMINATOR\";\n ModeValues[ModeValues[\"NUMERIC\"] = 1] = \"NUMERIC\";\n ModeValues[ModeValues[\"ALPHANUMERIC\"] = 2] = \"ALPHANUMERIC\";\n ModeValues[ModeValues[\"STRUCTURED_APPEND\"] = 3] = \"STRUCTURED_APPEND\";\n ModeValues[ModeValues[\"BYTE\"] = 4] = \"BYTE\";\n ModeValues[ModeValues[\"ECI\"] = 5] = \"ECI\";\n ModeValues[ModeValues[\"KANJI\"] = 6] = \"KANJI\";\n ModeValues[ModeValues[\"FNC1_FIRST_POSITION\"] = 7] = \"FNC1_FIRST_POSITION\";\n ModeValues[ModeValues[\"FNC1_SECOND_POSITION\"] = 8] = \"FNC1_SECOND_POSITION\";\n /** See GBT 18284-2000; \"Hanzi\" is a transliteration of this mode name. */\n ModeValues[ModeValues[\"HANZI\"] = 9] = \"HANZI\";\n })(ModeValues || (ModeValues = {}));\n /**\n *See ISO 18004:2006, 6.4.1, Tables 2 and 3. This enum encapsulates the various modes in which\n * data can be encoded to bits in the QR code standard.
\n *\n * @author Sean Owen\n */\n class Mode$1 {\n constructor(value, stringValue, characterCountBitsForVersions, bits /*int*/) {\n this.value = value;\n this.stringValue = stringValue;\n this.characterCountBitsForVersions = characterCountBitsForVersions;\n this.bits = bits;\n Mode$1.FOR_BITS.set(bits, this);\n Mode$1.FOR_VALUE.set(value, this);\n }\n /**\n * @param bits four bits encoding a QR Code data mode\n * @return Mode encoded by these bits\n * @throws IllegalArgumentException if bits do not correspond to a known mode\n */\n static forBits(bits /*int*/) {\n const mode = Mode$1.FOR_BITS.get(bits);\n if (undefined === mode) {\n throw new IllegalArgumentException();\n }\n return mode;\n }\n /**\n * @param version version in question\n * @return number of bits used, in this QR Code symbol {@link Version}, to encode the\n * count of characters that will follow encoded in this Mode\n */\n getCharacterCountBits(version) {\n const versionNumber = version.getVersionNumber();\n let offset;\n if (versionNumber <= 9) {\n offset = 0;\n }\n else if (versionNumber <= 26) {\n offset = 1;\n }\n else {\n offset = 2;\n }\n return this.characterCountBitsForVersions[offset];\n }\n getValue() {\n return this.value;\n }\n getBits() {\n return this.bits;\n }\n equals(o) {\n if (!(o instanceof Mode$1)) {\n return false;\n }\n const other = o;\n return this.value === other.value;\n }\n toString() {\n return this.stringValue;\n }\n }\n Mode$1.FOR_BITS = new Map();\n Mode$1.FOR_VALUE = new Map();\n Mode$1.TERMINATOR = new Mode$1(ModeValues.TERMINATOR, 'TERMINATOR', Int32Array.from([0, 0, 0]), 0x00); // Not really a mode...\n Mode$1.NUMERIC = new Mode$1(ModeValues.NUMERIC, 'NUMERIC', Int32Array.from([10, 12, 14]), 0x01);\n Mode$1.ALPHANUMERIC = new Mode$1(ModeValues.ALPHANUMERIC, 'ALPHANUMERIC', Int32Array.from([9, 11, 13]), 0x02);\n Mode$1.STRUCTURED_APPEND = new Mode$1(ModeValues.STRUCTURED_APPEND, 'STRUCTURED_APPEND', Int32Array.from([0, 0, 0]), 0x03); // Not supported\n Mode$1.BYTE = new Mode$1(ModeValues.BYTE, 'BYTE', Int32Array.from([8, 16, 16]), 0x04);\n Mode$1.ECI = new Mode$1(ModeValues.ECI, 'ECI', Int32Array.from([0, 0, 0]), 0x07); // character counts don't apply\n Mode$1.KANJI = new Mode$1(ModeValues.KANJI, 'KANJI', Int32Array.from([8, 10, 12]), 0x08);\n Mode$1.FNC1_FIRST_POSITION = new Mode$1(ModeValues.FNC1_FIRST_POSITION, 'FNC1_FIRST_POSITION', Int32Array.from([0, 0, 0]), 0x05);\n Mode$1.FNC1_SECOND_POSITION = new Mode$1(ModeValues.FNC1_SECOND_POSITION, 'FNC1_SECOND_POSITION', Int32Array.from([0, 0, 0]), 0x09);\n /** See GBT 18284-2000; \"Hanzi\" is a transliteration of this mode name. */\n Mode$1.HANZI = new Mode$1(ModeValues.HANZI, 'HANZI', Int32Array.from([8, 10, 12]), 0x0D);\n\n /*\n * Copyright 2007 ZXing authors\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 /*import java.io.UnsupportedEncodingException;*/\n /*import java.util.ArrayList;*/\n /*import java.util.Collection;*/\n /*import java.util.List;*/\n /*import java.util.Map;*/\n /**\n *QR Codes can encode text as bits in one of several modes, and can use multiple modes\n * in one QR Code. This class decodes the bits back into text.
\n *\n *See ISO 18004:2006, 6.4.3 - 6.4.7
\n *\n * @author Sean Owen\n */\n class DecodedBitStreamParser$1 {\n static decode(bytes, version, ecLevel, hints) {\n const bits = new BitSource(bytes);\n let result = new StringBuilder();\n const byteSegments = new Array(); // 1\n // TYPESCRIPTPORT: I do not use constructor with size 1 as in original Java means capacity and the array length is checked below\n let symbolSequence = -1;\n let parityData = -1;\n try {\n let currentCharacterSetECI = null;\n let fc1InEffect = false;\n let mode;\n do {\n // While still another segment to read...\n if (bits.available() < 4) {\n // OK, assume we're done. Really, a TERMINATOR mode should have been recorded here\n mode = Mode$1.TERMINATOR;\n }\n else {\n const modeBits = bits.readBits(4);\n mode = Mode$1.forBits(modeBits); // mode is encoded by 4 bits\n }\n switch (mode) {\n case Mode$1.TERMINATOR:\n break;\n case Mode$1.FNC1_FIRST_POSITION:\n case Mode$1.FNC1_SECOND_POSITION:\n // We do little with FNC1 except alter the parsed result a bit according to the spec\n fc1InEffect = true;\n break;\n case Mode$1.STRUCTURED_APPEND:\n if (bits.available() < 16) {\n throw new FormatException();\n }\n // sequence number and parity is added later to the result metadata\n // Read next 8 bits (symbol sequence #) and 8 bits (data: parity), then continue\n symbolSequence = bits.readBits(8);\n parityData = bits.readBits(8);\n break;\n case Mode$1.ECI:\n // Count doesn't apply to ECI\n const value = DecodedBitStreamParser$1.parseECIValue(bits);\n currentCharacterSetECI = CharacterSetECI.getCharacterSetECIByValue(value);\n if (currentCharacterSetECI === null) {\n throw new FormatException();\n }\n break;\n case Mode$1.HANZI:\n // First handle Hanzi mode which does not start with character count\n // Chinese mode contains a sub set indicator right after mode indicator\n const subset = bits.readBits(4);\n const countHanzi = bits.readBits(mode.getCharacterCountBits(version));\n if (subset === DecodedBitStreamParser$1.GB2312_SUBSET) {\n DecodedBitStreamParser$1.decodeHanziSegment(bits, result, countHanzi);\n }\n break;\n default:\n // \"Normal\" QR code modes:\n // How many characters will follow, encoded in this mode?\n const count = bits.readBits(mode.getCharacterCountBits(version));\n switch (mode) {\n case Mode$1.NUMERIC:\n DecodedBitStreamParser$1.decodeNumericSegment(bits, result, count);\n break;\n case Mode$1.ALPHANUMERIC:\n DecodedBitStreamParser$1.decodeAlphanumericSegment(bits, result, count, fc1InEffect);\n break;\n case Mode$1.BYTE:\n DecodedBitStreamParser$1.decodeByteSegment(bits, result, count, currentCharacterSetECI, byteSegments, hints);\n break;\n case Mode$1.KANJI:\n DecodedBitStreamParser$1.decodeKanjiSegment(bits, result, count);\n break;\n default:\n throw new FormatException();\n }\n break;\n }\n } while (mode !== Mode$1.TERMINATOR);\n }\n catch (iae /*: IllegalArgumentException*/) {\n // from readBits() calls\n throw new FormatException();\n }\n return new DecoderResult(bytes, result.toString(), byteSegments.length === 0 ? null : byteSegments, ecLevel === null ? null : ecLevel.toString(), symbolSequence, parityData);\n }\n /**\n * See specification GBT 18284-2000\n */\n static decodeHanziSegment(bits, result, count /*int*/) {\n // Don't crash trying to read more bits than we have available.\n if (count * 13 > bits.available()) {\n throw new FormatException();\n }\n // Each character will require 2 bytes. Read the characters as 2-byte pairs\n // and decode as GB2312 afterwards\n const buffer = new Uint8Array(2 * count);\n let offset = 0;\n while (count > 0) {\n // Each 13 bits encodes a 2-byte character\n const twoBytes = bits.readBits(13);\n let assembledTwoBytes = (((twoBytes / 0x060) << 8) & 0xFFFFFFFF) | (twoBytes % 0x060);\n if (assembledTwoBytes < 0x003BF) {\n // In the 0xA1A1 to 0xAAFE range\n assembledTwoBytes += 0x0A1A1;\n }\n else {\n // In the 0xB0A1 to 0xFAFE range\n assembledTwoBytes += 0x0A6A1;\n }\n buffer[offset] = /*(byte) */ ((assembledTwoBytes >> 8) & 0xFF);\n buffer[offset + 1] = /*(byte) */ (assembledTwoBytes & 0xFF);\n offset += 2;\n count--;\n }\n try {\n result.append(StringEncoding.decode(buffer, StringUtils.GB2312));\n // TYPESCRIPTPORT: TODO: implement GB2312 decode. StringView from MDN could be a starting point\n }\n catch (ignored /*: UnsupportedEncodingException*/) {\n throw new FormatException(ignored);\n }\n }\n static decodeKanjiSegment(bits, result, count /*int*/) {\n // Don't crash trying to read more bits than we have available.\n if (count * 13 > bits.available()) {\n throw new FormatException();\n }\n // Each character will require 2 bytes. Read the characters as 2-byte pairs\n // and decode as Shift_JIS afterwards\n const buffer = new Uint8Array(2 * count);\n let offset = 0;\n while (count > 0) {\n // Each 13 bits encodes a 2-byte character\n const twoBytes = bits.readBits(13);\n let assembledTwoBytes = (((twoBytes / 0x0C0) << 8) & 0xFFFFFFFF) | (twoBytes % 0x0C0);\n if (assembledTwoBytes < 0x01F00) {\n // In the 0x8140 to 0x9FFC range\n assembledTwoBytes += 0x08140;\n }\n else {\n // In the 0xE040 to 0xEBBF range\n assembledTwoBytes += 0x0C140;\n }\n buffer[offset] = /*(byte) */ (assembledTwoBytes >> 8);\n buffer[offset + 1] = /*(byte) */ assembledTwoBytes;\n offset += 2;\n count--;\n }\n // Shift_JIS may not be supported in some environments:\n try {\n result.append(StringEncoding.decode(buffer, StringUtils.SHIFT_JIS));\n // TYPESCRIPTPORT: TODO: implement SHIFT_JIS decode. StringView from MDN could be a starting point\n }\n catch (ignored /*: UnsupportedEncodingException*/) {\n throw new FormatException(ignored);\n }\n }\n static decodeByteSegment(bits, result, count /*int*/, currentCharacterSetECI, byteSegments, hints) {\n // Don't crash trying to read more bits than we have available.\n if (8 * count > bits.available()) {\n throw new FormatException();\n }\n const readBytes = new Uint8Array(count);\n for (let i = 0; i < count; i++) {\n readBytes[i] = /*(byte) */ bits.readBits(8);\n }\n let encoding;\n if (currentCharacterSetECI === null) {\n // The spec isn't clear on this mode; see\n // section 6.4.5: t does not say which encoding to assuming\n // upon decoding. I have seen ISO-8859-1 used as well as\n // Shift_JIS -- without anything like an ECI designator to\n // give a hint.\n encoding = StringUtils.guessEncoding(readBytes, hints);\n }\n else {\n encoding = currentCharacterSetECI.getName();\n }\n try {\n result.append(StringEncoding.decode(readBytes, encoding));\n }\n catch (ignored /*: UnsupportedEncodingException*/) {\n throw new FormatException(ignored);\n }\n byteSegments.push(readBytes);\n }\n static toAlphaNumericChar(value /*int*/) {\n if (value >= DecodedBitStreamParser$1.ALPHANUMERIC_CHARS.length) {\n throw new FormatException();\n }\n return DecodedBitStreamParser$1.ALPHANUMERIC_CHARS[value];\n }\n static decodeAlphanumericSegment(bits, result, count /*int*/, fc1InEffect) {\n // Read two characters at a time\n const start = result.length();\n while (count > 1) {\n if (bits.available() < 11) {\n throw new FormatException();\n }\n const nextTwoCharsBits = bits.readBits(11);\n result.append(DecodedBitStreamParser$1.toAlphaNumericChar(Math.floor(nextTwoCharsBits / 45)));\n result.append(DecodedBitStreamParser$1.toAlphaNumericChar(nextTwoCharsBits % 45));\n count -= 2;\n }\n if (count === 1) {\n // special case: one character left\n if (bits.available() < 6) {\n throw new FormatException();\n }\n result.append(DecodedBitStreamParser$1.toAlphaNumericChar(bits.readBits(6)));\n }\n // See section 6.4.8.1, 6.4.8.2\n if (fc1InEffect) {\n // We need to massage the result a bit if in an FNC1 mode:\n for (let i = start; i < result.length(); i++) {\n if (result.charAt(i) === '%') {\n if (i < result.length() - 1 && result.charAt(i + 1) === '%') {\n // %% is rendered as %\n result.deleteCharAt(i + 1);\n }\n else {\n // In alpha mode, % should be converted to FNC1 separator 0x1D\n result.setCharAt(i, String.fromCharCode(0x1D));\n }\n }\n }\n }\n }\n static decodeNumericSegment(bits, result, count /*int*/) {\n // Read three digits at a time\n while (count >= 3) {\n // Each 10 bits encodes three digits\n if (bits.available() < 10) {\n throw new FormatException();\n }\n const threeDigitsBits = bits.readBits(10);\n if (threeDigitsBits >= 1000) {\n throw new FormatException();\n }\n result.append(DecodedBitStreamParser$1.toAlphaNumericChar(Math.floor(threeDigitsBits / 100)));\n result.append(DecodedBitStreamParser$1.toAlphaNumericChar(Math.floor(threeDigitsBits / 10) % 10));\n result.append(DecodedBitStreamParser$1.toAlphaNumericChar(threeDigitsBits % 10));\n count -= 3;\n }\n if (count === 2) {\n // Two digits left over to read, encoded in 7 bits\n if (bits.available() < 7) {\n throw new FormatException();\n }\n const twoDigitsBits = bits.readBits(7);\n if (twoDigitsBits >= 100) {\n throw new FormatException();\n }\n result.append(DecodedBitStreamParser$1.toAlphaNumericChar(Math.floor(twoDigitsBits / 10)));\n result.append(DecodedBitStreamParser$1.toAlphaNumericChar(twoDigitsBits % 10));\n }\n else if (count === 1) {\n // One digit left over to read\n if (bits.available() < 4) {\n throw new FormatException();\n }\n const digitBits = bits.readBits(4);\n if (digitBits >= 10) {\n throw new FormatException();\n }\n result.append(DecodedBitStreamParser$1.toAlphaNumericChar(digitBits));\n }\n }\n static parseECIValue(bits) {\n const firstByte = bits.readBits(8);\n if ((firstByte & 0x80) === 0) {\n // just one byte\n return firstByte & 0x7F;\n }\n if ((firstByte & 0xC0) === 0x80) {\n // two bytes\n const secondByte = bits.readBits(8);\n return (((firstByte & 0x3F) << 8) & 0xFFFFFFFF) | secondByte;\n }\n if ((firstByte & 0xE0) === 0xC0) {\n // three bytes\n const secondThirdBytes = bits.readBits(16);\n return (((firstByte & 0x1F) << 16) & 0xFFFFFFFF) | secondThirdBytes;\n }\n throw new FormatException();\n }\n }\n /**\n * See ISO 18004:2006, 6.4.4 Table 5\n */\n DecodedBitStreamParser$1.ALPHANUMERIC_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:';\n DecodedBitStreamParser$1.GB2312_SUBSET = 1;\n // function Uint8ArrayToString(a: Uint8Array): string {\n // const CHUNK_SZ = 0x8000;\n // const c = new StringBuilder();\n // for (let i = 0, length = a.length; i < length; i += CHUNK_SZ) {\n // c.append(String.fromCharCode.apply(null, a.subarray(i, i + CHUNK_SZ)));\n // }\n // return c.toString();\n // }\n\n /*\n * Copyright 2013 ZXing authors\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 /**\n * Meta-data container for QR Code decoding. Instances of this class may be used to convey information back to the\n * decoding caller. Callers are expected to process this.\n *\n * @see com.google.zxing.common.DecoderResult#getOther()\n */\n class QRCodeDecoderMetaData {\n constructor(mirrored) {\n this.mirrored = mirrored;\n }\n /**\n * @return true if the QR Code was mirrored.\n */\n isMirrored() {\n return this.mirrored;\n }\n /**\n * Apply the result points' order correction due to mirroring.\n *\n * @param points Array of points to apply mirror correction to.\n */\n applyMirroredCorrection(points) {\n if (!this.mirrored || points === null || points.length < 3) {\n return;\n }\n const bottomLeft = points[0];\n points[0] = points[2];\n points[2] = bottomLeft;\n // No need to 'fix' top-left and alignment pattern.\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /*import java.util.Map;*/\n /**\n *The main class which implements QR Code decoding -- as opposed to locating and extracting\n * the QR Code from an image.
\n *\n * @author Sean Owen\n */\n class Decoder$2 {\n constructor() {\n this.rsDecoder = new ReedSolomonDecoder(GenericGF.QR_CODE_FIELD_256);\n }\n // public decode(image: boolean[][]): DecoderResult /*throws ChecksumException, FormatException*/ {\n // return decode(image, null)\n // }\n /**\n *Convenience method that can decode a QR Code represented as a 2D array of booleans.\n * \"true\" is taken to mean a black module.
\n *\n * @param image booleans representing white/black QR Code modules\n * @param hints decoding hints that should be used to influence decoding\n * @return text and bytes encoded within the QR Code\n * @throws FormatException if the QR Code cannot be decoded\n * @throws ChecksumException if error correction fails\n */\n decodeBooleanArray(image, hints) {\n return this.decodeBitMatrix(BitMatrix.parseFromBooleanArray(image), hints);\n }\n // public decodeBitMatrix(bits: BitMatrix): DecoderResult /*throws ChecksumException, FormatException*/ {\n // return decode(bits, null)\n // }\n /**\n *Decodes a QR Code represented as a {@link BitMatrix}. A 1 or \"true\" is taken to mean a black module.
\n *\n * @param bits booleans representing white/black QR Code modules\n * @param hints decoding hints that should be used to influence decoding\n * @return text and bytes encoded within the QR Code\n * @throws FormatException if the QR Code cannot be decoded\n * @throws ChecksumException if error correction fails\n */\n decodeBitMatrix(bits, hints) {\n // Construct a parser and read version, error-correction level\n const parser = new BitMatrixParser$1(bits);\n let ex = null;\n try {\n return this.decodeBitMatrixParser(parser, hints);\n }\n catch (e /*: FormatException, ChecksumException*/) {\n ex = e;\n }\n try {\n // Revert the bit matrix\n parser.remask();\n // Will be attempting a mirrored reading of the version and format info.\n parser.setMirror(true);\n // Preemptively read the version.\n parser.readVersion();\n // Preemptively read the format information.\n parser.readFormatInformation();\n /*\n * Since we're here, this means we have successfully detected some kind\n * of version and format information when mirrored. This is a good sign,\n * that the QR code may be mirrored, and we should try once more with a\n * mirrored content.\n */\n // Prepare for a mirrored reading.\n parser.mirror();\n const result = this.decodeBitMatrixParser(parser, hints);\n // Success! Notify the caller that the code was mirrored.\n result.setOther(new QRCodeDecoderMetaData(true));\n return result;\n }\n catch (e /*FormatException | ChecksumException*/) {\n // Throw the exception from the original reading\n if (ex !== null) {\n throw ex;\n }\n throw e;\n }\n }\n decodeBitMatrixParser(parser, hints) {\n const version = parser.readVersion();\n const ecLevel = parser.readFormatInformation().getErrorCorrectionLevel();\n // Read codewords\n const codewords = parser.readCodewords();\n // Separate into data blocks\n const dataBlocks = DataBlock$1.getDataBlocks(codewords, version, ecLevel);\n // Count total number of data bytes\n let totalBytes = 0;\n for (const dataBlock of dataBlocks) {\n totalBytes += dataBlock.getNumDataCodewords();\n }\n const resultBytes = new Uint8Array(totalBytes);\n let resultOffset = 0;\n // Error-correct and copy data blocks together into a stream of bytes\n for (const dataBlock of dataBlocks) {\n const codewordBytes = dataBlock.getCodewords();\n const numDataCodewords = dataBlock.getNumDataCodewords();\n this.correctErrors(codewordBytes, numDataCodewords);\n for (let i = 0; i < numDataCodewords; i++) {\n resultBytes[resultOffset++] = codewordBytes[i];\n }\n }\n // Decode the contents of that stream of bytes\n return DecodedBitStreamParser$1.decode(resultBytes, version, ecLevel, hints);\n }\n /**\n *Given data and error-correction codewords received, possibly corrupted by errors, attempts to\n * correct the errors in-place using Reed-Solomon error correction.
\n *\n * @param codewordBytes data and error correction codewords\n * @param numDataCodewords number of codewords that are data bytes\n * @throws ChecksumException if error correction fails\n */\n correctErrors(codewordBytes, numDataCodewords /*int*/) {\n // const numCodewords = codewordBytes.length;\n // First read into an array of ints\n const codewordsInts = new Int32Array(codewordBytes);\n // TYPESCRIPTPORT: not realy necessary to transform to ints? could redesign everything to work with unsigned bytes?\n // const codewordsInts = new Int32Array(numCodewords)\n // for (let i = 0; i < numCodewords; i++) {\n // codewordsInts[i] = codewordBytes[i] & 0xFF\n // }\n try {\n this.rsDecoder.decode(codewordsInts, codewordBytes.length - numDataCodewords);\n }\n catch (ignored /*: ReedSolomonException*/) {\n throw new ChecksumException();\n }\n // Copy back into array of bytes -- only need to worry about the bytes that were data\n // We don't care about errors in the error-correction codewords\n for (let i = 0; i < numDataCodewords; i++) {\n codewordBytes[i] = /*(byte) */ codewordsInts[i];\n }\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *Encapsulates an alignment pattern, which are the smaller square patterns found in\n * all but the simplest QR Codes.
\n *\n * @author Sean Owen\n */\n class AlignmentPattern extends ResultPoint {\n constructor(posX /*float*/, posY /*float*/, estimatedModuleSize /*float*/) {\n super(posX, posY);\n this.estimatedModuleSize = estimatedModuleSize;\n }\n /**\n *Determines if this alignment pattern \"about equals\" an alignment pattern at the stated\n * position and size -- meaning, it is at nearly the same center with nearly the same size.
\n */\n aboutEquals(moduleSize /*float*/, i /*float*/, j /*float*/) {\n if (Math.abs(i - this.getY()) <= moduleSize && Math.abs(j - this.getX()) <= moduleSize) {\n const moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);\n return moduleSizeDiff <= 1.0 || moduleSizeDiff <= this.estimatedModuleSize;\n }\n return false;\n }\n /**\n * Combines this object's current estimate of a finder pattern position and module size\n * with a new estimate. It returns a new {@code FinderPattern} containing an average of the two.\n */\n combineEstimate(i /*float*/, j /*float*/, newModuleSize /*float*/) {\n const combinedX = (this.getX() + j) / 2.0;\n const combinedY = (this.getY() + i) / 2.0;\n const combinedModuleSize = (this.estimatedModuleSize + newModuleSize) / 2.0;\n return new AlignmentPattern(combinedX, combinedY, combinedModuleSize);\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /*import java.util.ArrayList;*/\n /*import java.util.List;*/\n /**\n *This class attempts to find alignment patterns in a QR Code. Alignment patterns look like finder\n * patterns but are smaller and appear at regular intervals throughout the image.
\n *\n *At the moment this only looks for the bottom-right alignment pattern.
\n *\n *This is mostly a simplified copy of {@link FinderPatternFinder}. It is copied,\n * pasted and stripped down here for maximum performance but does unfortunately duplicate\n * some code.
\n *\n *This class is thread-safe but not reentrant. Each thread must allocate its own object.
\n *\n * @author Sean Owen\n */\n class AlignmentPatternFinder {\n /**\n *Creates a finder that will look in a portion of the whole image.
\n *\n * @param image image to search\n * @param startX left column from which to start searching\n * @param startY top row from which to start searching\n * @param width width of region to search\n * @param height height of region to search\n * @param moduleSize estimated module size so far\n */\n constructor(image, startX /*int*/, startY /*int*/, width /*int*/, height /*int*/, moduleSize /*float*/, resultPointCallback) {\n this.image = image;\n this.startX = startX;\n this.startY = startY;\n this.width = width;\n this.height = height;\n this.moduleSize = moduleSize;\n this.resultPointCallback = resultPointCallback;\n this.possibleCenters = []; // new ArrayThis method attempts to find the bottom-right alignment pattern in the image. It is a bit messy since\n * it's pretty performance-critical and so is written to be fast foremost.
\n *\n * @return {@link AlignmentPattern} if found\n * @throws NotFoundException if not found\n */\n find() {\n const startX = this.startX;\n const height = this.height;\n const width = this.width;\n const maxJ = startX + width;\n const middleI = this.startY + (height / 2);\n // We are looking for black/white/black modules in 1:1:1 ratio\n // this tracks the number of black/white/black modules seen so far\n const stateCount = new Int32Array(3);\n const image = this.image;\n for (let iGen = 0; iGen < height; iGen++) {\n // Search from middle outwards\n const i = middleI + ((iGen & 0x01) === 0 ? Math.floor((iGen + 1) / 2) : -Math.floor((iGen + 1) / 2));\n stateCount[0] = 0;\n stateCount[1] = 0;\n stateCount[2] = 0;\n let j = startX;\n // Burn off leading white pixels before anything else; if we start in the middle of\n // a white run, it doesn't make sense to count its length, since we don't know if the\n // white run continued to the left of the start point\n while (j < maxJ && !image.get(j, i)) {\n j++;\n }\n let currentState = 0;\n while (j < maxJ) {\n if (image.get(j, i)) {\n // Black pixel\n if (currentState === 1) { // Counting black pixels\n stateCount[1]++;\n }\n else { // Counting white pixels\n if (currentState === 2) { // A winner?\n if (this.foundPatternCross(stateCount)) { // Yes\n const confirmed = this.handlePossibleCenter(stateCount, i, j);\n if (confirmed !== null) {\n return confirmed;\n }\n }\n stateCount[0] = stateCount[2];\n stateCount[1] = 1;\n stateCount[2] = 0;\n currentState = 1;\n }\n else {\n stateCount[++currentState]++;\n }\n }\n }\n else { // White pixel\n if (currentState === 1) { // Counting black pixels\n currentState++;\n }\n stateCount[currentState]++;\n }\n j++;\n }\n if (this.foundPatternCross(stateCount)) {\n const confirmed = this.handlePossibleCenter(stateCount, i, maxJ);\n if (confirmed !== null) {\n return confirmed;\n }\n }\n }\n // Hmm, nothing we saw was observed and confirmed twice. If we had\n // any guess at all, return it.\n if (this.possibleCenters.length !== 0) {\n return this.possibleCenters[0];\n }\n throw new NotFoundException();\n }\n /**\n * Given a count of black/white/black pixels just seen and an end position,\n * figures the location of the center of this black/white/black run.\n */\n static centerFromEnd(stateCount, end /*int*/) {\n return (end - stateCount[2]) - stateCount[1] / 2.0;\n }\n /**\n * @param stateCount count of black/white/black pixels just read\n * @return true iff the proportions of the counts is close enough to the 1/1/1 ratios\n * used by alignment patterns to be considered a match\n */\n foundPatternCross(stateCount) {\n const moduleSize = this.moduleSize;\n const maxVariance = moduleSize / 2.0;\n for (let i = 0; i < 3; i++) {\n if (Math.abs(moduleSize - stateCount[i]) >= maxVariance) {\n return false;\n }\n }\n return true;\n }\n /**\n *After a horizontal scan finds a potential alignment pattern, this method\n * \"cross-checks\" by scanning down vertically through the center of the possible\n * alignment pattern to see if the same proportion is detected.
\n *\n * @param startI row where an alignment pattern was detected\n * @param centerJ center of the section that appears to cross an alignment pattern\n * @param maxCount maximum reasonable number of modules that should be\n * observed in any reading state, based on the results of the horizontal scan\n * @return vertical center of alignment pattern, or {@link Float#NaN} if not found\n */\n crossCheckVertical(startI /*int*/, centerJ /*int*/, maxCount /*int*/, originalStateCountTotal /*int*/) {\n const image = this.image;\n const maxI = image.getHeight();\n const stateCount = this.crossCheckStateCount;\n stateCount[0] = 0;\n stateCount[1] = 0;\n stateCount[2] = 0;\n // Start counting up from center\n let i = startI;\n while (i >= 0 && image.get(centerJ, i) && stateCount[1] <= maxCount) {\n stateCount[1]++;\n i--;\n }\n // If already too many modules in this state or ran off the edge:\n if (i < 0 || stateCount[1] > maxCount) {\n return NaN;\n }\n while (i >= 0 && !image.get(centerJ, i) && stateCount[0] <= maxCount) {\n stateCount[0]++;\n i--;\n }\n if (stateCount[0] > maxCount) {\n return NaN;\n }\n // Now also count down from center\n i = startI + 1;\n while (i < maxI && image.get(centerJ, i) && stateCount[1] <= maxCount) {\n stateCount[1]++;\n i++;\n }\n if (i === maxI || stateCount[1] > maxCount) {\n return NaN;\n }\n while (i < maxI && !image.get(centerJ, i) && stateCount[2] <= maxCount) {\n stateCount[2]++;\n i++;\n }\n if (stateCount[2] > maxCount) {\n return NaN;\n }\n const stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];\n if (5 * Math.abs(stateCountTotal - originalStateCountTotal) >= 2 * originalStateCountTotal) {\n return NaN;\n }\n return this.foundPatternCross(stateCount) ? AlignmentPatternFinder.centerFromEnd(stateCount, i) : NaN;\n }\n /**\n *This is called when a horizontal scan finds a possible alignment pattern. It will\n * cross check with a vertical scan, and if successful, will see if this pattern had been\n * found on a previous horizontal scan. If so, we consider it confirmed and conclude we have\n * found the alignment pattern.
\n *\n * @param stateCount reading state module counts from horizontal scan\n * @param i row where alignment pattern may be found\n * @param j end of possible alignment pattern in row\n * @return {@link AlignmentPattern} if we have found the same pattern twice, or null if not\n */\n handlePossibleCenter(stateCount, i /*int*/, j /*int*/) {\n const stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];\n const centerJ = AlignmentPatternFinder.centerFromEnd(stateCount, j);\n const centerI = this.crossCheckVertical(i, /*(int) */ centerJ, 2 * stateCount[1], stateCountTotal);\n if (!isNaN(centerI)) {\n const estimatedModuleSize = (stateCount[0] + stateCount[1] + stateCount[2]) / 3.0;\n for (const center of this.possibleCenters) {\n // Look for about the same center and module size:\n if (center.aboutEquals(estimatedModuleSize, centerI, centerJ)) {\n return center.combineEstimate(centerI, centerJ, estimatedModuleSize);\n }\n }\n // Hadn't found this before; save it\n const point = new AlignmentPattern(centerJ, centerI, estimatedModuleSize);\n this.possibleCenters.push(point);\n if (this.resultPointCallback !== null && this.resultPointCallback !== undefined) {\n this.resultPointCallback.foundPossibleResultPoint(point);\n }\n }\n return null;\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *Encapsulates a finder pattern, which are the three square patterns found in\n * the corners of QR Codes. It also encapsulates a count of similar finder patterns,\n * as a convenience to the finder's bookkeeping.
\n *\n * @author Sean Owen\n */\n class FinderPattern$1 extends ResultPoint {\n // FinderPattern(posX: number/*float*/, posY: number/*float*/, estimatedModuleSize: number/*float*/) {\n // this(posX, posY, estimatedModuleSize, 1)\n // }\n constructor(posX /*float*/, posY /*float*/, estimatedModuleSize /*float*/, count /*int*/) {\n super(posX, posY);\n this.estimatedModuleSize = estimatedModuleSize;\n this.count = count;\n if (undefined === count) {\n this.count = 1;\n }\n }\n getEstimatedModuleSize() {\n return this.estimatedModuleSize;\n }\n getCount() {\n return this.count;\n }\n /*\n void incrementCount() {\n this.count++\n }\n */\n /**\n *Determines if this finder pattern \"about equals\" a finder pattern at the stated\n * position and size -- meaning, it is at nearly the same center with nearly the same size.
\n */\n aboutEquals(moduleSize /*float*/, i /*float*/, j /*float*/) {\n if (Math.abs(i - this.getY()) <= moduleSize && Math.abs(j - this.getX()) <= moduleSize) {\n const moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);\n return moduleSizeDiff <= 1.0 || moduleSizeDiff <= this.estimatedModuleSize;\n }\n return false;\n }\n /**\n * Combines this object's current estimate of a finder pattern position and module size\n * with a new estimate. It returns a new {@code FinderPattern} containing a weighted average\n * based on count.\n */\n combineEstimate(i /*float*/, j /*float*/, newModuleSize /*float*/) {\n const combinedCount = this.count + 1;\n const combinedX = (this.count * this.getX() + j) / combinedCount;\n const combinedY = (this.count * this.getY() + i) / combinedCount;\n const combinedModuleSize = (this.count * this.estimatedModuleSize + newModuleSize) / combinedCount;\n return new FinderPattern$1(combinedX, combinedY, combinedModuleSize, combinedCount);\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /**\n *Encapsulates information about finder patterns in an image, including the location of\n * the three finder patterns, and their estimated module size.
\n *\n * @author Sean Owen\n */\n class FinderPatternInfo {\n constructor(patternCenters) {\n this.bottomLeft = patternCenters[0];\n this.topLeft = patternCenters[1];\n this.topRight = patternCenters[2];\n }\n getBottomLeft() {\n return this.bottomLeft;\n }\n getTopLeft() {\n return this.topLeft;\n }\n getTopRight() {\n return this.topRight;\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /*import java.io.Serializable;*/\n /*import java.util.ArrayList;*/\n /*import java.util.Collections;*/\n /*import java.util.Comparator;*/\n /*import java.util.List;*/\n /*import java.util.Map;*/\n /**\n *This class attempts to find finder patterns in a QR Code. Finder patterns are the square\n * markers at three corners of a QR Code.
\n *\n *This class is thread-safe but not reentrant. Each thread must allocate its own object.\n *\n * @author Sean Owen\n */\n class FinderPatternFinder {\n /**\n *
Creates a finder that will search the image for three finder patterns.
\n *\n * @param image image to search\n */\n // public constructor(image: BitMatrix) {\n // this(image, null)\n // }\n constructor(image, resultPointCallback) {\n this.image = image;\n this.resultPointCallback = resultPointCallback;\n this.possibleCenters = [];\n this.crossCheckStateCount = new Int32Array(5);\n this.resultPointCallback = resultPointCallback;\n }\n getImage() {\n return this.image;\n }\n getPossibleCenters() {\n return this.possibleCenters;\n }\n find(hints) {\n const tryHarder = (hints !== null && hints !== undefined) && undefined !== hints.get(DecodeHintType$1.TRY_HARDER);\n const pureBarcode = (hints !== null && hints !== undefined) && undefined !== hints.get(DecodeHintType$1.PURE_BARCODE);\n const image = this.image;\n const maxI = image.getHeight();\n const maxJ = image.getWidth();\n // We are looking for black/white/black/white/black modules in\n // 1:1:3:1:1 ratio; this tracks the number of such modules seen so far\n // Let's assume that the maximum version QR Code we support takes up 1/4 the height of the\n // image, and then account for the center being 3 modules in size. This gives the smallest\n // number of pixels the center could be, so skip this often. When trying harder, look for all\n // QR versions regardless of how dense they are.\n let iSkip = Math.floor((3 * maxI) / (4 * FinderPatternFinder.MAX_MODULES));\n if (iSkip < FinderPatternFinder.MIN_SKIP || tryHarder) {\n iSkip = FinderPatternFinder.MIN_SKIP;\n }\n let done = false;\n const stateCount = new Int32Array(5);\n for (let i = iSkip - 1; i < maxI && !done; i += iSkip) {\n // Get a row of black/white values\n stateCount[0] = 0;\n stateCount[1] = 0;\n stateCount[2] = 0;\n stateCount[3] = 0;\n stateCount[4] = 0;\n let currentState = 0;\n for (let j = 0; j < maxJ; j++) {\n if (image.get(j, i)) {\n // Black pixel\n if ((currentState & 1) === 1) { // Counting white pixels\n currentState++;\n }\n stateCount[currentState]++;\n }\n else { // White pixel\n if ((currentState & 1) === 0) { // Counting black pixels\n if (currentState === 4) { // A winner?\n if (FinderPatternFinder.foundPatternCross(stateCount)) { // Yes\n const confirmed = this.handlePossibleCenter(stateCount, i, j, pureBarcode);\n if (confirmed === true) {\n // Start examining every other line. Checking each line turned out to be too\n // expensive and didn't improve performance.\n iSkip = 2;\n if (this.hasSkipped === true) {\n done = this.haveMultiplyConfirmedCenters();\n }\n else {\n const rowSkip = this.findRowSkip();\n if (rowSkip > stateCount[2]) {\n // Skip rows between row of lower confirmed center\n // and top of presumed third confirmed center\n // but back up a bit to get a full chance of detecting\n // it, entire width of center of finder pattern\n // Skip by rowSkip, but back off by stateCount[2] (size of last center\n // of pattern we saw) to be conservative, and also back off by iSkip which\n // is about to be re-added\n i += rowSkip - stateCount[2] - iSkip;\n j = maxJ - 1;\n }\n }\n }\n else {\n stateCount[0] = stateCount[2];\n stateCount[1] = stateCount[3];\n stateCount[2] = stateCount[4];\n stateCount[3] = 1;\n stateCount[4] = 0;\n currentState = 3;\n continue;\n }\n // Clear state to start looking again\n currentState = 0;\n stateCount[0] = 0;\n stateCount[1] = 0;\n stateCount[2] = 0;\n stateCount[3] = 0;\n stateCount[4] = 0;\n }\n else { // No, shift counts back by two\n stateCount[0] = stateCount[2];\n stateCount[1] = stateCount[3];\n stateCount[2] = stateCount[4];\n stateCount[3] = 1;\n stateCount[4] = 0;\n currentState = 3;\n }\n }\n else {\n stateCount[++currentState]++;\n }\n }\n else { // Counting white pixels\n stateCount[currentState]++;\n }\n }\n }\n if (FinderPatternFinder.foundPatternCross(stateCount)) {\n const confirmed = this.handlePossibleCenter(stateCount, i, maxJ, pureBarcode);\n if (confirmed === true) {\n iSkip = stateCount[0];\n if (this.hasSkipped) {\n // Found a third one\n done = this.haveMultiplyConfirmedCenters();\n }\n }\n }\n }\n const patternInfo = this.selectBestPatterns();\n ResultPoint.orderBestPatterns(patternInfo);\n return new FinderPatternInfo(patternInfo);\n }\n /**\n * Given a count of black/white/black/white/black pixels just seen and an end position,\n * figures the location of the center of this run.\n */\n static centerFromEnd(stateCount, end /*int*/) {\n return (end - stateCount[4] - stateCount[3]) - stateCount[2] / 2.0;\n }\n /**\n * @param stateCount count of black/white/black/white/black pixels just read\n * @return true iff the proportions of the counts is close enough to the 1/1/3/1/1 ratios\n * used by finder patterns to be considered a match\n */\n static foundPatternCross(stateCount) {\n let totalModuleSize = 0;\n for (let i = 0; i < 5; i++) {\n const count = stateCount[i];\n if (count === 0) {\n return false;\n }\n totalModuleSize += count;\n }\n if (totalModuleSize < 7) {\n return false;\n }\n const moduleSize = totalModuleSize / 7.0;\n const maxVariance = moduleSize / 2.0;\n // Allow less than 50% variance from 1-1-3-1-1 proportions\n return Math.abs(moduleSize - stateCount[0]) < maxVariance &&\n Math.abs(moduleSize - stateCount[1]) < maxVariance &&\n Math.abs(3.0 * moduleSize - stateCount[2]) < 3 * maxVariance &&\n Math.abs(moduleSize - stateCount[3]) < maxVariance &&\n Math.abs(moduleSize - stateCount[4]) < maxVariance;\n }\n getCrossCheckStateCount() {\n const crossCheckStateCount = this.crossCheckStateCount;\n crossCheckStateCount[0] = 0;\n crossCheckStateCount[1] = 0;\n crossCheckStateCount[2] = 0;\n crossCheckStateCount[3] = 0;\n crossCheckStateCount[4] = 0;\n return crossCheckStateCount;\n }\n /**\n * After a vertical and horizontal scan finds a potential finder pattern, this method\n * \"cross-cross-cross-checks\" by scanning down diagonally through the center of the possible\n * finder pattern to see if the same proportion is detected.\n *\n * @param startI row where a finder pattern was detected\n * @param centerJ center of the section that appears to cross a finder pattern\n * @param maxCount maximum reasonable number of modules that should be\n * observed in any reading state, based on the results of the horizontal scan\n * @param originalStateCountTotal The original state count total.\n * @return true if proportions are withing expected limits\n */\n crossCheckDiagonal(startI /*int*/, centerJ /*int*/, maxCount /*int*/, originalStateCountTotal /*int*/) {\n const stateCount = this.getCrossCheckStateCount();\n // Start counting up, left from center finding black center mass\n let i = 0;\n const image = this.image;\n while (startI >= i && centerJ >= i && image.get(centerJ - i, startI - i)) {\n stateCount[2]++;\n i++;\n }\n if (startI < i || centerJ < i) {\n return false;\n }\n // Continue up, left finding white space\n while (startI >= i && centerJ >= i && !image.get(centerJ - i, startI - i) &&\n stateCount[1] <= maxCount) {\n stateCount[1]++;\n i++;\n }\n // If already too many modules in this state or ran off the edge:\n if (startI < i || centerJ < i || stateCount[1] > maxCount) {\n return false;\n }\n // Continue up, left finding black border\n while (startI >= i && centerJ >= i && image.get(centerJ - i, startI - i) &&\n stateCount[0] <= maxCount) {\n stateCount[0]++;\n i++;\n }\n if (stateCount[0] > maxCount) {\n return false;\n }\n const maxI = image.getHeight();\n const maxJ = image.getWidth();\n // Now also count down, right from center\n i = 1;\n while (startI + i < maxI && centerJ + i < maxJ && image.get(centerJ + i, startI + i)) {\n stateCount[2]++;\n i++;\n }\n // Ran off the edge?\n if (startI + i >= maxI || centerJ + i >= maxJ) {\n return false;\n }\n while (startI + i < maxI && centerJ + i < maxJ && !image.get(centerJ + i, startI + i) &&\n stateCount[3] < maxCount) {\n stateCount[3]++;\n i++;\n }\n if (startI + i >= maxI || centerJ + i >= maxJ || stateCount[3] >= maxCount) {\n return false;\n }\n while (startI + i < maxI && centerJ + i < maxJ && image.get(centerJ + i, startI + i) &&\n stateCount[4] < maxCount) {\n stateCount[4]++;\n i++;\n }\n if (stateCount[4] >= maxCount) {\n return false;\n }\n // If we found a finder-pattern-like section, but its size is more than 100% different than\n // the original, assume it's a false positive\n const stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4];\n return Math.abs(stateCountTotal - originalStateCountTotal) < 2 * originalStateCountTotal &&\n FinderPatternFinder.foundPatternCross(stateCount);\n }\n /**\n *After a horizontal scan finds a potential finder pattern, this method\n * \"cross-checks\" by scanning down vertically through the center of the possible\n * finder pattern to see if the same proportion is detected.
\n *\n * @param startI row where a finder pattern was detected\n * @param centerJ center of the section that appears to cross a finder pattern\n * @param maxCount maximum reasonable number of modules that should be\n * observed in any reading state, based on the results of the horizontal scan\n * @return vertical center of finder pattern, or {@link Float#NaN} if not found\n */\n crossCheckVertical(startI /*int*/, centerJ /*int*/, maxCount /*int*/, originalStateCountTotal /*int*/) {\n const image = this.image;\n const maxI = image.getHeight();\n const stateCount = this.getCrossCheckStateCount();\n // Start counting up from center\n let i = startI;\n while (i >= 0 && image.get(centerJ, i)) {\n stateCount[2]++;\n i--;\n }\n if (i < 0) {\n return NaN;\n }\n while (i >= 0 && !image.get(centerJ, i) && stateCount[1] <= maxCount) {\n stateCount[1]++;\n i--;\n }\n // If already too many modules in this state or ran off the edge:\n if (i < 0 || stateCount[1] > maxCount) {\n return NaN;\n }\n while (i >= 0 && image.get(centerJ, i) && stateCount[0] <= maxCount) {\n stateCount[0]++;\n i--;\n }\n if (stateCount[0] > maxCount) {\n return NaN;\n }\n // Now also count down from center\n i = startI + 1;\n while (i < maxI && image.get(centerJ, i)) {\n stateCount[2]++;\n i++;\n }\n if (i === maxI) {\n return NaN;\n }\n while (i < maxI && !image.get(centerJ, i) && stateCount[3] < maxCount) {\n stateCount[3]++;\n i++;\n }\n if (i === maxI || stateCount[3] >= maxCount) {\n return NaN;\n }\n while (i < maxI && image.get(centerJ, i) && stateCount[4] < maxCount) {\n stateCount[4]++;\n i++;\n }\n if (stateCount[4] >= maxCount) {\n return NaN;\n }\n // If we found a finder-pattern-like section, but its size is more than 40% different than\n // the original, assume it's a false positive\n const stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] +\n stateCount[4];\n if (5 * Math.abs(stateCountTotal - originalStateCountTotal) >= 2 * originalStateCountTotal) {\n return NaN;\n }\n return FinderPatternFinder.foundPatternCross(stateCount) ? FinderPatternFinder.centerFromEnd(stateCount, i) : NaN;\n }\n /**\n *Like {@link #crossCheckVertical(int, int, int, int)}, and in fact is basically identical,\n * except it reads horizontally instead of vertically. This is used to cross-cross\n * check a vertical cross check and locate the real center of the alignment pattern.
\n */\n crossCheckHorizontal(startJ /*int*/, centerI /*int*/, maxCount /*int*/, originalStateCountTotal /*int*/) {\n const image = this.image;\n const maxJ = image.getWidth();\n const stateCount = this.getCrossCheckStateCount();\n let j = startJ;\n while (j >= 0 && image.get(j, centerI)) {\n stateCount[2]++;\n j--;\n }\n if (j < 0) {\n return NaN;\n }\n while (j >= 0 && !image.get(j, centerI) && stateCount[1] <= maxCount) {\n stateCount[1]++;\n j--;\n }\n if (j < 0 || stateCount[1] > maxCount) {\n return NaN;\n }\n while (j >= 0 && image.get(j, centerI) && stateCount[0] <= maxCount) {\n stateCount[0]++;\n j--;\n }\n if (stateCount[0] > maxCount) {\n return NaN;\n }\n j = startJ + 1;\n while (j < maxJ && image.get(j, centerI)) {\n stateCount[2]++;\n j++;\n }\n if (j === maxJ) {\n return NaN;\n }\n while (j < maxJ && !image.get(j, centerI) && stateCount[3] < maxCount) {\n stateCount[3]++;\n j++;\n }\n if (j === maxJ || stateCount[3] >= maxCount) {\n return NaN;\n }\n while (j < maxJ && image.get(j, centerI) && stateCount[4] < maxCount) {\n stateCount[4]++;\n j++;\n }\n if (stateCount[4] >= maxCount) {\n return NaN;\n }\n // If we found a finder-pattern-like section, but its size is significantly different than\n // the original, assume it's a false positive\n const stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] +\n stateCount[4];\n if (5 * Math.abs(stateCountTotal - originalStateCountTotal) >= originalStateCountTotal) {\n return NaN;\n }\n return FinderPatternFinder.foundPatternCross(stateCount) ? FinderPatternFinder.centerFromEnd(stateCount, j) : NaN;\n }\n /**\n *This is called when a horizontal scan finds a possible alignment pattern. It will\n * cross check with a vertical scan, and if successful, will, ah, cross-cross-check\n * with another horizontal scan. This is needed primarily to locate the real horizontal\n * center of the pattern in cases of extreme skew.\n * And then we cross-cross-cross check with another diagonal scan.
\n *\n *If that succeeds the finder pattern location is added to a list that tracks\n * the number of times each location has been nearly-matched as a finder pattern.\n * Each additional find is more evidence that the location is in fact a finder\n * pattern center\n *\n * @param stateCount reading state module counts from horizontal scan\n * @param i row where finder pattern may be found\n * @param j end of possible finder pattern in row\n * @param pureBarcode true if in \"pure barcode\" mode\n * @return true if a finder pattern candidate was found this time\n */\n handlePossibleCenter(stateCount, i /*int*/, j /*int*/, pureBarcode) {\n const stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] +\n stateCount[4];\n let centerJ = FinderPatternFinder.centerFromEnd(stateCount, j);\n let centerI = this.crossCheckVertical(i, /*(int) */ Math.floor(centerJ), stateCount[2], stateCountTotal);\n if (!isNaN(centerI)) {\n // Re-cross check\n centerJ = this.crossCheckHorizontal(/*(int) */ Math.floor(centerJ), /*(int) */ Math.floor(centerI), stateCount[2], stateCountTotal);\n if (!isNaN(centerJ) &&\n (!pureBarcode || this.crossCheckDiagonal(/*(int) */ Math.floor(centerI), /*(int) */ Math.floor(centerJ), stateCount[2], stateCountTotal))) {\n const estimatedModuleSize = stateCountTotal / 7.0;\n let found = false;\n const possibleCenters = this.possibleCenters;\n for (let index = 0, length = possibleCenters.length; index < length; index++) {\n const center = possibleCenters[index];\n // Look for about the same center and module size:\n if (center.aboutEquals(estimatedModuleSize, centerI, centerJ)) {\n possibleCenters[index] = center.combineEstimate(centerI, centerJ, estimatedModuleSize);\n found = true;\n break;\n }\n }\n if (!found) {\n const point = new FinderPattern$1(centerJ, centerI, estimatedModuleSize);\n possibleCenters.push(point);\n if (this.resultPointCallback !== null && this.resultPointCallback !== undefined) {\n this.resultPointCallback.foundPossibleResultPoint(point);\n }\n }\n return true;\n }\n }\n return false;\n }\n /**\n * @return number of rows we could safely skip during scanning, based on the first\n * two finder patterns that have been located. In some cases their position will\n * allow us to infer that the third pattern must lie below a certain point farther\n * down in the image.\n */\n findRowSkip() {\n const max = this.possibleCenters.length;\n if (max <= 1) {\n return 0;\n }\n let firstConfirmedCenter = null;\n for (const center of this.possibleCenters) {\n if (center.getCount() >= FinderPatternFinder.CENTER_QUORUM) {\n if (firstConfirmedCenter == null) {\n firstConfirmedCenter = center;\n }\n else {\n // We have two confirmed centers\n // How far down can we skip before resuming looking for the next\n // pattern? In the worst case, only the difference between the\n // difference in the x / y coordinates of the two centers.\n // This is the case where you find top left last.\n this.hasSkipped = true;\n return /*(int) */ Math.floor((Math.abs(firstConfirmedCenter.getX() - center.getX()) -\n Math.abs(firstConfirmedCenter.getY() - center.getY())) / 2);\n }\n }\n }\n return 0;\n }\n /**\n * @return true iff we have found at least 3 finder patterns that have been detected\n * at least {@link #CENTER_QUORUM} times each, and, the estimated module size of the\n * candidates is \"pretty similar\"\n */\n haveMultiplyConfirmedCenters() {\n let confirmedCount = 0;\n let totalModuleSize = 0.0;\n const max = this.possibleCenters.length;\n for (const pattern of this.possibleCenters) {\n if (pattern.getCount() >= FinderPatternFinder.CENTER_QUORUM) {\n confirmedCount++;\n totalModuleSize += pattern.getEstimatedModuleSize();\n }\n }\n if (confirmedCount < 3) {\n return false;\n }\n // OK, we have at least 3 confirmed centers, but, it's possible that one is a \"false positive\"\n // and that we need to keep looking. We detect this by asking if the estimated module sizes\n // vary too much. We arbitrarily say that when the total deviation from average exceeds\n // 5% of the total module size estimates, it's too much.\n const average = totalModuleSize / max;\n let totalDeviation = 0.0;\n for (const pattern of this.possibleCenters) {\n totalDeviation += Math.abs(pattern.getEstimatedModuleSize() - average);\n }\n return totalDeviation <= 0.05 * totalModuleSize;\n }\n /**\n * @return the 3 best {@link FinderPattern}s from our list of candidates. The \"best\" are\n * those that have been detected at least {@link #CENTER_QUORUM} times, and whose module\n * size differs from the average among those patterns the least\n * @throws NotFoundException if 3 such finder patterns do not exist\n */\n selectBestPatterns() {\n const startSize = this.possibleCenters.length;\n if (startSize < 3) {\n // Couldn't find enough finder patterns\n throw new NotFoundException();\n }\n const possibleCenters = this.possibleCenters;\n let average;\n // Filter outlier possibilities whose module size is too different\n if (startSize > 3) {\n // But we can only afford to do so if we have at least 4 possibilities to choose from\n let totalModuleSize = 0.0;\n let square = 0.0;\n for (const center of this.possibleCenters) {\n const size = center.getEstimatedModuleSize();\n totalModuleSize += size;\n square += size * size;\n }\n average = totalModuleSize / startSize;\n let stdDev = Math.sqrt(square / startSize - average * average);\n possibleCenters.sort(\n /**\n *
Orders by furthest from average
\n */\n // FurthestFromAverageComparator implements ComparatorOrders by {@link FinderPattern#getCount()}, descending.
\n */\n // CenterComparator implements ComparatorEncapsulates logic that can detect a QR Code in an image, even if the QR Code\n * is rotated or skewed, or partially obscured.
\n *\n * @author Sean Owen\n */\n class Detector$2 {\n constructor(image) {\n this.image = image;\n }\n getImage() {\n return this.image;\n }\n getResultPointCallback() {\n return this.resultPointCallback;\n }\n /**\n *Detects a QR Code in an image.
\n *\n * @return {@link DetectorResult} encapsulating results of detecting a QR Code\n * @throws NotFoundException if QR Code cannot be found\n * @throws FormatException if a QR Code cannot be decoded\n */\n // public detect(): DetectorResult /*throws NotFoundException, FormatException*/ {\n // return detect(null)\n // }\n /**\n *Detects a QR Code in an image.
\n *\n * @param hints optional hints to detector\n * @return {@link DetectorResult} encapsulating results of detecting a QR Code\n * @throws NotFoundException if QR Code cannot be found\n * @throws FormatException if a QR Code cannot be decoded\n */\n detect(hints) {\n this.resultPointCallback = (hints === null || hints === undefined) ? null :\n /*(ResultPointCallback) */ hints.get(DecodeHintType$1.NEED_RESULT_POINT_CALLBACK);\n const finder = new FinderPatternFinder(this.image, this.resultPointCallback);\n const info = finder.find(hints);\n return this.processFinderPatternInfo(info);\n }\n processFinderPatternInfo(info) {\n const topLeft = info.getTopLeft();\n const topRight = info.getTopRight();\n const bottomLeft = info.getBottomLeft();\n const moduleSize = this.calculateModuleSize(topLeft, topRight, bottomLeft);\n if (moduleSize < 1.0) {\n throw new NotFoundException('No pattern found in proccess finder.');\n }\n const dimension = Detector$2.computeDimension(topLeft, topRight, bottomLeft, moduleSize);\n const provisionalVersion = Version$1.getProvisionalVersionForDimension(dimension);\n const modulesBetweenFPCenters = provisionalVersion.getDimensionForVersion() - 7;\n let alignmentPattern = null;\n // Anything above version 1 has an alignment pattern\n if (provisionalVersion.getAlignmentPatternCenters().length > 0) {\n // Guess where a \"bottom right\" finder pattern would have been\n const bottomRightX = topRight.getX() - topLeft.getX() + bottomLeft.getX();\n const bottomRightY = topRight.getY() - topLeft.getY() + bottomLeft.getY();\n // Estimate that alignment pattern is closer by 3 modules\n // from \"bottom right\" to known top left location\n const correctionToTopLeft = 1.0 - 3.0 / modulesBetweenFPCenters;\n const estAlignmentX = /*(int) */ Math.floor(topLeft.getX() + correctionToTopLeft * (bottomRightX - topLeft.getX()));\n const estAlignmentY = /*(int) */ Math.floor(topLeft.getY() + correctionToTopLeft * (bottomRightY - topLeft.getY()));\n // Kind of arbitrary -- expand search radius before giving up\n for (let i = 4; i <= 16; i <<= 1) {\n try {\n alignmentPattern = this.findAlignmentInRegion(moduleSize, estAlignmentX, estAlignmentY, i);\n break;\n }\n catch (re /*NotFoundException*/) {\n if (!(re instanceof NotFoundException)) {\n throw re;\n }\n // try next round\n }\n }\n // If we didn't find alignment pattern... well try anyway without it\n }\n const transform = Detector$2.createTransform(topLeft, topRight, bottomLeft, alignmentPattern, dimension);\n const bits = Detector$2.sampleGrid(this.image, transform, dimension);\n let points;\n if (alignmentPattern === null) {\n points = [bottomLeft, topLeft, topRight];\n }\n else {\n points = [bottomLeft, topLeft, topRight, alignmentPattern];\n }\n return new DetectorResult(bits, points);\n }\n static createTransform(topLeft, topRight, bottomLeft, alignmentPattern, dimension /*int*/) {\n const dimMinusThree = dimension - 3.5;\n let bottomRightX; /*float*/\n let bottomRightY; /*float*/\n let sourceBottomRightX; /*float*/\n let sourceBottomRightY; /*float*/\n if (alignmentPattern !== null) {\n bottomRightX = alignmentPattern.getX();\n bottomRightY = alignmentPattern.getY();\n sourceBottomRightX = dimMinusThree - 3.0;\n sourceBottomRightY = sourceBottomRightX;\n }\n else {\n // Don't have an alignment pattern, just make up the bottom-right point\n bottomRightX = (topRight.getX() - topLeft.getX()) + bottomLeft.getX();\n bottomRightY = (topRight.getY() - topLeft.getY()) + bottomLeft.getY();\n sourceBottomRightX = dimMinusThree;\n sourceBottomRightY = dimMinusThree;\n }\n return PerspectiveTransform.quadrilateralToQuadrilateral(3.5, 3.5, dimMinusThree, 3.5, sourceBottomRightX, sourceBottomRightY, 3.5, dimMinusThree, topLeft.getX(), topLeft.getY(), topRight.getX(), topRight.getY(), bottomRightX, bottomRightY, bottomLeft.getX(), bottomLeft.getY());\n }\n static sampleGrid(image, transform, dimension /*int*/) {\n const sampler = GridSamplerInstance.getInstance();\n return sampler.sampleGridWithTransform(image, dimension, dimension, transform);\n }\n /**\n *Computes the dimension (number of modules on a size) of the QR Code based on the position\n * of the finder patterns and estimated module size.
\n */\n static computeDimension(topLeft, topRight, bottomLeft, moduleSize /*float*/) {\n const tltrCentersDimension = MathUtils.round(ResultPoint.distance(topLeft, topRight) / moduleSize);\n const tlblCentersDimension = MathUtils.round(ResultPoint.distance(topLeft, bottomLeft) / moduleSize);\n let dimension = Math.floor((tltrCentersDimension + tlblCentersDimension) / 2) + 7;\n switch (dimension & 0x03) { // mod 4\n case 0:\n dimension++;\n break;\n // 1? do nothing\n case 2:\n dimension--;\n break;\n case 3:\n throw new NotFoundException('Dimensions could be not found.');\n }\n return dimension;\n }\n /**\n *Computes an average estimated module size based on estimated derived from the positions\n * of the three finder patterns.
\n *\n * @param topLeft detected top-left finder pattern center\n * @param topRight detected top-right finder pattern center\n * @param bottomLeft detected bottom-left finder pattern center\n * @return estimated module size\n */\n calculateModuleSize(topLeft, topRight, bottomLeft) {\n // Take the average\n return (this.calculateModuleSizeOneWay(topLeft, topRight) +\n this.calculateModuleSizeOneWay(topLeft, bottomLeft)) / 2.0;\n }\n /**\n *Estimates module size based on two finder patterns -- it uses\n * {@link #sizeOfBlackWhiteBlackRunBothWays(int, int, int, int)} to figure the\n * width of each, measuring along the axis between their centers.
\n */\n calculateModuleSizeOneWay(pattern, otherPattern) {\n const moduleSizeEst1 = this.sizeOfBlackWhiteBlackRunBothWays(/*(int) */ Math.floor(pattern.getX()), \n /*(int) */ Math.floor(pattern.getY()), \n /*(int) */ Math.floor(otherPattern.getX()), \n /*(int) */ Math.floor(otherPattern.getY()));\n const moduleSizeEst2 = this.sizeOfBlackWhiteBlackRunBothWays(/*(int) */ Math.floor(otherPattern.getX()), \n /*(int) */ Math.floor(otherPattern.getY()), \n /*(int) */ Math.floor(pattern.getX()), \n /*(int) */ Math.floor(pattern.getY()));\n if (isNaN(moduleSizeEst1)) {\n return moduleSizeEst2 / 7.0;\n }\n if (isNaN(moduleSizeEst2)) {\n return moduleSizeEst1 / 7.0;\n }\n // Average them, and divide by 7 since we've counted the width of 3 black modules,\n // and 1 white and 1 black module on either side. Ergo, divide sum by 14.\n return (moduleSizeEst1 + moduleSizeEst2) / 14.0;\n }\n /**\n * See {@link #sizeOfBlackWhiteBlackRun(int, int, int, int)}; computes the total width of\n * a finder pattern by looking for a black-white-black run from the center in the direction\n * of another point (another finder pattern center), and in the opposite direction too.\n */\n sizeOfBlackWhiteBlackRunBothWays(fromX /*int*/, fromY /*int*/, toX /*int*/, toY /*int*/) {\n let result = this.sizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY);\n // Now count other way -- don't run off image though of course\n let scale = 1.0;\n let otherToX = fromX - (toX - fromX);\n if (otherToX < 0) {\n scale = fromX / /*(float) */ (fromX - otherToX);\n otherToX = 0;\n }\n else if (otherToX >= this.image.getWidth()) {\n scale = (this.image.getWidth() - 1 - fromX) / /*(float) */ (otherToX - fromX);\n otherToX = this.image.getWidth() - 1;\n }\n let otherToY = /*(int) */ Math.floor(fromY - (toY - fromY) * scale);\n scale = 1.0;\n if (otherToY < 0) {\n scale = fromY / /*(float) */ (fromY - otherToY);\n otherToY = 0;\n }\n else if (otherToY >= this.image.getHeight()) {\n scale = (this.image.getHeight() - 1 - fromY) / /*(float) */ (otherToY - fromY);\n otherToY = this.image.getHeight() - 1;\n }\n otherToX = /*(int) */ Math.floor(fromX + (otherToX - fromX) * scale);\n result += this.sizeOfBlackWhiteBlackRun(fromX, fromY, otherToX, otherToY);\n // Middle pixel is double-counted this way; subtract 1\n return result - 1.0;\n }\n /**\n *This method traces a line from a point in the image, in the direction towards another point.\n * It begins in a black region, and keeps going until it finds white, then black, then white again.\n * It reports the distance from the start to this point.
\n *\n *This is used when figuring out how wide a finder pattern is, when the finder pattern\n * may be skewed or rotated.
\n */\n sizeOfBlackWhiteBlackRun(fromX /*int*/, fromY /*int*/, toX /*int*/, toY /*int*/) {\n // Mild variant of Bresenham's algorithm\n // see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm\n const steep = Math.abs(toY - fromY) > Math.abs(toX - fromX);\n if (steep) {\n let temp = fromX;\n fromX = fromY;\n fromY = temp;\n temp = toX;\n toX = toY;\n toY = temp;\n }\n const dx = Math.abs(toX - fromX);\n const dy = Math.abs(toY - fromY);\n let error = -dx / 2;\n const xstep = fromX < toX ? 1 : -1;\n const ystep = fromY < toY ? 1 : -1;\n // In black pixels, looking for white, first or second time.\n let state = 0;\n // Loop up until x == toX, but not beyond\n const xLimit = toX + xstep;\n for (let x = fromX, y = fromY; x !== xLimit; x += xstep) {\n const realX = steep ? y : x;\n const realY = steep ? x : y;\n // Does current pixel mean we have moved white to black or vice versa?\n // Scanning black in state 0,2 and white in state 1, so if we find the wrong\n // color, advance to next state or end if we are in state 2 already\n if ((state === 1) === this.image.get(realX, realY)) {\n if (state === 2) {\n return MathUtils.distance(x, y, fromX, fromY);\n }\n state++;\n }\n error += dy;\n if (error > 0) {\n if (y === toY) {\n break;\n }\n y += ystep;\n error -= dx;\n }\n }\n // Found black-white-black; give the benefit of the doubt that the next pixel outside the image\n // is \"white\" so this last point at (toX+xStep,toY) is the right ending. This is really a\n // small approximation; (toX+xStep,toY+yStep) might be really correct. Ignore this.\n if (state === 2) {\n return MathUtils.distance(toX + xstep, toY, fromX, fromY);\n }\n // else we didn't find even black-white-black; no estimate is really possible\n return NaN;\n }\n /**\n *Attempts to locate an alignment pattern in a limited region of the image, which is\n * guessed to contain it. This method uses {@link AlignmentPattern}.
\n *\n * @param overallEstModuleSize estimated module size so far\n * @param estAlignmentX x coordinate of center of area probably containing alignment pattern\n * @param estAlignmentY y coordinate of above\n * @param allowanceFactor number of pixels in all directions to search from the center\n * @return {@link AlignmentPattern} if found, or null otherwise\n * @throws NotFoundException if an unexpected error occurs during detection\n */\n findAlignmentInRegion(overallEstModuleSize /*float*/, estAlignmentX /*int*/, estAlignmentY /*int*/, allowanceFactor /*float*/) {\n // Look for an alignment pattern (3 modules in size) around where it\n // should be\n const allowance = /*(int) */ Math.floor(allowanceFactor * overallEstModuleSize);\n const alignmentAreaLeftX = Math.max(0, estAlignmentX - allowance);\n const alignmentAreaRightX = Math.min(this.image.getWidth() - 1, estAlignmentX + allowance);\n if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) {\n throw new NotFoundException('Alignment top exceeds estimated module size.');\n }\n const alignmentAreaTopY = Math.max(0, estAlignmentY - allowance);\n const alignmentAreaBottomY = Math.min(this.image.getHeight() - 1, estAlignmentY + allowance);\n if (alignmentAreaBottomY - alignmentAreaTopY < overallEstModuleSize * 3) {\n throw new NotFoundException('Alignment bottom exceeds estimated module size.');\n }\n const alignmentFinder = new AlignmentPatternFinder(this.image, alignmentAreaLeftX, alignmentAreaTopY, alignmentAreaRightX - alignmentAreaLeftX, alignmentAreaBottomY - alignmentAreaTopY, overallEstModuleSize, this.resultPointCallback);\n return alignmentFinder.find();\n }\n }\n\n /*\n * Copyright 2007 ZXing authors\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 /*import java.util.List;*/\n /*import java.util.Map;*/\n /**\n * This implementation can detect and decode QR Codes in an image.\n *\n * @author Sean Owen\n */\n class QRCodeReader {\n constructor() {\n this.decoder = new Decoder$2();\n }\n getDecoder() {\n return this.decoder;\n }\n /**\n * Locates and decodes a QR code in an image.\n *\n * @return a representing: string the content encoded by the QR code\n * @throws NotFoundException if a QR code cannot be found\n * @throws FormatException if a QR code cannot be decoded\n * @throws ChecksumException if error correction fails\n */\n /*@Override*/\n // public decode(image: BinaryBitmap): Result /*throws NotFoundException, ChecksumException, FormatException */ {\n // return this.decode(image, null)\n // }\n /*@Override*/\n decode(image, hints) {\n let decoderResult;\n let points;\n if (hints !== undefined && hints !== null && undefined !== hints.get(DecodeHintType$1.PURE_BARCODE)) {\n const bits = QRCodeReader.extractPureBits(image.getBlackMatrix());\n decoderResult = this.decoder.decodeBitMatrix(bits, hints);\n points = QRCodeReader.NO_POINTS;\n }\n else {\n const detectorResult = new Detector$2(image.getBlackMatrix()).detect(hints);\n decoderResult = this.decoder.decodeBitMatrix(detectorResult.getBits(), hints);\n points = detectorResult.getPoints();\n }\n // If the code was mirrored: swap the bottom-left and the top-right points.\n if (decoderResult.getOther() instanceof QRCodeDecoderMetaData) {\n decoderResult.getOther().applyMirroredCorrection(points);\n }\n const result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), undefined, points, BarcodeFormat$1.QR_CODE, undefined);\n const byteSegments = decoderResult.getByteSegments();\n if (byteSegments !== null) {\n result.putMetadata(ResultMetadataType$1.BYTE_SEGMENTS, byteSegments);\n }\n const ecLevel = decoderResult.getECLevel();\n if (ecLevel !== null) {\n result.putMetadata(ResultMetadataType$1.ERROR_CORRECTION_LEVEL, ecLevel);\n }\n if (decoderResult.hasStructuredAppend()) {\n result.putMetadata(ResultMetadataType$1.STRUCTURED_APPEND_SEQUENCE, decoderResult.getStructuredAppendSequenceNumber());\n result.putMetadata(ResultMetadataType$1.STRUCTURED_APPEND_PARITY, decoderResult.getStructuredAppendParity());\n }\n return result;\n }\n /*@Override*/\n reset() {\n // do nothing\n }\n /**\n * This method detects a code in a \"pure\" image -- that is, pure monochrome image\n * which contains only an unrotated, unskewed, image of a code, with some white border\n * around it. This is a specialized method that works exceptionally fast in this special\n * case.\n *\n * @see com.google.zxing.datamatrix.DataMatrixReader#extractPureBits(BitMatrix)\n */\n static extractPureBits(image) {\n const leftTopBlack = image.getTopLeftOnBit();\n const rightBottomBlack = image.getBottomRightOnBit();\n if (leftTopBlack === null || rightBottomBlack === null) {\n throw new NotFoundException();\n }\n const moduleSize = this.moduleSize(leftTopBlack, image);\n let top = leftTopBlack[1];\n let bottom = rightBottomBlack[1];\n let left = leftTopBlack[0];\n let right = rightBottomBlack[0];\n // Sanity check!\n if (left >= right || top >= bottom) {\n throw new NotFoundException();\n }\n if (bottom - top !== right - left) {\n // Special case, where bottom-right module wasn't black so we found something else in the last row\n // Assume it's a square, so use height as the width\n right = left + (bottom - top);\n if (right >= image.getWidth()) {\n // Abort if that would not make sense -- off image\n throw new NotFoundException();\n }\n }\n const matrixWidth = Math.round((right - left + 1) / moduleSize);\n const matrixHeight = Math.round((bottom - top + 1) / moduleSize);\n if (matrixWidth <= 0 || matrixHeight <= 0) {\n throw new NotFoundException();\n }\n if (matrixHeight !== matrixWidth) {\n // Only possibly decode square regions\n throw new NotFoundException();\n }\n // Push in the \"border\" by half the module width so that we start\n // sampling in the middle of the module. Just in case the image is a\n // little off, this will help recover.\n const nudge = /*(int) */ Math.floor(moduleSize / 2.0);\n top += nudge;\n left += nudge;\n // But careful that this does not sample off the edge\n // \"right\" is the farthest-right valid pixel location -- right+1 is not necessarily\n // This is positive by how much the inner x loop below would be too large\n const nudgedTooFarRight = left + /*(int) */ Math.floor((matrixWidth - 1) * moduleSize) - right;\n if (nudgedTooFarRight > 0) {\n if (nudgedTooFarRight > nudge) {\n // Neither way fits; abort\n throw new NotFoundException();\n }\n left -= nudgedTooFarRight;\n }\n // See logic above\n const nudgedTooFarDown = top + /*(int) */ Math.floor((matrixHeight - 1) * moduleSize) - bottom;\n if (nudgedTooFarDown > 0) {\n if (nudgedTooFarDown > nudge) {\n // Neither way fits; abort\n throw new NotFoundException();\n }\n top -= nudgedTooFarDown;\n }\n // Now just read off the bits\n const bits = new BitMatrix(matrixWidth, matrixHeight);\n for (let y = 0; y < matrixHeight; y++) {\n const iOffset = top + /*(int) */ Math.floor(y * moduleSize);\n for (let x = 0; x < matrixWidth; x++) {\n if (image.get(left + /*(int) */ Math.floor(x * moduleSize), iOffset)) {\n bits.set(x, y);\n }\n }\n }\n return bits;\n }\n static moduleSize(leftTopBlack, image) {\n const height = image.getHeight();\n const width = image.getWidth();\n let x = leftTopBlack[0];\n let y = leftTopBlack[1];\n let inBlack = true;\n let transitions = 0;\n while (x < width && y < height) {\n if (inBlack !== image.get(x, y)) {\n if (++transitions === 5) {\n break;\n }\n inBlack = !inBlack;\n }\n x++;\n y++;\n }\n if (x === width || y === height) {\n throw new NotFoundException();\n }\n return (x - leftTopBlack[0]) / 7.0;\n }\n }\n QRCodeReader.NO_POINTS = new Array();\n\n /*\n * Copyright 2009 ZXing authors\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 /**\n * @author SITA Lab (kevin.osullivan@sita.aero)\n * @author Guenther Grau\n */\n /*public final*/ class PDF417Common {\n PDF417Common() {\n }\n /**\n * @param moduleBitCount values to sum\n * @return sum of values\n * @deprecated call {@link MathUtils#sum(int[])}\n */\n // @Deprecated\n static getBitCountSum(moduleBitCount) {\n return MathUtils.sum(moduleBitCount);\n }\n static toIntArray(list) {\n if (list == null || !list.length) {\n return PDF417Common.EMPTY_INT_ARRAY;\n }\n const result = new Int32Array(list.length);\n let i = 0;\n for (const integer of list) {\n result[i++] = integer;\n }\n return result;\n }\n /**\n * @param symbol encoded symbol to translate to a codeword\n * @return the codeword corresponding to the symbol.\n */\n static getCodeword(symbol /*int*/) {\n const i = Arrays.binarySearch(PDF417Common.SYMBOL_TABLE, symbol & 0x3FFFF);\n if (i < 0) {\n return -1;\n }\n return (PDF417Common.CODEWORD_TABLE[i] - 1) % PDF417Common.NUMBER_OF_CODEWORDS;\n }\n }\n PDF417Common.NUMBER_OF_CODEWORDS = 929;\n // Maximum Codewords (Data + Error).\n PDF417Common.MAX_CODEWORDS_IN_BARCODE = PDF417Common.NUMBER_OF_CODEWORDS - 1;\n PDF417Common.MIN_ROWS_IN_BARCODE = 3;\n PDF417Common.MAX_ROWS_IN_BARCODE = 90;\n // One left row indication column + max 30 data columns + one right row indicator column\n // public static /*final*/ MAX_CODEWORDS_IN_ROW: /*int*/ number = 32;\n PDF417Common.MODULES_IN_CODEWORD = 17;\n PDF417Common.MODULES_IN_STOP_PATTERN = 18;\n PDF417Common.BARS_IN_MODULE = 8;\n PDF417Common.EMPTY_INT_ARRAY = new Int32Array([]);\n /**\n * The sorted table of all possible symbols. Extracted from the PDF417\n * specification. The index of a symbol in this table corresponds to the\n * index into the codeword table.\n */\n PDF417Common.SYMBOL_TABLE = Int32Array.from([\n 0x1025e, 0x1027a, 0x1029e, 0x102bc, 0x102f2, 0x102f4, 0x1032e, 0x1034e, 0x1035c, 0x10396, 0x103a6, 0x103ac,\n 0x10422, 0x10428, 0x10436, 0x10442, 0x10444, 0x10448, 0x10450, 0x1045e, 0x10466, 0x1046c, 0x1047a, 0x10482,\n 0x1049e, 0x104a0, 0x104bc, 0x104c6, 0x104d8, 0x104ee, 0x104f2, 0x104f4, 0x10504, 0x10508, 0x10510, 0x1051e,\n 0x10520, 0x1053c, 0x10540, 0x10578, 0x10586, 0x1058c, 0x10598, 0x105b0, 0x105be, 0x105ce, 0x105dc, 0x105e2,\n 0x105e4, 0x105e8, 0x105f6, 0x1062e, 0x1064e, 0x1065c, 0x1068e, 0x1069c, 0x106b8, 0x106de, 0x106fa, 0x10716,\n 0x10726, 0x1072c, 0x10746, 0x1074c, 0x10758, 0x1076e, 0x10792, 0x10794, 0x107a2, 0x107a4, 0x107a8, 0x107b6,\n 0x10822, 0x10828, 0x10842, 0x10848, 0x10850, 0x1085e, 0x10866, 0x1086c, 0x1087a, 0x10882, 0x10884, 0x10890,\n 0x1089e, 0x108a0, 0x108bc, 0x108c6, 0x108cc, 0x108d8, 0x108ee, 0x108f2, 0x108f4, 0x10902, 0x10908, 0x1091e,\n 0x10920, 0x1093c, 0x10940, 0x10978, 0x10986, 0x10998, 0x109b0, 0x109be, 0x109ce, 0x109dc, 0x109e2, 0x109e4,\n 0x109e8, 0x109f6, 0x10a08, 0x10a10, 0x10a1e, 0x10a20, 0x10a3c, 0x10a40, 0x10a78, 0x10af0, 0x10b06, 0x10b0c,\n 0x10b18, 0x10b30, 0x10b3e, 0x10b60, 0x10b7c, 0x10b8e, 0x10b9c, 0x10bb8, 0x10bc2, 0x10bc4, 0x10bc8, 0x10bd0,\n 0x10bde, 0x10be6, 0x10bec, 0x10c2e, 0x10c4e, 0x10c5c, 0x10c62, 0x10c64, 0x10c68, 0x10c76, 0x10c8e, 0x10c9c,\n 0x10cb8, 0x10cc2, 0x10cc4, 0x10cc8, 0x10cd0, 0x10cde, 0x10ce6, 0x10cec, 0x10cfa, 0x10d0e, 0x10d1c, 0x10d38,\n 0x10d70, 0x10d7e, 0x10d82, 0x10d84, 0x10d88, 0x10d90, 0x10d9e, 0x10da0, 0x10dbc, 0x10dc6, 0x10dcc, 0x10dd8,\n 0x10dee, 0x10df2, 0x10df4, 0x10e16, 0x10e26, 0x10e2c, 0x10e46, 0x10e58, 0x10e6e, 0x10e86, 0x10e8c, 0x10e98,\n 0x10eb0, 0x10ebe, 0x10ece, 0x10edc, 0x10f0a, 0x10f12, 0x10f14, 0x10f22, 0x10f28, 0x10f36, 0x10f42, 0x10f44,\n 0x10f48, 0x10f50, 0x10f5e, 0x10f66, 0x10f6c, 0x10fb2, 0x10fb4, 0x11022, 0x11028, 0x11042, 0x11048, 0x11050,\n 0x1105e, 0x1107a, 0x11082, 0x11084, 0x11090, 0x1109e, 0x110a0, 0x110bc, 0x110c6, 0x110cc, 0x110d8, 0x110ee,\n 0x110f2, 0x110f4, 0x11102, 0x1111e, 0x11120, 0x1113c, 0x11140, 0x11178, 0x11186, 0x11198, 0x111b0, 0x111be,\n 0x111ce, 0x111dc, 0x111e2, 0x111e4, 0x111e8, 0x111f6, 0x11208, 0x1121e, 0x11220, 0x11278, 0x112f0, 0x1130c,\n 0x11330, 0x1133e, 0x11360, 0x1137c, 0x1138e, 0x1139c, 0x113b8, 0x113c2, 0x113c8, 0x113d0, 0x113de, 0x113e6,\n 0x113ec, 0x11408, 0x11410, 0x1141e, 0x11420, 0x1143c, 0x11440, 0x11478, 0x114f0, 0x115e0, 0x1160c, 0x11618,\n 0x11630, 0x1163e, 0x11660, 0x1167c, 0x116c0, 0x116f8, 0x1171c, 0x11738, 0x11770, 0x1177e, 0x11782, 0x11784,\n 0x11788, 0x11790, 0x1179e, 0x117a0, 0x117bc, 0x117c6, 0x117cc, 0x117d8, 0x117ee, 0x1182e, 0x11834, 0x1184e,\n 0x1185c, 0x11862, 0x11864, 0x11868, 0x11876, 0x1188e, 0x1189c, 0x118b8, 0x118c2, 0x118c8, 0x118d0, 0x118de,\n 0x118e6, 0x118ec, 0x118fa, 0x1190e, 0x1191c, 0x11938, 0x11970, 0x1197e, 0x11982, 0x11984, 0x11990, 0x1199e,\n 0x119a0, 0x119bc, 0x119c6, 0x119cc, 0x119d8, 0x119ee, 0x119f2, 0x119f4, 0x11a0e, 0x11a1c, 0x11a38, 0x11a70,\n 0x11a7e, 0x11ae0, 0x11afc, 0x11b08, 0x11b10, 0x11b1e, 0x11b20, 0x11b3c, 0x11b40, 0x11b78, 0x11b8c, 0x11b98,\n 0x11bb0, 0x11bbe, 0x11bce, 0x11bdc, 0x11be2, 0x11be4, 0x11be8, 0x11bf6, 0x11c16, 0x11c26, 0x11c2c, 0x11c46,\n 0x11c4c, 0x11c58, 0x11c6e, 0x11c86, 0x11c98, 0x11cb0, 0x11cbe, 0x11cce, 0x11cdc, 0x11ce2, 0x11ce4, 0x11ce8,\n 0x11cf6, 0x11d06, 0x11d0c, 0x11d18, 0x11d30, 0x11d3e, 0x11d60, 0x11d7c, 0x11d8e, 0x11d9c, 0x11db8, 0x11dc4,\n 0x11dc8, 0x11dd0, 0x11dde, 0x11de6, 0x11dec, 0x11dfa, 0x11e0a, 0x11e12, 0x11e14, 0x11e22, 0x11e24, 0x11e28,\n 0x11e36, 0x11e42, 0x11e44, 0x11e50, 0x11e5e, 0x11e66, 0x11e6c, 0x11e82, 0x11e84, 0x11e88, 0x11e90, 0x11e9e,\n 0x11ea0, 0x11ebc, 0x11ec6, 0x11ecc, 0x11ed8, 0x11eee, 0x11f1a, 0x11f2e, 0x11f32, 0x11f34, 0x11f4e, 0x11f5c,\n 0x11f62, 0x11f64, 0x11f68, 0x11f76, 0x12048, 0x1205e, 0x12082, 0x12084, 0x12090, 0x1209e, 0x120a0, 0x120bc,\n 0x120d8, 0x120f2, 0x120f4, 0x12108, 0x1211e, 0x12120, 0x1213c, 0x12140, 0x12178, 0x12186, 0x12198, 0x121b0,\n 0x121be, 0x121e2, 0x121e4, 0x121e8, 0x121f6, 0x12204, 0x12210, 0x1221e, 0x12220, 0x12278, 0x122f0, 0x12306,\n 0x1230c, 0x12330, 0x1233e, 0x12360, 0x1237c, 0x1238e, 0x1239c, 0x123b8, 0x123c2, 0x123c8, 0x123d0, 0x123e6,\n 0x123ec, 0x1241e, 0x12420, 0x1243c, 0x124f0, 0x125e0, 0x12618, 0x1263e, 0x12660, 0x1267c, 0x126c0, 0x126f8,\n 0x12738, 0x12770, 0x1277e, 0x12782, 0x12784, 0x12790, 0x1279e, 0x127a0, 0x127bc, 0x127c6, 0x127cc, 0x127d8,\n 0x127ee, 0x12820, 0x1283c, 0x12840, 0x12878, 0x128f0, 0x129e0, 0x12bc0, 0x12c18, 0x12c30, 0x12c3e, 0x12c60,\n 0x12c7c, 0x12cc0, 0x12cf8, 0x12df0, 0x12e1c, 0x12e38, 0x12e70, 0x12e7e, 0x12ee0, 0x12efc, 0x12f04, 0x12f08,\n 0x12f10, 0x12f20, 0x12f3c, 0x12f40, 0x12f78, 0x12f86, 0x12f8c, 0x12f98, 0x12fb0, 0x12fbe, 0x12fce, 0x12fdc,\n 0x1302e, 0x1304e, 0x1305c, 0x13062, 0x13068, 0x1308e, 0x1309c, 0x130b8, 0x130c2, 0x130c8, 0x130d0, 0x130de,\n 0x130ec, 0x130fa, 0x1310e, 0x13138, 0x13170, 0x1317e, 0x13182, 0x13184, 0x13190, 0x1319e, 0x131a0, 0x131bc,\n 0x131c6, 0x131cc, 0x131d8, 0x131f2, 0x131f4, 0x1320e, 0x1321c, 0x13270, 0x1327e, 0x132e0, 0x132fc, 0x13308,\n 0x1331e, 0x13320, 0x1333c, 0x13340, 0x13378, 0x13386, 0x13398, 0x133b0, 0x133be, 0x133ce, 0x133dc, 0x133e2,\n 0x133e4, 0x133e8, 0x133f6, 0x1340e, 0x1341c, 0x13438, 0x13470, 0x1347e, 0x134e0, 0x134fc, 0x135c0, 0x135f8,\n 0x13608, 0x13610, 0x1361e, 0x13620, 0x1363c, 0x13640, 0x13678, 0x136f0, 0x1370c, 0x13718, 0x13730, 0x1373e,\n 0x13760, 0x1377c, 0x1379c, 0x137b8, 0x137c2, 0x137c4, 0x137c8, 0x137d0, 0x137de, 0x137e6, 0x137ec, 0x13816,\n 0x13826, 0x1382c, 0x13846, 0x1384c, 0x13858, 0x1386e, 0x13874, 0x13886, 0x13898, 0x138b0, 0x138be, 0x138ce,\n 0x138dc, 0x138e2, 0x138e4, 0x138e8, 0x13906, 0x1390c, 0x13930, 0x1393e, 0x13960, 0x1397c, 0x1398e, 0x1399c,\n 0x139b8, 0x139c8, 0x139d0, 0x139de, 0x139e6, 0x139ec, 0x139fa, 0x13a06, 0x13a0c, 0x13a18, 0x13a30, 0x13a3e,\n 0x13a60, 0x13a7c, 0x13ac0, 0x13af8, 0x13b0e, 0x13b1c, 0x13b38, 0x13b70, 0x13b7e, 0x13b88, 0x13b90, 0x13b9e,\n 0x13ba0, 0x13bbc, 0x13bcc, 0x13bd8, 0x13bee, 0x13bf2, 0x13bf4, 0x13c12, 0x13c14, 0x13c22, 0x13c24, 0x13c28,\n 0x13c36, 0x13c42, 0x13c48, 0x13c50, 0x13c5e, 0x13c66, 0x13c6c, 0x13c82, 0x13c84, 0x13c90, 0x13c9e, 0x13ca0,\n 0x13cbc, 0x13cc6, 0x13ccc, 0x13cd8, 0x13cee, 0x13d02, 0x13d04, 0x13d08, 0x13d10, 0x13d1e, 0x13d20, 0x13d3c,\n 0x13d40, 0x13d78, 0x13d86, 0x13d8c, 0x13d98, 0x13db0, 0x13dbe, 0x13dce, 0x13ddc, 0x13de4, 0x13de8, 0x13df6,\n 0x13e1a, 0x13e2e, 0x13e32, 0x13e34, 0x13e4e, 0x13e5c, 0x13e62, 0x13e64, 0x13e68, 0x13e76, 0x13e8e, 0x13e9c,\n 0x13eb8, 0x13ec2, 0x13ec4, 0x13ec8, 0x13ed0, 0x13ede, 0x13ee6, 0x13eec, 0x13f26, 0x13f2c, 0x13f3a, 0x13f46,\n 0x13f4c, 0x13f58, 0x13f6e, 0x13f72, 0x13f74, 0x14082, 0x1409e, 0x140a0, 0x140bc, 0x14104, 0x14108, 0x14110,\n 0x1411e, 0x14120, 0x1413c, 0x14140, 0x14178, 0x1418c, 0x14198, 0x141b0, 0x141be, 0x141e2, 0x141e4, 0x141e8,\n 0x14208, 0x14210, 0x1421e, 0x14220, 0x1423c, 0x14240, 0x14278, 0x142f0, 0x14306, 0x1430c, 0x14318, 0x14330,\n 0x1433e, 0x14360, 0x1437c, 0x1438e, 0x143c2, 0x143c4, 0x143c8, 0x143d0, 0x143e6, 0x143ec, 0x14408, 0x14410,\n 0x1441e, 0x14420, 0x1443c, 0x14440, 0x14478, 0x144f0, 0x145e0, 0x1460c, 0x14618, 0x14630, 0x1463e, 0x14660,\n 0x1467c, 0x146c0, 0x146f8, 0x1471c, 0x14738, 0x14770, 0x1477e, 0x14782, 0x14784, 0x14788, 0x14790, 0x147a0,\n 0x147bc, 0x147c6, 0x147cc, 0x147d8, 0x147ee, 0x14810, 0x14820, 0x1483c, 0x14840, 0x14878, 0x148f0, 0x149e0,\n 0x14bc0, 0x14c30, 0x14c3e, 0x14c60, 0x14c7c, 0x14cc0, 0x14cf8, 0x14df0, 0x14e38, 0x14e70, 0x14e7e, 0x14ee0,\n 0x14efc, 0x14f04, 0x14f08, 0x14f10, 0x14f1e, 0x14f20, 0x14f3c, 0x14f40, 0x14f78, 0x14f86, 0x14f8c, 0x14f98,\n 0x14fb0, 0x14fce, 0x14fdc, 0x15020, 0x15040, 0x15078, 0x150f0, 0x151e0, 0x153c0, 0x15860, 0x1587c, 0x158c0,\n 0x158f8, 0x159f0, 0x15be0, 0x15c70, 0x15c7e, 0x15ce0, 0x15cfc, 0x15dc0, 0x15df8, 0x15e08, 0x15e10, 0x15e20,\n 0x15e40, 0x15e78, 0x15ef0, 0x15f0c, 0x15f18, 0x15f30, 0x15f60, 0x15f7c, 0x15f8e, 0x15f9c, 0x15fb8, 0x1604e,\n 0x1605c, 0x1608e, 0x1609c, 0x160b8, 0x160c2, 0x160c4, 0x160c8, 0x160de, 0x1610e, 0x1611c, 0x16138, 0x16170,\n 0x1617e, 0x16184, 0x16188, 0x16190, 0x1619e, 0x161a0, 0x161bc, 0x161c6, 0x161cc, 0x161d8, 0x161f2, 0x161f4,\n 0x1620e, 0x1621c, 0x16238, 0x16270, 0x1627e, 0x162e0, 0x162fc, 0x16304, 0x16308, 0x16310, 0x1631e, 0x16320,\n 0x1633c, 0x16340, 0x16378, 0x16386, 0x1638c, 0x16398, 0x163b0, 0x163be, 0x163ce, 0x163dc, 0x163e2, 0x163e4,\n 0x163e8, 0x163f6, 0x1640e, 0x1641c, 0x16438, 0x16470, 0x1647e, 0x164e0, 0x164fc, 0x165c0, 0x165f8, 0x16610,\n 0x1661e, 0x16620, 0x1663c, 0x16640, 0x16678, 0x166f0, 0x16718, 0x16730, 0x1673e, 0x16760, 0x1677c, 0x1678e,\n 0x1679c, 0x167b8, 0x167c2, 0x167c4, 0x167c8, 0x167d0, 0x167de, 0x167e6, 0x167ec, 0x1681c, 0x16838, 0x16870,\n 0x168e0, 0x168fc, 0x169c0, 0x169f8, 0x16bf0, 0x16c10, 0x16c1e, 0x16c20, 0x16c3c, 0x16c40, 0x16c78, 0x16cf0,\n 0x16de0, 0x16e18, 0x16e30, 0x16e3e, 0x16e60, 0x16e7c, 0x16ec0, 0x16ef8, 0x16f1c, 0x16f38, 0x16f70, 0x16f7e,\n 0x16f84, 0x16f88, 0x16f90, 0x16f9e, 0x16fa0, 0x16fbc, 0x16fc6, 0x16fcc, 0x16fd8, 0x17026, 0x1702c, 0x17046,\n 0x1704c, 0x17058, 0x1706e, 0x17086, 0x1708c, 0x17098, 0x170b0, 0x170be, 0x170ce, 0x170dc, 0x170e8, 0x17106,\n 0x1710c, 0x17118, 0x17130, 0x1713e, 0x17160, 0x1717c, 0x1718e, 0x1719c, 0x171b8, 0x171c2, 0x171c4, 0x171c8,\n 0x171d0, 0x171de, 0x171e6, 0x171ec, 0x171fa, 0x17206, 0x1720c, 0x17218, 0x17230, 0x1723e, 0x17260, 0x1727c,\n 0x172c0, 0x172f8, 0x1730e, 0x1731c, 0x17338, 0x17370, 0x1737e, 0x17388, 0x17390, 0x1739e, 0x173a0, 0x173bc,\n 0x173cc, 0x173d8, 0x173ee, 0x173f2, 0x173f4, 0x1740c, 0x17418, 0x17430, 0x1743e, 0x17460, 0x1747c, 0x174c0,\n 0x174f8, 0x175f0, 0x1760e, 0x1761c, 0x17638, 0x17670, 0x1767e, 0x176e0, 0x176fc, 0x17708, 0x17710, 0x1771e,\n 0x17720, 0x1773c, 0x17740, 0x17778, 0x17798, 0x177b0, 0x177be, 0x177dc, 0x177e2, 0x177e4, 0x177e8, 0x17822,\n 0x17824, 0x17828, 0x17836, 0x17842, 0x17844, 0x17848, 0x17850, 0x1785e, 0x17866, 0x1786c, 0x17882, 0x17884,\n 0x17888, 0x17890, 0x1789e, 0x178a0, 0x178bc, 0x178c6, 0x178cc, 0x178d8, 0x178ee, 0x178f2, 0x178f4, 0x17902,\n 0x17904, 0x17908, 0x17910, 0x1791e, 0x17920, 0x1793c, 0x17940, 0x17978, 0x17986, 0x1798c, 0x17998, 0x179b0,\n 0x179be, 0x179ce, 0x179dc, 0x179e2, 0x179e4, 0x179e8, 0x179f6, 0x17a04, 0x17a08, 0x17a10, 0x17a1e, 0x17a20,\n 0x17a3c, 0x17a40, 0x17a78, 0x17af0, 0x17b06, 0x17b0c, 0x17b18, 0x17b30, 0x17b3e, 0x17b60, 0x17b7c, 0x17b8e,\n 0x17b9c, 0x17bb8, 0x17bc4, 0x17bc8, 0x17bd0, 0x17bde, 0x17be6, 0x17bec, 0x17c2e, 0x17c32, 0x17c34, 0x17c4e,\n 0x17c5c, 0x17c62, 0x17c64, 0x17c68, 0x17c76, 0x17c8e, 0x17c9c, 0x17cb8, 0x17cc2, 0x17cc4, 0x17cc8, 0x17cd0,\n 0x17cde, 0x17ce6, 0x17cec, 0x17d0e, 0x17d1c, 0x17d38, 0x17d70, 0x17d82, 0x17d84, 0x17d88, 0x17d90, 0x17d9e,\n 0x17da0, 0x17dbc, 0x17dc6, 0x17dcc, 0x17dd8, 0x17dee, 0x17e26, 0x17e2c, 0x17e3a, 0x17e46, 0x17e4c, 0x17e58,\n 0x17e6e, 0x17e72, 0x17e74, 0x17e86, 0x17e8c, 0x17e98, 0x17eb0, 0x17ece, 0x17edc, 0x17ee2, 0x17ee4, 0x17ee8,\n 0x17ef6, 0x1813a, 0x18172, 0x18174, 0x18216, 0x18226, 0x1823a, 0x1824c, 0x18258, 0x1826e, 0x18272, 0x18274,\n 0x18298, 0x182be, 0x182e2, 0x182e4, 0x182e8, 0x182f6, 0x1835e, 0x1837a, 0x183ae, 0x183d6, 0x18416, 0x18426,\n 0x1842c, 0x1843a, 0x18446, 0x18458, 0x1846e, 0x18472, 0x18474, 0x18486, 0x184b0, 0x184be, 0x184ce, 0x184dc,\n 0x184e2, 0x184e4, 0x184e8, 0x184f6, 0x18506, 0x1850c, 0x18518, 0x18530, 0x1853e, 0x18560, 0x1857c, 0x1858e,\n 0x1859c, 0x185b8, 0x185c2, 0x185c4, 0x185c8, 0x185d0, 0x185de, 0x185e6, 0x185ec, 0x185fa, 0x18612, 0x18614,\n 0x18622, 0x18628, 0x18636, 0x18642, 0x18650, 0x1865e, 0x1867a, 0x18682, 0x18684, 0x18688, 0x18690, 0x1869e,\n 0x186a0, 0x186bc, 0x186c6, 0x186cc, 0x186d8, 0x186ee, 0x186f2, 0x186f4, 0x1872e, 0x1874e, 0x1875c, 0x18796,\n 0x187a6, 0x187ac, 0x187d2, 0x187d4, 0x18826, 0x1882c, 0x1883a, 0x18846, 0x1884c, 0x18858, 0x1886e, 0x18872,\n 0x18874, 0x18886, 0x18898, 0x188b0, 0x188be, 0x188ce, 0x188dc, 0x188e2, 0x188e4, 0x188e8, 0x188f6, 0x1890c,\n 0x18930, 0x1893e, 0x18960, 0x1897c, 0x1898e, 0x189b8, 0x189c2, 0x189c8, 0x189d0, 0x189de, 0x189e6, 0x189ec,\n 0x189fa, 0x18a18, 0x18a30, 0x18a3e, 0x18a60, 0x18a7c, 0x18ac0, 0x18af8, 0x18b1c, 0x18b38, 0x18b70, 0x18b7e,\n 0x18b82, 0x18b84, 0x18b88, 0x18b90, 0x18b9e, 0x18ba0, 0x18bbc, 0x18bc6, 0x18bcc, 0x18bd8, 0x18bee, 0x18bf2,\n 0x18bf4, 0x18c22, 0x18c24, 0x18c28, 0x18c36, 0x18c42, 0x18c48, 0x18c50, 0x18c5e, 0x18c66, 0x18c7a, 0x18c82,\n 0x18c84, 0x18c90, 0x18c9e, 0x18ca0, 0x18cbc, 0x18ccc, 0x18cf2, 0x18cf4, 0x18d04, 0x18d08, 0x18d10, 0x18d1e,\n 0x18d20, 0x18d3c, 0x18d40, 0x18d78, 0x18d86, 0x18d98, 0x18dce, 0x18de2, 0x18de4, 0x18de8, 0x18e2e, 0x18e32,\n 0x18e34, 0x18e4e, 0x18e5c, 0x18e62, 0x18e64, 0x18e68, 0x18e8e, 0x18e9c, 0x18eb8, 0x18ec2, 0x18ec4, 0x18ec8,\n 0x18ed0, 0x18efa, 0x18f16, 0x18f26, 0x18f2c, 0x18f46, 0x18f4c, 0x18f58, 0x18f6e, 0x18f8a, 0x18f92, 0x18f94,\n 0x18fa2, 0x18fa4, 0x18fa8, 0x18fb6, 0x1902c, 0x1903a, 0x19046, 0x1904c, 0x19058, 0x19072, 0x19074, 0x19086,\n 0x19098, 0x190b0, 0x190be, 0x190ce, 0x190dc, 0x190e2, 0x190e8, 0x190f6, 0x19106, 0x1910c, 0x19130, 0x1913e,\n 0x19160, 0x1917c, 0x1918e, 0x1919c, 0x191b8, 0x191c2, 0x191c8, 0x191d0, 0x191de, 0x191e6, 0x191ec, 0x191fa,\n 0x19218, 0x1923e, 0x19260, 0x1927c, 0x192c0, 0x192f8, 0x19338, 0x19370, 0x1937e, 0x19382, 0x19384, 0x19390,\n 0x1939e, 0x193a0, 0x193bc, 0x193c6, 0x193cc, 0x193d8, 0x193ee, 0x193f2, 0x193f4, 0x19430, 0x1943e, 0x19460,\n 0x1947c, 0x194c0, 0x194f8, 0x195f0, 0x19638, 0x19670, 0x1967e, 0x196e0, 0x196fc, 0x19702, 0x19704, 0x19708,\n 0x19710, 0x19720, 0x1973c, 0x19740, 0x19778, 0x19786, 0x1978c, 0x19798, 0x197b0, 0x197be, 0x197ce, 0x197dc,\n 0x197e2, 0x197e4, 0x197e8, 0x19822, 0x19824, 0x19842, 0x19848, 0x19850, 0x1985e, 0x19866, 0x1987a, 0x19882,\n 0x19884, 0x19890, 0x1989e, 0x198a0, 0x198bc, 0x198cc, 0x198f2, 0x198f4, 0x19902, 0x19908, 0x1991e, 0x19920,\n 0x1993c, 0x19940, 0x19978, 0x19986, 0x19998, 0x199ce, 0x199e2, 0x199e4, 0x199e8, 0x19a08, 0x19a10, 0x19a1e,\n 0x19a20, 0x19a3c, 0x19a40, 0x19a78, 0x19af0, 0x19b18, 0x19b3e, 0x19b60, 0x19b9c, 0x19bc2, 0x19bc4, 0x19bc8,\n 0x19bd0, 0x19be6, 0x19c2e, 0x19c34, 0x19c4e, 0x19c5c, 0x19c62, 0x19c64, 0x19c68, 0x19c8e, 0x19c9c, 0x19cb8,\n 0x19cc2, 0x19cc8, 0x19cd0, 0x19ce6, 0x19cfa, 0x19d0e, 0x19d1c, 0x19d38, 0x19d70, 0x19d7e, 0x19d82, 0x19d84,\n 0x19d88, 0x19d90, 0x19da0, 0x19dcc, 0x19df2, 0x19df4, 0x19e16, 0x19e26, 0x19e2c, 0x19e46, 0x19e4c, 0x19e58,\n 0x19e74, 0x19e86, 0x19e8c, 0x19e98, 0x19eb0, 0x19ebe, 0x19ece, 0x19ee2, 0x19ee4, 0x19ee8, 0x19f0a, 0x19f12,\n 0x19f14, 0x19f22, 0x19f24, 0x19f28, 0x19f42, 0x19f44, 0x19f48, 0x19f50, 0x19f5e, 0x19f6c, 0x19f9a, 0x19fae,\n 0x19fb2, 0x19fb4, 0x1a046, 0x1a04c, 0x1a072, 0x1a074, 0x1a086, 0x1a08c, 0x1a098, 0x1a0b0, 0x1a0be, 0x1a0e2,\n 0x1a0e4, 0x1a0e8, 0x1a0f6, 0x1a106, 0x1a10c, 0x1a118, 0x1a130, 0x1a13e, 0x1a160, 0x1a17c, 0x1a18e, 0x1a19c,\n 0x1a1b8, 0x1a1c2, 0x1a1c4, 0x1a1c8, 0x1a1d0, 0x1a1de, 0x1a1e6, 0x1a1ec, 0x1a218, 0x1a230, 0x1a23e, 0x1a260,\n 0x1a27c, 0x1a2c0, 0x1a2f8, 0x1a31c, 0x1a338, 0x1a370, 0x1a37e, 0x1a382, 0x1a384, 0x1a388, 0x1a390, 0x1a39e,\n 0x1a3a0, 0x1a3bc, 0x1a3c6, 0x1a3cc, 0x1a3d8, 0x1a3ee, 0x1a3f2, 0x1a3f4, 0x1a418, 0x1a430, 0x1a43e, 0x1a460,\n 0x1a47c, 0x1a4c0, 0x1a4f8, 0x1a5f0, 0x1a61c, 0x1a638, 0x1a670, 0x1a67e, 0x1a6e0, 0x1a6fc, 0x1a702, 0x1a704,\n 0x1a708, 0x1a710, 0x1a71e, 0x1a720, 0x1a73c, 0x1a740, 0x1a778, 0x1a786, 0x1a78c, 0x1a798, 0x1a7b0, 0x1a7be,\n 0x1a7ce, 0x1a7dc, 0x1a7e2, 0x1a7e4, 0x1a7e8, 0x1a830, 0x1a860, 0x1a87c, 0x1a8c0, 0x1a8f8, 0x1a9f0, 0x1abe0,\n 0x1ac70, 0x1ac7e, 0x1ace0, 0x1acfc, 0x1adc0, 0x1adf8, 0x1ae04, 0x1ae08, 0x1ae10, 0x1ae20, 0x1ae3c, 0x1ae40,\n 0x1ae78, 0x1aef0, 0x1af06, 0x1af0c, 0x1af18, 0x1af30, 0x1af3e, 0x1af60, 0x1af7c, 0x1af8e, 0x1af9c, 0x1afb8,\n 0x1afc4, 0x1afc8, 0x1afd0, 0x1afde, 0x1b042, 0x1b05e, 0x1b07a, 0x1b082, 0x1b084, 0x1b088, 0x1b090, 0x1b09e,\n 0x1b0a0, 0x1b0bc, 0x1b0cc, 0x1b0f2, 0x1b0f4, 0x1b102, 0x1b104, 0x1b108, 0x1b110, 0x1b11e, 0x1b120, 0x1b13c,\n 0x1b140, 0x1b178, 0x1b186, 0x1b198, 0x1b1ce, 0x1b1e2, 0x1b1e4, 0x1b1e8, 0x1b204, 0x1b208, 0x1b210, 0x1b21e,\n 0x1b220, 0x1b23c, 0x1b240, 0x1b278, 0x1b2f0, 0x1b30c, 0x1b33e, 0x1b360, 0x1b39c, 0x1b3c2, 0x1b3c4, 0x1b3c8,\n 0x1b3d0, 0x1b3e6, 0x1b410, 0x1b41e, 0x1b420, 0x1b43c, 0x1b440, 0x1b478, 0x1b4f0, 0x1b5e0, 0x1b618, 0x1b660,\n 0x1b67c, 0x1b6c0, 0x1b738, 0x1b782, 0x1b784, 0x1b788, 0x1b790, 0x1b79e, 0x1b7a0, 0x1b7cc, 0x1b82e, 0x1b84e,\n 0x1b85c, 0x1b88e, 0x1b89c, 0x1b8b8, 0x1b8c2, 0x1b8c4, 0x1b8c8, 0x1b8d0, 0x1b8e6, 0x1b8fa, 0x1b90e, 0x1b91c,\n 0x1b938, 0x1b970, 0x1b97e, 0x1b982, 0x1b984, 0x1b988, 0x1b990, 0x1b99e, 0x1b9a0, 0x1b9cc, 0x1b9f2, 0x1b9f4,\n 0x1ba0e, 0x1ba1c, 0x1ba38, 0x1ba70, 0x1ba7e, 0x1bae0, 0x1bafc, 0x1bb08, 0x1bb10, 0x1bb20, 0x1bb3c, 0x1bb40,\n 0x1bb98, 0x1bbce, 0x1bbe2, 0x1bbe4, 0x1bbe8, 0x1bc16, 0x1bc26, 0x1bc2c, 0x1bc46, 0x1bc4c, 0x1bc58, 0x1bc72,\n 0x1bc74, 0x1bc86, 0x1bc8c, 0x1bc98, 0x1bcb0, 0x1bcbe, 0x1bcce, 0x1bce2, 0x1bce4, 0x1bce8, 0x1bd06, 0x1bd0c,\n 0x1bd18, 0x1bd30, 0x1bd3e, 0x1bd60, 0x1bd7c, 0x1bd9c, 0x1bdc2, 0x1bdc4, 0x1bdc8, 0x1bdd0, 0x1bde6, 0x1bdfa,\n 0x1be12, 0x1be14, 0x1be22, 0x1be24, 0x1be28, 0x1be42, 0x1be44, 0x1be48, 0x1be50, 0x1be5e, 0x1be66, 0x1be82,\n 0x1be84, 0x1be88, 0x1be90, 0x1be9e, 0x1bea0, 0x1bebc, 0x1becc, 0x1bef4, 0x1bf1a, 0x1bf2e, 0x1bf32, 0x1bf34,\n 0x1bf4e, 0x1bf5c, 0x1bf62, 0x1bf64, 0x1bf68, 0x1c09a, 0x1c0b2, 0x1c0b4, 0x1c11a, 0x1c132, 0x1c134, 0x1c162,\n 0x1c164, 0x1c168, 0x1c176, 0x1c1ba, 0x1c21a, 0x1c232, 0x1c234, 0x1c24e, 0x1c25c, 0x1c262, 0x1c264, 0x1c268,\n 0x1c276, 0x1c28e, 0x1c2c2, 0x1c2c4, 0x1c2c8, 0x1c2d0, 0x1c2de, 0x1c2e6, 0x1c2ec, 0x1c2fa, 0x1c316, 0x1c326,\n 0x1c33a, 0x1c346, 0x1c34c, 0x1c372, 0x1c374, 0x1c41a, 0x1c42e, 0x1c432, 0x1c434, 0x1c44e, 0x1c45c, 0x1c462,\n 0x1c464, 0x1c468, 0x1c476, 0x1c48e, 0x1c49c, 0x1c4b8, 0x1c4c2, 0x1c4c8, 0x1c4d0, 0x1c4de, 0x1c4e6, 0x1c4ec,\n 0x1c4fa, 0x1c51c, 0x1c538, 0x1c570, 0x1c57e, 0x1c582, 0x1c584, 0x1c588, 0x1c590, 0x1c59e, 0x1c5a0, 0x1c5bc,\n 0x1c5c6, 0x1c5cc, 0x1c5d8, 0x1c5ee, 0x1c5f2, 0x1c5f4, 0x1c616, 0x1c626, 0x1c62c, 0x1c63a, 0x1c646, 0x1c64c,\n 0x1c658, 0x1c66e, 0x1c672, 0x1c674, 0x1c686, 0x1c68c, 0x1c698, 0x1c6b0, 0x1c6be, 0x1c6ce, 0x1c6dc, 0x1c6e2,\n 0x1c6e4, 0x1c6e8, 0x1c712, 0x1c714, 0x1c722, 0x1c728, 0x1c736, 0x1c742, 0x1c744, 0x1c748, 0x1c750, 0x1c75e,\n 0x1c766, 0x1c76c, 0x1c77a, 0x1c7ae, 0x1c7d6, 0x1c7ea, 0x1c81a, 0x1c82e, 0x1c832, 0x1c834, 0x1c84e, 0x1c85c,\n 0x1c862, 0x1c864, 0x1c868, 0x1c876, 0x1c88e, 0x1c89c, 0x1c8b8, 0x1c8c2, 0x1c8c8, 0x1c8d0, 0x1c8de, 0x1c8e6,\n 0x1c8ec, 0x1c8fa, 0x1c90e, 0x1c938, 0x1c970, 0x1c97e, 0x1c982, 0x1c984, 0x1c990, 0x1c99e, 0x1c9a0, 0x1c9bc,\n 0x1c9c6, 0x1c9cc, 0x1c9d8, 0x1c9ee, 0x1c9f2, 0x1c9f4, 0x1ca38, 0x1ca70, 0x1ca7e, 0x1cae0, 0x1cafc, 0x1cb02,\n 0x1cb04, 0x1cb08, 0x1cb10, 0x1cb20, 0x1cb3c, 0x1cb40, 0x1cb78, 0x1cb86, 0x1cb8c, 0x1cb98, 0x1cbb0, 0x1cbbe,\n 0x1cbce, 0x1cbdc, 0x1cbe2, 0x1cbe4, 0x1cbe8, 0x1cbf6, 0x1cc16, 0x1cc26, 0x1cc2c, 0x1cc3a, 0x1cc46, 0x1cc58,\n 0x1cc72, 0x1cc74, 0x1cc86, 0x1ccb0, 0x1ccbe, 0x1ccce, 0x1cce2, 0x1cce4, 0x1cce8, 0x1cd06, 0x1cd0c, 0x1cd18,\n 0x1cd30, 0x1cd3e, 0x1cd60, 0x1cd7c, 0x1cd9c, 0x1cdc2, 0x1cdc4, 0x1cdc8, 0x1cdd0, 0x1cdde, 0x1cde6, 0x1cdfa,\n 0x1ce22, 0x1ce28, 0x1ce42, 0x1ce50, 0x1ce5e, 0x1ce66, 0x1ce7a, 0x1ce82, 0x1ce84, 0x1ce88, 0x1ce90, 0x1ce9e,\n 0x1cea0, 0x1cebc, 0x1cecc, 0x1cef2, 0x1cef4, 0x1cf2e, 0x1cf32, 0x1cf34, 0x1cf4e, 0x1cf5c, 0x1cf62, 0x1cf64,\n 0x1cf68, 0x1cf96, 0x1cfa6, 0x1cfac, 0x1cfca, 0x1cfd2, 0x1cfd4, 0x1d02e, 0x1d032, 0x1d034, 0x1d04e, 0x1d05c,\n 0x1d062, 0x1d064, 0x1d068, 0x1d076, 0x1d08e, 0x1d09c, 0x1d0b8, 0x1d0c2, 0x1d0c4, 0x1d0c8, 0x1d0d0, 0x1d0de,\n 0x1d0e6, 0x1d0ec, 0x1d0fa, 0x1d11c, 0x1d138, 0x1d170, 0x1d17e, 0x1d182, 0x1d184, 0x1d188, 0x1d190, 0x1d19e,\n 0x1d1a0, 0x1d1bc, 0x1d1c6, 0x1d1cc, 0x1d1d8, 0x1d1ee, 0x1d1f2, 0x1d1f4, 0x1d21c, 0x1d238, 0x1d270, 0x1d27e,\n 0x1d2e0, 0x1d2fc, 0x1d302, 0x1d304, 0x1d308, 0x1d310, 0x1d31e, 0x1d320, 0x1d33c, 0x1d340, 0x1d378, 0x1d386,\n 0x1d38c, 0x1d398, 0x1d3b0, 0x1d3be, 0x1d3ce, 0x1d3dc, 0x1d3e2, 0x1d3e4, 0x1d3e8, 0x1d3f6, 0x1d470, 0x1d47e,\n 0x1d4e0, 0x1d4fc, 0x1d5c0, 0x1d5f8, 0x1d604, 0x1d608, 0x1d610, 0x1d620, 0x1d640, 0x1d678, 0x1d6f0, 0x1d706,\n 0x1d70c, 0x1d718, 0x1d730, 0x1d73e, 0x1d760, 0x1d77c, 0x1d78e, 0x1d79c, 0x1d7b8, 0x1d7c2, 0x1d7c4, 0x1d7c8,\n 0x1d7d0, 0x1d7de, 0x1d7e6, 0x1d7ec, 0x1d826, 0x1d82c, 0x1d83a, 0x1d846, 0x1d84c, 0x1d858, 0x1d872, 0x1d874,\n 0x1d886, 0x1d88c, 0x1d898, 0x1d8b0, 0x1d8be, 0x1d8ce, 0x1d8e2, 0x1d8e4, 0x1d8e8, 0x1d8f6, 0x1d90c, 0x1d918,\n 0x1d930, 0x1d93e, 0x1d960, 0x1d97c, 0x1d99c, 0x1d9c2, 0x1d9c4, 0x1d9c8, 0x1d9d0, 0x1d9e6, 0x1d9fa, 0x1da0c,\n 0x1da18, 0x1da30, 0x1da3e, 0x1da60, 0x1da7c, 0x1dac0, 0x1daf8, 0x1db38, 0x1db82, 0x1db84, 0x1db88, 0x1db90,\n 0x1db9e, 0x1dba0, 0x1dbcc, 0x1dbf2, 0x1dbf4, 0x1dc22, 0x1dc42, 0x1dc44, 0x1dc48, 0x1dc50, 0x1dc5e, 0x1dc66,\n 0x1dc7a, 0x1dc82, 0x1dc84, 0x1dc88, 0x1dc90, 0x1dc9e, 0x1dca0, 0x1dcbc, 0x1dccc, 0x1dcf2, 0x1dcf4, 0x1dd04,\n 0x1dd08, 0x1dd10, 0x1dd1e, 0x1dd20, 0x1dd3c, 0x1dd40, 0x1dd78, 0x1dd86, 0x1dd98, 0x1ddce, 0x1dde2, 0x1dde4,\n 0x1dde8, 0x1de2e, 0x1de32, 0x1de34, 0x1de4e, 0x1de5c, 0x1de62, 0x1de64, 0x1de68, 0x1de8e, 0x1de9c, 0x1deb8,\n 0x1dec2, 0x1dec4, 0x1dec8, 0x1ded0, 0x1dee6, 0x1defa, 0x1df16, 0x1df26, 0x1df2c, 0x1df46, 0x1df4c, 0x1df58,\n 0x1df72, 0x1df74, 0x1df8a, 0x1df92, 0x1df94, 0x1dfa2, 0x1dfa4, 0x1dfa8, 0x1e08a, 0x1e092, 0x1e094, 0x1e0a2,\n 0x1e0a4, 0x1e0a8, 0x1e0b6, 0x1e0da, 0x1e10a, 0x1e112, 0x1e114, 0x1e122, 0x1e124, 0x1e128, 0x1e136, 0x1e142,\n 0x1e144, 0x1e148, 0x1e150, 0x1e166, 0x1e16c, 0x1e17a, 0x1e19a, 0x1e1b2, 0x1e1b4, 0x1e20a, 0x1e212, 0x1e214,\n 0x1e222, 0x1e224, 0x1e228, 0x1e236, 0x1e242, 0x1e248, 0x1e250, 0x1e25e, 0x1e266, 0x1e26c, 0x1e27a, 0x1e282,\n 0x1e284, 0x1e288, 0x1e290, 0x1e2a0, 0x1e2bc, 0x1e2c6, 0x1e2cc, 0x1e2d8, 0x1e2ee, 0x1e2f2, 0x1e2f4, 0x1e31a,\n 0x1e332, 0x1e334, 0x1e35c, 0x1e362, 0x1e364, 0x1e368, 0x1e3ba, 0x1e40a, 0x1e412, 0x1e414, 0x1e422, 0x1e428,\n 0x1e436, 0x1e442, 0x1e448, 0x1e450, 0x1e45e, 0x1e466, 0x1e46c, 0x1e47a, 0x1e482, 0x1e484, 0x1e490, 0x1e49e,\n 0x1e4a0, 0x1e4bc, 0x1e4c6, 0x1e4cc, 0x1e4d8, 0x1e4ee, 0x1e4f2, 0x1e4f4, 0x1e502, 0x1e504, 0x1e508, 0x1e510,\n 0x1e51e, 0x1e520, 0x1e53c, 0x1e540, 0x1e578, 0x1e586, 0x1e58c, 0x1e598, 0x1e5b0, 0x1e5be, 0x1e5ce, 0x1e5dc,\n 0x1e5e2, 0x1e5e4, 0x1e5e8, 0x1e5f6, 0x1e61a, 0x1e62e, 0x1e632, 0x1e634, 0x1e64e, 0x1e65c, 0x1e662, 0x1e668,\n 0x1e68e, 0x1e69c, 0x1e6b8, 0x1e6c2, 0x1e6c4, 0x1e6c8, 0x1e6d0, 0x1e6e6, 0x1e6fa, 0x1e716, 0x1e726, 0x1e72c,\n 0x1e73a, 0x1e746, 0x1e74c, 0x1e758, 0x1e772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x1eeb0, 0x1eebe, 0x1eece, 0x1eedc, 0x1eee2,\n 0x1eee4, 0x1eee8, 0x1ef12, 0x1ef22, 0x1ef24, 0x1ef28, 0x1ef36, 0x1ef42, 0x1ef44, 0x1ef48, 0x1ef50, 0x1ef5e,\n 0x1ef66, 0x1ef6c, 0x1ef7a, 0x1efae, 0x1efb2, 0x1efb4, 0x1efd6, 0x1f096, 0x1f0a6, 0x1f0ac, 0x1f0ba, 0x1f0ca,\n 0x1f0d2, 0x1f0d4, 0x1f116, 0x1f126, 0x1f12c, 0x1f13a, 0x1f146, 0x1f14c, 0x1f158, 0x1f16e, 0x1f172, 0x1f174,\n 0x1f18a, 0x1f192, 0x1f194, 0x1f1a2, 0x1f1a4, 0x1f1a8, 0x1f1da, 0x1f216, 0x1f226, 0x1f22c, 0x1f23a, 0x1f246,\n 0x1f258, 0x1f26e, 0x1f272, 0x1f274, 0x1f286, 0x1f28c, 0x1f298, 0x1f2b0, 0x1f2be, 0x1f2ce, 0x1f2dc, 0x1f2e2,\n 0x1f2e4, 0x1f2e8, 0x1f2f6, 0x1f30a, 0x1f312, 0x1f314, 0x1f322, 0x1f328, 0x1f342, 0x1f344, 0x1f348, 0x1f350,\n 0x1f35e, 0x1f366, 0x1f37a, 0x1f39a, 0x1f3ae, 0x1f3b2, 0x1f3b4, 0x1f416, 0x1f426, 0x1f42c, 0x1f43a, 0x1f446,\n 0x1f44c, 0x1f458, 0x1f46e, 0x1f472, 0x1f474, 0x1f486, 0x1f48c, 0x1f498, 0x1f4b0, 0x1f4be, 0x1f4ce, 0x1f4dc,\n 0x1f4e2, 0x1f4e4, 0x1f4e8, 0x1f4f6, 0x1f506, 0x1f50c, 0x1f518, 0x1f530, 0x1f53e, 0x1f560, 0x1f57c, 0x1f58e,\n 0x1f59c, 0x1f5b8, 0x1f5c2, 0x1f5c4, 0x1f5c8, 0x1f5d0, 0x1f5de, 0x1f5e6, 0x1f5ec, 0x1f5fa, 0x1f60a, 0x1f612,\n 0x1f614, 0x1f622, 0x1f624, 0x1f628, 0x1f636, 0x1f642, 0x1f644, 0x1f648, 0x1f650, 0x1f65e, 0x1f666, 0x1f67a,\n 0x1f682, 0x1f684, 0x1f688, 0x1f690, 0x1f69e, 0x1f6a0, 0x1f6bc, 0x1f6cc, 0x1f6f2, 0x1f6f4, 0x1f71a, 0x1f72e,\n 0x1f732, 0x1f734, 0x1f74e, 0x1f75c, 0x1f762, 0x1f764, 0x1f768, 0x1f776, 0x1f796, 0x1f7a6, 0x1f7ac, 0x1f7ba,\n 0x1f7d2, 0x1f7d4, 0x1f89a, 0x1f8ae, 0x1f8b2, 0x1f8b4, 0x1f8d6, 0x1f8ea, 0x1f91a, 0x1f92e, 0x1f932, 0x1f934,\n 0x1f94e, 0x1f95c, 0x1f962, 0x1f964, 0x1f968, 0x1f976, 0x1f996, 0x1f9a6, 0x1f9ac, 0x1f9ba, 0x1f9ca, 0x1f9d2,\n 0x1f9d4, 0x1fa1a, 0x1fa2e, 0x1fa32, 0x1fa34, 0x1fa4e, 0x1fa5c, 0x1fa62, 0x1fa64, 0x1fa68, 0x1fa76, 0x1fa8e,\n 0x1fa9c, 0x1fab8, 0x1fac2, 0x1fac4, 0x1fac8, 0x1fad0, 0x1fade, 0x1fae6, 0x1faec, 0x1fb16, 0x1fb26, 0x1fb2c,\n 0x1fb3a, 0x1fb46, 0x1fb4c, 0x1fb58, 0x1fb6e, 0x1fb72, 0x1fb74, 0x1fb8a, 0x1fb92, 0x1fb94, 0x1fba2, 0x1fba4,\n 0x1fba8, 0x1fbb6, 0x1fbda\n ]);\n /**\n * This table contains to codewords for all symbols.\n */\n PDF417Common.CODEWORD_TABLE = Int32Array.from([\n 2627, 1819, 2622, 2621, 1813, 1812, 2729, 2724, 2723, 2779, 2774, 2773, 902, 896, 908, 868, 865, 861, 859, 2511,\n 873, 871, 1780, 835, 2493, 825, 2491, 842, 837, 844, 1764, 1762, 811, 810, 809, 2483, 807, 2482, 806, 2480, 815,\n 814, 813, 812, 2484, 817, 816, 1745, 1744, 1742, 1746, 2655, 2637, 2635, 2626, 2625, 2623, 2628, 1820, 2752,\n 2739, 2737, 2728, 2727, 2725, 2730, 2785, 2783, 2778, 2777, 2775, 2780, 787, 781, 747, 739, 736, 2413, 754, 752,\n 1719, 692, 689, 681, 2371, 678, 2369, 700, 697, 694, 703, 1688, 1686, 642, 638, 2343, 631, 2341, 627, 2338, 651,\n 646, 643, 2345, 654, 652, 1652, 1650, 1647, 1654, 601, 599, 2322, 596, 2321, 594, 2319, 2317, 611, 610, 608, 606,\n 2324, 603, 2323, 615, 614, 612, 1617, 1616, 1614, 1612, 616, 1619, 1618, 2575, 2538, 2536, 905, 901, 898, 909,\n 2509, 2507, 2504, 870, 867, 864, 860, 2512, 875, 872, 1781, 2490, 2489, 2487, 2485, 1748, 836, 834, 832, 830,\n 2494, 827, 2492, 843, 841, 839, 845, 1765, 1763, 2701, 2676, 2674, 2653, 2648, 2656, 2634, 2633, 2631, 2629,\n 1821, 2638, 2636, 2770, 2763, 2761, 2750, 2745, 2753, 2736, 2735, 2733, 2731, 1848, 2740, 2738, 2786, 2784, 591,\n 588, 576, 569, 566, 2296, 1590, 537, 534, 526, 2276, 522, 2274, 545, 542, 539, 548, 1572, 1570, 481, 2245, 466,\n 2242, 462, 2239, 492, 485, 482, 2249, 496, 494, 1534, 1531, 1528, 1538, 413, 2196, 406, 2191, 2188, 425, 419,\n 2202, 415, 2199, 432, 430, 427, 1472, 1467, 1464, 433, 1476, 1474, 368, 367, 2160, 365, 2159, 362, 2157, 2155,\n 2152, 378, 377, 375, 2166, 372, 2165, 369, 2162, 383, 381, 379, 2168, 1419, 1418, 1416, 1414, 385, 1411, 384,\n 1423, 1422, 1420, 1424, 2461, 802, 2441, 2439, 790, 786, 783, 794, 2409, 2406, 2403, 750, 742, 738, 2414, 756,\n 753, 1720, 2367, 2365, 2362, 2359, 1663, 693, 691, 684, 2373, 680, 2370, 702, 699, 696, 704, 1690, 1687, 2337,\n 2336, 2334, 2332, 1624, 2329, 1622, 640, 637, 2344, 634, 2342, 630, 2340, 650, 648, 645, 2346, 655, 653, 1653,\n 1651, 1649, 1655, 2612, 2597, 2595, 2571, 2568, 2565, 2576, 2534, 2529, 2526, 1787, 2540, 2537, 907, 904, 900,\n 910, 2503, 2502, 2500, 2498, 1768, 2495, 1767, 2510, 2508, 2506, 869, 866, 863, 2513, 876, 874, 1782, 2720, 2713,\n 2711, 2697, 2694, 2691, 2702, 2672, 2670, 2664, 1828, 2678, 2675, 2647, 2646, 2644, 2642, 1823, 2639, 1822, 2654,\n 2652, 2650, 2657, 2771, 1855, 2765, 2762, 1850, 1849, 2751, 2749, 2747, 2754, 353, 2148, 344, 342, 336, 2142,\n 332, 2140, 345, 1375, 1373, 306, 2130, 299, 2128, 295, 2125, 319, 314, 311, 2132, 1354, 1352, 1349, 1356, 262,\n 257, 2101, 253, 2096, 2093, 274, 273, 267, 2107, 263, 2104, 280, 278, 275, 1316, 1311, 1308, 1320, 1318, 2052,\n 202, 2050, 2044, 2040, 219, 2063, 212, 2060, 208, 2055, 224, 221, 2066, 1260, 1258, 1252, 231, 1248, 229, 1266,\n 1264, 1261, 1268, 155, 1998, 153, 1996, 1994, 1991, 1988, 165, 164, 2007, 162, 2006, 159, 2003, 2000, 172, 171,\n 169, 2012, 166, 2010, 1186, 1184, 1182, 1179, 175, 1176, 173, 1192, 1191, 1189, 1187, 176, 1194, 1193, 2313,\n 2307, 2305, 592, 589, 2294, 2292, 2289, 578, 572, 568, 2297, 580, 1591, 2272, 2267, 2264, 1547, 538, 536, 529,\n 2278, 525, 2275, 547, 544, 541, 1574, 1571, 2237, 2235, 2229, 1493, 2225, 1489, 478, 2247, 470, 2244, 465, 2241,\n 493, 488, 484, 2250, 498, 495, 1536, 1533, 1530, 1539, 2187, 2186, 2184, 2182, 1432, 2179, 1430, 2176, 1427, 414,\n 412, 2197, 409, 2195, 405, 2193, 2190, 426, 424, 421, 2203, 418, 2201, 431, 429, 1473, 1471, 1469, 1466, 434,\n 1477, 1475, 2478, 2472, 2470, 2459, 2457, 2454, 2462, 803, 2437, 2432, 2429, 1726, 2443, 2440, 792, 789, 785,\n 2401, 2399, 2393, 1702, 2389, 1699, 2411, 2408, 2405, 745, 741, 2415, 758, 755, 1721, 2358, 2357, 2355, 2353,\n 1661, 2350, 1660, 2347, 1657, 2368, 2366, 2364, 2361, 1666, 690, 687, 2374, 683, 2372, 701, 698, 705, 1691, 1689,\n 2619, 2617, 2610, 2608, 2605, 2613, 2593, 2588, 2585, 1803, 2599, 2596, 2563, 2561, 2555, 1797, 2551, 1795, 2573,\n 2570, 2567, 2577, 2525, 2524, 2522, 2520, 1786, 2517, 1785, 2514, 1783, 2535, 2533, 2531, 2528, 1788, 2541, 2539,\n 906, 903, 911, 2721, 1844, 2715, 2712, 1838, 1836, 2699, 2696, 2693, 2703, 1827, 1826, 1824, 2673, 2671, 2669,\n 2666, 1829, 2679, 2677, 1858, 1857, 2772, 1854, 1853, 1851, 1856, 2766, 2764, 143, 1987, 139, 1986, 135, 133,\n 131, 1984, 128, 1983, 125, 1981, 138, 137, 136, 1985, 1133, 1132, 1130, 112, 110, 1974, 107, 1973, 104, 1971,\n 1969, 122, 121, 119, 117, 1977, 114, 1976, 124, 1115, 1114, 1112, 1110, 1117, 1116, 84, 83, 1953, 81, 1952, 78,\n 1950, 1948, 1945, 94, 93, 91, 1959, 88, 1958, 85, 1955, 99, 97, 95, 1961, 1086, 1085, 1083, 1081, 1078, 100,\n 1090, 1089, 1087, 1091, 49, 47, 1917, 44, 1915, 1913, 1910, 1907, 59, 1926, 56, 1925, 53, 1922, 1919, 66, 64,\n 1931, 61, 1929, 1042, 1040, 1038, 71, 1035, 70, 1032, 68, 1048, 1047, 1045, 1043, 1050, 1049, 12, 10, 1869, 1867,\n 1864, 1861, 21, 1880, 19, 1877, 1874, 1871, 28, 1888, 25, 1886, 22, 1883, 982, 980, 977, 974, 32, 30, 991, 989,\n 987, 984, 34, 995, 994, 992, 2151, 2150, 2147, 2146, 2144, 356, 355, 354, 2149, 2139, 2138, 2136, 2134, 1359,\n 343, 341, 338, 2143, 335, 2141, 348, 347, 346, 1376, 1374, 2124, 2123, 2121, 2119, 1326, 2116, 1324, 310, 308,\n 305, 2131, 302, 2129, 298, 2127, 320, 318, 316, 313, 2133, 322, 321, 1355, 1353, 1351, 1357, 2092, 2091, 2089,\n 2087, 1276, 2084, 1274, 2081, 1271, 259, 2102, 256, 2100, 252, 2098, 2095, 272, 269, 2108, 266, 2106, 281, 279,\n 277, 1317, 1315, 1313, 1310, 282, 1321, 1319, 2039, 2037, 2035, 2032, 1203, 2029, 1200, 1197, 207, 2053, 205,\n 2051, 201, 2049, 2046, 2043, 220, 218, 2064, 215, 2062, 211, 2059, 228, 226, 223, 2069, 1259, 1257, 1254, 232,\n 1251, 230, 1267, 1265, 1263, 2316, 2315, 2312, 2311, 2309, 2314, 2304, 2303, 2301, 2299, 1593, 2308, 2306, 590,\n 2288, 2287, 2285, 2283, 1578, 2280, 1577, 2295, 2293, 2291, 579, 577, 574, 571, 2298, 582, 581, 1592, 2263, 2262,\n 2260, 2258, 1545, 2255, 1544, 2252, 1541, 2273, 2271, 2269, 2266, 1550, 535, 532, 2279, 528, 2277, 546, 543, 549,\n 1575, 1573, 2224, 2222, 2220, 1486, 2217, 1485, 2214, 1482, 1479, 2238, 2236, 2234, 2231, 1496, 2228, 1492, 480,\n 477, 2248, 473, 2246, 469, 2243, 490, 487, 2251, 497, 1537, 1535, 1532, 2477, 2476, 2474, 2479, 2469, 2468, 2466,\n 2464, 1730, 2473, 2471, 2453, 2452, 2450, 2448, 1729, 2445, 1728, 2460, 2458, 2456, 2463, 805, 804, 2428, 2427,\n 2425, 2423, 1725, 2420, 1724, 2417, 1722, 2438, 2436, 2434, 2431, 1727, 2444, 2442, 793, 791, 788, 795, 2388,\n 2386, 2384, 1697, 2381, 1696, 2378, 1694, 1692, 2402, 2400, 2398, 2395, 1703, 2392, 1701, 2412, 2410, 2407, 751,\n 748, 744, 2416, 759, 757, 1807, 2620, 2618, 1806, 1805, 2611, 2609, 2607, 2614, 1802, 1801, 1799, 2594, 2592,\n 2590, 2587, 1804, 2600, 2598, 1794, 1793, 1791, 1789, 2564, 2562, 2560, 2557, 1798, 2554, 1796, 2574, 2572, 2569,\n 2578, 1847, 1846, 2722, 1843, 1842, 1840, 1845, 2716, 2714, 1835, 1834, 1832, 1830, 1839, 1837, 2700, 2698, 2695,\n 2704, 1817, 1811, 1810, 897, 862, 1777, 829, 826, 838, 1760, 1758, 808, 2481, 1741, 1740, 1738, 1743, 2624, 1818,\n 2726, 2776, 782, 740, 737, 1715, 686, 679, 695, 1682, 1680, 639, 628, 2339, 647, 644, 1645, 1643, 1640, 1648,\n 602, 600, 597, 595, 2320, 593, 2318, 609, 607, 604, 1611, 1610, 1608, 1606, 613, 1615, 1613, 2328, 926, 924, 892,\n 886, 899, 857, 850, 2505, 1778, 824, 823, 821, 819, 2488, 818, 2486, 833, 831, 828, 840, 1761, 1759, 2649, 2632,\n 2630, 2746, 2734, 2732, 2782, 2781, 570, 567, 1587, 531, 527, 523, 540, 1566, 1564, 476, 467, 463, 2240, 486,\n 483, 1524, 1521, 1518, 1529, 411, 403, 2192, 399, 2189, 423, 416, 1462, 1457, 1454, 428, 1468, 1465, 2210, 366,\n 363, 2158, 360, 2156, 357, 2153, 376, 373, 370, 2163, 1410, 1409, 1407, 1405, 382, 1402, 380, 1417, 1415, 1412,\n 1421, 2175, 2174, 777, 774, 771, 784, 732, 725, 722, 2404, 743, 1716, 676, 674, 668, 2363, 665, 2360, 685, 1684,\n 1681, 626, 624, 622, 2335, 620, 2333, 617, 2330, 641, 635, 649, 1646, 1644, 1642, 2566, 928, 925, 2530, 2527,\n 894, 891, 888, 2501, 2499, 2496, 858, 856, 854, 851, 1779, 2692, 2668, 2665, 2645, 2643, 2640, 2651, 2768, 2759,\n 2757, 2744, 2743, 2741, 2748, 352, 1382, 340, 337, 333, 1371, 1369, 307, 300, 296, 2126, 315, 312, 1347, 1342,\n 1350, 261, 258, 250, 2097, 246, 2094, 271, 268, 264, 1306, 1301, 1298, 276, 1312, 1309, 2115, 203, 2048, 195,\n 2045, 191, 2041, 213, 209, 2056, 1246, 1244, 1238, 225, 1234, 222, 1256, 1253, 1249, 1262, 2080, 2079, 154, 1997,\n 150, 1995, 147, 1992, 1989, 163, 160, 2004, 156, 2001, 1175, 1174, 1172, 1170, 1167, 170, 1164, 167, 1185, 1183,\n 1180, 1177, 174, 1190, 1188, 2025, 2024, 2022, 587, 586, 564, 559, 556, 2290, 573, 1588, 520, 518, 512, 2268,\n 508, 2265, 530, 1568, 1565, 461, 457, 2233, 450, 2230, 446, 2226, 479, 471, 489, 1526, 1523, 1520, 397, 395,\n 2185, 392, 2183, 389, 2180, 2177, 410, 2194, 402, 422, 1463, 1461, 1459, 1456, 1470, 2455, 799, 2433, 2430, 779,\n 776, 773, 2397, 2394, 2390, 734, 728, 724, 746, 1717, 2356, 2354, 2351, 2348, 1658, 677, 675, 673, 670, 667, 688,\n 1685, 1683, 2606, 2589, 2586, 2559, 2556, 2552, 927, 2523, 2521, 2518, 2515, 1784, 2532, 895, 893, 890, 2718,\n 2709, 2707, 2689, 2687, 2684, 2663, 2662, 2660, 2658, 1825, 2667, 2769, 1852, 2760, 2758, 142, 141, 1139, 1138,\n 134, 132, 129, 126, 1982, 1129, 1128, 1126, 1131, 113, 111, 108, 105, 1972, 101, 1970, 120, 118, 115, 1109, 1108,\n 1106, 1104, 123, 1113, 1111, 82, 79, 1951, 75, 1949, 72, 1946, 92, 89, 86, 1956, 1077, 1076, 1074, 1072, 98,\n 1069, 96, 1084, 1082, 1079, 1088, 1968, 1967, 48, 45, 1916, 42, 1914, 39, 1911, 1908, 60, 57, 54, 1923, 50, 1920,\n 1031, 1030, 1028, 1026, 67, 1023, 65, 1020, 62, 1041, 1039, 1036, 1033, 69, 1046, 1044, 1944, 1943, 1941, 11, 9,\n 1868, 7, 1865, 1862, 1859, 20, 1878, 16, 1875, 13, 1872, 970, 968, 966, 963, 29, 960, 26, 23, 983, 981, 978, 975,\n 33, 971, 31, 990, 988, 985, 1906, 1904, 1902, 993, 351, 2145, 1383, 331, 330, 328, 326, 2137, 323, 2135, 339,\n 1372, 1370, 294, 293, 291, 289, 2122, 286, 2120, 283, 2117, 309, 303, 317, 1348, 1346, 1344, 245, 244, 242, 2090,\n 239, 2088, 236, 2085, 2082, 260, 2099, 249, 270, 1307, 1305, 1303, 1300, 1314, 189, 2038, 186, 2036, 183, 2033,\n 2030, 2026, 206, 198, 2047, 194, 216, 1247, 1245, 1243, 1240, 227, 1237, 1255, 2310, 2302, 2300, 2286, 2284,\n 2281, 565, 563, 561, 558, 575, 1589, 2261, 2259, 2256, 2253, 1542, 521, 519, 517, 514, 2270, 511, 533, 1569,\n 1567, 2223, 2221, 2218, 2215, 1483, 2211, 1480, 459, 456, 453, 2232, 449, 474, 491, 1527, 1525, 1522, 2475, 2467,\n 2465, 2451, 2449, 2446, 801, 800, 2426, 2424, 2421, 2418, 1723, 2435, 780, 778, 775, 2387, 2385, 2382, 2379,\n 1695, 2375, 1693, 2396, 735, 733, 730, 727, 749, 1718, 2616, 2615, 2604, 2603, 2601, 2584, 2583, 2581, 2579,\n 1800, 2591, 2550, 2549, 2547, 2545, 1792, 2542, 1790, 2558, 929, 2719, 1841, 2710, 2708, 1833, 1831, 2690, 2688,\n 2686, 1815, 1809, 1808, 1774, 1756, 1754, 1737, 1736, 1734, 1739, 1816, 1711, 1676, 1674, 633, 629, 1638, 1636,\n 1633, 1641, 598, 1605, 1604, 1602, 1600, 605, 1609, 1607, 2327, 887, 853, 1775, 822, 820, 1757, 1755, 1584, 524,\n 1560, 1558, 468, 464, 1514, 1511, 1508, 1519, 408, 404, 400, 1452, 1447, 1444, 417, 1458, 1455, 2208, 364, 361,\n 358, 2154, 1401, 1400, 1398, 1396, 374, 1393, 371, 1408, 1406, 1403, 1413, 2173, 2172, 772, 726, 723, 1712, 672,\n 669, 666, 682, 1678, 1675, 625, 623, 621, 618, 2331, 636, 632, 1639, 1637, 1635, 920, 918, 884, 880, 889, 849,\n 848, 847, 846, 2497, 855, 852, 1776, 2641, 2742, 2787, 1380, 334, 1367, 1365, 301, 297, 1340, 1338, 1335, 1343,\n 255, 251, 247, 1296, 1291, 1288, 265, 1302, 1299, 2113, 204, 196, 192, 2042, 1232, 1230, 1224, 214, 1220, 210,\n 1242, 1239, 1235, 1250, 2077, 2075, 151, 148, 1993, 144, 1990, 1163, 1162, 1160, 1158, 1155, 161, 1152, 157,\n 1173, 1171, 1168, 1165, 168, 1181, 1178, 2021, 2020, 2018, 2023, 585, 560, 557, 1585, 516, 509, 1562, 1559, 458,\n 447, 2227, 472, 1516, 1513, 1510, 398, 396, 393, 390, 2181, 386, 2178, 407, 1453, 1451, 1449, 1446, 420, 1460,\n 2209, 769, 764, 720, 712, 2391, 729, 1713, 664, 663, 661, 659, 2352, 656, 2349, 671, 1679, 1677, 2553, 922, 919,\n 2519, 2516, 885, 883, 881, 2685, 2661, 2659, 2767, 2756, 2755, 140, 1137, 1136, 130, 127, 1125, 1124, 1122, 1127,\n 109, 106, 102, 1103, 1102, 1100, 1098, 116, 1107, 1105, 1980, 80, 76, 73, 1947, 1068, 1067, 1065, 1063, 90, 1060,\n 87, 1075, 1073, 1070, 1080, 1966, 1965, 46, 43, 40, 1912, 36, 1909, 1019, 1018, 1016, 1014, 58, 1011, 55, 1008,\n 51, 1029, 1027, 1024, 1021, 63, 1037, 1034, 1940, 1939, 1937, 1942, 8, 1866, 4, 1863, 1, 1860, 956, 954, 952,\n 949, 946, 17, 14, 969, 967, 964, 961, 27, 957, 24, 979, 976, 972, 1901, 1900, 1898, 1896, 986, 1905, 1903, 350,\n 349, 1381, 329, 327, 324, 1368, 1366, 292, 290, 287, 284, 2118, 304, 1341, 1339, 1337, 1345, 243, 240, 237, 2086,\n 233, 2083, 254, 1297, 1295, 1293, 1290, 1304, 2114, 190, 187, 184, 2034, 180, 2031, 177, 2027, 199, 1233, 1231,\n 1229, 1226, 217, 1223, 1241, 2078, 2076, 584, 555, 554, 552, 550, 2282, 562, 1586, 507, 506, 504, 502, 2257, 499,\n 2254, 515, 1563, 1561, 445, 443, 441, 2219, 438, 2216, 435, 2212, 460, 454, 475, 1517, 1515, 1512, 2447, 798,\n 797, 2422, 2419, 770, 768, 766, 2383, 2380, 2376, 721, 719, 717, 714, 731, 1714, 2602, 2582, 2580, 2548, 2546,\n 2543, 923, 921, 2717, 2706, 2705, 2683, 2682, 2680, 1771, 1752, 1750, 1733, 1732, 1731, 1735, 1814, 1707, 1670,\n 1668, 1631, 1629, 1626, 1634, 1599, 1598, 1596, 1594, 1603, 1601, 2326, 1772, 1753, 1751, 1581, 1554, 1552, 1504,\n 1501, 1498, 1509, 1442, 1437, 1434, 401, 1448, 1445, 2206, 1392, 1391, 1389, 1387, 1384, 359, 1399, 1397, 1394,\n 1404, 2171, 2170, 1708, 1672, 1669, 619, 1632, 1630, 1628, 1773, 1378, 1363, 1361, 1333, 1328, 1336, 1286, 1281,\n 1278, 248, 1292, 1289, 2111, 1218, 1216, 1210, 197, 1206, 193, 1228, 1225, 1221, 1236, 2073, 2071, 1151, 1150,\n 1148, 1146, 152, 1143, 149, 1140, 145, 1161, 1159, 1156, 1153, 158, 1169, 1166, 2017, 2016, 2014, 2019, 1582,\n 510, 1556, 1553, 452, 448, 1506, 1500, 394, 391, 387, 1443, 1441, 1439, 1436, 1450, 2207, 765, 716, 713, 1709,\n 662, 660, 657, 1673, 1671, 916, 914, 879, 878, 877, 882, 1135, 1134, 1121, 1120, 1118, 1123, 1097, 1096, 1094,\n 1092, 103, 1101, 1099, 1979, 1059, 1058, 1056, 1054, 77, 1051, 74, 1066, 1064, 1061, 1071, 1964, 1963, 1007,\n 1006, 1004, 1002, 999, 41, 996, 37, 1017, 1015, 1012, 1009, 52, 1025, 1022, 1936, 1935, 1933, 1938, 942, 940,\n 938, 935, 932, 5, 2, 955, 953, 950, 947, 18, 943, 15, 965, 962, 958, 1895, 1894, 1892, 1890, 973, 1899, 1897,\n 1379, 325, 1364, 1362, 288, 285, 1334, 1332, 1330, 241, 238, 234, 1287, 1285, 1283, 1280, 1294, 2112, 188, 185,\n 181, 178, 2028, 1219, 1217, 1215, 1212, 200, 1209, 1227, 2074, 2072, 583, 553, 551, 1583, 505, 503, 500, 513,\n 1557, 1555, 444, 442, 439, 436, 2213, 455, 451, 1507, 1505, 1502, 796, 763, 762, 760, 767, 711, 710, 708, 706,\n 2377, 718, 715, 1710, 2544, 917, 915, 2681, 1627, 1597, 1595, 2325, 1769, 1749, 1747, 1499, 1438, 1435, 2204,\n 1390, 1388, 1385, 1395, 2169, 2167, 1704, 1665, 1662, 1625, 1623, 1620, 1770, 1329, 1282, 1279, 2109, 1214, 1207,\n 1222, 2068, 2065, 1149, 1147, 1144, 1141, 146, 1157, 1154, 2013, 2011, 2008, 2015, 1579, 1549, 1546, 1495, 1487,\n 1433, 1431, 1428, 1425, 388, 1440, 2205, 1705, 658, 1667, 1664, 1119, 1095, 1093, 1978, 1057, 1055, 1052, 1062,\n 1962, 1960, 1005, 1003, 1000, 997, 38, 1013, 1010, 1932, 1930, 1927, 1934, 941, 939, 936, 933, 6, 930, 3, 951,\n 948, 944, 1889, 1887, 1884, 1881, 959, 1893, 1891, 35, 1377, 1360, 1358, 1327, 1325, 1322, 1331, 1277, 1275,\n 1272, 1269, 235, 1284, 2110, 1205, 1204, 1201, 1198, 182, 1195, 179, 1213, 2070, 2067, 1580, 501, 1551, 1548,\n 440, 437, 1497, 1494, 1490, 1503, 761, 709, 707, 1706, 913, 912, 2198, 1386, 2164, 2161, 1621, 1766, 2103, 1208,\n 2058, 2054, 1145, 1142, 2005, 2002, 1999, 2009, 1488, 1429, 1426, 2200, 1698, 1659, 1656, 1975, 1053, 1957, 1954,\n 1001, 998, 1924, 1921, 1918, 1928, 937, 934, 931, 1879, 1876, 1873, 1870, 945, 1885, 1882, 1323, 1273, 1270,\n 2105, 1202, 1199, 1196, 1211, 2061, 2057, 1576, 1543, 1540, 1484, 1481, 1478, 1491, 1700\n ]);\n\n /*\n * Copyright 2007 ZXing authors\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 // import java.util.List;\n /**\n * @author Guenther Grau\n */\n /*public final*/ class PDF417DetectorResult {\n constructor(bits, points) {\n this.bits = bits;\n this.points = points;\n }\n getBits() {\n return this.bits;\n }\n getPoints() {\n return this.points;\n }\n }\n\n /*\n * Copyright 2009 ZXing authors\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 // import java.util.ArrayList;\n // import java.util.Arrays;\n // import java.util.List;\n // import java.util.Map;\n /**\n *Encapsulates logic that can detect a PDF417 Code in an image, even if the\n * PDF417 Code is rotated or skewed, or partially obscured.
\n *\n * @author SITA Lab (kevin.osullivan@sita.aero)\n * @author dswitkin@google.com (Daniel Switkin)\n * @author Guenther Grau\n */\n /*public*/ /*final*/ class Detector$3 {\n /**\n *Detects a PDF417 Code in an image. Only checks 0 and 180 degree rotations.
\n *\n * @param image barcode image to decode\n * @param hints optional hints to detector\n * @param multiple if true, then the image is searched for multiple codes. If false, then at most one code will\n * be found and returned\n * @return {@link PDF417DetectorResult} encapsulating results of detecting a PDF417 code\n * @throws NotFoundException if no PDF417 Code can be found\n */\n static detectMultiple(image, hints, multiple) {\n // TODO detection improvement, tryHarder could try several different luminance thresholds/blackpoints or even\n // different binarizers\n // boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDER);\n let bitMatrix = image.getBlackMatrix();\n let barcodeCoordinates = Detector$3.detect(multiple, bitMatrix);\n if (!barcodeCoordinates.length) {\n bitMatrix = bitMatrix.clone();\n bitMatrix.rotate180();\n barcodeCoordinates = Detector$3.detect(multiple, bitMatrix);\n }\n return new PDF417DetectorResult(bitMatrix, barcodeCoordinates);\n }\n /**\n * Detects PDF417 codes in an image. Only checks 0 degree rotation\n * @param multiple if true, then the image is searched for multiple codes. If false, then at most one code will\n * be found and returned\n * @param bitMatrix bit matrix to detect barcodes in\n * @return List of ResultPoint arrays containing the coordinates of found barcodes\n */\n static detect(multiple, bitMatrix) {\n const barcodeCoordinates = new Array();\n let row = 0;\n let column = 0;\n let foundBarcodeInRow = false;\n while (row < bitMatrix.getHeight()) {\n const vertices = Detector$3.findVertices(bitMatrix, row, column);\n if (vertices[0] == null && vertices[3] == null) {\n if (!foundBarcodeInRow) {\n // we didn't find any barcode so that's the end of searching\n break;\n }\n // we didn't find a barcode starting at the given column and row. Try again from the first column and slightly\n // below the lowest barcode we found so far.\n foundBarcodeInRow = false;\n column = 0;\n for (const barcodeCoordinate of barcodeCoordinates) {\n if (barcodeCoordinate[1] != null) {\n row = Math.trunc(Math.max(row, barcodeCoordinate[1].getY()));\n }\n if (barcodeCoordinate[3] != null) {\n row = Math.max(row, Math.trunc(barcodeCoordinate[3].getY()));\n }\n }\n row += Detector$3.ROW_STEP;\n continue;\n }\n foundBarcodeInRow = true;\n barcodeCoordinates.push(vertices);\n if (!multiple) {\n break;\n }\n // if we didn't find a right row indicator column, then continue the search for the next barcode after the\n // start pattern of the barcode just found.\n if (vertices[2] != null) {\n column = Math.trunc(vertices[2].getX());\n row = Math.trunc(vertices[2].getY());\n }\n else {\n column = Math.trunc(vertices[4].getX());\n row = Math.trunc(vertices[4].getY());\n }\n }\n return barcodeCoordinates;\n }\n /**\n * Locate the vertices and the codewords area of a black blob using the Start\n * and Stop patterns as locators.\n *\n * @param matrix the scanned barcode image.\n * @return an array containing the vertices:\n * vertices[0] x, y top left barcode\n * vertices[1] x, y bottom left barcode\n * vertices[2] x, y top right barcode\n * vertices[3] x, y bottom right barcode\n * vertices[4] x, y top left codeword area\n * vertices[5] x, y bottom left codeword area\n * vertices[6] x, y top right codeword area\n * vertices[7] x, y bottom right codeword area\n */\n static findVertices(matrix, startRow, startColumn) {\n const height = matrix.getHeight();\n const width = matrix.getWidth();\n // const result = new ResultPoint[8];\n const result = new Array(8);\n Detector$3.copyToResult(result, Detector$3.findRowsWithPattern(matrix, height, width, startRow, startColumn, Detector$3.START_PATTERN), Detector$3.INDEXES_START_PATTERN);\n if (result[4] != null) {\n startColumn = Math.trunc(result[4].getX());\n startRow = Math.trunc(result[4].getY());\n }\n Detector$3.copyToResult(result, Detector$3.findRowsWithPattern(matrix, height, width, startRow, startColumn, Detector$3.STOP_PATTERN), Detector$3.INDEXES_STOP_PATTERN);\n return result;\n }\n static copyToResult(result, tmpResult, destinationIndexes) {\n for (let i = 0; i < destinationIndexes.length; i++) {\n result[destinationIndexes[i]] = tmpResult[i];\n }\n }\n static findRowsWithPattern(matrix, height, width, startRow, startColumn, pattern) {\n // const result = new ResultPoint[4];\n const result = new Array(4);\n let found = false;\n const counters = new Int32Array(pattern.length);\n for (; startRow < height; startRow += Detector$3.ROW_STEP) {\n let loc = Detector$3.findGuardPattern(matrix, startColumn, startRow, width, false, pattern, counters);\n if (loc != null) {\n while (startRow > 0) {\n const previousRowLoc = Detector$3.findGuardPattern(matrix, startColumn, --startRow, width, false, pattern, counters);\n if (previousRowLoc != null) {\n loc = previousRowLoc;\n }\n else {\n startRow++;\n break;\n }\n }\n result[0] = new ResultPoint(loc[0], startRow);\n result[1] = new ResultPoint(loc[1], startRow);\n found = true;\n break;\n }\n }\n let stopRow = startRow + 1;\n // Last row of the current symbol that contains pattern\n if (found) {\n let skippedRowCount = 0;\n let previousRowLoc = Int32Array.from([Math.trunc(result[0].getX()), Math.trunc(result[1].getX())]);\n for (; stopRow < height; stopRow++) {\n const loc = Detector$3.findGuardPattern(matrix, previousRowLoc[0], stopRow, width, false, pattern, counters);\n // a found pattern is only considered to belong to the same barcode if the start and end positions\n // don't differ too much. Pattern drift should be not bigger than two for consecutive rows. With\n // a higher number of skipped rows drift could be larger. To keep it simple for now, we allow a slightly\n // larger drift and don't check for skipped rows.\n if (loc != null &&\n Math.abs(previousRowLoc[0] - loc[0]) < Detector$3.MAX_PATTERN_DRIFT &&\n Math.abs(previousRowLoc[1] - loc[1]) < Detector$3.MAX_PATTERN_DRIFT) {\n previousRowLoc = loc;\n skippedRowCount = 0;\n }\n else {\n if (skippedRowCount > Detector$3.SKIPPED_ROW_COUNT_MAX) {\n break;\n }\n else {\n skippedRowCount++;\n }\n }\n }\n stopRow -= skippedRowCount + 1;\n result[2] = new ResultPoint(previousRowLoc[0], stopRow);\n result[3] = new ResultPoint(previousRowLoc[1], stopRow);\n }\n if (stopRow - startRow < Detector$3.BARCODE_MIN_HEIGHT) {\n Arrays.fill(result, null);\n }\n return result;\n }\n /**\n * @param matrix row of black/white values to search\n * @param column x position to start search\n * @param row y position to start search\n * @param width the number of pixels to search on this row\n * @param pattern pattern of counts of number of black and white pixels that are\n * being searched for as a pattern\n * @param counters array of counters, as long as pattern, to re-use\n * @return start/end horizontal offset of guard pattern, as an array of two ints.\n */\n static findGuardPattern(matrix, column, row, width, whiteFirst, pattern, counters) {\n Arrays.fillWithin(counters, 0, counters.length, 0);\n let patternStart = column;\n let pixelDrift = 0;\n // if there are black pixels left of the current pixel shift to the left, but only for MAX_PIXEL_DRIFT pixels\n while (matrix.get(patternStart, row) && patternStart > 0 && pixelDrift++ < Detector$3.MAX_PIXEL_DRIFT) {\n patternStart--;\n }\n let x = patternStart;\n let counterPosition = 0;\n let patternLength = pattern.length;\n for (let isWhite = whiteFirst; x < width; x++) {\n let pixel = matrix.get(x, row);\n if (pixel !== isWhite) {\n counters[counterPosition]++;\n }\n else {\n if (counterPosition === patternLength - 1) {\n if (Detector$3.patternMatchVariance(counters, pattern, Detector$3.MAX_INDIVIDUAL_VARIANCE) < Detector$3.MAX_AVG_VARIANCE) {\n return new Int32Array([patternStart, x]);\n }\n patternStart += counters[0] + counters[1];\n System.arraycopy(counters, 2, counters, 0, counterPosition - 1);\n counters[counterPosition - 1] = 0;\n counters[counterPosition] = 0;\n counterPosition--;\n }\n else {\n counterPosition++;\n }\n counters[counterPosition] = 1;\n isWhite = !isWhite;\n }\n }\n if (counterPosition === patternLength - 1 &&\n Detector$3.patternMatchVariance(counters, pattern, Detector$3.MAX_INDIVIDUAL_VARIANCE) < Detector$3.MAX_AVG_VARIANCE) {\n return new Int32Array([patternStart, x - 1]);\n }\n return null;\n }\n /**\n * Determines how closely a set of observed counts of runs of black/white\n * values matches a given target pattern. This is reported as the ratio of\n * the total variance from the expected pattern proportions across all\n * pattern elements, to the length of the pattern.\n *\n * @param counters observed counters\n * @param pattern expected pattern\n * @param maxIndividualVariance The most any counter can differ before we give up\n * @return ratio of total variance between counters and pattern compared to total pattern size\n */\n static patternMatchVariance(counters, pattern, maxIndividualVariance) {\n let numCounters = counters.length;\n let total = 0;\n let patternLength = 0;\n for (let i = 0; i < numCounters; i++) {\n total += counters[i];\n patternLength += pattern[i];\n }\n if (total < patternLength) {\n // If we don't even have one pixel per unit of bar width, assume this\n // is too small to reliably match, so fail:\n return /*Float.POSITIVE_INFINITY*/ Infinity;\n }\n // We're going to fake floating-point math in integers. We just need to use more bits.\n // Scale up patternLength so that intermediate values below like scaledCounter will have\n // more \"significant digits\".\n let unitBarWidth = total / patternLength;\n maxIndividualVariance *= unitBarWidth;\n let totalVariance = 0.0;\n for (let x = 0; x < numCounters; x++) {\n let counter = counters[x];\n let scaledPattern = pattern[x] * unitBarWidth;\n let variance = counter > scaledPattern ? counter - scaledPattern : scaledPattern - counter;\n if (variance > maxIndividualVariance) {\n return /*Float.POSITIVE_INFINITY*/ Infinity;\n }\n totalVariance += variance;\n }\n return totalVariance / total;\n }\n }\n Detector$3.INDEXES_START_PATTERN = Int32Array.from([0, 4, 1, 5]);\n Detector$3.INDEXES_STOP_PATTERN = Int32Array.from([6, 2, 7, 3]);\n Detector$3.MAX_AVG_VARIANCE = 0.42;\n Detector$3.MAX_INDIVIDUAL_VARIANCE = 0.8;\n // B S B S B S B S Bar/Space pattern\n // 11111111 0 1 0 1 0 1 000\n Detector$3.START_PATTERN = Int32Array.from([8, 1, 1, 1, 1, 1, 1, 3]);\n // 1111111 0 1 000 1 0 1 00 1\n Detector$3.STOP_PATTERN = Int32Array.from([7, 1, 1, 3, 1, 1, 1, 2, 1]);\n Detector$3.MAX_PIXEL_DRIFT = 3;\n Detector$3.MAX_PATTERN_DRIFT = 5;\n // if we set the value too low, then we don't detect the correct height of the bar if the start patterns are damaged.\n // if we set the value too high, then we might detect the start pattern from a neighbor barcode.\n Detector$3.SKIPPED_ROW_COUNT_MAX = 25;\n // A PDF471 barcode should have at least 3 rows, with each row being >= 3 times the module width. Therefore it should be at least\n // 9 pixels tall. To be conservative, we use about half the size to ensure we don't miss it.\n Detector$3.ROW_STEP = 5;\n Detector$3.BARCODE_MIN_HEIGHT = 10;\n\n /*\n * Copyright 2012 ZXing authors\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 /**\n * @author Sean Owen\n * @see com.google.zxing.common.reedsolomon.GenericGFPoly\n */\n /*final*/ class ModulusPoly {\n constructor(field, coefficients) {\n if (coefficients.length === 0) {\n throw new IllegalArgumentException();\n }\n this.field = field;\n let coefficientsLength = /*int*/ coefficients.length;\n if (coefficientsLength > 1 && coefficients[0] === 0) {\n // Leading term must be non-zero for anything except the constant polynomial \"0\"\n let firstNonZero = /*int*/ 1;\n while (firstNonZero < coefficientsLength && coefficients[firstNonZero] === 0) {\n firstNonZero++;\n }\n if (firstNonZero === coefficientsLength) {\n this.coefficients = new Int32Array([0]);\n }\n else {\n this.coefficients = new Int32Array(coefficientsLength - firstNonZero);\n System.arraycopy(coefficients, firstNonZero, this.coefficients, 0, this.coefficients.length);\n }\n }\n else {\n this.coefficients = coefficients;\n }\n }\n getCoefficients() {\n return this.coefficients;\n }\n /**\n * @return degree of this polynomial\n */\n getDegree() {\n return this.coefficients.length - 1;\n }\n /**\n * @return true iff this polynomial is the monomial \"0\"\n */\n isZero() {\n return this.coefficients[0] === 0;\n }\n /**\n * @return coefficient of x^degree term in this polynomial\n */\n getCoefficient(degree) {\n return this.coefficients[this.coefficients.length - 1 - degree];\n }\n /**\n * @return evaluation of this polynomial at a given point\n */\n evaluateAt(a) {\n if (a === 0) {\n // Just return the x^0 coefficient\n return this.getCoefficient(0);\n }\n if (a === 1) {\n // Just the sum of the coefficients\n let sum = /*int*/ 0;\n for (let coefficient /*int*/ of this.coefficients) {\n sum = this.field.add(sum, coefficient);\n }\n return sum;\n }\n let result = /*int*/ this.coefficients[0];\n let size = /*int*/ this.coefficients.length;\n for (let i /*int*/ = 1; i < size; i++) {\n result = this.field.add(this.field.multiply(a, result), this.coefficients[i]);\n }\n return result;\n }\n add(other) {\n if (!this.field.equals(other.field)) {\n throw new IllegalArgumentException('ModulusPolys do not have same ModulusGF field');\n }\n if (this.isZero()) {\n return other;\n }\n if (other.isZero()) {\n return this;\n }\n let smallerCoefficients = this.coefficients;\n let largerCoefficients = other.coefficients;\n if (smallerCoefficients.length > largerCoefficients.length) {\n let temp = smallerCoefficients;\n smallerCoefficients = largerCoefficients;\n largerCoefficients = temp;\n }\n let sumDiff = new Int32Array(largerCoefficients.length);\n let lengthDiff = /*int*/ largerCoefficients.length - smallerCoefficients.length;\n // Copy high-order terms only found in higher-degree polynomial's coefficients\n System.arraycopy(largerCoefficients, 0, sumDiff, 0, lengthDiff);\n for (let i /*int*/ = lengthDiff; i < largerCoefficients.length; i++) {\n sumDiff[i] = this.field.add(smallerCoefficients[i - lengthDiff], largerCoefficients[i]);\n }\n return new ModulusPoly(this.field, sumDiff);\n }\n subtract(other) {\n if (!this.field.equals(other.field)) {\n throw new IllegalArgumentException('ModulusPolys do not have same ModulusGF field');\n }\n if (other.isZero()) {\n return this;\n }\n return this.add(other.negative());\n }\n multiply(other) {\n if (other instanceof ModulusPoly) {\n return this.multiplyOther(other);\n }\n return this.multiplyScalar(other);\n }\n multiplyOther(other) {\n if (!this.field.equals(other.field)) {\n throw new IllegalArgumentException('ModulusPolys do not have same ModulusGF field');\n }\n if (this.isZero() || other.isZero()) {\n // return this.field.getZero();\n return new ModulusPoly(this.field, new Int32Array([0]));\n }\n let aCoefficients = this.coefficients;\n let aLength = /*int*/ aCoefficients.length;\n let bCoefficients = other.coefficients;\n let bLength = /*int*/ bCoefficients.length;\n let product = new Int32Array(aLength + bLength - 1);\n for (let i /*int*/ = 0; i < aLength; i++) {\n let aCoeff = /*int*/ aCoefficients[i];\n for (let j /*int*/ = 0; j < bLength; j++) {\n product[i + j] = this.field.add(product[i + j], this.field.multiply(aCoeff, bCoefficients[j]));\n }\n }\n return new ModulusPoly(this.field, product);\n }\n negative() {\n let size = /*int*/ this.coefficients.length;\n let negativeCoefficients = new Int32Array(size);\n for (let i /*int*/ = 0; i < size; i++) {\n negativeCoefficients[i] = this.field.subtract(0, this.coefficients[i]);\n }\n return new ModulusPoly(this.field, negativeCoefficients);\n }\n multiplyScalar(scalar) {\n if (scalar === 0) {\n return new ModulusPoly(this.field, new Int32Array([0]));\n }\n if (scalar === 1) {\n return this;\n }\n let size = /*int*/ this.coefficients.length;\n let product = new Int32Array(size);\n for (let i /*int*/ = 0; i < size; i++) {\n product[i] = this.field.multiply(this.coefficients[i], scalar);\n }\n return new ModulusPoly(this.field, product);\n }\n multiplyByMonomial(degree, coefficient) {\n if (degree < 0) {\n throw new IllegalArgumentException();\n }\n if (coefficient === 0) {\n return new ModulusPoly(this.field, new Int32Array([0]));\n }\n let size = /*int*/ this.coefficients.length;\n let product = new Int32Array(size + degree);\n for (let i /*int*/ = 0; i < size; i++) {\n product[i] = this.field.multiply(this.coefficients[i], coefficient);\n }\n return new ModulusPoly(this.field, product);\n }\n /*\n ModulusPoly[] divide(other: ModulusPoly) {\n if (!field.equals(other.field)) {\n throw new IllegalArgumentException(\"ModulusPolys do not have same ModulusGF field\");\n }\n if (other.isZero()) {\n throw new IllegalArgumentException(\"Divide by 0\");\n }\n \n let quotient: ModulusPoly = field.getZero();\n let remainder: ModulusPoly = this;\n \n let denominatorLeadingTerm: /*int/ number = other.getCoefficient(other.getDegree());\n let inverseDenominatorLeadingTerm: /*int/ number = field.inverse(denominatorLeadingTerm);\n \n while (remainder.getDegree() >= other.getDegree() && !remainder.isZero()) {\n let degreeDifference: /*int/ number = remainder.getDegree() - other.getDegree();\n let scale: /*int/ number = field.multiply(remainder.getCoefficient(remainder.getDegree()), inverseDenominatorLeadingTerm);\n let term: ModulusPoly = other.multiplyByMonomial(degreeDifference, scale);\n let iterationQuotient: ModulusPoly = field.buildMonomial(degreeDifference, scale);\n quotient = quotient.add(iterationQuotient);\n remainder = remainder.subtract(term);\n }\n \n return new ModulusPoly[] { quotient, remainder };\n }\n */\n // @Override\n toString() {\n let result = new StringBuilder( /*8 * this.getDegree()*/); // dynamic string size in JS\n for (let degree /*int*/ = this.getDegree(); degree >= 0; degree--) {\n let coefficient = /*int*/ this.getCoefficient(degree);\n if (coefficient !== 0) {\n if (coefficient < 0) {\n result.append(' - ');\n coefficient = -coefficient;\n }\n else {\n if (result.length() > 0) {\n result.append(' + ');\n }\n }\n if (degree === 0 || coefficient !== 1) {\n result.append(coefficient);\n }\n if (degree !== 0) {\n if (degree === 1) {\n result.append('x');\n }\n else {\n result.append('x^');\n result.append(degree);\n }\n }\n }\n }\n return result.toString();\n }\n }\n\n class ModulusBase {\n add(a, b) {\n return (a + b) % this.modulus;\n }\n subtract(a, b) {\n return (this.modulus + a - b) % this.modulus;\n }\n exp(a) {\n return this.expTable[a];\n }\n log(a) {\n if (a === 0) {\n throw new IllegalArgumentException();\n }\n return this.logTable[a];\n }\n inverse(a) {\n if (a === 0) {\n throw new ArithmeticException();\n }\n return this.expTable[this.modulus - this.logTable[a] - 1];\n }\n multiply(a, b) {\n if (a === 0 || b === 0) {\n return 0;\n }\n return this.expTable[(this.logTable[a] + this.logTable[b]) % (this.modulus - 1)];\n }\n getSize() {\n return this.modulus;\n }\n equals(o) {\n return o === this;\n }\n }\n\n /*\n * Copyright 2012 ZXing authors\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 /**\n *A field based on powers of a generator integer, modulo some modulus.
\n *\n * @author Sean Owen\n * @see com.google.zxing.common.reedsolomon.GenericGF\n */\n /*public final*/ class ModulusGF extends ModulusBase {\n // private /*final*/ modulus: /*int*/ number;\n constructor(modulus, generator) {\n super();\n this.modulus = modulus;\n this.expTable = new Int32Array(modulus);\n this.logTable = new Int32Array(modulus);\n let x = /*int*/ 1;\n for (let i /*int*/ = 0; i < modulus; i++) {\n this.expTable[i] = x;\n x = (x * generator) % modulus;\n }\n for (let i /*int*/ = 0; i < modulus - 1; i++) {\n this.logTable[this.expTable[i]] = i;\n }\n // logTable[0] == 0 but this should never be used\n this.zero = new ModulusPoly(this, new Int32Array([0]));\n this.one = new ModulusPoly(this, new Int32Array([1]));\n }\n getZero() {\n return this.zero;\n }\n getOne() {\n return this.one;\n }\n buildMonomial(degree, coefficient) {\n if (degree < 0) {\n throw new IllegalArgumentException();\n }\n if (coefficient === 0) {\n return this.zero;\n }\n let coefficients = new Int32Array(degree + 1);\n coefficients[0] = coefficient;\n return new ModulusPoly(this, coefficients);\n }\n }\n ModulusGF.PDF417_GF = new ModulusGF(PDF417Common.NUMBER_OF_CODEWORDS, 3);\n\n /*\n * Copyright 2012 ZXing authors\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 /**\n *PDF417 error correction implementation.
\n *\n *This example\n * is quite useful in understanding the algorithm.
\n *\n * @author Sean Owen\n * @see com.google.zxing.common.reedsolomon.ReedSolomonDecoder\n */\n /*public final*/ class ErrorCorrection {\n constructor() {\n this.field = ModulusGF.PDF417_GF;\n }\n /**\n * @param received received codewords\n * @param numECCodewords number of those codewords used for EC\n * @param erasures location of erasures\n * @return number of errors\n * @throws ChecksumException if errors cannot be corrected, maybe because of too many errors\n */\n decode(received, numECCodewords, erasures) {\n let poly = new ModulusPoly(this.field, received);\n let S = new Int32Array(numECCodewords);\n let error = false;\n for (let i /*int*/ = numECCodewords; i > 0; i--) {\n let evaluation = poly.evaluateAt(this.field.exp(i));\n S[numECCodewords - i] = evaluation;\n if (evaluation !== 0) {\n error = true;\n }\n }\n if (!error) {\n return 0;\n }\n let knownErrors = this.field.getOne();\n if (erasures != null) {\n for (const erasure of erasures) {\n let b = this.field.exp(received.length - 1 - erasure);\n // Add (1 - bx) term:\n let term = new ModulusPoly(this.field, new Int32Array([this.field.subtract(0, b), 1]));\n knownErrors = knownErrors.multiply(term);\n }\n }\n let syndrome = new ModulusPoly(this.field, S);\n // syndrome = syndrome.multiply(knownErrors);\n let sigmaOmega = this.runEuclideanAlgorithm(this.field.buildMonomial(numECCodewords, 1), syndrome, numECCodewords);\n let sigma = sigmaOmega[0];\n let omega = sigmaOmega[1];\n // sigma = sigma.multiply(knownErrors);\n let errorLocations = this.findErrorLocations(sigma);\n let errorMagnitudes = this.findErrorMagnitudes(omega, sigma, errorLocations);\n for (let i /*int*/ = 0; i < errorLocations.length; i++) {\n let position = received.length - 1 - this.field.log(errorLocations[i]);\n if (position < 0) {\n throw ChecksumException.getChecksumInstance();\n }\n received[position] = this.field.subtract(received[position], errorMagnitudes[i]);\n }\n return errorLocations.length;\n }\n /**\n *\n * @param ModulusPoly\n * @param a\n * @param ModulusPoly\n * @param b\n * @param int\n * @param R\n * @throws ChecksumException\n */\n runEuclideanAlgorithm(a, b, R) {\n // Assume a's degree is >= b's\n if (a.getDegree() < b.getDegree()) {\n let temp = a;\n a = b;\n b = temp;\n }\n let rLast = a;\n let r = b;\n let tLast = this.field.getZero();\n let t = this.field.getOne();\n // Run Euclidean algorithm until r's degree is less than R/2\n while (r.getDegree() >= Math.round(R / 2)) {\n let rLastLast = rLast;\n let tLastLast = tLast;\n rLast = r;\n tLast = t;\n // Divide rLastLast by rLast, with quotient in q and remainder in r\n if (rLast.isZero()) {\n // Oops, Euclidean algorithm already terminated?\n throw ChecksumException.getChecksumInstance();\n }\n r = rLastLast;\n let q = this.field.getZero();\n let denominatorLeadingTerm = rLast.getCoefficient(rLast.getDegree());\n let dltInverse = this.field.inverse(denominatorLeadingTerm);\n while (r.getDegree() >= rLast.getDegree() && !r.isZero()) {\n let degreeDiff = r.getDegree() - rLast.getDegree();\n let scale = this.field.multiply(r.getCoefficient(r.getDegree()), dltInverse);\n q = q.add(this.field.buildMonomial(degreeDiff, scale));\n r = r.subtract(rLast.multiplyByMonomial(degreeDiff, scale));\n }\n t = q.multiply(tLast).subtract(tLastLast).negative();\n }\n let sigmaTildeAtZero = t.getCoefficient(0);\n if (sigmaTildeAtZero === 0) {\n throw ChecksumException.getChecksumInstance();\n }\n let inverse = this.field.inverse(sigmaTildeAtZero);\n let sigma = t.multiply(inverse);\n let omega = r.multiply(inverse);\n return [sigma, omega];\n }\n /**\n *\n * @param errorLocator\n * @throws ChecksumException\n */\n findErrorLocations(errorLocator) {\n // This is a direct application of Chien's search\n let numErrors = errorLocator.getDegree();\n let result = new Int32Array(numErrors);\n let e = 0;\n for (let i /*int*/ = 1; i < this.field.getSize() && e < numErrors; i++) {\n if (errorLocator.evaluateAt(i) === 0) {\n result[e] = this.field.inverse(i);\n e++;\n }\n }\n if (e !== numErrors) {\n throw ChecksumException.getChecksumInstance();\n }\n return result;\n }\n findErrorMagnitudes(errorEvaluator, errorLocator, errorLocations) {\n let errorLocatorDegree = errorLocator.getDegree();\n let formalDerivativeCoefficients = new Int32Array(errorLocatorDegree);\n for (let i /*int*/ = 1; i <= errorLocatorDegree; i++) {\n formalDerivativeCoefficients[errorLocatorDegree - i] =\n this.field.multiply(i, errorLocator.getCoefficient(i));\n }\n let formalDerivative = new ModulusPoly(this.field, formalDerivativeCoefficients);\n // This is directly applying Forney's Formula\n let s = errorLocations.length;\n let result = new Int32Array(s);\n for (let i /*int*/ = 0; i < s; i++) {\n let xiInverse = this.field.inverse(errorLocations[i]);\n let numerator = this.field.subtract(0, errorEvaluator.evaluateAt(xiInverse));\n let denominator = this.field.inverse(formalDerivative.evaluateAt(xiInverse));\n result[i] = this.field.multiply(numerator, denominator);\n }\n return result;\n }\n }\n\n /*\n * Copyright 2013 ZXing authors\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 /**\n * @author Guenther Grau\n */\n /*final*/ class BoundingBox {\n constructor(image, topLeft, bottomLeft, topRight, bottomRight) {\n if (image instanceof BoundingBox) {\n this.constructor_2(image);\n }\n else {\n this.constructor_1(image, topLeft, bottomLeft, topRight, bottomRight);\n }\n }\n /**\n *\n * @param image\n * @param topLeft\n * @param bottomLeft\n * @param topRight\n * @param bottomRight\n *\n * @throws NotFoundException\n */\n constructor_1(image, topLeft, bottomLeft, topRight, bottomRight) {\n const leftUnspecified = topLeft == null || bottomLeft == null;\n const rightUnspecified = topRight == null || bottomRight == null;\n if (leftUnspecified && rightUnspecified) {\n throw new NotFoundException();\n }\n if (leftUnspecified) {\n topLeft = new ResultPoint(0, topRight.getY());\n bottomLeft = new ResultPoint(0, bottomRight.getY());\n }\n else if (rightUnspecified) {\n topRight = new ResultPoint(image.getWidth() - 1, topLeft.getY());\n bottomRight = new ResultPoint(image.getWidth() - 1, bottomLeft.getY());\n }\n this.image = image;\n this.topLeft = topLeft;\n this.bottomLeft = bottomLeft;\n this.topRight = topRight;\n this.bottomRight = bottomRight;\n this.minX = Math.trunc(Math.min(topLeft.getX(), bottomLeft.getX()));\n this.maxX = Math.trunc(Math.max(topRight.getX(), bottomRight.getX()));\n this.minY = Math.trunc(Math.min(topLeft.getY(), topRight.getY()));\n this.maxY = Math.trunc(Math.max(bottomLeft.getY(), bottomRight.getY()));\n }\n constructor_2(boundingBox) {\n this.image = boundingBox.image;\n this.topLeft = boundingBox.getTopLeft();\n this.bottomLeft = boundingBox.getBottomLeft();\n this.topRight = boundingBox.getTopRight();\n this.bottomRight = boundingBox.getBottomRight();\n this.minX = boundingBox.getMinX();\n this.maxX = boundingBox.getMaxX();\n this.minY = boundingBox.getMinY();\n this.maxY = boundingBox.getMaxY();\n }\n /**\n * @throws NotFoundException\n */\n static merge(leftBox, rightBox) {\n if (leftBox == null) {\n return rightBox;\n }\n if (rightBox == null) {\n return leftBox;\n }\n return new BoundingBox(leftBox.image, leftBox.topLeft, leftBox.bottomLeft, rightBox.topRight, rightBox.bottomRight);\n }\n /**\n * @throws NotFoundException\n */\n addMissingRows(missingStartRows, missingEndRows, isLeft) {\n let newTopLeft = this.topLeft;\n let newBottomLeft = this.bottomLeft;\n let newTopRight = this.topRight;\n let newBottomRight = this.bottomRight;\n if (missingStartRows > 0) {\n let top = isLeft ? this.topLeft : this.topRight;\n let newMinY = Math.trunc(top.getY() - missingStartRows);\n if (newMinY < 0) {\n newMinY = 0;\n }\n let newTop = new ResultPoint(top.getX(), newMinY);\n if (isLeft) {\n newTopLeft = newTop;\n }\n else {\n newTopRight = newTop;\n }\n }\n if (missingEndRows > 0) {\n let bottom = isLeft ? this.bottomLeft : this.bottomRight;\n let newMaxY = Math.trunc(bottom.getY() + missingEndRows);\n if (newMaxY >= this.image.getHeight()) {\n newMaxY = this.image.getHeight() - 1;\n }\n let newBottom = new ResultPoint(bottom.getX(), newMaxY);\n if (isLeft) {\n newBottomLeft = newBottom;\n }\n else {\n newBottomRight = newBottom;\n }\n }\n return new BoundingBox(this.image, newTopLeft, newBottomLeft, newTopRight, newBottomRight);\n }\n getMinX() {\n return this.minX;\n }\n getMaxX() {\n return this.maxX;\n }\n getMinY() {\n return this.minY;\n }\n getMaxY() {\n return this.maxY;\n }\n getTopLeft() {\n return this.topLeft;\n }\n getTopRight() {\n return this.topRight;\n }\n getBottomLeft() {\n return this.bottomLeft;\n }\n getBottomRight() {\n return this.bottomRight;\n }\n }\n\n /*\n * Copyright 2013 ZXing authors\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 // package com.google.zxing.pdf417.decoder;\n /**\n * @author Guenther Grau\n */\n /*final*/ class BarcodeMetadata {\n constructor(columnCount, rowCountUpperPart, rowCountLowerPart, errorCorrectionLevel) {\n this.columnCount = columnCount;\n this.errorCorrectionLevel = errorCorrectionLevel;\n this.rowCountUpperPart = rowCountUpperPart;\n this.rowCountLowerPart = rowCountLowerPart;\n this.rowCount = rowCountUpperPart + rowCountLowerPart;\n }\n getColumnCount() {\n return this.columnCount;\n }\n getErrorCorrectionLevel() {\n return this.errorCorrectionLevel;\n }\n getRowCount() {\n return this.rowCount;\n }\n getRowCountUpperPart() {\n return this.rowCountUpperPart;\n }\n getRowCountLowerPart() {\n return this.rowCountLowerPart;\n }\n }\n\n /**\n * Java Formatter class polyfill that works in the JS way.\n */\n class Formatter {\n constructor() {\n this.buffer = '';\n }\n /**\n *\n * @see https://stackoverflow.com/a/13439711/4367683\n *\n * @param str\n * @param arr\n */\n static form(str, arr) {\n let i = -1;\n function callback(exp, p0, p1, p2, p3, p4) {\n if (exp === '%%')\n return '%';\n if (arr[++i] === undefined)\n return undefined;\n exp = p2 ? parseInt(p2.substr(1)) : undefined;\n let base = p3 ? parseInt(p3.substr(1)) : undefined;\n let val;\n switch (p4) {\n case 's':\n val = arr[i];\n break;\n case 'c':\n val = arr[i][0];\n break;\n case 'f':\n val = parseFloat(arr[i]).toFixed(exp);\n break;\n case 'p':\n val = parseFloat(arr[i]).toPrecision(exp);\n break;\n case 'e':\n val = parseFloat(arr[i]).toExponential(exp);\n break;\n case 'x':\n val = parseInt(arr[i]).toString(base ? base : 16);\n break;\n case 'd':\n val = parseFloat(parseInt(arr[i], base ? base : 10).toPrecision(exp)).toFixed(0);\n break;\n }\n val = typeof val === 'object' ? JSON.stringify(val) : (+val).toString(base);\n let size = parseInt(p1); /* padding size */\n let ch = p1 && (p1[0] + '') === '0' ? '0' : ' '; /* isnull? */\n while (val.length < size)\n val = p0 !== undefined ? val + ch : ch + val; /* isminus? */\n return val;\n }\n let regex = /%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;\n return str.replace(regex, callback);\n }\n /**\n *\n * @param append The new string to append.\n * @param args Argumets values to be formated.\n */\n format(append, ...args) {\n this.buffer += Formatter.form(append, args);\n }\n /**\n * Returns the Formatter string value.\n */\n toString() {\n return this.buffer;\n }\n }\n\n /*\n * Copyright 2013 ZXing authors\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 /**\n * @author Guenther Grau\n */\n class DetectionResultColumn {\n constructor(boundingBox) {\n this.boundingBox = new BoundingBox(boundingBox);\n // this.codewords = new Codeword[boundingBox.getMaxY() - boundingBox.getMinY() + 1];\n this.codewords = new Array(boundingBox.getMaxY() - boundingBox.getMinY() + 1);\n }\n /*final*/ getCodewordNearby(imageRow) {\n let codeword = this.getCodeword(imageRow);\n if (codeword != null) {\n return codeword;\n }\n for (let i = 1; i < DetectionResultColumn.MAX_NEARBY_DISTANCE; i++) {\n let nearImageRow = this.imageRowToCodewordIndex(imageRow) - i;\n if (nearImageRow >= 0) {\n codeword = this.codewords[nearImageRow];\n if (codeword != null) {\n return codeword;\n }\n }\n nearImageRow = this.imageRowToCodewordIndex(imageRow) + i;\n if (nearImageRow < this.codewords.length) {\n codeword = this.codewords[nearImageRow];\n if (codeword != null) {\n return codeword;\n }\n }\n }\n return null;\n }\n /*final int*/ imageRowToCodewordIndex(imageRow) {\n return imageRow - this.boundingBox.getMinY();\n }\n /*final void*/ setCodeword(imageRow, codeword) {\n this.codewords[this.imageRowToCodewordIndex(imageRow)] = codeword;\n }\n /*final*/ getCodeword(imageRow) {\n return this.codewords[this.imageRowToCodewordIndex(imageRow)];\n }\n /*final*/ getBoundingBox() {\n return this.boundingBox;\n }\n /*final*/ getCodewords() {\n return this.codewords;\n }\n // @Override\n toString() {\n const formatter = new Formatter();\n let row = 0;\n for (const codeword of this.codewords) {\n if (codeword == null) {\n formatter.format('%3d: | %n', row++);\n continue;\n }\n formatter.format('%3d: %3d|%3d%n', row++, codeword.getRowNumber(), codeword.getValue());\n }\n return formatter.toString();\n }\n }\n DetectionResultColumn.MAX_NEARBY_DISTANCE = 5;\n\n /*\n * Copyright 2013 ZXing authors\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 // import java.util.ArrayList;\n // import java.util.Collection;\n // import java.util.HashMap;\n // import java.util.Map;\n // import java.util.Map.Entry;\n /**\n * @author Guenther Grau\n */\n /*final*/ class BarcodeValue {\n constructor() {\n this.values = new Map();\n }\n /**\n * Add an occurrence of a value\n */\n setValue(value) {\n value = Math.trunc(value);\n let confidence = this.values.get(value);\n if (confidence == null) {\n confidence = 0;\n }\n confidence++;\n this.values.set(value, confidence);\n }\n /**\n * Determines the maximum occurrence of a set value and returns all values which were set with this occurrence.\n * @return an array of int, containing the values with the highest occurrence, or null, if no value was set\n */\n getValue() {\n let maxConfidence = -1;\n let result = new Array();\n for (const [key, value] of this.values.entries()) {\n const entry = {\n getKey: () => key,\n getValue: () => value,\n };\n if (entry.getValue() > maxConfidence) {\n maxConfidence = entry.getValue();\n result = [];\n result.push(entry.getKey());\n }\n else if (entry.getValue() === maxConfidence) {\n result.push(entry.getKey());\n }\n }\n return PDF417Common.toIntArray(result);\n }\n getConfidence(value) {\n return this.values.get(value);\n }\n }\n\n /*\n * Copyright 2013 ZXing authors\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 /**\n * @author Guenther Grau\n */\n /*final*/ class DetectionResultRowIndicatorColumn extends DetectionResultColumn {\n constructor(boundingBox, isLeft) {\n super(boundingBox);\n this._isLeft = isLeft;\n }\n setRowNumbers() {\n for (let codeword /*Codeword*/ of this.getCodewords()) {\n if (codeword != null) {\n codeword.setRowNumberAsRowIndicatorColumn();\n }\n }\n }\n // TODO implement properly\n // TODO maybe we should add missing codewords to store the correct row number to make\n // finding row numbers for other columns easier\n // use row height count to make detection of invalid row numbers more reliable\n adjustCompleteIndicatorColumnRowNumbers(barcodeMetadata) {\n let codewords = this.getCodewords();\n this.setRowNumbers();\n this.removeIncorrectCodewords(codewords, barcodeMetadata);\n let boundingBox = this.getBoundingBox();\n let top = this._isLeft ? boundingBox.getTopLeft() : boundingBox.getTopRight();\n let bottom = this._isLeft ? boundingBox.getBottomLeft() : boundingBox.getBottomRight();\n let firstRow = this.imageRowToCodewordIndex(Math.trunc(top.getY()));\n let lastRow = this.imageRowToCodewordIndex(Math.trunc(bottom.getY()));\n // We need to be careful using the average row height. Barcode could be skewed so that we have smaller and\n // taller rows\n // float averageRowHeight = (lastRow - firstRow) / /*(float)*/ barcodeMetadata.getRowCount();\n let barcodeRow = -1;\n let maxRowHeight = 1;\n let currentRowHeight = 0;\n for (let codewordsRow /*int*/ = firstRow; codewordsRow < lastRow; codewordsRow++) {\n if (codewords[codewordsRow] == null) {\n continue;\n }\n let codeword = codewords[codewordsRow];\n // float expectedRowNumber = (codewordsRow - firstRow) / averageRowHeight;\n // if (Math.abs(codeword.getRowNumber() - expectedRowNumber) > 2) {\n // SimpleLog.log(LEVEL.WARNING,\n // \"Removing codeword, rowNumberSkew too high, codeword[\" + codewordsRow + \"]: Expected Row: \" +\n // expectedRowNumber + \", RealRow: \" + codeword.getRowNumber() + \", value: \" + codeword.getValue());\n // codewords[codewordsRow] = null;\n // }\n let rowDifference = codeword.getRowNumber() - barcodeRow;\n // TODO improve handling with case where first row indicator doesn't start with 0\n if (rowDifference === 0) {\n currentRowHeight++;\n }\n else if (rowDifference === 1) {\n maxRowHeight = Math.max(maxRowHeight, currentRowHeight);\n currentRowHeight = 1;\n barcodeRow = codeword.getRowNumber();\n }\n else if (rowDifference < 0 ||\n codeword.getRowNumber() >= barcodeMetadata.getRowCount() ||\n rowDifference > codewordsRow) {\n codewords[codewordsRow] = null;\n }\n else {\n let checkedRows;\n if (maxRowHeight > 2) {\n checkedRows = (maxRowHeight - 2) * rowDifference;\n }\n else {\n checkedRows = rowDifference;\n }\n let closePreviousCodewordFound = checkedRows >= codewordsRow;\n for (let i /*int*/ = 1; i <= checkedRows && !closePreviousCodewordFound; i++) {\n // there must be (height * rowDifference) number of codewords missing. For now we assume height = 1.\n // This should hopefully get rid of most problems already.\n closePreviousCodewordFound = codewords[codewordsRow - i] != null;\n }\n if (closePreviousCodewordFound) {\n codewords[codewordsRow] = null;\n }\n else {\n barcodeRow = codeword.getRowNumber();\n currentRowHeight = 1;\n }\n }\n }\n // return (int) (averageRowHeight + 0.5);\n }\n getRowHeights() {\n let barcodeMetadata = this.getBarcodeMetadata();\n if (barcodeMetadata == null) {\n return null;\n }\n this.adjustIncompleteIndicatorColumnRowNumbers(barcodeMetadata);\n let result = new Int32Array(barcodeMetadata.getRowCount());\n for (let codeword /*Codeword*/ of this.getCodewords()) {\n if (codeword != null) {\n let rowNumber = codeword.getRowNumber();\n if (rowNumber >= result.length) {\n // We have more rows than the barcode metadata allows for, ignore them.\n continue;\n }\n result[rowNumber]++;\n } // else throw exception?\n }\n return result;\n }\n // TODO maybe we should add missing codewords to store the correct row number to make\n // finding row numbers for other columns easier\n // use row height count to make detection of invalid row numbers more reliable\n adjustIncompleteIndicatorColumnRowNumbers(barcodeMetadata) {\n let boundingBox = this.getBoundingBox();\n let top = this._isLeft ? boundingBox.getTopLeft() : boundingBox.getTopRight();\n let bottom = this._isLeft ? boundingBox.getBottomLeft() : boundingBox.getBottomRight();\n let firstRow = this.imageRowToCodewordIndex(Math.trunc(top.getY()));\n let lastRow = this.imageRowToCodewordIndex(Math.trunc(bottom.getY()));\n // float averageRowHeight = (lastRow - firstRow) / /*(float)*/ barcodeMetadata.getRowCount();\n let codewords = this.getCodewords();\n let barcodeRow = -1;\n for (let codewordsRow /*int*/ = firstRow; codewordsRow < lastRow; codewordsRow++) {\n if (codewords[codewordsRow] == null) {\n continue;\n }\n let codeword = codewords[codewordsRow];\n codeword.setRowNumberAsRowIndicatorColumn();\n let rowDifference = codeword.getRowNumber() - barcodeRow;\n // TODO improve handling with case where first row indicator doesn't start with 0\n if (rowDifference === 0) ;\n else if (rowDifference === 1) {\n barcodeRow = codeword.getRowNumber();\n }\n else if (codeword.getRowNumber() >= barcodeMetadata.getRowCount()) {\n codewords[codewordsRow] = null;\n }\n else {\n barcodeRow = codeword.getRowNumber();\n }\n }\n // return (int) (averageRowHeight + 0.5);\n }\n getBarcodeMetadata() {\n let codewords = this.getCodewords();\n let barcodeColumnCount = new BarcodeValue();\n let barcodeRowCountUpperPart = new BarcodeValue();\n let barcodeRowCountLowerPart = new BarcodeValue();\n let barcodeECLevel = new BarcodeValue();\n for (let codeword /*Codeword*/ of codewords) {\n if (codeword == null) {\n continue;\n }\n codeword.setRowNumberAsRowIndicatorColumn();\n let rowIndicatorValue = codeword.getValue() % 30;\n let codewordRowNumber = codeword.getRowNumber();\n if (!this._isLeft) {\n codewordRowNumber += 2;\n }\n switch (codewordRowNumber % 3) {\n case 0:\n barcodeRowCountUpperPart.setValue(rowIndicatorValue * 3 + 1);\n break;\n case 1:\n barcodeECLevel.setValue(rowIndicatorValue / 3);\n barcodeRowCountLowerPart.setValue(rowIndicatorValue % 3);\n break;\n case 2:\n barcodeColumnCount.setValue(rowIndicatorValue + 1);\n break;\n }\n }\n // Maybe we should check if we have ambiguous values?\n if ((barcodeColumnCount.getValue().length === 0) ||\n (barcodeRowCountUpperPart.getValue().length === 0) ||\n (barcodeRowCountLowerPart.getValue().length === 0) ||\n (barcodeECLevel.getValue().length === 0) ||\n barcodeColumnCount.getValue()[0] < 1 ||\n barcodeRowCountUpperPart.getValue()[0] + barcodeRowCountLowerPart.getValue()[0] < PDF417Common.MIN_ROWS_IN_BARCODE ||\n barcodeRowCountUpperPart.getValue()[0] + barcodeRowCountLowerPart.getValue()[0] > PDF417Common.MAX_ROWS_IN_BARCODE) {\n return null;\n }\n let barcodeMetadata = new BarcodeMetadata(barcodeColumnCount.getValue()[0], barcodeRowCountUpperPart.getValue()[0], barcodeRowCountLowerPart.getValue()[0], barcodeECLevel.getValue()[0]);\n this.removeIncorrectCodewords(codewords, barcodeMetadata);\n return barcodeMetadata;\n }\n removeIncorrectCodewords(codewords, barcodeMetadata) {\n // Remove codewords which do not match the metadata\n // TODO Maybe we should keep the incorrect codewords for the start and end positions?\n for (let codewordRow /*int*/ = 0; codewordRow < codewords.length; codewordRow++) {\n let codeword = codewords[codewordRow];\n if (codewords[codewordRow] == null) {\n continue;\n }\n let rowIndicatorValue = codeword.getValue() % 30;\n let codewordRowNumber = codeword.getRowNumber();\n if (codewordRowNumber > barcodeMetadata.getRowCount()) {\n codewords[codewordRow] = null;\n continue;\n }\n if (!this._isLeft) {\n codewordRowNumber += 2;\n }\n switch (codewordRowNumber % 3) {\n case 0:\n if (rowIndicatorValue * 3 + 1 !== barcodeMetadata.getRowCountUpperPart()) {\n codewords[codewordRow] = null;\n }\n break;\n case 1:\n if (Math.trunc(rowIndicatorValue / 3) !== barcodeMetadata.getErrorCorrectionLevel() ||\n rowIndicatorValue % 3 !== barcodeMetadata.getRowCountLowerPart()) {\n codewords[codewordRow] = null;\n }\n break;\n case 2:\n if (rowIndicatorValue + 1 !== barcodeMetadata.getColumnCount()) {\n codewords[codewordRow] = null;\n }\n break;\n }\n }\n }\n isLeft() {\n return this._isLeft;\n }\n // @Override\n toString() {\n return 'IsLeft: ' + this._isLeft + '\\n' + super.toString();\n }\n }\n\n /*\n * Copyright 2013 ZXing authors\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 /**\n * @author Guenther Grau\n */\n /*final*/ class DetectionResult {\n constructor(barcodeMetadata, boundingBox) {\n /*final*/ this.ADJUST_ROW_NUMBER_SKIP = 2;\n this.barcodeMetadata = barcodeMetadata;\n this.barcodeColumnCount = barcodeMetadata.getColumnCount();\n this.boundingBox = boundingBox;\n // this.detectionResultColumns = new DetectionResultColumn[this.barcodeColumnCount + 2];\n this.detectionResultColumns = new Array(this.barcodeColumnCount + 2);\n }\n getDetectionResultColumns() {\n this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]);\n this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount + 1]);\n let unadjustedCodewordCount = PDF417Common.MAX_CODEWORDS_IN_BARCODE;\n let previousUnadjustedCount;\n do {\n previousUnadjustedCount = unadjustedCodewordCount;\n unadjustedCodewordCount = this.adjustRowNumbersAndGetCount();\n } while (unadjustedCodewordCount > 0 && unadjustedCodewordCount < previousUnadjustedCount);\n return this.detectionResultColumns;\n }\n adjustIndicatorColumnRowNumbers(detectionResultColumn) {\n if (detectionResultColumn != null) {\n detectionResultColumn\n .adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata);\n }\n }\n // TODO ensure that no detected codewords with unknown row number are left\n // we should be able to estimate the row height and use it as a hint for the row number\n // we should also fill the rows top to bottom and bottom to top\n /**\n * @return number of codewords which don't have a valid row number. Note that the count is not accurate as codewords\n * will be counted several times. It just serves as an indicator to see when we can stop adjusting row numbers\n */\n adjustRowNumbersAndGetCount() {\n let unadjustedCount = this.adjustRowNumbersByRow();\n if (unadjustedCount === 0) {\n return 0;\n }\n for (let barcodeColumn /*int*/ = 1; barcodeColumn < this.barcodeColumnCount + 1; barcodeColumn++) {\n let codewords = this.detectionResultColumns[barcodeColumn].getCodewords();\n for (let codewordsRow /*int*/ = 0; codewordsRow < codewords.length; codewordsRow++) {\n if (codewords[codewordsRow] == null) {\n continue;\n }\n if (!codewords[codewordsRow].hasValidRowNumber()) {\n this.adjustRowNumbers(barcodeColumn, codewordsRow, codewords);\n }\n }\n }\n return unadjustedCount;\n }\n adjustRowNumbersByRow() {\n this.adjustRowNumbersFromBothRI();\n // TODO we should only do full row adjustments if row numbers of left and right row indicator column match.\n // Maybe it's even better to calculated the height (rows: d) and divide it by the number of barcode\n // rows. This, together with the LRI and RRI row numbers should allow us to get a good estimate where a row\n // number starts and ends.\n let unadjustedCount = this.adjustRowNumbersFromLRI();\n return unadjustedCount + this.adjustRowNumbersFromRRI();\n }\n adjustRowNumbersFromBothRI() {\n if (this.detectionResultColumns[0] == null || this.detectionResultColumns[this.barcodeColumnCount + 1] == null) {\n return;\n }\n let LRIcodewords = this.detectionResultColumns[0].getCodewords();\n let RRIcodewords = this.detectionResultColumns[this.barcodeColumnCount + 1].getCodewords();\n for (let codewordsRow /*int*/ = 0; codewordsRow < LRIcodewords.length; codewordsRow++) {\n if (LRIcodewords[codewordsRow] != null &&\n RRIcodewords[codewordsRow] != null &&\n LRIcodewords[codewordsRow].getRowNumber() === RRIcodewords[codewordsRow].getRowNumber()) {\n for (let barcodeColumn /*int*/ = 1; barcodeColumn <= this.barcodeColumnCount; barcodeColumn++) {\n let codeword = this.detectionResultColumns[barcodeColumn].getCodewords()[codewordsRow];\n if (codeword == null) {\n continue;\n }\n codeword.setRowNumber(LRIcodewords[codewordsRow].getRowNumber());\n if (!codeword.hasValidRowNumber()) {\n this.detectionResultColumns[barcodeColumn].getCodewords()[codewordsRow] = null;\n }\n }\n }\n }\n }\n adjustRowNumbersFromRRI() {\n if (this.detectionResultColumns[this.barcodeColumnCount + 1] == null) {\n return 0;\n }\n let unadjustedCount = 0;\n let codewords = this.detectionResultColumns[this.barcodeColumnCount + 1].getCodewords();\n for (let codewordsRow /*int*/ = 0; codewordsRow < codewords.length; codewordsRow++) {\n if (codewords[codewordsRow] == null) {\n continue;\n }\n let rowIndicatorRowNumber = codewords[codewordsRow].getRowNumber();\n let invalidRowCounts = 0;\n for (let barcodeColumn /*int*/ = this.barcodeColumnCount + 1; barcodeColumn > 0 && invalidRowCounts < this.ADJUST_ROW_NUMBER_SKIP; barcodeColumn--) {\n let codeword = this.detectionResultColumns[barcodeColumn].getCodewords()[codewordsRow];\n if (codeword != null) {\n invalidRowCounts = DetectionResult.adjustRowNumberIfValid(rowIndicatorRowNumber, invalidRowCounts, codeword);\n if (!codeword.hasValidRowNumber()) {\n unadjustedCount++;\n }\n }\n }\n }\n return unadjustedCount;\n }\n adjustRowNumbersFromLRI() {\n if (this.detectionResultColumns[0] == null) {\n return 0;\n }\n let unadjustedCount = 0;\n let codewords = this.detectionResultColumns[0].getCodewords();\n for (let codewordsRow /*int*/ = 0; codewordsRow < codewords.length; codewordsRow++) {\n if (codewords[codewordsRow] == null) {\n continue;\n }\n let rowIndicatorRowNumber = codewords[codewordsRow].getRowNumber();\n let invalidRowCounts = 0;\n for (let barcodeColumn /*int*/ = 1; barcodeColumn < this.barcodeColumnCount + 1 && invalidRowCounts < this.ADJUST_ROW_NUMBER_SKIP; barcodeColumn++) {\n let codeword = this.detectionResultColumns[barcodeColumn].getCodewords()[codewordsRow];\n if (codeword != null) {\n invalidRowCounts = DetectionResult.adjustRowNumberIfValid(rowIndicatorRowNumber, invalidRowCounts, codeword);\n if (!codeword.hasValidRowNumber()) {\n unadjustedCount++;\n }\n }\n }\n }\n return unadjustedCount;\n }\n static adjustRowNumberIfValid(rowIndicatorRowNumber, invalidRowCounts, codeword) {\n if (codeword == null) {\n return invalidRowCounts;\n }\n if (!codeword.hasValidRowNumber()) {\n if (codeword.isValidRowNumber(rowIndicatorRowNumber)) {\n codeword.setRowNumber(rowIndicatorRowNumber);\n invalidRowCounts = 0;\n }\n else {\n ++invalidRowCounts;\n }\n }\n return invalidRowCounts;\n }\n adjustRowNumbers(barcodeColumn, codewordsRow, codewords) {\n let codeword = codewords[codewordsRow];\n let previousColumnCodewords = this.detectionResultColumns[barcodeColumn - 1].getCodewords();\n let nextColumnCodewords = previousColumnCodewords;\n if (this.detectionResultColumns[barcodeColumn + 1] != null) {\n nextColumnCodewords = this.detectionResultColumns[barcodeColumn + 1].getCodewords();\n }\n // let otherCodewords: Codeword[] = new Codeword[14];\n let otherCodewords = new Array(14);\n otherCodewords[2] = previousColumnCodewords[codewordsRow];\n otherCodewords[3] = nextColumnCodewords[codewordsRow];\n if (codewordsRow > 0) {\n otherCodewords[0] = codewords[codewordsRow - 1];\n otherCodewords[4] = previousColumnCodewords[codewordsRow - 1];\n otherCodewords[5] = nextColumnCodewords[codewordsRow - 1];\n }\n if (codewordsRow > 1) {\n otherCodewords[8] = codewords[codewordsRow - 2];\n otherCodewords[10] = previousColumnCodewords[codewordsRow - 2];\n otherCodewords[11] = nextColumnCodewords[codewordsRow - 2];\n }\n if (codewordsRow < codewords.length - 1) {\n otherCodewords[1] = codewords[codewordsRow + 1];\n otherCodewords[6] = previousColumnCodewords[codewordsRow + 1];\n otherCodewords[7] = nextColumnCodewords[codewordsRow + 1];\n }\n if (codewordsRow < codewords.length - 2) {\n otherCodewords[9] = codewords[codewordsRow + 2];\n otherCodewords[12] = previousColumnCodewords[codewordsRow + 2];\n otherCodewords[13] = nextColumnCodewords[codewordsRow + 2];\n }\n for (let otherCodeword of otherCodewords) {\n if (DetectionResult.adjustRowNumber(codeword, otherCodeword)) {\n return;\n }\n }\n }\n /**\n * @return true, if row number was adjusted, false otherwise\n */\n static adjustRowNumber(codeword, otherCodeword) {\n if (otherCodeword == null) {\n return false;\n }\n if (otherCodeword.hasValidRowNumber() && otherCodeword.getBucket() === codeword.getBucket()) {\n codeword.setRowNumber(otherCodeword.getRowNumber());\n return true;\n }\n return false;\n }\n getBarcodeColumnCount() {\n return this.barcodeColumnCount;\n }\n getBarcodeRowCount() {\n return this.barcodeMetadata.getRowCount();\n }\n getBarcodeECLevel() {\n return this.barcodeMetadata.getErrorCorrectionLevel();\n }\n setBoundingBox(boundingBox) {\n this.boundingBox = boundingBox;\n }\n getBoundingBox() {\n return this.boundingBox;\n }\n setDetectionResultColumn(barcodeColumn, detectionResultColumn) {\n this.detectionResultColumns[barcodeColumn] = detectionResultColumn;\n }\n getDetectionResultColumn(barcodeColumn) {\n return this.detectionResultColumns[barcodeColumn];\n }\n // @Override\n toString() {\n let rowIndicatorColumn = this.detectionResultColumns[0];\n if (rowIndicatorColumn == null) {\n rowIndicatorColumn = this.detectionResultColumns[this.barcodeColumnCount + 1];\n }\n // try (\n let formatter = new Formatter();\n // ) {\n for (let codewordsRow /*int*/ = 0; codewordsRow < rowIndicatorColumn.getCodewords().length; codewordsRow++) {\n formatter.format('CW %3d:', codewordsRow);\n for (let barcodeColumn /*int*/ = 0; barcodeColumn < this.barcodeColumnCount + 2; barcodeColumn++) {\n if (this.detectionResultColumns[barcodeColumn] == null) {\n formatter.format(' | ');\n continue;\n }\n let codeword = this.detectionResultColumns[barcodeColumn].getCodewords()[codewordsRow];\n if (codeword == null) {\n formatter.format(' | ');\n continue;\n }\n formatter.format(' %3d|%3d', codeword.getRowNumber(), codeword.getValue());\n }\n formatter.format('%n');\n }\n return formatter.toString();\n // }\n }\n }\n\n /*\n * Copyright 2013 ZXing authors\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 // package com.google.zxing.pdf417.decoder;\n /**\n * @author Guenther Grau\n */\n /*final*/ class Codeword {\n constructor(startX, endX, bucket, value) {\n this.rowNumber = Codeword.BARCODE_ROW_UNKNOWN;\n this.startX = Math.trunc(startX);\n this.endX = Math.trunc(endX);\n this.bucket = Math.trunc(bucket);\n this.value = Math.trunc(value);\n }\n hasValidRowNumber() {\n return this.isValidRowNumber(this.rowNumber);\n }\n isValidRowNumber(rowNumber) {\n return rowNumber !== Codeword.BARCODE_ROW_UNKNOWN && this.bucket === (rowNumber % 3) * 3;\n }\n setRowNumberAsRowIndicatorColumn() {\n this.rowNumber = Math.trunc((Math.trunc(this.value / 30)) * 3 + Math.trunc(this.bucket / 3));\n }\n getWidth() {\n return this.endX - this.startX;\n }\n getStartX() {\n return this.startX;\n }\n getEndX() {\n return this.endX;\n }\n getBucket() {\n return this.bucket;\n }\n getValue() {\n return this.value;\n }\n getRowNumber() {\n return this.rowNumber;\n }\n setRowNumber(rowNumber) {\n this.rowNumber = rowNumber;\n }\n // @Override\n toString() {\n return this.rowNumber + '|' + this.value;\n }\n }\n Codeword.BARCODE_ROW_UNKNOWN = -1;\n\n /*\n * Copyright 2013 ZXing authors\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 /**\n * @author Guenther Grau\n * @author creatale GmbH (christoph.schulz@creatale.de)\n */\n /*final*/ class PDF417CodewordDecoder {\n /* @note\n * this action have to be performed before first use of class\n * - static constructor\n * working with 32bit float (based from Java logic)\n */\n static initialize() {\n // Pre-computes the symbol ratio table.\n for ( /*int*/let i = 0; i < PDF417Common.SYMBOL_TABLE.length; i++) {\n let currentSymbol = PDF417Common.SYMBOL_TABLE[i];\n let currentBit = currentSymbol & 0x1;\n for ( /*int*/let j = 0; j < PDF417Common.BARS_IN_MODULE; j++) {\n let size = 0.0;\n while ((currentSymbol & 0x1) === currentBit) {\n size += 1.0;\n currentSymbol >>= 1;\n }\n currentBit = currentSymbol & 0x1;\n if (!PDF417CodewordDecoder.RATIOS_TABLE[i]) {\n PDF417CodewordDecoder.RATIOS_TABLE[i] = new Array(PDF417Common.BARS_IN_MODULE);\n }\n PDF417CodewordDecoder.RATIOS_TABLE[i][PDF417Common.BARS_IN_MODULE - j - 1] = Math.fround(size / PDF417Common.MODULES_IN_CODEWORD);\n }\n }\n this.bSymbolTableReady = true;\n }\n static getDecodedValue(moduleBitCount) {\n let decodedValue = PDF417CodewordDecoder.getDecodedCodewordValue(PDF417CodewordDecoder.sampleBitCounts(moduleBitCount));\n if (decodedValue !== -1) {\n return decodedValue;\n }\n return PDF417CodewordDecoder.getClosestDecodedValue(moduleBitCount);\n }\n static sampleBitCounts(moduleBitCount) {\n let bitCountSum = MathUtils.sum(moduleBitCount);\n let result = new Int32Array(PDF417Common.BARS_IN_MODULE);\n let bitCountIndex = 0;\n let sumPreviousBits = 0;\n for ( /*int*/let i = 0; i < PDF417Common.MODULES_IN_CODEWORD; i++) {\n let sampleIndex = bitCountSum / (2 * PDF417Common.MODULES_IN_CODEWORD) +\n (i * bitCountSum) / PDF417Common.MODULES_IN_CODEWORD;\n if (sumPreviousBits + moduleBitCount[bitCountIndex] <= sampleIndex) {\n sumPreviousBits += moduleBitCount[bitCountIndex];\n bitCountIndex++;\n }\n result[bitCountIndex]++;\n }\n return result;\n }\n static getDecodedCodewordValue(moduleBitCount) {\n let decodedValue = PDF417CodewordDecoder.getBitValue(moduleBitCount);\n return PDF417Common.getCodeword(decodedValue) === -1 ? -1 : decodedValue;\n }\n static getBitValue(moduleBitCount) {\n let result = /*long*/ 0;\n for (let /*int*/ i = 0; i < moduleBitCount.length; i++) {\n for ( /*int*/let bit = 0; bit < moduleBitCount[i]; bit++) {\n result = (result << 1) | (i % 2 === 0 ? 1 : 0);\n }\n }\n return Math.trunc(result);\n }\n // working with 32bit float (as in Java)\n static getClosestDecodedValue(moduleBitCount) {\n let bitCountSum = MathUtils.sum(moduleBitCount);\n let bitCountRatios = new Array(PDF417Common.BARS_IN_MODULE);\n if (bitCountSum > 1) {\n for (let /*int*/ i = 0; i < bitCountRatios.length; i++) {\n bitCountRatios[i] = Math.fround(moduleBitCount[i] / bitCountSum);\n }\n }\n let bestMatchError = Float.MAX_VALUE;\n let bestMatch = -1;\n if (!this.bSymbolTableReady) {\n PDF417CodewordDecoder.initialize();\n }\n for ( /*int*/let j = 0; j < PDF417CodewordDecoder.RATIOS_TABLE.length; j++) {\n let error = 0.0;\n let ratioTableRow = PDF417CodewordDecoder.RATIOS_TABLE[j];\n for ( /*int*/let k = 0; k < PDF417Common.BARS_IN_MODULE; k++) {\n let diff = Math.fround(ratioTableRow[k] - bitCountRatios[k]);\n error += Math.fround(diff * diff);\n if (error >= bestMatchError) {\n break;\n }\n }\n if (error < bestMatchError) {\n bestMatchError = error;\n bestMatch = PDF417Common.SYMBOL_TABLE[j];\n }\n }\n return bestMatch;\n }\n }\n // flag that the table is ready for use\n PDF417CodewordDecoder.bSymbolTableReady = false;\n PDF417CodewordDecoder.RATIOS_TABLE = new Array(PDF417Common.SYMBOL_TABLE.length).map(x => x = new Array(PDF417Common.BARS_IN_MODULE));\n\n /*\n * Copyright 2013 ZXing authors\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 // package com.google.zxing.pdf417;\n /**\n * @author Guenther Grau\n */\n /*public final*/ class PDF417ResultMetadata {\n constructor() {\n this.segmentCount = -1;\n this.fileSize = -1;\n this.timestamp = -1;\n this.checksum = -1;\n }\n /**\n * The Segment ID represents the segment of the whole file distributed over different symbols.\n *\n * @return File segment index\n */\n getSegmentIndex() {\n return this.segmentIndex;\n }\n setSegmentIndex(segmentIndex) {\n this.segmentIndex = segmentIndex;\n }\n /**\n * Is the same for each related PDF417 symbol\n *\n * @return File ID\n */\n getFileId() {\n return this.fileId;\n }\n setFileId(fileId) {\n this.fileId = fileId;\n }\n /**\n * @return always null\n * @deprecated use dedicated already parsed fields\n */\n // @Deprecated\n getOptionalData() {\n return this.optionalData;\n }\n /**\n * @param optionalData old optional data format as int array\n * @deprecated parse and use new fields\n */\n // @Deprecated\n setOptionalData(optionalData) {\n this.optionalData = optionalData;\n }\n /**\n * @return true if it is the last segment\n */\n isLastSegment() {\n return this.lastSegment;\n }\n setLastSegment(lastSegment) {\n this.lastSegment = lastSegment;\n }\n /**\n * @return count of segments, -1 if not set\n */\n getSegmentCount() {\n return this.segmentCount;\n }\n setSegmentCount(segmentCount /*int*/) {\n this.segmentCount = segmentCount;\n }\n getSender() {\n return this.sender || null;\n }\n setSender(sender) {\n this.sender = sender;\n }\n getAddressee() {\n return this.addressee || null;\n }\n setAddressee(addressee) {\n this.addressee = addressee;\n }\n /**\n * Filename of the encoded file\n *\n * @return filename\n */\n getFileName() {\n return this.fileName;\n }\n setFileName(fileName) {\n this.fileName = fileName;\n }\n /**\n * filesize in bytes of the encoded file\n *\n * @return filesize in bytes, -1 if not set\n */\n getFileSize() {\n return this.fileSize;\n }\n setFileSize(fileSize /*long*/) {\n this.fileSize = fileSize;\n }\n /**\n * 16-bit CRC checksum using CCITT-16\n *\n * @return crc checksum, -1 if not set\n */\n getChecksum() {\n return this.checksum;\n }\n setChecksum(checksum /*int*/) {\n this.checksum = checksum;\n }\n /**\n * unix epock timestamp, elapsed seconds since 1970-01-01\n *\n * @return elapsed seconds, -1 if not set\n */\n getTimestamp() {\n return this.timestamp;\n }\n setTimestamp(timestamp /*long*/) {\n this.timestamp = timestamp;\n }\n }\n\n /**\n * Ponyfill for Java's Long class.\n */\n class Long {\n /**\n * Parses a string to a number, since JS has no really Int64.\n *\n * @param num Numeric string.\n * @param radix Destination radix.\n */\n static parseLong(num, radix = undefined) {\n return parseInt(num, radix);\n }\n }\n\n /**\n * Custom Error class of type Exception.\n */\n class NullPointerException extends Exception {\n }\n NullPointerException.kind = 'NullPointerException';\n\n /*\n * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved.\n * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n *\n * This code is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License version 2 only, as\n * published by the Free Software Foundation. Oracle designates this\n * particular file as subject to the \"Classpath\" exception as provided\n * by Oracle in the LICENSE file that accompanied this code.\n *\n * This code is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n * version 2 for more details (a copy is included in the LICENSE file that\n * accompanied this code).\n *\n * You should have received a copy of the GNU General Public License version\n * 2 along with this work; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n * or visit www.oracle.com if you need additional information or have any\n * questions.\n */\n // package java.io;\n /**\n * This abstract class is the superclass of all classes representing\n * an output stream of bytes. An output stream accepts output bytes\n * and sends them to some sink.\n *\n * Applications that need to define a subclass of\n * OutputStream
must always provide at least a method\n * that writes one byte of output.\n *\n * @author Arthur van Hoff\n * @see java.io.BufferedOutputStream\n * @see java.io.ByteArrayOutputStream\n * @see java.io.DataOutputStream\n * @see java.io.FilterOutputStream\n * @see java.io.InputStream\n * @see java.io.OutputStream#write(int)\n * @since JDK1.0\n */\n /*public*/ class OutputStream /*implements Closeable, Flushable*/ {\n /**\n * Writes b.length
bytes from the specified byte array\n * to this output stream. The general contract for write(b)
\n * is that it should have exactly the same effect as the call\n * write(b, 0, b.length)
.\n *\n * @param b the data.\n * @exception IOException if an I/O error occurs.\n * @see java.io.OutputStream#write(byte[], int, int)\n */\n writeBytes(b) {\n this.writeBytesOffset(b, 0, b.length);\n }\n /**\n * Writes len
bytes from the specified byte array\n * starting at offset off
to this output stream.\n * The general contract for write(b, off, len)
is that\n * some of the bytes in the array b
are written to the\n * output stream in order; element b[off]
is the first\n * byte written and b[off+len-1]
is the last byte written\n * by this operation.\n *
\n * The write
method of OutputStream
calls\n * the write method of one argument on each of the bytes to be\n * written out. Subclasses are encouraged to override this method and\n * provide a more efficient implementation.\n *
\n * If b
is null
, a\n * NullPointerException
is thrown.\n *
\n * If off
is negative, or len
is negative, or\n * off+len
is greater than the length of the array\n * b
, then an IndexOutOfBoundsException is thrown.\n *\n * @param b the data.\n * @param off the start offset in the data.\n * @param len the number of bytes to write.\n * @exception IOException if an I/O error occurs. In particular,\n * an IOException
is thrown if the output\n * stream is closed.\n */\n writeBytesOffset(b, off, len) {\n if (b == null) {\n throw new NullPointerException();\n }\n else if ((off < 0) || (off > b.length) || (len < 0) ||\n ((off + len) > b.length) || ((off + len) < 0)) {\n throw new IndexOutOfBoundsException();\n }\n else if (len === 0) {\n return;\n }\n for (let i = 0; i < len; i++) {\n this.write(b[off + i]);\n }\n }\n /**\n * Flushes this output stream and forces any buffered output bytes\n * to be written out. The general contract of flush
is\n * that calling it is an indication that, if any bytes previously\n * written have been buffered by the implementation of the output\n * stream, such bytes should immediately be written to their\n * intended destination.\n *
\n * If the intended destination of this stream is an abstraction provided by\n * the underlying operating system, for example a file, then flushing the\n * stream guarantees only that bytes previously written to the stream are\n * passed to the operating system for writing; it does not guarantee that\n * they are actually written to a physical device such as a disk drive.\n *
\n * The flush
method of OutputStream
does nothing.\n *\n * @exception IOException if an I/O error occurs.\n */\n flush() {\n }\n /**\n * Closes this output stream and releases any system resources\n * associated with this stream. The general contract of close
\n * is that it closes the output stream. A closed stream cannot perform\n * output operations and cannot be reopened.\n *
\n * The close
method of OutputStream
does nothing.\n *\n * @exception IOException if an I/O error occurs.\n */\n close() {\n }\n }\n\n /**\n * Custom Error class of type Exception.\n */\n class OutOfMemoryError extends Exception {\n }\n\n /*\n * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.\n * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n *\n * This code is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License version 2 only, as\n * published by the Free Software Foundation. Oracle designates this\n * particular file as subject to the \"Classpath\" exception as provided\n * by Oracle in the LICENSE file that accompanied this code.\n *\n * This code is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n * version 2 for more details (a copy is included in the LICENSE file that\n * accompanied this code).\n *\n * You should have received a copy of the GNU General Public License version\n * 2 along with this work; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n * or visit www.oracle.com if you need additional information or have any\n * questions.\n */\n /**\n * This class implements an output stream in which the data is\n * written into a byte array. The buffer automatically grows as data\n * is written to it.\n * The data can be retrieved using toByteArray()
and\n * toString()
.\n *
\n * Closing a ByteArrayOutputStream has no effect. The methods in\n * this class can be called after the stream has been closed without\n * generating an IOException.\n *\n * @author Arthur van Hoff\n * @since JDK1.0\n */\n /*public*/ class ByteArrayOutputStream extends OutputStream {\n /**\n * Creates a new byte array output stream. The buffer capacity is\n * initially 32 bytes, though its size increases if necessary.\n */\n // public constructor() {\n // this(32);\n // }\n /**\n * Creates a new byte array output stream, with a buffer capacity of\n * the specified size, in bytes.\n *\n * @param size the initial size.\n * @exception IllegalArgumentException if size is negative.\n */\n constructor(size = 32) {\n super();\n /**\n * The number of valid bytes in the buffer.\n */\n this.count = 0;\n if (size < 0) {\n throw new IllegalArgumentException('Negative initial size: '\n + size);\n }\n this.buf = new Uint8Array(size);\n }\n /**\n * Increases the capacity if necessary to ensure that it can hold\n * at least the number of elements specified by the minimum\n * capacity argument.\n *\n * @param minCapacity the desired minimum capacity\n * @throws OutOfMemoryError if {@code minCapacity < 0}. This is\n * interpreted as a request for the unsatisfiably large capacity\n * {@code (long) Integer.MAX_VALUE + (minCapacity - Integer.MAX_VALUE)}.\n */\n ensureCapacity(minCapacity) {\n // overflow-conscious code\n if (minCapacity - this.buf.length > 0)\n this.grow(minCapacity);\n }\n /**\n * Increases the capacity to ensure that it can hold at least the\n * number of elements specified by the minimum capacity argument.\n *\n * @param minCapacity the desired minimum capacity\n */\n grow(minCapacity) {\n // overflow-conscious code\n let oldCapacity = this.buf.length;\n let newCapacity = oldCapacity << 1;\n if (newCapacity - minCapacity < 0)\n newCapacity = minCapacity;\n if (newCapacity < 0) {\n if (minCapacity < 0) // overflow\n throw new OutOfMemoryError();\n newCapacity = Integer.MAX_VALUE;\n }\n this.buf = Arrays.copyOfUint8Array(this.buf, newCapacity);\n }\n /**\n * Writes the specified byte to this byte array output stream.\n *\n * @param b the byte to be written.\n */\n write(b) {\n this.ensureCapacity(this.count + 1);\n this.buf[this.count] = /*(byte)*/ b;\n this.count += 1;\n }\n /**\n * Writes len
bytes from the specified byte array\n * starting at offset off
to this byte array output stream.\n *\n * @param b the data.\n * @param off the start offset in the data.\n * @param len the number of bytes to write.\n */\n writeBytesOffset(b, off, len) {\n if ((off < 0) || (off > b.length) || (len < 0) ||\n ((off + len) - b.length > 0)) {\n throw new IndexOutOfBoundsException();\n }\n this.ensureCapacity(this.count + len);\n System.arraycopy(b, off, this.buf, this.count, len);\n this.count += len;\n }\n /**\n * Writes the complete contents of this byte array output stream to\n * the specified output stream argument, as if by calling the output\n * stream's write method using out.write(buf, 0, count)
.\n *\n * @param out the output stream to which to write the data.\n * @exception IOException if an I/O error occurs.\n */\n writeTo(out) {\n out.writeBytesOffset(this.buf, 0, this.count);\n }\n /**\n * Resets the count
field of this byte array output\n * stream to zero, so that all currently accumulated output in the\n * output stream is discarded. The output stream can be used again,\n * reusing the already allocated buffer space.\n *\n * @see java.io.ByteArrayInputStream#count\n */\n reset() {\n this.count = 0;\n }\n /**\n * Creates a newly allocated byte array. Its size is the current\n * size of this output stream and the valid contents of the buffer\n * have been copied into it.\n *\n * @return the current contents of this output stream, as a byte array.\n * @see java.io.ByteArrayOutputStream#size()\n */\n toByteArray() {\n return Arrays.copyOfUint8Array(this.buf, this.count);\n }\n /**\n * Returns the current size of the buffer.\n *\n * @return the value of the count
field, which is the number\n * of valid bytes in this output stream.\n * @see java.io.ByteArrayOutputStream#count\n */\n size() {\n return this.count;\n }\n toString(param) {\n if (!param) {\n return this.toString_void();\n }\n if (typeof param === 'string') {\n return this.toString_string(param);\n }\n return this.toString_number(param);\n }\n /**\n * Converts the buffer's contents into a string decoding bytes using the\n * platform's default character set. The length of the new String\n * is a function of the character set, and hence may not be equal to the\n * size of the buffer.\n *\n *
This method always replaces malformed-input and unmappable-character\n * sequences with the default replacement string for the platform's\n * default character set. The {@linkplain java.nio.charset.CharsetDecoder}\n * class should be used when more control over the decoding process is\n * required.\n *\n * @return String decoded from the buffer's contents.\n * @since JDK1.1\n */\n toString_void() {\n return new String(this.buf /*, 0, this.count*/).toString();\n }\n /**\n * Converts the buffer's contents into a string by decoding the bytes using\n * the specified {@link java.nio.charset.Charset charsetName}. The length of\n * the new String is a function of the charset, and hence may not be\n * equal to the length of the byte array.\n *\n *
This method always replaces malformed-input and unmappable-character\n * sequences with this charset's default replacement string. The {@link\n * java.nio.charset.CharsetDecoder} class should be used when more control\n * over the decoding process is required.\n *\n * @param charsetName the name of a supported\n * {@linkplain java.nio.charset.Charset charset \n *\n * @throws IOException\n */\n close() {\n }\n }\n\n /*\n * Copyright 2009 ZXing authors\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 /*private*/ var Mode$2;\n (function (Mode) {\n Mode[Mode[\"ALPHA\"] = 0] = \"ALPHA\";\n Mode[Mode[\"LOWER\"] = 1] = \"LOWER\";\n Mode[Mode[\"MIXED\"] = 2] = \"MIXED\";\n Mode[Mode[\"PUNCT\"] = 3] = \"PUNCT\";\n Mode[Mode[\"ALPHA_SHIFT\"] = 4] = \"ALPHA_SHIFT\";\n Mode[Mode[\"PUNCT_SHIFT\"] = 5] = \"PUNCT_SHIFT\";\n })(Mode$2 || (Mode$2 = {}));\n /**\n * Indirectly access the global BigInt constructor, it\n * allows browsers that doesn't support BigInt to run\n * the library without breaking due to \"undefined BigInt\"\n * errors.\n */\n function getBigIntConstructor() {\n if (typeof window !== 'undefined') {\n return window['BigInt'] || null;\n }\n if (typeof global !== 'undefined') {\n return global['BigInt'] || null;\n }\n if (typeof self !== 'undefined') {\n return self['BigInt'] || null;\n }\n throw new Error('Can\\'t search globals for BigInt!');\n }\n /**\n * Used to store the BigInt constructor.\n */\n let BigInteger;\n /**\n * This function creates a bigint value. It allows browsers\n * that doesn't support BigInt to run the rest of the library\n * by not directly accessing the BigInt constructor.\n */\n function createBigInt(num) {\n if (typeof BigInteger === 'undefined') {\n BigInteger = getBigIntConstructor();\n }\n if (BigInteger === null) {\n throw new Error('BigInt is not supported!');\n }\n return BigInteger(num);\n }\n function getEXP900() {\n // in Java - array with length = 16\n let EXP900 = [];\n EXP900[0] = createBigInt(1);\n let nineHundred = createBigInt(900);\n EXP900[1] = nineHundred;\n // in Java - array with length = 16\n for (let i /*int*/ = 2; i < 16; i++) {\n EXP900[i] = EXP900[i - 1] * nineHundred;\n }\n return EXP900;\n }\n /**\n * This class contains the methods for decoding the PDF417 codewords. Given data and error-correction codewords received, possibly corrupted by errors, attempts to\n * correct the errors in-place. Implements Reed-Solomon encoding, as the name implies. Encode a sequence of code words (symbols) using Reed-Solomon to allow decoders\n * to detect and correct errors that may have been introduced when the resulting\n * data is stored or transmitted.}\n * @return String decoded from the buffer's contents.\n * @exception UnsupportedEncodingException\n * If the named charset is not supported\n * @since JDK1.1\n */\n toString_string(charsetName) {\n return new String(this.buf /*, 0, this.count, charsetName*/).toString();\n }\n /**\n * Creates a newly allocated string. Its size is the current size of\n * the output stream and the valid contents of the buffer have been\n * copied into it. Each character c in the resulting string is\n * constructed from the corresponding element b in the byte\n * array such that:\n *
\n *\n * @deprecated This method does not properly convert bytes into characters.\n * As of JDK 1.1, the preferred way to do this is via the\n * \n * c == (char)(((hibyte & 0xff) << 8) | (b & 0xff))\n *
toString(String enc)
method, which takes an encoding-name\n * argument, or the toString()
method, which uses the\n * platform's default character encoding.\n *\n * @param hibyte the high byte of each resulting Unicode character.\n * @return the current contents of the output stream, as a string.\n * @see java.io.ByteArrayOutputStream#size()\n * @see java.io.ByteArrayOutputStream#toString(String)\n * @see java.io.ByteArrayOutputStream#toString()\n */\n // @Deprecated\n toString_number(hibyte) {\n return new String(this.buf /*, hibyte, 0, this.count*/).toString();\n }\n /**\n * Closing a ByteArrayOutputStream has no effect. The methods in\n * this class can be called after the stream has been closed without\n * generating an IOException.\n *