marketplacepos 3.6.0 → 3.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/Marketplace/{chunk-DKPFXQNF.js → chunk-2GCJVDVN.js} +1 -1
- package/Marketplace/chunk-2KGUHH44.js +1 -0
- package/Marketplace/{chunk-JWESCPR3.js → chunk-45NXB6RE.js} +1 -1
- package/Marketplace/{chunk-FTYEJYHR.js → chunk-46GC4FG7.js} +1 -1
- package/Marketplace/{chunk-37HLVAAU.js → chunk-4YRDQUI3.js} +1 -1
- package/Marketplace/{chunk-KDJNHDU2.js → chunk-5LHF6NCK.js} +1 -1
- package/Marketplace/{chunk-4TY6WDXS.js → chunk-66UC4STB.js} +1 -1
- package/Marketplace/{chunk-PUSB4EIC.js → chunk-6M2Q3GGB.js} +1 -1
- package/Marketplace/{chunk-NAXDUEX4.js → chunk-7EYB3DHT.js} +1 -1
- package/Marketplace/{chunk-JUIDNG6B.js → chunk-7JWQMOH7.js} +1 -1
- package/Marketplace/{chunk-2GUSUJKR.js → chunk-7V6UQDFG.js} +1 -1
- package/Marketplace/{chunk-CIGF5YG5.js → chunk-A4X2AUOC.js} +1 -1
- package/Marketplace/{chunk-KTPCOMZ2.js → chunk-BATYANE3.js} +1 -1
- package/Marketplace/{chunk-6YFZBURX.js → chunk-BREDWZJ7.js} +1 -1
- package/Marketplace/chunk-BVGNNSM2.js +1 -0
- package/Marketplace/{chunk-YK6VKTWV.js → chunk-BVMOK3VE.js} +1 -1
- package/Marketplace/{chunk-FBU5QXHN.js → chunk-BW5REXI6.js} +1 -1
- package/Marketplace/{chunk-PP4T4PLJ.js → chunk-BYPWQ2HT.js} +1 -1
- package/Marketplace/{chunk-35GLPUIA.js → chunk-CBOPSK2G.js} +1 -1
- package/Marketplace/{chunk-WNUGQVRM.js → chunk-DKGYGZK7.js} +1 -1
- package/Marketplace/{chunk-JGYSNRH6.js → chunk-DQRS5DAE.js} +1 -1
- package/Marketplace/{chunk-MIAEM23L.js → chunk-DZKSVYPR.js} +1 -1
- package/Marketplace/{chunk-YS2YJHB3.js → chunk-EAYXHDLW.js} +1 -1
- package/Marketplace/{chunk-ISJRZPJX.js → chunk-EOM22W74.js} +1 -1
- package/Marketplace/{chunk-3G5KO3TI.js → chunk-ERRFLL6T.js} +1 -1
- package/Marketplace/{chunk-IPSBLHOU.js → chunk-F45ZZTMU.js} +1 -1
- package/Marketplace/{chunk-3ZNOGHL3.js → chunk-FH2STK2T.js} +1 -1
- package/Marketplace/{chunk-Q2ZCP6BL.js → chunk-FO3KSKQ6.js} +1 -1
- package/Marketplace/{chunk-AO2MXRCQ.js → chunk-GF526R3A.js} +1 -1
- package/Marketplace/{chunk-SFDY7NUA.js → chunk-GMNZLOVM.js} +1 -1
- package/Marketplace/{chunk-VX5ROJLM.js → chunk-HUDF4XGA.js} +1 -1
- package/Marketplace/{chunk-BUG6II55.js → chunk-HXRWGEJ5.js} +1 -1
- package/Marketplace/{chunk-I7PLLVEH.js → chunk-I3M6GHUE.js} +1 -1
- package/Marketplace/{chunk-QC4HQRFC.js → chunk-J2UWP2SN.js} +1 -1
- package/Marketplace/{chunk-SY5WIR62.js → chunk-JSCR55UZ.js} +3 -3
- package/Marketplace/{chunk-HVNMMTYL.js → chunk-KM23UFSR.js} +1 -1
- package/Marketplace/{chunk-YBAPXY6T.js → chunk-L3TBTXVF.js} +1 -1
- package/Marketplace/{chunk-3KJSV75O.js → chunk-LXDCPBTR.js} +1 -1
- package/Marketplace/chunk-MO3YBEXE.js +1 -0
- package/Marketplace/{chunk-233MWU5I.js → chunk-NZQHBWBK.js} +2 -2
- package/Marketplace/{chunk-K5FAZTRK.js → chunk-PFXGXQHO.js} +1 -1
- package/Marketplace/{chunk-SUY2H7ZI.js → chunk-PXAUQQ7Y.js} +1 -1
- package/Marketplace/{chunk-ZXU3FVPS.js → chunk-QYZDV3KB.js} +1 -1
- package/Marketplace/{chunk-W7OIIPRU.js → chunk-QZ6GD3DK.js} +1 -1
- package/Marketplace/{chunk-2Y66HZFD.js → chunk-RISSBTN2.js} +1 -1
- package/Marketplace/{chunk-MLMGMDJA.js → chunk-RNPQSH4X.js} +1 -1
- package/Marketplace/{chunk-53K2CWAN.js → chunk-RQYJJ3EK.js} +1 -1
- package/Marketplace/{chunk-V752HOUZ.js → chunk-RWYXA653.js} +1 -1
- package/Marketplace/{chunk-HEYRRICW.js → chunk-SB5XTLLY.js} +1 -1
- package/Marketplace/{chunk-2FZAKLVH.js → chunk-TAD43MYD.js} +1 -1
- package/Marketplace/{chunk-ZVELVZIL.js → chunk-TG2NAWXW.js} +1 -1
- package/Marketplace/{chunk-G4PZ5CPL.js → chunk-TPFTT632.js} +1 -1
- package/Marketplace/{chunk-IOUI2FZD.js → chunk-UV6KK4W6.js} +1 -1
- package/Marketplace/{chunk-IM6ZDC7I.js → chunk-V7X66MWE.js} +1 -1
- package/Marketplace/{chunk-UTRK7TTD.js → chunk-XAU4KWDG.js} +1 -1
- package/Marketplace/{chunk-R2U2NYVL.js → chunk-XDJYCAPB.js} +1 -1
- package/Marketplace/{chunk-Q6Y22NLN.js → chunk-XJMXZWZW.js} +1 -1
- package/Marketplace/{chunk-UTSC6PL6.js → chunk-YBEJ6DSM.js} +1 -1
- package/Marketplace/{chunk-M3XCT7JY.js → chunk-YO44EPAG.js} +1 -1
- package/Marketplace/{chunk-NEAQH3FX.js → chunk-Z4L57D42.js} +1 -1
- package/Marketplace/{chunk-MGVAWFYU.js → chunk-ZHLG7GCJ.js} +1 -1
- package/Marketplace/{chunk-7ARC4G4F.js → chunk-ZJYHLYQC.js} +1 -1
- package/Marketplace/{chunk-5LICD27P.js → chunk-ZLHGVQE6.js} +2 -2
- package/Marketplace/{chunk-MBHOZDLB.js → chunk-ZRTKOAYD.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-ICOUGZTS.js → main-JR4ZU2LJ.js} +1 -1
- package/Marketplace/{styles-XDRE2JJC.css → styles-DXZCV23O.css} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-E64JNFG7.js +0 -1
- package/Marketplace/chunk-UWU5GEHX.js +0 -1
- package/Marketplace/chunk-V3NJFGV3.js +0 -1
- /package/Marketplace/{chunk-6RUGKYFT.js → chunk-72VLH7XK.js} +0 -0
- /package/Marketplace/{chunk-6HLIRI7N.js → chunk-GCXKRLIU.js} +0 -0
- /package/Marketplace/{chunk-V6VYUZWG.js → chunk-NXHCLVII.js} +0 -0
- /package/Marketplace/{chunk-ZLME6FEU.js → chunk-OUASU5FP.js} +0 -0
- /package/Marketplace/{chunk-KPTAVWMG.js → chunk-YD4CXLB4.js} +0 -0
- /package/Marketplace/{polyfills-L2ZK4WXQ.js → polyfills-ON52FDZY.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as E,b as Ie,c as ne,d as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-5LICD27P.js";import{a as ye,b as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-I7PLLVEH.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-W7OIIPRU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-ZLME6FEU.js";import{a as be,b as we}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-FBU5QXHN.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6HLIRI7N.js";import{a as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-AO2MXRCQ.js";import{a as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-PUSB4EIC.js";import{a as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-NEAQH3FX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-IOUI2FZD.js";import{c as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-K5FAZTRK.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-BUG6II55.js";import{a as xe,b as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MLMGMDJA.js";import{b as z,e as Q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-VX5ROJLM.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-V752HOUZ.js";import{a as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MBHOZDLB.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-PP4T4PLJ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-HVNMMTYL.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-DKPFXQNF.js";import{d as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-2FZAKLVH.js";import{a as le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-G4PZ5CPL.js";import{t as Z,u as Ce,v as q,w as fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-IM6ZDC7I.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-JWESCPR3.js";import{b as he,c as G,h as K,k as J,m as Y,u as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6YFZBURX.js";import{c as b}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-KPTAVWMG.js";import{$a as S,B as P,Cb as f,Db as x,Eb as re,Fa as s,Ga as y,Hc as _e,Lb as R,Lc as H,Oa as c,Ua as g,X as k,Xb as pe,Za as r,Zb as me,_a as l,_b as $,aa as B,ab as T,bb as M,bc as L,cc as de,db as v,ea as F,ec as U,fa as O,fc as j,hb as u,ja as _,jb as p,ka as h,mb as ce,ob as A,pb as m,q as se,qb as V,rb as I,wb as oe,za as N}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6RUGKYFT.js";var Me=(()=>{let o=class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=F({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),S(3,"nav-tab",2),l()()(),S(4,"router-outlet")),n&2&&(s(3),c("Tabs",a.inventoryTabs))},dependencies:[_e,xe]});let i=o;return i})();function Le(i,o){if(i&1){let e=v();r(0,"button",22),u("click",function(){_(e);let n=p(3);return h(n.openScanDialog())}),S(1,"i",23),m(2," Scan Channel "),l()}}function Ue(i,o){if(i&1){let e=v();r(0,"button",24),u("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.onUpdateItems(n))}),S(1,"i",25),m(2," Update "),l()}}function je(i,o){if(i&1&&(r(0,"actions")(1,"div",3)(2,"div"),g(3,Le,3,0,"button",20)(4,Ue,3,0,"button",21),l()()()),i&2){let e=o.ngIf,t=p(2);s(3),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function ze(i,o){if(i&1){let e=v();r(0,"app-table",26),u("onToggle",function(n){_(e);let a=p(2);return h(a.onShowDifferenceStock(n))})("onSubmit",function(n){let d=_(e).ngIf,C=p(2);return h(C.updateStockByVariant(n,d))}),l()}if(i&2){let e=o.ngIf,t=p(2);c("data",e)("channel",t.channelOptions)("showProductToggle",!0)("filter",t.searchFilter)}}function Qe(i,o){if(i&1){let e=v();r(0,"span",27),u("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",28),m(2,"?"),l()()}}function He(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),V(x(2,1,e))}}function Ge(i,o){if(i&1){let e=v();r(0,"a",29),u("click",function(){_(e);let n=p(2);return h(n.nextPage())}),S(1,"i",30),m(2," Next"),l()}}function Ke(i,o){if(i&1){let e=v();r(0,"a",31),u("click",function(){_(e);let n=p(2);return h(n.getAllData())}),S(1,"i",32),m(2," Last"),l()}}function Je(i,o){if(i&1){let e=v();r(0,"mainpanel",1),u("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),g(1,je,5,2,"actions",2),f(2,"async"),r(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"label",5),m(8,"PageNumber"),l(),r(9,"input",6),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(10,"div")(11,"label",7),m(12,"Page Size"),l(),r(13,"input",8),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()()()()(),r(14,"content")(15,"div",9)(16,"div",10)(17,"div",11),g(18,ze,1,4,"app-table",12),f(19,"async"),T(20),r(21,"div",13)(22,"div",14)(23,"div",15),m(24),f(25,"number"),f(26,"async"),g(27,Qe,3,0,"span",16)(28,He,3,3,"span",2),f(29,"async"),m(30),l()(),r(31,"div",17),g(32,Ge,3,0,"a",18)(33,Ke,3,0,"a",19),l()(),M(),l()()()()()}if(i&2){let e=p(),t;c("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),s(1),c("ngIf",x(2,13,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(5),c("ngIf",x(19,15,e.paginationService.data$)),s(6),I(" Showing 1 - ",x(25,17,(t=x(26,19,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(29,21,!e.paginationService.hideCount&&e.allDataCount$)),s(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),s(2),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var De=(()=>{let o=class o{constructor(t,n,a,d,C){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=C,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:E.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,n){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let C=a.map(w=>({ID:w.ID,Code:w.Code,Inventory:w.Inventory}));var d=n.filter(w=>w.selected).map(w=>w.ID);let D={ListChannelID:d,List:C};this.http.post("/api/Inventory/UpdateChannel",D).subscribe(w=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+D.List.length+" variants in "+D.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(X,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(P(a=>b.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=b.GuidEMpty})}updateStockByVariant(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(d=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+C.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=E.DIFFERENCE:this.searchFilter.filterModel=E.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let n=this.productService.selectedVariantProduct(t);this.dialog.open(ye,{data:{selectedItems:n,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(P(a=>b.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1;let t={text:this.searchFilter.text};this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(Q),y(z),y(W),y(te),y(ee))},o.\u0275cmp=F({type:o,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],[1,"d-flex"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(g(0,Je,34,23,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",x(1,1,a.loader$))},dependencies:[$,G,Y,K,J,q,ne,Z,L,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function Ye(i,o){if(i&1){let e=v();r(0,"button",36),u("click",function(){_(e);let n=p(2).ngIf,a=p();return h(a.openScanDialog(n))}),S(1,"i",37),m(2," Scan Channel "),l()}}function Ze(i,o){if(i&1){let e=v();r(0,"button",38),u("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.updateStock(n))}),S(1,"i",39),m(2," Update"),l()}}function qe(i,o){if(i&1&&(r(0,"div"),g(1,Ye,3,0,"button",34)(2,Ze,3,0,"button",35),l()),i&2){let e=o.ngIf,t=p(2);s(1),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function We(i,o){i&1&&(r(0,"div",40)(1,"span"),m(2," showing only different stock, please press next to populate more data "),l()())}function Xe(i,o){if(i&1){let e=v();r(0,"th")(1,"input",41),u("ngModelChange",function(n){_(e);let a=p(2);return h(a.checkboxState=n)})("ngModelChange",function(){let a=_(e).ngIf,d=p(2);return h(d.onCheckboxStateChange(a))}),l()()}if(i&2){let e=p(2);s(1),c("ngModel",e.checkboxState)}}function et(i,o){i&1&&(T(0),r(1,"th",42),m(2," Reserved "),l(),M())}function tt(i,o){if(i&1){let e=v();r(0,"input",68),u("ngModelChange",function(n){_(e);let a=p(3).$implicit;return h(a.selected=n)})("ngModelChange",function(){_(e);let n=p(3).$implicit,a=p(2);return h(a.onCheckboxStateProduct(n))}),l()}if(i&2){let e=p(3).$implicit;c("ngModel",e.selected)}}function nt(i,o){if(i&1){let e=v();r(0,"img",69),u("click",function(n){_(e);let a=p(3).$implicit,d=p(2);return h(d.onZoomImage(n,a==null?null:a.ImageUrl))}),l()}if(i&2){let e=p(3).$implicit;ce("src",e==null?null:e.ThumbnailUrl,N)}}function it(i,o){i&1&&S(0,"img",70)}function at(i,o){if(i&1&&(T(0),r(1,"td",59)(2,"div",60),g(3,tt,1,1,"input",61)(4,nt,1,1,"img",62)(5,it,1,0,"ng-template",null,63,R),l()(),r(7,"td",64)(8,"span",65),m(9),l(),S(10,"br"),r(11,"div",66),S(12,"i",67),r(13,"small"),m(14),l()()(),M()),i&2){let e=A(6),t=p().$implicit,n=p().$implicit;s(1),c("rowSpan",n==null?null:n.Variants.length),s(2),c("ngIf",(t==null?null:t.Inventory)>=0||n.Variants.length>1),s(1),c("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",e),s(3),c("rowSpan",n==null?null:n.Variants.length),s(2),V(n==null?null:n.Name),s(5),I("(",n==null?null:n.Category,")")}}function ot(i,o){if(i&1){let e=v();T(0),r(1,"input",41),u("ngModelChange",function(n){_(e);let a=p(2).$implicit;return h(a.selected=n)}),l(),M()}if(i&2){let e=p(2).$implicit;s(1),c("ngModel",e.selected)}}function rt(i,o){if(i&1&&(T(0),g(1,ot,2,1,"ng-container",3),M()),i&2){let e=p().$implicit;s(1),c("ngIf",(e==null?null:e.Inventory)<=1e5)}}function lt(i,o){if(i&1){let e=v();r(0,"input",41),u("ngModelChange",function(n){_(e);let a=p(2).$implicit;return h(a.selected=n)}),l()}if(i&2){let e=p(2).$implicit;c("ngModel",e.selected)}}function st(i,o){if(i&1&&g(0,lt,1,1,"input",71),i&2){let e=p().$implicit;c("ngIf",(e==null?null:e.Inventory)>=0)}}function ct(i,o){if(i&1&&(r(0,"span")(1,"span",72),m(2),f(3,"number"),l(),m(4," => "),r(5,"span",73),m(6),f(7,"number"),l()()),i&2){let e=p().$implicit;s(2),I(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),V(x(7,4,e==null?null:e.Inventory))}}function pt(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=p().$implicit;s(1),I(" ",x(2,1,e==null?null:e.Inventory)," ")}}var mt=i=>({"bg-gradient-warning":i});function dt(i,o){if(i&1){let e=v();r(0,"td",74)(1,"span",75),u("click",function(){_(e);let n=p().$implicit,a=p(),d=a.$implicit,C=a.ngForOf,D=p(2);return h(D.openTableDialog(d,n,C))}),m(2),f(3,"number"),l()()}if(i&2){let e=p().$implicit;c("ngClass",oe(4,mt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(2),I(" ",x(3,2,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function _t(i,o){if(i&1&&(T(0),r(1,"span",77),m(2),f(3,"number"),l(),M()),i&2){let e=p(2).$implicit;s(2),I(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function ht(i,o){i&1&&m(0," - ")}function ut(i,o){if(i&1&&(T(0),r(1,"td",53),g(2,_t,4,3,"ng-container",51)(3,ht,1,0,"ng-template",null,76,R),l(),M()),i&2){let e=A(4),t=p().$implicit;s(2),c("ngIf",t==null||t.Channel[0]==null?null:t.Channel[0].InventoryReserved)("ngIfElse",e)}}function gt(i,o){i&1&&(T(0),m(1," - "),M())}function Ct(i,o){if(i&1&&(r(0,"span",78),f(1,"date"),m(2),f(3,"date"),l()),i&2){let e=p().$implicit;c("matTooltip",re(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",re(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}var ft=i=>({"text-decoration-line-through":i});function xt(i,o){if(i&1){let e=v();r(0,"tr"),g(1,at,15,7,"ng-container",3),r(2,"td",43),m(3),l(),r(4,"td",44)(5,"div",45)(6,"span",46),m(7),l(),r(8,"span",47)(9,"a",48),S(10,"i",49),l()()()(),r(11,"td",50),g(12,rt,2,1,"ng-container",51)(13,st,1,1,"ng-template",null,52,R),l(),r(15,"td",53),g(16,ct,8,6,"span",3)(17,pt,3,3,"span",3),l(),g(18,dt,4,6,"td",54)(19,ut,5,2,"ng-container",3),r(20,"td",26),g(21,gt,2,0,"ng-container",51)(22,Ct,4,8,"ng-template",null,55,R),l(),r(24,"td")(25,"div",12)(26,"div",56)(27,"a",48),S(28,"i",49),l(),m(29," \xA0\xA0 "),r(30,"span",57),u("click",function(){let a=_(e).$implicit,d=p(3);return h(d.refreshInventory(a==null||a.Channel[0]==null?null:a.Channel[0].ChannelItemID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelVariationID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelID,a==null?null:a.ID))}),S(31,"i",58),l()()()()()}if(i&2){let e=o.$implicit,t=o.index,n=A(14),a=A(23),d=p(3);s(1),c("ngIf",t==0),s(2),V(e==null?null:e.Model),s(1),c("matTooltip",e.isDiscontinued?d.discontinuedVariantMsg:""),s(2),c("ngClass",oe(15,ft,e.isDiscontinued)),s(1),V(e==null?null:e.Code),s(2),c("href","https://"+d.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),N),s(3),c("ngIf",(e==null?null:e.Channel[0].TypeID)==1)("ngIfElse",n),s(4),c("ngIf",(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",(e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",e==null?null:e.Channel),s(1),c("ngIf",d.isShowReservedColumn),s(2),c("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==d.minDate)("ngIfElse",a),s(6),c("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,N)}}function St(i,o){if(i&1&&(r(0,"tbody"),g(1,xt,32,17,"tr",28),l()),i&2){let e=o.$implicit;s(1),c("ngForOf",e.Variants)}}function vt(i,o){if(i&1){let e=v();r(0,"span",79),u("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",80),m(2,"?"),l()()}}function yt(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),V(x(2,1,e==null?null:e.Total))}}function It(i,o){if(i&1){let e=v();r(0,"a",84),u("click",function(){_(e);let n=p(3);return h(n.onNextPage())}),S(1,"i",85),m(2," Next"),l()}}function bt(i,o){if(i&1){let e=v();r(0,"a",86),u("click",function(){_(e);let n=p(3);return h(n.onLastPage())}),S(1,"i",87),m(2," Last"),l()}}function wt(i,o){if(i&1&&(r(0,"div",81),g(1,It,3,0,"a",82)(2,bt,3,0,"a",83),l()),i&2){let e=p(2);s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function Tt(i,o){if(i&1){let e=v();r(0,"mainpanel",1),u("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),r(1,"actions")(2,"div",2),g(3,qe,3,2,"div",3),f(4,"async"),l()(),r(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),m(10,"PageNumber"),l(),r(11,"input",6),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(12,"div")(13,"label",7),m(14,"Page Size"),l(),r(15,"input",8),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()(),r(16,"div")(17,"h6"),m(18,"Quantity From - To"),l(),r(19,"input",9),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityFrom=n)}),l(),m(20," - "),r(21,"input",10),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityTo=n)}),l()()()()(),r(22,"content")(23,"div",11)(24,"div",12)(25,"div",13),g(26,We,3,0,"div",14),r(27,"table",15)(28,"thead",16)(29,"tr")(30,"th",17),m(31,"Product "),S(32,"br"),r(33,"mat-slide-toggle",18),u("toggleChange",function(){_(e);let n=p();return n.showDifferenceStock=!n.showDifferenceStock,h(n.onShowDifferenceStock())}),r(34,"small",19),m(35,"FILTER DIFFERENT INVENTORY"),l()()(),r(36,"th",20),m(37,"Variant"),l(),r(38,"th",21),m(39,"SKU"),l(),g(40,Xe,2,1,"th",3),f(41,"async"),r(42,"th",22),m(43,"POS"),l(),r(44,"th",23)(45,"div",24),u("click",function(){_(e);let n=p();return h(n.onChangeChannel())}),S(46,"img",25),m(47),l()(),g(48,et,3,0,"ng-container",3),r(49,"th",26),m(50,"Last Sync"),l(),S(51,"th",27),l()(),g(52,St,2,1,"tbody",28),f(53,"async"),l(),r(54,"div",29)(55,"div",30)(56,"div",31),m(57),f(58,"number"),f(59,"async"),g(60,vt,3,0,"span",32)(61,yt,3,3,"span",3),f(62,"async"),m(63),l()(),g(64,wt,3,2,"div",33),f(65,"async"),l()()()()()()}if(i&2){let e=p(),t,n;c("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),c("ngIf",x(4,20,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(4),c("ngModel",e.searchFilter.QuantityFrom),s(2),c("ngModel",e.searchFilter.QuantityTo),s(5),c("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),c("ngIf",x(41,22,e.paginationService.data$)),s(5),c("matTooltip","Change "+(e.selectedChannel==null?null:e.selectedChannel.Name)),s(1),c("src",e.selectedChannel.logo,N),s(1),I(" ",e.selectedChannel!=null&&e.selectedChannel.Name?e.selectedChannel==null?null:e.selectedChannel.Name:"Choose Channel ..."," "),s(1),c("ngIf",e.isShowReservedColumn),s(4),c("ngForOf",x(53,24,e.products$)),s(5),I(" Showing 1 - ",x(58,26,(t=x(59,28,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(62,30,!e.paginationService.hideCount&&e.rowCount$)),s(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),s(1),c("ngIf",((n=x(65,32,e.paginationService.data$))==null?null:n.length)>0)}}var Ve=(()=>{let o=class o{constructor(t,n,a,d,C,D,w){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=C,this.biggerPictureService=D,this.inventoryService=w,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=b.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=C.getHostName()}ngOnInit(){this.initPageLoader(),this.products$=this.paginationService.data$.pipe(se(t=>(t=t.map(n=>(n.Variants=n.Variants.map(a=>(a.isDiscontinued=n.Discontinued=="Yes",a)),n)),t)),k(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let n=0,a;t.forEach(d=>{a=d.Variants.find(C=>b.IsNotEmpty(C?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe(k(t=>{if(this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),!t.Filter.IsMarketplaceAppActive){let n=`Automatic inventory sync disabled.
|
|
1
|
+
import{a as E,b as Ie,c as ne,d as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZLHGVQE6.js";import{a as ye,b as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-I3M6GHUE.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-QZ6GD3DK.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-OUASU5FP.js";import{a as be,b as we}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-BW5REXI6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-GCXKRLIU.js";import{a as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-GF526R3A.js";import{a as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-6M2Q3GGB.js";import{a as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-Z4L57D42.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-UV6KK4W6.js";import{c as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-PFXGXQHO.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-HXRWGEJ5.js";import{a as xe,b as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-RNPQSH4X.js";import{b as z,e as Q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-HUDF4XGA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-RWYXA653.js";import{a as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZRTKOAYD.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-BYPWQ2HT.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-KM23UFSR.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-2GCJVDVN.js";import{d as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-TAD43MYD.js";import{a as le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-TPFTT632.js";import{t as Z,u as Ce,v as q,w as fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-V7X66MWE.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-45NXB6RE.js";import{b as he,c as G,h as K,k as J,m as Y,u as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-BREDWZJ7.js";import{c as b}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-YD4CXLB4.js";import{$a as S,B as P,Cb as f,Db as x,Eb as re,Fa as s,Ga as y,Hc as _e,Lb as R,Lc as H,Oa as c,Ua as g,X as k,Xb as pe,Za as r,Zb as me,_a as l,_b as $,aa as B,ab as T,bb as M,bc as L,cc as de,db as v,ea as F,ec as U,fa as O,fc as j,hb as u,ja as _,jb as p,ka as h,mb as ce,ob as A,pb as m,q as se,qb as V,rb as I,wb as oe,za as N}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZHLG7GCJ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-72VLH7XK.js";var Me=(()=>{let o=class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=F({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),S(3,"nav-tab",2),l()()(),S(4,"router-outlet")),n&2&&(s(3),c("Tabs",a.inventoryTabs))},dependencies:[_e,xe]});let i=o;return i})();function Le(i,o){if(i&1){let e=v();r(0,"button",22),u("click",function(){_(e);let n=p(3);return h(n.openScanDialog())}),S(1,"i",23),m(2," Scan Channel "),l()}}function Ue(i,o){if(i&1){let e=v();r(0,"button",24),u("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.onUpdateItems(n))}),S(1,"i",25),m(2," Update "),l()}}function je(i,o){if(i&1&&(r(0,"actions")(1,"div",3)(2,"div"),g(3,Le,3,0,"button",20)(4,Ue,3,0,"button",21),l()()()),i&2){let e=o.ngIf,t=p(2);s(3),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function ze(i,o){if(i&1){let e=v();r(0,"app-table",26),u("onToggle",function(n){_(e);let a=p(2);return h(a.onShowDifferenceStock(n))})("onSubmit",function(n){let d=_(e).ngIf,C=p(2);return h(C.updateStockByVariant(n,d))}),l()}if(i&2){let e=o.ngIf,t=p(2);c("data",e)("channel",t.channelOptions)("showProductToggle",!0)("filter",t.searchFilter)}}function Qe(i,o){if(i&1){let e=v();r(0,"span",27),u("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",28),m(2,"?"),l()()}}function He(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),V(x(2,1,e))}}function Ge(i,o){if(i&1){let e=v();r(0,"a",29),u("click",function(){_(e);let n=p(2);return h(n.nextPage())}),S(1,"i",30),m(2," Next"),l()}}function Ke(i,o){if(i&1){let e=v();r(0,"a",31),u("click",function(){_(e);let n=p(2);return h(n.getAllData())}),S(1,"i",32),m(2," Last"),l()}}function Je(i,o){if(i&1){let e=v();r(0,"mainpanel",1),u("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),g(1,je,5,2,"actions",2),f(2,"async"),r(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"label",5),m(8,"PageNumber"),l(),r(9,"input",6),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(10,"div")(11,"label",7),m(12,"Page Size"),l(),r(13,"input",8),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()()()()(),r(14,"content")(15,"div",9)(16,"div",10)(17,"div",11),g(18,ze,1,4,"app-table",12),f(19,"async"),T(20),r(21,"div",13)(22,"div",14)(23,"div",15),m(24),f(25,"number"),f(26,"async"),g(27,Qe,3,0,"span",16)(28,He,3,3,"span",2),f(29,"async"),m(30),l()(),r(31,"div",17),g(32,Ge,3,0,"a",18)(33,Ke,3,0,"a",19),l()(),M(),l()()()()()}if(i&2){let e=p(),t;c("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),s(1),c("ngIf",x(2,13,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(5),c("ngIf",x(19,15,e.paginationService.data$)),s(6),I(" Showing 1 - ",x(25,17,(t=x(26,19,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(29,21,!e.paginationService.hideCount&&e.allDataCount$)),s(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),s(2),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var De=(()=>{let o=class o{constructor(t,n,a,d,C){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=C,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:E.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,n){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let C=a.map(w=>({ID:w.ID,Code:w.Code,Inventory:w.Inventory}));var d=n.filter(w=>w.selected).map(w=>w.ID);let D={ListChannelID:d,List:C};this.http.post("/api/Inventory/UpdateChannel",D).subscribe(w=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+D.List.length+" variants in "+D.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(X,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(P(a=>b.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=b.GuidEMpty})}updateStockByVariant(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(d=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+C.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=E.DIFFERENCE:this.searchFilter.filterModel=E.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let n=this.productService.selectedVariantProduct(t);this.dialog.open(ye,{data:{selectedItems:n,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(P(a=>b.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1;let t={text:this.searchFilter.text};this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(Q),y(z),y(W),y(te),y(ee))},o.\u0275cmp=F({type:o,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],[1,"d-flex"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(g(0,Je,34,23,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",x(1,1,a.loader$))},dependencies:[$,G,Y,K,J,q,ne,Z,L,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function Ye(i,o){if(i&1){let e=v();r(0,"button",36),u("click",function(){_(e);let n=p(2).ngIf,a=p();return h(a.openScanDialog(n))}),S(1,"i",37),m(2," Scan Channel "),l()}}function Ze(i,o){if(i&1){let e=v();r(0,"button",38),u("click",function(){_(e);let n=p().ngIf,a=p(2);return h(a.updateStock(n))}),S(1,"i",39),m(2," Update"),l()}}function qe(i,o){if(i&1&&(r(0,"div"),g(1,Ye,3,0,"button",34)(2,Ze,3,0,"button",35),l()),i&2){let e=o.ngIf,t=p(2);s(1),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function We(i,o){i&1&&(r(0,"div",40)(1,"span"),m(2," showing only different stock, please press next to populate more data "),l()())}function Xe(i,o){if(i&1){let e=v();r(0,"th")(1,"input",41),u("ngModelChange",function(n){_(e);let a=p(2);return h(a.checkboxState=n)})("ngModelChange",function(){let a=_(e).ngIf,d=p(2);return h(d.onCheckboxStateChange(a))}),l()()}if(i&2){let e=p(2);s(1),c("ngModel",e.checkboxState)}}function et(i,o){i&1&&(T(0),r(1,"th",42),m(2," Reserved "),l(),M())}function tt(i,o){if(i&1){let e=v();r(0,"input",68),u("ngModelChange",function(n){_(e);let a=p(3).$implicit;return h(a.selected=n)})("ngModelChange",function(){_(e);let n=p(3).$implicit,a=p(2);return h(a.onCheckboxStateProduct(n))}),l()}if(i&2){let e=p(3).$implicit;c("ngModel",e.selected)}}function nt(i,o){if(i&1){let e=v();r(0,"img",69),u("click",function(n){_(e);let a=p(3).$implicit,d=p(2);return h(d.onZoomImage(n,a==null?null:a.ImageUrl))}),l()}if(i&2){let e=p(3).$implicit;ce("src",e==null?null:e.ThumbnailUrl,N)}}function it(i,o){i&1&&S(0,"img",70)}function at(i,o){if(i&1&&(T(0),r(1,"td",59)(2,"div",60),g(3,tt,1,1,"input",61)(4,nt,1,1,"img",62)(5,it,1,0,"ng-template",null,63,R),l()(),r(7,"td",64)(8,"span",65),m(9),l(),S(10,"br"),r(11,"div",66),S(12,"i",67),r(13,"small"),m(14),l()()(),M()),i&2){let e=A(6),t=p().$implicit,n=p().$implicit;s(1),c("rowSpan",n==null?null:n.Variants.length),s(2),c("ngIf",(t==null?null:t.Inventory)>=0||n.Variants.length>1),s(1),c("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",e),s(3),c("rowSpan",n==null?null:n.Variants.length),s(2),V(n==null?null:n.Name),s(5),I("(",n==null?null:n.Category,")")}}function ot(i,o){if(i&1){let e=v();T(0),r(1,"input",41),u("ngModelChange",function(n){_(e);let a=p(2).$implicit;return h(a.selected=n)}),l(),M()}if(i&2){let e=p(2).$implicit;s(1),c("ngModel",e.selected)}}function rt(i,o){if(i&1&&(T(0),g(1,ot,2,1,"ng-container",3),M()),i&2){let e=p().$implicit;s(1),c("ngIf",(e==null?null:e.Inventory)<=1e5)}}function lt(i,o){if(i&1){let e=v();r(0,"input",41),u("ngModelChange",function(n){_(e);let a=p(2).$implicit;return h(a.selected=n)}),l()}if(i&2){let e=p(2).$implicit;c("ngModel",e.selected)}}function st(i,o){if(i&1&&g(0,lt,1,1,"input",71),i&2){let e=p().$implicit;c("ngIf",(e==null?null:e.Inventory)>=0)}}function ct(i,o){if(i&1&&(r(0,"span")(1,"span",72),m(2),f(3,"number"),l(),m(4," => "),r(5,"span",73),m(6),f(7,"number"),l()()),i&2){let e=p().$implicit;s(2),I(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),V(x(7,4,e==null?null:e.Inventory))}}function pt(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=p().$implicit;s(1),I(" ",x(2,1,e==null?null:e.Inventory)," ")}}var mt=i=>({"bg-gradient-warning":i});function dt(i,o){if(i&1){let e=v();r(0,"td",74)(1,"span",75),u("click",function(){_(e);let n=p().$implicit,a=p(),d=a.$implicit,C=a.ngForOf,D=p(2);return h(D.openTableDialog(d,n,C))}),m(2),f(3,"number"),l()()}if(i&2){let e=p().$implicit;c("ngClass",oe(4,mt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(2),I(" ",x(3,2,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function _t(i,o){if(i&1&&(T(0),r(1,"span",77),m(2),f(3,"number"),l(),M()),i&2){let e=p(2).$implicit;s(2),I(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function ht(i,o){i&1&&m(0," - ")}function ut(i,o){if(i&1&&(T(0),r(1,"td",53),g(2,_t,4,3,"ng-container",51)(3,ht,1,0,"ng-template",null,76,R),l(),M()),i&2){let e=A(4),t=p().$implicit;s(2),c("ngIf",t==null||t.Channel[0]==null?null:t.Channel[0].InventoryReserved)("ngIfElse",e)}}function gt(i,o){i&1&&(T(0),m(1," - "),M())}function Ct(i,o){if(i&1&&(r(0,"span",78),f(1,"date"),m(2),f(3,"date"),l()),i&2){let e=p().$implicit;c("matTooltip",re(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",re(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}var ft=i=>({"text-decoration-line-through":i});function xt(i,o){if(i&1){let e=v();r(0,"tr"),g(1,at,15,7,"ng-container",3),r(2,"td",43),m(3),l(),r(4,"td",44)(5,"div",45)(6,"span",46),m(7),l(),r(8,"span",47)(9,"a",48),S(10,"i",49),l()()()(),r(11,"td",50),g(12,rt,2,1,"ng-container",51)(13,st,1,1,"ng-template",null,52,R),l(),r(15,"td",53),g(16,ct,8,6,"span",3)(17,pt,3,3,"span",3),l(),g(18,dt,4,6,"td",54)(19,ut,5,2,"ng-container",3),r(20,"td",26),g(21,gt,2,0,"ng-container",51)(22,Ct,4,8,"ng-template",null,55,R),l(),r(24,"td")(25,"div",12)(26,"div",56)(27,"a",48),S(28,"i",49),l(),m(29," \xA0\xA0 "),r(30,"span",57),u("click",function(){let a=_(e).$implicit,d=p(3);return h(d.refreshInventory(a==null||a.Channel[0]==null?null:a.Channel[0].ChannelItemID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelVariationID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelID,a==null?null:a.ID))}),S(31,"i",58),l()()()()()}if(i&2){let e=o.$implicit,t=o.index,n=A(14),a=A(23),d=p(3);s(1),c("ngIf",t==0),s(2),V(e==null?null:e.Model),s(1),c("matTooltip",e.isDiscontinued?d.discontinuedVariantMsg:""),s(2),c("ngClass",oe(15,ft,e.isDiscontinued)),s(1),V(e==null?null:e.Code),s(2),c("href","https://"+d.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),N),s(3),c("ngIf",(e==null?null:e.Channel[0].TypeID)==1)("ngIfElse",n),s(4),c("ngIf",(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",(e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",e==null?null:e.Channel),s(1),c("ngIf",d.isShowReservedColumn),s(2),c("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==d.minDate)("ngIfElse",a),s(6),c("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,N)}}function St(i,o){if(i&1&&(r(0,"tbody"),g(1,xt,32,17,"tr",28),l()),i&2){let e=o.$implicit;s(1),c("ngForOf",e.Variants)}}function vt(i,o){if(i&1){let e=v();r(0,"span",79),u("click",function(){_(e);let n=p(2);return h(n.getRowCount())}),r(1,"i",80),m(2,"?"),l()()}}function yt(i,o){if(i&1&&(r(0,"span"),m(1),f(2,"number"),l()),i&2){let e=o.ngIf;s(1),V(x(2,1,e==null?null:e.Total))}}function It(i,o){if(i&1){let e=v();r(0,"a",84),u("click",function(){_(e);let n=p(3);return h(n.onNextPage())}),S(1,"i",85),m(2," Next"),l()}}function bt(i,o){if(i&1){let e=v();r(0,"a",86),u("click",function(){_(e);let n=p(3);return h(n.onLastPage())}),S(1,"i",87),m(2," Last"),l()}}function wt(i,o){if(i&1&&(r(0,"div",81),g(1,It,3,0,"a",82)(2,bt,3,0,"a",83),l()),i&2){let e=p(2);s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function Tt(i,o){if(i&1){let e=v();r(0,"mainpanel",1),u("onSubmit",function(n){_(e);let a=p();return h(a.onSearch(n))}),r(1,"actions")(2,"div",2),g(3,qe,3,2,"div",3),f(4,"async"),l()(),r(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),m(10,"PageNumber"),l(),r(11,"input",6),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.PageNumber=n)}),l()(),r(12,"div")(13,"label",7),m(14,"Page Size"),l(),r(15,"input",8),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.RowCount=n)}),l()(),r(16,"div")(17,"h6"),m(18,"Quantity From - To"),l(),r(19,"input",9),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityFrom=n)}),l(),m(20," - "),r(21,"input",10),u("ngModelChange",function(n){_(e);let a=p();return h(a.searchFilter.QuantityTo=n)}),l()()()()(),r(22,"content")(23,"div",11)(24,"div",12)(25,"div",13),g(26,We,3,0,"div",14),r(27,"table",15)(28,"thead",16)(29,"tr")(30,"th",17),m(31,"Product "),S(32,"br"),r(33,"mat-slide-toggle",18),u("toggleChange",function(){_(e);let n=p();return n.showDifferenceStock=!n.showDifferenceStock,h(n.onShowDifferenceStock())}),r(34,"small",19),m(35,"FILTER DIFFERENT INVENTORY"),l()()(),r(36,"th",20),m(37,"Variant"),l(),r(38,"th",21),m(39,"SKU"),l(),g(40,Xe,2,1,"th",3),f(41,"async"),r(42,"th",22),m(43,"POS"),l(),r(44,"th",23)(45,"div",24),u("click",function(){_(e);let n=p();return h(n.onChangeChannel())}),S(46,"img",25),m(47),l()(),g(48,et,3,0,"ng-container",3),r(49,"th",26),m(50,"Last Sync"),l(),S(51,"th",27),l()(),g(52,St,2,1,"tbody",28),f(53,"async"),l(),r(54,"div",29)(55,"div",30)(56,"div",31),m(57),f(58,"number"),f(59,"async"),g(60,vt,3,0,"span",32)(61,yt,3,3,"span",3),f(62,"async"),m(63),l()(),g(64,wt,3,2,"div",33),f(65,"async"),l()()()()()()}if(i&2){let e=p(),t,n;c("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),c("ngIf",x(4,20,e.paginationService.data$)),s(8),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(4),c("ngModel",e.searchFilter.QuantityFrom),s(2),c("ngModel",e.searchFilter.QuantityTo),s(5),c("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),c("ngIf",x(41,22,e.paginationService.data$)),s(5),c("matTooltip","Change "+(e.selectedChannel==null?null:e.selectedChannel.Name)),s(1),c("src",e.selectedChannel.logo,N),s(1),I(" ",e.selectedChannel!=null&&e.selectedChannel.Name?e.selectedChannel==null?null:e.selectedChannel.Name:"Choose Channel ..."," "),s(1),c("ngIf",e.isShowReservedColumn),s(4),c("ngForOf",x(53,24,e.products$)),s(5),I(" Showing 1 - ",x(58,26,(t=x(59,28,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",x(62,30,!e.paginationService.hideCount&&e.rowCount$)),s(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),s(1),c("ngIf",((n=x(65,32,e.paginationService.data$))==null?null:n.length)>0)}}var Ve=(()=>{let o=class o{constructor(t,n,a,d,C,D,w){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=d,this.productService=C,this.biggerPictureService=D,this.inventoryService=w,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=b.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=C.getHostName()}ngOnInit(){this.initPageLoader(),this.products$=this.paginationService.data$.pipe(se(t=>(t=t.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.isDiscontinued=n.Discontinued=="Yes",a))),n)),t)),k(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let n=0,a;t.forEach(d=>{a=d.Variants.find(C=>b.IsNotEmpty(C?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe(k(t=>{if(this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),!t.Filter.IsMarketplaceAppActive){let n=`Automatic inventory sync disabled.
|
|
2
2
|
Please enable Dealpos X Marketplace Apps integration in POS Configuration`;this.toastr.warning(n,"Warning")}}))}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(t=>t.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=b.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open(Te,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe(P(t=>b.IsNotEmpty(t))).subscribe(t=>{this.selectedChannel=t,this.onFilterChannel(t.ID)})}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}onFilterChannel(t){this.searchFilter.ChannelID=t,this.searchFilter.PageNumber=1,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t){let n=this.productService.selectedVariantProduct(t);if(n.length>0){let a=n.map(C=>({ID:C.ID,Code:C.Code,Inventory:C.Inventory})),d={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",d).subscribe(C=>{this.searchFilter.PageNumber=1,this.paginationService.reloadPagination(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(C)})}}handlingUpdateStock(t){if(t[0]?.StatusProduct){let n=t[0].StatusProduct.Fail_list,a=t[0].StatusProduct.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",a,n)}else this.toastr.error(t[0]?.Exception,"Error")}openScanDialog(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=b.GuidEMpty,this.dialog.open(X,{data:{filter:n,channelOptions:t.Options.Channel},width:"600px"}).afterClosed().pipe(P(d=>b.IsNotEmpty(d))).subscribe(d=>{this.searchFilter.ChannelID=d.ChannelID,this.searchFilter.ScanFull=d.ScanFull,this.searchFilter.UpdatedProduct=d.UpdatedProduct,this.searchFilter.Async=d.Async,this.scannALl(t)})}scannALl(t){let n=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(a=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.searchFilter.ScanFull=!1,this.initPageLoader(),this.toastr.success("Successfully scanned from "+n?.Name,"Success"))})}refreshInventory(t,n,a,d){let C={ChannelItemID:t,ChannelVariationID:n,ChannelID:a,VariantID:d};this.http.post("/api/Inventory/RefreshInventoryChannel",C).subscribe(D=>{this.toastr.success("Successfully updated","Success"),this.paginationService.reloadPagination(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(n=>(n.Inventory>=0&&(n.selected=t.selected),n))}onCheckboxStateChange(t){t=t.map(n=>(n.Variants=n.Variants.map(a=>(a.selected=this.checkboxState,a)),n))}openTableDialog(t,n,a){this.dialog.open(Ie,{data:{Name:t.Name,Variant:n,ChannelID:n?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe(P(C=>b.IsNotEmpty(C))).subscribe(C=>{this.updateItemAfterDialog(C,a)})}updateItemAfterDialog(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku},d=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(C=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+d?.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=E.DIFFERENCE:this.searchFilter.filterModel=E.ALL,this.paginationService.reloadPagination(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1};this.http.post(`${this.rowCountApi}`,t).subscribe({next:n=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,n.Total)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(Q),y(z),y(W),y(te),y(ee),y(ve),y(ie))},o.\u0275cmp=F({type:o,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],["type","number","name","QuantityFrom",1,"w-25","me-2",3,"ngModel","ngModelChange"],["type","number","name","QuantityTo",1,"w-25","ms-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","100px"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"text-center"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-start"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["OTHER_CHANNEL",""],[1,"text-end"],["class","text-end",3,"ngClass",4,"ngIf"],["SYNCDATE",""],[1,"col-12","ps-0","d-flex","justify-content-between"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"cursor",3,"click"],["EMPTY_RESERVED",""],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(g(0,Tt,66,34,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",x(1,1,a.loader$))},dependencies:[pe,me,$,G,Y,he,K,J,be,q,Z,L,U,de],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let i=o;return i})();var Mt=[{path:"",component:Me,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:De,canActivate:[le],data:{title:"Inventory Comparison"}},{path:"bychannel",component:Ve,canActivate:[le],data:{title:"Inventory Comparison"}}]}],Pe=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=O({type:o}),o.\u0275inj=B({imports:[j,H.forChild(Mt)]});let i=o;return i})();var xn=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=O({type:o}),o.\u0275inj=B({providers:[ie],imports:[j,Pe,H,Se,ue,ge,we,fe,ne,Ce]});let i=o;return i})();export{xn as InventoryModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as cr,b as dr,e as js,g as re,h as a,i as it}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6RUGKYFT.js";var ur=function(n){let e=[],t=0;for(let i=0;i<n.length;i++){let r=n.charCodeAt(i);r<128?e[t++]=r:r<2048?(e[t++]=r>>6|192,e[t++]=r&63|128):(r&64512)===55296&&i+1<n.length&&(n.charCodeAt(i+1)&64512)===56320?(r=65536+((r&1023)<<10)+(n.charCodeAt(++i)&1023),e[t++]=r>>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},Gs=function(n){let e=[],t=0,i=0;for(;t<n.length;){let r=n[t++];if(r<128)e[i++]=String.fromCharCode(r);else if(r>191&&r<224){let s=n[t++];e[i++]=String.fromCharCode((r&31)<<6|s&63)}else if(r>239&&r<365){let s=n[t++],o=n[t++],c=n[t++],d=((r&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;e[i++]=String.fromCharCode(55296+(d>>10)),e[i++]=String.fromCharCode(56320+(d&1023))}else{let s=n[t++],o=n[t++];e[i++]=String.fromCharCode((r&15)<<12|(s&63)<<6|o&63)}}return e.join("")},hr={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();let t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let r=0;r<n.length;r+=3){let s=n[r],o=r+1<n.length,c=o?n[r+1]:0,d=r+2<n.length,l=d?n[r+2]:0,h=s>>2,f=(s&3)<<4|c>>4,m=(c&15)<<2|l>>6,S=l&63;d||(S=64,o||(m=64)),i.push(t[h],t[f],t[m],t[S])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(ur(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Gs(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();let t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r<n.length;){let s=t[n.charAt(r++)],c=r<n.length?t[n.charAt(r)]:0;++r;let l=r<n.length?t[n.charAt(r)]:64;++r;let f=r<n.length?t[n.charAt(r)]:64;if(++r,s==null||c==null||l==null||f==null)throw new qt;let m=s<<2|c>>4;if(i.push(m),l!==64){let S=c<<4&240|l>>2;if(i.push(S),f!==64){let ie=l<<6&192|f;i.push(ie)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},qt=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},qs=function(n){let e=ur(n);return hr.encodeByteArray(e,!0)},Yt=function(n){return qs(n).replace(/\./g,"")},Jt=function(n){try{return hr.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function Ne(n,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:let t=e;return new Date(t.getTime());case Object:n===void 0&&(n={});break;case Array:n=[];break;default:return e}for(let t in e)!e.hasOwnProperty(t)||!Ks(t)||(n[t]=Ne(n[t],e[t]));return n}function Ks(n){return n!=="__proto__"}function Ys(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}var Js=()=>Ys().__FIREBASE_DEFAULTS__,Xs=()=>{if(typeof process>"u"||typeof process.env>"u")return;let n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Qs=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=n&&Jt(n[1]);return e&&JSON.parse(e)},Xt=()=>{try{return Js()||Xs()||Qs()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}};var Qt=()=>{var n;return(n=Xt())===null||n===void 0?void 0:n.config},fr=n=>{var e;return(e=Xt())===null||e===void 0?void 0:e[`_${n}`]};var rt=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,i)=>{t?this.reject(t):this.resolve(i),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,i))}}};function v(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function pr(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(v())}function Zt(){var n;let e=(n=Xt())===null||n===void 0?void 0:n.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function mr(){return typeof self=="object"&&self.self===self}function st(){let n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Oe(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function ot(){let n=v();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Ee(){try{return typeof indexedDB=="object"}catch{return!1}}function gr(){return new Promise((n,e)=>{try{let t=!0,i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),t||self.indexedDB.deleteDatabase(i),n(!0)},r.onupgradeneeded=()=>{t=!1},r.onerror=()=>{var s;e(((s=r.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}var Zs="FirebaseError",T=class n extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name=Zs,Object.setPrototypeOf(this,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,C.prototype.create)}},C=class{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){let i=t[0]||{},r=`${this.service}/${e}`,s=this.errors[e],o=s?eo(s,i):"Error",c=`${this.serviceName}: ${o} (${r}).`;return new T(r,c,i)}};function eo(n,e){return n.replace(to,(t,i)=>{let r=e[i];return r!=null?String(r):`<${i}?>`})}var to=/\{\$([^}]+)}/g;function en(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function _r(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function De(n,e){if(n===e)return!0;let t=Object.keys(n),i=Object.keys(e);for(let r of t){if(!i.includes(r))return!1;let s=n[r],o=e[r];if(lr(s)&&lr(o)){if(!De(s,o))return!1}else if(s!==o)return!1}for(let r of i)if(!t.includes(r))return!1;return!0}function lr(n){return n!==null&&typeof n=="object"}function se(n){let e=[];for(let[t,i]of Object.entries(n))Array.isArray(i)?i.forEach(r=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(i));return e.length?"&"+e.join("&"):""}function Y(n){let e={};return n.replace(/^\?/,"").split("&").forEach(i=>{if(i){let[r,s]=i.split("=");e[decodeURIComponent(r)]=decodeURIComponent(s)}}),e}function ye(n){let e=n.indexOf("?");if(!e)return"";let t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function at(n,e){let t=new Kt(n,e);return t.subscribe.bind(t)}var Kt=class{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(i=>{this.error(i)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,i){let r;if(e===void 0&&t===void 0&&i===void 0)throw new Error("Missing Observer.");no(e,["next","error","complete"])?r=e:r={next:e,error:t,complete:i},r.next===void 0&&(r.next=Gt),r.error===void 0&&(r.error=Gt),r.complete===void 0&&(r.complete=Gt);let s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(i){typeof console<"u"&&console.error&&console.error(i)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};function no(n,e){if(typeof n!="object"||n===null)return!1;for(let t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Gt(){}var al=4*60*60*1e3;function p(n){return n&&n._delegate?n._delegate:n}var R=class{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};var oe="[DEFAULT]";var tn=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let i=new rt;if(this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize())try{let r=this.getOrInitializeService({instanceIdentifier:t});r&&i.resolve(r)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let i=this.normalizeInstanceIdentifier(e?.identifier),r=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(ro(e))try{this.getOrInitializeService({instanceIdentifier:oe})}catch{}for(let[t,i]of this.instancesDeferred.entries()){let r=this.normalizeInstanceIdentifier(t);try{let s=this.getOrInitializeService({instanceIdentifier:r});i.resolve(s)}catch{}}}}clearInstance(e=oe){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}delete(){return a(this,null,function*(){let e=Array.from(this.instances.values());yield Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])})}isComponentSet(){return this.component!=null}isInitialized(e=oe){return this.instances.has(e)}getOptions(e=oe){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let r=this.getOrInitializeService({instanceIdentifier:i,options:t});for(let[s,o]of this.instancesDeferred.entries()){let c=this.normalizeInstanceIdentifier(s);i===c&&o.resolve(r)}return r}onInit(e,t){var i;let r=this.normalizeInstanceIdentifier(t),s=(i=this.onInitCallbacks.get(r))!==null&&i!==void 0?i:new Set;s.add(e),this.onInitCallbacks.set(r,s);let o=this.instances.get(r);return o&&e(o,r),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){let i=this.onInitCallbacks.get(t);if(i)for(let r of i)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:io(e),options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=oe){return this.component?this.component.multipleInstances?e:oe:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function io(n){return n===oe?void 0:n}function ro(n){return n.instantiationMode==="EAGER"}var ct=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new tn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}};var En={};js(En,{FirebaseError:()=>T,SDK_VERSION:()=>j,_DEFAULT_ENTRY_NAME:()=>U,_addComponent:()=>xe,_addOrOverwriteComponent:()=>mn,_apps:()=>X,_clearComponents:()=>Go,_components:()=>Le,_getProvider:()=>gn,_registerComponent:()=>$,_removeServiceInstance:()=>jo,deleteApp:()=>_n,getApp:()=>Or,getApps:()=>Ko,initializeApp:()=>lt,onLog:()=>vn,registerVersion:()=>O,setLogLevel:()=>In});var nn=[],g=function(n){return n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT",n}(g||{}),vr={debug:g.DEBUG,verbose:g.VERBOSE,info:g.INFO,warn:g.WARN,error:g.ERROR,silent:g.SILENT},so=g.INFO,oo={[g.DEBUG]:"log",[g.VERBOSE]:"log",[g.INFO]:"info",[g.WARN]:"warn",[g.ERROR]:"error"},ao=(n,e,...t)=>{if(e<n.logLevel)return;let i=new Date().toISOString(),r=oo[e];if(r)console[r](`[${i}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},J=class{constructor(e){this.name=e,this._logLevel=so,this._logHandler=ao,this._userLogHandler=null,nn.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in g))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?vr[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,g.DEBUG,...e),this._logHandler(this,g.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,g.VERBOSE,...e),this._logHandler(this,g.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,g.INFO,...e),this._logHandler(this,g.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,g.WARN,...e),this._logHandler(this,g.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,g.ERROR,...e),this._logHandler(this,g.ERROR,...e)}};function Ir(n){nn.forEach(e=>{e.setLogLevel(n)})}function Er(n,e){for(let t of nn){let i=null;e&&e.level&&(i=vr[e.level]),n===null?t.userLogHandler=null:t.userLogHandler=(r,s,...o)=>{let c=o.map(d=>{if(d==null)return null;if(typeof d=="string")return d;if(typeof d=="number"||typeof d=="boolean")return d.toString();if(d instanceof Error)return d.message;try{return JSON.stringify(d)}catch{return null}}).filter(d=>d).join(" ");s>=(i??r.logLevel)&&n({level:g[s].toLowerCase(),message:c,args:o,type:r.name})}}}var co=(n,e)=>e.some(t=>n instanceof t),yr,wr;function lo(){return yr||(yr=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function uo(){return wr||(wr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var Tr=new WeakMap,sn=new WeakMap,br=new WeakMap,rn=new WeakMap,an=new WeakMap;function ho(n){let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(x(n.result)),r()},o=()=>{i(n.error),r()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Tr.set(t,n)}).catch(()=>{}),an.set(e,n),e}function fo(n){if(sn.has(n))return;let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),r()},o=()=>{i(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});sn.set(n,e)}var on={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return sn.get(n);if(e==="objectStoreNames")return n.objectStoreNames||br.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return x(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Ar(n){on=n(on)}function po(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let i=n.call(dt(this),e,...t);return br.set(i,e.sort?e.sort():[e]),x(i)}:uo().includes(n)?function(...e){return n.apply(dt(this),e),x(Tr.get(this))}:function(...e){return x(n.apply(dt(this),e))}}function mo(n){return typeof n=="function"?po(n):(n instanceof IDBTransaction&&fo(n),co(n,lo())?new Proxy(n,on):n)}function x(n){if(n instanceof IDBRequest)return ho(n);if(rn.has(n))return rn.get(n);let e=mo(n);return e!==n&&(rn.set(n,e),an.set(e,n)),e}var dt=n=>an.get(n);function Rr(n,e,{blocked:t,upgrade:i,blocking:r,terminated:s}={}){let o=indexedDB.open(n,e),c=x(o);return i&&o.addEventListener("upgradeneeded",d=>{i(x(o.result),d.oldVersion,d.newVersion,x(o.transaction),d)}),t&&o.addEventListener("blocked",d=>t(d.oldVersion,d.newVersion,d)),c.then(d=>{s&&d.addEventListener("close",()=>s()),r&&d.addEventListener("versionchange",l=>r(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}var go=["get","getKey","getAll","getAllKeys","count"],_o=["put","add","delete","clear"],cn=new Map;function Sr(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(cn.get(e))return cn.get(e);let t=e.replace(/FromIndex$/,""),i=e!==t,r=_o.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(r||go.includes(t)))return;let s=function(o,...c){return a(this,null,function*(){let d=this.transaction(o,r?"readwrite":"readonly"),l=d.store;return i&&(l=l.index(c.shift())),(yield Promise.all([l[t](...c),r&&d.done]))[0]})};return cn.set(e,s),s}Ar(n=>dr(cr({},n),{get:(e,t,i)=>Sr(e,t)||n.get(e,t,i),has:(e,t)=>!!Sr(e,t)||n.has(e,t)}));var ln=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(vo(t)){let i=t.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(t=>t).join(" ")}};function vo(n){let e=n.getComponent();return e?.type==="VERSION"}var un="@firebase/app",Pr="0.9.25";var ae=new J("@firebase/app"),Io="@firebase/app-compat",Eo="@firebase/analytics-compat",yo="@firebase/analytics",wo="@firebase/app-check-compat",To="@firebase/app-check",bo="@firebase/auth",Ao="@firebase/auth-compat",So="@firebase/database",Ro="@firebase/database-compat",Po="@firebase/functions",ko="@firebase/functions-compat",Co="@firebase/installations",No="@firebase/installations-compat",Oo="@firebase/messaging",Do="@firebase/messaging-compat",Lo="@firebase/performance",Mo="@firebase/performance-compat",xo="@firebase/remote-config",Uo="@firebase/remote-config-compat",Fo="@firebase/storage",Vo="@firebase/storage-compat",Wo="@firebase/firestore",Ho="@firebase/firestore-compat",Bo="firebase",zo="10.7.1";var U="[DEFAULT]",$o={[un]:"fire-core",[Io]:"fire-core-compat",[yo]:"fire-analytics",[Eo]:"fire-analytics-compat",[To]:"fire-app-check",[wo]:"fire-app-check-compat",[bo]:"fire-auth",[Ao]:"fire-auth-compat",[So]:"fire-rtdb",[Ro]:"fire-rtdb-compat",[Po]:"fire-fn",[ko]:"fire-fn-compat",[Co]:"fire-iid",[No]:"fire-iid-compat",[Oo]:"fire-fcm",[Do]:"fire-fcm-compat",[Lo]:"fire-perf",[Mo]:"fire-perf-compat",[xo]:"fire-rc",[Uo]:"fire-rc-compat",[Fo]:"fire-gcs",[Vo]:"fire-gcs-compat",[Wo]:"fire-fst",[Ho]:"fire-fst-compat","fire-js":"fire-js",[Bo]:"fire-js-all"};var X=new Map,Le=new Map;function xe(n,e){try{n.container.addComponent(e)}catch(t){ae.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function mn(n,e){n.container.addOrOverwriteComponent(e)}function $(n){let e=n.name;if(Le.has(e))return ae.debug(`There were multiple attempts to register component ${e}.`),!1;Le.set(e,n);for(let t of X.values())xe(t,n);return!0}function gn(n,e){let t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function jo(n,e,t=U){gn(n,e).clearInstance(t)}function Go(){Le.clear()}var qo={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},z=new C("app","Firebase",qo);var hn=class{constructor(e,t,i){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new R("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw z.create("app-deleted",{appName:this._name})}};var j=zo;function lt(n,e={}){let t=n;typeof e!="object"&&(e={name:e});let i=Object.assign({name:U,automaticDataCollectionEnabled:!1},e),r=i.name;if(typeof r!="string"||!r)throw z.create("bad-app-name",{appName:String(r)});if(t||(t=Qt()),!t)throw z.create("no-options");let s=X.get(r);if(s){if(De(t,s.options)&&De(i,s.config))return s;throw z.create("duplicate-app",{appName:r})}let o=new ct(r);for(let d of Le.values())o.addComponent(d);let c=new hn(t,i,o);return X.set(r,c),c}function Or(n=U){let e=X.get(n);if(!e&&n===U&&Qt())return lt();if(!e)throw z.create("no-app",{appName:n});return e}function Ko(){return Array.from(X.values())}function _n(n){return a(this,null,function*(){let e=n.name;X.has(e)&&(X.delete(e),yield Promise.all(n.container.getProviders().map(t=>t.delete())),n.isDeleted=!0)})}function O(n,e,t){var i;let r=(i=$o[n])!==null&&i!==void 0?i:n;t&&(r+=`-${t}`);let s=r.match(/\s|\//),o=e.match(/\s|\//);if(s||o){let c=[`Unable to register library "${r}" with version "${e}":`];s&&c.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&c.push("and"),o&&c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),ae.warn(c.join(" "));return}$(new R(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}function vn(n,e){if(n!==null&&typeof n!="function")throw z.create("invalid-log-argument");Er(n,e)}function In(n){Ir(n)}var Yo="firebase-heartbeat-database",Jo=1,Me="firebase-heartbeat-store",dn=null;function Dr(){return dn||(dn=Rr(Yo,Jo,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(Me)}}}).catch(n=>{throw z.create("idb-open",{originalErrorMessage:n.message})})),dn}function Xo(n){return a(this,null,function*(){try{return yield(yield Dr()).transaction(Me).objectStore(Me).get(Lr(n))}catch(e){if(e instanceof T)ae.warn(e.message);else{let t=z.create("idb-get",{originalErrorMessage:e?.message});ae.warn(t.message)}}})}function kr(n,e){return a(this,null,function*(){try{let i=(yield Dr()).transaction(Me,"readwrite");yield i.objectStore(Me).put(e,Lr(n)),yield i.done}catch(t){if(t instanceof T)ae.warn(t.message);else{let i=z.create("idb-set",{originalErrorMessage:t?.message});ae.warn(i.message)}}})}function Lr(n){return`${n.name}!${n.options.appId}`}var Qo=1024,Zo=30*24*60*60*1e3,fn=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new pn(t),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}triggerHeartbeat(){return a(this,null,function*(){var e,t;let r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=Cr();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=yield this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)))return this._heartbeatsCache.heartbeats.push({date:s,agent:r}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{let c=new Date(o.date).valueOf();return Date.now()-c<=Zo}),this._storage.overwrite(this._heartbeatsCache)})}getHeartbeatsHeader(){return a(this,null,function*(){var e;if(this._heartbeatsCache===null&&(yield this._heartbeatsCachePromise),((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";let t=Cr(),{heartbeatsToSend:i,unsentEntries:r}=ea(this._heartbeatsCache.heartbeats),s=Yt(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,yield this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s})}};function Cr(){return new Date().toISOString().substring(0,10)}function ea(n,e=Qo){let t=[],i=n.slice();for(let r of n){let s=t.find(o=>o.agent===r.agent);if(s){if(s.dates.push(r.date),Nr(t)>e){s.dates.pop();break}}else if(t.push({agent:r.agent,dates:[r.date]}),Nr(t)>e){t.pop();break}i=i.slice(1)}return{heartbeatsToSend:t,unsentEntries:i}}var pn=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return a(this,null,function*(){return Ee()?gr().then(()=>!0).catch(()=>!1):!1})}read(){return a(this,null,function*(){if(yield this._canUseIndexedDBPromise){let t=yield Xo(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}})}overwrite(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let r=yield this.read();return kr(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return})}add(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let r=yield this.read();return kr(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return})}};function Nr(n){return Yt(JSON.stringify({version:2,heartbeats:n})).length}function ta(n){$(new R("platform-logger",e=>new ln(e),"PRIVATE")),$(new R("heartbeat",e=>new fn(e),"PRIVATE")),O(un,Pr,n),O(un,Pr,"esm2017"),O("fire-js","")}ta("");var yn=class{constructor(e,t){this._delegate=e,this.firebase=t,xe(e,new R("app-compat",()=>this,"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(e=>{this._delegate.checkDestroyed(),e()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),_n(this._delegate)))}_getService(e,t=U){var i;this._delegate.checkDestroyed();let r=this._delegate.container.getProvider(e);return!r.isInitialized()&&((i=r.getComponent())===null||i===void 0?void 0:i.instantiationMode)==="EXPLICIT"&&r.initialize(),r.getImmediate({identifier:t})}_removeServiceInstance(e,t=U){this._delegate.container.getProvider(e).clearInstance(t)}_addComponent(e){xe(this._delegate,e)}_addOrOverwriteComponent(e){mn(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}};var na={"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."},Mr=new C("app-compat","Firebase",na);function ia(n){let e={},t={__esModule:!0,initializeApp:s,app:r,registerVersion:O,setLogLevel:In,onLog:vn,apps:null,SDK_VERSION:j,INTERNAL:{registerComponent:c,removeApp:i,useAsService:d,modularAPIs:En}};t.default=t,Object.defineProperty(t,"apps",{get:o});function i(l){delete e[l]}function r(l){if(l=l||U,!en(e,l))throw Mr.create("no-app",{appName:l});return e[l]}r.App=n;function s(l,h={}){let f=lt(l,h);if(en(e,f.name))return e[f.name];let m=new n(f,t);return e[f.name]=m,m}function o(){return Object.keys(e).map(l=>e[l])}function c(l){let h=l.name,f=h.replace("-compat","");if($(l)&&l.type==="PUBLIC"){let m=(S=r())=>{if(typeof S[f]!="function")throw Mr.create("invalid-app-argument",{appName:h});return S[f]()};l.serviceProps!==void 0&&Ne(m,l.serviceProps),t[f]=m,n.prototype[f]=function(...S){return this._getService.bind(this,h).apply(this,l.multipleInstances?S:[])}}return l.type==="PUBLIC"?t[f]:null}function d(l,h){return h==="serverAuth"?null:h}return t}function Ur(){let n=ia(yn);n.INTERNAL=Object.assign(Object.assign({},n.INTERNAL),{createFirebaseNamespace:Ur,extendNamespace:e,createSubscribe:at,ErrorFactory:C,deepExtend:Ne});function e(t){Ne(n,t)}return n}var ra=Ur();var xr=new J("@firebase/app-compat"),sa="@firebase/app-compat",oa="0.2.25";function aa(n){O(sa,oa,n)}if(mr()&&self.firebase!==void 0){xr.warn(`
|
|
1
|
+
import{a as cr,b as dr,e as js,g as re,h as a,i as it}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-72VLH7XK.js";var ur=function(n){let e=[],t=0;for(let i=0;i<n.length;i++){let r=n.charCodeAt(i);r<128?e[t++]=r:r<2048?(e[t++]=r>>6|192,e[t++]=r&63|128):(r&64512)===55296&&i+1<n.length&&(n.charCodeAt(i+1)&64512)===56320?(r=65536+((r&1023)<<10)+(n.charCodeAt(++i)&1023),e[t++]=r>>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},Gs=function(n){let e=[],t=0,i=0;for(;t<n.length;){let r=n[t++];if(r<128)e[i++]=String.fromCharCode(r);else if(r>191&&r<224){let s=n[t++];e[i++]=String.fromCharCode((r&31)<<6|s&63)}else if(r>239&&r<365){let s=n[t++],o=n[t++],c=n[t++],d=((r&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;e[i++]=String.fromCharCode(55296+(d>>10)),e[i++]=String.fromCharCode(56320+(d&1023))}else{let s=n[t++],o=n[t++];e[i++]=String.fromCharCode((r&15)<<12|(s&63)<<6|o&63)}}return e.join("")},hr={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();let t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let r=0;r<n.length;r+=3){let s=n[r],o=r+1<n.length,c=o?n[r+1]:0,d=r+2<n.length,l=d?n[r+2]:0,h=s>>2,f=(s&3)<<4|c>>4,m=(c&15)<<2|l>>6,S=l&63;d||(S=64,o||(m=64)),i.push(t[h],t[f],t[m],t[S])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(ur(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Gs(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();let t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r<n.length;){let s=t[n.charAt(r++)],c=r<n.length?t[n.charAt(r)]:0;++r;let l=r<n.length?t[n.charAt(r)]:64;++r;let f=r<n.length?t[n.charAt(r)]:64;if(++r,s==null||c==null||l==null||f==null)throw new qt;let m=s<<2|c>>4;if(i.push(m),l!==64){let S=c<<4&240|l>>2;if(i.push(S),f!==64){let ie=l<<6&192|f;i.push(ie)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},qt=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},qs=function(n){let e=ur(n);return hr.encodeByteArray(e,!0)},Yt=function(n){return qs(n).replace(/\./g,"")},Jt=function(n){try{return hr.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function Ne(n,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:let t=e;return new Date(t.getTime());case Object:n===void 0&&(n={});break;case Array:n=[];break;default:return e}for(let t in e)!e.hasOwnProperty(t)||!Ks(t)||(n[t]=Ne(n[t],e[t]));return n}function Ks(n){return n!=="__proto__"}function Ys(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}var Js=()=>Ys().__FIREBASE_DEFAULTS__,Xs=()=>{if(typeof process>"u"||typeof process.env>"u")return;let n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Qs=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=n&&Jt(n[1]);return e&&JSON.parse(e)},Xt=()=>{try{return Js()||Xs()||Qs()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}};var Qt=()=>{var n;return(n=Xt())===null||n===void 0?void 0:n.config},fr=n=>{var e;return(e=Xt())===null||e===void 0?void 0:e[`_${n}`]};var rt=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,i)=>{t?this.reject(t):this.resolve(i),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,i))}}};function v(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function pr(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(v())}function Zt(){var n;let e=(n=Xt())===null||n===void 0?void 0:n.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function mr(){return typeof self=="object"&&self.self===self}function st(){let n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Oe(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function ot(){let n=v();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Ee(){try{return typeof indexedDB=="object"}catch{return!1}}function gr(){return new Promise((n,e)=>{try{let t=!0,i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),t||self.indexedDB.deleteDatabase(i),n(!0)},r.onupgradeneeded=()=>{t=!1},r.onerror=()=>{var s;e(((s=r.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}var Zs="FirebaseError",T=class n extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name=Zs,Object.setPrototypeOf(this,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,C.prototype.create)}},C=class{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){let i=t[0]||{},r=`${this.service}/${e}`,s=this.errors[e],o=s?eo(s,i):"Error",c=`${this.serviceName}: ${o} (${r}).`;return new T(r,c,i)}};function eo(n,e){return n.replace(to,(t,i)=>{let r=e[i];return r!=null?String(r):`<${i}?>`})}var to=/\{\$([^}]+)}/g;function en(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function _r(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function De(n,e){if(n===e)return!0;let t=Object.keys(n),i=Object.keys(e);for(let r of t){if(!i.includes(r))return!1;let s=n[r],o=e[r];if(lr(s)&&lr(o)){if(!De(s,o))return!1}else if(s!==o)return!1}for(let r of i)if(!t.includes(r))return!1;return!0}function lr(n){return n!==null&&typeof n=="object"}function se(n){let e=[];for(let[t,i]of Object.entries(n))Array.isArray(i)?i.forEach(r=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(i));return e.length?"&"+e.join("&"):""}function Y(n){let e={};return n.replace(/^\?/,"").split("&").forEach(i=>{if(i){let[r,s]=i.split("=");e[decodeURIComponent(r)]=decodeURIComponent(s)}}),e}function ye(n){let e=n.indexOf("?");if(!e)return"";let t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function at(n,e){let t=new Kt(n,e);return t.subscribe.bind(t)}var Kt=class{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(i=>{this.error(i)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,i){let r;if(e===void 0&&t===void 0&&i===void 0)throw new Error("Missing Observer.");no(e,["next","error","complete"])?r=e:r={next:e,error:t,complete:i},r.next===void 0&&(r.next=Gt),r.error===void 0&&(r.error=Gt),r.complete===void 0&&(r.complete=Gt);let s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(i){typeof console<"u"&&console.error&&console.error(i)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};function no(n,e){if(typeof n!="object"||n===null)return!1;for(let t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Gt(){}var al=4*60*60*1e3;function p(n){return n&&n._delegate?n._delegate:n}var R=class{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};var oe="[DEFAULT]";var tn=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let i=new rt;if(this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize())try{let r=this.getOrInitializeService({instanceIdentifier:t});r&&i.resolve(r)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let i=this.normalizeInstanceIdentifier(e?.identifier),r=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(ro(e))try{this.getOrInitializeService({instanceIdentifier:oe})}catch{}for(let[t,i]of this.instancesDeferred.entries()){let r=this.normalizeInstanceIdentifier(t);try{let s=this.getOrInitializeService({instanceIdentifier:r});i.resolve(s)}catch{}}}}clearInstance(e=oe){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}delete(){return a(this,null,function*(){let e=Array.from(this.instances.values());yield Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])})}isComponentSet(){return this.component!=null}isInitialized(e=oe){return this.instances.has(e)}getOptions(e=oe){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let r=this.getOrInitializeService({instanceIdentifier:i,options:t});for(let[s,o]of this.instancesDeferred.entries()){let c=this.normalizeInstanceIdentifier(s);i===c&&o.resolve(r)}return r}onInit(e,t){var i;let r=this.normalizeInstanceIdentifier(t),s=(i=this.onInitCallbacks.get(r))!==null&&i!==void 0?i:new Set;s.add(e),this.onInitCallbacks.set(r,s);let o=this.instances.get(r);return o&&e(o,r),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){let i=this.onInitCallbacks.get(t);if(i)for(let r of i)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:io(e),options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=oe){return this.component?this.component.multipleInstances?e:oe:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function io(n){return n===oe?void 0:n}function ro(n){return n.instantiationMode==="EAGER"}var ct=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new tn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}};var En={};js(En,{FirebaseError:()=>T,SDK_VERSION:()=>j,_DEFAULT_ENTRY_NAME:()=>U,_addComponent:()=>xe,_addOrOverwriteComponent:()=>mn,_apps:()=>X,_clearComponents:()=>Go,_components:()=>Le,_getProvider:()=>gn,_registerComponent:()=>$,_removeServiceInstance:()=>jo,deleteApp:()=>_n,getApp:()=>Or,getApps:()=>Ko,initializeApp:()=>lt,onLog:()=>vn,registerVersion:()=>O,setLogLevel:()=>In});var nn=[],g=function(n){return n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT",n}(g||{}),vr={debug:g.DEBUG,verbose:g.VERBOSE,info:g.INFO,warn:g.WARN,error:g.ERROR,silent:g.SILENT},so=g.INFO,oo={[g.DEBUG]:"log",[g.VERBOSE]:"log",[g.INFO]:"info",[g.WARN]:"warn",[g.ERROR]:"error"},ao=(n,e,...t)=>{if(e<n.logLevel)return;let i=new Date().toISOString(),r=oo[e];if(r)console[r](`[${i}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},J=class{constructor(e){this.name=e,this._logLevel=so,this._logHandler=ao,this._userLogHandler=null,nn.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in g))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?vr[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,g.DEBUG,...e),this._logHandler(this,g.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,g.VERBOSE,...e),this._logHandler(this,g.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,g.INFO,...e),this._logHandler(this,g.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,g.WARN,...e),this._logHandler(this,g.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,g.ERROR,...e),this._logHandler(this,g.ERROR,...e)}};function Ir(n){nn.forEach(e=>{e.setLogLevel(n)})}function Er(n,e){for(let t of nn){let i=null;e&&e.level&&(i=vr[e.level]),n===null?t.userLogHandler=null:t.userLogHandler=(r,s,...o)=>{let c=o.map(d=>{if(d==null)return null;if(typeof d=="string")return d;if(typeof d=="number"||typeof d=="boolean")return d.toString();if(d instanceof Error)return d.message;try{return JSON.stringify(d)}catch{return null}}).filter(d=>d).join(" ");s>=(i??r.logLevel)&&n({level:g[s].toLowerCase(),message:c,args:o,type:r.name})}}}var co=(n,e)=>e.some(t=>n instanceof t),yr,wr;function lo(){return yr||(yr=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function uo(){return wr||(wr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var Tr=new WeakMap,sn=new WeakMap,br=new WeakMap,rn=new WeakMap,an=new WeakMap;function ho(n){let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(x(n.result)),r()},o=()=>{i(n.error),r()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Tr.set(t,n)}).catch(()=>{}),an.set(e,n),e}function fo(n){if(sn.has(n))return;let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),r()},o=()=>{i(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});sn.set(n,e)}var on={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return sn.get(n);if(e==="objectStoreNames")return n.objectStoreNames||br.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return x(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Ar(n){on=n(on)}function po(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let i=n.call(dt(this),e,...t);return br.set(i,e.sort?e.sort():[e]),x(i)}:uo().includes(n)?function(...e){return n.apply(dt(this),e),x(Tr.get(this))}:function(...e){return x(n.apply(dt(this),e))}}function mo(n){return typeof n=="function"?po(n):(n instanceof IDBTransaction&&fo(n),co(n,lo())?new Proxy(n,on):n)}function x(n){if(n instanceof IDBRequest)return ho(n);if(rn.has(n))return rn.get(n);let e=mo(n);return e!==n&&(rn.set(n,e),an.set(e,n)),e}var dt=n=>an.get(n);function Rr(n,e,{blocked:t,upgrade:i,blocking:r,terminated:s}={}){let o=indexedDB.open(n,e),c=x(o);return i&&o.addEventListener("upgradeneeded",d=>{i(x(o.result),d.oldVersion,d.newVersion,x(o.transaction),d)}),t&&o.addEventListener("blocked",d=>t(d.oldVersion,d.newVersion,d)),c.then(d=>{s&&d.addEventListener("close",()=>s()),r&&d.addEventListener("versionchange",l=>r(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}var go=["get","getKey","getAll","getAllKeys","count"],_o=["put","add","delete","clear"],cn=new Map;function Sr(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(cn.get(e))return cn.get(e);let t=e.replace(/FromIndex$/,""),i=e!==t,r=_o.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(r||go.includes(t)))return;let s=function(o,...c){return a(this,null,function*(){let d=this.transaction(o,r?"readwrite":"readonly"),l=d.store;return i&&(l=l.index(c.shift())),(yield Promise.all([l[t](...c),r&&d.done]))[0]})};return cn.set(e,s),s}Ar(n=>dr(cr({},n),{get:(e,t,i)=>Sr(e,t)||n.get(e,t,i),has:(e,t)=>!!Sr(e,t)||n.has(e,t)}));var ln=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(vo(t)){let i=t.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(t=>t).join(" ")}};function vo(n){let e=n.getComponent();return e?.type==="VERSION"}var un="@firebase/app",Pr="0.9.25";var ae=new J("@firebase/app"),Io="@firebase/app-compat",Eo="@firebase/analytics-compat",yo="@firebase/analytics",wo="@firebase/app-check-compat",To="@firebase/app-check",bo="@firebase/auth",Ao="@firebase/auth-compat",So="@firebase/database",Ro="@firebase/database-compat",Po="@firebase/functions",ko="@firebase/functions-compat",Co="@firebase/installations",No="@firebase/installations-compat",Oo="@firebase/messaging",Do="@firebase/messaging-compat",Lo="@firebase/performance",Mo="@firebase/performance-compat",xo="@firebase/remote-config",Uo="@firebase/remote-config-compat",Fo="@firebase/storage",Vo="@firebase/storage-compat",Wo="@firebase/firestore",Ho="@firebase/firestore-compat",Bo="firebase",zo="10.7.1";var U="[DEFAULT]",$o={[un]:"fire-core",[Io]:"fire-core-compat",[yo]:"fire-analytics",[Eo]:"fire-analytics-compat",[To]:"fire-app-check",[wo]:"fire-app-check-compat",[bo]:"fire-auth",[Ao]:"fire-auth-compat",[So]:"fire-rtdb",[Ro]:"fire-rtdb-compat",[Po]:"fire-fn",[ko]:"fire-fn-compat",[Co]:"fire-iid",[No]:"fire-iid-compat",[Oo]:"fire-fcm",[Do]:"fire-fcm-compat",[Lo]:"fire-perf",[Mo]:"fire-perf-compat",[xo]:"fire-rc",[Uo]:"fire-rc-compat",[Fo]:"fire-gcs",[Vo]:"fire-gcs-compat",[Wo]:"fire-fst",[Ho]:"fire-fst-compat","fire-js":"fire-js",[Bo]:"fire-js-all"};var X=new Map,Le=new Map;function xe(n,e){try{n.container.addComponent(e)}catch(t){ae.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function mn(n,e){n.container.addOrOverwriteComponent(e)}function $(n){let e=n.name;if(Le.has(e))return ae.debug(`There were multiple attempts to register component ${e}.`),!1;Le.set(e,n);for(let t of X.values())xe(t,n);return!0}function gn(n,e){let t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function jo(n,e,t=U){gn(n,e).clearInstance(t)}function Go(){Le.clear()}var qo={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},z=new C("app","Firebase",qo);var hn=class{constructor(e,t,i){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new R("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw z.create("app-deleted",{appName:this._name})}};var j=zo;function lt(n,e={}){let t=n;typeof e!="object"&&(e={name:e});let i=Object.assign({name:U,automaticDataCollectionEnabled:!1},e),r=i.name;if(typeof r!="string"||!r)throw z.create("bad-app-name",{appName:String(r)});if(t||(t=Qt()),!t)throw z.create("no-options");let s=X.get(r);if(s){if(De(t,s.options)&&De(i,s.config))return s;throw z.create("duplicate-app",{appName:r})}let o=new ct(r);for(let d of Le.values())o.addComponent(d);let c=new hn(t,i,o);return X.set(r,c),c}function Or(n=U){let e=X.get(n);if(!e&&n===U&&Qt())return lt();if(!e)throw z.create("no-app",{appName:n});return e}function Ko(){return Array.from(X.values())}function _n(n){return a(this,null,function*(){let e=n.name;X.has(e)&&(X.delete(e),yield Promise.all(n.container.getProviders().map(t=>t.delete())),n.isDeleted=!0)})}function O(n,e,t){var i;let r=(i=$o[n])!==null&&i!==void 0?i:n;t&&(r+=`-${t}`);let s=r.match(/\s|\//),o=e.match(/\s|\//);if(s||o){let c=[`Unable to register library "${r}" with version "${e}":`];s&&c.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&c.push("and"),o&&c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),ae.warn(c.join(" "));return}$(new R(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}function vn(n,e){if(n!==null&&typeof n!="function")throw z.create("invalid-log-argument");Er(n,e)}function In(n){Ir(n)}var Yo="firebase-heartbeat-database",Jo=1,Me="firebase-heartbeat-store",dn=null;function Dr(){return dn||(dn=Rr(Yo,Jo,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(Me)}}}).catch(n=>{throw z.create("idb-open",{originalErrorMessage:n.message})})),dn}function Xo(n){return a(this,null,function*(){try{return yield(yield Dr()).transaction(Me).objectStore(Me).get(Lr(n))}catch(e){if(e instanceof T)ae.warn(e.message);else{let t=z.create("idb-get",{originalErrorMessage:e?.message});ae.warn(t.message)}}})}function kr(n,e){return a(this,null,function*(){try{let i=(yield Dr()).transaction(Me,"readwrite");yield i.objectStore(Me).put(e,Lr(n)),yield i.done}catch(t){if(t instanceof T)ae.warn(t.message);else{let i=z.create("idb-set",{originalErrorMessage:t?.message});ae.warn(i.message)}}})}function Lr(n){return`${n.name}!${n.options.appId}`}var Qo=1024,Zo=30*24*60*60*1e3,fn=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new pn(t),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}triggerHeartbeat(){return a(this,null,function*(){var e,t;let r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=Cr();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=yield this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)))return this._heartbeatsCache.heartbeats.push({date:s,agent:r}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{let c=new Date(o.date).valueOf();return Date.now()-c<=Zo}),this._storage.overwrite(this._heartbeatsCache)})}getHeartbeatsHeader(){return a(this,null,function*(){var e;if(this._heartbeatsCache===null&&(yield this._heartbeatsCachePromise),((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";let t=Cr(),{heartbeatsToSend:i,unsentEntries:r}=ea(this._heartbeatsCache.heartbeats),s=Yt(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,yield this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s})}};function Cr(){return new Date().toISOString().substring(0,10)}function ea(n,e=Qo){let t=[],i=n.slice();for(let r of n){let s=t.find(o=>o.agent===r.agent);if(s){if(s.dates.push(r.date),Nr(t)>e){s.dates.pop();break}}else if(t.push({agent:r.agent,dates:[r.date]}),Nr(t)>e){t.pop();break}i=i.slice(1)}return{heartbeatsToSend:t,unsentEntries:i}}var pn=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return a(this,null,function*(){return Ee()?gr().then(()=>!0).catch(()=>!1):!1})}read(){return a(this,null,function*(){if(yield this._canUseIndexedDBPromise){let t=yield Xo(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}})}overwrite(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let r=yield this.read();return kr(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return})}add(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let r=yield this.read();return kr(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return})}};function Nr(n){return Yt(JSON.stringify({version:2,heartbeats:n})).length}function ta(n){$(new R("platform-logger",e=>new ln(e),"PRIVATE")),$(new R("heartbeat",e=>new fn(e),"PRIVATE")),O(un,Pr,n),O(un,Pr,"esm2017"),O("fire-js","")}ta("");var yn=class{constructor(e,t){this._delegate=e,this.firebase=t,xe(e,new R("app-compat",()=>this,"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(e=>{this._delegate.checkDestroyed(),e()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),_n(this._delegate)))}_getService(e,t=U){var i;this._delegate.checkDestroyed();let r=this._delegate.container.getProvider(e);return!r.isInitialized()&&((i=r.getComponent())===null||i===void 0?void 0:i.instantiationMode)==="EXPLICIT"&&r.initialize(),r.getImmediate({identifier:t})}_removeServiceInstance(e,t=U){this._delegate.container.getProvider(e).clearInstance(t)}_addComponent(e){xe(this._delegate,e)}_addOrOverwriteComponent(e){mn(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}};var na={"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."},Mr=new C("app-compat","Firebase",na);function ia(n){let e={},t={__esModule:!0,initializeApp:s,app:r,registerVersion:O,setLogLevel:In,onLog:vn,apps:null,SDK_VERSION:j,INTERNAL:{registerComponent:c,removeApp:i,useAsService:d,modularAPIs:En}};t.default=t,Object.defineProperty(t,"apps",{get:o});function i(l){delete e[l]}function r(l){if(l=l||U,!en(e,l))throw Mr.create("no-app",{appName:l});return e[l]}r.App=n;function s(l,h={}){let f=lt(l,h);if(en(e,f.name))return e[f.name];let m=new n(f,t);return e[f.name]=m,m}function o(){return Object.keys(e).map(l=>e[l])}function c(l){let h=l.name,f=h.replace("-compat","");if($(l)&&l.type==="PUBLIC"){let m=(S=r())=>{if(typeof S[f]!="function")throw Mr.create("invalid-app-argument",{appName:h});return S[f]()};l.serviceProps!==void 0&&Ne(m,l.serviceProps),t[f]=m,n.prototype[f]=function(...S){return this._getService.bind(this,h).apply(this,l.multipleInstances?S:[])}}return l.type==="PUBLIC"?t[f]:null}function d(l,h){return h==="serverAuth"?null:h}return t}function Ur(){let n=ia(yn);n.INTERNAL=Object.assign(Object.assign({},n.INTERNAL),{createFirebaseNamespace:Ur,extendNamespace:e,createSubscribe:at,ErrorFactory:C,deepExtend:Ne});function e(t){Ne(n,t)}return n}var ra=Ur();var xr=new J("@firebase/app-compat"),sa="@firebase/app-compat",oa="0.2.25";function aa(n){O(sa,oa,n)}if(mr()&&self.firebase!==void 0){xr.warn(`
|
|
2
2
|
Warning: Firebase is already defined in the global scope. Please make sure
|
|
3
3
|
Firebase library is only loaded once.
|
|
4
4
|
`);let n=self.firebase.SDK_VERSION;n&&n.indexOf("LITE")>=0&&xr.warn(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.
|
|
1
|
+
import{a as h}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-BVMOK3VE.js";import{b as i}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-YD4CXLB4.js";import{$ as s,ca as n,q as o}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZHLG7GCJ.js";var g=(()=>{let a=class a{constructor(t){this.db=t,this.DATABASE="Categories"}saveCategoriesByChannelType(t,e){let c=this.getKey(e);return this.db.add(this.DATABASE,t,c).pipe(o(p=>t))}getCategoriesByChannelType(t){let e=this.getKey(t);return this.db.getByKey(this.DATABASE,e)}getKey(t){let e="";switch(t){case i.Lazada:e="Lazada";break;case i.Tokopedia:e="Tokopedia";break}return e}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let t=localStorage.getItem("Authorization");return this.hostName=JSON.parse(t)?.Host,this.hostName}};a.\u0275fac=function(e){return new(e||a)(n(h))},a.\u0275prov=s({token:a,factory:a.\u0275fac,providedIn:"root"});let r=a;return r})();export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ba as F,Da as w,Ga as a,Ia as de,Ja as V,La as d,Na as J,Qa as Q,Sb as T,Ub as ee,Z as c,_ as G,aa as M,ba as _,fa as E,ga as u,gb as ce,hb as m,ia as j,m as ae,na as p,q as le,tb as h,w as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";import{a as g,b as C}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6RUGKYFT.js";var Ve=(()=>{let e=class e{constructor(t,n){this._renderer=t,this._elementRef=n,this.onChange=s=>{},this.onTouched=()=>{}}setProperty(t,n){this._renderer.setProperty(this._elementRef.nativeElement,t,n)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}};e.\u0275fac=function(n){return new(n||e)(a(w),a(F))},e.\u0275dir=u({type:e});let i=e;return i})(),P=(()=>{let e=class e extends Ve{};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,features:[d]});let i=e;return i})(),b=new _("NgValueAccessor"),qe={provide:b,useExisting:c(()=>ze),multi:!0},ze=(()=>{let e=class e extends P{writeValue(t){this.setProperty("checked",t)}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(n,s){n&1&&m("change",function(l){return s.onChange(l.target.checked)})("blur",function(){return s.onTouched()})},features:[h([qe]),d]});let i=e;return i})(),Ze={provide:b,useExisting:c(()=>De),multi:!0};function Xe(){let i=ee()?ee().getUserAgent():"";return/android (\d+)/.test(i.toLowerCase())}var Ye=new _("CompositionEventMode"),De=(()=>{let e=class e extends Ve{constructor(t,n,s){super(t,n),this._compositionMode=s,this._composing=!1,this._compositionMode==null&&(this._compositionMode=!Xe())}writeValue(t){let n=t??"";this.setProperty("value",n)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}};e.\u0275fac=function(n){return new(n||e)(a(w),a(F),a(Ye,8))},e.\u0275dir=u({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(n,s){n&1&&m("input",function(l){return s._handleInput(l.target.value)})("blur",function(){return s.onTouched()})("compositionstart",function(){return s._compositionStart()})("compositionend",function(l){return s._compositionEnd(l.target.value)})},features:[h([Ze]),d]});let i=e;return i})();function y(i){return i==null||(typeof i=="string"||Array.isArray(i))&&i.length===0}function be(i){return i!=null&&typeof i.length=="number"}var A=new _("NgValidators"),ie=new _("NgAsyncValidators"),Ke=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,he=class{static min(e){return Je(e)}static max(e){return Qe(e)}static required(e){return Ae(e)}static requiredTrue(e){return et(e)}static email(e){return Me(e)}static minLength(e){return tt(e)}static maxLength(e){return it(e)}static pattern(e){return Ee(e)}static nullValidator(e){return U(e)}static compose(e){return Ne(e)}static composeAsync(e){return Pe(e)}};function Je(i){return e=>{if(y(e.value)||y(i))return null;let r=parseFloat(e.value);return!isNaN(r)&&r<i?{min:{min:i,actual:e.value}}:null}}function Qe(i){return e=>{if(y(e.value)||y(i))return null;let r=parseFloat(e.value);return!isNaN(r)&&r>i?{max:{max:i,actual:e.value}}:null}}function Ae(i){return y(i.value)?{required:!0}:null}function et(i){return i.value===!0?null:{required:!0}}function Me(i){return y(i.value)||Ke.test(i.value)?null:{email:!0}}function tt(i){return e=>y(e.value)||!be(e.value)?null:e.value.length<i?{minlength:{requiredLength:i,actualLength:e.value.length}}:null}function it(i){return e=>be(e.value)&&e.value.length>i?{maxlength:{requiredLength:i,actualLength:e.value.length}}:null}function Ee(i){if(!i)return U;let e,r;return typeof i=="string"?(r="",i.charAt(0)!=="^"&&(r+="^"),r+=i,i.charAt(i.length-1)!=="$"&&(r+="$"),e=new RegExp(r)):(r=i.toString(),e=i),t=>{if(y(t.value))return null;let n=t.value;return e.test(n)?null:{pattern:{requiredPattern:r,actualValue:n}}}}function U(i){return null}function Fe(i){return i!=null}function we(i){return ce(i)?ae(i):i}function Ie(i){let e={};return i.forEach(r=>{e=r!=null?g(g({},e),r):e}),Object.keys(e).length===0?null:e}function Se(i,e){return e.map(r=>r(i))}function nt(i){return!i.validate}function Oe(i){return i.map(e=>nt(e)?e:r=>e.validate(r))}function Ne(i){if(!i)return null;let e=i.filter(Fe);return e.length==0?null:function(r){return Ie(Se(r,e))}}function ne(i){return i!=null?Ne(Oe(i)):null}function Pe(i){if(!i)return null;let e=i.filter(Fe);return e.length==0?null:function(r){let t=Se(r,e).map(we);return ue(t).pipe(le(Ie))}}function re(i){return i!=null?Pe(Oe(i)):null}function fe(i,e){return i===null?[e]:Array.isArray(i)?[...i,e]:[i,e]}function xe(i){return i._rawValidators}function ke(i){return i._rawAsyncValidators}function te(i){return i?Array.isArray(i)?i:[i]:[]}function R(i,e){return Array.isArray(i)?i.includes(e):i===e}function pe(i,e){let r=te(e);return te(i).forEach(n=>{R(r,n)||r.push(n)}),r}function ge(i,e){return te(e).filter(r=>!R(i,r))}var H=class{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=ne(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=re(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,r){return this.control?this.control.hasError(e,r):!1}getError(e,r){return this.control?this.control.getError(e,r):null}},v=class extends H{get formDirective(){return null}get path(){return null}},N=class extends H{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}},L=class{constructor(e){this._cd=e}get isTouched(){return!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return!!this._cd?.submitted}},rt={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},oi=C(g({},rt),{"[class.ng-submitted]":"isSubmitted"}),ai=(()=>{let e=class e extends L{constructor(t){super(t)}};e.\u0275fac=function(n){return new(n||e)(a(N,2))},e.\u0275dir=u({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(n,s){n&2&&Q("ng-untouched",s.isUntouched)("ng-touched",s.isTouched)("ng-pristine",s.isPristine)("ng-dirty",s.isDirty)("ng-valid",s.isValid)("ng-invalid",s.isInvalid)("ng-pending",s.isPending)},features:[d]});let i=e;return i})(),li=(()=>{let e=class e extends L{constructor(t){super(t)}};e.\u0275fac=function(n){return new(n||e)(a(v,10))},e.\u0275dir=u({type:e,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(n,s){n&2&&Q("ng-untouched",s.isUntouched)("ng-touched",s.isTouched)("ng-pristine",s.isPristine)("ng-dirty",s.isDirty)("ng-valid",s.isValid)("ng-invalid",s.isInvalid)("ng-pending",s.isPending)("ng-submitted",s.isSubmitted)},features:[d]});let i=e;return i})();var I="VALID",B="INVALID",D="PENDING",S="DISABLED";function Ge(i){return(X(i)?i.validators:i)||null}function st(i){return Array.isArray(i)?ne(i):i||null}function je(i,e){return(X(e)?e.asyncValidators:i)||null}function ot(i){return Array.isArray(i)?re(i):i||null}function X(i){return i!=null&&!Array.isArray(i)&&typeof i=="object"}function at(i,e,r){let t=i.controls;if(!(e?Object.keys(t):t).length)throw new G(1e3,"");if(!t[r])throw new G(1001,"")}function lt(i,e,r){i._forEachChild((t,n)=>{if(r[n]===void 0)throw new G(1002,"")})}var $=class{constructor(e,r){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._assignValidators(e),this._assignAsyncValidators(r)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===I}get invalid(){return this.status===B}get pending(){return this.status==D}get disabled(){return this.status===S}get enabled(){return this.status!==S}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(pe(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(pe(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(ge(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(ge(e,this._rawAsyncValidators))}hasValidator(e){return R(this._rawValidators,e)}hasAsyncValidator(e){return R(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(r=>{r.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=D,e.emitEvent!==!1&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){let r=this._parentMarkedDirty(e.onlySelf);this.status=S,this.errors=null,this._forEachChild(t=>{t.disable(C(g({},e),{onlySelf:!0}))}),this._updateValue(),e.emitEvent!==!1&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(C(g({},e),{skipPristineCheck:r})),this._onDisabledChange.forEach(t=>t(!0))}enable(e={}){let r=this._parentMarkedDirty(e.onlySelf);this.status=I,this._forEachChild(t=>{t.enable(C(g({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(C(g({},e),{skipPristineCheck:r})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===I||this.status===D)&&this._runAsyncValidator(e.emitEvent)),e.emitEvent!==!1&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(r=>r._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?S:I}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=D,this._hasOwnPendingAsyncValidator=!0;let r=we(this.asyncValidator(this));this._asyncValidationSubscription=r.subscribe(t=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(t,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,r={}){this.errors=e,this._updateControlsErrors(r.emitEvent!==!1)}get(e){let r=e;return r==null||(Array.isArray(r)||(r=r.split(".")),r.length===0)?null:r.reduce((t,n)=>t&&t._find(n),this)}getError(e,r){let t=r?this.get(r):this;return t&&t.errors?t.errors[e]:null}hasError(e,r){return!!this.getError(e,r)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new V,this.statusChanges=new V}_calculateStatus(){return this._allControlsDisabled()?S:this.errors?B:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(D)?D:this._anyControlsHaveStatus(B)?B:I}_anyControlsHaveStatus(e){return this._anyControls(r=>r.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){X(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){let r=this._parent&&this._parent.dirty;return!e&&!!r&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=st(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=ot(this._rawAsyncValidators)}},W=class extends ${constructor(e,r,t){super(Ge(r),je(t,r)),this.controls=e,this._initObservables(),this._setUpdateStrategy(r),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,r){return this.controls[e]?this.controls[e]:(this.controls[e]=r,r.setParent(this),r._registerOnCollectionChange(this._onCollectionChange),r)}addControl(e,r,t={}){this.registerControl(e,r),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}removeControl(e,r={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}setControl(e,r,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],r&&this.registerControl(e,r),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,r={}){lt(this,!0,e),Object.keys(e).forEach(t=>{at(this,!0,t),this.controls[t].setValue(e[t],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r)}patchValue(e,r={}){e!=null&&(Object.keys(e).forEach(t=>{let n=this.controls[t];n&&n.patchValue(e[t],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r))}reset(e={},r={}){this._forEachChild((t,n)=>{t.reset(e?e[n]:null,{onlySelf:!0,emitEvent:r.emitEvent})}),this._updatePristine(r),this._updateTouched(r),this.updateValueAndValidity(r)}getRawValue(){return this._reduceChildren({},(e,r,t)=>(e[t]=r.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(r,t)=>t._syncPendingControls()?!0:r);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(r=>{let t=this.controls[r];t&&e(t,r)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(let[r,t]of Object.entries(this.controls))if(this.contains(r)&&e(t))return!0;return!1}_reduceValue(){let e={};return this._reduceChildren(e,(r,t,n)=>((t.enabled||this.disabled)&&(r[n]=t.value),r))}_reduceChildren(e,r){let t=e;return this._forEachChild((n,s)=>{t=r(t,n,s)}),t}_allControlsDisabled(){for(let e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(e){return this.controls.hasOwnProperty(e)?this.controls[e]:null}};var x=new _("CallSetDisabledState",{providedIn:"root",factory:()=>Y}),Y="always";function ut(i,e){return[...e.path,i]}function q(i,e,r=Y){se(i,e),e.valueAccessor.writeValue(i.value),(i.disabled||r==="always")&&e.valueAccessor.setDisabledState?.(i.disabled),ct(i,e),ft(i,e),ht(i,e),dt(i,e)}function me(i,e,r=!0){let t=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(t),e.valueAccessor.registerOnTouched(t)),Z(i,e),i&&(e._invokeOnDestroyCallbacks(),i._registerOnCollectionChange(()=>{}))}function z(i,e){i.forEach(r=>{r.registerOnValidatorChange&&r.registerOnValidatorChange(e)})}function dt(i,e){if(e.valueAccessor.setDisabledState){let r=t=>{e.valueAccessor.setDisabledState(t)};i.registerOnDisabledChange(r),e._registerOnDestroy(()=>{i._unregisterOnDisabledChange(r)})}}function se(i,e){let r=xe(i);e.validator!==null?i.setValidators(fe(r,e.validator)):typeof r=="function"&&i.setValidators([r]);let t=ke(i);e.asyncValidator!==null?i.setAsyncValidators(fe(t,e.asyncValidator)):typeof t=="function"&&i.setAsyncValidators([t]);let n=()=>i.updateValueAndValidity();z(e._rawValidators,n),z(e._rawAsyncValidators,n)}function Z(i,e){let r=!1;if(i!==null){if(e.validator!==null){let n=xe(i);if(Array.isArray(n)&&n.length>0){let s=n.filter(o=>o!==e.validator);s.length!==n.length&&(r=!0,i.setValidators(s))}}if(e.asyncValidator!==null){let n=ke(i);if(Array.isArray(n)&&n.length>0){let s=n.filter(o=>o!==e.asyncValidator);s.length!==n.length&&(r=!0,i.setAsyncValidators(s))}}}let t=()=>{};return z(e._rawValidators,t),z(e._rawAsyncValidators,t),r}function ct(i,e){e.valueAccessor.registerOnChange(r=>{i._pendingValue=r,i._pendingChange=!0,i._pendingDirty=!0,i.updateOn==="change"&&Te(i,e)})}function ht(i,e){e.valueAccessor.registerOnTouched(()=>{i._pendingTouched=!0,i.updateOn==="blur"&&i._pendingChange&&Te(i,e),i.updateOn!=="submit"&&i.markAsTouched()})}function Te(i,e){i._pendingDirty&&i.markAsDirty(),i.setValue(i._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1}function ft(i,e){let r=(t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)};i.registerOnChange(r),e._registerOnDestroy(()=>{i._unregisterOnChange(r)})}function Be(i,e){i==null,se(i,e)}function pt(i,e){return Z(i,e)}function gt(i,e){if(!i.hasOwnProperty("model"))return!1;let r=i.model;return r.isFirstChange()?!0:!Object.is(e,r.currentValue)}function mt(i){return Object.getPrototypeOf(i.constructor)===P}function Ue(i,e){i._syncPendingControls(),e.forEach(r=>{let t=r.control;t.updateOn==="submit"&&t._pendingChange&&(r.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)})}function yt(i,e){if(!e)return null;Array.isArray(e);let r,t,n;return e.forEach(s=>{s.constructor===De?r=s:mt(s)?t=s:n=s}),n||t||r||null}function vt(i,e){let r=i.indexOf(e);r>-1&&i.splice(r,1)}var _t={provide:v,useExisting:c(()=>Ct)},O=(()=>Promise.resolve())(),Ct=(()=>{let e=class e extends v{constructor(t,n,s){super(),this.callSetDisabledState=s,this.submitted=!1,this._directives=new Set,this.ngSubmit=new V,this.form=new W({},ne(t),re(n))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){O.then(()=>{let n=this._findContainer(t.path);t.control=n.registerControl(t.name,t.control),q(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){O.then(()=>{let n=this._findContainer(t.path);n&&n.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){O.then(()=>{let n=this._findContainer(t.path),s=new W({});Be(s,t),n.registerControl(t.name,s),s.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){O.then(()=>{let n=this._findContainer(t.path);n&&n.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,n){O.then(()=>{this.form.get(t.path).setValue(n)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,Ue(this.form,this._directives),this.ngSubmit.emit(t),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submitted=!1}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}};e.\u0275fac=function(n){return new(n||e)(a(A,10),a(ie,10),a(x,8))},e.\u0275dir=u({type:e,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(n,s){n&1&&m("submit",function(l){return s.onSubmit(l)})("reset",function(){return s.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[h([_t]),d]});let i=e;return i})();function ye(i,e){let r=i.indexOf(e);r>-1&&i.splice(r,1)}function ve(i){return typeof i=="object"&&i!==null&&Object.keys(i).length===2&&"value"in i&&"disabled"in i}var Re=class extends ${constructor(e=null,r,t){super(Ge(r),je(t,r)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(e),this._setUpdateStrategy(r),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),X(r)&&(r.nonNullable||r.initialValueIsDefault)&&(ve(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,r={}){this.value=this._pendingValue=e,this._onChange.length&&r.emitModelToViewChange!==!1&&this._onChange.forEach(t=>t(this.value,r.emitViewToModelChange!==!1)),this.updateValueAndValidity(r)}patchValue(e,r={}){this.setValue(e,r)}reset(e=this.defaultValue,r={}){this._applyFormState(e),this.markAsPristine(r),this.markAsUntouched(r),this.setValue(this.value,r),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){ye(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){ye(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){ve(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};var Vt=i=>i instanceof Re;var Dt={provide:N,useExisting:c(()=>bt)},_e=(()=>Promise.resolve())(),bt=(()=>{let e=class e extends N{constructor(t,n,s,o,l,f){super(),this._changeDetectorRef=l,this.callSetDisabledState=f,this.control=new Re,this._registered=!1,this.name="",this.update=new V,this._parent=t,this._setValidators(n),this._setAsyncValidators(s),this.valueAccessor=yt(this,o)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){let n=t.name.previousValue;this.formDirective.removeControl({name:n,path:this._getPath(n)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),gt(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){q(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(t){_e.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){let n=t.isDisabled.currentValue,s=n!==0&&T(n);_e.then(()=>{s&&!this.control.disabled?this.control.disable():!s&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?ut(t,this._parent):[t]}};e.\u0275fac=function(n){return new(n||e)(a(v,9),a(A,10),a(ie,10),a(b,10),a(de,8),a(x,8))},e.\u0275dir=u({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[h([Dt]),d,j]});let i=e;return i})(),di=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=u({type:e,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]});let i=e;return i})(),At={provide:b,useExisting:c(()=>Mt),multi:!0},Mt=(()=>{let e=class e extends P{writeValue(t){let n=t??"";this.setProperty("value",n)}registerOnChange(t){this.onChange=n=>{t(n==""?null:parseFloat(n))}}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(n,s){n&1&&m("input",function(l){return s.onChange(l.target.value)})("blur",function(){return s.onTouched()})},features:[h([At]),d]});let i=e;return i})();var Et=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=E({type:e}),e.\u0275inj=M({});let i=e;return i})();var Ft=new _("NgModelWithFormControlWarning");var wt={provide:v,useExisting:c(()=>It)},It=(()=>{let e=class e extends v{constructor(t,n,s){super(),this.callSetDisabledState=s,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new V,this._setValidators(t),this._setAsyncValidators(n)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(Z(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){let n=this.form.get(t.path);return q(n,t,this.callSetDisabledState),n.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),n}getControl(t){return this.form.get(t.path)}removeControl(t){me(t.control||null,t,!1),vt(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,n){this.form.get(t.path).setValue(n)}onSubmit(t){return this.submitted=!0,Ue(this.form,this.directives),this.ngSubmit.emit(t),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{let n=t.control,s=this.form.get(t.path);n!==s&&(me(n||null,t),Vt(s)&&(q(s,t,this.callSetDisabledState),t.control=s))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){let n=this.form.get(t.path);Be(n,t),n.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){let n=this.form.get(t.path);n&&pt(n,t)&&n.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){se(this.form,this),this._oldForm&&Z(this._oldForm,this)}_checkFormPresent(){this.form}};e.\u0275fac=function(n){return new(n||e)(a(A,10),a(ie,10),a(x,8))},e.\u0275dir=u({type:e,selectors:[["","formGroup",""]],hostBindings:function(n,s){n&1&&m("submit",function(l){return s.onSubmit(l)})("reset",function(){return s.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[h([wt]),d,j]});let i=e;return i})();var St={provide:b,useExisting:c(()=>Le),multi:!0};function He(i,e){return i==null?`${e}`:(e&&typeof e=="object"&&(e="Object"),`${i}: ${e}`.slice(0,50))}function Ot(i){return i.split(":")[0]}var Le=(()=>{let e=class e extends P{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;let n=this._getOptionId(t),s=He(n,t);this.setProperty("value",s)}registerOnChange(t){this.onChange=n=>{this.value=this._getOptionValue(n),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(let n of this._optionMap.keys())if(this._compareWith(this._optionMap.get(n),t))return n;return null}_getOptionValue(t){let n=Ot(t);return this._optionMap.has(n)?this._optionMap.get(n):t}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(n,s){n&1&&m("change",function(l){return s.onChange(l.target.value)})("blur",function(){return s.onTouched()})},inputs:{compareWith:"compareWith"},features:[h([St]),d]});let i=e;return i})(),ci=(()=>{let e=class e{constructor(t,n,s){this._element=t,this._renderer=n,this._select=s,this._select&&(this.id=this._select._registerOption())}set ngValue(t){this._select!=null&&(this._select._optionMap.set(this.id,t),this._setElementValue(He(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}};e.\u0275fac=function(n){return new(n||e)(a(F),a(w),a(Le,9))},e.\u0275dir=u({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}});let i=e;return i})(),Nt={provide:b,useExisting:c(()=>$e),multi:!0};function Ce(i,e){return i==null?`${e}`:(typeof e=="string"&&(e=`'${e}'`),e&&typeof e=="object"&&(e="Object"),`${i}: ${e}`.slice(0,50))}function Pt(i){return i.split(":")[0]}var $e=(()=>{let e=class e extends P{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;let n;if(Array.isArray(t)){let s=t.map(o=>this._getOptionId(o));n=(o,l)=>{o._setSelected(s.indexOf(l.toString())>-1)}}else n=(s,o)=>{s._setSelected(!1)};this._optionMap.forEach(n)}registerOnChange(t){this.onChange=n=>{let s=[],o=n.selectedOptions;if(o!==void 0){let l=o;for(let f=0;f<l.length;f++){let k=l[f],K=this._getOptionValue(k.value);s.push(K)}}else{let l=n.options;for(let f=0;f<l.length;f++){let k=l[f];if(k.selected){let K=this._getOptionValue(k.value);s.push(K)}}}this.value=s,t(s)}}_registerOption(t){let n=(this._idCounter++).toString();return this._optionMap.set(n,t),n}_getOptionId(t){for(let n of this._optionMap.keys())if(this._compareWith(this._optionMap.get(n)._value,t))return n;return null}_getOptionValue(t){let n=Pt(t);return this._optionMap.has(n)?this._optionMap.get(n)._value:t}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(n,s){n&1&&m("change",function(l){return s.onChange(l.target)})("blur",function(){return s.onTouched()})},inputs:{compareWith:"compareWith"},features:[h([Nt]),d]});let i=e;return i})(),hi=(()=>{let e=class e{constructor(t,n,s){this._element=t,this._renderer=n,this._select=s,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){this._select!=null&&(this._value=t,this._setElementValue(Ce(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(Ce(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}};e.\u0275fac=function(n){return new(n||e)(a(F),a(w),a($e,9))},e.\u0275dir=u({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}});let i=e;return i})();var oe=(()=>{let e=class e{constructor(){this._validator=U}ngOnChanges(t){if(this.inputName in t){let n=this.normalizeInput(t[this.inputName].currentValue);this._enabled=this.enabled(n),this._validator=this._enabled?this.createValidator(n):U,this._onChange&&this._onChange()}}validate(t){return this._validator(t)}registerOnValidatorChange(t){this._onChange=t}enabled(t){return t!=null}};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=u({type:e,features:[j]});let i=e;return i})();var xt={provide:A,useExisting:c(()=>kt),multi:!0};var kt=(()=>{let e=class e extends oe{constructor(){super(...arguments),this.inputName="required",this.normalizeInput=T,this.createValidator=t=>Ae}enabled(t){return t}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(n,s){n&2&&J("required",s._enabled?"":null)},inputs:{required:"required"},features:[h([xt]),d]});let i=e;return i})();var Gt={provide:A,useExisting:c(()=>jt),multi:!0},jt=(()=>{let e=class e extends oe{constructor(){super(...arguments),this.inputName="email",this.normalizeInput=T,this.createValidator=t=>Me}enabled(t){return t}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["","email","","formControlName",""],["","email","","formControl",""],["","email","","ngModel",""]],inputs:{email:"email"},features:[h([Gt]),d]});let i=e;return i})();var Tt={provide:A,useExisting:c(()=>Bt),multi:!0},Bt=(()=>{let e=class e extends oe{constructor(){super(...arguments),this.inputName="pattern",this.normalizeInput=t=>t,this.createValidator=t=>Ee(t)}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["","pattern","","formControlName",""],["","pattern","","formControl",""],["","pattern","","ngModel",""]],hostVars:1,hostBindings:function(n,s){n&2&&J("pattern",s._enabled?s.pattern:null)},inputs:{pattern:"pattern"},features:[h([Tt]),d]});let i=e;return i})();var We=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=E({type:e}),e.\u0275inj=M({imports:[Et]});let i=e;return i})();var fi=(()=>{let e=class e{static withConfig(t){return{ngModule:e,providers:[{provide:x,useValue:t.callSetDisabledState??Y}]}}};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=E({type:e}),e.\u0275inj=M({imports:[We]});let i=e;return i})(),pi=(()=>{let e=class e{static withConfig(t){return{ngModule:e,providers:[{provide:Ft,useValue:t.warnOnNgModelWithFormControl??"always"},{provide:x,useValue:t.callSetDisabledState??Y}]}}};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=E({type:e}),e.\u0275inj=M({imports:[We]});let i=e;return i})();export{b as a,ze as b,De as c,A as d,he as e,v as f,N as g,ai as h,li as i,Ct as j,bt as k,di as l,Mt as m,It as n,Le as o,ci as p,hi as q,kt as r,jt as s,Bt as t,fi as u,pi as v};
|
|
1
|
+
import{Ba as F,Da as w,Ga as a,Ia as de,Ja as V,La as d,Na as J,Qa as Q,Sb as T,Ub as ee,Z as c,_ as G,aa as M,ba as _,fa as E,ga as u,gb as ce,hb as m,ia as j,m as ae,na as p,q as le,tb as h,w as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZHLG7GCJ.js";import{a as g,b as C}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-72VLH7XK.js";var Ve=(()=>{let e=class e{constructor(t,n){this._renderer=t,this._elementRef=n,this.onChange=s=>{},this.onTouched=()=>{}}setProperty(t,n){this._renderer.setProperty(this._elementRef.nativeElement,t,n)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}};e.\u0275fac=function(n){return new(n||e)(a(w),a(F))},e.\u0275dir=u({type:e});let i=e;return i})(),P=(()=>{let e=class e extends Ve{};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,features:[d]});let i=e;return i})(),b=new _("NgValueAccessor"),qe={provide:b,useExisting:c(()=>ze),multi:!0},ze=(()=>{let e=class e extends P{writeValue(t){this.setProperty("checked",t)}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(n,s){n&1&&m("change",function(l){return s.onChange(l.target.checked)})("blur",function(){return s.onTouched()})},features:[h([qe]),d]});let i=e;return i})(),Ze={provide:b,useExisting:c(()=>De),multi:!0};function Xe(){let i=ee()?ee().getUserAgent():"";return/android (\d+)/.test(i.toLowerCase())}var Ye=new _("CompositionEventMode"),De=(()=>{let e=class e extends Ve{constructor(t,n,s){super(t,n),this._compositionMode=s,this._composing=!1,this._compositionMode==null&&(this._compositionMode=!Xe())}writeValue(t){let n=t??"";this.setProperty("value",n)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}};e.\u0275fac=function(n){return new(n||e)(a(w),a(F),a(Ye,8))},e.\u0275dir=u({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(n,s){n&1&&m("input",function(l){return s._handleInput(l.target.value)})("blur",function(){return s.onTouched()})("compositionstart",function(){return s._compositionStart()})("compositionend",function(l){return s._compositionEnd(l.target.value)})},features:[h([Ze]),d]});let i=e;return i})();function y(i){return i==null||(typeof i=="string"||Array.isArray(i))&&i.length===0}function be(i){return i!=null&&typeof i.length=="number"}var A=new _("NgValidators"),ie=new _("NgAsyncValidators"),Ke=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,he=class{static min(e){return Je(e)}static max(e){return Qe(e)}static required(e){return Ae(e)}static requiredTrue(e){return et(e)}static email(e){return Me(e)}static minLength(e){return tt(e)}static maxLength(e){return it(e)}static pattern(e){return Ee(e)}static nullValidator(e){return U(e)}static compose(e){return Ne(e)}static composeAsync(e){return Pe(e)}};function Je(i){return e=>{if(y(e.value)||y(i))return null;let r=parseFloat(e.value);return!isNaN(r)&&r<i?{min:{min:i,actual:e.value}}:null}}function Qe(i){return e=>{if(y(e.value)||y(i))return null;let r=parseFloat(e.value);return!isNaN(r)&&r>i?{max:{max:i,actual:e.value}}:null}}function Ae(i){return y(i.value)?{required:!0}:null}function et(i){return i.value===!0?null:{required:!0}}function Me(i){return y(i.value)||Ke.test(i.value)?null:{email:!0}}function tt(i){return e=>y(e.value)||!be(e.value)?null:e.value.length<i?{minlength:{requiredLength:i,actualLength:e.value.length}}:null}function it(i){return e=>be(e.value)&&e.value.length>i?{maxlength:{requiredLength:i,actualLength:e.value.length}}:null}function Ee(i){if(!i)return U;let e,r;return typeof i=="string"?(r="",i.charAt(0)!=="^"&&(r+="^"),r+=i,i.charAt(i.length-1)!=="$"&&(r+="$"),e=new RegExp(r)):(r=i.toString(),e=i),t=>{if(y(t.value))return null;let n=t.value;return e.test(n)?null:{pattern:{requiredPattern:r,actualValue:n}}}}function U(i){return null}function Fe(i){return i!=null}function we(i){return ce(i)?ae(i):i}function Ie(i){let e={};return i.forEach(r=>{e=r!=null?g(g({},e),r):e}),Object.keys(e).length===0?null:e}function Se(i,e){return e.map(r=>r(i))}function nt(i){return!i.validate}function Oe(i){return i.map(e=>nt(e)?e:r=>e.validate(r))}function Ne(i){if(!i)return null;let e=i.filter(Fe);return e.length==0?null:function(r){return Ie(Se(r,e))}}function ne(i){return i!=null?Ne(Oe(i)):null}function Pe(i){if(!i)return null;let e=i.filter(Fe);return e.length==0?null:function(r){let t=Se(r,e).map(we);return ue(t).pipe(le(Ie))}}function re(i){return i!=null?Pe(Oe(i)):null}function fe(i,e){return i===null?[e]:Array.isArray(i)?[...i,e]:[i,e]}function xe(i){return i._rawValidators}function ke(i){return i._rawAsyncValidators}function te(i){return i?Array.isArray(i)?i:[i]:[]}function R(i,e){return Array.isArray(i)?i.includes(e):i===e}function pe(i,e){let r=te(e);return te(i).forEach(n=>{R(r,n)||r.push(n)}),r}function ge(i,e){return te(e).filter(r=>!R(i,r))}var H=class{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=ne(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=re(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,r){return this.control?this.control.hasError(e,r):!1}getError(e,r){return this.control?this.control.getError(e,r):null}},v=class extends H{get formDirective(){return null}get path(){return null}},N=class extends H{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}},L=class{constructor(e){this._cd=e}get isTouched(){return!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return!!this._cd?.submitted}},rt={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},oi=C(g({},rt),{"[class.ng-submitted]":"isSubmitted"}),ai=(()=>{let e=class e extends L{constructor(t){super(t)}};e.\u0275fac=function(n){return new(n||e)(a(N,2))},e.\u0275dir=u({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(n,s){n&2&&Q("ng-untouched",s.isUntouched)("ng-touched",s.isTouched)("ng-pristine",s.isPristine)("ng-dirty",s.isDirty)("ng-valid",s.isValid)("ng-invalid",s.isInvalid)("ng-pending",s.isPending)},features:[d]});let i=e;return i})(),li=(()=>{let e=class e extends L{constructor(t){super(t)}};e.\u0275fac=function(n){return new(n||e)(a(v,10))},e.\u0275dir=u({type:e,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(n,s){n&2&&Q("ng-untouched",s.isUntouched)("ng-touched",s.isTouched)("ng-pristine",s.isPristine)("ng-dirty",s.isDirty)("ng-valid",s.isValid)("ng-invalid",s.isInvalid)("ng-pending",s.isPending)("ng-submitted",s.isSubmitted)},features:[d]});let i=e;return i})();var I="VALID",B="INVALID",D="PENDING",S="DISABLED";function Ge(i){return(X(i)?i.validators:i)||null}function st(i){return Array.isArray(i)?ne(i):i||null}function je(i,e){return(X(e)?e.asyncValidators:i)||null}function ot(i){return Array.isArray(i)?re(i):i||null}function X(i){return i!=null&&!Array.isArray(i)&&typeof i=="object"}function at(i,e,r){let t=i.controls;if(!(e?Object.keys(t):t).length)throw new G(1e3,"");if(!t[r])throw new G(1001,"")}function lt(i,e,r){i._forEachChild((t,n)=>{if(r[n]===void 0)throw new G(1002,"")})}var $=class{constructor(e,r){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._assignValidators(e),this._assignAsyncValidators(r)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===I}get invalid(){return this.status===B}get pending(){return this.status==D}get disabled(){return this.status===S}get enabled(){return this.status!==S}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(pe(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(pe(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(ge(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(ge(e,this._rawAsyncValidators))}hasValidator(e){return R(this._rawValidators,e)}hasAsyncValidator(e){return R(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(r=>{r.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=D,e.emitEvent!==!1&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){let r=this._parentMarkedDirty(e.onlySelf);this.status=S,this.errors=null,this._forEachChild(t=>{t.disable(C(g({},e),{onlySelf:!0}))}),this._updateValue(),e.emitEvent!==!1&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(C(g({},e),{skipPristineCheck:r})),this._onDisabledChange.forEach(t=>t(!0))}enable(e={}){let r=this._parentMarkedDirty(e.onlySelf);this.status=I,this._forEachChild(t=>{t.enable(C(g({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(C(g({},e),{skipPristineCheck:r})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===I||this.status===D)&&this._runAsyncValidator(e.emitEvent)),e.emitEvent!==!1&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(r=>r._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?S:I}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=D,this._hasOwnPendingAsyncValidator=!0;let r=we(this.asyncValidator(this));this._asyncValidationSubscription=r.subscribe(t=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(t,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,r={}){this.errors=e,this._updateControlsErrors(r.emitEvent!==!1)}get(e){let r=e;return r==null||(Array.isArray(r)||(r=r.split(".")),r.length===0)?null:r.reduce((t,n)=>t&&t._find(n),this)}getError(e,r){let t=r?this.get(r):this;return t&&t.errors?t.errors[e]:null}hasError(e,r){return!!this.getError(e,r)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new V,this.statusChanges=new V}_calculateStatus(){return this._allControlsDisabled()?S:this.errors?B:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(D)?D:this._anyControlsHaveStatus(B)?B:I}_anyControlsHaveStatus(e){return this._anyControls(r=>r.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){X(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){let r=this._parent&&this._parent.dirty;return!e&&!!r&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=st(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=ot(this._rawAsyncValidators)}},W=class extends ${constructor(e,r,t){super(Ge(r),je(t,r)),this.controls=e,this._initObservables(),this._setUpdateStrategy(r),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,r){return this.controls[e]?this.controls[e]:(this.controls[e]=r,r.setParent(this),r._registerOnCollectionChange(this._onCollectionChange),r)}addControl(e,r,t={}){this.registerControl(e,r),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}removeControl(e,r={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}setControl(e,r,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],r&&this.registerControl(e,r),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,r={}){lt(this,!0,e),Object.keys(e).forEach(t=>{at(this,!0,t),this.controls[t].setValue(e[t],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r)}patchValue(e,r={}){e!=null&&(Object.keys(e).forEach(t=>{let n=this.controls[t];n&&n.patchValue(e[t],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r))}reset(e={},r={}){this._forEachChild((t,n)=>{t.reset(e?e[n]:null,{onlySelf:!0,emitEvent:r.emitEvent})}),this._updatePristine(r),this._updateTouched(r),this.updateValueAndValidity(r)}getRawValue(){return this._reduceChildren({},(e,r,t)=>(e[t]=r.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(r,t)=>t._syncPendingControls()?!0:r);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(r=>{let t=this.controls[r];t&&e(t,r)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(let[r,t]of Object.entries(this.controls))if(this.contains(r)&&e(t))return!0;return!1}_reduceValue(){let e={};return this._reduceChildren(e,(r,t,n)=>((t.enabled||this.disabled)&&(r[n]=t.value),r))}_reduceChildren(e,r){let t=e;return this._forEachChild((n,s)=>{t=r(t,n,s)}),t}_allControlsDisabled(){for(let e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(e){return this.controls.hasOwnProperty(e)?this.controls[e]:null}};var x=new _("CallSetDisabledState",{providedIn:"root",factory:()=>Y}),Y="always";function ut(i,e){return[...e.path,i]}function q(i,e,r=Y){se(i,e),e.valueAccessor.writeValue(i.value),(i.disabled||r==="always")&&e.valueAccessor.setDisabledState?.(i.disabled),ct(i,e),ft(i,e),ht(i,e),dt(i,e)}function me(i,e,r=!0){let t=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(t),e.valueAccessor.registerOnTouched(t)),Z(i,e),i&&(e._invokeOnDestroyCallbacks(),i._registerOnCollectionChange(()=>{}))}function z(i,e){i.forEach(r=>{r.registerOnValidatorChange&&r.registerOnValidatorChange(e)})}function dt(i,e){if(e.valueAccessor.setDisabledState){let r=t=>{e.valueAccessor.setDisabledState(t)};i.registerOnDisabledChange(r),e._registerOnDestroy(()=>{i._unregisterOnDisabledChange(r)})}}function se(i,e){let r=xe(i);e.validator!==null?i.setValidators(fe(r,e.validator)):typeof r=="function"&&i.setValidators([r]);let t=ke(i);e.asyncValidator!==null?i.setAsyncValidators(fe(t,e.asyncValidator)):typeof t=="function"&&i.setAsyncValidators([t]);let n=()=>i.updateValueAndValidity();z(e._rawValidators,n),z(e._rawAsyncValidators,n)}function Z(i,e){let r=!1;if(i!==null){if(e.validator!==null){let n=xe(i);if(Array.isArray(n)&&n.length>0){let s=n.filter(o=>o!==e.validator);s.length!==n.length&&(r=!0,i.setValidators(s))}}if(e.asyncValidator!==null){let n=ke(i);if(Array.isArray(n)&&n.length>0){let s=n.filter(o=>o!==e.asyncValidator);s.length!==n.length&&(r=!0,i.setAsyncValidators(s))}}}let t=()=>{};return z(e._rawValidators,t),z(e._rawAsyncValidators,t),r}function ct(i,e){e.valueAccessor.registerOnChange(r=>{i._pendingValue=r,i._pendingChange=!0,i._pendingDirty=!0,i.updateOn==="change"&&Te(i,e)})}function ht(i,e){e.valueAccessor.registerOnTouched(()=>{i._pendingTouched=!0,i.updateOn==="blur"&&i._pendingChange&&Te(i,e),i.updateOn!=="submit"&&i.markAsTouched()})}function Te(i,e){i._pendingDirty&&i.markAsDirty(),i.setValue(i._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1}function ft(i,e){let r=(t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)};i.registerOnChange(r),e._registerOnDestroy(()=>{i._unregisterOnChange(r)})}function Be(i,e){i==null,se(i,e)}function pt(i,e){return Z(i,e)}function gt(i,e){if(!i.hasOwnProperty("model"))return!1;let r=i.model;return r.isFirstChange()?!0:!Object.is(e,r.currentValue)}function mt(i){return Object.getPrototypeOf(i.constructor)===P}function Ue(i,e){i._syncPendingControls(),e.forEach(r=>{let t=r.control;t.updateOn==="submit"&&t._pendingChange&&(r.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)})}function yt(i,e){if(!e)return null;Array.isArray(e);let r,t,n;return e.forEach(s=>{s.constructor===De?r=s:mt(s)?t=s:n=s}),n||t||r||null}function vt(i,e){let r=i.indexOf(e);r>-1&&i.splice(r,1)}var _t={provide:v,useExisting:c(()=>Ct)},O=(()=>Promise.resolve())(),Ct=(()=>{let e=class e extends v{constructor(t,n,s){super(),this.callSetDisabledState=s,this.submitted=!1,this._directives=new Set,this.ngSubmit=new V,this.form=new W({},ne(t),re(n))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){O.then(()=>{let n=this._findContainer(t.path);t.control=n.registerControl(t.name,t.control),q(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){O.then(()=>{let n=this._findContainer(t.path);n&&n.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){O.then(()=>{let n=this._findContainer(t.path),s=new W({});Be(s,t),n.registerControl(t.name,s),s.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){O.then(()=>{let n=this._findContainer(t.path);n&&n.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,n){O.then(()=>{this.form.get(t.path).setValue(n)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,Ue(this.form,this._directives),this.ngSubmit.emit(t),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submitted=!1}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}};e.\u0275fac=function(n){return new(n||e)(a(A,10),a(ie,10),a(x,8))},e.\u0275dir=u({type:e,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(n,s){n&1&&m("submit",function(l){return s.onSubmit(l)})("reset",function(){return s.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[h([_t]),d]});let i=e;return i})();function ye(i,e){let r=i.indexOf(e);r>-1&&i.splice(r,1)}function ve(i){return typeof i=="object"&&i!==null&&Object.keys(i).length===2&&"value"in i&&"disabled"in i}var Re=class extends ${constructor(e=null,r,t){super(Ge(r),je(t,r)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(e),this._setUpdateStrategy(r),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),X(r)&&(r.nonNullable||r.initialValueIsDefault)&&(ve(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,r={}){this.value=this._pendingValue=e,this._onChange.length&&r.emitModelToViewChange!==!1&&this._onChange.forEach(t=>t(this.value,r.emitViewToModelChange!==!1)),this.updateValueAndValidity(r)}patchValue(e,r={}){this.setValue(e,r)}reset(e=this.defaultValue,r={}){this._applyFormState(e),this.markAsPristine(r),this.markAsUntouched(r),this.setValue(this.value,r),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){ye(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){ye(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){ve(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};var Vt=i=>i instanceof Re;var Dt={provide:N,useExisting:c(()=>bt)},_e=(()=>Promise.resolve())(),bt=(()=>{let e=class e extends N{constructor(t,n,s,o,l,f){super(),this._changeDetectorRef=l,this.callSetDisabledState=f,this.control=new Re,this._registered=!1,this.name="",this.update=new V,this._parent=t,this._setValidators(n),this._setAsyncValidators(s),this.valueAccessor=yt(this,o)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){let n=t.name.previousValue;this.formDirective.removeControl({name:n,path:this._getPath(n)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),gt(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){q(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(t){_e.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){let n=t.isDisabled.currentValue,s=n!==0&&T(n);_e.then(()=>{s&&!this.control.disabled?this.control.disable():!s&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?ut(t,this._parent):[t]}};e.\u0275fac=function(n){return new(n||e)(a(v,9),a(A,10),a(ie,10),a(b,10),a(de,8),a(x,8))},e.\u0275dir=u({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[h([Dt]),d,j]});let i=e;return i})(),di=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=u({type:e,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]});let i=e;return i})(),At={provide:b,useExisting:c(()=>Mt),multi:!0},Mt=(()=>{let e=class e extends P{writeValue(t){let n=t??"";this.setProperty("value",n)}registerOnChange(t){this.onChange=n=>{t(n==""?null:parseFloat(n))}}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(n,s){n&1&&m("input",function(l){return s.onChange(l.target.value)})("blur",function(){return s.onTouched()})},features:[h([At]),d]});let i=e;return i})();var Et=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=E({type:e}),e.\u0275inj=M({});let i=e;return i})();var Ft=new _("NgModelWithFormControlWarning");var wt={provide:v,useExisting:c(()=>It)},It=(()=>{let e=class e extends v{constructor(t,n,s){super(),this.callSetDisabledState=s,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new V,this._setValidators(t),this._setAsyncValidators(n)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(Z(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){let n=this.form.get(t.path);return q(n,t,this.callSetDisabledState),n.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),n}getControl(t){return this.form.get(t.path)}removeControl(t){me(t.control||null,t,!1),vt(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,n){this.form.get(t.path).setValue(n)}onSubmit(t){return this.submitted=!0,Ue(this.form,this.directives),this.ngSubmit.emit(t),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{let n=t.control,s=this.form.get(t.path);n!==s&&(me(n||null,t),Vt(s)&&(q(s,t,this.callSetDisabledState),t.control=s))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){let n=this.form.get(t.path);Be(n,t),n.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){let n=this.form.get(t.path);n&&pt(n,t)&&n.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){se(this.form,this),this._oldForm&&Z(this._oldForm,this)}_checkFormPresent(){this.form}};e.\u0275fac=function(n){return new(n||e)(a(A,10),a(ie,10),a(x,8))},e.\u0275dir=u({type:e,selectors:[["","formGroup",""]],hostBindings:function(n,s){n&1&&m("submit",function(l){return s.onSubmit(l)})("reset",function(){return s.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[h([wt]),d,j]});let i=e;return i})();var St={provide:b,useExisting:c(()=>Le),multi:!0};function He(i,e){return i==null?`${e}`:(e&&typeof e=="object"&&(e="Object"),`${i}: ${e}`.slice(0,50))}function Ot(i){return i.split(":")[0]}var Le=(()=>{let e=class e extends P{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;let n=this._getOptionId(t),s=He(n,t);this.setProperty("value",s)}registerOnChange(t){this.onChange=n=>{this.value=this._getOptionValue(n),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(let n of this._optionMap.keys())if(this._compareWith(this._optionMap.get(n),t))return n;return null}_getOptionValue(t){let n=Ot(t);return this._optionMap.has(n)?this._optionMap.get(n):t}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(n,s){n&1&&m("change",function(l){return s.onChange(l.target.value)})("blur",function(){return s.onTouched()})},inputs:{compareWith:"compareWith"},features:[h([St]),d]});let i=e;return i})(),ci=(()=>{let e=class e{constructor(t,n,s){this._element=t,this._renderer=n,this._select=s,this._select&&(this.id=this._select._registerOption())}set ngValue(t){this._select!=null&&(this._select._optionMap.set(this.id,t),this._setElementValue(He(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}};e.\u0275fac=function(n){return new(n||e)(a(F),a(w),a(Le,9))},e.\u0275dir=u({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}});let i=e;return i})(),Nt={provide:b,useExisting:c(()=>$e),multi:!0};function Ce(i,e){return i==null?`${e}`:(typeof e=="string"&&(e=`'${e}'`),e&&typeof e=="object"&&(e="Object"),`${i}: ${e}`.slice(0,50))}function Pt(i){return i.split(":")[0]}var $e=(()=>{let e=class e extends P{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;let n;if(Array.isArray(t)){let s=t.map(o=>this._getOptionId(o));n=(o,l)=>{o._setSelected(s.indexOf(l.toString())>-1)}}else n=(s,o)=>{s._setSelected(!1)};this._optionMap.forEach(n)}registerOnChange(t){this.onChange=n=>{let s=[],o=n.selectedOptions;if(o!==void 0){let l=o;for(let f=0;f<l.length;f++){let k=l[f],K=this._getOptionValue(k.value);s.push(K)}}else{let l=n.options;for(let f=0;f<l.length;f++){let k=l[f];if(k.selected){let K=this._getOptionValue(k.value);s.push(K)}}}this.value=s,t(s)}}_registerOption(t){let n=(this._idCounter++).toString();return this._optionMap.set(n,t),n}_getOptionId(t){for(let n of this._optionMap.keys())if(this._compareWith(this._optionMap.get(n)._value,t))return n;return null}_getOptionValue(t){let n=Pt(t);return this._optionMap.has(n)?this._optionMap.get(n)._value:t}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(n,s){n&1&&m("change",function(l){return s.onChange(l.target)})("blur",function(){return s.onTouched()})},inputs:{compareWith:"compareWith"},features:[h([Nt]),d]});let i=e;return i})(),hi=(()=>{let e=class e{constructor(t,n,s){this._element=t,this._renderer=n,this._select=s,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){this._select!=null&&(this._value=t,this._setElementValue(Ce(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(Ce(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}};e.\u0275fac=function(n){return new(n||e)(a(F),a(w),a($e,9))},e.\u0275dir=u({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}});let i=e;return i})();var oe=(()=>{let e=class e{constructor(){this._validator=U}ngOnChanges(t){if(this.inputName in t){let n=this.normalizeInput(t[this.inputName].currentValue);this._enabled=this.enabled(n),this._validator=this._enabled?this.createValidator(n):U,this._onChange&&this._onChange()}}validate(t){return this._validator(t)}registerOnValidatorChange(t){this._onChange=t}enabled(t){return t!=null}};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=u({type:e,features:[j]});let i=e;return i})();var xt={provide:A,useExisting:c(()=>kt),multi:!0};var kt=(()=>{let e=class e extends oe{constructor(){super(...arguments),this.inputName="required",this.normalizeInput=T,this.createValidator=t=>Ae}enabled(t){return t}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(n,s){n&2&&J("required",s._enabled?"":null)},inputs:{required:"required"},features:[h([xt]),d]});let i=e;return i})();var Gt={provide:A,useExisting:c(()=>jt),multi:!0},jt=(()=>{let e=class e extends oe{constructor(){super(...arguments),this.inputName="email",this.normalizeInput=T,this.createValidator=t=>Me}enabled(t){return t}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["","email","","formControlName",""],["","email","","formControl",""],["","email","","ngModel",""]],inputs:{email:"email"},features:[h([Gt]),d]});let i=e;return i})();var Tt={provide:A,useExisting:c(()=>Bt),multi:!0},Bt=(()=>{let e=class e extends oe{constructor(){super(...arguments),this.inputName="pattern",this.normalizeInput=t=>t,this.createValidator=t=>Ee(t)}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=p(e)))(s||e)}})(),e.\u0275dir=u({type:e,selectors:[["","pattern","","formControlName",""],["","pattern","","formControl",""],["","pattern","","ngModel",""]],hostVars:1,hostBindings:function(n,s){n&2&&J("pattern",s._enabled?s.pattern:null)},inputs:{pattern:"pattern"},features:[h([Tt]),d]});let i=e;return i})();var We=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=E({type:e}),e.\u0275inj=M({imports:[Et]});let i=e;return i})();var fi=(()=>{let e=class e{static withConfig(t){return{ngModule:e,providers:[{provide:x,useValue:t.callSetDisabledState??Y}]}}};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=E({type:e}),e.\u0275inj=M({imports:[We]});let i=e;return i})(),pi=(()=>{let e=class e{static withConfig(t){return{ngModule:e,providers:[{provide:Ft,useValue:t.warnOnNgModelWithFormControl??"always"},{provide:x,useValue:t.callSetDisabledState??Y}]}}};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=E({type:e}),e.\u0275inj=M({imports:[We]});let i=e;return i})();export{b as a,ze as b,De as c,A as d,he as e,v as f,N as g,ai as h,li as i,Ct as j,bt as k,di as l,Mt as m,It as n,Le as o,ci as p,hi as q,kt as r,jt as s,Bt as t,fi as u,pi as v};
|