dealposbarcode 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/barcode/383.abe76a3fec58e667.js +1 -0
- package/barcode/index.html +2 -2
- package/barcode/{main.157df647b898d1b6.js → main.2c5c18a333f8f87d.js} +1 -1
- package/barcode/ngsw.json +8 -8
- package/barcode/{runtime.16834f787d90b3bb.js → runtime.6e465911cd30a21c.js} +1 -1
- package/package.json +1 -1
- package/barcode/383.af4a2bb423a6bd13.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkbarcode_app=self.webpackChunkbarcode_app||[]).push([[383],{2383:(J,P,E)=>{"use strict";E.r(P),E.d(P,{PagesModule:()=>Et});var x=E(6814),F=E(915),t=E(5879),v=E(5619),M=E(2181);let L=(()=>{var g;class m{constructor(){this.store=new v.X([])}getState(){return this.store.asObservable().pipe((0,M.h)(o=>void 0!==o))}setState(o){this.store.next(o)}}return(g=m).\u0275fac=function(o){return new(o||g)},g.\u0275prov=t.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),m})();var T=E(9049),D=E(2262),y=E(8645),l=E(9773),c=E(7398),n=E(6013),d=function(g){return g[g.SUPPLIER_BILL=0]="SUPPLIER_BILL",g[g.OUTLET_DELIVERY=1]="OUTLET_DELIVERY",g}(d||{}),p=E(7700),w=E(5141),b=E(95),U=E(4807),z=E(4211);let G=(()=>{var g;class m{constructor(o,u){this.data=o,this.dialogRef=u,this.outlets=o.outlets}ngOnInit(){this.initModalConfig(),this.initTransactionType()}initModalConfig(){this.modalConfig=new w.O,this.modalConfig.title="Choose your transaction",this.modalConfig.hideMoreButton=!0}initTransactionType(){this.transactionTypes=[{title:"Supplier Bill",type:d.SUPPLIER_BILL},{title:"Transfer Order",type:d.OUTLET_DELIVERY}]}onOk(){this.selectedOutlet&&this.poNumber&&this.dialogRef.close({Outlet:this.selectedOutlet.Name,Number:this.poNumber,Type:this.selectedTransactionType})}onCancel(){this.dialogRef.close()}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(p.WI),t.Y36(p.so))},g.\u0275cmp=t.Xpm({type:g,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,u){1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return u.onOk()})("onCancel",function(){return u.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 u.selectedTransactionType=V}),t.qZA()()(),t.TgZ(9,"tr",4)(10,"td",6)(11,"ng-select",7),t.NdJ("ngModelChange",function(V){return u.selectedOutlet=V}),t.qZA()()(),t.TgZ(12,"tr",4)(13,"td",6)(14,"div",8)(15,"input",9),t.NdJ("ngModelChange",function(V){return u.poNumber=V}),t.qZA(),t.TgZ(16,"label",10),t._uU(17,"Invoice Number"),t.qZA()()()()()()()()()()),2&o&&(t.Q6J("config",u.modalConfig),t.xp6(8),t.Q6J("items",u.transactionTypes)("ngModel",u.selectedTransactionType)("clearable",!1)("appendTo","body"),t.xp6(3),t.Q6J("items",u.outlets)("ngModel",u.selectedOutlet)("clearable",!1)("appendTo","body"),t.xp6(4),t.Q6J("ngModel",u.poNumber))},dependencies:[b.Fj,b.JJ,b.On,U.w9,z.M]}),m})();var X=E(9397),fe=E(7081),de=E(631);let he=(()=>{var g;class m{constructor(o){this.httpService=o,this.barcodeConfigState=new v.X(null)}updatePaperFormatConfig(o){let u=localStorage.getItem("Domain");return this.httpService.post("/api/Config/SaveConfig",{SubDomain:u,Version:this.paperFormatVersion,PaperFormats:o})}getPaperFormatConfig(){let o=localStorage.getItem("Domain"),u=[];return this.httpService.post("/api/Config/PaperConfig",{SubDomain:o}).pipe((0,c.U)(W=>(this.paperFormatVersion=W.version,u=W.PaperFormats,{paperFormat:u,outlets:W.Outlets})),(0,fe.d)(1))}setBarcodeConfigState(o){this.barcodeConfigState.next(o)}getBarcodeConfigState(){return this.barcodeConfigState.asObservable().pipe((0,M.h)(o=>n.gT.IsNotEmpty(o)))}}return(g=m).\u0275fac=function(o){return new(o||g)(t.LFG(de.O))},g.\u0275prov=t.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),m})();var Te=E(9862),Ne=E(4664);class Q{constructor(m){m&&(this.AccountID=m.AccountID,this.CalculationTypeID=m.CalculationTypeID,this.ID=m.ID,this.Index=m.Index,this.Label=m.Label,this.MultipleTaxTypeID=m.MultipleTaxTypeID,this.Note=m.Note,this.PrintVisible=m.PrintVisible,this.Rate=m.Rate,this.TypeID=m.TypeID,this.Name=m.Name,this.Type=m.Type)}get getID(){return this.ID}get getType(){return this.Type}get getName(){return this.Name}get getAccountID(){return this.AccountID}set setAccountId(m){this.AccountID=m}get getCalculationTypeID(){return this.CalculationTypeID}set setCalculationID(m){this.CalculationTypeID=m}get getRate(){return this.Rate}set setRate(m){this.Rate=m}get getLabel(){return this.Label}}class ee{get getPricebooks(){return n.gT.IsNotEmpty(this.Pricebook)&&(this.Pricebook=this.Pricebook.sort((m,S)=>m.MinimumQuantity-S.MinimumQuantity)),this.Pricebook}set setPricebooks(m){this.Pricebook=m}get getPriceDiscount(){return this.PriceDiscount}set setPriceDiscount(m){this.PriceDiscount=m}get getReleaseDate(){return this.ReleasedDate}set setReleaseDate(m){this.ReleasedDate=m}get getID(){return this.ID}set setID(m){this.ID=m}get getSelectedPromotion(){return this.SelectedPromotion}set setSelectedPromotion(m){this.SelectedPromotion=m}get getDescription(){return this.description}set setDescription(m){this.description=m}set setBarcodeTitle(m){this.barcodeTitle=m}get getBarcodeTitle(){return this.barcodeTitle}set setCustomPrice(m){this.customPrice=m}get getCustomPrice(){return this.customPrice}get getUnitPrice(){return this.UnitPrice}set setUnitPrice(m){this.UnitPrice=m}get getCode(){return this.Code}set setCode(m){this.barcodeTitle=m,this.Code=m}get getModel(){return this.Model}set setModel(m){this.Model=m}get getName(){return this.Name}set setName(m){this.Name=m}get getCurrency(){return this.CurrencySymbol}set setCurrency(m){this.CurrencySymbol=m}}class ne{get getCode(){return this.Code}get getName(){return this.Name}get getSuspended(){return this.Suspended}set setCode(m){this.Code=m}set setName(m){this.Name=m}set setSuspended(m){this.Suspended=m}}class Y{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(m){this.Outlet=m}set setNumber(m){this.Number=m}set setDate(m){this.Date=m}set setDueDate(m){this.DueDate=m}set setSupplier(m){this.Supplier=m}set setCreatorID(m){this.CreatorID=m}set setCreated(m){this.Created=m}set setDiscount1(m){this.Discount1=m}set setDiscountAmount(m){this.DiscountAmount=m}set setGross(m){this.Gross=m}set setDiscountTotal(m){this.DiscountTotal=m}set setTaxType(m){this.TaxType=m}set setTax(m){this.Tax=m}set setPurchase(m){this.Purchase=m}set setPurchaseNTax(m){this.PurchaseNTax=m}set setDelivery(m){this.Delivery=m}set setVariants(m){this.Variants=m}set setPayments(m){this.Payments=m}}class K extends ee{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(m){this.VariantID=m}set setQuantity(m){this.Quantity=m}set setPrice(m){this.Price=m}set setDiscount(m){this.Discount=m}set setNettPrice(m){this.NettPrice=m}}class le{get getID(){return this.ID}set setID(m){this.ID=m}get getName(){return this.Name}set setName(m){this.Name=m}get getDiscount(){return this.Discount}get getExtraCost(){return this.ExtraCost}get getPromotionID(){return this.PromotionID}get getUnitPrice(){return this.UnitPrice}set setDiscount(m){this.Discount=m}set setExtraCost(m){this.ExtraCost=m}set setPromotionID(m){this.PromotionID=m}set setUnitPrice(m){this.UnitPrice=m}}let Pe=(()=>{var g;class m{constructor(){this.outletID=null,this.outletName=""}}return(g=m).\u0275fac=function(o){return new(o||g)},g.\u0275prov=t.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),m})(),ce=(()=>{var g;class m{constructor(o){this.outlet=o}getProductModel(o){let u=new ee;u.setID=o.ID,u.setCode=o.Code,u.setCurrency=o.CurrencySymbol,u.setModel=o.Model,u.setName=o.Name,u.setUnitPrice=o.UnitPrice,u.setDescription=o.Description,u.setReleaseDate=o.ReleasedDate,u.setPriceDiscount=o.PriceDiscount;const V=o.OutletPrice?.find(W=>W.Outlet==this.outlet.outletName);return V&&(u.setUnitPrice=V.Price,u.setPriceDiscount=V.PriceDiscount),u.setPricebooks=o.Pricebook,u}getTaxModel(o){return new Q(o)}getOutletModel(o){let u=new ne;return u.setCode=o.Code,u.setName=o.Name,u.setSuspended=o.Suspended,u}getVariantModel(o){let u=new K;return u.setCode=o.Code,u.setDiscount=o.Discount,u.setNettPrice=o.NettPrice,u.setPrice=o.Price,u.setUnitPrice=o.UnitPrice,u.setQuantity=o.Quantity,u.setVariantID=o.VariantID,u.setName=o.Name,u}getBillModel(o){let u=new Y;return u.setNumber=o.Number,u.setOutlet=o.Outlet,u.setVariants=o.Variants?o.Variants.map(_=>this.getVariantModel(_)):[],u}getPromotionModel(o){let u=new le;return u.setDiscount=o.Discount,u.setExtraCost=o.ExtraCost,u.setPromotionID=o.PromotionID,u.setUnitPrice=o.UnitPrice,u.setName=o.Name,u.setID=o.ID,u}}return(g=m).\u0275fac=function(o){return new(o||g)(t.LFG(Pe))},g.\u0275prov=t.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),m})(),ue=(()=>{var g;class m{constructor(o,u,_,V,W){this.httpService=o,this.http=u,this.factoryService=_,this.outlet=V,this.barcodeService=W}getProductById(o){let u=localStorage.getItem("Domain");return this.barcodeService.getBarcodeConfigState().pipe((0,Ne.w)(_=>this.httpService.post(`https://${u}/API/V3/Variant/ID`,{ID:o,EntityID:n.gT.IsNotEmpty(_.OutletID)?_.OutletID:n.gT.GuidEmpty})),(0,c.U)(_=>this.factoryService.getProductModel(_)))}getPromotionByProducID(o){let u=localStorage.getItem("Domain");return this.httpService.post(`https://${u}/API/v3/PromotionEvent/GetByVariantID`,{VariantID:o}).pipe((0,c.U)(_=>_.map(W=>this.factoryService.getPromotionModel(W))))}uploadProducts(o){let u=localStorage.getItem("Domain"),_=new FormData;return _.append("file",o,o.name),_.append("OutletID",String(this.outlet.outletID)),this.httpService.postFormData(`https://${u}/API/catalog/product/UploadCSVforBarcode`,_).pipe((0,c.U)(V=>V.map(W=>(W.Print=W.Print.map(te=>this.factoryService.getProductModel(te)),W))))}getTax(){let o=localStorage.getItem("Domain"),u=localStorage.getItem("Token"),_=`https://${o}/API/V3/Tax`,V=new Te.WM({authorization:"Bearer "+u,"content-type":"application/json","X-ClientId":"dealpos-app"});return this.http.get(_,{headers:V}).pipe((0,c.U)(W=>{if(W)return W.map(te=>this.factoryService.getTaxModel(te))}))}}return(g=m).\u0275fac=function(o){return new(o||g)(t.LFG(de.O),t.LFG(Te.eN),t.LFG(ce),t.LFG(Pe),t.LFG(he))},g.\u0275prov=t.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),m})();var Ke=E(6608);let xe=(()=>{var g;class m{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=_=>{},this.preventNegative=!1,this.numericElement=new Ke(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(){}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(t.SBq))},g.\u0275dir=t.lG2({type:g,selectors:[["","autoNum",""]],hostBindings:function(o,u){1&o&&t.NdJ("keyup",function(){return u.onKeyUp()})},inputs:{percentage:"percentage",preventNegative:"preventNegative",decimalPlaces:"decimalPlaces",modifyValueOnWheel:"modifyValueOnWheel",_max:["max","_max"],_min:["min","_min"]},features:[t._Bn([{provide:b.JU,useExisting:(0,t.Gpc)(()=>g),multi:!0}])]}),m})();var Ae=E(2065),_e=E(3620),N=E(3680);const ye=["input"];function ke(g,m){if(1&g&&t._UZ(0,"img",15),2&g){const S=t.oxw(2).$implicit;t.Q6J("src",S.ImgUrl,t.LSH)}}function He(g,m){1&g&&(t.TgZ(0,"div",16),t._UZ(1,"i",17),t.qZA())}function Qe(g,m){if(1&g&&(t.ynx(0),t.TgZ(1,"div"),t.YNc(2,ke,1,1,"img",13),t.YNc(3,He,2,0,"ng-template",null,14,t.W1O),t.qZA(),t.BQk()),2&g){const S=t.MAs(4),o=t.oxw().$implicit;t.xp6(2),t.Q6J("ngIf",o.ImgUrl)("ngIfElse",S)}}const Ue=function(g){return{data:g}};function Fe(g,m){if(1&g&&(t.ynx(0),t.GkF(1,18),t.BQk()),2&g){const S=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Q6J("ngTemplateOutlet",o.itemTemplate)("ngTemplateOutletContext",t.VKq(2,Ue,S))}}function $e(g,m){if(1&g&&(t.TgZ(0,"div",19),t._uU(1),t.qZA()),2&g){const S=t.oxw().$implicit;t.xp6(1),t.hij(" ",S.Value," ")}}function Ze(g,m){if(1&g){const S=t.EpF();t.TgZ(0,"mat-option",8),t.NdJ("click",function(u){const V=t.CHM(S).$implicit;return t.oxw().changeDisplayName(V),t.KtG(u.stopPropagation())}),t.TgZ(1,"div",9),t.YNc(2,Qe,5,2,"ng-container",10),t.YNc(3,Fe,2,4,"ng-container",11),t.YNc(4,$e,2,1,"ng-template",null,12,t.W1O),t.qZA()()}if(2&g){const S=m.$implicit,o=t.MAs(5),u=t.oxw();t.Q6J("value",S),t.xp6(2),t.Q6J("ngIf",u.renderThumbnail),t.xp6(1),t.Q6J("ngIf",u.useCustomTemplate)("ngIfElse",o)}}let be=(()=>{var g;class m{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,u){this.httpService=o,this.ngZone=u,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 b.p4(""),this.options=[],this.complete=!1,this.foundProduct=!1,this.useCustomTemplate=!1,this.propagateChange=_=>{},this.termControl.valueChanges.pipe((0,_e.b)(500)).subscribe(_=>{this.options=[],"object"==typeof _?(this.value=_.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(_.Value),this.complete=!0),this.onSelect&&this.onSelect.emit(_.Key),this.options=[],"object"==typeof _&&(this.value=_.Key,this.clearOnSelect?this.clear():(this.termControl.setValue(_.Value),this.complete=!0),this.onOptionSelect)&&this.onOptionSelect.emit(JSON.stringify({Key:_.Key,Value:_.Value}))):"string"==typeof _&&_.length>0?_.length>2&&!this.inputLock&&this.search(_):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 u={};if(this.data&&(u=this.data),u.prefix=o,u.count=100,this.complete)this.complete=!1;else{let _=this.url,V=localStorage.getItem("Domain");V&&(_=`https://${V}${this.url}`),this.httpService.post(_,u).subscribe(W=>{this.options=W,this.foundProduct=this.options.length>0})}}else this.options=null}onblur(){setTimeout(()=>{},600)}changeDisplayName(o){this.input.nativeElement.value=o.Value}onKeydown(o){const u=o.key;"Enter"===u?(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"===u?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=""}writeValue(o){}registerOnChange(o){this.propagateChange=o}registerOnTouched(){}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(de.O),t.Y36(t.R0b))},g.\u0275cmp=t.Xpm({type:g,selectors:[["autocomplete"]],viewQuery:function(o,u){if(1&o&&t.Gf(ye,7),2&o){let _;t.iGM(_=t.CRH())&&(u.input=_.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",useCustomTemplate:"useCustomTemplate",itemTemplate:"itemTemplate"},outputs:{onOffline:"onOffline",onEnter:"onEnter",onSelect:"onSelect",onOptionSelect:"onOptionSelect",reset:"reset"},features:[t._Bn([{provide:b.JU,useExisting:(0,t.Gpc)(()=>g),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"],[3,"value","click",4,"ngFor","ngForOf"],[3,"value","click"],[1,"d-flex","align-items-center","justify-content-start"],[4,"ngIf"],[4,"ngIf","ngIfElse"],["DEFAULT_CONTENT",""],["width","30","height","30","class","me-2",3,"src",4,"ngIf","ngIfElse"],["EMPTY_IMAGE",""],["width","30","height","30",1,"me-2",3,"src"],[1,"empty-image","d-flex","justify-content-center","align-items-center","rounded-1"],[1,"fa-solid","fa-image","fa-image-autocomplete",2,"color","#b4b4b4c2"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ms-3"]],template:function(o,u){if(1&o&&(t.TgZ(0,"mat-form-field",0)(1,"div",1)(2,"input",2,3),t.NdJ("paste",function(V){return u.inputLock?V.preventDefault():""})("keydown",function(V){return u.onKeydown(V)})("blur",function(){return u.onblur()}),t.qZA(),t.TgZ(4,"label",4),t._uU(5),t.qZA()()(),t.TgZ(6,"mat-autocomplete",5,6),t.YNc(8,Ze,6,4,"mat-option",7),t.qZA()),2&o){const _=t.MAs(7);t.xp6(2),t.s9C("placeholder",u.placeholder||""),t.Q6J("matAutocomplete",_)("formControl",u.termControl),t.xp6(3),t.Oqu(u.placeholder||""),t.xp6(3),t.Q6J("ngForOf",u.options)}},dependencies:[Ae.XC,N.ey,Ae.ZL,x.sg,x.O5,x.tP,b.Fj,b.JJ,b.oH],styles:["mat-option[_ngcontent-%COMP%]{font-size:12px}"]}),m})(),je=(()=>{var g;class m{}return(g=m).\u0275fac=function(o){return new(o||g)},g.\u0275mod=t.oAB({type:g}),g.\u0275inj=t.cJS({imports:[Ae.Bb,x.ez,b.UX]}),m})();function Ve(g,m){if(1&g&&(t.ynx(0),t.TgZ(1,"small",15),t._uU(2),t.qZA(),t.BQk()),2&g){const S=t.oxw().data;t.xp6(2),t.Oqu(null==S?null:S.Code)}}function Ye(g,m){if(1&g&&(t.TgZ(0,"div")(1,"div"),t._uU(2),t.qZA(),t.YNc(3,Ve,3,1,"ng-container",14),t.qZA()),2&g){const S=m.data;t.xp6(2),t.Oqu(null==S?null:S.Value),t.xp6(1),t.Q6J("ngIf",null==S?null:S.Code)}}let ze=(()=>{var g;class m{constructor(o,u,_,V,W){this.dialogRef=o,this.barcodeService=u,this.productService=_,this.authenticationService=V,this.data=W,this.modalConfig=new w.O,this.variantName="",this.hasProductEdit=!0,this.hasPromotion=!1,this.destroy$=new y.x,this.variantName=W.variantName,this.qty=W.qty,this.customPrice=W.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(u=>"ProdE"==u)}initProductUpdate(){n.gT.IsNotEmpty(this.data.variantId)&&this.getProductById(this.data.variantId).subscribe(o=>{this.product.setSelectedPromotion=this.data.promotion,this.hasPromotion=n.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(u=>{this.customPrice=u.getUnitPrice,this.hasPromotion=!1,this.product.setSelectedPromotion=null})}getProductById(o){return this.productService.getProductById(o).pipe((0,X.b)(u=>{this.product=u,this.getPromotionByProductID(o)}))}getPromotionByProductID(o){this.productService.getPromotionByProducID(o).subscribe(u=>{this.promotions=u})}onCustomPriceChange(o){this.customPrice=o}onSelectPromotion(o){o?(this.product.setSelectedPromotion=this.promotions.find(u=>u.getName==o?.getName),this.customPrice=this.product.getUnitPrice,this.hasPromotion=n.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()}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(p.so),t.Y36(he),t.Y36(ue),t.Y36(T.$),t.Y36(p.WI))},g.\u0275cmp=t.Xpm({type:g,selectors:[["app-form-add-variant"]],features:[t._Bn([x.JJ])],decls:26,vars:9,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","itemTemplate","useCustomTemplate","onSelect"],["itemTemplate",""],[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"],[4,"ngIf"],[1,"opacity-75","d-block","mt-1"]],template:function(o,u){if(1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return u.onOk()})("onCancel",function(){return u.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 u.onSelectProduct(V)}),t.qZA(),t.YNc(9,Ye,4,2,"ng-template",null,6,t.W1O),t.qZA()(),t.TgZ(11,"tr",4)(12,"td")(13,"div",7)(14,"input",8),t.NdJ("ngModelChange",function(V){return u.qty=V}),t.qZA(),t.TgZ(15,"label",9),t._uU(16,"Quantity"),t.qZA()()()(),t.TgZ(17,"tr",4)(18,"td",10)(19,"ng-select",11),t.NdJ("change",function(V){return u.onSelectPromotion(V)}),t.qZA()()(),t.TgZ(20,"tr",4)(21,"td")(22,"div",7)(23,"input",12),t.NdJ("ngModelChange",function(V){return u.onCustomPriceChange(V)}),t.qZA(),t.TgZ(24,"label",13),t._uU(25,"Price"),t.qZA()()()()()()()()()()),2&o){const _=t.MAs(10);t.Q6J("config",u.modalConfig),t.xp6(8),t.Q6J("display",u.variantName)("itemTemplate",_)("useCustomTemplate",!0),t.xp6(6),t.Q6J("ngModel",u.qty),t.xp6(5),t.Q6J("items",u.promotions)("ngModel",null==u.product||null==u.product.getSelectedPromotion?null:u.product.getSelectedPromotion.getPromotionID),t.xp6(4),t.Q6J("ngModel",u.customPrice)("readonly",u.hasPromotion||!u.hasProductEdit)}},dependencies:[x.O5,b.Fj,b.JJ,b.On,U.w9,z.M,xe,be]}),m})(),Xe=(()=>{var g;class m{constructor(o,u){this.dialogRef=o,this.data=u,this.event=new t.vpe,this.modalConfig=new w.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)}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(p.so),t.Y36(p.WI))},g.\u0275cmp=t.Xpm({type:g,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,u){1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return u.onOk()})("onCancel",function(){return u.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 u.onUploadFile(V)}),t.qZA()()()()()()()()()),2&o&&t.Q6J("config",u.modalConfig)},dependencies:[z.M]}),m})();var Ge=E(9229);let Me=(()=>{var g;class m{constructor(o,u){this.httpService=o,this.factoryService=u}get(){let u=localStorage.getItem("Domain");return this.httpService.post(`https://${u}/api/v3/Outlet/p`,{Suspended:!1}).pipe((0,c.U)(_=>{let V=[];return _&&(V=_.map(W=>this.factoryService.getOutletModel(W))),V}))}}return(g=m).\u0275fac=function(o){return new(o||g)(t.LFG(de.O),t.LFG(ce))},g.\u0275prov=t.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),m})(),et=(()=>{var g;class m{constructor(o,u){this.httpService=o,this.factoryService=u}get(o){let u=localStorage.getItem("Domain"),_=this.getEndPointByType(o.Type);return this.httpService.post(`https://${u}${_}`,{Outlet:o.Outlet,Number:o.Number}).pipe((0,c.U)(W=>W.map(te=>this.factoryService.getVariantModel(te))))}getEndPointByType(o){let u;return u=o===d.SUPPLIER_BILL?"/API/V3/Barcode/byBillNumber":"/API/V3/Barcode/byOutletDeliveryNumber",u}}return(g=m).\u0275fac=function(o){return new(o||g)(t.LFG(de.O),t.LFG(ce))},g.\u0275prov=t.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),m})();function Se(g,m){if(1&g){const S=t.EpF();t.TgZ(0,"tr",23),t.NdJ("click",function(){const u=t.CHM(S),_=u.$implicit,V=u.index,W=t.oxw();return t.KtG(W.onUpdateProduct(_,V))}),t.TgZ(1,"td")(2,"i",24),t.NdJ("click",function(){const _=t.CHM(S).index,V=t.oxw();return t.KtG(V.onDeleteProduct(_))}),t.qZA()(),t.TgZ(3,"td")(4,"div",25)(5,"div"),t._uU(6),t.qZA(),t.TgZ(7,"small",26),t._uU(8),t.qZA()()(),t.TgZ(9,"td",27),t._uU(10),t.qZA()()}if(2&g){const S=m.$implicit;t.xp6(6),t.Oqu(null==S||null==S.Variants[0]?null:S.Variants[0].getName),t.xp6(2),t.Oqu(null==S||null==S.Variants[0]?null:S.Variants[0].getCode),t.xp6(2),t.Oqu(null==S?null:S.Quantity)}}let qe=(()=>{var g;class m{constructor(o,u,_,V,W,te,re,ie){this.dialog=o,this.productStateService=u,this.productService=_,this.toastService=V,this.queryParamService=W,this.outletService=te,this.billService=re,this.barcodeService=ie,this.destroy$=new y.x,this.stickerTotal=0,this.productGroups=[],this.productSource=[],this.getRouteParam(),this.initOutlets()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}getRouteParam(){this.queryParamService.getState().pipe((0,l.R)(this.destroy$),(0,M.h)(o=>n.gT.IsEmpty(o))).subscribe(o=>{o?.ID&&this.getProductById(o.ID,5),o?.billNumber&&this.getBill({Number:o.billNumber,Outlet:o.outletName,Type:d.SUPPLIER_BILL})})}initOutlets(){this.barcodeService.getPaperFormatConfig().pipe((0,c.U)(o=>o.outlets),(0,l.R)(this.destroy$)).subscribe(o=>{this.outlets=o})}onAddBill(){this.dialog.open(G,{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(u=>{u&&u.forEach(_=>{this.checkAvailableProductCode(_);let V=this.generateProductByQty(_,_.getQuantity);this.productGroups=[...this.productGroups,{VariantID:_.getVariantID,Quantity:_.getQuantity,Variants:V}],this.updateProductsSource()})})}onAddProduct(){this.dialog.open(ze,{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,u){this.productService.getProductById(o).pipe((0,l.R)(this.destroy$)).subscribe(_=>{_&&this.generateProductBarcode(_,u)})}generateProductBarcode(o,u){this.checkAvailableProductCode(o);let _=this.generateProductByQty(o,u);_=this.updateCustomPriceProducts(_),this.productGroups=[...this.productGroups,{VariantID:o.getID,Quantity:u,Variants:_}],this.updateProductsSource()}checkAvailableProductCode(o){o.getCode||this.toastService.error("Product has no code","Code Not Found")}onUpdateProduct(o,u){this.dialog.open(ze,{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(ve=>{if(ve){this.customPrice=ve.customPrice,this.checkAvailableProductCode(ve.product);let We=this.generateProductByQty(ve.product,ve.quantity);We=this.updateCustomPriceProducts(We),this.productGroups[u].Variants=We,this.productGroups[u].Quantity=ve.quantity,this.productGroups[u].VariantID=ve.product.getID,this.updateProductsSource()}})}onDeleteProduct(o){this.productGroups=this.productGroups.filter((u,_)=>_!==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 u;this.productService.uploadProducts(o[0]).pipe((0,l.R)(this.destroy$)).subscribe(_=>{_&&(this.productGroups=[...this.productGroups,..._.map(V=>(u={Quantity:V.Quantity,VariantID:V.VariantID,Variants:V.Print},u))],this.updateProductsSource())})}})}updateCustomPriceProducts(o){let u=o;return this.customPrice&&(u=o.map(_=>(_.setCustomPrice=this.customPrice,_))),u}generateProductByQty(o,u){let _=[];for(let V=1;V<=u;V++)_.push(o);return _}onClear(){this.productGroups=[],this.updateProductsSource()}onPrint(){window.print()}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(p.uw),t.Y36(L),t.Y36(ue),t.Y36(Ge._W),t.Y36(D.U),t.Y36(Me),t.Y36(et),t.Y36(he))},g.\u0275cmp=t.Xpm({type:g,selectors:[["app-list-products"]],decls:35,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,"d-flex","align-items-center","justify-content-center","h-100"],[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,"lh-base"],[1,"opacity-75","d-block"],[1,"text-end"]],template:function(o,u){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 u.onAddProduct()}),t._UZ(8,"i",6),t.qZA(),t.TgZ(9,"button",5),t.NdJ("click",function(){return u.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,Se,11,3,"tr",13),t.qZA()()(),t.TgZ(22,"div",14)(23,"div",15)(24,"div",16)(25,"a",17),t.NdJ("click",function(){return u.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 u.onClear()}),t.TgZ(30,"div",21),t._uU(31," Clear "),t.qZA()(),t.TgZ(32,"a",22),t.NdJ("click",function(){return u.onPrint()}),t.TgZ(33,"div",21),t._uU(34," Print "),t.qZA()()()()()()),2&o&&(t.xp6(5),t.hij("( ",0===u.stickerTotal?"":u.stickerTotal," stickers )"),t.xp6(16),t.Q6J("ngForOf",u.productGroups))},dependencies:[x.sg],styles:["td[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{font-size:12px}.btn[_ngcontent-%COMP%]{font-size:14px!important}"]}),m})();var De=E(4802),we=E(2495);let B=(()=>{var g;class m{constructor(){this._listeners=[]}notify(o,u){for(let _ of this._listeners)_(o,u)}listen(o){return this._listeners.push(o),()=>{this._listeners=this._listeners.filter(u=>o!==u)}}ngOnDestroy(){this._listeners=[]}}return(g=m).\u0275fac=function(o){return new(o||g)},g.\u0275prov=t.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),m})();const i=["input"],a=["*"];let r=0;class h{constructor(m,S){this.source=m,this.value=S}}const O={provide:b.JU,useExisting:(0,t.Gpc)(()=>H),multi:!0},C=new t.OlP("MatRadioGroup"),A=new t.OlP("mat-radio-default-options",{providedIn:"root",factory:function Z(){return{color:"accent"}}});let f=(()=>{var g;class m{get name(){return this._name}set name(o){this._name=o,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(o){this._labelPosition="before"===o?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(o){this._value!==o&&(this._value=o,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(o){this._selected=o,this.value=o?o.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(o){this._disabled=(0,we.Ig)(o),this._markRadiosForCheck()}get required(){return this._required}set required(o){this._required=(0,we.Ig)(o),this._markRadiosForCheck()}constructor(o){this._changeDetector=o,this._value=null,this._name="mat-radio-group-"+r++,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,this._buttonChanges=this._radios.changes.subscribe(()=>{this.selected&&!this._radios.find(o=>o===this.selected)&&(this._selected=null)})}ngOnDestroy(){this._buttonChanges?.unsubscribe()}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(o=>{o.name=this.name,o._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(u=>{u.checked=this.value===u.value,u.checked&&(this._selected=u)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new h(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(o=>o._markForCheck())}writeValue(o){this.value=o,this._changeDetector.markForCheck()}registerOnChange(o){this._controlValueAccessorChangeFn=o}registerOnTouched(o){this.onTouched=o}setDisabledState(o){this.disabled=o,this._changeDetector.markForCheck()}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(t.sBO))},g.\u0275dir=t.lG2({type:g,inputs:{color:"color",name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required"},outputs:{change:"change"}}),m})();class I{constructor(m){this._elementRef=m}}const j=(0,N.Kr)((0,N.sb)(I));let q=(()=>{var g;class m extends j{get checked(){return this._checked}set checked(o){const u=(0,we.Ig)(o);this._checked!==u&&(this._checked=u,u&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!u&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),u&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(o){this._value!==o&&(this._value=o,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===o),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(o){this._labelPosition=o}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(o){this._setDisabled((0,we.Ig)(o))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(o){this._required=(0,we.Ig)(o)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(o){this._color=o}get inputId(){return`${this.id||this._uniqueId}-input`}constructor(o,u,_,V,W,te,re,ie){super(u),this._changeDetector=_,this._focusMonitor=V,this._radioDispatcher=W,this._providerOverride=re,this._uniqueId="mat-radio-"+ ++r,this.id=this._uniqueId,this.change=new t.vpe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=o,this._noopAnimations="NoopAnimations"===te,ie&&(this.tabIndex=(0,we.su)(ie,0))}focus(o,u){u?this._focusMonitor.focusVia(this._inputElement,u,o):this._inputElement.nativeElement.focus(o)}_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((o,u)=>{o!==this.id&&u===this.name&&(this.checked=!1)})}ngDoCheck(){this._updateTabIndex()}ngAfterViewInit(){this._updateTabIndex(),this._focusMonitor.monitor(this._elementRef,!0).subscribe(o=>{!o&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new h(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(o){o.stopPropagation()}_onInputInteraction(o){if(o.stopPropagation(),!this.checked&&!this.disabled){const u=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),u&&this.radioGroup._emitChangeEvent())}}_onTouchTargetClick(o){this._onInputInteraction(o),this.disabled||this._inputElement.nativeElement.focus()}_setDisabled(o){this._disabled!==o&&(this._disabled=o,this._changeDetector.markForCheck())}_updateTabIndex(){const o=this.radioGroup;let u;if(u=o&&o.selected&&!this.disabled?o.selected===this?this.tabIndex:-1:this.tabIndex,u!==this._previousTabIndex){const _=this._inputElement?.nativeElement;_&&(_.setAttribute("tabindex",u+""),this._previousTabIndex=u)}}}return(g=m).\u0275fac=function(o){t.$Z()},g.\u0275dir=t.lG2({type:g,viewQuery:function(o,u){if(1&o&&t.Gf(i,5),2&o){let _;t.iGM(_=t.CRH())&&(u._inputElement=_.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]}),m})(),H=(()=>{var g;class m extends f{}return(g=m).\u0275fac=function(){let S;return function(u){return(S||(S=t.n5z(g)))(u||g)}}(),g.\u0275dir=t.lG2({type:g,selectors:[["mat-radio-group"]],contentQueries:function(o,u,_){if(1&o&&t.Suo(_,$,5),2&o){let V;t.iGM(V=t.CRH())&&(u._radios=V)}},hostAttrs:["role","radiogroup",1,"mat-mdc-radio-group"],exportAs:["matRadioGroup"],features:[t._Bn([O,{provide:C,useExisting:g}]),t.qOj]}),m})(),$=(()=>{var g;class m extends q{constructor(o,u,_,V,W,te,re,ie){super(o,u,_,V,W,te,re,ie)}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(C,8),t.Y36(t.SBq),t.Y36(t.sBO),t.Y36(De.tE),t.Y36(B),t.Y36(t.QbO,8),t.Y36(A,8),t.$8M("tabindex"))},g.\u0275cmp=t.Xpm({type:g,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-mdc-radio-button"],hostVars:15,hostBindings:function(o,u){1&o&&t.NdJ("focus",function(){return u._inputElement.nativeElement.focus()}),2&o&&(t.uIk("id",u.id)("tabindex",null)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),t.ekj("mat-primary","primary"===u.color)("mat-accent","accent"===u.color)("mat-warn","warn"===u.color)("mat-mdc-radio-checked",u.checked)("_mat-animation-noopable",u._noopAnimations))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[t.qOj],ngContentSelectors:a,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"],[1,"mdc-label",3,"for"]],template:function(o,u){if(1&o&&(t.F$t(),t.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3),t.NdJ("click",function(V){return u._onTouchTargetClick(V)}),t.qZA(),t.TgZ(4,"input",4,5),t.NdJ("change",function(V){return u._onInputInteraction(V)}),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&o){const _=t.MAs(1);t.ekj("mdc-form-field--align-end","before"==u.labelPosition),t.xp6(2),t.ekj("mdc-radio--disabled",u.disabled),t.xp6(2),t.Q6J("id",u.inputId)("checked",u.checked)("disabled",u.disabled)("required",u.required),t.uIk("name",u.name)("value",u.value)("aria-label",u.ariaLabel)("aria-labelledby",u.ariaLabelledby)("aria-describedby",u.ariaDescribedby),t.xp6(5),t.Q6J("matRippleTrigger",_)("matRippleDisabled",u._isRippleDisabled())("matRippleCentered",!0),t.xp6(2),t.Q6J("for",u.inputId)}},dependencies:[N.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{--mdc-radio-disabled-selected-icon-opacity:0.38;--mdc-radio-disabled-unselected-icon-opacity:0.38;--mdc-radio-state-layer-size:40px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{padding:calc((var(--mdc-radio-state-layer-size) - 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)}.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)}.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)}.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)}.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)}.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)}.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)}.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)}.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)}.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)}.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)}.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)}.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)}.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)}.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)}.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)}.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)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{top:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);left:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);right:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);left:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color)}.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-radio-checked-ripple-color)}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button .mdc-radio--disabled+label{color:var(--mat-radio-disabled-label-color)}.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}),m})(),oe=(()=>{var g;class m{}return(g=m).\u0275fac=function(o){return new(o||g)},g.\u0275mod=t.oAB({type:g}),g.\u0275inj=t.cJS({imports:[N.BQ,x.ez,N.si,N.BQ]}),m})();function me(g,m){if(1&g){const S=t.EpF();t.ynx(0),t.TgZ(1,"tr")(2,"td"),t._uU(3,"Pricebook Font Size"),t.qZA(),t.TgZ(4,"td")(5,"div",14)(6,"input",27),t.NdJ("ngModelChange",function(u){t.CHM(S);const _=t.oxw();return t.KtG(_.pricebookFontSize=u)}),t.qZA()()(),t.TgZ(7,"td")(8,"span"),t._uU(9,"Change font size for pricebook price"),t.qZA()()(),t.BQk()}if(2&g){const S=t.oxw();t.xp6(6),t.Q6J("ngModel",S.pricebookFontSize)}}function ge(g,m){if(1&g){const S=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2,"Selected Tax"),t.qZA(),t.TgZ(3,"td")(4,"ng-select",31),t.NdJ("ngModelChange",function(u){t.CHM(S);const _=t.oxw();return t.KtG(_.taxOptionSelected=u)})("change",function(){t.CHM(S);const u=t.oxw();return t.KtG(u.onSelectTaxType())}),t.qZA()(),t.TgZ(5,"td")(6,"span"),t._uU(7,"Applied Tax ex: 100 + 10% = 110"),t.qZA()()()}if(2&g){const S=t.oxw();t.xp6(4),t.Q6J("items",S.taxOptions)("ngModel",S.taxOptionSelected)("clearable",!1)}}function se(g,m){if(1&g){const S=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2,"Outlet Price"),t.qZA(),t.TgZ(3,"td")(4,"ng-select",32),t.NdJ("ngModelChange",function(u){t.CHM(S);const _=t.oxw();return t.KtG(_.outletID=u)}),t.qZA()(),t.TgZ(5,"td")(6,"span"),t._uU(7,"Price will be set according to the outlet price assigned when selected the outlet"),t.qZA()()()}if(2&g){const S=t.oxw();t.xp6(4),t.Q6J("items",S.outlets)("ngModel",S.outletID)("clearable",!0)}}const ae=function(g){return{active:g}};let Ie=(()=>{var g;class m{constructor(o,u,_){this.dialogRef=o,this.data=u,this.outlet=_,this.event=new t.vpe,this.modalConfig=new w.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.pricebookVisible=!1,this.pricebookFontSize=null,this.paperFormat=JSON.parse(JSON.stringify(u.paperFormat)),this.orientationOptions=this.paperFormat.OrientationChoice,this.outlets=u.outlets,this.taxs=u.taxs,this.authTax=u.authTax,this.initTaxOptions(),this.activeTab="paper",this.outletRole=u.outletRole}ngOnInit(){this.initModalConfig(),this.initFormValue(),this.authTax&&this.initTaxOptionSelected()}initTaxOptions(){this.taxOptions=[],this.taxs.forEach((o,u)=>{this.taxOptions=[...this.taxOptions,{id:u+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,this.outletID=this.paperFormat.OutletID,this.outletID=this.outlet.outletID,this.pricebookVisible=this.paperFormat.PricebookVisible,this.pricebookFontSize=this.paperFormat.PricebookFontSize)}setPaperFormat(){this.paperFormat&&(this.checkPriceWithTax(),this.paperFormat.PriceFontSize=this.PriceFontSize,this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.PaperWidth=this.paperWidth,this.paperFormat.MarginTop=this.marginTop,this.paperFormat.MarginLeft=this.marginLeft,this.paperFormat.StickerWidth=this.stickerWidth,this.paperFormat.StickerHeight=this.stickerHeight,this.paperFormat.BarcodeHeight=this.barcodeHeight,this.paperFormat.ColumnSpacing=this.spacingColumn,this.paperFormat.RowSpacing=this.spacingRow,this.paperFormat.BarcodeVisible=this.barcode,this.paperFormat.MoveProductNameOnTop=this.move,this.paperFormat.CodeVisible=this.code,this.paperFormat.PriceVisible=this.price,this.paperFormat.NameVisible=this.name,this.paperFormat.DescriptionAsCode=this.desc,this.paperFormat.ProductNameFontSize=this.fontSize,this.paperFormat.ProductNamePrefix=this.namePrefix,this.paperFormat.ProductNameMaxLength=this.maxChar,this.paperFormat.LineHeight=this.lineHeight,this.paperFormat.PriceWithTax=this.priceTax,this.paperFormat.TaxType=this.taxSelected,this.paperFormat.StoreName=this.storeName,this.paperFormat.CurrencySymbol=this.currencySymbol,this.paperFormat.PromotionPriceLabel=this.promotionPriceLabel,this.paperFormat.BasicPriceLabel=this.basicPriceLabel,this.paperFormat.ShowReleasedDate=this.relaseDate,this.paperFormat.ShowPriceDiscount=this.priceDiscount,this.paperFormat.Orientation=this.orientationType,this.paperFormat.OutletID=this.outletID,this.outlet.outletID=this.outletID,this.outlet.outletName=this.outlets.find(o=>o.ID==this.outletID)?.Name,this.paperFormat.PricebookVisible=this.pricebookVisible,this.paperFormat.PricebookFontSize=this.pricebookFontSize)}checkPriceWithTax(){this.priceTax||(this.taxSelected=this.taxs.find(o=>"No Tax"==o.getLabel))}dataTarget(o){this.activeTab=o}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(p.so),t.Y36(p.WI),t.Y36(Pe))},g.\u0275cmp=t.Xpm({type:g,selectors:[["app-form-settings"]],outputs:{event:"event"},decls:350,vars:82,consts:[[3,"config","onOk","onCancel"],["container",""],["id","myTab","role","tablist",1,"nav","nav-tabs"],["tabs",""],[1,"nav-item"],["data-bs-toggle","tab",1,"nav-link",3,"ngClass","click"],["id","spacing-tab","data-bs-toggle","tab","data-bs-target","'#spacing'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","dua-tab","data-bs-toggle","tab","data-bs-target","'#sticker-content'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","price-tab","data-bs-toggle","tab","data-bs-target","'#price'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","advanced-tab","data-bs-toggle","tab","data-bs-target","'#advanced'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],["id","promotionLabel-tab","data-bs-toggle","tab","data-bs-target","'#promotionLabel'","role","tab","aria-selected","true",1,"nav-link",3,"ngClass","click"],[1,"tab-content","border","bg-white"],["id","paper",1,"tab-pane","mt-0",3,"ngClass"],[1,"table","table-bordered","w-100"],[1,"input-group"],["type","number","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],[1,"input-group-append"],[1,"input-group-text"],["id","spacing",1,"tab-pane","mt-0",3,"ngClass"],["id","sticker-content",1,"tab-pane","mt-0",3,"ngClass"],[2,"width","150px"],["aria-label","Select an option","color","primary"],["value","false",3,"checked","change"],["value","true",1,"ms-4",3,"checked","change"],[4,"ngIf"],["id","price",1,"tab-pane","mt-0",3,"ngClass"],["type","text","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["type","text","autoNum","","aria-label","width",1,"form-control",3,"ngModel","ngModelChange"],["id","advanced",1,"tab-pane","mt-0",3,"ngClass"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Select orientation",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange"],["id","promotionLabel",1,"tab-pane","mt-0",3,"ngClass"],["appendTo","body","bindLabel","name","placeholder","Select Column",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange","change"],["appendTo","body","bindLabel","Name","bindValue","ID","name","Choose Outlet","placeholder","Choose Outlet",1,"sticky-top",3,"items","ngModel","clearable","ngModelChange"]],template:function(o,u){1&o&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return u.onOk()})("onCancel",function(){return u.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"ul",2,3)(5,"li",4)(6,"a",5),t.NdJ("click",function(){return u.dataTarget("paper")}),t._uU(7,"Paper"),t.qZA()(),t.TgZ(8,"li",4)(9,"a",6),t.NdJ("click",function(){return u.dataTarget("spacing")}),t._uU(10,"Spacing"),t.qZA()(),t.TgZ(11,"li",4)(12,"a",7),t.NdJ("click",function(){return u.dataTarget("sticker-content")}),t._uU(13,"Sticker Content"),t.qZA()(),t.TgZ(14,"li",4)(15,"a",8),t.NdJ("click",function(){return u.dataTarget("price")}),t._uU(16,"Price"),t.qZA()(),t.TgZ(17,"li",4)(18,"a",9),t.NdJ("click",function(){return u.dataTarget("advanced")}),t._uU(19,"Advanced"),t.qZA()(),t.TgZ(20,"li",4)(21,"a",10),t.NdJ("click",function(){return u.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 u.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 u.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 u.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 u.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 u.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 u.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 u.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",20)(118,"div",14)(119,"input",15),t.NdJ("ngModelChange",function(V){return u.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 u.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",21)(143,"mat-radio-button",22),t.NdJ("change",function(){return u.barcode=!1}),t._uU(144,"No "),t.qZA(),t.TgZ(145,"mat-radio-button",23),t.NdJ("change",function(){return u.barcode=!0}),t._uU(146,"Yes"),t.qZA()()(),t.TgZ(147,"td")(148,"span"),t._uU(149,"Whether barcode is visible"),t.qZA()()(),t.TgZ(150,"tr")(151,"td"),t._uU(152,"Code"),t.qZA(),t.TgZ(153,"td")(154,"mat-radio-group",21)(155,"mat-radio-button",22),t.NdJ("change",function(){return u.code=!1}),t._uU(156,"No "),t.qZA(),t.TgZ(157,"mat-radio-button",23),t.NdJ("change",function(){return u.code=!0}),t._uU(158,"Yes"),t.qZA()()(),t.TgZ(159,"td")(160,"span"),t._uU(161,"Whether variant code is visible"),t.qZA()()(),t.TgZ(162,"tr")(163,"td"),t._uU(164,"Price"),t.qZA(),t.TgZ(165,"td")(166,"mat-radio-group",21)(167,"mat-radio-button",22),t.NdJ("change",function(){return u.price=!1}),t._uU(168,"No "),t.qZA(),t.TgZ(169,"mat-radio-button",23),t.NdJ("change",function(){return u.price=!0}),t._uU(170,"Yes"),t.qZA()()(),t.TgZ(171,"td")(172,"span"),t._uU(173,"Whether variant price is visible"),t.qZA()()(),t.TgZ(174,"tr")(175,"td"),t._uU(176,"Name"),t.qZA(),t.TgZ(177,"td")(178,"mat-radio-group",21)(179,"mat-radio-button",22),t.NdJ("change",function(){return u.name=!1}),t._uU(180,"No "),t.qZA(),t.TgZ(181,"mat-radio-button",23),t.NdJ("change",function(){return u.name=!0}),t._uU(182,"Yes"),t.qZA()()(),t.TgZ(183,"td")(184,"span"),t._uU(185,"Whether variant name is visible"),t.qZA()()(),t.TgZ(186,"tr")(187,"td"),t._uU(188,"Move Product Name"),t.qZA(),t.TgZ(189,"td")(190,"mat-radio-group",21)(191,"mat-radio-button",22),t.NdJ("change",function(){return u.move=!1}),t._uU(192,"No "),t.qZA(),t.TgZ(193,"mat-radio-button",23),t.NdJ("change",function(){return u.move=!0}),t._uU(194,"Yes"),t.qZA()()(),t.TgZ(195,"td")(196,"span"),t._uU(197,"Whether move variant name below variant code or below variant price"),t.qZA()()(),t.TgZ(198,"tr")(199,"td"),t._uU(200,"Release Date"),t.qZA(),t.TgZ(201,"td")(202,"mat-radio-group",21)(203,"mat-radio-button",22),t.NdJ("change",function(){return u.relaseDate=!1}),t._uU(204,"No "),t.qZA(),t.TgZ(205,"mat-radio-button",23),t.NdJ("change",function(){return u.relaseDate=!0}),t._uU(206,"Yes"),t.qZA()()(),t.TgZ(207,"td")(208,"span"),t._uU(209,"Whether release date is visible"),t.qZA()()(),t.TgZ(210,"tr")(211,"td"),t._uU(212,"Discount Visible"),t.qZA(),t.TgZ(213,"td")(214,"mat-radio-group",21)(215,"mat-radio-button",22),t.NdJ("change",function(){return u.priceDiscount=!1}),t._uU(216,"No "),t.qZA(),t.TgZ(217,"mat-radio-button",23),t.NdJ("change",function(){return u.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,"tr")(223,"td"),t._uU(224,"Pricebook Price"),t.qZA(),t.TgZ(225,"td")(226,"mat-radio-group",21)(227,"mat-radio-button",22),t.NdJ("change",function(){return u.pricebookVisible=!1}),t._uU(228,"No "),t.qZA(),t.TgZ(229,"mat-radio-button",23),t.NdJ("change",function(){return u.pricebookVisible=!0}),t._uU(230,"Yes"),t.qZA()()(),t.TgZ(231,"td")(232,"span"),t._uU(233,"Whether pricebook price is visible"),t.qZA()()(),t.YNc(234,me,10,1,"ng-container",24),t.qZA()(),t.TgZ(235,"div",25)(236,"table",13)(237,"tr")(238,"td"),t._uU(239,"Price with Tax"),t.qZA(),t.TgZ(240,"td")(241,"mat-radio-group",21)(242,"mat-radio-button",22),t.NdJ("change",function(){return u.priceTax=!1}),t._uU(243," No"),t.qZA(),t.TgZ(244,"mat-radio-button",23),t.NdJ("change",function(){return u.priceTax=!0}),t._uU(245,"Yes"),t.qZA()()(),t.TgZ(246,"td")(247,"span"),t._uU(248),t.qZA()()(),t.YNc(249,ge,8,3,"tr",24),t.TgZ(250,"tr")(251,"td"),t._uU(252,"Currency"),t.qZA(),t.TgZ(253,"td",20)(254,"div",14)(255,"input",26),t.NdJ("ngModelChange",function(V){return u.currencySymbol=V}),t.qZA()()(),t.TgZ(256,"td")(257,"span"),t._uU(258,"The default currency"),t.qZA()()(),t.TgZ(259,"tr")(260,"td"),t._uU(261,"Font Size"),t.qZA(),t.TgZ(262,"td")(263,"div",14)(264,"input",27),t.NdJ("ngModelChange",function(V){return u.PriceFontSize=V}),t.qZA()()(),t.TgZ(265,"td")(266,"span"),t._uU(267,"Change font size for price"),t.qZA()()(),t.YNc(268,se,8,3,"tr",24),t.qZA()(),t.TgZ(269,"div",28)(270,"table",13)(271,"tr")(272,"td"),t._uU(273,"Max Character"),t.qZA(),t.TgZ(274,"td",20)(275,"div",14)(276,"input",15),t.NdJ("ngModelChange",function(V){return u.maxChar=V}),t.qZA()()(),t.TgZ(277,"td")(278,"span"),t._uU(279,"The max character of the product name"),t.qZA()()(),t.TgZ(280,"tr")(281,"td"),t._uU(282,"Name Prefix"),t.qZA(),t.TgZ(283,"td")(284,"div",14)(285,"input",26),t.NdJ("ngModelChange",function(V){return u.namePrefix=V}),t.qZA()()(),t.TgZ(286,"td")(287,"span"),t._uU(288,"A word, letter, or number placed before product name"),t.qZA()()(),t.TgZ(289,"tr")(290,"td"),t._uU(291,"Store Name"),t.qZA(),t.TgZ(292,"td")(293,"div",14)(294,"input",26),t.NdJ("ngModelChange",function(V){return u.storeName=V}),t.qZA()()(),t.TgZ(295,"td")(296,"span"),t._uU(297,"The name of the store"),t.qZA()()(),t.TgZ(298,"tr")(299,"td"),t._uU(300,"Orientation"),t.qZA(),t.TgZ(301,"td")(302,"ng-select",29),t.NdJ("ngModelChange",function(V){return u.orientationType=V}),t.qZA()(),t.TgZ(303,"td")(304,"span"),t._uU(305,"Horizontal or vertical position store name label"),t.qZA()()(),t.TgZ(306,"tr")(307,"td"),t._uU(308,"Use description as code"),t.qZA(),t.TgZ(309,"td")(310,"mat-radio-group",21)(311,"mat-radio-button",22),t.NdJ("change",function(){return u.desc=!1}),t._uU(312,"No "),t.qZA(),t.TgZ(313,"mat-radio-button",23),t.NdJ("change",function(){return u.desc=!0}),t._uU(314,"Yes"),t.qZA()()(),t.TgZ(315,"td")(316,"span"),t._uU(317,"Copy product description into product code"),t.qZA()()(),t.TgZ(318,"tr")(319,"td"),t._uU(320,'Remove "Default"'),t.qZA(),t.TgZ(321,"td")(322,"mat-radio-group",21)(323,"mat-radio-button",22),t.NdJ("change",function(){return u.removeDefault=!1}),t._uU(324,"No "),t.qZA(),t.TgZ(325,"mat-radio-button",23),t.NdJ("change",function(){return u.removeDefault=!0}),t._uU(326,"Yes"),t.qZA()()(),t.TgZ(327,"td")(328,"span"),t._uU(329,'Remove "Default" label from product name'),t.qZA()()()()(),t.TgZ(330,"div",30)(331,"table",13)(332,"tr")(333,"td"),t._uU(334,"Normal Price"),t.qZA(),t.TgZ(335,"td")(336,"div",14)(337,"input",26),t.NdJ("ngModelChange",function(V){return u.basicPriceLabel=V}),t.qZA()()(),t.TgZ(338,"td")(339,"span"),t._uU(340,"Custom label normal price"),t.qZA()()(),t.TgZ(341,"tr")(342,"td"),t._uU(343,"Promotion Price"),t.qZA(),t.TgZ(344,"td")(345,"div",14)(346,"input",26),t.NdJ("ngModelChange",function(V){return u.promotionPriceLabel=V}),t.qZA()()(),t.TgZ(347,"td")(348,"span"),t._uU(349,"Custom label promotion price"),t.qZA()()()()()()()()()),2&o&&(t.Q6J("config",u.modalConfig),t.xp6(6),t.Q6J("ngClass",t.VKq(58,ae,"paper"===u.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(60,ae,"spacing"===u.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(62,ae,"sticker-content"===u.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(64,ae,"price"===u.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(66,ae,"advanced"===u.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(68,ae,"promotionLabel"===u.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(70,ae,"paper"===u.activeTab)),t.xp6(7),t.Q6J("ngModel",u.paperWidth),t.xp6(12),t.Q6J("ngModel",u.stickerWidth),t.xp6(12),t.Q6J("ngModel",u.stickerHeight),t.xp6(7),t.Q6J("ngClass",t.VKq(72,ae,"spacing"===u.activeTab)),t.xp6(7),t.Q6J("ngModel",u.marginLeft),t.xp6(12),t.Q6J("ngModel",u.marginTop),t.xp6(12),t.Q6J("ngModel",u.spacingRow),t.xp6(12),t.Q6J("ngModel",u.spacingColumn),t.xp6(7),t.Q6J("ngClass",t.VKq(74,ae,"sticker-content"===u.activeTab)),t.xp6(7),t.Q6J("ngModel",u.barcodeHeight),t.xp6(12),t.Q6J("ngModel",u.fontSize),t.xp6(12),t.Q6J("checked",!u.barcode),t.xp6(2),t.Q6J("checked",u.barcode),t.xp6(10),t.Q6J("checked",!u.code),t.xp6(2),t.Q6J("checked",u.code),t.xp6(10),t.Q6J("checked",!u.price),t.xp6(2),t.Q6J("checked",u.price),t.xp6(10),t.Q6J("checked",!u.name),t.xp6(2),t.Q6J("checked",u.name),t.xp6(10),t.Q6J("checked",!u.move),t.xp6(2),t.Q6J("checked",u.move),t.xp6(10),t.Q6J("checked",!u.relaseDate),t.xp6(2),t.Q6J("checked",u.relaseDate),t.xp6(10),t.Q6J("checked",!u.priceDiscount),t.xp6(2),t.Q6J("checked",u.priceDiscount),t.xp6(10),t.Q6J("checked",!u.pricebookVisible),t.xp6(2),t.Q6J("checked",u.pricebookVisible),t.xp6(5),t.Q6J("ngIf",u.pricebookVisible),t.xp6(1),t.Q6J("ngClass",t.VKq(76,ae,"price"===u.activeTab)),t.xp6(7),t.Q6J("checked",!u.priceTax),t.xp6(2),t.Q6J("checked",u.priceTax),t.xp6(4),t.hij("Tax is added to the product base price ",u.authTax,""),t.xp6(1),t.Q6J("ngIf",1==u.priceTax&&1==u.authTax),t.xp6(6),t.Q6J("ngModel",u.currencySymbol),t.xp6(9),t.Q6J("ngModel",u.PriceFontSize),t.xp6(4),t.Q6J("ngIf",u.outletRole),t.xp6(1),t.Q6J("ngClass",t.VKq(78,ae,"advanced"===u.activeTab)),t.xp6(7),t.Q6J("ngModel",u.maxChar),t.xp6(9),t.Q6J("ngModel",u.namePrefix),t.xp6(9),t.Q6J("ngModel",u.storeName),t.xp6(8),t.Q6J("items",u.orientationOptions)("ngModel",u.orientationType)("clearable",!1),t.xp6(9),t.Q6J("checked",!u.desc),t.xp6(2),t.Q6J("checked",u.desc),t.xp6(10),t.Q6J("checked",!u.removeDefault),t.xp6(2),t.Q6J("checked",u.removeDefault),t.xp6(5),t.Q6J("ngClass",t.VKq(80,ae,"promotionLabel"===u.activeTab)),t.xp6(7),t.Q6J("ngModel",u.basicPriceLabel),t.xp6(9),t.Q6J("ngModel",u.promotionPriceLabel))},dependencies:[x.mk,x.O5,b.Fj,b.wV,b.JJ,b.On,U.w9,z.M,xe,H,$],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}"]}),m})();var Je=E(6387);const tt=["bcElement"];let nt=(()=>{var g;class m{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(o){this.renderer=o,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 o;switch(this.elementType){case"img":o=this.renderer.createElement("img");break;case"canvas":o=this.renderer.createElement("canvas");break;default:o=this.renderer.createElement("svg","svg")}Je(o,this.value,this.options);for(const u of this.bcElement.nativeElement.childNodes)this.renderer.removeChild(this.bcElement.nativeElement,u);this.renderer.appendChild(this.bcElement.nativeElement,o)}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(t.Qsj))},g.\u0275cmp=t.Xpm({type:g,selectors:[["ngx-barcode6"]],viewQuery:function(o,u){if(1&o&&t.Gf(tt,5),2&o){let _;t.iGM(_=t.CRH())&&(u.bcElement=_.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(o,u){1&o&&t._UZ(0,"div",null,0),2&o&&t.Tol(u.cssClass)},encapsulation:2}),m})(),Oe=(()=>{var g;class m{}return(g=m).\u0275fac=function(o){return new(o||g)},g.\u0275mod=t.oAB({type:g}),g.\u0275inj=t.cJS({}),m})(),Ee=(()=>{var g;class m{transform(o,u){let _=o,V=0;return u&&0!==u&&(V=o*(u/100),_=o+V),_}}return(g=m).\u0275fac=function(o){return new(o||g)},g.\u0275pipe=t.Yjl({name:"taxPipe",type:g,pure:!0}),m})();function lt(g,m){if(1&g&&t._UZ(0,"ngx-barcode6",18),2&g){const S=t.oxw().$implicit,o=t.oxw();t.Q6J("bc-value",null==S?null:S.getCode)("bc-element-type","img")("bc-width",1)("bc-height",null==o.selectedPaperFormat?null:o.selectedPaperFormat.BarcodeHeight)}}function Ce(g,m){if(1&g&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&g){const S=t.oxw().$implicit,o=t.oxw();t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.Oqu(S.getBarcodeTitle)}}function ct(g,m){if(1&g&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&g){const S=t.oxw().$implicit,o=t.oxw();t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=o.selectedPaperFormat&&o.selectedPaperFormat.ProductNamePrefix?(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNamePrefix)+" "+S.getName:S.getName,0,null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameMaxLength)," ")}}function ut(g,m){if(1&g&&(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&g){const S=t.oxw(2).$implicit,o=t.oxw();t.xp6(3),t.Oqu(o.selectedPaperFormat.BasicPriceLabel?o.selectedPaperFormat.BasicPriceLabel:"N. Price"),t.xp6(4),t.AsE("",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(8,6,null==S?null:S.getUnitPrice),""),t.xp6(4),t.Oqu(o.selectedPaperFormat.PromotionPriceLabel?o.selectedPaperFormat.PromotionPriceLabel:"Spc. Price"),t.xp6(2),t.AsE("",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(14,8,(null==S||null==S.getSelectedPromotion?null:S.getSelectedPromotion.getUnitPrice)-(null==S||null==S.getSelectedPromotion?null:S.getSelectedPromotion.getUnitPrice)*(null==S||null==S.getSelectedPromotion?null:S.getSelectedPromotion.getDiscount)/100),"")}}function dt(g,m){if(1&g&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&g){const S=t.oxw(3).$implicit,o=t.oxw();t.xp6(1),t.AsE(" ",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==S?null:S.getCustomPrice,o.tax))," ")}}function Le(g,m){if(1&g&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.ALo(3,"taxPipe"),t.BQk()),2&g){const S=t.oxw(4).$implicit,o=t.oxw();t.xp6(1),t.AsE(" ",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(2,2,t.xi3(3,4,null==S?null:S.getUnitPrice,o.tax))," ")}}function it(g,m){if(1&g&&t.YNc(0,Le,4,7,"ng-container",20),2&g){t.oxw();const S=t.MAs(5),o=t.oxw(3);t.Q6J("ngIf",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.PriceWithTax)&&o.tax&&0!=o.tax)("ngIfElse",S)}}function Re(g,m){if(1&g&&(t._uU(0),t.ALo(1,"number")),2&g){const S=t.oxw(3).$implicit,o=t.oxw();t.AsE(" ",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CurrencySymbol," ",t.lcZ(1,2,null==S?null:S.getUnitPrice)," ")}}function rt(g,m){if(1&g&&(t.TgZ(0,"strong"),t.YNc(1,dt,4,7,"ng-container",20),t.YNc(2,it,1,2,"ng-template",null,29,t.W1O),t.YNc(4,Re,2,4,"ng-template",null,30,t.W1O),t.qZA()),2&g){const S=t.MAs(3),o=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",0!==(null==o?null:o.getCustomPrice)&&void 0!==(null==o?null:o.getCustomPrice))("ngIfElse",S)}}function Be(g,m){if(1&g&&(t.TgZ(0,"span",19),t.YNc(1,ut,15,10,"ng-container",20),t.YNc(2,rt,6,2,"ng-template",null,21,t.W1O),t.qZA()),2&g){const S=t.MAs(3),o=t.oxw().$implicit,u=t.oxw();t.Udp("font-size",(null==u.selectedPaperFormat?null:u.selectedPaperFormat.PriceFontSize)+"px"),t.xp6(1),t.Q6J("ngIf",o.getSelectedPromotion)("ngIfElse",S)}}function mt(g,m){if(1&g&&(t.TgZ(0,"span",19),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&g){const S=t.oxw().$implicit,o=t.oxw();t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.Dn7(2,3,null!=o.selectedPaperFormat&&o.selectedPaperFormat.ProductNamePrefix?(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNamePrefix)+" "+S.getName:S.getName,0,null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameMaxLength)," ")}}function gt(g,m){if(1&g&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.ALo(3,"date"),t.qZA(),t.BQk()),2&g){const S=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",t.xi3(3,3,S.getReleaseDate,"dd MMM yy")," ")}}function pt(g,m){if(1&g&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&g){const S=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",S.getPriceDiscount,"% Off ")}}function ft(g,m){if(1&g&&(t.ynx(0),t.TgZ(1,"span",19),t._uU(2),t.qZA(),t.BQk()),2&g){const S=t.oxw(2);t.xp6(1),t.Udp("font-size",(null==S.selectedPaperFormat?null:S.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==S.selectedPaperFormat?null:S.selectedPaperFormat.StoreName," ")}}function vt(g,m){if(1&g&&(t.ynx(0),t.TgZ(1,"div",33)(2,"div"),t._uU(3),t.qZA(),t.TgZ(4,"div",34),t._uU(5,"-"),t.qZA(),t.TgZ(6,"div",35),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"div",34),t._uU(10,"-"),t.qZA(),t.TgZ(11,"div"),t._uU(12),t.ALo(13,"number"),t.qZA()(),t.BQk()),2&g){const S=m.$implicit,o=t.oxw(3);t.xp6(1),t.Udp("font-size",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.PricebookFontSize)+"px"),t.xp6(2),t.Oqu(null==S?null:S.Name),t.xp6(4),t.hij("Min. ",t.lcZ(8,5,null==S?null:S.MinimumQuantity),""),t.xp6(5),t.Oqu(t.lcZ(13,7,null==S?null:S.UnitPrice))}}function yt(g,m){if(1&g&&(t.ynx(0),t.TgZ(1,"div",31),t.YNc(2,vt,14,9,"ng-container",32),t.qZA(),t.BQk()),2&g){const S=t.oxw().$implicit;t.xp6(2),t.Q6J("ngForOf",null==S?null:S.getPricebooks)}}function _t(g,m){if(1&g&&(t.ynx(0),t.TgZ(1,"div",36)(2,"div",37),t._uU(3),t.qZA()(),t.BQk()),2&g){const S=t.oxw(2);t.xp6(2),t.Udp("height",(null==S.selectedPaperFormat?null:S.selectedPaperFormat.StickerHeight)+"px")("font-size",(null==S.selectedPaperFormat?null:S.selectedPaperFormat.ProductNameFontSize)+"px"),t.xp6(1),t.hij(" ",null==S.selectedPaperFormat?null:S.selectedPaperFormat.StoreName," ")}}function bt(g,m){if(1&g&&(t.TgZ(0,"li")(1,"div",13),t.YNc(2,lt,1,4,"ngx-barcode6",14),t.TgZ(3,"div",15),t.YNc(4,Ce,2,3,"span",16),t.YNc(5,ct,3,7,"span",16),t.YNc(6,Be,4,4,"span",16),t.YNc(7,mt,3,7,"span",16),t.YNc(8,gt,4,6,"ng-container",17),t.YNc(9,pt,3,3,"ng-container",17),t.YNc(10,ft,3,3,"ng-container",17),t.YNc(11,yt,3,1,"ng-container",17),t.qZA(),t.YNc(12,_t,4,5,"ng-container",17),t.qZA()()),2&g){const S=m.index,o=t.oxw();t.Udp("width",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.StickerWidth)+"px")("height",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.StickerHeight)+"px")("margin-right",(S+1)%o.totalStickerPerRow==0?0:(null==o.selectedPaperFormat?null:o.selectedPaperFormat.ColumnSpacing)+"px")("margin-bottom",S>=o.productPreview.length-o.lastIndex?0:(null==o.selectedPaperFormat?null:o.selectedPaperFormat.RowSpacing)+"px"),t.xp6(2),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.BarcodeVisible),t.xp6(2),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.CodeVisible),t.xp6(1),t.Q6J("ngIf",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.NameVisible)&&(null==o.selectedPaperFormat?null:o.selectedPaperFormat.MoveProductNameOnTop)),t.xp6(1),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.PriceVisible),t.xp6(1),t.Q6J("ngIf",(null==o.selectedPaperFormat?null:o.selectedPaperFormat.NameVisible)&&!(null!=o.selectedPaperFormat&&o.selectedPaperFormat.MoveProductNameOnTop)),t.xp6(1),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.ShowReleasedDate),t.xp6(1),t.Q6J("ngIf",null==o.selectedPaperFormat?null:o.selectedPaperFormat.ShowPriceDiscount),t.xp6(1),t.Q6J("ngIf",0==(null==o.selectedPaperFormat?null:o.selectedPaperFormat.Orientation)),t.xp6(1),t.Q6J("ngIf",o.selectedPaperFormat.PricebookVisible),t.xp6(1),t.Q6J("ngIf",1==(null==o.selectedPaperFormat?null:o.selectedPaperFormat.Orientation))}}let St=(()=>{var g;class m{constructor(o,u,_,V,W,te,re){this.dialog=o,this.productStateService=u,this.productService=_,this.barcodeService=V,this.toastService=W,this.authService=te,this.route=re,this.paperFormatOptions=[],this.optionSelected={id:1,name:"Continuous - 3 Column"},this.paperFormats=[],this.totalStickerPerRow=0,this.lastIndex=0,this.destroy$=new y.x,this.productPreview=[],this.taxs=[];const ie=this.route.snapshot.queryParams?.ID;ie&&this.productService.getProductById(ie).pipe((0,X.b)(ve=>this.productStateService.setState([ve]))).subscribe(),(()=>{const ve=localStorage.getItem("Token");if(n.gT.IsNotEmpty(ve)){var We=n.gT.parseJwt(ve);this.outletView=We["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"].includes("Out")}})()}ngOnInit(){this.getPaperFormats(),this.checkAuthTax(),this.subscribeToObsproducts()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}checkAuthTax(){this.authService.getRoles().find(_=>"StpE"===_)?(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.paperFormat&&(this.paperFormats=o.paperFormat,this.outlets=o.outlets,this.setSelectedPaperFormat(o.paperFormat[0]),this.initOptionFormat(),this.initOptionSelected(this.selectedPaperFormat))},error:o=>{console.error(o)}})}initOptionFormat(){this.paperFormatOptions=[],this.paperFormats.forEach((o,u)=>{this.paperFormatOptions=[...this.paperFormatOptions,{id:u+1,name:o.Name}]})}initOptionSelected(o){this.optionSelected=this.paperFormatOptions.find(u=>u.name===o.Name)}openSettingModal(){this.dialog.open(Ie,{width:"850px",data:{paperFormat:this.selectedPaperFormat,taxs:this.taxs,authTax:this.authTax,outlets:this.outlets,outletRole:this.outletView}}).afterClosed().pipe((0,l.R)(this.destroy$)).subscribe(o=>{o&&this.selectedPaperFormat&&(this.updatePaperFormatSource(o),this.updatePaperFormat(),this.setSelectedPaperFormat(o))})}onSelectPaperFormat(){this.getPaperFormatBarcode()}getPaperFormatBarcode(){let u=this.findPaperFormatByName(this.optionSelected.name);this.setSelectedPaperFormat(u)}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(_=>_.Name==o)}updatePaperFormatSource(o){this.paperFormats=this.paperFormats.map(u=>(o.Name===u.Name&&(u=o),u))}getPPnVal(o){this.tax=o.TaxType?o.TaxType.Rate:null}relayout(){let o=this.selectedPaperFormat?.PaperWidth?this.selectedPaperFormat?.PaperWidth:0,u=this.selectedPaperFormat?.StickerWidth?this.selectedPaperFormat?.StickerWidth:0,_=this.selectedPaperFormat?.ColumnSpacing?this.selectedPaperFormat?.ColumnSpacing:0,W=Math.floor((o+_)/(u+_));this.totalStickerPerRow=W;let re=Math.floor(this.productPreview.length/W),ie=this.productPreview.length-re*W;this.lastIndex=0===ie?W:ie,this.productPreview=this.productPreview.map(pe=>(pe.setBarcodeTitle=this.selectedPaperFormat?.DescriptionAsCode&&pe.getDescription?pe.getDescription:pe.getCode,pe))}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(p.uw),t.Y36(L),t.Y36(ue),t.Y36(he),t.Y36(Ge._W),t.Y36(T.$),t.Y36(F.gz))},g.\u0275cmp=t.Xpm({type:g,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,"p-2"],[4,"ngFor","ngForOf"],[1,"d-flex","align-items-center","justify-content-between","fw-bold"],[1,"mx-1"],[1,"d-flex","align-items-center"],[1,"h-100"],[1,"vertical-text"]],template:function(o,u){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 u.optionSelected=V})("change",function(){return u.onSelectPaperFormat()}),t.qZA(),t.TgZ(9,"button",7),t.NdJ("click",function(){return u.openSettingModal()}),t._UZ(10,"i",8),t.qZA()()(),t.TgZ(11,"div",9)(12,"div",10)(13,"ul",11),t.YNc(14,bt,13,18,"li",12),t.qZA()()()()),2&o&&(t.xp6(8),t.Q6J("items",u.paperFormatOptions)("ngModel",u.optionSelected)("clearable",!1),t.xp6(4),t.Udp("width",(null==u.selectedPaperFormat?null:u.selectedPaperFormat.PaperWidth)+"px")("margin-top",(null==u.selectedPaperFormat?null:u.selectedPaperFormat.MarginTop)+"px")("margin-left",(null==u.selectedPaperFormat?null:u.selectedPaperFormat.MarginLeft)+"px"),t.xp6(2),t.Q6J("ngForOf",u.productPreview))},dependencies:[x.sg,x.O5,b.JJ,b.On,U.w9,nt,x.OU,x.JJ,x.uU,Ee],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;top:0%;text-align:center}"]}),m})(),Pt=(()=>{var g;class m{constructor(o,u,_){this.variantServiceState=o,this.authService=u,this.queryParamService=_,this.domainName=localStorage.getItem("Domain")}onLogout(){this.variantServiceState.setState([]),this.queryParamService.setState(null),this.authService.logout()}}return(g=m).\u0275fac=function(o){return new(o||g)(t.Y36(L),t.Y36(T.$),t.Y36(D.U))},g.\u0275cmp=t.Xpm({type:g,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,u){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 u.onLogout()}),t._UZ(18,"span",14),t._uU(19,"\xa0Logout"),t.qZA()()()()()),2&o&&(t.xp6(15),t.MGl("href","https://",u.domainName,"",t.LSH),t.xp6(1),t.Oqu(u.domainName))},dependencies:[qe,St],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%}}"]}),m})();var wt=E(4007);const Ot=[{path:"",component:Pt}];let Et=(()=>{var g;class m{}return(g=m).\u0275fac=function(o){return new(o||g)},g.\u0275mod=t.oAB({type:g}),g.\u0275inj=t.cJS({imports:[x.ez,wt.m,je,Oe,oe,F.Bz.forChild(Ot)]}),m})()},6608:function(J){var E;E=()=>(()=>{var x={d:(s,k)=>{for(var R in k)x.o(k,R)&&!x.o(s,R)&&Object.defineProperty(s,R,{enumerable:!0,get:k[R]})},o:(s,k)=>Object.prototype.hasOwnProperty.call(s,k)},F={};x.d(F,{default:()=>ht});var t={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(t.allowedTagList),Object.defineProperty(t,"allowedTagList",{configurable:!1,writable:!1}),t.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(t.fromCharCodeKeyCode),Object.defineProperty(t,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),t.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(t.keyName._allFnKeys),Object.freeze(t.keyName._someNonPrintableKeys),Object.freeze(t.keyName._directionKeys),Object.freeze(t.keyName),Object.defineProperty(t,"keyName",{configurable:!1,writable:!1}),Object.freeze(t);const v=t;function M(s){return function(k){if(Array.isArray(k))return y(k)}(s)||function(k){if(typeof Symbol<"u"&&null!=k[Symbol.iterator]||null!=k["@@iterator"])return Array.from(k)}(s)||D(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 L(){return L=Object.assign?Object.assign.bind():function(s){for(var k=1;k<arguments.length;k++){var R=arguments[k];for(var B in R)Object.prototype.hasOwnProperty.call(R,B)&&(s[B]=R[B])}return s},L.apply(this,arguments)}function T(s,k){return function(R){if(Array.isArray(R))return R}(s)||function(R,B){var e=null==R?null:typeof Symbol<"u"&&R[Symbol.iterator]||R["@@iterator"];if(null!=e){var i,a,r,h,O=[],C=!0,A=!1;try{if(r=(e=e.call(R)).next,0===B){if(Object(e)!==e)return;C=!1}else for(;!(C=(i=r.call(e)).done)&&(O.push(i.value),O.length!==B);C=!0);}catch(Z){A=!0,a=Z}finally{try{if(!C&&null!=e.return&&(h=e.return(),Object(h)!==h))return}finally{if(A)throw a}}return O}}(s,k)||D(s,k)||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 D(s,k){if(s){if("string"==typeof s)return y(s,k);var R=Object.prototype.toString.call(s).slice(8,-1);return"Object"===R&&s.constructor&&(R=s.constructor.name),"Map"===R||"Set"===R?Array.from(s):"Arguments"===R||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R)?y(s,k):void 0}}function y(s,k){(null==k||k>s.length)&&(k=s.length);for(var R=0,B=new Array(k);R<k;R++)B[R]=s[R];return B}function l(s){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}function c(s,k){for(var R=0;R<k.length;R++){var B=k[R];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==l(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==l(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===l(i)?i:String(i)),B)}var i}var n=function(){function s(){!function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}(this,s)}var k,B;return k=s,B=[{key:"isNull",value:function(e){return null===e}},{key:"isUndefined",value:function(e){return void 0===e}},{key:"isUndefinedOrNullOrEmpty",value:function(e){return null==e||""===e}},{key:"isString",value:function(e){return"string"==typeof e||e instanceof String}},{key:"isEmptyString",value:function(e){return""===e}},{key:"isBoolean",value:function(e){return"boolean"==typeof e}},{key:"isTrueOrFalseString",value:function(e){var i=String(e).toLowerCase();return"true"===i||"false"===i}},{key:"isObject",value:function(e){return"object"===l(e)&&null!==e&&!Array.isArray(e)}},{key:"isEmptyObj",value:function(e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))return!1;return!0}},{key:"isNumberStrict",value:function(e){return"number"==typeof e}},{key:"isNumber",value:function(e){return!this.isArray(e)&&!isNaN(parseFloat(e))&&isFinite(e)}},{key:"isDigit",value:function(e){return/\d/.test(e)}},{key:"isNumberOrArabic",value:function(e){var i=this.arabicToLatinNumbers(e,!1,!0,!0);return this.isNumber(i)}},{key:"isInt",value:function(e){return"number"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)}},{key:"isFunction",value:function(e){return"function"==typeof e}},{key:"contains",value:function(e,i){return!(!this.isString(e)||!this.isString(i)||""===e||""===i)&&-1!==e.indexOf(i)}},{key:"isInArray",value:function(e,i){return!(!this.isArray(i)||i===[]||this.isUndefined(e))&&-1!==i.indexOf(e)}},{key:"isArray",value:function(e){if("[object Array]"===Object.prototype.toString.call([]))return Array.isArray(e)||"object"===l(e)&&"[object Array]"===Object.prototype.toString.call(e);throw new Error("toString message changed for Object Array")}},{key:"isElement",value:function(e){return typeof Element<"u"&&e instanceof Element}},{key:"isInputElement",value:function(e){return this.isElement(e)&&"input"===e.tagName.toLowerCase()}},{key:"decimalPlaces",value:function(e){var i=T(e.split("."),2)[1];return this.isUndefined(i)?0:i.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(e){var i=T(String(Math.abs(e)).split("."),2)[1];if(this.isUndefined(i))return 0;var a=i.lastIndexOf("0");return-1===a?a=0:a+=2,a}},{key:"keyCodeNumber",value:function(e){return void 0===e.which?e.keyCode:e.which}},{key:"character",value:function(e){var i;if("Unidentified"===e.key||void 0===e.key||this.isSeleniumBot()){var a=this.keyCodeNumber(e);if(229===a)return v.keyName.AndroidDefault;var r=v.fromCharCodeKeyCode[a];i=s.isUndefinedOrNullOrEmpty(r)?String.fromCharCode(a):r}else switch(e.key){case"Add":i=v.keyName.NumpadPlus;break;case"Apps":i=v.keyName.ContextMenu;break;case"Crsel":i=v.keyName.CrSel;break;case"Decimal":i=e.char?e.char:v.keyName.NumpadDot;break;case"Del":i=v.keyName.Delete;break;case"Divide":i=v.keyName.NumpadSlash;break;case"Down":i=v.keyName.DownArrow;break;case"Esc":i=v.keyName.Esc;break;case"Exsel":i=v.keyName.ExSel;break;case"Left":i=v.keyName.LeftArrow;break;case"Meta":case"Super":i=v.keyName.OSLeft;break;case"Multiply":i=v.keyName.NumpadMultiply;break;case"Right":i=v.keyName.RightArrow;break;case"Spacebar":i=v.keyName.Space;break;case"Subtract":i=v.keyName.NumpadMinus;break;case"Up":i=v.keyName.UpArrow;break;default:i=e.key}return i}},{key:"browser",value:function(){var e,i=navigator.userAgent,a=i.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(a[1])?{name:"ie",version:(e=/\brv[ :]+(\d+)/g.exec(i)||[])[1]||""}:"Chrome"===a[1]&&null!==(e=i.match(/\b(OPR|Edge)\/(\d+)/))?{name:e[1].replace("OPR","opera"),version:e[2]}:(a=a[2]?[a[1],a[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(e=i.match(/version\/(\d+)/i))&&a.splice(1,1,e[1]),{name:a[0].toLowerCase(),version:a[1]})}},{key:"isSeleniumBot",value:function(){return!0===window.navigator.webdriver}},{key:"isNegative",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e===i||""!==e&&(s.isNumber(e)?e<0:a?this.contains(e,i):this.isNegativeStrict(e,i))}},{key:"isNegativeStrict",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.charAt(0)===i}},{key:"isNegativeWithBrackets",value:function(e,i,a){return e.charAt(0)===i&&this.contains(e,a)}},{key:"isZeroOrHasNoValue",value:function(e){return!/[1-9]/g.test(e)}},{key:"setRawNegativeSign",value:function(e){return this.isNegativeStrict(e,"-")?e:"-".concat(e)}},{key:"replaceCharAt",value:function(e,i,a){return"".concat(e.substr(0,i)).concat(a).concat(e.substr(i+a.length))}},{key:"clampToRangeLimits",value:function(e,i){return Math.max(i.minimumValue,Math.min(i.maximumValue,e))}},{key:"countNumberCharactersOnTheCaretLeftSide",value:function(e,i,a){for(var r=new RegExp("[0-9".concat(a,"-]")),h=0,O=0;O<i;O++)r.test(e[O])&&h++;return h}},{key:"findCaretPositionInFormattedNumber",value:function(e,i,a,r){var h,O=a.length,C=e.length,A=0;for(h=0;h<O&&A<C&&A<i;h++)(e[A]===a[h]||"."===e[A]&&a[h]===r)&&A++;return h}},{key:"countCharInText",value:function(e,i){for(var a=0,r=0;r<i.length;r++)i[r]===e&&a++;return a}},{key:"convertCharacterCountToIndexPosition",value:function(e){return Math.max(e,e-1)}},{key:"getElementSelection",value:function(e){var i,a={};try{i=this.isUndefined(e.selectionStart)}catch{i=!1}try{if(i){var r=window.getSelection().getRangeAt(0);a.start=r.startOffset,a.end=r.endOffset,a.length=a.end-a.start}else a.start=e.selectionStart,a.end=e.selectionEnd,a.length=a.end-a.start}catch{a.start=0,a.end=0,a.length=0}return a}},{key:"setElementSelection",value:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(this.isUndefinedOrNullOrEmpty(a)&&(a=i),this.isInputElement(e))e.setSelectionRange(i,a);else if(!s.isNull(e.firstChild)){var r=document.createRange();r.setStart(e.firstChild,i),r.setEnd(e.firstChild,a);var h=window.getSelection();h.removeAllRanges(),h.addRange(r)}}},{key:"throwError",value:function(e){throw new Error(e)}},{key:"warning",value:function(e){(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&console.warn("Warning: ".concat(e))}},{key:"isWheelEvent",value:function(e){return e instanceof WheelEvent}},{key:"isWheelUpEvent",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),e.deltaY<0}},{key:"isWheelDownEvent",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),e.deltaY>0}},{key:"forceDecimalPlaces",value:function(e,i){var a=T(String(e).split("."),2),h=a[1];return h?"".concat(a[0],".").concat(h.substr(0,i)):e}},{key:"roundToNearest",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return 0===e?0:(0===i&&this.throwError("The `stepPlace` used to round is equal to `0`. This value must not be equal to zero."),Math.round(e/i)*i)}},{key:"modifyAndRoundToNearestAuto",value:function(e,i,a){e=Number(this.forceDecimalPlaces(e,a));var r=Math.abs(e);if(r>=0&&r<1){var h,O=Math.pow(10,-a);if(0===e)return i?O:-O;var A=a,Z=this.indexFirstNonZeroDecimalPlace(e);return h=Z>=A-1?O:Math.pow(10,-(Z+1)),this.roundToNearest(i?e+h:e-h,h)}e=parseInt(e,10);var f,I=Math.abs(e).toString().length;switch(I){case 1:f=0;break;case 2:case 3:f=1;break;case 4:case 5:f=2;break;default:f=I-3}var j,q=Math.pow(10,f);return(j=i?e+q:e-q)<=10&&j>=-10?j:this.roundToNearest(j,q)}},{key:"addAndRoundToNearestAuto",value:function(e,i){return this.modifyAndRoundToNearestAuto(e,!0,i)}},{key:"subtractAndRoundToNearestAuto",value:function(e,i){return this.modifyAndRoundToNearestAuto(e,!1,i)}},{key:"arabicToLatinNumbers",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.isNull(e))return e;var h=e.toString();if(""===h)return e;if(null===h.match(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06f4\u06f5\u06f6]/g))return i&&(h=Number(h)),h;a&&(h=h.replace(/\u066b/,".")),r&&(h=h.replace(/\u066c/g,"")),h=h.replace(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669]/g,function(C){return C.charCodeAt(0)-1632}).replace(/[\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9]/g,function(C){return C.charCodeAt(0)-1776});var O=Number(h);return isNaN(O)?O:(i&&(h=O),h)}},{key:"triggerEvent",value:function(e){var i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,h=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],O=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];window.CustomEvent?i=new CustomEvent(e,{detail:r,bubbles:h,cancelable:O}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,h,O,{detail:r}),a.dispatchEvent(i)}},{key:"parseStr",value:function(e){var i,a,r,h,O={};if(0===e&&1/e<0&&(e="-0"),e=e.toString(),this.isNegativeStrict(e,"-")?(e=e.slice(1),O.s=-1):O.s=1,(i=e.indexOf("."))>-1&&(e=e.replace(".","")),i<0&&(i=e.length),(a=-1===e.search(/[1-9]/i)?e.length:e.search(/[1-9]/i))===(r=e.length))O.e=0,O.c=[0];else{for(h=r-1;"0"===e.charAt(h);h-=1)r-=1;for(r-=1,O.e=i-a-1,O.c=[],i=0;a<=r;a+=1)O.c[i]=+e.charAt(a),i+=1}return O}},{key:"testMinMax",value:function(e,i){var a=i.c,r=e.c,h=i.s,O=e.s,C=i.e,A=e.e;if(!a[0]||!r[0])return a[0]?h:r[0]?-O:0;if(h!==O)return h;var Z=h<0;if(C!==A)return C>A^Z?1:-1;for(h=-1,O=(C=a.length)<(A=r.length)?C:A,h+=1;h<O;h+=1)if(a[h]!==r[h])return a[h]>r[h]^Z?1:-1;return C===A?0:C>A^Z?1:-1}},{key:"randomString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;return Math.random().toString(36).substr(2,e)}},{key:"domElement",value:function(e){return s.isString(e)?document.querySelector(e):e}},{key:"getElementValue",value:function(e){return"input"===e.tagName.toLowerCase()?e.value:this.text(e)}},{key:"setElementValue",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;"input"===e.tagName.toLowerCase()?e.value=i:e.textContent=i}},{key:"setInvalidState",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Invalid";(""===i||this.isNull(i))&&this.throwError("Cannot set the invalid state with an empty message."),e.setCustomValidity(i)}},{key:"setValidState",value:function(e){e.setCustomValidity("")}},{key:"cloneObject",value:function(e){return L({},e)}},{key:"camelize",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(this.isNull(e))return null;a&&(e=e.replace(/^data-/,""));var h=e.split(i).map(function(O){return"".concat(O.charAt(0).toUpperCase()).concat(O.slice(1))});return h=h.join(""),r&&(h="".concat(h.charAt(0).toLowerCase()).concat(h.slice(1))),h}},{key:"text",value:function(e){var i=e.nodeType;return i===Node.ELEMENT_NODE||i===Node.DOCUMENT_NODE||i===Node.DOCUMENT_FRAGMENT_NODE?e.textContent:i===Node.TEXT_NODE?e.nodeValue:""}},{key:"setText",value:function(e,i){var a=e.nodeType;a!==Node.ELEMENT_NODE&&a!==Node.DOCUMENT_NODE&&a!==Node.DOCUMENT_FRAGMENT_NODE||(e.textContent=i)}},{key:"filterOut",value:function(e,i){var a=this;return e.filter(function(r){return!a.isInArray(r,i)})}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(e){if(""===(e=String(e)))return"";var i=T(e.split("."),2),a=i[0],r=i[1];if(this.isUndefinedOrNullOrEmpty(r))return a;var h=r.replace(/0+$/g,"");return""===h?a:"".concat(a,".").concat(h)}},{key:"getHoveredElement",value:function(){var e=M(document.querySelectorAll(":hover"));return e[e.length-1]}},{key:"arrayTrim",value:function(e,i){var a=e.length;return 0===a||i>a?e:i<0?[]:(e.length=parseInt(i,10),e)}},{key:"arrayUnique",value:function(){var e;return M(new Set((e=[]).concat.apply(e,arguments)))}},{key:"mergeMaps",value:function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];return new Map(i.reduce(function(r,h){return r.concat(M(h))},[]))}},{key:"objectKeyLookup",value:function(e,i){var a=Object.entries(e).find(function(h){return h[1]===i}),r=null;return void 0!==a&&(r=a[0]),r}},{key:"insertAt",value:function(e,i,a){if(a>(e=String(e)).length)throw new Error("The given index is out of the string range.");if(1!==i.length)throw new Error("The given string `char` should be only one character long.");return""===e&&0===a?i:"".concat(e.slice(0,a)).concat(i).concat(e.slice(a))}},{key:"scientificToDecimal",value:function(e){var i=Number(e);if(isNaN(i))return NaN;if(e=String(e),!this.contains(e,"e")&&!this.contains(e,"E"))return e;var a=T(e.split(/e/i),2),r=a[0],h=a[1],O=r<0;O&&(r=r.replace("-",""));var C=+h<0;C&&(h=h.replace("-",""));var A,Z=T(r.split(/\./),2),f=Z[0],I=Z[1];return C?(A=f.length>h?this.insertAt(f,".",f.length-h):"0.".concat("0".repeat(h-f.length)).concat(f),A="".concat(A).concat(I||"")):I?(r="".concat(f).concat(I),A=h<I.length?this.insertAt(r,".",+h+f.length):"".concat(r).concat("0".repeat(h-I.length))):(r=r.replace(".",""),A="".concat(r).concat("0".repeat(Number(h)))),O&&(A="-".concat(A)),A}}],B&&c(k,B),Object.defineProperty(k,"prototype",{writable:!1}),s}();function d(s){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}var w=function(){function s(e){if(function(i,a){if(!(i instanceof a))throw new TypeError("Cannot call a class as a function")}(this,s),null===e)throw new Error("Invalid AST")}var k,R;return k=s,(R=[{key:"evaluate",value:function(e){if(null==e)throw new Error("Invalid AST sub-tree");if("number"===e.type)return e.value;if("unaryMinus"===e.type)return-this.evaluate(e.left);var i=this.evaluate(e.left),a=this.evaluate(e.right);switch(e.type){case"op_+":return Number(i)+Number(a);case"op_-":return i-a;case"op_*":return i*a;case"op_/":return i/a;default:throw new Error("Invalid operator '".concat(e.type,"'"))}}}])&&function p(s,k){for(var R=0;R<k.length;R++){var B=k[R];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==d(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==d(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===d(i)?i:String(i)),B)}var i}(k.prototype,R),Object.defineProperty(k,"prototype",{writable:!1}),s}();function b(s){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}function U(s,k){for(var R=0;R<k.length;R++){var B=k[R];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==b(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==b(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===b(i)?i:String(i)),B)}var i}var z=function(){function s(){!function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}(this,s)}var k,B;return k=s,(B=[{key:"createNode",value:function(e,i,a){var r=new s;return r.type=e,r.left=i,r.right=a,r}},{key:"createUnaryNode",value:function(e){var i=new s;return i.type="unaryMinus",i.left=e,i.right=null,i}},{key:"createLeaf",value:function(e){var i=new s;return i.type="number",i.value=e,i}}])&&U(k,B),Object.defineProperty(k,"prototype",{writable:!1}),s}();function G(s){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}function X(s,k){for(var R=0;R<k.length;R++){var B=k[R];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==G(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==G(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===G(i)?i:String(i)),B)}var i}var de=function fe(s,k,R){return k&&X(s.prototype,k),R&&X(s,R),Object.defineProperty(s,"prototype",{writable:!1}),s}(function s(k,R,B){(function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")})(this,s),this.type=k,this.value=R,this.symbol=B});function he(s){return(he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}var Ne=function(){function s(e){(function(i,a){if(!(i instanceof a))throw new TypeError("Cannot call a class as a function")})(this,s),this.text=e,this.textLength=e.length,this.index=0,this.token=new de("Error",0,0)}var k,R;return k=s,R=[{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(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".";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(e),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(e){this._skipSpaces();for(var i=this.index;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===e&&this.index++;this.index<=this.textLength&&n.isDigit(this.text[this.index]);)this.index++;if(this.index===i)throw new Error("No number has been found while it was expected");return this.text.substring(i,this.index).replace(e,".")}}],R&&function Te(s,k){for(var R=0;R<k.length;R++){var B=k[R];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==he(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==he(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===he(i)?i:String(i)),B)}var i}(k.prototype,R),Object.defineProperty(k,"prototype",{writable:!1}),s}();function Q(s){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}var ne=function(){function s(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".";return function(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}(this,s),this.text=e,this.decimalCharacter=i,this.lexer=new Ne(e),this.token=this.lexer.getNextToken(this.decimalCharacter),this._exp()}var k,R;return k=s,(R=[{key:"_exp",value:function(){var e=this._term(),i=this._moreExp();return z.createNode("op_+",e,i)}},{key:"_moreExp",value:function(){var e,i;switch(this.token.type){case"+":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),i=this._moreExp(),z.createNode("op_+",i,e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),i=this._moreExp(),z.createNode("op_-",i,e)}return z.createLeaf(0)}},{key:"_term",value:function(){var e=this._factor(),i=this._moreTerms();return z.createNode("op_*",e,i)}},{key:"_moreTerms",value:function(){var e,i;switch(this.token.type){case"*":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),i=this._moreTerms(),z.createNode("op_*",i,e);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),i=this._moreTerms(),z.createNode("op_/",i,e)}return z.createLeaf(1)}},{key:"_factor",value:function(){var e,i,a;switch(this.token.type){case"num":return a=this.token.value,this.token=this.lexer.getNextToken(this.decimalCharacter),z.createLeaf(a);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),i=this._factor(),z.createUnaryNode(i);case"(":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._exp(),this._match(")"),e;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(e){var i=this.lexer.getIndex()-1;if(this.text[i]!==e)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(i,"' in the match function"));this.token=this.lexer.getNextToken(this.decimalCharacter)}}])&&function ee(s,k){for(var R=0;R<k.length;R++){var B=k[R];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,(i=function(a,r){if("object"!==Q(a)||null===a)return a;var h=a[Symbol.toPrimitive];if(void 0!==h){var O=h.call(a,"string");if("object"!==Q(O))return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(B.key),"symbol"===Q(i)?i:String(i)),B)}var i}(k.prototype,R),Object.defineProperty(k,"prototype",{writable:!1}),s}();function Y(s){return function(k){if(Array.isArray(k))return Pe(k)}(s)||function(k){if(typeof Symbol<"u"&&null!=k[Symbol.iterator]||null!=k["@@iterator"])return Array.from(k)}(s)||le(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 K(s,k){return function(R){if(Array.isArray(R))return R}(s)||function(R,B){var e=null==R?null:typeof Symbol<"u"&&R[Symbol.iterator]||R["@@iterator"];if(null!=e){var i,a,r,h,O=[],C=!0,A=!1;try{if(r=(e=e.call(R)).next,0===B){if(Object(e)!==e)return;C=!1}else for(;!(C=(i=r.call(e)).done)&&(O.push(i.value),O.length!==B);C=!0);}catch(Z){A=!0,a=Z}finally{try{if(!C&&null!=e.return&&(h=e.return(),Object(h)!==h))return}finally{if(A)throw a}}return O}}(s,k)||le(s,k)||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 le(s,k){if(s){if("string"==typeof s)return Pe(s,k);var R=Object.prototype.toString.call(s).slice(8,-1);return"Object"===R&&s.constructor&&(R=s.constructor.name),"Map"===R||"Set"===R?Array.from(s):"Arguments"===R||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R)?Pe(s,k):void 0}}function Pe(s,k){(null==k||k>s.length)&&(k=s.length);for(var R=0,B=new Array(k);R<k;R++)B[R]=s[R];return B}function ce(){return ce=Object.assign?Object.assign.bind():function(s){for(var k=1;k<arguments.length;k++){var R=arguments[k];for(var B in R)Object.prototype.hasOwnProperty.call(R,B)&&(s[B]=R[B])}return s},ce.apply(this,arguments)}function ue(s){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k})(s)}function Ke(s,k){for(var R=0;R<k.length;R++){var B=k[R];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(s,Ae(B.key),B)}}function xe(s,k,R){return(k=Ae(k))in s?Object.defineProperty(s,k,{value:R,enumerable:!0,configurable:!0,writable:!0}):s[k]=R,s}function Ae(s){var k=function(R,B){if("object"!==ue(R)||null===R)return R;var e=R[Symbol.toPrimitive];if(void 0!==e){var i=e.call(R,"string");if("object"!==ue(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(R)}(s);return"symbol"===ue(k)?k:String(k)}var _e,N=function(){function s(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(f,I){if(!(f instanceof I))throw new TypeError("Cannot call a class as a function")}(this,s);var h=s._setArgumentsValues(i,a,r),C=h.initialValue,A=h.userOptions;if(this.domElement=h.domElement,this.defaultRawValue="",this._setSettings(A,!1),this._checkElement(),this.savedCancellableValue=null,this.historyTable=[],this.historyTableIndex=-1,this.onGoingRedo=!1,this.parentForm=this._getParentForm(),!this.runOnce&&this.settings.formatOnPageLoad)this._formatDefaultValueOnPageLoad(C);else{var Z;if(n.isNull(C))switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.min:Z=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:Z=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:Z="0";break;case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:Z="";break;case s.options.emptyInputBehavior.null:Z=null;break;default:Z=this.settings.emptyInputBehavior}else Z=C;this._setElementAndRawValue(Z)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(C),this.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(f){var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e.autoNumericLocalList.forEach(function(j){j.set(f,I)})},setUnformatted:function(f){var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e.autoNumericLocalList.forEach(function(j){j.setUnformatted(f,I)})},get:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=[];return e.autoNumericLocalList.forEach(function(j){I.push(j.get())}),e._executeCallback(I,f),I},getNumericString:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=[];return e.autoNumericLocalList.forEach(function(j){I.push(j.getNumericString())}),e._executeCallback(I,f),I},getFormatted:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=[];return e.autoNumericLocalList.forEach(function(j){I.push(j.getFormatted())}),e._executeCallback(I,f),I},getNumber:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=[];return e.autoNumericLocalList.forEach(function(j){I.push(j.getNumber())}),e._executeCallback(I,f),I},getLocalized:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=[];return e.autoNumericLocalList.forEach(function(j){I.push(j.getLocalized())}),e._executeCallback(I,f),I},reformat:function(){e.autoNumericLocalList.forEach(function(f){f.reformat()})},unformat:function(){e.autoNumericLocalList.forEach(function(f){f.unformat()})},unformatLocalized:function(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e.autoNumericLocalList.forEach(function(I){I.unformatLocalized(f)})},update:function(){for(var f=arguments.length,I=new Array(f),j=0;j<f;j++)I[j]=arguments[j];e.autoNumericLocalList.forEach(function(q){q.update.apply(q,I)})},isPristine:function(){var f=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],I=!0;return e.autoNumericLocalList.forEach(function(j){I&&!j.isPristine(f)&&(I=!1)}),I},clear:function(){var f=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.autoNumericLocalList.forEach(function(I){I.clear(f)})},remove:function(){e.autoNumericLocalList.forEach(function(f){f.remove()})},wipe:function(){e.autoNumericLocalList.forEach(function(f){f.wipe()})},nuke:function(){e.autoNumericLocalList.forEach(function(f){f.nuke()})},has:function(f){return e.autoNumericLocalList.has(f instanceof s?f.node():f)},addObject:function(f){var I,j;f instanceof s?(I=f.node(),j=f):j=s.getAutoNumericElement(I=f),e._hasLocalList()||e._createLocalList();var q,H=j._getLocalList();0===H.size&&(j._createLocalList(),H=j._getLocalList()),H instanceof Map?q=n.mergeMaps(e._getLocalList(),H):(e._addToLocalList(I,j),q=e._getLocalList()),q.forEach(function($){$._setLocalList(q)})},removeObject:function(f){var I,j,q=arguments.length>1&&void 0!==arguments[1]&&arguments[1];f instanceof s?(I=f.node(),j=f):j=s.getAutoNumericElement(I=f);var H=e.autoNumericLocalList;e.autoNumericLocalList.delete(I),H.forEach(function($){$._setLocalList(e.autoNumericLocalList)}),q||I!==e.node()?j._createLocalList():j._setLocalList(new Map)},empty:function(){var f=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.autoNumericLocalList.forEach(function(I){f?I._createLocalList():I._setLocalList(new Map)})},elements:function(){var f=[];return e.autoNumericLocalList.forEach(function(I){f.push(I.node())}),f},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(f){return e.update({allowDecimalPadding:f}),e},alwaysAllowDecimalCharacter:function(f){return e.update({alwaysAllowDecimalCharacter:f}),e},caretPositionOnFocus:function(f){return e.settings.caretPositionOnFocus=f,e},createLocalList:function(f){return e.settings.createLocalList=f,e.settings.createLocalList?e._hasLocalList()||e._createLocalList():e._deleteLocalList(),e},currencySymbol:function(f){return e.update({currencySymbol:f}),e},currencySymbolPlacement:function(f){return e.update({currencySymbolPlacement:f}),e},decimalCharacter:function(f){return e.update({decimalCharacter:f}),e},decimalCharacterAlternative:function(f){return e.settings.decimalCharacterAlternative=f,e},decimalPlaces:function(f){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:f}),e},decimalPlacesRawValue:function(f){return e.update({decimalPlacesRawValue:f}),e},decimalPlacesShownOnBlur:function(f){return e.update({decimalPlacesShownOnBlur:f}),e},decimalPlacesShownOnFocus:function(f){return e.update({decimalPlacesShownOnFocus:f}),e},defaultValueOverride:function(f){return e.update({defaultValueOverride:f}),e},digitalGroupSpacing:function(f){return e.update({digitalGroupSpacing:f}),e},digitGroupSeparator:function(f){return e.update({digitGroupSeparator:f}),e},divisorWhenUnfocused:function(f){return e.update({divisorWhenUnfocused:f}),e},emptyInputBehavior:function(f){return null===e.rawValue&&f!==s.options.emptyInputBehavior.null&&(n.warning("You are trying to modify the `emptyInputBehavior` option to something different than `'null'` (".concat(f,"), 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:f}),e},eventBubbles:function(f){return e.settings.eventBubbles=f,e},eventIsCancelable:function(f){return e.settings.eventIsCancelable=f,e},failOnUnknownOption:function(f){return e.settings.failOnUnknownOption=f,e},formatOnPageLoad:function(f){return e.settings.formatOnPageLoad=f,e},formulaMode:function(f){return e.settings.formulaMode=f,e},historySize:function(f){return e.settings.historySize=f,e},invalidClass:function(f){return e.settings.invalidClass=f,e},isCancellable:function(f){return e.settings.isCancellable=f,e},leadingZero:function(f){return e.update({leadingZero:f}),e},maximumValue:function(f){return e.update({maximumValue:f}),e},minimumValue:function(f){return e.update({minimumValue:f}),e},modifyValueOnUpDownArrow:function(f){return e.settings.modifyValueOnUpDownArrow=f,e},modifyValueOnWheel:function(f){return e.settings.modifyValueOnWheel=f,e},negativeBracketsTypeOnBlur:function(f){return e.update({negativeBracketsTypeOnBlur:f}),e},negativePositiveSignPlacement:function(f){return e.update({negativePositiveSignPlacement:f}),e},negativeSignCharacter:function(f){return e.update({negativeSignCharacter:f}),e},negativePositiveSignBehavior:function(f){return e.settings.negativePositiveSignBehavior=f,e},noEventListeners:function(f){return f===s.options.noEventListeners.noEvents&&e.settings.noEventListeners===s.options.noEventListeners.addEvents&&e._removeEventListeners(),e.update({noEventListeners:f}),e},onInvalidPaste:function(f){return e.settings.onInvalidPaste=f,e},outputFormat:function(f){return e.settings.outputFormat=f,e},overrideMinMaxLimits:function(f){return e.update({overrideMinMaxLimits:f}),e},positiveSignCharacter:function(f){return e.update({positiveSignCharacter:f}),e},rawValueDivisor:function(f){return e.update({rawValueDivisor:f}),e},readOnly:function(f){return e.settings.readOnly=f,e._setWritePermissions(),e},roundingMethod:function(f){return e.update({roundingMethod:f}),e},saveValueToSessionStorage:function(f){return e.update({saveValueToSessionStorage:f}),e},symbolWhenUnfocused:function(f){return e.update({symbolWhenUnfocused:f}),e},selectNumberOnly:function(f){return e.settings.selectNumberOnly=f,e},selectOnFocus:function(f){return e.settings.selectOnFocus=f,e},serializeSpaces:function(f){return e.settings.serializeSpaces=f,e},showOnlyNumbersOnFocus:function(f){return e.update({showOnlyNumbersOnFocus:f}),e},showPositiveSign:function(f){return e.update({showPositiveSign:f}),e},showWarnings:function(f){return e.settings.showWarnings=f,e},styleRules:function(f){return e.update({styleRules:f}),e},suffixText:function(f){return e.update({suffixText:f}),e},unformatOnHover:function(f){return e.settings.unformatOnHover=f,e},unformatOnSubmit:function(f){return e.settings.unformatOnSubmit=f,e},upDownStep:function(f){return e.settings.upDownStep=f,e},valuesToStrings:function(f){return e.update({valuesToStrings:f}),e},watchExternalChanges:function(f){return e.update({watchExternalChanges:f}),e},wheelOn:function(f){return e.settings.wheelOn=f,e},wheelStep:function(f){return e.settings.wheelStep=f,e}},this._triggerEvent(s.events.initialized,this.domElement,{newValue:n.getElementValue(this.domElement),newRawValue:this.rawValue,error:null,aNElement:this})}var k,R,B;return k=s,R=[{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()):e>1?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(){this._getFormElement(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null).dataset.anCount=1}},{key:"_incrementParentFormCounter",value:function(){this._getFormElement(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null).dataset.anCount++}},{key:"_decrementParentFormCounter",value:function(){this.parentForm.dataset.anCount--}},{key:"_hasFormHandlerFunction",value:function(){return"anFormHandler"in this._getFormElement(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null).dataset}},{key:"_getFormElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n.isNull(e)?this.parentForm:e}},{key:"_storeFormHandlerFunction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var i=n.randomString();this._getFormElement(e).dataset.anFormHandler=i,window.aNFormHandlerMap.set(i,{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(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&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,r=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return r.call(e.domElement)},set:function(h){a.call(e.domElement,h),e.settings.watchExternalChanges&&!e.internalModification&&e.set(h)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!n.isUndefined(this.getterSetter)){var i=this.getterSetter,a=i.set,r=i.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return r.call(e.domElement)},set:function(h){a.call(e.domElement,h)}})}}},{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 r=n.getElementSelection(this.domElement);this.selectionStart=r.start,this.selectionEnd=r.end,this.historyTable.push({value:this.rawValue,start:this.selectionStart+1,end:this.selectionEnd+1}),this.historyTable.length>1&&(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(){var e;if(arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?(e=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(e=this.historyTableIndex>0)&&this.historyTableIndex--,e){var i=this.historyTable[this.historyTableIndex];this.set(i.value,null,!1),n.setElementSelection(this.domElement,i.start,i.end)}}},{key:"_historyTableUndo",value:function(){this._historyTableUndoOrRedo(!0)}},{key:"_historyTableRedo",value:function(){this._historyTableUndoOrRedo(!1)}},{key:"_historyTableForget",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=[],a=0;a<e;a++)i.push(this.historyTable.shift()),this.historyTableIndex--,this.historyTableIndex<0&&(this.historyTableIndex=0);return 1===i.length?i[0]:i}},{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)||(this.rawValue>=0?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(i.classes.length>2){var a=i.callback(e.rawValue);n.isArray(a)?i.classes.forEach(function(r,h){n.isInArray(h,a)?e._addCSSClass(r):e._removeCSSClass(r)}):n.isInt(a)?i.classes.forEach(function(r,h){h===a?e._addCSSClass(r):e._removeCSSClass(r)}):n.isNull(a)?i.classes.forEach(function(r){e._removeCSSClass(r)}):n.throwError("The callback result is not an array nor a valid array index, ".concat(ue(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(ue(i.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),r=0;r<i;r++)a[r]=arguments[r];Array.isArray(a)&&Array.isArray(a[0])&&(a=a[0]);var h=n.cloneObject(this.settings),O=this.rawValue,C={};n.isUndefinedOrNullOrEmpty(a)||0===a.length?C=null:a.length>=1&&a.forEach(function(A){e.constructor._isPreDefinedOptionValid(A)&&(A=e.constructor._getOptionObject(A)),ce(C,A)});try{this._setSettings(C,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(O)}catch(A){return this._setSettings(h,!0),n.throwError("Unable to update the settings, those are invalid: [".concat(A,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,h=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];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(r)||this._setSettings(r,!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,h),this._saveValueToPersistentStorage(),this;if(i=this.constructor._toNumericValue(e,this.settings),isNaN(Number(i)))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("",h),this;if(""===i)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:i=0;break;case s.options.emptyInputBehavior.min:i=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:i=this.settings.maximumValue;break;default:n.isNumber(this.settings.emptyInputBehavior)&&(i=Number(this.settings.emptyInputBehavior))}if(""!==i){var O=K(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),C=O[0],A=O[1];if(C&&A&&this.settings.valuesToStrings&&this._checkValuesToStrings(i))return this._setElementAndRawValue(this.settings.valuesToStrings[i],i,h),this._saveValueToPersistentStorage(),this;if(n.isZeroOrHasNoValue(i)&&(i="0"),C&&A){var Z=this.constructor._roundRawValue(i,this.settings);return Z=this._trimLeadingAndTrailingZeros(Z.replace(this.settings.decimalCharacter,".")),i=this._getRawValueToFormat(i),this.isFocused?i=this.constructor._roundFormattedValueShownOnFocus(i,this.settings):(this.settings.divisorWhenUnfocused&&(i=(i/=this.settings.divisorWhenUnfocused).toString()),i=this.constructor._roundFormattedValueShownOnBlur(i,this.settings)),i=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(i,this.settings),i=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue,Z),!this.isFocused&&this.settings.symbolWhenUnfocused&&(i="".concat(i).concat(this.settings.symbolWhenUnfocused)),(this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._saveValueToPersistentStorage(),this._setElementAndRawValue(i,Z,h),this._setValidOrInvalidState(Z),this}return this._triggerRangeEvents(C,A),n.throwError("The value [".concat(i,"] 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("",h),this}return this._setElementAndRawValue(this.settings.emptyInputBehavior===s.options.emptyInputBehavior.always?this.settings.currencySymbol:"","",h),this}},{key:"setUnformatted",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===e||n.isUndefined(e))return this;n.isNull(i)||this._setSettings(i,!0);var a=this.constructor._removeBrackets(e,this.settings),r=this.constructor._stripAllNonNumberCharacters(a,this.settings,!0,this.isFocused);return n.isNumber(r)||n.throwError("The value is not a valid one, it's not a numeric string nor a recognized currency."),this.constructor._isWithinRangeWithOverrideOption(r,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){return this._setElementAndRawValue(e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]),this}},{key:"_setRawValue",value:function(e){var i=this,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.rawValue!==e){var r=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:r,newRawValue:this.rawValue,isPristine:this.isPristine(!0),error:null,aNElement:this}),this._parseStyleRules(),a&&window.requestAnimationFrame(function(){return i._historyTableAdd()})}}},{key:"_setElementValue",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=n.getElementValue(this.domElement);return e!==a&&(this.internalModification=!0,n.setElementValue(this.domElement,e),this.internalModification=!1,i&&this._triggerEvent(s.events.formatted,this.domElement,{oldValue:a,newValue:e,oldRawValue:this.rawValue,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this})),this}},{key:"_setElementAndRawValue",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return n.isNull(i)?i=e:n.isBoolean(i)&&(a=i,i=e),this._setElementValue(e),this._setRawValue(i,a),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){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;n.triggerEvent(e,i,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,this.settings.eventBubbles,this.settings.eventIsCancelable)}},{key:"get",value:function(){return this.getNumericString(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)}},{key:"getNumericString",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(this.rawValue)?null:n.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(e,i),e}},{key:"getFormatted",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;"value"in this.domElement||"textContent"in this.domElement||n.throwError("Unable to get the formatted string from the element.");var i=n.getElementValue(this.domElement);return this._executeCallback(i,e),i}},{key:"getNumber",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=null===this.rawValue?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(e,i),e}},{key:"getLocalized",value:function(){var e,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n.isFunction(a)&&n.isNull(r)&&(r=a,a=null),""!=(e=n.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))&&0===Number(e)&&this.settings.leadingZero!==s.options.leadingZero.keep&&(e="0"),i=n.isNull(a)?this.settings.outputFormat:a;var h=this.constructor._toLocale(e,i,this.settings);return this._executeCallback(h,r),h}},{key:"reformat",value:function(){return this.set(this.rawValue),this}},{key:"unformat",value:function(){return this._setElementValue(this.getNumericString()),this}},{key:"unformatLocalized",value:function(){return this._setElementValue(this.getLocalized(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)),this}},{key:"isPristine",value:function(){return arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?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),r=a.length,h=this.settings.currencySymbol.length,O=this.settings.currencySymbolPlacement,C=n.isNegative(a,this.settings.negativeSignCharacter)?1:0,A=this.settings.suffixText.length;if(e=O===s.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left&&1===C&&h>0?h+1:h,O===s.options.currencySymbolPlacement.prefix)i=r-A;else switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:i=r-(A+h);break;case s.options.negativePositiveSignPlacement.right:i=h>0?r-(h+C+A):r-(h+A);break;default:i=r-(h+A)}return n.setElementSelection(this.domElement,e,i),this}},{key:"selectInteger",value:function(){var e=0,i=this.rawValue>=0;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),r=a.indexOf(this.settings.decimalCharacter);return-1===r&&(r=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||(r-=1),r-=this.settings.suffixText.length),n.setElementSelection(this.domElement,e,r),this}},{key:"selectDecimal",value:function(){var e,a=n.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return-1===a?(a=0,e=0):e=(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(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(i)?this.domElement:i.node(),this._removeFromLocalList(e),this}},{key:"attach",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this._addToLocalList(e.node()),i&&e.update(this.settings),this}},{key:"formatOther",value:function(e){return this._formatOrUnformatOther(!0,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"unformatOther",value:function(e){return this._formatOrUnformatOther(!1,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"_formatOrUnformatOther",value:function(e,i){var a,r,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(a=n.isNull(h)?this.settings:this._cloneAndMergeSettings(h),n.isElement(i)){var O=n.getElementValue(i);return r=e?s.format(O,a):s.unformat(O,a),n.setElementValue(i,r),null}return e?s.format(i,a):s.unformat(i,a)}},{key:"init",value:function(e){var i=this,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!1,h=[];if(n.isString(e)?h=Y(document.querySelectorAll(e)):n.isElement(e)?(h.push(e),r=!0):n.isArray(e)?h=e:n.throwError("The given parameters to the 'init' function are invalid."),0===h.length)return n.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var O=this._getLocalList(),C=[];return h.forEach(function(A){var Z=i.settings.createLocalList;a&&(i.settings.createLocalList=!1);var f=new s(A,n.getElementValue(A),i.settings);a&&(f._setLocalList(O),i._addToLocalList(A,f),i.settings.createLocalList=Z),C.push(f)}),r?C[0]:C}},{key:"clear",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?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(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||n.isUndefinedOrNullOrEmpty(this.parentForm)){var e=this._getParentForm();if(!n.isNull(e)&&e!==this.parentForm){var i=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=i.length,this._hasFormHandlerFunction(e)?this._incrementParentFormCounter(e):(this._storeFormHandlerFunction(e),this._initializeFormCounterToOne(e))}this.parentForm=e}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var i=this,a=Y(e.elements),r=this._getContenteditableElements(e);return n.arrayUnique(a,r).filter(function(h){return i.constructor.isManagedByAutoNumeric(h)})}},{key:"_getContenteditableElements",value:function(e){if(n.isUndefinedOrNullOrEmpty(e)||!e.hasAttribute("id"))return[];var i=Y(e.querySelectorAll("[contenteditable=true]")),a=Y(document.querySelectorAll("*:not(input)[form=".concat(e.id,"][contenteditable=true]")));return n.arrayUnique(i,a)}},{key:"_getParentForm",value:function(){if(!n.isUndefined(this.domElement.form))return this.domElement.form;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(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,e)}},{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(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e=n.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,e)}},{key:"formJsonNumericString",value:function(){return JSON.stringify(this.formArrayNumericString())}},{key:"formJsonFormatted",value:function(){return JSON.stringify(this.formArrayFormatted())}},{key:"formJsonLocalized",value:function(){return JSON.stringify(this.formArrayLocalized(arguments.length>0&&void 0!==arguments[0]?arguments[0]: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(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n.isNull(e)?(this.formUnformat(),this.form().submit(),this.formReformat()):n.isFunction(e)?e(this.formNumericString()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n.isNull(e)?this.form().submit():n.isFunction(e)?e(this.formFormatted()):n.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.isNull(i)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):n.isFunction(i)?i(this.formLocalized(e)):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){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.isFunction(e)?e(this.formArrayLocalized(i)):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){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.isFunction(e)?e(this.formJsonLocalized(i)):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){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n.isNull(i)&&(i=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,i)}},{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];ce.apply(void 0,[this.settings].concat(i))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return ce.apply(void 0,[e,this.settings].concat(a)),e}},{key:"_updatePredefinedOptions",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.isNull(i)?this.update(e):(this._mergeSettings(e,i),this.update(this.settings)),this}},{key:"french",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().French,e),this}},{key:"northAmerican",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().NorthAmerican,e),this}},{key:"british",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().British,e),this}},{key:"swiss",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Swiss,e),this}},{key:"japanese",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Japanese,e),this}},{key:"spanish",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Spanish,e),this}},{key:"chinese",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Chinese,e),this}},{key:"brazilian",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Brazilian,e),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="";e in this.domElement.dataset&&(a=this.domElement.dataset[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),r=e.length,h=0,O=0,C=!1,A=0;this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.start&&(h=(e=(e=(e=e.replace(this.settings.negativeSignCharacter,"")).replace(this.settings.positiveSignCharacter,"")).replace(this.settings.currencySymbol,"")).length,C=n.contains(e,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalRight||(C?(O=e.indexOf(this.settings.decimalCharacter),A=this.settings.decimalCharacter.length):(O=h,A=0)));var Z="";i?Z=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!a&&(Z=this.settings.positiveSignCharacter);var f,I=Z.length,j=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:f=I+j;break;case s.options.negativePositiveSignPlacement.suffix:f=j}else f=j;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:f=r;break;case s.options.negativePositiveSignPlacement.suffix:f=j+h}else f=r;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:f=I+j+O;break;case s.options.negativePositiveSignPlacement.suffix:f=j+O}else f=j+O;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:f=I+j+O+A;break;case s.options.negativePositiveSignPlacement.suffix:f=j+O+A}else f=j+O+A}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:f=0;break;case s.options.negativePositiveSignPlacement.prefix:f=I}else f=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:f=h;break;case s.options.negativePositiveSignPlacement.prefix:f=I+h}else f=h;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:f=O;break;case s.options.negativePositiveSignPlacement.prefix:f=I+O}else f=O;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:f=O+A;break;case s.options.negativePositiveSignPlacement.prefix:f=I+O+A}else f=O+A;return f}},{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&&sessionStorage.setItem(this.rawValueStorageName,this.rawValue)}},{key:"_getValueFromPersistentStorage",value:function(){return this.settings.saveValueToSessionStorage?sessionStorage.getItem(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(){this.settings.saveValueToSessionStorage&&sessionStorage.removeItem(this.rawValueStorageName)}},{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 r=this.constructor._roundFormattedValueShownOnFocusOrBlur(a,this.settings,this.isFocused);this.settings.showOnlyNumbersOnFocus===s.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",i=r.replace(".",this.settings.decimalCharacter)):i=n.isNull(r)?"":this.constructor._addGroupSeparators(r.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,a)}this.valueOnFocus=n.isNull(i)?"":i,this.lastVal=this.valueOnFocus;var h=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),O=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),C=h&&""!==O&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus;C&&(i=O),n.isNull(i)||this._setElementValue(i),C&&O===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 ne(i,this.settings.decimalCharacter);e=(new w).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===v.keyName.Backspace||this.eventKey===v.keyName.Delete||this.eventKey===v.keyName.LeftArrow||this.eventKey===v.keyName.RightArrow||this.eventKey===v.keyName.Home||this.eventKey===v.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===v.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===v.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else{if(this.eventKey===v.keyName.Equal)return void this._enterFormulaMode();if(this.settings.modifyValueOnUpDownArrow&&(this.eventKey===v.keyName.UpArrow||this.eventKey===v.keyName.DownArrow))return void this.upDownArrowAction(e)}if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===v.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===v.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===v.keyName.Backspace||this.eventKey===v.keyName.Delete){var a=this._processCharacterDeletion(e);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!==v.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 r=n.getElementSelection(e.target).start+1;n.setElementSelection(e.target,r)}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===v.keyName.Esc)e.preventDefault();else{if(this._updateEventKeyInfo(e),this.eventKey===v.keyName.Z||this.eventKey===v.keyName.z){if(e.ctrlKey&&e.shiftKey)return e.preventDefault(),this._historyTableRedo(),this._triggerEvent(s.events.native.input,e.target),void(this.onGoingRedo=!0);if(e.ctrlKey&&!e.shiftKey){if(!this.onGoingRedo)return e.preventDefault(),this._historyTableUndo(),void this._triggerEvent(s.events.native.input,e.target);this.onGoingRedo=!1}}else if((this.eventKey===v.keyName.Y||this.eventKey===v.keyName.y)&&e.ctrlKey)return e.preventDefault(),this._historyTableRedo(),this._triggerEvent(s.events.native.input,e.target),void(this.onGoingRedo=!0);if(this.onGoingRedo&&(e.ctrlKey||e.shiftKey)&&(this.onGoingRedo=!1),(e.ctrlKey||e.metaKey)&&this.eventKey===v.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===v.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!e.ctrlKey&&!e.metaKey||this.eventKey!==v.keyName.Backspace&&this.eventKey!==v.keyName.Delete){this._updateInternalProperties(e);var r=this._processNonPrintableKeysAndShortcuts(e);delete this.valuePartsBeforePaste;var h=n.getElementValue(e.target);if(!(r||""===h&&""===this.initialValueOnFirstKeydown)&&(h===this.settings.currencySymbol?n.setElementSelection(e.target,this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?0:this.settings.currencySymbol.length):this.eventKey===v.keyName.Tab&&n.setElementSelection(e.target,0,h.length),(h===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(),h!==this.initialValueOnFirstKeydown&&this._triggerEvent(s.events.formatted,e.target,{oldValue:this.initialValueOnFirstKeydown,newValue:h,oldRawValue:this.initialRawValueOnFirstKeydown,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this}),this.historyTable.length>1)){var O=n.getElementSelection(this.domElement);this.selectionStart=O.start,this.selectionEnd=O.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var C=n.getElementValue(e.target);this._setRawValue(this._formatOrUnformatOther(!1,C))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===v.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),r=K(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),h=r[0],O=r[1],C=!1;if(""===i||a||(this._triggerRangeEvents(h,O),this.settings.valuesToStrings&&this._checkValuesToStrings(i)&&(this._setElementValue(this.settings.valuesToStrings[i]),C=!0)),!C){var A;if(A=a||""===i?i:String(i),""===i||a){if(""===i)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:this._setRawValue("0"),A=this.constructor._roundValue("0",this.settings,0);break;case s.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),A=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case s.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),A=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:n.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),A=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else h&&O&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(i,this.settings)?(A=this._modifyNegativeSignAndDecimalCharacterForRawValue(A),this.settings.divisorWhenUnfocused&&!n.isNull(A)&&(A=(A/=this.settings.divisorWhenUnfocused).toString()),A=this.constructor._roundFormattedValueShownOnBlur(A,this.settings),A=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(A,this.settings)):this._triggerRangeEvents(h,O);var Z=this.constructor._orderValueCurrencySymbolAndSuffixText(A,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(A,this.settings)||a&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.null||(Z=this.constructor._addGroupSeparators(A,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;e.clipboardData&&e.clipboardData.getData?i=e.clipboardData.getData("text/plain"):n.throwError("Unable to retrieve the pasted value. Please use a modern browser (i.e. Firefox or Chromium).");var r=n.getElementValue(a=e.target.tagName?e.target:e.explicitOriginalTarget),h=a.selectionStart||0,O=a.selectionEnd||0,C=O-h;if(C===r.length){var A=this._preparePastedText(i),Z=n.arabicToLatinNumbers(A,!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 f=n.isNegativeStrict(i,this.settings.negativeSignCharacter);f&&(i=i.slice(1,i.length));var I,j,q=this._preparePastedText(i);if("."!==(I="."===q?".":n.arabicToLatinNumbers(q,!1,!1,!1))&&(!n.isNumber(I)||""===I))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 H,$,oe=n.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);f&&!oe?(oe=!0,H=!0):H=!1;var me=r.slice(0,h),ge=r.slice(O,r.length);$=this._preparePastedText(h!==O?me+ge:r),oe&&($=n.setRawNegativeSign($)),j=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,h,this.settings.decimalCharacter)),H&&j++;var se=$.slice(0,j),ae=$.slice(j,$.length),Ie=!1;"."===I&&(n.contains(se,".")&&(Ie=!0,se=se.replace(".","")),ae=ae.replace(".",""));var Je=!1;switch(""===se&&"-"===ae&&(se="-",ae="",Je=!0),this.settings.onInvalidPaste){case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:for(var tt=n.parseStr(this.settings.minimumValue),nt=n.parseStr(this.settings.maximumValue),Oe=$,Ee=0,lt=se;Ee<I.length&&($=(lt+=I[Ee])+ae,this.constructor._checkIfInRange($,tt,nt));)Oe=$,Ee++;if(j+=Ee,Je&&j++,this.settings.onInvalidPaste===s.options.onInvalidPaste.truncate){$=Oe,Ie&&j--;break}for(var Ce=j,ct=Oe.length;Ee<I.length&&Ce<ct;)if("."!==Oe[Ce]){if($=n.replaceCharAt(Oe,Ce,I[Ee]),!this.constructor._checkIfInRange($,tt,nt))break;Oe=$,Ee++,Ce++}else Ce++;j=Ce,Ie&&j--,$=Oe;break;default:if($="".concat(se).concat(I).concat(ae),h===O)j=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,h,this.settings.decimalCharacter))+I.length;else if(""===ae)j=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,h,this.settings.decimalCharacter))+I.length,Je&&j++;else{var ut=n.convertCharacterCountToIndexPosition(n.countNumberCharactersOnTheCaretLeftSide(r,O,this.settings.decimalCharacter)),dt=n.getElementValue(a).slice(h,O);j=ut-C+n.countCharInText(this.settings.digitGroupSeparator,dt)+I.length}H&&j++,Ie&&j--}if(n.isNumber($)&&""!==$){var Le=!1,it=!1;try{this.set($),Le=!0}catch{var Re;switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:Re=n.clampToRangeLimits($,this.settings);try{this.set(Re)}catch{n.throwError("Fatal error: Unable to set the clamped value '".concat(Re,"'."))}it=!0,Le=!0,$=Re;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($,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));default:return}}var rt,Be=n.getElementValue(a);if(Le)switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:if(it){n.setElementSelection(a,this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?Be.length-this.settings.currencySymbol.length:Be.length);break}default:rt=n.findCaretPositionInFormattedNumber($,j,Be,this.settings.decimalCharacter),n.setElementSelection(a,rt)}Le&&r!==Be&&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($,"'."))}}},{key:"_onBlur",value:function(e){this.isFocused=!1,this.isEditing=!1,n.trimPaddedZerosFromDecimalPlaces(this.rawValue)!==n.trimPaddedZerosFromDecimalPlaces(this.rawValueOnFocus)&&this._triggerEvent(s.events.native.change,e.target),this.rawValueOnFocus=void 0}},{key:"_wheelAndUpDownActions",value:function(e,i,a,r){var h,O=e.target.selectionStart||0,C=e.target.selectionEnd||0,A=this.rawValue;if(h=+(h=n.isUndefinedOrNullOrEmpty(A)?this.settings.minimumValue>0||this.settings.maximumValue<0?i?this.settings.minimumValue:this.settings.maximumValue:0:A),n.isNumber(r)){var Z=+r;i?h+=Z:a&&(h-=Z)}else i?h=n.addAndRoundToNearestAuto(h,this.settings.decimalPlacesRawValue):a&&(h=n.subtractAndRoundToNearestAuto(h,this.settings.decimalPlacesRawValue));(h=n.clampToRangeLimits(h,this.settings))!==+A&&(this.set(h),this._triggerEvent(s.events.native.input,e.target)),e.preventDefault(),this._setSelection(O,C)}},{key:"upDownArrowAction",value:function(e){if(!(this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var i=!1,a=!1;this.eventKey===v.keyName.UpArrow?i=!0:this.eventKey===v.keyName.DownArrow?a=!0:n.throwError("Something has gone wrong since neither an Up or Down arrow key is detected, but the function was still called!"),this._wheelAndUpDownActions(e,i,a,this.settings.upDownStep)}}},{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=!1,a=!1;n.isWheelUpEvent(e)?i=!0:n.isWheelDownEvent(e)?a=!0:n.throwError("The event is not a 'wheel' event."),this._wheelAndUpDownActions(e,i,a,this.settings.wheelStep),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){this.isDropEvent=!0,e.preventDefault();var i=e.dataTransfer.getData("text/plain"),a=this.unformatOther(i),r=this.rawValue;this.set(a),this.isDropEvent=!1;var h=this.constructor._toNumericValue(a,this.settings);isNaN(Number(h))||n.trimPaddedZerosFromDecimalPlaces(r)!==n.trimPaddedZerosFromDecimalPlaces(h)&&this._triggerEvent(s.events.native.change,this.domElement)}}},{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)===v.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)===v.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._isContentEditable(this.domElement))}},{key:"_isContentEditable",value:function(e){return e.hasAttribute("contenteditable")&&"true"===e.getAttribute("contenteditable")}},{key:"_formatDefaultValueOnPageLoad",value:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=!0;if(n.isNull(i)?(e=n.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",e)):e=i,this.isInputElement||this.isContentEditable){var r=this.constructor._toNumericValue(e,this.settings);if(this.domElement.hasAttribute("value")&&""!==this.domElement.getAttribute("value")){if(null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride.toString()!==e||null===this.settings.defaultValueOverride&&""!==e&&e!==this.domElement.getAttribute("value")||""!==e&&"hidden"===this.domElement.getAttribute("type")&&!n.isNumber(r)){if(this.settings.saveValueToSessionStorage&&(null!==this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var h=this.constructor._removeBrackets(e,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(e,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(h,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(h,this.settings,!0,this.isFocused))}a=!1}}else isNaN(Number(r))||r===1/0?n.throwError("The value [".concat(e,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(r),a=!1);if(""===e)switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus: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;case s.options.emptyInputBehavior.null:this.set(null);break;default:this.set(this.settings.emptyInputBehavior)}else a&&e===this.domElement.getAttribute("value")&&this.set(e)}else null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride!==e||this.set(e)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=K(this.settings.maximumValue.toString().split("."),1)[0],i=K(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){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!i&&n.isNull(e)||this.constructor._convertOldOptionsToNewOnes(e),i?("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=v.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),i||(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=K(this._getLeftAndRightPartAroundTheSelection(),2),i=e[0],a=e[1];if(""===i&&""===a)return["",""];var r=!0;return this.eventKey!==v.keyName.Hyphen&&this.eventKey!==v.keyName.Minus||0!==Number(i)||(r=!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,r,this.isFocused),a=s._stripAllNonNumberCharactersExceptCustomDecimalChar(a,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(e,i){var a=!0;this.eventKey!==v.keyName.Hyphen&&this.eventKey!==v.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!==v.keyName.num0&&this.eventKey!==v.keyName.numpad0||0!==Number(e)||n.contains(e,this.settings.decimalCharacter)||""===i||(e=e.substring(0,e.length-1));var r=e+i;if(this.settings.decimalCharacter){var h=r.match(new RegExp("^".concat(this.regex.aNegRegAutoStrip,"\\").concat(this.settings.decimalCharacter)));h&&(r=(e=e.replace(h[1],h[1]+"0"))+i)}return[e,i,r]}},{key:"_setValueParts",value:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=K(this._normalizeParts(e,i),3),h=r[0],O=r[1],C=r[2],A=K(s._checkIfInRangeWithOverrideOption(C,this.settings),2),Z=A[0],f=A[1];if(Z&&f){var I=s._truncateDecimalPlaces(C,this.settings,a,this.settings.decimalPlacesRawValue).replace(this.settings.decimalCharacter,".");if(""===I||I===this.settings.negativeSignCharacter){var j;switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:j="";break;case s.options.emptyInputBehavior.min:j=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:j=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:j="0";break;case s.options.emptyInputBehavior.null:j=null;break;default:j=this.settings.emptyInputBehavior}this._setRawValue(j)}else this._setRawValue(this._trimLeadingAndTrailingZeros(I));var q=s._truncateDecimalPlaces(C,this.settings,a,this.settings.decimalPlacesShownOnFocus),H=h.length;return H>q.length&&(H=q.length),1===H&&"0"===h&&this.settings.leadingZero===s.options.leadingZero.deny&&(H=""===O||"0"===h&&""!==O?1:0),this._setElementValue(q,!1),this._setCaretPosition(H),!0}return this._triggerRangeEvents(Z,f),!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 r=a.length;e=[r-i,r]}}else e=[1e3,-1];return e}},{key:"_expandSelectionOnSign",value:function(){var e=K(this._getSignPosition(),2),i=e[0],a=e[1],r=this.selection;r.start<a&&r.end>i&&((r.start<i||r.end>a)&&n.getElementValue(this.domElement).substring(Math.max(r.start,i),Math.min(r.end,a)).match(/^\s*$/)?r.start<i?this._setSelection(r.start,i):this._setSelection(a,r.end):this._setSelection(Math.min(r.start,i),Math.max(r.end,a)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!n.isUndefined(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,i=K(this._getLeftAndRightPartAroundTheSelection(),2),a=i[0],r=i[1];delete this.valuePartsBeforePaste;var h=a.substr(0,e[0].length)+s._stripAllNonNumberCharactersExceptCustomDecimalChar(a.substr(e[0].length),this.settings,!0,this.isFocused);this._setValueParts(h,r,!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===v.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===v.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===v.keyName.c||this.eventKey===v.keyName.v||this.eventKey===v.keyName.x))return"keydown"===e.type&&this._expandSelectionOnSign(),this.eventKey!==v.keyName.v&&this.eventKey!==v.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===v.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===v.keyName.Z||this.eventKey===v.keyName.z);if(this.eventKey===v.keyName.LeftArrow||this.eventKey===v.keyName.RightArrow){if("keydown"===e.type&&!e.shiftKey){var i=n.getElementValue(this.domElement);this.eventKey!==v.keyName.LeftArrow||i.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&i.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==v.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}return n.isInArray(this.eventKey,v.keyName._directionKeys)}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var i=K(e,2),a=i[0],r=i[1],h=n.getElementValue(this.domElement),O=n.isNegative(h,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix&&(this.eventKey===v.keyName.Backspace?(this.caretFix=this.selection.start>=h.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,"-"===h.charAt(this.selection.start-1)?a=a.substring(1):this.selection.start<=h.length-this.settings.suffixText.length&&(a=a.substring(0,a.length-1))):(this.caretFix=this.selection.start>=h.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,this.selection.start>=h.indexOf(this.settings.currencySymbol)+this.settings.currencySymbol.length&&(r=r.substring(1,r.length)),n.isNegative(a,this.settings.negativeSignCharacter)&&"-"===h.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>=h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===v.keyName.Backspace?this.selection.start===h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&O?a=a.substring(1):"-"!==a&&(this.selection.start<=h.indexOf(this.settings.negativeSignCharacter)||!O)&&(a=a.substring(0,a.length-1)):("-"===a[0]&&(r=r.substring(1)),this.selection.start===h.indexOf(this.settings.negativeSignCharacter)&&O&&(a=a.substring(1)));break;case s.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===v.keyName.Backspace?this.selection.start===h.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?a=a.substring(1):"-"!==a&&this.selection.start<=h.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length?a=a.substring(0,a.length-1):""===a||O||(a=a.substring(0,a.length-1)):(this.caretFix=this.selection.start>=h.indexOf(this.settings.currencySymbol)&&""!==this.settings.currencySymbol,this.selection.start===h.indexOf(this.settings.negativeSignCharacter)&&(a=a.substring(1)),r=r.substring(1))}return[a,r]}},{key:"_processCharacterDeletion",value:function(e){var i,a;if(this.selection.length){this._expandSelectionOnSign();var r=K(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);i=r[0],a=r[1]}else{var h=K(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(a=h[1],""===(i=h[0])&&""===a&&(this.throwInput=!1),this.isTrailingNegative&&n.isNegative(n.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var O=K(this._processCharacterDeletionIfTrailingNegativeSign([i,a]),2);i=O[0],a=O[1]}else this.eventKey===v.keyName.Backspace?i=i.substring(0,i.length-1):a=a.substring(1,a.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(i).concat(a),this.settings)&&n.getElementValue(e.target)!==this.settings.currencySymbol&&(this._setValueParts(i,a),!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=K(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),i=e[0],a=e[1];if(this.eventKey!==v.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)||a.indexOf(this.settings.decimalCharacter)>0)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,"-")?(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&"+"===this.eventKey)&&(a=a.replace("-","")):n.isNegativeStrict(i,"-")?(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&"+"===this.eventKey)&&(i=i.replace("-","")):(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&"-"===this.eventKey)&&(i="".concat(this.settings.negativeSignCharacter).concat(i)),this._setValueParts(i,a),!0;var r=Number(this.eventKey);return r>=0&&r<=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,!1)}},{key:"_formatValue",value:function(e){var i=n.getElementValue(this.domElement),a=K(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 r=K(i.split(this.settings.decimalCharacter),1)[0],h="";n.isNegative(r,this.settings.negativeSignCharacter)&&(h=this.settings.negativeSignCharacter,r=r.replace(this.settings.negativeSignCharacter,""),a=a.replace("-","")),""===h&&r.length>this.settings.mIntPos&&"0"===a.charAt(0)&&(a=a.slice(1)),h===this.settings.negativeSignCharacter&&r.length>this.settings.mIntNeg&&"0"===a.charAt(0)&&(a=a.slice(1)),this.isTrailingNegative||(a="".concat(h).concat(a))}var O=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue),C=O.length;if(O){var A,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===v.keyName.Backspace||this.eventKey===v.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 f=this.settings.currencySymbol.split(""),I=["\\","^","$",".","|","?","*","+","(",")","["],j=[];f.forEach(function($,oe){n.isInArray(oe=f[$],I)?j.push("\\"+oe):j.push(oe)}),this.eventKey===v.keyName.Backspace&&"-"===this.settings.negativeSignCharacter&&j.push("-"),Z.push(j.join("")),this.caretFix="keydown"===e.type}for(var q=0;q<Z.length;q++)Z[q].match("\\d")||(Z[q]="\\"+Z[q]);A=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(Z.join(".*?"))):new RegExp("^.*?[".concat(this.settings.currencySymbol,"]*").concat(Z.join(".*?")));var H=O.match(A);H?(C=H[0].length,this.settings.showPositiveSign&&(0===C&&H.input.charAt(0)===this.settings.positiveSignCharacter&&(C=1===H.input.indexOf(this.settings.currencySymbol)?this.settings.currencySymbol.length+1:1),0===C&&H.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(C=this.settings.currencySymbol.length+1)),(0===C&&O.charAt(0)!==this.settings.negativeSignCharacter||1===C&&O.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(C=this.settings.currencySymbol.length+(n.isNegativeStrict(O,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(C-=this.settings.currencySymbol.length),this.settings.suffixText&&(C-=this.settings.suffixText.length))}O!==i&&(this._setElementValue(O,!1),this._setCaretPosition(C)),this.formatted=!0}}],B=[{key:"version",value:function(){return"4.10.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 r,h,O,C=n.isElement(e),A=n.isString(e),Z=n.isObject(i),f=Array.isArray(i)&&i.length>0,I=n.isNumberOrArabic(i)||""===i,j=this._isPreDefinedOptionValid(i),q=n.isNull(i),H=n.isEmptyString(i),$=n.isObject(a),oe=Array.isArray(a)&&a.length>0,me=n.isNull(a),ge=this._isPreDefinedOptionValid(a);return C&&q&&me?(r=e,O=null,h=null):C&&I&&me?(r=e,O=i,h=null):C&&Z&&me?(r=e,O=null,h=i):C&&j&&me?(r=e,O=null,h=this._getOptionObject(i)):C&&f&&me?(r=e,O=null,h=this.mergeOptions(i)):C&&(q||H)&&$?(r=e,O=null,h=a):C&&(q||H)&&oe?(r=e,O=null,h=this.mergeOptions(a)):A&&q&&me?(r=document.querySelector(e),O=null,h=null):A&&Z&&me?(r=document.querySelector(e),O=null,h=i):A&&j&&me?(r=document.querySelector(e),O=null,h=this._getOptionObject(i)):A&&f&&me?(r=document.querySelector(e),O=null,h=this.mergeOptions(i)):A&&(q||H)&&$?(r=document.querySelector(e),O=null,h=a):A&&(q||H)&&oe?(r=document.querySelector(e),O=null,h=this.mergeOptions(a)):A&&I&&me?(r=document.querySelector(e),O=i,h=null):A&&I&&$?(r=document.querySelector(e),O=i,h=a):A&&I&&ge?(r=document.querySelector(e),O=i,h=this._getOptionObject(a)):A&&I&&oe?(r=document.querySelector(e),O=i,h=this.mergeOptions(a)):C&&I&&$?(r=e,O=i,h=a):C&&I&&ge?(r=e,O=i,h=this._getOptionObject(a)):C&&I&&oe?(r=e,O=i,h=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(r)&&n.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:r,initialValue:O,userOptions:h}}},{key:"mergeOptions",value:function(e){var i=this,a={};return e.forEach(function(r){ce(a,i._getOptionObject(r))}),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=ue(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"),r=[];return Array.prototype.slice.call(a,0).forEach(function(h){i.test(h)&&r.push(h)}),r}},{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=ue(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){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!n.isUndefinedOrNullOrEmpty(e)&&n.isObject(e)||n.throwError("The userOptions are invalid ; it should be a valid object, [".concat(e,"] given."));var r,h=n.isObject(a);h||n.isNull(a)||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),r=i?ce({},this.getDefaultConfig(),e):e,n.isTrueOrFalseString(r.showWarnings)||n.isBoolean(r.showWarnings)||n.throwError("The debug option 'showWarnings' is invalid ; it should be either 'true' or 'false', [".concat(r.showWarnings,"] given."));var O,C=/^[0-9]+$/,A=/[0-9]+/,Z=/^-?[0-9]+(\.?[0-9]+)?$/,f=/^[0-9]+(\.?[0-9]+)?$/;n.isTrueOrFalseString(r.allowDecimalPadding)||n.isBoolean(r.allowDecimalPadding)||r.allowDecimalPadding===s.options.allowDecimalPadding.floats||n.isNumber(r.allowDecimalPadding)&&r.allowDecimalPadding>0||n.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true`, `'floats'` or a positive integer superior to 0, [".concat(r.allowDecimalPadding,"] given.")),n.isNumber(r.allowDecimalPadding)&&r.allowDecimalPadding>r.decimalPlaces&&n.warning("Setting 'allowDecimalPadding' to a number [".concat(r.allowDecimalPadding,"] superior to the current 'decimalPlaces' settings [").concat(r.decimalPlaces,"] is useless, since the padding will not be shown."),r.showWarnings),r.allowDecimalPadding!==s.options.allowDecimalPadding.never&&"false"!==r.allowDecimalPadding||r.decimalPlaces===s.options.decimalPlaces.none&&r.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.none&&r.decimalPlacesShownOnFocus===s.options.decimalPlacesShownOnFocus.none||n.warning("Setting 'allowDecimalPadding' to [".concat(r.allowDecimalPadding,"] will override the current 'decimalPlaces*' settings [").concat(r.decimalPlaces,", ").concat(r.decimalPlacesShownOnBlur," and ").concat(r.decimalPlacesShownOnFocus,"]."),r.showWarnings),n.isTrueOrFalseString(r.alwaysAllowDecimalCharacter)||n.isBoolean(r.alwaysAllowDecimalCharacter)||n.throwError("The option 'alwaysAllowDecimalCharacter' is invalid ; it should either be `true` or `false`, [".concat(r.alwaysAllowDecimalCharacter,"] given.")),n.isNull(r.caretPositionOnFocus)||n.isInArray(r.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(r.caretPositionOnFocus,"] given.")),O=h?a:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(e),n.isNull(O)||O.caretPositionOnFocus===s.options.caretPositionOnFocus.doNoForceCaretPosition||O.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(O.caretPositionOnFocus,"'. As a result, if this has been called when instantiating an AutoNumeric object, the 'selectOnFocus' option is forced to 'doNotSelect'."),r.showWarnings),n.isInArray(r.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(r.digitGroupSeparator,"] given.")),n.isTrueOrFalseString(r.showOnlyNumbersOnFocus)||n.isBoolean(r.showOnlyNumbersOnFocus)||n.throwError("The 'showOnlyNumbersOnFocus' option is invalid ; it should be either 'true' or 'false', [".concat(r.showOnlyNumbersOnFocus,"] given.")),n.isInArray(r.digitalGroupSpacing,[s.options.digitalGroupSpacing.two,s.options.digitalGroupSpacing.twoThree,s.options.digitalGroupSpacing.twoScaled,s.options.digitalGroupSpacing.three,s.options.digitalGroupSpacing.four])||r.digitalGroupSpacing>=2&&r.digitalGroupSpacing<=4||n.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2t', '2s', '3', or '4', [".concat(r.digitalGroupSpacing,"] given.")),n.isInArray(r.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(r.decimalCharacter,"] given.")),r.decimalCharacter===r.digitGroupSeparator&&n.throwError("autoNumeric will not function properly when the decimal character 'decimalCharacter' [".concat(r.decimalCharacter,"] and the thousand separator 'digitGroupSeparator' [").concat(r.digitGroupSeparator,"] are the same character.")),n.isNull(r.decimalCharacterAlternative)||n.isString(r.decimalCharacterAlternative)||n.throwError("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, [".concat(r.decimalCharacterAlternative,"] given.")),""===r.currencySymbol||n.isString(r.currencySymbol)||n.throwError("The currency symbol option 'currencySymbol' is invalid ; it should be a string, [".concat(r.currencySymbol,"] given.")),n.isInArray(r.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(r.currencySymbolPlacement,"] given.")),n.isInArray(r.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(r.negativePositiveSignPlacement,"] given.")),n.isTrueOrFalseString(r.showPositiveSign)||n.isBoolean(r.showPositiveSign)||n.throwError("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'true' or 'false', [".concat(r.showPositiveSign,"] given.")),(!n.isString(r.suffixText)||""!==r.suffixText&&(n.isNegative(r.suffixText,r.negativeSignCharacter)||A.test(r.suffixText)))&&n.throwError("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '".concat(r.negativeSignCharacter,"' nor any numerical characters, [").concat(r.suffixText,"] given.")),(!n.isString(r.negativeSignCharacter)||1!==r.negativeSignCharacter.length||n.isUndefinedOrNullOrEmpty(r.negativeSignCharacter)||A.test(r.negativeSignCharacter))&&n.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(r.negativeSignCharacter,"] given.")),(!n.isString(r.positiveSignCharacter)||1!==r.positiveSignCharacter.length||n.isUndefinedOrNullOrEmpty(r.positiveSignCharacter)||A.test(r.positiveSignCharacter))&&n.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(r.positiveSignCharacter,"] given.\nIf you want to show the positive sign character, you need to set the `showPositiveSign` option to `true`.")),r.negativeSignCharacter===r.positiveSignCharacter&&n.throwError("The positive 'positiveSignCharacter' and negative 'negativeSignCharacter' sign characters cannot be identical ; [".concat(r.negativeSignCharacter,"] given.")),n.isTrueOrFalseString(r.negativePositiveSignBehavior)||n.isBoolean(r.negativePositiveSignBehavior)||n.throwError("The option 'negativePositiveSignBehavior' is invalid ; it should be either 'true' or 'false', [".concat(r.negativePositiveSignBehavior,"] given."));var I=K(n.isNull(r.negativeBracketsTypeOnBlur)?["",""]:r.negativeBracketsTypeOnBlur.split(","),2),j=I[0],q=I[1];(n.contains(r.digitGroupSeparator,r.negativeSignCharacter)||n.contains(r.decimalCharacter,r.negativeSignCharacter)||n.contains(r.decimalCharacterAlternative,r.negativeSignCharacter)||n.contains(j,r.negativeSignCharacter)||n.contains(q,r.negativeSignCharacter)||n.contains(r.suffixText,r.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(r.negativeSignCharacter,"] given.")),(n.contains(r.digitGroupSeparator,r.positiveSignCharacter)||n.contains(r.decimalCharacter,r.positiveSignCharacter)||n.contains(r.decimalCharacterAlternative,r.positiveSignCharacter)||n.contains(j,r.positiveSignCharacter)||n.contains(q,r.positiveSignCharacter)||n.contains(r.suffixText,r.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(r.positiveSignCharacter,"] given.")),n.isNull(r.overrideMinMaxLimits)||n.isInArray(r.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(r.overrideMinMaxLimits,"] given.")),r.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.invalid&&r.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.ignore&&(r.minimumValue>0||r.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 (i.e. out-of-range), you should use the 'invalid' option for the 'overrideMinMaxLimits' setting."),n.isString(r.maximumValue)&&Z.test(r.maximumValue)||n.throwError("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(r.maximumValue,"] given.")),n.isString(r.minimumValue)&&Z.test(r.minimumValue)||n.throwError("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(r.minimumValue,"] given.")),parseFloat(r.minimumValue)>parseFloat(r.maximumValue)&&n.throwError("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' [".concat(r.minimumValue,"] should be smaller than 'maximumValue' [").concat(r.maximumValue,"].")),n.isInt(r.decimalPlaces)&&r.decimalPlaces>=0||n.isString(r.decimalPlaces)&&C.test(r.decimalPlaces)||n.throwError("The number of decimal places option 'decimalPlaces' is invalid ; it should be a positive integer, [".concat(r.decimalPlaces,"] given.")),n.isNull(r.decimalPlacesRawValue)||n.isInt(r.decimalPlacesRawValue)&&r.decimalPlacesRawValue>=0||n.isString(r.decimalPlacesRawValue)&&C.test(r.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(r.decimalPlacesRawValue,"] given.")),this._validateDecimalPlacesRawValue(r),n.isNull(r.decimalPlacesShownOnFocus)||C.test(String(r.decimalPlacesShownOnFocus))||n.throwError("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer or `null`, [".concat(r.decimalPlacesShownOnFocus,"] given.")),!n.isNull(r.decimalPlacesShownOnFocus)&&Number(r.decimalPlaces)>Number(r.decimalPlacesShownOnFocus)&&n.warning("The extended decimal places 'decimalPlacesShownOnFocus' [".concat(r.decimalPlacesShownOnFocus,"] should be greater than the 'decimalPlaces' [").concat(r.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?"),r.showWarnings),(n.isNull(r.divisorWhenUnfocused)||f.test(r.divisorWhenUnfocused))&&0!==r.divisorWhenUnfocused&&"0"!==r.divisorWhenUnfocused&&1!==r.divisorWhenUnfocused&&"1"!==r.divisorWhenUnfocused||n.throwError("The divisor option 'divisorWhenUnfocused' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(r.divisorWhenUnfocused,"] given.")),n.isNull(r.decimalPlacesShownOnBlur)||C.test(r.decimalPlacesShownOnBlur)||n.throwError("The number of decimals shown when unfocused option 'decimalPlacesShownOnBlur' is invalid ; it should be a positive integer or `null`, [".concat(r.decimalPlacesShownOnBlur,"] given.")),n.isNull(r.symbolWhenUnfocused)||n.isString(r.symbolWhenUnfocused)||n.throwError("The symbol to show when unfocused option 'symbolWhenUnfocused' is invalid ; it should be a string, [".concat(r.symbolWhenUnfocused,"] given.")),n.isTrueOrFalseString(r.saveValueToSessionStorage)||n.isBoolean(r.saveValueToSessionStorage)||n.throwError("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'true' or 'false', [".concat(r.saveValueToSessionStorage,"] given.")),n.isInArray(r.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(r.onInvalidPaste,"] given.")),n.isInArray(r.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(r.roundingMethod,"] given.")),n.isNull(r.negativeBracketsTypeOnBlur)||n.isInArray(r.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(r.negativeBracketsTypeOnBlur,"] given.")),(n.isString(r.emptyInputBehavior)||n.isNumber(r.emptyInputBehavior))&&(n.isInArray(r.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])||Z.test(r.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(r.emptyInputBehavior,"] given.")),r.emptyInputBehavior===s.options.emptyInputBehavior.zero&&(r.minimumValue>0||r.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(r.minimumValue,", ").concat(r.maximumValue,"].")),Z.test(String(r.emptyInputBehavior))&&(this._isWithinRangeWithOverrideOption(r.emptyInputBehavior,r)||n.throwError("The 'emptyInputBehavior' option is set to a number or a string that represents a number, but its value [".concat(r.emptyInputBehavior,"] is outside of the range defined by the 'minimumValue' and 'maximumValue' options [").concat(r.minimumValue,", ").concat(r.maximumValue,"]."))),n.isTrueOrFalseString(r.eventBubbles)||n.isBoolean(r.eventBubbles)||n.throwError("The event bubbles option 'eventBubbles' is invalid ; it should be either 'true' or 'false', [".concat(r.eventBubbles,"] given.")),n.isTrueOrFalseString(r.eventIsCancelable)||n.isBoolean(r.eventIsCancelable)||n.throwError("The event is cancelable option 'eventIsCancelable' is invalid ; it should be either 'true' or 'false', [".concat(r.eventIsCancelable,"] given.")),!n.isBoolean(r.invalidClass)&&/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(r.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(r.invalidClass,"] given.")),n.isInArray(r.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(r.leadingZero,"] given.")),n.isTrueOrFalseString(r.formatOnPageLoad)||n.isBoolean(r.formatOnPageLoad)||n.throwError("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'true' or 'false', [".concat(r.formatOnPageLoad,"] given.")),n.isTrueOrFalseString(r.formulaMode)||n.isBoolean(r.formulaMode)||n.throwError("The formula mode option 'formulaMode' is invalid ; it should be either 'true' or 'false', [".concat(r.formulaMode,"] given.")),C.test(r.historySize)&&0!==r.historySize||n.throwError("The history size option 'historySize' is invalid ; it should be a positive integer, [".concat(r.historySize,"] given.")),n.isTrueOrFalseString(r.selectNumberOnly)||n.isBoolean(r.selectNumberOnly)||n.throwError("The select number only option 'selectNumberOnly' is invalid ; it should be either 'true' or 'false', [".concat(r.selectNumberOnly,"] given.")),n.isTrueOrFalseString(r.selectOnFocus)||n.isBoolean(r.selectOnFocus)||n.throwError("The select on focus option 'selectOnFocus' is invalid ; it should be either 'true' or 'false', [".concat(r.selectOnFocus,"] given.")),n.isNull(r.defaultValueOverride)||""===r.defaultValueOverride||Z.test(r.defaultValueOverride)||n.throwError("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, [".concat(r.defaultValueOverride,"] given.")),n.isTrueOrFalseString(r.unformatOnSubmit)||n.isBoolean(r.unformatOnSubmit)||n.throwError("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'true' or 'false', [".concat(r.unformatOnSubmit,"] given.")),n.isNull(r.valuesToStrings)||n.isObject(r.valuesToStrings)||n.throwError("The option 'valuesToStrings' is invalid ; it should be an object, ideally with 'key -> value' entries, [".concat(r.valuesToStrings,"] given.")),n.isNull(r.outputFormat)||n.isInArray(r.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(r.outputFormat,"] given.")),n.isTrueOrFalseString(r.isCancellable)||n.isBoolean(r.isCancellable)||n.throwError("The cancellable behavior option 'isCancellable' is invalid ; it should be either 'true' or 'false', [".concat(r.isCancellable,"] given.")),n.isTrueOrFalseString(r.modifyValueOnUpDownArrow)||n.isBoolean(r.modifyValueOnUpDownArrow)||n.throwError("The increment/decrement on up and down arrow keys 'modifyValueOnUpDownArrow' is invalid ; it should be either 'true' or 'false', [".concat(r.modifyValueOnUpDownArrow,"] given.")),n.isTrueOrFalseString(r.modifyValueOnWheel)||n.isBoolean(r.modifyValueOnWheel)||n.throwError("The increment/decrement on mouse wheel option 'modifyValueOnWheel' is invalid ; it should be either 'true' or 'false', [".concat(r.modifyValueOnWheel,"] given.")),n.isTrueOrFalseString(r.watchExternalChanges)||n.isBoolean(r.watchExternalChanges)||n.throwError("The option 'watchExternalChanges' is invalid ; it should be either 'true' or 'false', [".concat(r.watchExternalChanges,"] given.")),n.isInArray(r.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(r.wheelOn,"] given.")),(!n.isString(r.upDownStep)&&!n.isNumber(r.upDownStep)||"progressive"!==r.upDownStep&&!f.test(r.upDownStep)||0===Number(r.upDownStep))&&n.throwError("The up/down arrow step value option 'upDownStep' is invalid ; it should either be the string 'progressive', or a number or a string that represents a positive number (excluding zero), [".concat(r.upDownStep,"] given.")),(!n.isString(r.wheelStep)&&!n.isNumber(r.wheelStep)||"progressive"!==r.wheelStep&&!f.test(r.wheelStep)||0===Number(r.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(r.wheelStep,"] given.")),n.isInArray(r.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(r.serializeSpaces,"] given.")),n.isTrueOrFalseString(r.noEventListeners)||n.isBoolean(r.noEventListeners)||n.throwError("The option 'noEventListeners' that prevent the creation of event listeners is invalid ; it should be either 'true' or 'false', [".concat(r.noEventListeners,"] given.")),n.isNull(r.styleRules)||n.isObject(r.styleRules)&&(Object.prototype.hasOwnProperty.call(r.styleRules,"positive")||Object.prototype.hasOwnProperty.call(r.styleRules,"negative")||Object.prototype.hasOwnProperty.call(r.styleRules,"ranges")||Object.prototype.hasOwnProperty.call(r.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(r.styleRules,"] given.")),n.isNull(r.styleRules)||!Object.prototype.hasOwnProperty.call(r.styleRules,"userDefined")||n.isNull(r.styleRules.userDefined)||r.styleRules.userDefined.forEach(function(H){Object.prototype.hasOwnProperty.call(H,"callback")&&!n.isFunction(H.callback)&&n.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(ue(H.callback)," given."))}),(n.isNull(r.rawValueDivisor)||f.test(r.rawValueDivisor))&&0!==r.rawValueDivisor&&"0"!==r.rawValueDivisor&&1!==r.rawValueDivisor&&"1"!==r.rawValueDivisor||n.throwError("The raw value divisor option 'rawValueDivisor' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(r.rawValueDivisor,"] given.")),n.isTrueOrFalseString(r.readOnly)||n.isBoolean(r.readOnly)||n.throwError("The option 'readOnly' is invalid ; it should be either 'true' or 'false', [".concat(r.readOnly,"] given.")),n.isTrueOrFalseString(r.unformatOnHover)||n.isBoolean(r.unformatOnHover)||n.throwError("The option 'unformatOnHover' is invalid ; it should be either 'true' or 'false', [".concat(r.unformatOnHover,"] given.")),n.isTrueOrFalseString(r.failOnUnknownOption)||n.isBoolean(r.failOnUnknownOption)||n.throwError("The debug option 'failOnUnknownOption' is invalid ; it should be either 'true' or 'false', [".concat(r.failOnUnknownOption,"] given.")),n.isTrueOrFalseString(r.createLocalList)||n.isBoolean(r.createLocalList)||n.throwError("The debug option 'createLocalList' is invalid ; it should be either 'true' or 'false', [".concat(r.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(r){ce(i,a._getOptionObject(r))}):e.length>=1&&e.forEach(function(r){ce(i,a._getOptionObject(r))})),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,r=new Array(a>1?a-1:0),h=1;h<a;h++)r[h-1]=arguments[h];var O=this._generateOptionsObjectFromOptionsArray(r),C=ce({},this.getDefaultConfig(),O);C.isNegativeSignAllowed=i<0,C.isPositiveSignAllowed=i>=0,this._setBrackets(C),this._cachesUsualRegularExpressions(C,{});var A=this._toNumericValue(i,C);return isNaN(Number(A))&&n.throwError("The value [".concat(A,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(A,C)||(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(A,"] being set falls outside of the minimumValue [").concat(C.minimumValue,"] and maximumValue [").concat(C.maximumValue,"] range set for this element"))),C.valuesToStrings&&this._checkValuesToStringsSettings(i,C)?C.valuesToStrings[i]:(this._correctNegativePositiveSignPlacementOption(C),this._calculateDecimalPlacesOnInit(C),n.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===A||null===A||(A*=C.rawValueDivisor),A=this._roundFormattedValueShownOnFocus(A,C),A=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(A,C),A=this._addGroupSeparators(A,C,!1,A))}},{key:"formatAndSet",value:function(e){var a=this.format(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null);return n.setElementValue(e,a),a}},{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,r=new Array(a>1?a-1:0),h=1;h<a;h++)r[h-1]=arguments[h];var O=this._generateOptionsObjectFromOptionsArray(r),C=ce({},this.getDefaultConfig(),O);if(C.isNegativeSignAllowed=!1,C.isPositiveSignAllowed=!0,i=i.toString(),C.valuesToStrings&&this._checkStringsToValuesSettings(i,C))return n.objectKeyLookup(C.valuesToStrings,i);if(n.isNegative(i,C.negativeSignCharacter))C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1;else if(!n.isNull(C.negativeBracketsTypeOnBlur)){var A=K(C.negativeBracketsTypeOnBlur.split(","),2);C.firstBracket=A[0],C.lastBracket=A[1],i.charAt(0)===C.firstBracket&&i.charAt(i.length-1)===C.lastBracket&&(C.isNegativeSignAllowed=!0,C.isPositiveSignAllowed=!1,i=this._removeBrackets(i,C,!1))}return i=this._convertToNumericString(i,C),n.isNumber(Number(i))&&(i=n.scientificToDecimal(i)),new RegExp("[^+-0123456789.]","gi").test(i)?NaN:(this._correctNegativePositiveSignPlacementOption(C),C.originalDecimalPlacesRawValue=C.decimalPlacesRawValue?C.decimalPlacesRawValue:C.decimalPlaces,this._calculateDecimalPlacesOnInit(C),n.isUndefinedOrNullOrEmpty(C.rawValueDivisor)||0===C.rawValueDivisor||""===i||null===i||(i/=C.rawValueDivisor),i=(i=this._roundRawValue(i,C)).replace(C.decimalCharacter,"."),i=this._toLocale(i,C.outputFormat,C))}},{key:"unformatAndSet",value:function(e){var a=this.unformat(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null);return n.setElementValue(e,a),a}},{key:"localize",value:function(e){var i,a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return""===(i=n.isElement(e)?n.getElementValue(e):e)?"":(n.isNull(r)&&(r=s.defaultSettings),i=this.unformat(i,r),0===Number(i)&&r.leadingZero!==s.options.leadingZero.keep&&(i="0"),a=n.isNull(r)?r.outputFormat:s.defaultSettings.outputFormat,this._toLocale(i,a,r))}},{key:"localizeAndSet",value:function(e){var a=this.localize(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null);return n.setElementValue(e,a),a}},{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){var a,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,h=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],O=n.domElement(e);return this.isManagedByAutoNumeric(O)?this.getAutoNumericElement(O).set(i,r,h):(a=!(!n.isNull(r)&&Object.prototype.hasOwnProperty.call(r,"showWarnings"))||r.showWarnings,n.warning("Impossible to find an AutoNumeric object for the given DOM element or selector.",a),null)}},{key:"getNumericString",value:function(e){return this._get(e,"getNumericString",arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"getFormatted",value:function(e){return this._get(e,"getFormatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"getNumber",value:function(e){return this._get(e,"getNumber",arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},{key:"_get",value:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=n.domElement(e);return this.isManagedByAutoNumeric(r)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(r)[i](a)}},{key:"getLocalized",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=n.domElement(e);return this.isManagedByAutoNumeric(r)||n.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(r).getLocalized(i,a)}},{key:"_stripAllNonNumberCharacters",value:function(e,i,a,r){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,a,r).replace(i.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(e,i,a,r){var h=(e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,i)).replace(i.allowedAutoStrip,"")).match(i.numRegAutoStrip);if(e=h?[h[1],h[2],h[3]].join(""):"",i.leadingZero===s.options.leadingZero.allow||i.leadingZero===s.options.leadingZero.keep){var O="",C=K(e.split(i.decimalCharacter),2),Z=C[1],f=C[0];n.contains(f,i.negativeSignCharacter)&&(O=i.negativeSignCharacter,f=f.replace(i.negativeSignCharacter,"")),""===O&&f.length>i.mIntPos&&"0"===f.charAt(0)&&(f=f.slice(1)),""!==O&&f.length>i.mIntNeg&&"0"===f.charAt(0)&&(f=f.slice(1)),e="".concat(O).concat(f).concat(n.isUndefined(Z)?"":i.decimalCharacter+Z)}return(a&&i.leadingZero===s.options.leadingZero.deny||!r&&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){var a,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return n.isNull(i.negativeBracketsTypeOnBlur)||e.charAt(0)!==i.firstBracket?a=e:(a=(a=e.replace(i.firstBracket,"")).replace(i.lastBracket,""),r?(a=a.replace(i.currencySymbol,""),a=this._mergeCurrencySignNegativePositiveSignAndValue(a,i,!0,!1)):a="".concat(i.negativeSignCharacter).concat(a)),a}},{key:"_setBrackets",value:function(e){if(n.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var i=K(e.negativeBracketsTypeOnBlur.split(","),2),r=i[1];e.firstBracket=i[0],e.lastBracket=r}}},{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 r=n.arabicToLatinNumbers(e,i.leadingZero!==s.options.leadingZero.keep,!1,!1);return isNaN(r)||(e=r.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 r;switch(i){case s.options.outputFormat.number:r=Number(e);break;case s.options.outputFormat.dotNegative:r=n.isNegative(e)?e.replace("-","")+"-":e;break;case s.options.outputFormat.comma:case s.options.outputFormat.negativeComma:r=e.replace(".",",");break;case s.options.outputFormat.commaNegative:r=e.replace(".",","),r=n.isNegative(r)?r.replace("-","")+"-":r;break;case s.options.outputFormat.dot:case s.options.outputFormat.negativeDot:r=e;break;default:n.throwError("The given outputFormat [".concat(i,"] option is not recognized."))}return i!==s.options.outputFormat.number&&"-"!==a.negativeSignCharacter&&(r=r.replace("-",a.negativeSignCharacter)),r}},{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 r;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:r=e+i.currencySymbol+i.suffixText;break;default:r=i.currencySymbol+e+i.suffixText}else r=e;return r}},{key:"_addGroupSeparators",value:function(e,i,a,r){var h,O=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(h=n.isNull(O)?n.isNegative(e,i.negativeSignCharacter)||n.isNegativeWithBrackets(e,i.firstBracket,i.lastBracket):O<0,e=this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,i,!1,a),this._isElementValueEmptyOrOnlyTheNegativeSign(e,i))return this._orderValueCurrencySymbolAndSuffixText(e,i,!0);var C=n.isZeroOrHasNoValue(e);h&&(e=e.replace("-",""));var A,Z=K(e.split(i.decimalCharacter),2),f=Z[0],I=Z[1];if(i.decimalCharacterAlternative&&n.isUndefined(I)){var j=K(e.split(i.decimalCharacterAlternative),2);f=j[0],I=j[1]}if(""!==i.digitGroupSeparator){var q;switch(i.digitalGroupSpacing=i.digitalGroupSpacing.toString(),i.digitalGroupSpacing){case s.options.digitalGroupSpacing.twoThree:q=/(\d)((\d)(\d{2}?)+)$/;break;case s.options.digitalGroupSpacing.twoScaled:q=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;default:q=new RegExp("(\\d)((\\d{".concat(i.digitalGroupSpacing,"}?)+)$"))}for(;q.test(f);)f=f.replace(q,"$1".concat(i.digitGroupSeparator,"$2"))}return 0===(A=a?i.decimalPlacesShownOnFocus:i.decimalPlacesShownOnBlur)||n.isUndefined(I)?e=f:(I.length>A&&(I=I.substring(0,A)),e="".concat(f).concat(i.decimalCharacter).concat(I)),e=s._mergeCurrencySignNegativePositiveSignAndValue(e,i,h,C),n.isNull(O)&&(O=r),null!==i.negativeBracketsTypeOnBlur&&(O<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,r){var h,O="";if(a?O=i.negativeSignCharacter:i.showPositiveSign&&!r&&(O=i.positiveSignCharacter),i.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)if(i.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(a||!a&&i.showPositiveSign&&!r))switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:h="".concat(O).concat(i.currencySymbol).concat(e);break;case s.options.negativePositiveSignPlacement.right:h="".concat(i.currencySymbol).concat(O).concat(e);break;case s.options.negativePositiveSignPlacement.suffix:h="".concat(i.currencySymbol).concat(e).concat(O)}else h=i.currencySymbol+e;else if(i.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)if(i.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(a||!a&&i.showPositiveSign&&!r))switch(i.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:h="".concat(e).concat(i.currencySymbol).concat(O);break;case s.options.negativePositiveSignPlacement.left:h="".concat(e).concat(O).concat(i.currencySymbol);break;case s.options.negativePositiveSignPlacement.prefix:h="".concat(O).concat(e).concat(i.currencySymbol)}else h=e+i.currencySymbol;return h}},{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 r,h=K(s._prepareValueForRounding(e,i),2),O=h[0],C=(e=h[1]).lastIndexOf("."),A=-1===C,Z=K(e.split("."),2),f=Z[0];if(!(Z[1]>0||i.allowDecimalPadding!==s.options.allowDecimalPadding.never&&i.allowDecimalPadding!==s.options.allowDecimalPadding.floats))return 0===Number(e)?f:"".concat(O).concat(f);r=i.allowDecimalPadding===s.options.allowDecimalPadding.always||i.allowDecimalPadding===s.options.allowDecimalPadding.floats?a:i.allowDecimalPadding>0?i.allowDecimalPadding:0;var I,q=e.length-1-(A?e.length-1:C),H="";if(q<=a){if(H=e,q<r){A&&(H="".concat(H).concat(i.decimalCharacter));for(var $="000000";q<r;)H+=$=$.substring(0,r-q),q+=$.length}else q>r?H=this._truncateZeros(H,r):0===q&&0===r&&(H=H.replace(/\.$/,""));return 0===Number(H)?H:"".concat(O).concat(H)}I=A?a-1:Number(a)+Number(C);var oe,me=Number(e.charAt(I+1)),ge=e.substring(0,I+1).split("");if(oe="."===e.charAt(I)?e.charAt(I-1)%2:e.charAt(I)%2,this._shouldRoundUp(me,i,O,oe))for(var se=ge.length-1;se>=0;se-=1)if("."!==ge[se]){if(ge[se]=+ge[se]+1,ge[se]<10)break;se>0&&(ge[se]="0")}return ge=ge.slice(0,I+1),H=this._truncateZeros(ge.join(""),r),0===Number(H)?H:"".concat(O).concat(H)}},{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=""),(Number(e)>0&&i.leadingZero!==s.options.leadingZero.keep||e.length>0&&i.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(/^0*(\d)/,"$1")),[a,e]}},{key:"_shouldRoundUp",value:function(e,i,a,r){return e>4&&i.roundingMethod===s.options.roundingMethod.halfUpSymmetric||e>4&&i.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&""===a||e>5&&i.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&"-"===a||e>5&&i.roundingMethod===s.options.roundingMethod.halfDownSymmetric||e>5&&i.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&""===a||e>4&&i.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&"-"===a||e>5&&i.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding||5===e&&i.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding&&1===r||e>0&&i.roundingMethod===s.options.roundingMethod.toCeilingTowardPositiveInfinity&&""===a||e>0&&i.roundingMethod===s.options.roundingMethod.toFloorTowardNegativeInfinity&&"-"===a||e>0&&i.roundingMethod===s.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,i,a,r){a&&(e=this._roundFormattedValueShownOnFocus(e,i));var h=K(e.split(i.decimalCharacter),2),O=h[0],C=h[1];if(C&&C.length>r)if(r>0){var A=C.substring(0,r);e="".concat(O).concat(i.decimalCharacter).concat(A)}else e=O;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,r=n.parseStr(i.minimumValue),h=n.parseStr(i.maximumValue),O=n.parseStr(e);switch(i.overrideMinMaxLimits){case s.options.overrideMinMaxLimits.floor:a=[n.testMinMax(r,O)>-1,!0];break;case s.options.overrideMinMaxLimits.ceiling:a=[!0,n.testMinMax(h,O)<1];break;default:a=[n.testMinMax(r,O)>-1,n.testMinMax(h,O)<1]}return a}},{key:"_isWithinRangeWithOverrideOption",value:function(e,i){var a=K(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 n.testMinMax(n.parseStr(i.minimumValue),this._cleanValueForRangeParse(e))>-1}},{key:"_isMaximumRangeRespected",value:function(e,i){return n.testMinMax(n.parseStr(i.maximumValue),this._cleanValueForRangeParse(e))<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){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._validateDecimalPlacesRawValue(e),n.isNull(i)&&n.throwError("When updating the settings, the previous ones should be passed as an argument.");var a="decimalPlaces"in e;if(a||"decimalPlacesRawValue"in e||"decimalPlacesShownOnFocus"in e||"decimalPlacesShownOnBlur"in e||"rawValueDivisor"in e){a?("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=i.decimalPlacesShownOnFocus),n.isUndefined(e.decimalPlacesShownOnBlur)&&(e.decimalPlacesShownOnBlur=i.decimalPlacesShownOnBlur));var r=0;e.rawValueDivisor&&e.rawValueDivisor!==s.options.rawValueDivisor.none&&(r=String(e.rawValueDivisor).length-1)<0&&(r=0),e.decimalPlacesRawValue=e.decimalPlaces||e.decimalPlacesRawValue?Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+r,Number(e.decimalPlacesRawValue)+r):Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+r,Number(i.originalDecimalPlacesRawValue)+r)}}},{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,modifyValueOnUpDownArrow:!0,modifyValueOnWheel:!0,negativeBracketsTypeOnBlur:!0,negativePositiveSignPlacement:!0,negativeSignCharacter:!0,negativePositiveSignBehavior:!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,upDownStep:!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=e.maximumValue>=0}},{key:"_toNumericValue",value:function(e,i){var a;return n.isNumber(Number(e))?(n.isNumberStrict(e)||(e=String(e).trim()),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 r=n.parseStr(e);return n.testMinMax(i,r)>-1&&n.testMinMax(a,r)<1}},{key:"_shouldSkipEventKey",value:function(e){var i=n.isInArray(e,v.keyName._allFnKeys),a=e===v.keyName.OSLeft||e===v.keyName.OSRight,r=e===v.keyName.ContextMenu,h=n.isInArray(e,v.keyName._someNonPrintableKeys);return i||a||r||h||e===v.keyName.Unidentified||e===v.keyName.NumLock||e===v.keyName.ScrollLock||e===v.keyName.Insert||e===v.keyName.Command}},{key:"_serialize",value:function(e){var i,a=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unformatted",O=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+",C=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,A=[];return"object"===ue(e)&&"form"===e.nodeName.toLowerCase()&&Array.prototype.slice.call(e.elements).forEach(function(Z){if(Z.name&&!Z.disabled&&-1===["file","reset","submit","button"].indexOf(Z.type))if("select-multiple"===Z.type)Array.prototype.slice.call(Z.options).forEach(function(q){q.selected&&A.push(r?{name:Z.name,value:q.value}:"".concat(encodeURIComponent(Z.name),"=").concat(encodeURIComponent(q.value)))});else if(-1===["checkbox","radio"].indexOf(Z.type)||Z.checked){var f,I;if(a.isManagedByAutoNumeric(Z))switch(h){case"unformatted":I=a.getAutoNumericElement(Z),n.isNull(I)||(f=a.unformat(Z,I.getSettings()));break;case"localized":if(I=a.getAutoNumericElement(Z),!n.isNull(I)){var j=n.cloneObject(I.getSettings());n.isNull(C)||(j.outputFormat=C),f=a.localize(Z,j)}break;default:f=Z.value}else f=Z.value;n.isUndefined(f)&&n.throwError("This error should never be hit. If it has, something really wrong happened!"),A.push(r?{name:Z.name,value:f}:"".concat(encodeURIComponent(Z.name),"=").concat(encodeURIComponent(f)))}}),r?i=A:(i=A.join("&"),"+"===O&&(i=i.replace(/%20/g,"+"))),i}},{key:"_serializeNumericString",value:function(e){return this._serialize(e,!1,"unformatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeFormatted",value:function(e){return this._serialize(e,!1,"formatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeLocalized",value:function(e){return this._serialize(e,!1,"localized",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+",arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)}},{key:"_serializeNumericStringArray",value:function(e){return this._serialize(e,!0,"unformatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeFormattedArray",value:function(e){return this._serialize(e,!0,"formatted",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+")}},{key:"_serializeLocalizedArray",value:function(e){return this._serialize(e,!0,"localized",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+",arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)}}],R&&Ke(k.prototype,R),B&&Ke(k,B),Object.defineProperty(k,"prototype",{writable:!1}),s}();xe(N,"options",void 0),xe(N,"events",void 0),xe(N,"defaultSettings",void 0),xe(N,"predefinedOptions",void 0),N.multiple=function(s){var k=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,R=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,B=[];if(n.isObject(k)&&(R=k,k=null),n.isString(s))s=Y(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 e=Y(s.rootElement.querySelectorAll("input"));Object.prototype.hasOwnProperty.call(s,"exclude")?(Array.isArray(s.exclude)||n.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),s=n.filterOut(e,s.exclude)):s=e}else n.isArray(s)||n.throwError("The given parameters to the 'multiple' function are invalid.");if(0===s.length){var i=!0;return!n.isNull(R)&&n.isBoolean(R.showWarnings)&&(i=R.showWarnings),n.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",i),[]}var a=n.isArray(k)&&k.length>=1,r=!1,h=!1;if(a){var O=ue(Number(k[0]));(r="number"===O&&!isNaN(Number(k[0])))||("string"===O||isNaN(O)||"object"===O)&&(h=!0)}var C,A=!1;if(n.isArray(R)&&R.length>=1){var Z=ue(R[0]);"string"!==Z&&"object"!==Z||(A=!0)}C=h?N.mergeOptions(k):A?N.mergeOptions(R):R;var f,I=n.isNumber(k);return r&&(f=k.length),s.forEach(function(j,q){B.push(new N(j,I?k:r&&q<=f?k[q]:null,C))}),B},N.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(N.events.native),Object.freeze(N.events),Object.defineProperty(N,"events",{configurable:!1,writable:!1}),N.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",twoThree:"2t",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"},modifyValueOnUpDownArrow:{modifyValue:!0,doNothing:!1},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"},negativePositiveSignBehavior:{toggle:!0,doNotToggle:!1},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 s>=-1&&s<0?0:0===Number(s)?1:s>0&&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},upDownStep:{progressive:"progressive"},valuesToStrings:{none:null,zeroDash:{0:"-"},oneAroundZero:{"-1":"Min",1:"Max"}},watchExternalChanges:{watch:!0,doNotWatch:!1},wheelOn:{focus:"focus",hover:"hover"},wheelStep:{progressive:"progressive"}},_e=N.options,Object.getOwnPropertyNames(_e).forEach(function(s){"valuesToStrings"===s?Object.getOwnPropertyNames(_e.valuesToStrings).forEach(function(k){null!==_e.valuesToStrings[k]&&Object.freeze(_e.valuesToStrings[k])}):"styleRules"!==s&&null!==_e[s]&&Object.freeze(_e[s])}),Object.freeze(_e),Object.defineProperty(N,"options",{configurable:!1,writable:!1}),N.defaultSettings={allowDecimalPadding:N.options.allowDecimalPadding.always,alwaysAllowDecimalCharacter:N.options.alwaysAllowDecimalCharacter.doNotAllow,caretPositionOnFocus:N.options.caretPositionOnFocus.doNoForceCaretPosition,createLocalList:N.options.createLocalList.createList,currencySymbol:N.options.currencySymbol.none,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,decimalCharacter:N.options.decimalCharacter.dot,decimalCharacterAlternative:N.options.decimalCharacterAlternative.none,decimalPlaces:N.options.decimalPlaces.two,decimalPlacesRawValue:N.options.decimalPlacesRawValue.useDefault,decimalPlacesShownOnBlur:N.options.decimalPlacesShownOnBlur.useDefault,decimalPlacesShownOnFocus:N.options.decimalPlacesShownOnFocus.useDefault,defaultValueOverride:N.options.defaultValueOverride.doNotOverride,digitalGroupSpacing:N.options.digitalGroupSpacing.three,digitGroupSeparator:N.options.digitGroupSeparator.comma,divisorWhenUnfocused:N.options.divisorWhenUnfocused.none,emptyInputBehavior:N.options.emptyInputBehavior.focus,eventBubbles:N.options.eventBubbles.bubbles,eventIsCancelable:N.options.eventIsCancelable.isCancelable,failOnUnknownOption:N.options.failOnUnknownOption.ignore,formatOnPageLoad:N.options.formatOnPageLoad.format,formulaMode:N.options.formulaMode.disabled,historySize:N.options.historySize.medium,invalidClass:N.options.invalidClass,isCancellable:N.options.isCancellable.cancellable,leadingZero:N.options.leadingZero.deny,maximumValue:N.options.maximumValue.tenTrillions,minimumValue:N.options.minimumValue.tenTrillions,modifyValueOnUpDownArrow:N.options.modifyValueOnUpDownArrow.modifyValue,modifyValueOnWheel:N.options.modifyValueOnWheel.modifyValue,negativeBracketsTypeOnBlur:N.options.negativeBracketsTypeOnBlur.none,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.none,negativeSignCharacter:N.options.negativeSignCharacter.hyphen,negativePositiveSignBehavior:N.options.negativePositiveSignBehavior.doNotToggle,noEventListeners:N.options.noEventListeners.addEvents,onInvalidPaste:N.options.onInvalidPaste.error,outputFormat:N.options.outputFormat.none,overrideMinMaxLimits:N.options.overrideMinMaxLimits.doNotOverride,positiveSignCharacter:N.options.positiveSignCharacter.plus,rawValueDivisor:N.options.rawValueDivisor.none,readOnly:N.options.readOnly.readWrite,roundingMethod:N.options.roundingMethod.halfUpSymmetric,saveValueToSessionStorage:N.options.saveValueToSessionStorage.doNotSave,selectNumberOnly:N.options.selectNumberOnly.selectNumbersOnly,selectOnFocus:N.options.selectOnFocus.select,serializeSpaces:N.options.serializeSpaces.plus,showOnlyNumbersOnFocus:N.options.showOnlyNumbersOnFocus.showAll,showPositiveSign:N.options.showPositiveSign.hide,showWarnings:N.options.showWarnings.show,styleRules:N.options.styleRules.none,suffixText:N.options.suffixText.none,symbolWhenUnfocused:N.options.symbolWhenUnfocused.none,unformatOnHover:N.options.unformatOnHover.unformat,unformatOnSubmit:N.options.unformatOnSubmit.keepCurrentValue,upDownStep:"1",valuesToStrings:N.options.valuesToStrings.none,watchExternalChanges:N.options.watchExternalChanges.doNotWatch,wheelOn:N.options.wheelOn.focus,wheelStep:N.options.wheelStep.progressive},Object.freeze(N.defaultSettings),Object.defineProperty(N,"defaultSettings",{configurable:!1,writable:!1});var ye={digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,decimalCharacterAlternative:N.options.decimalCharacterAlternative.dot,currencySymbol:"\u202f\u20ac",currencySymbolPlacement:N.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.prefix},ke={digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.dollar,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},He={digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.yen,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right};n.cloneObject(ye).formulaMode=N.options.formulaMode.enabled;var Qe=n.cloneObject(ye);Qe.minimumValue=0;var Ue=n.cloneObject(ye);Ue.maximumValue=0,Ue.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var Fe=n.cloneObject(ye);Fe.digitGroupSeparator=N.options.digitGroupSeparator.normalSpace;var $e=n.cloneObject(Fe);$e.minimumValue=0;var Ze=n.cloneObject(Fe);Ze.maximumValue=0,Ze.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var be=n.cloneObject(ye);be.currencySymbol=N.options.currencySymbol.none,be.suffixText="\u202f".concat(N.options.suffixText.percentage),be.wheelStep=1e-4,be.rawValueDivisor=N.options.rawValueDivisor.percentage;var je=n.cloneObject(be);je.minimumValue=0;var Ve=n.cloneObject(be);Ve.maximumValue=0,Ve.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var Ye=n.cloneObject(be);Ye.decimalPlaces=3;var ze=n.cloneObject(je);ze.decimalPlaces=3;var Xe=n.cloneObject(Ve);Xe.decimalPlaces=3,n.cloneObject(ke).formulaMode=N.options.formulaMode.enabled;var Ge=n.cloneObject(ke);Ge.minimumValue=0;var Me=n.cloneObject(ke);Me.maximumValue=0,Me.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var et=n.cloneObject(Me);et.negativeBracketsTypeOnBlur=N.options.negativeBracketsTypeOnBlur.parentheses;var Se=n.cloneObject(ke);Se.currencySymbol=N.options.currencySymbol.none,Se.suffixText=N.options.suffixText.percentage,Se.wheelStep=1e-4,Se.rawValueDivisor=N.options.rawValueDivisor.percentage;var qe=n.cloneObject(Se);qe.minimumValue=0;var De=n.cloneObject(Se);De.maximumValue=0,De.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var we=n.cloneObject(Se);we.decimalPlaces=3;var at=n.cloneObject(qe);at.decimalPlaces=3;var ot=n.cloneObject(De);ot.decimalPlaces=3;var st=n.cloneObject(ye);st.currencySymbol=N.options.currencySymbol.lira,N.predefinedOptions={euro:ye,euroPos:Qe,euroNeg:Ue,euroSpace:Fe,euroSpacePos:$e,euroSpaceNeg:Ze,percentageEU2dec:be,percentageEU2decPos:je,percentageEU2decNeg:Ve,percentageEU3dec:Ye,percentageEU3decPos:ze,percentageEU3decNeg:Xe,dollar:ke,dollarPos:Ge,dollarNeg:Me,dollarNegBrackets:et,percentageUS2dec:Se,percentageUS2decPos:qe,percentageUS2decNeg:De,percentageUS3dec:we,percentageUS3decPos:at,percentageUS3decNeg:ot,French:ye,Spanish:ye,NorthAmerican:ke,British:{digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.pound,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},Swiss:{digitGroupSeparator:N.options.digitGroupSeparator.apostrophe,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:"\u202fCHF",currencySymbolPlacement:N.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.prefix},Japanese:He,Chinese:He,Brazilian:{digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,currencySymbol:N.options.currencySymbol.real,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},Turkish:st,dotDecimalCharCommaSeparator:{digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot},commaDecimalCharDotSeparator:{digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,decimalCharacterAlternative:N.options.decimalCharacterAlternative.dot},integer:{decimalPlaces:0},integerPos:{minimumValue:N.options.minimumValue.zero,decimalPlaces:0},integerNeg:{maximumValue:N.options.maximumValue.zero,decimalPlaces:0},float:{allowDecimalPadding:N.options.allowDecimalPadding.never},floatPos:{allowDecimalPadding:N.options.allowDecimalPadding.never,minimumValue:N.options.minimumValue.zero,maximumValue:N.options.maximumValue.tenTrillions},floatNeg:{allowDecimalPadding:N.options.allowDecimalPadding.never,minimumValue:N.options.minimumValue.tenTrillions,maximumValue:N.options.maximumValue.zero},numeric:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none},numericPos:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none,minimumValue:N.options.minimumValue.zero,maximumValue:N.options.maximumValue.tenTrillions},numericNeg:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none,minimumValue:N.options.minimumValue.tenTrillions,maximumValue:N.options.maximumValue.zero}},Object.getOwnPropertyNames(N.predefinedOptions).forEach(function(s){Object.freeze(N.predefinedOptions[s])}),Object.freeze(N.predefinedOptions),Object.defineProperty(N,"predefinedOptions",{configurable:!1,writable:!1});const ht=N;return F.default})(),J.exports=E()},6387:(J,P,E)=>{"use strict";var F=z(E(4168)),v=z(E(6017)),L=z(E(1301)),D=z(E(7164)),l=z(E(8619)),n=z(E(4866)),p=z(E(3057)),w=E(723),U=z(E(530));function z(Q){return Q&&Q.__esModule?Q:{default:Q}}var G=function(){},X=function(ee,ne,Y){var K=new G;if(typeof ee>"u")throw Error("No element to render on was provided.");return K._renderProperties=(0,l.default)(ee),K._encodings=[],K._options=U.default,K._errorHandler=new p.default(K),typeof ne<"u"&&((Y=Y||{}).format||(Y.format=Te()),K.options(Y)[Y.format](ne,Y).render()),K};for(var fe in X.getModule=function(Q){return F.default[Q]},F.default)F.default.hasOwnProperty(fe)&&de(F.default,fe);function de(Q,ee){G.prototype[ee]=G.prototype[ee.toUpperCase()]=G.prototype[ee.toLowerCase()]=function(ne,Y){var K=this;return K._errorHandler.wrapBarcodeCall(function(){Y.text=typeof Y.text>"u"?void 0:""+Y.text;var le=(0,v.default)(K._options,Y);le=(0,n.default)(le);var ce=he(ne,Q[ee],le);return K._encodings.push(ce),K})}}function he(Q,ee,ne){var Y=new ee(Q=""+Q,ne);if(!Y.valid())throw new w.InvalidInputException(Y.constructor.name,Q);var K=Y.encode();K=(0,L.default)(K);for(var le=0;le<K.length;le++)K[le].options=(0,v.default)(ne,K[le].options);return K}function Te(){return F.default.CODE128?"CODE128":Object.keys(F.default)[0]}function Ne(Q,ee,ne){ee=(0,L.default)(ee);for(var Y=0;Y<ee.length;Y++)ee[Y].options=(0,v.default)(ne,ee[Y].options),(0,D.default)(ee[Y].options);(0,D.default)(ne),new(0,Q.renderer)(Q.element,ee,ne).render(),Q.afterRender&&Q.afterRender()}G.prototype.options=function(Q){return this._options=(0,v.default)(this._options,Q),this},G.prototype.blank=function(Q){var ee=new Array(Q+1).join("0");return this._encodings.push({data:ee}),this},G.prototype.init=function(){var Q;if(this._renderProperties)for(var ee in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){var ne=(0,v.default)(this._options,(Q=this._renderProperties[ee]).options);"auto"==ne.format&&(ne.format=Te()),this._errorHandler.wrapBarcodeCall(function(){var le=he(ne.value,F.default[ne.format.toUpperCase()],ne);Ne(Q,le,ne)})}},G.prototype.render=function(){if(!this._renderProperties)throw new w.NoElementException;if(Array.isArray(this._renderProperties))for(var Q=0;Q<this._renderProperties.length;Q++)Ne(this._renderProperties[Q],this._encodings,this._options);else Ne(this._renderProperties,this._encodings,this._options);return this},G.prototype._defaults=U.default,typeof window<"u"&&(window.JsBarcode=X),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(Q,ee){var ne=[];return jQuery(this).each(function(){ne.push(this)}),X(ne,Q,ee)}),J.exports=X},9418:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.default=function F(t,v){(function E(F,t){if(!(F instanceof t))throw new TypeError("Cannot call a class as a function")})(this,F),this.data=t,this.text=v.text||t,this.options=v}},8514:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function l(c,n){for(var d=0;d<n.length;d++){var p=n[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,n,d){return n&&l(c.prototype,n),d&&l(c,d),c}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(E(9418)),v=E(9144),y=function(l){function c(n,d){!function L(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c);var p=function T(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,n.substring(1),d));return p.bytes=n.split("").map(function(w){return w.charCodeAt(0)}),p}return function D(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),x(c,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var d=this.bytes,p=d.shift()-105,w=v.SET_BY_CODE[p];if(void 0===w)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&d.unshift(v.FNC1);var b=c.next(d,1,w);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:c.getBar(p)+b.result+c.getBar((b.checksum+p)%v.MODULO)+c.getBar(v.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var d=this.options.ean128||!1;return"string"==typeof d&&(d="true"===d.toLowerCase()),d}}],[{key:"getBar",value:function(d){return v.BARS[d]?v.BARS[d].toString():""}},{key:"correctIndex",value:function(d,p){if(p===v.SET_A){var w=d.shift();return w<32?w+64:w-32}return p===v.SET_B?d.shift()-32:10*(d.shift()-48)+d.shift()-48}},{key:"next",value:function(d,p,w){if(!d.length)return{result:"",checksum:0};var b=void 0,U=void 0;if(d[0]>=200){U=d.shift()-105;var z=v.SWAP[U];void 0!==z?b=c.next(d,p+1,z):((w===v.SET_A||w===v.SET_B)&&U===v.SHIFT&&(d[0]=w===v.SET_A?d[0]>95?d[0]-96:d[0]:d[0]<32?d[0]+96:d[0]),b=c.next(d,p+1,w))}else U=c.correctIndex(d,w),b=c.next(d,p+1,w);return{result:c.getBar(U)+b.result,checksum:U*p+b.checksum}}}]),c}(t.default);P.default=y},2100:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function l(c,n){for(var d=0;d<n.length;d++){var p=n[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,n,d){return n&&l(c.prototype,n),d&&l(c,d),c}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(E(8514)),v=E(9144),y=function(l){function c(n,d){return function L(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function T(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,v.A_START_CHAR+n,d))}return function D(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),x(c,[{key:"valid",value:function(){return new RegExp("^"+v.A_CHARS+"+$").test(this.data)}}]),c}(t.default);P.default=y},2943:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function l(c,n){for(var d=0;d<n.length;d++){var p=n[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,n,d){return n&&l(c.prototype,n),d&&l(c,d),c}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(E(8514)),v=E(9144),y=function(l){function c(n,d){return function L(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function T(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,v.B_START_CHAR+n,d))}return function D(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),x(c,[{key:"valid",value:function(){return new RegExp("^"+v.B_CHARS+"+$").test(this.data)}}]),c}(t.default);P.default=y},5683:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function l(c,n){for(var d=0;d<n.length;d++){var p=n[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,n,d){return n&&l(c.prototype,n),d&&l(c,d),c}}(),t=function M(l){return l&&l.__esModule?l:{default:l}}(E(8514)),v=E(9144),y=function(l){function c(n,d){return function L(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function T(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,v.C_START_CHAR+n,d))}return function D(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),x(c,[{key:"valid",value:function(){return new RegExp("^"+v.C_CHARS+"+$").test(this.data)}}]),c}(t.default);P.default=y},7737:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=M(E(8514)),v=M(E(4336));function M(l){return l&&l.__esModule?l:{default:l}}function T(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}var y=function(l){function c(n,d){if(function L(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var p=T(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,(0,v.default)(n),d));else p=T(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,n,d));return T(p)}return function D(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),c}(F.default);P.default=y},4336:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=E(9144),F=function(D){return D.match(new RegExp("^"+x.A_CHARS+"*"))[0].length},t=function(D){return D.match(new RegExp("^"+x.B_CHARS+"*"))[0].length},v=function(D){return D.match(new RegExp("^"+x.C_CHARS+"*"))[0]};function M(T,D){var y=D?x.A_CHARS:x.B_CHARS,l=T.match(new RegExp("^("+y+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(l)return l[1]+String.fromCharCode(204)+L(T.substring(l[1].length));var c=T.match(new RegExp("^"+y+"+"))[0];return c.length===T.length?T:c+String.fromCharCode(D?205:206)+M(T.substring(c.length),!D)}function L(T){var D=v(T),y=D.length;if(y===T.length)return T;T=T.substring(y);var l=F(T)>=t(T);return D+String.fromCharCode(l?206:205)+M(T,l)}P.default=function(T){var D=void 0;if(v(T).length>=2)D=x.C_START_CHAR+L(T);else{var l=F(T)>t(T);D=(l?x.A_START_CHAR:x.B_START_CHAR)+M(T,l)}return D.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(c,n){return String.fromCharCode(203)+n})}},9144:(J,P)=>{"use strict";var E;function x(fe,de,he){return de in fe?Object.defineProperty(fe,de,{value:he,enumerable:!0,configurable:!0,writable:!0}):fe[de]=he,fe}Object.defineProperty(P,"__esModule",{value:!0});var F=P.SET_A=0,t=P.SET_B=1,v=P.SET_C=2,L=(P.SHIFT=98,P.START_A=103),T=P.START_B=104,D=P.START_C=105;P.MODULO=103,P.STOP=106,P.FNC1=207,P.SET_BY_CODE=(x(E={},L,F),x(E,T,t),x(E,D,v),E),P.SWAP={101:F,100:t,99:v},P.A_START_CHAR=String.fromCharCode(208),P.B_START_CHAR=String.fromCharCode(209),P.C_START_CHAR=String.fromCharCode(210),P.A_CHARS="[\0-_\xc8-\xcf]",P.B_CHARS="[ -\x7f\xc8-\xcf]",P.C_CHARS="(\xcf*[0-9]{2}\xcf*)",P.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]},8754:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.CODE128C=P.CODE128B=P.CODE128A=P.CODE128=void 0;var F=y(E(7737)),v=y(E(2100)),L=y(E(2943)),D=y(E(5683));function y(l){return l&&l.__esModule?l:{default:l}}P.CODE128=F.default,P.CODE128A=v.default,P.CODE128B=L.default,P.CODE128C=D.default},6602:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.CODE39=void 0;var x=function(){function b(U,z){for(var G=0;G<z.length;G++){var X=z[G];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(U,X.key,X)}}return function(U,z,G){return z&&b(U.prototype,z),G&&b(U,G),U}}(),D=function(b){function U(z,G){return function M(b,U){if(!(b instanceof U))throw new TypeError("Cannot call a class as a function")}(this,U),z=z.toUpperCase(),G.mod43&&(z+=function d(b){return y[b]}(function w(b){for(var U=0,z=0;z<b.length;z++)U+=p(b[z]);return U%=43}(z))),function L(b,U){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!U||"object"!=typeof U&&"function"!=typeof U?b:U}(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,z,G))}return function T(b,U){if("function"!=typeof U&&null!==U)throw new TypeError("Super expression must either be null or a function, not "+typeof U);b.prototype=Object.create(U&&U.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(b,U):b.__proto__=U)}(U,b),x(U,[{key:"encode",value:function(){for(var G=c("*"),X=0;X<this.data.length;X++)G+=c(this.data[X])+"0";return{data:G+=c("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),U}(function v(b){return b&&b.__esModule?b:{default:b}}(E(9418)).default),y=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],l=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function c(b){return function n(b){return l[b].toString(2)}(p(b))}function p(b){return y.indexOf(b)}P.CODE39=D},4079:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function n(d,p){for(var w=0;w<p.length;w++){var b=p[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(d,b.key,b)}}return function(d,p,w){return p&&n(d.prototype,p),w&&n(d,w),d}}(),F=E(1392),v=T(E(2651));function T(n){return n&&n.__esModule?n:{default:n}}var c=function(n){function d(p,w){!function D(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")}(this,d);var b=function y(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,p,w));return b.fontSize=!w.flat&&w.fontSize>10*w.width?10*w.width:w.fontSize,b.guardHeight=w.height+b.fontSize/2+w.textMargin,b}return function l(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),x(d,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(w,b){return this.text.substr(w,b)}},{key:"leftEncode",value:function(w,b){return(0,v.default)(w,b)}},{key:"rightText",value:function(w,b){return this.text.substr(w,b)}},{key:"rightEncode",value:function(w,b){return(0,v.default)(w,b)}},{key:"encodeGuarded",value:function(){var w={fontSize:this.fontSize},b={height:this.guardHeight};return[{data:F.SIDE_BIN,options:b},{data:this.leftEncode(),text:this.leftText(),options:w},{data:F.MIDDLE_BIN,options:b},{data:this.rightEncode(),text:this.rightText(),options:w},{data:F.SIDE_BIN,options:b}]}},{key:"encodeFlat",value:function(){return{data:[F.SIDE_BIN,this.leftEncode(),F.MIDDLE_BIN,this.rightEncode(),F.SIDE_BIN].join(""),text:this.text}}}]),d}(T(E(9418)).default);P.default=c},9619:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function n(d,p){for(var w=0;w<p.length;w++){var b=p[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(d,b.key,b)}}return function(d,p,w){return p&&n(d.prototype,p),w&&n(d,w),d}}(),F=function n(d,p,w){null===d&&(d=Function.prototype);var b=Object.getOwnPropertyDescriptor(d,p);if(void 0===b){var U=Object.getPrototypeOf(d);return null===U?void 0:n(U,p,w)}if("value"in b)return b.value;var z=b.get;return void 0===z?void 0:z.call(w)},t=E(1392),M=function L(n){return n&&n.__esModule?n:{default:n}}(E(4079)),l=function(d){return(10-d.substr(0,12).split("").map(function(w){return+w}).reduce(function(w,b,U){return U%2?w+3*b:w+b},0)%10)%10},c=function(n){function d(p,w){(function T(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")})(this,d),-1!==p.search(/^[0-9]{12}$/)&&(p+=l(p));var b=function D(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,p,w));return b.lastChar=w.lastChar,b}return function y(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),x(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===l(this.data)}},{key:"leftText",value:function(){return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var w=this.data.substr(1,6),b=t.EAN13_STRUCTURE[this.data[0]];return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"leftEncode",this).call(this,w,b)}},{key:"rightText",value:function(){return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var w=this.data.substr(7,6);return F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"rightEncode",this).call(this,w,"RRRRRR")}},{key:"encodeGuarded",value:function(){var w=F(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(w.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(w.push({data:"00"}),w.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),w}}]),d}(M.default);P.default=c},5754:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function n(d,p){for(var w=0;w<p.length;w++){var b=p[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(d,b.key,b)}}return function(d,p,w){return p&&n(d.prototype,p),w&&n(d,w),d}}(),F=E(1392),v=T(E(2651));function T(n){return n&&n.__esModule?n:{default:n}}var c=function(n){function d(p,w){return function D(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")}(this,d),function y(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,p,w))}return function l(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),x(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var w=F.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,v.default)(this.data,w,"01"),text:this.text}}}]),d}(T(E(9418)).default);P.default=c},1931:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function d(p,w){for(var b=0;b<w.length;b++){var U=w[b];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(p,U.key,U)}}return function(p,w,b){return w&&d(p.prototype,w),b&&d(p,b),p}}(),F=E(1392),v=T(E(2651));function T(d){return d&&d.__esModule?d:{default:d}}var n=function(d){function p(w,b){return function D(d,p){if(!(d instanceof p))throw new TypeError("Cannot call a class as a function")}(this,p),function y(d,p){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!p||"object"!=typeof p&&"function"!=typeof p?d:p}(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,w,b))}return function l(d,p){if("function"!=typeof p&&null!==p)throw new TypeError("Super expression must either be null or a function, not "+typeof p);d.prototype=Object.create(p&&p.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(d,p):d.__proto__=p)}(p,d),x(p,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var b=F.EAN5_STRUCTURE[function(p){return p.split("").map(function(b){return+b}).reduce(function(b,U,z){return z%2?b+9*U:b+3*U},0)%10}(this.data)];return{data:"1011"+(0,v.default)(this.data,b,"01"),text:this.text}}}]),p}(T(E(9418)).default);P.default=n},3372:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function c(n,d){for(var p=0;p<d.length;p++){var w=d[p];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(n,w.key,w)}}return function(n,d,p){return d&&c(n.prototype,d),p&&c(n,p),n}}(),F=function c(n,d,p){null===n&&(n=Function.prototype);var w=Object.getOwnPropertyDescriptor(n,d);if(void 0===w){var b=Object.getPrototypeOf(n);return null===b?void 0:c(b,d,p)}if("value"in w)return w.value;var U=w.get;return void 0===U?void 0:U.call(p)},v=function M(c){return c&&c.__esModule?c:{default:c}}(E(4079)),y=function(n){return(10-n.substr(0,7).split("").map(function(p){return+p}).reduce(function(p,w,b){return b%2?p+w:p+3*w},0)%10)%10},l=function(c){function n(d,p){return function L(c,n){if(!(c instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),-1!==d.search(/^[0-9]{7}$/)&&(d+=y(d)),function T(c,n){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?c:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,d,p))}return function D(c,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);c.prototype=Object.create(n&&n.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(c,n):c.__proto__=n)}(n,c),x(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===y(this.data)}},{key:"leftText",value:function(){return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var p=this.data.substr(0,4);return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftEncode",this).call(this,p,"LLLL")}},{key:"rightText",value:function(){return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var p=this.data.substr(4,4);return F(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightEncode",this).call(this,p,"RRRR")}}]),n}(v.default);P.default=l},5821:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function n(d,p){for(var w=0;w<p.length;w++){var b=p[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(d,b.key,b)}}return function(d,p,w){return p&&n(d.prototype,p),w&&n(d,w),d}}();P.checksum=c;var t=L(E(2651));function L(n){return n&&n.__esModule?n:{default:n}}var l=function(n){function d(p,w){(function T(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")})(this,d),-1!==p.search(/^[0-9]{11}$/)&&(p+=c(p));var b=function D(n,d){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||"object"!=typeof d&&"function"!=typeof d?n:d}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,p,w));return b.displayValue=w.displayValue,b.fontSize=w.fontSize>10*w.width?10*w.width:w.fontSize,b.guardHeight=w.height+b.fontSize/2+w.textMargin,b}return function y(n,d){if("function"!=typeof d&&null!==d)throw new TypeError("Super expression must either be null or a function, not "+typeof d);n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(n,d):n.__proto__=d)}(d,n),x(d,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==c(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var w="";return w+="101",w+=(0,t.default)(this.data.substr(0,6),"LLLLLL"),w+="01010",w+=(0,t.default)(this.data.substr(6,6),"RRRRRR"),{data:w+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var w=[];return this.displayValue&&w.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),w.push({data:"101"+(0,t.default)(this.data[0],"L"),options:{height:this.guardHeight}}),w.push({data:(0,t.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),w.push({data:"01010",options:{height:this.guardHeight}}),w.push({data:(0,t.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),w.push({data:(0,t.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&w.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),w}}]),d}(L(E(9418)).default);function c(n){var p,d=0;for(p=1;p<11;p+=2)d+=parseInt(n[p]);for(p=0;p<11;p+=2)d+=3*parseInt(n[p]);return(10-d%10)%10}P.default=l},1091:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function w(b,U){for(var z=0;z<U.length;z++){var G=U[z];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(b,G.key,G)}}return function(b,U,z){return U&&w(b.prototype,U),z&&w(b,z),b}}(),t=T(E(2651)),M=T(E(9418)),L=E(5821);function T(w){return w&&w.__esModule?w:{default:w}}function y(w,b){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?w:b}var c=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],n=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],d=function(w){function b(U,z){!function D(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")}(this,b);var G=y(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,U,z));if(G.isValid=!1,-1!==U.search(/^[0-9]{6}$/))G.middleDigits=U,G.upcA=p(U,"0"),G.text=z.text||""+G.upcA[0]+U+G.upcA[G.upcA.length-1],G.isValid=!0;else{if(-1===U.search(/^[01][0-9]{7}$/))return y(G);if(G.middleDigits=U.substring(1,U.length-1),G.upcA=p(G.middleDigits,U[0]),G.upcA[G.upcA.length-1]!==U[U.length-1])return y(G);G.isValid=!0}return G.displayValue=z.displayValue,G.fontSize=z.fontSize>10*z.width?10*z.width:z.fontSize,G.guardHeight=z.height+G.fontSize/2+z.textMargin,G}return function l(w,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);w.prototype=Object.create(b&&b.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(w,b):w.__proto__=b)}(b,w),x(b,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var z="";return z+="101",z+=this.encodeMiddleDigits(),{data:z+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var z=[];return this.displayValue&&z.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),z.push({data:"101",options:{height:this.guardHeight}}),z.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),z.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&z.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),z}},{key:"encodeMiddleDigits",value:function(){var z=this.upcA[0],X=n[parseInt(this.upcA[this.upcA.length-1])][parseInt(z)];return(0,t.default)(this.middleDigits,X)}}]),b}(M.default);function p(w,b){for(var U=parseInt(w[w.length-1]),z=c[U],G="",X=0,fe=0;fe<z.length;fe++){var de=z[fe];G+="X"===de?w[X++]:de}return(G=""+b+G)+(0,L.checksum)(G)}P.default=d},1392:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.SIDE_BIN="101",P.MIDDLE_BIN="01010",P.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"]},P.EAN2_STRUCTURE=["LL","LG","GL","GG"],P.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],P.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},2651:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=E(1392);P.default=function(v,M,L){var T=v.split("").map(function(y,l){return x.BINARIES[M[l]]}).map(function(y,l){return y?y[v[l]]:""});if(L){var D=v.length-1;T=T.map(function(y,l){return l<D?y+L:y})}return T.join("")}},2708:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.UPCE=P.UPC=P.EAN2=P.EAN5=P.EAN8=P.EAN13=void 0;var F=d(E(9619)),v=d(E(3372)),L=d(E(1931)),D=d(E(5754)),l=d(E(5821)),n=d(E(1091));function d(p){return p&&p.__esModule?p:{default:p}}P.EAN13=F.default,P.EAN8=v.default,P.EAN5=L.default,P.EAN2=D.default,P.UPC=l.default,P.UPCE=n.default},8817:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.GenericBarcode=void 0;var x=function(){function y(l,c){for(var n=0;n<c.length;n++){var d=c[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,c,n){return c&&y(l.prototype,c),n&&y(l,n),l}}(),D=function(y){function l(c,n){return function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function L(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c,n))}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),x(l,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),l}(function v(y){return y&&y.__esModule?y:{default:y}}(E(9418)).default);P.GenericBarcode=D},6065:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function l(c,n){for(var d=0;d<n.length;d++){var p=n[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,n,d){return n&&l(c.prototype,n),d&&l(c,d),c}}(),F=E(5168),y=function(l){function c(){return function L(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function T(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return function D(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),x(c,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var d=this,p=this.data.match(/.{2}/g).map(function(w){return d.encodePair(w)}).join("");return{data:F.START_BIN+p+F.END_BIN,text:this.text}}},{key:"encodePair",value:function(d){var p=F.BINARIES[d[1]];return F.BINARIES[d[0]].split("").map(function(w,b){return("1"===w?"111":"1")+("1"===p[b]?"000":"0")}).join("")}}]),c}(function M(l){return l&&l.__esModule?l:{default:l}}(E(9418)).default);P.default=y},9643:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function l(c,n){for(var d=0;d<n.length;d++){var p=n[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,n,d){return n&&l(c.prototype,n),d&&l(c,d),c}}(),t=function v(l){return l&&l.__esModule?l:{default:l}}(E(6065)),D=function(c){var n=c.substr(0,13).split("").map(function(d){return parseInt(d,10)}).reduce(function(d,p,w){return d+p*(3-w%2*2)},0);return 10*Math.ceil(n/10)-n},y=function(l){function c(n,d){return function M(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),-1!==n.search(/^[0-9]{13}$/)&&(n+=D(n)),function L(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,n,d))}return function T(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),x(c,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===D(this.data)}}]),c}(t.default);P.default=y},5168:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.START_BIN="1010",P.END_BIN="11101",P.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},8969:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.ITF14=P.ITF=void 0;var F=M(E(6065)),v=M(E(9643));function M(L){return L&&L.__esModule?L:{default:L}}P.ITF=F.default,P.ITF14=v.default},7037:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function l(c,n){for(var d=0;d<n.length;d++){var p=n[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}return function(c,n,d){return n&&l(c.prototype,n),d&&l(c,d),c}}(),D=function(l){function c(n,d){return function M(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function L(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?l:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,n,d))}return function T(l,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(c,l),x(c,[{key:"encode",value:function(){for(var d="110",p=0;p<this.data.length;p++){var b=parseInt(this.data[p]).toString(2);b=y(b,4-b.length);for(var U=0;U<b.length;U++)d+="0"==b[U]?"100":"110"}return{data:d+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),c}(function v(l){return l&&l.__esModule?l:{default:l}}(E(9418)).default);function y(l,c){for(var n=0;n<c;n++)l="0"+l;return l}P.default=D},3922:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),D=function(y){function l(c,n){return function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function L(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c+(0,t.mod10)(c),n))}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(F.default);P.default=D},8742:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),D=function(y){function l(c,n){return function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),c+=(0,t.mod10)(c),c+=(0,t.mod10)(c),function L(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c,n))}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(F.default);P.default=D},1825:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),D=function(y){function l(c,n){return function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),function L(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c+(0,t.mod11)(c),n))}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(F.default);P.default=D},4455:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=function v(y){return y&&y.__esModule?y:{default:y}}(E(7037)),t=E(6225),D=function(y){function l(c,n){return function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l),c+=(0,t.mod11)(c),c+=(0,t.mod10)(c),function L(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c,n))}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),l}(F.default);P.default=D},6225:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.mod10=function E(F){for(var t=0,v=0;v<F.length;v++){var M=parseInt(F[v]);t+=(v+F.length)%2==0?M:2*M%10+Math.floor(2*M/10)}return(10-t%10)%10},P.mod11=function x(F){for(var t=0,v=[2,3,4,5,6,7],M=0;M<F.length;M++){var L=parseInt(F[F.length-1-M]);t+=v[M%v.length]*L}return(11-t%11)%11}},1122:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.MSI1110=P.MSI1010=P.MSI11=P.MSI10=P.MSI=void 0;var F=c(E(7037)),v=c(E(3922)),L=c(E(1825)),D=c(E(8742)),l=c(E(4455));function c(n){return n&&n.__esModule?n:{default:n}}P.MSI=F.default,P.MSI10=v.default,P.MSI11=L.default,P.MSI1010=D.default,P.MSI1110=l.default},886:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.codabar=void 0;var x=function(){function y(l,c){for(var n=0;n<c.length;n++){var d=c[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,c,n){return c&&y(l.prototype,c),n&&y(l,n),l}}(),D=function(y){function l(c,n){(function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")})(this,l),0===c.search(/^[0-9\-\$\:\.\+\/]+$/)&&(c="A"+c+"A");var d=function L(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c.toUpperCase(),n));return d.text=d.options.text||d.text.replace(/[A-D]/g,""),d}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),x(l,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var n=[],d=this.getEncodings(),p=0;p<this.data.length;p++)n.push(d[this.data.charAt(p)]),p!==this.data.length-1&&n.push("0");return{text:this.text,data:n.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 v(y){return y&&y.__esModule?y:{default:y}}(E(9418)).default);P.codabar=D},4168:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=E(6602),F=E(8754),t=E(2708),v=E(8969),M=E(1122),L=E(8758),T=E(886),D=E(8817);P.default={CODE39:x.CODE39,CODE128:F.CODE128,CODE128A:F.CODE128A,CODE128B:F.CODE128B,CODE128C:F.CODE128C,EAN13:t.EAN13,EAN8:t.EAN8,EAN5:t.EAN5,EAN2:t.EAN2,UPC:t.UPC,UPCE:t.UPCE,ITF14:v.ITF14,ITF:v.ITF,MSI:M.MSI,MSI10:M.MSI10,MSI11:M.MSI11,MSI1010:M.MSI1010,MSI1110:M.MSI1110,pharmacode:L.pharmacode,codabar:T.codabar,GenericBarcode:D.GenericBarcode}},8758:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.pharmacode=void 0;var x=function(){function y(l,c){for(var n=0;n<c.length;n++){var d=c[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,c,n){return c&&y(l.prototype,c),n&&y(l,n),l}}(),D=function(y){function l(c,n){!function M(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")}(this,l);var d=function L(y,l){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||"object"!=typeof l&&"function"!=typeof l?y:l}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,c,n));return d.number=parseInt(c,10),d}return function T(y,l){if("function"!=typeof l&&null!==l)throw new TypeError("Super expression must either be null or a function, not "+typeof l);y.prototype=Object.create(l&&l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(y,l):y.__proto__=l)}(l,y),x(l,[{key:"encode",value:function(){for(var n=this.number,d="";!isNaN(n)&&0!=n;)n%2==0?(d="11100"+d,n=(n-2)/2):(d="100"+d,n=(n-1)/2);return{data:d=d.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),l}(function v(y){return y&&y.__esModule?y:{default:y}}(E(9418)).default);P.pharmacode=D},3057:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var E=function(){function t(v,M){for(var L=0;L<M.length;L++){var T=M[L];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,T.key,T)}}return function(v,M,L){return M&&t(v.prototype,M),L&&t(v,L),v}}(),F=function(){function t(v){(function x(t,v){if(!(t instanceof v))throw new TypeError("Cannot call a class as a function")})(this,t),this.api=v}return E(t,[{key:"handleCatch",value:function(M){if("InvalidInputException"!==M.name)throw M;if(this.api._options.valid===this.api._defaults.valid)throw M.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(M){try{var L=M.apply(void 0,arguments);return this.api._options.valid(!0),L}catch(T){return this.handleCatch(T),this.api}}}]),t}();P.default=F},723:(J,P)=>{"use strict";function E(L,T){if(!(L instanceof T))throw new TypeError("Cannot call a class as a function")}function x(L,T){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!T||"object"!=typeof T&&"function"!=typeof T?L:T}function F(L,T){if("function"!=typeof T&&null!==T)throw new TypeError("Super expression must either be null or a function, not "+typeof T);L.prototype=Object.create(T&&T.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(L,T):L.__proto__=T)}Object.defineProperty(P,"__esModule",{value:!0});var t=function(L){function T(D,y){E(this,T);var l=x(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));return l.name="InvalidInputException",l.symbology=D,l.input=y,l.message='"'+l.input+'" is not a valid input for '+l.symbology,l}return F(T,Error),T}(),v=function(L){function T(){E(this,T);var D=x(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));return D.name="InvalidElementException",D.message="Not supported type to render on",D}return F(T,Error),T}(),M=function(L){function T(){E(this,T);var D=x(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));return D.name="NoElementException",D.message="No element to render on.",D}return F(T,Error),T}();P.InvalidInputException=t,P.InvalidElementException=v,P.NoElementException=M},7164:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.default=function E(x){return x.marginTop=x.marginTop||x.margin,x.marginBottom=x.marginBottom||x.margin,x.marginRight=x.marginRight||x.margin,x.marginLeft=x.marginLeft||x.margin,x}},7020:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=M(E(4866)),v=M(E(530));function M(T){return T&&T.__esModule?T:{default:T}}P.default=function L(T){var D={};for(var y in v.default)v.default.hasOwnProperty(y)&&(T.hasAttribute("jsbarcode-"+y.toLowerCase())&&(D[y]=T.getAttribute("jsbarcode-"+y.toLowerCase())),T.hasAttribute("data-"+y.toLowerCase())&&(D[y]=T.getAttribute("data-"+y.toLowerCase())));return D.value=T.getAttribute("jsbarcode-value")||T.getAttribute("data-value"),(0,F.default)(D)}},8619:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},t=T(E(7020)),M=T(E(2233)),L=E(723);function T(c){return c&&c.__esModule?c:{default:c}}P.default=function D(c){if("string"==typeof c)return function y(c){var n=document.querySelectorAll(c);if(0!==n.length){for(var d=[],p=0;p<n.length;p++)d.push(D(n[p]));return d}}(c);if(Array.isArray(c)){for(var n=[],d=0;d<c.length;d++)n.push(D(c[d]));return n}if(typeof HTMLCanvasElement<"u"&&c instanceof HTMLImageElement)return function l(c){var n=document.createElement("canvas");return{element:n,options:(0,t.default)(c),renderer:M.default.CanvasRenderer,afterRender:function(){c.setAttribute("src",n.toDataURL())}}}(c);if(c&&c.nodeName&&"svg"===c.nodeName.toLowerCase()||typeof SVGElement<"u"&&c instanceof SVGElement)return{element:c,options:(0,t.default)(c),renderer:M.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&c instanceof HTMLCanvasElement)return{element:c,options:(0,t.default)(c),renderer:M.default.CanvasRenderer};if(c&&c.getContext)return{element:c,renderer:M.default.CanvasRenderer};if(c&&"object"===(typeof c>"u"?"undefined":x(c))&&!c.nodeName)return{element:c,renderer:M.default.ObjectRenderer};throw new L.InvalidElementException}},1301:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.default=function E(x){var F=[];return function t(v){if(Array.isArray(v))for(var M=0;M<v.length;M++)t(v[M]);else v.text=v.text||"",v.data=v.data||"",F.push(v)}(x),F}},6017:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var E=Object.assign||function(x){for(var F=1;F<arguments.length;F++){var t=arguments[F];for(var v in t)Object.prototype.hasOwnProperty.call(t,v)&&(x[v]=t[v])}return x};P.default=function(x,F){return E({},x,F)}},4866:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.default=function E(x){var F=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var t in F)F.hasOwnProperty(t)&&"string"==typeof x[t=F[t]]&&(x[t]=parseInt(x[t],10));return"string"==typeof x.displayValue&&(x.displayValue="false"!=x.displayValue),x}},530:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.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(){}}},1799:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function D(y,l){for(var c=0;c<l.length;c++){var n=l[c];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(y,n.key,n)}}return function(y,l,c){return l&&D(y.prototype,l),c&&D(y,c),y}}(),t=function M(D){return D&&D.__esModule?D:{default:D}}(E(6017)),v=E(4358),T=function(){function D(y,l,c){(function L(D,y){if(!(D instanceof y))throw new TypeError("Cannot call a class as a function")})(this,D),this.canvas=y,this.encodings=l,this.options=c}return x(D,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var l=0;l<this.encodings.length;l++){var c=(0,t.default)(this.options,this.encodings[l].options);this.drawCanvasBarcode(c,this.encodings[l]),this.drawCanvasText(c,this.encodings[l]),this.moveCanvasDrawing(this.encodings[l])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var l=this.canvas.getContext("2d");l.save(),(0,v.calculateEncodingAttributes)(this.encodings,this.options,l);var c=(0,v.getTotalWidthOfEncodings)(this.encodings),n=(0,v.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=c+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,l.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(l.fillStyle=this.options.background,l.fillRect(0,0,this.canvas.width,this.canvas.height)),l.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(l,c){var p,n=this.canvas.getContext("2d"),d=c.data;p="top"==l.textPosition?l.marginTop+l.fontSize+l.textMargin:l.marginTop,n.fillStyle=l.lineColor;for(var w=0;w<d.length;w++){var b=w*l.width+c.barcodePadding;"1"===d[w]?n.fillRect(b,p,l.width,l.height):d[w]&&n.fillRect(b,p,l.width,l.height*d[w])}}},{key:"drawCanvasText",value:function(l,c){var p,w,n=this.canvas.getContext("2d");l.displayValue&&(w="top"==l.textPosition?l.marginTop+l.fontSize-l.textMargin:l.height+l.textMargin+l.marginTop+l.fontSize,n.font=l.fontOptions+" "+l.fontSize+"px "+l.font,"left"==l.textAlign||c.barcodePadding>0?(p=0,n.textAlign="left"):"right"==l.textAlign?(p=c.width-1,n.textAlign="right"):(p=c.width/2,n.textAlign="center"),n.fillText(c.text,p,w))}},{key:"moveCanvasDrawing",value:function(l){this.canvas.getContext("2d").translate(l.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),D}();P.default=T},2233:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var F=T(E(1799)),v=T(E(5794)),L=T(E(1138));function T(D){return D&&D.__esModule?D:{default:D}}P.default={CanvasRenderer:F.default,SVGRenderer:v.default,ObjectRenderer:L.default}},1138:(J,P)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var E=function(){function t(v,M){for(var L=0;L<M.length;L++){var T=M[L];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,T.key,T)}}return function(v,M,L){return M&&t(v.prototype,M),L&&t(v,L),v}}(),F=function(){function t(v,M,L){(function x(t,v){if(!(t instanceof v))throw new TypeError("Cannot call a class as a function")})(this,t),this.object=v,this.encodings=M,this.options=L}return E(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();P.default=F},4358:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.getTotalWidthOfEncodings=P.calculateEncodingAttributes=P.getBarcodePadding=P.getEncodingHeight=P.getMaximumHeightOfEncodings=void 0;var F=function t(l){return l&&l.__esModule?l:{default:l}}(E(6017));function v(l,c){return c.height+(c.displayValue&&l.text.length>0?c.fontSize+c.textMargin:0)+c.marginTop+c.marginBottom}function M(l,c,n){if(n.displayValue&&c<l){if("center"==n.textAlign)return Math.floor((l-c)/2);if("left"==n.textAlign)return 0;if("right"==n.textAlign)return Math.floor(l-c)}return 0}function y(l,c,n){var d;if(n)d=n;else{if(!(typeof document<"u"))return 0;d=document.createElement("canvas").getContext("2d")}d.font=c.fontOptions+" "+c.fontSize+"px "+c.font;var p=d.measureText(l);return p?p.width:0}P.getMaximumHeightOfEncodings=function D(l){for(var c=0,n=0;n<l.length;n++)l[n].height>c&&(c=l[n].height);return c},P.getEncodingHeight=v,P.getBarcodePadding=M,P.calculateEncodingAttributes=function L(l,c,n){for(var d=0;d<l.length;d++){var b,p=l[d],w=(0,F.default)(c,p.options);b=w.displayValue?y(p.text,w,n):0;var U=p.data.length*w.width;p.width=Math.ceil(Math.max(b,U)),p.height=v(p,w),p.barcodePadding=M(b,U,w)}},P.getTotalWidthOfEncodings=function T(l){for(var c=0,n=0;n<l.length;n++)c+=l[n].width;return c}},5794:(J,P,E)=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});var x=function(){function y(l,c){for(var n=0;n<c.length;n++){var d=c[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,c,n){return c&&y(l.prototype,c),n&&y(l,n),l}}(),t=function M(y){return y&&y.__esModule?y:{default:y}}(E(6017)),v=E(4358),T="http://www.w3.org/2000/svg",D=function(){function y(l,c,n){(function L(y,l){if(!(y instanceof l))throw new TypeError("Cannot call a class as a function")})(this,y),this.svg=l,this.encodings=c,this.options=n,this.document=n.xmlDocument||document}return x(y,[{key:"render",value:function(){var c=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var d=this.encodings[n],p=(0,t.default)(this.options,d.options),w=this.createGroup(c,p.marginTop,this.svg);this.setGroupOptions(w,p),this.drawSvgBarcode(w,p,d),this.drawSVGText(w,p,d),c+=d.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,v.calculateEncodingAttributes)(this.encodings,this.options);var c=(0,v.getTotalWidthOfEncodings)(this.encodings),n=(0,v.getMaximumHeightOfEncodings)(this.encodings),d=c+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(d,n),this.options.background&&this.drawRect(0,0,d,n,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(c,n,d){var w,p=d.data;w="top"==n.textPosition?n.fontSize+n.textMargin:0;for(var b=0,U=0,z=0;z<p.length;z++)U=z*n.width+d.barcodePadding,"1"===p[z]?b++:b>0&&(this.drawRect(U-n.width*b,w,n.width*b,n.height,c),b=0);b>0&&this.drawRect(U-n.width*(b-1),w,n.width*b,n.height,c)}},{key:"drawSVGText",value:function(c,n,d){var w,b,p=this.document.createElementNS(T,"text");n.displayValue&&(p.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),b="top"==n.textPosition?n.fontSize-n.textMargin:n.height+n.textMargin+n.fontSize,"left"==n.textAlign||d.barcodePadding>0?(w=0,p.setAttribute("text-anchor","start")):"right"==n.textAlign?(w=d.width-1,p.setAttribute("text-anchor","end")):(w=d.width/2,p.setAttribute("text-anchor","middle")),p.setAttribute("x",w),p.setAttribute("y",b),p.appendChild(this.document.createTextNode(d.text)),c.appendChild(p))}},{key:"setSvgAttributes",value:function(c,n){var d=this.svg;d.setAttribute("width",c+"px"),d.setAttribute("height",n+"px"),d.setAttribute("x","0px"),d.setAttribute("y","0px"),d.setAttribute("viewBox","0 0 "+c+" "+n),d.setAttribute("xmlns",T),d.setAttribute("version","1.1"),d.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(c,n,d){var p=this.document.createElementNS(T,"g");return p.setAttribute("transform","translate("+c+", "+n+")"),d.appendChild(p),p}},{key:"setGroupOptions",value:function(c,n){c.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(c,n,d,p,w){var b=this.document.createElementNS(T,"rect");return b.setAttribute("x",c),b.setAttribute("y",n),b.setAttribute("width",d),b.setAttribute("height",p),w.appendChild(b),b}}]),y}();P.default=D}}]);
|