dealposbarcode 1.5.4 → 1.5.5
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/barcode/57.a93b5afe9216fbdc.js +1 -0
- package/barcode/index.html +2 -2
- package/barcode/main.32649bbf7f71639b.js +1 -0
- package/barcode/ngsw.json +8 -8
- package/barcode/{runtime.7b410d7b2c9b69c2.js → runtime.ce7adc968df4cebe.js} +1 -1
- package/package.json +1 -1
- package/barcode/57.cdadb4822a82ad48.js +0 -1
- package/barcode/main.b570119f7f6930eb.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkbarcode_app=self.webpackChunkbarcode_app||[]).push([[57],{1057:(W,b,O)=>{"use strict";O.r(b),O.d(b,{PagesModule:()=>Ze});var F=O(6895),N=O(3893),t=O(4650),x=O(1135),M=O(9300);class w{constructor(){this.store=new x.X([])}getState(){return this.store.asObservable().pipe((0,M.h)(a=>void 0!==a))}setState(a){this.store.next(a)}}w.\u0275fac=function(a){return new(a||w)},w.\u0275prov=t.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"});var k=O(3389),I=O(5083),_=O(7579),l=O(2722),c=O(4004),h=O(8412),i=(()=>{return(E=i||(i={}))[E.SUPPLIER_BILL=0]="SUPPLIER_BILL",E[E.OUTLET_DELIVERY=1]="OUTLET_DELIVERY",i;var E})(),p=O(5412),S=O(6985),P=O(433),R=O(8796),U=O(4405);class j{constructor(a,r){this.data=a,this.dialogRef=r,this.outlets=a.outlets}ngOnInit(){this.initModalConfig(),this.initTransactionType()}initModalConfig(){this.modalConfig=new S.O,this.modalConfig.title="Choose your transaction",this.modalConfig.hideMoreButton=!0}initTransactionType(){this.transactionTypes=[{title:"Supplier Bill",type:i.SUPPLIER_BILL},{title:"Transfer Order",type:i.OUTLET_DELIVERY}]}onOk(){this.selectedOutlet&&this.poNumber&&this.dialogRef.close({Outlet:this.selectedOutlet.getName,Number:this.poNumber,Type:this.selectedTransactionType})}onCancel(){this.dialogRef.close()}}j.\u0275fac=function(a){return new(a||j)(t.Y36(p.WI),t.Y36(p.so))},j.\u0275cmp=t.Xpm({type:j,selectors:[["app-form-add-bill"]],decls:18,vars:10,consts:[[3,"config","onOk","onCancel"],[1,"row"],["align","center",1,"col-sm-12","mt-3"],[2,"position","relative","width","100%"],[1,"w-100"],["bindLabel","title","bindValue","type","placeholder","Choose Type",1,"sticky-top","tall",3,"items","ngModel","clearable","appendTo","ngModelChange"],[1,"pt-6"],["bindLabel","Name","placeholder","Choose Outlet",1,"sticky-top","tall",3,"items","ngModel","clearable","appendTo","ngModelChange"],[1,"form-label-group"],["min","1","id","qty","type","text","placeholder","Invoice Number","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["for","qty"]],template:function(a,r){1&a&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return r.onOk()})("onCancel",function(){return r.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"table",3)(5,"tbody")(6,"tr",4)(7,"td")(8,"ng-select",5),t.NdJ("ngModelChange",function(A){return r.selectedTransactionType=A}),t.qZA()()(),t.TgZ(9,"tr",4)(10,"td",6)(11,"ng-select",7),t.NdJ("ngModelChange",function(A){return r.selectedOutlet=A}),t.qZA()()(),t.TgZ(12,"tr",4)(13,"td",6)(14,"div",8)(15,"input",9),t.NdJ("ngModelChange",function(A){return r.poNumber=A}),t.qZA(),t.TgZ(16,"label",10),t._uU(17,"Invoice Number"),t.qZA()()()()()()()()()()),2&a&&(t.Q6J("config",r.modalConfig),t.xp6(8),t.Q6J("items",r.transactionTypes)("ngModel",r.selectedTransactionType)("clearable",!1)("appendTo","body"),t.xp6(3),t.Q6J("items",r.outlets)("ngModel",r.selectedOutlet)("clearable",!1)("appendTo","body"),t.xp6(4),t.Q6J("ngModel",r.poNumber))},dependencies:[P.Fj,P.JJ,P.On,R.w9,U.M]});var J=O(8505),ce=O(4782),le=O(1104);class ee{constructor(a){this.httpService=a,this.barcodeConfigState=new x.X(null)}updatePaperFormatConfig(a){let r=localStorage.getItem("Domain");return this.httpService.post("/api/Config/SaveConfig",{SubDomain:r,Version:this.paperFormatVersion,PaperFormats:a})}getPaperFormatConfig(){let a=localStorage.getItem("Domain"),r=[];return this.httpService.post("/api/Config/PaperConfig",{SubDomain:a}).pipe((0,c.U)(G=>(this.paperFormatVersion=G.version,r=G.PaperFormats,{paperFormat:r,outlets:G.Outlets})),(0,ce.d)(1))}setBarcodeConfigState(a){this.barcodeConfigState.next(a)}getBarcodeConfigState(){return this.barcodeConfigState.asObservable().pipe((0,M.h)(a=>h.gT.IsNotEmpty(a)))}}ee.\u0275fac=function(a){return new(a||ee)(t.LFG(le.O))},ee.\u0275prov=t.Yz7({token:ee,factory:ee.\u0275fac,providedIn:"root"});var de=O(529);class Ne{constructor(a){a&&(this.AccountID=a.AccountID,this.CalculationTypeID=a.CalculationTypeID,this.ID=a.ID,this.Index=a.Index,this.Label=a.Label,this.MultipleTaxTypeID=a.MultipleTaxTypeID,this.Note=a.Note,this.PrintVisible=a.PrintVisible,this.Rate=a.Rate,this.TypeID=a.TypeID,this.Name=a.Name,this.Type=a.Type)}get getID(){return this.ID}get getType(){return this.Type}get getName(){return this.Name}get getAccountID(){return this.AccountID}set setAccountId(a){this.AccountID=a}get getCalculationTypeID(){return this.CalculationTypeID}set setCalculationID(a){this.CalculationTypeID=a}get getRate(){return this.Rate}set setRate(a){this.Rate=a}get getLabel(){return this.Label}}class H{get getPriceDiscount(){return this.PriceDiscount}set setPriceDiscount(a){this.PriceDiscount=a}get getReleaseDate(){return this.ReleasedDate}set setReleaseDate(a){this.ReleasedDate=a}get getID(){return this.ID}set setID(a){this.ID=a}get getSelectedPromotion(){return this.SelectedPromotion}set setSelectedPromotion(a){this.SelectedPromotion=a}get getDescription(){return this.description}set setDescription(a){this.description=a}set setBarcodeTitle(a){this.barcodeTitle=a}get getBarcodeTitle(){return this.barcodeTitle}set setCustomPrice(a){this.customPrice=a}get getCustomPrice(){return this.customPrice}get getUnitPrice(){return this.UnitPrice}set setUnitPrice(a){this.UnitPrice=a}get getCode(){return this.Code}set setCode(a){this.barcodeTitle=a,this.Code=a}get getModel(){return this.Model}set setModel(a){this.Model=a}get getName(){return this.Name}set setName(a){this.Name=a}get getCurrency(){return this.CurrencySymbol}set setCurrency(a){this.CurrencySymbol=a}}class T{get getCode(){return this.Code}get getName(){return this.Name}get getSuspended(){return this.Suspended}set setCode(a){this.Code=a}set setName(a){this.Name=a}set setSuspended(a){this.Suspended=a}}class X{get getOutlet(){return this.Outlet}get getNumber(){return this.Number}get getDate(){return this.Date}get getDueDate(){return this.DueDate}get getSupplier(){return this.Supplier}get getCreatorID(){return this.CreatorID}get getCreated(){return this.Created}get getDiscount1(){return this.Discount1}get getDiscountAmount(){return this.DiscountAmount}get getGross(){return this.Gross}get getDiscountTotal(){return this.DiscountTotal}get getTaxType(){return this.TaxType}get getTax(){return this.Tax}get getPurchase(){return this.Purchase}get getPurchaseNTax(){return this.PurchaseNTax}get getDelivery(){return this.Delivery}get getVariants(){return this.Variants}get getPayments(){return this.Payments}set setOutlet(a){this.Outlet=a}set setNumber(a){this.Number=a}set setDate(a){this.Date=a}set setDueDate(a){this.DueDate=a}set setSupplier(a){this.Supplier=a}set setCreatorID(a){this.CreatorID=a}set setCreated(a){this.Created=a}set setDiscount1(a){this.Discount1=a}set setDiscountAmount(a){this.DiscountAmount=a}set setGross(a){this.Gross=a}set setDiscountTotal(a){this.DiscountTotal=a}set setTaxType(a){this.TaxType=a}set setTax(a){this.Tax=a}set setPurchase(a){this.Purchase=a}set setPurchaseNTax(a){this.PurchaseNTax=a}set setDelivery(a){this.Delivery=a}set setVariants(a){this.Variants=a}set setPayments(a){this.Payments=a}}class Q extends H{constructor(){super()}get getVariantID(){return this.VariantID}get getQuantity(){return this.Quantity}get getPrice(){return this.Price}get getDiscount(){return this.Discount}get getNettPrice(){return this.NettPrice}set setVariantID(a){this.VariantID=a}set setQuantity(a){this.Quantity=a}set setPrice(a){this.Price=a}set setDiscount(a){this.Discount=a}set setNettPrice(a){this.NettPrice=a}}class ${get getID(){return this.ID}set setID(a){this.ID=a}get getName(){return this.Name}set setName(a){this.Name=a}get getDiscount(){return this.Discount}get getExtraCost(){return this.ExtraCost}get getPromotionID(){return this.PromotionID}get getUnitPrice(){return this.UnitPrice}set setDiscount(a){this.Discount=a}set setExtraCost(a){this.ExtraCost=a}set setPromotionID(a){this.PromotionID=a}set setUnitPrice(a){this.UnitPrice=a}}class ie{constructor(){this.outletID=null,this.outletName=""}}ie.\u0275fac=function(a){return new(a||ie)},ie.\u0275prov=t.Yz7({token:ie,factory:ie.\u0275fac,providedIn:"root"});class ge{constructor(a){this.outlet=a}getProductModel(a){let r=new H;r.setID=a.ID,r.setCode=a.Code,r.setCurrency=a.CurrencySymbol,r.setModel=a.Model,r.setName=a.Name,r.setUnitPrice=a.UnitPrice,r.setDescription=a.Description,r.setReleaseDate=a.ReleasedDate,r.setPriceDiscount=a.PriceDiscount;const A=a.OutletPrice?.find(G=>G.Outlet==this.outlet.outletName);return A&&(r.setUnitPrice=A.Price),r}getTaxModel(a){return new Ne(a)}getOutletModel(a){let r=new T;return r.setCode=a.Code,r.setName=a.Name,r.setSuspended=a.Suspended,r}getVariantModel(a){let r=new Q;return r.setCode=a.Code,r.setDiscount=a.Discount,r.setNettPrice=a.NettPrice,r.setPrice=a.Price,r.setUnitPrice=a.UnitPrice,r.setQuantity=a.Quantity,r.setVariantID=a.VariantID,r.setName=a.Name,r}getBillModel(a){let r=new X;return r.setNumber=a.Number,r.setOutlet=a.Outlet,r.setVariants=a.Variants?a.Variants.map(g=>this.getVariantModel(g)):[],r}getPromotionModel(a){let r=new $;return r.setDiscount=a.Discount,r.setExtraCost=a.ExtraCost,r.setPromotionID=a.PromotionID,r.setUnitPrice=a.UnitPrice,r.setName=a.Name,r.setID=a.ID,r}}ge.\u0275fac=function(a){return new(a||ge)(t.LFG(ie))},ge.\u0275prov=t.Yz7({token:ge,factory:ge.\u0275fac,providedIn:"root"});class me{constructor(a,r,g){this.httpService=a,this.http=r,this.factoryService=g}getProductById(a){let r=localStorage.getItem("Domain");return this.httpService.post(`https://${r}/API/V3/Variant/ID`,{ID:a}).pipe((0,c.U)(g=>this.factoryService.getProductModel(g)))}getPromotionByProducID(a){let r=localStorage.getItem("Domain");return this.httpService.post(`https://${r}/API/v3/PromotionEvent/GetByVariantID`,{VariantID:a}).pipe((0,c.U)(g=>g.map(G=>this.factoryService.getPromotionModel(G))))}uploadProducts(a){let r=localStorage.getItem("Domain"),g=new FormData;return g.append("file",a,a.name),this.httpService.postFormData(`https://${r}/API/catalog/product/UploadCSVforBarcode`,g).pipe((0,c.U)(A=>A.map(G=>(G.Print=G.Print.map(K=>this.factoryService.getProductModel(K)),G))))}getTax(){let a=localStorage.getItem("Domain"),r=localStorage.getItem("Token"),g=`https://${a}/API/V3/Tax`,A=new de.WM({authorization:"Bearer "+r,"content-type":"application/json","X-ClientId":"dealpos-app"});return this.http.get(g,{headers:A}).pipe((0,c.U)(G=>{if(G)return G.map(K=>this.factoryService.getTaxModel(K))}))}}me.\u0275fac=function(a){return new(a||me)(t.LFG(le.O),t.LFG(de.eN),t.LFG(ge))},me.\u0275prov=t.Yz7({token:me,factory:me.\u0275fac,providedIn:"root"});var Ie=O(7370);class Se{set _max(a){a&&(this.max=a,this.updateNumericSettings())}set _min(a){a&&(this.min=a,this.updateNumericSettings())}constructor(a){this.elementRef=a,this.decimalPlaces=4,this.modifyValueOnWheel=!0,this.max="999999999999999.9999",this.min="-999999999999999.9999",this.propagateChange=g=>{},this.preventNegative=!1,this.numericElement=new Ie(this.elementRef.nativeElement,null,{digitGroupSeparator:",",decimalCharacter:".",decimalPlaces:this.decimalPlaces,maximumValue:this.max,minimumValue:this.min,allowDecimalPadding:!1,showWarnings:!1})}ngOnInit(){""==this.percentage&&(this.max="100"),this.preventNegative&&(this.min="0.00"),this.updateNumericSettings()}updateNumericSettings(){const a={maximumValue:this.max,minimumValue:this.min,readOnly:this.isElementDisabled(),decimalPlaces:this.decimalPlaces,modifyValueOnWheel:this.modifyValueOnWheel};this.numericElement.update(a)}onKeyUp(){let a=this.numericElement.getNumber();this.propagateChange(a)}isElementDisabled(){let a=!1;return(!0===this.elementRef.nativeElement.readOnly||!0===this.elementRef.nativeElement.disabled)&&(a=!0),a}writeValue(a){null!=a&&this.numericElement.set(a)}registerOnChange(a){this.propagateChange=a}registerOnTouched(){}}Se.\u0275fac=function(a){return new(a||Se)(t.Y36(t.SBq))},Se.\u0275dir=t.lG2({type:Se,selectors:[["","autoNum",""]],hostBindings:function(a,r){1&a&&t.NdJ("keyup",function(){return r.onKeyUp()})},inputs:{percentage:"percentage",preventNegative:"preventNegative",decimalPlaces:"decimalPlaces",modifyValueOnWheel:"modifyValueOnWheel",_max:["max","_max"],_min:["min","_min"]},features:[t._Bn([{provide:P.JU,useExisting:(0,t.Gpc)(()=>Se),multi:!0}])]});var Me=O(4120),Pe=O(8372),fe=O(3238);const De=["input"];function qe(E,a){if(1&E&&t._UZ(0,"img",10),2&E){const r=t.oxw().$implicit;t.Q6J("src",r.ImgUrl,t.LSH)}}function We(E,a){if(1&E){const r=t.EpF();t.TgZ(0,"mat-option",8),t.NdJ("click",function(A){const K=t.CHM(r).$implicit;return t.oxw().changeDisplayName(K),t.KtG(A.stopPropagation())}),t.YNc(1,qe,1,1,"img",9),t._uU(2),t.qZA()}if(2&E){const r=a.$implicit,g=t.oxw();t.Q6J("value",r),t.xp6(1),t.Q6J("ngIf",g.renderThumbnail&&r.ImgUrl),t.xp6(1),t.hij(" ",r.Value," ")}}class Ee{set display(a){this.input.nativeElement.value=a}get value(){return this._value}set value(a){this._value=a,this.propagateChange(this._value)}constructor(a,r){this.httpService=a,this.ngZone=r,this.offlineStorage=[],this.inputLock=!1,this.renderThumbnail=!1,this.onOffline=new t.vpe,this.onEnter=new t.vpe,this.onSelect=new t.vpe,this.onOptionSelect=new t.vpe,this.reset=new t.vpe,this.termControl=new P.p4(""),this.options=[],this.complete=!1,this.foundProduct=!1,this.propagateChange=g=>{},this.termControl.valueChanges.pipe((0,Pe.b)(500)).subscribe(g=>{this.options=[],"object"==typeof g?(this.value=g.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(g.Value),this.complete=!0),this.onSelect&&this.onSelect.emit(g.Key),this.options=[],"object"==typeof g&&(this.value=g.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(g.Value),this.complete=!0),this.onOptionSelect)&&this.onOptionSelect.emit(JSON.stringify({Key:g.Key,Value:g.Value}))):"string"==typeof g&&g.length>0?g.length>2&&!this.inputLock&&this.search(g):this.clear()})}ngOnChanges(a){null!=a.ngModel&&null==a.ngModel.currentValue&&this.clear(),null!=a.display&&a.display.currentValue!=a.display.previousValue&&this.termControl.setValue(a.display.currentValue)}ngAfterViewInit(){}search(a){if(this.termControl.value.length>0){let r={};if(this.data&&(r=this.data),r.prefix=a,r.count=100,this.complete)this.complete=!1;else{let g=this.url,A=localStorage.getItem("Domain");A&&(g=`https://${A}${this.url}`),this.httpService.post(g,r).subscribe(G=>{this.options=G,this.foundProduct=this.options.length>0})}}else this.options=null}onblur(){setTimeout(()=>{},600)}changeDisplayName(a){this.input.nativeElement.value=a.Value}onKeydown(a){const r=a.key;"Enter"===r?(this.clearOnSelect&&this.clear(),!this.foundProduct&&this.termControl.value.length>0&&(this.onEnter.emit(this.termControl.value),a.stopPropagation()),null!=this.termControl.value&&(this.input.nativeElement.value=this.termControl.value.Value),this.foundProduct=!1):(this.inputLock&&("Backspace"===r?this.clear():this.validateInputLock()),this.complete=!1,this.reset.emit())}validateInputLock(){""==this.input.nativeElement.value||0==this.input.nativeElement.value.length?this.startInput=new Date:(new Date).getTime()-this.startInput.getTime()>500&&this.clear()}clear(){this.value=null,this.input.nativeElement.value=""}displayFn(a){return a&&a.Value}writeValue(a){}registerOnChange(a){this.propagateChange=a}registerOnTouched(){}}Ee.\u0275fac=function(a){return new(a||Ee)(t.Y36(le.O),t.Y36(t.R0b))},Ee.\u0275cmp=t.Xpm({type:Ee,selectors:[["autocomplete"]],viewQuery:function(a,r){if(1&a&&t.Gf(De,7),2&a){let g;t.iGM(g=t.CRH())&&(r.input=g.first)}},inputs:{placeholder:"placeholder",url:"url",clearOnSelect:"clearOnSelect",offlineStorage:"offlineStorage",inputLock:"inputLock",data:"data",renderThumbnail:"renderThumbnail",ngModel:"ngModel",displayText:"displayText",localStorage:"localStorage",_value:"_value",display:"display"},outputs:{onOffline:"onOffline",onEnter:"onEnter",onSelect:"onSelect",onOptionSelect:"onOptionSelect",reset:"reset"},features:[t._Bn([{provide:P.JU,useExisting:(0,t.Gpc)(()=>Ee),multi:!0}]),t.TTD],decls:9,vars:5,consts:[[1,"w-100"],[1,"form-label-group"],["id","input","type","text","matInput","",1,"form-control","text-black",3,"matAutocomplete","placeholder","formControl","paste","keydown","blur"],["input",""],["for","input"],["autoActiveFirstOption","true"],["autocomplete","matAutocomplete"],["class","option-autocomplete",3,"value","click",4,"ngFor","ngForOf"],[1,"option-autocomplete",3,"value","click"],["width","30","height","30",3,"src",4,"ngIf"],["width","30","height","30",3,"src"]],template:function(a,r){if(1&a&&(t.TgZ(0,"mat-form-field",0)(1,"div",1)(2,"input",2,3),t.NdJ("paste",function(A){return r.inputLock?A.preventDefault():""})("keydown",function(A){return r.onKeydown(A)})("blur",function(){return r.onblur()}),t.qZA(),t.TgZ(4,"label",4),t._uU(5),t.qZA()()(),t.TgZ(6,"mat-autocomplete",5,6),t.YNc(8,We,3,3,"mat-option",7),t.qZA()),2&a){const g=t.MAs(7);t.xp6(2),t.s9C("placeholder",r.placeholder||""),t.Q6J("matAutocomplete",g)("formControl",r.termControl),t.xp6(3),t.Oqu(r.placeholder||""),t.xp6(3),t.Q6J("ngForOf",r.options)}},dependencies:[Me.XC,fe.ey,Me.ZL,F.sg,F.O5,P.Fj,P.JJ,P.oH],styles:["mat-option[_ngcontent-%COMP%]{font-size:12px}"]});class ke{}ke.\u0275fac=function(a){return new(a||ke)},ke.\u0275mod=t.oAB({type:ke}),ke.\u0275inj=t.cJS({imports:[Me.Bb,F.ez,P.UX]});class ve{constructor(a,r,g,A,G){this.dialogRef=a,this.barcodeService=r,this.productService=g,this.authenticationService=A,this.data=G,this.modalConfig=new S.O,this.variantName="",this.hasProductEdit=!0,this.hasPromotion=!1,this.destroy$=new _.x,this.variantName=G.variantName,this.qty=G.qty,this.customPrice=G.customPrice}ngOnInit(){this.getBarcodeConfig(),this.initModalConfig(),this.initProductUpdate(),this.initRoleProductEdit()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initRoleProductEdit(){let a=this.authenticationService.getRoles();this.hasProductEdit=-1!==a.findIndex(r=>"ProdE"==r)}initProductUpdate(){h.gT.IsNotEmpty(this.data.variantId)&&this.getProductById(this.data.variantId).subscribe(a=>{this.product.setSelectedPromotion=this.data.promotion,this.hasPromotion=h.gT.IsNotEmpty(this.data.promotion)})}getBarcodeConfig(){this.barcodeService.getBarcodeConfigState().pipe((0,l.R)(this.destroy$)).subscribe(a=>{a&&(this.paperFormat=a)})}initModalConfig(){this.modalConfig.title="Add New Product Barcode?",this.modalConfig.hideMoreButton=!0}onSelectProduct(a){this.getProductById(a).subscribe(r=>{this.customPrice=r.getUnitPrice,this.hasPromotion=!1,this.product.setSelectedPromotion=null})}getProductById(a){return this.productService.getProductById(a).pipe((0,J.b)(r=>{this.product=r,this.getPromotionByProductID(a)}))}getPromotionByProductID(a){this.productService.getPromotionByProducID(a).subscribe(r=>{this.promotions=r})}onCustomPriceChange(a){this.customPrice=a}onSelectPromotion(a){a?(this.product.setSelectedPromotion=this.promotions.find(r=>r.getName==a?.getName),this.customPrice=this.product.getUnitPrice,this.hasPromotion=h.gT.IsNotEmpty(this.product.getSelectedPromotion)):(this.hasPromotion=!1,this.product.setSelectedPromotion=null)}onOk(){this.qty&&this.qty>0&&this.product&&this.dialogRef.close({customPrice:this.customPrice,product:this.product,quantity:this.qty})}onCancel(){this.dialogRef.close()}}ve.\u0275fac=function(a){return new(a||ve)(t.Y36(p.so),t.Y36(ee),t.Y36(me),t.Y36(k.$),t.Y36(p.WI))},ve.\u0275cmp=t.Xpm({type:ve,selectors:[["app-form-add-variant"]],features:[t._Bn([F.JJ])],decls:24,vars:7,consts:[[3,"config","onOk","onCancel"],[1,"row"],["align","center",1,"col-sm-12","mt-3"],[2,"position","relative","width","100%"],[1,"w-100"],["placeholder","Name","url","/API/AC/GetVariantSuggestionByCodeNName",3,"display","onSelect"],[1,"form-label-group"],["id","qty","type","text","placeholder","Quantity","aria-label","width","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","qty"],[1,"pb-9"],["bindLabel","Name","bindValue","PromotionID","appendTo","body","placeholder","Select Promotion Price",1,"sticky-top","tall",3,"items","ngModel","change"],["placeholder","Price","aria-label","width","autoNum","",1,"form-control",3,"ngModel","readonly","ngModelChange"],["for","price"]],template:function(a,r){1&a&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return r.onOk()})("onCancel",function(){return r.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"table",3)(5,"tbody")(6,"tr",4)(7,"td")(8,"autocomplete",5),t.NdJ("onSelect",function(A){return r.onSelectProduct(A)}),t.qZA()()(),t.TgZ(9,"tr",4)(10,"td")(11,"div",6)(12,"input",7),t.NdJ("ngModelChange",function(A){return r.qty=A}),t.qZA(),t.TgZ(13,"label",8),t._uU(14,"Quantity"),t.qZA()()()(),t.TgZ(15,"tr",4)(16,"td",9)(17,"ng-select",10),t.NdJ("change",function(A){return r.onSelectPromotion(A)}),t.qZA()()(),t.TgZ(18,"tr",4)(19,"td")(20,"div",6)(21,"input",11),t.NdJ("ngModelChange",function(A){return r.onCustomPriceChange(A)}),t.qZA(),t.TgZ(22,"label",12),t._uU(23,"Price"),t.qZA()()()()()()()()()()),2&a&&(t.Q6J("config",r.modalConfig),t.xp6(8),t.Q6J("display",r.variantName),t.xp6(4),t.Q6J("ngModel",r.qty),t.xp6(5),t.Q6J("items",r.promotions)("ngModel",null==r.product||null==r.product.getSelectedPromotion?null:r.product.getSelectedPromotion.getPromotionID),t.xp6(4),t.Q6J("ngModel",r.customPrice)("readonly",r.hasPromotion||!r.hasProductEdit))},dependencies:[P.Fj,P.JJ,P.On,R.w9,U.M,Se,Ee]});class xe{constructor(a,r){this.dialogRef=a,this.data=r,this.event=new t.vpe,this.modalConfig=new S.O}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig.title="Upload New Product Barcode?",this.modalConfig.hideMoreButton=!0}onOk(){this.dialogRef.close(this.files)}onCancel(){this.dialogRef.close()}onUploadFile(a){a&&(this.files=a.target.files)}}xe.\u0275fac=function(a){return new(a||xe)(t.Y36(p.so),t.Y36(p.WI))},xe.\u0275cmp=t.Xpm({type:xe,selectors:[["app-form-upload-variant"]],outputs:{event:"event"},decls:15,vars:1,consts:[[3,"config","onOk","onCancel"],[1,"row"],[1,"col-sm-12"],["href","//res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv",2,"font-size","12px"],[1,"value-title"],["type","file","aria-label","upload",3,"change"]],template:function(a,r){1&a&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return r.onOk()})("onCancel",function(){return r.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"a",3),t._uU(5,"Download Sample CSV"),t.qZA(),t.TgZ(6,"table")(7,"tbody")(8,"tr")(9,"th",4),t._uU(10,"CSV File"),t.qZA(),t.TgZ(11,"td"),t._uU(12,":"),t.qZA(),t.TgZ(13,"td")(14,"input",5),t.NdJ("change",function(A){return r.onUploadFile(A)}),t.qZA()()()()()()()()()),2&a&&t.Q6J("config",r.modalConfig)},dependencies:[U.M]});var ye=O(7185);class we{constructor(a,r){this.httpService=a,this.factoryService=r}get(){let r=localStorage.getItem("Domain");return this.httpService.post(`https://${r}/api/v3/Outlet/p`,{Suspended:!1}).pipe((0,c.U)(g=>{let A=[];return g&&(A=g.map(G=>this.factoryService.getOutletModel(G))),A}))}}we.\u0275fac=function(a){return new(a||we)(t.LFG(le.O),t.LFG(ge))},we.\u0275prov=t.Yz7({token:we,factory:we.\u0275fac,providedIn:"root"});class _e{constructor(a,r){this.httpService=a,this.factoryService=r}get(a){let r=localStorage.getItem("Domain"),g=this.getEndPointByType(a.Type);return this.httpService.post(`https://${r}${g}`,{Outlet:a.Outlet,Number:a.Number}).pipe((0,c.U)(G=>G.map(K=>this.factoryService.getVariantModel(K))))}getEndPointByType(a){let r;return r=a===i.SUPPLIER_BILL?"/API/V3/Barcode/byBillNumber":"/API/V3/Barcode/byOutletDeliveryNumber",r}}function Je(E,a){if(1&E){const r=t.EpF();t.TgZ(0,"tr",22),t.NdJ("click",function(){const A=t.CHM(r),G=A.$implicit,K=A.index,ne=t.oxw();return t.KtG(ne.onUpdateProduct(G,K))}),t.TgZ(1,"td")(2,"i",23),t.NdJ("click",function(){const G=t.CHM(r).index,K=t.oxw();return t.KtG(K.onDeleteProduct(G))}),t.qZA()(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",24),t._uU(6),t.qZA()()}if(2&E){const r=a.$implicit;t.xp6(4),t.AsE(" ",null==r||null==r.Variants[0]?null:r.Variants[0].getName,"- ",null==r||null==r.Variants[0]?null:r.Variants[0].getCode," - "),t.xp6(2),t.Oqu(null==r?null:r.Quantity)}}_e.\u0275fac=function(a){return new(a||_e)(t.LFG(le.O),t.LFG(ge))},_e.\u0275prov=t.Yz7({token:_e,factory:_e.\u0275fac,providedIn:"root"});class Fe{constructor(a,r,g,A,G,K,ne,re){this.dialog=a,this.productStateService=r,this.productService=g,this.toastService=A,this.queryParamService=G,this.outletService=K,this.billService=ne,this.barcodeService=re,this.destroy$=new _.x,this.stickerTotal=0,this.productGroups=[],this.productSource=[],this.getRouteParam(),this.initOutlets()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}getRouteParam(){this.queryParamService.getState().pipe((0,l.R)(this.destroy$),(0,M.h)(a=>h.gT.IsEmpty(a))).subscribe(a=>{a?.ID&&this.getProductById(a.ID,5),a.billNumber&&this.getBill({Number:a.billNumber,Outlet:a.outletName,Type:i.SUPPLIER_BILL})})}initOutlets(){this.barcodeService.getPaperFormatConfig().pipe((0,c.U)(a=>a.outlets),(0,l.R)(this.destroy$)).subscribe(a=>{this.outlets=a})}onAddBill(){this.dialog.open(j,{width:"350px",data:{outlets:this.outlets}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(a=>{a&&this.getBill(a)})}getBill(a){this.billService.get(a).pipe((0,l.R)(this.destroy$)).subscribe(r=>{r&&r.forEach(g=>{this.checkAvailableProductCode(g);let A=this.generateProductByQty(g,g.getQuantity);this.productGroups=[...this.productGroups,{VariantID:g.getVariantID,Quantity:g.getQuantity,Variants:A}],this.updateProductsSource()})})}onAddProduct(){this.dialog.open(ve,{width:"350px",data:{variantName:"",variantId:null,qty:null}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(a=>{a&&(this.customPrice=a.customPrice,this.generateProductBarcode(a.product,a.quantity))})}getProductById(a,r){this.productService.getProductById(a).pipe((0,l.R)(this.destroy$)).subscribe(g=>{g&&this.generateProductBarcode(g,r)})}generateProductBarcode(a,r){this.checkAvailableProductCode(a);let g=this.generateProductByQty(a,r);g=this.updateCustomPriceProducts(g),this.productGroups=[...this.productGroups,{VariantID:a.getID,Quantity:r,Variants:g}],this.updateProductsSource()}checkAvailableProductCode(a){a.getCode||this.toastService.error("Product has no code","Code Not Found")}onUpdateProduct(a,r){this.dialog.open(ve,{width:"350px",data:{variantName:a.Variants[0].getName+" - "+a.Variants[0].getCode,variantId:a.VariantID,qty:a.Quantity,customPrice:a.Variants[0].getCustomPrice,promotion:a.Variants[0].getSelectedPromotion}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(ae=>{if(ae){this.customPrice=ae.customPrice,this.checkAvailableProductCode(ae.product);let be=this.generateProductByQty(ae.product,ae.quantity);be=this.updateCustomPriceProducts(be),this.productGroups[r].Variants=be,this.productGroups[r].Quantity=ae.quantity,this.productGroups[r].VariantID=ae.product.getID,this.updateProductsSource()}})}onDeleteProduct(a){this.productGroups=this.productGroups.filter((r,g)=>g!==a),this.updateProductsSource()}updateProductsSource(){this.productSource=[],this.productGroups.forEach(a=>{this.productSource=[...this.productSource,...a.Variants]}),this.stickerTotal=this.productSource.length,this.productStateService.setState(this.productSource)}onUploadProduct(){this.dialog.open(xe,{width:"350px"}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(a=>{if(a){let r;this.productService.uploadProducts(a[0]).pipe((0,l.R)(this.destroy$)).subscribe(g=>{g&&(this.productGroups=[...this.productGroups,...g.map(A=>(r={Quantity:A.Quantity,VariantID:A.VariantID,Variants:A.Print},r))],this.updateProductsSource())})}})}updateCustomPriceProducts(a){let r=a;return this.customPrice&&(r=a.map(g=>(g.setCustomPrice=this.customPrice,g))),r}generateProductByQty(a,r){let g=[];for(let A=1;A<=r;A++)g.push(a);return g}onClear(){this.productGroups=[],this.updateProductsSource()}onPrint(){window.print()}}Fe.\u0275fac=function(a){return new(a||Fe)(t.Y36(p.uw),t.Y36(w),t.Y36(me),t.Y36(ye._W),t.Y36(I.U),t.Y36(we),t.Y36(_e),t.Y36(ee))},Fe.\u0275cmp=t.Xpm({type:Fe,selectors:[["app-list-products"]],decls:33,vars:2,consts:[[1,"card","mt-3","sticky-top"],[1,"card-header","d-flex","justify-content-between","align-items-center","bg-white","pb-5",2,"border","none"],[1,"fw-light","m-1"],[1,"ms-1","fst-italic","text-info","d-block","mt-1"],[1,"btn-group"],["type","button",1,"btn-md","btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-plus"],["aria-hidden","true",1,"fa","fa-upload"],[1,"card-body","py-0"],[1,"table","table-borderless","table-fixed"],[1,"table-light","lh-1"],["scope","col"],["scope","col",1,"text-end"],[3,"click",4,"ngFor","ngForOf"],[1,"card-footer","bg-white","py-8","p-0"],[1,"row"],[1,"col-6","d-flex","justify-content-start"],[1,"btn","btn-xl","btn-outline-secondary",3,"click"],[1,"fa-regular","fa-file-lines","me-2"],[1,"col-6","d-flex","justify-content-end"],[1,"btn","btn-xl","btn-outline-secondary","ms-5",3,"click"],[1,"btn","btn-xl","btn-success","ms-5",3,"click"],[3,"click"],["aria-hidden","true",1,"fa","fa-times",2,"color","#fb404b !important","cursor","pointer",3,"click"],[1,"text-end"]],template:function(a,r){1&a&&(t.TgZ(0,"div",0)(1,"div",1)(2,"h1",2),t._uU(3," Products "),t.TgZ(4,"small",3),t._uU(5),t.qZA()(),t.TgZ(6,"div",4)(7,"button",5),t.NdJ("click",function(){return r.onAddProduct()}),t._UZ(8,"i",6),t.qZA(),t.TgZ(9,"button",5),t.NdJ("click",function(){return r.onUploadProduct()}),t._UZ(10,"i",7),t.qZA()()(),t.TgZ(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr"),t._UZ(15,"th",11),t.TgZ(16,"th",11),t._uU(17,"NAME"),t.qZA(),t.TgZ(18,"th",12),t._uU(19,"QTY"),t.qZA()()(),t.TgZ(20,"tbody"),t.YNc(21,Je,7,3,"tr",13),t.qZA()()(),t.TgZ(22,"div",14)(23,"div",15)(24,"div",16)(25,"a",17),t.NdJ("click",function(){return r.onAddBill()}),t._UZ(26,"i",18),t._uU(27," Load Transaction "),t.qZA()(),t.TgZ(28,"div",19)(29,"a",20),t.NdJ("click",function(){return r.onClear()}),t._uU(30,"Clear"),t.qZA(),t.TgZ(31,"a",21),t.NdJ("click",function(){return r.onPrint()}),t._uU(32,"Print"),t.qZA()()()()()),2&a&&(t.xp6(5),t.hij("( ",0===r.stickerTotal?"":r.stickerTotal," stickers )"),t.xp6(16),t.Q6J("ngForOf",r.productGroups))},dependencies:[F.sg],styles:["td[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{font-size:12px}.btn[_ngcontent-%COMP%]{font-size:14px!important}"]});var He=O(7188),Ce=O(1281);let v=(()=>{class E{constructor(){this._listeners=[]}notify(r,g){for(let A of this._listeners)A(r,g)}listen(r){return this._listeners.push(r),()=>{this._listeners=this._listeners.filter(g=>r!==g)}}ngOnDestroy(){this._listeners=[]}}return E.\u0275fac=function(r){return new(r||E)},E.\u0275prov=t.Yz7({token:E,factory:E.\u0275fac,providedIn:"root"}),E})();const C=["input"],V=["*"];let Z=0;class y{constructor(a,r){this.source=a,this.value=r}}const L={provide:P.JU,useExisting:(0,t.Gpc)(()=>se),multi:!0},D=new t.OlP("MatRadioGroup"),B=new t.OlP("mat-radio-default-options",{providedIn:"root",factory:function z(){return{color:"accent"}}});let q=(()=>{class E{get name(){return this._name}set name(r){this._name=r,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(r){this._labelPosition="before"===r?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(r){this._value!==r&&(this._value=r,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(r){this._selected=r,this.value=r?r.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(r){this._disabled=(0,Ce.Ig)(r),this._markRadiosForCheck()}get required(){return this._required}set required(r){this._required=(0,Ce.Ig)(r),this._markRadiosForCheck()}constructor(r){this._changeDetector=r,this._value=null,this._name="mat-radio-group-"+Z++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new t.vpe}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(r=>{r.name=this.name,r._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(g=>{g.checked=this.value===g.value,g.checked&&(this._selected=g)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new y(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(r=>r._markForCheck())}writeValue(r){this.value=r,this._changeDetector.markForCheck()}registerOnChange(r){this._controlValueAccessorChangeFn=r}registerOnTouched(r){this.onTouched=r}setDisabledState(r){this.disabled=r,this._changeDetector.markForCheck()}}return E.\u0275fac=function(r){return new(r||E)(t.Y36(t.sBO))},E.\u0275dir=t.lG2({type:E,inputs:{color:"color",name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required"},outputs:{change:"change"}}),E})();class Y{constructor(a){this._elementRef=a}}const oe=(0,fe.Kr)((0,fe.sb)(Y));let ue=(()=>{class E extends oe{get checked(){return this._checked}set checked(r){const g=(0,Ce.Ig)(r);this._checked!==g&&(this._checked=g,g&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!g&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),g&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(r){this._value!==r&&(this._value=r,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===r),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(r){this._labelPosition=r}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(r){this._setDisabled((0,Ce.Ig)(r))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(r){this._required=(0,Ce.Ig)(r)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(r){this._color=r}get inputId(){return`${this.id||this._uniqueId}-input`}constructor(r,g,A,G,K,ne,re,te){super(g),this._changeDetector=A,this._focusMonitor=G,this._radioDispatcher=K,this._providerOverride=re,this._uniqueId="mat-radio-"+ ++Z,this.id=this._uniqueId,this.change=new t.vpe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=r,this._noopAnimations="NoopAnimations"===ne,te&&(this.tabIndex=(0,Ce.su)(te,0))}focus(r,g){g?this._focusMonitor.focusVia(this._inputElement,g,r):this._inputElement.nativeElement.focus(r)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name),this._removeUniqueSelectionListener=this._radioDispatcher.listen((r,g)=>{r!==this.id&&g===this.name&&(this.checked=!1)})}ngDoCheck(){this._updateTabIndex()}ngAfterViewInit(){this._updateTabIndex(),this._focusMonitor.monitor(this._elementRef,!0).subscribe(r=>{!r&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new y(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(r){r.stopPropagation()}_onInputInteraction(r){if(r.stopPropagation(),!this.checked&&!this.disabled){const g=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),g&&this.radioGroup._emitChangeEvent())}}_setDisabled(r){this._disabled!==r&&(this._disabled=r,this._changeDetector.markForCheck())}_updateTabIndex(){const r=this.radioGroup;let g;if(g=r&&r.selected&&!this.disabled?r.selected===this?this.tabIndex:-1:this.tabIndex,g!==this._previousTabIndex){const A=this._inputElement?.nativeElement;A&&(A.setAttribute("tabindex",g+""),this._previousTabIndex=g)}}}return E.\u0275fac=function(r){t.$Z()},E.\u0275dir=t.lG2({type:E,viewQuery:function(r,g){if(1&r&&t.Gf(C,5),2&r){let A;t.iGM(A=t.CRH())&&(g._inputElement=A.first)}},inputs:{id:"id",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"],checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"},features:[t.qOj]}),E})(),se=(()=>{class E extends q{}return E.\u0275fac=function(){let a;return function(g){return(a||(a=t.n5z(E)))(g||E)}}(),E.\u0275dir=t.lG2({type:E,selectors:[["mat-radio-group"]],contentQueries:function(r,g,A){if(1&r&&t.Suo(A,Oe,5),2&r){let G;t.iGM(G=t.CRH())&&(g._radios=G)}},hostAttrs:["role","radiogroup",1,"mat-mdc-radio-group"],exportAs:["matRadioGroup"],features:[t._Bn([L,{provide:D,useExisting:E}]),t.qOj]}),E})(),Oe=(()=>{class E extends ue{constructor(r,g,A,G,K,ne,re,te){super(r,g,A,G,K,ne,re,te)}}return E.\u0275fac=function(r){return new(r||E)(t.Y36(D,8),t.Y36(t.SBq),t.Y36(t.sBO),t.Y36(He.tE),t.Y36(v),t.Y36(t.QbO,8),t.Y36(B,8),t.$8M("tabindex"))},E.\u0275cmp=t.Xpm({type:E,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-mdc-radio-button"],hostVars:15,hostBindings:function(r,g){1&r&&t.NdJ("focus",function(){return g._inputElement.nativeElement.focus()}),2&r&&(t.uIk("id",g.id)("tabindex",null)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),t.ekj("mat-primary","primary"===g.color)("mat-accent","accent"===g.color)("mat-warn","warn"===g.color)("mat-mdc-radio-checked",g.checked)("_mat-animation-noopable",g._noopAnimations))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[t.qOj],ngContentSelectors:V,decls:13,vars:17,consts:[[1,"mdc-form-field"],["formField",""],[1,"mdc-radio"],[1,"mat-mdc-radio-touch-target",3,"click"],["type","radio",1,"mdc-radio__native-control",3,"id","checked","disabled","required","change"],["input",""],[1,"mdc-radio__background"],[1,"mdc-radio__outer-circle"],[1,"mdc-radio__inner-circle"],["mat-ripple","",1,"mat-radio-ripple","mat-mdc-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[3,"for"]],template:function(r,g){if(1&r&&(t.F$t(),t.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3),t.NdJ("click",function(G){return g._onInputInteraction(G)}),t.qZA(),t.TgZ(4,"input",4,5),t.NdJ("change",function(G){return g._onInputInteraction(G)}),t.qZA(),t.TgZ(6,"div",6),t._UZ(7,"div",7)(8,"div",8),t.qZA(),t.TgZ(9,"div",9),t._UZ(10,"div",10),t.qZA()(),t.TgZ(11,"label",11),t.Hsn(12),t.qZA()()),2&r){const A=t.MAs(1);t.ekj("mdc-form-field--align-end","before"==g.labelPosition),t.xp6(2),t.ekj("mdc-radio--disabled",g.disabled),t.xp6(2),t.Q6J("id",g.inputId)("checked",g.checked)("disabled",g.disabled)("required",g.required),t.uIk("name",g.name)("value",g.value)("aria-label",g.ariaLabel)("aria-labelledby",g.ariaLabelledby)("aria-describedby",g.ariaDescribedby),t.xp6(5),t.Q6J("matRippleTrigger",A)("matRippleDisabled",g._isRippleDisabled())("matRippleCentered",!0),t.xp6(2),t.Q6J("for",g.inputId)}},dependencies:[fe.wG],styles:['.mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio[hidden]{display:none}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-form-field{display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field[hidden]{display:none}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{margin-left:auto;margin-right:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}[dir=rtl] .mdc-form-field--space-between>label,.mdc-form-field--space-between>label[dir=rtl]{margin:0}.mat-mdc-radio-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{padding:calc((var(--mdc-radio-state-layer-size, 40px) - 20px) / 2)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-selected-icon-color, #000)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-selected-icon-color, #000)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity, 0.38)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity, 0.38)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-unselected-icon-color, #000)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-unselected-icon-opacity, 0.38)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-focus-icon-color, #6200ee)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-focus-icon-color, #6200ee)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-hover-icon-color, #6200ee)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-hover-icon-color, #6200ee)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-icon-color, #6200ee)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-icon-color, #6200ee)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-pressed-icon-color, #6200ee)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-pressed-icon-color, #6200ee)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-hover-icon-color, #000)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-icon-color, #000)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-pressed-icon-color, #000)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{top:calc(-1 * (var(--mdc-radio-state-layer-size, 40px) - 20px) / 2);left:calc(-1 * (var(--mdc-radio-state-layer-size, 40px) - 20px) / 2);width:var(--mdc-radio-state-layer-size, 40px);height:var(--mdc-radio-state-layer-size, 40px)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:calc((var(--mdc-radio-state-layer-size, 40px) - var(--mdc-radio-state-layer-size, 40px)) / 2);right:calc((var(--mdc-radio-state-layer-size, 40px) - var(--mdc-radio-state-layer-size, 40px)) / 2);left:calc((var(--mdc-radio-state-layer-size, 40px) - var(--mdc-radio-state-layer-size, 40px)) / 2);width:var(--mdc-radio-state-layer-size, 40px);height:var(--mdc-radio-state-layer-size, 40px)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{background-color:var(--mat-mdc-radio-ripple-color, transparent)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:not([disabled]):not(:focus)~.mdc-radio__background::before{opacity:.04;transform:scale(1)}.mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio__background::before{background-color:var(--mat-mdc-radio-checked-ripple-color, transparent)}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element{background-color:var(--mat-mdc-radio-checked-ripple-color, transparent)}.mat-mdc-radio-button .mat-radio-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:50%}.mat-mdc-radio-button .mat-radio-ripple .mat-ripple-element{opacity:.14}.mat-mdc-radio-button .mat-radio-ripple::before{border-radius:50%}.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__background::before,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__outer-circle,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__inner-circle{transition:none !important}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:focus:enabled:not(:checked)~.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-focus-icon-color, black)}.mat-mdc-radio-button.cdk-focused .mat-mdc-focus-indicator::before{content:""}.mat-mdc-radio-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}[dir=rtl] .mat-mdc-radio-touch-target{left:0;right:50%;transform:translate(50%, -50%)}'],encapsulation:2,changeDetection:0}),E})(),Le=(()=>{class E{}return E.\u0275fac=function(r){return new(r||E)},E.\u0275mod=t.oAB({type:E}),E.\u0275inj=t.cJS({imports:[fe.BQ,F.ez,fe.si,fe.BQ]}),E})();function je(E,a){if(1&E){const r=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2,"Selected Tax"),t.qZA(),t.TgZ(3,"td")(4,"ng-select",31),t.NdJ("ngModelChange",function(A){t.CHM(r);const G=t.oxw();return t.KtG(G.taxOptionSelected=A)})("change",function(){t.CHM(r);const A=t.oxw();return t.KtG(A.onSelectTaxType())}),t.qZA()(),t.TgZ(5,"td")(6,"span"),t._uU(7,"Applied Tax ex: 100 + 10% = 110"),t.qZA()()()}if(2&E){const r=t.oxw();t.xp6(4),t.Q6J("items",r.taxOptions)("ngModel",r.taxOptionSelected)("clearable",!1)}}function Ke(E,a){if(1&E){const r=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2,"Outlet Price"),t.qZA(),t.TgZ(3,"td")(4,"ng-select",32),t.NdJ("ngModelChange",function(A){t.CHM(r);const G=t.oxw();return t.KtG(G.outletID=A)}),t.qZA()(),t.TgZ(5,"td")(6,"span"),t._uU(7,"Price will be set according to the Outlet Price assigned when selected the outlet"),t.qZA()()()}if(2&E){const r=t.oxw();t.xp6(4),t.Q6J("items",r.outlets)("ngModel",r.outletID)("clearable",!0)}}const he=function(E){return{active:E}};class pe{constructor(a,r,g){this.dialogRef=a,this.data=r,this.outlet=g,this.event=new t.vpe,this.modalConfig=new S.O,this.taxOptions=[],this.paperWidth=0,this.marginTop=0,this.marginLeft=0,this.stickerWidth=0,this.stickerHeight=0,this.barcodeHeight=0,this.spacingColumn=0,this.spacingRow=0,this.barcode=!0,this.code=!0,this.price=!0,this.name=!0,this.move=!0,this.relaseDate=!0,this.priceDiscount=!0,this.removeDefault=!0,this.desc=!0,this.priceTax=!0,this.fontSize=0,this.namePrefix="",this.maxChar=0,this.publiclineHeight=0,this.orientationOptions=[],this.paperFormat=JSON.parse(JSON.stringify(r.paperFormat)),this.orientationOptions=this.paperFormat.OrientationChoice,this.outlets=r.outlets,this.taxs=r.taxs,this.authTax=r.authTax,this.initTaxOptions(),this.activeTab="paper",this.outletRole=r.outletRole}ngOnInit(){this.initModalConfig(),this.initFormValue(),this.authTax&&this.initTaxOptionSelected()}initTaxOptions(){this.taxOptions=[],this.taxs.forEach((a,r)=>{this.taxOptions=[...this.taxOptions,{id:r+1,name:a.getName,ID:a.getID}]})}initTaxOptionSelected(){this.taxSelected&&(this.taxOptionSelected=this.taxOptions.find(a=>a.ID===this.taxSelected.ID))}onSelectTaxType(){this.taxSelected=this.taxs.find(a=>a.getID===this.taxOptionSelected.ID)}initModalConfig(){this.modalConfig.title="Sticker Configuration",this.modalConfig.hideMoreButton=!0}onOk(){this.setPaperFormat(),this.dialogRef.close(this.paperFormat)}onCancel(){this.dialogRef.close()}initFormValue(){this.paperFormat&&(this.barcodeHeight=this.paperFormat.BarcodeHeight,this.PriceFontSize=this.paperFormat.PriceFontSize,this.paperWidth=this.paperFormat.PaperWidth,this.marginTop=this.paperFormat.MarginTop,this.marginLeft=this.paperFormat.MarginLeft,this.stickerWidth=this.paperFormat.StickerWidth,this.stickerHeight=this.paperFormat.StickerHeight,this.barcodeHeight=this.paperFormat.BarcodeHeight,this.spacingColumn=this.paperFormat.ColumnSpacing,this.spacingRow=this.paperFormat.RowSpacing,this.barcode=this.paperFormat.BarcodeVisible,this.code=this.paperFormat.CodeVisible,this.price=this.paperFormat.PriceVisible,this.name=this.paperFormat.NameVisible,this.move=this.paperFormat.MoveProductNameOnTop,this.desc=this.paperFormat.DescriptionAsCode,this.fontSize=this.paperFormat.ProductNameFontSize,this.namePrefix=this.paperFormat.ProductNamePrefix,this.maxChar=this.paperFormat.ProductNameMaxLength,this.lineHeight=this.paperFormat.LineHeight,this.priceTax=this.paperFormat.PriceWithTax,this.taxSelected=this.paperFormat.TaxType,this.storeName=this.paperFormat.StoreName,this.currencySymbol=this.paperFormat.CurrencySymbol,this.promotionPriceLabel=this.paperFormat.PromotionPriceLabel,this.basicPriceLabel=this.paperFormat.BasicPriceLabel,this.relaseDate=this.paperFormat.ShowReleasedDate,this.priceDiscount=this.paperFormat.ShowPriceDiscount,this.orientationType=this.paperFormat.Orientation,this.outletID=this.outlet.outletID)}setPaperFormat(){this.paperFormat&&(this.checkPriceWithTax(),this.paperFormat.PriceFontSize=this.PriceFontSize,this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.PaperWidth=this.paperWidth,this.paperFormat.MarginTop=this.marginTop,this.paperFormat.MarginLeft=this.marginLeft,this.paperFormat.StickerWidth=this.stickerWidth,this.paperFormat.StickerHeight=this.stickerHeight,this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.ColumnSpacing=this.spacingColumn,this.paperFormat.RowSpacing=this.spacingRow,this.paperFormat.BarcodeVisible=this.barcode,this.paperFormat.MoveProductNameOnTop=this.move,this.paperFormat.CodeVisible=this.code,this.paperFormat.PriceVisible=this.price,this.paperFormat.NameVisible=this.name,this.paperFormat.DescriptionAsCode=this.desc,this.paperFormat.ProductNameFontSize=this.fontSize,this.paperFormat.ProductNamePrefix=this.namePrefix,this.paperFormat.ProductNameMaxLength=this.maxChar,this.paperFormat.LineHeight=this.lineHeight,this.paperFormat.PriceWithTax=this.priceTax,this.paperFormat.TaxType=this.taxSelected,this.paperFormat.StoreName=this.storeName,this.paperFormat.CurrencySymbol=this.currencySymbol,this.paperFormat.PromotionPriceLabel=this.promotionPriceLabel,this.paperFormat.BasicPriceLabel=this.basicPriceLabel,this.paperFormat.ShowReleasedDate=this.relaseDate,this.paperFormat.ShowPriceDiscount=this.priceDiscount,this.paperFormat.Orientation=this.orientationType,this.outlet.outletID=this.outletID,this.outlet.outletName=this.outlets.find(a=>a.ID==this.outletID)?.Name)}checkPriceWithTax(){this.priceTax||(this.taxSelected=this.taxs.find(a=>"No Tax"==a.getLabel))}dataTarget(a){this.activeTab=a}}pe.\u0275fac=function(a){return new(a||pe)(t.Y36(p.so),t.Y36(p.WI),t.Y36(ie))},pe.\u0275cmp=t.Xpm({type:pe,selectors:[["app-form-settings"]],outputs:{event:"event"},decls:337,vars:79,consts:[[3,"config","onOk","onCancel"],["container",""],["id","myTab","role","tablist",1,"nav","nav-tabs"],["tabs",""],[1,"nav-item"],["data-bs-toggle","tab",1,"nav-link",3,"ngClass","click"],["id","spacing-tab","data-bs-toggle","tab","data-bs-target","'#spacing'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","dua-tab","data-bs-toggle","tab","data-bs-target","'#sticker-content'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","price-tab","data-bs-toggle","tab","data-bs-target","'#price'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","advanced-tab","data-bs-toggle","tab","data-bs-target","'#advanced'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","promotionLabel-tab","data-bs-toggle","tab","data-bs-target","'#promotionLabel'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],[1,"tab-content","border","bg-white"],["id","paper",1,"tab-pane","mt-0",3,"ngClass"],[1,"table","table-bordered","w-100"],[1,"input-group"],["type","number","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],[1,"input-group-append"],[1,"input-group-text"],["id","spacing",1,"tab-pane","mt-0",3,"ngClass"],["id","sticker-content",1,"tab-pane","mt-0",3,"ngClass"],[2,"width","150px"],["aria-label","Select an option","color","primary"],["value","false",3,"checked","change"],["value","true",1,"ms-4",3,"checked","change"],["id","price",1,"tab-pane","mt-0",3,"ngClass"],[4,"ngIf"],["type","text","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["type","text","autoNum","","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["id","advanced",1,"tab-pane","mt-0",3,"ngClass"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Select orientation",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange"],["id","promotionLabel",1,"tab-pane","mt-0",3,"ngClass"],["appendTo","body","bindLabel","name","placeholder","Select Column",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange","change"],["appendTo","body","bindLabel","Name","bindValue","ID","name","Choose Outlet","placeholder","Choose Outlet",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange"]],template:function(a,r){1&a&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return r.onOk()})("onCancel",function(){return r.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"ul",2,3)(5,"li",4)(6,"a",5),t.NdJ("click",function(){return r.dataTarget("paper")}),t._uU(7,"Paper"),t.qZA()(),t.TgZ(8,"li",4)(9,"a",6),t.NdJ("click",function(){return r.dataTarget("spacing")}),t._uU(10,"Spacing"),t.qZA()(),t.TgZ(11,"li",4)(12,"a",7),t.NdJ("click",function(){return r.dataTarget("sticker-content")}),t._uU(13,"Sticker Content"),t.qZA()(),t.TgZ(14,"li",4)(15,"a",8),t.NdJ("click",function(){return r.dataTarget("price")}),t._uU(16,"Price"),t.qZA()(),t.TgZ(17,"li",4)(18,"a",9),t.NdJ("click",function(){return r.dataTarget("advanced")}),t._uU(19,"Advanced"),t.qZA()(),t.TgZ(20,"li",4)(21,"a",10),t.NdJ("click",function(){return r.dataTarget("promotionLabel")}),t._uU(22,"Label"),t.qZA()()(),t.TgZ(23,"div",11)(24,"div",12)(25,"table",13)(26,"tr")(27,"td"),t._uU(28,"Paper Width"),t.qZA(),t.TgZ(29,"td")(30,"div",14)(31,"input",15),t.NdJ("ngModelChange",function(A){return r.paperWidth=A}),t.qZA(),t.TgZ(32,"div",16)(33,"span",17),t._uU(34,"px"),t.qZA()()()(),t.TgZ(35,"td")(36,"span"),t._uU(37,"The width of the paper"),t.qZA()()(),t.TgZ(38,"tr")(39,"td"),t._uU(40,"Sticker Width"),t.qZA(),t.TgZ(41,"td")(42,"div",14)(43,"input",15),t.NdJ("ngModelChange",function(A){return r.stickerWidth=A}),t.qZA(),t.TgZ(44,"div",16)(45,"span",17),t._uU(46,"px"),t.qZA()()()(),t.TgZ(47,"td")(48,"span"),t._uU(49,"The width of the sticker"),t.qZA()()(),t.TgZ(50,"tr")(51,"td"),t._uU(52,"Sticker Height"),t.qZA(),t.TgZ(53,"td")(54,"div",14)(55,"input",15),t.NdJ("ngModelChange",function(A){return r.stickerHeight=A}),t.qZA(),t.TgZ(56,"div",16)(57,"span",17),t._uU(58,"px"),t.qZA()()()(),t.TgZ(59,"td")(60,"span"),t._uU(61,"The height of the sticker"),t.qZA()()()()(),t.TgZ(62,"div",18)(63,"table",13)(64,"tr")(65,"td"),t._uU(66,"Left Indent"),t.qZA(),t.TgZ(67,"td")(68,"div",14)(69,"input",15),t.NdJ("ngModelChange",function(A){return r.marginLeft=A}),t.qZA(),t.TgZ(70,"div",16)(71,"span",17),t._uU(72,"px"),t.qZA()()()(),t.TgZ(73,"td")(74,"span"),t._uU(75,"The number of pixels appended before the first COLUMN"),t.qZA()()(),t.TgZ(76,"tr")(77,"td"),t._uU(78,"Top Indent"),t.qZA(),t.TgZ(79,"td")(80,"div",14)(81,"input",15),t.NdJ("ngModelChange",function(A){return r.marginTop=A}),t.qZA(),t.TgZ(82,"div",16)(83,"span",17),t._uU(84,"px"),t.qZA()()()(),t.TgZ(85,"td")(86,"span"),t._uU(87,"The number of pixels appended before the first ROW"),t.qZA()()(),t.TgZ(88,"tr")(89,"td"),t._uU(90,"Row Spacing"),t.qZA(),t.TgZ(91,"td")(92,"div",14)(93,"input",15),t.NdJ("ngModelChange",function(A){return r.spacingRow=A}),t.qZA(),t.TgZ(94,"div",16)(95,"span",17),t._uU(96,"px"),t.qZA()()()(),t.TgZ(97,"td")(98,"span"),t._uU(99,"The number of pixels between each ROW"),t.qZA()()(),t.TgZ(100,"tr")(101,"td"),t._uU(102,"Column Spacing"),t.qZA(),t.TgZ(103,"td")(104,"div",14)(105,"input",15),t.NdJ("ngModelChange",function(A){return r.spacingColumn=A}),t.qZA(),t.TgZ(106,"div",16)(107,"span",17),t._uU(108,"px"),t.qZA()()()(),t.TgZ(109,"td")(110,"span"),t._uU(111,"The number of pixels between each COLUMN"),t.qZA()()()()(),t.TgZ(112,"div",19)(113,"table",13)(114,"tr")(115,"td"),t._uU(116,"Barcode Height"),t.qZA(),t.TgZ(117,"td",20)(118,"div",14)(119,"input",15),t.NdJ("ngModelChange",function(A){return r.barcodeHeight=A}),t.qZA(),t.TgZ(120,"div",16)(121,"span",17),t._uU(122,"px"),t.qZA()()()(),t.TgZ(123,"td")(124,"span"),t._uU(125,"The height of the generated barcode in pixels"),t.qZA()()(),t.TgZ(126,"tr")(127,"td"),t._uU(128,"Font Size"),t.qZA(),t.TgZ(129,"td")(130,"div",14)(131,"input",15),t.NdJ("ngModelChange",function(A){return r.fontSize=A}),t.qZA(),t.TgZ(132,"div",16)(133,"span",17),t._uU(134,"px"),t.qZA()()()(),t.TgZ(135,"td")(136,"span"),t._uU(137,"Change all font size (except price)"),t.qZA()()(),t.TgZ(138,"tr")(139,"td"),t._uU(140,"Barcode"),t.qZA(),t.TgZ(141,"td")(142,"mat-radio-group",21)(143,"mat-radio-button",22),t.NdJ("change",function(){return r.barcode=!1}),t._uU(144,"No "),t.qZA(),t.TgZ(145,"mat-radio-button",23),t.NdJ("change",function(){return r.barcode=!0}),t._uU(146,"Yes"),t.qZA()()(),t.TgZ(147,"td")(148,"span"),t._uU(149,"Whether barcode is visible"),t.qZA()()(),t.TgZ(150,"tr")(151,"td"),t._uU(152,"Code"),t.qZA(),t.TgZ(153,"td")(154,"mat-radio-group",21)(155,"mat-radio-button",22),t.NdJ("change",function(){return r.code=!1}),t._uU(156,"No "),t.qZA(),t.TgZ(157,"mat-radio-button",23),t.NdJ("change",function(){return r.code=!0}),t._uU(158,"Yes"),t.qZA()()(),t.TgZ(159,"td")(160,"span"),t._uU(161,"Whether variant code is visible"),t.qZA()()(),t.TgZ(162,"tr")(163,"td"),t._uU(164,"Price"),t.qZA(),t.TgZ(165,"td")(166,"mat-radio-group",21)(167,"mat-radio-button",22),t.NdJ("change",function(){return r.price=!1}),t._uU(168,"No "),t.qZA(),t.TgZ(169,"mat-radio-button",23),t.NdJ("change",function(){return r.price=!0}),t._uU(170,"Yes"),t.qZA()()(),t.TgZ(171,"td")(172,"span"),t._uU(173,"Whether variant price is visible"),t.qZA()()(),t.TgZ(174,"tr")(175,"td"),t._uU(176,"Name"),t.qZA(),t.TgZ(177,"td")(178,"mat-radio-group",21)(179,"mat-radio-button",22),t.NdJ("change",function(){return r.name=!1}),t._uU(180,"No "),t.qZA(),t.TgZ(181,"mat-radio-button",23),t.NdJ("change",function(){return r.name=!0}),t._uU(182,"Yes"),t.qZA()()(),t.TgZ(183,"td")(184,"span"),t._uU(185,"Whether variant name is visible"),t.qZA()()(),t.TgZ(186,"tr")(187,"td"),t._uU(188,"Move Product Name"),t.qZA(),t.TgZ(189,"td")(190,"mat-radio-group",21)(191,"mat-radio-button",22),t.NdJ("change",function(){return r.move=!1}),t._uU(192,"No "),t.qZA(),t.TgZ(193,"mat-radio-button",23),t.NdJ("change",function(){return r.move=!0}),t._uU(194,"Yes"),t.qZA()()(),t.TgZ(195,"td")(196,"span"),t._uU(197,"Whether move variant name below variant code or below variant price"),t.qZA()()(),t.TgZ(198,"tr")(199,"td"),t._uU(200,"Release Date"),t.qZA(),t.TgZ(201,"td")(202,"mat-radio-group",21)(203,"mat-radio-button",22),t.NdJ("change",function(){return r.relaseDate=!1}),t._uU(204,"No "),t.qZA(),t.TgZ(205,"mat-radio-button",23),t.NdJ("change",function(){return r.relaseDate=!0}),t._uU(206,"Yes"),t.qZA()()(),t.TgZ(207,"td")(208,"span"),t._uU(209,"Whether release date is Visible"),t.qZA()()(),t.TgZ(210,"tr")(211,"td"),t._uU(212,"Discount Visible"),t.qZA(),t.TgZ(213,"td")(214,"mat-radio-group",21)(215,"mat-radio-button",22),t.NdJ("change",function(){return r.priceDiscount=!1}),t._uU(216,"No "),t.qZA(),t.TgZ(217,"mat-radio-button",23),t.NdJ("change",function(){return r.priceDiscount=!0}),t._uU(218,"Yes"),t.qZA()()(),t.TgZ(219,"td")(220,"span"),t._uU(221,"Whether variant's sell price discount is Visible"),t.qZA()()()()(),t.TgZ(222,"div",24)(223,"table",13)(224,"tr")(225,"td"),t._uU(226,"Price with Tax"),t.qZA(),t.TgZ(227,"td")(228,"mat-radio-group",21)(229,"mat-radio-button",22),t.NdJ("change",function(){return r.priceTax=!1}),t._uU(230," No"),t.qZA(),t.TgZ(231,"mat-radio-button",23),t.NdJ("change",function(){return r.priceTax=!0}),t._uU(232,"Yes"),t.qZA()()(),t.TgZ(233,"td")(234,"span"),t._uU(235),t.qZA()()(),t.YNc(236,je,8,3,"tr",25),t.TgZ(237,"tr")(238,"td"),t._uU(239,"Currency"),t.qZA(),t.TgZ(240,"td",20)(241,"div",14)(242,"input",26),t.NdJ("ngModelChange",function(A){return r.currencySymbol=A}),t.qZA()()(),t.TgZ(243,"td")(244,"span"),t._uU(245,"The default currency"),t.qZA()()(),t.TgZ(246,"tr")(247,"td"),t._uU(248,"Font Size"),t.qZA(),t.TgZ(249,"td")(250,"div",14)(251,"input",27),t.NdJ("ngModelChange",function(A){return r.PriceFontSize=A}),t.qZA()()(),t.TgZ(252,"td")(253,"span"),t._uU(254,"Change font size for price"),t.qZA()()(),t.YNc(255,Ke,8,3,"tr",25),t.qZA()(),t.TgZ(256,"div",28)(257,"table",13)(258,"tr")(259,"td"),t._uU(260,"Max Character"),t.qZA(),t.TgZ(261,"td",20)(262,"div",14)(263,"input",15),t.NdJ("ngModelChange",function(A){return r.maxChar=A}),t.qZA()()(),t.TgZ(264,"td")(265,"span"),t._uU(266,"The max character of the product name"),t.qZA()()(),t.TgZ(267,"tr")(268,"td"),t._uU(269,"Name Prefix"),t.qZA(),t.TgZ(270,"td")(271,"div",14)(272,"input",26),t.NdJ("ngModelChange",function(A){return r.namePrefix=A}),t.qZA()()(),t.TgZ(273,"td")(274,"span"),t._uU(275,"A word, letter, or number placed before product name"),t.qZA()()(),t.TgZ(276,"tr")(277,"td"),t._uU(278,"Store Name"),t.qZA(),t.TgZ(279,"td")(280,"div",14)(281,"input",26),t.NdJ("ngModelChange",function(A){return r.storeName=A}),t.qZA()()(),t.TgZ(282,"td")(283,"span"),t._uU(284,"The name of the store"),t.qZA()()(),t.TgZ(285,"tr")(286,"td"),t._uU(287,"Orientation"),t.qZA(),t.TgZ(288,"td")(289,"ng-select",29),t.NdJ("ngModelChange",function(A){return r.orientationType=A}),t.qZA()(),t.TgZ(290,"td")(291,"span"),t._uU(292,"Horizontal or Vertical Position store name label"),t.qZA()()(),t.TgZ(293,"tr")(294,"td"),t._uU(295,"Use description as code"),t.qZA(),t.TgZ(296,"td")(297,"mat-radio-group",21)(298,"mat-radio-button",22),t.NdJ("change",function(){return r.desc=!1}),t._uU(299,"No "),t.qZA(),t.TgZ(300,"mat-radio-button",23),t.NdJ("change",function(){return r.desc=!0}),t._uU(301,"Yes"),t.qZA()()(),t.TgZ(302,"td")(303,"span"),t._uU(304,"Copy product description into Product Code"),t.qZA()()(),t.TgZ(305,"tr")(306,"td"),t._uU(307,'Remove "Default"'),t.qZA(),t.TgZ(308,"td")(309,"mat-radio-group",21)(310,"mat-radio-button",22),t.NdJ("change",function(){return r.removeDefault=!1}),t._uU(311,"No "),t.qZA(),t.TgZ(312,"mat-radio-button",23),t.NdJ("change",function(){return r.removeDefault=!0}),t._uU(313,"Yes"),t.qZA()()(),t.TgZ(314,"td")(315,"span"),t._uU(316,'Remove "Default" Label from product name'),t.qZA()()()()(),t.TgZ(317,"div",30)(318,"table",13)(319,"tr")(320,"td"),t._uU(321,"Normal Price"),t.qZA(),t.TgZ(322,"td")(323,"div",14)(324,"input",26),t.NdJ("ngModelChange",function(A){return r.basicPriceLabel=A}),t.qZA()()(),t.TgZ(325,"td")(326,"span"),t._uU(327,"Custom label normal price"),t.qZA()()(),t.TgZ(328,"tr")(329,"td"),t._uU(330,"Promotion Price"),t.qZA(),t.TgZ(331,"td")(332,"div",14)(333,"input",26),t.NdJ("ngModelChange",function(A){return r.promotionPriceLabel=A}),t.qZA()()(),t.TgZ(334,"td")(335,"span"),t._uU(336,"Custom label promotion price"),t.qZA()()()()()()()()()),2&a&&(t.Q6J("config",r.modalConfig),t.xp6(6),t.Q6J("ngClass",t.VKq(55,he,"paper"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(57,he,"spacing"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(59,he,"sticker-content"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(61,he,"price"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(63,he,"advanced"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(65,he,"promotionLabel"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(67,he,"paper"===r.activeTab)),t.xp6(7),t.Q6J("ngModel",r.paperWidth),t.xp6(12),t.Q6J("ngModel",r.stickerWidth),t.xp6(12),t.Q6J("ngModel",r.stickerHeight),t.xp6(7),t.Q6J("ngClass",t.VKq(69,he,"spacing"===r.activeTab)),t.xp6(7),t.Q6J("ngModel",r.marginLeft),t.xp6(12),t.Q6J("ngModel",r.marginTop),t.xp6(12),t.Q6J("ngModel",r.spacingRow),t.xp6(12),t.Q6J("ngModel",r.spacingColumn),t.xp6(7),t.Q6J("ngClass",t.VKq(71,he,"sticker-content"===r.activeTab)),t.xp6(7),t.Q6J("ngModel",r.barcodeHeight),t.xp6(12),t.Q6J("ngModel",r.fontSize),t.xp6(12),t.Q6J("checked",!r.barcode),t.xp6(2),t.Q6J("checked",r.barcode),t.xp6(10),t.Q6J("checked",!r.code),t.xp6(2),t.Q6J("checked",r.code),t.xp6(10),t.Q6J("checked",!r.price),t.xp6(2),t.Q6J("checked",r.price),t.xp6(10),t.Q6J("checked",!r.name),t.xp6(2),t.Q6J("checked",r.name),t.xp6(10),t.Q6J("checked",!r.move),t.xp6(2),t.Q6J("checked",r.move),t.xp6(10),t.Q6J("checked",!r.relaseDate),t.xp6(2),t.Q6J("checked",r.relaseDate),t.xp6(10),t.Q6J("checked",!r.priceDiscount),t.xp6(2),t.Q6J("checked",r.priceDiscount),t.xp6(5),t.Q6J("ngClass",t.VKq(73,he,"price"===r.activeTab)),t.xp6(7),t.Q6J("checked",!r.priceTax),t.xp6(2),t.Q6J("checked",r.priceTax),t.xp6(4),t.hij("Tax is added to the product base price ",r.authTax,""),t.xp6(1),t.Q6J("ngIf",1==r.priceTax&&1==r.authTax),t.xp6(6),t.Q6J("ngModel",r.currencySymbol),t.xp6(9),t.Q6J("ngModel",r.PriceFontSize),t.xp6(4),t.Q6J("ngIf",r.outletRole),t.xp6(1),t.Q6J("ngClass",t.VKq(75,he,"advanced"===r.activeTab)),t.xp6(7),t.Q6J("ngModel",r.maxChar),t.xp6(9),t.Q6J("ngModel",r.namePrefix),t.xp6(9),t.Q6J("ngModel",r.storeName),t.xp6(8),t.Q6J("items",r.orientationOptions)("ngModel",r.orientationType)("clearable",!1),t.xp6(9),t.Q6J("checked",!r.desc),t.xp6(2),t.Q6J("checked",r.desc),t.xp6(10),t.Q6J("checked",!r.removeDefault),t.xp6(2),t.Q6J("checked",r.removeDefault),t.xp6(5),t.Q6J("ngClass",t.VKq(77,he,"promotionLabel"===r.activeTab)),t.xp6(7),t.Q6J("ngModel",r.basicPriceLabel),t.xp6(9),t.Q6J("ngModel",r.promotionPriceLabel))},dependencies:[F.mk,F.O5,P.Fj,P.wV,P.JJ,P.On,R.w9,U.M,Se,se,Oe],styles:[".input-group-append[_ngcontent-%COMP%]{height:30px}.form-control[_ngcontent-%COMP%]{height:30px;font-size:12px}.input-group-text[_ngcontent-%COMP%]{font-size:12px}.value-title[_ngcontent-%COMP%]{font-size:12px;font-weight:550;width:90px}.advance-value-title[_ngcontent-%COMP%]{font-size:12px;font-weight:550;width:135px}h3[_ngcontent-%COMP%]{margin-bottom:0;font-weight:550}label[_ngcontent-%COMP%]{font-size:12px}bs-dropdown-container[_ngcontent-%COMP%]{z-index:1060}.nav-tabs-custom-border[_ngcontent-%COMP%] .nav-tabs[_ngcontent-%COMP%]{border-bottom:0}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%]{margin-bottom:10px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(1){font-weight:700;width:172px;padding:12px 1rem}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){width:120px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:nth-child(2), .tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){border-right:1px solid #dee2e6;border-left:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2) input[_ngcontent-%COMP%]{border:0;border-bottom:1px solid #dee2e6}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2) .input-group-text[_ngcontent-%COMP%]{border:0;border-bottom:1px solid #dee2e6;margin-top:-1px}.tab-content[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(3){font-style:italic;color:#28a745}.nav-link[_ngcontent-%COMP%]{cursor:pointer} .mat-mdc-radio-checked .mdc-radio__outer-circle{border-color:#0075ff} .mat-radio-checked .mdc-radio__inner-circle{background-color:#0075ff}"]});var Te=O(7243);const Ye=["bcElement"];let Ae=(()=>{class E{get options(){return{format:this.format,lineColor:this.lineColor,width:this.width,height:this.height,displayValue:this.displayValue,fontOptions:this.fontOptions,font:this.font,textAlign:this.textAlign,textPosition:this.textPosition,textMargin:this.textMargin,fontSize:this.fontSize,background:this.background,margin:this.margin,marginTop:this.marginTop,marginBottom:this.marginBottom,marginLeft:this.marginLeft,marginRight:this.marginRight,valid:this.valid}}constructor(r){this.renderer=r,this.elementType="svg",this.cssClass="barcode",this.format="CODE128",this.lineColor="#000000",this.width=2,this.height=100,this.displayValue=!1,this.fontOptions="",this.font="monospace",this.textAlign="center",this.textPosition="bottom",this.textMargin=2,this.fontSize=20,this.background="#ffffff",this.margin=10,this.marginTop=10,this.marginBottom=10,this.marginLeft=10,this.marginRight=10,this.value="",this.valid=()=>!0}ngAfterViewInit(){this.createBarcode()}ngOnChanges(){this.bcElement&&this.createBarcode()}createBarcode(){if(!this.value)return;let r;switch(this.elementType){case"img":r=this.renderer.createElement("img");break;case"canvas":r=this.renderer.createElement("canvas");break;default:r=this.renderer.createElement("svg","svg")}Te(r,this.value,this.options);for(const g of this.bcElement.nativeElement.childNodes)this.renderer.removeChild(this.bcElement.nativeElement,g);this.renderer.appendChild(this.bcElement.nativeElement,r)}}return E.\u0275fac=function(r){return new(r||E)(t.Y36(t.Qsj))},E.\u0275cmp=t.Xpm({type:E,selectors:[["ngx-barcode6"]],viewQuery:function(r,g){if(1&r&&t.Gf(Ye,5),2&r){let A;t.iGM(A=t.CRH())&&(g.bcElement=A.first)}},inputs:{elementType:["bc-element-type","elementType"],cssClass:["bc-class","cssClass"],format:["bc-format","format"],lineColor:["bc-line-color","lineColor"],width:["bc-width","width"],height:["bc-height","height"],displayValue:["bc-display-value","displayValue"],fontOptions:["bc-font-options","fontOptions"],font:["bc-font","font"],textAlign:["bc-text-align","textAlign"],textPosition:["bc-text-position","textPosition"],textMargin:["bc-text-margin","textMargin"],fontSize:["bc-font-size","fontSize"],background:["bc-background","background"],margin:["bc-margin","margin"],marginTop:["bc-margin-top","marginTop"],marginBottom:["bc-margin-bottom","marginBottom"],marginLeft:["bc-margin-left","marginLeft"],marginRight:["bc-margin-right","marginRight"],value:["bc-value","value"],valid:["bc-valid","valid"]},features:[t.TTD],decls:2,vars:2,consts:[["bcElement",""]],template:function(r,g){1&r&&t._UZ(0,"div",null,0),2&r&&t.Tol(g.cssClass)},encapsulation:2}),E})(),Xe=(()=>{class E{}return E.\u0275fac=function(r){return new(r||E)},E.\u0275mod=t.oAB({type:E}),E.\u0275inj=t.cJS({}),E})();class Ve{transform(a,r){let g=a,A=0;return r&&0!==r&&(A=a*(r/100),g=a+A),g}}function et(E,a){if(1&E&&t._UZ(0,"ngx-barcode6",18),2&E){const r=t.oxw().$implicit,g=t.oxw();t.Q6J("bc-value",null==r?null:r.getCode)("bc-element-type","img")("bc-width",1)("bc-height",null==g.selectedPaperFormat?null:g.selectedPaperFormat.BarcodeHeight)}}function Re(E,a){if(1&E&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&E){const r=t.oxw().$implicit,g=t.oxw();t.Udp("font-size",(null==g.selectedPaperFormat?null:g.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.Oqu(r.getBarcodeTitle)}}function Qe(E,a){if(1&E&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&E){const r=t.oxw().$implicit,g=t.oxw();t.Udp("font-size",(null==g.selectedPaperFormat?null:g.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=g.selectedPaperFormat&&g.selectedPaperFormat.ProductNamePrefix?(null==g.selectedPaperFormat?null:g.selectedPaperFormat.ProductNamePrefix)+" "+r.getName:r.getName,0,null==g.selectedPaperFormat?null:g.selectedPaperFormat.ProductNameMaxLength)," ")}}function Be(E,a){if(1&E&&(t.ynx(0),t.TgZ(1,"div",22)(2,"span",23),t._uU(3),t.qZA(),t.TgZ(4,"span",24)(5,"span",25)(6,"span",26),t._uU(7),t.ALo(8,"number"),t.qZA()()()(),t.TgZ(9,"div",27)(10,"span",23),t._uU(11),t.qZA(),t.TgZ(12,"span",28),t._uU(13),t.ALo(14,"number"),t.qZA()(),t.BQk()),2&E){const r=t.oxw(2).$implicit,g=t.oxw();t.xp6(3),t.Oqu(g.selectedPaperFormat.BasicPriceLabel?g.selectedPaperFormat.BasicPriceLabel:"N. Price"),t.xp6(4),t.AsE("",null==g.selectedPaperFormat?null:g.selectedPaperFormat.CurrencySymbol," ",t.lcZ(8,6,null==r?null:r.getUnitPrice),""),t.xp6(4),t.Oqu(g.selectedPaperFormat.PromotionPriceLabel?g.selectedPaperFormat.PromotionPriceLabel:"Spc. Price"),t.xp6(2),t.AsE("",null==g.selectedPaperFormat?null:g.selectedPaperFormat.CurrencySymbol," ",t.lcZ(14,8,(null==r||null==r.getSelectedPromotion?null:r.getSelectedPromotion.getUnitPrice)-(null==r||null==r.getSelectedPromotion?null:r.getSelectedPromotion.getUnitPrice)*(null==r||null==r.getSelectedPromotion?null:r.getSelectedPromotion.getDiscount)/100),"")}}function $e(E,a){if(1&E&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&E){const r=t.oxw(3).$implicit,g=t.oxw();t.xp6(1),t.AsE(" ",null==g.selectedPaperFormat?null:g.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==r?null:r.getCustomPrice,g.tax))," ")}}function Ue(E,a){if(1&E&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&E){const r=t.oxw(4).$implicit,g=t.oxw();t.xp6(1),t.AsE(" ",null==g.selectedPaperFormat?null:g.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==r?null:r.getUnitPrice,g.tax))," ")}}function tt(E,a){if(1&E&&t.YNc(0,Ue,4,7,"ng-container",20),2&E){t.oxw();const r=t.MAs(5),g=t.oxw(3);t.Q6J("ngIf",(null==g.selectedPaperFormat?null:g.selectedPaperFormat.PriceWithTax)&&g.tax&&0!=g.tax)("ngIfElse",r)}}function it(E,a){if(1&E&&(t._uU(0),t.ALo(1,"number")),2&E){const r=t.oxw(3).$implicit,g=t.oxw();t.AsE(" ",null==g.selectedPaperFormat?null:g.selectedPaperFormat.CurrencySymbol," ",t.lcZ(1,2,null==r?null:r.getUnitPrice)," ")}}function rt(E,a){if(1&E&&(t.TgZ(0,"strong"),t.YNc(1,$e,4,7,"ng-container",20),t.YNc(2,tt,1,2,"ng-template",null,29,t.W1O),t.YNc(4,it,2,4,"ng-template",null,30,t.W1O),t.qZA()),2&E){const r=t.MAs(3),g=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",0!==(null==g?null:g.getCustomPrice)&&void 0!==(null==g?null:g.getCustomPrice))("ngIfElse",r)}}function at(E,a){if(1&E&&(t.TgZ(0,"span",19),t.YNc(1,Be,15,10,"ng-container",20),t.YNc(2,rt,6,2,"ng-template",null,21,t.W1O),t.qZA()),2&E){const r=t.MAs(3),g=t.oxw().$implicit,A=t.oxw();t.Udp("font-size",(null==A.selectedPaperFormat?null:A.selectedPaperFormat.PriceFontSize)+"px"),t.xp6(1),t.Q6J("ngIf",g.getSelectedPromotion)("ngIfElse",r)}}function ot(E,a){if(1&E&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&E){const r=t.oxw().$implicit,g=t.oxw();t.Udp("font-size",(null==g.selectedPaperFormat?null:g.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=g.selectedPaperFormat&&g.selectedPaperFormat.ProductNamePrefix?(null==g.selectedPaperFormat?null:g.selectedPaperFormat.ProductNamePrefix)+" "+r.getName:r.getName,0,null==g.selectedPaperFormat?null:g.selectedPaperFormat.ProductNameMaxLength)," ")}}function st(E,a){if(1&E&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.ALo(3,"date"),t.qZA(),t.BQk()),2&E){const r=t.oxw().$implicit,g=t.oxw();t.xp6(1),t.Udp("font-size",(null==g.selectedPaperFormat?null:g.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.xi3(3,3,r.getReleaseDate,"dd MMM yy")," ")}}function lt(E,a){if(1&E&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&E){const r=t.oxw().$implicit,g=t.oxw();t.xp6(1),t.Udp("font-size",(null==g.selectedPaperFormat?null:g.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",r.getPriceDiscount,"% Off ")}}function ct(E,a){if(1&E&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&E){const r=t.oxw(2);t.xp6(1),t.Udp("font-size",(null==r.selectedPaperFormat?null:r.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==r.selectedPaperFormat?null:r.selectedPaperFormat.StoreName," ")}}function ut(E,a){if(1&E&&(t.ynx(0),t.TgZ(1,"div",31),t._uU(2),t.qZA(),t.BQk()),2&E){const r=t.oxw(2);t.xp6(1),t.Udp("font-size",(null==r.selectedPaperFormat?null:r.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==r.selectedPaperFormat?null:r.selectedPaperFormat.StoreName," ")}}function dt(E,a){if(1&E&&(t.TgZ(0,"li")(1,"div",13),t.YNc(2,et,1,4,"ngx-barcode6",14),t.TgZ(3,"div",15),t.YNc(4,Re,2,3,"span",16),t.YNc(5,Qe,3,7,"span",16),t.YNc(6,at,4,4,"span",16),t.YNc(7,ot,3,7,"span",16),t.YNc(8,st,4,6,"ng-container",17),t.YNc(9,lt,3,3,"ng-container",17),t.YNc(10,ct,3,3,"ng-container",17),t.qZA(),t.YNc(11,ut,3,3,"ng-container",17),t.qZA()()),2&E){const r=a.index,g=t.oxw();t.Udp("width",(null==g.selectedPaperFormat?null:g.selectedPaperFormat.StickerWidth)+"px")("height",(null==g.selectedPaperFormat?null:g.selectedPaperFormat.StickerHeight)+"px")("margin-right",(r+1)%g.totalStickerPerRow==0?0:(null==g.selectedPaperFormat?null:g.selectedPaperFormat.ColumnSpacing)+"px")("margin-bottom",r>=g.productPreview.length-g.lastIndex?0:(null==g.selectedPaperFormat?null:g.selectedPaperFormat.RowSpacing)+"px"),t.xp6(2),t.Q6J("ngIf",null==g.selectedPaperFormat?null:g.selectedPaperFormat.BarcodeVisible),t.xp6(2),t.Q6J("ngIf",null==g.selectedPaperFormat?null:g.selectedPaperFormat.CodeVisible),t.xp6(1),t.Q6J("ngIf",(null==g.selectedPaperFormat?null:g.selectedPaperFormat.NameVisible)&&(null==g.selectedPaperFormat?null:g.selectedPaperFormat.MoveProductNameOnTop)),t.xp6(1),t.Q6J("ngIf",null==g.selectedPaperFormat?null:g.selectedPaperFormat.PriceVisible),t.xp6(1),t.Q6J("ngIf",(null==g.selectedPaperFormat?null:g.selectedPaperFormat.NameVisible)&&!(null!=g.selectedPaperFormat&&g.selectedPaperFormat.MoveProductNameOnTop)),t.xp6(1),t.Q6J("ngIf",null==g.selectedPaperFormat?null:g.selectedPaperFormat.ShowReleasedDate),t.xp6(1),t.Q6J("ngIf",null==g.selectedPaperFormat?null:g.selectedPaperFormat.ShowPriceDiscount),t.xp6(1),t.Q6J("ngIf",0==(null==g.selectedPaperFormat?null:g.selectedPaperFormat.Orientation)),t.xp6(1),t.Q6J("ngIf",1==(null==g.selectedPaperFormat?null:g.selectedPaperFormat.Orientation))}}Ve.\u0275fac=function(a){return new(a||Ve)},Ve.\u0275pipe=t.Yjl({name:"taxPipe",type:Ve,pure:!0});class Ge{constructor(a,r,g,A,G,K,ne){this.dialog=a,this.productStateService=r,this.productService=g,this.barcodeService=A,this.toastService=G,this.authService=K,this.route=ne,this.paperFormatOptions=[],this.optionSelected={id:1,name:"Continuous - 3 Column"},this.paperFormats=[],this.totalStickerPerRow=0,this.lastIndex=0,this.destroy$=new _.x,this.productPreview=[],this.taxs=[];const re=this.route.snapshot.queryParams?.ID;re&&this.productService.getProductById(re).pipe((0,J.b)(ae=>this.productStateService.setState([ae]))).subscribe(),(()=>{const ae=localStorage.getItem("Token");if(h.gT.IsNotEmpty(ae)){const nt=h.gT.parseJwt(ae)["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];console.log(nt),this.outletView=nt.includes("Out")}})()}ngOnInit(){this.getPaperFormats(),this.checkAuthTax(),this.subscribeToObsproducts()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}checkAuthTax(){this.authService.getRoles().find(g=>"StpE"===g)?(this.getProductTax(),this.authTax=!0):this.authTax=!1}subscribeToObsproducts(){this.productStateService.getState().pipe((0,l.R)(this.destroy$)).subscribe(a=>{this.productPreview=a,this.relayout()})}getProductTax(){this.productService.getTax().pipe((0,l.R)(this.destroy$)).subscribe(a=>{a&&(this.taxs=a)})}getPaperFormats(){this.barcodeService.getPaperFormatConfig().pipe((0,l.R)(this.destroy$)).subscribe({next:a=>{a.paperFormat&&(this.paperFormats=a.paperFormat,this.outlets=a.outlets,this.setSelectedPaperFormat(a.paperFormat[0]),this.initOptionFormat(),this.initOptionSelected(this.selectedPaperFormat))},error:a=>{console.error(a)}})}initOptionFormat(){this.paperFormatOptions=[],this.paperFormats.forEach((a,r)=>{this.paperFormatOptions=[...this.paperFormatOptions,{id:r+1,name:a.Name}]})}initOptionSelected(a){this.optionSelected=this.paperFormatOptions.find(r=>r.name===a.Name)}openSettingModal(){this.dialog.open(pe,{width:"850px",data:{paperFormat:this.selectedPaperFormat,taxs:this.taxs,authTax:this.authTax,outlets:this.outlets,outletRole:this.outletView}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(a=>{a&&this.selectedPaperFormat&&(this.updatePaperFormatSource(a),this.updatePaperFormat(),this.setSelectedPaperFormat(a))})}onSelectPaperFormat(){this.getPaperFormatBarcode()}getPaperFormatBarcode(){let r=this.findPaperFormatByName(this.optionSelected.name);this.setSelectedPaperFormat(r)}updatePaperFormat(){this.barcodeService.updatePaperFormatConfig(this.paperFormats).pipe((0,l.R)(this.destroy$)).subscribe({next:()=>{this.toastService.success("Success Update Paper Format","Success")},error:a=>{console.error(a)}})}setSelectedPaperFormat(a){this.selectedPaperFormat=a,this.barcodeService.setBarcodeConfigState(a),this.relayout(),this.getPPnVal(a)}findPaperFormatByName(a){return this.paperFormats.find(g=>g.Name==a)}updatePaperFormatSource(a){this.paperFormats=this.paperFormats.map(r=>(a.Name===r.Name&&(r=a),r))}getPPnVal(a){this.tax=a.TaxType?a.TaxType.Rate:null}relayout(){let g=this.selectedPaperFormat?.ColumnSpacing?this.selectedPaperFormat?.ColumnSpacing:0,G=Math.floor(((this.selectedPaperFormat?.PaperWidth?this.selectedPaperFormat?.PaperWidth:0)+g)/((this.selectedPaperFormat?.StickerWidth?this.selectedPaperFormat?.StickerWidth:0)+g));this.totalStickerPerRow=G;let ne=Math.floor(this.productPreview.length/G),re=this.productPreview.length-ne*G;this.lastIndex=0===re?G:re,this.productPreview=this.productPreview.map(te=>(te.setBarcodeTitle=this.selectedPaperFormat?.DescriptionAsCode&&te.getDescription?te.getDescription:te.getCode,te))}}Ge.\u0275fac=function(a){return new(a||Ge)(t.Y36(p.uw),t.Y36(w),t.Y36(me),t.Y36(ee),t.Y36(ye._W),t.Y36(k.$),t.Y36(N.gz))},Ge.\u0275cmp=t.Xpm({type:Ge,selectors:[["app-print-preview"]],decls:15,vars:10,consts:[[1,"mt-3","d-print-none"],[1,"card","mt-0","mb-0","paper-barcode"],[1,"card-header","d-flex","justify-content-between","align-items-center","border-bottom","pb-5","d-print-none"],[1,"fw-light"],["align","right",2,"width","400px"],[1,"d-inline-block","fw-light","text-info","fst-italic"],["align","left","bindLabel","name","placeholder","Select Column",1,"d-inline-block","ms-4",3,"items","ngModel","clearable","ngModelChange","change"],[1,"btn","btn","btn-outline-secondary","ms-4",3,"click"],["aria-hidden","true",1,"fa","fa-cog"],[1,"card-body","d-print-block",2,"padding","0"],[1,"canvas"],[1,"barcodes"],[3,"width","height","margin-right","margin-bottom",4,"ngFor","ngForOf"],[1,"position-relative"],[3,"bc-value","bc-element-type","bc-width","bc-height",4,"ngIf"],[2,"margin-top","-4px","line-height","1"],["class","d-block",3,"font-size",4,"ngIf"],[4,"ngIf"],[3,"bc-value","bc-element-type","bc-width","bc-height"],[1,"d-block"],[4,"ngIf","ngIfElse"],["WITHOUT_PROMOTION",""],[1,"d-flex","justify-content-between"],[1,"ms-12"],[1,"me-12"],[1,"text-danger",2,"text-decoration","line-through","text-decoration-thickness","1.5px"],[1,"text-dark"],[1,"d-flex","justify-content-between","mt-1"],[1,"me-12","text-danger"],["WITH_TAX",""],["WITHOUT_TAX",""],[1,"vertical-text"]],template:function(a,r){1&a&&(t._UZ(0,"div",0),t.TgZ(1,"div",1)(2,"div",2)(3,"h1",3),t._uU(4," Print Preview "),t.qZA(),t.TgZ(5,"div",4)(6,"h5",5),t._uU(7,"Paper Source"),t.qZA(),t.TgZ(8,"ng-select",6),t.NdJ("ngModelChange",function(A){return r.optionSelected=A})("change",function(){return r.onSelectPaperFormat()}),t.qZA(),t.TgZ(9,"button",7),t.NdJ("click",function(){return r.openSettingModal()}),t._UZ(10,"i",8),t.qZA()()(),t.TgZ(11,"div",9)(12,"div",10)(13,"ul",11),t.YNc(14,dt,12,17,"li",12),t.qZA()()()()),2&a&&(t.xp6(8),t.Q6J("items",r.paperFormatOptions)("ngModel",r.optionSelected)("clearable",!1),t.xp6(4),t.Udp("width",(null==r.selectedPaperFormat?null:r.selectedPaperFormat.PaperWidth)+"px")("margin-top",(null==r.selectedPaperFormat?null:r.selectedPaperFormat.MarginTop)+"px")("margin-left",(null==r.selectedPaperFormat?null:r.selectedPaperFormat.MarginLeft)+"px"),t.xp6(2),t.Q6J("ngForOf",r.productPreview))},dependencies:[F.sg,F.O5,P.JJ,P.On,R.w9,Ae,F.OU,F.JJ,F.uU,Ve],styles:["ng-select[_ngcontent-%COMP%]{width:50%}.card-header[_ngcontent-%COMP%]{height:65px} div.barcode>img{text-align:center;max-width:100%;border:none;outline:none}@media (max-width: 480px){ div.barcode>img{border:none!important}} div.canvas ul.barcodes li img{display:block;margin:0 auto}.vertical-text[_ngcontent-%COMP%]{transform:rotate(180deg);writing-mode:vertical-rl;position:absolute;right:0;height:100%;top:8%;text-align:center}"]});class ze{constructor(a,r,g){this.variantServiceState=a,this.authService=r,this.queryParamService=g,this.domainName=localStorage.getItem("Domain")}onLogout(){this.variantServiceState.setState([]),this.queryParamService.setState(null),this.authService.logout()}}ze.\u0275fac=function(a){return new(a||ze)(t.Y36(w),t.Y36(k.$),t.Y36(I.U))},ze.\u0275cmp=t.Xpm({type:ze,selectors:[["app-pages"]],decls:20,vars:2,consts:[[1,"container"],[1,"row"],[1,"col-4","d-print-none"],[1,"col-8","p-0"],[1,"d-md-block","d-print-none"],[1,"row","justify-content-between","align-items-center"],[1,"col-auto","d-inline-flex"],[1,"pt-1rem","me-3"],["target","_blank","href","https://www.dealpos.com"],["src","https://res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png","alt","dealpos-logo",1,"img-fluid"],[1,"col-auto"],[1,"logout","d-print-none"],[3,"href"],[3,"click"],[1,"fa","fa-sign-out-alt"]],template:function(a,r){1&a&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._UZ(3,"app-list-products"),t.qZA(),t.TgZ(4,"div",3),t._UZ(5,"app-print-preview"),t.qZA()()(),t.TgZ(6,"footer",4)(7,"div",5)(8,"div",6)(9,"p",7),t._uU(10,"Powered by : "),t.qZA(),t.TgZ(11,"a",8),t._UZ(12,"img",9),t.qZA()(),t.TgZ(13,"div",10)(14,"div",11)(15,"a",12),t._uU(16),t.qZA(),t.TgZ(17,"h5",13),t.NdJ("click",function(){return r.onLogout()}),t._UZ(18,"span",14),t._uU(19,"\xa0Logout"),t.qZA()()()()()),2&a&&(t.xp6(15),t.MGl("href","https://",r.domainName,"",t.LSH),t.xp6(1),t.Oqu(r.domainName))},dependencies:[Fe,Ge],styles:[".logout[_ngcontent-%COMP%]{position:relative;left:2.5vw;top:-5px;font-size:14px;cursor:pointer}footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:-1%}@media (min-height: 720px){footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:12%}}@media (min-height: 768px){footer[_ngcontent-%COMP%]{position:relative;bottom:0;width:90%;left:3rem;top:16%}}"]});var ht=O(4949);const mt=[{path:"",component:ze}];class Ze{}Ze.\u0275fac=function(a){return new(a||Ze)},Ze.\u0275mod=t.oAB({type:Ze}),Ze.\u0275inj=t.cJS({imports:[F.ez,ht.m,ke,Xe,Le,N.Bz.forChild(mt)]})},7370:function(W){W.exports=function(){return F={},b.m=O=[function(N,t,x){"use strict";x.r(t);var M={allowedTagList:["b","caption","cite","code","const","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","input","ins","kdb","label","li","option","output","p","q","s","sample","span","strong","td","th","u"]};Object.freeze(M.allowedTagList),Object.defineProperty(M,"allowedTagList",{configurable:!1,writable:!1}),M.keyCode={Backspace:8,Tab:9,Enter:13,Shift:16,Ctrl:17,Alt:18,Pause:19,CapsLock:20,Esc:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,LeftArrow:37,UpArrow:38,RightArrow:39,DownArrow:40,Insert:45,Delete:46,num0:48,num1:49,num2:50,num3:51,num4:52,num5:53,num6:54,num7:55,num8:56,num9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,OSLeft:91,OSRight:92,ContextMenu:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,MultiplyNumpad:106,PlusNumpad:107,MinusNumpad:109,DotNumpad:110,SlashNumpad:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,HyphenFirefox:173,MyComputer:182,MyCalculator:183,Semicolon:186,Equal:187,Comma:188,Hyphen:189,Dot:190,Slash:191,Backquote:192,LeftBracket:219,Backslash:220,RightBracket:221,Quote:222,Command:224,AltGraph:225,AndroidDefault:229},Object.freeze(M.keyCode),Object.defineProperty(M,"keyCode",{configurable:!1,writable:!1}),M.fromCharCodeKeyCode={0:"LaunchCalculator",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",91:"OS",92:"OSRight",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",173:"-",182:"MyComputer",183:"MyCalculator",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta",225:"AltGraph"},Object.freeze(M.fromCharCodeKeyCode),Object.defineProperty(M,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),M.keyName={Unidentified:"Unidentified",AndroidDefault:"AndroidDefault",Alt:"Alt",AltGr:"AltGraph",CapsLock:"CapsLock",Ctrl:"Control",Fn:"Fn",FnLock:"FnLock",Hyper:"Hyper",Meta:"Meta",OSLeft:"OS",OSRight:"OS",Command:"OS",NumLock:"NumLock",ScrollLock:"ScrollLock",Shift:"Shift",Super:"Super",Symbol:"Symbol",SymbolLock:"SymbolLock",Enter:"Enter",Tab:"Tab",Space:" ",LeftArrow:"ArrowLeft",UpArrow:"ArrowUp",RightArrow:"ArrowRight",DownArrow:"ArrowDown",End:"End",Home:"Home",PageUp:"PageUp",PageDown:"PageDown",Backspace:"Backspace",Clear:"Clear",Copy:"Copy",CrSel:"CrSel",Cut:"Cut",Delete:"Delete",EraseEof:"EraseEof",ExSel:"ExSel",Insert:"Insert",Paste:"Paste",Redo:"Redo",Undo:"Undo",Accept:"Accept",Again:"Again",Attn:"Attn",Cancel:"Cancel",ContextMenu:"ContextMenu",Esc:"Escape",Execute:"Execute",Find:"Find",Finish:"Finish",Help:"Help",Pause:"Pause",Play:"Play",Props:"Props",Select:"Select",ZoomIn:"ZoomIn",ZoomOut:"ZoomOut",BrightnessDown:"BrightnessDown",BrightnessUp:"BrightnessUp",Eject:"Eject",LogOff:"LogOff",Power:"Power",PowerOff:"PowerOff",PrintScreen:"PrintScreen",Hibernate:"Hibernate",Standby:"Standby",WakeUp:"WakeUp",Compose:"Compose",Dead:"Dead",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",Print:"Print",num0:"0",num1:"1",num2:"2",num3:"3",num4:"4",num5:"5",num6:"6",num7:"7",num8:"8",num9:"9",a:"a",b:"b",c:"c",d:"d",e:"e",f:"f",g:"g",h:"h",i:"i",j:"j",k:"k",l:"l",m:"m",n:"n",o:"o",p:"p",q:"q",r:"r",s:"s",t:"t",u:"u",v:"v",w:"w",x:"x",y:"y",z:"z",A:"A",B:"B",C:"C",D:"D",E:"E",F:"F",G:"G",H:"H",I:"I",J:"J",K:"K",L:"L",M:"M",N:"N",O:"O",P:"P",Q:"Q",R:"R",S:"S",T:"T",U:"U",V:"V",W:"W",X:"X",Y:"Y",Z:"Z",Semicolon:";",Equal:"=",Comma:",",Hyphen:"-",Minus:"-",Plus:"+",Dot:".",Slash:"/",Backquote:"`",LeftParenthesis:"(",RightParenthesis:")",LeftBracket:"[",RightBracket:"]",Backslash:"\\",Quote:"'",numpad0:"0",numpad1:"1",numpad2:"2",numpad3:"3",numpad4:"4",numpad5:"5",numpad6:"6",numpad7:"7",numpad8:"8",numpad9:"9",NumpadDot:".",NumpadDotAlt:",",NumpadMultiply:"*",NumpadPlus:"+",NumpadMinus:"-",NumpadSubtract:"-",NumpadSlash:"/",NumpadDotObsoleteBrowsers:"Decimal",NumpadMultiplyObsoleteBrowsers:"Multiply",NumpadPlusObsoleteBrowsers:"Add",NumpadMinusObsoleteBrowsers:"Subtract",NumpadSlashObsoleteBrowsers:"Divide",_allFnKeys:["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"],_someNonPrintableKeys:["Tab","Enter","Shift","ShiftLeft","ShiftRight","Control","ControlLeft","ControlRight","Alt","AltLeft","AltRight","Pause","CapsLock","Escape"],_directionKeys:["PageUp","PageDown","End","Home","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"]},Object.freeze(M.keyName._allFnKeys),Object.freeze(M.keyName._someNonPrintableKeys),Object.freeze(M.keyName._directionKeys),Object.freeze(M.keyName),Object.defineProperty(M,"keyName",{configurable:!1,writable:!1}),Object.freeze(M);var w=M;function k(s){return function(d){if(Array.isArray(d))return c(d)}(s)||function(d){if(typeof Symbol<"u"&&Symbol.iterator in Object(d))return Array.from(d)}(s)||l(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(){return(I=Object.assign||function(s){for(var d=1;d<arguments.length;d++){var f=arguments[d];for(var e in f)Object.prototype.hasOwnProperty.call(f,e)&&(s[e]=f[e])}return s}).apply(this,arguments)}function _(s,d){return function(f){if(Array.isArray(f))return f}(s)||function(f,e){if(typeof Symbol<"u"&&Symbol.iterator in Object(f)){var n=[],o=!0,m=!1,v=void 0;try{for(var u,C=f[Symbol.iterator]();!(o=(u=C.next()).done)&&(n.push(u.value),!e||n.length!==e);o=!0);}catch(V){m=!0,v=V}finally{try{o||null==C.return||C.return()}finally{if(m)throw v}}return n}}(s,d)||l(s,d)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(s,d){if(s){if("string"==typeof s)return c(s,d);var f=Object.prototype.toString.call(s).slice(8,-1);return"Object"===f&&s.constructor&&(f=s.constructor.name),"Map"===f||"Set"===f?Array.from(f):"Arguments"===f||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?c(s,d):void 0}}function c(s,d){(null==d||d>s.length)&&(d=s.length);for(var f=0,e=new Array(d);f<d;f++)e[f]=s[f];return e}function h(s){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(d){return typeof d}:function(d){return d&&"function"==typeof Symbol&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d})(s)}var i=function(){function s(){!function(d){if(!(d instanceof s))throw new TypeError("Cannot call a class as a function")}(this)}return function(d,f){for(var e=0;e<f.length;e++){var n=f[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(d,n.key,n)}}(s,[{key:"isNull",value:function(d){return null===d}},{key:"isUndefined",value:function(d){return void 0===d}},{key:"isUndefinedOrNullOrEmpty",value:function(d){return null==d||""===d}},{key:"isString",value:function(d){return"string"==typeof d||d instanceof String}},{key:"isEmptyString",value:function(d){return""===d}},{key:"isBoolean",value:function(d){return"boolean"==typeof d}},{key:"isTrueOrFalseString",value:function(d){var f=String(d).toLowerCase();return"true"===f||"false"===f}},{key:"isObject",value:function(d){return"object"===h(d)&&null!==d&&!Array.isArray(d)}},{key:"isEmptyObj",value:function(d){for(var f in d)if(Object.prototype.hasOwnProperty.call(d,f))return!1;return!0}},{key:"isNumberStrict",value:function(d){return"number"==typeof d}},{key:"isNumber",value:function(d){return!this.isArray(d)&&!isNaN(parseFloat(d))&&isFinite(d)}},{key:"isDigit",value:function(d){return/\d/.test(d)}},{key:"isNumberOrArabic",value:function(d){var f=this.arabicToLatinNumbers(d,!1,!0,!0);return this.isNumber(f)}},{key:"isInt",value:function(d){return"number"==typeof d&&parseFloat(d)===parseInt(d,10)&&!isNaN(d)}},{key:"isFunction",value:function(d){return"function"==typeof d}},{key:"isIE11",value:function(){return typeof window<"u"&&!!window.MSInputMethodContext&&!!document.documentMode}},{key:"contains",value:function(d,f){return!(!this.isString(d)||!this.isString(f)||""===d||""===f)&&-1!==d.indexOf(f)}},{key:"isInArray",value:function(d,f){return!(!this.isArray(f)||f===[]||this.isUndefined(d))&&-1!==f.indexOf(d)}},{key:"isArray",value:function(d){if("[object Array]"===Object.prototype.toString.call([]))return Array.isArray(d)||"object"===h(d)&&"[object Array]"===Object.prototype.toString.call(d);throw new Error("toString message changed for Object Array")}},{key:"isElement",value:function(d){return typeof Element<"u"&&d instanceof Element}},{key:"isInputElement",value:function(d){return this.isElement(d)&&"input"===d.tagName.toLowerCase()}},{key:"decimalPlaces",value:function(d){var f=_(d.split("."),2)[1];return this.isUndefined(f)?0:f.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(d){var f=_(String(Math.abs(d)).split("."),2)[1];if(this.isUndefined(f))return 0;var e=f.lastIndexOf("0");return-1===e?e=0:e+=2,e}},{key:"keyCodeNumber",value:function(d){return void 0===d.which?d.keyCode:d.which}},{key:"character",value:function(d){var f;if("Unidentified"===d.key||void 0===d.key||this.isSeleniumBot()){var e=this.keyCodeNumber(d);if(e===w.keyCode.AndroidDefault)return w.keyName.AndroidDefault;var n=w.fromCharCodeKeyCode[e];f=s.isUndefinedOrNullOrEmpty(n)?String.fromCharCode(e):n}else{var o;switch(d.key){case"Add":f=w.keyName.NumpadPlus;break;case"Apps":f=w.keyName.ContextMenu;break;case"Crsel":f=w.keyName.CrSel;break;case"Decimal":f=d.char?d.char:w.keyName.NumpadDot;break;case"Del":f="firefox"===(o=this.browser()).name&&o.version<=36||"ie"===o.name&&o.version<=9?w.keyName.Dot:w.keyName.Delete;break;case"Divide":f=w.keyName.NumpadSlash;break;case"Down":f=w.keyName.DownArrow;break;case"Esc":f=w.keyName.Esc;break;case"Exsel":f=w.keyName.ExSel;break;case"Left":f=w.keyName.LeftArrow;break;case"Meta":case"Super":f=w.keyName.OSLeft;break;case"Multiply":f=w.keyName.NumpadMultiply;break;case"Right":f=w.keyName.RightArrow;break;case"Spacebar":f=w.keyName.Space;break;case"Subtract":f=w.keyName.NumpadMinus;break;case"Up":f=w.keyName.UpArrow;break;default:f=d.key}}return f}},{key:"browser",value:function(){var d,f=navigator.userAgent,e=f.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(e[1])?{name:"ie",version:(d=/\brv[ :]+(\d+)/g.exec(f)||[])[1]||""}:"Chrome"===e[1]&&null!==(d=f.match(/\b(OPR|Edge)\/(\d+)/))?{name:d[1].replace("OPR","opera"),version:d[2]}:(e=e[2]?[e[1],e[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(d=f.match(/version\/(\d+)/i))&&e.splice(1,1,d[1]),{name:e[0].toLowerCase(),version:e[1]})}},{key:"isSeleniumBot",value:function(){return!0===window.navigator.webdriver}},{key:"isNegative",value:function(d,f,e){var n=1<arguments.length&&void 0!==f?f:"-",o=!(2<arguments.length&&void 0!==e)||e;return d===n||""!==d&&(s.isNumber(d)?d<0:o?this.contains(d,n):this.isNegativeStrict(d,n))}},{key:"isNegativeStrict",value:function(d,f){var e=1<arguments.length&&void 0!==f?f:"-";return d.charAt(0)===e}},{key:"isNegativeWithBrackets",value:function(d,f,e){return d.charAt(0)===f&&this.contains(d,e)}},{key:"isZeroOrHasNoValue",value:function(d){return!/[1-9]/g.test(d)}},{key:"setRawNegativeSign",value:function(d){return this.isNegativeStrict(d,"-")?d:"-".concat(d)}},{key:"replaceCharAt",value:function(d,f,e){return"".concat(d.substr(0,f)).concat(e).concat(d.substr(f+e.length))}},{key:"clampToRangeLimits",value:function(d,f){return Math.max(f.minimumValue,Math.min(f.maximumValue,d))}},{key:"countNumberCharactersOnTheCaretLeftSide",value:function(d,f,e){for(var n=new RegExp("[0-9".concat(e,"-]")),o=0,m=0;m<f;m++)n.test(d[m])&&o++;return o}},{key:"findCaretPositionInFormattedNumber",value:function(d,f,e,n){var o,m=e.length,v=d.length,u=0;for(o=0;o<m&&u<v&&u<f;o++)(d[u]===e[o]||"."===d[u]&&e[o]===n)&&u++;return o}},{key:"countCharInText",value:function(d,f){for(var e=0,n=0;n<f.length;n++)f[n]===d&&e++;return e}},{key:"convertCharacterCountToIndexPosition",value:function(d){return Math.max(d,d-1)}},{key:"getElementSelection",value:function(d){var f,e={};try{f=this.isUndefined(d.selectionStart)}catch{f=!1}try{if(f){var n=window.getSelection().getRangeAt(0);e.start=n.startOffset,e.end=n.endOffset,e.length=e.end-e.start}else e.start=d.selectionStart,e.end=d.selectionEnd,e.length=e.end-e.start}catch{e.start=0,e.end=0,e.length=0}return e}},{key:"setElementSelection",value:function(d,f,e){var n=2<arguments.length&&void 0!==e?e:null;if(this.isUndefinedOrNullOrEmpty(n)&&(n=f),this.isInputElement(d))d.setSelectionRange(f,n);else if(!s.isNull(d.firstChild)){var o=document.createRange();o.setStart(d.firstChild,f),o.setEnd(d.firstChild,n);var m=window.getSelection();m.removeAllRanges(),m.addRange(o)}}},{key:"throwError",value:function(d){throw new Error(d)}},{key:"warning",value:function(d,f){1<arguments.length&&void 0!==f&&!f||console.warn("Warning: ".concat(d))}},{key:"isWheelUpEvent",value:function(d){return d.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(d.type,"' given.")),d.deltaY<0}},{key:"isWheelDownEvent",value:function(d){return d.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(d.type,"' given.")),0<d.deltaY}},{key:"forceDecimalPlaces",value:function(d,f){var e=_(String(d).split("."),2),o=e[1];return o?"".concat(e[0],".").concat(o.substr(0,f)):d}},{key:"roundToNearest",value:function(d,f){var e=1<arguments.length&&void 0!==f?f:1e3;return 0===d?0:(0===e&&this.throwError("The `stepPlace` used to round is equal to `0`. This value must not be equal to zero."),Math.round(d/e)*e)}},{key:"modifyAndRoundToNearestAuto",value:function(d,f,e){d=Number(this.forceDecimalPlaces(d,e));var n=Math.abs(d);if(0<=n&&n<1){var o,m=Math.pow(10,-e);if(0===d)return f?m:-m;var u=e,C=this.indexFirstNonZeroDecimalPlace(d);return o=u-1<=C?m:Math.pow(10,-(C+1)),this.roundToNearest(f?d+o:d-o,o)}d=parseInt(d,10);var V,Z=Math.abs(d).toString().length;switch(Z){case 1:V=0;break;case 2:case 3:V=1;break;case 4:case 5:V=2;break;default:V=Z-3}var y,L=Math.pow(10,V);return(y=f?d+L:d-L)<=10&&-10<=y?y:this.roundToNearest(y,L)}},{key:"addAndRoundToNearestAuto",value:function(d,f){return this.modifyAndRoundToNearestAuto(d,!0,f)}},{key:"subtractAndRoundToNearestAuto",value:function(d,f){return this.modifyAndRoundToNearestAuto(d,!1,f)}},{key:"arabicToLatinNumbers",value:function(d,f,e,n){var o=!(1<arguments.length&&void 0!==f)||f,m=2<arguments.length&&void 0!==e&&e,v=3<arguments.length&&void 0!==n&&n;if(this.isNull(d))return d;var u=d.toString();if(""===u)return d;if(null===u.match(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06f4\u06f5\u06f6]/g))return o&&(u=Number(u)),u;m&&(u=u.replace(/\u066b/,".")),v&&(u=u.replace(/\u066c/g,"")),u=u.replace(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669]/g,function(V){return V.charCodeAt(0)-1632}).replace(/[\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9]/g,function(V){return V.charCodeAt(0)-1776});var C=Number(u);return isNaN(C)?C:(o&&(u=C),u)}},{key:"triggerEvent",value:function(d,f,e,n,o){var m,v=1<arguments.length&&void 0!==f?f:document,u=2<arguments.length&&void 0!==e?e:null,C=!(3<arguments.length&&void 0!==n)||n,V=!(4<arguments.length&&void 0!==o)||o;window.CustomEvent?m=new CustomEvent(d,{detail:u,bubbles:C,cancelable:V}):(m=document.createEvent("CustomEvent")).initCustomEvent(d,C,V,{detail:u}),v.dispatchEvent(m)}},{key:"parseStr",value:function(d){var f,e,n,o,m={};if(0===d&&1/d<0&&(d="-0"),d=d.toString(),this.isNegativeStrict(d,"-")?(d=d.slice(1),m.s=-1):m.s=1,-1<(f=d.indexOf("."))&&(d=d.replace(".","")),f<0&&(f=d.length),(e=-1===d.search(/[1-9]/i)?d.length:d.search(/[1-9]/i))===(n=d.length))m.e=0,m.c=[0];else{for(o=n-1;"0"===d.charAt(o);--o)--n;for(--n,m.e=f-e-1,m.c=[],f=0;e<=n;e+=1)m.c[f]=+d.charAt(e),f+=1}return m}},{key:"testMinMax",value:function(d,f){var e=f.c,n=d.c,o=f.s,m=d.s,v=f.e,u=d.e;if(!e[0]||!n[0])return e[0]?o:n[0]?-m:0;if(o!==m)return o;var C=o<0;if(v!==u)return u<v^C?1:-1;for(o=-1,m=(v=e.length)<(u=n.length)?v:u,o+=1;o<m;o+=1)if(e[o]!==n[o])return e[o]>n[o]^C?1:-1;return v===u?0:u<v^C?1:-1}},{key:"randomString",value:function(d){var f=0<arguments.length&&void 0!==d?d:5;return Math.random().toString(36).substr(2,f)}},{key:"domElement",value:function(d){return s.isString(d)?document.querySelector(d):d}},{key:"getElementValue",value:function(d){return"input"===d.tagName.toLowerCase()?d.value:this.text(d)}},{key:"setElementValue",value:function(d,f){var e=1<arguments.length&&void 0!==f?f:null;"input"===d.tagName.toLowerCase()?d.value=e:d.textContent=e}},{key:"setInvalidState",value:function(d,f){var e=1<arguments.length&&void 0!==f?f:"Invalid";""!==e&&!this.isNull(e)||this.throwError("Cannot set the invalid state with an empty message."),d.setCustomValidity(e)}},{key:"setValidState",value:function(d){d.setCustomValidity("")}},{key:"cloneObject",value:function(d){return I({},d)}},{key:"camelize",value:function(d,f,e,n){var o=1<arguments.length&&void 0!==f?f:"-",m=!(2<arguments.length&&void 0!==e)||e,v=!(3<arguments.length&&void 0!==n)||n;if(this.isNull(d))return null;m&&(d=d.replace(/^data-/,""));var u=d.split(o).map(function(C){return"".concat(C.charAt(0).toUpperCase()).concat(C.slice(1))});return u=u.join(""),v&&(u="".concat(u.charAt(0).toLowerCase()).concat(u.slice(1))),u}},{key:"text",value:function(d){var f=d.nodeType;return f===Node.ELEMENT_NODE||f===Node.DOCUMENT_NODE||f===Node.DOCUMENT_FRAGMENT_NODE?d.textContent:f===Node.TEXT_NODE?d.nodeValue:""}},{key:"setText",value:function(d,f){var e=d.nodeType;e!==Node.ELEMENT_NODE&&e!==Node.DOCUMENT_NODE&&e!==Node.DOCUMENT_FRAGMENT_NODE||(d.textContent=f)}},{key:"filterOut",value:function(d,f){var e=this;return d.filter(function(n){return!e.isInArray(n,f)})}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(d){if(""===(d=String(d)))return"";var f=_(d.split("."),2),e=f[0],n=f[1];if(this.isUndefinedOrNullOrEmpty(n))return e;var o=n.replace(/0+$/g,"");return""===o?e:"".concat(e,".").concat(o)}},{key:"getHoveredElement",value:function(){var d=k(document.querySelectorAll(":hover"));return d[d.length-1]}},{key:"arrayTrim",value:function(d,f){var e=d.length;return 0===e||e<f?d:f<0?[]:(d.length=parseInt(f,10),d)}},{key:"arrayUnique",value:function(){var d;return k(new Set((d=[]).concat.apply(d,arguments)))}},{key:"mergeMaps",value:function(){for(var d=arguments.length,f=new Array(d),e=0;e<d;e++)f[e]=arguments[e];return new Map(f.reduce(function(n,o){return n.concat(k(o))},[]))}},{key:"objectKeyLookup",value:function(d,f){var e=Object.entries(d).find(function(o){return o[1]===f}),n=null;return void 0!==e&&(n=e[0]),n}},{key:"insertAt",value:function(d,f,e){if(e>(d=String(d)).length)throw new Error("The given index is out of the string range.");if(1!==f.length)throw new Error("The given string `char` should be only one character long.");return""===d&&0===e?f:"".concat(d.slice(0,e)).concat(f).concat(d.slice(e))}},{key:"scientificToDecimal",value:function(d){var f=Number(d);if(isNaN(f))return NaN;if(d=String(d),!this.contains(d,"e")&&!this.contains(d,"E"))return d;var e=_(d.split(/e/i),2),n=e[0],o=e[1],m=n<0;m&&(n=n.replace("-",""));var v=+o<0;v&&(o=o.replace("-",""));var u,C=_(n.split(/\./),2),V=C[0],Z=C[1];return u=v?(u=V.length>o?this.insertAt(V,".",V.length-o):"0.".concat("0".repeat(o-V.length)).concat(V),"".concat(u).concat(Z||"")):Z?(n="".concat(V).concat(Z),o<Z.length?this.insertAt(n,".",+o+V.length):"".concat(n).concat("0".repeat(o-Z.length))):(n=n.replace(".",""),"".concat(n).concat("0".repeat(Number(o)))),m&&(u="-".concat(u)),u}}]),s}(),p=function(){function s(d){if(function(f){if(!(f instanceof s))throw new TypeError("Cannot call a class as a function")}(this),null===d)throw new Error("Invalid AST")}return function(d,f){for(var e=0;e<f.length;e++){var n=f[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(d,n.key,n)}}(s.prototype,[{key:"evaluate",value:function(d){if(null==d)throw new Error("Invalid AST sub-tree");if("number"===d.type)return d.value;if("unaryMinus"===d.type)return-this.evaluate(d.left);var f=this.evaluate(d.left),e=this.evaluate(d.right);switch(d.type){case"op_+":return Number(f)+Number(e);case"op_-":return f-e;case"op_*":return f*e;case"op_/":return f/e;default:throw new Error("Invalid operator '".concat(d.type,"'"))}}}]),s}(),S=function(){function s(){!function(d){if(!(d instanceof s))throw new TypeError("Cannot call a class as a function")}(this)}return function(d,f){for(var e=0;e<f.length;e++){var n=f[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(d,n.key,n)}}(s,[{key:"createNode",value:function(d,f,e){var n=new s;return n.type=d,n.left=f,n.right=e,n}},{key:"createUnaryNode",value:function(d){var f=new s;return f.type="unaryMinus",f.left=d,f.right=null,f}},{key:"createLeaf",value:function(d){var f=new s;return f.type="number",f.value=d,f}}]),s}();function P(s,d,f){(function(e){if(!(e instanceof P))throw new TypeError("Cannot call a class as a function")})(this),this.type=s,this.value=d,this.symbol=f}var R=function(){function s(d){(function(f){if(!(f instanceof s))throw new TypeError("Cannot call a class as a function")})(this),this.text=d,this.textLength=d.length,this.index=0,this.token=new P("Error",0,0)}return function(d,f){for(var e=0;e<f.length;e++){var n=f[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(d,n.key,n)}}(s.prototype,[{key:"_skipSpaces",value:function(){for(;" "===this.text[this.index]&&this.index<=this.textLength;)this.index++}},{key:"getIndex",value:function(){return this.index}},{key:"getNextToken",value:function(d){var f=0<arguments.length&&void 0!==d?d:".";if(this._skipSpaces(),this.textLength===this.index)return this.token.type="EOT",this.token;if(i.isDigit(this.text[this.index]))return this.token.type="num",this.token.value=this._getNumber(f),this.token;switch(this.token.type="Error",this.text[this.index]){case"+":this.token.type="+";break;case"-":this.token.type="-";break;case"*":this.token.type="*";break;case"/":this.token.type="/";break;case"(":this.token.type="(";break;case")":this.token.type=")"}if("Error"===this.token.type)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(this.token.index,"' in the token function"));return this.token.symbol=this.text[this.index],this.index++,this.token}},{key:"_getNumber",value:function(d){this._skipSpaces();for(var f=this.index;this.index<=this.textLength&&i.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===d&&this.index++;this.index<=this.textLength&&i.isDigit(this.text[this.index]);)this.index++;if(this.index===f)throw new Error("No number has been found while it was expected");return this.text.substring(f,this.index).replace(d,".")}}]),s}(),U=function(){function s(d){var f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:".";return function(e){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}(this),this.text=d,this.decimalCharacter=f,this.lexer=new R(d),this.token=this.lexer.getNextToken(this.decimalCharacter),this._exp()}return function(d,f){for(var e=0;e<f.length;e++){var n=f[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(d,n.key,n)}}(s.prototype,[{key:"_exp",value:function(){var d=this._term(),f=this._moreExp();return S.createNode("op_+",d,f)}},{key:"_moreExp",value:function(){var d,f;switch(this.token.type){case"+":return this.token=this.lexer.getNextToken(this.decimalCharacter),d=this._term(),f=this._moreExp(),S.createNode("op_+",f,d);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),d=this._term(),f=this._moreExp(),S.createNode("op_-",f,d)}return S.createLeaf(0)}},{key:"_term",value:function(){var d=this._factor(),f=this._moreTerms();return S.createNode("op_*",d,f)}},{key:"_moreTerms",value:function(){var d,f;switch(this.token.type){case"*":return this.token=this.lexer.getNextToken(this.decimalCharacter),d=this._factor(),f=this._moreTerms(),S.createNode("op_*",f,d);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),d=this._factor(),f=this._moreTerms(),S.createNode("op_/",f,d)}return S.createLeaf(1)}},{key:"_factor",value:function(){var d,f,e;switch(this.token.type){case"num":return e=this.token.value,this.token=this.lexer.getNextToken(this.decimalCharacter),S.createLeaf(e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),f=this._factor(),S.createUnaryNode(f);case"(":return this.token=this.lexer.getNextToken(this.decimalCharacter),d=this._exp(),this._match(")"),d;default:throw new Error("Unexpected token '".concat(this.token.symbol,"' with type '").concat(this.token.type,"' at position '").concat(this.token.index,"' in the factor function"))}}},{key:"_match",value:function(d){var f=this.lexer.getIndex()-1;if(this.text[f]!==d)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(f,"' in the match function"));this.token=this.lexer.getNextToken(this.decimalCharacter)}}]),s}();function j(s){return function(d){if(Array.isArray(d))return le(d)}(s)||function(d){if(typeof Symbol<"u"&&Symbol.iterator in Object(d))return Array.from(d)}(s)||ce(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(s,d){return function(f){if(Array.isArray(f))return f}(s)||function(f,e){if(typeof Symbol<"u"&&Symbol.iterator in Object(f)){var n=[],o=!0,m=!1,v=void 0;try{for(var u,C=f[Symbol.iterator]();!(o=(u=C.next()).done)&&(n.push(u.value),!e||n.length!==e);o=!0);}catch(V){m=!0,v=V}finally{try{o||null==C.return||C.return()}finally{if(m)throw v}}return n}}(s,d)||ce(s,d)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ce(s,d){if(s){if("string"==typeof s)return le(s,d);var f=Object.prototype.toString.call(s).slice(8,-1);return"Object"===f&&s.constructor&&(f=s.constructor.name),"Map"===f||"Set"===f?Array.from(f):"Arguments"===f||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?le(s,d):void 0}}function le(s,d){(null==d||d>s.length)&&(d=s.length);for(var f=0,e=new Array(d);f<d;f++)e[f]=s[f];return e}function ee(){return(ee=Object.assign||function(s){for(var d=1;d<arguments.length;d++){var f=arguments[d];for(var e in f)Object.prototype.hasOwnProperty.call(f,e)&&(s[e]=f[e])}return s}).apply(this,arguments)}function de(s){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(d){return typeof d}:function(d){return d&&"function"==typeof Symbol&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d})(s)}function Ne(s,d){for(var f=0;f<d.length;f++){var e=d[f];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}var H,T=function(){function s(){var e=this,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,m=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;!function(y){if(!(y instanceof s))throw new TypeError("Cannot call a class as a function")}(this);var v=s._setArgumentsValues(n,o,m),C=v.initialValue,V=v.userOptions;if(this.domElement=v.domElement,this.defaultRawValue="",this._setSettings(V,!1),this._checkElement(),this.savedCancellableValue=null,this.historyTable=[],this.historyTableIndex=-1,this.onGoingRedo=!1,this.parentForm=this._getParentForm(),!this.runOnce&&this.settings.formatOnPageLoad)this._formatDefaultValueOnPageLoad(C);else{var Z;if(i.isNull(C))switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.min:Z=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:Z=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:Z="0";break;case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:case s.options.emptyInputBehavior.null:Z="";break;default:Z=this.settings.emptyInputBehavior}else Z=C;this._setElementAndRawValue(Z)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(C),this.sessionStorageAvailable=this.constructor._storageTest(),this.storageNamePrefix="AUTO_",this._setPersistentStorageName(),this.validState=!0,this.isFocused=!1,this.isWheelEvent=!1,this.isDropEvent=!1,this.isEditing=!1,this.rawValueOnFocus=void 0,this.internalModification=!1,this.attributeToWatch=this._getAttributeToWatch(),this.getterSetter=Object.getOwnPropertyDescriptor(this.domElement.__proto__,this.attributeToWatch),this._addWatcher(),this.settings.createLocalList&&this._createLocalList(),this.constructor._addToGlobalList(this),this.global={set:function(y,L){var D=1<arguments.length&&void 0!==L?L:null;e.autoNumericLocalList.forEach(function(B){B.set(y,D)})},setUnformatted:function(y,L){var D=1<arguments.length&&void 0!==L?L:null;e.autoNumericLocalList.forEach(function(B){B.setUnformatted(y,D)})},get:function(y){var L=0<arguments.length&&void 0!==y?y:null,D=[];return e.autoNumericLocalList.forEach(function(B){D.push(B.get())}),e._executeCallback(D,L),D},getNumericString:function(y){var L=0<arguments.length&&void 0!==y?y:null,D=[];return e.autoNumericLocalList.forEach(function(B){D.push(B.getNumericString())}),e._executeCallback(D,L),D},getFormatted:function(y){var L=0<arguments.length&&void 0!==y?y:null,D=[];return e.autoNumericLocalList.forEach(function(B){D.push(B.getFormatted())}),e._executeCallback(D,L),D},getNumber:function(y){var L=0<arguments.length&&void 0!==y?y:null,D=[];return e.autoNumericLocalList.forEach(function(B){D.push(B.getNumber())}),e._executeCallback(D,L),D},getLocalized:function(y){var L=0<arguments.length&&void 0!==y?y:null,D=[];return e.autoNumericLocalList.forEach(function(B){D.push(B.getLocalized())}),e._executeCallback(D,L),D},reformat:function(){e.autoNumericLocalList.forEach(function(y){y.reformat()})},unformat:function(){e.autoNumericLocalList.forEach(function(y){y.unformat()})},unformatLocalized:function(y){var L=0<arguments.length&&void 0!==y?y:null;e.autoNumericLocalList.forEach(function(D){D.unformatLocalized(L)})},update:function(){for(var y=arguments.length,L=new Array(y),D=0;D<y;D++)L[D]=arguments[D];e.autoNumericLocalList.forEach(function(B){B.update.apply(B,L)})},isPristine:function(){var y=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],L=!0;return e.autoNumericLocalList.forEach(function(D){L&&!D.isPristine(y)&&(L=!1)}),L},clear:function(y){var L=0<arguments.length&&void 0!==y&&y;e.autoNumericLocalList.forEach(function(D){D.clear(L)})},remove:function(){e.autoNumericLocalList.forEach(function(y){y.remove()})},wipe:function(){e.autoNumericLocalList.forEach(function(y){y.wipe()})},nuke:function(){e.autoNumericLocalList.forEach(function(y){y.nuke()})},has:function(y){return e.autoNumericLocalList.has(y instanceof s?y.node():y)},addObject:function(y){var L,D;D=y instanceof s?(L=y.node(),y):s.getAutoNumericElement(L=y),e._hasLocalList()||e._createLocalList();var B,z=D._getLocalList();0===z.size&&(D._createLocalList(),z=D._getLocalList()),(B=z instanceof Map?i.mergeMaps(e._getLocalList(),z):(e._addToLocalList(L,D),e._getLocalList())).forEach(function(q){q._setLocalList(B)})},removeObject:function(y,L){var D,B,z=1<arguments.length&&void 0!==L&&L;B=y instanceof s?(D=y.node(),y):s.getAutoNumericElement(D=y);var q=e.autoNumericLocalList;e.autoNumericLocalList.delete(D),q.forEach(function(Y){Y._setLocalList(e.autoNumericLocalList)}),z||D!==e.node()?B._createLocalList():B._setLocalList(new Map)},empty:function(y){var L=0<arguments.length&&void 0!==y&&y;e.autoNumericLocalList.forEach(function(D){L?D._createLocalList():D._setLocalList(new Map)})},elements:function(){var y=[];return e.autoNumericLocalList.forEach(function(L){y.push(L.node())}),y},getList:function(){return e.autoNumericLocalList},size:function(){return e.autoNumericLocalList.size}},this.options={reset:function(){return e.settings={rawValue:e.defaultRawValue},e.update(s.defaultSettings),e},allowDecimalPadding:function(y){return e.update({allowDecimalPadding:y}),e},alwaysAllowDecimalCharacter:function(y){return e.update({alwaysAllowDecimalCharacter:y}),e},caretPositionOnFocus:function(y){return e.settings.caretPositionOnFocus=y,e},createLocalList:function(y){return e.settings.createLocalList=y,e.settings.createLocalList?e._hasLocalList()||e._createLocalList():e._deleteLocalList(),e},currencySymbol:function(y){return e.update({currencySymbol:y}),e},currencySymbolPlacement:function(y){return e.update({currencySymbolPlacement:y}),e},decimalCharacter:function(y){return e.update({decimalCharacter:y}),e},decimalCharacterAlternative:function(y){return e.settings.decimalCharacterAlternative=y,e},decimalPlaces:function(y){return i.warning("Using `options.decimalPlaces()` instead of calling the specific `options.decimalPlacesRawValue()`, `options.decimalPlacesShownOnFocus()` and `options.decimalPlacesShownOnBlur()` methods will reset those options.\nPlease call the specific methods if you do not want to reset those.",e.settings.showWarnings),e.update({decimalPlaces:y}),e},decimalPlacesRawValue:function(y){return e.update({decimalPlacesRawValue:y}),e},decimalPlacesShownOnBlur:function(y){return e.update({decimalPlacesShownOnBlur:y}),e},decimalPlacesShownOnFocus:function(y){return e.update({decimalPlacesShownOnFocus:y}),e},defaultValueOverride:function(y){return e.update({defaultValueOverride:y}),e},digitalGroupSpacing:function(y){return e.update({digitalGroupSpacing:y}),e},digitGroupSeparator:function(y){return e.update({digitGroupSeparator:y}),e},divisorWhenUnfocused:function(y){return e.update({divisorWhenUnfocused:y}),e},emptyInputBehavior:function(y){return null===e.rawValue&&y!==s.options.emptyInputBehavior.null&&(i.warning("You are trying to modify the `emptyInputBehavior` option to something different than `'null'` (".concat(y,"), but the element raw value is currently set to `null`. This would result in an invalid `rawValue`. In order to fix that, the element value has been changed to the empty string `''`."),e.settings.showWarnings),e.rawValue=""),e.update({emptyInputBehavior:y}),e},eventBubbles:function(y){return e.settings.eventBubbles=y,e},eventIsCancelable:function(y){return e.settings.eventIsCancelable=y,e},failOnUnknownOption:function(y){return e.settings.failOnUnknownOption=y,e},formatOnPageLoad:function(y){return e.settings.formatOnPageLoad=y,e},formulaMode:function(y){return e.settings.formulaMode=y,e},historySize:function(y){return e.settings.historySize=y,e},invalidClass:function(y){return e.settings.invalidClass=y,e},isCancellable:function(y){return e.settings.isCancellable=y,e},leadingZero:function(y){return e.update({leadingZero:y}),e},maximumValue:function(y){return e.update({maximumValue:y}),e},minimumValue:function(y){return e.update({minimumValue:y}),e},modifyValueOnWheel:function(y){return e.settings.modifyValueOnWheel=y,e},negativeBracketsTypeOnBlur:function(y){return e.update({negativeBracketsTypeOnBlur:y}),e},negativePositiveSignPlacement:function(y){return e.update({negativePositiveSignPlacement:y}),e},negativeSignCharacter:function(y){return e.update({negativeSignCharacter:y}),e},noEventListeners:function(y){return y===s.options.noEventListeners.noEvents&&e.settings.noEventListeners===s.options.noEventListeners.addEvents&&e._removeEventListeners(),e.update({noEventListeners:y}),e},onInvalidPaste:function(y){return e.settings.onInvalidPaste=y,e},outputFormat:function(y){return e.settings.outputFormat=y,e},overrideMinMaxLimits:function(y){return e.update({overrideMinMaxLimits:y}),e},positiveSignCharacter:function(y){return e.update({positiveSignCharacter:y}),e},rawValueDivisor:function(y){return e.update({rawValueDivisor:y}),e},readOnly:function(y){return e.settings.readOnly=y,e._setWritePermissions(),e},roundingMethod:function(y){return e.update({roundingMethod:y}),e},saveValueToSessionStorage:function(y){return e.update({saveValueToSessionStorage:y}),e},symbolWhenUnfocused:function(y){return e.update({symbolWhenUnfocused:y}),e},selectNumberOnly:function(y){return e.settings.selectNumberOnly=y,e},selectOnFocus:function(y){return e.settings.selectOnFocus=y,e},serializeSpaces:function(y){return e.settings.serializeSpaces=y,e},showOnlyNumbersOnFocus:function(y){return e.update({showOnlyNumbersOnFocus:y}),e},showPositiveSign:function(y){return e.update({showPositiveSign:y}),e},showWarnings:function(y){return e.settings.showWarnings=y,e},styleRules:function(y){return e.update({styleRules:y}),e},suffixText:function(y){return e.update({suffixText:y}),e},unformatOnHover:function(y){return e.settings.unformatOnHover=y,e},unformatOnSubmit:function(y){return e.settings.unformatOnSubmit=y,e},valuesToStrings:function(y){return e.update({valuesToStrings:y}),e},watchExternalChanges:function(y){return e.update({watchExternalChanges:y}),e},wheelOn:function(y){return e.settings.wheelOn=y,e},wheelStep:function(y){return e.settings.wheelStep=y,e}},this._triggerEvent(s.events.initialized,this.domElement,{newValue:i.getElementValue(this.domElement),newRawValue:this.rawValue,error:null,aNElement:this})}var d,f;return f=[{key:"version",value:function(){return"4.6.0"}},{key:"_setArgumentsValues",value:function(e,n,o){i.isNull(e)&&i.throwError("At least one valid parameter is needed in order to initialize an AutoNumeric object");var m,v,u,C=i.isElement(e),V=i.isString(e),Z=i.isObject(n),y=Array.isArray(n)&&0<n.length,L=i.isNumberOrArabic(n)||""===n,D=this._isPreDefinedOptionValid(n),B=i.isNull(n),z=i.isEmptyString(n),q=i.isObject(o),Y=Array.isArray(o)&&0<o.length,oe=i.isNull(o),ue=this._isPreDefinedOptionValid(o);return C&&B&&oe?(m=e,v=u=null):C&&L&&oe?(m=e,u=n,v=null):C&&Z&&oe?(m=e,u=null,v=n):C&&D&&oe?(m=e,u=null,v=this._getOptionObject(n)):C&&y&&oe?(m=e,u=null,v=this.mergeOptions(n)):C&&(B||z)&&q?(m=e,u=null,v=o):C&&(B||z)&&Y?(m=e,u=null,v=this.mergeOptions(o)):V&&B&&oe?(m=document.querySelector(e),v=u=null):V&&Z&&oe?(m=document.querySelector(e),u=null,v=n):V&&D&&oe?(m=document.querySelector(e),u=null,v=this._getOptionObject(n)):V&&y&&oe?(m=document.querySelector(e),u=null,v=this.mergeOptions(n)):V&&(B||z)&&q?(m=document.querySelector(e),u=null,v=o):V&&(B||z)&&Y?(m=document.querySelector(e),u=null,v=this.mergeOptions(o)):V&&L&&oe?(m=document.querySelector(e),u=n,v=null):V&&L&&q?(m=document.querySelector(e),u=n,v=o):V&&L&&ue?(m=document.querySelector(e),u=n,v=this._getOptionObject(o)):V&&L&&Y?(m=document.querySelector(e),u=n,v=this.mergeOptions(o)):C&&L&&q?(m=e,u=n,v=o):C&&L&&ue?(m=e,u=n,v=this._getOptionObject(o)):C&&L&&Y?(m=e,u=n,v=this.mergeOptions(o)):i.throwError("The parameters given to the AutoNumeric object are not valid, '".concat(e,"', '").concat(n,"' and '").concat(o,"' given.")),i.isNull(m)&&i.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:m,initialValue:u,userOptions:v}}},{key:"mergeOptions",value:function(e){var n=this,o={};return e.forEach(function(m){ee(o,n._getOptionObject(m))}),o}},{key:"_isPreDefinedOptionValid",value:function(e){return Object.prototype.hasOwnProperty.call(s.predefinedOptions,e)}},{key:"_getOptionObject",value:function(e){var n;return i.isString(e)?null==(n=s.getPredefinedOptions()[e])&&i.warning("The given pre-defined option [".concat(e,"] is not recognized by autoNumeric. Please check that pre-defined option name."),!0):n=e,n}},{key:"_doesFormHandlerListExists",value:function(){var e=de(window.aNFormHandlerMap);return"undefined"!==e&&"object"===e}},{key:"_createFormHandlerList",value:function(){window.aNFormHandlerMap=new Map}},{key:"_checkValuesToStringsArray",value:function(e,n){return i.isInArray(String(e),n)}},{key:"_checkValuesToStringsSettings",value:function(e,n){return this._checkValuesToStringsArray(e,Object.keys(n.valuesToStrings))}},{key:"_checkStringsToValuesSettings",value:function(e,n){return this._checkValuesToStringsArray(e,Object.values(n.valuesToStrings))}},{key:"_unformatAltHovered",value:function(e){e.hoveredWithAlt=!0,e.unformat()}},{key:"_reformatAltHovered",value:function(e){e.hoveredWithAlt=!1,e.reformat()}},{key:"_getChildANInputElement",value:function(e){var n=this,o=e.getElementsByTagName("input"),m=[];return Array.prototype.slice.call(o,0).forEach(function(v){n.test(v)&&m.push(v)}),m}},{key:"test",value:function(e){return this._isInGlobalList(i.domElement(e))}},{key:"_createWeakMap",value:function(e){window[e]=new WeakMap}},{key:"_createGlobalList",value:function(){this.autoNumericGlobalListName="autoNumericGlobalList",this._createWeakMap(this.autoNumericGlobalListName)}},{key:"_doesGlobalListExists",value:function(){var e=de(window[this.autoNumericGlobalListName]);return"undefined"!==e&&"object"===e}},{key:"_addToGlobalList",value:function(e){this._doesGlobalListExists()||this._createGlobalList();var n=e.node();if(this._isInGlobalList(n)){if(this._getFromGlobalList(n)===this)return;i.warning("A reference to the DOM element you just initialized already exists in the global AutoNumeric element list. Please make sure to not initialize the same DOM element multiple times.",e.getSettings().showWarnings)}window[this.autoNumericGlobalListName].set(n,e)}},{key:"_removeFromGlobalList",value:function(e){this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].delete(e.node())}},{key:"_getFromGlobalList",value:function(e){return this._doesGlobalListExists()?window[this.autoNumericGlobalListName].get(e):null}},{key:"_isInGlobalList",value:function(e){return!!this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].has(e)}},{key:"validate",value:function(e,n,o){var m=!(1<arguments.length&&void 0!==n)||n,v=2<arguments.length&&void 0!==o?o:null;!i.isUndefinedOrNullOrEmpty(e)&&i.isObject(e)||i.throwError("The userOptions are invalid ; it should be a valid object, [".concat(e,"] given."));var u,C=i.isObject(v);C||i.isNull(v)||i.throwError("The 'originalOptions' parameter is invalid ; it should either be a valid option object or `null`, [".concat(e,"] given.")),i.isNull(e)||this._convertOldOptionsToNewOnes(e),u=m?ee({},this.getDefaultConfig(),e):e,i.isTrueOrFalseString(u.showWarnings)||i.isBoolean(u.showWarnings)||i.throwError("The debug option 'showWarnings' is invalid ; it should be either 'true' or 'false', [".concat(u.showWarnings,"] given."));var V,Z=/^[0-9]+$/,y=/[0-9]+/,L=/^-?[0-9]+(\.?[0-9]+)?$/,D=/^[0-9]+(\.?[0-9]+)?$/;i.isTrueOrFalseString(u.allowDecimalPadding)||i.isBoolean(u.allowDecimalPadding)||u.allowDecimalPadding===s.options.allowDecimalPadding.floats||i.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true` or `'floats'`, [".concat(u.allowDecimalPadding,"] given.")),u.allowDecimalPadding!==s.options.allowDecimalPadding.never&&"false"!==u.allowDecimalPadding||u.decimalPlaces===s.options.decimalPlaces.none&&u.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.none&&u.decimalPlacesShownOnFocus===s.options.decimalPlacesShownOnFocus.none||i.warning("Setting 'allowDecimalPadding' to [".concat(u.allowDecimalPadding,"] will override the current 'decimalPlaces*' settings [").concat(u.decimalPlaces,", ").concat(u.decimalPlacesShownOnBlur," and ").concat(u.decimalPlacesShownOnFocus,"]."),u.showWarnings),i.isTrueOrFalseString(u.alwaysAllowDecimalCharacter)||i.isBoolean(u.alwaysAllowDecimalCharacter)||i.throwError("The option 'alwaysAllowDecimalCharacter' is invalid ; it should either be `true` or `false`, [".concat(u.alwaysAllowDecimalCharacter,"] given.")),i.isNull(u.caretPositionOnFocus)||i.isInArray(u.caretPositionOnFocus,[s.options.caretPositionOnFocus.start,s.options.caretPositionOnFocus.end,s.options.caretPositionOnFocus.decimalLeft,s.options.caretPositionOnFocus.decimalRight])||i.throwError("The display on empty string option 'caretPositionOnFocus' is invalid ; it should either be `null`, 'focus', 'press', 'always' or 'zero', [".concat(u.caretPositionOnFocus,"] given.")),V=C?v:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(e),i.isNull(V)||V.caretPositionOnFocus===s.options.caretPositionOnFocus.doNoForceCaretPosition||V.selectOnFocus!==s.options.selectOnFocus.select||i.warning("The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '".concat(V.caretPositionOnFocus,"'. As a result, if this has been called when instantiating an AutoNumeric object, the 'selectOnFocus' option is forced to 'doNotSelect'."),u.showWarnings),i.isInArray(u.digitGroupSeparator,[s.options.digitGroupSeparator.comma,s.options.digitGroupSeparator.dot,s.options.digitGroupSeparator.normalSpace,s.options.digitGroupSeparator.thinSpace,s.options.digitGroupSeparator.narrowNoBreakSpace,s.options.digitGroupSeparator.noBreakSpace,s.options.digitGroupSeparator.noSeparator,s.options.digitGroupSeparator.apostrophe,s.options.digitGroupSeparator.arabicThousandsSeparator,s.options.digitGroupSeparator.dotAbove,s.options.digitGroupSeparator.privateUseTwo])||i.throwError("The thousand separator character option 'digitGroupSeparator' is invalid ; it should be ',', '.', '\u066c', '\u02d9', \"'\", '\x92', ' ', '\u2009', '\u202f', '\xa0' or empty (''), [".concat(u.digitGroupSeparator,"] given.")),i.isTrueOrFalseString(u.showOnlyNumbersOnFocus)||i.isBoolean(u.showOnlyNumbersOnFocus)||i.throwError("The 'showOnlyNumbersOnFocus' option is invalid ; it should be either 'true' or 'false', [".concat(u.showOnlyNumbersOnFocus,"] given.")),i.isInArray(u.digitalGroupSpacing,[s.options.digitalGroupSpacing.two,s.options.digitalGroupSpacing.twoScaled,s.options.digitalGroupSpacing.three,s.options.digitalGroupSpacing.four])||2<=u.digitalGroupSpacing&&u.digitalGroupSpacing<=4||i.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2s', '3', or '4', [".concat(u.digitalGroupSpacing,"] given.")),i.isInArray(u.decimalCharacter,[s.options.decimalCharacter.comma,s.options.decimalCharacter.dot,s.options.decimalCharacter.middleDot,s.options.decimalCharacter.arabicDecimalSeparator,s.options.decimalCharacter.decimalSeparatorKeySymbol])||i.throwError("The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '\xb7', '\u2396' or '\u066b', [".concat(u.decimalCharacter,"] given.")),u.decimalCharacter===u.digitGroupSeparator&&i.throwError("autoNumeric will not function properly when the decimal character 'decimalCharacter' [".concat(u.decimalCharacter,"] and the thousand separator 'digitGroupSeparator' [").concat(u.digitGroupSeparator,"] are the same character.")),i.isNull(u.decimalCharacterAlternative)||i.isString(u.decimalCharacterAlternative)||i.throwError("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, [".concat(u.decimalCharacterAlternative,"] given.")),""===u.currencySymbol||i.isString(u.currencySymbol)||i.throwError("The currency symbol option 'currencySymbol' is invalid ; it should be a string, [".concat(u.currencySymbol,"] given.")),i.isInArray(u.currencySymbolPlacement,[s.options.currencySymbolPlacement.prefix,s.options.currencySymbolPlacement.suffix])||i.throwError("The placement of the currency sign option 'currencySymbolPlacement' is invalid ; it should either be 'p' (prefix) or 's' (suffix), [".concat(u.currencySymbolPlacement,"] given.")),i.isInArray(u.negativePositiveSignPlacement,[s.options.negativePositiveSignPlacement.prefix,s.options.negativePositiveSignPlacement.suffix,s.options.negativePositiveSignPlacement.left,s.options.negativePositiveSignPlacement.right,s.options.negativePositiveSignPlacement.none])||i.throwError("The placement of the negative sign option 'negativePositiveSignPlacement' is invalid ; it should either be 'p' (prefix), 's' (suffix), 'l' (left), 'r' (right) or 'null', [".concat(u.negativePositiveSignPlacement,"] given.")),i.isTrueOrFalseString(u.showPositiveSign)||i.isBoolean(u.showPositiveSign)||i.throwError("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'true' or 'false', [".concat(u.showPositiveSign,"] given.")),i.isString(u.suffixText)&&(""===u.suffixText||!i.isNegative(u.suffixText,u.negativeSignCharacter)&&!y.test(u.suffixText))||i.throwError("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '".concat(u.negativeSignCharacter,"' nor any numerical characters, [").concat(u.suffixText,"] given.")),i.isString(u.negativeSignCharacter)&&1===u.negativeSignCharacter.length&&!i.isUndefinedOrNullOrEmpty(u.negativeSignCharacter)&&!y.test(u.negativeSignCharacter)||i.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(u.negativeSignCharacter,"] given.")),i.isString(u.positiveSignCharacter)&&1===u.positiveSignCharacter.length&&!i.isUndefinedOrNullOrEmpty(u.positiveSignCharacter)&&!y.test(u.positiveSignCharacter)||i.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(u.positiveSignCharacter,"] given.\nIf you want to hide the positive sign character, you need to set the `showPositiveSign` option to `true`.")),u.negativeSignCharacter===u.positiveSignCharacter&&i.throwError("The positive 'positiveSignCharacter' and negative 'negativeSignCharacter' sign characters cannot be identical ; [".concat(u.negativeSignCharacter,"] given."));var B=J(i.isNull(u.negativeBracketsTypeOnBlur)?["",""]:u.negativeBracketsTypeOnBlur.split(","),2),z=B[0],q=B[1];(i.contains(u.digitGroupSeparator,u.negativeSignCharacter)||i.contains(u.decimalCharacter,u.negativeSignCharacter)||i.contains(u.decimalCharacterAlternative,u.negativeSignCharacter)||i.contains(z,u.negativeSignCharacter)||i.contains(q,u.negativeSignCharacter)||i.contains(u.suffixText,u.negativeSignCharacter))&&i.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(u.negativeSignCharacter,"] given.")),(i.contains(u.digitGroupSeparator,u.positiveSignCharacter)||i.contains(u.decimalCharacter,u.positiveSignCharacter)||i.contains(u.decimalCharacterAlternative,u.positiveSignCharacter)||i.contains(z,u.positiveSignCharacter)||i.contains(q,u.positiveSignCharacter)||i.contains(u.suffixText,u.positiveSignCharacter))&&i.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(u.positiveSignCharacter,"] given.")),i.isNull(u.overrideMinMaxLimits)||i.isInArray(u.overrideMinMaxLimits,[s.options.overrideMinMaxLimits.ceiling,s.options.overrideMinMaxLimits.floor,s.options.overrideMinMaxLimits.ignore,s.options.overrideMinMaxLimits.invalid])||i.throwError("The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor', 'ignore' or 'invalid', [".concat(u.overrideMinMaxLimits,"] given.")),u.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.invalid&&u.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.ignore&&(0<u.minimumValue||u.maximumValue<0)&&i.warning("You've set a `minimumValue` or a `maximumValue` excluding the value `0`. AutoNumeric will force the users to always have a valid value in the input, hence preventing them to clear the field. If you want to allow for temporary invalid values (ie. out-of-range), you should use the 'invalid' option for the 'overrideMinMaxLimits' setting."),i.isString(u.maximumValue)&&L.test(u.maximumValue)||i.throwError("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(u.maximumValue,"] given.")),i.isString(u.minimumValue)&&L.test(u.minimumValue)||i.throwError("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(u.minimumValue,"] given.")),parseFloat(u.minimumValue)>parseFloat(u.maximumValue)&&i.throwError("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' [".concat(u.minimumValue,"] should be smaller than 'maximumValue' [").concat(u.maximumValue,"].")),i.isInt(u.decimalPlaces)&&0<=u.decimalPlaces||i.isString(u.decimalPlaces)&&Z.test(u.decimalPlaces)||i.throwError("The number of decimal places option 'decimalPlaces' is invalid ; it should be a positive integer, [".concat(u.decimalPlaces,"] given.")),i.isNull(u.decimalPlacesRawValue)||i.isInt(u.decimalPlacesRawValue)&&0<=u.decimalPlacesRawValue||i.isString(u.decimalPlacesRawValue)&&Z.test(u.decimalPlacesRawValue)||i.throwError("The number of decimal places for the raw value option 'decimalPlacesRawValue' is invalid ; it should be a positive integer or `null`, [".concat(u.decimalPlacesRawValue,"] given.")),this._validateDecimalPlacesRawValue(u),i.isNull(u.decimalPlacesShownOnFocus)||Z.test(String(u.decimalPlacesShownOnFocus))||i.throwError("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer or `null`, [".concat(u.decimalPlacesShownOnFocus,"] given.")),!i.isNull(u.decimalPlacesShownOnFocus)&&Number(u.decimalPlaces)>Number(u.decimalPlacesShownOnFocus)&&i.warning("The extended decimal places 'decimalPlacesShownOnFocus' [".concat(u.decimalPlacesShownOnFocus,"] should be greater than the 'decimalPlaces' [").concat(u.decimalPlaces,"] value. Currently, this will limit the ability of your user to manually change some of the decimal places. Do you really want to do that?"),u.showWarnings),(i.isNull(u.divisorWhenUnfocused)||D.test(u.divisorWhenUnfocused))&&0!==u.divisorWhenUnfocused&&"0"!==u.divisorWhenUnfocused&&1!==u.divisorWhenUnfocused&&"1"!==u.divisorWhenUnfocused||i.throwError("The divisor option 'divisorWhenUnfocused' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(u.divisorWhenUnfocused,"] given.")),i.isNull(u.decimalPlacesShownOnBlur)||Z.test(u.decimalPlacesShownOnBlur)||i.throwError("The number of decimals shown when unfocused option 'decimalPlacesShownOnBlur' is invalid ; it should be a positive integer or `null`, [".concat(u.decimalPlacesShownOnBlur,"] given.")),i.isNull(u.symbolWhenUnfocused)||i.isString(u.symbolWhenUnfocused)||i.throwError("The symbol to show when unfocused option 'symbolWhenUnfocused' is invalid ; it should be a string, [".concat(u.symbolWhenUnfocused,"] given.")),i.isTrueOrFalseString(u.saveValueToSessionStorage)||i.isBoolean(u.saveValueToSessionStorage)||i.throwError("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'true' or 'false', [".concat(u.saveValueToSessionStorage,"] given.")),i.isInArray(u.onInvalidPaste,[s.options.onInvalidPaste.error,s.options.onInvalidPaste.ignore,s.options.onInvalidPaste.clamp,s.options.onInvalidPaste.truncate,s.options.onInvalidPaste.replace])||i.throwError("The paste behavior option 'onInvalidPaste' is invalid ; it should either be 'error', 'ignore', 'clamp', 'truncate' or 'replace' (cf. documentation), [".concat(u.onInvalidPaste,"] given.")),i.isInArray(u.roundingMethod,[s.options.roundingMethod.halfUpSymmetric,s.options.roundingMethod.halfUpAsymmetric,s.options.roundingMethod.halfDownSymmetric,s.options.roundingMethod.halfDownAsymmetric,s.options.roundingMethod.halfEvenBankersRounding,s.options.roundingMethod.upRoundAwayFromZero,s.options.roundingMethod.downRoundTowardZero,s.options.roundingMethod.toCeilingTowardPositiveInfinity,s.options.roundingMethod.toFloorTowardNegativeInfinity,s.options.roundingMethod.toNearest05,s.options.roundingMethod.toNearest05Alt,s.options.roundingMethod.upToNext05,s.options.roundingMethod.downToNext05])||i.throwError("The rounding method option 'roundingMethod' is invalid ; it should either be 'S', 'A', 's', 'a', 'B', 'U', 'D', 'C', 'F', 'N05', 'CHF', 'U05' or 'D05' (cf. documentation), [".concat(u.roundingMethod,"] given.")),i.isNull(u.negativeBracketsTypeOnBlur)||i.isInArray(u.negativeBracketsTypeOnBlur,[s.options.negativeBracketsTypeOnBlur.parentheses,s.options.negativeBracketsTypeOnBlur.brackets,s.options.negativeBracketsTypeOnBlur.chevrons,s.options.negativeBracketsTypeOnBlur.curlyBraces,s.options.negativeBracketsTypeOnBlur.angleBrackets,s.options.negativeBracketsTypeOnBlur.japaneseQuotationMarks,s.options.negativeBracketsTypeOnBlur.halfBrackets,s.options.negativeBracketsTypeOnBlur.whiteSquareBrackets,s.options.negativeBracketsTypeOnBlur.quotationMarks,s.options.negativeBracketsTypeOnBlur.guillemets])||i.throwError("The brackets for negative values option 'negativeBracketsTypeOnBlur' is invalid ; it should either be '(,)', '[,]', '<,>', '{,}', '\u3008,\u3009', '\uff62,\uff63', '\u2e24,\u2e25', '\u27e6,\u27e7', '\u2039,\u203a' or '\xab,\xbb', [".concat(u.negativeBracketsTypeOnBlur,"] given.")),(i.isString(u.emptyInputBehavior)||i.isNumber(u.emptyInputBehavior))&&(i.isInArray(u.emptyInputBehavior,[s.options.emptyInputBehavior.focus,s.options.emptyInputBehavior.press,s.options.emptyInputBehavior.always,s.options.emptyInputBehavior.min,s.options.emptyInputBehavior.max,s.options.emptyInputBehavior.zero,s.options.emptyInputBehavior.null])||L.test(u.emptyInputBehavior))||i.throwError("The display on empty string option 'emptyInputBehavior' is invalid ; it should either be 'focus', 'press', 'always', 'min', 'max', 'zero', 'null', a number, or a string that represents a number, [".concat(u.emptyInputBehavior,"] given.")),u.emptyInputBehavior===s.options.emptyInputBehavior.zero&&(0<u.minimumValue||u.maximumValue<0)&&i.throwError("The 'emptyInputBehavior' option is set to 'zero', but this value is outside of the range defined by 'minimumValue' and 'maximumValue' [".concat(u.minimumValue,", ").concat(u.maximumValue,"].")),L.test(String(u.emptyInputBehavior))&&(this._isWithinRangeWithOverrideOption(u.emptyInputBehavior,u)||i.throwError("The 'emptyInputBehavior' option is set to a number or a string that represents a number, but its value [".concat(u.emptyInputBehavior,"] is outside of the range defined by the 'minimumValue' and 'maximumValue' options [").concat(u.minimumValue,", ").concat(u.maximumValue,"]."))),i.isTrueOrFalseString(u.eventBubbles)||i.isBoolean(u.eventBubbles)||i.throwError("The event bubbles option 'eventBubbles' is invalid ; it should be either 'true' or 'false', [".concat(u.eventBubbles,"] given.")),i.isTrueOrFalseString(u.eventIsCancelable)||i.isBoolean(u.eventIsCancelable)||i.throwError("The event is cancelable option 'eventIsCancelable' is invalid ; it should be either 'true' or 'false', [".concat(u.eventIsCancelable,"] given.")),!i.isBoolean(u.invalidClass)&&/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(u.invalidClass)||i.throwError("The name of the 'invalidClass' option is not a valid CSS class name ; it should not be empty, and should follow the '^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$' regex, [".concat(u.invalidClass,"] given.")),i.isInArray(u.leadingZero,[s.options.leadingZero.allow,s.options.leadingZero.deny,s.options.leadingZero.keep])||i.throwError("The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', [".concat(u.leadingZero,"] given.")),i.isTrueOrFalseString(u.formatOnPageLoad)||i.isBoolean(u.formatOnPageLoad)||i.throwError("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'true' or 'false', [".concat(u.formatOnPageLoad,"] given.")),i.isTrueOrFalseString(u.formulaMode)||i.isBoolean(u.formulaMode)||i.throwError("The formula mode option 'formulaMode' is invalid ; it should be either 'true' or 'false', [".concat(u.formulaMode,"] given.")),Z.test(u.historySize)&&0!==u.historySize||i.throwError("The history size option 'historySize' is invalid ; it should be a positive integer, [".concat(u.historySize,"] given.")),i.isTrueOrFalseString(u.selectNumberOnly)||i.isBoolean(u.selectNumberOnly)||i.throwError("The select number only option 'selectNumberOnly' is invalid ; it should be either 'true' or 'false', [".concat(u.selectNumberOnly,"] given.")),i.isTrueOrFalseString(u.selectOnFocus)||i.isBoolean(u.selectOnFocus)||i.throwError("The select on focus option 'selectOnFocus' is invalid ; it should be either 'true' or 'false', [".concat(u.selectOnFocus,"] given.")),i.isNull(u.defaultValueOverride)||""===u.defaultValueOverride||L.test(u.defaultValueOverride)||i.throwError("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, [".concat(u.defaultValueOverride,"] given.")),i.isTrueOrFalseString(u.unformatOnSubmit)||i.isBoolean(u.unformatOnSubmit)||i.throwError("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'true' or 'false', [".concat(u.unformatOnSubmit,"] given.")),i.isNull(u.valuesToStrings)||i.isObject(u.valuesToStrings)||i.throwError("The option 'valuesToStrings' is invalid ; it should be an object, ideally with 'key -> value' entries, [".concat(u.valuesToStrings,"] given.")),i.isNull(u.outputFormat)||i.isInArray(u.outputFormat,[s.options.outputFormat.string,s.options.outputFormat.number,s.options.outputFormat.dot,s.options.outputFormat.negativeDot,s.options.outputFormat.comma,s.options.outputFormat.negativeComma,s.options.outputFormat.dotNegative,s.options.outputFormat.commaNegative])||i.throwError("The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', [".concat(u.outputFormat,"] given.")),i.isTrueOrFalseString(u.isCancellable)||i.isBoolean(u.isCancellable)||i.throwError("The cancellable behavior option 'isCancellable' is invalid ; it should be either 'true' or 'false', [".concat(u.isCancellable,"] given.")),i.isTrueOrFalseString(u.modifyValueOnWheel)||i.isBoolean(u.modifyValueOnWheel)||i.throwError("The increment/decrement on mouse wheel option 'modifyValueOnWheel' is invalid ; it should be either 'true' or 'false', [".concat(u.modifyValueOnWheel,"] given.")),i.isTrueOrFalseString(u.watchExternalChanges)||i.isBoolean(u.watchExternalChanges)||i.throwError("The option 'watchExternalChanges' is invalid ; it should be either 'true' or 'false', [".concat(u.watchExternalChanges,"] given.")),i.isInArray(u.wheelOn,[s.options.wheelOn.focus,s.options.wheelOn.hover])||i.throwError("The wheel behavior option 'wheelOn' is invalid ; it should either be 'focus' or 'hover', [".concat(u.wheelOn,"] given.")),(i.isString(u.wheelStep)||i.isNumber(u.wheelStep))&&("progressive"===u.wheelStep||D.test(u.wheelStep))&&0!==Number(u.wheelStep)||i.throwError("The wheel step value option 'wheelStep' is invalid ; it should either be the string 'progressive', or a number or a string that represents a positive number (excluding zero), [".concat(u.wheelStep,"] given.")),i.isInArray(u.serializeSpaces,[s.options.serializeSpaces.plus,s.options.serializeSpaces.percent])||i.throwError("The space replacement character option 'serializeSpaces' is invalid ; it should either be '+' or '%20', [".concat(u.serializeSpaces,"] given.")),i.isTrueOrFalseString(u.noEventListeners)||i.isBoolean(u.noEventListeners)||i.throwError("The option 'noEventListeners' that prevent the creation of event listeners is invalid ; it should be either 'true' or 'false', [".concat(u.noEventListeners,"] given.")),i.isNull(u.styleRules)||i.isObject(u.styleRules)&&(Object.prototype.hasOwnProperty.call(u.styleRules,"positive")||Object.prototype.hasOwnProperty.call(u.styleRules,"negative")||Object.prototype.hasOwnProperty.call(u.styleRules,"ranges")||Object.prototype.hasOwnProperty.call(u.styleRules,"userDefined"))||i.throwError("The option 'styleRules' is invalid ; it should be a correctly structured object, with one or more 'positive', 'negative', 'ranges' or 'userDefined' attributes, [".concat(u.styleRules,"] given.")),i.isNull(u.styleRules)||!Object.prototype.hasOwnProperty.call(u.styleRules,"userDefined")||i.isNull(u.styleRules.userDefined)||u.styleRules.userDefined.forEach(function(Y){Object.prototype.hasOwnProperty.call(Y,"callback")&&!i.isFunction(Y.callback)&&i.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(de(Y.callback)," given."))}),(i.isNull(u.rawValueDivisor)||D.test(u.rawValueDivisor))&&0!==u.rawValueDivisor&&"0"!==u.rawValueDivisor&&1!==u.rawValueDivisor&&"1"!==u.rawValueDivisor||i.throwError("The raw value divisor option 'rawValueDivisor' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(u.rawValueDivisor,"] given.")),i.isTrueOrFalseString(u.readOnly)||i.isBoolean(u.readOnly)||i.throwError("The option 'readOnly' is invalid ; it should be either 'true' or 'false', [".concat(u.readOnly,"] given.")),i.isTrueOrFalseString(u.unformatOnHover)||i.isBoolean(u.unformatOnHover)||i.throwError("The option 'unformatOnHover' is invalid ; it should be either 'true' or 'false', [".concat(u.unformatOnHover,"] given.")),i.isTrueOrFalseString(u.failOnUnknownOption)||i.isBoolean(u.failOnUnknownOption)||i.throwError("The debug option 'failOnUnknownOption' is invalid ; it should be either 'true' or 'false', [".concat(u.failOnUnknownOption,"] given.")),i.isTrueOrFalseString(u.createLocalList)||i.isBoolean(u.createLocalList)||i.throwError("The debug option 'createLocalList' is invalid ; it should be either 'true' or 'false', [".concat(u.createLocalList,"] given."))}},{key:"_validateDecimalPlacesRawValue",value:function(e){i.isNull(e.decimalPlacesRawValue)||(e.decimalPlacesRawValue<e.decimalPlaces&&i.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones to display [").concat(e.decimalPlaces,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlaces`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnFocus&&i.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown on focus [").concat(e.decimalPlacesShownOnFocus,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnFocus`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnBlur&&i.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown when unfocused [").concat(e.decimalPlacesShownOnBlur,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnBlur`."),e.showWarnings))}},{key:"areSettingsValid",value:function(e){var n=!0;try{this.validate(e,!0)}catch{n=!1}return n}},{key:"getDefaultConfig",value:function(){return s.defaultSettings}},{key:"getPredefinedOptions",value:function(){return s.predefinedOptions}},{key:"_generateOptionsObjectFromOptionsArray",value:function(e){var n,o=this;return i.isUndefinedOrNullOrEmpty(e)||0===e.length?n=null:(n={},1===e.length&&Array.isArray(e[0])?e[0].forEach(function(m){ee(n,o._getOptionObject(m))}):1<=e.length&&e.forEach(function(m){ee(n,o._getOptionObject(m))})),n}},{key:"format",value:function(e){if(i.isUndefined(e)||null===e)return null;var n;n=i.isElement(e)?i.getElementValue(e):e,i.isString(n)||i.isNumber(n)||i.throwError('The value "'.concat(n,'" being "set" is not numeric and therefore cannot be used appropriately.'));for(var o=arguments.length,m=new Array(1<o?o-1:0),v=1;v<o;v++)m[v-1]=arguments[v];var u=this._generateOptionsObjectFromOptionsArray(m),C=ee({},this.getDefaultConfig(),u);C.isNegativeSignAllowed=n<0,C.isPositiveSignAllowed=0<=n,this._setBrackets(C),this._cachesUsualRegularExpressions(C,{});var V=this._toNumericValue(n,C);return isNaN(Number(V))&&i.throwError("The value [".concat(V,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(V,C)||(i.triggerEvent(s.events.formatted,document,{oldValue:null,newValue:null,oldRawValue:null,newRawValue:null,isPristine:null,error:"Range test failed",aNElement:null},!0,!0),i.throwError("The value [".concat(V,"] being set falls outside of the minimumValue [").concat(C.minimumValue,"] and maximumValue [").concat(C.maximumValue,"] range set for this element"))),C.valuesToStrings&&this._checkValuesToStringsSettings(n,C)?C.valuesToStrings[n]:(this._correctNegativePositiveSignPlacementOption(C),this._calculateDecimalPlacesOnInit(C),i.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===V||null===V||(V*=C.rawValueDivisor),V=this._roundFormattedValueShownOnFocus(V,C),V=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(V,C),V=this._addGroupSeparators(V,C,!1,V))}},{key:"formatAndSet",value:function(e,n){var m=this.format(e,1<arguments.length&&void 0!==n?n:null);return i.setElementValue(e,m),m}},{key:"unformat",value:function(e){if(i.isNumberStrict(e))return e;var n;if(""===(n=i.isElement(e)?i.getElementValue(e):e))return"";if(i.isUndefined(n)||null===n)return null;(i.isArray(n)||i.isObject(n))&&i.throwError("A number or a string representing a number is needed to be able to unformat it, [".concat(n,"] given."));for(var o=arguments.length,m=new Array(1<o?o-1:0),v=1;v<o;v++)m[v-1]=arguments[v];var u=this._generateOptionsObjectFromOptionsArray(m),C=ee({},this.getDefaultConfig(),u);if(C.isNegativeSignAllowed=!1,C.isPositiveSignAllowed=!0,n=n.toString(),C.valuesToStrings&&this._checkStringsToValuesSettings(n,C))return i.objectKeyLookup(C.valuesToStrings,n);if(i.isNegative(n,C.negativeSignCharacter))C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1;else if(!i.isNull(C.negativeBracketsTypeOnBlur)){var V=J(C.negativeBracketsTypeOnBlur.split(","),2);C.firstBracket=V[0],C.lastBracket=V[1],n.charAt(0)===C.firstBracket&&n.charAt(n.length-1)===C.lastBracket&&(C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1,n=this._removeBrackets(n,C,!1))}return n=this._convertToNumericString(n,C),new RegExp("[^+-0123456789.]","gi").test(n)?NaN:(this._correctNegativePositiveSignPlacementOption(C),C.originalDecimalPlacesRawValue=C.decimalPlacesRawValue?C.decimalPlacesRawValue:C.decimalPlaces,this._calculateDecimalPlacesOnInit(C),i.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===n||null===n||(n/=C.rawValueDivisor),n=(n=this._roundRawValue(n,C)).replace(C.decimalCharacter,"."),n=this._toLocale(n,C.outputFormat,C))}},{key:"unformatAndSet",value:function(e,n){var m=this.unformat(e,1<arguments.length&&void 0!==n?n:null);return i.setElementValue(e,m),m}},{key:"localize",value:function(e,n){var o,m,v=1<arguments.length&&void 0!==n?n:null;return""===(o=i.isElement(e)?i.getElementValue(e):e)?"":(i.isNull(v)&&(v=s.defaultSettings),o=this.unformat(o,v),0===Number(o)&&v.leadingZero!==s.options.leadingZero.keep&&(o="0"),m=i.isNull(v)?v.outputFormat:s.defaultSettings.outputFormat,this._toLocale(o,m,v))}},{key:"localizeAndSet",value:function(e,n){var m=this.localize(e,1<arguments.length&&void 0!==n?n:null);return i.setElementValue(e,m),m}},{key:"isManagedByAutoNumeric",value:function(e){return this._isInGlobalList(i.domElement(e))}},{key:"getAutoNumericElement",value:function(e){var n=i.domElement(e);return this.isManagedByAutoNumeric(n)?this._getFromGlobalList(n):null}},{key:"set",value:function(e,n,o,m){var v,u=2<arguments.length&&void 0!==o?o:null,C=!(3<arguments.length&&void 0!==m)||m,V=i.domElement(e);return this.isManagedByAutoNumeric(V)?this.getAutoNumericElement(V).set(n,u,C):(v=!(!i.isNull(u)&&Object.prototype.hasOwnProperty.call(u,"showWarnings"))||u.showWarnings,i.warning("Impossible to find an AutoNumeric object for the given DOM element or selector.",v),null)}},{key:"getNumericString",value:function(e,n){return this._get(e,"getNumericString",1<arguments.length&&void 0!==n?n:null)}},{key:"getFormatted",value:function(e,n){return this._get(e,"getFormatted",1<arguments.length&&void 0!==n?n:null)}},{key:"getNumber",value:function(e,n){return this._get(e,"getNumber",1<arguments.length&&void 0!==n?n:null)}},{key:"_get",value:function(e,n,o){var m=2<arguments.length&&void 0!==o?o:null,v=i.domElement(e);return this.isManagedByAutoNumeric(v)||i.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(v)[n](m)}},{key:"getLocalized",value:function(e,n,o){var m=1<arguments.length&&void 0!==n?n:null,v=2<arguments.length&&void 0!==o?o:null,u=i.domElement(e);return this.isManagedByAutoNumeric(u)||i.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(u).getLocalized(m,v)}},{key:"_stripAllNonNumberCharacters",value:function(e,n,o,m){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,n,o,m).replace(n.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(e,n,o,m){var v=(e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,n)).replace(n.allowedAutoStrip,"")).match(n.numRegAutoStrip);if(e=v?[v[1],v[2],v[3]].join(""):"",n.leadingZero===s.options.leadingZero.allow||n.leadingZero===s.options.leadingZero.keep){var u="",C=J(e.split(n.decimalCharacter),2),Z=C[1],y=C[0];i.contains(y,n.negativeSignCharacter)&&(u=n.negativeSignCharacter,y=y.replace(n.negativeSignCharacter,"")),""===u&&y.length>n.mIntPos&&"0"===y.charAt(0)&&(y=y.slice(1)),""!==u&&y.length>n.mIntNeg&&"0"===y.charAt(0)&&(y=y.slice(1)),e="".concat(u).concat(y).concat(i.isUndefined(Z)?"":n.decimalCharacter+Z)}return(o&&n.leadingZero===s.options.leadingZero.deny||!m&&n.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(n.stripReg,"$1$2")),e}},{key:"_toggleNegativeBracket",value:function(e,n,o){return o?this._removeBrackets(e,n):this._addBrackets(e,n)}},{key:"_addBrackets",value:function(e,n){return i.isNull(n.negativeBracketsTypeOnBlur)?e:"".concat(n.firstBracket).concat(e.replace(n.negativeSignCharacter,"")).concat(n.lastBracket)}},{key:"_removeBrackets",value:function(e,n,o){var m,v=!(2<arguments.length&&void 0!==o)||o;return i.isNull(n.negativeBracketsTypeOnBlur)||e.charAt(0)!==n.firstBracket?e:(m=(m=e.replace(n.firstBracket,"")).replace(n.lastBracket,""),v?(m=m.replace(n.currencySymbol,""),this._mergeCurrencySignNegativePositiveSignAndValue(m,n,!0,!1)):"".concat(n.negativeSignCharacter).concat(m))}},{key:"_setBrackets",value:function(e){if(i.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var n=J(e.negativeBracketsTypeOnBlur.split(","),2),m=n[1];e.firstBracket=n[0],e.lastBracket=m}}},{key:"_convertToNumericString",value:function(e,n){e=this._removeBrackets(e,n,!1),e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,n)).replace(new RegExp("[".concat(n.digitGroupSeparator,"]"),"g"),""),"."!==n.decimalCharacter&&(e=e.replace(n.decimalCharacter,".")),i.isNegative(e)&&e.lastIndexOf("-")===e.length-1&&(e=e.replace("-",""),e="-".concat(e)),n.showPositiveSign&&(e=e.replace(n.positiveSignCharacter,""));var m=i.arabicToLatinNumbers(e,n.leadingZero!==s.options.leadingZero.keep,!1,!1);return isNaN(m)||(e=m.toString()),e}},{key:"_normalizeCurrencySuffixAndNegativeSignCharacters",value:function(e,n){return e=String(e),n.currencySymbol!==s.options.currencySymbol.none&&(e=e.replace(n.currencySymbol,"")),n.suffixText!==s.options.suffixText.none&&(e=e.replace(n.suffixText,"")),n.negativeSignCharacter!==s.options.negativeSignCharacter.hyphen&&(e=e.replace(n.negativeSignCharacter,"-")),e}},{key:"_toLocale",value:function(e,n,o){if(i.isNull(n)||n===s.options.outputFormat.string)return e;var m;switch(n){case s.options.outputFormat.number:m=Number(e);break;case s.options.outputFormat.dotNegative:m=i.isNegative(e)?e.replace("-","")+"-":e;break;case s.options.outputFormat.comma:case s.options.outputFormat.negativeComma:m=e.replace(".",",");break;case s.options.outputFormat.commaNegative:m=e.replace(".",","),m=i.isNegative(m)?m.replace("-","")+"-":m;break;case s.options.outputFormat.dot:case s.options.outputFormat.negativeDot:m=e;break;default:i.throwError("The given outputFormat [".concat(n,"] option is not recognized."))}return n!==s.options.outputFormat.number&&"-"!==o.negativeSignCharacter&&(m=m.replace("-",o.negativeSignCharacter)),m}},{key:"_modifyNegativeSignAndDecimalCharacterForFormattedValue",value:function(e,n){return"-"!==n.negativeSignCharacter&&(e=e.replace("-",n.negativeSignCharacter)),"."!==n.decimalCharacter&&(e=e.replace(".",n.decimalCharacter)),e}},{key:"_isElementValueEmptyOrOnlyTheNegativeSign",value:function(e,n){return""===e||e===n.negativeSignCharacter}},{key:"_orderValueCurrencySymbolAndSuffixText",value:function(e,n,o){var m;if(n.emptyInputBehavior===s.options.emptyInputBehavior.always||o)switch(n.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.none:m=e+n.currencySymbol+n.suffixText;break;default:m=n.currencySymbol+e+n.suffixText}else m=e;return m}},{key:"_addGroupSeparators",value:function(e,n,o,m,v){var u,C=4<arguments.length&&void 0!==v?v:null;if(u=i.isNull(C)?i.isNegative(e,n.negativeSignCharacter)||i.isNegativeWithBrackets(e,n.firstBracket,n.lastBracket):C<0,e=this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,n,!1,o),this._isElementValueEmptyOrOnlyTheNegativeSign(e,n))return this._orderValueCurrencySymbolAndSuffixText(e,n,!0);var V,Z=i.isZeroOrHasNoValue(e);switch(u&&(e=e.replace("-","")),n.digitalGroupSpacing=n.digitalGroupSpacing.toString(),n.digitalGroupSpacing){case s.options.digitalGroupSpacing.two:V=/(\d)((\d)(\d{2}?)+)$/;break;case s.options.digitalGroupSpacing.twoScaled:V=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;case s.options.digitalGroupSpacing.four:V=/(\d)((\d{4}?)+)$/;break;default:V=/(\d)((\d{3}?)+)$/}var y,L=J(e.split(n.decimalCharacter),2),D=L[0],B=L[1];if(n.decimalCharacterAlternative&&i.isUndefined(B)){var z=J(e.split(n.decimalCharacterAlternative),2);D=z[0],B=z[1]}if(""!==n.digitGroupSeparator)for(;V.test(D);)D=D.replace(V,"$1".concat(n.digitGroupSeparator,"$2"));return e=0===(y=o?n.decimalPlacesShownOnFocus:n.decimalPlacesShownOnBlur)||i.isUndefined(B)?D:(B.length>y&&(B=B.substring(0,y)),"".concat(D).concat(n.decimalCharacter).concat(B)),e=s._mergeCurrencySignNegativePositiveSignAndValue(e,n,u,Z),i.isNull(C)&&(C=m),null!==n.negativeBracketsTypeOnBlur&&(C<0||i.isNegativeStrict(e,n.negativeSignCharacter))&&(e=this._toggleNegativeBracket(e,n,o)),n.suffixText?"".concat(e).concat(n.suffixText):e}},{key:"_mergeCurrencySignNegativePositiveSignAndValue",value:function(e,n,o,m){var v,u="";if(o?u=n.negativeSignCharacter:n.showPositiveSign&&!m&&(u=n.positiveSignCharacter),n.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)if(n.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(o||!o&&n.showPositiveSign&&!m))switch(n.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:v="".concat(u).concat(n.currencySymbol).concat(e);break;case s.options.negativePositiveSignPlacement.right:v="".concat(n.currencySymbol).concat(u).concat(e);break;case s.options.negativePositiveSignPlacement.suffix:v="".concat(n.currencySymbol).concat(e).concat(u)}else v=n.currencySymbol+e;else if(n.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)if(n.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(o||!o&&n.showPositiveSign&&!m))switch(n.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:v="".concat(e).concat(n.currencySymbol).concat(u);break;case s.options.negativePositiveSignPlacement.left:v="".concat(e).concat(u).concat(n.currencySymbol);break;case s.options.negativePositiveSignPlacement.prefix:v="".concat(u).concat(e).concat(n.currencySymbol)}else v=e+n.currencySymbol;return v}},{key:"_truncateZeros",value:function(e,n){var o;switch(n){case 0:o=/(\.(?:\d*[1-9])?)0*$/;break;case 1:o=/(\.\d(?:\d*[1-9])?)0*$/;break;default:o=new RegExp("(\\.\\d{".concat(n,"}(?:\\d*[1-9])?)0*"))}return e=e.replace(o,"$1"),0===n&&(e=e.replace(/\.$/,"")),e}},{key:"_roundRawValue",value:function(e,n){return this._roundValue(e,n,n.decimalPlacesRawValue)}},{key:"_roundFormattedValueShownOnFocus",value:function(e,n){return this._roundValue(e,n,Number(n.decimalPlacesShownOnFocus))}},{key:"_roundFormattedValueShownOnBlur",value:function(e,n){return this._roundValue(e,n,Number(n.decimalPlacesShownOnBlur))}},{key:"_roundFormattedValueShownOnFocusOrBlur",value:function(e,n,o){return o?this._roundFormattedValueShownOnFocus(e,n):this._roundFormattedValueShownOnBlur(e,n)}},{key:"_roundValue",value:function(e,n,o){if(i.isNull(e))return e;if(e=""===e?"0":e.toString(),n.roundingMethod===s.options.roundingMethod.toNearest05||n.roundingMethod===s.options.roundingMethod.toNearest05Alt||n.roundingMethod===s.options.roundingMethod.upToNext05||n.roundingMethod===s.options.roundingMethod.downToNext05)return this._roundCloseTo05(e,n);var m,v=J(s._prepareValueForRounding(e,n),2),u=v[0],C=(e=v[1]).lastIndexOf("."),V=-1===C,Z=J(e.split("."),2),y=Z[0];if(!(0<Z[1]||n.allowDecimalPadding!==s.options.allowDecimalPadding.never&&n.allowDecimalPadding!==s.options.allowDecimalPadding.floats))return 0===Number(e)?y:"".concat(u).concat(y);m=n.allowDecimalPadding===s.options.allowDecimalPadding.always||n.allowDecimalPadding===s.options.allowDecimalPadding.floats?o:0;var L,B=e.length-1-(V?e.length-1:C),z="";if(B<=o){if(z=e,B<m){V&&(z="".concat(z).concat(n.decimalCharacter));for(var q="000000";B<m;)z+=q=q.substring(0,m-B),B+=q.length}else m<B?z=this._truncateZeros(z,m):0===B&&0===m&&(z=z.replace(/\.$/,""));return 0===Number(z)?z:"".concat(u).concat(z)}L=V?o-1:Number(o)+Number(C);var Y,oe=Number(e.charAt(L+1)),ue=e.substring(0,L+1).split("");if(Y="."===e.charAt(L)?e.charAt(L-1)%2:e.charAt(L)%2,this._shouldRoundUp(oe,n,u,Y))for(var se=ue.length-1;0<=se;--se)if("."!==ue[se]){if(ue[se]=+ue[se]+1,ue[se]<10)break;0<se&&(ue[se]="0")}return ue=ue.slice(0,L+1),z=this._truncateZeros(ue.join(""),m),0===Number(z)?z:"".concat(u).concat(z)}},{key:"_roundCloseTo05",value:function(e,n){switch(n.roundingMethod){case s.options.roundingMethod.toNearest05:case s.options.roundingMethod.toNearest05Alt:e=(Math.round(20*e)/20).toString();break;case s.options.roundingMethod.upToNext05:e=(Math.ceil(20*e)/20).toString();break;default:e=(Math.floor(20*e)/20).toString()}return i.contains(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}},{key:"_prepareValueForRounding",value:function(e,n){var o="";return i.isNegativeStrict(e,"-")&&(o="-",e=e.replace("-","")),e.match(/^\d/)||(e="0".concat(e)),0===Number(e)&&(o=""),(0<Number(e)&&n.leadingZero!==s.options.leadingZero.keep||0<e.length&&n.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(/^0*(\d)/,"$1")),[o,e]}},{key:"_shouldRoundUp",value:function(e,n,o,m){return 4<e&&n.roundingMethod===s.options.roundingMethod.halfUpSymmetric||4<e&&n.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&""===o||5<e&&n.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&"-"===o||5<e&&n.roundingMethod===s.options.roundingMethod.halfDownSymmetric||5<e&&n.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&""===o||4<e&&n.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&"-"===o||5<e&&n.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding||5===e&&n.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding&&1===m||0<e&&n.roundingMethod===s.options.roundingMethod.toCeilingTowardPositiveInfinity&&""===o||0<e&&n.roundingMethod===s.options.roundingMethod.toFloorTowardNegativeInfinity&&"-"===o||0<e&&n.roundingMethod===s.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,n,o,m){o&&(e=this._roundFormattedValueShownOnFocus(e,n));var v=J(e.split(n.decimalCharacter),2),u=v[0],C=v[1];if(C&&C.length>m)if(0<m){var V=C.substring(0,m);e="".concat(u).concat(n.decimalCharacter).concat(V)}else e=u;return e}},{key:"_checkIfInRangeWithOverrideOption",value:function(e,n){if(i.isNull(e)&&n.emptyInputBehavior===s.options.emptyInputBehavior.null||n.overrideMinMaxLimits===s.options.overrideMinMaxLimits.ignore||n.overrideMinMaxLimits===s.options.overrideMinMaxLimits.invalid)return[!0,!0];e=(e=e.toString()).replace(",",".");var o,m=i.parseStr(n.minimumValue),v=i.parseStr(n.maximumValue),u=i.parseStr(e);switch(n.overrideMinMaxLimits){case s.options.overrideMinMaxLimits.floor:o=[-1<i.testMinMax(m,u),!0];break;case s.options.overrideMinMaxLimits.ceiling:o=[!0,i.testMinMax(v,u)<1];break;default:o=[-1<i.testMinMax(m,u),i.testMinMax(v,u)<1]}return o}},{key:"_isWithinRangeWithOverrideOption",value:function(e,n){var o=J(this._checkIfInRangeWithOverrideOption(e,n),2);return o[0]&&o[1]}},{key:"_cleanValueForRangeParse",value:function(e){return e=e.toString().replace(",","."),i.parseStr(e)}},{key:"_isMinimumRangeRespected",value:function(e,n){return-1<i.testMinMax(i.parseStr(n.minimumValue),this._cleanValueForRangeParse(e))}},{key:"_isMaximumRangeRespected",value:function(e,n){return i.testMinMax(i.parseStr(n.maximumValue),this._cleanValueForRangeParse(e))<1}},{key:"_readCookie",value:function(e){for(var n=e+"=",o=document.cookie.split(";"),m="",v=0;v<o.length;v+=1){for(m=o[v];" "===m.charAt(0);)m=m.substring(1,m.length);if(0===m.indexOf(n))return m.substring(n.length,m.length)}return null}},{key:"_storageTest",value:function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch{return!1}}},{key:"_correctNegativePositiveSignPlacementOption",value:function(e){if(i.isNull(e.negativePositiveSignPlacement))if(i.isUndefined(e)||!i.isUndefinedOrNullOrEmpty(e.negativePositiveSignPlacement)||i.isUndefinedOrNullOrEmpty(e.currencySymbol))e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.left;else switch(e.currencySymbolPlacement){case s.options.currencySymbolPlacement.suffix:e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.prefix;break;case s.options.currencySymbolPlacement.prefix:e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.left}}},{key:"_correctCaretPositionOnFocusAndSelectOnFocusOptions",value:function(e){return i.isNull(e)?null:(!i.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&i.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&(e.selectOnFocus=s.options.selectOnFocus.doNotSelect),i.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&!i.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&e.selectOnFocus===s.options.selectOnFocus.select&&(e.caretPositionOnFocus=s.options.caretPositionOnFocus.doNoForceCaretPosition),e)}},{key:"_calculateDecimalPlacesOnInit",value:function(e){this._validateDecimalPlacesRawValue(e),e.decimalPlacesShownOnFocus===s.options.decimalPlacesShownOnFocus.useDefault&&(e.decimalPlacesShownOnFocus=e.decimalPlaces),e.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.useDefault&&(e.decimalPlacesShownOnBlur=e.decimalPlaces),e.decimalPlacesRawValue===s.options.decimalPlacesRawValue.useDefault&&(e.decimalPlacesRawValue=e.decimalPlaces);var n=0;e.rawValueDivisor&&e.rawValueDivisor!==s.options.rawValueDivisor.none&&(n=String(e.rawValueDivisor).length-1)<0&&(n=0),e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+n,Number(e.originalDecimalPlacesRawValue)+n)}},{key:"_calculateDecimalPlacesOnUpdate",value:function(e,n){var o=1<arguments.length&&void 0!==n?n:null;this._validateDecimalPlacesRawValue(e),i.isNull(o)&&i.throwError("When updating the settings, the previous ones should be passed as an argument.");var m="decimalPlaces"in e;if(m||"decimalPlacesRawValue"in e||"decimalPlacesShownOnFocus"in e||"decimalPlacesShownOnBlur"in e||"rawValueDivisor"in e){m?("decimalPlacesShownOnFocus"in e&&e.decimalPlacesShownOnFocus!==s.options.decimalPlacesShownOnFocus.useDefault||(e.decimalPlacesShownOnFocus=e.decimalPlaces),"decimalPlacesShownOnBlur"in e&&e.decimalPlacesShownOnBlur!==s.options.decimalPlacesShownOnBlur.useDefault||(e.decimalPlacesShownOnBlur=e.decimalPlaces),"decimalPlacesRawValue"in e&&e.decimalPlacesRawValue!==s.options.decimalPlacesRawValue.useDefault||(e.decimalPlacesRawValue=e.decimalPlaces)):(i.isUndefined(e.decimalPlacesShownOnFocus)&&(e.decimalPlacesShownOnFocus=o.decimalPlacesShownOnFocus),i.isUndefined(e.decimalPlacesShownOnBlur)&&(e.decimalPlacesShownOnBlur=o.decimalPlacesShownOnBlur));var v=0;e.rawValueDivisor&&e.rawValueDivisor!==s.options.rawValueDivisor.none&&(v=String(e.rawValueDivisor).length-1)<0&&(v=0),e.decimalPlacesRawValue=e.decimalPlaces||e.decimalPlacesRawValue?Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+v,Number(e.decimalPlacesRawValue)+v):Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+v,Number(o.originalDecimalPlacesRawValue)+v)}}},{key:"_cachesUsualRegularExpressions",value:function(e,n){var o;o=e.negativeSignCharacter!==s.options.negativeSignCharacter.hyphen?"([-\\".concat(e.negativeSignCharacter,"]?)"):"(-?)",n.aNegRegAutoStrip=o,e.allowedAutoStrip=new RegExp("[^-0123456789\\".concat(e.decimalCharacter,"]"),"g"),e.numRegAutoStrip=new RegExp("".concat(o,"(?:\\").concat(e.decimalCharacter,"?([0-9]+\\").concat(e.decimalCharacter,"[0-9]+)|([0-9]*(?:\\").concat(e.decimalCharacter,"[0-9]*)?))")),e.stripReg=new RegExp("^".concat(n.aNegRegAutoStrip,"0*([0-9])")),e.formulaChars=new RegExp("[0-9".concat(e.decimalCharacter,"+\\-*/() ]"))}},{key:"_convertOldOptionsToNewOnes",value:function(e){var n={aSep:"digitGroupSeparator",nSep:"showOnlyNumbersOnFocus",dGroup:"digitalGroupSpacing",aDec:"decimalCharacter",altDec:"decimalCharacterAlternative",aSign:"currencySymbol",pSign:"currencySymbolPlacement",pNeg:"negativePositiveSignPlacement",aSuffix:"suffixText",oLimits:"overrideMinMaxLimits",vMax:"maximumValue",vMin:"minimumValue",mDec:"decimalPlacesOverride",eDec:"decimalPlacesShownOnFocus",scaleDecimal:"decimalPlacesShownOnBlur",aStor:"saveValueToSessionStorage",mRound:"roundingMethod",aPad:"allowDecimalPadding",nBracket:"negativeBracketsTypeOnBlur",wEmpty:"emptyInputBehavior",lZero:"leadingZero",aForm:"formatOnPageLoad",sNumber:"selectNumberOnly",anDefault:"defaultValueOverride",unSetOnSubmit:"unformatOnSubmit",outputType:"outputFormat",debug:"showWarnings",allowDecimalPadding:!0,alwaysAllowDecimalCharacter:!0,caretPositionOnFocus:!0,createLocalList:!0,currencySymbol:!0,currencySymbolPlacement:!0,decimalCharacter:!0,decimalCharacterAlternative:!0,decimalPlaces:!0,decimalPlacesRawValue:!0,decimalPlacesShownOnBlur:!0,decimalPlacesShownOnFocus:!0,defaultValueOverride:!0,digitalGroupSpacing:!0,digitGroupSeparator:!0,divisorWhenUnfocused:!0,emptyInputBehavior:!0,eventBubbles:!0,eventIsCancelable:!0,failOnUnknownOption:!0,formatOnPageLoad:!0,formulaMode:!0,historySize:!0,isCancellable:!0,leadingZero:!0,maximumValue:!0,minimumValue:!0,modifyValueOnWheel:!0,negativeBracketsTypeOnBlur:!0,negativePositiveSignPlacement:!0,negativeSignCharacter:!0,noEventListeners:!0,onInvalidPaste:!0,outputFormat:!0,overrideMinMaxLimits:!0,positiveSignCharacter:!0,rawValueDivisor:!0,readOnly:!0,roundingMethod:!0,saveValueToSessionStorage:!0,selectNumberOnly:!0,selectOnFocus:!0,serializeSpaces:!0,showOnlyNumbersOnFocus:!0,showPositiveSign:!0,showWarnings:!0,styleRules:!0,suffixText:!0,symbolWhenUnfocused:!0,unformatOnHover:!0,unformatOnSubmit:!0,valuesToStrings:!0,watchExternalChanges:!0,wheelOn:!0,wheelStep:!0,allowedAutoStrip:!0,formulaChars:!0,isNegativeSignAllowed:!0,isPositiveSignAllowed:!0,mIntNeg:!0,mIntPos:!0,numRegAutoStrip:!0,originalDecimalPlaces:!0,originalDecimalPlacesRawValue:!0,stripReg:!0};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(!0===n[o])continue;Object.prototype.hasOwnProperty.call(n,o)?(i.warning("You are using the deprecated option name '".concat(o,"'. Please use '").concat(n[o],"' instead from now on. The old option name will be dropped very soon\u2122."),!0),e[n[o]]=e[o],delete e[o]):e.failOnUnknownOption&&i.throwError("Option name '".concat(o,"' is unknown. Please fix the options passed to autoNumeric"))}"mDec"in e&&i.warning("The old `mDec` option has been deprecated in favor of more accurate options ; `decimalPlaces`, `decimalPlacesRawValue`, `decimalPlacesShownOnFocus` and `decimalPlacesShownOnBlur`.",!0)}},{key:"_setNegativePositiveSignPermissions",value:function(e){e.isNegativeSignAllowed=e.minimumValue<0,e.isPositiveSignAllowed=0<=e.maximumValue}},{key:"_toNumericValue",value:function(e,n){var o;return i.isNumber(Number(e))?o=i.scientificToDecimal(e):(o=this._convertToNumericString(e.toString(),n),i.isNumber(Number(o))||(i.warning('The given value "'.concat(e,'" cannot be converted to a numeric one and therefore cannot be used appropriately.'),n.showWarnings),o=NaN)),o}},{key:"_checkIfInRange",value:function(e,n,o){var m=i.parseStr(e);return-1<i.testMinMax(n,m)&&i.testMinMax(o,m)<1}},{key:"_shouldSkipEventKey",value:function(e){var n=i.isInArray(e,w.keyName._allFnKeys),o=e===w.keyName.OSLeft||e===w.keyName.OSRight,m=e===w.keyName.ContextMenu,v=i.isInArray(e,w.keyName._someNonPrintableKeys);return n||o||m||v||e===w.keyName.Unidentified||e===w.keyName.NumLock||e===w.keyName.ScrollLock||e===w.keyName.Insert||e===w.keyName.Command}},{key:"_serialize",value:function(e,n,o,m,v){var u,C=this,V=1<arguments.length&&void 0!==n&&n,Z=2<arguments.length&&void 0!==o?o:"unformatted",y=3<arguments.length&&void 0!==m?m:"+",L=4<arguments.length&&void 0!==v?v:null,D=[];return"object"===de(e)&&"form"===e.nodeName.toLowerCase()&&Array.prototype.slice.call(e.elements).forEach(function(B){if(B.name&&!B.disabled&&-1===["file","reset","submit","button"].indexOf(B.type))if("select-multiple"===B.type)Array.prototype.slice.call(B.options).forEach(function(oe){oe.selected&&D.push(V?{name:B.name,value:oe.value}:"".concat(encodeURIComponent(B.name),"=").concat(encodeURIComponent(oe.value)))});else if(-1===["checkbox","radio"].indexOf(B.type)||B.checked){var z,q;if(C.isManagedByAutoNumeric(B))switch(Z){case"unformatted":q=C.getAutoNumericElement(B),i.isNull(q)||(z=C.unformat(B,q.getSettings()));break;case"localized":if(q=C.getAutoNumericElement(B),!i.isNull(q)){var Y=i.cloneObject(q.getSettings());i.isNull(L)||(Y.outputFormat=L),z=C.localize(B,Y)}break;default:z=B.value}else z=B.value;i.isUndefined(z)&&i.throwError("This error should never be hit. If it has, something really wrong happened!"),D.push(V?{name:B.name,value:z}:"".concat(encodeURIComponent(B.name),"=").concat(encodeURIComponent(z)))}}),V?u=D:(u=D.join("&"),"+"===y&&(u=u.replace(/%20/g,"+"))),u}},{key:"_serializeNumericString",value:function(e,n){return this._serialize(e,!1,"unformatted",1<arguments.length&&void 0!==n?n:"+")}},{key:"_serializeFormatted",value:function(e,n){return this._serialize(e,!1,"formatted",1<arguments.length&&void 0!==n?n:"+")}},{key:"_serializeLocalized",value:function(e,n,o){return this._serialize(e,!1,"localized",1<arguments.length&&void 0!==n?n:"+",2<arguments.length&&void 0!==o?o:null)}},{key:"_serializeNumericStringArray",value:function(e,n){return this._serialize(e,!0,"unformatted",1<arguments.length&&void 0!==n?n:"+")}},{key:"_serializeFormattedArray",value:function(e,n){return this._serialize(e,!0,"formatted",1<arguments.length&&void 0!==n?n:"+")}},{key:"_serializeLocalizedArray",value:function(e,n,o){return this._serialize(e,!0,"localized",1<arguments.length&&void 0!==n?n:"+",2<arguments.length&&void 0!==o?o:null)}}],Ne((d=s).prototype,[{key:"_saveInitialValues",value:function(e){this.initialValueHtmlAttribute=i.scientificToDecimal(this.domElement.getAttribute("value")),i.isNull(this.initialValueHtmlAttribute)&&(this.initialValueHtmlAttribute=""),this.initialValue=e,i.isNull(this.initialValue)&&(this.initialValue="")}},{key:"_createEventListeners",value:function(){var e=this;this.formulaMode=!1,this._onFocusInFunc=function(n){e._onFocusIn(n)},this._onFocusInAndMouseEnterFunc=function(n){e._onFocusInAndMouseEnter(n)},this._onFocusFunc=function(){e._onFocus()},this._onKeydownFunc=function(n){e._onKeydown(n)},this._onKeypressFunc=function(n){e._onKeypress(n)},this._onKeyupFunc=function(n){e._onKeyup(n)},this._onFocusOutAndMouseLeaveFunc=function(n){e._onFocusOutAndMouseLeave(n)},this._onPasteFunc=function(n){e._onPaste(n)},this._onWheelFunc=function(n){e._onWheel(n)},this._onDropFunc=function(n){e._onDrop(n)},this._onKeydownGlobalFunc=function(n){e._onKeydownGlobal(n)},this._onKeyupGlobalFunc=function(n){e._onKeyupGlobal(n)},this.domElement.addEventListener("focusin",this._onFocusInFunc,!1),this.domElement.addEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("focus",this._onFocusFunc,!1),this.domElement.addEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("keydown",this._onKeydownFunc,!1),this.domElement.addEventListener("keypress",this._onKeypressFunc,!1),this.domElement.addEventListener("keyup",this._onKeyupFunc,!1),this.domElement.addEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("paste",this._onPasteFunc,!1),this.domElement.addEventListener("wheel",this._onWheelFunc,!1),this.domElement.addEventListener("drop",this._onDropFunc,!1),this._setupFormListener(),this.hasEventListeners=!0,s._doesGlobalListExists()||(document.addEventListener("keydown",this._onKeydownGlobalFunc,!1),document.addEventListener("keyup",this._onKeyupGlobalFunc,!1))}},{key:"_removeEventListeners",value:function(){this.domElement.removeEventListener("focusin",this._onFocusInFunc,!1),this.domElement.removeEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("focus",this._onFocusFunc,!1),this.domElement.removeEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("keydown",this._onKeydownFunc,!1),this.domElement.removeEventListener("keypress",this._onKeypressFunc,!1),this.domElement.removeEventListener("keyup",this._onKeyupFunc,!1),this.domElement.removeEventListener("paste",this._onPasteFunc,!1),this.domElement.removeEventListener("wheel",this._onWheelFunc,!1),this.domElement.removeEventListener("drop",this._onDropFunc,!1),this._removeFormListener(),this.hasEventListeners=!1,document.removeEventListener("keydown",this._onKeydownGlobalFunc,!1),document.removeEventListener("keyup",this._onKeyupGlobalFunc,!1)}},{key:"_updateEventListeners",value:function(){this.settings.noEventListeners||this.hasEventListeners||this._createEventListeners(),this.settings.noEventListeners&&this.hasEventListeners&&this._removeEventListeners()}},{key:"_setupFormListener",value:function(){var e=this;i.isNull(this.parentForm)||(this._onFormSubmitFunc=function(){e._onFormSubmit()},this._onFormResetFunc=function(){e._onFormReset()},this._hasParentFormCounter()?this._incrementParentFormCounter():(this._initializeFormCounterToOne(),this.parentForm.addEventListener("submit",this._onFormSubmitFunc,!1),this.parentForm.addEventListener("reset",this._onFormResetFunc,!1),this._storeFormHandlerFunction()))}},{key:"_removeFormListener",value:function(){if(!i.isNull(this.parentForm)){var e=this._getParentFormCounter();1===e?(this.parentForm.removeEventListener("submit",this._getFormHandlerFunction().submitFn,!1),this.parentForm.removeEventListener("reset",this._getFormHandlerFunction().resetFn,!1),this._removeFormDataSetInfo()):1<e?this._decrementParentFormCounter():i.throwError("The AutoNumeric object count on the form is incoherent.")}}},{key:"_hasParentFormCounter",value:function(){return"anCount"in this.parentForm.dataset}},{key:"_getParentFormCounter",value:function(){return Number(this.parentForm.dataset.anCount)}},{key:"_initializeFormCounterToOne",value:function(e){this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset.anCount=1}},{key:"_incrementParentFormCounter",value:function(e){this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset.anCount++}},{key:"_decrementParentFormCounter",value:function(){this.parentForm.dataset.anCount--}},{key:"_hasFormHandlerFunction",value:function(e){return"anFormHandler"in this._getFormElement(0<arguments.length&&void 0!==e?e:null).dataset}},{key:"_getFormElement",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;return i.isNull(n)?this.parentForm:n}},{key:"_storeFormHandlerFunction",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var o=i.randomString();this._getFormElement(n).dataset.anFormHandler=o,window.aNFormHandlerMap.set(o,{submitFn:this._onFormSubmitFunc,resetFn:this._onFormResetFunc})}},{key:"_getFormHandlerKey",value:function(){this._hasFormHandlerFunction()||i.throwError("Unable to retrieve the form handler name");var e=this.parentForm.dataset.anFormHandler;return""===e&&i.throwError("The form handler name is invalid"),e}},{key:"_getFormHandlerFunction",value:function(){var e=this._getFormHandlerKey();return window.aNFormHandlerMap.get(e)}},{key:"_removeFormDataSetInfo",value:function(){this._decrementParentFormCounter(),window.aNFormHandlerMap.delete(this._getFormHandlerKey()),this.parentForm.removeAttribute("data-an-count"),this.parentForm.removeAttribute("data-an-form-handler")}},{key:"_setWritePermissions",value:function(e){0<arguments.length&&void 0!==e&&e&&this.domElement.readOnly||this.settings.readOnly?this._setReadOnly():this._setReadWrite()}},{key:"_setReadOnly",value:function(){this.isInputElement?this.domElement.readOnly=!0:this.domElement.setAttribute("contenteditable",!1)}},{key:"_setReadWrite",value:function(){this.isInputElement?this.domElement.readOnly=!1:this.domElement.setAttribute("contenteditable",!0)}},{key:"_addWatcher",value:function(){var e=this;if(!i.isUndefined(this.getterSetter)){var n=this.getterSetter,o=n.set,m=n.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return m.call(e.domElement)},set:function(v){o.call(e.domElement,v),e.settings.watchExternalChanges&&!e.internalModification&&e.set(v)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!i.isUndefined(this.getterSetter)){var n=this.getterSetter,o=n.set,m=n.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return m.call(e.domElement)},set:function(v){o.call(e.domElement,v)}})}}},{key:"_getAttributeToWatch",value:function(){var e;if(this.isInputElement)e="value";else{var n=this.domElement.nodeType;n===Node.ELEMENT_NODE||n===Node.DOCUMENT_NODE||n===Node.DOCUMENT_FRAGMENT_NODE?e="textContent":n===Node.TEXT_NODE&&(e="nodeValue")}return e}},{key:"_historyTableAdd",value:function(){var e=0===this.historyTable.length;if(e||this.rawValue!==this._historyTableCurrentValueUsed()){var n=!0;if(!e){var o=this.historyTableIndex+1;o<this.historyTable.length&&this.rawValue===this.historyTable[o].value?n=!1:i.arrayTrim(this.historyTable,this.historyTableIndex+1)}if(this.historyTableIndex++,n){var m=i.getElementSelection(this.domElement);this.selectionStart=m.start,this.selectionEnd=m.end,this.historyTable.push({value:this.rawValue,start:this.selectionStart+1,end:this.selectionEnd+1}),1<this.historyTable.length&&(this.historyTable[this.historyTableIndex-1].start=this.selectionStart,this.historyTable[this.historyTableIndex-1].end=this.selectionEnd)}this.historyTable.length>this.settings.historySize&&this._historyTableForget()}}},{key:"_historyTableUndoOrRedo",value:function(e){var n;if(0<arguments.length&&void 0!==e&&!e?(n=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(n=0<this.historyTableIndex)&&this.historyTableIndex--,n){var o=this.historyTable[this.historyTableIndex];this.set(o.value,null,!1),i.setElementSelection(this.domElement,o.start,o.end)}}},{key:"_historyTableUndo",value:function(){this._historyTableUndoOrRedo(!0)}},{key:"_historyTableRedo",value:function(){this._historyTableUndoOrRedo(!1)}},{key:"_historyTableForget",value:function(e){for(var n=0<arguments.length&&void 0!==e?e:1,o=[],m=0;m<n;m++)o.push(this.historyTable.shift()),this.historyTableIndex--,this.historyTableIndex<0&&(this.historyTableIndex=0);return 1===o.length?o[0]:o}},{key:"_historyTableCurrentValueUsed",value:function(){var e=this.historyTableIndex;return e<0&&(e=0),i.isUndefinedOrNullOrEmpty(this.historyTable[e])?"":this.historyTable[e].value}},{key:"_parseStyleRules",value:function(){var e=this;i.isUndefinedOrNullOrEmpty(this.settings.styleRules)||""===this.rawValue||(i.isUndefinedOrNullOrEmpty(this.settings.styleRules.positive)||(0<=this.rawValue?this._addCSSClass(this.settings.styleRules.positive):this._removeCSSClass(this.settings.styleRules.positive)),i.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)||(this.rawValue<0?this._addCSSClass(this.settings.styleRules.negative):this._removeCSSClass(this.settings.styleRules.negative)),i.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges)||0===this.settings.styleRules.ranges.length||this.settings.styleRules.ranges.forEach(function(n){e.rawValue>=n.min&&e.rawValue<n.max?e._addCSSClass(n.class):e._removeCSSClass(n.class)}),i.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined)||0===this.settings.styleRules.userDefined.length||this.settings.styleRules.userDefined.forEach(function(n){if(i.isFunction(n.callback))if(i.isString(n.classes))n.callback(e.rawValue)?e._addCSSClass(n.classes):e._removeCSSClass(n.classes);else if(i.isArray(n.classes))if(2===n.classes.length)n.callback(e.rawValue)?(e._addCSSClass(n.classes[0]),e._removeCSSClass(n.classes[1])):(e._removeCSSClass(n.classes[0]),e._addCSSClass(n.classes[1]));else if(2<n.classes.length){var o=n.callback(e.rawValue);i.isArray(o)?n.classes.forEach(function(m,v){i.isInArray(v,o)?e._addCSSClass(m):e._removeCSSClass(m)}):i.isInt(o)?n.classes.forEach(function(m,v){v===o?e._addCSSClass(m):e._removeCSSClass(m)}):i.isNull(o)?n.classes.forEach(function(m){e._removeCSSClass(m)}):i.throwError("The callback result is not an array nor a valid array index, ".concat(de(o)," given."))}else i.throwError("The classes attribute is not valid for the `styleRules` option.");else i.isUndefinedOrNullOrEmpty(n.classes)?n.callback(e):i.throwError("The callback/classes structure is not valid for the `styleRules` option.");else i.warning("The given `styleRules` callback is not a function, ".concat(typeof callback>"u"?"undefined":de(callback)," given."),e.settings.showWarnings)}))}},{key:"_addCSSClass",value:function(e){this.domElement.classList.add(e)}},{key:"_removeCSSClass",value:function(e){this.domElement.classList.remove(e)}},{key:"update",value:function(){for(var e=this,n=arguments.length,o=new Array(n),m=0;m<n;m++)o[m]=arguments[m];Array.isArray(o)&&Array.isArray(o[0])&&(o=o[0]);var v=i.cloneObject(this.settings),u=this.rawValue,C={};i.isUndefinedOrNullOrEmpty(o)||0===o.length?C=null:1<=o.length&&o.forEach(function(V){e.constructor._isPreDefinedOptionValid(V)&&(V=e.constructor._getOptionObject(V)),ee(C,V)});try{this._setSettings(C,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(u)}catch(V){return this._setSettings(v,!0),i.throwError("Unable to update the settings, those are invalid: [".concat(V,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(e,n,o){var m,v=1<arguments.length&&void 0!==n?n:null,u=!(2<arguments.length&&void 0!==o)||o;if(i.isUndefined(e))return i.warning("You are trying to set an 'undefined' value ; an error could have occurred.",this.settings.showWarnings),this;if(i.isNull(v)||this._setSettings(v,!0),null===e&&this.settings.emptyInputBehavior!==s.options.emptyInputBehavior.null)return i.warning("You are trying to set the `null` value while the `emptyInputBehavior` option is set to ".concat(this.settings.emptyInputBehavior,". If you want to be able to set the `null` value, you need to change the 'emptyInputBehavior' option to `'null'`."),this.settings.showWarnings),this;if(null===e)return this._setElementAndRawValue(null,null,u),this._saveValueToPersistentStorage(),this;if(m=this.constructor._toNumericValue(e,this.settings),isNaN(Number(m)))return i.warning("The value you are trying to set results in `NaN`. The element value is set to the empty string instead.",this.settings.showWarnings),this.setValue("",u),this;if(""===m)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:m=0;break;case s.options.emptyInputBehavior.min:m=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:m=this.settings.maximumValue;break;default:i.isNumber(this.settings.emptyInputBehavior)&&(m=Number(this.settings.emptyInputBehavior))}if(""===m)return this._setElementAndRawValue(this.settings.emptyInputBehavior===s.options.emptyInputBehavior.always?this.settings.currencySymbol:"","",u),this;var V=J(this.constructor._checkIfInRangeWithOverrideOption(m,this.settings),2),Z=V[0],y=V[1];if(Z&&y&&this.settings.valuesToStrings&&this._checkValuesToStrings(m))return this._setElementAndRawValue(this.settings.valuesToStrings[m],m,u),this._saveValueToPersistentStorage(),this;if(i.isZeroOrHasNoValue(m)&&(m="0"),Z&&y){var L=this.constructor._roundRawValue(m,this.settings);return L=this._trimLeadingAndTrailingZeros(L.replace(this.settings.decimalCharacter,".")),m=this._getRawValueToFormat(m),m=this.isFocused?this.constructor._roundFormattedValueShownOnFocus(m,this.settings):(this.settings.divisorWhenUnfocused&&(m=(m/=this.settings.divisorWhenUnfocused).toString()),this.constructor._roundFormattedValueShownOnBlur(m,this.settings)),m=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(m,this.settings),m=this.constructor._addGroupSeparators(m,this.settings,this.isFocused,this.rawValue,L),!this.isFocused&&this.settings.symbolWhenUnfocused&&(m="".concat(m).concat(this.settings.symbolWhenUnfocused)),(this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._saveValueToPersistentStorage(),this._setElementAndRawValue(m,L,u),this._setValidOrInvalidState(L),this}return this._triggerRangeEvents(Z,y),i.throwError("The value [".concat(m,"] being set falls outside of the minimumValue [").concat(this.settings.minimumValue,"] and maximumValue [").concat(this.settings.maximumValue,"] range set for this element")),this._removeValueFromPersistentStorage(),this.setValue("",u),this}},{key:"setUnformatted",value:function(e,n){var o=1<arguments.length&&void 0!==n?n:null;if(null===e||i.isUndefined(e))return this;i.isNull(o)||this._setSettings(o,!0);var m=this.constructor._removeBrackets(e,this.settings),v=this.constructor._stripAllNonNumberCharacters(m,this.settings,!0,this.isFocused);return i.isNumber(v)||i.throwError("The value is not a valid one, it's not a numeric string nor a recognized currency."),this.constructor._isWithinRangeWithOverrideOption(v,this.settings)?this.setValue(e):i.throwError("The value is out of the range limits [".concat(this.settings.minimumValue,", ").concat(this.settings.maximumValue,"].")),this}},{key:"setValue",value:function(e,n){return this._setElementAndRawValue(e,!(1<arguments.length&&void 0!==n)||n),this}},{key:"_setRawValue",value:function(e,n){var o=!(1<arguments.length&&void 0!==n)||n;if(this.rawValue!==e){var m=this.rawValue;this.rawValue=e,!i.isNull(this.settings.rawValueDivisor)&&0!==this.settings.rawValueDivisor&&""!==e&&null!==e&&this._isUserManuallyEditingTheValue()&&(this.rawValue/=this.settings.rawValueDivisor),this._triggerEvent(s.events.rawValueModified,this.domElement,{oldRawValue:m,newRawValue:this.rawValue,isPristine:this.isPristine(!0),error:null,aNElement:this}),this._parseStyleRules(),o&&this._historyTableAdd()}}},{key:"_setElementValue",value:function(e,n){var o=!(1<arguments.length&&void 0!==n)||n,m=i.getElementValue(this.domElement);return e!==m&&(this.internalModification=!0,i.setElementValue(this.domElement,e),this.internalModification=!1,o&&this._triggerEvent(s.events.formatted,this.domElement,{oldValue:m,newValue:e,oldRawValue:this.rawValue,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this})),this}},{key:"_setElementAndRawValue",value:function(e,n,o){var m=1<arguments.length&&void 0!==n?n:null,v=!(2<arguments.length&&void 0!==o)||o;return i.isNull(m)?m=e:i.isBoolean(m)&&(v=m,m=e),this._setElementValue(e),this._setRawValue(m,v),this}},{key:"_getRawValueToFormat",value:function(e){return i.isNull(this.settings.rawValueDivisor)||0===this.settings.rawValueDivisor||""===e||null===e?e:e*this.settings.rawValueDivisor}},{key:"_checkValuesToStrings",value:function(e){return this.constructor._checkValuesToStringsArray(e,this.valuesToStringsKeys)}},{key:"_isUserManuallyEditingTheValue",value:function(){return this.isFocused&&this.isEditing||this.isDropEvent}},{key:"_executeCallback",value:function(e,n){!i.isNull(n)&&i.isFunction(n)&&n(e,this)}},{key:"_triggerEvent",value:function(e,n,o){var m=1<arguments.length&&void 0!==n?n:document;i.triggerEvent(e,m,2<arguments.length&&void 0!==o?o:null,this.settings.eventBubbles,this.settings.eventIsCancelable)}},{key:"get",value:function(e){return this.getNumericString(0<arguments.length&&void 0!==e?e:null)}},{key:"getNumericString",value:function(e){var n,o=0<arguments.length&&void 0!==e?e:null;return n=i.isNull(this.rawValue)?null:i.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(n,o),n}},{key:"getFormatted",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;"value"in this.domElement||"textContent"in this.domElement||i.throwError("Unable to get the formatted string from the element.");var o=i.getElementValue(this.domElement);return this._executeCallback(o,n),o}},{key:"getNumber",value:function(e){var n,o=0<arguments.length&&void 0!==e?e:null;return n=null===this.rawValue?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(n,o),n}},{key:"getLocalized",value:function(e,n){var o,m,v=0<arguments.length&&void 0!==e?e:null,u=1<arguments.length&&void 0!==n?n:null;i.isFunction(v)&&i.isNull(u)&&(u=v,v=null),(o=i.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))&&0===Number(o)&&this.settings.leadingZero!==s.options.leadingZero.keep&&(o="0"),m=i.isNull(v)?this.settings.outputFormat:v;var C=this.constructor._toLocale(o,m,this.settings);return this._executeCallback(C,u),C}},{key:"reformat",value:function(){return this.set(this.rawValue),this}},{key:"unformat",value:function(){return this._setElementValue(this.getNumericString()),this}},{key:"unformatLocalized",value:function(e){return this._setElementValue(this.getLocalized(0<arguments.length&&void 0!==e?e:null)),this}},{key:"isPristine",value:function(e){return 0<arguments.length&&void 0!==e&&!e?this.initialValueHtmlAttribute===this.getFormatted():this.initialValue===this.getNumericString()}},{key:"select",value:function(){return this.settings.selectNumberOnly?this.selectNumber():this._defaultSelectAll(),this}},{key:"_defaultSelectAll",value:function(){i.setElementSelection(this.domElement,0,i.getElementValue(this.domElement).length)}},{key:"selectNumber",value:function(){var e,n,o=i.getElementValue(this.domElement),m=o.length,v=this.settings.currencySymbol.length,u=this.settings.currencySymbolPlacement,C=i.isNegative(o,this.settings.negativeSignCharacter)?1:0,V=this.settings.suffixText.length;if(e=u===s.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left&&1==C&&0<v?v+1:v,u===s.options.currencySymbolPlacement.prefix)n=m-V;else switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:n=m-(V+v);break;case s.options.negativePositiveSignPlacement.right:n=0<v?m-(v+C+V):m-(v+V);break;default:n=m-(v+V)}return i.setElementSelection(this.domElement,e,n),this}},{key:"selectInteger",value:function(){var e=0,n=0<=this.rawValue;this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.prefix&&(this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none)||(this.settings.showPositiveSign&&n||!n&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left)&&(e+=1),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(e+=this.settings.currencySymbol.length);var o=i.getElementValue(this.domElement),m=o.indexOf(this.settings.decimalCharacter);return-1===m&&(m=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?o.length-this.settings.currencySymbol.length:o.length,n||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.suffix&&this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.suffix||--m,m-=this.settings.suffixText.length),i.setElementSelection(this.domElement,e,m),this}},{key:"selectDecimal",value:function(){var e,o=i.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return e=-1===o?o=0:(o+=1)+Number(this.isFocused?this.settings.decimalPlacesShownOnFocus:this.settings.decimalPlacesShownOnBlur),i.setElementSelection(this.domElement,o,e),this}},{key:"node",value:function(){return this.domElement}},{key:"parent",value:function(){return this.domElement.parentNode}},{key:"detach",value:function(e){var n,o=0<arguments.length&&void 0!==e?e:null;return n=i.isNull(o)?this.domElement:o.node(),this._removeFromLocalList(n),this}},{key:"attach",value:function(e,n){var o=!(1<arguments.length&&void 0!==n)||n;return this._addToLocalList(e.node()),o&&e.update(this.settings),this}},{key:"formatOther",value:function(e,n){return this._formatOrUnformatOther(!0,e,1<arguments.length&&void 0!==n?n:null)}},{key:"unformatOther",value:function(e,n){return this._formatOrUnformatOther(!1,e,1<arguments.length&&void 0!==n?n:null)}},{key:"_formatOrUnformatOther",value:function(e,n,o){var m,v,u=2<arguments.length&&void 0!==o?o:null;if(m=i.isNull(u)?this.settings:this._cloneAndMergeSettings(u),i.isElement(n)){var C=i.getElementValue(n);return v=e?s.format(C,m):s.unformat(C,m),i.setElementValue(n,v),null}return e?s.format(n,m):s.unformat(n,m)}},{key:"init",value:function(e,n){var o=this,m=!(1<arguments.length&&void 0!==n)||n,v=!1,u=[];if(i.isString(e)?u=j(document.querySelectorAll(e)):i.isElement(e)?(u.push(e),v=!0):i.isArray(e)?u=e:i.throwError("The given parameters to the 'init' function are invalid."),0===u.length)return i.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var C=this._getLocalList(),V=[];return u.forEach(function(Z){var y=o.settings.createLocalList;m&&(o.settings.createLocalList=!1);var L=new s(Z,i.getElementValue(Z),o.settings);m&&(L._setLocalList(C),o._addToLocalList(Z,L),o.settings.createLocalList=y),V.push(L)}),v?V[0]:V}},{key:"clear",value:function(e){return 0<arguments.length&&void 0!==e&&e?this.set("",{emptyInputBehavior:s.options.emptyInputBehavior.focus}):this.set(""),this}},{key:"remove",value:function(){this._removeValueFromPersistentStorage(),this._removeEventListeners(),this._removeWatcher(),this._removeFromLocalList(this.domElement),this.constructor._removeFromGlobalList(this)}},{key:"wipe",value:function(){this._setElementValue("",!1),this.remove()}},{key:"nuke",value:function(){this.remove(),this.domElement.parentNode.removeChild(this.domElement)}},{key:"form",value:function(e){if(0<arguments.length&&void 0!==e&&e||i.isUndefinedOrNullOrEmpty(this.parentForm)){var n=this._getParentForm();if(!i.isNull(n)&&n!==this.parentForm){var o=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=o.length,this._hasFormHandlerFunction(n)?this._incrementParentFormCounter(n):(this._storeFormHandlerFunction(n),this._initializeFormCounterToOne(n))}this.parentForm=n}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var n=this;return j(e.querySelectorAll("input")).filter(function(o){return n.constructor.isManagedByAutoNumeric(o)})}},{key:"_getParentForm",value:function(){if("body"===this.domElement.tagName.toLowerCase())return null;var e,n=this.domElement;do{if(i.isNull(n=n.parentNode))return null;if("body"===(e=n.tagName?n.tagName.toLowerCase():""))break}while("form"!==e);return"form"===e?n:null}},{key:"formNumericString",value:function(){return this.constructor._serializeNumericString(this.form(),this.settings.serializeSpaces)}},{key:"formFormatted",value:function(){return this.constructor._serializeFormatted(this.form(),this.settings.serializeSpaces)}},{key:"formLocalized",value:function(e){var n,o=0<arguments.length&&void 0!==e?e:null;return n=i.isNull(o)?this.settings.outputFormat:o,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,n)}},{key:"formArrayNumericString",value:function(){return this.constructor._serializeNumericStringArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayFormatted",value:function(){return this.constructor._serializeFormattedArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayLocalized",value:function(e){var n,o=0<arguments.length&&void 0!==e?e:null;return n=i.isNull(o)?this.settings.outputFormat:o,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,n)}},{key:"formJsonNumericString",value:function(){return JSON.stringify(this.formArrayNumericString())}},{key:"formJsonFormatted",value:function(){return JSON.stringify(this.formArrayFormatted())}},{key:"formJsonLocalized",value:function(e){return JSON.stringify(this.formArrayLocalized(0<arguments.length&&void 0!==e?e:null))}},{key:"formUnformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).unformat()}),this}},{key:"formUnformatLocalized",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).unformatLocalized()}),this}},{key:"formReformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).reformat()}),this}},{key:"formSubmitNumericString",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;return i.isNull(n)?(this.formUnformat(),this.form().submit(),this.formReformat()):i.isFunction(n)?n(this.formNumericString()):i.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;return i.isNull(n)?this.form().submit():i.isFunction(n)?n(this.formFormatted()):i.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(e,n){var o=0<arguments.length&&void 0!==e?e:null,m=1<arguments.length&&void 0!==n?n:null;return i.isNull(m)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):i.isFunction(m)?m(this.formLocalized(o)):i.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayNumericString",value:function(e){return i.isFunction(e)?e(this.formArrayNumericString()):i.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayFormatted",value:function(e){return i.isFunction(e)?e(this.formArrayFormatted()):i.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayLocalized",value:function(e,n){var o=1<arguments.length&&void 0!==n?n:null;return i.isFunction(e)?e(this.formArrayLocalized(o)):i.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonNumericString",value:function(e){return i.isFunction(e)?e(this.formJsonNumericString()):i.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonFormatted",value:function(e){return i.isFunction(e)?e(this.formJsonFormatted()):i.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonLocalized",value:function(e,n){var o=1<arguments.length&&void 0!==n?n:null;return i.isFunction(e)?e(this.formJsonLocalized(o)):i.throwError("The given callback is not a function."),this}},{key:"_createLocalList",value:function(){this.autoNumericLocalList=new Map,this._addToLocalList(this.domElement)}},{key:"_deleteLocalList",value:function(){delete this.autoNumericLocalList}},{key:"_setLocalList",value:function(e){this.autoNumericLocalList=e}},{key:"_getLocalList",value:function(){return this.autoNumericLocalList}},{key:"_hasLocalList",value:function(){return this.autoNumericLocalList instanceof Map&&0!==this.autoNumericLocalList.size}},{key:"_addToLocalList",value:function(e,n){var o=1<arguments.length&&void 0!==n?n:null;i.isNull(o)&&(o=this),i.isUndefined(this.autoNumericLocalList)?i.throwError("The local list provided does not exists when trying to add an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.set(e,o)}},{key:"_removeFromLocalList",value:function(e){i.isUndefined(this.autoNumericLocalList)?this.settings.createLocalList&&i.throwError("The local list provided does not exists when trying to remove an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.delete(e)}},{key:"_mergeSettings",value:function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];ee.apply(void 0,[this.settings].concat(n))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},n=arguments.length,o=new Array(n),m=0;m<n;m++)o[m]=arguments[m];return ee.apply(void 0,[e,this.settings].concat(o)),e}},{key:"_updatePredefinedOptions",value:function(e,n){var o=1<arguments.length&&void 0!==n?n:null;return i.isNull(o)?this.update(e):(this._mergeSettings(e,o),this.update(this.settings)),this}},{key:"french",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().French,n),this}},{key:"northAmerican",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().NorthAmerican,n),this}},{key:"british",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().British,n),this}},{key:"swiss",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Swiss,n),this}},{key:"japanese",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Japanese,n),this}},{key:"spanish",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Spanish,n),this}},{key:"chinese",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Chinese,n),this}},{key:"brazilian",value:function(e){var n=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Brazilian,n),this}},{key:"_runCallbacksFoundInTheSettingsObject",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var n=this.settings[e];if("function"==typeof n)this.settings[e]=n(this,e);else{var o=this.domElement.getAttribute(e);o=i.camelize(o),"function"==typeof this.settings[o]&&(this.settings[e]=o(this,e))}}}},{key:"_setTrailingNegativeSignInfo",value:function(){this.isTrailingNegative=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left||this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.right)}},{key:"_modifyNegativeSignAndDecimalCharacterForRawValue",value:function(e){return"."!==this.settings.decimalCharacter&&(e=e.replace(this.settings.decimalCharacter,".")),"-"!==this.settings.negativeSignCharacter&&this.settings.isNegativeSignAllowed&&(e=e.replace(this.settings.negativeSignCharacter,"-")),e.match(/\d/)||(e+="0"),e}},{key:"_initialCaretPosition",value:function(e){i.isNull(this.settings.caretPositionOnFocus)&&this.settings.selectOnFocus===s.options.selectOnFocus.doNotSelect&&i.throwError("`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.");var n=this.rawValue<0,o=i.isZeroOrHasNoValue(e),m=e.length,v=0,u=0,C=!1,V=0;this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.start&&(v=(e=(e=(e=e.replace(this.settings.negativeSignCharacter,"")).replace(this.settings.positiveSignCharacter,"")).replace(this.settings.currencySymbol,"")).length,C=i.contains(e,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalRight||(V=C?(u=e.indexOf(this.settings.decimalCharacter),this.settings.decimalCharacter.length):(u=v,0)));var Z="";n?Z=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!o&&(Z=this.settings.positiveSignCharacter);var y,L=Z.length,D=this.settings.currencySymbol.length;if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix){if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(n||!n&&this.settings.showPositiveSign&&!o))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:y=L+D;break;case s.options.negativePositiveSignPlacement.suffix:y=D}else y=D;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(n||!n&&this.settings.showPositiveSign&&!o))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:y=m;break;case s.options.negativePositiveSignPlacement.suffix:y=D+v}else y=m;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(n||!n&&this.settings.showPositiveSign&&!o))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:y=L+D+u;break;case s.options.negativePositiveSignPlacement.suffix:y=D+u}else y=D+u;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(n||!n&&this.settings.showPositiveSign&&!o))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:y=L+D+u+V;break;case s.options.negativePositiveSignPlacement.suffix:y=D+u+V}else y=D+u+V}else if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(n||!n&&this.settings.showPositiveSign&&!o))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:y=0;break;case s.options.negativePositiveSignPlacement.prefix:y=L}else y=0;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(n||!n&&this.settings.showPositiveSign&&!o))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:y=v;break;case s.options.negativePositiveSignPlacement.prefix:y=L+v}else y=v;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(n||!n&&this.settings.showPositiveSign&&!o))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:y=u;break;case s.options.negativePositiveSignPlacement.prefix:y=L+u}else y=u;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(n||!n&&this.settings.showPositiveSign&&!o))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:y=u+V;break;case s.options.negativePositiveSignPlacement.prefix:y=L+u+V}else y=u+V;return y}},{key:"_triggerRangeEvents",value:function(e,n){e||this._triggerEvent(s.events.minRangeExceeded,this.domElement),n||this._triggerEvent(s.events.maxRangeExceeded,this.domElement)}},{key:"_setInvalidState",value:function(){this.isInputElement?i.setInvalidState(this.domElement):this._addCSSClass(this.settings.invalidClass),this._triggerEvent(s.events.invalidValue,this.domElement),this.validState=!1}},{key:"_setValidState",value:function(){this.isInputElement?i.setValidState(this.domElement):this._removeCSSClass(this.settings.invalidClass),this.validState||this._triggerEvent(s.events.correctedValue,this.domElement),this.validState=!0}},{key:"_setValidOrInvalidState",value:function(e){if(this.settings.overrideMinMaxLimits===s.options.overrideMinMaxLimits.invalid){var n=this.constructor._isMinimumRangeRespected(e,this.settings),o=this.constructor._isMaximumRangeRespected(e,this.settings);n&&o?this._setValidState():this._setInvalidState(),this._triggerRangeEvents(n,o)}}},{key:"_keepAnOriginalSettingsCopy",value:function(){this.originalDigitGroupSeparator=this.settings.digitGroupSeparator,this.originalCurrencySymbol=this.settings.currencySymbol,this.originalSuffixText=this.settings.suffixText}},{key:"_trimLeadingAndTrailingZeros",value:function(e){if(""===e||null===e)return e;if(this.settings.leadingZero!==s.options.leadingZero.keep){if(0===Number(e))return"0";e=e.replace(/^(-)?0+(?=\d)/g,"$1")}return i.contains(e,".")&&(e=e.replace(/(\.[0-9]*?)0+$/,"$1")),e.replace(/\.$/,"")}},{key:"_setPersistentStorageName",value:function(){this.settings.saveValueToSessionStorage&&(this.rawValueStorageName=""===this.domElement.name||i.isUndefined(this.domElement.name)?"".concat(this.storageNamePrefix).concat(this.domElement.id):"".concat(this.storageNamePrefix).concat(decodeURIComponent(this.domElement.name)))}},{key:"_saveValueToPersistentStorage",value:function(){this.settings.saveValueToSessionStorage&&(this.sessionStorageAvailable?sessionStorage.setItem(this.rawValueStorageName,this.rawValue):document.cookie="".concat(this.rawValueStorageName,"=").concat(this.rawValue,"; expires= ; path=/"))}},{key:"_getValueFromPersistentStorage",value:function(){return this.settings.saveValueToSessionStorage?this.sessionStorageAvailable?sessionStorage.getItem(this.rawValueStorageName):this.constructor._readCookie(this.rawValueStorageName):(i.warning("`_getValueFromPersistentStorage()` is called but `settings.saveValueToSessionStorage` is false. There must be an error that needs fixing.",this.settings.showWarnings),null)}},{key:"_removeValueFromPersistentStorage",value:function(){if(this.settings.saveValueToSessionStorage)if(this.sessionStorageAvailable)sessionStorage.removeItem(this.rawValueStorageName);else{var e=new Date;e.setTime(e.getTime()-864e5);var n="; expires=".concat(e.toUTCString());document.cookie="".concat(this.rawValueStorageName,"='' ;").concat(n,"; path=/")}}},{key:"_getDefaultValue",value:function(e){var n=e.getAttribute("value");return i.isNull(n)?"":n}},{key:"_onFocusInAndMouseEnter",value:function(e){if(this.isEditing=!1,!this.formulaMode&&this.settings.unformatOnHover&&"mouseenter"===e.type&&e.altKey)this.constructor._unformatAltHovered(this);else if("focus"===e.type&&(this.isFocused=!0,this.rawValueOnFocus=this.rawValue),"focus"===e.type&&this.settings.unformatOnHover&&this.hoveredWithAlt&&this.constructor._reformatAltHovered(this),"focus"===e.type||"mouseenter"===e.type&&!this.isFocused){var n=null;this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus&&this.rawValue<0&&null!==this.settings.negativeBracketsTypeOnBlur&&this.settings.isNegativeSignAllowed&&(n=this.constructor._removeBrackets(i.getElementValue(this.domElement),this.settings));var o=this._getRawValueToFormat(this.rawValue);if(""!==o){var m=this.constructor._roundFormattedValueShownOnFocusOrBlur(o,this.settings,this.isFocused);n=this.settings.showOnlyNumbersOnFocus===s.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",m.replace(".",this.settings.decimalCharacter)):i.isNull(m)?"":this.constructor._addGroupSeparators(m.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,o)}this.valueOnFocus=i.isNull(n)?"":n,this.lastVal=this.valueOnFocus;var v=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),u=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),C=v&&""!==u&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus;C&&(n=u),i.isNull(n)||this._setElementValue(n),C&&u===this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&i.setElementSelection(e.target,0)}}},{key:"_onFocus",value:function(){this.settings.isCancellable&&this._saveCancellableValue()}},{key:"_onFocusIn",value:function(e){this.settings.selectOnFocus?this.select():i.isNull(this.settings.caretPositionOnFocus)||i.setElementSelection(e.target,this._initialCaretPosition(i.getElementValue(this.domElement)))}},{key:"_enterFormulaMode",value:function(){this.settings.formulaMode&&(this.formulaMode=!0,i.setElementValue(this.domElement,"="),i.setElementSelection(this.domElement,1))}},{key:"_exitFormulaMode",value:function(){var e,n=i.getElementValue(this.domElement);n=n.replace(/^\s*=/,"");try{var o=new U(n,this.settings.decimalCharacter);e=(new p).evaluate(o)}catch{return this._triggerEvent(s.events.invalidFormula,this.domElement,{formula:n,aNElement:this}),this.reformat(),void(this.formulaMode=!1)}this._triggerEvent(s.events.validFormula,this.domElement,{formula:n,result:e,aNElement:this}),this.set(e),this.formulaMode=!1}},{key:"_acceptNonPrintableKeysInFormulaMode",value:function(){return this.eventKey===w.keyName.Backspace||this.eventKey===w.keyName.Delete||this.eventKey===w.keyName.LeftArrow||this.eventKey===w.keyName.RightArrow||this.eventKey===w.keyName.Home||this.eventKey===w.keyName.End}},{key:"_onKeydown",value:function(e){if(this.formatted=!1,this.isEditing=!0,this.formulaMode||this.isFocused||!this.settings.unformatOnHover||!e.altKey||this.domElement!==i.getHoveredElement()){if(this._updateEventKeyInfo(e),this.keydownEventCounter+=1,1===this.keydownEventCounter&&(this.initialValueOnFirstKeydown=i.getElementValue(e.target),this.initialRawValueOnFirstKeydown=this.rawValue),this.formulaMode){if(this.eventKey===w.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===w.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else if(this.eventKey===w.keyName.Equal)return void this._enterFormulaMode();if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===w.keyName.Esc&&(e.preventDefault(),this.settings.isCancellable&&this.rawValue!==this.savedCancellableValue&&(this.set(this.savedCancellableValue),this._triggerEvent(s.events.native.input,e.target)),this.select());var n=i.getElementValue(e.target);if(this.eventKey===w.keyName.Enter&&this.rawValue!==this.rawValueOnFocus&&(this._triggerEvent(s.events.native.change,e.target),this.valueOnFocus=n,this.rawValueOnFocus=this.rawValue,this.settings.isCancellable&&this._saveCancellableValue()),this._updateInternalProperties(e),this._processNonPrintableKeysAndShortcuts(e))this.processed=!0;else if(this.eventKey===w.keyName.Backspace||this.eventKey===w.keyName.Delete){var o=this._processCharacterDeletion();if(this.processed=!0,!o)return void e.preventDefault();this._formatValue(e),(n=i.getElementValue(e.target))!==this.lastVal&&this.throwInput&&(this._triggerEvent(s.events.native.input,e.target),e.preventDefault()),this.lastVal=n,this.throwInput=!0}}}else this.constructor._unformatAltHovered(this)}},{key:"_onKeypress",value:function(e){if(this.formulaMode){if(this._acceptNonPrintableKeysInFormulaMode()||this.settings.formulaChars.test(this.eventKey))return;e.preventDefault()}else if(this.eventKey!==w.keyName.Insert){var n=this.processed;if(this._updateInternalProperties(e),!this._processNonPrintableKeysAndShortcuts(e))if(n)e.preventDefault();else{if(this._processCharacterInsertion()){this._formatValue(e);var o=i.getElementValue(e.target);if(o!==this.lastVal&&this.throwInput)this._triggerEvent(s.events.native.input,e.target),e.preventDefault();else{if((this.eventKey===this.settings.decimalCharacter||this.eventKey===this.settings.decimalCharacterAlternative)&&i.getElementSelection(e.target).start===i.getElementSelection(e.target).end&&i.getElementSelection(e.target).start===o.indexOf(this.settings.decimalCharacter)){var m=i.getElementSelection(e.target).start+1;i.setElementSelection(e.target,m)}e.preventDefault()}return this.lastVal=i.getElementValue(e.target),this.throwInput=!0,void this._setValidOrInvalidState(this.rawValue)}e.preventDefault()}}}},{key:"_onKeyup",value:function(e){if(this.isEditing=!1,this.keydownEventCounter=0,!this.formulaMode)if(this.settings.isCancellable&&this.eventKey===w.keyName.Esc)e.preventDefault();else{if(this.eventKey===w.keyName.Z||this.eventKey===w.keyName.z){if(e.ctrlKey&&e.shiftKey)return e.preventDefault(),this._historyTableRedo(),void(this.onGoingRedo=!0);if(e.ctrlKey&&!e.shiftKey){if(!this.onGoingRedo)return e.preventDefault(),void this._historyTableUndo();this.onGoingRedo=!1}}if(this.onGoingRedo&&(e.ctrlKey||e.shiftKey)&&(this.onGoingRedo=!1),(e.ctrlKey||e.metaKey)&&this.eventKey===w.keyName.x){var n=i.getElementSelection(this.domElement).start,o=this.constructor._toNumericValue(i.getElementValue(e.target),this.settings);this.set(o),this._setCaretPosition(n)}if(this.eventKey===w.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!e.ctrlKey&&!e.metaKey||this.eventKey!==w.keyName.Backspace&&this.eventKey!==w.keyName.Delete){this._updateInternalProperties(e);var m=this._processNonPrintableKeysAndShortcuts(e);delete this.valuePartsBeforePaste;var v=i.getElementValue(e.target);if(!(m||""===v&&""===this.initialValueOnFirstKeydown)&&(v===this.settings.currencySymbol?i.setElementSelection(e.target,this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?0:this.settings.currencySymbol.length):this.eventKey===w.keyName.Tab&&i.setElementSelection(e.target,0,v.length),(v===this.settings.suffixText||""===this.rawValue&&""!==this.settings.currencySymbol&&""!==this.settings.suffixText)&&i.setElementSelection(e.target,0),null!==this.settings.decimalPlacesShownOnFocus&&this._saveValueToPersistentStorage(),this.formatted||this._formatValue(e),this._setValidOrInvalidState(this.rawValue),this._saveRawValueForAndroid(),v!==this.initialValueOnFirstKeydown&&this._triggerEvent(s.events.formatted,e.target,{oldValue:this.initialValueOnFirstKeydown,newValue:v,oldRawValue:this.initialRawValueOnFirstKeydown,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this}),1<this.historyTable.length)){var u=i.getElementSelection(this.domElement);this.selectionStart=u.start,this.selectionEnd=u.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var C=i.getElementValue(e.target);this._setRawValue(this._formatOrUnformatOther(!1,C))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===w.keyName.AndroidDefault){var e=this.constructor._stripAllNonNumberCharactersExceptCustomDecimalChar(this.getFormatted(),this.settings,!0,this.isFocused);e=this.constructor._convertToNumericString(e,this.settings),this._setRawValue(e)}}},{key:"_onFocusOutAndMouseLeave",value:function(e){if(this.isEditing=!1,"mouseleave"!==e.type||!this.formulaMode)if(this.settings.unformatOnHover&&"mouseleave"===e.type&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if("mouseleave"===e.type&&!this.isFocused||"blur"===e.type){"blur"===e.type&&this.formulaMode&&this._exitFormulaMode(),this._saveValueToPersistentStorage(),this.settings.showOnlyNumbersOnFocus===s.options.showOnlyNumbersOnFocus.onlyNumbers&&(this.settings.digitGroupSeparator=this.originalDigitGroupSeparator,this.settings.currencySymbol=this.originalCurrencySymbol,this.settings.suffixText=this.originalSuffixText);var n=this._getRawValueToFormat(this.rawValue),o=i.isNull(n),m=J(this.constructor._checkIfInRangeWithOverrideOption(n,this.settings),2),v=m[0],u=m[1],C=!1;if(""===n||o||(this._triggerRangeEvents(v,u),this.settings.valuesToStrings&&this._checkValuesToStrings(n)&&(this._setElementValue(this.settings.valuesToStrings[n]),C=!0)),!C){var V;if(V=o||""===n?n:String(n),""===n||o){if(""===n)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:this._setRawValue("0"),V=this.constructor._roundValue("0",this.settings,0);break;case s.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),V=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case s.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),V=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:i.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),V=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else v&&u&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(n,this.settings)?(V=this._modifyNegativeSignAndDecimalCharacterForRawValue(V),this.settings.divisorWhenUnfocused&&!i.isNull(V)&&(V=(V/=this.settings.divisorWhenUnfocused).toString()),V=this.constructor._roundFormattedValueShownOnBlur(V,this.settings),V=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(V,this.settings)):this._triggerRangeEvents(v,u);var Z=this.constructor._orderValueCurrencySymbolAndSuffixText(V,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(V,this.settings)||o&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.null||(Z=this.constructor._addGroupSeparators(V,this.settings,!1,n)),Z===n&&""!==n&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.never&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.floats||(this.settings.symbolWhenUnfocused&&""!==n&&null!==n&&(Z="".concat(Z).concat(this.settings.symbolWhenUnfocused)),this._setElementValue(Z))}this._setValidOrInvalidState(this.rawValue),"blur"===e.type&&this._onBlur(e)}}},{key:"_onPaste",value:function(e){if(e.preventDefault(),!(this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var n,o;window.clipboardData&&window.clipboardData.getData?n=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?n=e.clipboardData.getData("text/plain"):i.throwError("Unable to retrieve the pasted value. Please use a modern browser (ie. Firefox or Chromium).");var m=i.getElementValue(o=e.target.tagName?e.target:e.explicitOriginalTarget),v=o.selectionStart||0,u=o.selectionEnd||0,C=u-v;if(C===m.length){var V=this._preparePastedText(n),Z=i.arabicToLatinNumbers(V,!1,!1,!1);return"."===Z||""===Z||"."!==Z&&!i.isNumber(Z)?(this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&i.throwError("The pasted value '".concat(n,"' is not a valid paste content.")))):(this.set(Z),this.formatted=!0,void this._triggerEvent(s.events.native.input,o))}var y=i.isNegativeStrict(n,this.settings.negativeSignCharacter);y&&(n=n.slice(1,n.length));var L,D,B=this._preparePastedText(n);if("."!==(L="."===B?".":i.arabicToLatinNumbers(B,!1,!1,!1))&&(!i.isNumber(L)||""===L))return this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&i.throwError("The pasted value '".concat(n,"' is not a valid paste content.")));var z,q,Y=i.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);z=!(!y||Y)&&(Y=!0);var oe=m.slice(0,v),ue=m.slice(u,m.length);q=this._preparePastedText(v!==u?oe+ue:m),Y&&(q=i.setRawNegativeSign(q)),D=i.convertCharacterCountToIndexPosition(i.countNumberCharactersOnTheCaretLeftSide(m,v,this.settings.decimalCharacter)),z&&D++;var se=q.slice(0,D),Oe=q.slice(D,q.length),Le=!1;"."===L&&(i.contains(se,".")&&(Le=!0,se=se.replace(".","")),Oe=Oe.replace(".",""));var je=!1;switch(""===se&&"-"===Oe&&(se="-",je=!(Oe="")),this.settings.onInvalidPaste){case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:for(var Ke=i.parseStr(this.settings.minimumValue),he=i.parseStr(this.settings.maximumValue),pe=q,Te=0,Ye=se;Te<L.length&&(q=(Ye+=L[Te])+Oe,this.constructor._checkIfInRange(q,Ke,he));)pe=q,Te++;if(D+=Te,je&&D++,this.settings.onInvalidPaste===s.options.onInvalidPaste.truncate){q=pe,Le&&D--;break}for(var Ae=D,Xe=pe.length;Te<L.length&&Ae<Xe;)if("."!==pe[Ae]){if(q=i.replaceCharAt(pe,Ae,L[Te]),!this.constructor._checkIfInRange(q,Ke,he))break;pe=q,Te++,Ae++}else Ae++;D=Ae,Le&&D--,q=pe;break;default:if(q="".concat(se).concat(L).concat(Oe),v===u)D=i.convertCharacterCountToIndexPosition(i.countNumberCharactersOnTheCaretLeftSide(m,v,this.settings.decimalCharacter))+L.length;else if(""===Oe)D=i.convertCharacterCountToIndexPosition(i.countNumberCharactersOnTheCaretLeftSide(m,v,this.settings.decimalCharacter))+L.length,je&&D++;else{var Ve=i.convertCharacterCountToIndexPosition(i.countNumberCharactersOnTheCaretLeftSide(m,u,this.settings.decimalCharacter)),et=i.getElementValue(o).slice(v,u);D=Ve-C+i.countCharInText(this.settings.digitGroupSeparator,et)+L.length}z&&D++,Le&&D--}if(i.isNumber(q)&&""!==q){var Re=!1,Qe=!1;try{this.set(q),Re=!0}catch{var Be;switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:Be=i.clampToRangeLimits(q,this.settings);try{this.set(Be)}catch{i.throwError("Fatal error: Unable to set the clamped value '".concat(Be,"'."))}Re=Qe=!0,q=Be;break;case s.options.onInvalidPaste.error:case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:i.throwError("The pasted value '".concat(n,"' results in a value '").concat(q,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));default:return}}var $e,Ue=i.getElementValue(o);if(Re)switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:if(Qe){i.setElementSelection(o,this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?Ue.length-this.settings.currencySymbol.length:Ue.length);break}default:$e=i.findCaretPositionInFormattedNumber(q,D,Ue,this.settings.decimalCharacter),i.setElementSelection(o,$e)}Re&&m!==Ue&&this._triggerEvent(s.events.native.input,o)}else this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&i.throwError("The pasted value '".concat(n,"' would result into an invalid content '").concat(q,"'."))}}},{key:"_onBlur",value:function(e){this.isFocused=!1,this.isEditing=!1,this.rawValue!==this.rawValueOnFocus&&this._triggerEvent(s.events.native.change,e.target),this.rawValueOnFocus=void 0}},{key:"_onWheel",value:function(e){this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled||this.settings.modifyValueOnWheel&&(this.settings.wheelOn===s.options.wheelOn.focus?this.isFocused?e.shiftKey||this.wheelAction(e):e.shiftKey&&this.wheelAction(e):this.settings.wheelOn===s.options.wheelOn.hover?e.shiftKey?(e.preventDefault(),window.scrollBy(0,i.isNegativeStrict(String(e.deltaY))?-50:50)):this.wheelAction(e):i.throwError("Unknown `wheelOn` option."))}},{key:"wheelAction",value:function(e){this.isWheelEvent=!0;var n,o=e.target.selectionStart||0,m=e.target.selectionEnd||0,v=this.rawValue;if(i.isUndefinedOrNullOrEmpty(v)?0<this.settings.minimumValue||this.settings.maximumValue<0?i.isWheelUpEvent(e)?n=this.settings.minimumValue:i.isWheelDownEvent(e)?n=this.settings.maximumValue:i.throwError("The event is not a 'wheel' event."):n=0:n=v,n=+n,i.isNumber(this.settings.wheelStep)){var u=+this.settings.wheelStep;i.isWheelUpEvent(e)?n+=u:i.isWheelDownEvent(e)&&(n-=u)}else i.isWheelUpEvent(e)?n=i.addAndRoundToNearestAuto(n,this.settings.decimalPlacesRawValue):i.isWheelDownEvent(e)&&(n=i.subtractAndRoundToNearestAuto(n,this.settings.decimalPlacesRawValue));(n=i.clampToRangeLimits(n,this.settings))!==+v&&(this.set(n),this._triggerEvent(s.events.native.input,e.target)),e.preventDefault(),this._setSelection(o,m),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){var n;this.isDropEvent=!0,e.preventDefault(),n=i.isIE11()?"text":"text/plain";var o=e.dataTransfer.getData(n),m=this.unformatOther(o);this.set(m),this.isDropEvent=!1}}},{key:"_onFormSubmit",value:function(){var e=this;return this._getFormAutoNumericChildren(this.parentForm).map(function(n){return e.constructor.getAutoNumericElement(n)}).forEach(function(n){return n._unformatOnSubmit()}),!0}},{key:"_onFormReset",value:function(){var e=this;this._getFormAutoNumericChildren(this.parentForm).map(function(n){return e.constructor.getAutoNumericElement(n)}).forEach(function(n){var o=e._getDefaultValue(n.node());setTimeout(function(){return n.set(o)},0)})}},{key:"_unformatOnSubmit",value:function(){this.settings.unformatOnSubmit&&this._setElementValue(this.rawValue)}},{key:"_onKeydownGlobal",value:function(e){if(i.character(e)===w.keyName.Alt){var n=i.getHoveredElement();if(s.isManagedByAutoNumeric(n)){var o=s.getAutoNumericElement(n);!o.formulaMode&&o.settings.unformatOnHover&&this.constructor._unformatAltHovered(o)}}}},{key:"_onKeyupGlobal",value:function(e){if(i.character(e)===w.keyName.Alt){var n=i.getHoveredElement();if(s.isManagedByAutoNumeric(n)){var o=s.getAutoNumericElement(n);if(o.formulaMode||!o.settings.unformatOnHover)return;this.constructor._reformatAltHovered(o)}}}},{key:"_isElementTagSupported",value:function(){return i.isElement(this.domElement)||i.throwError("The DOM element is not valid, ".concat(this.domElement," given.")),i.isInArray(this.domElement.tagName.toLowerCase(),this.allowedTagList)}},{key:"_isInputElement",value:function(){return"input"===this.domElement.tagName.toLowerCase()}},{key:"_isInputTypeSupported",value:function(){return"text"===this.domElement.type||"hidden"===this.domElement.type||"tel"===this.domElement.type||i.isUndefinedOrNullOrEmpty(this.domElement.type)}},{key:"_checkElement",value:function(){var e=this.domElement.tagName.toLowerCase();this._isElementTagSupported()||i.throwError("The <".concat(e,"> tag is not supported by autoNumeric")),this._isInputElement()?(this._isInputTypeSupported()||i.throwError('The input type "'.concat(this.domElement.type,'" is not supported by autoNumeric')),this.isInputElement=!0):(this.isInputElement=!1,this.isContentEditable=this.domElement.hasAttribute("contenteditable")&&"true"===this.domElement.getAttribute("contenteditable"))}},{key:"_formatDefaultValueOnPageLoad",value:function(e){var n,o=0<arguments.length&&void 0!==e?e:null,m=!0;if(i.isNull(o)?(n=i.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",n)):n=o,this.isInputElement||this.isContentEditable){var v=this.constructor._toNumericValue(n,this.settings);if(this.domElement.hasAttribute("value")&&""!==this.domElement.getAttribute("value")){if(null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride.toString()!==n||null===this.settings.defaultValueOverride&&""!==n&&n!==this.domElement.getAttribute("value")||""!==n&&"hidden"===this.domElement.getAttribute("type")&&!i.isNumber(v)){if(this.settings.saveValueToSessionStorage&&(null!==this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var u=this.constructor._removeBrackets(n,this.settings);(this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)&&""!==this.settings.negativeSignCharacter&&i.isNegative(n,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(u,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(u,this.settings,!0,this.isFocused))}m=!1}}else isNaN(Number(v))||1/0===v?i.throwError("The value [".concat(n,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(v),m=!1);if(""===n)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.null:case s.options.emptyInputBehavior.press:break;case s.options.emptyInputBehavior.always:this._setElementValue(this.settings.currencySymbol);break;case s.options.emptyInputBehavior.min:this.set(this.settings.minimumValue);break;case s.options.emptyInputBehavior.max:this.set(this.settings.maximumValue);break;case s.options.emptyInputBehavior.zero:this.set("0");break;default:this.set(this.settings.emptyInputBehavior)}else m&&n===this.domElement.getAttribute("value")&&this.set(n)}else null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride!==n||this.set(n)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=J(this.settings.maximumValue.toString().split("."),1)[0],n=J(this.settings.minimumValue||0===this.settings.minimumValue?this.settings.minimumValue.toString().split("."):[],1)[0];e=e.replace(this.settings.negativeSignCharacter,""),n=n.replace(this.settings.negativeSignCharacter,""),this.settings.mIntPos=Math.max(e.length,1),this.settings.mIntNeg=Math.max(n.length,1)}},{key:"_calculateValuesToStringsKeys",value:function(){this.valuesToStringsKeys=this.settings.valuesToStrings?Object.keys(this.settings.valuesToStrings):[]}},{key:"_transformOptionsValuesToDefaultTypes",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var n=this.settings[e];"true"!==n&&"false"!==n||(this.settings[e]="true"===n),"number"==typeof n&&(this.settings[e]=n.toString())}}},{key:"_setSettings",value:function(e,n){var o=1<arguments.length&&void 0!==n&&n;!o&&i.isNull(e)||this.constructor._convertOldOptionsToNewOnes(e),o?("decimalPlacesRawValue"in e&&(this.settings.originalDecimalPlacesRawValue=e.decimalPlacesRawValue),"decimalPlaces"in e&&(this.settings.originalDecimalPlaces=e.decimalPlaces),this.constructor._calculateDecimalPlacesOnUpdate(e,this.settings),this._mergeSettings(e)):(this.settings={},this._mergeSettings(this.constructor.getDefaultConfig(),this.domElement.dataset,e,{rawValue:this.defaultRawValue}),this.caretFix=!1,this.throwInput=!0,this.allowedTagList=w.allowedTagList,this.runOnce=!1,this.hoveredWithAlt=!1),this._transformOptionsValuesToDefaultTypes(),this._runCallbacksFoundInTheSettingsObject(),this.constructor._correctNegativePositiveSignPlacementOption(this.settings),this.constructor._correctCaretPositionOnFocusAndSelectOnFocusOptions(this.settings),this.constructor._setNegativePositiveSignPermissions(this.settings),o||(this.settings.originalDecimalPlaces=i.isNull(e)||!e.decimalPlaces?null:e.decimalPlaces,this.settings.originalDecimalPlacesRawValue=this.settings.decimalPlacesRawValue,this.constructor._calculateDecimalPlacesOnInit(this.settings)),this._calculateVMinAndVMaxIntegerSizes(),this._setTrailingNegativeSignInfo(),this.regex={},this.constructor._cachesUsualRegularExpressions(this.settings,this.regex),this.constructor._setBrackets(this.settings),this._calculateValuesToStringsKeys(),i.isEmptyObj(this.settings)&&i.throwError("Unable to set the settings, those are invalid ; an empty object was given."),this.constructor.validate(this.settings,!1,e),this._keepAnOriginalSettingsCopy()}},{key:"_preparePastedText",value:function(e){return this.constructor._stripAllNonNumberCharacters(e,this.settings,!0,this.isFocused)}},{key:"_updateInternalProperties",value:function(){this.selection=i.getElementSelection(this.domElement),this.processed=!1}},{key:"_updateEventKeyInfo",value:function(e){this.eventKey=i.character(e)}},{key:"_saveCancellableValue",value:function(){this.savedCancellableValue=this.rawValue}},{key:"_setSelection",value:function(e,n){e=Math.max(e,0),n=Math.min(n,i.getElementValue(this.domElement).length),this.selection={start:e,end:n,length:n-e},i.setElementSelection(this.domElement,e,n)}},{key:"_setCaretPosition",value:function(e){this._setSelection(e,e)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=i.getElementValue(this.domElement);return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=J(this._getLeftAndRightPartAroundTheSelection(),2),n=e[0],o=e[1];if(""===n&&""===o)return["",""];var m=!0;return this.eventKey!==w.keyName.Hyphen&&this.eventKey!==w.keyName.Minus||0!==Number(n)||(m=!1),this.isTrailingNegative&&(i.isNegative(o,this.settings.negativeSignCharacter)&&!i.isNegative(n,this.settings.negativeSignCharacter)||""===o&&i.isNegative(n,this.settings.negativeSignCharacter,!0))&&(n=n.replace(this.settings.negativeSignCharacter,""),o=o.replace(this.settings.negativeSignCharacter,""),n=n.replace("-",""),o=o.replace("-",""),n="-".concat(n)),[n=s._stripAllNonNumberCharactersExceptCustomDecimalChar(n,this.settings,m,this.isFocused),o=s._stripAllNonNumberCharactersExceptCustomDecimalChar(o,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(e,n){var o=!0;this.eventKey!==w.keyName.Hyphen&&this.eventKey!==w.keyName.Minus||0!==Number(e)||(o=!1),this.isTrailingNegative&&i.isNegative(n,this.settings.negativeSignCharacter)&&!i.isNegative(e,this.settings.negativeSignCharacter)&&(e="-".concat(e),n=n.replace(this.settings.negativeSignCharacter,"")),e=s._stripAllNonNumberCharactersExceptCustomDecimalChar(e,this.settings,o,this.isFocused),n=s._stripAllNonNumberCharactersExceptCustomDecimalChar(n,this.settings,!1,this.isFocused),this.settings.leadingZero!==s.options.leadingZero.deny||this.eventKey!==w.keyName.num0&&this.eventKey!==w.keyName.numpad0||0!==Number(e)||i.contains(e,this.settings.decimalCharacter)||""===n||(e=e.substring(0,e.length-1));var m=e+n;if(this.settings.decimalCharacter){var v=m.match(new RegExp("^".concat(this.regex.aNegRegAutoStrip,"\\").concat(this.settings.decimalCharacter)));v&&(m=(e=e.replace(v[1],v[1]+"0"))+n)}return[e,n,m]}},{key:"_setValueParts",value:function(e,n,o){var m=2<arguments.length&&void 0!==o&&o,v=J(this._normalizeParts(e,n),3),u=v[0],C=v[1],V=v[2],Z=J(s._checkIfInRangeWithOverrideOption(V,this.settings),2),y=Z[0],L=Z[1];if(y&&L){var D=s._truncateDecimalPlaces(V,this.settings,m,this.settings.decimalPlacesRawValue).replace(this.settings.decimalCharacter,".");if(""===D||D===this.settings.negativeSignCharacter){var B;switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:B="";break;case s.options.emptyInputBehavior.min:B=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:B=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:B="0";break;case s.options.emptyInputBehavior.null:B=null;break;default:B=this.settings.emptyInputBehavior}this._setRawValue(B)}else this._setRawValue(this._trimLeadingAndTrailingZeros(D));var z=s._truncateDecimalPlaces(V,this.settings,m,this.settings.decimalPlacesShownOnFocus),q=u.length;return q>z.length&&(q=z.length),1===q&&"0"===u&&this.settings.leadingZero===s.options.leadingZero.deny&&(q=""===C||"0"===u&&""!==C?1:0),this._setElementValue(z,!1),this._setCaretPosition(q),!0}return this._triggerRangeEvents(y,L),!1}},{key:"_getSignPosition",value:function(){var e;if(this.settings.currencySymbol){var n=this.settings.currencySymbol.length,o=i.getElementValue(this.domElement);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)e=this.settings.negativeSignCharacter&&o&&o.charAt(0)===this.settings.negativeSignCharacter?[1,n+1]:[0,n];else{var m=o.length;e=[m-n,m]}}else e=[1e3,-1];return e}},{key:"_expandSelectionOnSign",value:function(){var e=J(this._getSignPosition(),2),n=e[0],o=e[1],m=this.selection;m.start<o&&m.end>n&&((m.start<n||m.end>o)&&i.getElementValue(this.domElement).substring(Math.max(m.start,n),Math.min(m.end,o)).match(/^\s*$/)?m.start<n?this._setSelection(m.start,n):this._setSelection(o,m.end):this._setSelection(Math.min(m.start,n),Math.max(m.end,o)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!i.isUndefined(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,n=J(this._getLeftAndRightPartAroundTheSelection(),2),o=n[0],m=n[1];delete this.valuePartsBeforePaste;var v=o.substr(0,e[0].length)+s._stripAllNonNumberCharactersExceptCustomDecimalChar(o.substr(e[0].length),this.settings,!0,this.isFocused);this._setValueParts(v,m,!0)||(this._setElementValue(e.join(""),!1),this._setCaretPosition(e[0].length))}}},{key:"_processNonPrintableKeysAndShortcuts",value:function(e){if((e.ctrlKey||e.metaKey)&&"keyup"===e.type&&!i.isUndefined(this.valuePartsBeforePaste)||e.shiftKey&&this.eventKey===w.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===w.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===w.keyName.c||this.eventKey===w.keyName.v||this.eventKey===w.keyName.x))return"keydown"===e.type&&this._expandSelectionOnSign(),this.eventKey!==w.keyName.v&&this.eventKey!==w.keyName.Insert||("keydown"===e.type||"keypress"===e.type?i.isUndefined(this.valuePartsBeforePaste)&&(this.valuePartsBeforePaste=this._getLeftAndRightPartAroundTheSelection()):this._checkPaste()),"keydown"===e.type||"keypress"===e.type||this.eventKey===w.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===w.keyName.Z||this.eventKey===w.keyName.z);if(this.eventKey!==w.keyName.LeftArrow&&this.eventKey!==w.keyName.RightArrow)return i.isInArray(this.eventKey,w.keyName._directionKeys);if("keydown"===e.type&&!e.shiftKey){var n=i.getElementValue(this.domElement);this.eventKey!==w.keyName.LeftArrow||n.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&n.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==w.keyName.RightArrow||n.charAt(this.selection.start+1)!==this.settings.digitGroupSeparator&&n.charAt(this.selection.start+1)!==this.settings.decimalCharacter||this._setCaretPosition(this.selection.start+1):this._setCaretPosition(this.selection.start-1)}return!0}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var n=J(e,2),o=n[0],m=n[1],v=i.getElementValue(this.domElement),u=i.isNegative(v,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix&&(this.eventKey===w.keyName.Backspace?(this.caretFix=this.selection.start>=v.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,"-"===v.charAt(this.selection.start-1)?o=o.substring(1):this.selection.start<=v.length-this.settings.suffixText.length&&(o=o.substring(0,o.length-1))):(this.caretFix=this.selection.start>=v.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,this.selection.start>=v.indexOf(this.settings.currencySymbol)+this.settings.currencySymbol.length&&(m=m.substring(1,m.length)),i.isNegative(o,this.settings.negativeSignCharacter)&&"-"===v.charAt(this.selection.start)&&(o=o.substring(1)))),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:this.caretFix=this.selection.start>=v.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===w.keyName.Backspace?this.selection.start===v.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&u?o=o.substring(1):"-"!==o&&(this.selection.start<=v.indexOf(this.settings.negativeSignCharacter)||!u)&&(o=o.substring(0,o.length-1)):("-"===o[0]&&(m=m.substring(1)),this.selection.start===v.indexOf(this.settings.negativeSignCharacter)&&u&&(o=o.substring(1)));break;case s.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=v.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===w.keyName.Backspace?this.selection.start===v.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?o=o.substring(1):("-"!==o&&this.selection.start<=v.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length||""!==o&&!u)&&(o=o.substring(0,o.length-1)):(this.caretFix=this.selection.start>=v.indexOf(this.settings.currencySymbol)&&""!==this.settings.currencySymbol,this.selection.start===v.indexOf(this.settings.negativeSignCharacter)&&(o=o.substring(1)),m=m.substring(1))}return[o,m]}},{key:"_processCharacterDeletion",value:function(){var e,n;if(this.selection.length){this._expandSelectionOnSign();var o=J(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);e=o[0],n=o[1]}else{var m=J(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(n=m[1],""===(e=m[0])&&""===n&&(this.throwInput=!1),this.isTrailingNegative&&i.isNegative(i.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var v=J(this._processCharacterDeletionIfTrailingNegativeSign([e,n]),2);e=v[0],n=v[1]}else this.eventKey===w.keyName.Backspace?e=e.substring(0,e.length-1):n=n.substring(1,n.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(e).concat(n),this.settings)&&(this._setValueParts(e,n),!0)}},{key:"_isDecimalCharacterInsertionAllowed",value:function(){return String(this.settings.decimalPlacesShownOnFocus)!==String(s.options.decimalPlacesShownOnFocus.none)&&String(this.settings.decimalPlaces)!==String(s.options.decimalPlaces.none)}},{key:"_processCharacterInsertion",value:function(){var e=J(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),n=e[0],o=e[1];if(this.eventKey!==w.keyName.AndroidDefault&&(this.throwInput=!0),this.eventKey===this.settings.decimalCharacter||this.settings.decimalCharacterAlternative&&this.eventKey===this.settings.decimalCharacterAlternative){if(!this._isDecimalCharacterInsertionAllowed()||!this.settings.decimalCharacter)return!1;if(this.settings.alwaysAllowDecimalCharacter)n=n.replace(this.settings.decimalCharacter,""),o=o.replace(this.settings.decimalCharacter,"");else{if(i.contains(n,this.settings.decimalCharacter)||0<o.indexOf(this.settings.decimalCharacter))return!0;0===o.indexOf(this.settings.decimalCharacter)&&(o=o.substr(1))}return this.settings.negativeSignCharacter&&i.contains(o,this.settings.negativeSignCharacter)&&(n="".concat(this.settings.negativeSignCharacter).concat(n),o=o.replace(this.settings.negativeSignCharacter,"")),this._setValueParts(n+this.settings.decimalCharacter,o),!0}if(("-"===this.eventKey||"+"===this.eventKey)&&this.settings.isNegativeSignAllowed)return""===n&&i.contains(o,"-")?o=o.replace("-",""):n=i.isNegativeStrict(n,"-")?n.replace("-",""):"".concat(this.settings.negativeSignCharacter).concat(n),this._setValueParts(n,o),!0;var m=Number(this.eventKey);return 0<=m&&m<=9?(this.settings.isNegativeSignAllowed&&""===n&&i.contains(o,"-")&&(n="-",o=o.substring(1,o.length)),this.settings.maximumValue<=0&&this.settings.minimumValue<this.settings.maximumValue&&!i.contains(i.getElementValue(this.domElement),this.settings.negativeSignCharacter)&&"0"!==this.eventKey&&(n="-".concat(n)),this._setValueParts("".concat(n).concat(this.eventKey),o),!0):this.throwInput=!1}},{key:"_formatValue",value:function(e){var n=i.getElementValue(this.domElement),o=J(this._getUnformattedLeftAndRightPartAroundTheSelection(),1)[0];if((""===this.settings.digitGroupSeparator||""!==this.settings.digitGroupSeparator&&!i.contains(n,this.settings.digitGroupSeparator))&&(""===this.settings.currencySymbol||""!==this.settings.currencySymbol&&!i.contains(n,this.settings.currencySymbol))){var m=J(n.split(this.settings.decimalCharacter),1)[0],v="";i.isNegative(m,this.settings.negativeSignCharacter)&&(v=this.settings.negativeSignCharacter,m=m.replace(this.settings.negativeSignCharacter,""),o=o.replace("-","")),""===v&&m.length>this.settings.mIntPos&&"0"===o.charAt(0)&&(o=o.slice(1)),v===this.settings.negativeSignCharacter&&m.length>this.settings.mIntNeg&&"0"===o.charAt(0)&&(o=o.slice(1)),this.isTrailingNegative||(o="".concat(v).concat(o))}var u=this.constructor._addGroupSeparators(n,this.settings,this.isFocused,this.rawValue),C=u.length;if(u){var V,Z=o.split("");if((this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)&&Z[0]===this.settings.negativeSignCharacter&&!this.settings.isNegativeSignAllowed&&(Z.shift(),(this.eventKey===w.keyName.Backspace||this.eventKey===w.keyName.Delete)&&this.caretFix&&((this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left||this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix)&&(Z.push(this.settings.negativeSignCharacter),this.caretFix="keydown"===e.type),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.right))){var y=this.settings.currencySymbol.split(""),L=["\\","^","$",".","|","?","*","+","(",")","["],D=[];y.forEach(function(q,Y){i.isInArray(Y=y[q],L)?D.push("\\"+Y):D.push(Y)}),this.eventKey===w.keyName.Backspace&&"-"===this.settings.negativeSignCharacter&&D.push("-"),Z.push(D.join("")),this.caretFix="keydown"===e.type}for(var B=0;B<Z.length;B++)Z[B].match("\\d")||(Z[B]="\\"+Z[B]);V=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(Z.join(".*?"))):new RegExp("^.*?".concat(this.settings.currencySymbol).concat(Z.join(".*?")));var z=u.match(V);z?(C=z[0].length,this.settings.showPositiveSign&&(0===C&&z.input.charAt(0)===this.settings.positiveSignCharacter&&(C=1===z.input.indexOf(this.settings.currencySymbol)?this.settings.currencySymbol.length+1:1),0===C&&z.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(C=this.settings.currencySymbol.length+1)),(0===C&&u.charAt(0)!==this.settings.negativeSignCharacter||1===C&&u.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(C=this.settings.currencySymbol.length+(i.isNegativeStrict(u,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(C-=this.settings.currencySymbol.length),this.settings.suffixText&&(C-=this.settings.suffixText.length))}u!==n&&(this._setElementValue(u,!1),this._setCaretPosition(C)),this.formatted=!0}}]),Ne(d,f),s}();function X(s,d){d=d||{bubbles:!1,cancelable:!1,detail:void 0};var f=document.createEvent("CustomEvent");return f.initCustomEvent(s,d.bubbles,d.cancelable,d.detail),f}T.multiple=function(s){var d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,f=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,e=[];if(i.isObject(d)&&(f=d,d=null),i.isString(s))s=j(document.querySelectorAll(s));else if(i.isObject(s)){Object.prototype.hasOwnProperty.call(s,"rootElement")||i.throwError("The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.");var n=j(s.rootElement.querySelectorAll("input"));s=Object.prototype.hasOwnProperty.call(s,"exclude")?(Array.isArray(s.exclude)||i.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),i.filterOut(n,s.exclude)):n}else i.isArray(s)||i.throwError("The given parameters to the 'multiple' function are invalid.");if(0===s.length){var o=!0;return!i.isNull(f)&&i.isBoolean(f.showWarnings)&&(o=f.showWarnings),i.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",o),[]}var m=i.isArray(d)&&1<=d.length,v=!1,u=!1;if(m){var C=de(Number(d[0]));(v="number"===C&&!isNaN(Number(d[0])))||"string"!==C&&!isNaN(C)&&"object"!==C||(u=!0)}var V,Z=!1;if(i.isArray(f)&&1<=f.length){var y=de(f[0]);"string"!==y&&"object"!==y||(Z=!0)}V=u?T.mergeOptions(d):Z?T.mergeOptions(f):f;var L,D=i.isNumber(d);return v&&(L=d.length),s.forEach(function(B,z){e.push(new T(B,D?d:v&&z<=L?d[z]:null,V))}),e},Array.from||(Array.from=function(s){return[].slice.call(s)}),typeof window<"u"&&"function"!=typeof window.CustomEvent&&(X.prototype=window.Event.prototype,window.CustomEvent=X),T.events={correctedValue:"autoNumeric:correctedValue",initialized:"autoNumeric:initialized",invalidFormula:"autoNumeric:invalidFormula",invalidValue:"autoNumeric:invalidValue",formatted:"autoNumeric:formatted",rawValueModified:"autoNumeric:rawValueModified",minRangeExceeded:"autoNumeric:minExceeded",maxRangeExceeded:"autoNumeric:maxExceeded",native:{input:"input",change:"change"},validFormula:"autoNumeric:validFormula"},Object.freeze(T.events.native),Object.freeze(T.events),Object.defineProperty(T,"events",{configurable:!1,writable:!1}),T.options={allowDecimalPadding:{always:!0,never:!1,floats:"floats"},alwaysAllowDecimalCharacter:{alwaysAllow:!0,doNotAllow:!1},caretPositionOnFocus:{start:"start",end:"end",decimalLeft:"decimalLeft",decimalRight:"decimalRight",doNoForceCaretPosition:null},createLocalList:{createList:!0,doNotCreateList:!1},currencySymbol:{none:"",currencySign:"\xa4",austral:"\u20b3",australCentavo:"\xa2",baht:"\u0e3f",cedi:"\u20b5",cent:"\xa2",colon:"\u20a1",cruzeiro:"\u20a2",dollar:"$",dong:"\u20ab",drachma:"\u20af",dram:"\u200b\u058f",european:"\u20a0",euro:"\u20ac",florin:"\u0192",franc:"\u20a3",guarani:"\u20b2",hryvnia:"\u20b4",kip:"\u20ad",att:"\u0ead\u0eb1\u0e94",lepton:"\u039b.",lira:"\u20ba",liraOld:"\u20a4",lari:"\u20be",mark:"\u2133",mill:"\u20a5",naira:"\u20a6",peseta:"\u20a7",peso:"\u20b1",pfennig:"\u20b0",pound:"\xa3",real:"R$",riel:"\u17db",ruble:"\u20bd",rupee:"\u20b9",rupeeOld:"\u20a8",shekel:"\u20aa",shekelAlt:"\u05e9\u05f4\u05d7\u200e\u200e",taka:"\u09f3",tenge:"\u20b8",togrog:"\u20ae",won:"\u20a9",yen:"\xa5"},currencySymbolPlacement:{prefix:"p",suffix:"s"},decimalCharacter:{comma:",",dot:".",middleDot:"\xb7",arabicDecimalSeparator:"\u066b",decimalSeparatorKeySymbol:"\u2396"},decimalCharacterAlternative:{none:null,comma:",",dot:"."},decimalPlaces:{none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesRawValue:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnBlur:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnFocus:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},defaultValueOverride:{doNotOverride:null},digitalGroupSpacing:{two:"2",twoScaled:"2s",three:"3",four:"4"},digitGroupSeparator:{comma:",",dot:".",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0",noSeparator:"",apostrophe:"'",arabicThousandsSeparator:"\u066c",dotAbove:"\u02d9",privateUseTwo:"\u2019"},divisorWhenUnfocused:{none:null,percentage:100,permille:1e3,basisPoint:1e4},emptyInputBehavior:{focus:"focus",press:"press",always:"always",zero:"zero",min:"min",max:"max",null:"null"},eventBubbles:{bubbles:!0,doesNotBubble:!1},eventIsCancelable:{isCancelable:!0,isNotCancelable:!1},failOnUnknownOption:{fail:!0,ignore:!1},formatOnPageLoad:{format:!0,doNotFormat:!1},formulaMode:{enabled:!0,disabled:!1},historySize:{verySmall:5,small:10,medium:20,large:50,veryLarge:100,insane:Number.MAX_SAFE_INTEGER},invalidClass:"an-invalid",isCancellable:{cancellable:!0,notCancellable:!1},leadingZero:{allow:"allow",deny:"deny",keep:"keep"},maximumValue:{tenTrillions:"10000000000000",oneBillion:"1000000000",zero:"0"},minimumValue:{tenTrillions:"-10000000000000",oneBillion:"-1000000000",zero:"0"},modifyValueOnWheel:{modifyValue:!0,doNothing:!1},negativeBracketsTypeOnBlur:{parentheses:"(,)",brackets:"[,]",chevrons:"<,>",curlyBraces:"{,}",angleBrackets:"\u3008,\u3009",japaneseQuotationMarks:"\uff62,\uff63",halfBrackets:"\u2e24,\u2e25",whiteSquareBrackets:"\u27e6,\u27e7",quotationMarks:"\u2039,\u203a",guillemets:"\xab,\xbb",none:null},negativePositiveSignPlacement:{prefix:"p",suffix:"s",left:"l",right:"r",none:null},negativeSignCharacter:{hyphen:"-",minus:"\u2212",heavyMinus:"\u2796",fullWidthHyphen:"\uff0d",circledMinus:"\u2296",squaredMinus:"\u229f",triangleMinus:"\u2a3a",plusMinus:"\xb1",minusPlus:"\u2213",dotMinus:"\u2238",minusTilde:"\u2242",not:"\xac"},noEventListeners:{noEvents:!0,addEvents:!1},onInvalidPaste:{error:"error",ignore:"ignore",clamp:"clamp",truncate:"truncate",replace:"replace"},outputFormat:{string:"string",number:"number",dot:".",negativeDot:"-.",comma:",",negativeComma:"-,",dotNegative:".-",commaNegative:",-",none:null},overrideMinMaxLimits:{ceiling:"ceiling",floor:"floor",ignore:"ignore",invalid:"invalid",doNotOverride:null},positiveSignCharacter:{plus:"+",fullWidthPlus:"\uff0b",heavyPlus:"\u2795",doublePlus:"\u29fa",triplePlus:"\u29fb",circledPlus:"\u2295",squaredPlus:"\u229e",trianglePlus:"\u2a39",plusMinus:"\xb1",minusPlus:"\u2213",dotPlus:"\u2214",altHebrewPlus:"\ufb29",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202f",noBreakSpace:"\xa0"},rawValueDivisor:{none:null,percentage:100,permille:1e3,basisPoint:1e4},readOnly:{readOnly:!0,readWrite:!1},roundingMethod:{halfUpSymmetric:"S",halfUpAsymmetric:"A",halfDownSymmetric:"s",halfDownAsymmetric:"a",halfEvenBankersRounding:"B",upRoundAwayFromZero:"U",downRoundTowardZero:"D",toCeilingTowardPositiveInfinity:"C",toFloorTowardNegativeInfinity:"F",toNearest05:"N05",toNearest05Alt:"CHF",upToNext05:"U05",downToNext05:"D05"},saveValueToSessionStorage:{save:!0,doNotSave:!1},selectNumberOnly:{selectNumbersOnly:!0,selectAll:!1},selectOnFocus:{select:!0,doNotSelect:!1},serializeSpaces:{plus:"+",percent:"%20"},showOnlyNumbersOnFocus:{onlyNumbers:!0,showAll:!1},showPositiveSign:{show:!0,hide:!1},showWarnings:{show:!0,hide:!1},styleRules:{none:null,positiveNegative:{positive:"autoNumeric-positive",negative:"autoNumeric-negative"},range0To100With4Steps:{ranges:[{min:0,max:25,class:"autoNumeric-red"},{min:25,max:50,class:"autoNumeric-orange"},{min:50,max:75,class:"autoNumeric-yellow"},{min:75,max:100,class:"autoNumeric-green"}]},evenOdd:{userDefined:[{callback:function(s){return s%2==0},classes:["autoNumeric-even","autoNumeric-odd"]}]},rangeSmallAndZero:{userDefined:[{callback:function(s){return-1<=s&&s<0?0:0===Number(s)?1:0<s&&s<=1?2:null},classes:["autoNumeric-small-negative","autoNumeric-zero","autoNumeric-small-positive"]}]}},suffixText:{none:"",percentage:"%",permille:"\u2030",basisPoint:"\u2031"},symbolWhenUnfocused:{none:null,percentage:"%",permille:"\u2030",basisPoint:"\u2031"},unformatOnHover:{unformat:!0,doNotUnformat:!1},unformatOnSubmit:{unformat:!0,keepCurrentValue:!1},valuesToStrings:{none:null,zeroDash:{0:"-"},oneAroundZero:{"-1":"Min",1:"Max"}},watchExternalChanges:{watch:!0,doNotWatch:!1},wheelOn:{focus:"focus",hover:"hover"},wheelStep:{progressive:"progressive"}},H=T.options,Object.getOwnPropertyNames(H).forEach(function(s){"valuesToStrings"===s?Object.getOwnPropertyNames(H.valuesToStrings).forEach(function(d){i.isIE11()||null===H.valuesToStrings[d]||Object.freeze(H.valuesToStrings[d])}):"styleRules"!==s&&(i.isIE11()||null===H[s]||Object.freeze(H[s]))}),Object.freeze(H),Object.defineProperty(T,"options",{configurable:!1,writable:!1}),T.defaultSettings={allowDecimalPadding:T.options.allowDecimalPadding.always,alwaysAllowDecimalCharacter:T.options.alwaysAllowDecimalCharacter.doNotAllow,caretPositionOnFocus:T.options.caretPositionOnFocus.doNoForceCaretPosition,createLocalList:T.options.createLocalList.createList,currencySymbol:T.options.currencySymbol.none,currencySymbolPlacement:T.options.currencySymbolPlacement.prefix,decimalCharacter:T.options.decimalCharacter.dot,decimalCharacterAlternative:T.options.decimalCharacterAlternative.none,decimalPlaces:T.options.decimalPlaces.two,decimalPlacesRawValue:T.options.decimalPlacesRawValue.useDefault,decimalPlacesShownOnBlur:T.options.decimalPlacesShownOnBlur.useDefault,decimalPlacesShownOnFocus:T.options.decimalPlacesShownOnFocus.useDefault,defaultValueOverride:T.options.defaultValueOverride.doNotOverride,digitalGroupSpacing:T.options.digitalGroupSpacing.three,digitGroupSeparator:T.options.digitGroupSeparator.comma,divisorWhenUnfocused:T.options.divisorWhenUnfocused.none,emptyInputBehavior:T.options.emptyInputBehavior.focus,eventBubbles:T.options.eventBubbles.bubbles,eventIsCancelable:T.options.eventIsCancelable.isCancelable,failOnUnknownOption:T.options.failOnUnknownOption.ignore,formatOnPageLoad:T.options.formatOnPageLoad.format,formulaMode:T.options.formulaMode.disabled,historySize:T.options.historySize.medium,invalidClass:T.options.invalidClass,isCancellable:T.options.isCancellable.cancellable,leadingZero:T.options.leadingZero.deny,maximumValue:T.options.maximumValue.tenTrillions,minimumValue:T.options.minimumValue.tenTrillions,modifyValueOnWheel:T.options.modifyValueOnWheel.modifyValue,negativeBracketsTypeOnBlur:T.options.negativeBracketsTypeOnBlur.none,negativePositiveSignPlacement:T.options.negativePositiveSignPlacement.none,negativeSignCharacter:T.options.negativeSignCharacter.hyphen,noEventListeners:T.options.noEventListeners.addEvents,onInvalidPaste:T.options.onInvalidPaste.error,outputFormat:T.options.outputFormat.none,overrideMinMaxLimits:T.options.overrideMinMaxLimits.doNotOverride,positiveSignCharacter:T.options.positiveSignCharacter.plus,rawValueDivisor:T.options.rawValueDivisor.none,readOnly:T.options.readOnly.readWrite,roundingMethod:T.options.roundingMethod.halfUpSymmetric,saveValueToSessionStorage:T.options.saveValueToSessionStorage.doNotSave,selectNumberOnly:T.options.selectNumberOnly.selectNumbersOnly,selectOnFocus:T.options.selectOnFocus.select,serializeSpaces:T.options.serializeSpaces.plus,showOnlyNumbersOnFocus:T.options.showOnlyNumbersOnFocus.showAll,showPositiveSign:T.options.showPositiveSign.hide,showWarnings:T.options.showWarnings.show,styleRules:T.options.styleRules.none,suffixText:T.options.suffixText.none,symbolWhenUnfocused:T.options.symbolWhenUnfocused.none,unformatOnHover:T.options.unformatOnHover.unformat,unformatOnSubmit:T.options.unformatOnSubmit.keepCurrentValue,valuesToStrings:T.options.valuesToStrings.none,watchExternalChanges:T.options.watchExternalChanges.doNotWatch,wheelOn:T.options.wheelOn.focus,wheelStep:T.options.wheelStep.progressive},Object.freeze(T.defaultSettings),Object.defineProperty(T,"defaultSettings",{configurable:!1,writable:!1});var Q={digitGroupSeparator:T.options.digitGroupSeparator.dot,decimalCharacter:T.options.decimalCharacter.comma,decimalCharacterAlternative:T.options.decimalCharacterAlternative.dot,currencySymbol:"\u202f\u20ac",currencySymbolPlacement:T.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:T.options.negativePositiveSignPlacement.prefix},$={digitGroupSeparator:T.options.digitGroupSeparator.comma,decimalCharacter:T.options.decimalCharacter.dot,currencySymbol:T.options.currencySymbol.dollar,currencySymbolPlacement:T.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:T.options.negativePositiveSignPlacement.right},ie={digitGroupSeparator:T.options.digitGroupSeparator.comma,decimalCharacter:T.options.decimalCharacter.dot,currencySymbol:T.options.currencySymbol.yen,currencySymbolPlacement:T.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:T.options.negativePositiveSignPlacement.right};i.cloneObject(Q).formulaMode=T.options.formulaMode.enabled;var ge=i.cloneObject(Q);ge.minimumValue=0;var me=i.cloneObject(Q);me.maximumValue=0,me.negativePositiveSignPlacement=T.options.negativePositiveSignPlacement.prefix;var Ie=i.cloneObject(Q);Ie.digitGroupSeparator=T.options.digitGroupSeparator.normalSpace;var Se=i.cloneObject(Ie);Se.minimumValue=0;var Me=i.cloneObject(Ie);Me.maximumValue=0,Me.negativePositiveSignPlacement=T.options.negativePositiveSignPlacement.prefix;var Pe=i.cloneObject(Q);Pe.currencySymbol=T.options.currencySymbol.none,Pe.suffixText="\u202f".concat(T.options.suffixText.percentage),Pe.wheelStep=1e-4,Pe.rawValueDivisor=T.options.rawValueDivisor.percentage;var fe=i.cloneObject(Pe);fe.minimumValue=0;var De=i.cloneObject(Pe);De.maximumValue=0,De.negativePositiveSignPlacement=T.options.negativePositiveSignPlacement.prefix;var qe=i.cloneObject(Pe);qe.decimalPlaces=3;var We=i.cloneObject(fe);We.decimalPlaces=3;var Ee=i.cloneObject(De);Ee.decimalPlaces=3,i.cloneObject($).formulaMode=T.options.formulaMode.enabled;var ke=i.cloneObject($);ke.minimumValue=0;var ve=i.cloneObject($);ve.maximumValue=0,ve.negativePositiveSignPlacement=T.options.negativePositiveSignPlacement.prefix;var xe=i.cloneObject(ve);xe.negativeBracketsTypeOnBlur=T.options.negativeBracketsTypeOnBlur.parentheses;var ye=i.cloneObject($);ye.currencySymbol=T.options.currencySymbol.none,ye.suffixText=T.options.suffixText.percentage,ye.wheelStep=1e-4,ye.rawValueDivisor=T.options.rawValueDivisor.percentage;var we=i.cloneObject(ye);we.minimumValue=0;var _e=i.cloneObject(ye);_e.maximumValue=0,_e.negativePositiveSignPlacement=T.options.negativePositiveSignPlacement.prefix;var Je=i.cloneObject(ye);Je.decimalPlaces=3;var Fe=i.cloneObject(we);Fe.decimalPlaces=3;var He=i.cloneObject(_e);He.decimalPlaces=3;var Ce=i.cloneObject(Q);Ce.currencySymbol=T.options.currencySymbol.lira,T.predefinedOptions={euro:Q,euroPos:ge,euroNeg:me,euroSpace:Ie,euroSpacePos:Se,euroSpaceNeg:Me,percentageEU2dec:Pe,percentageEU2decPos:fe,percentageEU2decNeg:De,percentageEU3dec:qe,percentageEU3decPos:We,percentageEU3decNeg:Ee,dollar:$,dollarPos:ke,dollarNeg:ve,dollarNegBrackets:xe,percentageUS2dec:ye,percentageUS2decPos:we,percentageUS2decNeg:_e,percentageUS3dec:Je,percentageUS3decPos:Fe,percentageUS3decNeg:He,French:Q,Spanish:Q,NorthAmerican:$,British:{digitGroupSeparator:T.options.digitGroupSeparator.comma,decimalCharacter:T.options.decimalCharacter.dot,currencySymbol:T.options.currencySymbol.pound,currencySymbolPlacement:T.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:T.options.negativePositiveSignPlacement.right},Swiss:{digitGroupSeparator:T.options.digitGroupSeparator.apostrophe,decimalCharacter:T.options.decimalCharacter.dot,currencySymbol:"\u202fCHF",currencySymbolPlacement:T.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:T.options.negativePositiveSignPlacement.prefix},Japanese:ie,Chinese:ie,Brazilian:{digitGroupSeparator:T.options.digitGroupSeparator.dot,decimalCharacter:T.options.decimalCharacter.comma,currencySymbol:T.options.currencySymbol.real,currencySymbolPlacement:T.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:T.options.negativePositiveSignPlacement.right},Turkish:Ce,dotDecimalCharCommaSeparator:{digitGroupSeparator:T.options.digitGroupSeparator.comma,decimalCharacter:T.options.decimalCharacter.dot},commaDecimalCharDotSeparator:{digitGroupSeparator:T.options.digitGroupSeparator.dot,decimalCharacter:T.options.decimalCharacter.comma,decimalCharacterAlternative:T.options.decimalCharacterAlternative.dot},integer:{decimalPlaces:0},integerPos:{minimumValue:T.options.minimumValue.zero,decimalPlaces:0},integerNeg:{maximumValue:T.options.maximumValue.zero,decimalPlaces:0},float:{allowDecimalPadding:T.options.allowDecimalPadding.never},floatPos:{allowDecimalPadding:T.options.allowDecimalPadding.never,minimumValue:T.options.minimumValue.zero,maximumValue:T.options.maximumValue.tenTrillions},floatNeg:{allowDecimalPadding:T.options.allowDecimalPadding.never,minimumValue:T.options.minimumValue.tenTrillions,maximumValue:T.options.maximumValue.zero},numeric:{digitGroupSeparator:T.options.digitGroupSeparator.noSeparator,decimalCharacter:T.options.decimalCharacter.dot,currencySymbol:T.options.currencySymbol.none},numericPos:{digitGroupSeparator:T.options.digitGroupSeparator.noSeparator,decimalCharacter:T.options.decimalCharacter.dot,currencySymbol:T.options.currencySymbol.none,minimumValue:T.options.minimumValue.zero,maximumValue:T.options.maximumValue.tenTrillions},numericNeg:{digitGroupSeparator:T.options.digitGroupSeparator.noSeparator,decimalCharacter:T.options.decimalCharacter.dot,currencySymbol:T.options.currencySymbol.none,minimumValue:T.options.minimumValue.tenTrillions,maximumValue:T.options.maximumValue.zero}},Object.getOwnPropertyNames(T.predefinedOptions).forEach(function(s){Object.freeze(T.predefinedOptions[s])}),Object.freeze(T.predefinedOptions),Object.defineProperty(T,"predefinedOptions",{configurable:!1,writable:!1}),t.default=T}],b.c=F,b.d=function(N,t,x){b.o(N,t)||Object.defineProperty(N,t,{enumerable:!0,get:x})},b.r=function(N){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})},b.t=function(N,t){if(1&t&&(N=b(N)),8&t||4&t&&"object"==typeof N&&N&&N.__esModule)return N;var x=Object.create(null);if(b.r(x),Object.defineProperty(x,"default",{enumerable:!0,value:N}),2&t&&"string"!=typeof N)for(var M in N)b.d(x,M,function(w){return N[w]}.bind(null,M));return x},b.n=function(N){var t=N&&N.__esModule?function(){return N.default}:function(){return N};return b.d(t,"a",t),t},b.o=function(N,t){return Object.prototype.hasOwnProperty.call(N,t)},b.p="",b(b.s=0).default;function b(N){if(F[N])return F[N].exports;var t=F[N]={i:N,l:!1,exports:{}};return O[N].call(t.exports,t,t.exports,b),t.l=!0,t.exports}var O,F}()},7243:(W,b,O)=>{"use strict";var N=U(O(9721)),x=U(O(4070)),w=U(O(6162)),I=U(O(3800)),l=U(O(1731)),h=U(O(70)),p=U(O(3930)),S=O(7497),R=U(O(7850));function U(H){return H&&H.__esModule?H:{default:H}}var j=function(){},J=function(T,X,Q){var $=new j;if(typeof T>"u")throw Error("No element to render on was provided.");return $._renderProperties=(0,l.default)(T),$._encodings=[],$._options=R.default,$._errorHandler=new p.default($),typeof X<"u"&&((Q=Q||{}).format||(Q.format=de()),$.options(Q)[Q.format](X,Q).render()),$};for(var ce in J.getModule=function(H){return N.default[H]},N.default)N.default.hasOwnProperty(ce)&&le(N.default,ce);function le(H,T){j.prototype[T]=j.prototype[T.toUpperCase()]=j.prototype[T.toLowerCase()]=function(X,Q){var $=this;return $._errorHandler.wrapBarcodeCall(function(){Q.text=typeof Q.text>"u"?void 0:""+Q.text;var ie=(0,x.default)($._options,Q);ie=(0,h.default)(ie);var me=ee(X,H[T],ie);return $._encodings.push(me),$})}}function ee(H,T,X){var Q=new T(H=""+H,X);if(!Q.valid())throw new S.InvalidInputException(Q.constructor.name,H);var $=Q.encode();$=(0,w.default)($);for(var ie=0;ie<$.length;ie++)$[ie].options=(0,x.default)(X,$[ie].options);return $}function de(){return N.default.CODE128?"CODE128":Object.keys(N.default)[0]}function Ne(H,T,X){T=(0,w.default)(T);for(var Q=0;Q<T.length;Q++)T[Q].options=(0,x.default)(X,T[Q].options),(0,I.default)(T[Q].options);(0,I.default)(X),new(0,H.renderer)(H.element,T,X).render(),H.afterRender&&H.afterRender()}j.prototype.options=function(H){return this._options=(0,x.default)(this._options,H),this},j.prototype.blank=function(H){var T=new Array(H+1).join("0");return this._encodings.push({data:T}),this},j.prototype.init=function(){var H;if(this._renderProperties)for(var T in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){var X=(0,x.default)(this._options,(H=this._renderProperties[T]).options);"auto"==X.format&&(X.format=de()),this._errorHandler.wrapBarcodeCall(function(){var ie=ee(X.value,N.default[X.format.toUpperCase()],X);Ne(H,ie,X)})}},j.prototype.render=function(){if(!this._renderProperties)throw new S.NoElementException;if(Array.isArray(this._renderProperties))for(var H=0;H<this._renderProperties.length;H++)Ne(this._renderProperties[H],this._encodings,this._options);else Ne(this._renderProperties,this._encodings,this._options);return this},j.prototype._defaults=R.default,typeof window<"u"&&(window.JsBarcode=J),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(H,T){var X=[];return jQuery(this).each(function(){X.push(this)}),J(X,H,T)}),W.exports=J},4648:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function N(t,x){(function O(N,t){if(!(N instanceof t))throw new TypeError("Cannot call a class as a function")})(this,N),this.data=t,this.text=x.text||t,this.options=x}},6106:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function l(c,h){for(var i=0;i<h.length;i++){var p=h[i];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,h,i){return h&&l(c.prototype,h),i&&l(c,i),c}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(O(4648)),x=O(9068),_=function(l){function c(h,i){!function w(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c);var p=function k(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,h.substring(1),i));return p.bytes=h.split("").map(function(S){return S.charCodeAt(0)}),p}return function I(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),F(c,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var i=this.bytes,p=i.shift()-105,S=x.SET_BY_CODE[p];if(void 0===S)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&i.unshift(x.FNC1);var P=c.next(i,1,S);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:c.getBar(p)+P.result+c.getBar((P.checksum+p)%x.MODULO)+c.getBar(x.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var i=this.options.ean128||!1;return"string"==typeof i&&(i="true"===i.toLowerCase()),i}}],[{key:"getBar",value:function(i){return x.BARS[i]?x.BARS[i].toString():""}},{key:"correctIndex",value:function(i,p){if(p===x.SET_A){var S=i.shift();return S<32?S+64:S-32}return p===x.SET_B?i.shift()-32:10*(i.shift()-48)+i.shift()-48}},{key:"next",value:function(i,p,S){if(!i.length)return{result:"",checksum:0};var P=void 0,R=void 0;if(i[0]>=200){R=i.shift()-105;var U=x.SWAP[R];void 0!==U?P=c.next(i,p+1,U):((S===x.SET_A||S===x.SET_B)&&R===x.SHIFT&&(i[0]=S===x.SET_A?i[0]>95?i[0]-96:i[0]:i[0]<32?i[0]+96:i[0]),P=c.next(i,p+1,S))}else R=c.correctIndex(i,S),P=c.next(i,p+1,S);return{result:c.getBar(R)+P.result,checksum:R*p+P.checksum}}}]),c}(t.default);b.default=_},8964:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function l(c,h){for(var i=0;i<h.length;i++){var p=h[i];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,h,i){return h&&l(c.prototype,h),i&&l(c,i),c}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(O(6106)),x=O(9068),_=function(l){function c(h,i){return function w(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function k(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,x.A_START_CHAR+h,i))}return function I(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),F(c,[{key:"valid",value:function(){return new RegExp("^"+x.A_CHARS+"+$").test(this.data)}}]),c}(t.default);b.default=_},3254:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function l(c,h){for(var i=0;i<h.length;i++){var p=h[i];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,h,i){return h&&l(c.prototype,h),i&&l(c,i),c}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(O(6106)),x=O(9068),_=function(l){function c(h,i){return function w(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function k(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,x.B_START_CHAR+h,i))}return function I(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),F(c,[{key:"valid",value:function(){return new RegExp("^"+x.B_CHARS+"+$").test(this.data)}}]),c}(t.default);b.default=_},5701:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function l(c,h){for(var i=0;i<h.length;i++){var p=h[i];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,h,i){return h&&l(c.prototype,h),i&&l(c,i),c}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(O(6106)),x=O(9068),_=function(l){function c(h,i){return function w(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function k(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,x.C_START_CHAR+h,i))}return function I(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),F(c,[{key:"valid",value:function(){return new RegExp("^"+x.C_CHARS+"+$").test(this.data)}}]),c}(t.default);b.default=_},5626:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var N=M(O(6106)),x=M(O(4779));function M(l){return l&&l.__esModule?l:{default:l}}function k(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}var _=function(l){function c(h,i){if(function w(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),/^[\x00-\x7F\xC8-\xD3]+$/.test(h))var p=k(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,(0,x.default)(h),i));else p=k(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,h,i));return k(p)}return function I(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),c}(N.default);b.default=_},4779:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=O(9068),N=function(I){return I.match(new RegExp("^"+F.A_CHARS+"*"))[0].length},t=function(I){return I.match(new RegExp("^"+F.B_CHARS+"*"))[0].length},x=function(I){return I.match(new RegExp("^"+F.C_CHARS+"*"))[0]};function M(k,I){var _=I?F.A_CHARS:F.B_CHARS,l=k.match(new RegExp("^("+_+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(l)return l[1]+String.fromCharCode(204)+w(k.substring(l[1].length));var c=k.match(new RegExp("^"+_+"+"))[0];return c.length===k.length?k:c+String.fromCharCode(I?205:206)+M(k.substring(c.length),!I)}function w(k){var I=x(k),_=I.length;if(_===k.length)return k;k=k.substring(_);var l=N(k)>=t(k);return I+String.fromCharCode(l?206:205)+M(k,l)}b.default=function(k){var I=void 0;if(x(k).length>=2)I=F.C_START_CHAR+w(k);else{var l=N(k)>t(k);I=(l?F.A_START_CHAR:F.B_START_CHAR)+M(k,l)}return I.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(c,h){return String.fromCharCode(203)+h})}},9068:(W,b)=>{"use strict";var O;function F(ce,le,ee){return le in ce?Object.defineProperty(ce,le,{value:ee,enumerable:!0,configurable:!0,writable:!0}):ce[le]=ee,ce}Object.defineProperty(b,"__esModule",{value:!0});var N=b.SET_A=0,t=b.SET_B=1,x=b.SET_C=2,w=(b.SHIFT=98,b.START_A=103),k=b.START_B=104,I=b.START_C=105;b.MODULO=103,b.STOP=106,b.FNC1=207,b.SET_BY_CODE=(F(O={},w,N),F(O,k,t),F(O,I,x),O),b.SWAP={101:N,100:t,99:x},b.A_START_CHAR=String.fromCharCode(208),b.B_START_CHAR=String.fromCharCode(209),b.C_START_CHAR=String.fromCharCode(210),b.A_CHARS="[\0-_\xc8-\xcf]",b.B_CHARS="[ -\x7f\xc8-\xcf]",b.C_CHARS="(\xcf*[0-9]{2}\xcf*)",b.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},6038:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CODE128C=b.CODE128B=b.CODE128A=b.CODE128=void 0;var N=_(O(5626)),x=_(O(8964)),w=_(O(3254)),I=_(O(5701));function _(l){return l&&l.__esModule?l:{default:l}}b.CODE128=N.default,b.CODE128A=x.default,b.CODE128B=w.default,b.CODE128C=I.default},528:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CODE39=void 0;var F=function(){function P(R,U){for(var j=0;j<U.length;j++){var J=U[j];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(R,J.key,J)}}return function(R,U,j){return U&&P(R.prototype,U),j&&P(R,j),R}}(),I=function(P){function R(U,j){return function M(P,R){if(!(P instanceof R))throw new TypeError("Cannot call a class as a function")}(this,R),U=U.toUpperCase(),j.mod43&&(U+=function i(P){return _[P]}(function S(P){for(var R=0,U=0;U<P.length;U++)R+=p(P[U]);return R%=43}(U))),function w(P,R){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!R||"object"!=typeof R&&"function"!=typeof R?P:R}(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,U,j))}return function k(P,R){if("function"!=typeof R&&null!==R)throw new TypeError("Super expression must either be null or a function, not "+typeof R);P.prototype=Object.create(R&&R.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(P,R):P.__proto__=R)}(R,P),F(R,[{key:"encode",value:function(){for(var j=c("*"),J=0;J<this.data.length;J++)j+=c(this.data[J])+"0";return{data:j+=c("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),R}(function x(P){return P&&P.__esModule?P:{default:P}}(O(4648)).default),_=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],l=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function c(P){return function h(P){return l[P].toString(2)}(p(P))}function p(P){return _.indexOf(P)}b.CODE39=I},7417:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function h(i,p){for(var S=0;S<p.length;S++){var P=p[S];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(i,P.key,P)}}return function(i,p,S){return p&&h(i.prototype,p),S&&h(i,S),i}}(),N=O(3819),x=k(O(9259));function k(h){return h&&h.__esModule?h:{default:h}}var c=function(h){function i(p,S){!function I(h,i){if(!(h instanceof i))throw new TypeError("Cannot call a class as a function")}(this,i);var P=function _(h,i){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!i||"object"!=typeof i&&"function"!=typeof i?h:i}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,p,S));return P.fontSize=!S.flat&&S.fontSize>10*S.width?10*S.width:S.fontSize,P.guardHeight=S.height+P.fontSize/2+S.textMargin,P}return function l(h,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function, not "+typeof i);h.prototype=Object.create(i&&i.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(h,i):h.__proto__=i)}(i,h),F(i,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(S,P){return this.text.substr(S,P)}},{key:"leftEncode",value:function(S,P){return(0,x.default)(S,P)}},{key:"rightText",value:function(S,P){return this.text.substr(S,P)}},{key:"rightEncode",value:function(S,P){return(0,x.default)(S,P)}},{key:"encodeGuarded",value:function(){var S={fontSize:this.fontSize},P={height:this.guardHeight};return[{data:N.SIDE_BIN,options:P},{data:this.leftEncode(),text:this.leftText(),options:S},{data:N.MIDDLE_BIN,options:P},{data:this.rightEncode(),text:this.rightText(),options:S},{data:N.SIDE_BIN,options:P}]}},{key:"encodeFlat",value:function(){return{data:[N.SIDE_BIN,this.leftEncode(),N.MIDDLE_BIN,this.rightEncode(),N.SIDE_BIN].join(""),text:this.text}}}]),i}(k(O(4648)).default);b.default=c},6195:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function h(i,p){for(var S=0;S<p.length;S++){var P=p[S];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(i,P.key,P)}}return function(i,p,S){return p&&h(i.prototype,p),S&&h(i,S),i}}(),N=function h(i,p,S){null===i&&(i=Function.prototype);var P=Object.getOwnPropertyDescriptor(i,p);if(void 0===P){var R=Object.getPrototypeOf(i);return null===R?void 0:h(R,p,S)}if("value"in P)return P.value;var U=P.get;return void 0===U?void 0:U.call(S)},t=O(3819),M=function w(h){return h&&h.__esModule?h:{default:h}}(O(7417)),l=function(i){return(10-i.substr(0,12).split("").map(function(S){return+S}).reduce(function(S,P,R){return R%2?S+3*P:S+P},0)%10)%10},c=function(h){function i(p,S){(function k(h,i){if(!(h instanceof i))throw new TypeError("Cannot call a class as a function")})(this,i),-1!==p.search(/^[0-9]{12}$/)&&(p+=l(p));var P=function I(h,i){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!i||"object"!=typeof i&&"function"!=typeof i?h:i}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,p,S));return P.lastChar=S.lastChar,P}return function _(h,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function, not "+typeof i);h.prototype=Object.create(i&&i.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(h,i):h.__proto__=i)}(i,h),F(i,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===l(this.data)}},{key:"leftText",value:function(){return N(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var S=this.data.substr(1,6),P=t.EAN13_STRUCTURE[this.data[0]];return N(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"leftEncode",this).call(this,S,P)}},{key:"rightText",value:function(){return N(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var S=this.data.substr(7,6);return N(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"rightEncode",this).call(this,S,"RRRRRR")}},{key:"encodeGuarded",value:function(){var S=N(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(S.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(S.push({data:"00"}),S.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),S}}]),i}(M.default);b.default=c},4500:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function h(i,p){for(var S=0;S<p.length;S++){var P=p[S];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(i,P.key,P)}}return function(i,p,S){return p&&h(i.prototype,p),S&&h(i,S),i}}(),N=O(3819),x=k(O(9259));function k(h){return h&&h.__esModule?h:{default:h}}var c=function(h){function i(p,S){return function I(h,i){if(!(h instanceof i))throw new TypeError("Cannot call a class as a function")}(this,i),function _(h,i){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!i||"object"!=typeof i&&"function"!=typeof i?h:i}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,p,S))}return function l(h,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function, not "+typeof i);h.prototype=Object.create(i&&i.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(h,i):h.__proto__=i)}(i,h),F(i,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var S=N.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,x.default)(this.data,S,"01"),text:this.text}}}]),i}(k(O(4648)).default);b.default=c},5174:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function i(p,S){for(var P=0;P<S.length;P++){var R=S[P];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(p,R.key,R)}}return function(p,S,P){return S&&i(p.prototype,S),P&&i(p,P),p}}(),N=O(3819),x=k(O(9259));function k(i){return i&&i.__esModule?i:{default:i}}var h=function(i){function p(S,P){return function I(i,p){if(!(i instanceof p))throw new TypeError("Cannot call a class as a function")}(this,p),function _(i,p){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!p||"object"!=typeof p&&"function"!=typeof p?i:p}(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,S,P))}return function l(i,p){if("function"!=typeof p&&null!==p)throw new TypeError("Super expression must either be null or a function, not "+typeof p);i.prototype=Object.create(p&&p.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(i,p):i.__proto__=p)}(p,i),F(p,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var P=N.EAN5_STRUCTURE[function(p){return p.split("").map(function(P){return+P}).reduce(function(P,R,U){return U%2?P+9*R:P+3*R},0)%10}(this.data)];return{data:"1011"+(0,x.default)(this.data,P,"01"),text:this.text}}}]),p}(k(O(4648)).default);b.default=h},2523:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function c(h,i){for(var p=0;p<i.length;p++){var S=i[p];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(h,S.key,S)}}return function(h,i,p){return i&&c(h.prototype,i),p&&c(h,p),h}}(),N=function c(h,i,p){null===h&&(h=Function.prototype);var S=Object.getOwnPropertyDescriptor(h,i);if(void 0===S){var P=Object.getPrototypeOf(h);return null===P?void 0:c(P,i,p)}if("value"in S)return S.value;var R=S.get;return void 0===R?void 0:R.call(p)},x=function M(c){return c&&c.__esModule?c:{default:c}}(O(7417)),_=function(h){return(10-h.substr(0,7).split("").map(function(p){return+p}).reduce(function(p,S,P){return P%2?p+S:p+3*S},0)%10)%10},l=function(c){function h(i,p){return function w(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}(this,h),-1!==i.search(/^[0-9]{7}$/)&&(i+=_(i)),function k(c,h){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||"object"!=typeof h&&"function"!=typeof h?c:h}(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,i,p))}return function I(c,h){if("function"!=typeof h&&null!==h)throw new TypeError("Super expression must either be null or a function, not "+typeof h);c.prototype=Object.create(h&&h.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(c,h):c.__proto__=h)}(h,c),F(h,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===_(this.data)}},{key:"leftText",value:function(){return N(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var p=this.data.substr(0,4);return N(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"leftEncode",this).call(this,p,"LLLL")}},{key:"rightText",value:function(){return N(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var p=this.data.substr(4,4);return N(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"rightEncode",this).call(this,p,"RRRR")}}]),h}(x.default);b.default=l},4102:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function h(i,p){for(var S=0;S<p.length;S++){var P=p[S];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(i,P.key,P)}}return function(i,p,S){return p&&h(i.prototype,p),S&&h(i,S),i}}();b.checksum=c;var t=w(O(9259));function w(h){return h&&h.__esModule?h:{default:h}}var l=function(h){function i(p,S){(function k(h,i){if(!(h instanceof i))throw new TypeError("Cannot call a class as a function")})(this,i),-1!==p.search(/^[0-9]{11}$/)&&(p+=c(p));var P=function I(h,i){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!i||"object"!=typeof i&&"function"!=typeof i?h:i}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,p,S));return P.displayValue=S.displayValue,P.fontSize=S.fontSize>10*S.width?10*S.width:S.fontSize,P.guardHeight=S.height+P.fontSize/2+S.textMargin,P}return function _(h,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function, not "+typeof i);h.prototype=Object.create(i&&i.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(h,i):h.__proto__=i)}(i,h),F(i,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==c(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var S="";return S+="101",S+=(0,t.default)(this.data.substr(0,6),"LLLLLL"),S+="01010",S+=(0,t.default)(this.data.substr(6,6),"RRRRRR"),{data:S+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var S=[];return this.displayValue&&S.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),S.push({data:"101"+(0,t.default)(this.data[0],"L"),options:{height:this.guardHeight}}),S.push({data:(0,t.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),S.push({data:"01010",options:{height:this.guardHeight}}),S.push({data:(0,t.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),S.push({data:(0,t.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&S.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),S}}]),i}(w(O(4648)).default);function c(h){var p,i=0;for(p=1;p<11;p+=2)i+=parseInt(h[p]);for(p=0;p<11;p+=2)i+=3*parseInt(h[p]);return(10-i%10)%10}b.default=l},1285:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function S(P,R){for(var U=0;U<R.length;U++){var j=R[U];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(P,j.key,j)}}return function(P,R,U){return R&&S(P.prototype,R),U&&S(P,U),P}}(),t=k(O(9259)),M=k(O(4648)),w=O(4102);function k(S){return S&&S.__esModule?S:{default:S}}function _(S,P){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!P||"object"!=typeof P&&"function"!=typeof P?S:P}var c=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],h=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],i=function(S){function P(R,U){!function I(S,P){if(!(S instanceof P))throw new TypeError("Cannot call a class as a function")}(this,P);var j=_(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,R,U));if(j.isValid=!1,-1!==R.search(/^[0-9]{6}$/))j.middleDigits=R,j.upcA=p(R,"0"),j.text=U.text||""+j.upcA[0]+R+j.upcA[j.upcA.length-1],j.isValid=!0;else{if(-1===R.search(/^[01][0-9]{7}$/))return _(j);if(j.middleDigits=R.substring(1,R.length-1),j.upcA=p(j.middleDigits,R[0]),j.upcA[j.upcA.length-1]!==R[R.length-1])return _(j);j.isValid=!0}return j.displayValue=U.displayValue,j.fontSize=U.fontSize>10*U.width?10*U.width:U.fontSize,j.guardHeight=U.height+j.fontSize/2+U.textMargin,j}return function l(S,P){if("function"!=typeof P&&null!==P)throw new TypeError("Super expression must either be null or a function, not "+typeof P);S.prototype=Object.create(P&&P.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(S,P):S.__proto__=P)}(P,S),F(P,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var U="";return U+="101",U+=this.encodeMiddleDigits(),{data:U+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var U=[];return this.displayValue&&U.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),U.push({data:"101",options:{height:this.guardHeight}}),U.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),U.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&U.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),U}},{key:"encodeMiddleDigits",value:function(){var U=this.upcA[0],J=h[parseInt(this.upcA[this.upcA.length-1])][parseInt(U)];return(0,t.default)(this.middleDigits,J)}}]),P}(M.default);function p(S,P){for(var R=parseInt(S[S.length-1]),U=c[R],j="",J=0,ce=0;ce<U.length;ce++){var le=U[ce];j+="X"===le?S[J++]:le}return(j=""+P+j)+(0,w.checksum)(j)}b.default=i},3819:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.SIDE_BIN="101",b.MIDDLE_BIN="01010",b.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},b.EAN2_STRUCTURE=["LL","LG","GL","GG"],b.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],b.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},9259:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=O(3819);b.default=function(x,M,w){var k=x.split("").map(function(_,l){return F.BINARIES[M[l]]}).map(function(_,l){return _?_[x[l]]:""});if(w){var I=x.length-1;k=k.map(function(_,l){return l<I?_+w:_})}return k.join("")}},7422:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.UPCE=b.UPC=b.EAN2=b.EAN5=b.EAN8=b.EAN13=void 0;var N=i(O(6195)),x=i(O(2523)),w=i(O(5174)),I=i(O(4500)),l=i(O(4102)),h=i(O(1285));function i(p){return p&&p.__esModule?p:{default:p}}b.EAN13=N.default,b.EAN8=x.default,b.EAN5=w.default,b.EAN2=I.default,b.UPC=l.default,b.UPCE=h.default},791:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.GenericBarcode=void 0;var F=function(){function _(l,c){for(var h=0;h<c.length;h++){var i=c[h];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(l,i.key,i)}}return function(l,c,h){return c&&_(l.prototype,c),h&&_(l,h),l}}(),I=function(_){function l(c,h){return function M(_,l){if(!(_ instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function w(_,l){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?_:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c,h))}return function k(_,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);_.prototype=Object.create(l&&l.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(_,l):_.__proto__=l)}(l,_),F(l,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),l}(function x(_){return _&&_.__esModule?_:{default:_}}(O(4648)).default);b.GenericBarcode=I},3435:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function l(c,h){for(var i=0;i<h.length;i++){var p=h[i];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,h,i){return h&&l(c.prototype,h),i&&l(c,i),c}}(),N=O(5306);function w(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}function k(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}var _=function(l){function c(){return w(this,c),k(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return function I(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),F(c,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var i=this,p=this.data.match(/.{2}/g).map(function(S){return i.encodePair(S)}).join("");return{data:N.START_BIN+p+N.END_BIN,text:this.text}}},{key:"encodePair",value:function(i){var p=N.BINARIES[i[1]];return N.BINARIES[i[0]].split("").map(function(S,P){return("1"===S?"111":"1")+("1"===p[P]?"000":"0")}).join("")}}]),c}(function M(l){return l&&l.__esModule?l:{default:l}}(O(4648)).default);b.default=_},580:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function l(c,h){for(var i=0;i<h.length;i++){var p=h[i];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,h,i){return h&&l(c.prototype,h),i&&l(c,i),c}}(),t=function x(l){return l&&l.__esModule?l:{default:l}}(O(3435)),I=function(c){var h=c.substr(0,13).split("").map(function(i){return parseInt(i,10)}).reduce(function(i,p,S){return i+p*(3-S%2*2)},0);return 10*Math.ceil(h/10)-h},_=function(l){function c(h,i){return function M(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),-1!==h.search(/^[0-9]{13}$/)&&(h+=I(h)),function w(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,h,i))}return function k(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),F(c,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===I(this.data)}}]),c}(t.default);b.default=_},5306:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.START_BIN="1010",b.END_BIN="11101",b.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},7191:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ITF14=b.ITF=void 0;var N=M(O(3435)),x=M(O(580));function M(w){return w&&w.__esModule?w:{default:w}}b.ITF=N.default,b.ITF14=x.default},6431:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function l(c,h){for(var i=0;i<h.length;i++){var p=h[i];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,h,i){return h&&l(c.prototype,h),i&&l(c,i),c}}(),I=function(l){function c(h,i){return function M(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function w(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,h,i))}return function k(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),F(c,[{key:"encode",value:function(){for(var i="110",p=0;p<this.data.length;p++){var P=parseInt(this.data[p]).toString(2);P=_(P,4-P.length);for(var R=0;R<P.length;R++)i+="0"==P[R]?"100":"110"}return{data:i+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),c}(function x(l){return l&&l.__esModule?l:{default:l}}(O(4648)).default);function _(l,c){for(var h=0;h<c;h++)l="0"+l;return l}b.default=I},7218:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var N=function x(_){return _&&_.__esModule?_:{default:_}}(O(6431)),t=O(6855),I=function(_){function l(c,h){return function M(_,l){if(!(_ instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function w(_,l){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?_:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c+(0,t.mod10)(c),h))}return function k(_,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);_.prototype=Object.create(l&&l.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(_,l):_.__proto__=l)}(l,_),l}(N.default);b.default=I},9762:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var N=function x(_){return _&&_.__esModule?_:{default:_}}(O(6431)),t=O(6855),I=function(_){function l(c,h){return function M(_,l){if(!(_ instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),c+=(0,t.mod10)(c),c+=(0,t.mod10)(c),function w(_,l){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?_:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c,h))}return function k(_,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);_.prototype=Object.create(l&&l.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(_,l):_.__proto__=l)}(l,_),l}(N.default);b.default=I},3117:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var N=function x(_){return _&&_.__esModule?_:{default:_}}(O(6431)),t=O(6855),I=function(_){function l(c,h){return function M(_,l){if(!(_ instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function w(_,l){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?_:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c+(0,t.mod11)(c),h))}return function k(_,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);_.prototype=Object.create(l&&l.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(_,l):_.__proto__=l)}(l,_),l}(N.default);b.default=I},1878:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var N=function x(_){return _&&_.__esModule?_:{default:_}}(O(6431)),t=O(6855),I=function(_){function l(c,h){return function M(_,l){if(!(_ instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),c+=(0,t.mod11)(c),c+=(0,t.mod10)(c),function w(_,l){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?_:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c,h))}return function k(_,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);_.prototype=Object.create(l&&l.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(_,l):_.__proto__=l)}(l,_),l}(N.default);b.default=I},6855:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.mod10=function O(N){for(var t=0,x=0;x<N.length;x++){var M=parseInt(N[x]);t+=(x+N.length)%2==0?M:2*M%10+Math.floor(2*M/10)}return(10-t%10)%10},b.mod11=function F(N){for(var t=0,x=[2,3,4,5,6,7],M=0;M<N.length;M++){var w=parseInt(N[N.length-1-M]);t+=x[M%x.length]*w}return(11-t%11)%11}},1247:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.MSI1110=b.MSI1010=b.MSI11=b.MSI10=b.MSI=void 0;var N=c(O(6431)),x=c(O(7218)),w=c(O(3117)),I=c(O(9762)),l=c(O(1878));function c(h){return h&&h.__esModule?h:{default:h}}b.MSI=N.default,b.MSI10=x.default,b.MSI11=w.default,b.MSI1010=I.default,b.MSI1110=l.default},2250:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.codabar=void 0;var F=function(){function _(l,c){for(var h=0;h<c.length;h++){var i=c[h];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(l,i.key,i)}}return function(l,c,h){return c&&_(l.prototype,c),h&&_(l,h),l}}(),I=function(_){function l(c,h){(function M(_,l){if(!(_ instanceof l))throw new TypeError("Cannot call a class as a function")})(this,l),0===c.search(/^[0-9\-\$\:\.\+\/]+$/)&&(c="A"+c+"A");var i=function w(_,l){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?_:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c.toUpperCase(),h));return i.text=i.options.text||i.text.replace(/[A-D]/g,""),i}return function k(_,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);_.prototype=Object.create(l&&l.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(_,l):_.__proto__=l)}(l,_),F(l,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var h=[],i=this.getEncodings(),p=0;p<this.data.length;p++)h.push(i[this.data.charAt(p)]),p!==this.data.length-1&&h.push("0");return{text:this.text,data:h.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),l}(function x(_){return _&&_.__esModule?_:{default:_}}(O(4648)).default);b.codabar=I},9721:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=O(528),N=O(6038),t=O(7422),x=O(7191),M=O(1247),w=O(7624),k=O(2250),I=O(791);b.default={CODE39:F.CODE39,CODE128:N.CODE128,CODE128A:N.CODE128A,CODE128B:N.CODE128B,CODE128C:N.CODE128C,EAN13:t.EAN13,EAN8:t.EAN8,EAN5:t.EAN5,EAN2:t.EAN2,UPC:t.UPC,UPCE:t.UPCE,ITF14:x.ITF14,ITF:x.ITF,MSI:M.MSI,MSI10:M.MSI10,MSI11:M.MSI11,MSI1010:M.MSI1010,MSI1110:M.MSI1110,pharmacode:w.pharmacode,codabar:k.codabar,GenericBarcode:I.GenericBarcode}},7624:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.pharmacode=void 0;var F=function(){function _(l,c){for(var h=0;h<c.length;h++){var i=c[h];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(l,i.key,i)}}return function(l,c,h){return c&&_(l.prototype,c),h&&_(l,h),l}}(),I=function(_){function l(c,h){!function M(_,l){if(!(_ instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l);var i=function w(_,l){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?_:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c,h));return i.number=parseInt(c,10),i}return function k(_,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);_.prototype=Object.create(l&&l.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(_,l):_.__proto__=l)}(l,_),F(l,[{key:"encode",value:function(){for(var h=this.number,i="";!isNaN(h)&&0!=h;)h%2==0?(i="11100"+i,h=(h-2)/2):(i="100"+i,h=(h-1)/2);return{data:i=i.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),l}(function x(_){return _&&_.__esModule?_:{default:_}}(O(4648)).default);b.pharmacode=I},3930:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var O=function(){function t(x,M){for(var w=0;w<M.length;w++){var k=M[w];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(x,k.key,k)}}return function(x,M,w){return M&&t(x.prototype,M),w&&t(x,w),x}}(),N=function(){function t(x){(function F(t,x){if(!(t instanceof x))throw new TypeError("Cannot call a class as a function")})(this,t),this.api=x}return O(t,[{key:"handleCatch",value:function(M){if("InvalidInputException"!==M.name)throw M;if(this.api._options.valid===this.api._defaults.valid)throw M.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(M){try{var w=M.apply(void 0,arguments);return this.api._options.valid(!0),w}catch(k){return this.handleCatch(k),this.api}}}]),t}();b.default=N},7497:(W,b)=>{"use strict";function O(w,k){if(!(w instanceof k))throw new TypeError("Cannot call a class as a function")}function F(w,k){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!k||"object"!=typeof k&&"function"!=typeof k?w:k}function N(w,k){if("function"!=typeof k&&null!==k)throw new TypeError("Super expression must either be null or a function, not "+typeof k);w.prototype=Object.create(k&&k.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(w,k):w.__proto__=k)}Object.defineProperty(b,"__esModule",{value:!0});var t=function(w){function k(I,_){O(this,k);var l=F(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));return l.name="InvalidInputException",l.symbology=I,l.input=_,l.message='"'+l.input+'" is not a valid input for '+l.symbology,l}return N(k,Error),k}(),x=function(w){function k(){O(this,k);var I=F(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));return I.name="InvalidElementException",I.message="Not supported type to render on",I}return N(k,Error),k}(),M=function(w){function k(){O(this,k);var I=F(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));return I.name="NoElementException",I.message="No element to render on.",I}return N(k,Error),k}();b.InvalidInputException=t,b.InvalidElementException=x,b.NoElementException=M},3800:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function O(F){return F.marginTop=F.marginTop||F.margin,F.marginBottom=F.marginBottom||F.margin,F.marginRight=F.marginRight||F.margin,F.marginLeft=F.marginLeft||F.margin,F}},6428:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var N=M(O(70)),x=M(O(7850));function M(k){return k&&k.__esModule?k:{default:k}}b.default=function w(k){var I={};for(var _ in x.default)x.default.hasOwnProperty(_)&&(k.hasAttribute("jsbarcode-"+_.toLowerCase())&&(I[_]=k.getAttribute("jsbarcode-"+_.toLowerCase())),k.hasAttribute("data-"+_.toLowerCase())&&(I[_]=k.getAttribute("data-"+_.toLowerCase())));return I.value=k.getAttribute("jsbarcode-value")||k.getAttribute("data-value"),(0,N.default)(I)}},1731:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},t=k(O(6428)),M=k(O(2216)),w=O(7497);function k(c){return c&&c.__esModule?c:{default:c}}b.default=function I(c){if("string"==typeof c)return function _(c){var h=document.querySelectorAll(c);if(0!==h.length){for(var i=[],p=0;p<h.length;p++)i.push(I(h[p]));return i}}(c);if(Array.isArray(c)){for(var h=[],i=0;i<c.length;i++)h.push(I(c[i]));return h}if(typeof HTMLCanvasElement<"u"&&c instanceof HTMLImageElement)return function l(c){var h=document.createElement("canvas");return{element:h,options:(0,t.default)(c),renderer:M.default.CanvasRenderer,afterRender:function(){c.setAttribute("src",h.toDataURL())}}}(c);if(c&&c.nodeName&&"svg"===c.nodeName.toLowerCase()||typeof SVGElement<"u"&&c instanceof SVGElement)return{element:c,options:(0,t.default)(c),renderer:M.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&c instanceof HTMLCanvasElement)return{element:c,options:(0,t.default)(c),renderer:M.default.CanvasRenderer};if(c&&c.getContext)return{element:c,renderer:M.default.CanvasRenderer};if(c&&"object"===(typeof c>"u"?"undefined":F(c))&&!c.nodeName)return{element:c,renderer:M.default.ObjectRenderer};throw new w.InvalidElementException}},6162:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function O(F){var N=[];return function t(x){if(Array.isArray(x))for(var M=0;M<x.length;M++)t(x[M]);else x.text=x.text||"",x.data=x.data||"",N.push(x)}(F),N}},4070:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var O=Object.assign||function(F){for(var N=1;N<arguments.length;N++){var t=arguments[N];for(var x in t)Object.prototype.hasOwnProperty.call(t,x)&&(F[x]=t[x])}return F};b.default=function(F,N){return O({},F,N)}},70:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function O(F){var N=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var t in N)N.hasOwnProperty(t)&&"string"==typeof F[t=N[t]]&&(F[t]=parseInt(F[t],10));return"string"==typeof F.displayValue&&(F.displayValue="false"!=F.displayValue),F}},7850:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}}},726:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function I(_,l){for(var c=0;c<l.length;c++){var h=l[c];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(_,h.key,h)}}return function(_,l,c){return l&&I(_.prototype,l),c&&I(_,c),_}}(),t=function M(I){return I&&I.__esModule?I:{default:I}}(O(4070)),x=O(3737),k=function(){function I(_,l,c){(function w(I,_){if(!(I instanceof _))throw new TypeError("Cannot call a class as a function")})(this,I),this.canvas=_,this.encodings=l,this.options=c}return F(I,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var l=0;l<this.encodings.length;l++){var c=(0,t.default)(this.options,this.encodings[l].options);this.drawCanvasBarcode(c,this.encodings[l]),this.drawCanvasText(c,this.encodings[l]),this.moveCanvasDrawing(this.encodings[l])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var l=this.canvas.getContext("2d");l.save(),(0,x.calculateEncodingAttributes)(this.encodings,this.options,l);var c=(0,x.getTotalWidthOfEncodings)(this.encodings),h=(0,x.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=c+this.options.marginLeft+this.options.marginRight,this.canvas.height=h,l.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(l.fillStyle=this.options.background,l.fillRect(0,0,this.canvas.width,this.canvas.height)),l.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(l,c){var p,h=this.canvas.getContext("2d"),i=c.data;p="top"==l.textPosition?l.marginTop+l.fontSize+l.textMargin:l.marginTop,h.fillStyle=l.lineColor;for(var S=0;S<i.length;S++){var P=S*l.width+c.barcodePadding;"1"===i[S]?h.fillRect(P,p,l.width,l.height):i[S]&&h.fillRect(P,p,l.width,l.height*i[S])}}},{key:"drawCanvasText",value:function(l,c){var p,S,h=this.canvas.getContext("2d");l.displayValue&&(S="top"==l.textPosition?l.marginTop+l.fontSize-l.textMargin:l.height+l.textMargin+l.marginTop+l.fontSize,h.font=l.fontOptions+" "+l.fontSize+"px "+l.font,"left"==l.textAlign||c.barcodePadding>0?(p=0,h.textAlign="left"):"right"==l.textAlign?(p=c.width-1,h.textAlign="right"):(p=c.width/2,h.textAlign="center"),h.fillText(c.text,p,S))}},{key:"moveCanvasDrawing",value:function(l){this.canvas.getContext("2d").translate(l.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),I}();b.default=k},2216:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var N=k(O(726)),x=k(O(7902)),w=k(O(8138));function k(I){return I&&I.__esModule?I:{default:I}}b.default={CanvasRenderer:N.default,SVGRenderer:x.default,ObjectRenderer:w.default}},8138:(W,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var O=function(){function t(x,M){for(var w=0;w<M.length;w++){var k=M[w];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(x,k.key,k)}}return function(x,M,w){return M&&t(x.prototype,M),w&&t(x,w),x}}(),N=function(){function t(x,M,w){(function F(t,x){if(!(t instanceof x))throw new TypeError("Cannot call a class as a function")})(this,t),this.object=x,this.encodings=M,this.options=w}return O(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();b.default=N},3737:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.getTotalWidthOfEncodings=b.calculateEncodingAttributes=b.getBarcodePadding=b.getEncodingHeight=b.getMaximumHeightOfEncodings=void 0;var N=function t(l){return l&&l.__esModule?l:{default:l}}(O(4070));function x(l,c){return c.height+(c.displayValue&&l.text.length>0?c.fontSize+c.textMargin:0)+c.marginTop+c.marginBottom}function M(l,c,h){if(h.displayValue&&c<l){if("center"==h.textAlign)return Math.floor((l-c)/2);if("left"==h.textAlign)return 0;if("right"==h.textAlign)return Math.floor(l-c)}return 0}function _(l,c,h){var i;if(h)i=h;else{if(!(typeof document<"u"))return 0;i=document.createElement("canvas").getContext("2d")}i.font=c.fontOptions+" "+c.fontSize+"px "+c.font;var p=i.measureText(l);return p?p.width:0}b.getMaximumHeightOfEncodings=function I(l){for(var c=0,h=0;h<l.length;h++)l[h].height>c&&(c=l[h].height);return c},b.getEncodingHeight=x,b.getBarcodePadding=M,b.calculateEncodingAttributes=function w(l,c,h){for(var i=0;i<l.length;i++){var P,p=l[i],S=(0,N.default)(c,p.options);P=S.displayValue?_(p.text,S,h):0;var R=p.data.length*S.width;p.width=Math.ceil(Math.max(P,R)),p.height=x(p,S),p.barcodePadding=M(P,R,S)}},b.getTotalWidthOfEncodings=function k(l){for(var c=0,h=0;h<l.length;h++)c+=l[h].width;return c}},7902:(W,b,O)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var F=function(){function _(l,c){for(var h=0;h<c.length;h++){var i=c[h];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(l,i.key,i)}}return function(l,c,h){return c&&_(l.prototype,c),h&&_(l,h),l}}(),t=function M(_){return _&&_.__esModule?_:{default:_}}(O(4070)),x=O(3737),k="http://www.w3.org/2000/svg",I=function(){function _(l,c,h){(function w(_,l){if(!(_ instanceof l))throw new TypeError("Cannot call a class as a function")})(this,_),this.svg=l,this.encodings=c,this.options=h,this.document=h.xmlDocument||document}return F(_,[{key:"render",value:function(){var c=this.options.marginLeft;this.prepareSVG();for(var h=0;h<this.encodings.length;h++){var i=this.encodings[h],p=(0,t.default)(this.options,i.options),S=this.createGroup(c,p.marginTop,this.svg);this.setGroupOptions(S,p),this.drawSvgBarcode(S,p,i),this.drawSVGText(S,p,i),c+=i.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,x.calculateEncodingAttributes)(this.encodings,this.options);var c=(0,x.getTotalWidthOfEncodings)(this.encodings),h=(0,x.getMaximumHeightOfEncodings)(this.encodings),i=c+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(i,h),this.options.background&&this.drawRect(0,0,i,h,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(c,h,i){var S,p=i.data;S="top"==h.textPosition?h.fontSize+h.textMargin:0;for(var P=0,R=0,U=0;U<p.length;U++)R=U*h.width+i.barcodePadding,"1"===p[U]?P++:P>0&&(this.drawRect(R-h.width*P,S,h.width*P,h.height,c),P=0);P>0&&this.drawRect(R-h.width*(P-1),S,h.width*P,h.height,c)}},{key:"drawSVGText",value:function(c,h,i){var S,P,p=this.document.createElementNS(k,"text");h.displayValue&&(p.setAttribute("style","font:"+h.fontOptions+" "+h.fontSize+"px "+h.font),P="top"==h.textPosition?h.fontSize-h.textMargin:h.height+h.textMargin+h.fontSize,"left"==h.textAlign||i.barcodePadding>0?(S=0,p.setAttribute("text-anchor","start")):"right"==h.textAlign?(S=i.width-1,p.setAttribute("text-anchor","end")):(S=i.width/2,p.setAttribute("text-anchor","middle")),p.setAttribute("x",S),p.setAttribute("y",P),p.appendChild(this.document.createTextNode(i.text)),c.appendChild(p))}},{key:"setSvgAttributes",value:function(c,h){var i=this.svg;i.setAttribute("width",c+"px"),i.setAttribute("height",h+"px"),i.setAttribute("x","0px"),i.setAttribute("y","0px"),i.setAttribute("viewBox","0 0 "+c+" "+h),i.setAttribute("xmlns",k),i.setAttribute("version","1.1"),i.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(c,h,i){var p=this.document.createElementNS(k,"g");return p.setAttribute("transform","translate("+c+", "+h+")"),i.appendChild(p),p}},{key:"setGroupOptions",value:function(c,h){c.setAttribute("style","fill:"+h.lineColor+";")}},{key:"drawRect",value:function(c,h,i,p,S){var P=this.document.createElementNS(k,"rect");return P.setAttribute("x",c),P.setAttribute("y",h),P.setAttribute("width",i),P.setAttribute("height",p),S.appendChild(P),P}}]),_}();b.default=I}}]);
|