dealposbarcode 1.4.4 → 1.4.6

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.
@@ -0,0 +1 @@
1
+ (self.webpackChunkbarcode_app=self.webpackChunkbarcode_app||[]).push([[467],{9467:(J,S,O)=>{"use strict";O.r(S),O.d(S,{PagesModule:()=>Be});var F=O(6895),N=O(3893),t=O(4650),x=O(1135),A=O(9300);class P{constructor(){this.store=new x.X([])}getState(){return this.store.asObservable().pipe((0,A.h)(o=>void 0!==o))}setState(o){this.store.next(o)}}P.\u0275fac=function(o){return new(o||P)},P.\u0275prov=t.Yz7({token:P,factory:P.\u0275fac,providedIn:"root"});var C=O(3389),I=O(5083),b=O(7579),l=O(2722),u=O(8412),h=(()=>{return(k=h||(h={}))[k.SUPPLIER_BILL=0]="SUPPLIER_BILL",k[k.OUTLET_DELIVERY=1]="OUTLET_DELIVERY",h;var k})(),n=O(5412),p=O(6985),_=O(433),w=O(8796),R=O(4405);class U{constructor(o,r){this.data=o,this.dialogRef=r,this.outlets=o.outlets}ngOnInit(){this.initModalConfig(),this.initTransactionType()}initModalConfig(){this.modalConfig=new p.O,this.modalConfig.title="Choose your transaction",this.modalConfig.hideMoreButton=!0}initTransactionType(){this.transactionTypes=[{title:"Supplier Bill",type:h.SUPPLIER_BILL},{title:"Transfer Order",type:h.OUTLET_DELIVERY}]}onOk(){this.selectedOutlet&&this.poNumber&&this.dialogRef.close({Outlet:this.selectedOutlet.getName,Number:this.poNumber,Type:this.selectedTransactionType})}onCancel(){this.dialogRef.close()}}U.\u0275fac=function(o){return new(o||U)(t.Y36(n.WI),t.Y36(n.so))},U.\u0275cmp=t.Xpm({type:U,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(o,r){1&o&&(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(V){return r.selectedTransactionType=V}),t.qZA()()(),t.TgZ(9,"tr",4)(10,"td",6)(11,"ng-select",7),t.NdJ("ngModelChange",function(V){return r.selectedOutlet=V}),t.qZA()()(),t.TgZ(12,"tr",4)(13,"td",6)(14,"div",8)(15,"input",9),t.NdJ("ngModelChange",function(V){return r.poNumber=V}),t.qZA(),t.TgZ(16,"label",10),t._uU(17,"Invoice Number"),t.qZA()()()()()()()()()()),2&o&&(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:[_.Fj,_.JJ,_.On,w.w9,R.M]});var j=O(8505),q=O(4004),ie=O(1104);class re{constructor(o){this.httpService=o,this.barcodeConfigState=new x.X(null)}updatePaperFormatConfig(o){let r=localStorage.getItem("Domain");return this.httpService.post("/api/Config/SaveConfig",{SubDomain:r,Version:this.paperFormatVersion,PaperFormats:o})}getPaperFormatConfig(){let o=localStorage.getItem("Domain"),r=[];return this.httpService.post("/api/Config/PaperConfig",{SubDomain:o}).pipe((0,q.U)(G=>(this.paperFormatVersion=G.version,r=G.PaperFormats,r)))}setBarcodeConfigState(o){this.barcodeConfigState.next(o)}getBarcodeConfigState(){return this.barcodeConfigState.asObservable().pipe((0,A.h)(o=>u.gT.IsNotEmpty(o)))}}re.\u0275fac=function(o){return new(o||re)(t.LFG(ie.O))},re.\u0275prov=t.Yz7({token:re,factory:re.\u0275fac,providedIn:"root"});var oe=O(529);class me{constructor(o){o&&(this.AccountID=o.AccountID,this.CalculationTypeID=o.CalculationTypeID,this.ID=o.ID,this.Index=o.Index,this.Label=o.Label,this.MultipleTaxTypeID=o.MultipleTaxTypeID,this.Note=o.Note,this.PrintVisible=o.PrintVisible,this.Rate=o.Rate,this.TypeID=o.TypeID,this.Name=o.Name,this.Type=o.Type)}get getID(){return this.ID}get getType(){return this.Type}get getName(){return this.Name}get getAccountID(){return this.AccountID}set setAccountId(o){this.AccountID=o}get getCalculationTypeID(){return this.CalculationTypeID}set setCalculationID(o){this.CalculationTypeID=o}get getRate(){return this.Rate}set setRate(o){this.Rate=o}get getLabel(){return this.Label}}class ye{get getPriceDiscount(){return this.PriceDiscount}set setPriceDiscount(o){this.PriceDiscount=o}get getReleaseDate(){return this.ReleasedDate}set setReleaseDate(o){this.ReleasedDate=o}get getID(){return this.ID}set setID(o){this.ID=o}get getSelectedPromotion(){return this.SelectedPromotion}set setSelectedPromotion(o){this.SelectedPromotion=o}get getDescription(){return this.description}set setDescription(o){this.description=o}set setBarcodeTitle(o){this.barcodeTitle=o}get getBarcodeTitle(){return this.barcodeTitle}set setCustomPrice(o){this.customPrice=o}get getCustomPrice(){return this.customPrice}get getUnitPrice(){return this.UnitPrice}set setUnitPrice(o){this.UnitPrice=o}get getCode(){return this.Code}set setCode(o){this.barcodeTitle=o,this.Code=o}get getModel(){return this.Model}set setModel(o){this.Model=o}get getName(){return this.Name}set setName(o){this.Name=o}get getCurrency(){return this.CurrencySymbol}set setCurrency(o){this.CurrencySymbol=o}}class H{get getCode(){return this.Code}get getName(){return this.Name}get getSuspended(){return this.Suspended}set setCode(o){this.Code=o}set setName(o){this.Name=o}set setSuspended(o){this.Suspended=o}}class T{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(o){this.Outlet=o}set setNumber(o){this.Number=o}set setDate(o){this.Date=o}set setDueDate(o){this.DueDate=o}set setSupplier(o){this.Supplier=o}set setCreatorID(o){this.CreatorID=o}set setCreated(o){this.Created=o}set setDiscount1(o){this.Discount1=o}set setDiscountAmount(o){this.DiscountAmount=o}set setGross(o){this.Gross=o}set setDiscountTotal(o){this.DiscountTotal=o}set setTaxType(o){this.TaxType=o}set setTax(o){this.Tax=o}set setPurchase(o){this.Purchase=o}set setPurchaseNTax(o){this.PurchaseNTax=o}set setDelivery(o){this.Delivery=o}set setVariants(o){this.Variants=o}set setPayments(o){this.Payments=o}}class X extends ye{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(o){this.VariantID=o}set setQuantity(o){this.Quantity=o}set setPrice(o){this.Price=o}set setDiscount(o){this.Discount=o}set setNettPrice(o){this.NettPrice=o}}class ${get getID(){return this.ID}set setID(o){this.ID=o}get getName(){return this.Name}set setName(o){this.Name=o}get getDiscount(){return this.Discount}get getExtraCost(){return this.ExtraCost}get getPromotionID(){return this.PromotionID}get getUnitPrice(){return this.UnitPrice}set setDiscount(o){this.Discount=o}set setExtraCost(o){this.ExtraCost=o}set setPromotionID(o){this.PromotionID=o}set setUnitPrice(o){this.UnitPrice=o}}class K{constructor(){}getProductModel(o){let r=new ye;return r.setID=o.ID,r.setCode=o.Code,r.setCurrency=o.CurrencySymbol,r.setModel=o.Model,r.setName=o.Name,r.setUnitPrice=o.UnitPrice,r.setDescription=o.Description,r.setReleaseDate=o.ReleasedDate,r.setPriceDiscount=o.PriceDiscount,r}getTaxModel(o){return new me(o)}getOutletModel(o){let r=new H;return r.setCode=o.Code,r.setName=o.Name,r.setSuspended=o.Suspended,r}getVariantModel(o){let r=new X;return r.setCode=o.Code,r.setDiscount=o.Discount,r.setNettPrice=o.NettPrice,r.setPrice=o.Price,r.setUnitPrice=o.UnitPrice,r.setQuantity=o.Quantity,r.setVariantID=o.VariantID,r.setName=o.Name,r}getBillModel(o){let r=new T;return r.setNumber=o.Number,r.setOutlet=o.Outlet,r.setVariants=o.Variants?o.Variants.map(g=>this.getVariantModel(g)):[],r}getPromotionModel(o){let r=new $;return r.setDiscount=o.Discount,r.setExtraCost=o.ExtraCost,r.setPromotionID=o.PromotionID,r.setUnitPrice=o.UnitPrice,r.setName=o.Name,r.setID=o.ID,r}}K.\u0275fac=function(o){return new(o||K)},K.\u0275prov=t.Yz7({token:K,factory:K.\u0275fac,providedIn:"root"});class ee{constructor(o,r,g){this.httpService=o,this.http=r,this.factoryService=g}getProductById(o){let r=localStorage.getItem("Domain");return this.httpService.post(`https://${r}/API/V3/Variant/ID`,{ID:o}).pipe((0,q.U)(g=>this.factoryService.getProductModel(g)))}getPromotionByProducID(o){let r=localStorage.getItem("Domain");return this.httpService.post(`https://${r}/API/v3/PromotionEvent/GetByVariantID`,{VariantID:o}).pipe((0,q.U)(g=>g.map(G=>this.factoryService.getPromotionModel(G))))}uploadProducts(o){let r=localStorage.getItem("Domain"),g=new FormData;return g.append("file",o,o.name),this.httpService.postFormData(`https://${r}/API/catalog/product/UploadCSVforBarcode`,g).pipe((0,q.U)(V=>V.map(G=>(G.Print=G.Print.map(Q=>this.factoryService.getProductModel(Q)),G))))}getTax(){let o=localStorage.getItem("Domain"),r=localStorage.getItem("Token"),g=`https://${o}/API/V3/Tax`,V=new oe.WM({authorization:"Bearer "+r,"content-type":"application/json","X-ClientId":"dealpos-app"});return this.http.get(g,{headers:V}).pipe((0,q.U)(G=>{if(G)return G.map(Q=>this.factoryService.getTaxModel(Q))}))}}ee.\u0275fac=function(o){return new(o||ee)(t.LFG(ie.O),t.LFG(oe.eN),t.LFG(K))},ee.\u0275prov=t.Yz7({token:ee,factory:ee.\u0275fac,providedIn:"root"});var Ve=O(7370);class ge{set _max(o){o&&(this.max=o,this.updateNumericSettings())}set _min(o){o&&(this.min=o,this.updateNumericSettings())}constructor(o){this.elementRef=o,this.decimalPlaces=4,this.modifyValueOnWheel=!0,this.max="999999999999999.9999",this.min="-999999999999999.9999",this.propagateChange=g=>{},this.preventNegative=!1,this.numericElement=new Ve(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 o={maximumValue:this.max,minimumValue:this.min,readOnly:this.isElementDisabled(),decimalPlaces:this.decimalPlaces,modifyValueOnWheel:this.modifyValueOnWheel};this.numericElement.update(o)}onKeyUp(){let o=this.numericElement.getNumber();this.propagateChange(o)}isElementDisabled(){let o=!1;return(!0===this.elementRef.nativeElement.readOnly||!0===this.elementRef.nativeElement.disabled)&&(o=!0),o}writeValue(o){null!=o&&this.numericElement.set(o)}registerOnChange(o){this.propagateChange=o}registerOnTouched(){}}ge.\u0275fac=function(o){return new(o||ge)(t.Y36(t.SBq))},ge.\u0275dir=t.lG2({type:ge,selectors:[["","autoNum",""]],hostBindings:function(o,r){1&o&&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:_.JU,useExisting:(0,t.Gpc)(()=>ge),multi:!0}])]});var Ne=O(4120),ze=O(8372),pe=O(3238);const fe=["input"];function Ue(k,o){if(1&k&&t._UZ(0,"img",10),2&k){const r=t.oxw().$implicit;t.Q6J("src",r.ImgUrl,t.LSH)}}function Ie(k,o){if(1&k){const r=t.EpF();t.TgZ(0,"mat-option",8),t.NdJ("click",function(V){const Q=t.CHM(r).$implicit;return t.oxw().changeDisplayName(Q),t.KtG(V.stopPropagation())}),t.YNc(1,Ue,1,1,"img",9),t._uU(2),t.qZA()}if(2&k){const r=o.$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 _e{set display(o){this.input.nativeElement.value=o}get value(){return this._value}set value(o){this._value=o,this.propagateChange(this._value)}constructor(o,r){this.httpService=o,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 _.p4(""),this.options=[],this.complete=!1,this.foundProduct=!1,this.propagateChange=g=>{},this.termControl.valueChanges.pipe((0,ze.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(o){null!=o.ngModel&&null==o.ngModel.currentValue&&this.clear(),null!=o.display&&o.display.currentValue!=o.display.previousValue&&this.termControl.setValue(o.display.currentValue)}ngAfterViewInit(){}search(o){if(this.termControl.value.length>0){let r={};if(this.data&&(r=this.data),r.prefix=o,r.count=100,this.complete)this.complete=!1;else{let g=this.url,V=localStorage.getItem("Domain");V&&(g=`https://${V}${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(o){this.input.nativeElement.value=o.Value}onKeydown(o){const r=o.key;"Enter"===r?(this.clearOnSelect&&this.clear(),!this.foundProduct&&this.termControl.value.length>0&&(this.onEnter.emit(this.termControl.value),o.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(o){return o&&o.Value}writeValue(o){}registerOnChange(o){this.propagateChange=o}registerOnTouched(){}}_e.\u0275fac=function(o){return new(o||_e)(t.Y36(ie.O),t.Y36(t.R0b))},_e.\u0275cmp=t.Xpm({type:_e,selectors:[["autocomplete"]],viewQuery:function(o,r){if(1&o&&t.Gf(fe,7),2&o){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:_.JU,useExisting:(0,t.Gpc)(()=>_e),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(o,r){if(1&o&&(t.TgZ(0,"mat-form-field",0)(1,"div",1)(2,"input",2,3),t.NdJ("paste",function(V){return r.inputLock?V.preventDefault():""})("keydown",function(V){return r.onKeydown(V)})("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,Ie,3,3,"mat-option",7),t.qZA()),2&o){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:[Ne.XC,pe.ey,Ne.ZL,F.sg,F.O5,_.Fj,_.JJ,_.oH],styles:["mat-option[_ngcontent-%COMP%]{font-size:12px}"]});class be{}be.\u0275fac=function(o){return new(o||be)},be.\u0275mod=t.oAB({type:be}),be.\u0275inj=t.cJS({imports:[Ne.Bb,F.ez,_.UX]});class Se{constructor(o,r,g,V,G){this.dialogRef=o,this.barcodeService=r,this.productService=g,this.authenticationService=V,this.data=G,this.modalConfig=new p.O,this.variantName="",this.hasProductEdit=!0,this.hasPromotion=!1,this.destroy$=new b.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 o=this.authenticationService.getRoles();this.hasProductEdit=-1!==o.findIndex(r=>"ProdE"==r)}initProductUpdate(){u.gT.IsNotEmpty(this.data.variantId)&&this.getProductById(this.data.variantId).subscribe(o=>{this.product.setSelectedPromotion=this.data.promotion,this.hasPromotion=u.gT.IsNotEmpty(this.data.promotion)})}getBarcodeConfig(){this.barcodeService.getBarcodeConfigState().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&(this.paperFormat=o)})}initModalConfig(){this.modalConfig.title="Add New Product Barcode?",this.modalConfig.hideMoreButton=!0}onSelectProduct(o){this.getProductById(o).subscribe(r=>{this.customPrice=r.getUnitPrice,this.hasPromotion=!1,this.product.setSelectedPromotion=null})}getProductById(o){return this.productService.getProductById(o).pipe((0,j.b)(r=>{this.product=r,this.getPromotionByProductID(o)}))}getPromotionByProductID(o){this.productService.getPromotionByProducID(o).subscribe(r=>{this.promotions=r})}onCustomPriceChange(o){this.customPrice=o}onSelectPromotion(o){o?(this.product.setSelectedPromotion=this.promotions.find(r=>r.getName==o?.getName),this.customPrice=this.product.getUnitPrice,this.hasPromotion=u.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()}}Se.\u0275fac=function(o){return new(o||Se)(t.Y36(n.so),t.Y36(re),t.Y36(ee),t.Y36(C.$),t.Y36(n.WI))},Se.\u0275cmp=t.Xpm({type:Se,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(o,r){1&o&&(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(V){return r.onSelectProduct(V)}),t.qZA()()(),t.TgZ(9,"tr",4)(10,"td")(11,"div",6)(12,"input",7),t.NdJ("ngModelChange",function(V){return r.qty=V}),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(V){return r.onSelectPromotion(V)}),t.qZA()()(),t.TgZ(18,"tr",4)(19,"td")(20,"div",6)(21,"input",11),t.NdJ("ngModelChange",function(V){return r.onCustomPriceChange(V)}),t.qZA(),t.TgZ(22,"label",12),t._uU(23,"Price"),t.qZA()()()()()()()()()()),2&o&&(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:[_.Fj,_.JJ,_.On,w.w9,R.M,ge,_e]});class xe{constructor(o,r){this.dialogRef=o,this.data=r,this.event=new t.vpe,this.modalConfig=new p.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(o){o&&(this.files=o.target.files)}}xe.\u0275fac=function(o){return new(o||xe)(t.Y36(n.so),t.Y36(n.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(o,r){1&o&&(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(V){return r.onUploadFile(V)}),t.qZA()()()()()()()()()),2&o&&t.Q6J("config",r.modalConfig)},dependencies:[R.M]});var Ae=O(7185);class Pe{constructor(o,r){this.httpService=o,this.factoryService=r}get(){let r=localStorage.getItem("Domain");return this.httpService.post(`https://${r}/api/v3/Outlet/p`,{Suspended:!1}).pipe((0,q.U)(g=>{let V=[];return g&&(V=g.map(G=>this.factoryService.getOutletModel(G))),V}))}}Pe.\u0275fac=function(o){return new(o||Pe)(t.LFG(ie.O),t.LFG(K))},Pe.\u0275prov=t.Yz7({token:Pe,factory:Pe.\u0275fac,providedIn:"root"});class he{constructor(o,r){this.httpService=o,this.factoryService=r}get(o){let r=localStorage.getItem("Domain"),g=this.getEndPointByType(o.Type);return this.httpService.post(`https://${r}${g}`,{Outlet:o.Outlet,Number:o.Number}).pipe((0,q.U)(G=>G.map(Q=>this.factoryService.getVariantModel(Q))))}getEndPointByType(o){let r;return r=o===h.SUPPLIER_BILL?"/API/V3/Barcode/byBillNumber":"/API/V3/Barcode/byOutletDeliveryNumber",r}}function Ze(k,o){if(1&k){const r=t.EpF();t.TgZ(0,"tr",22),t.NdJ("click",function(){const V=t.CHM(r),G=V.$implicit,Q=V.index,ae=t.oxw();return t.KtG(ae.onUpdateProduct(G,Q))}),t.TgZ(1,"td")(2,"i",23),t.NdJ("click",function(){const G=t.CHM(r).index,Q=t.oxw();return t.KtG(Q.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&k){const r=o.$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)}}he.\u0275fac=function(o){return new(o||he)(t.LFG(ie.O),t.LFG(K))},he.\u0275prov=t.Yz7({token:he,factory:he.\u0275fac,providedIn:"root"});class ve{constructor(o,r,g,V,G,Q,ae){this.dialog=o,this.productStateService=r,this.productService=g,this.toastService=V,this.queryParamService=G,this.outletService=Q,this.billService=ae,this.destroy$=new b.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,A.h)(o=>u.gT.IsEmpty(o))).subscribe(o=>{o?.ID&&this.getProductById(o.ID,5),o.billNumber&&this.getBill({Number:o.billNumber,Outlet:o.outletName,Type:h.SUPPLIER_BILL})})}initOutlets(){this.outletService.get().pipe((0,l.R)(this.destroy$)).subscribe(o=>{this.outlets=o})}onAddBill(){this.dialog.open(U,{width:"350px",data:{outlets:this.outlets}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&this.getBill(o)})}getBill(o){this.billService.get(o).pipe((0,l.R)(this.destroy$)).subscribe(r=>{r&&r.forEach(g=>{this.checkAvailableProductCode(g);let V=this.generateProductByQty(g,g.getQuantity);this.productGroups=[...this.productGroups,{VariantID:g.getVariantID,Quantity:g.getQuantity,Variants:V}],this.updateProductsSource()})})}onAddProduct(){this.dialog.open(Se,{width:"350px",data:{variantName:"",variantId:null,qty:null}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&(this.customPrice=o.customPrice,this.generateProductBarcode(o.product,o.quantity))})}getProductById(o,r){this.productService.getProductById(o).pipe((0,l.R)(this.destroy$)).subscribe(g=>{g&&this.generateProductBarcode(g,r)})}generateProductBarcode(o,r){this.checkAvailableProductCode(o);let g=this.generateProductByQty(o,r);g=this.updateCustomPriceProducts(g),this.productGroups=[...this.productGroups,{VariantID:o.getID,Quantity:r,Variants:g}],this.updateProductsSource()}checkAvailableProductCode(o){o.getCode||this.toastService.error("Product has no code","Code Not Found")}onUpdateProduct(o,r){this.dialog.open(Se,{width:"350px",data:{variantName:o.Variants[0].getName+" - "+o.Variants[0].getCode,variantId:o.VariantID,qty:o.Quantity,customPrice:o.Variants[0].getCustomPrice,promotion:o.Variants[0].getSelectedPromotion}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(de=>{if(de){this.customPrice=de.customPrice,this.checkAvailableProductCode(de.product);let Te=this.generateProductByQty(de.product,de.quantity);Te=this.updateCustomPriceProducts(Te),this.productGroups[r].Variants=Te,this.productGroups[r].Quantity=de.quantity,this.productGroups[r].VariantID=de.product.getID,this.updateProductsSource()}})}onDeleteProduct(o){this.productGroups=this.productGroups.filter((r,g)=>g!==o),this.updateProductsSource()}updateProductsSource(){this.productSource=[],this.productGroups.forEach(o=>{this.productSource=[...this.productSource,...o.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(o=>{if(o){let r;this.productService.uploadProducts(o[0]).pipe((0,l.R)(this.destroy$)).subscribe(g=>{g&&(this.productGroups=[...this.productGroups,...g.map(V=>(r={Quantity:V.Quantity,VariantID:V.VariantID,Variants:V.Print},r))],this.updateProductsSource())})}})}updateCustomPriceProducts(o){let r=o;return this.customPrice&&(r=o.map(g=>(g.setCustomPrice=this.customPrice,g))),r}generateProductByQty(o,r){let g=[];for(let V=1;V<=r;V++)g.push(o);return g}onClear(){this.productGroups=[],this.updateProductsSource()}onPrint(){window.print()}}ve.\u0275fac=function(o){return new(o||ve)(t.Y36(n.uw),t.Y36(P),t.Y36(ee),t.Y36(Ae._W),t.Y36(I.U),t.Y36(Pe),t.Y36(he))},ve.\u0275cmp=t.Xpm({type:ve,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(o,r){1&o&&(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,Ze,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&o&&(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 qe=O(7188),we=O(1281);let a=(()=>{class k{constructor(){this._listeners=[]}notify(r,g){for(let V of this._listeners)V(r,g)}listen(r){return this._listeners.push(r),()=>{this._listeners=this._listeners.filter(g=>r!==g)}}ngOnDestroy(){this._listeners=[]}}return k.\u0275fac=function(r){return new(r||k)},k.\u0275prov=t.Yz7({token:k,factory:k.\u0275fac,providedIn:"root"}),k})();const v=["input"],c=["*"];let E=0;class M{constructor(o,r){this.source=o,this.value=r}}const Z={provide:_.JU,useExisting:(0,t.Gpc)(()=>ne),multi:!0},y=new t.OlP("MatRadioGroup"),L=new t.OlP("mat-radio-default-options",{providedIn:"root",factory:function D(){return{color:"accent"}}});let B=(()=>{class k{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,we.Ig)(r),this._markRadiosForCheck()}get required(){return this._required}set required(r){this._required=(0,we.Ig)(r),this._markRadiosForCheck()}constructor(r){this._changeDetector=r,this._value=null,this._name="mat-radio-group-"+E++,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 M(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 k.\u0275fac=function(r){return new(r||k)(t.Y36(t.sBO))},k.\u0275dir=t.lG2({type:k,inputs:{color:"color",name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required"},outputs:{change:"change"}}),k})();class z{constructor(o){this._elementRef=o}}const W=(0,pe.Kr)((0,pe.sb)(z));let Y=(()=>{class k extends W{get checked(){return this._checked}set checked(r){const g=(0,we.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,we.Ig)(r))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(r){this._required=(0,we.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,V,G,Q,ae,ue,te){super(g),this._changeDetector=V,this._focusMonitor=G,this._radioDispatcher=Q,this._providerOverride=ue,this._uniqueId="mat-radio-"+ ++E,this.id=this._uniqueId,this.change=new t.vpe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=r,this._noopAnimations="NoopAnimations"===ae,te&&(this.tabIndex=(0,we.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 M(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 V=this._inputElement?.nativeElement;V&&(V.setAttribute("tabindex",g+""),this._previousTabIndex=g)}}}return k.\u0275fac=function(r){t.$Z()},k.\u0275dir=t.lG2({type:k,viewQuery:function(r,g){if(1&r&&t.Gf(v,5),2&r){let V;t.iGM(V=t.CRH())&&(g._inputElement=V.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]}),k})(),ne=(()=>{class k extends B{}return k.\u0275fac=function(){let o;return function(g){return(o||(o=t.n5z(k)))(g||k)}}(),k.\u0275dir=t.lG2({type:k,selectors:[["mat-radio-group"]],contentQueries:function(r,g,V){if(1&r&&t.Suo(V,le,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([Z,{provide:y,useExisting:k}]),t.qOj]}),k})(),le=(()=>{class k extends Y{constructor(r,g,V,G,Q,ae,ue,te){super(r,g,V,G,Q,ae,ue,te)}}return k.\u0275fac=function(r){return new(r||k)(t.Y36(y,8),t.Y36(t.SBq),t.Y36(t.sBO),t.Y36(qe.tE),t.Y36(a),t.Y36(t.QbO,8),t.Y36(L,8),t.$8M("tabindex"))},k.\u0275cmp=t.Xpm({type:k,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:c,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 V=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",V)("matRippleDisabled",g._isRippleDisabled())("matRippleCentered",!0),t.xp6(2),t.Q6J("for",g.inputId)}},dependencies:[pe.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}),k})(),se=(()=>{class k{}return k.\u0275fac=function(r){return new(r||k)},k.\u0275mod=t.oAB({type:k}),k.\u0275inj=t.cJS({imports:[pe.BQ,F.ez,pe.si,pe.BQ]}),k})();function Oe(k,o){if(1&k){const r=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2,"Selected Tax"),t.qZA(),t.TgZ(3,"td")(4,"ng-select",30),t.NdJ("ngModelChange",function(V){t.CHM(r);const G=t.oxw();return t.KtG(G.taxOptionSelected=V)})("change",function(){t.CHM(r);const V=t.oxw();return t.KtG(V.onSelectTaxType())}),t.qZA()(),t.TgZ(5,"td")(6,"span"),t._uU(7,"Applied Tax ex: 100 + 10% = 110"),t.qZA()()()}if(2&k){const r=t.oxw();t.xp6(4),t.Q6J("items",r.taxOptions)("ngModel",r.taxOptionSelected)("clearable",!1)}}const ce=function(k){return{active:k}};class Ee{constructor(o,r){this.dialogRef=o,this.data=r,this.event=new t.vpe,this.modalConfig=new p.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.taxs=r.taxs,this.authTax=r.authTax,this.initTaxOptions(),this.activeTab="paper"}ngOnInit(){this.initModalConfig(),this.initFormValue(),this.authTax&&this.initTaxOptionSelected()}initTaxOptions(){this.taxOptions=[],this.taxs.forEach((o,r)=>{this.taxOptions=[...this.taxOptions,{id:r+1,name:o.getName,ID:o.getID}]})}initTaxOptionSelected(){this.taxSelected&&(this.taxOptionSelected=this.taxOptions.find(o=>o.ID===this.taxSelected.ID))}onSelectTaxType(){this.taxSelected=this.taxs.find(o=>o.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)}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)}checkPriceWithTax(){this.priceTax||(this.taxSelected=this.taxs.find(o=>"No Tax"==o.getLabel))}dataTarget(o){this.activeTab=o}}Ee.\u0275fac=function(o){return new(o||Ee)(t.Y36(n.so),t.Y36(n.WI))},Ee.\u0275cmp=t.Xpm({type:Ee,selectors:[["app-form-settings"]],outputs:{event:"event"},decls:336,vars:78,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"],["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"]],template:function(o,r){1&o&&(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(V){return r.paperWidth=V}),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(V){return r.stickerWidth=V}),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(V){return r.stickerHeight=V}),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(V){return r.marginLeft=V}),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(V){return r.marginTop=V}),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(V){return r.spacingRow=V}),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(V){return r.spacingColumn=V}),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")(118,"div",14)(119,"input",15),t.NdJ("ngModelChange",function(V){return r.barcodeHeight=V}),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(V){return r.fontSize=V}),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",20)(143,"mat-radio-button",21),t.NdJ("change",function(){return r.barcode=!1}),t._uU(144,"No "),t.qZA(),t.TgZ(145,"mat-radio-button",22),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",20)(155,"mat-radio-button",21),t.NdJ("change",function(){return r.code=!1}),t._uU(156,"No "),t.qZA(),t.TgZ(157,"mat-radio-button",22),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",20)(167,"mat-radio-button",21),t.NdJ("change",function(){return r.price=!1}),t._uU(168,"No "),t.qZA(),t.TgZ(169,"mat-radio-button",22),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",20)(179,"mat-radio-button",21),t.NdJ("change",function(){return r.name=!1}),t._uU(180,"No "),t.qZA(),t.TgZ(181,"mat-radio-button",22),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",20)(191,"mat-radio-button",21),t.NdJ("change",function(){return r.move=!1}),t._uU(192,"No "),t.qZA(),t.TgZ(193,"mat-radio-button",22),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",20)(203,"mat-radio-button",21),t.NdJ("change",function(){return r.relaseDate=!1}),t._uU(204,"No "),t.qZA(),t.TgZ(205,"mat-radio-button",22),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",20)(215,"mat-radio-button",21),t.NdJ("change",function(){return r.priceDiscount=!1}),t._uU(216,"No "),t.qZA(),t.TgZ(217,"mat-radio-button",22),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",23)(223,"table",13)(224,"tr")(225,"td"),t._uU(226,"Price with Tax"),t.qZA(),t.TgZ(227,"td")(228,"mat-radio-group",20)(229,"mat-radio-button",21),t.NdJ("change",function(){return r.priceTax=!1}),t._uU(230," No"),t.qZA(),t.TgZ(231,"mat-radio-button",22),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,Oe,8,3,"tr",24),t.TgZ(237,"tr")(238,"td"),t._uU(239,"Currency"),t.qZA(),t.TgZ(240,"td")(241,"div",14)(242,"input",25),t.NdJ("ngModelChange",function(V){return r.currencySymbol=V}),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",26),t.NdJ("ngModelChange",function(V){return r.PriceFontSize=V}),t.qZA()()(),t.TgZ(252,"td")(253,"span"),t._uU(254,"Change font size for price"),t.qZA()()()()(),t.TgZ(255,"div",27)(256,"table",13)(257,"tr")(258,"td"),t._uU(259,"Max Character"),t.qZA(),t.TgZ(260,"td")(261,"div",14)(262,"input",15),t.NdJ("ngModelChange",function(V){return r.maxChar=V}),t.qZA()()(),t.TgZ(263,"td")(264,"span"),t._uU(265,"The max character of the product name"),t.qZA()()(),t.TgZ(266,"tr")(267,"td"),t._uU(268,"Name Prefix"),t.qZA(),t.TgZ(269,"td")(270,"div",14)(271,"input",25),t.NdJ("ngModelChange",function(V){return r.namePrefix=V}),t.qZA()()(),t.TgZ(272,"td")(273,"span"),t._uU(274,"A word, letter, or number placed before product name"),t.qZA()()(),t.TgZ(275,"tr")(276,"td"),t._uU(277,"Store Name"),t.qZA(),t.TgZ(278,"td")(279,"div",14)(280,"input",25),t.NdJ("ngModelChange",function(V){return r.storeName=V}),t.qZA()()(),t.TgZ(281,"td")(282,"span"),t._uU(283,"The name of the store"),t.qZA()()(),t.TgZ(284,"tr")(285,"td"),t._uU(286,"Orientation"),t.qZA(),t.TgZ(287,"td")(288,"ng-select",28),t.NdJ("ngModelChange",function(V){return r.orientationType=V}),t.qZA()(),t.TgZ(289,"td")(290,"span"),t._uU(291,"Horizontal or Vertical Position store name label"),t.qZA()()(),t.TgZ(292,"tr")(293,"td"),t._uU(294,"Use description as code"),t.qZA(),t.TgZ(295,"td")(296,"mat-radio-group",20)(297,"mat-radio-button",21),t.NdJ("change",function(){return r.desc=!1}),t._uU(298,"No "),t.qZA(),t.TgZ(299,"mat-radio-button",22),t.NdJ("change",function(){return r.desc=!0}),t._uU(300,"Yes"),t.qZA()()(),t.TgZ(301,"td")(302,"span"),t._uU(303,"Copy product description into Product Code"),t.qZA()()(),t.TgZ(304,"tr")(305,"td"),t._uU(306,'Remove "Default"'),t.qZA(),t.TgZ(307,"td")(308,"mat-radio-group",20)(309,"mat-radio-button",21),t.NdJ("change",function(){return r.removeDefault=!1}),t._uU(310,"No "),t.qZA(),t.TgZ(311,"mat-radio-button",22),t.NdJ("change",function(){return r.removeDefault=!0}),t._uU(312,"Yes"),t.qZA()()(),t.TgZ(313,"td")(314,"span"),t._uU(315,'Remove "Default" Label from product name'),t.qZA()()()()(),t.TgZ(316,"div",29)(317,"table",13)(318,"tr")(319,"td"),t._uU(320,"Normal Price"),t.qZA(),t.TgZ(321,"td")(322,"div",14)(323,"input",25),t.NdJ("ngModelChange",function(V){return r.basicPriceLabel=V}),t.qZA()()(),t.TgZ(324,"td")(325,"span"),t._uU(326,"Custom label normal price"),t.qZA()()(),t.TgZ(327,"tr")(328,"td"),t._uU(329,"Promotion Price"),t.qZA(),t.TgZ(330,"td")(331,"div",14)(332,"input",25),t.NdJ("ngModelChange",function(V){return r.promotionPriceLabel=V}),t.qZA()()(),t.TgZ(333,"td")(334,"span"),t._uU(335,"Custom label promotion price"),t.qZA()()()()()()()()()),2&o&&(t.Q6J("config",r.modalConfig),t.xp6(6),t.Q6J("ngClass",t.VKq(54,ce,"paper"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(56,ce,"spacing"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(58,ce,"sticker-content"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(60,ce,"price"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(62,ce,"advanced"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(64,ce,"promotionLabel"===r.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(66,ce,"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(68,ce,"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(70,ce,"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(72,ce,"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("ngClass",t.VKq(74,ce,"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(76,ce,"promotionLabel"===r.activeTab)),t.xp6(7),t.Q6J("ngModel",r.basicPriceLabel),t.xp6(9),t.Q6J("ngModel",r.promotionPriceLabel))},dependencies:[F.mk,F.O5,_.Fj,_.wV,_.JJ,_.On,w.w9,R.M,ge,ne,le],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 We=O(7243);const Je=["bcElement"];let ke=(()=>{class k{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")}We(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 k.\u0275fac=function(r){return new(r||k)(t.Y36(t.Qsj))},k.\u0275cmp=t.Xpm({type:k,selectors:[["ngx-barcode6"]],viewQuery:function(r,g){if(1&r&&t.Gf(Je,5),2&r){let V;t.iGM(V=t.CRH())&&(g.bcElement=V.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}),k})(),Ce=(()=>{class k{}return k.\u0275fac=function(r){return new(r||k)},k.\u0275mod=t.oAB({type:k}),k.\u0275inj=t.cJS({}),k})();class Me{transform(o,r){let g=o,V=0;return r&&0!==r&&(V=o*(r/100),g=o+V),g}}function Fe(k,o){if(1&k&&t._UZ(0,"ngx-barcode6",18),2&k){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 Ye(k,o){if(1&k&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&k){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 Xe(k,o){if(1&k&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&k){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 et(k,o){if(1&k&&(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&k){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 De(k,o){if(1&k&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&k){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 He(k,o){if(1&k&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&k){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 Le(k,o){if(1&k&&t.YNc(0,He,4,7,"ng-container",20),2&k){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 Ke(k,o){if(1&k&&(t._uU(0),t.ALo(1,"number")),2&k){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 Re(k,o){if(1&k&&(t.TgZ(0,"strong"),t.YNc(1,De,4,7,"ng-container",20),t.YNc(2,Le,1,2,"ng-template",null,29,t.W1O),t.YNc(4,Ke,2,4,"ng-template",null,30,t.W1O),t.qZA()),2&k){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 tt(k,o){if(1&k&&(t.TgZ(0,"span",19),t.YNc(1,et,15,10,"ng-container",20),t.YNc(2,Re,6,2,"ng-template",null,21,t.W1O),t.qZA()),2&k){const r=t.MAs(3),g=t.oxw().$implicit,V=t.oxw();t.Udp("font-size",(null==V.selectedPaperFormat?null:V.selectedPaperFormat.PriceFontSize)+"px"),t.xp6(1),t.Q6J("ngIf",g.getSelectedPromotion)("ngIfElse",r)}}function nt(k,o){if(1&k&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&k){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 it(k,o){if(1&k&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.ALo(3,"date"),t.qZA(),t.BQk()),2&k){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 rt(k,o){if(1&k&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&k){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 at(k,o){if(1&k&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&k){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 ot(k,o){if(1&k&&(t.ynx(0),t.TgZ(1,"div",31),t._uU(2),t.qZA(),t.BQk()),2&k){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 st(k,o){if(1&k&&(t.TgZ(0,"li")(1,"div",13),t.YNc(2,Fe,1,4,"ngx-barcode6",14),t.TgZ(3,"div",15),t.YNc(4,Ye,2,3,"span",16),t.YNc(5,Xe,3,7,"span",16),t.YNc(6,tt,4,4,"span",16),t.YNc(7,nt,3,7,"span",16),t.YNc(8,it,4,6,"ng-container",17),t.YNc(9,rt,3,3,"ng-container",17),t.YNc(10,at,3,3,"ng-container",17),t.qZA(),t.YNc(11,ot,3,3,"ng-container",17),t.qZA()()),2&k){const r=o.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))}}Me.\u0275fac=function(o){return new(o||Me)},Me.\u0275pipe=t.Yjl({name:"taxPipe",type:Me,pure:!0});class je{constructor(o,r,g,V,G,Q){this.dialog=o,this.productStateService=r,this.productService=g,this.barcodeService=V,this.toastService=G,this.authService=Q,this.paperFormatOptions=[],this.optionSelected={id:1,name:"Continuous - 3 Column"},this.paperFormats=[],this.totalStickerPerRow=0,this.lastIndex=0,this.destroy$=new b.x,this.productPreview=[],this.taxs=[]}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(o=>{this.productPreview=o,this.relayout()})}getProductTax(){this.productService.getTax().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&(this.taxs=o)})}getPaperFormats(){this.barcodeService.getPaperFormatConfig().pipe((0,l.R)(this.destroy$)).subscribe({next:o=>{o&&(this.paperFormats=o,this.setSelectedPaperFormat(o[0]),this.initOptionFormat(),this.initOptionSelected(this.selectedPaperFormat))},error:o=>{console.error(o)}})}initOptionFormat(){this.paperFormatOptions=[],this.paperFormats.forEach((o,r)=>{this.paperFormatOptions=[...this.paperFormatOptions,{id:r+1,name:o.Name}]})}initOptionSelected(o){this.optionSelected=this.paperFormatOptions.find(r=>r.name===o.Name)}openSettingModal(){this.dialog.open(Ee,{width:"850px",data:{paperFormat:this.selectedPaperFormat,taxs:this.taxs,authTax:this.authTax}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&this.selectedPaperFormat&&(this.updatePaperFormatSource(o),this.updatePaperFormat(),this.setSelectedPaperFormat(o))})}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:o=>{console.error(o)}})}setSelectedPaperFormat(o){this.selectedPaperFormat=o,this.barcodeService.setBarcodeConfigState(o),this.relayout(),this.getPPnVal(o)}findPaperFormatByName(o){return this.paperFormats.find(g=>g.Name==o)}updatePaperFormatSource(o){this.paperFormats=this.paperFormats.map(r=>(o.Name===r.Name&&(r=o),r))}getPPnVal(o){this.tax=o.TaxType?o.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 ae=Math.floor(this.productPreview.length/G),ue=this.productPreview.length-ae*G;this.lastIndex=0===ue?G:ue,this.productPreview=this.productPreview.map(te=>(te.setBarcodeTitle=this.selectedPaperFormat?.DescriptionAsCode&&te.getDescription?te.getDescription:te.getCode,te))}}je.\u0275fac=function(o){return new(o||je)(t.Y36(n.uw),t.Y36(P),t.Y36(ee),t.Y36(re),t.Y36(Ae._W),t.Y36(C.$))},je.\u0275cmp=t.Xpm({type:je,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(o,r){1&o&&(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(V){return r.optionSelected=V})("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,st,12,17,"li",12),t.qZA()()()()),2&o&&(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,_.JJ,_.On,w.w9,ke,F.OU,F.JJ,F.uU,Me],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 Ge{constructor(o,r,g){this.variantServiceState=o,this.authService=r,this.queryParamService=g,this.domainName=localStorage.getItem("Domain")}onLogout(){this.variantServiceState.setState([]),this.queryParamService.setState(null),this.authService.logout()}}Ge.\u0275fac=function(o){return new(o||Ge)(t.Y36(P),t.Y36(C.$),t.Y36(I.U))},Ge.\u0275cmp=t.Xpm({type:Ge,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(o,r){1&o&&(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&o&&(t.xp6(15),t.MGl("href","https://",r.domainName,"",t.LSH),t.xp6(1),t.Oqu(r.domainName))},dependencies:[ve,je],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 lt=O(4949);const ct=[{path:"",component:Ge}];class Be{}Be.\u0275fac=function(o){return new(o||Be)},Be.\u0275mod=t.oAB({type:Be}),Be.\u0275inj=t.cJS({imports:[F.ez,lt.m,be,Ce,se,N.Bz.forChild(ct)]})},7370:function(J){J.exports=function(){return F={},S.m=O=[function(N,t,x){"use strict";x.r(t);var A={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(A.allowedTagList),Object.defineProperty(A,"allowedTagList",{configurable:!1,writable:!1}),A.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(A.keyCode),Object.defineProperty(A,"keyCode",{configurable:!1,writable:!1}),A.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(A.fromCharCodeKeyCode),Object.defineProperty(A,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),A.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(A.keyName._allFnKeys),Object.freeze(A.keyName._someNonPrintableKeys),Object.freeze(A.keyName._directionKeys),Object.freeze(A.keyName),Object.defineProperty(A,"keyName",{configurable:!1,writable:!1}),Object.freeze(A);var P=A;function C(s){return function(d){if(Array.isArray(d))return u(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 b(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 i=[],a=!0,m=!1,v=void 0;try{for(var c,E=f[Symbol.iterator]();!(a=(c=E.next()).done)&&(i.push(c.value),!e||i.length!==e);a=!0);}catch(M){m=!0,v=M}finally{try{a||null==E.return||E.return()}finally{if(m)throw v}}return i}}(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 u(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)?u(s,d):void 0}}function u(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 n=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 i=f[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(d,i.key,i)}}(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=b(d.split("."),2)[1];return this.isUndefined(f)?0:f.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(d){var f=b(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===P.keyCode.AndroidDefault)return P.keyName.AndroidDefault;var i=P.fromCharCodeKeyCode[e];f=s.isUndefinedOrNullOrEmpty(i)?String.fromCharCode(e):i}else{var a;switch(d.key){case"Add":f=P.keyName.NumpadPlus;break;case"Apps":f=P.keyName.ContextMenu;break;case"Crsel":f=P.keyName.CrSel;break;case"Decimal":f=d.char?d.char:P.keyName.NumpadDot;break;case"Del":f="firefox"===(a=this.browser()).name&&a.version<=36||"ie"===a.name&&a.version<=9?P.keyName.Dot:P.keyName.Delete;break;case"Divide":f=P.keyName.NumpadSlash;break;case"Down":f=P.keyName.DownArrow;break;case"Esc":f=P.keyName.Esc;break;case"Exsel":f=P.keyName.ExSel;break;case"Left":f=P.keyName.LeftArrow;break;case"Meta":case"Super":f=P.keyName.OSLeft;break;case"Multiply":f=P.keyName.NumpadMultiply;break;case"Right":f=P.keyName.RightArrow;break;case"Spacebar":f=P.keyName.Space;break;case"Subtract":f=P.keyName.NumpadMinus;break;case"Up":f=P.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 i=1<arguments.length&&void 0!==f?f:"-",a=!(2<arguments.length&&void 0!==e)||e;return d===i||""!==d&&(s.isNumber(d)?d<0:a?this.contains(d,i):this.isNegativeStrict(d,i))}},{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 i=new RegExp("[0-9".concat(e,"-]")),a=0,m=0;m<f;m++)i.test(d[m])&&a++;return a}},{key:"findCaretPositionInFormattedNumber",value:function(d,f,e,i){var a,m=e.length,v=d.length,c=0;for(a=0;a<m&&c<v&&c<f;a++)(d[c]===e[a]||"."===d[c]&&e[a]===i)&&c++;return a}},{key:"countCharInText",value:function(d,f){for(var e=0,i=0;i<f.length;i++)f[i]===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 i=window.getSelection().getRangeAt(0);e.start=i.startOffset,e.end=i.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 i=2<arguments.length&&void 0!==e?e:null;if(this.isUndefinedOrNullOrEmpty(i)&&(i=f),this.isInputElement(d))d.setSelectionRange(f,i);else if(!s.isNull(d.firstChild)){var a=document.createRange();a.setStart(d.firstChild,f),a.setEnd(d.firstChild,i);var m=window.getSelection();m.removeAllRanges(),m.addRange(a)}}},{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=b(String(d).split("."),2),a=e[1];return a?"".concat(e[0],".").concat(a.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 i=Math.abs(d);if(0<=i&&i<1){var a,m=Math.pow(10,-e);if(0===d)return f?m:-m;var c=e,E=this.indexFirstNonZeroDecimalPlace(d);return a=c-1<=E?m:Math.pow(10,-(E+1)),this.roundToNearest(f?d+a:d-a,a)}d=parseInt(d,10);var M,Z=Math.abs(d).toString().length;switch(Z){case 1:M=0;break;case 2:case 3:M=1;break;case 4:case 5:M=2;break;default:M=Z-3}var y,L=Math.pow(10,M);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,i){var a=!(1<arguments.length&&void 0!==f)||f,m=2<arguments.length&&void 0!==e&&e,v=3<arguments.length&&void 0!==i&&i;if(this.isNull(d))return d;var c=d.toString();if(""===c)return d;if(null===c.match(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06f4\u06f5\u06f6]/g))return a&&(c=Number(c)),c;m&&(c=c.replace(/\u066b/,".")),v&&(c=c.replace(/\u066c/g,"")),c=c.replace(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669]/g,function(M){return M.charCodeAt(0)-1632}).replace(/[\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9]/g,function(M){return M.charCodeAt(0)-1776});var E=Number(c);return isNaN(E)?E:(a&&(c=E),c)}},{key:"triggerEvent",value:function(d,f,e,i,a){var m,v=1<arguments.length&&void 0!==f?f:document,c=2<arguments.length&&void 0!==e?e:null,E=!(3<arguments.length&&void 0!==i)||i,M=!(4<arguments.length&&void 0!==a)||a;window.CustomEvent?m=new CustomEvent(d,{detail:c,bubbles:E,cancelable:M}):(m=document.createEvent("CustomEvent")).initCustomEvent(d,E,M,{detail:c}),v.dispatchEvent(m)}},{key:"parseStr",value:function(d){var f,e,i,a,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))===(i=d.length))m.e=0,m.c=[0];else{for(a=i-1;"0"===d.charAt(a);--a)--i;for(--i,m.e=f-e-1,m.c=[],f=0;e<=i;e+=1)m.c[f]=+d.charAt(e),f+=1}return m}},{key:"testMinMax",value:function(d,f){var e=f.c,i=d.c,a=f.s,m=d.s,v=f.e,c=d.e;if(!e[0]||!i[0])return e[0]?a:i[0]?-m:0;if(a!==m)return a;var E=a<0;if(v!==c)return c<v^E?1:-1;for(a=-1,m=(v=e.length)<(c=i.length)?v:c,a+=1;a<m;a+=1)if(e[a]!==i[a])return e[a]>i[a]^E?1:-1;return v===c?0:c<v^E?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,i){var a=1<arguments.length&&void 0!==f?f:"-",m=!(2<arguments.length&&void 0!==e)||e,v=!(3<arguments.length&&void 0!==i)||i;if(this.isNull(d))return null;m&&(d=d.replace(/^data-/,""));var c=d.split(a).map(function(E){return"".concat(E.charAt(0).toUpperCase()).concat(E.slice(1))});return c=c.join(""),v&&(c="".concat(c.charAt(0).toLowerCase()).concat(c.slice(1))),c}},{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(i){return!e.isInArray(i,f)})}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(d){if(""===(d=String(d)))return"";var f=b(d.split("."),2),e=f[0],i=f[1];if(this.isUndefinedOrNullOrEmpty(i))return e;var a=i.replace(/0+$/g,"");return""===a?e:"".concat(e,".").concat(a)}},{key:"getHoveredElement",value:function(){var d=C(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 C(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(i,a){return i.concat(C(a))},[]))}},{key:"objectKeyLookup",value:function(d,f){var e=Object.entries(d).find(function(a){return a[1]===f}),i=null;return void 0!==e&&(i=e[0]),i}},{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=b(d.split(/e/i),2),i=e[0],a=e[1],m=i<0;m&&(i=i.replace("-",""));var v=+a<0;v&&(a=a.replace("-",""));var c,E=b(i.split(/\./),2),M=E[0],Z=E[1];return c=v?(c=M.length>a?this.insertAt(M,".",M.length-a):"0.".concat("0".repeat(a-M.length)).concat(M),"".concat(c).concat(Z||"")):Z?(i="".concat(M).concat(Z),a<Z.length?this.insertAt(i,".",+a+M.length):"".concat(i).concat("0".repeat(a-Z.length))):(i=i.replace(".",""),"".concat(i).concat("0".repeat(Number(a)))),m&&(c="-".concat(c)),c}}]),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 i=f[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(d,i.key,i)}}(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}(),_=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 i=f[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(d,i.key,i)}}(s,[{key:"createNode",value:function(d,f,e){var i=new s;return i.type=d,i.left=f,i.right=e,i}},{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 w(s,d,f){(function(e){if(!(e instanceof w))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 w("Error",0,0)}return function(d,f){for(var e=0;e<f.length;e++){var i=f[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(d,i.key,i)}}(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(n.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&&n.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===d&&this.index++;this.index<=this.textLength&&n.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 i=f[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(d,i.key,i)}}(s.prototype,[{key:"_exp",value:function(){var d=this._term(),f=this._moreExp();return _.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(),_.createNode("op_+",f,d);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),d=this._term(),f=this._moreExp(),_.createNode("op_-",f,d)}return _.createLeaf(0)}},{key:"_term",value:function(){var d=this._factor(),f=this._moreTerms();return _.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(),_.createNode("op_*",f,d);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),d=this._factor(),f=this._moreTerms(),_.createNode("op_/",f,d)}return _.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),_.createLeaf(e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),f=this._factor(),_.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 re(d)}(s)||function(d){if(typeof Symbol<"u"&&Symbol.iterator in Object(d))return Array.from(d)}(s)||ie(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 q(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 i=[],a=!0,m=!1,v=void 0;try{for(var c,E=f[Symbol.iterator]();!(a=(c=E.next()).done)&&(i.push(c.value),!e||i.length!==e);a=!0);}catch(M){m=!0,v=M}finally{try{a||null==E.return||E.return()}finally{if(m)throw v}}return i}}(s,d)||ie(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 ie(s,d){if(s){if("string"==typeof s)return re(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)?re(s,d):void 0}}function re(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 oe(){return(oe=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 me(s){return(me="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 ye(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,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,a=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(i,a,m),E=v.initialValue,M=v.userOptions;if(this.domElement=v.domElement,this.defaultRawValue="",this._setSettings(M,!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(E);else{var Z;if(n.isNull(E))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=E;this._setElementAndRawValue(Z)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(E),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?n.mergeMaps(e._getLocalList(),z):(e._addToLocalList(L,D),e._getLocalList())).forEach(function(W){W._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 W=e.autoNumericLocalList;e.autoNumericLocalList.delete(D),W.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 n.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&&(n.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:n.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,i,a){n.isNull(e)&&n.throwError("At least one valid parameter is needed in order to initialize an AutoNumeric object");var m,v,c,E=n.isElement(e),M=n.isString(e),Z=n.isObject(i),y=Array.isArray(i)&&0<i.length,L=n.isNumberOrArabic(i)||""===i,D=this._isPreDefinedOptionValid(i),B=n.isNull(i),z=n.isEmptyString(i),W=n.isObject(a),Y=Array.isArray(a)&&0<a.length,ne=n.isNull(a),le=this._isPreDefinedOptionValid(a);return E&&B&&ne?(m=e,v=c=null):E&&L&&ne?(m=e,c=i,v=null):E&&Z&&ne?(m=e,c=null,v=i):E&&D&&ne?(m=e,c=null,v=this._getOptionObject(i)):E&&y&&ne?(m=e,c=null,v=this.mergeOptions(i)):E&&(B||z)&&W?(m=e,c=null,v=a):E&&(B||z)&&Y?(m=e,c=null,v=this.mergeOptions(a)):M&&B&&ne?(m=document.querySelector(e),v=c=null):M&&Z&&ne?(m=document.querySelector(e),c=null,v=i):M&&D&&ne?(m=document.querySelector(e),c=null,v=this._getOptionObject(i)):M&&y&&ne?(m=document.querySelector(e),c=null,v=this.mergeOptions(i)):M&&(B||z)&&W?(m=document.querySelector(e),c=null,v=a):M&&(B||z)&&Y?(m=document.querySelector(e),c=null,v=this.mergeOptions(a)):M&&L&&ne?(m=document.querySelector(e),c=i,v=null):M&&L&&W?(m=document.querySelector(e),c=i,v=a):M&&L&&le?(m=document.querySelector(e),c=i,v=this._getOptionObject(a)):M&&L&&Y?(m=document.querySelector(e),c=i,v=this.mergeOptions(a)):E&&L&&W?(m=e,c=i,v=a):E&&L&&le?(m=e,c=i,v=this._getOptionObject(a)):E&&L&&Y?(m=e,c=i,v=this.mergeOptions(a)):n.throwError("The parameters given to the AutoNumeric object are not valid, '".concat(e,"', '").concat(i,"' and '").concat(a,"' given.")),n.isNull(m)&&n.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:m,initialValue:c,userOptions:v}}},{key:"mergeOptions",value:function(e){var i=this,a={};return e.forEach(function(m){oe(a,i._getOptionObject(m))}),a}},{key:"_isPreDefinedOptionValid",value:function(e){return Object.prototype.hasOwnProperty.call(s.predefinedOptions,e)}},{key:"_getOptionObject",value:function(e){var i;return n.isString(e)?null==(i=s.getPredefinedOptions()[e])&&n.warning("The given pre-defined option [".concat(e,"] is not recognized by autoNumeric. Please check that pre-defined option name."),!0):i=e,i}},{key:"_doesFormHandlerListExists",value:function(){var e=me(window.aNFormHandlerMap);return"undefined"!==e&&"object"===e}},{key:"_createFormHandlerList",value:function(){window.aNFormHandlerMap=new Map}},{key:"_checkValuesToStringsArray",value:function(e,i){return n.isInArray(String(e),i)}},{key:"_checkValuesToStringsSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.keys(i.valuesToStrings))}},{key:"_checkStringsToValuesSettings",value:function(e,i){return this._checkValuesToStringsArray(e,Object.values(i.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 i=this,a=e.getElementsByTagName("input"),m=[];return Array.prototype.slice.call(a,0).forEach(function(v){i.test(v)&&m.push(v)}),m}},{key:"test",value:function(e){return this._isInGlobalList(n.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=me(window[this.autoNumericGlobalListName]);return"undefined"!==e&&"object"===e}},{key:"_addToGlobalList",value:function(e){this._doesGlobalListExists()||this._createGlobalList();var i=e.node();if(this._isInGlobalList(i)){if(this._getFromGlobalList(i)===this)return;n.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(i,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,i,a){var m=!(1<arguments.length&&void 0!==i)||i,v=2<arguments.length&&void 0!==a?a:null;!n.isUndefinedOrNullOrEmpty(e)&&n.isObject(e)||n.throwError("The userOptions are invalid ; it should be a valid object, [".concat(e,"] given."));var c,E=n.isObject(v);E||n.isNull(v)||n.throwError("The 'originalOptions' parameter is invalid ; it should either be a valid option object or `null`, [".concat(e,"] given.")),n.isNull(e)||this._convertOldOptionsToNewOnes(e),c=m?oe({},this.getDefaultConfig(),e):e,n.isTrueOrFalseString(c.showWarnings)||n.isBoolean(c.showWarnings)||n.throwError("The debug option 'showWarnings' is invalid ; it should be either 'true' or 'false', [".concat(c.showWarnings,"] given."));var M,Z=/^[0-9]+$/,y=/[0-9]+/,L=/^-?[0-9]+(\.?[0-9]+)?$/,D=/^[0-9]+(\.?[0-9]+)?$/;n.isTrueOrFalseString(c.allowDecimalPadding)||n.isBoolean(c.allowDecimalPadding)||c.allowDecimalPadding===s.options.allowDecimalPadding.floats||n.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true` or `'floats'`, [".concat(c.allowDecimalPadding,"] given.")),c.allowDecimalPadding!==s.options.allowDecimalPadding.never&&"false"!==c.allowDecimalPadding||c.decimalPlaces===s.options.decimalPlaces.none&&c.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.none&&c.decimalPlacesShownOnFocus===s.options.decimalPlacesShownOnFocus.none||n.warning("Setting 'allowDecimalPadding' to [".concat(c.allowDecimalPadding,"] will override the current 'decimalPlaces*' settings [").concat(c.decimalPlaces,", ").concat(c.decimalPlacesShownOnBlur," and ").concat(c.decimalPlacesShownOnFocus,"]."),c.showWarnings),n.isTrueOrFalseString(c.alwaysAllowDecimalCharacter)||n.isBoolean(c.alwaysAllowDecimalCharacter)||n.throwError("The option 'alwaysAllowDecimalCharacter' is invalid ; it should either be `true` or `false`, [".concat(c.alwaysAllowDecimalCharacter,"] given.")),n.isNull(c.caretPositionOnFocus)||n.isInArray(c.caretPositionOnFocus,[s.options.caretPositionOnFocus.start,s.options.caretPositionOnFocus.end,s.options.caretPositionOnFocus.decimalLeft,s.options.caretPositionOnFocus.decimalRight])||n.throwError("The display on empty string option 'caretPositionOnFocus' is invalid ; it should either be `null`, 'focus', 'press', 'always' or 'zero', [".concat(c.caretPositionOnFocus,"] given.")),M=E?v:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(e),n.isNull(M)||M.caretPositionOnFocus===s.options.caretPositionOnFocus.doNoForceCaretPosition||M.selectOnFocus!==s.options.selectOnFocus.select||n.warning("The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '".concat(M.caretPositionOnFocus,"'. As a result, if this has been called when instantiating an AutoNumeric object, the 'selectOnFocus' option is forced to 'doNotSelect'."),c.showWarnings),n.isInArray(c.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])||n.throwError("The thousand separator character option 'digitGroupSeparator' is invalid ; it should be ',', '.', '\u066c', '\u02d9', \"'\", '\x92', ' ', '\u2009', '\u202f', '\xa0' or empty (''), [".concat(c.digitGroupSeparator,"] given.")),n.isTrueOrFalseString(c.showOnlyNumbersOnFocus)||n.isBoolean(c.showOnlyNumbersOnFocus)||n.throwError("The 'showOnlyNumbersOnFocus' option is invalid ; it should be either 'true' or 'false', [".concat(c.showOnlyNumbersOnFocus,"] given.")),n.isInArray(c.digitalGroupSpacing,[s.options.digitalGroupSpacing.two,s.options.digitalGroupSpacing.twoScaled,s.options.digitalGroupSpacing.three,s.options.digitalGroupSpacing.four])||2<=c.digitalGroupSpacing&&c.digitalGroupSpacing<=4||n.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2s', '3', or '4', [".concat(c.digitalGroupSpacing,"] given.")),n.isInArray(c.decimalCharacter,[s.options.decimalCharacter.comma,s.options.decimalCharacter.dot,s.options.decimalCharacter.middleDot,s.options.decimalCharacter.arabicDecimalSeparator,s.options.decimalCharacter.decimalSeparatorKeySymbol])||n.throwError("The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '\xb7', '\u2396' or '\u066b', [".concat(c.decimalCharacter,"] given.")),c.decimalCharacter===c.digitGroupSeparator&&n.throwError("autoNumeric will not function properly when the decimal character 'decimalCharacter' [".concat(c.decimalCharacter,"] and the thousand separator 'digitGroupSeparator' [").concat(c.digitGroupSeparator,"] are the same character.")),n.isNull(c.decimalCharacterAlternative)||n.isString(c.decimalCharacterAlternative)||n.throwError("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, [".concat(c.decimalCharacterAlternative,"] given.")),""===c.currencySymbol||n.isString(c.currencySymbol)||n.throwError("The currency symbol option 'currencySymbol' is invalid ; it should be a string, [".concat(c.currencySymbol,"] given.")),n.isInArray(c.currencySymbolPlacement,[s.options.currencySymbolPlacement.prefix,s.options.currencySymbolPlacement.suffix])||n.throwError("The placement of the currency sign option 'currencySymbolPlacement' is invalid ; it should either be 'p' (prefix) or 's' (suffix), [".concat(c.currencySymbolPlacement,"] given.")),n.isInArray(c.negativePositiveSignPlacement,[s.options.negativePositiveSignPlacement.prefix,s.options.negativePositiveSignPlacement.suffix,s.options.negativePositiveSignPlacement.left,s.options.negativePositiveSignPlacement.right,s.options.negativePositiveSignPlacement.none])||n.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(c.negativePositiveSignPlacement,"] given.")),n.isTrueOrFalseString(c.showPositiveSign)||n.isBoolean(c.showPositiveSign)||n.throwError("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'true' or 'false', [".concat(c.showPositiveSign,"] given.")),n.isString(c.suffixText)&&(""===c.suffixText||!n.isNegative(c.suffixText,c.negativeSignCharacter)&&!y.test(c.suffixText))||n.throwError("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '".concat(c.negativeSignCharacter,"' nor any numerical characters, [").concat(c.suffixText,"] given.")),n.isString(c.negativeSignCharacter)&&1===c.negativeSignCharacter.length&&!n.isUndefinedOrNullOrEmpty(c.negativeSignCharacter)&&!y.test(c.negativeSignCharacter)||n.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(c.negativeSignCharacter,"] given.")),n.isString(c.positiveSignCharacter)&&1===c.positiveSignCharacter.length&&!n.isUndefinedOrNullOrEmpty(c.positiveSignCharacter)&&!y.test(c.positiveSignCharacter)||n.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(c.positiveSignCharacter,"] given.\nIf you want to hide the positive sign character, you need to set the `showPositiveSign` option to `true`.")),c.negativeSignCharacter===c.positiveSignCharacter&&n.throwError("The positive 'positiveSignCharacter' and negative 'negativeSignCharacter' sign characters cannot be identical ; [".concat(c.negativeSignCharacter,"] given."));var B=q(n.isNull(c.negativeBracketsTypeOnBlur)?["",""]:c.negativeBracketsTypeOnBlur.split(","),2),z=B[0],W=B[1];(n.contains(c.digitGroupSeparator,c.negativeSignCharacter)||n.contains(c.decimalCharacter,c.negativeSignCharacter)||n.contains(c.decimalCharacterAlternative,c.negativeSignCharacter)||n.contains(z,c.negativeSignCharacter)||n.contains(W,c.negativeSignCharacter)||n.contains(c.suffixText,c.negativeSignCharacter))&&n.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(c.negativeSignCharacter,"] given.")),(n.contains(c.digitGroupSeparator,c.positiveSignCharacter)||n.contains(c.decimalCharacter,c.positiveSignCharacter)||n.contains(c.decimalCharacterAlternative,c.positiveSignCharacter)||n.contains(z,c.positiveSignCharacter)||n.contains(W,c.positiveSignCharacter)||n.contains(c.suffixText,c.positiveSignCharacter))&&n.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(c.positiveSignCharacter,"] given.")),n.isNull(c.overrideMinMaxLimits)||n.isInArray(c.overrideMinMaxLimits,[s.options.overrideMinMaxLimits.ceiling,s.options.overrideMinMaxLimits.floor,s.options.overrideMinMaxLimits.ignore,s.options.overrideMinMaxLimits.invalid])||n.throwError("The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor', 'ignore' or 'invalid', [".concat(c.overrideMinMaxLimits,"] given.")),c.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.invalid&&c.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.ignore&&(0<c.minimumValue||c.maximumValue<0)&&n.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."),n.isString(c.maximumValue)&&L.test(c.maximumValue)||n.throwError("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(c.maximumValue,"] given.")),n.isString(c.minimumValue)&&L.test(c.minimumValue)||n.throwError("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(c.minimumValue,"] given.")),parseFloat(c.minimumValue)>parseFloat(c.maximumValue)&&n.throwError("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' [".concat(c.minimumValue,"] should be smaller than 'maximumValue' [").concat(c.maximumValue,"].")),n.isInt(c.decimalPlaces)&&0<=c.decimalPlaces||n.isString(c.decimalPlaces)&&Z.test(c.decimalPlaces)||n.throwError("The number of decimal places option 'decimalPlaces' is invalid ; it should be a positive integer, [".concat(c.decimalPlaces,"] given.")),n.isNull(c.decimalPlacesRawValue)||n.isInt(c.decimalPlacesRawValue)&&0<=c.decimalPlacesRawValue||n.isString(c.decimalPlacesRawValue)&&Z.test(c.decimalPlacesRawValue)||n.throwError("The number of decimal places for the raw value option 'decimalPlacesRawValue' is invalid ; it should be a positive integer or `null`, [".concat(c.decimalPlacesRawValue,"] given.")),this._validateDecimalPlacesRawValue(c),n.isNull(c.decimalPlacesShownOnFocus)||Z.test(String(c.decimalPlacesShownOnFocus))||n.throwError("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer or `null`, [".concat(c.decimalPlacesShownOnFocus,"] given.")),!n.isNull(c.decimalPlacesShownOnFocus)&&Number(c.decimalPlaces)>Number(c.decimalPlacesShownOnFocus)&&n.warning("The extended decimal places 'decimalPlacesShownOnFocus' [".concat(c.decimalPlacesShownOnFocus,"] should be greater than the 'decimalPlaces' [").concat(c.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?"),c.showWarnings),(n.isNull(c.divisorWhenUnfocused)||D.test(c.divisorWhenUnfocused))&&0!==c.divisorWhenUnfocused&&"0"!==c.divisorWhenUnfocused&&1!==c.divisorWhenUnfocused&&"1"!==c.divisorWhenUnfocused||n.throwError("The divisor option 'divisorWhenUnfocused' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(c.divisorWhenUnfocused,"] given.")),n.isNull(c.decimalPlacesShownOnBlur)||Z.test(c.decimalPlacesShownOnBlur)||n.throwError("The number of decimals shown when unfocused option 'decimalPlacesShownOnBlur' is invalid ; it should be a positive integer or `null`, [".concat(c.decimalPlacesShownOnBlur,"] given.")),n.isNull(c.symbolWhenUnfocused)||n.isString(c.symbolWhenUnfocused)||n.throwError("The symbol to show when unfocused option 'symbolWhenUnfocused' is invalid ; it should be a string, [".concat(c.symbolWhenUnfocused,"] given.")),n.isTrueOrFalseString(c.saveValueToSessionStorage)||n.isBoolean(c.saveValueToSessionStorage)||n.throwError("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'true' or 'false', [".concat(c.saveValueToSessionStorage,"] given.")),n.isInArray(c.onInvalidPaste,[s.options.onInvalidPaste.error,s.options.onInvalidPaste.ignore,s.options.onInvalidPaste.clamp,s.options.onInvalidPaste.truncate,s.options.onInvalidPaste.replace])||n.throwError("The paste behavior option 'onInvalidPaste' is invalid ; it should either be 'error', 'ignore', 'clamp', 'truncate' or 'replace' (cf. documentation), [".concat(c.onInvalidPaste,"] given.")),n.isInArray(c.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])||n.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(c.roundingMethod,"] given.")),n.isNull(c.negativeBracketsTypeOnBlur)||n.isInArray(c.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])||n.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(c.negativeBracketsTypeOnBlur,"] given.")),(n.isString(c.emptyInputBehavior)||n.isNumber(c.emptyInputBehavior))&&(n.isInArray(c.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(c.emptyInputBehavior))||n.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(c.emptyInputBehavior,"] given.")),c.emptyInputBehavior===s.options.emptyInputBehavior.zero&&(0<c.minimumValue||c.maximumValue<0)&&n.throwError("The 'emptyInputBehavior' option is set to 'zero', but this value is outside of the range defined by 'minimumValue' and 'maximumValue' [".concat(c.minimumValue,", ").concat(c.maximumValue,"].")),L.test(String(c.emptyInputBehavior))&&(this._isWithinRangeWithOverrideOption(c.emptyInputBehavior,c)||n.throwError("The 'emptyInputBehavior' option is set to a number or a string that represents a number, but its value [".concat(c.emptyInputBehavior,"] is outside of the range defined by the 'minimumValue' and 'maximumValue' options [").concat(c.minimumValue,", ").concat(c.maximumValue,"]."))),n.isTrueOrFalseString(c.eventBubbles)||n.isBoolean(c.eventBubbles)||n.throwError("The event bubbles option 'eventBubbles' is invalid ; it should be either 'true' or 'false', [".concat(c.eventBubbles,"] given.")),n.isTrueOrFalseString(c.eventIsCancelable)||n.isBoolean(c.eventIsCancelable)||n.throwError("The event is cancelable option 'eventIsCancelable' is invalid ; it should be either 'true' or 'false', [".concat(c.eventIsCancelable,"] given.")),!n.isBoolean(c.invalidClass)&&/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(c.invalidClass)||n.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(c.invalidClass,"] given.")),n.isInArray(c.leadingZero,[s.options.leadingZero.allow,s.options.leadingZero.deny,s.options.leadingZero.keep])||n.throwError("The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', [".concat(c.leadingZero,"] given.")),n.isTrueOrFalseString(c.formatOnPageLoad)||n.isBoolean(c.formatOnPageLoad)||n.throwError("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'true' or 'false', [".concat(c.formatOnPageLoad,"] given.")),n.isTrueOrFalseString(c.formulaMode)||n.isBoolean(c.formulaMode)||n.throwError("The formula mode option 'formulaMode' is invalid ; it should be either 'true' or 'false', [".concat(c.formulaMode,"] given.")),Z.test(c.historySize)&&0!==c.historySize||n.throwError("The history size option 'historySize' is invalid ; it should be a positive integer, [".concat(c.historySize,"] given.")),n.isTrueOrFalseString(c.selectNumberOnly)||n.isBoolean(c.selectNumberOnly)||n.throwError("The select number only option 'selectNumberOnly' is invalid ; it should be either 'true' or 'false', [".concat(c.selectNumberOnly,"] given.")),n.isTrueOrFalseString(c.selectOnFocus)||n.isBoolean(c.selectOnFocus)||n.throwError("The select on focus option 'selectOnFocus' is invalid ; it should be either 'true' or 'false', [".concat(c.selectOnFocus,"] given.")),n.isNull(c.defaultValueOverride)||""===c.defaultValueOverride||L.test(c.defaultValueOverride)||n.throwError("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, [".concat(c.defaultValueOverride,"] given.")),n.isTrueOrFalseString(c.unformatOnSubmit)||n.isBoolean(c.unformatOnSubmit)||n.throwError("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'true' or 'false', [".concat(c.unformatOnSubmit,"] given.")),n.isNull(c.valuesToStrings)||n.isObject(c.valuesToStrings)||n.throwError("The option 'valuesToStrings' is invalid ; it should be an object, ideally with 'key -> value' entries, [".concat(c.valuesToStrings,"] given.")),n.isNull(c.outputFormat)||n.isInArray(c.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])||n.throwError("The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', [".concat(c.outputFormat,"] given.")),n.isTrueOrFalseString(c.isCancellable)||n.isBoolean(c.isCancellable)||n.throwError("The cancellable behavior option 'isCancellable' is invalid ; it should be either 'true' or 'false', [".concat(c.isCancellable,"] given.")),n.isTrueOrFalseString(c.modifyValueOnWheel)||n.isBoolean(c.modifyValueOnWheel)||n.throwError("The increment/decrement on mouse wheel option 'modifyValueOnWheel' is invalid ; it should be either 'true' or 'false', [".concat(c.modifyValueOnWheel,"] given.")),n.isTrueOrFalseString(c.watchExternalChanges)||n.isBoolean(c.watchExternalChanges)||n.throwError("The option 'watchExternalChanges' is invalid ; it should be either 'true' or 'false', [".concat(c.watchExternalChanges,"] given.")),n.isInArray(c.wheelOn,[s.options.wheelOn.focus,s.options.wheelOn.hover])||n.throwError("The wheel behavior option 'wheelOn' is invalid ; it should either be 'focus' or 'hover', [".concat(c.wheelOn,"] given.")),(n.isString(c.wheelStep)||n.isNumber(c.wheelStep))&&("progressive"===c.wheelStep||D.test(c.wheelStep))&&0!==Number(c.wheelStep)||n.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(c.wheelStep,"] given.")),n.isInArray(c.serializeSpaces,[s.options.serializeSpaces.plus,s.options.serializeSpaces.percent])||n.throwError("The space replacement character option 'serializeSpaces' is invalid ; it should either be '+' or '%20', [".concat(c.serializeSpaces,"] given.")),n.isTrueOrFalseString(c.noEventListeners)||n.isBoolean(c.noEventListeners)||n.throwError("The option 'noEventListeners' that prevent the creation of event listeners is invalid ; it should be either 'true' or 'false', [".concat(c.noEventListeners,"] given.")),n.isNull(c.styleRules)||n.isObject(c.styleRules)&&(Object.prototype.hasOwnProperty.call(c.styleRules,"positive")||Object.prototype.hasOwnProperty.call(c.styleRules,"negative")||Object.prototype.hasOwnProperty.call(c.styleRules,"ranges")||Object.prototype.hasOwnProperty.call(c.styleRules,"userDefined"))||n.throwError("The option 'styleRules' is invalid ; it should be a correctly structured object, with one or more 'positive', 'negative', 'ranges' or 'userDefined' attributes, [".concat(c.styleRules,"] given.")),n.isNull(c.styleRules)||!Object.prototype.hasOwnProperty.call(c.styleRules,"userDefined")||n.isNull(c.styleRules.userDefined)||c.styleRules.userDefined.forEach(function(Y){Object.prototype.hasOwnProperty.call(Y,"callback")&&!n.isFunction(Y.callback)&&n.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(me(Y.callback)," given."))}),(n.isNull(c.rawValueDivisor)||D.test(c.rawValueDivisor))&&0!==c.rawValueDivisor&&"0"!==c.rawValueDivisor&&1!==c.rawValueDivisor&&"1"!==c.rawValueDivisor||n.throwError("The raw value divisor option 'rawValueDivisor' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(c.rawValueDivisor,"] given.")),n.isTrueOrFalseString(c.readOnly)||n.isBoolean(c.readOnly)||n.throwError("The option 'readOnly' is invalid ; it should be either 'true' or 'false', [".concat(c.readOnly,"] given.")),n.isTrueOrFalseString(c.unformatOnHover)||n.isBoolean(c.unformatOnHover)||n.throwError("The option 'unformatOnHover' is invalid ; it should be either 'true' or 'false', [".concat(c.unformatOnHover,"] given.")),n.isTrueOrFalseString(c.failOnUnknownOption)||n.isBoolean(c.failOnUnknownOption)||n.throwError("The debug option 'failOnUnknownOption' is invalid ; it should be either 'true' or 'false', [".concat(c.failOnUnknownOption,"] given.")),n.isTrueOrFalseString(c.createLocalList)||n.isBoolean(c.createLocalList)||n.throwError("The debug option 'createLocalList' is invalid ; it should be either 'true' or 'false', [".concat(c.createLocalList,"] given."))}},{key:"_validateDecimalPlacesRawValue",value:function(e){n.isNull(e.decimalPlacesRawValue)||(e.decimalPlacesRawValue<e.decimalPlaces&&n.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&&n.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&&n.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 i=!0;try{this.validate(e,!0)}catch{i=!1}return i}},{key:"getDefaultConfig",value:function(){return s.defaultSettings}},{key:"getPredefinedOptions",value:function(){return s.predefinedOptions}},{key:"_generateOptionsObjectFromOptionsArray",value:function(e){var i,a=this;return n.isUndefinedOrNullOrEmpty(e)||0===e.length?i=null:(i={},1===e.length&&Array.isArray(e[0])?e[0].forEach(function(m){oe(i,a._getOptionObject(m))}):1<=e.length&&e.forEach(function(m){oe(i,a._getOptionObject(m))})),i}},{key:"format",value:function(e){if(n.isUndefined(e)||null===e)return null;var i;i=n.isElement(e)?n.getElementValue(e):e,n.isString(i)||n.isNumber(i)||n.throwError('The value "'.concat(i,'" being "set" is not numeric and therefore cannot be used appropriately.'));for(var a=arguments.length,m=new Array(1<a?a-1:0),v=1;v<a;v++)m[v-1]=arguments[v];var c=this._generateOptionsObjectFromOptionsArray(m),E=oe({},this.getDefaultConfig(),c);E.isNegativeSignAllowed=i<0,E.isPositiveSignAllowed=0<=i,this._setBrackets(E),this._cachesUsualRegularExpressions(E,{});var M=this._toNumericValue(i,E);return isNaN(Number(M))&&n.throwError("The value [".concat(M,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(M,E)||(n.triggerEvent(s.events.formatted,document,{oldValue:null,newValue:null,oldRawValue:null,newRawValue:null,isPristine:null,error:"Range test failed",aNElement:null},!0,!0),n.throwError("The value [".concat(M,"] being set falls outside of the minimumValue [").concat(E.minimumValue,"] and maximumValue [").concat(E.maximumValue,"] range set for this element"))),E.valuesToStrings&&this._checkValuesToStringsSettings(i,E)?E.valuesToStrings[i]:(this._correctNegativePositiveSignPlacementOption(E),this._calculateDecimalPlacesOnInit(E),n.isUndefinedOrNullOrEmpty(E.rawValueDivisor)||0===E.rawValueDivisor||""===M||null===M||(M*=E.rawValueDivisor),M=this._roundFormattedValueShownOnFocus(M,E),M=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(M,E),M=this._addGroupSeparators(M,E,!1,M))}},{key:"formatAndSet",value:function(e,i){var m=this.format(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,m),m}},{key:"unformat",value:function(e){if(n.isNumberStrict(e))return e;var i;if(""===(i=n.isElement(e)?n.getElementValue(e):e))return"";if(n.isUndefined(i)||null===i)return null;(n.isArray(i)||n.isObject(i))&&n.throwError("A number or a string representing a number is needed to be able to unformat it, [".concat(i,"] given."));for(var a=arguments.length,m=new Array(1<a?a-1:0),v=1;v<a;v++)m[v-1]=arguments[v];var c=this._generateOptionsObjectFromOptionsArray(m),E=oe({},this.getDefaultConfig(),c);if(E.isNegativeSignAllowed=!1,E.isPositiveSignAllowed=!0,i=i.toString(),E.valuesToStrings&&this._checkStringsToValuesSettings(i,E))return n.objectKeyLookup(E.valuesToStrings,i);if(n.isNegative(i,E.negativeSignCharacter))E.isNegativeSignAllowed=!0,E.isPositiveSignAllowed=!1;else if(!n.isNull(E.negativeBracketsTypeOnBlur)){var M=q(E.negativeBracketsTypeOnBlur.split(","),2);E.firstBracket=M[0],E.lastBracket=M[1],i.charAt(0)===E.firstBracket&&i.charAt(i.length-1)===E.lastBracket&&(E.isNegativeSignAllowed=!0,E.isPositiveSignAllowed=!1,i=this._removeBrackets(i,E,!1))}return i=this._convertToNumericString(i,E),new RegExp("[^+-0123456789.]","gi").test(i)?NaN:(this._correctNegativePositiveSignPlacementOption(E),E.originalDecimalPlacesRawValue=E.decimalPlacesRawValue?E.decimalPlacesRawValue:E.decimalPlaces,this._calculateDecimalPlacesOnInit(E),n.isUndefinedOrNullOrEmpty(E.rawValueDivisor)||0===E.rawValueDivisor||""===i||null===i||(i/=E.rawValueDivisor),i=(i=this._roundRawValue(i,E)).replace(E.decimalCharacter,"."),i=this._toLocale(i,E.outputFormat,E))}},{key:"unformatAndSet",value:function(e,i){var m=this.unformat(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,m),m}},{key:"localize",value:function(e,i){var a,m,v=1<arguments.length&&void 0!==i?i:null;return""===(a=n.isElement(e)?n.getElementValue(e):e)?"":(n.isNull(v)&&(v=s.defaultSettings),a=this.unformat(a,v),0===Number(a)&&v.leadingZero!==s.options.leadingZero.keep&&(a="0"),m=n.isNull(v)?v.outputFormat:s.defaultSettings.outputFormat,this._toLocale(a,m,v))}},{key:"localizeAndSet",value:function(e,i){var m=this.localize(e,1<arguments.length&&void 0!==i?i:null);return n.setElementValue(e,m),m}},{key:"isManagedByAutoNumeric",value:function(e){return this._isInGlobalList(n.domElement(e))}},{key:"getAutoNumericElement",value:function(e){var i=n.domElement(e);return this.isManagedByAutoNumeric(i)?this._getFromGlobalList(i):null}},{key:"set",value:function(e,i,a,m){var v,c=2<arguments.length&&void 0!==a?a:null,E=!(3<arguments.length&&void 0!==m)||m,M=n.domElement(e);return this.isManagedByAutoNumeric(M)?this.getAutoNumericElement(M).set(i,c,E):(v=!(!n.isNull(c)&&Object.prototype.hasOwnProperty.call(c,"showWarnings"))||c.showWarnings,n.warning("Impossible to find an AutoNumeric object for the given DOM element or selector.",v),null)}},{key:"getNumericString",value:function(e,i){return this._get(e,"getNumericString",1<arguments.length&&void 0!==i?i:null)}},{key:"getFormatted",value:function(e,i){return this._get(e,"getFormatted",1<arguments.length&&void 0!==i?i:null)}},{key:"getNumber",value:function(e,i){return this._get(e,"getNumber",1<arguments.length&&void 0!==i?i:null)}},{key:"_get",value:function(e,i,a){var m=2<arguments.length&&void 0!==a?a:null,v=n.domElement(e);return this.isManagedByAutoNumeric(v)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(v)[i](m)}},{key:"getLocalized",value:function(e,i,a){var m=1<arguments.length&&void 0!==i?i:null,v=2<arguments.length&&void 0!==a?a:null,c=n.domElement(e);return this.isManagedByAutoNumeric(c)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(c).getLocalized(m,v)}},{key:"_stripAllNonNumberCharacters",value:function(e,i,a,m){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,a,m).replace(i.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(e,i,a,m){var v=(e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(i.allowedAutoStrip,"")).match(i.numRegAutoStrip);if(e=v?[v[1],v[2],v[3]].join(""):"",i.leadingZero===s.options.leadingZero.allow||i.leadingZero===s.options.leadingZero.keep){var c="",E=q(e.split(i.decimalCharacter),2),Z=E[1],y=E[0];n.contains(y,i.negativeSignCharacter)&&(c=i.negativeSignCharacter,y=y.replace(i.negativeSignCharacter,"")),""===c&&y.length>i.mIntPos&&"0"===y.charAt(0)&&(y=y.slice(1)),""!==c&&y.length>i.mIntNeg&&"0"===y.charAt(0)&&(y=y.slice(1)),e="".concat(c).concat(y).concat(n.isUndefined(Z)?"":i.decimalCharacter+Z)}return(a&&i.leadingZero===s.options.leadingZero.deny||!m&&i.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(i.stripReg,"$1$2")),e}},{key:"_toggleNegativeBracket",value:function(e,i,a){return a?this._removeBrackets(e,i):this._addBrackets(e,i)}},{key:"_addBrackets",value:function(e,i){return n.isNull(i.negativeBracketsTypeOnBlur)?e:"".concat(i.firstBracket).concat(e.replace(i.negativeSignCharacter,"")).concat(i.lastBracket)}},{key:"_removeBrackets",value:function(e,i,a){var m,v=!(2<arguments.length&&void 0!==a)||a;return n.isNull(i.negativeBracketsTypeOnBlur)||e.charAt(0)!==i.firstBracket?e:(m=(m=e.replace(i.firstBracket,"")).replace(i.lastBracket,""),v?(m=m.replace(i.currencySymbol,""),this._mergeCurrencySignNegativePositiveSignAndValue(m,i,!0,!1)):"".concat(i.negativeSignCharacter).concat(m))}},{key:"_setBrackets",value:function(e){if(n.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var i=q(e.negativeBracketsTypeOnBlur.split(","),2),m=i[1];e.firstBracket=i[0],e.lastBracket=m}}},{key:"_convertToNumericString",value:function(e,i){e=this._removeBrackets(e,i,!1),e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(new RegExp("[".concat(i.digitGroupSeparator,"]"),"g"),""),"."!==i.decimalCharacter&&(e=e.replace(i.decimalCharacter,".")),n.isNegative(e)&&e.lastIndexOf("-")===e.length-1&&(e=e.replace("-",""),e="-".concat(e)),i.showPositiveSign&&(e=e.replace(i.positiveSignCharacter,""));var m=n.arabicToLatinNumbers(e,i.leadingZero!==s.options.leadingZero.keep,!1,!1);return isNaN(m)||(e=m.toString()),e}},{key:"_normalizeCurrencySuffixAndNegativeSignCharacters",value:function(e,i){return e=String(e),i.currencySymbol!==s.options.currencySymbol.none&&(e=e.replace(i.currencySymbol,"")),i.suffixText!==s.options.suffixText.none&&(e=e.replace(i.suffixText,"")),i.negativeSignCharacter!==s.options.negativeSignCharacter.hyphen&&(e=e.replace(i.negativeSignCharacter,"-")),e}},{key:"_toLocale",value:function(e,i,a){if(n.isNull(i)||i===s.options.outputFormat.string)return e;var m;switch(i){case s.options.outputFormat.number:m=Number(e);break;case s.options.outputFormat.dotNegative:m=n.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=n.isNegative(m)?m.replace("-","")+"-":m;break;case s.options.outputFormat.dot:case s.options.outputFormat.negativeDot:m=e;break;default:n.throwError("The given outputFormat [".concat(i,"] option is not recognized."))}return i!==s.options.outputFormat.number&&"-"!==a.negativeSignCharacter&&(m=m.replace("-",a.negativeSignCharacter)),m}},{key:"_modifyNegativeSignAndDecimalCharacterForFormattedValue",value:function(e,i){return"-"!==i.negativeSignCharacter&&(e=e.replace("-",i.negativeSignCharacter)),"."!==i.decimalCharacter&&(e=e.replace(".",i.decimalCharacter)),e}},{key:"_isElementValueEmptyOrOnlyTheNegativeSign",value:function(e,i){return""===e||e===i.negativeSignCharacter}},{key:"_orderValueCurrencySymbolAndSuffixText",value:function(e,i,a){var m;if(i.emptyInputBehavior===s.options.emptyInputBehavior.always||a)switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.none:m=e+i.currencySymbol+i.suffixText;break;default:m=i.currencySymbol+e+i.suffixText}else m=e;return m}},{key:"_addGroupSeparators",value:function(e,i,a,m,v){var c,E=4<arguments.length&&void 0!==v?v:null;if(c=n.isNull(E)?n.isNegative(e,i.negativeSignCharacter)||n.isNegativeWithBrackets(e,i.firstBracket,i.lastBracket):E<0,e=this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,!1,a),this._isElementValueEmptyOrOnlyTheNegativeSign(e,i))return this._orderValueCurrencySymbolAndSuffixText(e,i,!0);var M,Z=n.isZeroOrHasNoValue(e);switch(c&&(e=e.replace("-","")),i.digitalGroupSpacing=i.digitalGroupSpacing.toString(),i.digitalGroupSpacing){case s.options.digitalGroupSpacing.two:M=/(\d)((\d)(\d{2}?)+)$/;break;case s.options.digitalGroupSpacing.twoScaled:M=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;case s.options.digitalGroupSpacing.four:M=/(\d)((\d{4}?)+)$/;break;default:M=/(\d)((\d{3}?)+)$/}var y,L=q(e.split(i.decimalCharacter),2),D=L[0],B=L[1];if(i.decimalCharacterAlternative&&n.isUndefined(B)){var z=q(e.split(i.decimalCharacterAlternative),2);D=z[0],B=z[1]}if(""!==i.digitGroupSeparator)for(;M.test(D);)D=D.replace(M,"$1".concat(i.digitGroupSeparator,"$2"));return e=0===(y=a?i.decimalPlacesShownOnFocus:i.decimalPlacesShownOnBlur)||n.isUndefined(B)?D:(B.length>y&&(B=B.substring(0,y)),"".concat(D).concat(i.decimalCharacter).concat(B)),e=s._mergeCurrencySignNegativePositiveSignAndValue(e,i,c,Z),n.isNull(E)&&(E=m),null!==i.negativeBracketsTypeOnBlur&&(E<0||n.isNegativeStrict(e,i.negativeSignCharacter))&&(e=this._toggleNegativeBracket(e,i,a)),i.suffixText?"".concat(e).concat(i.suffixText):e}},{key:"_mergeCurrencySignNegativePositiveSignAndValue",value:function(e,i,a,m){var v,c="";if(a?c=i.negativeSignCharacter:i.showPositiveSign&&!m&&(c=i.positiveSignCharacter),i.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)if(i.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(a||!a&&i.showPositiveSign&&!m))switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:v="".concat(c).concat(i.currencySymbol).concat(e);break;case s.options.negativePositiveSignPlacement.right:v="".concat(i.currencySymbol).concat(c).concat(e);break;case s.options.negativePositiveSignPlacement.suffix:v="".concat(i.currencySymbol).concat(e).concat(c)}else v=i.currencySymbol+e;else if(i.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)if(i.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(a||!a&&i.showPositiveSign&&!m))switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:v="".concat(e).concat(i.currencySymbol).concat(c);break;case s.options.negativePositiveSignPlacement.left:v="".concat(e).concat(c).concat(i.currencySymbol);break;case s.options.negativePositiveSignPlacement.prefix:v="".concat(c).concat(e).concat(i.currencySymbol)}else v=e+i.currencySymbol;return v}},{key:"_truncateZeros",value:function(e,i){var a;switch(i){case 0:a=/(\.(?:\d*[1-9])?)0*$/;break;case 1:a=/(\.\d(?:\d*[1-9])?)0*$/;break;default:a=new RegExp("(\\.\\d{".concat(i,"}(?:\\d*[1-9])?)0*"))}return e=e.replace(a,"$1"),0===i&&(e=e.replace(/\.$/,"")),e}},{key:"_roundRawValue",value:function(e,i){return this._roundValue(e,i,i.decimalPlacesRawValue)}},{key:"_roundFormattedValueShownOnFocus",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnFocus))}},{key:"_roundFormattedValueShownOnBlur",value:function(e,i){return this._roundValue(e,i,Number(i.decimalPlacesShownOnBlur))}},{key:"_roundFormattedValueShownOnFocusOrBlur",value:function(e,i,a){return a?this._roundFormattedValueShownOnFocus(e,i):this._roundFormattedValueShownOnBlur(e,i)}},{key:"_roundValue",value:function(e,i,a){if(n.isNull(e))return e;if(e=""===e?"0":e.toString(),i.roundingMethod===s.options.roundingMethod.toNearest05||i.roundingMethod===s.options.roundingMethod.toNearest05Alt||i.roundingMethod===s.options.roundingMethod.upToNext05||i.roundingMethod===s.options.roundingMethod.downToNext05)return this._roundCloseTo05(e,i);var m,v=q(s._prepareValueForRounding(e,i),2),c=v[0],E=(e=v[1]).lastIndexOf("."),M=-1===E,Z=q(e.split("."),2),y=Z[0];if(!(0<Z[1]||i.allowDecimalPadding!==s.options.allowDecimalPadding.never&&i.allowDecimalPadding!==s.options.allowDecimalPadding.floats))return 0===Number(e)?y:"".concat(c).concat(y);m=i.allowDecimalPadding===s.options.allowDecimalPadding.always||i.allowDecimalPadding===s.options.allowDecimalPadding.floats?a:0;var L,B=e.length-1-(M?e.length-1:E),z="";if(B<=a){if(z=e,B<m){M&&(z="".concat(z).concat(i.decimalCharacter));for(var W="000000";B<m;)z+=W=W.substring(0,m-B),B+=W.length}else m<B?z=this._truncateZeros(z,m):0===B&&0===m&&(z=z.replace(/\.$/,""));return 0===Number(z)?z:"".concat(c).concat(z)}L=M?a-1:Number(a)+Number(E);var Y,ne=Number(e.charAt(L+1)),le=e.substring(0,L+1).split("");if(Y="."===e.charAt(L)?e.charAt(L-1)%2:e.charAt(L)%2,this._shouldRoundUp(ne,i,c,Y))for(var se=le.length-1;0<=se;--se)if("."!==le[se]){if(le[se]=+le[se]+1,le[se]<10)break;0<se&&(le[se]="0")}return le=le.slice(0,L+1),z=this._truncateZeros(le.join(""),m),0===Number(z)?z:"".concat(c).concat(z)}},{key:"_roundCloseTo05",value:function(e,i){switch(i.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 n.contains(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}},{key:"_prepareValueForRounding",value:function(e,i){var a="";return n.isNegativeStrict(e,"-")&&(a="-",e=e.replace("-","")),e.match(/^\d/)||(e="0".concat(e)),0===Number(e)&&(a=""),(0<Number(e)&&i.leadingZero!==s.options.leadingZero.keep||0<e.length&&i.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(/^0*(\d)/,"$1")),[a,e]}},{key:"_shouldRoundUp",value:function(e,i,a,m){return 4<e&&i.roundingMethod===s.options.roundingMethod.halfUpSymmetric||4<e&&i.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&""===a||5<e&&i.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&"-"===a||5<e&&i.roundingMethod===s.options.roundingMethod.halfDownSymmetric||5<e&&i.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&""===a||4<e&&i.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&"-"===a||5<e&&i.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding||5===e&&i.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding&&1===m||0<e&&i.roundingMethod===s.options.roundingMethod.toCeilingTowardPositiveInfinity&&""===a||0<e&&i.roundingMethod===s.options.roundingMethod.toFloorTowardNegativeInfinity&&"-"===a||0<e&&i.roundingMethod===s.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,i,a,m){a&&(e=this._roundFormattedValueShownOnFocus(e,i));var v=q(e.split(i.decimalCharacter),2),c=v[0],E=v[1];if(E&&E.length>m)if(0<m){var M=E.substring(0,m);e="".concat(c).concat(i.decimalCharacter).concat(M)}else e=c;return e}},{key:"_checkIfInRangeWithOverrideOption",value:function(e,i){if(n.isNull(e)&&i.emptyInputBehavior===s.options.emptyInputBehavior.null||i.overrideMinMaxLimits===s.options.overrideMinMaxLimits.ignore||i.overrideMinMaxLimits===s.options.overrideMinMaxLimits.invalid)return[!0,!0];e=(e=e.toString()).replace(",",".");var a,m=n.parseStr(i.minimumValue),v=n.parseStr(i.maximumValue),c=n.parseStr(e);switch(i.overrideMinMaxLimits){case s.options.overrideMinMaxLimits.floor:a=[-1<n.testMinMax(m,c),!0];break;case s.options.overrideMinMaxLimits.ceiling:a=[!0,n.testMinMax(v,c)<1];break;default:a=[-1<n.testMinMax(m,c),n.testMinMax(v,c)<1]}return a}},{key:"_isWithinRangeWithOverrideOption",value:function(e,i){var a=q(this._checkIfInRangeWithOverrideOption(e,i),2);return a[0]&&a[1]}},{key:"_cleanValueForRangeParse",value:function(e){return e=e.toString().replace(",","."),n.parseStr(e)}},{key:"_isMinimumRangeRespected",value:function(e,i){return-1<n.testMinMax(n.parseStr(i.minimumValue),this._cleanValueForRangeParse(e))}},{key:"_isMaximumRangeRespected",value:function(e,i){return n.testMinMax(n.parseStr(i.maximumValue),this._cleanValueForRangeParse(e))<1}},{key:"_readCookie",value:function(e){for(var i=e+"=",a=document.cookie.split(";"),m="",v=0;v<a.length;v+=1){for(m=a[v];" "===m.charAt(0);)m=m.substring(1,m.length);if(0===m.indexOf(i))return m.substring(i.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(n.isNull(e.negativePositiveSignPlacement))if(n.isUndefined(e)||!n.isUndefinedOrNullOrEmpty(e.negativePositiveSignPlacement)||n.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 n.isNull(e)?null:(!n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&n.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&(e.selectOnFocus=s.options.selectOnFocus.doNotSelect),n.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&!n.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 i=0;e.rawValueDivisor&&e.rawValueDivisor!==s.options.rawValueDivisor.none&&(i=String(e.rawValueDivisor).length-1)<0&&(i=0),e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+i,Number(e.originalDecimalPlacesRawValue)+i)}},{key:"_calculateDecimalPlacesOnUpdate",value:function(e,i){var a=1<arguments.length&&void 0!==i?i:null;this._validateDecimalPlacesRawValue(e),n.isNull(a)&&n.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)):(n.isUndefined(e.decimalPlacesShownOnFocus)&&(e.decimalPlacesShownOnFocus=a.decimalPlacesShownOnFocus),n.isUndefined(e.decimalPlacesShownOnBlur)&&(e.decimalPlacesShownOnBlur=a.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(a.originalDecimalPlacesRawValue)+v)}}},{key:"_cachesUsualRegularExpressions",value:function(e,i){var a;a=e.negativeSignCharacter!==s.options.negativeSignCharacter.hyphen?"([-\\".concat(e.negativeSignCharacter,"]?)"):"(-?)",i.aNegRegAutoStrip=a,e.allowedAutoStrip=new RegExp("[^-0123456789\\".concat(e.decimalCharacter,"]"),"g"),e.numRegAutoStrip=new RegExp("".concat(a,"(?:\\").concat(e.decimalCharacter,"?([0-9]+\\").concat(e.decimalCharacter,"[0-9]+)|([0-9]*(?:\\").concat(e.decimalCharacter,"[0-9]*)?))")),e.stripReg=new RegExp("^".concat(i.aNegRegAutoStrip,"0*([0-9])")),e.formulaChars=new RegExp("[0-9".concat(e.decimalCharacter,"+\\-*/() ]"))}},{key:"_convertOldOptionsToNewOnes",value:function(e){var i={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 a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(!0===i[a])continue;Object.prototype.hasOwnProperty.call(i,a)?(n.warning("You are using the deprecated option name '".concat(a,"'. Please use '").concat(i[a],"' instead from now on. The old option name will be dropped very soon\u2122."),!0),e[i[a]]=e[a],delete e[a]):e.failOnUnknownOption&&n.throwError("Option name '".concat(a,"' is unknown. Please fix the options passed to autoNumeric"))}"mDec"in e&&n.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,i){var a;return n.isNumber(Number(e))?a=n.scientificToDecimal(e):(a=this._convertToNumericString(e.toString(),i),n.isNumber(Number(a))||(n.warning('The given value "'.concat(e,'" cannot be converted to a numeric one and therefore cannot be used appropriately.'),i.showWarnings),a=NaN)),a}},{key:"_checkIfInRange",value:function(e,i,a){var m=n.parseStr(e);return-1<n.testMinMax(i,m)&&n.testMinMax(a,m)<1}},{key:"_shouldSkipEventKey",value:function(e){var i=n.isInArray(e,P.keyName._allFnKeys),a=e===P.keyName.OSLeft||e===P.keyName.OSRight,m=e===P.keyName.ContextMenu,v=n.isInArray(e,P.keyName._someNonPrintableKeys);return i||a||m||v||e===P.keyName.Unidentified||e===P.keyName.NumLock||e===P.keyName.ScrollLock||e===P.keyName.Insert||e===P.keyName.Command}},{key:"_serialize",value:function(e,i,a,m,v){var c,E=this,M=1<arguments.length&&void 0!==i&&i,Z=2<arguments.length&&void 0!==a?a:"unformatted",y=3<arguments.length&&void 0!==m?m:"+",L=4<arguments.length&&void 0!==v?v:null,D=[];return"object"===me(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(ne){ne.selected&&D.push(M?{name:B.name,value:ne.value}:"".concat(encodeURIComponent(B.name),"=").concat(encodeURIComponent(ne.value)))});else if(-1===["checkbox","radio"].indexOf(B.type)||B.checked){var z,W;if(E.isManagedByAutoNumeric(B))switch(Z){case"unformatted":W=E.getAutoNumericElement(B),n.isNull(W)||(z=E.unformat(B,W.getSettings()));break;case"localized":if(W=E.getAutoNumericElement(B),!n.isNull(W)){var Y=n.cloneObject(W.getSettings());n.isNull(L)||(Y.outputFormat=L),z=E.localize(B,Y)}break;default:z=B.value}else z=B.value;n.isUndefined(z)&&n.throwError("This error should never be hit. If it has, something really wrong happened!"),D.push(M?{name:B.name,value:z}:"".concat(encodeURIComponent(B.name),"=").concat(encodeURIComponent(z)))}}),M?c=D:(c=D.join("&"),"+"===y&&(c=c.replace(/%20/g,"+"))),c}},{key:"_serializeNumericString",value:function(e,i){return this._serialize(e,!1,"unformatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeFormatted",value:function(e,i){return this._serialize(e,!1,"formatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeLocalized",value:function(e,i,a){return this._serialize(e,!1,"localized",1<arguments.length&&void 0!==i?i:"+",2<arguments.length&&void 0!==a?a:null)}},{key:"_serializeNumericStringArray",value:function(e,i){return this._serialize(e,!0,"unformatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeFormattedArray",value:function(e,i){return this._serialize(e,!0,"formatted",1<arguments.length&&void 0!==i?i:"+")}},{key:"_serializeLocalizedArray",value:function(e,i,a){return this._serialize(e,!0,"localized",1<arguments.length&&void 0!==i?i:"+",2<arguments.length&&void 0!==a?a:null)}}],ye((d=s).prototype,[{key:"_saveInitialValues",value:function(e){this.initialValueHtmlAttribute=n.scientificToDecimal(this.domElement.getAttribute("value")),n.isNull(this.initialValueHtmlAttribute)&&(this.initialValueHtmlAttribute=""),this.initialValue=e,n.isNull(this.initialValue)&&(this.initialValue="")}},{key:"_createEventListeners",value:function(){var e=this;this.formulaMode=!1,this._onFocusInFunc=function(i){e._onFocusIn(i)},this._onFocusInAndMouseEnterFunc=function(i){e._onFocusInAndMouseEnter(i)},this._onFocusFunc=function(){e._onFocus()},this._onKeydownFunc=function(i){e._onKeydown(i)},this._onKeypressFunc=function(i){e._onKeypress(i)},this._onKeyupFunc=function(i){e._onKeyup(i)},this._onFocusOutAndMouseLeaveFunc=function(i){e._onFocusOutAndMouseLeave(i)},this._onPasteFunc=function(i){e._onPaste(i)},this._onWheelFunc=function(i){e._onWheel(i)},this._onDropFunc=function(i){e._onDrop(i)},this._onKeydownGlobalFunc=function(i){e._onKeydownGlobal(i)},this._onKeyupGlobalFunc=function(i){e._onKeyupGlobal(i)},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;n.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(!n.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():n.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 i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?this.parentForm:i}},{key:"_storeFormHandlerFunction",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var a=n.randomString();this._getFormElement(i).dataset.anFormHandler=a,window.aNFormHandlerMap.set(a,{submitFn:this._onFormSubmitFunc,resetFn:this._onFormResetFunc})}},{key:"_getFormHandlerKey",value:function(){this._hasFormHandlerFunction()||n.throwError("Unable to retrieve the form handler name");var e=this.parentForm.dataset.anFormHandler;return""===e&&n.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(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,a=i.set,m=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return m.call(e.domElement)},set:function(v){a.call(e.domElement,v),e.settings.watchExternalChanges&&!e.internalModification&&e.set(v)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,a=i.set,m=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return m.call(e.domElement)},set:function(v){a.call(e.domElement,v)}})}}},{key:"_getAttributeToWatch",value:function(){var e;if(this.isInputElement)e="value";else{var i=this.domElement.nodeType;i===Node.ELEMENT_NODE||i===Node.DOCUMENT_NODE||i===Node.DOCUMENT_FRAGMENT_NODE?e="textContent":i===Node.TEXT_NODE&&(e="nodeValue")}return e}},{key:"_historyTableAdd",value:function(){var e=0===this.historyTable.length;if(e||this.rawValue!==this._historyTableCurrentValueUsed()){var i=!0;if(!e){var a=this.historyTableIndex+1;a<this.historyTable.length&&this.rawValue===this.historyTable[a].value?i=!1:n.arrayTrim(this.historyTable,this.historyTableIndex+1)}if(this.historyTableIndex++,i){var m=n.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 i;if(0<arguments.length&&void 0!==e&&!e?(i=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(i=0<this.historyTableIndex)&&this.historyTableIndex--,i){var a=this.historyTable[this.historyTableIndex];this.set(a.value,null,!1),n.setElementSelection(this.domElement,a.start,a.end)}}},{key:"_historyTableUndo",value:function(){this._historyTableUndoOrRedo(!0)}},{key:"_historyTableRedo",value:function(){this._historyTableUndoOrRedo(!1)}},{key:"_historyTableForget",value:function(e){for(var i=0<arguments.length&&void 0!==e?e:1,a=[],m=0;m<i;m++)a.push(this.historyTable.shift()),this.historyTableIndex--,this.historyTableIndex<0&&(this.historyTableIndex=0);return 1===a.length?a[0]:a}},{key:"_historyTableCurrentValueUsed",value:function(){var e=this.historyTableIndex;return e<0&&(e=0),n.isUndefinedOrNullOrEmpty(this.historyTable[e])?"":this.historyTable[e].value}},{key:"_parseStyleRules",value:function(){var e=this;n.isUndefinedOrNullOrEmpty(this.settings.styleRules)||""===this.rawValue||(n.isUndefinedOrNullOrEmpty(this.settings.styleRules.positive)||(0<=this.rawValue?this._addCSSClass(this.settings.styleRules.positive):this._removeCSSClass(this.settings.styleRules.positive)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)||(this.rawValue<0?this._addCSSClass(this.settings.styleRules.negative):this._removeCSSClass(this.settings.styleRules.negative)),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges)||0===this.settings.styleRules.ranges.length||this.settings.styleRules.ranges.forEach(function(i){e.rawValue>=i.min&&e.rawValue<i.max?e._addCSSClass(i.class):e._removeCSSClass(i.class)}),n.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined)||0===this.settings.styleRules.userDefined.length||this.settings.styleRules.userDefined.forEach(function(i){if(n.isFunction(i.callback))if(n.isString(i.classes))i.callback(e.rawValue)?e._addCSSClass(i.classes):e._removeCSSClass(i.classes);else if(n.isArray(i.classes))if(2===i.classes.length)i.callback(e.rawValue)?(e._addCSSClass(i.classes[0]),e._removeCSSClass(i.classes[1])):(e._removeCSSClass(i.classes[0]),e._addCSSClass(i.classes[1]));else if(2<i.classes.length){var a=i.callback(e.rawValue);n.isArray(a)?i.classes.forEach(function(m,v){n.isInArray(v,a)?e._addCSSClass(m):e._removeCSSClass(m)}):n.isInt(a)?i.classes.forEach(function(m,v){v===a?e._addCSSClass(m):e._removeCSSClass(m)}):n.isNull(a)?i.classes.forEach(function(m){e._removeCSSClass(m)}):n.throwError("The callback result is not an array nor a valid array index, ".concat(me(a)," given."))}else n.throwError("The classes attribute is not valid for the `styleRules` option.");else n.isUndefinedOrNullOrEmpty(i.classes)?i.callback(e):n.throwError("The callback/classes structure is not valid for the `styleRules` option.");else n.warning("The given `styleRules` callback is not a function, ".concat(typeof callback>"u"?"undefined":me(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,i=arguments.length,a=new Array(i),m=0;m<i;m++)a[m]=arguments[m];Array.isArray(a)&&Array.isArray(a[0])&&(a=a[0]);var v=n.cloneObject(this.settings),c=this.rawValue,E={};n.isUndefinedOrNullOrEmpty(a)||0===a.length?E=null:1<=a.length&&a.forEach(function(M){e.constructor._isPreDefinedOptionValid(M)&&(M=e.constructor._getOptionObject(M)),oe(E,M)});try{this._setSettings(E,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(c)}catch(M){return this._setSettings(v,!0),n.throwError("Unable to update the settings, those are invalid: [".concat(M,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(e,i,a){var m,v=1<arguments.length&&void 0!==i?i:null,c=!(2<arguments.length&&void 0!==a)||a;if(n.isUndefined(e))return n.warning("You are trying to set an 'undefined' value ; an error could have occurred.",this.settings.showWarnings),this;if(n.isNull(v)||this._setSettings(v,!0),null===e&&this.settings.emptyInputBehavior!==s.options.emptyInputBehavior.null)return n.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,c),this._saveValueToPersistentStorage(),this;if(m=this.constructor._toNumericValue(e,this.settings),isNaN(Number(m)))return n.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("",c),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:n.isNumber(this.settings.emptyInputBehavior)&&(m=Number(this.settings.emptyInputBehavior))}if(""===m)return this._setElementAndRawValue(this.settings.emptyInputBehavior===s.options.emptyInputBehavior.always?this.settings.currencySymbol:"","",c),this;var M=q(this.constructor._checkIfInRangeWithOverrideOption(m,this.settings),2),Z=M[0],y=M[1];if(Z&&y&&this.settings.valuesToStrings&&this._checkValuesToStrings(m))return this._setElementAndRawValue(this.settings.valuesToStrings[m],m,c),this._saveValueToPersistentStorage(),this;if(n.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,c),this._setValidOrInvalidState(L),this}return this._triggerRangeEvents(Z,y),n.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("",c),this}},{key:"setUnformatted",value:function(e,i){var a=1<arguments.length&&void 0!==i?i:null;if(null===e||n.isUndefined(e))return this;n.isNull(a)||this._setSettings(a,!0);var m=this.constructor._removeBrackets(e,this.settings),v=this.constructor._stripAllNonNumberCharacters(m,this.settings,!0,this.isFocused);return n.isNumber(v)||n.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):n.throwError("The value is out of the range limits [".concat(this.settings.minimumValue,", ").concat(this.settings.maximumValue,"].")),this}},{key:"setValue",value:function(e,i){return this._setElementAndRawValue(e,!(1<arguments.length&&void 0!==i)||i),this}},{key:"_setRawValue",value:function(e,i){var a=!(1<arguments.length&&void 0!==i)||i;if(this.rawValue!==e){var m=this.rawValue;this.rawValue=e,!n.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(),a&&this._historyTableAdd()}}},{key:"_setElementValue",value:function(e,i){var a=!(1<arguments.length&&void 0!==i)||i,m=n.getElementValue(this.domElement);return e!==m&&(this.internalModification=!0,n.setElementValue(this.domElement,e),this.internalModification=!1,a&&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,i,a){var m=1<arguments.length&&void 0!==i?i:null,v=!(2<arguments.length&&void 0!==a)||a;return n.isNull(m)?m=e:n.isBoolean(m)&&(v=m,m=e),this._setElementValue(e),this._setRawValue(m,v),this}},{key:"_getRawValueToFormat",value:function(e){return n.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,i){!n.isNull(i)&&n.isFunction(i)&&i(e,this)}},{key:"_triggerEvent",value:function(e,i,a){var m=1<arguments.length&&void 0!==i?i:document;n.triggerEvent(e,m,2<arguments.length&&void 0!==a?a: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 i,a=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(this.rawValue)?null:n.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(i,a),i}},{key:"getFormatted",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;"value"in this.domElement||"textContent"in this.domElement||n.throwError("Unable to get the formatted string from the element.");var a=n.getElementValue(this.domElement);return this._executeCallback(a,i),a}},{key:"getNumber",value:function(e){var i,a=0<arguments.length&&void 0!==e?e:null;return i=null===this.rawValue?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(i,a),i}},{key:"getLocalized",value:function(e,i){var a,m,v=0<arguments.length&&void 0!==e?e:null,c=1<arguments.length&&void 0!==i?i:null;n.isFunction(v)&&n.isNull(c)&&(c=v,v=null),(a=n.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))&&0===Number(a)&&this.settings.leadingZero!==s.options.leadingZero.keep&&(a="0"),m=n.isNull(v)?this.settings.outputFormat:v;var E=this.constructor._toLocale(a,m,this.settings);return this._executeCallback(E,c),E}},{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(){n.setElementSelection(this.domElement,0,n.getElementValue(this.domElement).length)}},{key:"selectNumber",value:function(){var e,i,a=n.getElementValue(this.domElement),m=a.length,v=this.settings.currencySymbol.length,c=this.settings.currencySymbolPlacement,E=n.isNegative(a,this.settings.negativeSignCharacter)?1:0,M=this.settings.suffixText.length;if(e=c===s.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left&&1==E&&0<v?v+1:v,c===s.options.currencySymbolPlacement.prefix)i=m-M;else switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:i=m-(M+v);break;case s.options.negativePositiveSignPlacement.right:i=0<v?m-(v+E+M):m-(v+M);break;default:i=m-(v+M)}return n.setElementSelection(this.domElement,e,i),this}},{key:"selectInteger",value:function(){var e=0,i=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&&i||!i&&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 a=n.getElementValue(this.domElement),m=a.indexOf(this.settings.decimalCharacter);return-1===m&&(m=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?a.length-this.settings.currencySymbol.length:a.length,i||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.suffix&&this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.suffix||--m,m-=this.settings.suffixText.length),n.setElementSelection(this.domElement,e,m),this}},{key:"selectDecimal",value:function(){var e,a=n.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return e=-1===a?a=0:(a+=1)+Number(this.isFocused?this.settings.decimalPlacesShownOnFocus:this.settings.decimalPlacesShownOnBlur),n.setElementSelection(this.domElement,a,e),this}},{key:"node",value:function(){return this.domElement}},{key:"parent",value:function(){return this.domElement.parentNode}},{key:"detach",value:function(e){var i,a=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(a)?this.domElement:a.node(),this._removeFromLocalList(i),this}},{key:"attach",value:function(e,i){var a=!(1<arguments.length&&void 0!==i)||i;return this._addToLocalList(e.node()),a&&e.update(this.settings),this}},{key:"formatOther",value:function(e,i){return this._formatOrUnformatOther(!0,e,1<arguments.length&&void 0!==i?i:null)}},{key:"unformatOther",value:function(e,i){return this._formatOrUnformatOther(!1,e,1<arguments.length&&void 0!==i?i:null)}},{key:"_formatOrUnformatOther",value:function(e,i,a){var m,v,c=2<arguments.length&&void 0!==a?a:null;if(m=n.isNull(c)?this.settings:this._cloneAndMergeSettings(c),n.isElement(i)){var E=n.getElementValue(i);return v=e?s.format(E,m):s.unformat(E,m),n.setElementValue(i,v),null}return e?s.format(i,m):s.unformat(i,m)}},{key:"init",value:function(e,i){var a=this,m=!(1<arguments.length&&void 0!==i)||i,v=!1,c=[];if(n.isString(e)?c=j(document.querySelectorAll(e)):n.isElement(e)?(c.push(e),v=!0):n.isArray(e)?c=e:n.throwError("The given parameters to the 'init' function are invalid."),0===c.length)return n.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var E=this._getLocalList(),M=[];return c.forEach(function(Z){var y=a.settings.createLocalList;m&&(a.settings.createLocalList=!1);var L=new s(Z,n.getElementValue(Z),a.settings);m&&(L._setLocalList(E),a._addToLocalList(Z,L),a.settings.createLocalList=y),M.push(L)}),v?M[0]:M}},{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||n.isUndefinedOrNullOrEmpty(this.parentForm)){var i=this._getParentForm();if(!n.isNull(i)&&i!==this.parentForm){var a=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=a.length,this._hasFormHandlerFunction(i)?this._incrementParentFormCounter(i):(this._storeFormHandlerFunction(i),this._initializeFormCounterToOne(i))}this.parentForm=i}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var i=this;return j(e.querySelectorAll("input")).filter(function(a){return i.constructor.isManagedByAutoNumeric(a)})}},{key:"_getParentForm",value:function(){if("body"===this.domElement.tagName.toLowerCase())return null;var e,i=this.domElement;do{if(n.isNull(i=i.parentNode))return null;if("body"===(e=i.tagName?i.tagName.toLowerCase():""))break}while("form"!==e);return"form"===e?i: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 i,a=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(a)?this.settings.outputFormat:a,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,i)}},{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 i,a=0<arguments.length&&void 0!==e?e:null;return i=n.isNull(a)?this.settings.outputFormat:a,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,i)}},{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 i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?(this.formUnformat(),this.form().submit(),this.formReformat()):n.isFunction(i)?i(this.formNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return n.isNull(i)?this.form().submit():n.isFunction(i)?i(this.formFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(e,i){var a=0<arguments.length&&void 0!==e?e:null,m=1<arguments.length&&void 0!==i?i:null;return n.isNull(m)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):n.isFunction(m)?m(this.formLocalized(a)):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayNumericString",value:function(e){return n.isFunction(e)?e(this.formArrayNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayFormatted",value:function(e){return n.isFunction(e)?e(this.formArrayFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayLocalized",value:function(e,i){var a=1<arguments.length&&void 0!==i?i:null;return n.isFunction(e)?e(this.formArrayLocalized(a)):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonNumericString",value:function(e){return n.isFunction(e)?e(this.formJsonNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonFormatted",value:function(e){return n.isFunction(e)?e(this.formJsonFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonLocalized",value:function(e,i){var a=1<arguments.length&&void 0!==i?i:null;return n.isFunction(e)?e(this.formJsonLocalized(a)):n.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,i){var a=1<arguments.length&&void 0!==i?i:null;n.isNull(a)&&(a=this),n.isUndefined(this.autoNumericLocalList)?n.throwError("The local list provided does not exists when trying to add an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.set(e,a)}},{key:"_removeFromLocalList",value:function(e){n.isUndefined(this.autoNumericLocalList)?this.settings.createLocalList&&n.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,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];oe.apply(void 0,[this.settings].concat(i))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},i=arguments.length,a=new Array(i),m=0;m<i;m++)a[m]=arguments[m];return oe.apply(void 0,[e,this.settings].concat(a)),e}},{key:"_updatePredefinedOptions",value:function(e,i){var a=1<arguments.length&&void 0!==i?i:null;return n.isNull(a)?this.update(e):(this._mergeSettings(e,a),this.update(this.settings)),this}},{key:"french",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().French,i),this}},{key:"northAmerican",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().NorthAmerican,i),this}},{key:"british",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().British,i),this}},{key:"swiss",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Swiss,i),this}},{key:"japanese",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Japanese,i),this}},{key:"spanish",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Spanish,i),this}},{key:"chinese",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Chinese,i),this}},{key:"brazilian",value:function(e){var i=0<arguments.length&&void 0!==e?e:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Brazilian,i),this}},{key:"_runCallbacksFoundInTheSettingsObject",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var i=this.settings[e];if("function"==typeof i)this.settings[e]=i(this,e);else{var a=this.domElement.getAttribute(e);a=n.camelize(a),"function"==typeof this.settings[a]&&(this.settings[e]=a(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){n.isNull(this.settings.caretPositionOnFocus)&&this.settings.selectOnFocus===s.options.selectOnFocus.doNotSelect&&n.throwError("`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.");var i=this.rawValue<0,a=n.isZeroOrHasNoValue(e),m=e.length,v=0,c=0,E=!1,M=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,E=n.contains(e,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalRight||(M=E?(c=e.indexOf(this.settings.decimalCharacter),this.settings.decimalCharacter.length):(c=v,0)));var Z="";i?Z=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!a&&(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&&(i||!i&&this.settings.showPositiveSign&&!a))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&&(i||!i&&this.settings.showPositiveSign&&!a))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&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:y=L+D+c;break;case s.options.negativePositiveSignPlacement.suffix:y=D+c}else y=D+c;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:y=L+D+c+M;break;case s.options.negativePositiveSignPlacement.suffix:y=D+c+M}else y=D+c+M}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&&(i||!i&&this.settings.showPositiveSign&&!a))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&&(i||!i&&this.settings.showPositiveSign&&!a))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&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:y=c;break;case s.options.negativePositiveSignPlacement.prefix:y=L+c}else y=c;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!a))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:y=c+M;break;case s.options.negativePositiveSignPlacement.prefix:y=L+c+M}else y=c+M;return y}},{key:"_triggerRangeEvents",value:function(e,i){e||this._triggerEvent(s.events.minRangeExceeded,this.domElement),i||this._triggerEvent(s.events.maxRangeExceeded,this.domElement)}},{key:"_setInvalidState",value:function(){this.isInputElement?n.setInvalidState(this.domElement):this._addCSSClass(this.settings.invalidClass),this._triggerEvent(s.events.invalidValue,this.domElement),this.validState=!1}},{key:"_setValidState",value:function(){this.isInputElement?n.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 i=this.constructor._isMinimumRangeRespected(e,this.settings),a=this.constructor._isMaximumRangeRespected(e,this.settings);i&&a?this._setValidState():this._setInvalidState(),this._triggerRangeEvents(i,a)}}},{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 n.contains(e,".")&&(e=e.replace(/(\.[0-9]*?)0+$/,"$1")),e.replace(/\.$/,"")}},{key:"_setPersistentStorageName",value:function(){this.settings.saveValueToSessionStorage&&(this.rawValueStorageName=""===this.domElement.name||n.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):(n.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 i="; expires=".concat(e.toUTCString());document.cookie="".concat(this.rawValueStorageName,"='' ;").concat(i,"; path=/")}}},{key:"_getDefaultValue",value:function(e){var i=e.getAttribute("value");return n.isNull(i)?"":i}},{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 i=null;this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus&&this.rawValue<0&&null!==this.settings.negativeBracketsTypeOnBlur&&this.settings.isNegativeSignAllowed&&(i=this.constructor._removeBrackets(n.getElementValue(this.domElement),this.settings));var a=this._getRawValueToFormat(this.rawValue);if(""!==a){var m=this.constructor._roundFormattedValueShownOnFocusOrBlur(a,this.settings,this.isFocused);i=this.settings.showOnlyNumbersOnFocus===s.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",m.replace(".",this.settings.decimalCharacter)):n.isNull(m)?"":this.constructor._addGroupSeparators(m.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,a)}this.valueOnFocus=n.isNull(i)?"":i,this.lastVal=this.valueOnFocus;var v=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),c=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),E=v&&""!==c&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus;E&&(i=c),n.isNull(i)||this._setElementValue(i),E&&c===this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&n.setElementSelection(e.target,0)}}},{key:"_onFocus",value:function(){this.settings.isCancellable&&this._saveCancellableValue()}},{key:"_onFocusIn",value:function(e){this.settings.selectOnFocus?this.select():n.isNull(this.settings.caretPositionOnFocus)||n.setElementSelection(e.target,this._initialCaretPosition(n.getElementValue(this.domElement)))}},{key:"_enterFormulaMode",value:function(){this.settings.formulaMode&&(this.formulaMode=!0,n.setElementValue(this.domElement,"="),n.setElementSelection(this.domElement,1))}},{key:"_exitFormulaMode",value:function(){var e,i=n.getElementValue(this.domElement);i=i.replace(/^\s*=/,"");try{var a=new U(i,this.settings.decimalCharacter);e=(new p).evaluate(a)}catch{return this._triggerEvent(s.events.invalidFormula,this.domElement,{formula:i,aNElement:this}),this.reformat(),void(this.formulaMode=!1)}this._triggerEvent(s.events.validFormula,this.domElement,{formula:i,result:e,aNElement:this}),this.set(e),this.formulaMode=!1}},{key:"_acceptNonPrintableKeysInFormulaMode",value:function(){return this.eventKey===P.keyName.Backspace||this.eventKey===P.keyName.Delete||this.eventKey===P.keyName.LeftArrow||this.eventKey===P.keyName.RightArrow||this.eventKey===P.keyName.Home||this.eventKey===P.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!==n.getHoveredElement()){if(this._updateEventKeyInfo(e),this.keydownEventCounter+=1,1===this.keydownEventCounter&&(this.initialValueOnFirstKeydown=n.getElementValue(e.target),this.initialRawValueOnFirstKeydown=this.rawValue),this.formulaMode){if(this.eventKey===P.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===P.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else if(this.eventKey===P.keyName.Equal)return void this._enterFormulaMode();if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===P.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 i=n.getElementValue(e.target);if(this.eventKey===P.keyName.Enter&&this.rawValue!==this.rawValueOnFocus&&(this._triggerEvent(s.events.native.change,e.target),this.valueOnFocus=i,this.rawValueOnFocus=this.rawValue,this.settings.isCancellable&&this._saveCancellableValue()),this._updateInternalProperties(e),this._processNonPrintableKeysAndShortcuts(e))this.processed=!0;else if(this.eventKey===P.keyName.Backspace||this.eventKey===P.keyName.Delete){var a=this._processCharacterDeletion();if(this.processed=!0,!a)return void e.preventDefault();this._formatValue(e),(i=n.getElementValue(e.target))!==this.lastVal&&this.throwInput&&(this._triggerEvent(s.events.native.input,e.target),e.preventDefault()),this.lastVal=i,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!==P.keyName.Insert){var i=this.processed;if(this._updateInternalProperties(e),!this._processNonPrintableKeysAndShortcuts(e))if(i)e.preventDefault();else{if(this._processCharacterInsertion()){this._formatValue(e);var a=n.getElementValue(e.target);if(a!==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)&&n.getElementSelection(e.target).start===n.getElementSelection(e.target).end&&n.getElementSelection(e.target).start===a.indexOf(this.settings.decimalCharacter)){var m=n.getElementSelection(e.target).start+1;n.setElementSelection(e.target,m)}e.preventDefault()}return this.lastVal=n.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===P.keyName.Esc)e.preventDefault();else{if(this.eventKey===P.keyName.Z||this.eventKey===P.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===P.keyName.x){var i=n.getElementSelection(this.domElement).start,a=this.constructor._toNumericValue(n.getElementValue(e.target),this.settings);this.set(a),this._setCaretPosition(i)}if(this.eventKey===P.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!e.ctrlKey&&!e.metaKey||this.eventKey!==P.keyName.Backspace&&this.eventKey!==P.keyName.Delete){this._updateInternalProperties(e);var m=this._processNonPrintableKeysAndShortcuts(e);delete this.valuePartsBeforePaste;var v=n.getElementValue(e.target);if(!(m||""===v&&""===this.initialValueOnFirstKeydown)&&(v===this.settings.currencySymbol?n.setElementSelection(e.target,this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?0:this.settings.currencySymbol.length):this.eventKey===P.keyName.Tab&&n.setElementSelection(e.target,0,v.length),(v===this.settings.suffixText||""===this.rawValue&&""!==this.settings.currencySymbol&&""!==this.settings.suffixText)&&n.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 c=n.getElementSelection(this.domElement);this.selectionStart=c.start,this.selectionEnd=c.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var E=n.getElementValue(e.target);this._setRawValue(this._formatOrUnformatOther(!1,E))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===P.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 i=this._getRawValueToFormat(this.rawValue),a=n.isNull(i),m=q(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),v=m[0],c=m[1],E=!1;if(""===i||a||(this._triggerRangeEvents(v,c),this.settings.valuesToStrings&&this._checkValuesToStrings(i)&&(this._setElementValue(this.settings.valuesToStrings[i]),E=!0)),!E){var M;if(M=a||""===i?i:String(i),""===i||a){if(""===i)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:this._setRawValue("0"),M=this.constructor._roundValue("0",this.settings,0);break;case s.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),M=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case s.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),M=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:n.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),M=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else v&&c&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(i,this.settings)?(M=this._modifyNegativeSignAndDecimalCharacterForRawValue(M),this.settings.divisorWhenUnfocused&&!n.isNull(M)&&(M=(M/=this.settings.divisorWhenUnfocused).toString()),M=this.constructor._roundFormattedValueShownOnBlur(M,this.settings),M=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(M,this.settings)):this._triggerRangeEvents(v,c);var Z=this.constructor._orderValueCurrencySymbolAndSuffixText(M,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(M,this.settings)||a&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.null||(Z=this.constructor._addGroupSeparators(M,this.settings,!1,i)),Z===i&&""!==i&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.never&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.floats||(this.settings.symbolWhenUnfocused&&""!==i&&null!==i&&(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 i,a;window.clipboardData&&window.clipboardData.getData?i=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?i=e.clipboardData.getData("text/plain"):n.throwError("Unable to retrieve the pasted value. Please use a modern browser (ie. Firefox or Chromium).");var m=n.getElementValue(a=e.target.tagName?e.target:e.explicitOriginalTarget),v=a.selectionStart||0,c=a.selectionEnd||0,E=c-v;if(E===m.length){var M=this._preparePastedText(i),Z=n.arabicToLatinNumbers(M,!1,!1,!1);return"."===Z||""===Z||"."!==Z&&!n.isNumber(Z)?(this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")))):(this.set(Z),this.formatted=!0,void this._triggerEvent(s.events.native.input,a))}var y=n.isNegativeStrict(i,this.settings.negativeSignCharacter);y&&(i=i.slice(1,i.length));var L,D,B=this._preparePastedText(i);if("."!==(L="."===B?".":n.arabicToLatinNumbers(B,!1,!1,!1))&&(!n.isNumber(L)||""===L))return this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' is not a valid paste content.")));var z,W,Y=n.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);z=!(!y||Y)&&(Y=!0);var ne=m.slice(0,v),le=m.slice(c,m.length);W=this._preparePastedText(v!==c?ne+le:m),Y&&(W=n.setRawNegativeSign(W)),D=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,v,this.settings.decimalCharacter)),z&&D++;var se=W.slice(0,D),Oe=W.slice(D,W.length),ce=!1;"."===L&&(n.contains(se,".")&&(ce=!0,se=se.replace(".","")),Oe=Oe.replace(".",""));var Ee=!1;switch(""===se&&"-"===Oe&&(se="-",Ee=!(Oe="")),this.settings.onInvalidPaste){case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:for(var We=n.parseStr(this.settings.minimumValue),Je=n.parseStr(this.settings.maximumValue),ke=W,Ce=0,Me=se;Ce<L.length&&(W=(Me+=L[Ce])+Oe,this.constructor._checkIfInRange(W,We,Je));)ke=W,Ce++;if(D+=Ce,Ee&&D++,this.settings.onInvalidPaste===s.options.onInvalidPaste.truncate){W=ke,ce&&D--;break}for(var Fe=D,Ye=ke.length;Ce<L.length&&Fe<Ye;)if("."!==ke[Fe]){if(W=n.replaceCharAt(ke,Fe,L[Ce]),!this.constructor._checkIfInRange(W,We,Je))break;ke=W,Ce++,Fe++}else Fe++;D=Fe,ce&&D--,W=ke;break;default:if(W="".concat(se).concat(L).concat(Oe),v===c)D=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,v,this.settings.decimalCharacter))+L.length;else if(""===Oe)D=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,v,this.settings.decimalCharacter))+L.length,Ee&&D++;else{var Xe=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(m,c,this.settings.decimalCharacter)),et=n.getElementValue(a).slice(v,c);D=Xe-E+n.countCharInText(this.settings.digitGroupSeparator,et)+L.length}z&&D++,ce&&D--}if(n.isNumber(W)&&""!==W){var De=!1,He=!1;try{this.set(W),De=!0}catch{var Le;switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:Le=n.clampToRangeLimits(W,this.settings);try{this.set(Le)}catch{n.throwError("Fatal error: Unable to set the clamped value '".concat(Le,"'."))}De=He=!0,W=Le;break;case s.options.onInvalidPaste.error:case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:n.throwError("The pasted value '".concat(i,"' results in a value '").concat(W,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));default:return}}var Ke,Re=n.getElementValue(a);if(De)switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:if(He){n.setElementSelection(a,this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?Re.length-this.settings.currencySymbol.length:Re.length);break}default:Ke=n.findCaretPositionInFormattedNumber(W,D,Re,this.settings.decimalCharacter),n.setElementSelection(a,Ke)}De&&m!==Re&&this._triggerEvent(s.events.native.input,a)}else this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&n.throwError("The pasted value '".concat(i,"' would result into an invalid content '").concat(W,"'."))}}},{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,n.isNegativeStrict(String(e.deltaY))?-50:50)):this.wheelAction(e):n.throwError("Unknown `wheelOn` option."))}},{key:"wheelAction",value:function(e){this.isWheelEvent=!0;var i,a=e.target.selectionStart||0,m=e.target.selectionEnd||0,v=this.rawValue;if(n.isUndefinedOrNullOrEmpty(v)?0<this.settings.minimumValue||this.settings.maximumValue<0?n.isWheelUpEvent(e)?i=this.settings.minimumValue:n.isWheelDownEvent(e)?i=this.settings.maximumValue:n.throwError("The event is not a 'wheel' event."):i=0:i=v,i=+i,n.isNumber(this.settings.wheelStep)){var c=+this.settings.wheelStep;n.isWheelUpEvent(e)?i+=c:n.isWheelDownEvent(e)&&(i-=c)}else n.isWheelUpEvent(e)?i=n.addAndRoundToNearestAuto(i,this.settings.decimalPlacesRawValue):n.isWheelDownEvent(e)&&(i=n.subtractAndRoundToNearestAuto(i,this.settings.decimalPlacesRawValue));(i=n.clampToRangeLimits(i,this.settings))!==+v&&(this.set(i),this._triggerEvent(s.events.native.input,e.target)),e.preventDefault(),this._setSelection(a,m),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){var i;this.isDropEvent=!0,e.preventDefault(),i=n.isIE11()?"text":"text/plain";var a=e.dataTransfer.getData(i),m=this.unformatOther(a);this.set(m),this.isDropEvent=!1}}},{key:"_onFormSubmit",value:function(){var e=this;return this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){return i._unformatOnSubmit()}),!0}},{key:"_onFormReset",value:function(){var e=this;this._getFormAutoNumericChildren(this.parentForm).map(function(i){return e.constructor.getAutoNumericElement(i)}).forEach(function(i){var a=e._getDefaultValue(i.node());setTimeout(function(){return i.set(a)},0)})}},{key:"_unformatOnSubmit",value:function(){this.settings.unformatOnSubmit&&this._setElementValue(this.rawValue)}},{key:"_onKeydownGlobal",value:function(e){if(n.character(e)===P.keyName.Alt){var i=n.getHoveredElement();if(s.isManagedByAutoNumeric(i)){var a=s.getAutoNumericElement(i);!a.formulaMode&&a.settings.unformatOnHover&&this.constructor._unformatAltHovered(a)}}}},{key:"_onKeyupGlobal",value:function(e){if(n.character(e)===P.keyName.Alt){var i=n.getHoveredElement();if(s.isManagedByAutoNumeric(i)){var a=s.getAutoNumericElement(i);if(a.formulaMode||!a.settings.unformatOnHover)return;this.constructor._reformatAltHovered(a)}}}},{key:"_isElementTagSupported",value:function(){return n.isElement(this.domElement)||n.throwError("The DOM element is not valid, ".concat(this.domElement," given.")),n.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||n.isUndefinedOrNullOrEmpty(this.domElement.type)}},{key:"_checkElement",value:function(){var e=this.domElement.tagName.toLowerCase();this._isElementTagSupported()||n.throwError("The <".concat(e,"> tag is not supported by autoNumeric")),this._isInputElement()?(this._isInputTypeSupported()||n.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 i,a=0<arguments.length&&void 0!==e?e:null,m=!0;if(n.isNull(a)?(i=n.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",i)):i=a,this.isInputElement||this.isContentEditable){var v=this.constructor._toNumericValue(i,this.settings);if(this.domElement.hasAttribute("value")&&""!==this.domElement.getAttribute("value")){if(null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride.toString()!==i||null===this.settings.defaultValueOverride&&""!==i&&i!==this.domElement.getAttribute("value")||""!==i&&"hidden"===this.domElement.getAttribute("type")&&!n.isNumber(v)){if(this.settings.saveValueToSessionStorage&&(null!==this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var c=this.constructor._removeBrackets(i,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&&n.isNegative(i,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(c,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(c,this.settings,!0,this.isFocused))}m=!1}}else isNaN(Number(v))||1/0===v?n.throwError("The value [".concat(i,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(v),m=!1);if(""===i)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&&i===this.domElement.getAttribute("value")&&this.set(i)}else null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride!==i||this.set(i)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=q(this.settings.maximumValue.toString().split("."),1)[0],i=q(this.settings.minimumValue||0===this.settings.minimumValue?this.settings.minimumValue.toString().split("."):[],1)[0];e=e.replace(this.settings.negativeSignCharacter,""),i=i.replace(this.settings.negativeSignCharacter,""),this.settings.mIntPos=Math.max(e.length,1),this.settings.mIntNeg=Math.max(i.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 i=this.settings[e];"true"!==i&&"false"!==i||(this.settings[e]="true"===i),"number"==typeof i&&(this.settings[e]=i.toString())}}},{key:"_setSettings",value:function(e,i){var a=1<arguments.length&&void 0!==i&&i;!a&&n.isNull(e)||this.constructor._convertOldOptionsToNewOnes(e),a?("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=P.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),a||(this.settings.originalDecimalPlaces=n.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(),n.isEmptyObj(this.settings)&&n.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=n.getElementSelection(this.domElement),this.processed=!1}},{key:"_updateEventKeyInfo",value:function(e){this.eventKey=n.character(e)}},{key:"_saveCancellableValue",value:function(){this.savedCancellableValue=this.rawValue}},{key:"_setSelection",value:function(e,i){e=Math.max(e,0),i=Math.min(i,n.getElementValue(this.domElement).length),this.selection={start:e,end:i,length:i-e},n.setElementSelection(this.domElement,e,i)}},{key:"_setCaretPosition",value:function(e){this._setSelection(e,e)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=n.getElementValue(this.domElement);return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=q(this._getLeftAndRightPartAroundTheSelection(),2),i=e[0],a=e[1];if(""===i&&""===a)return["",""];var m=!0;return this.eventKey!==P.keyName.Hyphen&&this.eventKey!==P.keyName.Minus||0!==Number(i)||(m=!1),this.isTrailingNegative&&(n.isNegative(a,this.settings.negativeSignCharacter)&&!n.isNegative(i,this.settings.negativeSignCharacter)||""===a&&n.isNegative(i,this.settings.negativeSignCharacter,!0))&&(i=i.replace(this.settings.negativeSignCharacter,""),a=a.replace(this.settings.negativeSignCharacter,""),i=i.replace("-",""),a=a.replace("-",""),i="-".concat(i)),[i=s._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,m,this.isFocused),a=s._stripAllNonNumberCharactersExceptCustomDecimalChar(a,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(e,i){var a=!0;this.eventKey!==P.keyName.Hyphen&&this.eventKey!==P.keyName.Minus||0!==Number(e)||(a=!1),this.isTrailingNegative&&n.isNegative(i,this.settings.negativeSignCharacter)&&!n.isNegative(e,this.settings.negativeSignCharacter)&&(e="-".concat(e),i=i.replace(this.settings.negativeSignCharacter,"")),e=s._stripAllNonNumberCharactersExceptCustomDecimalChar(e,this.settings,a,this.isFocused),i=s._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,!1,this.isFocused),this.settings.leadingZero!==s.options.leadingZero.deny||this.eventKey!==P.keyName.num0&&this.eventKey!==P.keyName.numpad0||0!==Number(e)||n.contains(e,this.settings.decimalCharacter)||""===i||(e=e.substring(0,e.length-1));var m=e+i;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"))+i)}return[e,i,m]}},{key:"_setValueParts",value:function(e,i,a){var m=2<arguments.length&&void 0!==a&&a,v=q(this._normalizeParts(e,i),3),c=v[0],E=v[1],M=v[2],Z=q(s._checkIfInRangeWithOverrideOption(M,this.settings),2),y=Z[0],L=Z[1];if(y&&L){var D=s._truncateDecimalPlaces(M,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(M,this.settings,m,this.settings.decimalPlacesShownOnFocus),W=c.length;return W>z.length&&(W=z.length),1===W&&"0"===c&&this.settings.leadingZero===s.options.leadingZero.deny&&(W=""===E||"0"===c&&""!==E?1:0),this._setElementValue(z,!1),this._setCaretPosition(W),!0}return this._triggerRangeEvents(y,L),!1}},{key:"_getSignPosition",value:function(){var e;if(this.settings.currencySymbol){var i=this.settings.currencySymbol.length,a=n.getElementValue(this.domElement);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)e=this.settings.negativeSignCharacter&&a&&a.charAt(0)===this.settings.negativeSignCharacter?[1,i+1]:[0,i];else{var m=a.length;e=[m-i,m]}}else e=[1e3,-1];return e}},{key:"_expandSelectionOnSign",value:function(){var e=q(this._getSignPosition(),2),i=e[0],a=e[1],m=this.selection;m.start<a&&m.end>i&&((m.start<i||m.end>a)&&n.getElementValue(this.domElement).substring(Math.max(m.start,i),Math.min(m.end,a)).match(/^\s*$/)?m.start<i?this._setSelection(m.start,i):this._setSelection(a,m.end):this._setSelection(Math.min(m.start,i),Math.max(m.end,a)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!n.isUndefined(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,i=q(this._getLeftAndRightPartAroundTheSelection(),2),a=i[0],m=i[1];delete this.valuePartsBeforePaste;var v=a.substr(0,e[0].length)+s._stripAllNonNumberCharactersExceptCustomDecimalChar(a.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&&!n.isUndefined(this.valuePartsBeforePaste)||e.shiftKey&&this.eventKey===P.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===P.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===P.keyName.c||this.eventKey===P.keyName.v||this.eventKey===P.keyName.x))return"keydown"===e.type&&this._expandSelectionOnSign(),this.eventKey!==P.keyName.v&&this.eventKey!==P.keyName.Insert||("keydown"===e.type||"keypress"===e.type?n.isUndefined(this.valuePartsBeforePaste)&&(this.valuePartsBeforePaste=this._getLeftAndRightPartAroundTheSelection()):this._checkPaste()),"keydown"===e.type||"keypress"===e.type||this.eventKey===P.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===P.keyName.Z||this.eventKey===P.keyName.z);if(this.eventKey!==P.keyName.LeftArrow&&this.eventKey!==P.keyName.RightArrow)return n.isInArray(this.eventKey,P.keyName._directionKeys);if("keydown"===e.type&&!e.shiftKey){var i=n.getElementValue(this.domElement);this.eventKey!==P.keyName.LeftArrow||i.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==P.keyName.RightArrow||i.charAt(this.selection.start+1)!==this.settings.digitGroupSeparator&&i.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 i=q(e,2),a=i[0],m=i[1],v=n.getElementValue(this.domElement),c=n.isNegative(v,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix&&(this.eventKey===P.keyName.Backspace?(this.caretFix=this.selection.start>=v.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,"-"===v.charAt(this.selection.start-1)?a=a.substring(1):this.selection.start<=v.length-this.settings.suffixText.length&&(a=a.substring(0,a.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)),n.isNegative(a,this.settings.negativeSignCharacter)&&"-"===v.charAt(this.selection.start)&&(a=a.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===P.keyName.Backspace?this.selection.start===v.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&c?a=a.substring(1):"-"!==a&&(this.selection.start<=v.indexOf(this.settings.negativeSignCharacter)||!c)&&(a=a.substring(0,a.length-1)):("-"===a[0]&&(m=m.substring(1)),this.selection.start===v.indexOf(this.settings.negativeSignCharacter)&&c&&(a=a.substring(1)));break;case s.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=v.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===P.keyName.Backspace?this.selection.start===v.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?a=a.substring(1):("-"!==a&&this.selection.start<=v.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length||""!==a&&!c)&&(a=a.substring(0,a.length-1)):(this.caretFix=this.selection.start>=v.indexOf(this.settings.currencySymbol)&&""!==this.settings.currencySymbol,this.selection.start===v.indexOf(this.settings.negativeSignCharacter)&&(a=a.substring(1)),m=m.substring(1))}return[a,m]}},{key:"_processCharacterDeletion",value:function(){var e,i;if(this.selection.length){this._expandSelectionOnSign();var a=q(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);e=a[0],i=a[1]}else{var m=q(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(i=m[1],""===(e=m[0])&&""===i&&(this.throwInput=!1),this.isTrailingNegative&&n.isNegative(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var v=q(this._processCharacterDeletionIfTrailingNegativeSign([e,i]),2);e=v[0],i=v[1]}else this.eventKey===P.keyName.Backspace?e=e.substring(0,e.length-1):i=i.substring(1,i.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(e).concat(i),this.settings)&&(this._setValueParts(e,i),!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=q(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),i=e[0],a=e[1];if(this.eventKey!==P.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)i=i.replace(this.settings.decimalCharacter,""),a=a.replace(this.settings.decimalCharacter,"");else{if(n.contains(i,this.settings.decimalCharacter)||0<a.indexOf(this.settings.decimalCharacter))return!0;0===a.indexOf(this.settings.decimalCharacter)&&(a=a.substr(1))}return this.settings.negativeSignCharacter&&n.contains(a,this.settings.negativeSignCharacter)&&(i="".concat(this.settings.negativeSignCharacter).concat(i),a=a.replace(this.settings.negativeSignCharacter,"")),this._setValueParts(i+this.settings.decimalCharacter,a),!0}if(("-"===this.eventKey||"+"===this.eventKey)&&this.settings.isNegativeSignAllowed)return""===i&&n.contains(a,"-")?a=a.replace("-",""):i=n.isNegativeStrict(i,"-")?i.replace("-",""):"".concat(this.settings.negativeSignCharacter).concat(i),this._setValueParts(i,a),!0;var m=Number(this.eventKey);return 0<=m&&m<=9?(this.settings.isNegativeSignAllowed&&""===i&&n.contains(a,"-")&&(i="-",a=a.substring(1,a.length)),this.settings.maximumValue<=0&&this.settings.minimumValue<this.settings.maximumValue&&!n.contains(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)&&"0"!==this.eventKey&&(i="-".concat(i)),this._setValueParts("".concat(i).concat(this.eventKey),a),!0):this.throwInput=!1}},{key:"_formatValue",value:function(e){var i=n.getElementValue(this.domElement),a=q(this._getUnformattedLeftAndRightPartAroundTheSelection(),1)[0];if((""===this.settings.digitGroupSeparator||""!==this.settings.digitGroupSeparator&&!n.contains(i,this.settings.digitGroupSeparator))&&(""===this.settings.currencySymbol||""!==this.settings.currencySymbol&&!n.contains(i,this.settings.currencySymbol))){var m=q(i.split(this.settings.decimalCharacter),1)[0],v="";n.isNegative(m,this.settings.negativeSignCharacter)&&(v=this.settings.negativeSignCharacter,m=m.replace(this.settings.negativeSignCharacter,""),a=a.replace("-","")),""===v&&m.length>this.settings.mIntPos&&"0"===a.charAt(0)&&(a=a.slice(1)),v===this.settings.negativeSignCharacter&&m.length>this.settings.mIntNeg&&"0"===a.charAt(0)&&(a=a.slice(1)),this.isTrailingNegative||(a="".concat(v).concat(a))}var c=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue),E=c.length;if(c){var M,Z=a.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===P.keyName.Backspace||this.eventKey===P.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(W,Y){n.isInArray(Y=y[W],L)?D.push("\\"+Y):D.push(Y)}),this.eventKey===P.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]);M=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(Z.join(".*?"))):new RegExp("^.*?".concat(this.settings.currencySymbol).concat(Z.join(".*?")));var z=c.match(M);z?(E=z[0].length,this.settings.showPositiveSign&&(0===E&&z.input.charAt(0)===this.settings.positiveSignCharacter&&(E=1===z.input.indexOf(this.settings.currencySymbol)?this.settings.currencySymbol.length+1:1),0===E&&z.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(E=this.settings.currencySymbol.length+1)),(0===E&&c.charAt(0)!==this.settings.negativeSignCharacter||1===E&&c.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(E=this.settings.currencySymbol.length+(n.isNegativeStrict(c,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(E-=this.settings.currencySymbol.length),this.settings.suffixText&&(E-=this.settings.suffixText.length))}c!==i&&(this._setElementValue(c,!1),this._setCaretPosition(E)),this.formatted=!0}}]),ye(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(n.isObject(d)&&(f=d,d=null),n.isString(s))s=j(document.querySelectorAll(s));else if(n.isObject(s)){Object.prototype.hasOwnProperty.call(s,"rootElement")||n.throwError("The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.");var i=j(s.rootElement.querySelectorAll("input"));s=Object.prototype.hasOwnProperty.call(s,"exclude")?(Array.isArray(s.exclude)||n.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),n.filterOut(i,s.exclude)):i}else n.isArray(s)||n.throwError("The given parameters to the 'multiple' function are invalid.");if(0===s.length){var a=!0;return!n.isNull(f)&&n.isBoolean(f.showWarnings)&&(a=f.showWarnings),n.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",a),[]}var m=n.isArray(d)&&1<=d.length,v=!1,c=!1;if(m){var E=me(Number(d[0]));(v="number"===E&&!isNaN(Number(d[0])))||"string"!==E&&!isNaN(E)&&"object"!==E||(c=!0)}var M,Z=!1;if(n.isArray(f)&&1<=f.length){var y=me(f[0]);"string"!==y&&"object"!==y||(Z=!0)}M=c?T.mergeOptions(d):Z?T.mergeOptions(f):f;var L,D=n.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,M))}),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){n.isIE11()||null===H.valuesToStrings[d]||Object.freeze(H.valuesToStrings[d])}):"styleRules"!==s&&(n.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 $={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},K={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},ee={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};n.cloneObject($).formulaMode=T.options.formulaMode.enabled;var Ve=n.cloneObject($);Ve.minimumValue=0;var ge=n.cloneObject($);ge.maximumValue=0,ge.negativePositiveSignPlacement=T.options.negativePositiveSignPlacement.prefix;var Ne=n.cloneObject($);Ne.digitGroupSeparator=T.options.digitGroupSeparator.normalSpace;var ze=n.cloneObject(Ne);ze.minimumValue=0;var pe=n.cloneObject(Ne);pe.maximumValue=0,pe.negativePositiveSignPlacement=T.options.negativePositiveSignPlacement.prefix;var fe=n.cloneObject($);fe.currencySymbol=T.options.currencySymbol.none,fe.suffixText="\u202f".concat(T.options.suffixText.percentage),fe.wheelStep=1e-4,fe.rawValueDivisor=T.options.rawValueDivisor.percentage;var Ue=n.cloneObject(fe);Ue.minimumValue=0;var Ie=n.cloneObject(fe);Ie.maximumValue=0,Ie.negativePositiveSignPlacement=T.options.negativePositiveSignPlacement.prefix;var _e=n.cloneObject(fe);_e.decimalPlaces=3;var be=n.cloneObject(Ue);be.decimalPlaces=3;var Se=n.cloneObject(Ie);Se.decimalPlaces=3,n.cloneObject(K).formulaMode=T.options.formulaMode.enabled;var xe=n.cloneObject(K);xe.minimumValue=0;var Ae=n.cloneObject(K);Ae.maximumValue=0,Ae.negativePositiveSignPlacement=T.options.negativePositiveSignPlacement.prefix;var Pe=n.cloneObject(Ae);Pe.negativeBracketsTypeOnBlur=T.options.negativeBracketsTypeOnBlur.parentheses;var he=n.cloneObject(K);he.currencySymbol=T.options.currencySymbol.none,he.suffixText=T.options.suffixText.percentage,he.wheelStep=1e-4,he.rawValueDivisor=T.options.rawValueDivisor.percentage;var Ze=n.cloneObject(he);Ze.minimumValue=0;var ve=n.cloneObject(he);ve.maximumValue=0,ve.negativePositiveSignPlacement=T.options.negativePositiveSignPlacement.prefix;var qe=n.cloneObject(he);qe.decimalPlaces=3;var we=n.cloneObject(Ze);we.decimalPlaces=3;var Qe=n.cloneObject(ve);Qe.decimalPlaces=3;var $e=n.cloneObject($);$e.currencySymbol=T.options.currencySymbol.lira,T.predefinedOptions={euro:$,euroPos:Ve,euroNeg:ge,euroSpace:Ne,euroSpacePos:ze,euroSpaceNeg:pe,percentageEU2dec:fe,percentageEU2decPos:Ue,percentageEU2decNeg:Ie,percentageEU3dec:_e,percentageEU3decPos:be,percentageEU3decNeg:Se,dollar:K,dollarPos:xe,dollarNeg:Ae,dollarNegBrackets:Pe,percentageUS2dec:he,percentageUS2decPos:Ze,percentageUS2decNeg:ve,percentageUS3dec:qe,percentageUS3decPos:we,percentageUS3decNeg:Qe,French:$,Spanish:$,NorthAmerican:K,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:ee,Chinese:ee,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:$e,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}],S.c=F,S.d=function(N,t,x){S.o(N,t)||Object.defineProperty(N,t,{enumerable:!0,get:x})},S.r=function(N){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})},S.t=function(N,t){if(1&t&&(N=S(N)),8&t||4&t&&"object"==typeof N&&N&&N.__esModule)return N;var x=Object.create(null);if(S.r(x),Object.defineProperty(x,"default",{enumerable:!0,value:N}),2&t&&"string"!=typeof N)for(var A in N)S.d(x,A,function(P){return N[P]}.bind(null,A));return x},S.n=function(N){var t=N&&N.__esModule?function(){return N.default}:function(){return N};return S.d(t,"a",t),t},S.o=function(N,t){return Object.prototype.hasOwnProperty.call(N,t)},S.p="",S(S.s=0).default;function S(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,S),t.l=!0,t.exports}var O,F}()},7243:(J,S,O)=>{"use strict";var N=U(O(9721)),x=U(O(4070)),P=U(O(6162)),I=U(O(3800)),l=U(O(1731)),h=U(O(70)),p=U(O(3930)),_=O(7497),R=U(O(7850));function U(H){return H&&H.__esModule?H:{default:H}}var j=function(){},q=function(T,X,$){var K=new j;if(typeof T>"u")throw Error("No element to render on was provided.");return K._renderProperties=(0,l.default)(T),K._encodings=[],K._options=R.default,K._errorHandler=new p.default(K),typeof X<"u"&&(($=$||{}).format||($.format=me()),K.options($)[$.format](X,$).render()),K};for(var ie in q.getModule=function(H){return N.default[H]},N.default)N.default.hasOwnProperty(ie)&&re(N.default,ie);function re(H,T){j.prototype[T]=j.prototype[T.toUpperCase()]=j.prototype[T.toLowerCase()]=function(X,$){var K=this;return K._errorHandler.wrapBarcodeCall(function(){$.text=typeof $.text>"u"?void 0:""+$.text;var ee=(0,x.default)(K._options,$);ee=(0,h.default)(ee);var ge=oe(X,H[T],ee);return K._encodings.push(ge),K})}}function oe(H,T,X){var $=new T(H=""+H,X);if(!$.valid())throw new _.InvalidInputException($.constructor.name,H);var K=$.encode();K=(0,P.default)(K);for(var ee=0;ee<K.length;ee++)K[ee].options=(0,x.default)(X,K[ee].options);return K}function me(){return N.default.CODE128?"CODE128":Object.keys(N.default)[0]}function ye(H,T,X){T=(0,P.default)(T);for(var $=0;$<T.length;$++)T[$].options=(0,x.default)(X,T[$].options),(0,I.default)(T[$].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=me()),this._errorHandler.wrapBarcodeCall(function(){var ee=oe(X.value,N.default[X.format.toUpperCase()],X);ye(H,ee,X)})}},j.prototype.render=function(){if(!this._renderProperties)throw new _.NoElementException;if(Array.isArray(this._renderProperties))for(var H=0;H<this._renderProperties.length;H++)ye(this._renderProperties[H],this._encodings,this._options);else ye(this._renderProperties,this._encodings,this._options);return this},j.prototype._defaults=R.default,typeof window<"u"&&(window.JsBarcode=q),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(H,T){var X=[];return jQuery(this).each(function(){X.push(this)}),q(X,H,T)}),J.exports=q},4648:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.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:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,h){for(var n=0;n<h.length;n++){var p=h[n];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(u,p.key,p)}}return function(u,h,n){return h&&l(u.prototype,h),n&&l(u,n),u}}(),t=function A(l){return l&&l.__esModule?l:{default:l}}(O(4648)),x=O(9068),b=function(l){function u(h,n){!function P(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u);var p=function C(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,h.substring(1),n));return p.bytes=h.split("").map(function(_){return _.charCodeAt(0)}),p}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,p=n.shift()-105,_=x.SET_BY_CODE[p];if(void 0===_)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&n.unshift(x.FNC1);var w=u.next(n,1,_);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:u.getBar(p)+w.result+u.getBar((w.checksum+p)%x.MODULO)+u.getBar(x.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return"string"==typeof n&&(n="true"===n.toLowerCase()),n}}],[{key:"getBar",value:function(n){return x.BARS[n]?x.BARS[n].toString():""}},{key:"correctIndex",value:function(n,p){if(p===x.SET_A){var _=n.shift();return _<32?_+64:_-32}return p===x.SET_B?n.shift()-32:10*(n.shift()-48)+n.shift()-48}},{key:"next",value:function(n,p,_){if(!n.length)return{result:"",checksum:0};var w=void 0,R=void 0;if(n[0]>=200){R=n.shift()-105;var U=x.SWAP[R];void 0!==U?w=u.next(n,p+1,U):((_===x.SET_A||_===x.SET_B)&&R===x.SHIFT&&(n[0]=_===x.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),w=u.next(n,p+1,_))}else R=u.correctIndex(n,_),w=u.next(n,p+1,_);return{result:u.getBar(R)+w.result,checksum:R*p+w.checksum}}}]),u}(t.default);S.default=b},8964:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,h){for(var n=0;n<h.length;n++){var p=h[n];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(u,p.key,p)}}return function(u,h,n){return h&&l(u.prototype,h),n&&l(u,n),u}}(),t=function A(l){return l&&l.__esModule?l:{default:l}}(O(6106)),x=O(9068),b=function(l){function u(h,n){return function P(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function C(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,x.A_START_CHAR+h,n))}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return new RegExp("^"+x.A_CHARS+"+$").test(this.data)}}]),u}(t.default);S.default=b},3254:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,h){for(var n=0;n<h.length;n++){var p=h[n];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(u,p.key,p)}}return function(u,h,n){return h&&l(u.prototype,h),n&&l(u,n),u}}(),t=function A(l){return l&&l.__esModule?l:{default:l}}(O(6106)),x=O(9068),b=function(l){function u(h,n){return function P(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function C(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,x.B_START_CHAR+h,n))}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return new RegExp("^"+x.B_CHARS+"+$").test(this.data)}}]),u}(t.default);S.default=b},5701:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,h){for(var n=0;n<h.length;n++){var p=h[n];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(u,p.key,p)}}return function(u,h,n){return h&&l(u.prototype,h),n&&l(u,n),u}}(),t=function A(l){return l&&l.__esModule?l:{default:l}}(O(6106)),x=O(9068),b=function(l){function u(h,n){return function P(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function C(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,x.C_START_CHAR+h,n))}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return new RegExp("^"+x.C_CHARS+"+$").test(this.data)}}]),u}(t.default);S.default=b},5626:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=A(O(6106)),x=A(O(4779));function A(l){return l&&l.__esModule?l:{default:l}}function C(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}var b=function(l){function u(h,n){if(function P(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),/^[\x00-\x7F\xC8-\xD3]+$/.test(h))var p=C(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,(0,x.default)(h),n));else p=C(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,h,n));return C(p)}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),u}(N.default);S.default=b},4779:(J,S,O)=>{"use strict";Object.defineProperty(S,"__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 A(C,I){var b=I?F.A_CHARS:F.B_CHARS,l=C.match(new RegExp("^("+b+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(l)return l[1]+String.fromCharCode(204)+P(C.substring(l[1].length));var u=C.match(new RegExp("^"+b+"+"))[0];return u.length===C.length?C:u+String.fromCharCode(I?205:206)+A(C.substring(u.length),!I)}function P(C){var I=x(C),b=I.length;if(b===C.length)return C;C=C.substring(b);var l=N(C)>=t(C);return I+String.fromCharCode(l?206:205)+A(C,l)}S.default=function(C){var I=void 0;if(x(C).length>=2)I=F.C_START_CHAR+P(C);else{var l=N(C)>t(C);I=(l?F.A_START_CHAR:F.B_START_CHAR)+A(C,l)}return I.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(u,h){return String.fromCharCode(203)+h})}},9068:(J,S)=>{"use strict";var O;function F(ie,re,oe){return re in ie?Object.defineProperty(ie,re,{value:oe,enumerable:!0,configurable:!0,writable:!0}):ie[re]=oe,ie}Object.defineProperty(S,"__esModule",{value:!0});var N=S.SET_A=0,t=S.SET_B=1,x=S.SET_C=2,P=(S.SHIFT=98,S.START_A=103),C=S.START_B=104,I=S.START_C=105;S.MODULO=103,S.STOP=106,S.FNC1=207,S.SET_BY_CODE=(F(O={},P,N),F(O,C,t),F(O,I,x),O),S.SWAP={101:N,100:t,99:x},S.A_START_CHAR=String.fromCharCode(208),S.B_START_CHAR=String.fromCharCode(209),S.C_START_CHAR=String.fromCharCode(210),S.A_CHARS="[\0-_\xc8-\xcf]",S.B_CHARS="[ -\x7f\xc8-\xcf]",S.C_CHARS="(\xcf*[0-9]{2}\xcf*)",S.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:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CODE128C=S.CODE128B=S.CODE128A=S.CODE128=void 0;var N=b(O(5626)),x=b(O(8964)),P=b(O(3254)),I=b(O(5701));function b(l){return l&&l.__esModule?l:{default:l}}S.CODE128=N.default,S.CODE128A=x.default,S.CODE128B=P.default,S.CODE128C=I.default},528:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CODE39=void 0;var F=function(){function w(R,U){for(var j=0;j<U.length;j++){var q=U[j];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(R,q.key,q)}}return function(R,U,j){return U&&w(R.prototype,U),j&&w(R,j),R}}(),I=function(w){function R(U,j){return function A(w,R){if(!(w instanceof R))throw new TypeError("Cannot call a class as a function")}(this,R),U=U.toUpperCase(),j.mod43&&(U+=function n(w){return b[w]}(function _(w){for(var R=0,U=0;U<w.length;U++)R+=p(w[U]);return R%=43}(U))),function P(w,R){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!R||"object"!=typeof R&&"function"!=typeof R?w:R}(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,U,j))}return function C(w,R){if("function"!=typeof R&&null!==R)throw new TypeError("Super expression must either be null or a function, not "+typeof R);w.prototype=Object.create(R&&R.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(w,R):w.__proto__=R)}(R,w),F(R,[{key:"encode",value:function(){for(var j=u("*"),q=0;q<this.data.length;q++)j+=u(this.data[q])+"0";return{data:j+=u("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),R}(function x(w){return w&&w.__esModule?w:{default:w}}(O(4648)).default),b=["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 u(w){return function h(w){return l[w].toString(2)}(p(w))}function p(w){return b.indexOf(w)}S.CODE39=I},7417:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function h(n,p){for(var _=0;_<p.length;_++){var w=p[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(n,w.key,w)}}return function(n,p,_){return p&&h(n.prototype,p),_&&h(n,_),n}}(),N=O(3819),x=C(O(9259));function C(h){return h&&h.__esModule?h:{default:h}}var u=function(h){function n(p,_){!function I(h,n){if(!(h instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n);var w=function b(h,n){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?h:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,p,_));return w.fontSize=!_.flat&&_.fontSize>10*_.width?10*_.width:_.fontSize,w.guardHeight=_.height+w.fontSize/2+_.textMargin,w}return function l(h,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);h.prototype=Object.create(n&&n.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(h,n):h.__proto__=n)}(n,h),F(n,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(_,w){return this.text.substr(_,w)}},{key:"leftEncode",value:function(_,w){return(0,x.default)(_,w)}},{key:"rightText",value:function(_,w){return this.text.substr(_,w)}},{key:"rightEncode",value:function(_,w){return(0,x.default)(_,w)}},{key:"encodeGuarded",value:function(){var _={fontSize:this.fontSize},w={height:this.guardHeight};return[{data:N.SIDE_BIN,options:w},{data:this.leftEncode(),text:this.leftText(),options:_},{data:N.MIDDLE_BIN,options:w},{data:this.rightEncode(),text:this.rightText(),options:_},{data:N.SIDE_BIN,options:w}]}},{key:"encodeFlat",value:function(){return{data:[N.SIDE_BIN,this.leftEncode(),N.MIDDLE_BIN,this.rightEncode(),N.SIDE_BIN].join(""),text:this.text}}}]),n}(C(O(4648)).default);S.default=u},6195:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function h(n,p){for(var _=0;_<p.length;_++){var w=p[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(n,w.key,w)}}return function(n,p,_){return p&&h(n.prototype,p),_&&h(n,_),n}}(),N=function h(n,p,_){null===n&&(n=Function.prototype);var w=Object.getOwnPropertyDescriptor(n,p);if(void 0===w){var R=Object.getPrototypeOf(n);return null===R?void 0:h(R,p,_)}if("value"in w)return w.value;var U=w.get;return void 0===U?void 0:U.call(_)},t=O(3819),A=function P(h){return h&&h.__esModule?h:{default:h}}(O(7417)),l=function(n){return(10-n.substr(0,12).split("").map(function(_){return+_}).reduce(function(_,w,R){return R%2?_+3*w:_+w},0)%10)%10},u=function(h){function n(p,_){(function C(h,n){if(!(h instanceof n))throw new TypeError("Cannot call a class as a function")})(this,n),-1!==p.search(/^[0-9]{12}$/)&&(p+=l(p));var w=function I(h,n){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?h:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,p,_));return w.lastChar=_.lastChar,w}return function b(h,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);h.prototype=Object.create(n&&n.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(h,n):h.__proto__=n)}(n,h),F(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===l(this.data)}},{key:"leftText",value:function(){return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var _=this.data.substr(1,6),w=t.EAN13_STRUCTURE[this.data[0]];return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftEncode",this).call(this,_,w)}},{key:"rightText",value:function(){return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var _=this.data.substr(7,6);return N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightEncode",this).call(this,_,"RRRRRR")}},{key:"encodeGuarded",value:function(){var _=N(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(_.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(_.push({data:"00"}),_.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),_}}]),n}(A.default);S.default=u},4500:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function h(n,p){for(var _=0;_<p.length;_++){var w=p[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(n,w.key,w)}}return function(n,p,_){return p&&h(n.prototype,p),_&&h(n,_),n}}(),N=O(3819),x=C(O(9259));function C(h){return h&&h.__esModule?h:{default:h}}var u=function(h){function n(p,_){return function I(h,n){if(!(h instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),function b(h,n){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?h:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,p,_))}return function l(h,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);h.prototype=Object.create(n&&n.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(h,n):h.__proto__=n)}(n,h),F(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var _=N.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,x.default)(this.data,_,"01"),text:this.text}}}]),n}(C(O(4648)).default);S.default=u},5174:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function n(p,_){for(var w=0;w<_.length;w++){var R=_[w];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(p,R.key,R)}}return function(p,_,w){return _&&n(p.prototype,_),w&&n(p,w),p}}(),N=O(3819),x=C(O(9259));function C(n){return n&&n.__esModule?n:{default:n}}var h=function(n){function p(_,w){return function I(n,p){if(!(n instanceof p))throw new TypeError("Cannot call a class as a function")}(this,p),function b(n,p){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!p||"object"!=typeof p&&"function"!=typeof p?n:p}(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,_,w))}return function l(n,p){if("function"!=typeof p&&null!==p)throw new TypeError("Super expression must either be null or a function, not "+typeof p);n.prototype=Object.create(p&&p.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(n,p):n.__proto__=p)}(p,n),F(p,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var w=N.EAN5_STRUCTURE[function(p){return p.split("").map(function(w){return+w}).reduce(function(w,R,U){return U%2?w+9*R:w+3*R},0)%10}(this.data)];return{data:"1011"+(0,x.default)(this.data,w,"01"),text:this.text}}}]),p}(C(O(4648)).default);S.default=h},2523:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function u(h,n){for(var p=0;p<n.length;p++){var _=n[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(h,_.key,_)}}return function(h,n,p){return n&&u(h.prototype,n),p&&u(h,p),h}}(),N=function u(h,n,p){null===h&&(h=Function.prototype);var _=Object.getOwnPropertyDescriptor(h,n);if(void 0===_){var w=Object.getPrototypeOf(h);return null===w?void 0:u(w,n,p)}if("value"in _)return _.value;var R=_.get;return void 0===R?void 0:R.call(p)},x=function A(u){return u&&u.__esModule?u:{default:u}}(O(7417)),b=function(h){return(10-h.substr(0,7).split("").map(function(p){return+p}).reduce(function(p,_,w){return w%2?p+_:p+3*_},0)%10)%10},l=function(u){function h(n,p){return function P(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}(this,h),-1!==n.search(/^[0-9]{7}$/)&&(n+=b(n)),function C(u,h){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||"object"!=typeof h&&"function"!=typeof h?u:h}(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,n,p))}return function I(u,h){if("function"!=typeof h&&null!==h)throw new TypeError("Super expression must either be null or a function, not "+typeof h);u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(u,h):u.__proto__=h)}(h,u),F(h,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===b(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);S.default=l},4102:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function h(n,p){for(var _=0;_<p.length;_++){var w=p[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(n,w.key,w)}}return function(n,p,_){return p&&h(n.prototype,p),_&&h(n,_),n}}();S.checksum=u;var t=P(O(9259));function P(h){return h&&h.__esModule?h:{default:h}}var l=function(h){function n(p,_){(function C(h,n){if(!(h instanceof n))throw new TypeError("Cannot call a class as a function")})(this,n),-1!==p.search(/^[0-9]{11}$/)&&(p+=u(p));var w=function I(h,n){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?h:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,p,_));return w.displayValue=_.displayValue,w.fontSize=_.fontSize>10*_.width?10*_.width:_.fontSize,w.guardHeight=_.height+w.fontSize/2+_.textMargin,w}return function b(h,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);h.prototype=Object.create(n&&n.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(h,n):h.__proto__=n)}(n,h),F(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==u(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var _="";return _+="101",_+=(0,t.default)(this.data.substr(0,6),"LLLLLL"),_+="01010",_+=(0,t.default)(this.data.substr(6,6),"RRRRRR"),{data:_+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var _=[];return this.displayValue&&_.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),_.push({data:"101"+(0,t.default)(this.data[0],"L"),options:{height:this.guardHeight}}),_.push({data:(0,t.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),_.push({data:"01010",options:{height:this.guardHeight}}),_.push({data:(0,t.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),_.push({data:(0,t.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&_.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),_}}]),n}(P(O(4648)).default);function u(h){var p,n=0;for(p=1;p<11;p+=2)n+=parseInt(h[p]);for(p=0;p<11;p+=2)n+=3*parseInt(h[p]);return(10-n%10)%10}S.default=l},1285:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function _(w,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(w,j.key,j)}}return function(w,R,U){return R&&_(w.prototype,R),U&&_(w,U),w}}(),t=C(O(9259)),A=C(O(4648)),P=O(4102);function C(_){return _&&_.__esModule?_:{default:_}}function b(_,w){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!w||"object"!=typeof w&&"function"!=typeof w?_:w}var u=["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"]],n=function(_){function w(R,U){!function I(_,w){if(!(_ instanceof w))throw new TypeError("Cannot call a class as a function")}(this,w);var j=b(this,(w.__proto__||Object.getPrototypeOf(w)).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 b(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 b(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(_,w){if("function"!=typeof w&&null!==w)throw new TypeError("Super expression must either be null or a function, not "+typeof w);_.prototype=Object.create(w&&w.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(_,w):_.__proto__=w)}(w,_),F(w,[{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],q=h[parseInt(this.upcA[this.upcA.length-1])][parseInt(U)];return(0,t.default)(this.middleDigits,q)}}]),w}(A.default);function p(_,w){for(var R=parseInt(_[_.length-1]),U=u[R],j="",q=0,ie=0;ie<U.length;ie++){var re=U[ie];j+="X"===re?_[q++]:re}return(j=""+w+j)+(0,P.checksum)(j)}S.default=n},3819:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SIDE_BIN="101",S.MIDDLE_BIN="01010",S.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"]},S.EAN2_STRUCTURE=["LL","LG","GL","GG"],S.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],S.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},9259:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=O(3819);S.default=function(x,A,P){var C=x.split("").map(function(b,l){return F.BINARIES[A[l]]}).map(function(b,l){return b?b[x[l]]:""});if(P){var I=x.length-1;C=C.map(function(b,l){return l<I?b+P:b})}return C.join("")}},7422:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UPCE=S.UPC=S.EAN2=S.EAN5=S.EAN8=S.EAN13=void 0;var N=n(O(6195)),x=n(O(2523)),P=n(O(5174)),I=n(O(4500)),l=n(O(4102)),h=n(O(1285));function n(p){return p&&p.__esModule?p:{default:p}}S.EAN13=N.default,S.EAN8=x.default,S.EAN5=P.default,S.EAN2=I.default,S.UPC=l.default,S.UPCE=h.default},791:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.GenericBarcode=void 0;var F=function(){function b(l,u){for(var h=0;h<u.length;h++){var n=u[h];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(l,n.key,n)}}return function(l,u,h){return u&&b(l.prototype,u),h&&b(l,h),l}}(),I=function(b){function l(u,h){return function A(b,l){if(!(b instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function P(b,l){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?b:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,h))}return function C(b,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);b.prototype=Object.create(l&&l.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(b,l):b.__proto__=l)}(l,b),F(l,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),l}(function x(b){return b&&b.__esModule?b:{default:b}}(O(4648)).default);S.GenericBarcode=I},3435:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,h){for(var n=0;n<h.length;n++){var p=h[n];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(u,p.key,p)}}return function(u,h,n){return h&&l(u.prototype,h),n&&l(u,n),u}}(),N=O(5306);function P(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function C(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}var b=function(l){function u(){return P(this,u),C(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}return function I(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var n=this,p=this.data.match(/.{2}/g).map(function(_){return n.encodePair(_)}).join("");return{data:N.START_BIN+p+N.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var p=N.BINARIES[n[1]];return N.BINARIES[n[0]].split("").map(function(_,w){return("1"===_?"111":"1")+("1"===p[w]?"000":"0")}).join("")}}]),u}(function A(l){return l&&l.__esModule?l:{default:l}}(O(4648)).default);S.default=b},580:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,h){for(var n=0;n<h.length;n++){var p=h[n];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(u,p.key,p)}}return function(u,h,n){return h&&l(u.prototype,h),n&&l(u,n),u}}(),t=function x(l){return l&&l.__esModule?l:{default:l}}(O(3435)),I=function(u){var h=u.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,p,_){return n+p*(3-_%2*2)},0);return 10*Math.ceil(h/10)-h},b=function(l){function u(h,n){return function A(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),-1!==h.search(/^[0-9]{13}$/)&&(h+=I(h)),function P(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,h,n))}return function C(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===I(this.data)}}]),u}(t.default);S.default=b},5306:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.START_BIN="1010",S.END_BIN="11101",S.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},7191:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.ITF14=S.ITF=void 0;var N=A(O(3435)),x=A(O(580));function A(P){return P&&P.__esModule?P:{default:P}}S.ITF=N.default,S.ITF14=x.default},6431:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function l(u,h){for(var n=0;n<h.length;n++){var p=h[n];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(u,p.key,p)}}return function(u,h,n){return h&&l(u.prototype,h),n&&l(u,n),u}}(),I=function(l){function u(h,n){return function A(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}(this,u),function P(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!u||"object"!=typeof u&&"function"!=typeof u?l:u}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,h,n))}return function C(l,u){if("function"!=typeof u&&null!==u)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}(u,l),F(u,[{key:"encode",value:function(){for(var n="110",p=0;p<this.data.length;p++){var w=parseInt(this.data[p]).toString(2);w=b(w,4-w.length);for(var R=0;R<w.length;R++)n+="0"==w[R]?"100":"110"}return{data:n+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),u}(function x(l){return l&&l.__esModule?l:{default:l}}(O(4648)).default);function b(l,u){for(var h=0;h<u;h++)l="0"+l;return l}S.default=I},7218:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=function x(b){return b&&b.__esModule?b:{default:b}}(O(6431)),t=O(6855),I=function(b){function l(u,h){return function A(b,l){if(!(b instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function P(b,l){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?b:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u+(0,t.mod10)(u),h))}return function C(b,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);b.prototype=Object.create(l&&l.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(b,l):b.__proto__=l)}(l,b),l}(N.default);S.default=I},9762:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=function x(b){return b&&b.__esModule?b:{default:b}}(O(6431)),t=O(6855),I=function(b){function l(u,h){return function A(b,l){if(!(b instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),u+=(0,t.mod10)(u),u+=(0,t.mod10)(u),function P(b,l){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?b:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,h))}return function C(b,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);b.prototype=Object.create(l&&l.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(b,l):b.__proto__=l)}(l,b),l}(N.default);S.default=I},3117:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=function x(b){return b&&b.__esModule?b:{default:b}}(O(6431)),t=O(6855),I=function(b){function l(u,h){return function A(b,l){if(!(b instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function P(b,l){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?b:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u+(0,t.mod11)(u),h))}return function C(b,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);b.prototype=Object.create(l&&l.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(b,l):b.__proto__=l)}(l,b),l}(N.default);S.default=I},1878:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=function x(b){return b&&b.__esModule?b:{default:b}}(O(6431)),t=O(6855),I=function(b){function l(u,h){return function A(b,l){if(!(b instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),u+=(0,t.mod11)(u),u+=(0,t.mod10)(u),function P(b,l){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?b:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,h))}return function C(b,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);b.prototype=Object.create(l&&l.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(b,l):b.__proto__=l)}(l,b),l}(N.default);S.default=I},6855:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.mod10=function O(N){for(var t=0,x=0;x<N.length;x++){var A=parseInt(N[x]);t+=(x+N.length)%2==0?A:2*A%10+Math.floor(2*A/10)}return(10-t%10)%10},S.mod11=function F(N){for(var t=0,x=[2,3,4,5,6,7],A=0;A<N.length;A++){var P=parseInt(N[N.length-1-A]);t+=x[A%x.length]*P}return(11-t%11)%11}},1247:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.MSI1110=S.MSI1010=S.MSI11=S.MSI10=S.MSI=void 0;var N=u(O(6431)),x=u(O(7218)),P=u(O(3117)),I=u(O(9762)),l=u(O(1878));function u(h){return h&&h.__esModule?h:{default:h}}S.MSI=N.default,S.MSI10=x.default,S.MSI11=P.default,S.MSI1010=I.default,S.MSI1110=l.default},2250:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.codabar=void 0;var F=function(){function b(l,u){for(var h=0;h<u.length;h++){var n=u[h];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(l,n.key,n)}}return function(l,u,h){return u&&b(l.prototype,u),h&&b(l,h),l}}(),I=function(b){function l(u,h){(function A(b,l){if(!(b instanceof l))throw new TypeError("Cannot call a class as a function")})(this,l),0===u.search(/^[0-9\-\$\:\.\+\/]+$/)&&(u="A"+u+"A");var n=function P(b,l){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?b:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u.toUpperCase(),h));return n.text=n.options.text||n.text.replace(/[A-D]/g,""),n}return function C(b,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);b.prototype=Object.create(l&&l.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(b,l):b.__proto__=l)}(l,b),F(l,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var h=[],n=this.getEncodings(),p=0;p<this.data.length;p++)h.push(n[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(b){return b&&b.__esModule?b:{default:b}}(O(4648)).default);S.codabar=I},9721:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=O(528),N=O(6038),t=O(7422),x=O(7191),A=O(1247),P=O(7624),C=O(2250),I=O(791);S.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:A.MSI,MSI10:A.MSI10,MSI11:A.MSI11,MSI1010:A.MSI1010,MSI1110:A.MSI1110,pharmacode:P.pharmacode,codabar:C.codabar,GenericBarcode:I.GenericBarcode}},7624:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.pharmacode=void 0;var F=function(){function b(l,u){for(var h=0;h<u.length;h++){var n=u[h];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(l,n.key,n)}}return function(l,u,h){return u&&b(l.prototype,u),h&&b(l,h),l}}(),I=function(b){function l(u,h){!function A(b,l){if(!(b instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l);var n=function P(b,l){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?b:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,u,h));return n.number=parseInt(u,10),n}return function C(b,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);b.prototype=Object.create(l&&l.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(b,l):b.__proto__=l)}(l,b),F(l,[{key:"encode",value:function(){for(var h=this.number,n="";!isNaN(h)&&0!=h;)h%2==0?(n="11100"+n,h=(h-2)/2):(n="100"+n,h=(h-1)/2);return{data:n=n.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),l}(function x(b){return b&&b.__esModule?b:{default:b}}(O(4648)).default);S.pharmacode=I},3930:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var O=function(){function t(x,A){for(var P=0;P<A.length;P++){var C=A[P];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(x,C.key,C)}}return function(x,A,P){return A&&t(x.prototype,A),P&&t(x,P),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(A){if("InvalidInputException"!==A.name)throw A;if(this.api._options.valid===this.api._defaults.valid)throw A.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(A){try{var P=A.apply(void 0,arguments);return this.api._options.valid(!0),P}catch(C){return this.handleCatch(C),this.api}}}]),t}();S.default=N},7497:(J,S)=>{"use strict";function O(P,C){if(!(P instanceof C))throw new TypeError("Cannot call a class as a function")}function F(P,C){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!C||"object"!=typeof C&&"function"!=typeof C?P:C}function N(P,C){if("function"!=typeof C&&null!==C)throw new TypeError("Super expression must either be null or a function, not "+typeof C);P.prototype=Object.create(C&&C.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(P,C):P.__proto__=C)}Object.defineProperty(S,"__esModule",{value:!0});var t=function(P){function C(I,b){O(this,C);var l=F(this,(C.__proto__||Object.getPrototypeOf(C)).call(this));return l.name="InvalidInputException",l.symbology=I,l.input=b,l.message='"'+l.input+'" is not a valid input for '+l.symbology,l}return N(C,Error),C}(),x=function(P){function C(){O(this,C);var I=F(this,(C.__proto__||Object.getPrototypeOf(C)).call(this));return I.name="InvalidElementException",I.message="Not supported type to render on",I}return N(C,Error),C}(),A=function(P){function C(){O(this,C);var I=F(this,(C.__proto__||Object.getPrototypeOf(C)).call(this));return I.name="NoElementException",I.message="No element to render on.",I}return N(C,Error),C}();S.InvalidInputException=t,S.InvalidElementException=x,S.NoElementException=A},3800:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.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:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=A(O(70)),x=A(O(7850));function A(C){return C&&C.__esModule?C:{default:C}}S.default=function P(C){var I={};for(var b in x.default)x.default.hasOwnProperty(b)&&(C.hasAttribute("jsbarcode-"+b.toLowerCase())&&(I[b]=C.getAttribute("jsbarcode-"+b.toLowerCase())),C.hasAttribute("data-"+b.toLowerCase())&&(I[b]=C.getAttribute("data-"+b.toLowerCase())));return I.value=C.getAttribute("jsbarcode-value")||C.getAttribute("data-value"),(0,N.default)(I)}},1731:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},t=C(O(6428)),A=C(O(2216)),P=O(7497);function C(u){return u&&u.__esModule?u:{default:u}}S.default=function I(u){if("string"==typeof u)return function b(u){var h=document.querySelectorAll(u);if(0!==h.length){for(var n=[],p=0;p<h.length;p++)n.push(I(h[p]));return n}}(u);if(Array.isArray(u)){for(var h=[],n=0;n<u.length;n++)h.push(I(u[n]));return h}if(typeof HTMLCanvasElement<"u"&&u instanceof HTMLImageElement)return function l(u){var h=document.createElement("canvas");return{element:h,options:(0,t.default)(u),renderer:A.default.CanvasRenderer,afterRender:function(){u.setAttribute("src",h.toDataURL())}}}(u);if(u&&u.nodeName&&"svg"===u.nodeName.toLowerCase()||typeof SVGElement<"u"&&u instanceof SVGElement)return{element:u,options:(0,t.default)(u),renderer:A.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&u instanceof HTMLCanvasElement)return{element:u,options:(0,t.default)(u),renderer:A.default.CanvasRenderer};if(u&&u.getContext)return{element:u,renderer:A.default.CanvasRenderer};if(u&&"object"===(typeof u>"u"?"undefined":F(u))&&!u.nodeName)return{element:u,renderer:A.default.ObjectRenderer};throw new P.InvalidElementException}},6162:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function O(F){var N=[];return function t(x){if(Array.isArray(x))for(var A=0;A<x.length;A++)t(x[A]);else x.text=x.text||"",x.data=x.data||"",N.push(x)}(F),N}},4070:(J,S)=>{"use strict";Object.defineProperty(S,"__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};S.default=function(F,N){return O({},F,N)}},70:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.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:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.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:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function I(b,l){for(var u=0;u<l.length;u++){var h=l[u];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(b,h.key,h)}}return function(b,l,u){return l&&I(b.prototype,l),u&&I(b,u),b}}(),t=function A(I){return I&&I.__esModule?I:{default:I}}(O(4070)),x=O(3737),C=function(){function I(b,l,u){(function P(I,b){if(!(I instanceof b))throw new TypeError("Cannot call a class as a function")})(this,I),this.canvas=b,this.encodings=l,this.options=u}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 u=(0,t.default)(this.options,this.encodings[l].options);this.drawCanvasBarcode(u,this.encodings[l]),this.drawCanvasText(u,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 u=(0,x.getTotalWidthOfEncodings)(this.encodings),h=(0,x.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=u+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,u){var p,h=this.canvas.getContext("2d"),n=u.data;p="top"==l.textPosition?l.marginTop+l.fontSize+l.textMargin:l.marginTop,h.fillStyle=l.lineColor;for(var _=0;_<n.length;_++){var w=_*l.width+u.barcodePadding;"1"===n[_]?h.fillRect(w,p,l.width,l.height):n[_]&&h.fillRect(w,p,l.width,l.height*n[_])}}},{key:"drawCanvasText",value:function(l,u){var p,_,h=this.canvas.getContext("2d");l.displayValue&&(_="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||u.barcodePadding>0?(p=0,h.textAlign="left"):"right"==l.textAlign?(p=u.width-1,h.textAlign="right"):(p=u.width/2,h.textAlign="center"),h.fillText(u.text,p,_))}},{key:"moveCanvasDrawing",value:function(l){this.canvas.getContext("2d").translate(l.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),I}();S.default=C},2216:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var N=C(O(726)),x=C(O(7902)),P=C(O(8138));function C(I){return I&&I.__esModule?I:{default:I}}S.default={CanvasRenderer:N.default,SVGRenderer:x.default,ObjectRenderer:P.default}},8138:(J,S)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var O=function(){function t(x,A){for(var P=0;P<A.length;P++){var C=A[P];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(x,C.key,C)}}return function(x,A,P){return A&&t(x.prototype,A),P&&t(x,P),x}}(),N=function(){function t(x,A,P){(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=A,this.options=P}return O(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();S.default=N},3737:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.getTotalWidthOfEncodings=S.calculateEncodingAttributes=S.getBarcodePadding=S.getEncodingHeight=S.getMaximumHeightOfEncodings=void 0;var N=function t(l){return l&&l.__esModule?l:{default:l}}(O(4070));function x(l,u){return u.height+(u.displayValue&&l.text.length>0?u.fontSize+u.textMargin:0)+u.marginTop+u.marginBottom}function A(l,u,h){if(h.displayValue&&u<l){if("center"==h.textAlign)return Math.floor((l-u)/2);if("left"==h.textAlign)return 0;if("right"==h.textAlign)return Math.floor(l-u)}return 0}function b(l,u,h){var n;if(h)n=h;else{if(!(typeof document<"u"))return 0;n=document.createElement("canvas").getContext("2d")}n.font=u.fontOptions+" "+u.fontSize+"px "+u.font;var p=n.measureText(l);return p?p.width:0}S.getMaximumHeightOfEncodings=function I(l){for(var u=0,h=0;h<l.length;h++)l[h].height>u&&(u=l[h].height);return u},S.getEncodingHeight=x,S.getBarcodePadding=A,S.calculateEncodingAttributes=function P(l,u,h){for(var n=0;n<l.length;n++){var w,p=l[n],_=(0,N.default)(u,p.options);w=_.displayValue?b(p.text,_,h):0;var R=p.data.length*_.width;p.width=Math.ceil(Math.max(w,R)),p.height=x(p,_),p.barcodePadding=A(w,R,_)}},S.getTotalWidthOfEncodings=function C(l){for(var u=0,h=0;h<l.length;h++)u+=l[h].width;return u}},7902:(J,S,O)=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});var F=function(){function b(l,u){for(var h=0;h<u.length;h++){var n=u[h];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(l,n.key,n)}}return function(l,u,h){return u&&b(l.prototype,u),h&&b(l,h),l}}(),t=function A(b){return b&&b.__esModule?b:{default:b}}(O(4070)),x=O(3737),C="http://www.w3.org/2000/svg",I=function(){function b(l,u,h){(function P(b,l){if(!(b instanceof l))throw new TypeError("Cannot call a class as a function")})(this,b),this.svg=l,this.encodings=u,this.options=h,this.document=h.xmlDocument||document}return F(b,[{key:"render",value:function(){var u=this.options.marginLeft;this.prepareSVG();for(var h=0;h<this.encodings.length;h++){var n=this.encodings[h],p=(0,t.default)(this.options,n.options),_=this.createGroup(u,p.marginTop,this.svg);this.setGroupOptions(_,p),this.drawSvgBarcode(_,p,n),this.drawSVGText(_,p,n),u+=n.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,x.calculateEncodingAttributes)(this.encodings,this.options);var u=(0,x.getTotalWidthOfEncodings)(this.encodings),h=(0,x.getMaximumHeightOfEncodings)(this.encodings),n=u+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,h),this.options.background&&this.drawRect(0,0,n,h,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(u,h,n){var _,p=n.data;_="top"==h.textPosition?h.fontSize+h.textMargin:0;for(var w=0,R=0,U=0;U<p.length;U++)R=U*h.width+n.barcodePadding,"1"===p[U]?w++:w>0&&(this.drawRect(R-h.width*w,_,h.width*w,h.height,u),w=0);w>0&&this.drawRect(R-h.width*(w-1),_,h.width*w,h.height,u)}},{key:"drawSVGText",value:function(u,h,n){var _,w,p=this.document.createElementNS(C,"text");h.displayValue&&(p.setAttribute("style","font:"+h.fontOptions+" "+h.fontSize+"px "+h.font),w="top"==h.textPosition?h.fontSize-h.textMargin:h.height+h.textMargin+h.fontSize,"left"==h.textAlign||n.barcodePadding>0?(_=0,p.setAttribute("text-anchor","start")):"right"==h.textAlign?(_=n.width-1,p.setAttribute("text-anchor","end")):(_=n.width/2,p.setAttribute("text-anchor","middle")),p.setAttribute("x",_),p.setAttribute("y",w),p.appendChild(this.document.createTextNode(n.text)),u.appendChild(p))}},{key:"setSvgAttributes",value:function(u,h){var n=this.svg;n.setAttribute("width",u+"px"),n.setAttribute("height",h+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+u+" "+h),n.setAttribute("xmlns",C),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(u,h,n){var p=this.document.createElementNS(C,"g");return p.setAttribute("transform","translate("+u+", "+h+")"),n.appendChild(p),p}},{key:"setGroupOptions",value:function(u,h){u.setAttribute("style","fill:"+h.lineColor+";")}},{key:"drawRect",value:function(u,h,n,p,_){var w=this.document.createElementNS(C,"rect");return w.setAttribute("x",u),w.setAttribute("y",h),w.setAttribute("width",n),w.setAttribute("height",p),_.appendChild(w),w}}]),b}();S.default=I}}]);