@mescius/wijmo.barcode.common 5.20232.939
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMMERCIAL-LICENSE.html +485 -0
- package/README.md +363 -0
- package/es2015-commonjs.js +14 -0
- package/es2015-esm.js +14 -0
- package/es5-esm.js +14 -0
- package/index.d.ts +982 -0
- package/index.js +14 -0
- package/package.json +45 -0
package/es2015-esm.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* Wijmo Library 5.20232.939
|
|
4
|
+
* https://developer.mescius.com/wijmo
|
|
5
|
+
*
|
|
6
|
+
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
|
|
9
|
+
* us.sales@mescius.com
|
|
10
|
+
* https://developer.mescius.com/wijmo/licensing
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import{asEnum,addClass,_registerModule}from"@mescius/wijmo";import{OneDimensionalBarcode,Utils,InvalidTextException,InvalidOptionsException,Barcode,InvalidCharacterException,Constants,TextTooLongException,BitBuffer,TwoDimensionalBarcode,BarcodeBase,_LabelPositionConvertor,_NarrowWideRatioConvertor}from"@mescius/wijmo.barcode";import*as selfModule from"@mescius/wijmo.barcode.common";const EXP_TABLE=new Array(256);for(let e=0;e<8;e++)EXP_TABLE[e]=1<<e;for(let e=8;e<256;e++)EXP_TABLE[e]=EXP_TABLE[e-4]^EXP_TABLE[e-5]^EXP_TABLE[e-6]^EXP_TABLE[e-8];const LOG_TABLE=new Array(256);for(let e=0;e<255;e+=1)LOG_TABLE[EXP_TABLE[e]]=e;const RS_COEFFICIENTS=[null,null,null,null,null,null,null,[0,87,229,146,149,238,102,21],null,null,[0,251,67,46,61,118,70,64,94,32,45],null,null,[0,74,152,176,100,86,100,106,104,130,218,206,140,78],null,[0,8,183,61,91,202,37,51,58,58,237,140,124,5,99,105],[0,120,104,107,109,102,161,76,3,91,191,147,169,182,194,225,120],[0,43,139,206,78,43,239,123,206,214,147,24,99,150,39,243,163,136],[0,215,234,158,94,184,97,118,170,79,187,152,148,252,179,5,98,96,153],null,[0,17,60,79,50,61,163,26,187,202,180,221,225,83,239,156,164,212,212,188,190],null,[0,210,171,247,242,93,230,14,109,221,53,200,74,8,172,98,80,219,134,160,105,165,231],null,[0,229,121,135,48,211,117,251,126,159,180,169,152,192,226,228,218,111,0,117,232,87,96,227,21],null,[0,173,125,158,2,103,182,118,17,145,201,111,28,165,53,161,21,245,142,13,102,48,227,153,145,218,70],null,[0,168,223,200,104,224,234,108,180,110,190,195,147,205,27,232,201,21,43,245,87,42,195,212,119,242,37,9,123],null,[0,41,173,145,152,216,31,179,182,50,48,110,86,239,96,222,125,42,173,226,193,224,130,156,37,251,216,238,40,192,180],null,[0,10,6,106,190,249,167,4,67,209,138,138,32,242,123,89,27,120,185,80,156,38,69,171,60,28,222,80,52,254,185,220,241],null,[0,111,77,146,94,26,21,108,19,105,94,113,193,86,140,163,125,58,158,229,239,218,103,56,70,114,61,183,129,167,13,98,62,129,51],null,[0,200,183,98,16,172,31,246,234,60,152,115,0,167,152,113,248,238,107,18,63,218,37,87,210,105,177,120,74,121,196,117,251,113,233,30,120],null,null,null,[0,59,116,79,161,252,98,128,205,128,161,247,57,163,56,235,106,53,26,187,174,226,104,170,7,175,35,181,114,88,41,47,163,125,134,72,20,232,53,35,15],null,[0,250,103,221,230,25,18,137,231,0,3,58,242,221,191,110,84,230,8,188,106,96,147,15,131,139,34,101,223,39,101,213,199,237,254,201,123,171,162,194,117,50,96],null,[0,190,7,61,121,71,246,69,55,168,188,89,243,191,25,72,123,9,145,14,247,1,238,44,78,143,62,224,126,118,114,68,163,52,194,217,147,204,169,37,130,113,102,73,181],null,[0,112,94,88,112,253,224,202,115,187,99,89,5,54,113,129,44,58,16,135,216,169,211,36,1,4,96,60,241,73,104,234,8,249,245,119,174,52,25,157,224,43,202,223,19,82,15],null,[0,228,25,196,130,211,146,60,24,251,90,39,102,240,61,178,63,46,123,115,18,221,111,135,160,182,205,107,206,95,150,120,184,91,21,247,156,140,238,191,11,94,227,84,50,163,39,34,108],null,[0,232,125,157,161,164,9,118,46,209,99,203,193,35,3,209,111,195,242,203,225,46,13,32,160,126,209,130,160,242,215,242,75,77,42,189,32,113,65,124,69,228,114,235,175,124,170,215,232,133,205],null,[0,116,50,86,186,50,220,251,89,192,46,86,127,124,19,184,233,151,215,22,14,59,145,37,242,203,134,254,89,190,94,59,65,124,113,100,233,235,121,22,76,86,97,39,242,200,220,101,33,239,254,116,51],null,[0,183,26,201,87,210,221,113,21,46,65,45,50,238,184,249,225,102,58,209,218,109,165,26,95,184,192,52,245,35,254,238,175,172,79,123,25,122,43,120,108,215,80,128,201,235,8,153,59,101,31,198,76,31,156],null,[0,106,120,107,157,164,216,112,116,2,91,248,163,36,201,202,229,6,144,254,155,135,208,170,209,12,139,127,142,182,249,177,174,190,28,10,85,239,184,101,124,152,206,96,23,163,61,27,196,247,151,154,202,207,20,61,10],null,[0,82,116,26,247,66,27,62,107,252,182,200,185,235,55,251,242,210,144,154,237,176,141,192,248,152,249,206,85,253,142,65,165,125,23,24,30,122,240,214,6,129,218,29,145,127,134,206,245,117,29,41,63,159,142,233,125,148,123],null,[0,107,140,26,12,9,141,243,197,226,197,219,45,211,101,219,120,28,181,127,6,100,247,2,205,198,57,115,219,101,109,160,82,37,38,238,49,160,209,121,86,11,124,30,181,84,25,194,87,65,102,190,220,70,27,209,16,89,7,33,240],null,[0,65,202,113,98,71,223,248,118,214,94,1,122,37,23,2,228,58,121,7,105,135,78,243,118,70,76,223,89,72,50,70,111,194,17,212,126,181,35,221,117,235,11,229,149,147,123,213,40,115,6,200,100,26,246,182,218,127,215,36,186,110,106],null,[0,45,51,175,9,7,158,159,49,68,119,92,123,177,204,187,254,200,78,141,149,119,26,127,53,160,93,199,212,29,24,145,156,208,150,218,209,4,216,91,47,184,146,47,140,195,195,125,242,238,63,99,108,140,230,242,31,204,11,178,243,217,156,213,231],null,[0,5,118,222,180,136,136,162,51,46,117,13,215,81,17,139,247,197,171,95,173,65,137,178,68,111,95,101,41,72,214,169,197,95,7,44,154,77,111,236,40,121,143,63,87,80,253,240,126,217,77,34,232,106,50,168,82,76,146,67,106,171,25,132,93,45,105],null,[0,247,159,223,33,224,93,77,70,90,160,32,254,43,150,84,101,190,205,133,52,60,202,165,220,203,151,93,84,15,84,253,173,160,89,227,52,199,97,95,231,52,177,41,125,137,241,166,225,118,2,54,32,82,215,175,198,43,238,235,27,101,184,127,3,5,8,163,238],null];export function generateErrorCorrectionCode(e,t,o){let r=[];const n=RS_COEFFICIENTS[t];let i=e.slice(0);for(let e=0;e<o;e++){if(0!=i[0]){let e=LOG_TABLE[i[0]];for(let t=0;t<=n.length-1;t++){let o=n[t]+e;for(;o>=255;)o-=255;r[t]=EXP_TABLE[o]}for(let e=0;e<=n.length-1;e++)i[e]=i[e]^r[e]}for(let e=1;e<i.length;e++)i[e-1]=i[e];i[i.length-1]=0}return i.slice(0,t)}const G15=1335,G18=7973,MODEL2_G15_MASK=21522,MODEL1_G15_MASK=10277;function getBCHDigit(e){let t=0;for(;0!=e;){t+=1;e>>>=1}return t}export function getBCH15(e,t){let o=2===t?MODEL2_G15_MASK:MODEL1_G15_MASK,r=e<<10;for(;getBCHDigit(r)-getBCHDigit(G15)>=0;)r^=G15<<getBCHDigit(r)-getBCHDigit(G15);return(e<<10|r)^o}export function getBCH18(e){let t=e<<12;for(;getBCHDigit(t)-getBCHDigit(G18)>=0;)t^=G18<<getBCHDigit(t)-getBCHDigit(G18);return e<<12|t}export const MODE_INDICATOR={ECI:7,Numeric:1,Alphanumeric:2,"8BitByte":4,Kanji:8,StructuredAppend:3,FNC1First:5,FNC2Second:9,Terminator:0};export const EC_INDICATOR={L:1,M:0,Q:3,H:2};function isNumericMode(e){return e>=48&&e<=57}function isAlphanumericMode(e){return-1!=" $%*+-./:".indexOf(String.fromCharCode(e))||(e>=48&&e<=57||e>=65&&e<=90)}function is8BitByteMode(e){return e>=0&&e<=255}function isKanjiMode(e){return e>=33087&&e<=64587}const checkFns={Numeric:isNumericMode,Alphanumeric:isAlphanumericMode,"8BitByte":is8BitByteMode,Kanji:isKanjiMode};export function isMode(e,t){let o=checkFns[e];return 1===t.length?o(t):t.every(e=>o(e))}export function getCharMode(e,t="UTF-8"){return isNumericMode(e)?"Numeric":isAlphanumericMode(e)?"Alphanumeric":"Shift_JIS"===t&&isKanjiMode(e)?"Kanji":"8BitByte"}export const getSizeByVersion=e=>4*e+17;export function getCharacterCountIndicatorbitsNumber(e){return e>=1&&e<=9?{Numeric:10,Alphanumeric:9,"8BitByte":8,Kanji:8}:e>=10&&e<=26?{Numeric:12,Alphanumeric:11,"8BitByte":16,Kanji:10}:{Numeric:14,Alphanumeric:13,"8BitByte":16,Kanji:12}}const SYMBOL_MAP={" ":36,$:37,"%":38,"*":39,"+":40,"-":41,".":42,"/":43,":":44};export function getAlphanumericCharValue(e){if(e>=48&&e<=57)return+String.fromCharCode(e);if(e>=65&&e<=90)return e-65+10;const t=SYMBOL_MAP[String.fromCharCode(e)];if(t)return t;throw new InvalidTextException(String.fromCharCode(e))}export function createModules(e){let t=[];for(let o=0;o<e;o++)t.push(Utils.fillArray(new Array(e),null));return t}const alignmentPatterns=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]];export function getAlignmentPattersPos(e){return alignmentPatterns[e-1]}export const padCodewords0=236;export const padCodewords1=17;export const maskFuncs=[(e,t)=>(e+t)%2==0,e=>e%2==0,(e,t)=>t%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(e/2)+Math.floor(t/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>(e*t%3+(e+t)%2)%2==0];const MODEL2_1ERROR_CORRECTION_CHARACTERISTICS=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],MODEL1_ERROR_CORRECTION_CHARACTERISTICS=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,46,36],[1,46,30],[1,46,24],[1,46,16],[1,72,57],[1,72,44],[1,72,36],[1,72,24],[1,100,80],[1,100,60],[1,100,50],[1,100,34],[1,134,108],[1,134,82],[1,134,68],[2,67,23],[1,170,136],[2,85,53],[2,85,43],[2,85,29],[1,212,170],[2,106,66],[2,106,54],[3,70,24],[2,128,104],[2,128,80],[2,128,64],[3,85,29],[2,153,123],[2,153,93],[3,102,52],[3,102,34],[2,179,145],[2,179,111],[3,119,61],[4,89,31],[2,208,168],[4,104,64],[4,104,52],[5,83,29],[2,238,192],[4,119,73],[4,119,61],[5,95,33],[3,180,144],[4,135,83],[4,135,69],[6,90,32],[3,203,163],[4,152,92],[5,122,62],[6,101,35]];export function getErrorCorrectionCharacteristics(e,t,o=2){let r;switch(t){case 1:r=0;break;case 0:r=1;break;case 3:r=2;break;case 2:r=3}const n=(2===o?MODEL2_1ERROR_CORRECTION_CHARACTERISTICS:MODEL1_ERROR_CORRECTION_CHARACTERISTICS)[4*(e-1)+r],i=[],s=n.length/3;for(let e=0;e<s;e++){let t=n[3*e];for(let o=0;o<t;o++)i.push({total:n[3*e+1],data:n[3*e+2],ec:n[3*e+1]-n[3*e+2]})}return i}export function getMaskFunc(e){return maskFuncs[e]}function cloneModules(e){return e.reduce((e,t)=>{e.push(t.slice(0));return e},[])}export function getMaskScore(e){const t=e.length;let o=0;for(let r=0;r<t;r++)for(let n=0;n<t;n++){let i=0,s=e[r][n];for(let o=-1;o<=1;o++)if(!(r+o<0||t<=r+o))for(let a=-1;a<=1;a++)n+a<0||t<=n+a||0==o&&0==a||s==e[r+o][n+a]&&(i+=1);i>5&&(o+=3+i-5)}for(let r=0;r<t-1;r++)for(let n=0;n<t-1;n++){let t=0;e[r][n]&&(t+=1);e[r+1][n]&&(t+=1);e[r][n+1]&&(t+=1);e[r+1][n+1]&&(t+=1);0!=t&&4!=t||(o+=3)}for(let r=0;r<t;r++)for(let n=0;n<t-6;n++)e[r][n]&&!e[r][n+1]&&e[r][n+2]&&e[r][n+3]&&e[r][n+4]&&!e[r][n+5]&&e[r][n+6]&&(o+=40);for(let r=0;r<t;r++)for(let n=0;n<t-6;n++)e[n][r]&&!e[n+1][r]&&e[n+2][r]&&e[n+3][r]&&e[n+4][r]&&!e[n+5][r]&&e[n+6][r]&&(o+=40);let r=0;for(let o=0;o<t;o++)for(let n=0;n<t;n++)e[n][o]&&(r+=1);return o+=10*(Math.abs(100*r/t/t-50)/5)}export function addFormatInformation(e,t,o,r){const n=e.length,i=cloneModules(e),s=Utils.strPadStart(Utils.convertRadix(o,2),2,0),a=Utils.strPadStart(Utils.convertRadix(t,2),3,0),l=getBCH15(parseInt(s+a,2),r);i[n-8][8]=1;for(let e=15;e>0;e--){let t=l>>e-1&1;if(e>9){i[8][15-e]=t;i[n-1-15+e][8]=t}else if(e>8){i[8][15-e+1]=t;i[n-1-15+e][8]=t}else if(e>6){i[e][8]=t;i[8][n-e]=t}else{i[e-1][8]=t;i[8][n-e]=t}}return i}export function getEstimatedVersion(e,t,o){let r=0,n=0,i=0,s=0;t.forEach(e=>{isNumericMode(e)?r++:isAlphanumericMode(e)?n++:isKanjiMode(e)?s++:is8BitByteMode(e)&&i++});let a=Math.ceil((5*n+3*r+13*s+8*i)/8);for(let t=1;t<=40;t++){if(a<=getErrorCorrectionCharacteristics(t,e,o).reduce((e,t)=>e+=t.data,0))return t}throw new TextTooLongException}const MODE_CHECK_INFO={Alphanumeric:[[6,11],[7,15],[8,16]],Numeric:[[4,6,6,13],[4,7,8,15],[5,8,9,17]]};export function getModeCheckInfo(e,t){let o=MODE_CHECK_INFO[e];return t<=9?o[0]:t<=26?o[1]:o[2]}export function utf8Encode(e){const t=[];for(let o=0,r=e.length;o<r;o++){let r=e[o];if(r<128)t.push(r);else if(r<2048)t.push(192|r>>6,128|63&r);else if(r<55296||r>=57344)t.push(224|r>>12,128|r>>6&63,128|63&r);else{r=65536+((1023&r)<<10|1023&e[++o]);t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)}}return t}export function getParityData(e){let t=utf8Encode(e),o=t[0];for(let e=1,r=t.length;e<r;e++)o^=t[e];return o}export function getCharCode(e){let t=[];Utils.sliceString(e,1,e=>{t.push(e.charCodeAt(0))});return t}export class ModeKanji{constructor(e){this.mode="Kanji";this.data=e}getMode(){return MODE_INDICATOR.Kanji}getLength(){return this.data.length}write(e){this.data.forEach(t=>{let o;if(t>33088&&t<40956){o=192*((t-=33088)>>>8)+(255&t)}else if(t>57408&&t<60351){o=192*((t-=49472)>>>8)+(255&t)}e.put(o,13)})}}export class ModeAlphanumeric{constructor(e){this.mode="Alphanumeric";this.data=e}getMode(){return MODE_INDICATOR.Alphanumeric}getLength(){return this.data.length}write(e){Utils.sliceArray(this.data,2,t=>{let o=getAlphanumericCharValue(t[0]);if(2===t.length){let r=45*o+getAlphanumericCharValue(t[1]);e.put(r,11)}else e.put(o,6)})}}export class ModeNumeric{constructor(e){this.mode="Numeric";this.data=e}getMode(){return MODE_INDICATOR.Numeric}getLength(){return this.data.length}write(e){Utils.sliceArray(this.data,3,t=>{const o=parseInt(t.reduce((e,t)=>e+=String.fromCharCode(t),""));switch(t.length){case 1:e.put(o,4);return;case 2:e.put(o,7);return;default:e.put(o,10);return}})}}export class Mode8BitByte{constructor(e){this.mode="8BitByte";this.data=e;this.bytes=utf8Encode(e)}getMode(){return MODE_INDICATOR["8BitByte"]}getLength(){return this.bytes.length}write(e){this.bytes.forEach(t=>{e.put(t,8)})}}export class QRCodeBase{constructor(e,t){let{version:o,model:r,charCode:n}=t;this.charCode=n||getCharCode(e);const i=EC_INDICATOR[t.errorCorrectionLevel];this.config=t;this.errorCorrectionLevel=i;this.model=+r;o="auto"===o?this.getAutoVersion():+o;this.version=o;this.modulesCount=getSizeByVersion(o);this.charCountIndicatorBitsNumber=getCharacterCountIndicatorbitsNumber(o);this.errorCorrectionCharacteristics=getErrorCorrectionCharacteristics(o,i,this.model);this.totalDataCount=this.errorCorrectionCharacteristics.reduce((e,t)=>e+=t.data,0);this.totalDataBits=8*this.totalDataCount}getConnections(){const{totalDataBits:e,charCode:t}=this;let o=e-20,r=t.length,n=0,i=1,s=[],a=t[0];for(;i<=r;){let e=t.slice(n,i),l=this.analysisData(e);if(this.encodeData(l).length>o){s.push(a);n=i-1}else i===r&&s.push(e);a=e;i++}return s}processConnection(e){let{totalDataBits:t,config:{connection:o,connectionNo:r}}=this;r=+r;if(o){let o=Math.ceil(e.length/(t-20));if(r>o-1)throw new InvalidOptionsException({connectionNo:r},`Max connection number is ${o-1}`);let n=this.getConnections()[r],i=this.analysisData(n);return this.encodeData(i,{connectionNo:r,connectionCnt:o})}if(e.length>t)throw new TextTooLongException;return e}padBuffer(e){const{totalDataBits:t}=this;e.length+4<=t&&e.put(MODE_INDICATOR.Terminator,4);for(;e.length%8!=0;)e.putBit(!1);for(;!(e.length>=t);){e.put(padCodewords0,8);if(e.length>=t)break;e.put(padCodewords1,8)}}getAutoVersion(){let{errorCorrectionLevel:e,charCode:t,model:o}=this;for(let r=getEstimatedVersion(e,t,o);r<40;r++){this.version=r;this.modulesCount=getSizeByVersion(this.version);this.charCountIndicatorBitsNumber=getCharacterCountIndicatorbitsNumber(this.version);this.errorCorrectionCharacteristics=getErrorCorrectionCharacteristics(this.version,e);this.totalDataCount=this.errorCorrectionCharacteristics.reduce((e,t)=>e+=t.data,0);this.totalDataBits=8*this.totalDataCount;let o=this.analysisData(t);if(!(this.encodeData(o).length>this.totalDataBits))return r}throw new TextTooLongException}analysisData(e){const{version:t,config:{charset:o}}=this;let r=getCharMode(e[0],o);switch(r){case"Alphanumeric":let o=getModeCheckInfo(r,t);isMode("8BitByte",e.slice(1,1+o[0]))&&(r="8BitByte");break;case"Numeric":let n=getModeCheckInfo(r,t),i=e.slice(1,1+n[0]),s=e.slice(1,1+n[1]);isMode("8BitByte",i)?r="8BitByte":isMode("Alphanumeric",s)&&(r="Alphanumeric")}let n={mode:r,code:[]};const i=[n];e.forEach((r,s)=>{let a=getCharMode(r,o);if(n.mode===a)n.code.push(r);else if("8BitByte"===n.mode)if("Kanji"===a){n={mode:a,code:[r]};i.push(n)}else if("Numeric"===a){let o=getModeCheckInfo(a,t);if(isMode(a,e.slice(s,s+o[2]))){n={mode:a,code:[r]};i.push(n)}else n.code.push(r)}else if("Alphanumeric"===a){let o=getModeCheckInfo(a,t);if(isMode(a,e.slice(s,s+o[1]))){n={mode:a,code:[r]};i.push(n)}else n.code.push(r)}else n.code.push(r);else if("Alphanumeric"===n.mode)if("Kanji"===a||"8BitByte"===a){n={mode:a,code:[r]};i.push(n)}else if("Numeric"===a){let o=getModeCheckInfo(a,t);if(isMode(a,e.slice(s,s+o[2]))){n={mode:a,code:[r]};i.push(n)}else n.code.push(r)}else n.code.push(r);else{n={mode:a,code:[r]};i.push(n)}});return i}generateErrorCorrectionCode(e){const{errorCorrectionCharacteristics:t}=this,o=[];let r=0;t.forEach(t=>{let n=e.getBuffer().slice(r,r+t.data);o.push({data:n,ec:generateErrorCorrectionCode(n,t.ec,t.data)});r+=t.data});return o}addRectModule(e,t,o,r,n=!1){const{modules:i}=this,s=r+t,a=o+e;for(;t<s;t++){let o=e;for(;o<a;o++)i[t][o]=+n}}addPositionDetectionPattern(){const{modules:e}=this,t=e.length;this.addPattern(0,0,7);this.addRectModule(7,0,1,8,!1);this.addRectModule(0,7,8,1,!1);let o=t-7;this.addPattern(o,0,7);this.addRectModule(o-1,0,1,8,!1);this.addRectModule(o-1,7,8,1,!1);let r=t-7;this.addPattern(0,r,7);this.addRectModule(7,r-1,1,8,!1);this.addRectModule(0,r-1,8,1,!1)}addTimingPattern(){const{modules:e}=this,t=e.length;let o=!0;for(let r=8;r<t-7;r++){e[6][r]=+o;e[r][6]=+o;o=!o}}addPattern(e,t,o){this.addRectModule(e,t,o,o,!0);this.addRectModule(e+1,t+1,o-2,o-2,!1);this.addRectModule(e+2,t+2,o-4,o-4,!0)}}export class QRCodeModel2 extends QRCodeBase{encodeData(e,t){const{charCountIndicatorBitsNumber:o,charCode:r}=this;let n=new BitBuffer;if(t){n.put(MODE_INDICATOR.StructuredAppend,4);n.put(t.connectionNo,4);n.put(t.connectionCnt-1,4);n.put(getParityData(r),8)}e.forEach(e=>{if(!e.code)return;let t;switch(e.mode){case"Numeric":t=new ModeNumeric(e.code);break;case"Alphanumeric":t=new ModeAlphanumeric(e.code);break;case"8BitByte":t=new Mode8BitByte(e.code);break;case"Kanji":t=new ModeKanji(e.code)}n.put(t.getMode(),4);n.put(t.getLength(),o[t.mode]);t.write(n)});return n}getFinalMessage(e){const t=[],o=e.map(e=>e.data),r=e.map(e=>e.ec),n=Utils.getMaxValue(o),i=Utils.getMaxValue(r);for(let e=0;e<n;e++)o.forEach(o=>{Utils.isDefined(o[e])&&t.push(o[e])});for(let e=0;e<i;e++)r.forEach(o=>{Utils.isDefined(o[e])&&t.push(o[e])});return t}setModules(e){let{modulesCount:t,version:o}=this;this.modules=createModules(t);this.addPositionDetectionPattern();this.addAlignmentPattern();this.addTimingPattern();o>6&&this.addVersionInformation();this.maskModules(e)}maskModules(e){const{modules:t,errorCorrectionLevel:o,model:r,config:{mask:n}}=this;if("auto"===n)this.autoMask(e);else{let i=getMaskFunc(n);this.maskPattern=n;let s=addFormatInformation(t,n,o,r);this.modules=this.fillDataModules(s,e,i)}}autoMask(e){const{modules:t,errorCorrectionLevel:o,model:r}=this;let n,i,s;maskFuncs.forEach((a,l)=>{let d=addFormatInformation(t,l,o,r),c=this.fillDataModules(d,e,a),h=getMaskScore(c);if(!i||h<i){n=c;i=h;s=l}});this.modules=n;this.maskPattern=s}addAlignmentPattern(){const{modules:e,version:t}=this,o=getAlignmentPattersPos(t);o.forEach(t=>{o.forEach(o=>{null===e[t][o]&&this.addPattern(o-2,t-2,5)})})}addVersionInformation(){const{modulesCount:e,modules:t,version:o}=this,r=getBCH18(o);for(let o=0;o<18;o++){let n=r>>o&1;t[Math.floor(o/3)][o%3+e-8-3]=n;t[o%3+e-8-3][Math.floor(o/3)]=n}}fillDataModules(e,t,o){const r=e.length;let n=-1,i=r-1,s=7,a=0;for(let l=r-1;l>0;l-=2){6==l&&(l-=1);for(;;){for(let r=0;r<2;r+=1)if(null==e[i][l-r]){let n=!1;a<t.length&&(n=1==(t[a]>>>s&1));o(i,l-r)&&(n=!n);e[i][l-r]=+n;if(-1==(s-=1)){a+=1;s=7}}if((i+=n)<0||r<=i){i-=n;n=-n;break}}}return e}getMatrix(){let{charCode:e}=this,t=this.analysisData(e),o=this.encodeData(t),r=this.processConnection(o);this.padBuffer(r);let n=this.generateErrorCorrectionCode(r),i=this.getFinalMessage(n);this.setModules(i);return this.modules}}export class QRCodeModel1 extends QRCodeBase{encodeData(e,t){const{charCountIndicatorBitsNumber:o,charCode:r}=this;let n=new BitBuffer;n.put(0,4);if(t){n.put(MODE_INDICATOR.StructuredAppend,4);n.put(t.connectionNo,4);n.put(t.connectionCnt-1,4);n.put(getParityData(r),8)}e.forEach(e=>{if(!e.code)return;let t;switch(e.mode){case"Numeric":t=new ModeNumeric(e.code);break;case"Alphanumeric":t=new ModeAlphanumeric(e.code);break;case"8BitByte":t=new Mode8BitByte(e.code);break;case"Kanji":t=new ModeKanji(e.code)}n.put(t.getMode(),4);n.put(t.getLength(),o[t.mode]);t.write(n)});return n}getFinalMessage(e){let t=[];const o=e.map(e=>e.data),r=e.map(e=>e.ec);o.forEach(e=>t=t.concat(e));r.forEach(e=>t=t.concat(e));return t}setModules(e){let{modulesCount:t}=this;this.modules=createModules(t);this.addPositionDetectionPattern();this.addExtensionPattern();this.addTimingPattern();this.maskModules(e)}maskModules(e){const{modules:t,errorCorrectionLevel:o,model:r,config:{mask:n}}=this;if("auto"===n)this.autoMask(e);else{let i=getMaskFunc(n);this.maskPattern=n;let s=addFormatInformation(t,n,o,r);this.modules=this.fillDataModules(s,e,i)}}autoMask(e){const{modules:t,errorCorrectionLevel:o,model:r}=this;let n,i,s;maskFuncs.forEach((a,l)=>{let d=addFormatInformation(t,l,o,r),c=this.fillDataModules(d,e,a),h=getMaskScore(c);if(!i||h<i){n=c;i=h;s=l}});this.modules=n;this.maskPattern=s}addExtensionPattern(){const{modules:e,version:t}=this,o=e.length;e[o-1][o-1]=1;e[o-2][o-1]=0;e[o-1][o-2]=0;e[o-2][o-2]=0;let r=Math.floor(t/2);if(Utils.isEven(t))for(let e=0;e<r;e++){this.addBaseExtension(13+8*e);this.addRightExtension(13+8*e)}else for(let e=0;e<r;e++){this.addBaseExtension(17+8*e);this.addRightExtension(17+8*e)}}addBaseExtension(e){const{modules:t}=this,o=t.length;let r=o-2,n=o-1;t[r][e]=0;t[r][e+1]=0;t[r][e+2]=0;t[r][e+3]=0;t[n][e]=1;t[n][e+1]=1;t[n][e+2]=1;t[n][e+3]=1}addRightExtension(e){const{modules:t}=this,o=t.length;let r=o-2,n=o-1;t[e][r]=0;t[e+1][r]=0;t[e+2][r]=0;t[e+3][r]=0;t[e][n]=1;t[e+1][n]=1;t[e+2][n]=1;t[e+3][n]=1}fillDataModules(e,t,o){const r=e.length;let n,i;n=i=r-1;let s=2,a=new BitBuffer(t);a.next();a.next();a.next();a.next();for(;n>=0;){if(n==r-5)s=4;else if(8==n)s=2;else if(6==n){n--;continue}for(;i>=0;)if(null===e[i][n]){for(let t=0;t<s;t++){let r=a.next();o(i,n-t)&&(r=!r);e[i][n-t]=+r}i--}else i--;n-=s;i=r-1}return e}getMatrix(){let{charCode:e}=this,t=this.analysisData(e),o=this.encodeData(t),r=this.processConnection(o);this.padBuffer(r);let n=this.generateErrorCorrectionCode(r),i=this.getFinalMessage(n);this.setModules(i);return this.modules}}export class QRCodeEncoder extends TwoDimensionalBarcode{constructor(e){e.merge(QRCodeEncoder.DefaultConfig);super(e);const{encodeConfig:{text:t},config:o}=this;let r;r="2"==o.model?new QRCodeModel2(t,o):new QRCodeModel1(t,o);this.innerQRCode=r}calculateData(){return this.innerQRCode.getMatrix()}validate(){const{version:e,model:t,charset:o,charCode:r,connectionNo:n}=this.config,{text:i}=this.encodeConfig;if(!(i||r&&0!==r.length))throw new InvalidTextException(i);if("1"!=t&&"2"!=t)throw new InvalidOptionsException({model:t});if("UTF-8"!=o&&"Shift_JIS"!=o)throw new InvalidOptionsException({charset:o});if("1"==t&&Utils.isNumberLike(e)&&(e<1||e>14))throw new InvalidOptionsException({version:e},"Model 1 only support version 1 - 14.");if("2"==t&&Utils.isNumberLike(e)&&(e<1||e>40))throw new InvalidOptionsException({version:e},"Model 2 only support version 1 - 40.");if(n>15||n<0)throw new InvalidOptionsException({connectionNo:n},"ConnectionNo is in range 0 - 15.")}}QRCodeEncoder.DefaultConfig={version:"auto",errorCorrectionLevel:"L",model:2,mask:"auto",connection:!1,connectionNo:0,charCode:void 0,charset:"UTF-8",quietZone:{top:4,left:4,right:4,bottom:4}};Barcode.registerEncoder("QRCode",QRCodeEncoder);const TableCode128A=[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","\0","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","","","","","","","","","","","","",""," "," "," "," "," "," "," "," "," "," "],TableCode128B=[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~",""," "," "," "," "," "," "," "," "," "," "],TableCode128Data=["212222","222122","222221","121223","121322","131222","122213","122312","132212","221213","221312","231212","112232","122132","122231","113222","123122","123221","223211","221132","221231","213212","223112","312131","311222","321122","321221","312212","322112","322211","212123","212321","232121","111323","131123","131321","112313","132113","132311","211313","231113","231311","112133","112331","132131","113123","113321","133121","313121","211331","231131","213113","213311","213131","311123","311321","331121","312113","312311","332111","314111","221411","431111","111224","111422","121124","121421","141122","141221","112214","112412","122114","122411","142112","142211","241211","221114","413111","241112","134111","111242","121142","121241","114212","124112","124211","411212","421112","421211","212141","214121","412121","111143","111341","131141","114113","114311","411113","411311","113141","114131","311141","411131","211412","211214","211232"];export const stopPattern="2331112";export const Code128Sym={CodeC:99,CodeB:100,CodeA:101,FNC1:102,FNC2:97,FNC3:96,StartA:103,StartB:104,StartC:105};export const Code128Char={CodeC:String.fromCharCode(204),CodeB:String.fromCharCode(205),CodeA:String.fromCharCode(206),FNC1:Constants.FNC1,FNC2:Constants.FNC2,FNC3:Constants.FNC3,StartA:String.fromCharCode(208),StartB:String.fromCharCode(209),StartC:String.fromCharCode(210)};export function getCharValue(e,t){if(e===Code128Char.FNC1)return Code128Sym.FNC1;if(e===Code128Char.FNC2)return Code128Sym.FNC2;if(e===Code128Char.FNC3)return Code128Sym.FNC3;let o;switch(t){case"A":return o=TableCode128A.indexOf(e);case"B":return o=TableCode128B.indexOf(e);case"C":return+e}}export function getCharPattern(e,t){const o=TableCode128Data[getCharValue(e,t)];if(!o)throw new InvalidCharacterException(e);return o}export function getPatternByIndex(e){return TableCode128Data[e]}export function encode(e){let t="";Utils.str2Array(e).forEach((e,o)=>{Utils.isEven(o)?t+=Utils.strRepeat("1",+e):t+=Utils.strRepeat("0",+e)});return t}const CODE_SET_A="A",CODE_SET_B="B",CODE_SET_C="C";export class Code128Auto{constructor(e,t=!1){this.text=e;this.isUccEan128=t;this.validate()}validate(){let{text:e}=this;if(!/^[\x00-\x7F\xC8-\xD3]+$/.test(e))throw new InvalidTextException(e)}calculateGroup(){let{text:e,isUccEan128:t}=this,o={code:t?CODE_SET_C:CODE_SET_B,text:""},r=[];r.push(o);for(let t=0,n=e.length;t<n;t++){let i=o.code,s=e[t];if(o.code!==CODE_SET_C&&t+3<n&&Utils.isNumberLike(e.substr(t,4))||o.code===CODE_SET_C&&t+1<n&&Utils.isNumberLike(e.substr(t,2))){i=CODE_SET_C;s+=e[++t]}else if(getCharValue(s,i=o.code===CODE_SET_C?CODE_SET_B:o.code)<0&&getCharValue(s,i=o.code===CODE_SET_A?CODE_SET_B:CODE_SET_A)<0)continue;if(o.code!==i){o={code:i,text:s};r.push(o)}else o.text+=s}return r.filter(e=>e.text)}getData(){const e=this.calculateGroup(),t=this.checksum(e);let o="";e.forEach((e,t)=>{if(0===t){let t=getPatternByIndex(Code128Sym["Start"+e.code]);o+=encode(t)}else{let t=getPatternByIndex(Code128Sym["Code"+e.code]);o+=encode(t)}e.code===CODE_SET_C?Utils.sliceString(e.text,2,t=>{o+=encode(getCharPattern(t,e.code))}):Utils.sliceString(e.text,1,t=>{o+=encode(getCharPattern(t,e.code))})});o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)}checksum(e){let t=0,o=0;e.forEach((e,r)=>{let{code:n,text:i}=e;if(0===r)o+=Code128Sym["Start"+n];else{let e=Code128Sym["Code"+n];o+=e*++t}n===CODE_SET_C?Utils.sliceString(i,2,e=>{o+=getCharValue(e,n)*++t}):Utils.sliceString(i,1,e=>{o+=getCharValue(e,n)*++t})});return o%103}}export class Code128C{constructor(e){this.text=e;this.validate()}validate(){let{text:e}=this;if(!/^(\xCF*[0-9]{2}\xCF*)+$/.test(e))throw new InvalidTextException(e)}getData(){let{text:e}=this;const t=this.checksum();let o="",r=getPatternByIndex(Code128Sym.StartC);o+=encode(r);Utils.sliceString(e,2,e=>{let t=getCharPattern(e,"C");o+=encode(t)});o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)}checksum(){let{text:e}=this,t=0,o=0;Utils.sliceString(e,2,e=>{o+=getCharValue(e,"C")*++t});return(o+=Code128Sym.StartC)%103}}export class Code128B{constructor(e){this.text=e;this.validate()}validate(){let{text:e}=this;if(!/^[\x20-\x7F\xC8-\xCF]+$/.test(e))throw new InvalidTextException(e)}getData(){let{text:e}=this;const t=this.checksum();let o="",r=getPatternByIndex(Code128Sym.StartB);o+=encode(r);Utils.sliceString(e,1,e=>{let t=getCharPattern(e,"B");o+=encode(t)});o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)}checksum(){let{text:e}=this,t=0,o=0;Utils.sliceString(e,1,e=>{o+=getCharValue(e,"B")*++t});return(o+=Code128Sym.StartB)%103}}export class Code128A{constructor(e){this.text=e;this.validate()}validate(){let{text:e}=this;if(!/^[\x00-\x5F\xC8-\xCF]+$/.test(e))throw new InvalidTextException(e)}getData(){let{text:e}=this;const t=this.checksum();let o="",r=getPatternByIndex(Code128Sym.StartA);o+=encode(r);Utils.sliceString(e,1,e=>{let t=getCharPattern(e,"A");o+=encode(t)});o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)}checksum(){let{text:e}=this,t=0,o=0;Utils.sliceString(e,1,e=>{o+=getCharValue(e,"A")*++t});return(o+=Code128Sym.StartA)%103}}export class Code128Encoder extends OneDimensionalBarcode{constructor(e,t=!1){e.merge(Code128Encoder.DefaultConfig);super(e);let{text:o}=this.encodeConfig;this.isUccEan128=t;t&&o[0]!==Code128Char.FNC1&&(o=Code128Char.FNC1+o);this.text=o;this.label=o.replace(/[^\x20-\x7E]/g,"")}validate(){}calculateData(){let e,{config:{codeSet:t},text:o,isUccEan128:r}=this;if(r)e=new Code128Auto(o);else switch(t){case"A":e=new Code128A(o);break;case"B":e=new Code128B(o);break;case"C":e=new Code128C(o);break;default:e=new Code128Auto(o)}return e.getData()}}Code128Encoder.DefaultConfig={codeSet:"auto",quietZone:{right:10,left:10}};export class GS1_128Encoder extends Code128Encoder{constructor(e){super(e,!0)}}Barcode.registerEncoder("GS1_128",GS1_128Encoder);Barcode.registerEncoder("Code128",Code128Encoder);export class EncodeTable_Code39{static getMod43Val(e){let t=0;Utils.sliceString(e,1,e=>{t+=EncodeTable_Code39.MODULO_43_CHECK_TABLE.indexOf(e)});return EncodeTable_Code39.MODULO_43_CHECK_TABLE[t%43]}static getFullASCIIChar(e){let t="";Utils.sliceString(e,1,o=>{let r=EncodeTable_Code39.FULL_ASCII_TABLE[o.charCodeAt(0)];if(!r)throw new InvalidTextException(e);t+=r});return t}}EncodeTable_Code39.TABLE={0:"000110100",1:"100100001",2:"001100001",3:"101100000",4:"000110001",5:"100110000",6:"001110000",7:"000100101",8:"100100100",9:"001100100",A:"100001001",B:"001001001",C:"101001000",D:"000011001",E:"100011000",F:"001011000",G:"000001101",H:"100001100",I:"001001100",J:"000011100",K:"100000011",L:"001000011",M:"101000010",N:"000010011",O:"100010010",P:"001010010",Q:"000000111",R:"100000110",S:"001000110",T:"000010110",U:"110000001",V:"011000001",W:"111000000",X:"010010001",Y:"110010000",Z:"011010000","-":"010000101",".":"110000100"," ":"011000100",$:"010101000","/":"010100010","+":"010001010","%":"000101010","*":"010010100"};EncodeTable_Code39.MODULO_43_CHECK_TABLE=Utils.str2Array("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%");EncodeTable_Code39.FULL_ASCII_TABLE=["%U","$A","$B","$C","$D","$E","$F","$G","$H","$I","$J","$K","$L","$M","$N","$O","$P","$Q","$R","$S","$T","$U","$V","$W","$X","$Y","$Z","%A","%B","%C","%D","%E"," ","/A","/B","/C","/D","/E","/F","/G","/H","/I","/J","/K","/L","-",".","/O","0","1","2","3","4","5","6","7","8","9","/Z","%F","%G","%H","%I","%J","%V","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","%K","%L","%M","%N","%O","%W","+A","+B","+C","+D","+E","+F","+G","+H","+I","+J","+K","+L","+M","+N","+O","+P","+Q","+R","+S","+T","+U","+V","+W","+X","+Y","+Z","%P","%Q","%R","%S","%T"];export class Code39Encoder extends OneDimensionalBarcode{constructor(e){e.merge(Code39Encoder.DefaultConfig);super(e);let{encodeConfig:{text:t,hideExtraChecksum:o},config:{checkDigit:r,fullASCII:n,nwRatio:i,labelWithStartAndStopCharacter:s}}=this,a=n?EncodeTable_Code39.getFullASCIIChar(t):t;if(r){const e=EncodeTable_Code39.getMod43Val(a);this.text=Code39Encoder.START_STOP_CHARACTERS+a+e+Code39Encoder.START_STOP_CHARACTERS;const r=o?t:t+e,n=Code39Encoder.START_STOP_CHARACTERS+r+Code39Encoder.START_STOP_CHARACTERS;this.label=s?n:r}else{this.text=Code39Encoder.START_STOP_CHARACTERS+a+Code39Encoder.START_STOP_CHARACTERS;const e=t,o=Code39Encoder.START_STOP_CHARACTERS+e+Code39Encoder.START_STOP_CHARACTERS;this.label=s?o:e}this.nwRatio=+i}validate(){let{encodeConfig:{text:e},config:{fullASCII:t,nwRatio:o}}=this;if(!t&&!/^[0-9A-Z\-\.\ \$\/\+\%]+$/.test(e))throw new InvalidTextException(e);if(2!=o&&3!=o)throw new InvalidOptionsException({nwRatio:o},"NwRatio is 2 or 3")}encode(e){let{nwRatio:t}=this,o="";const r=Utils.strRepeat("1",t),n=Utils.strRepeat("0",t);Utils.str2Array(e).forEach((e,t)=>{Utils.isEven(t)?o+="1"===e?r:"1":o+="1"===e?n:"0"});return o}calculateData(){let{text:e}=this,t="";Utils.sliceString(e,1,e=>{t=t+this.encode(EncodeTable_Code39.TABLE[e])+"0"});return t=t.substr(0,t.length-1)}}Code39Encoder.DefaultConfig={checkDigit:!1,fullASCII:!1,nwRatio:3,labelWithStartAndStopCharacter:!1,quietZone:{right:10,left:10}};Code39Encoder.START_STOP_CHARACTERS="*";Barcode.registerEncoder("Code39",Code39Encoder);export class EncodeTable{static encodeCharByTable(e,t){return EncodeTable.TABLE[t][e]}static encodeByStructure(e,t){return Utils.str2Array(e).reduce((e,o,r)=>e+=EncodeTable.encodeCharByTable(o,t[r]),"")}static encodeByTable(e,t){if(e.length>1){return Utils.str2Array(e).reduce((e,o)=>e+=EncodeTable.encodeCharByTable(o,t),"")}return EncodeTable.encodeCharByTable(e,t)}}EncodeTable.TABLE={A:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],B:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],C:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"]};export class AddOnSymbol{constructor(e,t,o,r){this.isTextGroup=o;this.addOn=""+e;if("auto"!==t)if(Utils.isNumberLike(t))t=+t;else{t=Utils.convertUnit(Utils.fixSize2PixelDefault(t));t/=r}this.addOnHeight=t;this.validate()}static get2DigitAddOnTable(e){switch((e=parseInt(e))%4){case 0:return{leftStructure:"A",rightStructure:"A"};case 1:return{leftStructure:"A",rightStructure:"B"};case 2:return{leftStructure:"B",rightStructure:"A"};case 3:return{leftStructure:"B",rightStructure:"B"}}}static get5DigitAddOnTable(e){const t=3*(+(e+="")[0]+ +e[2]+ +e[4])+9*(+e[1]+ +e[3]);return AddOnSymbol.fiveDigitAddOnStructure[t%10]}validate(){const{addOn:e}=this;if(2!==e.length&&5!==e.length)throw new InvalidOptionsException({addOn:e},"Add on length should be 2 or 5.")}_encode2DigitAddOn(){let{addOn:e,isTextGroup:t}=this;const o=[];let r,n,i;r=AddOnSymbol.get2DigitAddOnTable(e);n=EncodeTable.encodeByTable(e[0],r.leftStructure[0]);i=EncodeTable.encodeByTable(e[1],r.rightStructure[0]);if(t){o.push({binary:AddOnSymbol.ADD_ON_GUARD,role:"ADDON"});o.push({binary:n,text:e[0],role:"ADDON"});o.push({binary:AddOnSymbol.ADD_ON_DELINEATOR,role:"ADDON"});o.push({binary:i,text:e[1],role:"ADDON"})}else o.push({binary:AddOnSymbol.ADD_ON_GUARD+n+AddOnSymbol.ADD_ON_DELINEATOR+i,text:e,role:"ADDON"});return o}_encode5DigitAddOn(){let{addOn:e,isTextGroup:t}=this;const o=[];let r=AddOnSymbol.get5DigitAddOnTable(e);if(t){o.push({binary:AddOnSymbol.ADD_ON_GUARD,role:"ADDON"});Utils.str2Array(e).forEach((t,n)=>{o.push({binary:EncodeTable.encodeByTable(t,r[n]),text:t,role:"ADDON"});n<e.length-1&&o.push({binary:AddOnSymbol.ADD_ON_DELINEATOR,role:"ADDON"})})}else{let t=Utils.str2Array(e).reduce((t,o,n)=>{t+=EncodeTable.encodeByTable(o,r[n]);n<e.length-1&&(t+=AddOnSymbol.ADD_ON_DELINEATOR);return t},"");o.push({binary:AddOnSymbol.ADD_ON_GUARD+t,text:e,role:"ADDON"})}return o}calculateData(){let{addOn:e}=this,t=[];2===e.length?t=this._encode2DigitAddOn():5===e.length&&(t=this._encode5DigitAddOn());t.push({text:">",role:"ADDON_RIGHT_QUIET_ZONE"});return t}}AddOnSymbol.fiveDigitAddOnStructure=["BBAAA","BABAA","BAABA","BAAAB","ABBAA","AABBA","AAABB","ABABA","ABAAB","AABAB"];AddOnSymbol.ADD_ON_GUARD="1011";AddOnSymbol.ADD_ON_DELINEATOR="01";export class EANBase extends OneDimensionalBarcode{constructor(e){e.merge(EANBase.DefaultConfig);super(e);let{style:{textAlign:t,unitValue:o},config:{addOnLabelPosition:r,addOn:n,addOnHeight:i}}=this;this.isTextGroup="group"===t;this.isAddOnLabelBottom="top"!==r;this._setAddOn(n,i,o)}_setAddOn(e,t,o){if(Utils.isDefined(e)){this.addOn=new AddOnSymbol(e,t,this.isTextGroup,o);this.addOnHeight=this.addOn.addOnHeight}else this.addOnHeight=0}checksum(e,t=!1){let o=Utils.str2Array(e),r=t?Utils.isOdd:Utils.isEven,n=o.reduce((e,t,o)=>{t=+t;return e+=r(o)?t:3*t},0)%10;return 0===n?0:10-n}convertToShape(e){let{isTextGroup:t,addOnHeight:o,isAddOnLabelBottom:r,style:{textAlign:n},encodeConfig:{isLabelBottom:i,height:s,quietZone:a,showLabel:l,fontSizeInUnit:d}}=this;l||(d=0);o=o||0;const c=[];let h,u,C,g,A,E,p,f=a.left,_=a.top;if(i){h=s+5;u=_+s;C=l?s+d:h;if(r)A=(g=_)+(E="auto"===o?l?s:h:o);else{A=_;g=_+d;E="auto"===o?h-d:o}}else{h=s;s-=5;u=_;_+=d;C=l?h+d:h;if(r){g=a.top;A=g+(E="auto"===o?l?s:h:o)}else{A=a.top;g=a.top+d;E="auto"===o?h:o}}p=l?E+d:E;e.forEach(e=>{let o,r=_,i=s,d=u,C=t?"center":n,p=f;switch(e.role){case"GUARD":i=h;o=e.binary.length;break;case"ADDON":r=g;i=E;d=A;o=e.binary.length;break;case"LEFT_QUIET_ZONE":C="left";o=a.left;p=0;break;case"RIGHT_QUIET_ZONE":case"NO_ADDON_RIGHT_QUIET_ZONE":C="right";o=a.right;break;case"ADDON_QUIET_ZONE":o=a.addOn;break;case"ADDON_RIGHT_QUIET_ZONE":C="right";d=A;o=a.right;break;default:o=e.binary.length}if(l&&e.text){switch(C){case"center":p+=o/2;break;case"right":p+=o}const t={type:"text",x:p,y:d,text:e.text,textAlign:C,maxWidth:o};if("NO_ADDON_RIGHT_QUIET_ZONE"===e.role||"ADDON_RIGHT_QUIET_ZONE"===e.role){t.fontStyle="normal";t.fontWeight="normal";t.textDecoration="none"}c.push(t)}e.binary?Utils.combineTruthy(e.binary).forEach(e=>{if(0!==e){c.push({type:"rect",x:f,y:r,width:e,height:i});f+=e}else f++}):"ADDON_QUIET_ZONE"===e.role&&(f+=o)});this.size={width:f+a.right,height:Math.max(C,p)+a.top+a.bottom};this.shapes=c}afterApplyDesiredSize(){let{config:{addOn:e,addOnHeight:t},style:{unitValue:o}}=this;this._setAddOn(e,t,o);this.addOnHeight>this.encodeConfig.height&&(this.addOnHeight=this.encodeConfig.height)}}EANBase.NORMAL_GUARD="101";EANBase.CENTRE_GUARD="01010";EANBase.DefaultConfig={quietZone:{right:7,left:11}};export class UPC_E extends EANBase{constructor(e,t,o){e.merge(UPC_E.DefaultConfig);super(e);let{text:r,hideExtraChecksum:n}=this.encodeConfig;this.prefix=t;let i=r;if(r.length<7){r+=this.checksum(r);n||(i=r)}this.label=i;this.text=r;this.tableStructure=o}validate(){const{text:e}=this.encodeConfig;if(!/^(\d{6}|\d{7})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 6 or 7.");if(7===e.length){if(this.checksum(e.substr(0,6))!=e[6])throw new InvalidTextException(e,"Check digit is invalid.")}}checksum(e){let t;switch(e[5]){case"0":case"1":case"2":t=e.substr(0,2)+e[5]+"0000"+e.substr(2,3);break;case"3":t=e.substr(0,3)+"00000"+e.substr(3,2);break;case"4":t=e.substr(0,4)+"00000"+e[4];break;default:t=e.substr(0,5)+"0000"+e[5]}t=this.prefix+t;return super.checksum(t,!0)}calculateData(){let{text:e,addOn:t,isTextGroup:o,prefix:r,tableStructure:n,label:i}=this;const s=e[6],a=i[6];e=e.substr(0,6);const l=i.substr(0,6),d=n[s];let c=[];c.push({text:r,role:"LEFT_QUIET_ZONE"});c.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});o?Utils.str2Array(e).forEach((e,t)=>{c.push({binary:EncodeTable.encodeByTable(e,d[t]),text:l[t]})}):c.push({binary:EncodeTable.encodeByStructure(e,d),text:l});c.push({binary:UPC_E.SPECIAL_GUARD,role:"GUARD"});if(t){c.push({text:a,role:"ADDON_QUIET_ZONE"});c=c.concat(t.calculateData())}else c.push({text:a,role:"NO_ADDON_RIGHT_QUIET_ZONE"});return c}}UPC_E.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{left:9,addOn:5}};UPC_E.SPECIAL_GUARD="010101";export class UPC_E1_Encoder extends UPC_E{constructor(e){super(e,"1",UPC_E1_Encoder.structure)}}UPC_E1_Encoder.structure=["AAABBB","AABABB","AABBAB","AABBBA","ABAABB","ABBAAB","ABBBAA","ABABAB","ABABBA","ABBABA"];export class UPC_E0_Encoder extends UPC_E{constructor(e){super(e,"0",UPC_E0_Encoder.structure)}}UPC_E0_Encoder.structure=["BBBAAA","BBABAA","BBAABA","BBAAAB","BABBAA","BAABBA","BAAABB","BABABA","BABAAB","BAABAB"];export class UPC_A_Encoder extends EANBase{constructor(e){e.merge(UPC_A_Encoder.DefaultConfig);super(e);let{text:t,hideExtraChecksum:o}=this.encodeConfig,r=t;if(t.length<12){t+=this.checksum(t,!0);o||(r=t)}this.label=r;this.text=t}validate(){const{text:e}=this.encodeConfig;if(!/^(\d{11}|\d{12})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 11 or 12.");if(12===e.length){if(this.checksum(e.substr(0,11),!0)!=e[11])throw new InvalidTextException(e,"Check digit is invalid.")}}calculateData(){let{text:e,addOn:t,isTextGroup:o,label:r}=this;const n=e[0],i=e[11],s=r[11];let a=e.substr(1,5),l=e.substr(6,5),d=r.substr(1,5),c=r.substr(6,5),h=[];h.push({text:n,role:"LEFT_QUIET_ZONE"});h.push({binary:EANBase.NORMAL_GUARD+EncodeTable.encodeByTable(n,"A"),role:"GUARD"});o?Utils.str2Array(a).forEach((e,t)=>{h.push({binary:EncodeTable.encodeByTable(e,"A"),text:d[t]})}):h.push({binary:EncodeTable.encodeByTable(a,"A"),text:d});h.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(l).forEach((e,t)=>{h.push({binary:EncodeTable.encodeByTable(e,"C"),text:c[t]})}):h.push({binary:EncodeTable.encodeByTable(l,"C"),text:c});h.push({binary:EncodeTable.encodeByTable(i,"C")+EANBase.NORMAL_GUARD,role:"GUARD"});if(t){h.push({text:s,role:"ADDON_QUIET_ZONE"});h=h.concat(t.calculateData())}else h.push({text:s,role:"NO_ADDON_RIGHT_QUIET_ZONE"});return h}}UPC_A_Encoder.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{right:9,left:9,addOn:5}};Barcode.registerEncoder("UPC-A",UPC_A_Encoder);Barcode.registerEncoder("UPC-E0",UPC_E0_Encoder);Barcode.registerEncoder("UPC-E1",UPC_E1_Encoder);export class EAN13Encoder extends EANBase{constructor(e){e.merge(EAN13Encoder.DefaultConfig);super(e);let{text:t,hideExtraChecksum:o}=this.encodeConfig,r=t;if(t.length<13){t+=this.checksum(t);o||(r=t)}this.label=r;this.text=t}validate(){const{text:e}=this.encodeConfig;if(!/^[1-9](\d{11}|\d{12})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. And it should not start with 0. The length should be 12 or 13.");if(13===e.length){if(this.checksum(e.substr(0,12))!=e[12])throw new InvalidTextException(e,"Check digit is invalid.")}}calculateData(){let{text:e,addOn:t,isTextGroup:o,label:r}=this,n=e.substr(1,6),i=e.substr(7,6),s=r.substr(1,6),a=r.substr(7,6);const l=EAN13Encoder.leftStructure[e[0]];let d=[];d.push({text:e[0],role:"LEFT_QUIET_ZONE"});d.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});o?Utils.str2Array(n).forEach((e,t)=>{d.push({binary:EncodeTable.encodeByTable(e,l[t]),text:s[t]})}):d.push({binary:EncodeTable.encodeByStructure(n,l),text:s});d.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(i).forEach((e,t)=>{d.push({binary:EncodeTable.encodeByTable(e,"C"),text:a[t]})}):d.push({binary:EncodeTable.encodeByTable(i,"C"),text:a});d.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});if(t){d.push({role:"ADDON_QUIET_ZONE"});d=d.concat(t.calculateData())}else d.push({text:">",role:"NO_ADDON_RIGHT_QUIET_ZONE"});return d}}EAN13Encoder.leftStructure=["AAAAAA","AABABB","AABBAB","AABBBA","ABAABB","ABBAAB","ABBBAA","ABABAB","ABABBA","ABBABA"];EAN13Encoder.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{addOn:5}};export class EAN8Encoder extends EANBase{constructor(e){e.merge(EAN8Encoder.DefaultConfig);super(e);let{text:t,hideExtraChecksum:o}=this.encodeConfig,r=t;if(t.length<8){t+=this.checksum(t,!0);o||(r=t)}this.label=r;this.text=t}validate(){const{text:e}=this.encodeConfig;if(!/^[0-9](\d{6}|\d{7})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 7 or 8.");if(8===e.length){if(this.checksum(e.substr(0,7),!0)!=e[7])throw new InvalidTextException(e,"Check digit is invalid.")}}calculateData(){let{text:e,label:t,isTextGroup:o}=this,r=e.substr(0,4),n=e.substr(4,4),i=t.substr(0,4),s=t.substr(4,4);const a=[];a.push({text:"<",role:"LEFT_QUIET_ZONE"});a.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});o?Utils.str2Array(r).forEach((e,t)=>{a.push({binary:EncodeTable.encodeByTable(e,"A"),text:i[t]})}):a.push({binary:EncodeTable.encodeByTable(r,"A"),text:i});a.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(n).forEach((e,t)=>{a.push({binary:EncodeTable.encodeByTable(e,"C"),text:s[t]})}):a.push({binary:EncodeTable.encodeByTable(n,"C"),text:s});a.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});a.push({text:">",role:"RIGHT_QUIET_ZONE"});return a}}EAN8Encoder.DefaultConfig={quietZone:{left:7}};Barcode.registerEncoder("EAN8",EAN8Encoder);Barcode.registerEncoder("EAN13",EAN13Encoder);const REG=/^([A-D]?)([0-9\-\$\:\.\+\/]+)([A-D]?)$/;export class CodabarEncoder extends OneDimensionalBarcode{constructor(e){e.merge(CodabarEncoder.DefaultConfig);super(e);let{config:{checkDigit:t,nwRatio:o},encodeConfig:{text:r,hideExtraChecksum:n}}=this;const{originStartPattern:i,startPattern:s,content:a,originStopPattern:l,stopPattern:d}=this.getTextEntity(r);this.label=r;if(t){let e=this.checksum(a);this.text=s+a+e+d;n||(this.label=i+a+e+l)}else this.text=s+a+d;this.nwRatio=+o}validate(){let{config:{nwRatio:e},encodeConfig:{text:t}}=this;if(!REG.test(t))throw new InvalidTextException(t);if(2!=e&&3!=e)throw new InvalidOptionsException({nwRatio:e},"NwRatio is 2 or 3")}getTextEntity(e){const t=REG.exec(e);if(!t)throw new InvalidTextException(e);const o=t[1],r=o||"A",n=t[2],i=t[3];return{originStartPattern:o,startPattern:r,content:n,originStopPattern:i,stopPattern:i||"B"}}encode(e){let{nwRatio:t}=this,o="";const r=Utils.strRepeat("1",t),n=Utils.strRepeat("0",t);Utils.str2Array(e).forEach((e,t)=>{Utils.isEven(t)?o+="1"===e?r:"1":o+="1"===e?n:"0"});return o}calculateData(){let{text:e}=this,t="";Utils.sliceString(e,1,e=>{t=t+this.encode(CodabarEncoder.TABLE[e])+"0"});return t=t.substr(0,t.length-1)}checksum(e){let t=Utils.str2Array(e).filter(e=>Utils.isInteger(+e)).reverse().reduce((e,t,o)=>{let r=Utils.toNumber(t);if(Utils.isEven(o)){let t=2*r;e+=t>9?t-9:t}else e+=r;return e},0)%10;0!==t&&(t=10-t);return t}}CodabarEncoder.DefaultConfig={checkDigit:!1,quietZone:{right:10,left:10},nwRatio:3};CodabarEncoder.TABLE={0:"0000011",1:"0000110",2:"0001001",3:"1100000",4:"0010010",5:"1000010",6:"0100001",7:"0100100",8:"0110000",9:"1001000","-":"0001100",$:"0011000",":":"1000101","/":"1010001",".":"1010100","+":"0010101",A:"0011010",B:"0101001",C:"0001011",D:"0001110"};Barcode.registerEncoder("Codabar",CodabarEncoder);export var QrCodeCharset;!function(e){e[e.Utf8=0]="Utf8";e[e.ShiftJis=1]="ShiftJis"}(QrCodeCharset||(QrCodeCharset={}));export var QrCodeCorrectionLevel;!function(e){e[e.Low=0]="Low";e[e.Medium=1]="Medium";e[e.Quartile=2]="Quartile";e[e.High=3]="High"}(QrCodeCorrectionLevel||(QrCodeCorrectionLevel={}));export var QrCodeModel;!function(e){e[e.Model1=0]="Model1";e[e.Model2=1]="Model2"}(QrCodeModel||(QrCodeModel={}));export var Code128CodeSet;!function(e){e[e.Auto=0]="Auto";e[e.A=1]="A";e[e.B=2]="B";e[e.C=3]="C"}(Code128CodeSet||(Code128CodeSet={}));export class _QrCodeModelConvertor{static stringToEnum(e){switch(e.toString()){case"1":return QrCodeModel.Model1;case"2":return QrCodeModel.Model2}throw`Unknown QRCode internal model '${e}'`}static enumToString(e){var t=QrCodeModel[asEnum(e,QrCodeModel)];return t.charAt(t.length-1)}}export class _CharsetTypeConvertor{static stringToEnum(e){switch(e){case"UTF-8":return QrCodeCharset.Utf8;case"Shift_JIS":return QrCodeCharset.ShiftJis}throw`Unknown Barcode internal charset '${e}'`}static enumToString(e){let t;switch(asEnum(e,QrCodeCharset)){case QrCodeCharset.Utf8:t="UTF-8";break;case QrCodeCharset.ShiftJis:t="Shift_JIS"}return t}}export class _CorrectionLevelConvertor{static stringToEnum(e){switch(e){case"L":return QrCodeCorrectionLevel.Low;case"M":return QrCodeCorrectionLevel.Medium;case"Q":return QrCodeCorrectionLevel.Quartile;case"H":return QrCodeCorrectionLevel.High}throw`Unknown barcode internal errorCorrectionLevel '${e}'`}static enumToString(e){return QrCodeCorrectionLevel[asEnum(e,QrCodeCorrectionLevel)].charAt(0)}}export class _CodeSetTypeConvertor{static stringToEnum(e){switch(e){case"auto":return Code128CodeSet.Auto;case"A":return Code128CodeSet.A;case"B":return Code128CodeSet.B;case"C":return Code128CodeSet.C}throw`Unknown barcode internal codeSet '${e}'`}static enumToString(e){let t,o=asEnum(e,Code128CodeSet);switch(o){case Code128CodeSet.Auto:t="auto";break;case Code128CodeSet.A:case Code128CodeSet.B:case Code128CodeSet.C:t=Code128CodeSet[o]}return t}}export class Codabar extends BarcodeBase{constructor(e,t){super(e);addClass(this.hostElement,"wj-barcode-codabar");this._setAw(!0);this.initialize(t)}get autoWidth(){return this._getAw()}set autoWidth(e){this._setAw(e)}get autoWidthZoom(){return this._getWzoom()}set autoWidthZoom(e){this._setWzoom(e)}get showLabel(){return this._getProp("showLabel")}set showLabel(e){this._setProp("showLabel",e)}get checkDigit(){return this._getProp("checkDigit")}set checkDigit(e){this._setProp("checkDigit",e)}get labelPosition(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))}set labelPosition(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))}get nwRatio(){return _NarrowWideRatioConvertor.stringToEnum(this._getProp("nwRatio"))}set nwRatio(e){this._setProp("nwRatio",_NarrowWideRatioConvertor.enumToString(e))}}Codabar.type="Codabar";export class EanBase extends BarcodeBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-ean")}get showLabel(){return this._getProp("showLabel")}set showLabel(e){this._setProp("showLabel",e)}get labelPosition(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))}set labelPosition(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))}}export class Ean8 extends EanBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-ean8")}}Ean8.type="EAN8";export class Ean13 extends EanBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-ean13")}get addOn(){return this._getProp("addOn")}set addOn(e){this._setProp("addOn",e)}get addOnHeight(){return this._getProp("addOnHeight")}set addOnHeight(e){this._setProp("addOnHeight",e)}get addOnLabelPosition(){return _LabelPositionConvertor.stringToEnum(this._getProp("addOnLabelPosition"))}set addOnLabelPosition(e){this._setProp("addOnLabelPosition",_LabelPositionConvertor.enumToString(e))}get quietZone(){return this._getProp("quietZone")}set quietZone(e){this._setProp("quietZone",e)}}Ean13.type="EAN13";export class Code39 extends BarcodeBase{constructor(e,t){super(e);addClass(this.hostElement,"wj-barcode-code39");this._setAw(!0);this.initialize(t)}get autoWidth(){return this._getAw()}set autoWidth(e){this._setAw(e)}get autoWidthZoom(){return this._getWzoom()}set autoWidthZoom(e){this._setWzoom(e)}get showLabel(){return this._getProp("showLabel")}set showLabel(e){this._setProp("showLabel",e)}get checkDigit(){return this._getProp("checkDigit")}set checkDigit(e){this._setProp("checkDigit",e)}get fullAscii(){return this._getProp("fullASCII")}set fullAscii(e){this._setProp("fullASCII",e)}get labelPosition(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))}set labelPosition(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))}get nwRatio(){return _NarrowWideRatioConvertor.stringToEnum(this._getProp("nwRatio"))}set nwRatio(e){this._setProp("nwRatio",_NarrowWideRatioConvertor.enumToString(e))}get labelWithStartAndStopCharacter(){return this._getProp("labelWithStartAndStopCharacter")}set labelWithStartAndStopCharacter(e){this._setProp("labelWithStartAndStopCharacter",e)}}Code39.type="Code39";export class Code128 extends BarcodeBase{constructor(e,t){super(e);addClass(this.hostElement,"wj-barcode-code128");this._setAw(!0);this.initialize(t)}get autoWidth(){return this._getAw()}set autoWidth(e){this._setAw(e)}get autoWidthZoom(){return this._getWzoom()}set autoWidthZoom(e){this._setWzoom(e)}get showLabel(){return this._getProp("showLabel")}set showLabel(e){this._setProp("showLabel",e)}get codeSet(){return _CodeSetTypeConvertor.stringToEnum(this._getProp("codeSet"))}set codeSet(e){this._setProp("codeSet",_CodeSetTypeConvertor.enumToString(e))}get labelPosition(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))}set labelPosition(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))}}Code128.type="Code128";export class Gs1_128 extends BarcodeBase{constructor(e,t){super(e);addClass(this.hostElement,"wj-barcode-gs1_128");this._setAw(!0);this.initialize(t)}get autoWidth(){return this._getAw()}set autoWidth(e){this._setAw(e)}get autoWidthZoom(){return this._getWzoom()}set autoWidthZoom(e){this._setWzoom(e)}get showLabel(){return this._getProp("showLabel")}set showLabel(e){this._setProp("showLabel",e)}get labelPosition(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))}set labelPosition(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))}}Gs1_128.type="GS1_128";export class UpcBase extends BarcodeBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-upc")}get showLabel(){return this._getProp("showLabel")}set showLabel(e){this._setProp("showLabel",e)}get addOn(){return this._getProp("addOn")}set addOn(e){this._setProp("addOn",e)}get labelPosition(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))}set labelPosition(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))}get addOnHeight(){return this._getProp("addOnHeight")}set addOnHeight(e){this._setProp("addOnHeight",e)}get addOnLabelPosition(){return _LabelPositionConvertor.stringToEnum(this._getProp("addOnLabelPosition"))}set addOnLabelPosition(e){this._setProp("addOnLabelPosition",_LabelPositionConvertor.enumToString(e))}get quietZone(){return this._getProp("quietZone")}set quietZone(e){this._setProp("quietZone",e)}}export class UpcA extends UpcBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-upca")}}UpcA.type="UPC-A";export class UpcE0 extends UpcBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-upce0")}}UpcE0.type="UPC-E0";export class UpcE1 extends UpcBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-upce1")}}UpcE1.type="UPC-E1";export class QrCode extends BarcodeBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-qrcode")}get charCode(){return this._getProp("charCode")}set charCode(e){this._setProp("charCode",e)}get charset(){return _CharsetTypeConvertor.stringToEnum(this._getProp("charset"))}set charset(e){this._setProp("charset",_CharsetTypeConvertor.enumToString(e))}get model(){return _QrCodeModelConvertor.stringToEnum(this._getProp("model"))}set model(e){this._setProp("model",_QrCodeModelConvertor.enumToString(e))}get version(){let e=this._getProp("version");return"auto"===e?null:e}set version(e){this._setProp("version",null==e?"auto":e)}get errorCorrectionLevel(){return _CorrectionLevelConvertor.stringToEnum(this._getProp("errorCorrectionLevel"))}set errorCorrectionLevel(e){this._setProp("errorCorrectionLevel",_CorrectionLevelConvertor.enumToString(e))}get mask(){let e=this._getProp("mask");return"auto"===e?null:e}set mask(e){this._setProp("mask",null==e?"auto":e)}get connection(){return this._getProp("connection")}set connection(e){this._setProp("connection",e)}get connectionIndex(){return this._getProp("connectionNo")}set connectionIndex(e){this._setProp("connectionNo",e)}}QrCode.type="QRCode";_registerModule("wijmo.barcode.common",selfModule);
|
package/es5-esm.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* Wijmo Library 5.20232.939
|
|
4
|
+
* https://developer.mescius.com/wijmo
|
|
5
|
+
*
|
|
6
|
+
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
|
|
9
|
+
* us.sales@mescius.com
|
|
10
|
+
* https://developer.mescius.com/wijmo/licensing
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}();import{asEnum,addClass,_registerModule}from"@mescius/wijmo";import{OneDimensionalBarcode,Utils,InvalidTextException,InvalidOptionsException,Barcode,InvalidCharacterException,Constants,TextTooLongException,BitBuffer,TwoDimensionalBarcode,BarcodeBase,_LabelPositionConvertor,_NarrowWideRatioConvertor}from"@mescius/wijmo.barcode";import*as selfModule from"@mescius/wijmo.barcode.common";for(var EXP_TABLE=new Array(256),i=0;i<8;i++)EXP_TABLE[i]=1<<i;for(i=8;i<256;i++)EXP_TABLE[i]=EXP_TABLE[i-4]^EXP_TABLE[i-5]^EXP_TABLE[i-6]^EXP_TABLE[i-8];var LOG_TABLE=new Array(256);for(i=0;i<255;i+=1)LOG_TABLE[EXP_TABLE[i]]=i;var RS_COEFFICIENTS=[null,null,null,null,null,null,null,[0,87,229,146,149,238,102,21],null,null,[0,251,67,46,61,118,70,64,94,32,45],null,null,[0,74,152,176,100,86,100,106,104,130,218,206,140,78],null,[0,8,183,61,91,202,37,51,58,58,237,140,124,5,99,105],[0,120,104,107,109,102,161,76,3,91,191,147,169,182,194,225,120],[0,43,139,206,78,43,239,123,206,214,147,24,99,150,39,243,163,136],[0,215,234,158,94,184,97,118,170,79,187,152,148,252,179,5,98,96,153],null,[0,17,60,79,50,61,163,26,187,202,180,221,225,83,239,156,164,212,212,188,190],null,[0,210,171,247,242,93,230,14,109,221,53,200,74,8,172,98,80,219,134,160,105,165,231],null,[0,229,121,135,48,211,117,251,126,159,180,169,152,192,226,228,218,111,0,117,232,87,96,227,21],null,[0,173,125,158,2,103,182,118,17,145,201,111,28,165,53,161,21,245,142,13,102,48,227,153,145,218,70],null,[0,168,223,200,104,224,234,108,180,110,190,195,147,205,27,232,201,21,43,245,87,42,195,212,119,242,37,9,123],null,[0,41,173,145,152,216,31,179,182,50,48,110,86,239,96,222,125,42,173,226,193,224,130,156,37,251,216,238,40,192,180],null,[0,10,6,106,190,249,167,4,67,209,138,138,32,242,123,89,27,120,185,80,156,38,69,171,60,28,222,80,52,254,185,220,241],null,[0,111,77,146,94,26,21,108,19,105,94,113,193,86,140,163,125,58,158,229,239,218,103,56,70,114,61,183,129,167,13,98,62,129,51],null,[0,200,183,98,16,172,31,246,234,60,152,115,0,167,152,113,248,238,107,18,63,218,37,87,210,105,177,120,74,121,196,117,251,113,233,30,120],null,null,null,[0,59,116,79,161,252,98,128,205,128,161,247,57,163,56,235,106,53,26,187,174,226,104,170,7,175,35,181,114,88,41,47,163,125,134,72,20,232,53,35,15],null,[0,250,103,221,230,25,18,137,231,0,3,58,242,221,191,110,84,230,8,188,106,96,147,15,131,139,34,101,223,39,101,213,199,237,254,201,123,171,162,194,117,50,96],null,[0,190,7,61,121,71,246,69,55,168,188,89,243,191,25,72,123,9,145,14,247,1,238,44,78,143,62,224,126,118,114,68,163,52,194,217,147,204,169,37,130,113,102,73,181],null,[0,112,94,88,112,253,224,202,115,187,99,89,5,54,113,129,44,58,16,135,216,169,211,36,1,4,96,60,241,73,104,234,8,249,245,119,174,52,25,157,224,43,202,223,19,82,15],null,[0,228,25,196,130,211,146,60,24,251,90,39,102,240,61,178,63,46,123,115,18,221,111,135,160,182,205,107,206,95,150,120,184,91,21,247,156,140,238,191,11,94,227,84,50,163,39,34,108],null,[0,232,125,157,161,164,9,118,46,209,99,203,193,35,3,209,111,195,242,203,225,46,13,32,160,126,209,130,160,242,215,242,75,77,42,189,32,113,65,124,69,228,114,235,175,124,170,215,232,133,205],null,[0,116,50,86,186,50,220,251,89,192,46,86,127,124,19,184,233,151,215,22,14,59,145,37,242,203,134,254,89,190,94,59,65,124,113,100,233,235,121,22,76,86,97,39,242,200,220,101,33,239,254,116,51],null,[0,183,26,201,87,210,221,113,21,46,65,45,50,238,184,249,225,102,58,209,218,109,165,26,95,184,192,52,245,35,254,238,175,172,79,123,25,122,43,120,108,215,80,128,201,235,8,153,59,101,31,198,76,31,156],null,[0,106,120,107,157,164,216,112,116,2,91,248,163,36,201,202,229,6,144,254,155,135,208,170,209,12,139,127,142,182,249,177,174,190,28,10,85,239,184,101,124,152,206,96,23,163,61,27,196,247,151,154,202,207,20,61,10],null,[0,82,116,26,247,66,27,62,107,252,182,200,185,235,55,251,242,210,144,154,237,176,141,192,248,152,249,206,85,253,142,65,165,125,23,24,30,122,240,214,6,129,218,29,145,127,134,206,245,117,29,41,63,159,142,233,125,148,123],null,[0,107,140,26,12,9,141,243,197,226,197,219,45,211,101,219,120,28,181,127,6,100,247,2,205,198,57,115,219,101,109,160,82,37,38,238,49,160,209,121,86,11,124,30,181,84,25,194,87,65,102,190,220,70,27,209,16,89,7,33,240],null,[0,65,202,113,98,71,223,248,118,214,94,1,122,37,23,2,228,58,121,7,105,135,78,243,118,70,76,223,89,72,50,70,111,194,17,212,126,181,35,221,117,235,11,229,149,147,123,213,40,115,6,200,100,26,246,182,218,127,215,36,186,110,106],null,[0,45,51,175,9,7,158,159,49,68,119,92,123,177,204,187,254,200,78,141,149,119,26,127,53,160,93,199,212,29,24,145,156,208,150,218,209,4,216,91,47,184,146,47,140,195,195,125,242,238,63,99,108,140,230,242,31,204,11,178,243,217,156,213,231],null,[0,5,118,222,180,136,136,162,51,46,117,13,215,81,17,139,247,197,171,95,173,65,137,178,68,111,95,101,41,72,214,169,197,95,7,44,154,77,111,236,40,121,143,63,87,80,253,240,126,217,77,34,232,106,50,168,82,76,146,67,106,171,25,132,93,45,105],null,[0,247,159,223,33,224,93,77,70,90,160,32,254,43,150,84,101,190,205,133,52,60,202,165,220,203,151,93,84,15,84,253,173,160,89,227,52,199,97,95,231,52,177,41,125,137,241,166,225,118,2,54,32,82,215,175,198,43,238,235,27,101,184,127,3,5,8,163,238],null];export function generateErrorCorrectionCode(e,t,o){for(var r=[],n=RS_COEFFICIENTS[t],i=e.slice(0),a=0;a<o;a++){if(0!=i[0]){for(var s=LOG_TABLE[i[0]],c=0;c<=n.length-1;c++){for(var d=n[c]+s;d>=255;)d-=255;r[c]=EXP_TABLE[d]}for(var u=0;u<=n.length-1;u++)i[u]=i[u]^r[u]}for(var l=1;l<i.length;l++)i[l-1]=i[l];i[i.length-1]=0}return i.slice(0,t)}var G15=1335,G18=7973,MODEL2_G15_MASK=21522,MODEL1_G15_MASK=10277;function getBCHDigit(e){for(var t=0;0!=e;){t+=1;e>>>=1}return t}export function getBCH15(e,t){for(var o=2===t?MODEL2_G15_MASK:MODEL1_G15_MASK,r=e<<10;getBCHDigit(r)-getBCHDigit(G15)>=0;)r^=G15<<getBCHDigit(r)-getBCHDigit(G15);return(e<<10|r)^o}export function getBCH18(e){for(var t=e<<12;getBCHDigit(t)-getBCHDigit(G18)>=0;)t^=G18<<getBCHDigit(t)-getBCHDigit(G18);return e<<12|t}export var MODE_INDICATOR={ECI:7,Numeric:1,Alphanumeric:2,"8BitByte":4,Kanji:8,StructuredAppend:3,FNC1First:5,FNC2Second:9,Terminator:0};export var EC_INDICATOR={L:1,M:0,Q:3,H:2};function isNumericMode(e){return e>=48&&e<=57}function isAlphanumericMode(e){return-1!=" $%*+-./:".indexOf(String.fromCharCode(e))||(e>=48&&e<=57||e>=65&&e<=90)}function is8BitByteMode(e){return e>=0&&e<=255}function isKanjiMode(e){return e>=33087&&e<=64587}var checkFns={Numeric:isNumericMode,Alphanumeric:isAlphanumericMode,"8BitByte":is8BitByteMode,Kanji:isKanjiMode};export function isMode(e,t){var o=checkFns[e];return 1===t.length?o(t):t.every((function(e){return o(e)}))}export function getCharMode(e,t){void 0===t&&(t="UTF-8");return isNumericMode(e)?"Numeric":isAlphanumericMode(e)?"Alphanumeric":"Shift_JIS"===t&&isKanjiMode(e)?"Kanji":"8BitByte"}export var getSizeByVersion=function(e){return 4*e+17};export function getCharacterCountIndicatorbitsNumber(e){return e>=1&&e<=9?{Numeric:10,Alphanumeric:9,"8BitByte":8,Kanji:8}:e>=10&&e<=26?{Numeric:12,Alphanumeric:11,"8BitByte":16,Kanji:10}:{Numeric:14,Alphanumeric:13,"8BitByte":16,Kanji:12}}var SYMBOL_MAP={" ":36,$:37,"%":38,"*":39,"+":40,"-":41,".":42,"/":43,":":44};export function getAlphanumericCharValue(e){if(e>=48&&e<=57)return+String.fromCharCode(e);if(e>=65&&e<=90)return e-65+10;var t=SYMBOL_MAP[String.fromCharCode(e)];if(t)return t;throw new InvalidTextException(String.fromCharCode(e))}export function createModules(e){for(var t=[],o=0;o<e;o++)t.push(Utils.fillArray(new Array(e),null));return t}var alignmentPatterns=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]];export function getAlignmentPattersPos(e){return alignmentPatterns[e-1]}export var padCodewords0=236;export var padCodewords1=17;export var maskFuncs=[function(e,t){return(e+t)%2==0},function(e){return e%2==0},function(e,t){return t%3==0},function(e,t){return(e+t)%3==0},function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0},function(e,t){return e*t%2+e*t%3==0},function(e,t){return(e*t%2+e*t%3)%2==0},function(e,t){return(e*t%3+(e+t)%2)%2==0}];var MODEL2_1ERROR_CORRECTION_CHARACTERISTICS=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],MODEL1_ERROR_CORRECTION_CHARACTERISTICS=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,46,36],[1,46,30],[1,46,24],[1,46,16],[1,72,57],[1,72,44],[1,72,36],[1,72,24],[1,100,80],[1,100,60],[1,100,50],[1,100,34],[1,134,108],[1,134,82],[1,134,68],[2,67,23],[1,170,136],[2,85,53],[2,85,43],[2,85,29],[1,212,170],[2,106,66],[2,106,54],[3,70,24],[2,128,104],[2,128,80],[2,128,64],[3,85,29],[2,153,123],[2,153,93],[3,102,52],[3,102,34],[2,179,145],[2,179,111],[3,119,61],[4,89,31],[2,208,168],[4,104,64],[4,104,52],[5,83,29],[2,238,192],[4,119,73],[4,119,61],[5,95,33],[3,180,144],[4,135,83],[4,135,69],[6,90,32],[3,203,163],[4,152,92],[5,122,62],[6,101,35]];export function getErrorCorrectionCharacteristics(e,t,o){void 0===o&&(o=2);var r;switch(t){case 1:r=0;break;case 0:r=1;break;case 3:r=2;break;case 2:r=3}for(var n=(2===o?MODEL2_1ERROR_CORRECTION_CHARACTERISTICS:MODEL1_ERROR_CORRECTION_CHARACTERISTICS)[4*(e-1)+r],i=[],a=n.length/3,s=0;s<a;s++)for(var c=n[3*s],d=0;d<c;d++)i.push({total:n[3*s+1],data:n[3*s+2],ec:n[3*s+1]-n[3*s+2]});return i}export function getMaskFunc(e){return maskFuncs[e]}function cloneModules(e){return e.reduce((function(e,t){e.push(t.slice(0));return e}),[])}export function getMaskScore(e){for(var t=e.length,o=0,r=0;r<t;r++)for(var n=0;n<t;n++){for(var i=0,a=e[r][n],s=-1;s<=1;s++)if(!(r+s<0||t<=r+s))for(var c=-1;c<=1;c++)n+c<0||t<=n+c||0==s&&0==c||a==e[r+s][n+c]&&(i+=1);i>5&&(o+=3+i-5)}for(r=0;r<t-1;r++)for(n=0;n<t-1;n++){var d=0;e[r][n]&&(d+=1);e[r+1][n]&&(d+=1);e[r][n+1]&&(d+=1);e[r+1][n+1]&&(d+=1);0!=d&&4!=d||(o+=3)}for(r=0;r<t;r++)for(n=0;n<t-6;n++)e[r][n]&&!e[r][n+1]&&e[r][n+2]&&e[r][n+3]&&e[r][n+4]&&!e[r][n+5]&&e[r][n+6]&&(o+=40);for(n=0;n<t;n++)for(r=0;r<t-6;r++)e[r][n]&&!e[r+1][n]&&e[r+2][n]&&e[r+3][n]&&e[r+4][n]&&!e[r+5][n]&&e[r+6][n]&&(o+=40);var u=0;for(n=0;n<t;n++)for(r=0;r<t;r++)e[r][n]&&(u+=1);return o+=10*(Math.abs(100*u/t/t-50)/5)}export function addFormatInformation(e,t,o,r){var n=e.length,i=cloneModules(e),a=Utils.strPadStart(Utils.convertRadix(o,2),2,0),s=Utils.strPadStart(Utils.convertRadix(t,2),3,0),c=getBCH15(parseInt(a+s,2),r);i[n-8][8]=1;for(var d=15;d>0;d--){var u=c>>d-1&1;if(d>9){i[8][15-d]=u;i[n-1-15+d][8]=u}else if(d>8){i[8][15-d+1]=u;i[n-1-15+d][8]=u}else if(d>6){i[d][8]=u;i[8][n-d]=u}else{i[d-1][8]=u;i[8][n-d]=u}}return i}export function getEstimatedVersion(e,t,o){var r=0,n=0,i=0,a=0;t.forEach((function(e){isNumericMode(e)?r++:isAlphanumericMode(e)?n++:isKanjiMode(e)?a++:is8BitByteMode(e)&&i++}));for(var s=Math.ceil((5*n+3*r+13*a+8*i)/8),c=1;c<=40;c++){if(s<=getErrorCorrectionCharacteristics(c,e,o).reduce((function(e,t){return e+t.data}),0))return c}throw new TextTooLongException}var MODE_CHECK_INFO={Alphanumeric:[[6,11],[7,15],[8,16]],Numeric:[[4,6,6,13],[4,7,8,15],[5,8,9,17]]};export function getModeCheckInfo(e,t){var o=MODE_CHECK_INFO[e];return t<=9?o[0]:t<=26?o[1]:o[2]}export function utf8Encode(e){for(var t=[],o=0,r=e.length;o<r;o++){var n=e[o];if(n<128)t.push(n);else if(n<2048)t.push(192|n>>6,128|63&n);else if(n<55296||n>=57344)t.push(224|n>>12,128|n>>6&63,128|63&n);else{n=65536+((1023&n)<<10|1023&e[++o]);t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)}}return t}export function getParityData(e){for(var t=utf8Encode(e),o=t[0],r=1,n=t.length;r<n;r++)o^=t[r];return o}export function getCharCode(e){var t=[];Utils.sliceString(e,1,(function(e){t.push(e.charCodeAt(0))}));return t}var ModeKanji=function(){function ModeKanji(e){this.mode="Kanji";this.data=e}ModeKanji.prototype.getMode=function(){return MODE_INDICATOR.Kanji};ModeKanji.prototype.getLength=function(){return this.data.length};ModeKanji.prototype.write=function(e){this.data.forEach((function(t){var o;if(t>33088&&t<40956){o=192*((t-=33088)>>>8)+(255&t)}else if(t>57408&&t<60351){o=192*((t-=49472)>>>8)+(255&t)}e.put(o,13)}))};return ModeKanji}();export{ModeKanji};var ModeAlphanumeric=function(){function ModeAlphanumeric(e){this.mode="Alphanumeric";this.data=e}ModeAlphanumeric.prototype.getMode=function(){return MODE_INDICATOR.Alphanumeric};ModeAlphanumeric.prototype.getLength=function(){return this.data.length};ModeAlphanumeric.prototype.write=function(e){Utils.sliceArray(this.data,2,(function(t){var o=getAlphanumericCharValue(t[0]);if(2===t.length){var r=45*o+getAlphanumericCharValue(t[1]);e.put(r,11)}else e.put(o,6)}))};return ModeAlphanumeric}();export{ModeAlphanumeric};var ModeNumeric=function(){function ModeNumeric(e){this.mode="Numeric";this.data=e}ModeNumeric.prototype.getMode=function(){return MODE_INDICATOR.Numeric};ModeNumeric.prototype.getLength=function(){return this.data.length};ModeNumeric.prototype.write=function(e){Utils.sliceArray(this.data,3,(function(t){var o=parseInt(t.reduce((function(e,t){return e+String.fromCharCode(t)}),""));switch(t.length){case 1:e.put(o,4);return;case 2:e.put(o,7);return;default:e.put(o,10);return}}))};return ModeNumeric}();export{ModeNumeric};var Mode8BitByte=function(){function Mode8BitByte(e){this.mode="8BitByte";this.data=e;this.bytes=utf8Encode(e)}Mode8BitByte.prototype.getMode=function(){return MODE_INDICATOR["8BitByte"]};Mode8BitByte.prototype.getLength=function(){return this.bytes.length};Mode8BitByte.prototype.write=function(e){this.bytes.forEach((function(t){e.put(t,8)}))};return Mode8BitByte}();export{Mode8BitByte};var QRCodeBase=function(){function QRCodeBase(e,t){var o=t.version,r=t.model,n=t.charCode;this.charCode=n||getCharCode(e);var i=EC_INDICATOR[t.errorCorrectionLevel];this.config=t;this.errorCorrectionLevel=i;this.model=+r;o="auto"===o?this.getAutoVersion():+o;this.version=o;this.modulesCount=getSizeByVersion(o);this.charCountIndicatorBitsNumber=getCharacterCountIndicatorbitsNumber(o);this.errorCorrectionCharacteristics=getErrorCorrectionCharacteristics(o,i,this.model);this.totalDataCount=this.errorCorrectionCharacteristics.reduce((function(e,t){return e+t.data}),0);this.totalDataBits=8*this.totalDataCount}QRCodeBase.prototype.getConnections=function(){for(var e=this.totalDataBits,t=this.charCode,o=e-20,r=t.length,n=0,i=1,a=[],s=t[0];i<=r;){var c=t.slice(n,i),d=this.analysisData(c);if(this.encodeData(d).length>o){a.push(s);n=i-1}else i===r&&a.push(c);s=c;i++}return a};QRCodeBase.prototype.processConnection=function(e){var t=this.totalDataBits,o=this.config,r=o.connection,n=o.connectionNo;n=+n;if(r){var i=Math.ceil(e.length/(t-20));if(n>i-1)throw new InvalidOptionsException({connectionNo:n},"Max connection number is "+(i-1));var a=this.getConnections()[n],s=this.analysisData(a);return this.encodeData(s,{connectionNo:n,connectionCnt:i})}if(e.length>t)throw new TextTooLongException;return e};QRCodeBase.prototype.padBuffer=function(e){var t=this.totalDataBits;e.length+4<=t&&e.put(MODE_INDICATOR.Terminator,4);for(;e.length%8!=0;)e.putBit(!1);for(;!(e.length>=t);){e.put(padCodewords0,8);if(e.length>=t)break;e.put(padCodewords1,8)}};QRCodeBase.prototype.getAutoVersion=function(){for(var e=this.errorCorrectionLevel,t=this.charCode,o=getEstimatedVersion(e,t,this.model);o<40;o++){this.version=o;this.modulesCount=getSizeByVersion(this.version);this.charCountIndicatorBitsNumber=getCharacterCountIndicatorbitsNumber(this.version);this.errorCorrectionCharacteristics=getErrorCorrectionCharacteristics(this.version,e);this.totalDataCount=this.errorCorrectionCharacteristics.reduce((function(e,t){return e+t.data}),0);this.totalDataBits=8*this.totalDataCount;var r=this.analysisData(t);if(!(this.encodeData(r).length>this.totalDataBits))return o}throw new TextTooLongException};QRCodeBase.prototype.analysisData=function(e){var t=this.version,o=this.config.charset,r=getCharMode(e[0],o);switch(r){case"Alphanumeric":var n=getModeCheckInfo(r,t);isMode("8BitByte",e.slice(1,1+n[0]))&&(r="8BitByte");break;case"Numeric":var i=getModeCheckInfo(r,t),a=e.slice(1,1+i[0]),s=e.slice(1,1+i[1]);isMode("8BitByte",a)?r="8BitByte":isMode("Alphanumeric",s)&&(r="Alphanumeric")}var c={mode:r,code:[]},d=[c];e.forEach((function(r,n){var i=getCharMode(r,o);if(c.mode===i)c.code.push(r);else if("8BitByte"===c.mode)if("Kanji"===i){c={mode:i,code:[r]};d.push(c)}else if("Numeric"===i){var a=getModeCheckInfo(i,t);if(isMode(i,e.slice(n,n+a[2]))){c={mode:i,code:[r]};d.push(c)}else c.code.push(r)}else if("Alphanumeric"===i){a=getModeCheckInfo(i,t);if(isMode(i,e.slice(n,n+a[1]))){c={mode:i,code:[r]};d.push(c)}else c.code.push(r)}else c.code.push(r);else if("Alphanumeric"===c.mode)if("Kanji"===i||"8BitByte"===i){c={mode:i,code:[r]};d.push(c)}else if("Numeric"===i){a=getModeCheckInfo(i,t);if(isMode(i,e.slice(n,n+a[2]))){c={mode:i,code:[r]};d.push(c)}else c.code.push(r)}else c.code.push(r);else{c={mode:i,code:[r]};d.push(c)}}));return d};QRCodeBase.prototype.generateErrorCorrectionCode=function(e){var t=this.errorCorrectionCharacteristics,o=[],r=0;t.forEach((function(t){var n=e.getBuffer().slice(r,r+t.data);o.push({data:n,ec:generateErrorCorrectionCode(n,t.ec,t.data)});r+=t.data}));return o};QRCodeBase.prototype.addRectModule=function(e,t,o,r,n){void 0===n&&(n=!1);for(var i=this.modules,a=r+t,s=o+e;t<a;t++)for(var c=e;c<s;c++)i[t][c]=+n};QRCodeBase.prototype.addPositionDetectionPattern=function(){var e=this.modules.length;this.addPattern(0,0,7);this.addRectModule(7,0,1,8,!1);this.addRectModule(0,7,8,1,!1);var t=e-7;this.addPattern(t,0,7);this.addRectModule(t-1,0,1,8,!1);this.addRectModule(t-1,7,8,1,!1);var o=e-7;this.addPattern(0,o,7);this.addRectModule(7,o-1,1,8,!1);this.addRectModule(0,o-1,8,1,!1)};QRCodeBase.prototype.addTimingPattern=function(){for(var e=this.modules,t=e.length,o=!0,r=8;r<t-7;r++){e[6][r]=+o;e[r][6]=+o;o=!o}};QRCodeBase.prototype.addPattern=function(e,t,o){this.addRectModule(e,t,o,o,!0);this.addRectModule(e+1,t+1,o-2,o-2,!1);this.addRectModule(e+2,t+2,o-4,o-4,!0)};return QRCodeBase}();export{QRCodeBase};var QRCodeModel2=function(e){__extends(QRCodeModel2,e);function QRCodeModel2(){return null!==e&&e.apply(this,arguments)||this}QRCodeModel2.prototype.encodeData=function(e,t){var o=this.charCountIndicatorBitsNumber,r=this.charCode,n=new BitBuffer;if(t){n.put(MODE_INDICATOR.StructuredAppend,4);n.put(t.connectionNo,4);n.put(t.connectionCnt-1,4);n.put(getParityData(r),8)}e.forEach((function(e){if(e.code){var t;switch(e.mode){case"Numeric":t=new ModeNumeric(e.code);break;case"Alphanumeric":t=new ModeAlphanumeric(e.code);break;case"8BitByte":t=new Mode8BitByte(e.code);break;case"Kanji":t=new ModeKanji(e.code)}n.put(t.getMode(),4);n.put(t.getLength(),o[t.mode]);t.write(n)}}));return n};QRCodeModel2.prototype.getFinalMessage=function(e){for(var t=[],o=e.map((function(e){return e.data})),r=e.map((function(e){return e.ec})),n=Utils.getMaxValue(o),i=Utils.getMaxValue(r),_loop_1=function(e){o.forEach((function(o){Utils.isDefined(o[e])&&t.push(o[e])}))},a=0;a<n;a++)_loop_1(a);var _loop_2=function(e){r.forEach((function(o){Utils.isDefined(o[e])&&t.push(o[e])}))};for(a=0;a<i;a++)_loop_2(a);return t};QRCodeModel2.prototype.setModules=function(e){var t=this.modulesCount,o=this.version;this.modules=createModules(t);this.addPositionDetectionPattern();this.addAlignmentPattern();this.addTimingPattern();o>6&&this.addVersionInformation();this.maskModules(e)};QRCodeModel2.prototype.maskModules=function(e){var t=this.modules,o=this.errorCorrectionLevel,r=this.model,n=this.config.mask;if("auto"===n)this.autoMask(e);else{var i=getMaskFunc(n);this.maskPattern=n;var a=addFormatInformation(t,n,o,r);this.modules=this.fillDataModules(a,e,i)}};QRCodeModel2.prototype.autoMask=function(e){var t,o,r,n=this,i=this.modules,a=this.errorCorrectionLevel,s=this.model;maskFuncs.forEach((function(c,d){var u=addFormatInformation(i,d,a,s),l=n.fillDataModules(u,e,c),h=getMaskScore(l);if(!o||h<o){t=l;o=h;r=d}}));this.modules=t;this.maskPattern=r};QRCodeModel2.prototype.addAlignmentPattern=function(){var e=this,t=this.modules,o=getAlignmentPattersPos(this.version);o.forEach((function(r){o.forEach((function(o){null===t[r][o]&&e.addPattern(o-2,r-2,5)}))}))};QRCodeModel2.prototype.addVersionInformation=function(){for(var e=this.modulesCount,t=this.modules,o=getBCH18(this.version),r=0;r<18;r++){var n=o>>r&1;t[Math.floor(r/3)][r%3+e-8-3]=n;t[r%3+e-8-3][Math.floor(r/3)]=n}};QRCodeModel2.prototype.fillDataModules=function(e,t,o){for(var r=e.length,n=-1,i=r-1,a=7,s=0,c=r-1;c>0;c-=2){6==c&&(c-=1);for(;;){for(var d=0;d<2;d+=1)if(null==e[i][c-d]){var u=!1;s<t.length&&(u=1==(t[s]>>>a&1));o(i,c-d)&&(u=!u);e[i][c-d]=+u;if(-1==(a-=1)){s+=1;a=7}}if((i+=n)<0||r<=i){i-=n;n=-n;break}}}return e};QRCodeModel2.prototype.getMatrix=function(){var e=this.charCode,t=this.analysisData(e),o=this.encodeData(t),r=this.processConnection(o);this.padBuffer(r);var n=this.generateErrorCorrectionCode(r),i=this.getFinalMessage(n);this.setModules(i);return this.modules};return QRCodeModel2}(QRCodeBase);export{QRCodeModel2};var QRCodeModel1=function(e){__extends(QRCodeModel1,e);function QRCodeModel1(){return null!==e&&e.apply(this,arguments)||this}QRCodeModel1.prototype.encodeData=function(e,t){var o=this.charCountIndicatorBitsNumber,r=this.charCode,n=new BitBuffer;n.put(0,4);if(t){n.put(MODE_INDICATOR.StructuredAppend,4);n.put(t.connectionNo,4);n.put(t.connectionCnt-1,4);n.put(getParityData(r),8)}e.forEach((function(e){if(e.code){var t;switch(e.mode){case"Numeric":t=new ModeNumeric(e.code);break;case"Alphanumeric":t=new ModeAlphanumeric(e.code);break;case"8BitByte":t=new Mode8BitByte(e.code);break;case"Kanji":t=new ModeKanji(e.code)}n.put(t.getMode(),4);n.put(t.getLength(),o[t.mode]);t.write(n)}}));return n};QRCodeModel1.prototype.getFinalMessage=function(e){var t=[],o=e.map((function(e){return e.data})),r=e.map((function(e){return e.ec}));o.forEach((function(e){return t=t.concat(e)}));r.forEach((function(e){return t=t.concat(e)}));return t};QRCodeModel1.prototype.setModules=function(e){var t=this.modulesCount;this.modules=createModules(t);this.addPositionDetectionPattern();this.addExtensionPattern();this.addTimingPattern();this.maskModules(e)};QRCodeModel1.prototype.maskModules=function(e){var t=this.modules,o=this.errorCorrectionLevel,r=this.model,n=this.config.mask;if("auto"===n)this.autoMask(e);else{var i=getMaskFunc(n);this.maskPattern=n;var a=addFormatInformation(t,n,o,r);this.modules=this.fillDataModules(a,e,i)}};QRCodeModel1.prototype.autoMask=function(e){var t,o,r,n=this,i=this.modules,a=this.errorCorrectionLevel,s=this.model;maskFuncs.forEach((function(c,d){var u=addFormatInformation(i,d,a,s),l=n.fillDataModules(u,e,c),h=getMaskScore(l);if(!o||h<o){t=l;o=h;r=d}}));this.modules=t;this.maskPattern=r};QRCodeModel1.prototype.addExtensionPattern=function(){var e=this.modules,t=this.version,o=e.length;e[o-1][o-1]=1;e[o-2][o-1]=0;e[o-1][o-2]=0;e[o-2][o-2]=0;var r=Math.floor(t/2);if(Utils.isEven(t))for(var n=0;n<r;n++){this.addBaseExtension(13+8*n);this.addRightExtension(13+8*n)}else for(n=0;n<r;n++){this.addBaseExtension(17+8*n);this.addRightExtension(17+8*n)}};QRCodeModel1.prototype.addBaseExtension=function(e){var t=this.modules,o=t.length,r=o-2,n=o-1;t[r][e]=0;t[r][e+1]=0;t[r][e+2]=0;t[r][e+3]=0;t[n][e]=1;t[n][e+1]=1;t[n][e+2]=1;t[n][e+3]=1};QRCodeModel1.prototype.addRightExtension=function(e){var t=this.modules,o=t.length,r=o-2,n=o-1;t[e][r]=0;t[e+1][r]=0;t[e+2][r]=0;t[e+3][r]=0;t[e][n]=1;t[e+1][n]=1;t[e+2][n]=1;t[e+3][n]=1};QRCodeModel1.prototype.fillDataModules=function(e,t,o){var r,n,i=e.length;r=n=i-1;var a=2,s=new BitBuffer(t);s.next();s.next();s.next();s.next();for(;r>=0;){if(r==i-5)a=4;else if(8==r)a=2;else if(6==r){r--;continue}for(;n>=0;)if(null===e[n][r]){for(var c=0;c<a;c++){var d=s.next();o(n,r-c)&&(d=!d);e[n][r-c]=+d}n--}else n--;r-=a;n=i-1}return e};QRCodeModel1.prototype.getMatrix=function(){var e=this.charCode,t=this.analysisData(e),o=this.encodeData(t),r=this.processConnection(o);this.padBuffer(r);var n=this.generateErrorCorrectionCode(r),i=this.getFinalMessage(n);this.setModules(i);return this.modules};return QRCodeModel1}(QRCodeBase);export{QRCodeModel1};var QRCodeEncoder=function(e){__extends(QRCodeEncoder,e);function QRCodeEncoder(t){var o=this;t.merge(QRCodeEncoder.DefaultConfig);var r,n=o=e.call(this,t)||this,i=n.encodeConfig.text,a=n.config;r="2"==a.model?new QRCodeModel2(i,a):new QRCodeModel1(i,a);o.innerQRCode=r;return o}QRCodeEncoder.prototype.calculateData=function(){return this.innerQRCode.getMatrix()};QRCodeEncoder.prototype.validate=function(){var e=this.config,t=e.version,o=e.model,r=e.charset,n=e.charCode,i=e.connectionNo,a=this.encodeConfig.text;if(!(a||n&&0!==n.length))throw new InvalidTextException(a);if("1"!=o&&"2"!=o)throw new InvalidOptionsException({model:o});if("UTF-8"!=r&&"Shift_JIS"!=r)throw new InvalidOptionsException({charset:r});if("1"==o&&Utils.isNumberLike(t)&&(t<1||t>14))throw new InvalidOptionsException({version:t},"Model 1 only support version 1 - 14.");if("2"==o&&Utils.isNumberLike(t)&&(t<1||t>40))throw new InvalidOptionsException({version:t},"Model 2 only support version 1 - 40.");if(i>15||i<0)throw new InvalidOptionsException({connectionNo:i},"ConnectionNo is in range 0 - 15.")};QRCodeEncoder.DefaultConfig={version:"auto",errorCorrectionLevel:"L",model:2,mask:"auto",connection:!1,connectionNo:0,charCode:void 0,charset:"UTF-8",quietZone:{top:4,left:4,right:4,bottom:4}};return QRCodeEncoder}(TwoDimensionalBarcode);export{QRCodeEncoder};Barcode.registerEncoder("QRCode",QRCodeEncoder);var TableCode128A=[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","\0","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","","","","","","","","","","","","",""," "," "," "," "," "," "," "," "," "," "],TableCode128B=[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~",""," "," "," "," "," "," "," "," "," "," "],TableCode128Data=["212222","222122","222221","121223","121322","131222","122213","122312","132212","221213","221312","231212","112232","122132","122231","113222","123122","123221","223211","221132","221231","213212","223112","312131","311222","321122","321221","312212","322112","322211","212123","212321","232121","111323","131123","131321","112313","132113","132311","211313","231113","231311","112133","112331","132131","113123","113321","133121","313121","211331","231131","213113","213311","213131","311123","311321","331121","312113","312311","332111","314111","221411","431111","111224","111422","121124","121421","141122","141221","112214","112412","122114","122411","142112","142211","241211","221114","413111","241112","134111","111242","121142","121241","114212","124112","124211","411212","421112","421211","212141","214121","412121","111143","111341","131141","114113","114311","411113","411311","113141","114131","311141","411131","211412","211214","211232"];export var stopPattern="2331112";export var Code128Sym={CodeC:99,CodeB:100,CodeA:101,FNC1:102,FNC2:97,FNC3:96,StartA:103,StartB:104,StartC:105};export var Code128Char={CodeC:String.fromCharCode(204),CodeB:String.fromCharCode(205),CodeA:String.fromCharCode(206),FNC1:Constants.FNC1,FNC2:Constants.FNC2,FNC3:Constants.FNC3,StartA:String.fromCharCode(208),StartB:String.fromCharCode(209),StartC:String.fromCharCode(210)};export function getCharValue(e,t){if(e===Code128Char.FNC1)return Code128Sym.FNC1;if(e===Code128Char.FNC2)return Code128Sym.FNC2;if(e===Code128Char.FNC3)return Code128Sym.FNC3;switch(t){case"A":return TableCode128A.indexOf(e);case"B":return TableCode128B.indexOf(e);case"C":return+e}}export function getCharPattern(e,t){var o=TableCode128Data[getCharValue(e,t)];if(!o)throw new InvalidCharacterException(e);return o}export function getPatternByIndex(e){return TableCode128Data[e]}export function encode(e){var t="";Utils.str2Array(e).forEach((function(e,o){Utils.isEven(o)?t+=Utils.strRepeat("1",+e):t+=Utils.strRepeat("0",+e)}));return t}var CODE_SET_A="A",CODE_SET_B="B",CODE_SET_C="C",Code128Auto=function(){function Code128Auto(e,t){void 0===t&&(t=!1);this.text=e;this.isUccEan128=t;this.validate()}Code128Auto.prototype.validate=function(){var e=this.text;if(!/^[\x00-\x7F\xC8-\xD3]+$/.test(e))throw new InvalidTextException(e)};Code128Auto.prototype.calculateGroup=function(){var e=this.text,t={code:this.isUccEan128?CODE_SET_C:CODE_SET_B,text:""},o=[];o.push(t);for(var r=0,n=e.length;r<n;r++){var i=t.code,a=e[r];if(t.code!==CODE_SET_C&&r+3<n&&Utils.isNumberLike(e.substr(r,4))||t.code===CODE_SET_C&&r+1<n&&Utils.isNumberLike(e.substr(r,2))){i=CODE_SET_C;a+=e[++r]}else if(getCharValue(a,i=t.code===CODE_SET_C?CODE_SET_B:t.code)<0&&getCharValue(a,i=t.code===CODE_SET_A?CODE_SET_B:CODE_SET_A)<0)continue;if(t.code!==i){t={code:i,text:a};o.push(t)}else t.text+=a}return o.filter((function(e){return e.text}))};Code128Auto.prototype.getData=function(){var e=this.calculateGroup(),t=this.checksum(e),o="";e.forEach((function(e,t){if(0===t){var r=getPatternByIndex(Code128Sym["Start"+e.code]);o+=encode(r)}else{r=getPatternByIndex(Code128Sym["Code"+e.code]);o+=encode(r)}e.code===CODE_SET_C?Utils.sliceString(e.text,2,(function(t){o+=encode(getCharPattern(t,e.code))})):Utils.sliceString(e.text,1,(function(t){o+=encode(getCharPattern(t,e.code))}))}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128Auto.prototype.checksum=function(e){var t=0,o=0;e.forEach((function(e,r){var n=e.code,i=e.text;if(0===r)o+=Code128Sym["Start"+n];else{var a=Code128Sym["Code"+n];o+=a*++t}n===CODE_SET_C?Utils.sliceString(i,2,(function(e){o+=getCharValue(e,n)*++t})):Utils.sliceString(i,1,(function(e){o+=getCharValue(e,n)*++t}))}));return o%103};return Code128Auto}();export{Code128Auto};var Code128C=function(){function Code128C(e){this.text=e;this.validate()}Code128C.prototype.validate=function(){var e=this.text;if(!/^(\xCF*[0-9]{2}\xCF*)+$/.test(e))throw new InvalidTextException(e)};Code128C.prototype.getData=function(){var e=this.text,t=this.checksum(),o="",r=getPatternByIndex(Code128Sym.StartC);o+=encode(r);Utils.sliceString(e,2,(function(e){var t=getCharPattern(e,"C");o+=encode(t)}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128C.prototype.checksum=function(){var e=this.text,t=0,o=0;Utils.sliceString(e,2,(function(e){o+=getCharValue(e,"C")*++t}));return(o+=Code128Sym.StartC)%103};return Code128C}();export{Code128C};var Code128B=function(){function Code128B(e){this.text=e;this.validate()}Code128B.prototype.validate=function(){var e=this.text;if(!/^[\x20-\x7F\xC8-\xCF]+$/.test(e))throw new InvalidTextException(e)};Code128B.prototype.getData=function(){var e=this.text,t=this.checksum(),o="",r=getPatternByIndex(Code128Sym.StartB);o+=encode(r);Utils.sliceString(e,1,(function(e){var t=getCharPattern(e,"B");o+=encode(t)}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128B.prototype.checksum=function(){var e=this.text,t=0,o=0;Utils.sliceString(e,1,(function(e){o+=getCharValue(e,"B")*++t}));return(o+=Code128Sym.StartB)%103};return Code128B}();export{Code128B};var Code128A=function(){function Code128A(e){this.text=e;this.validate()}Code128A.prototype.validate=function(){var e=this.text;if(!/^[\x00-\x5F\xC8-\xCF]+$/.test(e))throw new InvalidTextException(e)};Code128A.prototype.getData=function(){var e=this.text,t=this.checksum(),o="",r=getPatternByIndex(Code128Sym.StartA);o+=encode(r);Utils.sliceString(e,1,(function(e){var t=getCharPattern(e,"A");o+=encode(t)}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128A.prototype.checksum=function(){var e=this.text,t=0,o=0;Utils.sliceString(e,1,(function(e){o+=getCharValue(e,"A")*++t}));return(o+=Code128Sym.StartA)%103};return Code128A}();export{Code128A};var Code128Encoder=function(e){__extends(Code128Encoder,e);function Code128Encoder(t,o){void 0===o&&(o=!1);var r=this;t.merge(Code128Encoder.DefaultConfig);var n=(r=e.call(this,t)||this).encodeConfig.text;r.isUccEan128=o;o&&n[0]!==Code128Char.FNC1&&(n=Code128Char.FNC1+n);r.text=n;r.label=n.replace(/[^\x20-\x7E]/g,"");return r}Code128Encoder.prototype.validate=function(){};Code128Encoder.prototype.calculateData=function(){var e,t=this.config.codeSet,o=this.text;if(this.isUccEan128)e=new Code128Auto(o);else switch(t){case"A":e=new Code128A(o);break;case"B":e=new Code128B(o);break;case"C":e=new Code128C(o);break;default:e=new Code128Auto(o)}return e.getData()};Code128Encoder.DefaultConfig={codeSet:"auto",quietZone:{right:10,left:10}};return Code128Encoder}(OneDimensionalBarcode);export{Code128Encoder};var GS1_128Encoder=function(e){__extends(GS1_128Encoder,e);function GS1_128Encoder(t){return e.call(this,t,!0)||this}return GS1_128Encoder}(Code128Encoder);export{GS1_128Encoder};Barcode.registerEncoder("GS1_128",GS1_128Encoder);Barcode.registerEncoder("Code128",Code128Encoder);var EncodeTable_Code39=function(){function EncodeTable_Code39(){}EncodeTable_Code39.getMod43Val=function(e){var t=0;Utils.sliceString(e,1,(function(e){t+=EncodeTable_Code39.MODULO_43_CHECK_TABLE.indexOf(e)}));return EncodeTable_Code39.MODULO_43_CHECK_TABLE[t%43]};EncodeTable_Code39.getFullASCIIChar=function(e){var t="";Utils.sliceString(e,1,(function(o){var r=EncodeTable_Code39.FULL_ASCII_TABLE[o.charCodeAt(0)];if(!r)throw new InvalidTextException(e);t+=r}));return t};EncodeTable_Code39.TABLE={0:"000110100",1:"100100001",2:"001100001",3:"101100000",4:"000110001",5:"100110000",6:"001110000",7:"000100101",8:"100100100",9:"001100100",A:"100001001",B:"001001001",C:"101001000",D:"000011001",E:"100011000",F:"001011000",G:"000001101",H:"100001100",I:"001001100",J:"000011100",K:"100000011",L:"001000011",M:"101000010",N:"000010011",O:"100010010",P:"001010010",Q:"000000111",R:"100000110",S:"001000110",T:"000010110",U:"110000001",V:"011000001",W:"111000000",X:"010010001",Y:"110010000",Z:"011010000","-":"010000101",".":"110000100"," ":"011000100",$:"010101000","/":"010100010","+":"010001010","%":"000101010","*":"010010100"};EncodeTable_Code39.MODULO_43_CHECK_TABLE=Utils.str2Array("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%");EncodeTable_Code39.FULL_ASCII_TABLE=["%U","$A","$B","$C","$D","$E","$F","$G","$H","$I","$J","$K","$L","$M","$N","$O","$P","$Q","$R","$S","$T","$U","$V","$W","$X","$Y","$Z","%A","%B","%C","%D","%E"," ","/A","/B","/C","/D","/E","/F","/G","/H","/I","/J","/K","/L","-",".","/O","0","1","2","3","4","5","6","7","8","9","/Z","%F","%G","%H","%I","%J","%V","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","%K","%L","%M","%N","%O","%W","+A","+B","+C","+D","+E","+F","+G","+H","+I","+J","+K","+L","+M","+N","+O","+P","+Q","+R","+S","+T","+U","+V","+W","+X","+Y","+Z","%P","%Q","%R","%S","%T"];return EncodeTable_Code39}();export{EncodeTable_Code39};var Code39Encoder=function(e){__extends(Code39Encoder,e);function Code39Encoder(t){var o=this;t.merge(Code39Encoder.DefaultConfig);var r=o=e.call(this,t)||this,n=r.encodeConfig,i=n.text,a=n.hideExtraChecksum,s=r.config,c=s.checkDigit,d=s.fullASCII,u=s.nwRatio,l=s.labelWithStartAndStopCharacter,h=d?EncodeTable_Code39.getFullASCIIChar(i):i;if(c){var C=EncodeTable_Code39.getMod43Val(h);o.text=Code39Encoder.START_STOP_CHARACTERS+h+C+Code39Encoder.START_STOP_CHARACTERS;var f=a?i:i+C,p=Code39Encoder.START_STOP_CHARACTERS+f+Code39Encoder.START_STOP_CHARACTERS;o.label=l?p:f}else{o.text=Code39Encoder.START_STOP_CHARACTERS+h+Code39Encoder.START_STOP_CHARACTERS;f=i,p=Code39Encoder.START_STOP_CHARACTERS+f+Code39Encoder.START_STOP_CHARACTERS;o.label=l?p:f}o.nwRatio=+u;return o}Code39Encoder.prototype.validate=function(){var e=this.encodeConfig.text,t=this.config,o=t.fullASCII,r=t.nwRatio;if(!o&&!/^[0-9A-Z\-\.\ \$\/\+\%]+$/.test(e))throw new InvalidTextException(e);if(2!=r&&3!=r)throw new InvalidOptionsException({nwRatio:r},"NwRatio is 2 or 3")};Code39Encoder.prototype.encode=function(e){var t=this.nwRatio,o="",r=Utils.strRepeat("1",t),n=Utils.strRepeat("0",t);Utils.str2Array(e).forEach((function(e,t){Utils.isEven(t)?o+="1"===e?r:"1":o+="1"===e?n:"0"}));return o};Code39Encoder.prototype.calculateData=function(){var e=this,t=this.text,o="";Utils.sliceString(t,1,(function(t){o=o+e.encode(EncodeTable_Code39.TABLE[t])+"0"}));return o=o.substr(0,o.length-1)};Code39Encoder.DefaultConfig={checkDigit:!1,fullASCII:!1,nwRatio:3,labelWithStartAndStopCharacter:!1,quietZone:{right:10,left:10}};Code39Encoder.START_STOP_CHARACTERS="*";return Code39Encoder}(OneDimensionalBarcode);export{Code39Encoder};Barcode.registerEncoder("Code39",Code39Encoder);var EncodeTable=function(){function EncodeTable(){}EncodeTable.encodeCharByTable=function(e,t){return EncodeTable.TABLE[t][e]};EncodeTable.encodeByStructure=function(e,t){return Utils.str2Array(e).reduce((function(e,o,r){return e+=EncodeTable.encodeCharByTable(o,t[r])}),"")};EncodeTable.encodeByTable=function(e,t){if(e.length>1){return Utils.str2Array(e).reduce((function(e,o){return e+=EncodeTable.encodeCharByTable(o,t)}),"")}return EncodeTable.encodeCharByTable(e,t)};EncodeTable.TABLE={A:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],B:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],C:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"]};return EncodeTable}();export{EncodeTable};var AddOnSymbol=function(){function AddOnSymbol(e,t,o,r){this.isTextGroup=o;this.addOn=""+e;if("auto"!==t)if(Utils.isNumberLike(t))t=+t;else{t=Utils.convertUnit(Utils.fixSize2PixelDefault(t));t/=r}this.addOnHeight=t;this.validate()}AddOnSymbol.get2DigitAddOnTable=function(e){switch((e=parseInt(e))%4){case 0:return{leftStructure:"A",rightStructure:"A"};case 1:return{leftStructure:"A",rightStructure:"B"};case 2:return{leftStructure:"B",rightStructure:"A"};case 3:return{leftStructure:"B",rightStructure:"B"}}};AddOnSymbol.get5DigitAddOnTable=function(e){var t=3*(+(e+="")[0]+ +e[2]+ +e[4])+9*(+e[1]+ +e[3]);return AddOnSymbol.fiveDigitAddOnStructure[t%10]};AddOnSymbol.prototype.validate=function(){var e=this.addOn;if(2!==e.length&&5!==e.length)throw new InvalidOptionsException({addOn:e},"Add on length should be 2 or 5.")};AddOnSymbol.prototype._encode2DigitAddOn=function(){var e,t,o,r=this.addOn,n=this.isTextGroup,i=[];e=AddOnSymbol.get2DigitAddOnTable(r);t=EncodeTable.encodeByTable(r[0],e.leftStructure[0]);o=EncodeTable.encodeByTable(r[1],e.rightStructure[0]);if(n){i.push({binary:AddOnSymbol.ADD_ON_GUARD,role:"ADDON"});i.push({binary:t,text:r[0],role:"ADDON"});i.push({binary:AddOnSymbol.ADD_ON_DELINEATOR,role:"ADDON"});i.push({binary:o,text:r[1],role:"ADDON"})}else i.push({binary:AddOnSymbol.ADD_ON_GUARD+t+AddOnSymbol.ADD_ON_DELINEATOR+o,text:r,role:"ADDON"});return i};AddOnSymbol.prototype._encode5DigitAddOn=function(){var e=this.addOn,t=this.isTextGroup,o=[],r=AddOnSymbol.get5DigitAddOnTable(e);if(t){o.push({binary:AddOnSymbol.ADD_ON_GUARD,role:"ADDON"});Utils.str2Array(e).forEach((function(t,n){o.push({binary:EncodeTable.encodeByTable(t,r[n]),text:t,role:"ADDON"});n<e.length-1&&o.push({binary:AddOnSymbol.ADD_ON_DELINEATOR,role:"ADDON"})}))}else{var n=Utils.str2Array(e).reduce((function(t,o,n){t+=EncodeTable.encodeByTable(o,r[n]);n<e.length-1&&(t+=AddOnSymbol.ADD_ON_DELINEATOR);return t}),"");o.push({binary:AddOnSymbol.ADD_ON_GUARD+n,text:e,role:"ADDON"})}return o};AddOnSymbol.prototype.calculateData=function(){var e=this.addOn,t=[];2===e.length?t=this._encode2DigitAddOn():5===e.length&&(t=this._encode5DigitAddOn());t.push({text:">",role:"ADDON_RIGHT_QUIET_ZONE"});return t};AddOnSymbol.fiveDigitAddOnStructure=["BBAAA","BABAA","BAABA","BAAAB","ABBAA","AABBA","AAABB","ABABA","ABAAB","AABAB"];AddOnSymbol.ADD_ON_GUARD="1011";AddOnSymbol.ADD_ON_DELINEATOR="01";return AddOnSymbol}();export{AddOnSymbol};var EANBase=function(e){__extends(EANBase,e);function EANBase(t){var o=this;t.merge(EANBase.DefaultConfig);var r=o=e.call(this,t)||this,n=r.style,i=n.textAlign,a=n.unitValue,s=r.config,c=s.addOnLabelPosition,d=s.addOn,u=s.addOnHeight;o.isTextGroup="group"===i;o.isAddOnLabelBottom="top"!==c;o._setAddOn(d,u,a);return o}EANBase.prototype._setAddOn=function(e,t,o){if(Utils.isDefined(e)){this.addOn=new AddOnSymbol(e,t,this.isTextGroup,o);this.addOnHeight=this.addOn.addOnHeight}else this.addOnHeight=0};EANBase.prototype.checksum=function(e,t){void 0===t&&(t=!1);var o=Utils.str2Array(e),r=t?Utils.isOdd:Utils.isEven,n=o.reduce((function(e,t,o){t=+t;return e+=r(o)?t:3*t}),0)%10;return 0===n?0:10-n};EANBase.prototype.convertToShape=function(e){var t=this,o=t.isTextGroup,r=t.addOnHeight,n=t.isAddOnLabelBottom,i=t.style.textAlign,a=t.encodeConfig,s=a.isLabelBottom,c=a.height,d=a.quietZone,u=a.showLabel,l=a.fontSizeInUnit;u||(l=0);r=r||0;var h,C,f,p,E,g,A,_=[],b=d.left,v=d.top;if(s){h=c+5;C=v+c;f=u?c+l:h;if(n)E=(p=v)+(g="auto"===r?u?c:h:r);else{E=v;p=v+l;g="auto"===r?h-l:r}}else{h=c;c-=5;C=v;v+=l;f=u?h+l:h;if(n){p=d.top;E=p+(g="auto"===r?u?c:h:r)}else{E=d.top;p=d.top+l;g="auto"===r?h:r}}A=u?g+l:g;e.forEach((function(e){var t,r=v,n=c,a=C,s=o?"center":i,l=b;switch(e.role){case"GUARD":n=h;t=e.binary.length;break;case"ADDON":r=p;n=g;a=E;t=e.binary.length;break;case"LEFT_QUIET_ZONE":s="left";t=d.left;l=0;break;case"RIGHT_QUIET_ZONE":case"NO_ADDON_RIGHT_QUIET_ZONE":s="right";t=d.right;break;case"ADDON_QUIET_ZONE":t=d.addOn;break;case"ADDON_RIGHT_QUIET_ZONE":s="right";a=E;t=d.right;break;default:t=e.binary.length}if(u&&e.text){switch(s){case"center":l+=t/2;break;case"right":l+=t}var f={type:"text",x:l,y:a,text:e.text,textAlign:s,maxWidth:t};if("NO_ADDON_RIGHT_QUIET_ZONE"===e.role||"ADDON_RIGHT_QUIET_ZONE"===e.role){f.fontStyle="normal";f.fontWeight="normal";f.textDecoration="none"}_.push(f)}e.binary?Utils.combineTruthy(e.binary).forEach((function(e){if(0!==e){_.push({type:"rect",x:b,y:r,width:e,height:n});b+=e}else b++})):"ADDON_QUIET_ZONE"===e.role&&(b+=t)}));this.size={width:b+d.right,height:Math.max(f,A)+d.top+d.bottom};this.shapes=_};EANBase.prototype.afterApplyDesiredSize=function(){var e=this.config,t=e.addOn,o=e.addOnHeight,r=this.style.unitValue;this._setAddOn(t,o,r);this.addOnHeight>this.encodeConfig.height&&(this.addOnHeight=this.encodeConfig.height)};EANBase.NORMAL_GUARD="101";EANBase.CENTRE_GUARD="01010";EANBase.DefaultConfig={quietZone:{right:7,left:11}};return EANBase}(OneDimensionalBarcode);export{EANBase};var UPC_E=function(e){__extends(UPC_E,e);function UPC_E(t,o,r){var n=this;t.merge(UPC_E.DefaultConfig);var i=(n=e.call(this,t)||this).encodeConfig,a=i.text,s=i.hideExtraChecksum;n.prefix=o;var c=a;if(a.length<7){a+=n.checksum(a);s||(c=a)}n.label=c;n.text=a;n.tableStructure=r;return n}UPC_E.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^(\d{6}|\d{7})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 6 or 7.");if(7===e.length){if(this.checksum(e.substr(0,6))!=e[6])throw new InvalidTextException(e,"Check digit is invalid.")}};UPC_E.prototype.checksum=function(t){var o;switch(t[5]){case"0":case"1":case"2":o=t.substr(0,2)+t[5]+"0000"+t.substr(2,3);break;case"3":o=t.substr(0,3)+"00000"+t.substr(3,2);break;case"4":o=t.substr(0,4)+"00000"+t[4];break;default:o=t.substr(0,5)+"0000"+t[5]}o=this.prefix+o;return e.prototype.checksum.call(this,o,!0)};UPC_E.prototype.calculateData=function(){var e=this,t=e.text,o=e.addOn,r=e.isTextGroup,n=e.prefix,i=e.tableStructure,a=e.label,s=t[6],c=a[6];t=t.substr(0,6);var d=a.substr(0,6),u=i[s],l=[];l.push({text:n,role:"LEFT_QUIET_ZONE"});l.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});r?Utils.str2Array(t).forEach((function(e,t){l.push({binary:EncodeTable.encodeByTable(e,u[t]),text:d[t]})})):l.push({binary:EncodeTable.encodeByStructure(t,u),text:d});l.push({binary:UPC_E.SPECIAL_GUARD,role:"GUARD"});if(o){l.push({text:c,role:"ADDON_QUIET_ZONE"});l=l.concat(o.calculateData())}else l.push({text:c,role:"NO_ADDON_RIGHT_QUIET_ZONE"});return l};UPC_E.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{left:9,addOn:5}};UPC_E.SPECIAL_GUARD="010101";return UPC_E}(EANBase);export{UPC_E};var UPC_E1_Encoder=function(e){__extends(UPC_E1_Encoder,e);function UPC_E1_Encoder(t){return e.call(this,t,"1",UPC_E1_Encoder.structure)||this}UPC_E1_Encoder.structure=["AAABBB","AABABB","AABBAB","AABBBA","ABAABB","ABBAAB","ABBBAA","ABABAB","ABABBA","ABBABA"];return UPC_E1_Encoder}(UPC_E);export{UPC_E1_Encoder};var UPC_E0_Encoder=function(e){__extends(UPC_E0_Encoder,e);function UPC_E0_Encoder(t){return e.call(this,t,"0",UPC_E0_Encoder.structure)||this}UPC_E0_Encoder.structure=["BBBAAA","BBABAA","BBAABA","BBAAAB","BABBAA","BAABBA","BAAABB","BABABA","BABAAB","BAABAB"];return UPC_E0_Encoder}(UPC_E);export{UPC_E0_Encoder};var UPC_A_Encoder=function(e){__extends(UPC_A_Encoder,e);function UPC_A_Encoder(t){var o=this;t.merge(UPC_A_Encoder.DefaultConfig);var r=(o=e.call(this,t)||this).encodeConfig,n=r.text,i=r.hideExtraChecksum,a=n;if(n.length<12){n+=o.checksum(n,!0);i||(a=n)}o.label=a;o.text=n;return o}UPC_A_Encoder.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^(\d{11}|\d{12})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 11 or 12.");if(12===e.length){if(this.checksum(e.substr(0,11),!0)!=e[11])throw new InvalidTextException(e,"Check digit is invalid.")}};UPC_A_Encoder.prototype.calculateData=function(){var e=this.text,t=this.addOn,o=this.isTextGroup,r=this.label,n=e[0],i=e[11],a=r[11],s=e.substr(1,5),c=e.substr(6,5),d=r.substr(1,5),u=r.substr(6,5),l=[];l.push({text:n,role:"LEFT_QUIET_ZONE"});l.push({binary:EANBase.NORMAL_GUARD+EncodeTable.encodeByTable(n,"A"),role:"GUARD"});o?Utils.str2Array(s).forEach((function(e,t){l.push({binary:EncodeTable.encodeByTable(e,"A"),text:d[t]})})):l.push({binary:EncodeTable.encodeByTable(s,"A"),text:d});l.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(c).forEach((function(e,t){l.push({binary:EncodeTable.encodeByTable(e,"C"),text:u[t]})})):l.push({binary:EncodeTable.encodeByTable(c,"C"),text:u});l.push({binary:EncodeTable.encodeByTable(i,"C")+EANBase.NORMAL_GUARD,role:"GUARD"});if(t){l.push({text:a,role:"ADDON_QUIET_ZONE"});l=l.concat(t.calculateData())}else l.push({text:a,role:"NO_ADDON_RIGHT_QUIET_ZONE"});return l};UPC_A_Encoder.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{right:9,left:9,addOn:5}};return UPC_A_Encoder}(EANBase);export{UPC_A_Encoder};Barcode.registerEncoder("UPC-A",UPC_A_Encoder);Barcode.registerEncoder("UPC-E0",UPC_E0_Encoder);Barcode.registerEncoder("UPC-E1",UPC_E1_Encoder);var EAN13Encoder=function(e){__extends(EAN13Encoder,e);function EAN13Encoder(t){var o=this;t.merge(EAN13Encoder.DefaultConfig);var r=(o=e.call(this,t)||this).encodeConfig,n=r.text,i=r.hideExtraChecksum,a=n;if(n.length<13){n+=o.checksum(n);i||(a=n)}o.label=a;o.text=n;return o}EAN13Encoder.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^[1-9](\d{11}|\d{12})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. And it should not start with 0. The length should be 12 or 13.");if(13===e.length){if(this.checksum(e.substr(0,12))!=e[12])throw new InvalidTextException(e,"Check digit is invalid.")}};EAN13Encoder.prototype.calculateData=function(){var e=this.text,t=this.addOn,o=this.isTextGroup,r=this.label,n=e.substr(1,6),i=e.substr(7,6),a=r.substr(1,6),s=r.substr(7,6),c=EAN13Encoder.leftStructure[e[0]],d=[];d.push({text:e[0],role:"LEFT_QUIET_ZONE"});d.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});o?Utils.str2Array(n).forEach((function(e,t){d.push({binary:EncodeTable.encodeByTable(e,c[t]),text:a[t]})})):d.push({binary:EncodeTable.encodeByStructure(n,c),text:a});d.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(i).forEach((function(e,t){d.push({binary:EncodeTable.encodeByTable(e,"C"),text:s[t]})})):d.push({binary:EncodeTable.encodeByTable(i,"C"),text:s});d.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});if(t){d.push({role:"ADDON_QUIET_ZONE"});d=d.concat(t.calculateData())}else d.push({text:">",role:"NO_ADDON_RIGHT_QUIET_ZONE"});return d};EAN13Encoder.leftStructure=["AAAAAA","AABABB","AABBAB","AABBBA","ABAABB","ABBAAB","ABBBAA","ABABAB","ABABBA","ABBABA"];EAN13Encoder.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{addOn:5}};return EAN13Encoder}(EANBase);export{EAN13Encoder};var EAN8Encoder=function(e){__extends(EAN8Encoder,e);function EAN8Encoder(t){var o=this;t.merge(EAN8Encoder.DefaultConfig);var r=(o=e.call(this,t)||this).encodeConfig,n=r.text,i=r.hideExtraChecksum,a=n;if(n.length<8){n+=o.checksum(n,!0);i||(a=n)}o.label=a;o.text=n;return o}EAN8Encoder.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^[0-9](\d{6}|\d{7})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 7 or 8.");if(8===e.length){if(this.checksum(e.substr(0,7),!0)!=e[7])throw new InvalidTextException(e,"Check digit is invalid.")}};EAN8Encoder.prototype.calculateData=function(){var e=this.text,t=this.label,o=this.isTextGroup,r=e.substr(0,4),n=e.substr(4,4),i=t.substr(0,4),a=t.substr(4,4),s=[];s.push({text:"<",role:"LEFT_QUIET_ZONE"});s.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});o?Utils.str2Array(r).forEach((function(e,t){s.push({binary:EncodeTable.encodeByTable(e,"A"),text:i[t]})})):s.push({binary:EncodeTable.encodeByTable(r,"A"),text:i});s.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(n).forEach((function(e,t){s.push({binary:EncodeTable.encodeByTable(e,"C"),text:a[t]})})):s.push({binary:EncodeTable.encodeByTable(n,"C"),text:a});s.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});s.push({text:">",role:"RIGHT_QUIET_ZONE"});return s};EAN8Encoder.DefaultConfig={quietZone:{left:7}};return EAN8Encoder}(EANBase);export{EAN8Encoder};Barcode.registerEncoder("EAN8",EAN8Encoder);Barcode.registerEncoder("EAN13",EAN13Encoder);var REG=/^([A-D]?)([0-9\-\$\:\.\+\/]+)([A-D]?)$/,CodabarEncoder=function(e){__extends(CodabarEncoder,e);function CodabarEncoder(t){var o=this;t.merge(CodabarEncoder.DefaultConfig);var r=o=e.call(this,t)||this,n=r.config,i=n.checkDigit,a=n.nwRatio,s=r.encodeConfig,c=s.text,d=s.hideExtraChecksum,u=o.getTextEntity(c),l=u.originStartPattern,h=u.startPattern,C=u.content,f=u.originStopPattern,p=u.stopPattern;o.label=c;if(i){var E=o.checksum(C);o.text=h+C+E+p;d||(o.label=l+C+E+f)}else o.text=h+C+p;o.nwRatio=+a;return o}CodabarEncoder.prototype.validate=function(){var e=this.config.nwRatio,t=this.encodeConfig.text;if(!REG.test(t))throw new InvalidTextException(t);if(2!=e&&3!=e)throw new InvalidOptionsException({nwRatio:e},"NwRatio is 2 or 3")};CodabarEncoder.prototype.getTextEntity=function(e){var t=REG.exec(e);if(!t)throw new InvalidTextException(e);var o=t[1],r=o||"A",n=t[2],i=t[3];return{originStartPattern:o,startPattern:r,content:n,originStopPattern:i,stopPattern:i||"B"}};CodabarEncoder.prototype.encode=function(e){var t=this.nwRatio,o="",r=Utils.strRepeat("1",t),n=Utils.strRepeat("0",t);Utils.str2Array(e).forEach((function(e,t){Utils.isEven(t)?o+="1"===e?r:"1":o+="1"===e?n:"0"}));return o};CodabarEncoder.prototype.calculateData=function(){var e=this,t=this.text,o="";Utils.sliceString(t,1,(function(t){o=o+e.encode(CodabarEncoder.TABLE[t])+"0"}));return o=o.substr(0,o.length-1)};CodabarEncoder.prototype.checksum=function(e){var t=Utils.str2Array(e).filter((function(e){return Utils.isInteger(+e)})).reverse().reduce((function(e,t,o){var r=Utils.toNumber(t);if(Utils.isEven(o)){var n=2*r;e+=n>9?n-9:n}else e+=r;return e}),0)%10;0!==t&&(t=10-t);return t};CodabarEncoder.DefaultConfig={checkDigit:!1,quietZone:{right:10,left:10},nwRatio:3};CodabarEncoder.TABLE={0:"0000011",1:"0000110",2:"0001001",3:"1100000",4:"0010010",5:"1000010",6:"0100001",7:"0100100",8:"0110000",9:"1001000","-":"0001100",$:"0011000",":":"1000101","/":"1010001",".":"1010100","+":"0010101",A:"0011010",B:"0101001",C:"0001011",D:"0001110"};return CodabarEncoder}(OneDimensionalBarcode);export{CodabarEncoder};Barcode.registerEncoder("Codabar",CodabarEncoder);export var QrCodeCharset;!function(e){e[e.Utf8=0]="Utf8";e[e.ShiftJis=1]="ShiftJis"}(QrCodeCharset||(QrCodeCharset={}));export var QrCodeCorrectionLevel;!function(e){e[e.Low=0]="Low";e[e.Medium=1]="Medium";e[e.Quartile=2]="Quartile";e[e.High=3]="High"}(QrCodeCorrectionLevel||(QrCodeCorrectionLevel={}));export var QrCodeModel;!function(e){e[e.Model1=0]="Model1";e[e.Model2=1]="Model2"}(QrCodeModel||(QrCodeModel={}));export var Code128CodeSet;!function(e){e[e.Auto=0]="Auto";e[e.A=1]="A";e[e.B=2]="B";e[e.C=3]="C"}(Code128CodeSet||(Code128CodeSet={}));var _QrCodeModelConvertor=function(){function _QrCodeModelConvertor(){}_QrCodeModelConvertor.stringToEnum=function(e){switch(e.toString()){case"1":return QrCodeModel.Model1;case"2":return QrCodeModel.Model2}throw"Unknown QRCode internal model '"+e+"'"};_QrCodeModelConvertor.enumToString=function(e){var t=QrCodeModel[asEnum(e,QrCodeModel)];return t.charAt(t.length-1)};return _QrCodeModelConvertor}();export{_QrCodeModelConvertor};var _CharsetTypeConvertor=function(){function _CharsetTypeConvertor(){}_CharsetTypeConvertor.stringToEnum=function(e){switch(e){case"UTF-8":return QrCodeCharset.Utf8;case"Shift_JIS":return QrCodeCharset.ShiftJis}throw"Unknown Barcode internal charset '"+e+"'"};_CharsetTypeConvertor.enumToString=function(e){var t;switch(asEnum(e,QrCodeCharset)){case QrCodeCharset.Utf8:t="UTF-8";break;case QrCodeCharset.ShiftJis:t="Shift_JIS"}return t};return _CharsetTypeConvertor}();export{_CharsetTypeConvertor};var _CorrectionLevelConvertor=function(){function _CorrectionLevelConvertor(){}_CorrectionLevelConvertor.stringToEnum=function(e){switch(e){case"L":return QrCodeCorrectionLevel.Low;case"M":return QrCodeCorrectionLevel.Medium;case"Q":return QrCodeCorrectionLevel.Quartile;case"H":return QrCodeCorrectionLevel.High}throw"Unknown barcode internal errorCorrectionLevel '"+e+"'"};_CorrectionLevelConvertor.enumToString=function(e){return QrCodeCorrectionLevel[asEnum(e,QrCodeCorrectionLevel)].charAt(0)};return _CorrectionLevelConvertor}();export{_CorrectionLevelConvertor};var _CodeSetTypeConvertor=function(){function _CodeSetTypeConvertor(){}_CodeSetTypeConvertor.stringToEnum=function(e){switch(e){case"auto":return Code128CodeSet.Auto;case"A":return Code128CodeSet.A;case"B":return Code128CodeSet.B;case"C":return Code128CodeSet.C}throw"Unknown barcode internal codeSet '"+e+"'"};_CodeSetTypeConvertor.enumToString=function(e){var t,o=asEnum(e,Code128CodeSet);switch(o){case Code128CodeSet.Auto:t="auto";break;case Code128CodeSet.A:case Code128CodeSet.B:case Code128CodeSet.C:t=Code128CodeSet[o]}return t};return _CodeSetTypeConvertor}();export{_CodeSetTypeConvertor};var Codabar=function(e){__extends(Codabar,e);function Codabar(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,"wj-barcode-codabar");r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Codabar.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"checkDigit",{get:function(){return this._getProp("checkDigit")},set:function(e){this._setProp("checkDigit",e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"nwRatio",{get:function(){return _NarrowWideRatioConvertor.stringToEnum(this._getProp("nwRatio"))},set:function(e){this._setProp("nwRatio",_NarrowWideRatioConvertor.enumToString(e))},enumerable:!0,configurable:!0});Codabar.type="Codabar";return Codabar}(BarcodeBase);export{Codabar};var EanBase=function(e){__extends(EanBase,e);function EanBase(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,"wj-barcode-ean");return r}Object.defineProperty(EanBase.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(EanBase.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});return EanBase}(BarcodeBase);export{EanBase};var Ean8=function(e){__extends(Ean8,e);function Ean8(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,"wj-barcode-ean8");return r}Ean8.type="EAN8";return Ean8}(EanBase);export{Ean8};var Ean13=function(e){__extends(Ean13,e);function Ean13(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,"wj-barcode-ean13");return r}Object.defineProperty(Ean13.prototype,"addOn",{get:function(){return this._getProp("addOn")},set:function(e){this._setProp("addOn",e)},enumerable:!0,configurable:!0});Object.defineProperty(Ean13.prototype,"addOnHeight",{get:function(){return this._getProp("addOnHeight")},set:function(e){this._setProp("addOnHeight",e)},enumerable:!0,configurable:!0});Object.defineProperty(Ean13.prototype,"addOnLabelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("addOnLabelPosition"))},set:function(e){this._setProp("addOnLabelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Ean13.prototype,"quietZone",{get:function(){return this._getProp("quietZone")},set:function(e){this._setProp("quietZone",e)},enumerable:!0,configurable:!0});Ean13.type="EAN13";return Ean13}(EanBase);export{Ean13};var Code39=function(e){__extends(Code39,e);function Code39(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,"wj-barcode-code39");r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Code39.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"checkDigit",{get:function(){return this._getProp("checkDigit")},set:function(e){this._setProp("checkDigit",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"fullAscii",{get:function(){return this._getProp("fullASCII")},set:function(e){this._setProp("fullASCII",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"nwRatio",{get:function(){return _NarrowWideRatioConvertor.stringToEnum(this._getProp("nwRatio"))},set:function(e){this._setProp("nwRatio",_NarrowWideRatioConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"labelWithStartAndStopCharacter",{get:function(){return this._getProp("labelWithStartAndStopCharacter")},set:function(e){this._setProp("labelWithStartAndStopCharacter",e)},enumerable:!0,configurable:!0});Code39.type="Code39";return Code39}(BarcodeBase);export{Code39};var Code128=function(e){__extends(Code128,e);function Code128(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,"wj-barcode-code128");r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Code128.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"codeSet",{get:function(){return _CodeSetTypeConvertor.stringToEnum(this._getProp("codeSet"))},set:function(e){this._setProp("codeSet",_CodeSetTypeConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Code128.type="Code128";return Code128}(BarcodeBase);export{Code128};var Gs1_128=function(e){__extends(Gs1_128,e);function Gs1_128(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,"wj-barcode-gs1_128");r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Gs1_128.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1_128.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1_128.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1_128.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Gs1_128.type="GS1_128";return Gs1_128}(BarcodeBase);export{Gs1_128};var UpcBase=function(e){__extends(UpcBase,e);function UpcBase(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,"wj-barcode-upc");return r}Object.defineProperty(UpcBase.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"addOn",{get:function(){return this._getProp("addOn")},set:function(e){this._setProp("addOn",e)},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"addOnHeight",{get:function(){return this._getProp("addOnHeight")},set:function(e){this._setProp("addOnHeight",e)},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"addOnLabelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("addOnLabelPosition"))},set:function(e){this._setProp("addOnLabelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"quietZone",{get:function(){return this._getProp("quietZone")},set:function(e){this._setProp("quietZone",e)},enumerable:!0,configurable:!0});return UpcBase}(BarcodeBase);export{UpcBase};var UpcA=function(e){__extends(UpcA,e);function UpcA(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,"wj-barcode-upca");return r}UpcA.type="UPC-A";return UpcA}(UpcBase);export{UpcA};var UpcE0=function(e){__extends(UpcE0,e);function UpcE0(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,"wj-barcode-upce0");return r}UpcE0.type="UPC-E0";return UpcE0}(UpcBase);export{UpcE0};var UpcE1=function(e){__extends(UpcE1,e);function UpcE1(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,"wj-barcode-upce1");return r}UpcE1.type="UPC-E1";return UpcE1}(UpcBase);export{UpcE1};var QrCode=function(e){__extends(QrCode,e);function QrCode(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,"wj-barcode-qrcode");return r}Object.defineProperty(QrCode.prototype,"charCode",{get:function(){return this._getProp("charCode")},set:function(e){this._setProp("charCode",e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"charset",{get:function(){return _CharsetTypeConvertor.stringToEnum(this._getProp("charset"))},set:function(e){this._setProp("charset",_CharsetTypeConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"model",{get:function(){return _QrCodeModelConvertor.stringToEnum(this._getProp("model"))},set:function(e){this._setProp("model",_QrCodeModelConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"version",{get:function(){var e=this._getProp("version");return"auto"===e?null:e},set:function(e){this._setProp("version",null==e?"auto":e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"errorCorrectionLevel",{get:function(){return _CorrectionLevelConvertor.stringToEnum(this._getProp("errorCorrectionLevel"))},set:function(e){this._setProp("errorCorrectionLevel",_CorrectionLevelConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"mask",{get:function(){var e=this._getProp("mask");return"auto"===e?null:e},set:function(e){this._setProp("mask",null==e?"auto":e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"connection",{get:function(){return this._getProp("connection")},set:function(e){this._setProp("connection",e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"connectionIndex",{get:function(){return this._getProp("connectionNo")},set:function(e){this._setProp("connectionNo",e)},enumerable:!0,configurable:!0});QrCode.type="QRCode";return QrCode}(BarcodeBase);export{QrCode};_registerModule("wijmo.barcode.common",selfModule);
|