@valentynb/gs1-parser 1.1.0 → 1.2.0

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/README.md CHANGED
@@ -1,14 +1,17 @@
1
1
  # GS1 Barcode Parser
2
2
 
3
- [![NPM version](https://img.shields.io/npm/v/gs1-barcode-parser-ts.svg?style=flat-square)](https://www.npmjs.com/package/@valentynb/gs1-parser)
4
- [![NPM downloads](https://img.shields.io/npm/dm/gs1-barcode-parser-ts.svg?style=flat-square)](https://www.npmjs.com/package/@valentynb/gs1-parser)
5
- [![Build Status](https://img.shields.io/github/actions/workflow/status/YOUR_GITHUB_REPO/publish.yml?style=flat-square)](https://github.com/valentynblaha/gs1-parser/actions)
6
- [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)
3
+ [![NPM version](https://img.shields.io/npm/v/%40valentynb%2Fgs1-parser)](https://www.npmjs.com/package/@valentynb/gs1-parser)
4
+ [![NPM downloads](https://img.shields.io/npm/dm/%40valentynb%2Fgs1-parser)](https://www.npmjs.com/package/@valentynb/gs1-parser)
5
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/valentynblaha/gs1-parser/publish.yml)](https://github.com/valentynblaha/gs1-parser/actions)
7
6
  [![Types Included](https://img.shields.io/badge/types-TypeScript-blue.svg?style=flat-square)](#)
7
+ [![Docs](https://img.shields.io/badge/docs-online-success)](https://valentynblaha.github.io/gs1-parser/)
8
+ [![Deploy Docs](https://github.com/valentynblaha/gs1-parser/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/valentynblaha/gs1-parser/actions/workflows/deploy-docs.yml)
9
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)
10
+
8
11
 
9
12
  A modern TypeScript library for parsing GS1 barcodes, supporting both ESModule and CommonJS formats.
10
13
 
11
- ### Based on work from: https://github.com/PeterBrockfeld/BarcodeParser
14
+ #### Based on work from: https://github.com/PeterBrockfeld/BarcodeParser
12
15
 
13
16
  ## Table of Contents
14
17
 
@@ -28,7 +31,6 @@ A modern TypeScript library for parsing GS1 barcodes, supporting both ESModule a
28
31
  * [About Barcode Scanning Devices](#about-barcode-scanning-devices)
29
32
  * [The FNC1 Character](#the-fnc1-character)
30
33
  * [Key Press Detecting](#key-press-detecting)
31
- * [Examples](#examples)
32
34
  * [What's New](#whats-new)
33
35
  * [License](#license)
34
36
 
@@ -117,8 +119,11 @@ import { GS1Parser } from '@valentynb/gs1-parser';
117
119
 
118
120
  const gs1Parser = new GS1Parser(
119
121
  {
120
- lotMaxLength: 20 // If not specified, no limit is applied, except the one in the GS1 specs
121
- fncChar: String.fromCodePoint(29); // If not specified, the GS char is used
122
+ // If not specified, no limit is applied, except the one in the GS1 specs
123
+ lotMaxLength: 20
124
+
125
+ // If not specified, the GS char is used
126
+ fncChar: String.fromCodePoint(29);
122
127
  }
123
128
  );
124
129
 
@@ -138,10 +143,12 @@ try {
138
143
  ### CommonJS Usage
139
144
 
140
145
  ```javascript
141
- const { parseBarcode } = require('@valentynb/gs1-parser');
146
+ const { GS1Parser } = require('@valentynb/gs1-parser');
147
+
148
+ const gs1Parser = new GS1Parser();
142
149
 
143
150
  try {
144
- const result = parseBarcode(barcodeString);
151
+ const result = gs1Parser.decode(barcodeString);
145
152
  // Process result...
146
153
  } catch (error) {
147
154
  console.error('Barcode parsing failed:', error);
@@ -153,17 +160,12 @@ try {
153
160
  The library is written in TypeScript and includes full type definitions:
154
161
 
155
162
  ```typescript
156
- import { GS1Parser, BarcodeResult, ParsedElement } from '@valentynb/gs1-parser';
163
+ import { GS1Parser, DecodeResult, ParsedElement } from '@valentynb/gs1-parser';
157
164
 
158
- const gs1Parser = new GS1Parser(
159
- {
160
- lotMaxLength: 20 // If not specified, no limit is applied, except the one in the GS1 specs
161
- fncChar: String.fromCodePoint(29); // If not specified, the GS char is used
162
- }
163
- );
165
+ const gs1Parser = new GS1Parser();
164
166
 
165
167
  try {
166
- const result: BarcodeResult = gs1Parser.decode(barcodeString);
168
+ const result: DecodeResult = gs1Parser.decode(barcodeString);
167
169
 
168
170
  result.data.values().forEach((item: ParsedElement) => {
169
171
  console.log(`AI: ${item.ai}`);
@@ -182,21 +184,8 @@ The `decode()` method does not perform plausibility checks (as of now). If the b
182
184
 
183
185
  ## API Reference
184
186
 
185
- ### `GS1Parser.decode(barcode: string): BarcodeResult`
186
-
187
- Parses a GS1 barcode string and returns structured data.
188
-
189
- **Returns:** `BarcodeResult` object containing:
190
- - `codeName` (string): Barcode type identifier (e.g., "GS1-128", "GS1-DataMatrix")
191
- - `data` (Partial<Record<GS1Field, ParsedElement>>): Dictionary of parsed data elements
192
- - `denormalized` (string): The original barcode in human readable form, with parentheses surrounding each AI
193
-
194
- **ParsedCodeItem structure:**
195
- - `ai` (string): Application identifier
196
- - `data` (string | number | Date): The actual content
197
- - `dataTitle` (string): Description of the data element
198
- - `dataString` (string): The substring that is being parsed
199
- - `unit` (string | undefined): Unit of measurement, country code, or currency (ISO codes)
187
+ Check out the documentation at:
188
+ #### [valentynblaha.github.io/gs1-parser](https://valentynblaha.github.io/gs1-parser)
200
189
 
201
190
  ## About Barcode Scanning Devices
202
191
 
@@ -219,15 +208,6 @@ Since this character isn't on standard keyboards, scanners send control sequence
219
208
 
220
209
  To determine what control sequence your scanner sends, create a simple test page that logs keyboard events (`keyCode`, `charCode`, `which`) to the console when scanning test barcodes containing the GS character.
221
210
 
222
- ## Examples
223
-
224
- Example usage and test barcodes are included in the repository, demonstrating:
225
-
226
- * Basic parsing operations
227
- * Handling different barcode formats (GS1-128, DataMatrix, QR Code)
228
- * Working with FNC1 characters
229
- * Building scanning applications
230
-
231
211
  ## What's New
232
212
 
233
213
  This modernized version includes:
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var C=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var r=(_,I)=>C(_,"name",{value:I,configurable:!0});var p=(_,I)=>{for(var E in I)C(_,E,{get:I[E],enumerable:!0})},b=(_,I,E,S)=>{if(I&&typeof I=="object"||typeof I=="function")for(let t of w(I))!B.call(_,t)&&t!==E&&C(_,t,{get:()=>I[t],enumerable:!(S=W(I,t))||S.enumerable});return _};var Q=_=>b(C({},"__esModule",{value:!0}),_);var y={};p(y,{GS1Parser:()=>D});module.exports=Q(y);var m={ai00:"sscc",ai01:"gtin",ai02:"content",ai10:"batch",ai11:"prodDate",ai12:"dueDate",ai13:"packDate",ai15:"bestBefore",ai16:"sellBy",ai17:"expDate",ai20:"variant",ai21:"serial",ai22:"hibcc",ai235:"tpx",ai240:"additionalProductID",ai241:"customerPartNumber",ai242:"madeToOrder",ai243:"packaging",ai250:"secondarySerialNumber",ai251:"refSource",ai253:"gdti",ai254:"glnExtension",ai255:"gcn",ai30:"variableCount",ai310:"netWeightKg0",ai3100:"netWeightKg0",ai3101:"netWeightKg1",ai3102:"netWeightKg2",ai3103:"netWeightKg3",ai3104:"netWeightKg4",ai3105:"netWeightKg5",ai3110:"lengthMeters0",ai3111:"lengthMeters1",ai3112:"lengthMeters2",ai3113:"lengthMeters3",ai3114:"lengthMeters4",ai3115:"lengthMeters5",ai3120:"widthMeters0",ai3121:"widthMeters1",ai3122:"widthMeters2",ai3123:"widthMeters3",ai3124:"widthMeters4",ai3125:"widthMeters5",ai3130:"heightMeters0",ai3131:"heightMeters1",ai3132:"heightMeters2",ai3133:"heightMeters3",ai3134:"heightMeters4",ai3135:"heightMeters5",ai3140:"areaSquareMeters0",ai3141:"areaSquareMeters1",ai3142:"areaSquareMeters2",ai3143:"areaSquareMeters3",ai3144:"areaSquareMeters4",ai3145:"areaSquareMeters5",ai3150:"netVolumeLiters0",ai3151:"netVolumeLiters1",ai3152:"netVolumeLiters2",ai3153:"netVolumeLiters3",ai3154:"netVolumeLiters4",ai3155:"netVolumeLiters5",ai3160:"netVolumeCubicMeters0",ai3161:"netVolumeCubicMeters1",ai3162:"netVolumeCubicMeters2",ai3163:"netVolumeCubicMeters3",ai3164:"netVolumeCubicMeters4",ai3165:"netVolumeCubicMeters5",ai3200:"netWeightLb0",ai3201:"netWeightLb1",ai3202:"netWeightLb2",ai3203:"netWeightLb3",ai3204:"netWeightLb4",ai3205:"netWeightLb5",ai3210:"lengthInches0",ai3211:"lengthInches1",ai3212:"lengthInches2",ai3213:"lengthInches3",ai3214:"lengthInches4",ai3215:"lengthInches5",ai3220:"lengthFeet0",ai3221:"lengthFeet1",ai3222:"lengthFeet2",ai3223:"lengthFeet3",ai3224:"lengthFeet4",ai3225:"lengthFeet5",ai3230:"lengthYards0",ai3231:"lengthYards1",ai3232:"lengthYards2",ai3233:"lengthYards3",ai3234:"lengthYards4",ai3235:"lengthYards5",ai3240:"widthInches0",ai3241:"widthInches1",ai3242:"widthInches2",ai3243:"widthInches3",ai3244:"widthInches4",ai3245:"widthInches5",ai3250:"widthFeet0",ai3251:"widthFeet1",ai3252:"widthFeet2",ai3253:"widthFeet3",ai3254:"widthFeet4",ai3255:"widthFeet5",ai3260:"widthYards0",ai3261:"widthYards1",ai3262:"widthYards2",ai3263:"widthYards3",ai3264:"widthYards4",ai3265:"widthYards5",ai3270:"heightInches0",ai3271:"heightInches1",ai3272:"heightInches2",ai3273:"heightInches3",ai3274:"heightInches4",ai3275:"heightInches5",ai3280:"heightFeet0",ai3281:"heightFeet1",ai3282:"heightFeet2",ai3283:"heightFeet3",ai3284:"heightFeet4",ai3285:"heightFeet5",ai3290:"heightYards0",ai3291:"heightYards1",ai3292:"heightYards2",ai3293:"heightYards3",ai3294:"heightYards4",ai3295:"heightYards5",ai3300:"grossWeightKg0",ai3301:"grossWeightKg1",ai3302:"grossWeightKg2",ai3303:"grossWeightKg3",ai3304:"grossWeightKg4",ai3305:"grossWeightKg5",ai3310:"lengthMetersLog0",ai3311:"lengthMetersLog1",ai3312:"lengthMetersLog2",ai3313:"lengthMetersLog3",ai3314:"lengthMetersLog4",ai3315:"lengthMetersLog5",ai3320:"widthMetersLog0",ai3321:"widthMetersLog1",ai3322:"widthMetersLog2",ai3323:"widthMetersLog3",ai3324:"widthMetersLog4",ai3325:"widthMetersLog5",ai3330:"heightMetersLog0",ai3331:"heightMetersLog1",ai3332:"heightMetersLog2",ai3333:"heightMetersLog3",ai3334:"heightMetersLog4",ai3335:"heightMetersLog5",ai3340:"areaSquareInches0",ai3341:"areaSquareInches1",ai3342:"areaSquareInches2",ai3343:"areaSquareInches3",ai3344:"areaSquareInches4",ai3345:"areaSquareInches5",ai3350:"areaSquareFeet0",ai3351:"areaSquareFeet1",ai3352:"areaSquareFeet2",ai3353:"areaSquareFeet3",ai3354:"areaSquareFeet4",ai3355:"areaSquareFeet5",ai3360:"areaSquareYards0",ai3361:"areaSquareYards1",ai3362:"areaSquareYards2",ai3363:"areaSquareYards3",ai3364:"areaSquareYards4",ai3365:"areaSquareYards5",ai3370:"areaSquareMetersLog0",ai3371:"areaSquareMetersLog1",ai3372:"areaSquareMetersLog2",ai3373:"areaSquareMetersLog3",ai3374:"areaSquareMetersLog4",ai3375:"areaSquareMetersLog5",ai3400:"netWeightOunces0",ai3401:"netWeightOunces1",ai3402:"netWeightOunces2",ai3403:"netWeightOunces3",ai3404:"netWeightOunces4",ai3405:"netWeightOunces5",ai3410:"netVolumeQuarts0",ai3411:"netVolumeQuarts1",ai3412:"netVolumeQuarts2",ai3413:"netVolumeQuarts3",ai3414:"netVolumeQuarts4",ai3415:"netVolumeQuarts5",ai3420:"netVolumeGallons0",ai3421:"netVolumeGallons1",ai3422:"netVolumeGallons2",ai3423:"netVolumeGallons3",ai3424:"netVolumeGallons4",ai3425:"netVolumeGallons5",ai3430:"volumeCubicInches0",ai3431:"volumeCubicInches1",ai3432:"volumeCubicInches2",ai3433:"volumeCubicInches3",ai3434:"volumeCubicInches4",ai3435:"volumeCubicInches5",ai3440:"volumeCubicFeet0",ai3441:"volumeCubicFeet1",ai3442:"volumeCubicFeet2",ai3443:"volumeCubicFeet3",ai3444:"volumeCubicFeet4",ai3445:"volumeCubicFeet5",ai3450:"volumeCubicYards0",ai3451:"volumeCubicYards1",ai3452:"volumeCubicYards2",ai3453:"volumeCubicYards3",ai3454:"volumeCubicYards4",ai3455:"volumeCubicYards5",ai3460:"volumeCubicMetersLog0",ai3461:"volumeCubicMetersLog1",ai3462:"volumeCubicMetersLog2",ai3463:"volumeCubicMetersLog3",ai3464:"volumeCubicMetersLog4",ai3465:"volumeCubicMetersLog5",ai3500:"grossWeightLb0",ai3501:"grossWeightLb1",ai3502:"grossWeightLb2",ai3503:"grossWeightLb3",ai3504:"grossWeightLb4",ai3505:"grossWeightLb5",ai3510:"lengthInchesLog0",ai3511:"lengthInchesLog1",ai3512:"lengthInchesLog2",ai3513:"lengthInchesLog3",ai3514:"lengthInchesLog4",ai3515:"lengthInchesLog5",ai3520:"lengthFeetLog0",ai3521:"lengthFeetLog1",ai3522:"lengthFeetLog2",ai3523:"lengthFeetLog3",ai3524:"lengthFeetLog4",ai3525:"lengthFeetLog5",ai3530:"lengthYardsLog0",ai3531:"lengthYardsLog1",ai3532:"lengthYardsLog2",ai3533:"lengthYardsLog3",ai3534:"lengthYardsLog4",ai3535:"lengthYardsLog5",ai3540:"widthInchesLog0",ai3541:"widthInchesLog1",ai3542:"widthInchesLog2",ai3543:"widthInchesLog3",ai3544:"widthInchesLog4",ai3545:"widthInchesLog5",ai3550:"widthFeetLog0",ai3551:"widthFeetLog1",ai3552:"widthFeetLog2",ai3553:"widthFeetLog3",ai3554:"widthFeetLog4",ai3555:"widthFeetLog5",ai3560:"widthYardsLog0",ai3561:"widthYardsLog1",ai3562:"widthYardsLog2",ai3563:"widthYardsLog3",ai3564:"widthYardsLog4",ai3565:"widthYardsLog5",ai3570:"heightInchesLog0",ai3571:"heightInchesLog1",ai3572:"heightInchesLog2",ai3573:"heightInchesLog3",ai3574:"heightInchesLog4",ai3575:"heightInchesLog5",ai3580:"heightFeetLog0",ai3581:"heightFeetLog1",ai3582:"heightFeetLog2",ai3583:"heightFeetLog3",ai3584:"heightFeetLog4",ai3585:"heightFeetLog5",ai3590:"heightYardsLog0",ai3591:"heightYardsLog1",ai3592:"heightYardsLog2",ai3593:"heightYardsLog3",ai3594:"heightYardsLog4",ai3595:"heightYardsLog5",ai3600:"grossWeightOunces0",ai3601:"grossWeightOunces1",ai3602:"grossWeightOunces2",ai3603:"grossWeightOunces3",ai3604:"grossWeightOunces4",ai3605:"grossWeightOunces5",ai3610:"netVolumeFluidOunces0",ai3611:"netVolumeFluidOunces1",ai3612:"netVolumeFluidOunces2",ai3613:"netVolumeFluidOunces3",ai3614:"netVolumeFluidOunces4",ai3615:"netVolumeFluidOunces5",ai3620:"grossVolumeQuarts0",ai3621:"grossVolumeQuarts1",ai3622:"grossVolumeQuarts2",ai3623:"grossVolumeQuarts3",ai3624:"grossVolumeQuarts4",ai3625:"grossVolumeQuarts5",ai3630:"grossVolumeGallons0",ai3631:"grossVolumeGallons1",ai3632:"grossVolumeGallons2",ai3633:"grossVolumeGallons3",ai3634:"grossVolumeGallons4",ai3635:"grossVolumeGallons5",ai3640:"volumeCubicInchesLog0",ai3641:"volumeCubicInchesLog1",ai3642:"volumeCubicInchesLog2",ai3643:"volumeCubicInchesLog3",ai3644:"volumeCubicInchesLog4",ai3645:"volumeCubicInchesLog5",ai3650:"volumeCubicFeetLog0",ai3651:"volumeCubicFeetLog1",ai3652:"volumeCubicFeetLog2",ai3653:"volumeCubicFeetLog3",ai3654:"volumeCubicFeetLog4",ai3655:"volumeCubicFeetLog5",ai3660:"volumeCubicYardsLog0",ai3661:"volumeCubicYardsLog1",ai3662:"volumeCubicYardsLog2",ai3663:"volumeCubicYardsLog3",ai3664:"volumeCubicYardsLog4",ai3665:"volumeCubicYardsLog5",ai37:"count",ai3900:"amountPayable0",ai3901:"amountPayable1",ai3902:"amountPayable2",ai3903:"amountPayable3",ai3904:"amountPayable4",ai3905:"amountPayable5",ai3910:"amountPayableISO0",ai3911:"amountPayableISO1",ai3912:"amountPayableISO2",ai3913:"amountPayableISO3",ai3914:"amountPayableISO4",ai3915:"amountPayableISO5",ai3920:"price0",ai3921:"price1",ai3922:"price2",ai3923:"price3",ai3930:"priceISO0",ai3931:"priceISO1",ai3932:"priceISO2",ai3933:"priceISO3",ai3940:"percentDiscount0",ai3941:"percentDiscount1",ai3942:"percentDiscount2",ai3943:"percentDiscount3",ai3950:"pricePerUnitMeasure0",ai3951:"pricePerUnitMeasure1",ai3952:"pricePerUnitMeasure2",ai3953:"pricePerUnitMeasure3",ai3954:"pricePerUnitMeasure4",ai3955:"pricePerUnitMeasure5",ai400:"orderNumber",ai401:"ginc",ai402:"gsin",ai403:"route",ai410:"shipTo",ai411:"billTo",ai412:"purchaseFrom",ai413:"shipFor",ai414:"locNo",ai415:"payTo",ai416:"prodServLoc",ai417:"party",ai420:"shipToPost",ai421:"shipToPostISO",ai422:"origin",ai423:"countryInitialProcess",ai424:"countryProcess",ai425:"countryDisassembly",ai426:"countryFullProcess",ai427:"originSubdivision",ai7001:"nsn",ai7002:"meatCut",ai7003:"expirationDateTime",ai7004:"activePotency",ai7005:"catchArea",ai7006:"firstFreezeDate",ai7007:"harvestDate",ai7008:"aquaticSpecies",ai7009:"fishingGearType",ai7010:"prodMethod",ai7020:"refurbLot",ai7021:"funcStat",ai7022:"revStat",ai7023:"giaiAssembly",ai7030:"processor",ai7031:"processor2",ai7032:"processor3",ai7033:"processor4",ai7034:"processor5",ai7035:"processor6",ai7036:"processor7",ai7037:"processor8",ai7038:"processor9",ai7039:"processor10",ai7040:"uicExt",ai7041:"ufrgtUnitType",ai710:"nhrnPzn",ai711:"nhrnCip",ai712:"nhrnCn",ai713:"nhrnDrn",ai714:"nhrnAim",ai715:"nhrnDnc",ai716:"nhrnAic",ai8001:"rollProducts",ai8002:"cmtNo",ai8003:"grai",ai8004:"giai",ai8005:"pricePerUnit",ai8006:"itip",ai8007:"iban",ai8008:"prodTime",ai8009:"opticalSensor",ai8010:"cpid",ai8011:"cpidSerial",ai8012:"version",ai8013:"gmn",ai8017:"gsrnProvider",ai8018:"gsrnRecipient",ai8019:"srin",ai8020:"refNo",ai8026:"itipContent",ai8030:"digSig",ai8110:"coupon",ai8111:"points",ai8112:"couponExtended",ai8200:"productURL",ai90:"internal1",ai91:"internal2",ai92:"internal3",ai93:"internal4",ai94:"internal5",ai95:"internal6",ai96:"internal7",ai97:"internal8",ai98:"internal9",ai99:"internal10"};var h=String.fromCodePoint(29),l=/^\d+$/;var A=class extends Error{static{r(this,"InternalError")}constructor(I,E){super(I),this.name="InternalError",this.code=I,this.ex=E}ex;code},R=class extends Error{static{r(this,"InvalidAiError")}constructor(I,E){let S;I?S=`Invalid AI identifier "${E}" after "${I}"`:S=`Invalid first AI identifier "${E}"`,super(S),this.name="InvalidAiError"}},G=class extends Error{static{r(this,"BarcodeError")}constructor(I,E,S){super(S),this.name="BarcodeError",this.num=I,this.code=E,this.des=S}num;code;des},H=class{static{r(this,"ParsedElementClass")}ai;dataTitle;data;dataString;unit;constructor(I,E,S){switch(this.ai=I,this.dataTitle=E,this.unit="",this.dataString="",S){case"S":this.data="";break;case"N":this.data=0;break;case"D":this.data=new Date,this.data.setHours(0,0,0,0);break;default:this.data="";break}}},M=class{constructor(I,E,S={}){this.codeName=I;this.denormalized=E;this.data=S}static{r(this,"DecodeResult")}};function F(_,I){let E=_,S=E.slice(0,1);for(;S===I;)E=E.slice(1),S=E.slice(0,1);return E}r(F,"cleanCodestring");function g(_,I,E){if(I<0||I>11)return!1;let S=I;E===0&&S++;let t=new Date(_,S,E);return t.getFullYear()===_&&t.getMonth()===I&&(t.getDate()===E||E===0)}r(g,"checkValidDate");function o(_,I){let E=_.length-I,S=_.slice(0,E)+"."+_.slice(E);try{return Number.parseFloat(S)}catch(t){throw new A("36",t)}}r(o,"parseFloatingPoint");function n(_,I,E){let S=new H(_,I,"D"),t=_.length,a=E.slice(t,t+6),e=0,L=0,O=0;try{e=Number.parseInt(a.slice(0,2),10)}catch(N){throw new A("33",N)}try{L=Number.parseInt(a.slice(2,4),10)-1}catch(N){throw new A("34",N)}try{O=Number.parseInt(a.slice(4,6),10)}catch(N){throw new A("35",N)}if(e>50?e=e+1900:e=e+2e3,!g(e,L,O))throw new G(7,"36",`Invalid date "${a}" for AI "${_}".`);return O===0&&L++,S.data.setFullYear(e,L,O),S.dataString=a,{element:S,codestring:E.slice(t+6,E.length)}}r(n,"parseDate");function s(_,I,E,S,t=!1){let a=new H(_,I,"S"),e=_.length,L=S.slice(e,E+e);if(L.length<E)throw new G(9,"37",`Data length ${L.length} is less than expected length ${E} for AI "${_}".`);if(t&&!l.test(L))throw new G(11,"39",`Numeric data expected for AI "${_}", but got "${L}".`);a.data=L,a.dataString=L;let O=S.slice(E+e,S.length);return{element:a,codestring:O}}r(s,"parseFixedLength");function T(_,I,E,S,t,a=!1){let e=new H(_,I,"S"),L=_.length,O=E.indexOf(S),N="";if(O===-1?t&&t>0?(e.data=E.slice(L,t+L),N=E.replace(_+e.data,"")):e.data=E.slice(L,E.length):(e.data=E.slice(L,O),N=E.slice(O+1,E.length)),e.data==="")throw new G(10,"38",`Variable length data for AI "${_}" is empty.`);if(a&&!l.test(e.data))throw new G(11,"39",`Numeric data expected for AI "${_}", but got "${e.data}".`);return e.dataString=e.data,{element:e,codestring:N}}r(T,"parseVariableLength");function c(_,I,E,S,t,a){let e=new H(_+I,E,"N"),L=_.length+1,O=t.indexOf(a),N=Number.parseInt(I,10),u="",U="";return O===-1?u=t.slice(L,t.length):(u=t.slice(L,O),U=t.slice(O+1,t.length)),e.data=o(u,N),e.dataString=u,e.unit=S,{element:e,codestring:U}}r(c,"parseVariableLengthMeasure");function i(_,I,E,S,t){let a=new H(_+I,E,"N"),e=_.length+1;if(!l.test(I))throw new R(_,I);let L=Number.parseInt(I,10),O=t.slice(e,e+6);if(!l.test(O))throw new G(11,"39",`Numeric data expected for AI "${_+I}", but got "${O}".`);a.data=o(O,L),a.dataString=O,a.unit=S;let N=t.slice(e+6,t.length);return{element:a,codestring:N}}r(i,"parseFixedLengthMeasure");function P(_,I,E,S,t){let a=new H(_+I,E,"N"),e=_.length+1,L=S.indexOf(t),O=Number.parseInt(I,10),N="",u="",U="";return L===-1?N=S.slice(e,S.length):(N=S.slice(e,L),U=S.slice(L+1,S.length)),u=N.slice(3,N.length),a.data=o(u,O),a.dataString=u,a.unit=N.slice(0,3),{element:a,codestring:U}}r(P,"parseVariableLengthWithISONumbers");function V(_,I,E,S){let t=new H(_,I,"S"),a=_.length,e=E.indexOf(S),L="",O="";return e===-1?L=E.slice(a,E.length):(L=E.slice(a,e),O=E.slice(e+1,E.length)),t.data=L.slice(3,L.length),t.unit=L.slice(0,3),t.dataString=L,{element:t,codestring:O}}r(V,"parseVariableLengthWithISOChars");function f(_,I,E){E||(E=h);let S=_.slice(0,1),t=_.slice(1,2),a="",e="";switch(S){case"0":switch(t){case"0":return s("00","SSCC",18,_,!0);case"1":return s("01","GTIN",14,_,!0);case"2":return s("02","CONTENT",14,_);case"3":return s("03","MTO GTIN",14,_);default:throw new R("0",t)}case"1":switch(t){case"0":return T("10","BATCH/LOT",_,E,I??20);case"1":return n("11","PROD DATE",_);case"2":return n("12","DUE DATE",_);case"3":return n("13","PACK DATE",_);case"5":return n("15","BEST BEFORE or BEST BY",_);case"6":return n("16","SELL BY",_);case"7":return n("17","USE BY OR EXPIRY",_);default:throw new R("1",t)}case"2":switch(t){case"0":return s("20","VARIANT",2,_);case"1":return T("21","SERIAL",_,E,I??20);case"2":return T("22","CPV",_,E,20);case"3":switch(a=_.slice(2,3),a){case"5":return T("235","TPX",_,E,28);default:throw new R("23",a)}case"4":switch(a=_.slice(2,3),a){case"0":return T("240","ADDITIONAL ID",_,E,30);case"1":return T("241","CUST. PART NO.",_,E,30);case"2":return T("242","MTO VARIANT",_,E,6,!0);case"3":return T("243","PCN",_,E,20);default:throw new R("24",a)}case"5":switch(a=_.slice(2,3),a){case"0":return T("250","SECONDARY SERIAL",_,E,30);case"1":return T("251","REF. TO SOURCE",_,E,30);case"3":return T("253","GDTI",_,E,42);case"4":return T("254","GLN EXTENSION COMPONENT",_,E,20);case"5":return T("255","GCN",_,E,25,!0);default:throw new R("25",a)}default:throw new R("2",t)}case"3":switch(t){case"0":return T("30","VAR. COUNT",_,E,8,!0);case"1":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return i("310",e,"NET WEIGHT (kg)","KGM",_);case"1":return i("311",e,"LENGTH (m)","MTR",_);case"2":return i("312",e,"WIDTH (m)","MTR",_);case"3":return i("313",e,"HEIGHT (m)","MTR",_);case"4":return i("314",e,"AREA (m2)","MTK",_);case"5":return i("315",e,"NET VOLUME (l)","LTR",_);case"6":return i("316",e,"NET VOLUME (m3)","MTQ",_);default:throw new R("31",a)}case"2":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return i("320",e,"NET WEIGHT (lb)","LBR",_);case"1":return i("321",e,"LENGTH (i)","INH",_);case"2":return i("322",e,"LENGTH (f)","FOT",_);case"3":return i("323",e,"LENGTH (y)","YRD",_);case"4":return i("324",e,"WIDTH (i)","INH",_);case"5":return i("325",e,"WIDTH (f)","FOT",_);case"6":return i("326",e,"WIDTH (y)","YRD",_);case"7":return i("327",e,"HEIGHT (i)","INH",_);case"8":return i("328",e,"HEIGHT (f)","FOT",_);case"9":return i("329",e,"HEIGHT (y)","YRD",_);default:throw new R("32",a)}case"3":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return i("330",e,"GROSS WEIGHT (kg)","KGM",_);case"1":return i("331",e,"LENGTH (m), log","MTR",_);case"2":return i("332",e,"WIDTH (m), log","MTR",_);case"3":return i("333",e,"HEIGHT (m), log","MTR",_);case"4":return i("334",e,"AREA (m2), log","MTK",_);case"5":return i("335",e,"VOLUME (l), log","LTR",_);case"6":return i("336",e,"VOLUME (m3), log","MTQ",_);case"7":return i("337",e,"KG PER m\xB2","28",_);default:throw new R("33",a)}case"4":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return i("340",e,"GROSS WEIGHT (lb)","LBR",_);case"1":return i("341",e,"LENGTH (i), log","INH",_);case"2":return i("342",e,"LENGTH (f), log","FOT",_);case"3":return i("343",e,"LENGTH (y), log","YRD",_);case"4":return i("344",e,"WIDTH (i), log","INH",_);case"5":return i("345",e,"WIDTH (f), log","FOT",_);case"6":return i("346",e,"WIDTH (y), log","YRD",_);case"7":return i("347",e,"HEIGHT (i), log","INH",_);case"8":return i("348",e,"HEIGHT (f), log","FOT",_);case"9":return i("349",e,"HEIGHT (y), log","YRD",_);default:throw new R("33",a)}case"5":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return i("350",e,"AREA (i2)","INK",_);case"1":return i("351",e,"AREA (f2)","FTK",_);case"2":return i("352",e,"AREA (y2)","YDK",_);case"3":return i("353",e,"AREA (i2), log","INK",_);case"4":return i("354",e,"AREA (f2), log","FTK",_);case"5":return i("355",e,"AREA (y2), log","YDK",_);case"6":return i("356",e,"NET WEIGHT (t)","APZ",_);case"7":return i("357",e,"NET VOLUME (oz)","ONZ",_);default:throw new R("35",a)}case"6":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return i("360",e,"NET VOLUME (q)","QT",_);case"1":return i("361",e,"NET VOLUME (g)","GLL",_);case"2":return i("362",e,"VOLUME (q), log","QT",_);case"3":return i("363",e,"VOLUME (g), log","GLL",_);case"4":return i("364",e,"VOLUME (i3)","INQ",_);case"5":return i("365",e,"VOLUME (f3)","FTQ",_);case"6":return i("366",e,"VOLUME (y3)","YDQ",_);case"7":return i("367",e,"VOLUME (i3), log","INQ",_);case"8":return i("368",e,"VOLUME (f3), log","FTQ",_);case"9":return i("369",e,"VOLUME (y3), log","YDQ",_);default:throw new R("36",a)}case"7":return T("37","COUNT",_,E,8);case"9":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return c("390",e,"AMOUNT","",_,E);case"1":return P("391",e,"AMOUNT",_,E);case"2":return c("392",e,"PRICE","",_,E);case"3":return P("393",e,"PRICE",_,E);default:throw new R("39",a)}default:throw new R("3",t)}case"4":switch(t){case"0":switch(a=_.slice(2,3),a){case"0":return T("400","ORDER NUMBER",_,E,30);case"1":return T("401","GINC",_,E);case"2":return T("402","GSIN",_,E,17,!0);case"3":return T("403","ROUTE",_,E,30);default:throw new R("40",a)}case"1":switch(a=_.slice(2,3),a){case"0":return s("410","SHIP TO LOC",13,_,!0);case"1":return s("411","BILL TO",13,_,!0);case"2":return s("412","PURCHASE FROM",13,_,!0);case"3":return s("413","SHIP FOR LOC",13,_,!0);case"4":return s("414","LOC NO",13,_,!0);case"5":return s("415","PAY TO",13,_,!0);case"6":return s("416","PROD/SERV LOC",13,_,!0);case"7":return s("417","PARTY",13,_,!0);default:throw new R("41",a)}case"2":switch(a=_.slice(2,3),a){case"0":return T("420","SHIP TO POST",_,E,20);case"1":return V("421","SHIP TO POST",_,E);case"2":return s("422","ORIGIN",3,_,!0);case"3":return T("423","COUNTRY - INITIAL PROCESS.",_,E,15);case"4":return s("424","COUNTRY - PROCESS.",3,_,!0);case"5":return s("425","COUNTRY - DISASSEMBLY",3,_,!0);case"6":return s("426","COUNTRY - FULL PROCESS",3,_,!0);case"7":return T("427","ORIGIN SUBDIVISION",_,E,3);default:throw new R("42",a)}default:throw new R("4",t)}case"7":switch(t){case"0":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":switch(e){case"1":return T("7001","NSN",_,E,13,!0);case"2":return T("7002","MEAT CUT",_,E);case"3":return T("7003","EXPIRY TIME",_,E,10,!0);case"4":return T("7004","ACTIVE POTENCY",_,E,4,!0);case"5":return T("7005","CATCH AREA",_,E,12);case"6":return n("7006","FIRST FREEZE DATE",_);case"7":return T("7007","HARVEST DATE",_,E,12,!0);case"8":return T("7008","AQUATIC SPECIES",_,E,3);case"9":return T("7009","FISHING GEAR TYPE",_,E,10);default:throw new R("700",e)}case"1":switch(e){case"0":return T("7010","PROD METHOD",_,E,2);case"1":return T("7011","TEST BY DATE",_,E,10,!0);default:throw new R("701",e)}case"2":switch(e){case"0":return T("7020","REFURB LOT",_,E,20);case"1":return T("7021","FUNC STAT",_,E,20);case"2":return T("7022","REV STAT",_,E,20);case"3":return T("7023","GIAI - ASSEMBLY",_,E,30);default:throw new R("702",e)}case"3":return V("703"+e,"PROCESSOR # "+e,_,E);default:throw new R("70",a)}case"1":switch(a=_.slice(2,3),a){case"0":return T("710","NHRN PZN",_,E);case"1":return T("711","NHRN CIP",_,E);case"2":return T("712","NHRN CN",_,E);case"3":return T("713","NHRN DRN",_,E);case"4":return T("714","NHRN AIM",_,E);case"5":return T("715","NHRN NDC",_,E);case"6":return T("716","NHRN AIC",_,E);default:throw new R("71",a)}default:throw new R("7",t)}case"8":switch(t){case"0":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":switch(e){case"1":return T("8001","DIMENSIONS",_,E,14);case"2":return T("8002","CMT No",_,E);case"3":return T("8003","GRAI",_,E);case"4":return T("8004","GIAI",_,E);case"5":return T("8005","PRICE PER UNIT",_,E,6);case"6":return T("8006","GCTIN",_,E,18);case"7":return T("8007","IBAN",_,E);case"8":return T("8008","PROD TIME",_,E,12);default:throw new R("800",e)}case"1":switch(e){case"0":return T("8010","CPID",_,E);case"1":return T("8011","CPID SERIAL",_,E);case"7":return T("8017","GSRN - PROVIDER",_,E,18);case"8":return T("8018","GSRN - RECIPIENT",_,E,18,!0);case"9":return T("8019","SRIN",_,E,void 0,!0);default:throw new R("801",e)}case"2":switch(e){case"0":return T("8020","REF No",_,E);case"6":return T("8026","ITIP CONTENT",_,E,18,!0);default:throw new R("802",e)}case"3":switch(e){case"0":return T("8030","DIGSIG",_,E);default:throw new R("803",e)}default:throw new R("80",a)}case"1":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"1":switch(e){case"0":return T("8110","-",_,E);case"1":return T("8111","POINTS",_,E,4,!0);case"2":return T("8112","-",_,E);default:throw new R("811",e)}default:throw new R("81",a)}case"2":switch(a=_.slice(2,3),a){case"0":return T("8200","PRODUCT URL",_,E);default:throw new R("82",a)}default:throw new R("8",t)}case"9":switch(t){case"0":return T("90","INTERNAL",_,E,30);case"1":return T("91","INTERNAL",_,E);case"2":return T("92","INTERNAL",_,E);case"3":return T("93","INTERNAL",_,E);case"4":return T("94","INTERNAL",_,E);case"5":return T("95","INTERNAL",_,E);case"6":return T("96","INTERNAL",_,E);case"7":return T("97","INTERNAL",_,E);case"8":return T("98","INTERNAL",_,E);case"9":return T("99","INTERNAL",_,E);default:throw new R("9",t)}default:throw new R("",S)}}r(f,"identifyAI");function Y(_,I,E){if(!_||typeof _!="string")throw new G(2,"31","The barcode is empty or not a string.");let S=_.length,t={codeName:"",denormalized:"",parsedCodeItems:[]},a="",e=_.slice(0,3),L;switch(e){case"]C1":t.codeName="GS1-128",a=_.slice(3,S);break;case"]e0":t.codeName="GS1 DataBar",a=_.slice(3,S);break;case"]e1":case"]e2":t.codeName="GS1 Composite",a=_.slice(3,S);break;case"]d2":t.codeName="GS1 DataMatrix",a=_.slice(3,S);break;case"]Q3":t.codeName="GS1 QR Code",a=_.slice(3,S);break;default:t.codeName="",a=_;break}for(t.parsedCodeItems=[];a.length>0;)try{L=f(a,E),a=F(L.codestring,I),t.parsedCodeItems.push(L.element),t.denormalized+="("+L.element.ai+")"+L.element.dataString}catch(O){if(O instanceof A)v(O);else throw O}return t}r(Y,"parseBarcode");function v(_){switch(_.code){case"32":throw new G(6,32,"Invalid normal AI.");case"33":throw new G(7,33,"The year of the date is not valid.");case"34":throw new G(7,34,"The month of the date is not valid.");case"36":throw new G(8,36,"Invalid numbers");default:throw _}}r(v,"handleInternalError");var D=class{static{r(this,"GS1Parser")}fncChar;lotLen;constructor(I){this.fncChar=I?.fncChar||h,this.lotLen=I?.lotMaxLength}decode(I){let E=I.replaceAll("(",this.fncChar).replaceAll(")","");E.startsWith(this.fncChar)&&(E=E.slice(1));let S=Y(E,this.fncChar,this.lotLen),t={};for(let a of S.parsedCodeItems){let e=m["ai"+a.ai];e&&(t[e]=a)}return new M(S.codeName,S.denormalized,t)}};0&&(module.exports={GS1Parser});
1
+ "use strict";var D=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var N=(E,I)=>D(E,"name",{value:I,configurable:!0});var d=(E,I)=>{for(var e in I)D(E,e,{get:I[e],enumerable:!0})},Q=(E,I,e,i)=>{if(I&&typeof I=="object"||typeof I=="function")for(let S of p(I))!b.call(E,S)&&S!==e&&D(E,S,{get:()=>I[S],enumerable:!(i=B(I,S))||i.enumerable});return E};var f=E=>Q(D({},"__esModule",{value:!0}),E);var K={};d(K,{DecodeResult:()=>l,GS1Field:()=>c,GS1Parser:()=>o});module.exports=f(K);var c=(_=>(_.SSCC="sscc",_.GTIN="gtin",_.CONTENT="content",_.BATCH="batch",_.PROD_DATE="prodDate",_.DUE_DATE="dueDate",_.PACK_DATE="packDate",_.BEST_BEFORE="bestBefore",_.SELL_BY="sellBy",_.EXP_DATE="expDate",_.VARIANT="variant",_.SERIAL="serial",_.HIBCC="hibcc",_.TPX="tpx",_.ADDITIONAL_PRODUCT_ID="additionalProductID",_.CUSTOMER_PART_NUMBER="customerPartNumber",_.MADE_TO_ORDER="madeToOrder",_.PACKAGING="packaging",_.SECONDARY_SERIAL_NUMBER="secondarySerialNumber",_.REF_SOURCE="refSource",_.GDTI="gdti",_.GLN_EXTENSION="glnExtension",_.GCN="gcn",_.VARIABLE_COUNT="variableCount",_.NET_WEIGHT_KG_0="netWeightKg0",_.NET_WEIGHT_KG_1="netWeightKg1",_.NET_WEIGHT_KG_2="netWeightKg2",_.NET_WEIGHT_KG_3="netWeightKg3",_.NET_WEIGHT_KG_4="netWeightKg4",_.NET_WEIGHT_KG_5="netWeightKg5",_.LENGTH_METERS_0="lengthMeters0",_.LENGTH_METERS_1="lengthMeters1",_.LENGTH_METERS_2="lengthMeters2",_.LENGTH_METERS_3="lengthMeters3",_.LENGTH_METERS_4="lengthMeters4",_.LENGTH_METERS_5="lengthMeters5",_.WIDTH_METERS_0="widthMeters0",_.WIDTH_METERS_1="widthMeters1",_.WIDTH_METERS_2="widthMeters2",_.WIDTH_METERS_3="widthMeters3",_.WIDTH_METERS_4="widthMeters4",_.WIDTH_METERS_5="widthMeters5",_.HEIGHT_METERS_0="heightMeters0",_.HEIGHT_METERS_1="heightMeters1",_.HEIGHT_METERS_2="heightMeters2",_.HEIGHT_METERS_3="heightMeters3",_.HEIGHT_METERS_4="heightMeters4",_.HEIGHT_METERS_5="heightMeters5",_.AREA_SQUARE_METERS_0="areaSquareMeters0",_.AREA_SQUARE_METERS_1="areaSquareMeters1",_.AREA_SQUARE_METERS_2="areaSquareMeters2",_.AREA_SQUARE_METERS_3="areaSquareMeters3",_.AREA_SQUARE_METERS_4="areaSquareMeters4",_.AREA_SQUARE_METERS_5="areaSquareMeters5",_.NET_VOLUME_LITERS_0="netVolumeLiters0",_.NET_VOLUME_LITERS_1="netVolumeLiters1",_.NET_VOLUME_LITERS_2="netVolumeLiters2",_.NET_VOLUME_LITERS_3="netVolumeLiters3",_.NET_VOLUME_LITERS_4="netVolumeLiters4",_.NET_VOLUME_LITERS_5="netVolumeLiters5",_.NET_VOLUME_CUBIC_METERS_0="netVolumeCubicMeters0",_.NET_VOLUME_CUBIC_METERS_1="netVolumeCubicMeters1",_.NET_VOLUME_CUBIC_METERS_2="netVolumeCubicMeters2",_.NET_VOLUME_CUBIC_METERS_3="netVolumeCubicMeters3",_.NET_VOLUME_CUBIC_METERS_4="netVolumeCubicMeters4",_.NET_VOLUME_CUBIC_METERS_5="netVolumeCubicMeters5",_.NET_WEIGHT_LB_0="netWeightLb0",_.NET_WEIGHT_LB_1="netWeightLb1",_.NET_WEIGHT_LB_2="netWeightLb2",_.NET_WEIGHT_LB_3="netWeightLb3",_.NET_WEIGHT_LB_4="netWeightLb4",_.NET_WEIGHT_LB_5="netWeightLb5",_.LENGTH_INCHES_0="lengthInches0",_.LENGTH_INCHES_1="lengthInches1",_.LENGTH_INCHES_2="lengthInches2",_.LENGTH_INCHES_3="lengthInches3",_.LENGTH_INCHES_4="lengthInches4",_.LENGTH_INCHES_5="lengthInches5",_.LENGTH_FEET_0="lengthFeet0",_.LENGTH_FEET_1="lengthFeet1",_.LENGTH_FEET_2="lengthFeet2",_.LENGTH_FEET_3="lengthFeet3",_.LENGTH_FEET_4="lengthFeet4",_.LENGTH_FEET_5="lengthFeet5",_.LENGTH_YARDS_0="lengthYards0",_.LENGTH_YARDS_1="lengthYards1",_.LENGTH_YARDS_2="lengthYards2",_.LENGTH_YARDS_3="lengthYards3",_.LENGTH_YARDS_4="lengthYards4",_.LENGTH_YARDS_5="lengthYards5",_.WIDTH_INCHES_0="widthInches0",_.WIDTH_INCHES_1="widthInches1",_.WIDTH_INCHES_2="widthInches2",_.WIDTH_INCHES_3="widthInches3",_.WIDTH_INCHES_4="widthInches4",_.WIDTH_INCHES_5="widthInches5",_.WIDTH_FEET_0="widthFeet0",_.WIDTH_FEET_1="widthFeet1",_.WIDTH_FEET_2="widthFeet2",_.WIDTH_FEET_3="widthFeet3",_.WIDTH_FEET_4="widthFeet4",_.WIDTH_FEET_5="widthFeet5",_.WIDTH_YARDS_0="widthYards0",_.WIDTH_YARDS_1="widthYards1",_.WIDTH_YARDS_2="widthYards2",_.WIDTH_YARDS_3="widthYards3",_.WIDTH_YARDS_4="widthYards4",_.WIDTH_YARDS_5="widthYards5",_.HEIGHT_INCHES_0="heightInches0",_.HEIGHT_INCHES_1="heightInches1",_.HEIGHT_INCHES_2="heightInches2",_.HEIGHT_INCHES_3="heightInches3",_.HEIGHT_INCHES_4="heightInches4",_.HEIGHT_INCHES_5="heightInches5",_.HEIGHT_FEET_0="heightFeet0",_.HEIGHT_FEET_1="heightFeet1",_.HEIGHT_FEET_2="heightFeet2",_.HEIGHT_FEET_3="heightFeet3",_.HEIGHT_FEET_4="heightFeet4",_.HEIGHT_FEET_5="heightFeet5",_.HEIGHT_YARDS_0="heightYards0",_.HEIGHT_YARDS_1="heightYards1",_.HEIGHT_YARDS_2="heightYards2",_.HEIGHT_YARDS_3="heightYards3",_.HEIGHT_YARDS_4="heightYards4",_.HEIGHT_YARDS_5="heightYards5",_.GROSS_WEIGHT_KG_0="grossWeightKg0",_.GROSS_WEIGHT_KG_1="grossWeightKg1",_.GROSS_WEIGHT_KG_2="grossWeightKg2",_.GROSS_WEIGHT_KG_3="grossWeightKg3",_.GROSS_WEIGHT_KG_4="grossWeightKg4",_.GROSS_WEIGHT_KG_5="grossWeightKg5",_.LENGTH_METERS_LOG_0="lengthMetersLog0",_.LENGTH_METERS_LOG_1="lengthMetersLog1",_.LENGTH_METERS_LOG_2="lengthMetersLog2",_.LENGTH_METERS_LOG_3="lengthMetersLog3",_.LENGTH_METERS_LOG_4="lengthMetersLog4",_.LENGTH_METERS_LOG_5="lengthMetersLog5",_.WIDTH_METERS_LOG_0="widthMetersLog0",_.WIDTH_METERS_LOG_1="widthMetersLog1",_.WIDTH_METERS_LOG_2="widthMetersLog2",_.WIDTH_METERS_LOG_3="widthMetersLog3",_.WIDTH_METERS_LOG_4="widthMetersLog4",_.WIDTH_METERS_LOG_5="widthMetersLog5",_.HEIGHT_METERS_LOG_0="heightMetersLog0",_.HEIGHT_METERS_LOG_1="heightMetersLog1",_.HEIGHT_METERS_LOG_2="heightMetersLog2",_.HEIGHT_METERS_LOG_3="heightMetersLog3",_.HEIGHT_METERS_LOG_4="heightMetersLog4",_.HEIGHT_METERS_LOG_5="heightMetersLog5",_.AREA_SQUARE_INCHES_0="areaSquareInches0",_.AREA_SQUARE_INCHES_1="areaSquareInches1",_.AREA_SQUARE_INCHES_2="areaSquareInches2",_.AREA_SQUARE_INCHES_3="areaSquareInches3",_.AREA_SQUARE_INCHES_4="areaSquareInches4",_.AREA_SQUARE_INCHES_5="areaSquareInches5",_.AREA_SQUARE_FEET_0="areaSquareFeet0",_.AREA_SQUARE_FEET_1="areaSquareFeet1",_.AREA_SQUARE_FEET_2="areaSquareFeet2",_.AREA_SQUARE_FEET_3="areaSquareFeet3",_.AREA_SQUARE_FEET_4="areaSquareFeet4",_.AREA_SQUARE_FEET_5="areaSquareFeet5",_.AREA_SQUARE_YARDS_0="areaSquareYards0",_.AREA_SQUARE_YARDS_1="areaSquareYards1",_.AREA_SQUARE_YARDS_2="areaSquareYards2",_.AREA_SQUARE_YARDS_3="areaSquareYards3",_.AREA_SQUARE_YARDS_4="areaSquareYards4",_.AREA_SQUARE_YARDS_5="areaSquareYards5",_.AREA_SQUARE_METERS_LOG_0="areaSquareMetersLog0",_.AREA_SQUARE_METERS_LOG_1="areaSquareMetersLog1",_.AREA_SQUARE_METERS_LOG_2="areaSquareMetersLog2",_.AREA_SQUARE_METERS_LOG_3="areaSquareMetersLog3",_.AREA_SQUARE_METERS_LOG_4="areaSquareMetersLog4",_.AREA_SQUARE_METERS_LOG_5="areaSquareMetersLog5",_.NET_WEIGHT_OUNCES_0="netWeightOunces0",_.NET_WEIGHT_OUNCES_1="netWeightOunces1",_.NET_WEIGHT_OUNCES_2="netWeightOunces2",_.NET_WEIGHT_OUNCES_3="netWeightOunces3",_.NET_WEIGHT_OUNCES_4="netWeightOunces4",_.NET_WEIGHT_OUNCES_5="netWeightOunces5",_.NET_VOLUME_QUARTS_0="netVolumeQuarts0",_.NET_VOLUME_QUARTS_1="netVolumeQuarts1",_.NET_VOLUME_QUARTS_2="netVolumeQuarts2",_.NET_VOLUME_QUARTS_3="netVolumeQuarts3",_.NET_VOLUME_QUARTS_4="netVolumeQuarts4",_.NET_VOLUME_QUARTS_5="netVolumeQuarts5",_.NET_VOLUME_GALLONS_0="netVolumeGallons0",_.NET_VOLUME_GALLONS_1="netVolumeGallons1",_.NET_VOLUME_GALLONS_2="netVolumeGallons2",_.NET_VOLUME_GALLONS_3="netVolumeGallons3",_.NET_VOLUME_GALLONS_4="netVolumeGallons4",_.NET_VOLUME_GALLONS_5="netVolumeGallons5",_.VOLUME_CUBIC_INCHES_0="volumeCubicInches0",_.VOLUME_CUBIC_INCHES_1="volumeCubicInches1",_.VOLUME_CUBIC_INCHES_2="volumeCubicInches2",_.VOLUME_CUBIC_INCHES_3="volumeCubicInches3",_.VOLUME_CUBIC_INCHES_4="volumeCubicInches4",_.VOLUME_CUBIC_INCHES_5="volumeCubicInches5",_.VOLUME_CUBIC_FEET_0="volumeCubicFeet0",_.VOLUME_CUBIC_FEET_1="volumeCubicFeet1",_.VOLUME_CUBIC_FEET_2="volumeCubicFeet2",_.VOLUME_CUBIC_FEET_3="volumeCubicFeet3",_.VOLUME_CUBIC_FEET_4="volumeCubicFeet4",_.VOLUME_CUBIC_FEET_5="volumeCubicFeet5",_.VOLUME_CUBIC_YARDS_0="volumeCubicYards0",_.VOLUME_CUBIC_YARDS_1="volumeCubicYards1",_.VOLUME_CUBIC_YARDS_2="volumeCubicYards2",_.VOLUME_CUBIC_YARDS_3="volumeCubicYards3",_.VOLUME_CUBIC_YARDS_4="volumeCubicYards4",_.VOLUME_CUBIC_YARDS_5="volumeCubicYards5",_.VOLUME_CUBIC_METERS_LOG_0="volumeCubicMetersLog0",_.VOLUME_CUBIC_METERS_LOG_1="volumeCubicMetersLog1",_.VOLUME_CUBIC_METERS_LOG_2="volumeCubicMetersLog2",_.VOLUME_CUBIC_METERS_LOG_3="volumeCubicMetersLog3",_.VOLUME_CUBIC_METERS_LOG_4="volumeCubicMetersLog4",_.VOLUME_CUBIC_METERS_LOG_5="volumeCubicMetersLog5",_.GROSS_WEIGHT_LB_0="grossWeightLb0",_.GROSS_WEIGHT_LB_1="grossWeightLb1",_.GROSS_WEIGHT_LB_2="grossWeightLb2",_.GROSS_WEIGHT_LB_3="grossWeightLb3",_.GROSS_WEIGHT_LB_4="grossWeightLb4",_.GROSS_WEIGHT_LB_5="grossWeightLb5",_.LENGTH_INCHES_LOG_0="lengthInchesLog0",_.LENGTH_INCHES_LOG_1="lengthInchesLog1",_.LENGTH_INCHES_LOG_2="lengthInchesLog2",_.LENGTH_INCHES_LOG_3="lengthInchesLog3",_.LENGTH_INCHES_LOG_4="lengthInchesLog4",_.LENGTH_INCHES_LOG_5="lengthInchesLog5",_.LENGTH_FEET_LOG_0="lengthFeetLog0",_.LENGTH_FEET_LOG_1="lengthFeetLog1",_.LENGTH_FEET_LOG_2="lengthFeetLog2",_.LENGTH_FEET_LOG_3="lengthFeetLog3",_.LENGTH_FEET_LOG_4="lengthFeetLog4",_.LENGTH_FEET_LOG_5="lengthFeetLog5",_.LENGTH_YARDS_LOG_0="lengthYardsLog0",_.LENGTH_YARDS_LOG_1="lengthYardsLog1",_.LENGTH_YARDS_LOG_2="lengthYardsLog2",_.LENGTH_YARDS_LOG_3="lengthYardsLog3",_.LENGTH_YARDS_LOG_4="lengthYardsLog4",_.LENGTH_YARDS_LOG_5="lengthYardsLog5",_.WIDTH_INCHES_LOG_0="widthInchesLog0",_.WIDTH_INCHES_LOG_1="widthInchesLog1",_.WIDTH_INCHES_LOG_2="widthInchesLog2",_.WIDTH_INCHES_LOG_3="widthInchesLog3",_.WIDTH_INCHES_LOG_4="widthInchesLog4",_.WIDTH_INCHES_LOG_5="widthInchesLog5",_.WIDTH_FEET_LOG_0="widthFeetLog0",_.WIDTH_FEET_LOG_1="widthFeetLog1",_.WIDTH_FEET_LOG_2="widthFeetLog2",_.WIDTH_FEET_LOG_3="widthFeetLog3",_.WIDTH_FEET_LOG_4="widthFeetLog4",_.WIDTH_FEET_LOG_5="widthFeetLog5",_.WIDTH_YARDS_LOG_0="widthYardsLog0",_.WIDTH_YARDS_LOG_1="widthYardsLog1",_.WIDTH_YARDS_LOG_2="widthYardsLog2",_.WIDTH_YARDS_LOG_3="widthYardsLog3",_.WIDTH_YARDS_LOG_4="widthYardsLog4",_.WIDTH_YARDS_LOG_5="widthYardsLog5",_.HEIGHT_INCHES_LOG_0="heightInchesLog0",_.HEIGHT_INCHES_LOG_1="heightInchesLog1",_.HEIGHT_INCHES_LOG_2="heightInchesLog2",_.HEIGHT_INCHES_LOG_3="heightInchesLog3",_.HEIGHT_INCHES_LOG_4="heightInchesLog4",_.HEIGHT_INCHES_LOG_5="heightInchesLog5",_.HEIGHT_FEET_LOG_0="heightFeetLog0",_.HEIGHT_FEET_LOG_1="heightFeetLog1",_.HEIGHT_FEET_LOG_2="heightFeetLog2",_.HEIGHT_FEET_LOG_3="heightFeetLog3",_.HEIGHT_FEET_LOG_4="heightFeetLog4",_.HEIGHT_FEET_LOG_5="heightFeetLog5",_.HEIGHT_YARDS_LOG_0="heightYardsLog0",_.HEIGHT_YARDS_LOG_1="heightYardsLog1",_.HEIGHT_YARDS_LOG_2="heightYardsLog2",_.HEIGHT_YARDS_LOG_3="heightYardsLog3",_.HEIGHT_YARDS_LOG_4="heightYardsLog4",_.HEIGHT_YARDS_LOG_5="heightYardsLog5",_.GROSS_WEIGHT_OUNCES_0="grossWeightOunces0",_.GROSS_WEIGHT_OUNCES_1="grossWeightOunces1",_.GROSS_WEIGHT_OUNCES_2="grossWeightOunces2",_.GROSS_WEIGHT_OUNCES_3="grossWeightOunces3",_.GROSS_WEIGHT_OUNCES_4="grossWeightOunces4",_.GROSS_WEIGHT_OUNCES_5="grossWeightOunces5",_.NET_VOLUME_FLUID_OUNCES_0="netVolumeFluidOunces0",_.NET_VOLUME_FLUID_OUNCES_1="netVolumeFluidOunces1",_.NET_VOLUME_FLUID_OUNCES_2="netVolumeFluidOunces2",_.NET_VOLUME_FLUID_OUNCES_3="netVolumeFluidOunces3",_.NET_VOLUME_FLUID_OUNCES_4="netVolumeFluidOunces4",_.NET_VOLUME_FLUID_OUNCES_5="netVolumeFluidOunces5",_.GROSS_VOLUME_QUARTS_0="grossVolumeQuarts0",_.GROSS_VOLUME_QUARTS_1="grossVolumeQuarts1",_.GROSS_VOLUME_QUARTS_2="grossVolumeQuarts2",_.GROSS_VOLUME_QUARTS_3="grossVolumeQuarts3",_.GROSS_VOLUME_QUARTS_4="grossVolumeQuarts4",_.GROSS_VOLUME_QUARTS_5="grossVolumeQuarts5",_.GROSS_VOLUME_GALLONS_0="grossVolumeGallons0",_.GROSS_VOLUME_GALLONS_1="grossVolumeGallons1",_.GROSS_VOLUME_GALLONS_2="grossVolumeGallons2",_.GROSS_VOLUME_GALLONS_3="grossVolumeGallons3",_.GROSS_VOLUME_GALLONS_4="grossVolumeGallons4",_.GROSS_VOLUME_GALLONS_5="grossVolumeGallons5",_.VOLUME_CUBIC_INCHES_LOG_0="volumeCubicInchesLog0",_.VOLUME_CUBIC_INCHES_LOG_1="volumeCubicInchesLog1",_.VOLUME_CUBIC_INCHES_LOG_2="volumeCubicInchesLog2",_.VOLUME_CUBIC_INCHES_LOG_3="volumeCubicInchesLog3",_.VOLUME_CUBIC_INCHES_LOG_4="volumeCubicInchesLog4",_.VOLUME_CUBIC_INCHES_LOG_5="volumeCubicInchesLog5",_.VOLUME_CUBIC_FEET_LOG_0="volumeCubicFeetLog0",_.VOLUME_CUBIC_FEET_LOG_1="volumeCubicFeetLog1",_.VOLUME_CUBIC_FEET_LOG_2="volumeCubicFeetLog2",_.VOLUME_CUBIC_FEET_LOG_3="volumeCubicFeetLog3",_.VOLUME_CUBIC_FEET_LOG_4="volumeCubicFeetLog4",_.VOLUME_CUBIC_FEET_LOG_5="volumeCubicFeetLog5",_.VOLUME_CUBIC_YARDS_LOG_0="volumeCubicYardsLog0",_.VOLUME_CUBIC_YARDS_LOG_1="volumeCubicYardsLog1",_.VOLUME_CUBIC_YARDS_LOG_2="volumeCubicYardsLog2",_.VOLUME_CUBIC_YARDS_LOG_3="volumeCubicYardsLog3",_.VOLUME_CUBIC_YARDS_LOG_4="volumeCubicYardsLog4",_.VOLUME_CUBIC_YARDS_LOG_5="volumeCubicYardsLog5",_.COUNT="count",_.AMOUNT_PAYABLE_0="amountPayable0",_.AMOUNT_PAYABLE_1="amountPayable1",_.AMOUNT_PAYABLE_2="amountPayable2",_.AMOUNT_PAYABLE_3="amountPayable3",_.AMOUNT_PAYABLE_4="amountPayable4",_.AMOUNT_PAYABLE_5="amountPayable5",_.AMOUNT_PAYABLE_ISO_0="amountPayableISO0",_.AMOUNT_PAYABLE_ISO_1="amountPayableISO1",_.AMOUNT_PAYABLE_ISO_2="amountPayableISO2",_.AMOUNT_PAYABLE_ISO_3="amountPayableISO3",_.AMOUNT_PAYABLE_ISO_4="amountPayableISO4",_.AMOUNT_PAYABLE_ISO_5="amountPayableISO5",_.PRICE_0="price0",_.PRICE_1="price1",_.PRICE_2="price2",_.PRICE_3="price3",_.PRICE_ISO_0="priceISO0",_.PRICE_ISO_1="priceISO1",_.PRICE_ISO_2="priceISO2",_.PRICE_ISO_3="priceISO3",_.PERCENT_DISCOUNT_0="percentDiscount0",_.PERCENT_DISCOUNT_1="percentDiscount1",_.PERCENT_DISCOUNT_2="percentDiscount2",_.PERCENT_DISCOUNT_3="percentDiscount3",_.PRICE_PER_UNIT_MEASURE_0="pricePerUnitMeasure0",_.PRICE_PER_UNIT_MEASURE_1="pricePerUnitMeasure1",_.PRICE_PER_UNIT_MEASURE_2="pricePerUnitMeasure2",_.PRICE_PER_UNIT_MEASURE_3="pricePerUnitMeasure3",_.PRICE_PER_UNIT_MEASURE_4="pricePerUnitMeasure4",_.PRICE_PER_UNIT_MEASURE_5="pricePerUnitMeasure5",_.ORDER_NUMBER="orderNumber",_.GINC="ginc",_.GSIN="gsin",_.ROUTE="route",_.SHIP_TO="shipTo",_.BILL_TO="billTo",_.PURCHASE_FROM="purchaseFrom",_.SHIP_FOR="shipFor",_.LOC_NO="locNo",_.PAY_TO="payTo",_.PROD_SERV_LOC="prodServLoc",_.PARTY="party",_.SHIP_TO_POST="shipToPost",_.SHIP_TO_POST_ISO="shipToPostISO",_.ORIGIN="origin",_.COUNTRY_INITIAL_PROCESS="countryInitialProcess",_.COUNTRY_PROCESS="countryProcess",_.COUNTRY_DISASSEMBLY="countryDisassembly",_.COUNTRY_FULL_PROCESS="countryFullProcess",_.ORIGIN_SUBDIVISION="originSubdivision",_.NSN="nsn",_.MEAT_CUT="meatCut",_.EXPIRATION_DATE_TIME="expirationDateTime",_.ACTIVE_POTENCY="activePotency",_.CATCH_AREA="catchArea",_.FIRST_FREEZE_DATE="firstFreezeDate",_.HARVEST_DATE="harvestDate",_.AQUATIC_SPECIES="aquaticSpecies",_.FISHING_GEAR_TYPE="fishingGearType",_.PROD_METHOD="prodMethod",_.REFURB_LOT="refurbLot",_.FUNC_STAT="funcStat",_.REV_STAT="revStat",_.GIAI_ASSEMBLY="giaiAssembly",_.PROCESSOR="processor",_.PROCESSOR_2="processor2",_.PROCESSOR_3="processor3",_.PROCESSOR_4="processor4",_.PROCESSOR_5="processor5",_.PROCESSOR_6="processor6",_.PROCESSOR_7="processor7",_.PROCESSOR_8="processor8",_.PROCESSOR_9="processor9",_.PROCESSOR_10="processor10",_.UIC_EXT="uicExt",_.UFRGT_UNIT_TYPE="ufrgtUnitType",_.NHRN_PZN="nhrnPzn",_.NHRN_CIP="nhrnCip",_.NHRN_CN="nhrnCn",_.NHRN_DRN="nhrnDrn",_.NHRN_AIM="nhrnAim",_.NHRN_DNC="nhrnDnc",_.NHRN_AIC="nhrnAic",_.ROLL_PRODUCTS="rollProducts",_.CMT_NO="cmtNo",_.GRAI="grai",_.GIAI="giai",_.PRICE_PER_UNIT="pricePerUnit",_.ITIP="itip",_.IBAN="iban",_.PROD_TIME="prodTime",_.OPTICAL_SENSOR="opticalSensor",_.CPID="cpid",_.CPID_SERIAL="cpidSerial",_.VERSION="version",_.GMN="gmn",_.GSRN_PROVIDER="gsrnProvider",_.GSRN_RECIPIENT="gsrnRecipient",_.SRIN="srin",_.REF_NO="refNo",_.ITIP_CONTENT="itipContent",_.DIG_SIG="digSig",_.COUPON="coupon",_.POINTS="points",_.COUPON_EXTENDED="couponExtended",_.PRODUCT_URL="productURL",_.INTERNAL_1="internal1",_.INTERNAL_2="internal2",_.INTERNAL_3="internal3",_.INTERNAL_4="internal4",_.INTERNAL_5="internal5",_.INTERNAL_6="internal6",_.INTERNAL_7="internal7",_.INTERNAL_8="internal8",_.INTERNAL_9="internal9",_.INTERNAL_10="internal10",_))(c||{}),F={ai00:"sscc",ai01:"gtin",ai02:"content",ai10:"batch",ai11:"prodDate",ai12:"dueDate",ai13:"packDate",ai15:"bestBefore",ai16:"sellBy",ai17:"expDate",ai20:"variant",ai21:"serial",ai22:"hibcc",ai235:"tpx",ai240:"additionalProductID",ai241:"customerPartNumber",ai242:"madeToOrder",ai243:"packaging",ai250:"secondarySerialNumber",ai251:"refSource",ai253:"gdti",ai254:"glnExtension",ai255:"gcn",ai30:"variableCount",ai310:"netWeightKg0",ai3100:"netWeightKg0",ai3101:"netWeightKg1",ai3102:"netWeightKg2",ai3103:"netWeightKg3",ai3104:"netWeightKg4",ai3105:"netWeightKg5",ai3110:"lengthMeters0",ai3111:"lengthMeters1",ai3112:"lengthMeters2",ai3113:"lengthMeters3",ai3114:"lengthMeters4",ai3115:"lengthMeters5",ai3120:"widthMeters0",ai3121:"widthMeters1",ai3122:"widthMeters2",ai3123:"widthMeters3",ai3124:"widthMeters4",ai3125:"widthMeters5",ai3130:"heightMeters0",ai3131:"heightMeters1",ai3132:"heightMeters2",ai3133:"heightMeters3",ai3134:"heightMeters4",ai3135:"heightMeters5",ai3140:"areaSquareMeters0",ai3141:"areaSquareMeters1",ai3142:"areaSquareMeters2",ai3143:"areaSquareMeters3",ai3144:"areaSquareMeters4",ai3145:"areaSquareMeters5",ai3150:"netVolumeLiters0",ai3151:"netVolumeLiters1",ai3152:"netVolumeLiters2",ai3153:"netVolumeLiters3",ai3154:"netVolumeLiters4",ai3155:"netVolumeLiters5",ai3160:"netVolumeCubicMeters0",ai3161:"netVolumeCubicMeters1",ai3162:"netVolumeCubicMeters2",ai3163:"netVolumeCubicMeters3",ai3164:"netVolumeCubicMeters4",ai3165:"netVolumeCubicMeters5",ai3200:"netWeightLb0",ai3201:"netWeightLb1",ai3202:"netWeightLb2",ai3203:"netWeightLb3",ai3204:"netWeightLb4",ai3205:"netWeightLb5",ai3210:"lengthInches0",ai3211:"lengthInches1",ai3212:"lengthInches2",ai3213:"lengthInches3",ai3214:"lengthInches4",ai3215:"lengthInches5",ai3220:"lengthFeet0",ai3221:"lengthFeet1",ai3222:"lengthFeet2",ai3223:"lengthFeet3",ai3224:"lengthFeet4",ai3225:"lengthFeet5",ai3230:"lengthYards0",ai3231:"lengthYards1",ai3232:"lengthYards2",ai3233:"lengthYards3",ai3234:"lengthYards4",ai3235:"lengthYards5",ai3240:"widthInches0",ai3241:"widthInches1",ai3242:"widthInches2",ai3243:"widthInches3",ai3244:"widthInches4",ai3245:"widthInches5",ai3250:"widthFeet0",ai3251:"widthFeet1",ai3252:"widthFeet2",ai3253:"widthFeet3",ai3254:"widthFeet4",ai3255:"widthFeet5",ai3260:"widthYards0",ai3261:"widthYards1",ai3262:"widthYards2",ai3263:"widthYards3",ai3264:"widthYards4",ai3265:"widthYards5",ai3270:"heightInches0",ai3271:"heightInches1",ai3272:"heightInches2",ai3273:"heightInches3",ai3274:"heightInches4",ai3275:"heightInches5",ai3280:"heightFeet0",ai3281:"heightFeet1",ai3282:"heightFeet2",ai3283:"heightFeet3",ai3284:"heightFeet4",ai3285:"heightFeet5",ai3290:"heightYards0",ai3291:"heightYards1",ai3292:"heightYards2",ai3293:"heightYards3",ai3294:"heightYards4",ai3295:"heightYards5",ai3300:"grossWeightKg0",ai3301:"grossWeightKg1",ai3302:"grossWeightKg2",ai3303:"grossWeightKg3",ai3304:"grossWeightKg4",ai3305:"grossWeightKg5",ai3310:"lengthMetersLog0",ai3311:"lengthMetersLog1",ai3312:"lengthMetersLog2",ai3313:"lengthMetersLog3",ai3314:"lengthMetersLog4",ai3315:"lengthMetersLog5",ai3320:"widthMetersLog0",ai3321:"widthMetersLog1",ai3322:"widthMetersLog2",ai3323:"widthMetersLog3",ai3324:"widthMetersLog4",ai3325:"widthMetersLog5",ai3330:"heightMetersLog0",ai3331:"heightMetersLog1",ai3332:"heightMetersLog2",ai3333:"heightMetersLog3",ai3334:"heightMetersLog4",ai3335:"heightMetersLog5",ai3340:"areaSquareInches0",ai3341:"areaSquareInches1",ai3342:"areaSquareInches2",ai3343:"areaSquareInches3",ai3344:"areaSquareInches4",ai3345:"areaSquareInches5",ai3350:"areaSquareFeet0",ai3351:"areaSquareFeet1",ai3352:"areaSquareFeet2",ai3353:"areaSquareFeet3",ai3354:"areaSquareFeet4",ai3355:"areaSquareFeet5",ai3360:"areaSquareYards0",ai3361:"areaSquareYards1",ai3362:"areaSquareYards2",ai3363:"areaSquareYards3",ai3364:"areaSquareYards4",ai3365:"areaSquareYards5",ai3370:"areaSquareMetersLog0",ai3371:"areaSquareMetersLog1",ai3372:"areaSquareMetersLog2",ai3373:"areaSquareMetersLog3",ai3374:"areaSquareMetersLog4",ai3375:"areaSquareMetersLog5",ai3400:"netWeightOunces0",ai3401:"netWeightOunces1",ai3402:"netWeightOunces2",ai3403:"netWeightOunces3",ai3404:"netWeightOunces4",ai3405:"netWeightOunces5",ai3410:"netVolumeQuarts0",ai3411:"netVolumeQuarts1",ai3412:"netVolumeQuarts2",ai3413:"netVolumeQuarts3",ai3414:"netVolumeQuarts4",ai3415:"netVolumeQuarts5",ai3420:"netVolumeGallons0",ai3421:"netVolumeGallons1",ai3422:"netVolumeGallons2",ai3423:"netVolumeGallons3",ai3424:"netVolumeGallons4",ai3425:"netVolumeGallons5",ai3430:"volumeCubicInches0",ai3431:"volumeCubicInches1",ai3432:"volumeCubicInches2",ai3433:"volumeCubicInches3",ai3434:"volumeCubicInches4",ai3435:"volumeCubicInches5",ai3440:"volumeCubicFeet0",ai3441:"volumeCubicFeet1",ai3442:"volumeCubicFeet2",ai3443:"volumeCubicFeet3",ai3444:"volumeCubicFeet4",ai3445:"volumeCubicFeet5",ai3450:"volumeCubicYards0",ai3451:"volumeCubicYards1",ai3452:"volumeCubicYards2",ai3453:"volumeCubicYards3",ai3454:"volumeCubicYards4",ai3455:"volumeCubicYards5",ai3460:"volumeCubicMetersLog0",ai3461:"volumeCubicMetersLog1",ai3462:"volumeCubicMetersLog2",ai3463:"volumeCubicMetersLog3",ai3464:"volumeCubicMetersLog4",ai3465:"volumeCubicMetersLog5",ai3500:"grossWeightLb0",ai3501:"grossWeightLb1",ai3502:"grossWeightLb2",ai3503:"grossWeightLb3",ai3504:"grossWeightLb4",ai3505:"grossWeightLb5",ai3510:"lengthInchesLog0",ai3511:"lengthInchesLog1",ai3512:"lengthInchesLog2",ai3513:"lengthInchesLog3",ai3514:"lengthInchesLog4",ai3515:"lengthInchesLog5",ai3520:"lengthFeetLog0",ai3521:"lengthFeetLog1",ai3522:"lengthFeetLog2",ai3523:"lengthFeetLog3",ai3524:"lengthFeetLog4",ai3525:"lengthFeetLog5",ai3530:"lengthYardsLog0",ai3531:"lengthYardsLog1",ai3532:"lengthYardsLog2",ai3533:"lengthYardsLog3",ai3534:"lengthYardsLog4",ai3535:"lengthYardsLog5",ai3540:"widthInchesLog0",ai3541:"widthInchesLog1",ai3542:"widthInchesLog2",ai3543:"widthInchesLog3",ai3544:"widthInchesLog4",ai3545:"widthInchesLog5",ai3550:"widthFeetLog0",ai3551:"widthFeetLog1",ai3552:"widthFeetLog2",ai3553:"widthFeetLog3",ai3554:"widthFeetLog4",ai3555:"widthFeetLog5",ai3560:"widthYardsLog0",ai3561:"widthYardsLog1",ai3562:"widthYardsLog2",ai3563:"widthYardsLog3",ai3564:"widthYardsLog4",ai3565:"widthYardsLog5",ai3570:"heightInchesLog0",ai3571:"heightInchesLog1",ai3572:"heightInchesLog2",ai3573:"heightInchesLog3",ai3574:"heightInchesLog4",ai3575:"heightInchesLog5",ai3580:"heightFeetLog0",ai3581:"heightFeetLog1",ai3582:"heightFeetLog2",ai3583:"heightFeetLog3",ai3584:"heightFeetLog4",ai3585:"heightFeetLog5",ai3590:"heightYardsLog0",ai3591:"heightYardsLog1",ai3592:"heightYardsLog2",ai3593:"heightYardsLog3",ai3594:"heightYardsLog4",ai3595:"heightYardsLog5",ai3600:"grossWeightOunces0",ai3601:"grossWeightOunces1",ai3602:"grossWeightOunces2",ai3603:"grossWeightOunces3",ai3604:"grossWeightOunces4",ai3605:"grossWeightOunces5",ai3610:"netVolumeFluidOunces0",ai3611:"netVolumeFluidOunces1",ai3612:"netVolumeFluidOunces2",ai3613:"netVolumeFluidOunces3",ai3614:"netVolumeFluidOunces4",ai3615:"netVolumeFluidOunces5",ai3620:"grossVolumeQuarts0",ai3621:"grossVolumeQuarts1",ai3622:"grossVolumeQuarts2",ai3623:"grossVolumeQuarts3",ai3624:"grossVolumeQuarts4",ai3625:"grossVolumeQuarts5",ai3630:"grossVolumeGallons0",ai3631:"grossVolumeGallons1",ai3632:"grossVolumeGallons2",ai3633:"grossVolumeGallons3",ai3634:"grossVolumeGallons4",ai3635:"grossVolumeGallons5",ai3640:"volumeCubicInchesLog0",ai3641:"volumeCubicInchesLog1",ai3642:"volumeCubicInchesLog2",ai3643:"volumeCubicInchesLog3",ai3644:"volumeCubicInchesLog4",ai3645:"volumeCubicInchesLog5",ai3650:"volumeCubicFeetLog0",ai3651:"volumeCubicFeetLog1",ai3652:"volumeCubicFeetLog2",ai3653:"volumeCubicFeetLog3",ai3654:"volumeCubicFeetLog4",ai3655:"volumeCubicFeetLog5",ai3660:"volumeCubicYardsLog0",ai3661:"volumeCubicYardsLog1",ai3662:"volumeCubicYardsLog2",ai3663:"volumeCubicYardsLog3",ai3664:"volumeCubicYardsLog4",ai3665:"volumeCubicYardsLog5",ai37:"count",ai3900:"amountPayable0",ai3901:"amountPayable1",ai3902:"amountPayable2",ai3903:"amountPayable3",ai3904:"amountPayable4",ai3905:"amountPayable5",ai3910:"amountPayableISO0",ai3911:"amountPayableISO1",ai3912:"amountPayableISO2",ai3913:"amountPayableISO3",ai3914:"amountPayableISO4",ai3915:"amountPayableISO5",ai3920:"price0",ai3921:"price1",ai3922:"price2",ai3923:"price3",ai3930:"priceISO0",ai3931:"priceISO1",ai3932:"priceISO2",ai3933:"priceISO3",ai3940:"percentDiscount0",ai3941:"percentDiscount1",ai3942:"percentDiscount2",ai3943:"percentDiscount3",ai3950:"pricePerUnitMeasure0",ai3951:"pricePerUnitMeasure1",ai3952:"pricePerUnitMeasure2",ai3953:"pricePerUnitMeasure3",ai3954:"pricePerUnitMeasure4",ai3955:"pricePerUnitMeasure5",ai400:"orderNumber",ai401:"ginc",ai402:"gsin",ai403:"route",ai410:"shipTo",ai411:"billTo",ai412:"purchaseFrom",ai413:"shipFor",ai414:"locNo",ai415:"payTo",ai416:"prodServLoc",ai417:"party",ai420:"shipToPost",ai421:"shipToPostISO",ai422:"origin",ai423:"countryInitialProcess",ai424:"countryProcess",ai425:"countryDisassembly",ai426:"countryFullProcess",ai427:"originSubdivision",ai7001:"nsn",ai7002:"meatCut",ai7003:"expirationDateTime",ai7004:"activePotency",ai7005:"catchArea",ai7006:"firstFreezeDate",ai7007:"harvestDate",ai7008:"aquaticSpecies",ai7009:"fishingGearType",ai7010:"prodMethod",ai7020:"refurbLot",ai7021:"funcStat",ai7022:"revStat",ai7023:"giaiAssembly",ai7030:"processor",ai7031:"processor2",ai7032:"processor3",ai7033:"processor4",ai7034:"processor5",ai7035:"processor6",ai7036:"processor7",ai7037:"processor8",ai7038:"processor9",ai7039:"processor10",ai7040:"uicExt",ai7041:"ufrgtUnitType",ai710:"nhrnPzn",ai711:"nhrnCip",ai712:"nhrnCn",ai713:"nhrnDrn",ai714:"nhrnAim",ai715:"nhrnDnc",ai716:"nhrnAic",ai8001:"rollProducts",ai8002:"cmtNo",ai8003:"grai",ai8004:"giai",ai8005:"pricePerUnit",ai8006:"itip",ai8007:"iban",ai8008:"prodTime",ai8009:"opticalSensor",ai8010:"cpid",ai8011:"cpidSerial",ai8012:"version",ai8013:"gmn",ai8017:"gsrnProvider",ai8018:"gsrnRecipient",ai8019:"srin",ai8020:"refNo",ai8026:"itipContent",ai8030:"digSig",ai8110:"coupon",ai8111:"points",ai8112:"couponExtended",ai8200:"productURL",ai90:"internal1",ai91:"internal2",ai92:"internal3",ai93:"internal4",ai94:"internal5",ai95:"internal6",ai96:"internal7",ai97:"internal8",ai98:"internal9",ai99:"internal10"};var h=String.fromCodePoint(29),M=/^\d+$/;var n=class extends Error{static{N(this,"InternalError")}constructor(I,e){super(I),this.name="InternalError",this.code=I,this.ex=e}ex;code},L=class extends Error{static{N(this,"InvalidAiError")}constructor(I,e){let i;I?i=`Invalid AI identifier "${e}" after "${I}"`:i=`Invalid first AI identifier "${e}"`,super(i),this.name="InvalidAiError"}},H=class extends Error{static{N(this,"BarcodeError")}constructor(I,e,i){super(i),this.name="BarcodeError",this.num=I,this.code=e,this.des=i}num;code;des},A=class{static{N(this,"ParsedElementClass")}ai;dataTitle;data;dataString;unit;type="";constructor(I,e,i){switch(this.ai=I,this.dataTitle=e,this.unit="",this.dataString="",i){case"string":this.data="",this.type="string";break;case"number":this.data=0,this.type="number";break;case"date":this.data=new Date,this.data.setHours(0,0,0,0),this.type="date";break;default:this.data="";break}}},l=class{constructor(I,e,i={}){this.codeName=I;this.denormalized=e;this.data=i}static{N(this,"DecodeResult")}};function Y(E,I){let e=E,i=e.slice(0,1);for(;i===I;)e=e.slice(1),i=e.slice(0,1);return e}N(Y,"cleanCodestring");function W(E,I,e){if(I<0||I>11)return!1;let i=I;e===0&&i++;let S=new Date(E,i,e);return S.getFullYear()===E&&S.getMonth()===I&&(S.getDate()===e||e===0)}N(W,"checkValidDate");function P(E,I){let e=E.length-I,i=E.slice(0,e)+"."+E.slice(e);try{return Number.parseFloat(i)}catch(S){throw new n("36",S)}}N(P,"parseFloatingPoint");function U(E,I,e){let i=new A(E,I,"date"),S=E.length,T=e.slice(S,S+6),a=0,O=0,r=0;try{a=Number.parseInt(T.slice(0,2),10)}catch(s){throw new n("33",s)}try{O=Number.parseInt(T.slice(2,4),10)-1}catch(s){throw new n("34",s)}try{r=Number.parseInt(T.slice(4,6),10)}catch(s){throw new n("35",s)}if(a>50?a=a+1900:a=a+2e3,!W(a,O,r))throw new H(7,"36",`Invalid date "${T}" for AI "${E}".`);return r===0&&O++,i.data.setFullYear(a,O,r),i.dataString=T,{element:i,codestring:e.slice(S+6,e.length)}}N(U,"parseDate");function G(E,I,e,i,S=!1){let T=new A(E,I,"string"),a=E.length,O=i.slice(a,e+a);if(O.length<e)throw new H(9,"37",`Data length ${O.length} is less than expected length ${e} for AI "${E}".`);if(S&&!M.test(O))throw new H(11,"39",`Numeric data expected for AI "${E}", but got "${O}".`);T.data=O,T.dataString=O;let r=i.slice(e+a,i.length);return{element:T,codestring:r}}N(G,"parseFixedLength");function t(E,I,e,i,S,T=!1){let a=new A(E,I,"string"),O=E.length,r=e.indexOf(i),s="";if(r===-1?S&&S>0?(a.data=e.slice(O,S+O),s=e.replace(E+a.data,"")):a.data=e.slice(O,e.length):(a.data=e.slice(O,r),s=e.slice(r+1,e.length)),a.data==="")throw new H(10,"38",`Variable length data for AI "${E}" is empty.`);if(T&&!M.test(a.data))throw new H(11,"39",`Numeric data expected for AI "${E}", but got "${a.data}".`);return a.dataString=a.data,{element:a,codestring:s}}N(t,"parseVariableLength");function V(E,I,e,i,S,T){let a=new A(E+I,e,"number"),O=E.length+1,r=S.indexOf(T),s=Number.parseInt(I,10),u="",C="";return r===-1?u=S.slice(O,S.length):(u=S.slice(O,r),C=S.slice(r+1,S.length)),a.data=P(u,s),a.dataString=u,a.unit=i,{element:a,codestring:C}}N(V,"parseVariableLengthMeasure");function R(E,I,e,i,S){let T=new A(E+I,e,"number"),a=E.length+1;if(!M.test(I))throw new L(E,I);let O=Number.parseInt(I,10),r=S.slice(a,a+6);if(!M.test(r))throw new H(11,"39",`Numeric data expected for AI "${E+I}", but got "${r}".`);T.data=P(r,O),T.dataString=r,T.unit=i;let s=S.slice(a+6,S.length);return{element:T,codestring:s}}N(R,"parseFixedLengthMeasure");function m(E,I,e,i,S){let T=new A(E+I,e,"number"),a=E.length+1,O=i.indexOf(S),r=Number.parseInt(I,10),s="",u="",C="";return O===-1?s=i.slice(a,i.length):(s=i.slice(a,O),C=i.slice(O+1,i.length)),u=s.slice(3,s.length),T.data=P(u,r),T.dataString=u,T.unit=s.slice(0,3),{element:T,codestring:C}}N(m,"parseVariableLengthWithISONumbers");function g(E,I,e,i){let S=new A(E,I,"string"),T=E.length,a=e.indexOf(i),O="",r="";return a===-1?O=e.slice(T,e.length):(O=e.slice(T,a),r=e.slice(a+1,e.length)),S.data=O.slice(3,O.length),S.unit=O.slice(0,3),S.dataString=O,{element:S,codestring:r}}N(g,"parseVariableLengthWithISOChars");function v(E,I,e){e||(e=h);let i=E.slice(0,1),S=E.slice(1,2),T="",a="";switch(i){case"0":switch(S){case"0":return G("00","SSCC",18,E,!0);case"1":return G("01","GTIN",14,E,!0);case"2":return G("02","CONTENT",14,E);case"3":return G("03","MTO GTIN",14,E);default:throw new L("0",S)}case"1":switch(S){case"0":return t("10","BATCH/LOT",E,e,I??20);case"1":return U("11","PROD DATE",E);case"2":return U("12","DUE DATE",E);case"3":return U("13","PACK DATE",E);case"5":return U("15","BEST BEFORE or BEST BY",E);case"6":return U("16","SELL BY",E);case"7":return U("17","USE BY OR EXPIRY",E);default:throw new L("1",S)}case"2":switch(S){case"0":return G("20","VARIANT",2,E);case"1":return t("21","SERIAL",E,e,I??20);case"2":return t("22","CPV",E,e,20);case"3":switch(T=E.slice(2,3),T){case"5":return t("235","TPX",E,e,28);default:throw new L("23",T)}case"4":switch(T=E.slice(2,3),T){case"0":return t("240","ADDITIONAL ID",E,e,30);case"1":return t("241","CUST. PART NO.",E,e,30);case"2":return t("242","MTO VARIANT",E,e,6,!0);case"3":return t("243","PCN",E,e,20);default:throw new L("24",T)}case"5":switch(T=E.slice(2,3),T){case"0":return t("250","SECONDARY SERIAL",E,e,30);case"1":return t("251","REF. TO SOURCE",E,e,30);case"3":return t("253","GDTI",E,e,42);case"4":return t("254","GLN EXTENSION COMPONENT",E,e,20);case"5":return t("255","GCN",E,e,25,!0);default:throw new L("25",T)}default:throw new L("2",S)}case"3":switch(S){case"0":return t("30","VAR. COUNT",E,e,8,!0);case"1":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return R("310",a,"NET WEIGHT (kg)","KGM",E);case"1":return R("311",a,"LENGTH (m)","MTR",E);case"2":return R("312",a,"WIDTH (m)","MTR",E);case"3":return R("313",a,"HEIGHT (m)","MTR",E);case"4":return R("314",a,"AREA (m2)","MTK",E);case"5":return R("315",a,"NET VOLUME (l)","LTR",E);case"6":return R("316",a,"NET VOLUME (m3)","MTQ",E);default:throw new L("31",T)}case"2":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return R("320",a,"NET WEIGHT (lb)","LBR",E);case"1":return R("321",a,"LENGTH (i)","INH",E);case"2":return R("322",a,"LENGTH (f)","FOT",E);case"3":return R("323",a,"LENGTH (y)","YRD",E);case"4":return R("324",a,"WIDTH (i)","INH",E);case"5":return R("325",a,"WIDTH (f)","FOT",E);case"6":return R("326",a,"WIDTH (y)","YRD",E);case"7":return R("327",a,"HEIGHT (i)","INH",E);case"8":return R("328",a,"HEIGHT (f)","FOT",E);case"9":return R("329",a,"HEIGHT (y)","YRD",E);default:throw new L("32",T)}case"3":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return R("330",a,"GROSS WEIGHT (kg)","KGM",E);case"1":return R("331",a,"LENGTH (m), log","MTR",E);case"2":return R("332",a,"WIDTH (m), log","MTR",E);case"3":return R("333",a,"HEIGHT (m), log","MTR",E);case"4":return R("334",a,"AREA (m2), log","MTK",E);case"5":return R("335",a,"VOLUME (l), log","LTR",E);case"6":return R("336",a,"VOLUME (m3), log","MTQ",E);case"7":return R("337",a,"KG PER m\xB2","28",E);default:throw new L("33",T)}case"4":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return R("340",a,"GROSS WEIGHT (lb)","LBR",E);case"1":return R("341",a,"LENGTH (i), log","INH",E);case"2":return R("342",a,"LENGTH (f), log","FOT",E);case"3":return R("343",a,"LENGTH (y), log","YRD",E);case"4":return R("344",a,"WIDTH (i), log","INH",E);case"5":return R("345",a,"WIDTH (f), log","FOT",E);case"6":return R("346",a,"WIDTH (y), log","YRD",E);case"7":return R("347",a,"HEIGHT (i), log","INH",E);case"8":return R("348",a,"HEIGHT (f), log","FOT",E);case"9":return R("349",a,"HEIGHT (y), log","YRD",E);default:throw new L("33",T)}case"5":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return R("350",a,"AREA (i2)","INK",E);case"1":return R("351",a,"AREA (f2)","FTK",E);case"2":return R("352",a,"AREA (y2)","YDK",E);case"3":return R("353",a,"AREA (i2), log","INK",E);case"4":return R("354",a,"AREA (f2), log","FTK",E);case"5":return R("355",a,"AREA (y2), log","YDK",E);case"6":return R("356",a,"NET WEIGHT (t)","APZ",E);case"7":return R("357",a,"NET VOLUME (oz)","ONZ",E);default:throw new L("35",T)}case"6":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return R("360",a,"NET VOLUME (q)","QT",E);case"1":return R("361",a,"NET VOLUME (g)","GLL",E);case"2":return R("362",a,"VOLUME (q), log","QT",E);case"3":return R("363",a,"VOLUME (g), log","GLL",E);case"4":return R("364",a,"VOLUME (i3)","INQ",E);case"5":return R("365",a,"VOLUME (f3)","FTQ",E);case"6":return R("366",a,"VOLUME (y3)","YDQ",E);case"7":return R("367",a,"VOLUME (i3), log","INQ",E);case"8":return R("368",a,"VOLUME (f3), log","FTQ",E);case"9":return R("369",a,"VOLUME (y3), log","YDQ",E);default:throw new L("36",T)}case"7":return t("37","COUNT",E,e,8);case"9":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return V("390",a,"AMOUNT","",E,e);case"1":return m("391",a,"AMOUNT",E,e);case"2":return V("392",a,"PRICE","",E,e);case"3":return m("393",a,"PRICE",E,e);default:throw new L("39",T)}default:throw new L("3",S)}case"4":switch(S){case"0":switch(T=E.slice(2,3),T){case"0":return t("400","ORDER NUMBER",E,e,30);case"1":return t("401","GINC",E,e);case"2":return t("402","GSIN",E,e,17,!0);case"3":return t("403","ROUTE",E,e,30);default:throw new L("40",T)}case"1":switch(T=E.slice(2,3),T){case"0":return G("410","SHIP TO LOC",13,E,!0);case"1":return G("411","BILL TO",13,E,!0);case"2":return G("412","PURCHASE FROM",13,E,!0);case"3":return G("413","SHIP FOR LOC",13,E,!0);case"4":return G("414","LOC NO",13,E,!0);case"5":return G("415","PAY TO",13,E,!0);case"6":return G("416","PROD/SERV LOC",13,E,!0);case"7":return G("417","PARTY",13,E,!0);default:throw new L("41",T)}case"2":switch(T=E.slice(2,3),T){case"0":return t("420","SHIP TO POST",E,e,20);case"1":return g("421","SHIP TO POST",E,e);case"2":return G("422","ORIGIN",3,E,!0);case"3":return t("423","COUNTRY - INITIAL PROCESS.",E,e,15);case"4":return G("424","COUNTRY - PROCESS.",3,E,!0);case"5":return G("425","COUNTRY - DISASSEMBLY",3,E,!0);case"6":return G("426","COUNTRY - FULL PROCESS",3,E,!0);case"7":return t("427","ORIGIN SUBDIVISION",E,e,3);default:throw new L("42",T)}default:throw new L("4",S)}case"7":switch(S){case"0":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":switch(a){case"1":return t("7001","NSN",E,e,13,!0);case"2":return t("7002","MEAT CUT",E,e);case"3":return t("7003","EXPIRY TIME",E,e,10,!0);case"4":return t("7004","ACTIVE POTENCY",E,e,4,!0);case"5":return t("7005","CATCH AREA",E,e,12);case"6":return U("7006","FIRST FREEZE DATE",E);case"7":return t("7007","HARVEST DATE",E,e,12,!0);case"8":return t("7008","AQUATIC SPECIES",E,e,3);case"9":return t("7009","FISHING GEAR TYPE",E,e,10);default:throw new L("700",a)}case"1":switch(a){case"0":return t("7010","PROD METHOD",E,e,2);case"1":return t("7011","TEST BY DATE",E,e,10,!0);default:throw new L("701",a)}case"2":switch(a){case"0":return t("7020","REFURB LOT",E,e,20);case"1":return t("7021","FUNC STAT",E,e,20);case"2":return t("7022","REV STAT",E,e,20);case"3":return t("7023","GIAI - ASSEMBLY",E,e,30);default:throw new L("702",a)}case"3":return g("703"+a,"PROCESSOR # "+a,E,e);default:throw new L("70",T)}case"1":switch(T=E.slice(2,3),T){case"0":return t("710","NHRN PZN",E,e);case"1":return t("711","NHRN CIP",E,e);case"2":return t("712","NHRN CN",E,e);case"3":return t("713","NHRN DRN",E,e);case"4":return t("714","NHRN AIM",E,e);case"5":return t("715","NHRN NDC",E,e);case"6":return t("716","NHRN AIC",E,e);default:throw new L("71",T)}default:throw new L("7",S)}case"8":switch(S){case"0":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":switch(a){case"1":return t("8001","DIMENSIONS",E,e,14);case"2":return t("8002","CMT No",E,e);case"3":return t("8003","GRAI",E,e);case"4":return t("8004","GIAI",E,e);case"5":return t("8005","PRICE PER UNIT",E,e,6);case"6":return t("8006","GCTIN",E,e,18);case"7":return t("8007","IBAN",E,e);case"8":return t("8008","PROD TIME",E,e,12);default:throw new L("800",a)}case"1":switch(a){case"0":return t("8010","CPID",E,e);case"1":return t("8011","CPID SERIAL",E,e);case"7":return t("8017","GSRN - PROVIDER",E,e,18);case"8":return t("8018","GSRN - RECIPIENT",E,e,18,!0);case"9":return t("8019","SRIN",E,e,void 0,!0);default:throw new L("801",a)}case"2":switch(a){case"0":return t("8020","REF No",E,e);case"6":return t("8026","ITIP CONTENT",E,e,18,!0);default:throw new L("802",a)}case"3":switch(a){case"0":return t("8030","DIGSIG",E,e);default:throw new L("803",a)}default:throw new L("80",T)}case"1":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"1":switch(a){case"0":return t("8110","-",E,e);case"1":return t("8111","POINTS",E,e,4,!0);case"2":return t("8112","-",E,e);default:throw new L("811",a)}default:throw new L("81",T)}case"2":switch(T=E.slice(2,3),T){case"0":return t("8200","PRODUCT URL",E,e);default:throw new L("82",T)}default:throw new L("8",S)}case"9":switch(S){case"0":return t("90","INTERNAL",E,e,30);case"1":return t("91","INTERNAL",E,e);case"2":return t("92","INTERNAL",E,e);case"3":return t("93","INTERNAL",E,e);case"4":return t("94","INTERNAL",E,e);case"5":return t("95","INTERNAL",E,e);case"6":return t("96","INTERNAL",E,e);case"7":return t("97","INTERNAL",E,e);case"8":return t("98","INTERNAL",E,e);case"9":return t("99","INTERNAL",E,e);default:throw new L("9",S)}default:throw new L("",i)}}N(v,"identifyAI");function w(E,I,e){if(!E||typeof E!="string")throw new H(2,"31","The barcode is empty or not a string.");let i=E.length,S={codeName:"",denormalized:"",parsedCodeItems:[]},T="",a=E.slice(0,3),O;switch(a){case"]C1":S.codeName="GS1-128",T=E.slice(3,i);break;case"]e0":S.codeName="GS1 DataBar",T=E.slice(3,i);break;case"]e1":case"]e2":S.codeName="GS1 Composite",T=E.slice(3,i);break;case"]d2":S.codeName="GS1 DataMatrix",T=E.slice(3,i);break;case"]Q3":S.codeName="GS1 QR Code",T=E.slice(3,i);break;default:S.codeName="",T=E;break}for(S.parsedCodeItems=[];T.length>0;)try{O=v(T,e),T=Y(O.codestring,I),S.parsedCodeItems.push(O.element),S.denormalized+="("+O.element.ai+")"+O.element.dataString}catch(r){if(r instanceof n)x(r);else throw r}return S}N(w,"parseBarcode");function x(E){switch(E.code){case"32":throw new H(6,32,"Invalid normal AI.");case"33":throw new H(7,33,"The year of the date is not valid.");case"34":throw new H(7,34,"The month of the date is not valid.");case"36":throw new H(8,36,"Invalid numbers");default:throw E}}N(x,"handleInternalError");var o=class{static{N(this,"GS1Parser")}fncChar;lotLen;constructor(I){this.fncChar=I?.fncChar||h,this.lotLen=I?.lotMaxLength}decode(I){let e=I.replaceAll("(",this.fncChar).replaceAll(")","");e.startsWith(this.fncChar)&&(e=e.slice(1));let i=w(e,this.fncChar,this.lotLen),S={};for(let T of i.parsedCodeItems){let a=F["ai"+T.ai];a&&(S[a]=T)}return new l(i.codeName,i.denormalized,S)}};0&&(module.exports={DecodeResult,GS1Field,GS1Parser});
package/dist/index.d.cts CHANGED
@@ -1,16 +1,3 @@
1
- type GS1DecodedData = string | number | Date;
2
- interface ParsedElement {
3
- ai: string;
4
- dataTitle: string;
5
- data: GS1DecodedData;
6
- dataString: string;
7
- unit: string;
8
- }
9
- interface ParserOptions {
10
- fncChar?: string;
11
- lotMaxLength?: number;
12
- }
13
-
14
1
  declare enum GS1Field {
15
2
  SSCC = "sscc",
16
3
  GTIN = "gtin",
@@ -449,24 +436,82 @@ declare enum GS1Field {
449
436
  INTERNAL_10 = "internal10"
450
437
  }
451
438
 
439
+ declare enum ElementType {
440
+ S = "string",
441
+ N = "number",
442
+ D = "date",
443
+ UNDEFINED = ""
444
+ }
445
+ /**
446
+ * The result returned by {@link GS1Parser#decode}
447
+ */
452
448
  declare class DecodeResult {
449
+ /**
450
+ * A barcode type identifier (a simple string denoting the type of barcode)
451
+ */
453
452
  codeName: string;
453
+ /**
454
+ * Human readable full barcode, with parentheses surrounding AIs
455
+ */
454
456
  denormalized: string;
455
- data: Partial<Record<GS1Field, ParsedElement>>;
456
- constructor(codeName: string, denormalized: string, data?: Partial<Record<GS1Field, ParsedElement>>);
457
+ /**
458
+ * The actual parsed data, presented in a dictionary
459
+ */
460
+ data: Partial<Record<GS1Field, ParsedElement<GS1DecodedData>>>;
461
+ constructor(
462
+ /**
463
+ * A barcode type identifier (a simple string denoting the type of barcode)
464
+ */
465
+ codeName: string,
466
+ /**
467
+ * Human readable full barcode, with parentheses surrounding AIs
468
+ */
469
+ denormalized: string,
470
+ /**
471
+ * The actual parsed data, presented in a dictionary
472
+ */
473
+ data?: Partial<Record<GS1Field, ParsedElement<GS1DecodedData>>>);
474
+ }
475
+
476
+ type GS1DecodedData = string | number | Date;
477
+ interface ParsedElement<T> {
478
+ ai: string;
479
+ dataTitle: string;
480
+ data: T;
481
+ dataString: string;
482
+ unit: string;
483
+ type: ElementType;
484
+ }
485
+ /**
486
+ * Options that tweak the parser's behavior
487
+ */
488
+ interface ParserOptions {
489
+ /**
490
+ * The FNC1 character, a non-printable special character that delimits fields of variable length.
491
+ * If not specified, the GS char (\x1D) is used
492
+ */
493
+ fncChar?: string;
494
+ /**
495
+ * The lot (or batch) field is usually delimited by a FNC1 char, but you can limit its size to a specific length.
496
+ * If not specified, no limit is applied, except the one in the GS1 specs
497
+ */
498
+ lotMaxLength?: number;
457
499
  }
458
500
 
459
501
  declare class GS1Parser {
460
- fncChar: string;
461
- lotLen?: number;
502
+ protected fncChar: string;
503
+ protected lotLen?: number;
462
504
  /**
463
505
  * Builds a GS1 barcode parser
464
- * @param options
465
- * @param options.fncChar The function character used as a separator in variable length fields. Default is ASCII 29 (Group Separator).
466
- * @param options.lotMaxLength The maximum length for lot/batch numbers. If not provided, no maximum length is enforced.
506
+ * @param options Barcode parser options
467
507
  */
468
508
  constructor(options?: ParserOptions);
509
+ /**
510
+ * Performs the actual parsing
511
+ * @param barcode The barcode to be parsed
512
+ * @returns Parsed data
513
+ */
469
514
  decode(barcode: string): DecodeResult;
470
515
  }
471
516
 
472
- export { GS1Parser };
517
+ export { DecodeResult, type GS1DecodedData, GS1Field, GS1Parser, type ParsedElement, type ParserOptions };
package/dist/index.d.ts CHANGED
@@ -1,16 +1,3 @@
1
- type GS1DecodedData = string | number | Date;
2
- interface ParsedElement {
3
- ai: string;
4
- dataTitle: string;
5
- data: GS1DecodedData;
6
- dataString: string;
7
- unit: string;
8
- }
9
- interface ParserOptions {
10
- fncChar?: string;
11
- lotMaxLength?: number;
12
- }
13
-
14
1
  declare enum GS1Field {
15
2
  SSCC = "sscc",
16
3
  GTIN = "gtin",
@@ -449,24 +436,82 @@ declare enum GS1Field {
449
436
  INTERNAL_10 = "internal10"
450
437
  }
451
438
 
439
+ declare enum ElementType {
440
+ S = "string",
441
+ N = "number",
442
+ D = "date",
443
+ UNDEFINED = ""
444
+ }
445
+ /**
446
+ * The result returned by {@link GS1Parser#decode}
447
+ */
452
448
  declare class DecodeResult {
449
+ /**
450
+ * A barcode type identifier (a simple string denoting the type of barcode)
451
+ */
453
452
  codeName: string;
453
+ /**
454
+ * Human readable full barcode, with parentheses surrounding AIs
455
+ */
454
456
  denormalized: string;
455
- data: Partial<Record<GS1Field, ParsedElement>>;
456
- constructor(codeName: string, denormalized: string, data?: Partial<Record<GS1Field, ParsedElement>>);
457
+ /**
458
+ * The actual parsed data, presented in a dictionary
459
+ */
460
+ data: Partial<Record<GS1Field, ParsedElement<GS1DecodedData>>>;
461
+ constructor(
462
+ /**
463
+ * A barcode type identifier (a simple string denoting the type of barcode)
464
+ */
465
+ codeName: string,
466
+ /**
467
+ * Human readable full barcode, with parentheses surrounding AIs
468
+ */
469
+ denormalized: string,
470
+ /**
471
+ * The actual parsed data, presented in a dictionary
472
+ */
473
+ data?: Partial<Record<GS1Field, ParsedElement<GS1DecodedData>>>);
474
+ }
475
+
476
+ type GS1DecodedData = string | number | Date;
477
+ interface ParsedElement<T> {
478
+ ai: string;
479
+ dataTitle: string;
480
+ data: T;
481
+ dataString: string;
482
+ unit: string;
483
+ type: ElementType;
484
+ }
485
+ /**
486
+ * Options that tweak the parser's behavior
487
+ */
488
+ interface ParserOptions {
489
+ /**
490
+ * The FNC1 character, a non-printable special character that delimits fields of variable length.
491
+ * If not specified, the GS char (\x1D) is used
492
+ */
493
+ fncChar?: string;
494
+ /**
495
+ * The lot (or batch) field is usually delimited by a FNC1 char, but you can limit its size to a specific length.
496
+ * If not specified, no limit is applied, except the one in the GS1 specs
497
+ */
498
+ lotMaxLength?: number;
457
499
  }
458
500
 
459
501
  declare class GS1Parser {
460
- fncChar: string;
461
- lotLen?: number;
502
+ protected fncChar: string;
503
+ protected lotLen?: number;
462
504
  /**
463
505
  * Builds a GS1 barcode parser
464
- * @param options
465
- * @param options.fncChar The function character used as a separator in variable length fields. Default is ASCII 29 (Group Separator).
466
- * @param options.lotMaxLength The maximum length for lot/batch numbers. If not provided, no maximum length is enforced.
506
+ * @param options Barcode parser options
467
507
  */
468
508
  constructor(options?: ParserOptions);
509
+ /**
510
+ * Performs the actual parsing
511
+ * @param barcode The barcode to be parsed
512
+ * @returns Parsed data
513
+ */
469
514
  decode(barcode: string): DecodeResult;
470
515
  }
471
516
 
472
- export { GS1Parser };
517
+ export { DecodeResult, type GS1DecodedData, GS1Field, GS1Parser, type ParsedElement, type ParserOptions };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var Y=Object.defineProperty;var r=(_,i)=>Y(_,"name",{value:i,configurable:!0});var V={ai00:"sscc",ai01:"gtin",ai02:"content",ai10:"batch",ai11:"prodDate",ai12:"dueDate",ai13:"packDate",ai15:"bestBefore",ai16:"sellBy",ai17:"expDate",ai20:"variant",ai21:"serial",ai22:"hibcc",ai235:"tpx",ai240:"additionalProductID",ai241:"customerPartNumber",ai242:"madeToOrder",ai243:"packaging",ai250:"secondarySerialNumber",ai251:"refSource",ai253:"gdti",ai254:"glnExtension",ai255:"gcn",ai30:"variableCount",ai310:"netWeightKg0",ai3100:"netWeightKg0",ai3101:"netWeightKg1",ai3102:"netWeightKg2",ai3103:"netWeightKg3",ai3104:"netWeightKg4",ai3105:"netWeightKg5",ai3110:"lengthMeters0",ai3111:"lengthMeters1",ai3112:"lengthMeters2",ai3113:"lengthMeters3",ai3114:"lengthMeters4",ai3115:"lengthMeters5",ai3120:"widthMeters0",ai3121:"widthMeters1",ai3122:"widthMeters2",ai3123:"widthMeters3",ai3124:"widthMeters4",ai3125:"widthMeters5",ai3130:"heightMeters0",ai3131:"heightMeters1",ai3132:"heightMeters2",ai3133:"heightMeters3",ai3134:"heightMeters4",ai3135:"heightMeters5",ai3140:"areaSquareMeters0",ai3141:"areaSquareMeters1",ai3142:"areaSquareMeters2",ai3143:"areaSquareMeters3",ai3144:"areaSquareMeters4",ai3145:"areaSquareMeters5",ai3150:"netVolumeLiters0",ai3151:"netVolumeLiters1",ai3152:"netVolumeLiters2",ai3153:"netVolumeLiters3",ai3154:"netVolumeLiters4",ai3155:"netVolumeLiters5",ai3160:"netVolumeCubicMeters0",ai3161:"netVolumeCubicMeters1",ai3162:"netVolumeCubicMeters2",ai3163:"netVolumeCubicMeters3",ai3164:"netVolumeCubicMeters4",ai3165:"netVolumeCubicMeters5",ai3200:"netWeightLb0",ai3201:"netWeightLb1",ai3202:"netWeightLb2",ai3203:"netWeightLb3",ai3204:"netWeightLb4",ai3205:"netWeightLb5",ai3210:"lengthInches0",ai3211:"lengthInches1",ai3212:"lengthInches2",ai3213:"lengthInches3",ai3214:"lengthInches4",ai3215:"lengthInches5",ai3220:"lengthFeet0",ai3221:"lengthFeet1",ai3222:"lengthFeet2",ai3223:"lengthFeet3",ai3224:"lengthFeet4",ai3225:"lengthFeet5",ai3230:"lengthYards0",ai3231:"lengthYards1",ai3232:"lengthYards2",ai3233:"lengthYards3",ai3234:"lengthYards4",ai3235:"lengthYards5",ai3240:"widthInches0",ai3241:"widthInches1",ai3242:"widthInches2",ai3243:"widthInches3",ai3244:"widthInches4",ai3245:"widthInches5",ai3250:"widthFeet0",ai3251:"widthFeet1",ai3252:"widthFeet2",ai3253:"widthFeet3",ai3254:"widthFeet4",ai3255:"widthFeet5",ai3260:"widthYards0",ai3261:"widthYards1",ai3262:"widthYards2",ai3263:"widthYards3",ai3264:"widthYards4",ai3265:"widthYards5",ai3270:"heightInches0",ai3271:"heightInches1",ai3272:"heightInches2",ai3273:"heightInches3",ai3274:"heightInches4",ai3275:"heightInches5",ai3280:"heightFeet0",ai3281:"heightFeet1",ai3282:"heightFeet2",ai3283:"heightFeet3",ai3284:"heightFeet4",ai3285:"heightFeet5",ai3290:"heightYards0",ai3291:"heightYards1",ai3292:"heightYards2",ai3293:"heightYards3",ai3294:"heightYards4",ai3295:"heightYards5",ai3300:"grossWeightKg0",ai3301:"grossWeightKg1",ai3302:"grossWeightKg2",ai3303:"grossWeightKg3",ai3304:"grossWeightKg4",ai3305:"grossWeightKg5",ai3310:"lengthMetersLog0",ai3311:"lengthMetersLog1",ai3312:"lengthMetersLog2",ai3313:"lengthMetersLog3",ai3314:"lengthMetersLog4",ai3315:"lengthMetersLog5",ai3320:"widthMetersLog0",ai3321:"widthMetersLog1",ai3322:"widthMetersLog2",ai3323:"widthMetersLog3",ai3324:"widthMetersLog4",ai3325:"widthMetersLog5",ai3330:"heightMetersLog0",ai3331:"heightMetersLog1",ai3332:"heightMetersLog2",ai3333:"heightMetersLog3",ai3334:"heightMetersLog4",ai3335:"heightMetersLog5",ai3340:"areaSquareInches0",ai3341:"areaSquareInches1",ai3342:"areaSquareInches2",ai3343:"areaSquareInches3",ai3344:"areaSquareInches4",ai3345:"areaSquareInches5",ai3350:"areaSquareFeet0",ai3351:"areaSquareFeet1",ai3352:"areaSquareFeet2",ai3353:"areaSquareFeet3",ai3354:"areaSquareFeet4",ai3355:"areaSquareFeet5",ai3360:"areaSquareYards0",ai3361:"areaSquareYards1",ai3362:"areaSquareYards2",ai3363:"areaSquareYards3",ai3364:"areaSquareYards4",ai3365:"areaSquareYards5",ai3370:"areaSquareMetersLog0",ai3371:"areaSquareMetersLog1",ai3372:"areaSquareMetersLog2",ai3373:"areaSquareMetersLog3",ai3374:"areaSquareMetersLog4",ai3375:"areaSquareMetersLog5",ai3400:"netWeightOunces0",ai3401:"netWeightOunces1",ai3402:"netWeightOunces2",ai3403:"netWeightOunces3",ai3404:"netWeightOunces4",ai3405:"netWeightOunces5",ai3410:"netVolumeQuarts0",ai3411:"netVolumeQuarts1",ai3412:"netVolumeQuarts2",ai3413:"netVolumeQuarts3",ai3414:"netVolumeQuarts4",ai3415:"netVolumeQuarts5",ai3420:"netVolumeGallons0",ai3421:"netVolumeGallons1",ai3422:"netVolumeGallons2",ai3423:"netVolumeGallons3",ai3424:"netVolumeGallons4",ai3425:"netVolumeGallons5",ai3430:"volumeCubicInches0",ai3431:"volumeCubicInches1",ai3432:"volumeCubicInches2",ai3433:"volumeCubicInches3",ai3434:"volumeCubicInches4",ai3435:"volumeCubicInches5",ai3440:"volumeCubicFeet0",ai3441:"volumeCubicFeet1",ai3442:"volumeCubicFeet2",ai3443:"volumeCubicFeet3",ai3444:"volumeCubicFeet4",ai3445:"volumeCubicFeet5",ai3450:"volumeCubicYards0",ai3451:"volumeCubicYards1",ai3452:"volumeCubicYards2",ai3453:"volumeCubicYards3",ai3454:"volumeCubicYards4",ai3455:"volumeCubicYards5",ai3460:"volumeCubicMetersLog0",ai3461:"volumeCubicMetersLog1",ai3462:"volumeCubicMetersLog2",ai3463:"volumeCubicMetersLog3",ai3464:"volumeCubicMetersLog4",ai3465:"volumeCubicMetersLog5",ai3500:"grossWeightLb0",ai3501:"grossWeightLb1",ai3502:"grossWeightLb2",ai3503:"grossWeightLb3",ai3504:"grossWeightLb4",ai3505:"grossWeightLb5",ai3510:"lengthInchesLog0",ai3511:"lengthInchesLog1",ai3512:"lengthInchesLog2",ai3513:"lengthInchesLog3",ai3514:"lengthInchesLog4",ai3515:"lengthInchesLog5",ai3520:"lengthFeetLog0",ai3521:"lengthFeetLog1",ai3522:"lengthFeetLog2",ai3523:"lengthFeetLog3",ai3524:"lengthFeetLog4",ai3525:"lengthFeetLog5",ai3530:"lengthYardsLog0",ai3531:"lengthYardsLog1",ai3532:"lengthYardsLog2",ai3533:"lengthYardsLog3",ai3534:"lengthYardsLog4",ai3535:"lengthYardsLog5",ai3540:"widthInchesLog0",ai3541:"widthInchesLog1",ai3542:"widthInchesLog2",ai3543:"widthInchesLog3",ai3544:"widthInchesLog4",ai3545:"widthInchesLog5",ai3550:"widthFeetLog0",ai3551:"widthFeetLog1",ai3552:"widthFeetLog2",ai3553:"widthFeetLog3",ai3554:"widthFeetLog4",ai3555:"widthFeetLog5",ai3560:"widthYardsLog0",ai3561:"widthYardsLog1",ai3562:"widthYardsLog2",ai3563:"widthYardsLog3",ai3564:"widthYardsLog4",ai3565:"widthYardsLog5",ai3570:"heightInchesLog0",ai3571:"heightInchesLog1",ai3572:"heightInchesLog2",ai3573:"heightInchesLog3",ai3574:"heightInchesLog4",ai3575:"heightInchesLog5",ai3580:"heightFeetLog0",ai3581:"heightFeetLog1",ai3582:"heightFeetLog2",ai3583:"heightFeetLog3",ai3584:"heightFeetLog4",ai3585:"heightFeetLog5",ai3590:"heightYardsLog0",ai3591:"heightYardsLog1",ai3592:"heightYardsLog2",ai3593:"heightYardsLog3",ai3594:"heightYardsLog4",ai3595:"heightYardsLog5",ai3600:"grossWeightOunces0",ai3601:"grossWeightOunces1",ai3602:"grossWeightOunces2",ai3603:"grossWeightOunces3",ai3604:"grossWeightOunces4",ai3605:"grossWeightOunces5",ai3610:"netVolumeFluidOunces0",ai3611:"netVolumeFluidOunces1",ai3612:"netVolumeFluidOunces2",ai3613:"netVolumeFluidOunces3",ai3614:"netVolumeFluidOunces4",ai3615:"netVolumeFluidOunces5",ai3620:"grossVolumeQuarts0",ai3621:"grossVolumeQuarts1",ai3622:"grossVolumeQuarts2",ai3623:"grossVolumeQuarts3",ai3624:"grossVolumeQuarts4",ai3625:"grossVolumeQuarts5",ai3630:"grossVolumeGallons0",ai3631:"grossVolumeGallons1",ai3632:"grossVolumeGallons2",ai3633:"grossVolumeGallons3",ai3634:"grossVolumeGallons4",ai3635:"grossVolumeGallons5",ai3640:"volumeCubicInchesLog0",ai3641:"volumeCubicInchesLog1",ai3642:"volumeCubicInchesLog2",ai3643:"volumeCubicInchesLog3",ai3644:"volumeCubicInchesLog4",ai3645:"volumeCubicInchesLog5",ai3650:"volumeCubicFeetLog0",ai3651:"volumeCubicFeetLog1",ai3652:"volumeCubicFeetLog2",ai3653:"volumeCubicFeetLog3",ai3654:"volumeCubicFeetLog4",ai3655:"volumeCubicFeetLog5",ai3660:"volumeCubicYardsLog0",ai3661:"volumeCubicYardsLog1",ai3662:"volumeCubicYardsLog2",ai3663:"volumeCubicYardsLog3",ai3664:"volumeCubicYardsLog4",ai3665:"volumeCubicYardsLog5",ai37:"count",ai3900:"amountPayable0",ai3901:"amountPayable1",ai3902:"amountPayable2",ai3903:"amountPayable3",ai3904:"amountPayable4",ai3905:"amountPayable5",ai3910:"amountPayableISO0",ai3911:"amountPayableISO1",ai3912:"amountPayableISO2",ai3913:"amountPayableISO3",ai3914:"amountPayableISO4",ai3915:"amountPayableISO5",ai3920:"price0",ai3921:"price1",ai3922:"price2",ai3923:"price3",ai3930:"priceISO0",ai3931:"priceISO1",ai3932:"priceISO2",ai3933:"priceISO3",ai3940:"percentDiscount0",ai3941:"percentDiscount1",ai3942:"percentDiscount2",ai3943:"percentDiscount3",ai3950:"pricePerUnitMeasure0",ai3951:"pricePerUnitMeasure1",ai3952:"pricePerUnitMeasure2",ai3953:"pricePerUnitMeasure3",ai3954:"pricePerUnitMeasure4",ai3955:"pricePerUnitMeasure5",ai400:"orderNumber",ai401:"ginc",ai402:"gsin",ai403:"route",ai410:"shipTo",ai411:"billTo",ai412:"purchaseFrom",ai413:"shipFor",ai414:"locNo",ai415:"payTo",ai416:"prodServLoc",ai417:"party",ai420:"shipToPost",ai421:"shipToPostISO",ai422:"origin",ai423:"countryInitialProcess",ai424:"countryProcess",ai425:"countryDisassembly",ai426:"countryFullProcess",ai427:"originSubdivision",ai7001:"nsn",ai7002:"meatCut",ai7003:"expirationDateTime",ai7004:"activePotency",ai7005:"catchArea",ai7006:"firstFreezeDate",ai7007:"harvestDate",ai7008:"aquaticSpecies",ai7009:"fishingGearType",ai7010:"prodMethod",ai7020:"refurbLot",ai7021:"funcStat",ai7022:"revStat",ai7023:"giaiAssembly",ai7030:"processor",ai7031:"processor2",ai7032:"processor3",ai7033:"processor4",ai7034:"processor5",ai7035:"processor6",ai7036:"processor7",ai7037:"processor8",ai7038:"processor9",ai7039:"processor10",ai7040:"uicExt",ai7041:"ufrgtUnitType",ai710:"nhrnPzn",ai711:"nhrnCip",ai712:"nhrnCn",ai713:"nhrnDrn",ai714:"nhrnAim",ai715:"nhrnDnc",ai716:"nhrnAic",ai8001:"rollProducts",ai8002:"cmtNo",ai8003:"grai",ai8004:"giai",ai8005:"pricePerUnit",ai8006:"itip",ai8007:"iban",ai8008:"prodTime",ai8009:"opticalSensor",ai8010:"cpid",ai8011:"cpidSerial",ai8012:"version",ai8013:"gmn",ai8017:"gsrnProvider",ai8018:"gsrnRecipient",ai8019:"srin",ai8020:"refNo",ai8026:"itipContent",ai8030:"digSig",ai8110:"coupon",ai8111:"points",ai8112:"couponExtended",ai8200:"productURL",ai90:"internal1",ai91:"internal2",ai92:"internal3",ai93:"internal4",ai94:"internal5",ai95:"internal6",ai96:"internal7",ai97:"internal8",ai98:"internal9",ai99:"internal10"};var M=String.fromCodePoint(29),l=/^\d+$/;var A=class extends Error{static{r(this,"InternalError")}constructor(i,E){super(i),this.name="InternalError",this.code=i,this.ex=E}ex;code},R=class extends Error{static{r(this,"InvalidAiError")}constructor(i,E){let S;i?S=`Invalid AI identifier "${E}" after "${i}"`:S=`Invalid first AI identifier "${E}"`,super(S),this.name="InvalidAiError"}},G=class extends Error{static{r(this,"BarcodeError")}constructor(i,E,S){super(S),this.name="BarcodeError",this.num=i,this.code=E,this.des=S}num;code;des},H=class{static{r(this,"ParsedElementClass")}ai;dataTitle;data;dataString;unit;constructor(i,E,S){switch(this.ai=i,this.dataTitle=E,this.unit="",this.dataString="",S){case"S":this.data="";break;case"N":this.data=0;break;case"D":this.data=new Date,this.data.setHours(0,0,0,0);break;default:this.data="";break}}},C=class{constructor(i,E,S={}){this.codeName=i;this.denormalized=E;this.data=S}static{r(this,"DecodeResult")}};function m(_,i){let E=_,S=E.slice(0,1);for(;S===i;)E=E.slice(1),S=E.slice(0,1);return E}r(m,"cleanCodestring");function F(_,i,E){if(i<0||i>11)return!1;let S=i;E===0&&S++;let t=new Date(_,S,E);return t.getFullYear()===_&&t.getMonth()===i&&(t.getDate()===E||E===0)}r(F,"checkValidDate");function h(_,i){let E=_.length-i,S=_.slice(0,E)+"."+_.slice(E);try{return Number.parseFloat(S)}catch(t){throw new A("36",t)}}r(h,"parseFloatingPoint");function n(_,i,E){let S=new H(_,i,"D"),t=_.length,a=E.slice(t,t+6),e=0,L=0,O=0;try{e=Number.parseInt(a.slice(0,2),10)}catch(N){throw new A("33",N)}try{L=Number.parseInt(a.slice(2,4),10)-1}catch(N){throw new A("34",N)}try{O=Number.parseInt(a.slice(4,6),10)}catch(N){throw new A("35",N)}if(e>50?e=e+1900:e=e+2e3,!F(e,L,O))throw new G(7,"36",`Invalid date "${a}" for AI "${_}".`);return O===0&&L++,S.data.setFullYear(e,L,O),S.dataString=a,{element:S,codestring:E.slice(t+6,E.length)}}r(n,"parseDate");function s(_,i,E,S,t=!1){let a=new H(_,i,"S"),e=_.length,L=S.slice(e,E+e);if(L.length<E)throw new G(9,"37",`Data length ${L.length} is less than expected length ${E} for AI "${_}".`);if(t&&!l.test(L))throw new G(11,"39",`Numeric data expected for AI "${_}", but got "${L}".`);a.data=L,a.dataString=L;let O=S.slice(E+e,S.length);return{element:a,codestring:O}}r(s,"parseFixedLength");function T(_,i,E,S,t,a=!1){let e=new H(_,i,"S"),L=_.length,O=E.indexOf(S),N="";if(O===-1?t&&t>0?(e.data=E.slice(L,t+L),N=E.replace(_+e.data,"")):e.data=E.slice(L,E.length):(e.data=E.slice(L,O),N=E.slice(O+1,E.length)),e.data==="")throw new G(10,"38",`Variable length data for AI "${_}" is empty.`);if(a&&!l.test(e.data))throw new G(11,"39",`Numeric data expected for AI "${_}", but got "${e.data}".`);return e.dataString=e.data,{element:e,codestring:N}}r(T,"parseVariableLength");function D(_,i,E,S,t,a){let e=new H(_+i,E,"N"),L=_.length+1,O=t.indexOf(a),N=Number.parseInt(i,10),u="",U="";return O===-1?u=t.slice(L,t.length):(u=t.slice(L,O),U=t.slice(O+1,t.length)),e.data=h(u,N),e.dataString=u,e.unit=S,{element:e,codestring:U}}r(D,"parseVariableLengthMeasure");function I(_,i,E,S,t){let a=new H(_+i,E,"N"),e=_.length+1;if(!l.test(i))throw new R(_,i);let L=Number.parseInt(i,10),O=t.slice(e,e+6);if(!l.test(O))throw new G(11,"39",`Numeric data expected for AI "${_+i}", but got "${O}".`);a.data=h(O,L),a.dataString=O,a.unit=S;let N=t.slice(e+6,t.length);return{element:a,codestring:N}}r(I,"parseFixedLengthMeasure");function o(_,i,E,S,t){let a=new H(_+i,E,"N"),e=_.length+1,L=S.indexOf(t),O=Number.parseInt(i,10),N="",u="",U="";return L===-1?N=S.slice(e,S.length):(N=S.slice(e,L),U=S.slice(L+1,S.length)),u=N.slice(3,N.length),a.data=h(u,O),a.dataString=u,a.unit=N.slice(0,3),{element:a,codestring:U}}r(o,"parseVariableLengthWithISONumbers");function c(_,i,E,S){let t=new H(_,i,"S"),a=_.length,e=E.indexOf(S),L="",O="";return e===-1?L=E.slice(a,E.length):(L=E.slice(a,e),O=E.slice(e+1,E.length)),t.data=L.slice(3,L.length),t.unit=L.slice(0,3),t.dataString=L,{element:t,codestring:O}}r(c,"parseVariableLengthWithISOChars");function w(_,i,E){E||(E=M);let S=_.slice(0,1),t=_.slice(1,2),a="",e="";switch(S){case"0":switch(t){case"0":return s("00","SSCC",18,_,!0);case"1":return s("01","GTIN",14,_,!0);case"2":return s("02","CONTENT",14,_);case"3":return s("03","MTO GTIN",14,_);default:throw new R("0",t)}case"1":switch(t){case"0":return T("10","BATCH/LOT",_,E,i??20);case"1":return n("11","PROD DATE",_);case"2":return n("12","DUE DATE",_);case"3":return n("13","PACK DATE",_);case"5":return n("15","BEST BEFORE or BEST BY",_);case"6":return n("16","SELL BY",_);case"7":return n("17","USE BY OR EXPIRY",_);default:throw new R("1",t)}case"2":switch(t){case"0":return s("20","VARIANT",2,_);case"1":return T("21","SERIAL",_,E,i??20);case"2":return T("22","CPV",_,E,20);case"3":switch(a=_.slice(2,3),a){case"5":return T("235","TPX",_,E,28);default:throw new R("23",a)}case"4":switch(a=_.slice(2,3),a){case"0":return T("240","ADDITIONAL ID",_,E,30);case"1":return T("241","CUST. PART NO.",_,E,30);case"2":return T("242","MTO VARIANT",_,E,6,!0);case"3":return T("243","PCN",_,E,20);default:throw new R("24",a)}case"5":switch(a=_.slice(2,3),a){case"0":return T("250","SECONDARY SERIAL",_,E,30);case"1":return T("251","REF. TO SOURCE",_,E,30);case"3":return T("253","GDTI",_,E,42);case"4":return T("254","GLN EXTENSION COMPONENT",_,E,20);case"5":return T("255","GCN",_,E,25,!0);default:throw new R("25",a)}default:throw new R("2",t)}case"3":switch(t){case"0":return T("30","VAR. COUNT",_,E,8,!0);case"1":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return I("310",e,"NET WEIGHT (kg)","KGM",_);case"1":return I("311",e,"LENGTH (m)","MTR",_);case"2":return I("312",e,"WIDTH (m)","MTR",_);case"3":return I("313",e,"HEIGHT (m)","MTR",_);case"4":return I("314",e,"AREA (m2)","MTK",_);case"5":return I("315",e,"NET VOLUME (l)","LTR",_);case"6":return I("316",e,"NET VOLUME (m3)","MTQ",_);default:throw new R("31",a)}case"2":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return I("320",e,"NET WEIGHT (lb)","LBR",_);case"1":return I("321",e,"LENGTH (i)","INH",_);case"2":return I("322",e,"LENGTH (f)","FOT",_);case"3":return I("323",e,"LENGTH (y)","YRD",_);case"4":return I("324",e,"WIDTH (i)","INH",_);case"5":return I("325",e,"WIDTH (f)","FOT",_);case"6":return I("326",e,"WIDTH (y)","YRD",_);case"7":return I("327",e,"HEIGHT (i)","INH",_);case"8":return I("328",e,"HEIGHT (f)","FOT",_);case"9":return I("329",e,"HEIGHT (y)","YRD",_);default:throw new R("32",a)}case"3":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return I("330",e,"GROSS WEIGHT (kg)","KGM",_);case"1":return I("331",e,"LENGTH (m), log","MTR",_);case"2":return I("332",e,"WIDTH (m), log","MTR",_);case"3":return I("333",e,"HEIGHT (m), log","MTR",_);case"4":return I("334",e,"AREA (m2), log","MTK",_);case"5":return I("335",e,"VOLUME (l), log","LTR",_);case"6":return I("336",e,"VOLUME (m3), log","MTQ",_);case"7":return I("337",e,"KG PER m\xB2","28",_);default:throw new R("33",a)}case"4":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return I("340",e,"GROSS WEIGHT (lb)","LBR",_);case"1":return I("341",e,"LENGTH (i), log","INH",_);case"2":return I("342",e,"LENGTH (f), log","FOT",_);case"3":return I("343",e,"LENGTH (y), log","YRD",_);case"4":return I("344",e,"WIDTH (i), log","INH",_);case"5":return I("345",e,"WIDTH (f), log","FOT",_);case"6":return I("346",e,"WIDTH (y), log","YRD",_);case"7":return I("347",e,"HEIGHT (i), log","INH",_);case"8":return I("348",e,"HEIGHT (f), log","FOT",_);case"9":return I("349",e,"HEIGHT (y), log","YRD",_);default:throw new R("33",a)}case"5":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return I("350",e,"AREA (i2)","INK",_);case"1":return I("351",e,"AREA (f2)","FTK",_);case"2":return I("352",e,"AREA (y2)","YDK",_);case"3":return I("353",e,"AREA (i2), log","INK",_);case"4":return I("354",e,"AREA (f2), log","FTK",_);case"5":return I("355",e,"AREA (y2), log","YDK",_);case"6":return I("356",e,"NET WEIGHT (t)","APZ",_);case"7":return I("357",e,"NET VOLUME (oz)","ONZ",_);default:throw new R("35",a)}case"6":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return I("360",e,"NET VOLUME (q)","QT",_);case"1":return I("361",e,"NET VOLUME (g)","GLL",_);case"2":return I("362",e,"VOLUME (q), log","QT",_);case"3":return I("363",e,"VOLUME (g), log","GLL",_);case"4":return I("364",e,"VOLUME (i3)","INQ",_);case"5":return I("365",e,"VOLUME (f3)","FTQ",_);case"6":return I("366",e,"VOLUME (y3)","YDQ",_);case"7":return I("367",e,"VOLUME (i3), log","INQ",_);case"8":return I("368",e,"VOLUME (f3), log","FTQ",_);case"9":return I("369",e,"VOLUME (y3), log","YDQ",_);default:throw new R("36",a)}case"7":return T("37","COUNT",_,E,8);case"9":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":return D("390",e,"AMOUNT","",_,E);case"1":return o("391",e,"AMOUNT",_,E);case"2":return D("392",e,"PRICE","",_,E);case"3":return o("393",e,"PRICE",_,E);default:throw new R("39",a)}default:throw new R("3",t)}case"4":switch(t){case"0":switch(a=_.slice(2,3),a){case"0":return T("400","ORDER NUMBER",_,E,30);case"1":return T("401","GINC",_,E);case"2":return T("402","GSIN",_,E,17,!0);case"3":return T("403","ROUTE",_,E,30);default:throw new R("40",a)}case"1":switch(a=_.slice(2,3),a){case"0":return s("410","SHIP TO LOC",13,_,!0);case"1":return s("411","BILL TO",13,_,!0);case"2":return s("412","PURCHASE FROM",13,_,!0);case"3":return s("413","SHIP FOR LOC",13,_,!0);case"4":return s("414","LOC NO",13,_,!0);case"5":return s("415","PAY TO",13,_,!0);case"6":return s("416","PROD/SERV LOC",13,_,!0);case"7":return s("417","PARTY",13,_,!0);default:throw new R("41",a)}case"2":switch(a=_.slice(2,3),a){case"0":return T("420","SHIP TO POST",_,E,20);case"1":return c("421","SHIP TO POST",_,E);case"2":return s("422","ORIGIN",3,_,!0);case"3":return T("423","COUNTRY - INITIAL PROCESS.",_,E,15);case"4":return s("424","COUNTRY - PROCESS.",3,_,!0);case"5":return s("425","COUNTRY - DISASSEMBLY",3,_,!0);case"6":return s("426","COUNTRY - FULL PROCESS",3,_,!0);case"7":return T("427","ORIGIN SUBDIVISION",_,E,3);default:throw new R("42",a)}default:throw new R("4",t)}case"7":switch(t){case"0":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":switch(e){case"1":return T("7001","NSN",_,E,13,!0);case"2":return T("7002","MEAT CUT",_,E);case"3":return T("7003","EXPIRY TIME",_,E,10,!0);case"4":return T("7004","ACTIVE POTENCY",_,E,4,!0);case"5":return T("7005","CATCH AREA",_,E,12);case"6":return n("7006","FIRST FREEZE DATE",_);case"7":return T("7007","HARVEST DATE",_,E,12,!0);case"8":return T("7008","AQUATIC SPECIES",_,E,3);case"9":return T("7009","FISHING GEAR TYPE",_,E,10);default:throw new R("700",e)}case"1":switch(e){case"0":return T("7010","PROD METHOD",_,E,2);case"1":return T("7011","TEST BY DATE",_,E,10,!0);default:throw new R("701",e)}case"2":switch(e){case"0":return T("7020","REFURB LOT",_,E,20);case"1":return T("7021","FUNC STAT",_,E,20);case"2":return T("7022","REV STAT",_,E,20);case"3":return T("7023","GIAI - ASSEMBLY",_,E,30);default:throw new R("702",e)}case"3":return c("703"+e,"PROCESSOR # "+e,_,E);default:throw new R("70",a)}case"1":switch(a=_.slice(2,3),a){case"0":return T("710","NHRN PZN",_,E);case"1":return T("711","NHRN CIP",_,E);case"2":return T("712","NHRN CN",_,E);case"3":return T("713","NHRN DRN",_,E);case"4":return T("714","NHRN AIM",_,E);case"5":return T("715","NHRN NDC",_,E);case"6":return T("716","NHRN AIC",_,E);default:throw new R("71",a)}default:throw new R("7",t)}case"8":switch(t){case"0":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"0":switch(e){case"1":return T("8001","DIMENSIONS",_,E,14);case"2":return T("8002","CMT No",_,E);case"3":return T("8003","GRAI",_,E);case"4":return T("8004","GIAI",_,E);case"5":return T("8005","PRICE PER UNIT",_,E,6);case"6":return T("8006","GCTIN",_,E,18);case"7":return T("8007","IBAN",_,E);case"8":return T("8008","PROD TIME",_,E,12);default:throw new R("800",e)}case"1":switch(e){case"0":return T("8010","CPID",_,E);case"1":return T("8011","CPID SERIAL",_,E);case"7":return T("8017","GSRN - PROVIDER",_,E,18);case"8":return T("8018","GSRN - RECIPIENT",_,E,18,!0);case"9":return T("8019","SRIN",_,E,void 0,!0);default:throw new R("801",e)}case"2":switch(e){case"0":return T("8020","REF No",_,E);case"6":return T("8026","ITIP CONTENT",_,E,18,!0);default:throw new R("802",e)}case"3":switch(e){case"0":return T("8030","DIGSIG",_,E);default:throw new R("803",e)}default:throw new R("80",a)}case"1":switch(a=_.slice(2,3),e=_.slice(3,4),a){case"1":switch(e){case"0":return T("8110","-",_,E);case"1":return T("8111","POINTS",_,E,4,!0);case"2":return T("8112","-",_,E);default:throw new R("811",e)}default:throw new R("81",a)}case"2":switch(a=_.slice(2,3),a){case"0":return T("8200","PRODUCT URL",_,E);default:throw new R("82",a)}default:throw new R("8",t)}case"9":switch(t){case"0":return T("90","INTERNAL",_,E,30);case"1":return T("91","INTERNAL",_,E);case"2":return T("92","INTERNAL",_,E);case"3":return T("93","INTERNAL",_,E);case"4":return T("94","INTERNAL",_,E);case"5":return T("95","INTERNAL",_,E);case"6":return T("96","INTERNAL",_,E);case"7":return T("97","INTERNAL",_,E);case"8":return T("98","INTERNAL",_,E);case"9":return T("99","INTERNAL",_,E);default:throw new R("9",t)}default:throw new R("",S)}}r(w,"identifyAI");function g(_,i,E){if(!_||typeof _!="string")throw new G(2,"31","The barcode is empty or not a string.");let S=_.length,t={codeName:"",denormalized:"",parsedCodeItems:[]},a="",e=_.slice(0,3),L;switch(e){case"]C1":t.codeName="GS1-128",a=_.slice(3,S);break;case"]e0":t.codeName="GS1 DataBar",a=_.slice(3,S);break;case"]e1":case"]e2":t.codeName="GS1 Composite",a=_.slice(3,S);break;case"]d2":t.codeName="GS1 DataMatrix",a=_.slice(3,S);break;case"]Q3":t.codeName="GS1 QR Code",a=_.slice(3,S);break;default:t.codeName="",a=_;break}for(t.parsedCodeItems=[];a.length>0;)try{L=w(a,E),a=m(L.codestring,i),t.parsedCodeItems.push(L.element),t.denormalized+="("+L.element.ai+")"+L.element.dataString}catch(O){if(O instanceof A)B(O);else throw O}return t}r(g,"parseBarcode");function B(_){switch(_.code){case"32":throw new G(6,32,"Invalid normal AI.");case"33":throw new G(7,33,"The year of the date is not valid.");case"34":throw new G(7,34,"The month of the date is not valid.");case"36":throw new G(8,36,"Invalid numbers");default:throw _}}r(B,"handleInternalError");var P=class{static{r(this,"GS1Parser")}fncChar;lotLen;constructor(i){this.fncChar=i?.fncChar||M,this.lotLen=i?.lotMaxLength}decode(i){let E=i.replaceAll("(",this.fncChar).replaceAll(")","");E.startsWith(this.fncChar)&&(E=E.slice(1));let S=g(E,this.fncChar,this.lotLen),t={};for(let a of S.parsedCodeItems){let e=V["ai"+a.ai];e&&(t[e]=a)}return new C(S.codeName,S.denormalized,t)}};export{P as GS1Parser};
1
+ var w=Object.defineProperty;var N=(E,R)=>w(E,"name",{value:R,configurable:!0});var m=(_=>(_.SSCC="sscc",_.GTIN="gtin",_.CONTENT="content",_.BATCH="batch",_.PROD_DATE="prodDate",_.DUE_DATE="dueDate",_.PACK_DATE="packDate",_.BEST_BEFORE="bestBefore",_.SELL_BY="sellBy",_.EXP_DATE="expDate",_.VARIANT="variant",_.SERIAL="serial",_.HIBCC="hibcc",_.TPX="tpx",_.ADDITIONAL_PRODUCT_ID="additionalProductID",_.CUSTOMER_PART_NUMBER="customerPartNumber",_.MADE_TO_ORDER="madeToOrder",_.PACKAGING="packaging",_.SECONDARY_SERIAL_NUMBER="secondarySerialNumber",_.REF_SOURCE="refSource",_.GDTI="gdti",_.GLN_EXTENSION="glnExtension",_.GCN="gcn",_.VARIABLE_COUNT="variableCount",_.NET_WEIGHT_KG_0="netWeightKg0",_.NET_WEIGHT_KG_1="netWeightKg1",_.NET_WEIGHT_KG_2="netWeightKg2",_.NET_WEIGHT_KG_3="netWeightKg3",_.NET_WEIGHT_KG_4="netWeightKg4",_.NET_WEIGHT_KG_5="netWeightKg5",_.LENGTH_METERS_0="lengthMeters0",_.LENGTH_METERS_1="lengthMeters1",_.LENGTH_METERS_2="lengthMeters2",_.LENGTH_METERS_3="lengthMeters3",_.LENGTH_METERS_4="lengthMeters4",_.LENGTH_METERS_5="lengthMeters5",_.WIDTH_METERS_0="widthMeters0",_.WIDTH_METERS_1="widthMeters1",_.WIDTH_METERS_2="widthMeters2",_.WIDTH_METERS_3="widthMeters3",_.WIDTH_METERS_4="widthMeters4",_.WIDTH_METERS_5="widthMeters5",_.HEIGHT_METERS_0="heightMeters0",_.HEIGHT_METERS_1="heightMeters1",_.HEIGHT_METERS_2="heightMeters2",_.HEIGHT_METERS_3="heightMeters3",_.HEIGHT_METERS_4="heightMeters4",_.HEIGHT_METERS_5="heightMeters5",_.AREA_SQUARE_METERS_0="areaSquareMeters0",_.AREA_SQUARE_METERS_1="areaSquareMeters1",_.AREA_SQUARE_METERS_2="areaSquareMeters2",_.AREA_SQUARE_METERS_3="areaSquareMeters3",_.AREA_SQUARE_METERS_4="areaSquareMeters4",_.AREA_SQUARE_METERS_5="areaSquareMeters5",_.NET_VOLUME_LITERS_0="netVolumeLiters0",_.NET_VOLUME_LITERS_1="netVolumeLiters1",_.NET_VOLUME_LITERS_2="netVolumeLiters2",_.NET_VOLUME_LITERS_3="netVolumeLiters3",_.NET_VOLUME_LITERS_4="netVolumeLiters4",_.NET_VOLUME_LITERS_5="netVolumeLiters5",_.NET_VOLUME_CUBIC_METERS_0="netVolumeCubicMeters0",_.NET_VOLUME_CUBIC_METERS_1="netVolumeCubicMeters1",_.NET_VOLUME_CUBIC_METERS_2="netVolumeCubicMeters2",_.NET_VOLUME_CUBIC_METERS_3="netVolumeCubicMeters3",_.NET_VOLUME_CUBIC_METERS_4="netVolumeCubicMeters4",_.NET_VOLUME_CUBIC_METERS_5="netVolumeCubicMeters5",_.NET_WEIGHT_LB_0="netWeightLb0",_.NET_WEIGHT_LB_1="netWeightLb1",_.NET_WEIGHT_LB_2="netWeightLb2",_.NET_WEIGHT_LB_3="netWeightLb3",_.NET_WEIGHT_LB_4="netWeightLb4",_.NET_WEIGHT_LB_5="netWeightLb5",_.LENGTH_INCHES_0="lengthInches0",_.LENGTH_INCHES_1="lengthInches1",_.LENGTH_INCHES_2="lengthInches2",_.LENGTH_INCHES_3="lengthInches3",_.LENGTH_INCHES_4="lengthInches4",_.LENGTH_INCHES_5="lengthInches5",_.LENGTH_FEET_0="lengthFeet0",_.LENGTH_FEET_1="lengthFeet1",_.LENGTH_FEET_2="lengthFeet2",_.LENGTH_FEET_3="lengthFeet3",_.LENGTH_FEET_4="lengthFeet4",_.LENGTH_FEET_5="lengthFeet5",_.LENGTH_YARDS_0="lengthYards0",_.LENGTH_YARDS_1="lengthYards1",_.LENGTH_YARDS_2="lengthYards2",_.LENGTH_YARDS_3="lengthYards3",_.LENGTH_YARDS_4="lengthYards4",_.LENGTH_YARDS_5="lengthYards5",_.WIDTH_INCHES_0="widthInches0",_.WIDTH_INCHES_1="widthInches1",_.WIDTH_INCHES_2="widthInches2",_.WIDTH_INCHES_3="widthInches3",_.WIDTH_INCHES_4="widthInches4",_.WIDTH_INCHES_5="widthInches5",_.WIDTH_FEET_0="widthFeet0",_.WIDTH_FEET_1="widthFeet1",_.WIDTH_FEET_2="widthFeet2",_.WIDTH_FEET_3="widthFeet3",_.WIDTH_FEET_4="widthFeet4",_.WIDTH_FEET_5="widthFeet5",_.WIDTH_YARDS_0="widthYards0",_.WIDTH_YARDS_1="widthYards1",_.WIDTH_YARDS_2="widthYards2",_.WIDTH_YARDS_3="widthYards3",_.WIDTH_YARDS_4="widthYards4",_.WIDTH_YARDS_5="widthYards5",_.HEIGHT_INCHES_0="heightInches0",_.HEIGHT_INCHES_1="heightInches1",_.HEIGHT_INCHES_2="heightInches2",_.HEIGHT_INCHES_3="heightInches3",_.HEIGHT_INCHES_4="heightInches4",_.HEIGHT_INCHES_5="heightInches5",_.HEIGHT_FEET_0="heightFeet0",_.HEIGHT_FEET_1="heightFeet1",_.HEIGHT_FEET_2="heightFeet2",_.HEIGHT_FEET_3="heightFeet3",_.HEIGHT_FEET_4="heightFeet4",_.HEIGHT_FEET_5="heightFeet5",_.HEIGHT_YARDS_0="heightYards0",_.HEIGHT_YARDS_1="heightYards1",_.HEIGHT_YARDS_2="heightYards2",_.HEIGHT_YARDS_3="heightYards3",_.HEIGHT_YARDS_4="heightYards4",_.HEIGHT_YARDS_5="heightYards5",_.GROSS_WEIGHT_KG_0="grossWeightKg0",_.GROSS_WEIGHT_KG_1="grossWeightKg1",_.GROSS_WEIGHT_KG_2="grossWeightKg2",_.GROSS_WEIGHT_KG_3="grossWeightKg3",_.GROSS_WEIGHT_KG_4="grossWeightKg4",_.GROSS_WEIGHT_KG_5="grossWeightKg5",_.LENGTH_METERS_LOG_0="lengthMetersLog0",_.LENGTH_METERS_LOG_1="lengthMetersLog1",_.LENGTH_METERS_LOG_2="lengthMetersLog2",_.LENGTH_METERS_LOG_3="lengthMetersLog3",_.LENGTH_METERS_LOG_4="lengthMetersLog4",_.LENGTH_METERS_LOG_5="lengthMetersLog5",_.WIDTH_METERS_LOG_0="widthMetersLog0",_.WIDTH_METERS_LOG_1="widthMetersLog1",_.WIDTH_METERS_LOG_2="widthMetersLog2",_.WIDTH_METERS_LOG_3="widthMetersLog3",_.WIDTH_METERS_LOG_4="widthMetersLog4",_.WIDTH_METERS_LOG_5="widthMetersLog5",_.HEIGHT_METERS_LOG_0="heightMetersLog0",_.HEIGHT_METERS_LOG_1="heightMetersLog1",_.HEIGHT_METERS_LOG_2="heightMetersLog2",_.HEIGHT_METERS_LOG_3="heightMetersLog3",_.HEIGHT_METERS_LOG_4="heightMetersLog4",_.HEIGHT_METERS_LOG_5="heightMetersLog5",_.AREA_SQUARE_INCHES_0="areaSquareInches0",_.AREA_SQUARE_INCHES_1="areaSquareInches1",_.AREA_SQUARE_INCHES_2="areaSquareInches2",_.AREA_SQUARE_INCHES_3="areaSquareInches3",_.AREA_SQUARE_INCHES_4="areaSquareInches4",_.AREA_SQUARE_INCHES_5="areaSquareInches5",_.AREA_SQUARE_FEET_0="areaSquareFeet0",_.AREA_SQUARE_FEET_1="areaSquareFeet1",_.AREA_SQUARE_FEET_2="areaSquareFeet2",_.AREA_SQUARE_FEET_3="areaSquareFeet3",_.AREA_SQUARE_FEET_4="areaSquareFeet4",_.AREA_SQUARE_FEET_5="areaSquareFeet5",_.AREA_SQUARE_YARDS_0="areaSquareYards0",_.AREA_SQUARE_YARDS_1="areaSquareYards1",_.AREA_SQUARE_YARDS_2="areaSquareYards2",_.AREA_SQUARE_YARDS_3="areaSquareYards3",_.AREA_SQUARE_YARDS_4="areaSquareYards4",_.AREA_SQUARE_YARDS_5="areaSquareYards5",_.AREA_SQUARE_METERS_LOG_0="areaSquareMetersLog0",_.AREA_SQUARE_METERS_LOG_1="areaSquareMetersLog1",_.AREA_SQUARE_METERS_LOG_2="areaSquareMetersLog2",_.AREA_SQUARE_METERS_LOG_3="areaSquareMetersLog3",_.AREA_SQUARE_METERS_LOG_4="areaSquareMetersLog4",_.AREA_SQUARE_METERS_LOG_5="areaSquareMetersLog5",_.NET_WEIGHT_OUNCES_0="netWeightOunces0",_.NET_WEIGHT_OUNCES_1="netWeightOunces1",_.NET_WEIGHT_OUNCES_2="netWeightOunces2",_.NET_WEIGHT_OUNCES_3="netWeightOunces3",_.NET_WEIGHT_OUNCES_4="netWeightOunces4",_.NET_WEIGHT_OUNCES_5="netWeightOunces5",_.NET_VOLUME_QUARTS_0="netVolumeQuarts0",_.NET_VOLUME_QUARTS_1="netVolumeQuarts1",_.NET_VOLUME_QUARTS_2="netVolumeQuarts2",_.NET_VOLUME_QUARTS_3="netVolumeQuarts3",_.NET_VOLUME_QUARTS_4="netVolumeQuarts4",_.NET_VOLUME_QUARTS_5="netVolumeQuarts5",_.NET_VOLUME_GALLONS_0="netVolumeGallons0",_.NET_VOLUME_GALLONS_1="netVolumeGallons1",_.NET_VOLUME_GALLONS_2="netVolumeGallons2",_.NET_VOLUME_GALLONS_3="netVolumeGallons3",_.NET_VOLUME_GALLONS_4="netVolumeGallons4",_.NET_VOLUME_GALLONS_5="netVolumeGallons5",_.VOLUME_CUBIC_INCHES_0="volumeCubicInches0",_.VOLUME_CUBIC_INCHES_1="volumeCubicInches1",_.VOLUME_CUBIC_INCHES_2="volumeCubicInches2",_.VOLUME_CUBIC_INCHES_3="volumeCubicInches3",_.VOLUME_CUBIC_INCHES_4="volumeCubicInches4",_.VOLUME_CUBIC_INCHES_5="volumeCubicInches5",_.VOLUME_CUBIC_FEET_0="volumeCubicFeet0",_.VOLUME_CUBIC_FEET_1="volumeCubicFeet1",_.VOLUME_CUBIC_FEET_2="volumeCubicFeet2",_.VOLUME_CUBIC_FEET_3="volumeCubicFeet3",_.VOLUME_CUBIC_FEET_4="volumeCubicFeet4",_.VOLUME_CUBIC_FEET_5="volumeCubicFeet5",_.VOLUME_CUBIC_YARDS_0="volumeCubicYards0",_.VOLUME_CUBIC_YARDS_1="volumeCubicYards1",_.VOLUME_CUBIC_YARDS_2="volumeCubicYards2",_.VOLUME_CUBIC_YARDS_3="volumeCubicYards3",_.VOLUME_CUBIC_YARDS_4="volumeCubicYards4",_.VOLUME_CUBIC_YARDS_5="volumeCubicYards5",_.VOLUME_CUBIC_METERS_LOG_0="volumeCubicMetersLog0",_.VOLUME_CUBIC_METERS_LOG_1="volumeCubicMetersLog1",_.VOLUME_CUBIC_METERS_LOG_2="volumeCubicMetersLog2",_.VOLUME_CUBIC_METERS_LOG_3="volumeCubicMetersLog3",_.VOLUME_CUBIC_METERS_LOG_4="volumeCubicMetersLog4",_.VOLUME_CUBIC_METERS_LOG_5="volumeCubicMetersLog5",_.GROSS_WEIGHT_LB_0="grossWeightLb0",_.GROSS_WEIGHT_LB_1="grossWeightLb1",_.GROSS_WEIGHT_LB_2="grossWeightLb2",_.GROSS_WEIGHT_LB_3="grossWeightLb3",_.GROSS_WEIGHT_LB_4="grossWeightLb4",_.GROSS_WEIGHT_LB_5="grossWeightLb5",_.LENGTH_INCHES_LOG_0="lengthInchesLog0",_.LENGTH_INCHES_LOG_1="lengthInchesLog1",_.LENGTH_INCHES_LOG_2="lengthInchesLog2",_.LENGTH_INCHES_LOG_3="lengthInchesLog3",_.LENGTH_INCHES_LOG_4="lengthInchesLog4",_.LENGTH_INCHES_LOG_5="lengthInchesLog5",_.LENGTH_FEET_LOG_0="lengthFeetLog0",_.LENGTH_FEET_LOG_1="lengthFeetLog1",_.LENGTH_FEET_LOG_2="lengthFeetLog2",_.LENGTH_FEET_LOG_3="lengthFeetLog3",_.LENGTH_FEET_LOG_4="lengthFeetLog4",_.LENGTH_FEET_LOG_5="lengthFeetLog5",_.LENGTH_YARDS_LOG_0="lengthYardsLog0",_.LENGTH_YARDS_LOG_1="lengthYardsLog1",_.LENGTH_YARDS_LOG_2="lengthYardsLog2",_.LENGTH_YARDS_LOG_3="lengthYardsLog3",_.LENGTH_YARDS_LOG_4="lengthYardsLog4",_.LENGTH_YARDS_LOG_5="lengthYardsLog5",_.WIDTH_INCHES_LOG_0="widthInchesLog0",_.WIDTH_INCHES_LOG_1="widthInchesLog1",_.WIDTH_INCHES_LOG_2="widthInchesLog2",_.WIDTH_INCHES_LOG_3="widthInchesLog3",_.WIDTH_INCHES_LOG_4="widthInchesLog4",_.WIDTH_INCHES_LOG_5="widthInchesLog5",_.WIDTH_FEET_LOG_0="widthFeetLog0",_.WIDTH_FEET_LOG_1="widthFeetLog1",_.WIDTH_FEET_LOG_2="widthFeetLog2",_.WIDTH_FEET_LOG_3="widthFeetLog3",_.WIDTH_FEET_LOG_4="widthFeetLog4",_.WIDTH_FEET_LOG_5="widthFeetLog5",_.WIDTH_YARDS_LOG_0="widthYardsLog0",_.WIDTH_YARDS_LOG_1="widthYardsLog1",_.WIDTH_YARDS_LOG_2="widthYardsLog2",_.WIDTH_YARDS_LOG_3="widthYardsLog3",_.WIDTH_YARDS_LOG_4="widthYardsLog4",_.WIDTH_YARDS_LOG_5="widthYardsLog5",_.HEIGHT_INCHES_LOG_0="heightInchesLog0",_.HEIGHT_INCHES_LOG_1="heightInchesLog1",_.HEIGHT_INCHES_LOG_2="heightInchesLog2",_.HEIGHT_INCHES_LOG_3="heightInchesLog3",_.HEIGHT_INCHES_LOG_4="heightInchesLog4",_.HEIGHT_INCHES_LOG_5="heightInchesLog5",_.HEIGHT_FEET_LOG_0="heightFeetLog0",_.HEIGHT_FEET_LOG_1="heightFeetLog1",_.HEIGHT_FEET_LOG_2="heightFeetLog2",_.HEIGHT_FEET_LOG_3="heightFeetLog3",_.HEIGHT_FEET_LOG_4="heightFeetLog4",_.HEIGHT_FEET_LOG_5="heightFeetLog5",_.HEIGHT_YARDS_LOG_0="heightYardsLog0",_.HEIGHT_YARDS_LOG_1="heightYardsLog1",_.HEIGHT_YARDS_LOG_2="heightYardsLog2",_.HEIGHT_YARDS_LOG_3="heightYardsLog3",_.HEIGHT_YARDS_LOG_4="heightYardsLog4",_.HEIGHT_YARDS_LOG_5="heightYardsLog5",_.GROSS_WEIGHT_OUNCES_0="grossWeightOunces0",_.GROSS_WEIGHT_OUNCES_1="grossWeightOunces1",_.GROSS_WEIGHT_OUNCES_2="grossWeightOunces2",_.GROSS_WEIGHT_OUNCES_3="grossWeightOunces3",_.GROSS_WEIGHT_OUNCES_4="grossWeightOunces4",_.GROSS_WEIGHT_OUNCES_5="grossWeightOunces5",_.NET_VOLUME_FLUID_OUNCES_0="netVolumeFluidOunces0",_.NET_VOLUME_FLUID_OUNCES_1="netVolumeFluidOunces1",_.NET_VOLUME_FLUID_OUNCES_2="netVolumeFluidOunces2",_.NET_VOLUME_FLUID_OUNCES_3="netVolumeFluidOunces3",_.NET_VOLUME_FLUID_OUNCES_4="netVolumeFluidOunces4",_.NET_VOLUME_FLUID_OUNCES_5="netVolumeFluidOunces5",_.GROSS_VOLUME_QUARTS_0="grossVolumeQuarts0",_.GROSS_VOLUME_QUARTS_1="grossVolumeQuarts1",_.GROSS_VOLUME_QUARTS_2="grossVolumeQuarts2",_.GROSS_VOLUME_QUARTS_3="grossVolumeQuarts3",_.GROSS_VOLUME_QUARTS_4="grossVolumeQuarts4",_.GROSS_VOLUME_QUARTS_5="grossVolumeQuarts5",_.GROSS_VOLUME_GALLONS_0="grossVolumeGallons0",_.GROSS_VOLUME_GALLONS_1="grossVolumeGallons1",_.GROSS_VOLUME_GALLONS_2="grossVolumeGallons2",_.GROSS_VOLUME_GALLONS_3="grossVolumeGallons3",_.GROSS_VOLUME_GALLONS_4="grossVolumeGallons4",_.GROSS_VOLUME_GALLONS_5="grossVolumeGallons5",_.VOLUME_CUBIC_INCHES_LOG_0="volumeCubicInchesLog0",_.VOLUME_CUBIC_INCHES_LOG_1="volumeCubicInchesLog1",_.VOLUME_CUBIC_INCHES_LOG_2="volumeCubicInchesLog2",_.VOLUME_CUBIC_INCHES_LOG_3="volumeCubicInchesLog3",_.VOLUME_CUBIC_INCHES_LOG_4="volumeCubicInchesLog4",_.VOLUME_CUBIC_INCHES_LOG_5="volumeCubicInchesLog5",_.VOLUME_CUBIC_FEET_LOG_0="volumeCubicFeetLog0",_.VOLUME_CUBIC_FEET_LOG_1="volumeCubicFeetLog1",_.VOLUME_CUBIC_FEET_LOG_2="volumeCubicFeetLog2",_.VOLUME_CUBIC_FEET_LOG_3="volumeCubicFeetLog3",_.VOLUME_CUBIC_FEET_LOG_4="volumeCubicFeetLog4",_.VOLUME_CUBIC_FEET_LOG_5="volumeCubicFeetLog5",_.VOLUME_CUBIC_YARDS_LOG_0="volumeCubicYardsLog0",_.VOLUME_CUBIC_YARDS_LOG_1="volumeCubicYardsLog1",_.VOLUME_CUBIC_YARDS_LOG_2="volumeCubicYardsLog2",_.VOLUME_CUBIC_YARDS_LOG_3="volumeCubicYardsLog3",_.VOLUME_CUBIC_YARDS_LOG_4="volumeCubicYardsLog4",_.VOLUME_CUBIC_YARDS_LOG_5="volumeCubicYardsLog5",_.COUNT="count",_.AMOUNT_PAYABLE_0="amountPayable0",_.AMOUNT_PAYABLE_1="amountPayable1",_.AMOUNT_PAYABLE_2="amountPayable2",_.AMOUNT_PAYABLE_3="amountPayable3",_.AMOUNT_PAYABLE_4="amountPayable4",_.AMOUNT_PAYABLE_5="amountPayable5",_.AMOUNT_PAYABLE_ISO_0="amountPayableISO0",_.AMOUNT_PAYABLE_ISO_1="amountPayableISO1",_.AMOUNT_PAYABLE_ISO_2="amountPayableISO2",_.AMOUNT_PAYABLE_ISO_3="amountPayableISO3",_.AMOUNT_PAYABLE_ISO_4="amountPayableISO4",_.AMOUNT_PAYABLE_ISO_5="amountPayableISO5",_.PRICE_0="price0",_.PRICE_1="price1",_.PRICE_2="price2",_.PRICE_3="price3",_.PRICE_ISO_0="priceISO0",_.PRICE_ISO_1="priceISO1",_.PRICE_ISO_2="priceISO2",_.PRICE_ISO_3="priceISO3",_.PERCENT_DISCOUNT_0="percentDiscount0",_.PERCENT_DISCOUNT_1="percentDiscount1",_.PERCENT_DISCOUNT_2="percentDiscount2",_.PERCENT_DISCOUNT_3="percentDiscount3",_.PRICE_PER_UNIT_MEASURE_0="pricePerUnitMeasure0",_.PRICE_PER_UNIT_MEASURE_1="pricePerUnitMeasure1",_.PRICE_PER_UNIT_MEASURE_2="pricePerUnitMeasure2",_.PRICE_PER_UNIT_MEASURE_3="pricePerUnitMeasure3",_.PRICE_PER_UNIT_MEASURE_4="pricePerUnitMeasure4",_.PRICE_PER_UNIT_MEASURE_5="pricePerUnitMeasure5",_.ORDER_NUMBER="orderNumber",_.GINC="ginc",_.GSIN="gsin",_.ROUTE="route",_.SHIP_TO="shipTo",_.BILL_TO="billTo",_.PURCHASE_FROM="purchaseFrom",_.SHIP_FOR="shipFor",_.LOC_NO="locNo",_.PAY_TO="payTo",_.PROD_SERV_LOC="prodServLoc",_.PARTY="party",_.SHIP_TO_POST="shipToPost",_.SHIP_TO_POST_ISO="shipToPostISO",_.ORIGIN="origin",_.COUNTRY_INITIAL_PROCESS="countryInitialProcess",_.COUNTRY_PROCESS="countryProcess",_.COUNTRY_DISASSEMBLY="countryDisassembly",_.COUNTRY_FULL_PROCESS="countryFullProcess",_.ORIGIN_SUBDIVISION="originSubdivision",_.NSN="nsn",_.MEAT_CUT="meatCut",_.EXPIRATION_DATE_TIME="expirationDateTime",_.ACTIVE_POTENCY="activePotency",_.CATCH_AREA="catchArea",_.FIRST_FREEZE_DATE="firstFreezeDate",_.HARVEST_DATE="harvestDate",_.AQUATIC_SPECIES="aquaticSpecies",_.FISHING_GEAR_TYPE="fishingGearType",_.PROD_METHOD="prodMethod",_.REFURB_LOT="refurbLot",_.FUNC_STAT="funcStat",_.REV_STAT="revStat",_.GIAI_ASSEMBLY="giaiAssembly",_.PROCESSOR="processor",_.PROCESSOR_2="processor2",_.PROCESSOR_3="processor3",_.PROCESSOR_4="processor4",_.PROCESSOR_5="processor5",_.PROCESSOR_6="processor6",_.PROCESSOR_7="processor7",_.PROCESSOR_8="processor8",_.PROCESSOR_9="processor9",_.PROCESSOR_10="processor10",_.UIC_EXT="uicExt",_.UFRGT_UNIT_TYPE="ufrgtUnitType",_.NHRN_PZN="nhrnPzn",_.NHRN_CIP="nhrnCip",_.NHRN_CN="nhrnCn",_.NHRN_DRN="nhrnDrn",_.NHRN_AIM="nhrnAim",_.NHRN_DNC="nhrnDnc",_.NHRN_AIC="nhrnAic",_.ROLL_PRODUCTS="rollProducts",_.CMT_NO="cmtNo",_.GRAI="grai",_.GIAI="giai",_.PRICE_PER_UNIT="pricePerUnit",_.ITIP="itip",_.IBAN="iban",_.PROD_TIME="prodTime",_.OPTICAL_SENSOR="opticalSensor",_.CPID="cpid",_.CPID_SERIAL="cpidSerial",_.VERSION="version",_.GMN="gmn",_.GSRN_PROVIDER="gsrnProvider",_.GSRN_RECIPIENT="gsrnRecipient",_.SRIN="srin",_.REF_NO="refNo",_.ITIP_CONTENT="itipContent",_.DIG_SIG="digSig",_.COUPON="coupon",_.POINTS="points",_.COUPON_EXTENDED="couponExtended",_.PRODUCT_URL="productURL",_.INTERNAL_1="internal1",_.INTERNAL_2="internal2",_.INTERNAL_3="internal3",_.INTERNAL_4="internal4",_.INTERNAL_5="internal5",_.INTERNAL_6="internal6",_.INTERNAL_7="internal7",_.INTERNAL_8="internal8",_.INTERNAL_9="internal9",_.INTERNAL_10="internal10",_))(m||{}),g={ai00:"sscc",ai01:"gtin",ai02:"content",ai10:"batch",ai11:"prodDate",ai12:"dueDate",ai13:"packDate",ai15:"bestBefore",ai16:"sellBy",ai17:"expDate",ai20:"variant",ai21:"serial",ai22:"hibcc",ai235:"tpx",ai240:"additionalProductID",ai241:"customerPartNumber",ai242:"madeToOrder",ai243:"packaging",ai250:"secondarySerialNumber",ai251:"refSource",ai253:"gdti",ai254:"glnExtension",ai255:"gcn",ai30:"variableCount",ai310:"netWeightKg0",ai3100:"netWeightKg0",ai3101:"netWeightKg1",ai3102:"netWeightKg2",ai3103:"netWeightKg3",ai3104:"netWeightKg4",ai3105:"netWeightKg5",ai3110:"lengthMeters0",ai3111:"lengthMeters1",ai3112:"lengthMeters2",ai3113:"lengthMeters3",ai3114:"lengthMeters4",ai3115:"lengthMeters5",ai3120:"widthMeters0",ai3121:"widthMeters1",ai3122:"widthMeters2",ai3123:"widthMeters3",ai3124:"widthMeters4",ai3125:"widthMeters5",ai3130:"heightMeters0",ai3131:"heightMeters1",ai3132:"heightMeters2",ai3133:"heightMeters3",ai3134:"heightMeters4",ai3135:"heightMeters5",ai3140:"areaSquareMeters0",ai3141:"areaSquareMeters1",ai3142:"areaSquareMeters2",ai3143:"areaSquareMeters3",ai3144:"areaSquareMeters4",ai3145:"areaSquareMeters5",ai3150:"netVolumeLiters0",ai3151:"netVolumeLiters1",ai3152:"netVolumeLiters2",ai3153:"netVolumeLiters3",ai3154:"netVolumeLiters4",ai3155:"netVolumeLiters5",ai3160:"netVolumeCubicMeters0",ai3161:"netVolumeCubicMeters1",ai3162:"netVolumeCubicMeters2",ai3163:"netVolumeCubicMeters3",ai3164:"netVolumeCubicMeters4",ai3165:"netVolumeCubicMeters5",ai3200:"netWeightLb0",ai3201:"netWeightLb1",ai3202:"netWeightLb2",ai3203:"netWeightLb3",ai3204:"netWeightLb4",ai3205:"netWeightLb5",ai3210:"lengthInches0",ai3211:"lengthInches1",ai3212:"lengthInches2",ai3213:"lengthInches3",ai3214:"lengthInches4",ai3215:"lengthInches5",ai3220:"lengthFeet0",ai3221:"lengthFeet1",ai3222:"lengthFeet2",ai3223:"lengthFeet3",ai3224:"lengthFeet4",ai3225:"lengthFeet5",ai3230:"lengthYards0",ai3231:"lengthYards1",ai3232:"lengthYards2",ai3233:"lengthYards3",ai3234:"lengthYards4",ai3235:"lengthYards5",ai3240:"widthInches0",ai3241:"widthInches1",ai3242:"widthInches2",ai3243:"widthInches3",ai3244:"widthInches4",ai3245:"widthInches5",ai3250:"widthFeet0",ai3251:"widthFeet1",ai3252:"widthFeet2",ai3253:"widthFeet3",ai3254:"widthFeet4",ai3255:"widthFeet5",ai3260:"widthYards0",ai3261:"widthYards1",ai3262:"widthYards2",ai3263:"widthYards3",ai3264:"widthYards4",ai3265:"widthYards5",ai3270:"heightInches0",ai3271:"heightInches1",ai3272:"heightInches2",ai3273:"heightInches3",ai3274:"heightInches4",ai3275:"heightInches5",ai3280:"heightFeet0",ai3281:"heightFeet1",ai3282:"heightFeet2",ai3283:"heightFeet3",ai3284:"heightFeet4",ai3285:"heightFeet5",ai3290:"heightYards0",ai3291:"heightYards1",ai3292:"heightYards2",ai3293:"heightYards3",ai3294:"heightYards4",ai3295:"heightYards5",ai3300:"grossWeightKg0",ai3301:"grossWeightKg1",ai3302:"grossWeightKg2",ai3303:"grossWeightKg3",ai3304:"grossWeightKg4",ai3305:"grossWeightKg5",ai3310:"lengthMetersLog0",ai3311:"lengthMetersLog1",ai3312:"lengthMetersLog2",ai3313:"lengthMetersLog3",ai3314:"lengthMetersLog4",ai3315:"lengthMetersLog5",ai3320:"widthMetersLog0",ai3321:"widthMetersLog1",ai3322:"widthMetersLog2",ai3323:"widthMetersLog3",ai3324:"widthMetersLog4",ai3325:"widthMetersLog5",ai3330:"heightMetersLog0",ai3331:"heightMetersLog1",ai3332:"heightMetersLog2",ai3333:"heightMetersLog3",ai3334:"heightMetersLog4",ai3335:"heightMetersLog5",ai3340:"areaSquareInches0",ai3341:"areaSquareInches1",ai3342:"areaSquareInches2",ai3343:"areaSquareInches3",ai3344:"areaSquareInches4",ai3345:"areaSquareInches5",ai3350:"areaSquareFeet0",ai3351:"areaSquareFeet1",ai3352:"areaSquareFeet2",ai3353:"areaSquareFeet3",ai3354:"areaSquareFeet4",ai3355:"areaSquareFeet5",ai3360:"areaSquareYards0",ai3361:"areaSquareYards1",ai3362:"areaSquareYards2",ai3363:"areaSquareYards3",ai3364:"areaSquareYards4",ai3365:"areaSquareYards5",ai3370:"areaSquareMetersLog0",ai3371:"areaSquareMetersLog1",ai3372:"areaSquareMetersLog2",ai3373:"areaSquareMetersLog3",ai3374:"areaSquareMetersLog4",ai3375:"areaSquareMetersLog5",ai3400:"netWeightOunces0",ai3401:"netWeightOunces1",ai3402:"netWeightOunces2",ai3403:"netWeightOunces3",ai3404:"netWeightOunces4",ai3405:"netWeightOunces5",ai3410:"netVolumeQuarts0",ai3411:"netVolumeQuarts1",ai3412:"netVolumeQuarts2",ai3413:"netVolumeQuarts3",ai3414:"netVolumeQuarts4",ai3415:"netVolumeQuarts5",ai3420:"netVolumeGallons0",ai3421:"netVolumeGallons1",ai3422:"netVolumeGallons2",ai3423:"netVolumeGallons3",ai3424:"netVolumeGallons4",ai3425:"netVolumeGallons5",ai3430:"volumeCubicInches0",ai3431:"volumeCubicInches1",ai3432:"volumeCubicInches2",ai3433:"volumeCubicInches3",ai3434:"volumeCubicInches4",ai3435:"volumeCubicInches5",ai3440:"volumeCubicFeet0",ai3441:"volumeCubicFeet1",ai3442:"volumeCubicFeet2",ai3443:"volumeCubicFeet3",ai3444:"volumeCubicFeet4",ai3445:"volumeCubicFeet5",ai3450:"volumeCubicYards0",ai3451:"volumeCubicYards1",ai3452:"volumeCubicYards2",ai3453:"volumeCubicYards3",ai3454:"volumeCubicYards4",ai3455:"volumeCubicYards5",ai3460:"volumeCubicMetersLog0",ai3461:"volumeCubicMetersLog1",ai3462:"volumeCubicMetersLog2",ai3463:"volumeCubicMetersLog3",ai3464:"volumeCubicMetersLog4",ai3465:"volumeCubicMetersLog5",ai3500:"grossWeightLb0",ai3501:"grossWeightLb1",ai3502:"grossWeightLb2",ai3503:"grossWeightLb3",ai3504:"grossWeightLb4",ai3505:"grossWeightLb5",ai3510:"lengthInchesLog0",ai3511:"lengthInchesLog1",ai3512:"lengthInchesLog2",ai3513:"lengthInchesLog3",ai3514:"lengthInchesLog4",ai3515:"lengthInchesLog5",ai3520:"lengthFeetLog0",ai3521:"lengthFeetLog1",ai3522:"lengthFeetLog2",ai3523:"lengthFeetLog3",ai3524:"lengthFeetLog4",ai3525:"lengthFeetLog5",ai3530:"lengthYardsLog0",ai3531:"lengthYardsLog1",ai3532:"lengthYardsLog2",ai3533:"lengthYardsLog3",ai3534:"lengthYardsLog4",ai3535:"lengthYardsLog5",ai3540:"widthInchesLog0",ai3541:"widthInchesLog1",ai3542:"widthInchesLog2",ai3543:"widthInchesLog3",ai3544:"widthInchesLog4",ai3545:"widthInchesLog5",ai3550:"widthFeetLog0",ai3551:"widthFeetLog1",ai3552:"widthFeetLog2",ai3553:"widthFeetLog3",ai3554:"widthFeetLog4",ai3555:"widthFeetLog5",ai3560:"widthYardsLog0",ai3561:"widthYardsLog1",ai3562:"widthYardsLog2",ai3563:"widthYardsLog3",ai3564:"widthYardsLog4",ai3565:"widthYardsLog5",ai3570:"heightInchesLog0",ai3571:"heightInchesLog1",ai3572:"heightInchesLog2",ai3573:"heightInchesLog3",ai3574:"heightInchesLog4",ai3575:"heightInchesLog5",ai3580:"heightFeetLog0",ai3581:"heightFeetLog1",ai3582:"heightFeetLog2",ai3583:"heightFeetLog3",ai3584:"heightFeetLog4",ai3585:"heightFeetLog5",ai3590:"heightYardsLog0",ai3591:"heightYardsLog1",ai3592:"heightYardsLog2",ai3593:"heightYardsLog3",ai3594:"heightYardsLog4",ai3595:"heightYardsLog5",ai3600:"grossWeightOunces0",ai3601:"grossWeightOunces1",ai3602:"grossWeightOunces2",ai3603:"grossWeightOunces3",ai3604:"grossWeightOunces4",ai3605:"grossWeightOunces5",ai3610:"netVolumeFluidOunces0",ai3611:"netVolumeFluidOunces1",ai3612:"netVolumeFluidOunces2",ai3613:"netVolumeFluidOunces3",ai3614:"netVolumeFluidOunces4",ai3615:"netVolumeFluidOunces5",ai3620:"grossVolumeQuarts0",ai3621:"grossVolumeQuarts1",ai3622:"grossVolumeQuarts2",ai3623:"grossVolumeQuarts3",ai3624:"grossVolumeQuarts4",ai3625:"grossVolumeQuarts5",ai3630:"grossVolumeGallons0",ai3631:"grossVolumeGallons1",ai3632:"grossVolumeGallons2",ai3633:"grossVolumeGallons3",ai3634:"grossVolumeGallons4",ai3635:"grossVolumeGallons5",ai3640:"volumeCubicInchesLog0",ai3641:"volumeCubicInchesLog1",ai3642:"volumeCubicInchesLog2",ai3643:"volumeCubicInchesLog3",ai3644:"volumeCubicInchesLog4",ai3645:"volumeCubicInchesLog5",ai3650:"volumeCubicFeetLog0",ai3651:"volumeCubicFeetLog1",ai3652:"volumeCubicFeetLog2",ai3653:"volumeCubicFeetLog3",ai3654:"volumeCubicFeetLog4",ai3655:"volumeCubicFeetLog5",ai3660:"volumeCubicYardsLog0",ai3661:"volumeCubicYardsLog1",ai3662:"volumeCubicYardsLog2",ai3663:"volumeCubicYardsLog3",ai3664:"volumeCubicYardsLog4",ai3665:"volumeCubicYardsLog5",ai37:"count",ai3900:"amountPayable0",ai3901:"amountPayable1",ai3902:"amountPayable2",ai3903:"amountPayable3",ai3904:"amountPayable4",ai3905:"amountPayable5",ai3910:"amountPayableISO0",ai3911:"amountPayableISO1",ai3912:"amountPayableISO2",ai3913:"amountPayableISO3",ai3914:"amountPayableISO4",ai3915:"amountPayableISO5",ai3920:"price0",ai3921:"price1",ai3922:"price2",ai3923:"price3",ai3930:"priceISO0",ai3931:"priceISO1",ai3932:"priceISO2",ai3933:"priceISO3",ai3940:"percentDiscount0",ai3941:"percentDiscount1",ai3942:"percentDiscount2",ai3943:"percentDiscount3",ai3950:"pricePerUnitMeasure0",ai3951:"pricePerUnitMeasure1",ai3952:"pricePerUnitMeasure2",ai3953:"pricePerUnitMeasure3",ai3954:"pricePerUnitMeasure4",ai3955:"pricePerUnitMeasure5",ai400:"orderNumber",ai401:"ginc",ai402:"gsin",ai403:"route",ai410:"shipTo",ai411:"billTo",ai412:"purchaseFrom",ai413:"shipFor",ai414:"locNo",ai415:"payTo",ai416:"prodServLoc",ai417:"party",ai420:"shipToPost",ai421:"shipToPostISO",ai422:"origin",ai423:"countryInitialProcess",ai424:"countryProcess",ai425:"countryDisassembly",ai426:"countryFullProcess",ai427:"originSubdivision",ai7001:"nsn",ai7002:"meatCut",ai7003:"expirationDateTime",ai7004:"activePotency",ai7005:"catchArea",ai7006:"firstFreezeDate",ai7007:"harvestDate",ai7008:"aquaticSpecies",ai7009:"fishingGearType",ai7010:"prodMethod",ai7020:"refurbLot",ai7021:"funcStat",ai7022:"revStat",ai7023:"giaiAssembly",ai7030:"processor",ai7031:"processor2",ai7032:"processor3",ai7033:"processor4",ai7034:"processor5",ai7035:"processor6",ai7036:"processor7",ai7037:"processor8",ai7038:"processor9",ai7039:"processor10",ai7040:"uicExt",ai7041:"ufrgtUnitType",ai710:"nhrnPzn",ai711:"nhrnCip",ai712:"nhrnCn",ai713:"nhrnDrn",ai714:"nhrnAim",ai715:"nhrnDnc",ai716:"nhrnAic",ai8001:"rollProducts",ai8002:"cmtNo",ai8003:"grai",ai8004:"giai",ai8005:"pricePerUnit",ai8006:"itip",ai8007:"iban",ai8008:"prodTime",ai8009:"opticalSensor",ai8010:"cpid",ai8011:"cpidSerial",ai8012:"version",ai8013:"gmn",ai8017:"gsrnProvider",ai8018:"gsrnRecipient",ai8019:"srin",ai8020:"refNo",ai8026:"itipContent",ai8030:"digSig",ai8110:"coupon",ai8111:"points",ai8112:"couponExtended",ai8200:"productURL",ai90:"internal1",ai91:"internal2",ai92:"internal3",ai93:"internal4",ai94:"internal5",ai95:"internal6",ai96:"internal7",ai97:"internal8",ai98:"internal9",ai99:"internal10"};var D=String.fromCodePoint(29),M=/^\d+$/;var n=class extends Error{static{N(this,"InternalError")}constructor(R,e){super(R),this.name="InternalError",this.code=R,this.ex=e}ex;code},L=class extends Error{static{N(this,"InvalidAiError")}constructor(R,e){let i;R?i=`Invalid AI identifier "${e}" after "${R}"`:i=`Invalid first AI identifier "${e}"`,super(i),this.name="InvalidAiError"}},H=class extends Error{static{N(this,"BarcodeError")}constructor(R,e,i){super(i),this.name="BarcodeError",this.num=R,this.code=e,this.des=i}num;code;des},A=class{static{N(this,"ParsedElementClass")}ai;dataTitle;data;dataString;unit;type="";constructor(R,e,i){switch(this.ai=R,this.dataTitle=e,this.unit="",this.dataString="",i){case"string":this.data="",this.type="string";break;case"number":this.data=0,this.type="number";break;case"date":this.data=new Date,this.data.setHours(0,0,0,0),this.type="date";break;default:this.data="";break}}},C=class{constructor(R,e,i={}){this.codeName=R;this.denormalized=e;this.data=i}static{N(this,"DecodeResult")}};function F(E,R){let e=E,i=e.slice(0,1);for(;i===R;)e=e.slice(1),i=e.slice(0,1);return e}N(F,"cleanCodestring");function Y(E,R,e){if(R<0||R>11)return!1;let i=R;e===0&&i++;let S=new Date(E,i,e);return S.getFullYear()===E&&S.getMonth()===R&&(S.getDate()===e||e===0)}N(Y,"checkValidDate");function h(E,R){let e=E.length-R,i=E.slice(0,e)+"."+E.slice(e);try{return Number.parseFloat(i)}catch(S){throw new n("36",S)}}N(h,"parseFloatingPoint");function U(E,R,e){let i=new A(E,R,"date"),S=E.length,T=e.slice(S,S+6),a=0,O=0,r=0;try{a=Number.parseInt(T.slice(0,2),10)}catch(s){throw new n("33",s)}try{O=Number.parseInt(T.slice(2,4),10)-1}catch(s){throw new n("34",s)}try{r=Number.parseInt(T.slice(4,6),10)}catch(s){throw new n("35",s)}if(a>50?a=a+1900:a=a+2e3,!Y(a,O,r))throw new H(7,"36",`Invalid date "${T}" for AI "${E}".`);return r===0&&O++,i.data.setFullYear(a,O,r),i.dataString=T,{element:i,codestring:e.slice(S+6,e.length)}}N(U,"parseDate");function G(E,R,e,i,S=!1){let T=new A(E,R,"string"),a=E.length,O=i.slice(a,e+a);if(O.length<e)throw new H(9,"37",`Data length ${O.length} is less than expected length ${e} for AI "${E}".`);if(S&&!M.test(O))throw new H(11,"39",`Numeric data expected for AI "${E}", but got "${O}".`);T.data=O,T.dataString=O;let r=i.slice(e+a,i.length);return{element:T,codestring:r}}N(G,"parseFixedLength");function t(E,R,e,i,S,T=!1){let a=new A(E,R,"string"),O=E.length,r=e.indexOf(i),s="";if(r===-1?S&&S>0?(a.data=e.slice(O,S+O),s=e.replace(E+a.data,"")):a.data=e.slice(O,e.length):(a.data=e.slice(O,r),s=e.slice(r+1,e.length)),a.data==="")throw new H(10,"38",`Variable length data for AI "${E}" is empty.`);if(T&&!M.test(a.data))throw new H(11,"39",`Numeric data expected for AI "${E}", but got "${a.data}".`);return a.dataString=a.data,{element:a,codestring:s}}N(t,"parseVariableLength");function o(E,R,e,i,S,T){let a=new A(E+R,e,"number"),O=E.length+1,r=S.indexOf(T),s=Number.parseInt(R,10),u="",l="";return r===-1?u=S.slice(O,S.length):(u=S.slice(O,r),l=S.slice(r+1,S.length)),a.data=h(u,s),a.dataString=u,a.unit=i,{element:a,codestring:l}}N(o,"parseVariableLengthMeasure");function I(E,R,e,i,S){let T=new A(E+R,e,"number"),a=E.length+1;if(!M.test(R))throw new L(E,R);let O=Number.parseInt(R,10),r=S.slice(a,a+6);if(!M.test(r))throw new H(11,"39",`Numeric data expected for AI "${E+R}", but got "${r}".`);T.data=h(r,O),T.dataString=r,T.unit=i;let s=S.slice(a+6,S.length);return{element:T,codestring:s}}N(I,"parseFixedLengthMeasure");function c(E,R,e,i,S){let T=new A(E+R,e,"number"),a=E.length+1,O=i.indexOf(S),r=Number.parseInt(R,10),s="",u="",l="";return O===-1?s=i.slice(a,i.length):(s=i.slice(a,O),l=i.slice(O+1,i.length)),u=s.slice(3,s.length),T.data=h(u,r),T.dataString=u,T.unit=s.slice(0,3),{element:T,codestring:l}}N(c,"parseVariableLengthWithISONumbers");function P(E,R,e,i){let S=new A(E,R,"string"),T=E.length,a=e.indexOf(i),O="",r="";return a===-1?O=e.slice(T,e.length):(O=e.slice(T,a),r=e.slice(a+1,e.length)),S.data=O.slice(3,O.length),S.unit=O.slice(0,3),S.dataString=O,{element:S,codestring:r}}N(P,"parseVariableLengthWithISOChars");function p(E,R,e){e||(e=D);let i=E.slice(0,1),S=E.slice(1,2),T="",a="";switch(i){case"0":switch(S){case"0":return G("00","SSCC",18,E,!0);case"1":return G("01","GTIN",14,E,!0);case"2":return G("02","CONTENT",14,E);case"3":return G("03","MTO GTIN",14,E);default:throw new L("0",S)}case"1":switch(S){case"0":return t("10","BATCH/LOT",E,e,R??20);case"1":return U("11","PROD DATE",E);case"2":return U("12","DUE DATE",E);case"3":return U("13","PACK DATE",E);case"5":return U("15","BEST BEFORE or BEST BY",E);case"6":return U("16","SELL BY",E);case"7":return U("17","USE BY OR EXPIRY",E);default:throw new L("1",S)}case"2":switch(S){case"0":return G("20","VARIANT",2,E);case"1":return t("21","SERIAL",E,e,R??20);case"2":return t("22","CPV",E,e,20);case"3":switch(T=E.slice(2,3),T){case"5":return t("235","TPX",E,e,28);default:throw new L("23",T)}case"4":switch(T=E.slice(2,3),T){case"0":return t("240","ADDITIONAL ID",E,e,30);case"1":return t("241","CUST. PART NO.",E,e,30);case"2":return t("242","MTO VARIANT",E,e,6,!0);case"3":return t("243","PCN",E,e,20);default:throw new L("24",T)}case"5":switch(T=E.slice(2,3),T){case"0":return t("250","SECONDARY SERIAL",E,e,30);case"1":return t("251","REF. TO SOURCE",E,e,30);case"3":return t("253","GDTI",E,e,42);case"4":return t("254","GLN EXTENSION COMPONENT",E,e,20);case"5":return t("255","GCN",E,e,25,!0);default:throw new L("25",T)}default:throw new L("2",S)}case"3":switch(S){case"0":return t("30","VAR. COUNT",E,e,8,!0);case"1":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return I("310",a,"NET WEIGHT (kg)","KGM",E);case"1":return I("311",a,"LENGTH (m)","MTR",E);case"2":return I("312",a,"WIDTH (m)","MTR",E);case"3":return I("313",a,"HEIGHT (m)","MTR",E);case"4":return I("314",a,"AREA (m2)","MTK",E);case"5":return I("315",a,"NET VOLUME (l)","LTR",E);case"6":return I("316",a,"NET VOLUME (m3)","MTQ",E);default:throw new L("31",T)}case"2":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return I("320",a,"NET WEIGHT (lb)","LBR",E);case"1":return I("321",a,"LENGTH (i)","INH",E);case"2":return I("322",a,"LENGTH (f)","FOT",E);case"3":return I("323",a,"LENGTH (y)","YRD",E);case"4":return I("324",a,"WIDTH (i)","INH",E);case"5":return I("325",a,"WIDTH (f)","FOT",E);case"6":return I("326",a,"WIDTH (y)","YRD",E);case"7":return I("327",a,"HEIGHT (i)","INH",E);case"8":return I("328",a,"HEIGHT (f)","FOT",E);case"9":return I("329",a,"HEIGHT (y)","YRD",E);default:throw new L("32",T)}case"3":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return I("330",a,"GROSS WEIGHT (kg)","KGM",E);case"1":return I("331",a,"LENGTH (m), log","MTR",E);case"2":return I("332",a,"WIDTH (m), log","MTR",E);case"3":return I("333",a,"HEIGHT (m), log","MTR",E);case"4":return I("334",a,"AREA (m2), log","MTK",E);case"5":return I("335",a,"VOLUME (l), log","LTR",E);case"6":return I("336",a,"VOLUME (m3), log","MTQ",E);case"7":return I("337",a,"KG PER m\xB2","28",E);default:throw new L("33",T)}case"4":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return I("340",a,"GROSS WEIGHT (lb)","LBR",E);case"1":return I("341",a,"LENGTH (i), log","INH",E);case"2":return I("342",a,"LENGTH (f), log","FOT",E);case"3":return I("343",a,"LENGTH (y), log","YRD",E);case"4":return I("344",a,"WIDTH (i), log","INH",E);case"5":return I("345",a,"WIDTH (f), log","FOT",E);case"6":return I("346",a,"WIDTH (y), log","YRD",E);case"7":return I("347",a,"HEIGHT (i), log","INH",E);case"8":return I("348",a,"HEIGHT (f), log","FOT",E);case"9":return I("349",a,"HEIGHT (y), log","YRD",E);default:throw new L("33",T)}case"5":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return I("350",a,"AREA (i2)","INK",E);case"1":return I("351",a,"AREA (f2)","FTK",E);case"2":return I("352",a,"AREA (y2)","YDK",E);case"3":return I("353",a,"AREA (i2), log","INK",E);case"4":return I("354",a,"AREA (f2), log","FTK",E);case"5":return I("355",a,"AREA (y2), log","YDK",E);case"6":return I("356",a,"NET WEIGHT (t)","APZ",E);case"7":return I("357",a,"NET VOLUME (oz)","ONZ",E);default:throw new L("35",T)}case"6":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return I("360",a,"NET VOLUME (q)","QT",E);case"1":return I("361",a,"NET VOLUME (g)","GLL",E);case"2":return I("362",a,"VOLUME (q), log","QT",E);case"3":return I("363",a,"VOLUME (g), log","GLL",E);case"4":return I("364",a,"VOLUME (i3)","INQ",E);case"5":return I("365",a,"VOLUME (f3)","FTQ",E);case"6":return I("366",a,"VOLUME (y3)","YDQ",E);case"7":return I("367",a,"VOLUME (i3), log","INQ",E);case"8":return I("368",a,"VOLUME (f3), log","FTQ",E);case"9":return I("369",a,"VOLUME (y3), log","YDQ",E);default:throw new L("36",T)}case"7":return t("37","COUNT",E,e,8);case"9":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":return o("390",a,"AMOUNT","",E,e);case"1":return c("391",a,"AMOUNT",E,e);case"2":return o("392",a,"PRICE","",E,e);case"3":return c("393",a,"PRICE",E,e);default:throw new L("39",T)}default:throw new L("3",S)}case"4":switch(S){case"0":switch(T=E.slice(2,3),T){case"0":return t("400","ORDER NUMBER",E,e,30);case"1":return t("401","GINC",E,e);case"2":return t("402","GSIN",E,e,17,!0);case"3":return t("403","ROUTE",E,e,30);default:throw new L("40",T)}case"1":switch(T=E.slice(2,3),T){case"0":return G("410","SHIP TO LOC",13,E,!0);case"1":return G("411","BILL TO",13,E,!0);case"2":return G("412","PURCHASE FROM",13,E,!0);case"3":return G("413","SHIP FOR LOC",13,E,!0);case"4":return G("414","LOC NO",13,E,!0);case"5":return G("415","PAY TO",13,E,!0);case"6":return G("416","PROD/SERV LOC",13,E,!0);case"7":return G("417","PARTY",13,E,!0);default:throw new L("41",T)}case"2":switch(T=E.slice(2,3),T){case"0":return t("420","SHIP TO POST",E,e,20);case"1":return P("421","SHIP TO POST",E,e);case"2":return G("422","ORIGIN",3,E,!0);case"3":return t("423","COUNTRY - INITIAL PROCESS.",E,e,15);case"4":return G("424","COUNTRY - PROCESS.",3,E,!0);case"5":return G("425","COUNTRY - DISASSEMBLY",3,E,!0);case"6":return G("426","COUNTRY - FULL PROCESS",3,E,!0);case"7":return t("427","ORIGIN SUBDIVISION",E,e,3);default:throw new L("42",T)}default:throw new L("4",S)}case"7":switch(S){case"0":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":switch(a){case"1":return t("7001","NSN",E,e,13,!0);case"2":return t("7002","MEAT CUT",E,e);case"3":return t("7003","EXPIRY TIME",E,e,10,!0);case"4":return t("7004","ACTIVE POTENCY",E,e,4,!0);case"5":return t("7005","CATCH AREA",E,e,12);case"6":return U("7006","FIRST FREEZE DATE",E);case"7":return t("7007","HARVEST DATE",E,e,12,!0);case"8":return t("7008","AQUATIC SPECIES",E,e,3);case"9":return t("7009","FISHING GEAR TYPE",E,e,10);default:throw new L("700",a)}case"1":switch(a){case"0":return t("7010","PROD METHOD",E,e,2);case"1":return t("7011","TEST BY DATE",E,e,10,!0);default:throw new L("701",a)}case"2":switch(a){case"0":return t("7020","REFURB LOT",E,e,20);case"1":return t("7021","FUNC STAT",E,e,20);case"2":return t("7022","REV STAT",E,e,20);case"3":return t("7023","GIAI - ASSEMBLY",E,e,30);default:throw new L("702",a)}case"3":return P("703"+a,"PROCESSOR # "+a,E,e);default:throw new L("70",T)}case"1":switch(T=E.slice(2,3),T){case"0":return t("710","NHRN PZN",E,e);case"1":return t("711","NHRN CIP",E,e);case"2":return t("712","NHRN CN",E,e);case"3":return t("713","NHRN DRN",E,e);case"4":return t("714","NHRN AIM",E,e);case"5":return t("715","NHRN NDC",E,e);case"6":return t("716","NHRN AIC",E,e);default:throw new L("71",T)}default:throw new L("7",S)}case"8":switch(S){case"0":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"0":switch(a){case"1":return t("8001","DIMENSIONS",E,e,14);case"2":return t("8002","CMT No",E,e);case"3":return t("8003","GRAI",E,e);case"4":return t("8004","GIAI",E,e);case"5":return t("8005","PRICE PER UNIT",E,e,6);case"6":return t("8006","GCTIN",E,e,18);case"7":return t("8007","IBAN",E,e);case"8":return t("8008","PROD TIME",E,e,12);default:throw new L("800",a)}case"1":switch(a){case"0":return t("8010","CPID",E,e);case"1":return t("8011","CPID SERIAL",E,e);case"7":return t("8017","GSRN - PROVIDER",E,e,18);case"8":return t("8018","GSRN - RECIPIENT",E,e,18,!0);case"9":return t("8019","SRIN",E,e,void 0,!0);default:throw new L("801",a)}case"2":switch(a){case"0":return t("8020","REF No",E,e);case"6":return t("8026","ITIP CONTENT",E,e,18,!0);default:throw new L("802",a)}case"3":switch(a){case"0":return t("8030","DIGSIG",E,e);default:throw new L("803",a)}default:throw new L("80",T)}case"1":switch(T=E.slice(2,3),a=E.slice(3,4),T){case"1":switch(a){case"0":return t("8110","-",E,e);case"1":return t("8111","POINTS",E,e,4,!0);case"2":return t("8112","-",E,e);default:throw new L("811",a)}default:throw new L("81",T)}case"2":switch(T=E.slice(2,3),T){case"0":return t("8200","PRODUCT URL",E,e);default:throw new L("82",T)}default:throw new L("8",S)}case"9":switch(S){case"0":return t("90","INTERNAL",E,e,30);case"1":return t("91","INTERNAL",E,e);case"2":return t("92","INTERNAL",E,e);case"3":return t("93","INTERNAL",E,e);case"4":return t("94","INTERNAL",E,e);case"5":return t("95","INTERNAL",E,e);case"6":return t("96","INTERNAL",E,e);case"7":return t("97","INTERNAL",E,e);case"8":return t("98","INTERNAL",E,e);case"9":return t("99","INTERNAL",E,e);default:throw new L("9",S)}default:throw new L("",i)}}N(p,"identifyAI");function W(E,R,e){if(!E||typeof E!="string")throw new H(2,"31","The barcode is empty or not a string.");let i=E.length,S={codeName:"",denormalized:"",parsedCodeItems:[]},T="",a=E.slice(0,3),O;switch(a){case"]C1":S.codeName="GS1-128",T=E.slice(3,i);break;case"]e0":S.codeName="GS1 DataBar",T=E.slice(3,i);break;case"]e1":case"]e2":S.codeName="GS1 Composite",T=E.slice(3,i);break;case"]d2":S.codeName="GS1 DataMatrix",T=E.slice(3,i);break;case"]Q3":S.codeName="GS1 QR Code",T=E.slice(3,i);break;default:S.codeName="",T=E;break}for(S.parsedCodeItems=[];T.length>0;)try{O=p(T,e),T=F(O.codestring,R),S.parsedCodeItems.push(O.element),S.denormalized+="("+O.element.ai+")"+O.element.dataString}catch(r){if(r instanceof n)b(r);else throw r}return S}N(W,"parseBarcode");function b(E){switch(E.code){case"32":throw new H(6,32,"Invalid normal AI.");case"33":throw new H(7,33,"The year of the date is not valid.");case"34":throw new H(7,34,"The month of the date is not valid.");case"36":throw new H(8,36,"Invalid numbers");default:throw E}}N(b,"handleInternalError");var V=class{static{N(this,"GS1Parser")}fncChar;lotLen;constructor(R){this.fncChar=R?.fncChar||D,this.lotLen=R?.lotMaxLength}decode(R){let e=R.replaceAll("(",this.fncChar).replaceAll(")","");e.startsWith(this.fncChar)&&(e=e.slice(1));let i=W(e,this.fncChar,this.lotLen),S={};for(let T of i.parsedCodeItems){let a=g["ai"+T.ai];a&&(S[a]=T)}return new C(i.codeName,i.denormalized,S)}};export{C as DecodeResult,m as GS1Field,V as GS1Parser};
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@valentynb/gs1-parser",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A typescript gs1-barcode parser. Based on code from https://github.com/PeterBrockfeld/BarcodeParser",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "type": "module",
8
8
  "scripts": {
9
- "dev": "vite",
10
9
  "build": "tsup src/index.ts --dts --format esm,cjs --clean --minify --keep-names",
10
+ "dev": "vite",
11
+ "docs": "typedoc",
11
12
  "test": "vitest"
12
13
  },
13
14
  "publishConfig": {
@@ -27,7 +28,7 @@
27
28
  ],
28
29
  "author": "Valentyn Blaha",
29
30
  "license": "MIT",
30
- "homepage": "https://github.com/valentynblaha/gs1-parser#readme",
31
+ "homepage": "https://valentynblaha.github.io/gs1-parser",
31
32
  "repository": {
32
33
  "url": "git+https://github.com/valentynblaha/gs1-parser.git",
33
34
  "type": "git"
@@ -41,6 +42,7 @@
41
42
  "globals": "^16.5.0",
42
43
  "jiti": "^2.6.1",
43
44
  "tsup": "^8.5.1",
45
+ "typedoc": "^0.28.14",
44
46
  "typescript": "~5.9.3",
45
47
  "typescript-eslint": "~8.46.4",
46
48
  "vite": "^7.2.2",
package/typedoc.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "entryPoints": ["src/index.ts"],
3
+ "out": "docs",
4
+ "tsconfig": "tsconfig.json",
5
+ "includeVersion": true,
6
+ "cleanOutputDir": true,
7
+ "hideGenerator": true,
8
+ "entryPointStrategy": "expand",
9
+ "disableSources": true
10
+ }
@@ -1,31 +0,0 @@
1
- name: CI (Tests + Dry Publish Check)
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
-
8
- permissions:
9
- contents: read
10
-
11
- jobs:
12
- test-build:
13
- runs-on: ubuntu-latest
14
-
15
- steps:
16
- - uses: actions/checkout@v5
17
-
18
- - uses: actions/setup-node@v5
19
- with:
20
- node-version: 24
21
- registry-url: https://registry.npmjs.org/
22
-
23
- - run: npm ci
24
-
25
- - run: npm test
26
-
27
- - run: npm run build
28
-
29
- - name: Verify npm packaging (dry run)
30
- run: npm publish --dry-run
31
-
@@ -1,45 +0,0 @@
1
- name: Publish to npm
2
-
3
- on:
4
- release:
5
- types: [published]
6
-
7
- permissions:
8
- id-token: write
9
- contents: read
10
-
11
- jobs:
12
- publish:
13
- runs-on: ubuntu-latest
14
-
15
- steps:
16
- - name: Checkout code
17
- uses: actions/checkout@v5
18
-
19
- - name: Set up Node
20
- uses: actions/setup-node@v5
21
- with:
22
- node-version: '24'
23
- registry-url: 'https://registry.npmjs.org/'
24
-
25
- - name: Authenticate with npm
26
- run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
27
- env:
28
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29
-
30
- - name: Update npm
31
- run: npm install -g npm@latest
32
-
33
- - name: Install dependencies
34
- run: npm ci
35
-
36
- - name: Test
37
- run: npm test
38
-
39
- - name: Build
40
- run: npm run build
41
-
42
- - name: Publish
43
- run: npm publish --provenance
44
- env:
45
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}