marketplacepos 26.34.2 → 26.34.3
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-EVMKTCWL.js → chunk-2QVCMGWJ.js} +1 -1
- package/Marketplace/{chunk-E2MNYCXC.js → chunk-4I5ZIMLM.js} +1 -1
- package/Marketplace/{chunk-I6YMWE2I.js → chunk-57QHWMGM.js} +1 -1
- package/Marketplace/{chunk-N43DWTGJ.js → chunk-5PI45NLK.js} +1 -1
- package/Marketplace/{chunk-BB774JJL.js → chunk-6CPYFCTP.js} +1 -1
- package/Marketplace/{chunk-S4NPAYFZ.js → chunk-6GF6TGRT.js} +1 -1
- package/Marketplace/{chunk-NVCOALE3.js → chunk-6MURSHMV.js} +1 -1
- package/Marketplace/{chunk-SRKJPZRP.js → chunk-7PXXC2F6.js} +1 -1
- package/Marketplace/{chunk-KVP4SMDT.js → chunk-7USSFLDS.js} +1 -1
- package/Marketplace/{chunk-YZ3S5QD5.js → chunk-7WNEJX5C.js} +1 -1
- package/Marketplace/{chunk-36CTIOND.js → chunk-AHJS7WUL.js} +1 -1
- package/Marketplace/{chunk-FZOFDLSB.js → chunk-ALSZI27W.js} +1 -1
- package/Marketplace/{chunk-2HKCBHED.js → chunk-AV5SOF7A.js} +1 -1
- package/Marketplace/{chunk-EEYZAVW7.js → chunk-C4R4RCUC.js} +1 -1
- package/Marketplace/{chunk-PH5HOZEM.js → chunk-CUG5ZTOK.js} +1 -1
- package/Marketplace/{chunk-DJRDXH7L.js → chunk-DORFETS5.js} +1 -1
- package/Marketplace/{chunk-CSDFU2K4.js → chunk-DS6OSXCD.js} +1 -1
- package/Marketplace/{chunk-36J2U3X4.js → chunk-DUAZQEL4.js} +1 -1
- package/Marketplace/{chunk-64S6GWFY.js → chunk-E5F7SMXH.js} +2 -2
- package/Marketplace/{chunk-IAVUWAOY.js → chunk-EJYJDCGC.js} +1 -1
- package/Marketplace/{chunk-A7KQRHB5.js → chunk-EPO43IBF.js} +1 -1
- package/Marketplace/{chunk-KFMBQ3P5.js → chunk-GCFH7BCA.js} +1 -1
- package/Marketplace/{chunk-BXC5XPFC.js → chunk-GP6IR3V6.js} +1 -1
- package/Marketplace/{chunk-ME7VWK4U.js → chunk-HIEVYN2X.js} +1 -1
- package/Marketplace/{chunk-MPBKHIBO.js → chunk-HKB2CWMM.js} +1 -1
- package/Marketplace/{chunk-RRTPK7JU.js → chunk-HLCE56JK.js} +1 -1
- package/Marketplace/{chunk-DVOLD4ZD.js → chunk-HS4SNPQY.js} +1 -1
- package/Marketplace/{chunk-3WKSJQSB.js → chunk-HVOO6TRM.js} +1 -1
- package/Marketplace/{chunk-KY3SHKPY.js → chunk-I2RXZGDF.js} +1 -1
- package/Marketplace/{chunk-EHIWGKF4.js → chunk-IMW6HVQ7.js} +1 -1
- package/Marketplace/{chunk-HSQHTCMT.js → chunk-JMIZ564I.js} +1 -1
- package/Marketplace/{chunk-2F6UM24P.js → chunk-JMRPU32Z.js} +1 -1
- package/Marketplace/{chunk-HVHDETOD.js → chunk-JQXBAK4B.js} +1 -1
- package/Marketplace/{chunk-3KG62A5P.js → chunk-JW3CZ5UT.js} +1 -1
- package/Marketplace/{chunk-S5RHOZPK.js → chunk-K7F6K5MI.js} +1 -1
- package/Marketplace/{chunk-77TSJAY2.js → chunk-KF76RZHT.js} +1 -1
- package/Marketplace/{chunk-LFYAFKQS.js → chunk-KJW7YEK7.js} +1 -1
- package/Marketplace/{chunk-RWXGDZ7O.js → chunk-LES7DMKA.js} +1 -1
- package/Marketplace/{chunk-YBOG2XAH.js → chunk-MF7R2S36.js} +1 -1
- package/Marketplace/{chunk-SMUPCSVR.js → chunk-MSLVJTQF.js} +1 -1
- package/Marketplace/{chunk-GGMCBTH7.js → chunk-N3A2MJLI.js} +1 -1
- package/Marketplace/{chunk-3XPVCJVH.js → chunk-P6XNHHE7.js} +1 -1
- package/Marketplace/{chunk-HCF7AFEH.js → chunk-QDG5DTAT.js} +1 -1
- package/Marketplace/{chunk-RB4PJKZF.js → chunk-RPQ6KE7P.js} +1 -1
- package/Marketplace/{chunk-EJRTUNFI.js → chunk-STYIWS5Z.js} +1 -1
- package/Marketplace/{chunk-T6YKYTBR.js → chunk-TK5U2DIZ.js} +1 -1
- package/Marketplace/{chunk-5XO4LV4P.js → chunk-UJH6BJHJ.js} +1 -1
- package/Marketplace/{chunk-IB26VQFI.js → chunk-URIANTX3.js} +1 -1
- package/Marketplace/{chunk-MY3Y4REF.js → chunk-UTDC6NVH.js} +1 -1
- package/Marketplace/{chunk-WTT6F7NP.js → chunk-UXPROMWF.js} +1 -1
- package/Marketplace/{chunk-X5SRVZ5V.js → chunk-UYH7DSIW.js} +1 -1
- package/Marketplace/{chunk-IDESTQQG.js → chunk-WB3M7GSG.js} +1 -1
- package/Marketplace/{chunk-YXNCP6JR.js → chunk-XII5NWIM.js} +1 -1
- package/Marketplace/{chunk-VCBRU23L.js → chunk-XNM2QAY5.js} +1 -1
- package/Marketplace/{chunk-FXQKWDS6.js → chunk-XO37YBMB.js} +1 -1
- package/Marketplace/{chunk-Q3X2BL7Z.js → chunk-XQHX4KC7.js} +1 -1
- package/Marketplace/{chunk-64S5XWUC.js → chunk-YBX5DAAH.js} +1 -1
- package/Marketplace/{chunk-GN6GDJOJ.js → chunk-YU775UKC.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-N5MK5CLJ.js → main-IK7POR7N.js} +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-7KVKRA5M.js";var o=[{path:"",loadComponent(){return import("./chunk-
|
|
1
|
+
import"./chunk-7KVKRA5M.js";var o=[{path:"",loadComponent(){return import("./chunk-XO37YBMB.js").then(t=>t.LoginComponent)},data:{title:"Dealpos x Marketplace"}},{path:"shopee",loadComponent(){return import("./chunk-VNRC3PLG.js").then(t=>t.ShopeeAuthorizedComponent)},data:{title:"Success"}},{path:"tiktok",loadComponent(){return import("./chunk-NXGGE5B5.js").then(t=>t.TiktokComponent)},data:{title:"Success"}},{path:"lazada",loadComponent(){return import("./chunk-VSW3OXAF.js").then(t=>t.LazadaComponent)},data:{title:"Success"}},{path:"shopify",loadComponent(){return import("./chunk-CHOOEMQZ.js").then(t=>t.ShopifyAuthorizedComponent)},data:{title:"Success"}}];export{o as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as x}from"./chunk-
|
|
1
|
+
import{f as x}from"./chunk-6MURSHMV.js";import{c as o}from"./chunk-NNVT5X6O.js";import{e as k,g as C}from"./chunk-2P7JU6NZ.js";import{$b as b,Eb as v,Mc as u,Oc as p,ad as I,bc as D,gc as s,hc as c,ia as h,ic as m,kb as g,mb as l,na as i,rd as f,wd as _,xc as d}from"./chunk-UL2ZUNXQ.js";var y=(()=>{class e{constructor(){this.localDataService=i(x),this.baseUrl=this.localDataService.getHostName()}getBaseUrl(r){let t="";return o.IsNotEmpty(r.ID)?t=`https://${this.baseUrl}/menu/Orders/Orders/Customer_Invoice/Info?ID=${r.ID}`:t="/menu/Order/detail",t}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var L=(e,a)=>({Number:e,Outlet:a});function N(e,a){if(e&1&&(c(0,"a",0),u(1),m()),e&2){let r,t=d();s("href",t.baseUrl(),g),l(),p(" ",(r=t.order())==null?null:r.Number," ")}}function S(e,a){if(e&1&&(c(0,"a",1),u(1),m()),e&2){let r,t,n=d();s("routerLink",n.baseUrl())("queryParams",I(3,L,(r=n.order())==null?null:r.Number,(r=n.order())==null?null:r.Outlet)),l(),p(" ",(t=n.order())==null?null:t.Number," ")}}var z=(()=>{class e{constructor(){this.order=_(),this.generateLinkService=i(y),this.baseUrl=f(()=>this.generateLinkService.getBaseUrl(this.order())),this.hasOrderID=f(()=>o.IsNotEmpty(this.order()?.ID))}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=v({type:e,selectors:[["order-link"]],inputs:{order:[1,"order"]},decls:2,vars:1,consts:[["target","_blank",3,"href"],["target","_blank",3,"routerLink","queryParams"]],template:function(t,n){t&1&&b(0,N,2,2,"a",0)(1,S,2,6,"a",1),t&2&&D(n.hasOrderID()?0:1)},dependencies:[C,k],encapsulation:2,changeDetection:0})}}return e})();export{z as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-EJYJDCGC.js";import{a as d}from"./chunk-YVHVMROC.js";import"./chunk-RPUNCPRY.js";import"./chunk-W37YHNVN.js";import"./chunk-CSHGL57O.js";import"./chunk-6MURSHMV.js";import"./chunk-YLGAO33X.js";import"./chunk-QXRG5XYP.js";import"./chunk-OD6Q5ER6.js";import"./chunk-GRKPMAMP.js";import"./chunk-NNVT5X6O.js";import"./chunk-OTGSPSYP.js";import"./chunk-CL2QGEN4.js";import"./chunk-KVPTGBX3.js";import{c as m}from"./chunk-2P7JU6NZ.js";import"./chunk-ET5KHOIM.js";import"./chunk-ASFPLYOZ.js";import{Eb as i,Ha as a,gc as l,hc as p,ic as c,jc as o,mb as r}from"./chunk-UL2ZUNXQ.js";import"./chunk-WFMAM73Y.js";import"./chunk-7KVKRA5M.js";var h=(()=>{class t{constructor(){this.ObjectlogTabs=a([{Title:"Channel Push Log Exception",Url:"/menu/log/exception"},{Title:"Channel Push Log",Url:"/menu/log/rawlog"},{Title:"POS Sync Order Log",Url:"/menu/log/order"},{Title:"Inventory Sync ",Url:"/menu/log/inventory"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"},{Title:"Flush Cache ",Url:"/menu/log/flush-cache"}])}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=i({type:t,selectors:[["app-logs"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,s){n&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),c()()(),o(4,"router-outlet")),n&2&&(r(3),l("Tabs",s.ObjectlogTabs()))},dependencies:[d,m],encapsulation:2,changeDetection:0})}}return t})();var T=[{path:"",component:h,children:[{path:"",redirectTo:"exception",pathMatch:"full"},{path:"order",loadComponent(){return import("./chunk-KF76RZHT.js").then(t=>t.OrderComponent)},canActivate:[e],data:{title:"Order Log"}},{path:"inventory/sync-inventory",loadComponent(){return import("./chunk-MF7R2S36.js").then(t=>t.InventoryLogComponent)},canActivate:[e],data:{title:"Product Inventory Sync"}},{path:"rawlog",loadComponent(){return import("./chunk-LES7DMKA.js").then(t=>t.RawLogComponent)},canActivate:[e],data:{title:"Raw Log"}},{path:"rawlog/detail",loadComponent(){return import("./chunk-Y2ZWST7R.js").then(t=>t.RawDetailComponent)},canActivate:[e],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",loadComponent(){return import("./chunk-USX5PX4Q.js").then(t=>t.InventoryDetailComponent)},canActivate:[e],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",loadComponent(){return import("./chunk-KZBCS3M2.js").then(t=>t.OrderdetailComponent)},canActivate:[e],data:{title:"Order Details"}},{path:"order/detail-user",loadComponent(){return import("./chunk-BPH57JUA.js").then(t=>t.OrderdetailUserComponent)},canActivate:[e],data:{title:"Order User Details"}},{path:"exception",loadComponent(){return import("./chunk-STYIWS5Z.js").then(t=>t.ExceptionLogComponent)},canActivate:[e],data:{title:"Exception Log"}},{path:"exception/detail",loadComponent(){return import("./chunk-DORFETS5.js").then(t=>t.ExceptionDetailComponent)},canActivate:[e],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-BJ22OOEH.js").then(t=>t.InventoryAsyncLogComponent),canActivate:[e],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-JF6PYGBM.js").then(t=>t.InventoryAsyncDetailComponent),canActivate:[e],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-JMRPU32Z.js").then(t=>t.ChannelLogComponent)},canActivate:[e],data:{title:"Authorization Log"}},{path:"flush-cache",loadComponent(){return import("./chunk-WCHIGKFX.js").then(t=>t.FlushCacheComponent)},canActivate:[e],data:{title:"Flush Cache"}}]}];export{T as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-EJYJDCGC.js";import{a as s}from"./chunk-YVHVMROC.js";import"./chunk-RPUNCPRY.js";import"./chunk-W37YHNVN.js";import"./chunk-CSHGL57O.js";import"./chunk-6MURSHMV.js";import"./chunk-YLGAO33X.js";import"./chunk-QXRG5XYP.js";import"./chunk-OD6Q5ER6.js";import"./chunk-GRKPMAMP.js";import"./chunk-NNVT5X6O.js";import"./chunk-OTGSPSYP.js";import"./chunk-CL2QGEN4.js";import"./chunk-KVPTGBX3.js";import{c as m,g as c}from"./chunk-2P7JU6NZ.js";import"./chunk-ET5KHOIM.js";import"./chunk-ASFPLYOZ.js";import{Eb as i,gc as r,hc as p,ic as l,jc as o,mb as a}from"./chunk-UL2ZUNXQ.js";import"./chunk-WFMAM73Y.js";import"./chunk-7KVKRA5M.js";var u=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Multi Channel Row Comparison",Url:"/menu/price/update"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=i({type:e,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,C){t&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),l()()(),o(4,"router-outlet")),t&2&&(a(3),r("Tabs",C.priceTabs))},dependencies:[s,c,m],encapsulation:2,changeDetection:0})}}return e})();var S=[{path:"",component:u,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-KJW7YEK7.js").then(e=>e.PricePosChannelComponent)},canActivate:[n],data:{title:"Global Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-IMW6HVQ7.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[n],data:{title:"Price Single Channel Comparison"}},{path:"update",loadComponent(){return import("./chunk-AHJS7WUL.js").then(e=>e.PriceUpdateComponent)},canActivate:[n],data:{title:"Multi Channel Row Comparison"}}]}];export{S as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-EJYJDCGC.js";import{a as m}from"./chunk-YVHVMROC.js";import"./chunk-RPUNCPRY.js";import"./chunk-W37YHNVN.js";import"./chunk-CSHGL57O.js";import"./chunk-6MURSHMV.js";import"./chunk-YLGAO33X.js";import"./chunk-QXRG5XYP.js";import"./chunk-OD6Q5ER6.js";import"./chunk-GRKPMAMP.js";import"./chunk-NNVT5X6O.js";import"./chunk-OTGSPSYP.js";import"./chunk-CL2QGEN4.js";import"./chunk-KVPTGBX3.js";import{c as p}from"./chunk-2P7JU6NZ.js";import"./chunk-ET5KHOIM.js";import"./chunk-ASFPLYOZ.js";import{Eb as i,gc as a,hc as c,ic as l,jc as o,mb as r}from"./chunk-UL2ZUNXQ.js";import"./chunk-WFMAM73Y.js";import"./chunk-7KVKRA5M.js";var d=(()=>{class t{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/void-invoice"},{Title:"All",Url:"/menu/sync-log/all"}]}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=i({type:t,selectors:[["app-order"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,s){n&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),l()()(),o(4,"router-outlet")),n&2&&(r(3),a("Tabs",s.reportTabs))},dependencies:[m,p],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]})}}return t})();var T=[{path:"",component:d,children:[{path:"",redirectTo:"all",pathMatch:"full"},{path:"sync-order",loadComponent(){return import("./chunk-7R226ENP.js").then(t=>t.SalesOrderComponent)},canActivate:[e],data:{title:"Sync Order"}},{path:"convert-to-invoice",loadComponent(){return import("./chunk-XMNPQFIX.js").then(t=>t.ConvertInvoiceComponent)},canActivate:[e],data:{title:"Sync Convert to Invoice"}},{path:"invoice",loadComponent(){return import("./chunk-ZJIMUCST.js").then(t=>t.InvoiceComponent)},canActivate:[e],data:{title:"Sync Invoice"}},{path:"delivery",loadComponent(){return import("./chunk-OM5TMTS6.js").then(t=>t.DeliveryComponent)},canActivate:[e],data:{title:"Sync Delivery"}},{path:"payment",loadComponent(){return import("./chunk-4XMMT7HU.js").then(t=>t.PaymentComponent)},canActivate:[e],data:{title:"Sync Payment"}},{path:"void-invoice",loadComponent(){return import("./chunk-5QFJ5X2G.js").then(t=>t.VoidInvoiceComponent)},canActivate:[e],data:{title:"Sync void invoice"}},{path:"all",loadComponent(){return import("./chunk-OQN55YMB.js").then(t=>t.AllComponent)},canActivate:[e],data:{title:"All Report"}}]}];export{T as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-7KVKRA5M.js";var o=[{path:"",loadComponent(){return import("./chunk-7VDQS5EM.js").then(t=>t.OrdersV2Component)},children:[{path:"to-ship",loadComponent(){return import("./chunk-
|
|
1
|
+
import"./chunk-7KVKRA5M.js";var o=[{path:"",loadComponent(){return import("./chunk-7VDQS5EM.js").then(t=>t.OrdersV2Component)},children:[{path:"to-ship",loadComponent(){return import("./chunk-JW3CZ5UT.js").then(t=>t.ReadyToShipComponent)},title:"To Ship"},{path:"awaiting-collection",loadComponent(){return import("./chunk-HLCE56JK.js").then(t=>t.AwaitingCollectionComponent)},title:"Awaiting Collection"},{path:"shipped",loadComponent(){return import("./chunk-YU775UKC.js").then(t=>t.ShippedComponent)},title:"Shipped"},{path:"completed",loadComponent(){return import("./chunk-HVOO6TRM.js").then(t=>t.CompletedComponent)},title:"Completed"},{path:"all",loadComponent(){return import("./chunk-CUG5ZTOK.js").then(t=>t.AllComponent)},title:"All Orders"},{path:"cancelled",loadComponent(){return import("./chunk-GCFH7BCA.js").then(t=>t.CancelledComponent)},title:"Cancelled"},{path:"download",loadComponent(){return import("./chunk-WB3M7GSG.js").then(t=>t.DownloadV2Component)},title:"Download"},{path:"log",loadComponent(){return import("./chunk-7PXXC2F6.js").then(t=>t.DownloadOrderLogComponent)},title:"Download Log"},{path:"log/detail",loadComponent(){return import("./chunk-AHSXSURA.js").then(t=>t.DownloadOrderDetailComponent)},title:"Download Log Detail"},{path:"",pathMatch:"full",redirectTo:"to-ship"}]}];export{o as routes};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as nt}from"./chunk-YLGAO33X.js";import{a as Q}from"./chunk-QXRG5XYP.js";import{a as rt}from"./chunk-GRKPMAMP.js";import{b as we,c as ee}from"./chunk-NNVT5X6O.js";import{d as Qe}from"./chunk-OTGSPSYP.js";import{a as Ge,b as fe,c as Ze,d as Je,e as ge,f as Xe,g as me,h as Ye,i as G,j as ye,k as x}from"./chunk-CL2QGEN4.js";import{e as et}from"./chunk-KVPTGBX3.js";import{d as tt}from"./chunk-2P7JU6NZ.js";import{C as qe,D as Ve}from"./chunk-ET5KHOIM.js";import{Aa as Ue,Bd as L,D as Ne,E as Fe,Ea as H,Fb as U,L as le,La as ze,P as Le,Q as $e,Ua as K,V as ue,Y as O,Z as de,aa as he,c as g,ca as We,d as je,da as He,h as Oe,i as Be,ia as T,ja as W,l as q,la as C,m as Y,ma as f,n as B,na as M,o as V,ra as pe,t as R,ta as Ke,u as Me}from"./chunk-UL2ZUNXQ.js";import{b as y}from"./chunk-WFMAM73Y.js";import{a as ce,i as A}from"./chunk-7KVKRA5M.js";var ot={production:!0,version:"6.34.2",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var it=(()=>{class r{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let t=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return typeof t=="string"&&(t=[t]),t||[]}ParseToken(e){try{let n=e.split(".")[0].replace("-","+").replace("_","/"),o=JSON.parse(window.atob(n)),c=e.split(".")[1].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(c));return s.header=o,s}catch(t){return!1}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Tt="firebase",Ct="11.10.0";G(Tt,Ct,"app");var z=new We("ANGULARFIRE2_VERSION");var st=(r,a)=>{let e=a?[a]:Ye(),t=[];return e.forEach(n=>{n.container.getProvider(r).instances.forEach(i=>{t.includes(i)||t.push(i)})}),t},ve=(function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r})(ve||{}),Mr=L()&&typeof Zone<"u"?ve.WARN:ve.SILENT;var te=class{zone;delegate;constructor(a,e=Be){this.zone=a,this.delegate=e}now(){return this.delegate.now()}schedule(a,e,t){let n=this.zone,o=function(i){n?n.runGuarded(()=>{a.apply(this,[i])}):a.apply(this,[i])};return this.delegate.schedule(o,e,t)}},Ae=(()=>{class r{outsideAngular;insideAngular;constructor(){let e=M(H);this.outsideAngular=e.runOutsideAngular(()=>new te(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new te(typeof Zone>"u"?void 0:Zone.current,Oe))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var Pt="firebase",xt="11.10.0";x.registerVersion(Pt,xt,"app-compat");var _t=["ngOnDestroy"],ct=(r,a,e,t={})=>new Proxy(r,{get:(n,o)=>e.runOutsideAngular(()=>{if(r[o])return t?.spy?.get&&t.spy.get(o,r[o]),r[o];if(_t.indexOf(o)>-1)return()=>{};let i=a.toPromise().then(c=>{let s=c?.[o];return typeof s=="function"?s.bind(c):s?.then?s.then(l=>e.run(()=>l)):e.run(()=>s)});return new Proxy(()=>{},{get:(c,s)=>i[s],apply:(c,s,l)=>i.then(h=>{let u=h?.(...l);return t?.spy?.apply&&t.spy.apply(o,l,u),u})})})});var re=class{constructor(a){return a}},ne=new C("angularfire2.app.options"),oe=new C("angularfire2.app.name");function ke(r,a,e){let t=typeof e=="string"&&e||"[DEFAULT]",n=typeof e=="object"&&e||{};n.name=n.name||t;let i=x.apps.filter(c=>c&&c.name===n.name)[0]||a.runOutsideAngular(()=>x.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(i.options)){let c=!!module.hot;Rt("error",`${i.name} Firebase App already initialized with different options${c?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch(c){}return new re(i)}var Rt=(r,...a)=>{L()&&typeof console<"u"&&console[r](...a)},jt={provide:re,useFactory:ke,deps:[ne,H,[new ze,oe]]},zr=(()=>{class r{static initializeApp(e,t){return{ngModule:r,providers:[{provide:ne,useValue:e},{provide:oe,useValue:t}]}}constructor(e){x.registerVersion("angularfire",z.full,"core"),x.registerVersion("angularfire",z.full,"app-compat"),x.registerVersion("angular",He.full,e.toString())}static \u0275fac=function(t){return new(t||r)(f(K))};static \u0275mod=U({type:r});static \u0275inj=W({providers:[jt]})}return r})();function lt(r,a,e,t,n){let[,o,i]=globalThis.\u0275AngularfireInstanceCache.find(c=>c[0]===r)||[];if(o)return Ot(n,i)||(at("error",`${a} was already initialized on the ${e} Firebase App with different settings.${Bt?" You may need to reload as Firebase is not HMR aware.":""}`),at("warn",{is:n,was:i})),o;{let c=t();return globalThis.\u0275AngularfireInstanceCache.push([r,c,n]),c}}function Ot(r,a){try{return r.toString()===a.toString()}catch(e){return r===a}}var Bt=typeof module<"u"&&!!module.hot,at=(r,...a)=>{L()&&typeof console<"u"&&console[r](...a)};globalThis.\u0275AngularfireInstanceCache||=[];var Mt=new Map,Nt={activated:!1,tokenObservers:[]},Ft={initialized:!1,enabled:!1};function _(r){return Mt.get(r)||Object.assign({},Nt)}function pt(){return Ft}var Lt="https://content-firebaseappcheck.googleapis.com/v1";var $t="exchangeDebugToken",ut={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},nn=1440*60*1e3;var Ee=class{constructor(a,e,t,n,o){if(this.operation=a,this.retryPolicy=e,this.getWaitDuration=t,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(a){return A(this,null,function*(){this.stop();try{this.pending=new fe,this.pending.promise.catch(e=>{}),yield Wt(this.getNextRun(a)),this.pending.resolve(),yield this.pending.promise,this.pending=new fe,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(a){if(a)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function Wt(r){return new Promise(a=>{setTimeout(a,r)})}var Ht={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},N=new Je("appCheck","AppCheck",Ht);function ft(r){if(!_(r).activated)throw N.create("use-before-activation",{appName:r.name})}function gt(t,n){return A(this,arguments,function*({url:r,body:a},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let d=yield i.getHeartbeatsHeader();d&&(o["X-Firebase-Client"]=d)}let c={method:"POST",body:JSON.stringify(a),headers:o},s;try{s=yield fetch(r,c)}catch(d){throw N.create("fetch-network-error",{originalErrorMessage:d?.message})}if(s.status!==200)throw N.create("fetch-status-error",{httpStatus:s.status});let l;try{l=yield s.json()}catch(d){throw N.create("fetch-parse-error",{originalErrorMessage:d?.message})}let h=l.ttl.match(/^([\d.]+)(s)$/);if(!h||!h[2]||isNaN(Number(h[1])))throw N.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(h[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function mt(r,a){let{projectId:e,appId:t,apiKey:n}=r.options;return{url:`${Lt}/projects/${e}/apps/${t}:${$t}?key=${n}`,body:{debug_token:a}}}var Kt="firebase-app-check-database",Ut=1,Ie="firebase-app-check-store";var ie=null;function zt(){return ie||(ie=new Promise((r,a)=>{try{let e=indexedDB.open(Kt,Ut);e.onsuccess=t=>{r(t.target.result)},e.onerror=t=>{var n;a(N.create("storage-open",{originalErrorMessage:(n=t.target.error)===null||n===void 0?void 0:n.message}))},e.onupgradeneeded=t=>{let n=t.target.result;t.oldVersion===0&&n.createObjectStore(Ie,{keyPath:"compositeKey"})}}catch(e){a(N.create("storage-open",{originalErrorMessage:e?.message}))}}),ie)}function qt(r,a){return Vt(Gt(r),a)}function Vt(r,a){return A(this,null,function*(){let t=(yield zt()).transaction(Ie,"readwrite"),o=t.objectStore(Ie).put({compositeKey:r,value:a});return new Promise((i,c)=>{o.onsuccess=s=>{i()},t.onerror=s=>{var l;c(N.create("storage-set",{originalErrorMessage:(l=s.target.error)===null||l===void 0?void 0:l.message}))}})})}function Gt(r){return`${r.options.appId}-${r.name}`}var Z=new Xe("@firebase/app-check");function be(r,a){return Ze()?qt(r,a).catch(e=>{Z.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function yt(){return pt().enabled}function wt(){return A(this,null,function*(){let r=pt();if(r.enabled&&r.token)return r.token.promise;throw Error(`
|
|
1
|
+
import{a as nt}from"./chunk-YLGAO33X.js";import{a as Q}from"./chunk-QXRG5XYP.js";import{a as rt}from"./chunk-GRKPMAMP.js";import{b as we,c as ee}from"./chunk-NNVT5X6O.js";import{d as Qe}from"./chunk-OTGSPSYP.js";import{a as Ge,b as fe,c as Ze,d as Je,e as ge,f as Xe,g as me,h as Ye,i as G,j as ye,k as x}from"./chunk-CL2QGEN4.js";import{e as et}from"./chunk-KVPTGBX3.js";import{d as tt}from"./chunk-2P7JU6NZ.js";import{C as qe,D as Ve}from"./chunk-ET5KHOIM.js";import{Aa as Ue,Bd as L,D as Ne,E as Fe,Ea as H,Fb as U,L as le,La as ze,P as Le,Q as $e,Ua as K,V as ue,Y as O,Z as de,aa as he,c as g,ca as We,d as je,da as He,h as Oe,i as Be,ia as T,ja as W,l as q,la as C,m as Y,ma as f,n as B,na as M,o as V,ra as pe,t as R,ta as Ke,u as Me}from"./chunk-UL2ZUNXQ.js";import{b as y}from"./chunk-WFMAM73Y.js";import{a as ce,i as A}from"./chunk-7KVKRA5M.js";var ot={production:!0,version:"6.34.3",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var it=(()=>{class r{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let t=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return typeof t=="string"&&(t=[t]),t||[]}ParseToken(e){try{let n=e.split(".")[0].replace("-","+").replace("_","/"),o=JSON.parse(window.atob(n)),c=e.split(".")[1].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(c));return s.header=o,s}catch(t){return!1}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Tt="firebase",Ct="11.10.0";G(Tt,Ct,"app");var z=new We("ANGULARFIRE2_VERSION");var st=(r,a)=>{let e=a?[a]:Ye(),t=[];return e.forEach(n=>{n.container.getProvider(r).instances.forEach(i=>{t.includes(i)||t.push(i)})}),t},ve=(function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r})(ve||{}),Mr=L()&&typeof Zone<"u"?ve.WARN:ve.SILENT;var te=class{zone;delegate;constructor(a,e=Be){this.zone=a,this.delegate=e}now(){return this.delegate.now()}schedule(a,e,t){let n=this.zone,o=function(i){n?n.runGuarded(()=>{a.apply(this,[i])}):a.apply(this,[i])};return this.delegate.schedule(o,e,t)}},Ae=(()=>{class r{outsideAngular;insideAngular;constructor(){let e=M(H);this.outsideAngular=e.runOutsideAngular(()=>new te(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new te(typeof Zone>"u"?void 0:Zone.current,Oe))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var Pt="firebase",xt="11.10.0";x.registerVersion(Pt,xt,"app-compat");var _t=["ngOnDestroy"],ct=(r,a,e,t={})=>new Proxy(r,{get:(n,o)=>e.runOutsideAngular(()=>{if(r[o])return t?.spy?.get&&t.spy.get(o,r[o]),r[o];if(_t.indexOf(o)>-1)return()=>{};let i=a.toPromise().then(c=>{let s=c?.[o];return typeof s=="function"?s.bind(c):s?.then?s.then(l=>e.run(()=>l)):e.run(()=>s)});return new Proxy(()=>{},{get:(c,s)=>i[s],apply:(c,s,l)=>i.then(h=>{let u=h?.(...l);return t?.spy?.apply&&t.spy.apply(o,l,u),u})})})});var re=class{constructor(a){return a}},ne=new C("angularfire2.app.options"),oe=new C("angularfire2.app.name");function ke(r,a,e){let t=typeof e=="string"&&e||"[DEFAULT]",n=typeof e=="object"&&e||{};n.name=n.name||t;let i=x.apps.filter(c=>c&&c.name===n.name)[0]||a.runOutsideAngular(()=>x.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(i.options)){let c=!!module.hot;Rt("error",`${i.name} Firebase App already initialized with different options${c?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch(c){}return new re(i)}var Rt=(r,...a)=>{L()&&typeof console<"u"&&console[r](...a)},jt={provide:re,useFactory:ke,deps:[ne,H,[new ze,oe]]},zr=(()=>{class r{static initializeApp(e,t){return{ngModule:r,providers:[{provide:ne,useValue:e},{provide:oe,useValue:t}]}}constructor(e){x.registerVersion("angularfire",z.full,"core"),x.registerVersion("angularfire",z.full,"app-compat"),x.registerVersion("angular",He.full,e.toString())}static \u0275fac=function(t){return new(t||r)(f(K))};static \u0275mod=U({type:r});static \u0275inj=W({providers:[jt]})}return r})();function lt(r,a,e,t,n){let[,o,i]=globalThis.\u0275AngularfireInstanceCache.find(c=>c[0]===r)||[];if(o)return Ot(n,i)||(at("error",`${a} was already initialized on the ${e} Firebase App with different settings.${Bt?" You may need to reload as Firebase is not HMR aware.":""}`),at("warn",{is:n,was:i})),o;{let c=t();return globalThis.\u0275AngularfireInstanceCache.push([r,c,n]),c}}function Ot(r,a){try{return r.toString()===a.toString()}catch(e){return r===a}}var Bt=typeof module<"u"&&!!module.hot,at=(r,...a)=>{L()&&typeof console<"u"&&console[r](...a)};globalThis.\u0275AngularfireInstanceCache||=[];var Mt=new Map,Nt={activated:!1,tokenObservers:[]},Ft={initialized:!1,enabled:!1};function _(r){return Mt.get(r)||Object.assign({},Nt)}function pt(){return Ft}var Lt="https://content-firebaseappcheck.googleapis.com/v1";var $t="exchangeDebugToken",ut={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},nn=1440*60*1e3;var Ee=class{constructor(a,e,t,n,o){if(this.operation=a,this.retryPolicy=e,this.getWaitDuration=t,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(a){return A(this,null,function*(){this.stop();try{this.pending=new fe,this.pending.promise.catch(e=>{}),yield Wt(this.getNextRun(a)),this.pending.resolve(),yield this.pending.promise,this.pending=new fe,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(a){if(a)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function Wt(r){return new Promise(a=>{setTimeout(a,r)})}var Ht={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},N=new Je("appCheck","AppCheck",Ht);function ft(r){if(!_(r).activated)throw N.create("use-before-activation",{appName:r.name})}function gt(t,n){return A(this,arguments,function*({url:r,body:a},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let d=yield i.getHeartbeatsHeader();d&&(o["X-Firebase-Client"]=d)}let c={method:"POST",body:JSON.stringify(a),headers:o},s;try{s=yield fetch(r,c)}catch(d){throw N.create("fetch-network-error",{originalErrorMessage:d?.message})}if(s.status!==200)throw N.create("fetch-status-error",{httpStatus:s.status});let l;try{l=yield s.json()}catch(d){throw N.create("fetch-parse-error",{originalErrorMessage:d?.message})}let h=l.ttl.match(/^([\d.]+)(s)$/);if(!h||!h[2]||isNaN(Number(h[1])))throw N.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(h[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function mt(r,a){let{projectId:e,appId:t,apiKey:n}=r.options;return{url:`${Lt}/projects/${e}/apps/${t}:${$t}?key=${n}`,body:{debug_token:a}}}var Kt="firebase-app-check-database",Ut=1,Ie="firebase-app-check-store";var ie=null;function zt(){return ie||(ie=new Promise((r,a)=>{try{let e=indexedDB.open(Kt,Ut);e.onsuccess=t=>{r(t.target.result)},e.onerror=t=>{var n;a(N.create("storage-open",{originalErrorMessage:(n=t.target.error)===null||n===void 0?void 0:n.message}))},e.onupgradeneeded=t=>{let n=t.target.result;t.oldVersion===0&&n.createObjectStore(Ie,{keyPath:"compositeKey"})}}catch(e){a(N.create("storage-open",{originalErrorMessage:e?.message}))}}),ie)}function qt(r,a){return Vt(Gt(r),a)}function Vt(r,a){return A(this,null,function*(){let t=(yield zt()).transaction(Ie,"readwrite"),o=t.objectStore(Ie).put({compositeKey:r,value:a});return new Promise((i,c)=>{o.onsuccess=s=>{i()},t.onerror=s=>{var l;c(N.create("storage-set",{originalErrorMessage:(l=s.target.error)===null||l===void 0?void 0:l.message}))}})})}function Gt(r){return`${r.options.appId}-${r.name}`}var Z=new Xe("@firebase/app-check");function be(r,a){return Ze()?qt(r,a).catch(e=>{Z.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function yt(){return pt().enabled}function wt(){return A(this,null,function*(){let r=pt();if(r.enabled&&r.token)return r.token.promise;throw Error(`
|
|
2
2
|
Can't get debug token in production mode.
|
|
3
3
|
`)})}var Zt={error:"UNKNOWN_ERROR"};function Jt(r){return Ge.encodeString(JSON.stringify(r),!1)}function Te(r,a=!1,e=!1){return A(this,null,function*(){let t=r.app;ft(t);let n=_(t),o=n.token,i;if(o&&!J(o)&&(n.token=void 0,o=void 0),!o){let l=yield n.cachedTokenPromise;l&&(J(l)?o=l:yield be(t,void 0))}if(!a&&o&&J(o))return{token:o.token};let c=!1;if(yt())try{n.exchangeTokenPromise||(n.exchangeTokenPromise=gt(mt(t,yield wt()),r.heartbeatServiceProvider).finally(()=>{n.exchangeTokenPromise=void 0}),c=!0);let l=yield n.exchangeTokenPromise;return yield be(t,l),n.token=l,{token:l.token}}catch(l){return l.code==="appCheck/throttled"||l.code==="appCheck/initial-throttle"?Z.warn(l.message):e&&Z.error(l),Se(l)}try{n.exchangeTokenPromise||(n.exchangeTokenPromise=n.provider.getToken().finally(()=>{n.exchangeTokenPromise=void 0}),c=!0),o=yield _(t).exchangeTokenPromise}catch(l){l.code==="appCheck/throttled"||l.code==="appCheck/initial-throttle"?Z.warn(l.message):e&&Z.error(l),i=l}let s;return o?i?J(o)?s={token:o.token,internalError:i}:s=Se(i):(s={token:o.token},n.token=o,yield be(t,o)):s=Se(i),c&&er(t,s),s})}function Xt(r){return A(this,null,function*(){let a=r.app;ft(a);let{provider:e}=_(a);if(yt()){let t=yield wt(),{token:n}=yield gt(mt(a,t),r.heartbeatServiceProvider);return{token:n}}else{let{token:t}=yield e.getToken();return{token:t}}})}function Yt(r,a,e,t){let{app:n}=r,o=_(n),i={next:e,error:t,type:a};if(o.tokenObservers=[...o.tokenObservers,i],o.token&&J(o.token)){let c=o.token;Promise.resolve().then(()=>{e({token:c.token}),dt(r)}).catch(()=>{})}o.cachedTokenPromise.then(()=>dt(r))}function vt(r,a){let e=_(r),t=e.tokenObservers.filter(n=>n.next!==a);t.length===0&&e.tokenRefresher&&e.tokenRefresher.isRunning()&&e.tokenRefresher.stop(),e.tokenObservers=t}function dt(r){let{app:a}=r,e=_(a),t=e.tokenRefresher;t||(t=Qt(r),e.tokenRefresher=t),!t.isRunning()&&e.isTokenAutoRefreshEnabled&&t.start()}function Qt(r){let{app:a}=r;return new Ee(()=>A(null,null,function*(){let e=_(a),t;if(e.token?t=yield Te(r,!0):t=yield Te(r),t.error)throw t.error;if(t.internalError)throw t.internalError}),()=>!0,()=>{let e=_(a);if(e.token){let t=e.token.issuedAtTimeMillis+(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)*.5+3e5,n=e.token.expireTimeMillis-300*1e3;return t=Math.min(t,n),Math.max(0,t-Date.now())}else return 0},ut.RETRIAL_MIN_WAIT,ut.RETRIAL_MAX_WAIT)}function er(r,a){let e=_(r).tokenObservers;for(let t of e)try{t.type==="EXTERNAL"&&a.error!=null?t.error(a.error):t.next(a)}catch(n){}}function J(r){return r.expireTimeMillis-Date.now()>0}function Se(r){return{token:Jt(Zt),error:r}}var Ce=class{constructor(a,e){this.app=a,this.heartbeatServiceProvider=e}_delete(){let{tokenObservers:a}=_(this.app);for(let e of a)vt(this.app,e.next);return Promise.resolve()}};function tr(r,a){return new Ce(r,a)}function rr(r){return{getToken:a=>Te(r,a),getLimitedUseToken:()=>Xt(r),addTokenListener:a=>Yt(r,"INTERNAL",a),removeTokenListener:a=>vt(r.app,a)}}var nr="@firebase/app-check",or="0.10.1";var ir="app-check",ht="app-check-internal";function sr(){me(new ge(ir,r=>{let a=r.getProvider("app").getImmediate(),e=r.getProvider("heartbeat");return tr(a,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,a,e)=>{r.getProvider(ht).initialize()})),me(new ge(ht,r=>{let a=r.getProvider("app-check").getImmediate();return rr(a)},"PUBLIC").setInstantiationMode("EXPLICIT")),G(nr,or)}sr();var ar="app-check";var se=class{constructor(){return st(ar)}};var cr=["localhost","0.0.0.0","127.0.0.1"],vn=typeof window<"u"&&cr.includes(window.location.hostname);var ur=new C("angularfire2.auth.use-emulator"),dr=new C("angularfire2.auth.settings"),hr=new C("angularfire2.auth.tenant-id"),pr=new C("angularfire2.auth.langugage-code"),fr=new C("angularfire2.auth.use-device-language"),gr=new C("angularfire.auth.persistence"),mr=(r,a,e,t,n,o,i,c)=>lt(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let s=a.runOutsideAngular(()=>r.auth());if(e&&s.useEmulator(...e),t&&(s.tenantId=t),s.languageCode=n,o&&s.useDeviceLanguage(),i)for(let[l,h]of Object.entries(i))s.settings[l]=h;return c&&s.setPersistence(c),s},[e,t,n,o,i,c]),De=(()=>{class r{injector=M(pe);authState;idToken;user;idTokenResult;credential;constructor(e,t,n,o,i,c,s,l,h,u,p,d){let m=new je,D=V(void 0).pipe(q(i.outsideAngular),O(()=>o.runOutsideAngular(()=>import("./chunk-2FZK2L23.js"))),R(()=>ke(e,o,t)),R(P=>mr(P,o,c,l,h,u,s,p)),ue({bufferSize:1,refCount:!1}));if(Ve(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=V(null);else{D.pipe($e()).subscribe();let P=D.pipe(O(E=>E.getRedirectResult().then(j=>j,()=>null)),Qe(this.injector),ue({bufferSize:1,refCount:!1})),X=D.pipe(O(E=>new g(j=>({unsubscribe:o.runOutsideAngular(()=>E.onAuthStateChanged(F=>j.next(F),F=>j.error(F),()=>j.complete()))})))),ae=D.pipe(O(E=>new g(j=>({unsubscribe:o.runOutsideAngular(()=>E.onIdTokenChanged(F=>j.next(F),F=>j.error(F),()=>j.complete()))}))));this.authState=P.pipe(de(X),Y(i.outsideAngular),q(i.insideAngular)),this.user=P.pipe(de(ae),Y(i.outsideAngular),q(i.insideAngular)),this.idToken=this.user.pipe(O(E=>E?B(E.getIdToken()):V(null))),this.idTokenResult=this.user.pipe(O(E=>E?B(E.getIdTokenResult()):V(null))),this.credential=Ne(P,m,this.authState.pipe(Fe(E=>!E))).pipe(R(E=>E?.user?E:null),Y(i.outsideAngular),q(i.insideAngular))}return ct(this,D,o,{spy:{apply:(P,X,ae)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&ae.then(E=>m.next(E))}}})}static \u0275fac=function(t){return new(t||r)(f(ne),f(oe,8),f(K),f(H),f(Ae),f(ur,8),f(dr,8),f(hr,8),f(pr,8),f(fr,8),f(gr,8),f(se,8))};static \u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),Bn=(()=>{class r{constructor(){x.registerVersion("angularfire",z.full,"auth-compat")}static \u0275fac=function(t){return new(t||r)};static \u0275mod=U({type:r});static \u0275inj=W({providers:[De]})}return r})();var k=(function(r){return r.readonly="readonly",r.readwrite="readwrite",r})(k||{}),At=new C(null),kt=new C("Indexed DB"),wr=new C("Server Indexed DB");function vr(r,a){return r.objectStoreNames.contains(a)}function I(r,a,e){if(!r){e("You need to use the openDatabase function to create a database before you query it!");return}vr(r,a)||e(`objectStore does not exists: ${a}`)}function b(r,a){let e=r.transaction(a.storeName,a.dbMode);return e.onerror=a.error,e.onabort=a.abort,e}function S(r,a,e,t){return{storeName:a,dbMode:r,error:n=>{e(n)},abort:n=>{e(n)}}}var xe=[];function w(r,a,e,t){return new Promise((n,o)=>{r||o("IndexedDB not available");let i=r.open(a,e),c;i.onsuccess=()=>{c=i.result,xe.push(c),n(c)},i.onerror=()=>{o(`IndexedDB error: ${i.error}`)},typeof t=="function"&&(i.onupgradeneeded=s=>{t(s,c)})})}function Pe(r,a,e,t,n){return A(this,null,function*(){return new Promise((o,i)=>{if(!r)return;let c=r.open(a,e);c.onupgradeneeded=s=>A(null,null,function*(){let l=s.target.result,h=t.map(p=>A(null,null,function*(){if(!l.objectStoreNames.contains(p.store)){let d=l.createObjectStore(p.store,p.storeConfig);for(let m of p.storeSchema)d.createIndex(m.name,m.keypath,m.options)}}));yield Promise.all(h);let u=n&&n();if(u){let p=Object.keys(u).map(d=>parseInt(d,10)).filter(d=>d>s.oldVersion).sort((d,m)=>d-m);for(let d of p)u[d](l,c.transaction)}l.close(),o()}),c.onsuccess=s=>{s.target.result.close(),o()},c.onerror=s=>{i(s)}})})}function Ar(r,a,e){if(!r||!a||!e)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(t=>{try{let n=a+1,o=indexedDB.open(r,n);o.onupgradeneeded=i=>{let c=i.target.result;c.deleteObjectStore(e),c.close(),console.log("onupgradeneeded"),t.next(),t.complete()},o.onerror=i=>t.error(i)}catch(n){t.error(n)}})}function kr(r){return new Promise((a,e)=>{if(!r){e(new Error("No database to close"));return}try{r.close(),a()}catch(t){e(`Error closing database: ${t}`)}})}function v(){return function(r,a,e){let t=e.value;return e.value=function(...n){let o=t.apply(this,n);return o instanceof g?o.pipe(Le(()=>A(this,null,function*(){let i=xe.map(c=>A(this,null,function*(){yield kr(c)}));yield Promise.all(i),xe.length=0}))):o},e}}var Re=(()=>{class r{constructor(e,t){this.dbConfigs=e,this.indexedDB=t,this.defaultDatabaseName=null,Object.values(this.dbConfigs).forEach((n,o,i)=>this.instanciateConfig(n,i.length===1))}instanciateConfig(e,t){return A(this,null,function*(){if(!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if((e.isDefault??!1)&&this.defaultDatabaseName)throw new Error("NgxIndexedDB: Only one database can be set as default");((e.isDefault??!1)&&!this.defaultDatabaseName||t)&&(this.defaultDatabaseName=e.name,this.selectedDb=e.name),yield Pe(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),w(this.indexedDB,e.name).then(n=>{n.version!==e.version&&(L()&&(console.warn(`
|
|
4
4
|
Your DB Config doesn't match the most recent version of the DB with name ${e.name}, please update it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as te,b as ne}from"./chunk-M622ISHM.js";import{a as ee}from"./chunk-ZXFAXYFC.js";import{a as $}from"./chunk-
|
|
1
|
+
import{a as te,b as ne}from"./chunk-M622ISHM.js";import{a as ee}from"./chunk-ZXFAXYFC.js";import{a as $}from"./chunk-HS4SNPQY.js";import"./chunk-VCPL27TZ.js";import"./chunk-MWWC66IC.js";import"./chunk-752YRTLC.js";import"./chunk-PBNIIZI3.js";import"./chunk-5SMIEG4C.js";import"./chunk-TFLTQKQC.js";import{a as Z}from"./chunk-KLLGH7UI.js";import"./chunk-5XJEZSY4.js";import"./chunk-IW277O6V.js";import"./chunk-RDMMFHDE.js";import"./chunk-EUPJPCMA.js";import"./chunk-P23WQYF4.js";import"./chunk-S52ABRV5.js";import"./chunk-BVN6SNGQ.js";import"./chunk-R4AQOQYM.js";import"./chunk-OF3KLUMM.js";import"./chunk-F66DGPZP.js";import"./chunk-LGOZQVMY.js";import"./chunk-WM53FF34.js";import{b as Y}from"./chunk-PHOKCO5Q.js";import"./chunk-A7GSUUCG.js";import"./chunk-EJRNWPPD.js";import"./chunk-RPUNCPRY.js";import"./chunk-7AXL27HI.js";import"./chunk-GGAT6SSK.js";import"./chunk-5LT2EUGJ.js";import"./chunk-ALU2M2OP.js";import"./chunk-6IK2SMV2.js";import"./chunk-RP34WI5C.js";import"./chunk-QVFZNJGC.js";import"./chunk-IMETJ3FA.js";import"./chunk-JQDMGUB2.js";import"./chunk-27GIACJC.js";import"./chunk-PNL3GTGS.js";import"./chunk-BHQ7CWDE.js";import"./chunk-DF32ANGX.js";import"./chunk-VZ5IMYAU.js";import"./chunk-ZEX7ZA5M.js";import"./chunk-VK76JOCL.js";import"./chunk-HRSPRUJL.js";import"./chunk-W37YHNVN.js";import"./chunk-CSHGL57O.js";import{h as q}from"./chunk-6MURSHMV.js";import"./chunk-YLGAO33X.js";import"./chunk-QXRG5XYP.js";import"./chunk-OD6Q5ER6.js";import"./chunk-GRKPMAMP.js";import{c as H}from"./chunk-NNVT5X6O.js";import{c as G,h as J,m as K,o as Q,z as X}from"./chunk-J5MD62BS.js";import"./chunk-OTGSPSYP.js";import"./chunk-CL2QGEN4.js";import{e as U}from"./chunk-KVPTGBX3.js";import{e as W,g as j}from"./chunk-2P7JU6NZ.js";import{x as V,z as A}from"./chunk-ET5KHOIM.js";import"./chunk-ASFPLYOZ.js";import{$b as x,$c as k,Eb as M,Ha as _,Mc as r,Nc as u,Oc as S,Qc as N,Rc as I,Sc as F,bc as E,dc as L,ec as T,fc as P,gc as p,hc as t,ic as n,id as v,jc as f,jd as z,kb as y,kd as B,mb as o,na as C,qc as R,rd as h,va as D,vc as s,wa as O,xc as w}from"./chunk-UL2ZUNXQ.js";import"./chunk-WFMAM73Y.js";import{a as g,b}from"./chunk-7KVKRA5M.js";var ie=l=>({ID:l});function oe(l,c){if(l&1&&(t(0,"tr")(1,"td"),r(2),n(),t(3,"td"),f(4,"img",23),n(),t(5,"td"),r(6),n(),t(7,"td",24)(8,"a",25),r(9),v(10,"number"),n()(),t(11,"td"),r(12),n(),t(13,"td"),r(14),v(15,"date"),n()()),l&2){let e=c.$implicit;o(2),u(e._source.ChannelName),o(2),p("src",e.logo,y),o(2),u(e._source.DateRange),o(2),p("queryParams",k(12,ie,e._source.ID)),o(),S(" ",z(10,7,e._source.CountOrder)," "),o(3),u(e._source.UserLogin),o(2),S(" ",B(15,9,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," ")}}function re(l,c){if(l&1){let e=R();t(0,"div",14)(1,"table",16)(2,"thead")(3,"tr",17)(4,"th",18),r(5,"Channel"),n(),t(6,"th",19),r(7,"Type"),n(),t(8,"th",20),r(9,"Download Date Range"),n(),t(10,"th",21),r(11,"Count"),n(),t(12,"th"),r(13,"User Login"),n(),t(14,"th"),r(15,"Created"),n()()(),t(16,"tbody"),T(17,oe,16,14,"tr",null,L),n()(),t(19,"mat-paginator",22),s("page",function(a){D(e);let m=w();return O(m.onPaginationChange(a))}),n()()}if(l&2){let e,i=w();o(17),P(i.downloadOrders()),o(2),p("length",i.paginationTotal())("pageSize",i.paginationPageSize())("pageIndex",((e=i.filter())==null?null:e.PageNumber)==0?0:((e=i.filter())==null?null:e.PageNumber)-1)}}function ae(l,c){l&1&&(t(0,"div",15),f(1,"app-empty-state"),n())}var Me=(()=>{class l{constructor(){this.http=C(U),this.authService=C(q),this.downloadOrdersResponse=_(null),this.downloadOrders=h(()=>{let e=this.downloadOrdersResponse();return e?e.hits.map(i=>(i.logo=H.getChannelLogoByTypeId(i._source.TypeID),i)):[]}),this.filter=_({PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""}),this.paginationTotal=h(()=>this.downloadOrdersResponse()?.total.value??0),this.paginationPageSize=h(()=>{let e=this.paginationTotal();return this.filter().RowCount>e?e:this.filter().RowCount}),this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter.set(e.Filter),this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter()).subscribe(e=>{this.downloadOrdersResponse.set(e)})}onPaginationChange(e){this.filter.update(i=>b(g({},i),{PageNumber:e.pageIndex+1})),this.getDownloadOrders()}onFilterChange(e){this.filter.update(i=>g(g({},i),e))}static{this.\u0275fac=function(i){return new(i||l)}}static{this.\u0275cmp=M({type:l,selectors:[["app-download-order-log"]],decls:27,vars:7,consts:[["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/order/log/detail",3,"queryParams"]],template:function(i,a){if(i&1&&(t(0,"mainpanel",0),s("onSubmit",function(){return a.getDownloadOrders()}),t(1,"filters")(2,"div")(3,"label",1),r(4,"Channel"),n(),t(5,"app-channel-options-v2",2),s("ngModelChange",function(d){return a.onFilterChange({ChannelID:d})}),n()(),t(6,"div",3)(7,"label",4),r(8,"From/To"),n(),t(9,"div",5)(10,"datepicker",6),s("dateChange",function(d){return a.onFilterChange({From:d})}),n()(),t(11,"div")(12,"datepicker",7),s("dateChange",function(d){return a.onFilterChange({To:d})}),n()()(),t(13,"div",3)(14,"label",8),r(15,"Page Number"),n(),t(16,"input",9),s("ngModelChange",function(d){return a.onFilterChange({PageNumber:+d})}),n()(),t(17,"div",3)(18,"label",8),r(19,"Page Size"),n(),t(20,"input",10),F("ngModelChange",function(d){return I(a.filter().RowCount,d)||(a.filter().RowCount=d),d}),n()()(),t(21,"content")(22,"div",11)(23,"div",12)(24,"div",13),x(25,re,20,3,"div",14)(26,ae,2,0,"div",15),n()()()()()),i&2){let m;p("hideSearchBox",!0),o(5),p("ngModel",a.filter().ChannelID),o(5),p("date",a.filter().From),o(2),p("date",a.filter().To),o(4),p("ngModel",a.filter().PageNumber),o(4),N("ngModel",a.filter().RowCount),o(5),E(((m=a.downloadOrders())==null?null:m.length)>0?25:26)}},dependencies:[ne,te,Y,X,G,Q,J,K,ee,j,W,Z,$,V,A],encapsulation:2,changeDetection:0})}}return l})();export{Me as DownloadOrderLogComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Jt}from"./chunk-ZLAQX3DO.js";import"./chunk-QZ6ZCOFC.js";import{b as Wt}from"./chunk-KUSSKYYP.js";import{a as jt,b as zt}from"./chunk-QX7XQQ4T.js";import"./chunk-3OJ7ID4M.js";import{a as Gt}from"./chunk-WGEOVL5H.js";import"./chunk-MWWC66IC.js";import"./chunk-752YRTLC.js";import"./chunk-PBNIIZI3.js";import{a as Bt}from"./chunk-4PT2Y3IQ.js";import{a as ct,b as Rt,c as st,d as mt,e as pt}from"./chunk-RB4PJKZF.js";import"./chunk-FXMJKY2I.js";import"./chunk-S5JNUALT.js";import{a as $t}from"./chunk-CZZ6XOQK.js";import"./chunk-VCBRU23L.js";import"./chunk-RDMMFHDE.js";import"./chunk-EUPJPCMA.js";import"./chunk-P23WQYF4.js";import"./chunk-S52ABRV5.js";import"./chunk-BVN6SNGQ.js";import"./chunk-R4AQOQYM.js";import"./chunk-YZ3S5QD5.js";import"./chunk-OF3KLUMM.js";import"./chunk-LGOZQVMY.js";import"./chunk-WM53FF34.js";import{d as w,e as L}from"./chunk-EHE35Y2Y.js";import{b as Lt}from"./chunk-PHOKCO5Q.js";import"./chunk-A7GSUUCG.js";import"./chunk-EJRNWPPD.js";import{a as wt}from"./chunk-RPUNCPRY.js";import{b as Yt,c as Ht}from"./chunk-67YZKJCR.js";import"./chunk-7AXL27HI.js";import"./chunk-CN3FR2GN.js";import"./chunk-GGAT6SSK.js";import"./chunk-5LT2EUGJ.js";import"./chunk-ALU2M2OP.js";import"./chunk-6IK2SMV2.js";import"./chunk-RP34WI5C.js";import"./chunk-QVFZNJGC.js";import"./chunk-IMETJ3FA.js";import"./chunk-JQDMGUB2.js";import"./chunk-27GIACJC.js";import"./chunk-PNL3GTGS.js";import"./chunk-BHQ7CWDE.js";import"./chunk-DF32ANGX.js";import"./chunk-VZ5IMYAU.js";import"./chunk-ZEX7ZA5M.js";import"./chunk-VK76JOCL.js";import"./chunk-HRSPRUJL.js";import{b as Ut}from"./chunk-W37YHNVN.js";import"./chunk-CSHGL57O.js";import"./chunk-ZSUWHVKX.js";import"./chunk-NVCOALE3.js";import"./chunk-YLGAO33X.js";import"./chunk-QXRG5XYP.js";import"./chunk-OD6Q5ER6.js";import"./chunk-GRKPMAMP.js";import{b as ft,c as C}from"./chunk-NNVT5X6O.js";import{A as U,c as j,e as Q,h as V,i as z,l as lt,m as kt,n as W,q as Ot,r as Y,s as H,t as Dt,u as Mt,v as Vt,y as J,z as X}from"./chunk-J5MD62BS.js";import"./chunk-OTGSPSYP.js";import"./chunk-CL2QGEN4.js";import{b as Et,e as rt}from"./chunk-KVPTGBX3.js";import"./chunk-2P7JU6NZ.js";import{v as S}from"./chunk-ET5KHOIM.js";import"./chunk-ASFPLYOZ.js";import{$b as f,Eb as x,I as St,K as It,Ma as k,Mc as u,Nc as et,Oc as q,Qc as At,Rc as Pt,Sc as Nt,V as B,X as Ft,Zc as T,_ as _t,_c as at,aa as A,bc as h,cc as O,d as Tt,ec as D,fc as M,gc as p,hc as s,ia as P,ic as l,id as y,jc as _,jd as v,mb as m,na as d,qc as G,t as R,va as N,vc as I,vd as F,wa as E,wd as b,xc as a}from"./chunk-UL2ZUNXQ.js";import"./chunk-WFMAM73Y.js";import"./chunk-7KVKRA5M.js";var K=(function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e})(K||{});var it=(function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e})(it||{});var ot=(function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e})(ot||{});var ht=class extends lt{setValue(c,t){if(c instanceof Date){let i=Math.floor(c.getTime()/1e3);super.setValue(i,t)}else super.setValue(c,t)}},Ct=(()=>{class e{constructor(){this.shopeeUploadService=d(ct),this.formBuilder=d(J)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(R(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.map(o=>(i=o?.multi_lang?.find(r=>r.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(r=>(n=r?.multi_lang?.find(g=>g.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(Q.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==K.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new lt(null),value:new lt(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==K.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ot.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new ht(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),r=n.filter(g=>o.findIndex(nt=>parseInt(nt)==g.attribute_id||g.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(t,i){return t.map(o=>{switch(o.attribute_info.input_type){case K.MULTI_COMBO_BOX:C.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(g=>g==r.value_id)!=-1):o.attribute_value_list=[];break;case K.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ot.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(r=>r.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(t,i){let n=[];if(C.IsNotEmpty(t)){let o={value_id:0,original_value_name:JSON.stringify(t)};C.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(t){let i=[];return C.IsNotEmpty(t)&&(i=[{value_id:0,original_value_name:JSON.stringify(t)}]),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();var gt=()=>[];function te(e,c){e&1&&(s(0,"span",4),u(1,"*"),l())}function ee(e,c){if(e&1&&_(0,"ng-select",5),e&2){let t=a().$implicit;p("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(4,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function ie(e,c){if(e&1&&_(0,"input",7),e&2){let t=a(2).$implicit;p("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function oe(e,c){if(e&1&&(s(0,"option",14),u(1),l()),e&2){let t=c.$implicit;p("value",t),m(),et(t)}}function ne(e,c){if(e&1&&(s(0,"div",9),_(1,"input",11),s(2,"select",12)(3,"option",13),u(4,"Unit"),l(),D(5,oe,2,2,"option",14,O),l()()),e&2){let t=a(3).$implicit;p("formGroupName",t.attribute_id),m(),p("placeholder","Isi "+(t==null?null:t.name)),m(2),p("value",null),m(2),M(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function re(e,c){if(e&1&&_(0,"input",10),e&2){let t=a(3).$implicit;p("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ae(e,c){if(e&1&&f(0,ne,7,3,"div",9)(1,re,1,2,"input",10),e&2){let t=a(2).$implicit,i=a(2);h((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function le(e,c){if(e&1&&_(0,"datepicker",8),e&2){let t=a(2).$implicit;p("formControlName",t.attribute_id)}}function ce(e,c){if(e&1&&f(0,ie,1,2,"input",7)(1,ae,2,1)(2,le,1,1,"datepicker",8),e&2){let t,i=a().$implicit,n=a(2);h((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function se(e,c){if(e&1&&_(0,"ng-select",6),e&2){let t=a().$implicit;p("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function me(e,c){if(e&1&&_(0,"ng-select",6),e&2){let t=a().$implicit;p("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function pe(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),f(2,te,2,0,"span",4),s(3,"span"),u(4),l()(),f(5,ee,1,5,"ng-select",5)(6,ce,3,1)(7,se,1,4,"ng-select",6)(8,me,1,4,"ng-select",6),l()),e&2){let t,i=c.$implicit,n=a(2);m(2),h(i.mandatory?2:-1),m(2),q(" ",i==null?null:i.name," "),m(),h((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function de(e,c){if(e&1&&(s(0,"form",0)(1,"div",1),D(2,pe,9,3,"div",2,O),l()()),e&2){let t=a();p("formGroup",t.form),m(2),M(c)}}var Xt=(()=>{class e{constructor(){this.formCategoryService=d(Ct),this.channelType=b(void 0),this.categoryId=b(void 0),this.channelId=b(void 0),this.channelProductUpload=b(void 0),this.attributesChanges=F(),this.inputType=K,this.formatType=it,this.validationType=ot}ngOnChanges(){let t=this.categoryId(),i=this.channelId();C.IsNotEmpty(t)&&C.IsNotEmpty(i)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:t,channelId:i,channelType:this.channelType()}).pipe(A(n=>{this.form=this.formCategoryService.createFormGroup(n),this.listenToFormChange(n)}),B(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[T([Ct]),k],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){if(i&1&&(f(0,de,4,1,"form",0),y(1,"async")),i&2){let o;h((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[L,w,U,W,Mt,Vt,j,Dt,V,z,H,Y,Ot,$t,Ht,Yt,S],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mat-icon-button-state-layer-size: 36px}"],changeDetection:0})}}return e})();var Z=(function(e){return e.TIKTOK_SHOP="TIKTOK_SHOP",e.TOKOPEDIA="TOKOPEDIA",e})(Z||{});var bt=(()=>{class e{constructor(){this.httpService=d(rt),this.formBuilder=d(J),this.uploadProductService=d(pt)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(St(o=>this.uploadProductService.selectedProduct$.pipe(R(r=>(o=this.mappingAttributeSalesProperty(o,r),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(Q.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i.addControl("listingPlatform",this.formBuilder.control([Z.TIKTOK_SHOP,Z.TOKOPEDIA],[Q.required])),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),r=n.filter(g=>o.findIndex(nt=>parseInt(nt)==g.id)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(t,i){return t.map(o=>(C.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(r=>i[o.id]?.includes(r.id)):o.values=o.values.filter(r=>r.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();function ue(e,c){e&1&&(s(0,"small",5),u(1," Platform is required "),l())}function _e(e,c){e&1&&(s(0,"span",5),u(1,"*"),l())}function fe(e,c){if(e&1&&_(0,"ng-select",6),e&2){let t=a().$implicit;p("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function he(e,c){if(e&1&&_(0,"ng-select",7),e&2){let t=a().$implicit;p("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&_(0,"input",8),e&2){let t=a().$implicit;p("formControlName",t.id)("placeholder",t==null?null:t.name)}}function ge(e,c){if(e&1&&(s(0,"small",5),u(1),l()),e&2){let t=a().$implicit;m(),q(" ",t==null?null:t.name," is mandatory ")}}function be(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),f(2,_e,2,0,"span",5),s(3,"span"),u(4),l()(),f(5,fe,1,4,"ng-select",6)(6,he,1,3,"ng-select",7)(7,Ce,1,2,"input",8),f(8,ge,2,1,"small",5),l()),e&2){let t=c.$implicit;m(2),h(t.is_required?2:-1),m(2),q(" ",t==null?null:t.name," "),m(),h(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),m(3),h(t.is_required?8:-1)}}function ye(e,c){if(e&1&&(s(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),u(5," Platform Options"),l()(),_(6,"ng-select",4),f(7,ue,2,0,"small",5),l(),D(8,be,9,4,"div",2,O),l()()),e&2){let t,i=a();p("formGroup",i.form),m(6),p("multiple",!0)("items",i.platformOptions)("clearable",!1),m(),h(!(i.form==null||(t=i.form.get("listingPlatform").errors)==null)&&t.required?7:-1),m(),M(c)}}var Kt=(()=>{class e{constructor(){this.tiktokAttributeFormService=d(bt),this.channelId=b(void 0),this.categoryId=b(void 0),this.platformChange=F({alias:"onPlatformChanges"}),this.formSubscription=new Tt,this.attributesChanges=F(),this.platformOptions=[{label:"TikTok Shop",value:Z.TIKTOK_SHOP},{label:"Tokopedia",value:Z.TOKOPEDIA}]}ngOnChanges(){let t=this.categoryId(),i=this.channelId();C.IsNotEmpty(t)&&C.IsNotEmpty(i)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(i,t).pipe(R(n=>n.filter(o=>!(o.type=="PRODUCT_PROPERTY"&&(C.IsEmpty(o.values)||o.values?.length==0)&&o.is_customizable==!1))),A(n=>{this.form=this.tiktokAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),B(1)))}listenToFormChange(t){let i=[];this.form.valueChanges.pipe(_t(this.formSubscription)).subscribe(n=>{delete n.listingPlatform,i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)}),this.form.get("listingPlatform").valueChanges.pipe(Ft(this.form.get("listingPlatform").value),_t(this.formSubscription)).subscribe(n=>{this.platformChange.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[T([bt]),k],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){if(i&1&&(f(0,ye,10,5,"form",0),y(1,"async")),i&2){let o;h((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[L,w,U,W,j,V,z,H,Y,X,S],encapsulation:2,changeDetection:0})}}return e})();var yt=(()=>{class e{constructor(){this.formBuilder=d(J),this.lazadaUploadProductService=d(st)}getAttributes(t,i){return this.lazadaUploadProductService.getAttributes(t,i)}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_mandatory==1&&n.push(Q.required),i.addControl(String(o.id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),r=n.filter(g=>o.findIndex(nt=>Number(nt)==g.id)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(t,i){return t.map(o=>{if(o.options&&o.options.length>0){let r=o.options.filter(g=>Array.isArray(i[String(o.id)])?i[String(o.id)]?.includes(g.id):g.id==i[String(o.id)]);o.options=r}else i[String(o.id)]&&(o.options=[{id:null,name:i[String(o.id)]}]);return o}).filter(o=>o?.options?.length>0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();function ve(e,c){e&1&&(s(0,"span",4),u(1,"*"),l())}function xe(e,c){if(e&1&&_(0,"ng-select",5),e&2){let t=a().$implicit;p("formControlName",t.id)("items",t.options)("placeholder","Pilih "+(t.label||t.name))}}function Te(e,c){if(e&1&&_(0,"input",6),e&2){let t=a().$implicit;p("formControlName",t.id)("placeholder",t.label||t.name)}}function Se(e,c){if(e&1&&(s(0,"small",4),u(1),l()),e&2){let t=a().$implicit;m(),q(" ",t.label||t.name," is mandatory ")}}function Ie(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),f(2,ve,2,0,"span",4),s(3,"span"),u(4),l()(),f(5,xe,1,3,"ng-select",5)(6,Te,1,2,"input",6),f(7,Se,2,1,"small",4),l()),e&2){let t=c.$implicit;m(2),h(t.is_mandatory==1?2:-1),m(2),et(t.label||t.name),m(),h((t.options==null?null:t.options.length)>0?5:6),m(2),h(t.is_mandatory==1?7:-1)}}function Fe(e,c){if(e&1&&(s(0,"form",0)(1,"div",1),D(2,Ie,8,4,"div",2,O),l()()),e&2){let t=a();p("formGroup",t.form),m(2),M(c)}}var qt=(()=>{class e{constructor(){this.lazadaAttributeFormService=d(yt),this.channelId=b(void 0),this.categoryId=b(void 0),this.attributesChanges=F()}ngOnChanges(){let t=this.categoryId(),i=this.channelId();C.IsNotEmpty(t)&&C.IsNotEmpty(i)&&(this.attributes$=this.lazadaAttributeFormService.getAttributes(i,t).pipe(A(n=>{this.form=this.lazadaAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),B(1)))}listenToFormChange(t){this.form.valueChanges.subscribe(i=>{let n=this.lazadaAttributeFormService.getFilteredAttributes(t,i);this.attributesChanges.emit(n)})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["lazada-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[T([yt]),k],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){if(i&1&&(f(0,Fe,4,1,"form",0),y(1,"async")),i&2){let o;h((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[L,w,U,W,j,V,z,H,Y,X,S],encapsulation:2,changeDetection:0})}}return e})();var vt=(()=>{class e{constructor(){this.woocommerceUploadService=d(mt)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(R(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();var Qt=(()=>{class e{constructor(){this.wooAttributeFormService=d(vt),this.channelId=b(),this.categoryId=b(),this.attributesChanges=F()}ngOnChanges(){C.IsNotEmpty(this.categoryId())&&C.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[T([vt]),k],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),u(3,"Atribut"),l(),s(4,"ng-select",3),y(5,"async"),I("change",function(r){return n.onSelectAttribute(r)}),l()()()),i&2&&(m(4),p("items",v(5,1,n.attributes$)))},dependencies:[X,L,w,U,S],encapsulation:2,changeDetection:0})}}return e})();var xt=(()=>{class e{constructor(){this.httpService=d(rt),this.formBuilder=d(J)}getAttributes(t){return this.httpService.get("api/product/ShopifyV2/GetAttributes",[{key:"ID",value:t}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();function Ae(e,c){if(e&1&&(s(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),u(4," Brand "),l(),_(5,"input",4),l(),s(6,"div",5)(7,"div",3),u(8," Product Type "),l(),_(9,"input",6),l(),s(10,"div",5)(11,"div",3),u(12," Status "),l(),_(13,"ng-select",7),l()()()),e&2){let t=a();p("formGroup",t.form),m(13),p("items",c.Options.StatusOptions)}}var Zt=(()=>{class e{constructor(){this.channelId=b(void 0),this.attributesChanges=F(),this.shopifyFormService=d(xt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(A(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(It(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[T([xt]),k],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){if(i&1&&(f(0,Ae,14,2,"form",0),y(1,"async")),i&2){let o;h((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[U,W,j,V,z,H,Y,L,w,S],encapsulation:2,changeDetection:0})}}return e})();function Pe(e,c){if(e&1&&(s(0,"div",6),_(1,"app-product-card",9),l()),e&2){let t=c.$implicit;m(),p("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Ne(e,c){if(e&1){let t=G();s(0,"mat-checkbox",21),Nt("ngModelChange",function(n){N(t);let o=a().$implicit;return Pt(o.selected,n)||(o.selected=n),E(n)}),I("ngModelChange",function(){let n=N(t),o=a(),r=o.$implicit,g=o.$index,tt=a();return E(tt.onSelectChannel(r,g,n))}),l()}if(e&2){let t=a().$implicit;At("ngModel",t.selected)}}function Ee(e,c){if(e&1&&(s(0,"div",18),_(1,"input",22),l()),e&2){let t=a().$implicit,i=a();p("matTooltip",t.type==i.channelType.Shopify||t.type==i.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function ke(e,c){if(e&1){let t=G();s(0,"app-channel-category-select",23),I("selectedCategory",function(n){N(t);let o=a().$index,r=a();return E(r.onCategoryChange(o,n))}),l()}if(e&2){let t=a().$implicit;p("disabled",!t.selected)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Oe(e,c){if(e&1){let t=G();s(0,"shopee-attribute-form",27),I("attributesChanges",function(n){N(t);let o=a(2).$index,r=a();return E(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function De(e,c){if(e&1){let t=G();s(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){N(t);let o=a(2).$index,r=a();return E(r.onAttributesChange(o,n))})("onPlatformChanges",function(n){N(t);let o=a(2).$index,r=a();return E(r.onPlatformChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function Me(e,c){if(e&1){let t=G();s(0,"wooocommerce-attribute-form",29),I("attributesChanges",function(n){N(t);let o=a(2).$index,r=a();return E(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function Ve(e,c){if(e&1){let t=G();s(0,"lazada-attribute-form",29),I("attributesChanges",function(n){N(t);let o=a(2).$index,r=a();return E(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function Ue(e,c){if(e&1&&(s(0,"div",20)(1,"div",24),f(2,Oe,1,3,"shopee-attribute-form",25)(3,De,1,2,"tiktok-attribute-form",26)(4,Me,1,2,"wooocommerce-attribute-form",26)(5,Ve,1,2,"lazada-attribute-form",26),l()()),e&2){let t,i=a().$implicit,n=a();m(2),h((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Lazada?5:-1)}}function we(e,c){if(e&1){let t=G();s(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),I("attributesChanges",function(n){N(t);let o=a().$index,r=a();return E(r.onAttributesChange(o,n))}),l()()()}if(e&2){let t=a().$implicit;m(2),p("channelId",t.id)}}function Le(e,c){if(e&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),f(6,Ne,1,1,"mat-checkbox",14),y(7,"async"),l(),s(8,"div"),_(9,"app-channel-logo",15),l(),s(10,"div",16)(11,"span"),u(12),l()()()(),s(13,"div",12)(14,"div",17),f(15,Ee,2,1,"div",18)(16,ke,1,4,"app-channel-category-select",19),l()()(),f(17,Ue,6,1,"div",20)(18,we,3,1,"div",20),l()()),e&2){let t,i=c.$implicit,n=a();m(6),h((t=v(7,8,n.defaultCategories$))?6:-1,t),m(3),p("typeId",i.type)("showChannelName",!1),m(),p("matTooltip",i.name)("matTooltipShowDelay",2500),m(2),et(i.name),m(3),h(i.type==n.channelType.Shopify||i.type==n.channelType.Plugo||i.type==n.channelType.ShopifyV2?15:16),m(2),h(i.categoryId&&i.selected?17:(n.channelType.Shopify==i.type||i.type==n.channelType.ShopifyV2)&&i.selected?18:-1)}}var mn=(()=>{class e{constructor(){this.toastr=d(Et),this.uploadProductService=d(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=ft,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(B(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.categoryId=i,o.attributes=[]),o)))}onPlatformChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.listing_platforms=i),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.attributes=i),o)))}tiktokPlatformChanges(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.listing_platforms=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((r,g)=>{if(g==i&&t.selected){let tt=this.findCategoryByChannelId(t.id,n);r.categoryId=tt?.DefaultCategoryID}return g==i&&!t.selected&&(r.categoryId=null),r}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}onRemoveCategory(t){this.channelProductUploads.update(i=>i.map((n,o)=>(o==t&&(n.categoryId=null,n.attributes=[]),n)))}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(i=>i.type==ft.Tiktok&&C.IsNotEmpty(i?.categoryId)?i.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["app-product-upload"]],features:[T([ct,Rt,st,mt])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],["color","primary",1,"example-margin",3,"ngModel"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),_(3,"i",2),u(4," Upload "),l()(),s(5,"content")(6,"div",3)(7,"h3",4),u(8,"Product To Upload"),l(),s(9,"div",5),D(10,Pe,2,7,"div",6,O),y(12,"async"),l(),s(13,"h3",7),u(14,"Channel To Upload"),l(),D(15,Le,19,10,"div",8,O),l()()()),i&2){let o;p("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),m(8),M(v(12,3,n.selectedProducts$)),m(5),M(n.channelProductUploads())}},dependencies:[Wt,Lt,zt,jt,Gt,X,V,kt,wt,Ut,Kt,Qt,Zt,Bt,Jt,Xt,qt,S],encapsulation:2,changeDetection:0})}}return e})();export{mn as ProductUploadComponent};
|
|
1
|
+
import{a as Jt}from"./chunk-ZLAQX3DO.js";import"./chunk-QZ6ZCOFC.js";import{b as Wt}from"./chunk-KUSSKYYP.js";import{a as jt,b as zt}from"./chunk-QX7XQQ4T.js";import"./chunk-3OJ7ID4M.js";import{a as Gt}from"./chunk-WGEOVL5H.js";import"./chunk-MWWC66IC.js";import"./chunk-752YRTLC.js";import"./chunk-PBNIIZI3.js";import{a as Bt}from"./chunk-4PT2Y3IQ.js";import{a as ct,b as Rt,c as st,d as mt,e as pt}from"./chunk-RPQ6KE7P.js";import"./chunk-FXMJKY2I.js";import"./chunk-S5JNUALT.js";import{a as $t}from"./chunk-CZZ6XOQK.js";import"./chunk-XNM2QAY5.js";import"./chunk-RDMMFHDE.js";import"./chunk-EUPJPCMA.js";import"./chunk-P23WQYF4.js";import"./chunk-S52ABRV5.js";import"./chunk-BVN6SNGQ.js";import"./chunk-R4AQOQYM.js";import"./chunk-7WNEJX5C.js";import"./chunk-OF3KLUMM.js";import"./chunk-LGOZQVMY.js";import"./chunk-WM53FF34.js";import{d as w,e as L}from"./chunk-EHE35Y2Y.js";import{b as Lt}from"./chunk-PHOKCO5Q.js";import"./chunk-A7GSUUCG.js";import"./chunk-EJRNWPPD.js";import{a as wt}from"./chunk-RPUNCPRY.js";import{b as Yt,c as Ht}from"./chunk-67YZKJCR.js";import"./chunk-7AXL27HI.js";import"./chunk-CN3FR2GN.js";import"./chunk-GGAT6SSK.js";import"./chunk-5LT2EUGJ.js";import"./chunk-ALU2M2OP.js";import"./chunk-6IK2SMV2.js";import"./chunk-RP34WI5C.js";import"./chunk-QVFZNJGC.js";import"./chunk-IMETJ3FA.js";import"./chunk-JQDMGUB2.js";import"./chunk-27GIACJC.js";import"./chunk-PNL3GTGS.js";import"./chunk-BHQ7CWDE.js";import"./chunk-DF32ANGX.js";import"./chunk-VZ5IMYAU.js";import"./chunk-ZEX7ZA5M.js";import"./chunk-VK76JOCL.js";import"./chunk-HRSPRUJL.js";import{b as Ut}from"./chunk-W37YHNVN.js";import"./chunk-CSHGL57O.js";import"./chunk-ZSUWHVKX.js";import"./chunk-6MURSHMV.js";import"./chunk-YLGAO33X.js";import"./chunk-QXRG5XYP.js";import"./chunk-OD6Q5ER6.js";import"./chunk-GRKPMAMP.js";import{b as ft,c as C}from"./chunk-NNVT5X6O.js";import{A as U,c as j,e as Q,h as V,i as z,l as lt,m as kt,n as W,q as Ot,r as Y,s as H,t as Dt,u as Mt,v as Vt,y as J,z as X}from"./chunk-J5MD62BS.js";import"./chunk-OTGSPSYP.js";import"./chunk-CL2QGEN4.js";import{b as Et,e as rt}from"./chunk-KVPTGBX3.js";import"./chunk-2P7JU6NZ.js";import{v as S}from"./chunk-ET5KHOIM.js";import"./chunk-ASFPLYOZ.js";import{$b as f,Eb as x,I as St,K as It,Ma as k,Mc as u,Nc as et,Oc as q,Qc as At,Rc as Pt,Sc as Nt,V as B,X as Ft,Zc as T,_ as _t,_c as at,aa as A,bc as h,cc as O,d as Tt,ec as D,fc as M,gc as p,hc as s,ia as P,ic as l,id as y,jc as _,jd as v,mb as m,na as d,qc as G,t as R,va as N,vc as I,vd as F,wa as E,wd as b,xc as a}from"./chunk-UL2ZUNXQ.js";import"./chunk-WFMAM73Y.js";import"./chunk-7KVKRA5M.js";var K=(function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e})(K||{});var it=(function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e})(it||{});var ot=(function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e})(ot||{});var ht=class extends lt{setValue(c,t){if(c instanceof Date){let i=Math.floor(c.getTime()/1e3);super.setValue(i,t)}else super.setValue(c,t)}},Ct=(()=>{class e{constructor(){this.shopeeUploadService=d(ct),this.formBuilder=d(J)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(R(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.map(o=>(i=o?.multi_lang?.find(r=>r.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(r=>(n=r?.multi_lang?.find(g=>g.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(Q.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==K.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new lt(null),value:new lt(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==K.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ot.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new ht(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),r=n.filter(g=>o.findIndex(nt=>parseInt(nt)==g.attribute_id||g.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(t,i){return t.map(o=>{switch(o.attribute_info.input_type){case K.MULTI_COMBO_BOX:C.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(g=>g==r.value_id)!=-1):o.attribute_value_list=[];break;case K.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ot.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(r=>r.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(t,i){let n=[];if(C.IsNotEmpty(t)){let o={value_id:0,original_value_name:JSON.stringify(t)};C.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(t){let i=[];return C.IsNotEmpty(t)&&(i=[{value_id:0,original_value_name:JSON.stringify(t)}]),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();var gt=()=>[];function te(e,c){e&1&&(s(0,"span",4),u(1,"*"),l())}function ee(e,c){if(e&1&&_(0,"ng-select",5),e&2){let t=a().$implicit;p("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(4,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function ie(e,c){if(e&1&&_(0,"input",7),e&2){let t=a(2).$implicit;p("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function oe(e,c){if(e&1&&(s(0,"option",14),u(1),l()),e&2){let t=c.$implicit;p("value",t),m(),et(t)}}function ne(e,c){if(e&1&&(s(0,"div",9),_(1,"input",11),s(2,"select",12)(3,"option",13),u(4,"Unit"),l(),D(5,oe,2,2,"option",14,O),l()()),e&2){let t=a(3).$implicit;p("formGroupName",t.attribute_id),m(),p("placeholder","Isi "+(t==null?null:t.name)),m(2),p("value",null),m(2),M(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function re(e,c){if(e&1&&_(0,"input",10),e&2){let t=a(3).$implicit;p("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ae(e,c){if(e&1&&f(0,ne,7,3,"div",9)(1,re,1,2,"input",10),e&2){let t=a(2).$implicit,i=a(2);h((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function le(e,c){if(e&1&&_(0,"datepicker",8),e&2){let t=a(2).$implicit;p("formControlName",t.attribute_id)}}function ce(e,c){if(e&1&&f(0,ie,1,2,"input",7)(1,ae,2,1)(2,le,1,1,"datepicker",8),e&2){let t,i=a().$implicit,n=a(2);h((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function se(e,c){if(e&1&&_(0,"ng-select",6),e&2){let t=a().$implicit;p("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function me(e,c){if(e&1&&_(0,"ng-select",6),e&2){let t=a().$implicit;p("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function pe(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),f(2,te,2,0,"span",4),s(3,"span"),u(4),l()(),f(5,ee,1,5,"ng-select",5)(6,ce,3,1)(7,se,1,4,"ng-select",6)(8,me,1,4,"ng-select",6),l()),e&2){let t,i=c.$implicit,n=a(2);m(2),h(i.mandatory?2:-1),m(2),q(" ",i==null?null:i.name," "),m(),h((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function de(e,c){if(e&1&&(s(0,"form",0)(1,"div",1),D(2,pe,9,3,"div",2,O),l()()),e&2){let t=a();p("formGroup",t.form),m(2),M(c)}}var Xt=(()=>{class e{constructor(){this.formCategoryService=d(Ct),this.channelType=b(void 0),this.categoryId=b(void 0),this.channelId=b(void 0),this.channelProductUpload=b(void 0),this.attributesChanges=F(),this.inputType=K,this.formatType=it,this.validationType=ot}ngOnChanges(){let t=this.categoryId(),i=this.channelId();C.IsNotEmpty(t)&&C.IsNotEmpty(i)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:t,channelId:i,channelType:this.channelType()}).pipe(A(n=>{this.form=this.formCategoryService.createFormGroup(n),this.listenToFormChange(n)}),B(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[T([Ct]),k],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){if(i&1&&(f(0,de,4,1,"form",0),y(1,"async")),i&2){let o;h((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[L,w,U,W,Mt,Vt,j,Dt,V,z,H,Y,Ot,$t,Ht,Yt,S],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mat-icon-button-state-layer-size: 36px}"],changeDetection:0})}}return e})();var Z=(function(e){return e.TIKTOK_SHOP="TIKTOK_SHOP",e.TOKOPEDIA="TOKOPEDIA",e})(Z||{});var bt=(()=>{class e{constructor(){this.httpService=d(rt),this.formBuilder=d(J),this.uploadProductService=d(pt)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(St(o=>this.uploadProductService.selectedProduct$.pipe(R(r=>(o=this.mappingAttributeSalesProperty(o,r),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(Q.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i.addControl("listingPlatform",this.formBuilder.control([Z.TIKTOK_SHOP,Z.TOKOPEDIA],[Q.required])),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),r=n.filter(g=>o.findIndex(nt=>parseInt(nt)==g.id)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(t,i){return t.map(o=>(C.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(r=>i[o.id]?.includes(r.id)):o.values=o.values.filter(r=>r.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();function ue(e,c){e&1&&(s(0,"small",5),u(1," Platform is required "),l())}function _e(e,c){e&1&&(s(0,"span",5),u(1,"*"),l())}function fe(e,c){if(e&1&&_(0,"ng-select",6),e&2){let t=a().$implicit;p("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function he(e,c){if(e&1&&_(0,"ng-select",7),e&2){let t=a().$implicit;p("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&_(0,"input",8),e&2){let t=a().$implicit;p("formControlName",t.id)("placeholder",t==null?null:t.name)}}function ge(e,c){if(e&1&&(s(0,"small",5),u(1),l()),e&2){let t=a().$implicit;m(),q(" ",t==null?null:t.name," is mandatory ")}}function be(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),f(2,_e,2,0,"span",5),s(3,"span"),u(4),l()(),f(5,fe,1,4,"ng-select",6)(6,he,1,3,"ng-select",7)(7,Ce,1,2,"input",8),f(8,ge,2,1,"small",5),l()),e&2){let t=c.$implicit;m(2),h(t.is_required?2:-1),m(2),q(" ",t==null?null:t.name," "),m(),h(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),m(3),h(t.is_required?8:-1)}}function ye(e,c){if(e&1&&(s(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),u(5," Platform Options"),l()(),_(6,"ng-select",4),f(7,ue,2,0,"small",5),l(),D(8,be,9,4,"div",2,O),l()()),e&2){let t,i=a();p("formGroup",i.form),m(6),p("multiple",!0)("items",i.platformOptions)("clearable",!1),m(),h(!(i.form==null||(t=i.form.get("listingPlatform").errors)==null)&&t.required?7:-1),m(),M(c)}}var Kt=(()=>{class e{constructor(){this.tiktokAttributeFormService=d(bt),this.channelId=b(void 0),this.categoryId=b(void 0),this.platformChange=F({alias:"onPlatformChanges"}),this.formSubscription=new Tt,this.attributesChanges=F(),this.platformOptions=[{label:"TikTok Shop",value:Z.TIKTOK_SHOP},{label:"Tokopedia",value:Z.TOKOPEDIA}]}ngOnChanges(){let t=this.categoryId(),i=this.channelId();C.IsNotEmpty(t)&&C.IsNotEmpty(i)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(i,t).pipe(R(n=>n.filter(o=>!(o.type=="PRODUCT_PROPERTY"&&(C.IsEmpty(o.values)||o.values?.length==0)&&o.is_customizable==!1))),A(n=>{this.form=this.tiktokAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),B(1)))}listenToFormChange(t){let i=[];this.form.valueChanges.pipe(_t(this.formSubscription)).subscribe(n=>{delete n.listingPlatform,i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)}),this.form.get("listingPlatform").valueChanges.pipe(Ft(this.form.get("listingPlatform").value),_t(this.formSubscription)).subscribe(n=>{this.platformChange.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[T([bt]),k],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){if(i&1&&(f(0,ye,10,5,"form",0),y(1,"async")),i&2){let o;h((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[L,w,U,W,j,V,z,H,Y,X,S],encapsulation:2,changeDetection:0})}}return e})();var yt=(()=>{class e{constructor(){this.formBuilder=d(J),this.lazadaUploadProductService=d(st)}getAttributes(t,i){return this.lazadaUploadProductService.getAttributes(t,i)}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_mandatory==1&&n.push(Q.required),i.addControl(String(o.id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),r=n.filter(g=>o.findIndex(nt=>Number(nt)==g.id)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(t,i){return t.map(o=>{if(o.options&&o.options.length>0){let r=o.options.filter(g=>Array.isArray(i[String(o.id)])?i[String(o.id)]?.includes(g.id):g.id==i[String(o.id)]);o.options=r}else i[String(o.id)]&&(o.options=[{id:null,name:i[String(o.id)]}]);return o}).filter(o=>o?.options?.length>0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();function ve(e,c){e&1&&(s(0,"span",4),u(1,"*"),l())}function xe(e,c){if(e&1&&_(0,"ng-select",5),e&2){let t=a().$implicit;p("formControlName",t.id)("items",t.options)("placeholder","Pilih "+(t.label||t.name))}}function Te(e,c){if(e&1&&_(0,"input",6),e&2){let t=a().$implicit;p("formControlName",t.id)("placeholder",t.label||t.name)}}function Se(e,c){if(e&1&&(s(0,"small",4),u(1),l()),e&2){let t=a().$implicit;m(),q(" ",t.label||t.name," is mandatory ")}}function Ie(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),f(2,ve,2,0,"span",4),s(3,"span"),u(4),l()(),f(5,xe,1,3,"ng-select",5)(6,Te,1,2,"input",6),f(7,Se,2,1,"small",4),l()),e&2){let t=c.$implicit;m(2),h(t.is_mandatory==1?2:-1),m(2),et(t.label||t.name),m(),h((t.options==null?null:t.options.length)>0?5:6),m(2),h(t.is_mandatory==1?7:-1)}}function Fe(e,c){if(e&1&&(s(0,"form",0)(1,"div",1),D(2,Ie,8,4,"div",2,O),l()()),e&2){let t=a();p("formGroup",t.form),m(2),M(c)}}var qt=(()=>{class e{constructor(){this.lazadaAttributeFormService=d(yt),this.channelId=b(void 0),this.categoryId=b(void 0),this.attributesChanges=F()}ngOnChanges(){let t=this.categoryId(),i=this.channelId();C.IsNotEmpty(t)&&C.IsNotEmpty(i)&&(this.attributes$=this.lazadaAttributeFormService.getAttributes(i,t).pipe(A(n=>{this.form=this.lazadaAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),B(1)))}listenToFormChange(t){this.form.valueChanges.subscribe(i=>{let n=this.lazadaAttributeFormService.getFilteredAttributes(t,i);this.attributesChanges.emit(n)})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["lazada-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[T([yt]),k],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){if(i&1&&(f(0,Fe,4,1,"form",0),y(1,"async")),i&2){let o;h((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[L,w,U,W,j,V,z,H,Y,X,S],encapsulation:2,changeDetection:0})}}return e})();var vt=(()=>{class e{constructor(){this.woocommerceUploadService=d(mt)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(R(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();var Qt=(()=>{class e{constructor(){this.wooAttributeFormService=d(vt),this.channelId=b(),this.categoryId=b(),this.attributesChanges=F()}ngOnChanges(){C.IsNotEmpty(this.categoryId())&&C.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[T([vt]),k],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),u(3,"Atribut"),l(),s(4,"ng-select",3),y(5,"async"),I("change",function(r){return n.onSelectAttribute(r)}),l()()()),i&2&&(m(4),p("items",v(5,1,n.attributes$)))},dependencies:[X,L,w,U,S],encapsulation:2,changeDetection:0})}}return e})();var xt=(()=>{class e{constructor(){this.httpService=d(rt),this.formBuilder=d(J)}getAttributes(t){return this.httpService.get("api/product/ShopifyV2/GetAttributes",[{key:"ID",value:t}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();function Ae(e,c){if(e&1&&(s(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),u(4," Brand "),l(),_(5,"input",4),l(),s(6,"div",5)(7,"div",3),u(8," Product Type "),l(),_(9,"input",6),l(),s(10,"div",5)(11,"div",3),u(12," Status "),l(),_(13,"ng-select",7),l()()()),e&2){let t=a();p("formGroup",t.form),m(13),p("items",c.Options.StatusOptions)}}var Zt=(()=>{class e{constructor(){this.channelId=b(void 0),this.attributesChanges=F(),this.shopifyFormService=d(xt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(A(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(It(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[T([xt]),k],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){if(i&1&&(f(0,Ae,14,2,"form",0),y(1,"async")),i&2){let o;h((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[U,W,j,V,z,H,Y,L,w,S],encapsulation:2,changeDetection:0})}}return e})();function Pe(e,c){if(e&1&&(s(0,"div",6),_(1,"app-product-card",9),l()),e&2){let t=c.$implicit;m(),p("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Ne(e,c){if(e&1){let t=G();s(0,"mat-checkbox",21),Nt("ngModelChange",function(n){N(t);let o=a().$implicit;return Pt(o.selected,n)||(o.selected=n),E(n)}),I("ngModelChange",function(){let n=N(t),o=a(),r=o.$implicit,g=o.$index,tt=a();return E(tt.onSelectChannel(r,g,n))}),l()}if(e&2){let t=a().$implicit;At("ngModel",t.selected)}}function Ee(e,c){if(e&1&&(s(0,"div",18),_(1,"input",22),l()),e&2){let t=a().$implicit,i=a();p("matTooltip",t.type==i.channelType.Shopify||t.type==i.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function ke(e,c){if(e&1){let t=G();s(0,"app-channel-category-select",23),I("selectedCategory",function(n){N(t);let o=a().$index,r=a();return E(r.onCategoryChange(o,n))}),l()}if(e&2){let t=a().$implicit;p("disabled",!t.selected)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Oe(e,c){if(e&1){let t=G();s(0,"shopee-attribute-form",27),I("attributesChanges",function(n){N(t);let o=a(2).$index,r=a();return E(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function De(e,c){if(e&1){let t=G();s(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){N(t);let o=a(2).$index,r=a();return E(r.onAttributesChange(o,n))})("onPlatformChanges",function(n){N(t);let o=a(2).$index,r=a();return E(r.onPlatformChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function Me(e,c){if(e&1){let t=G();s(0,"wooocommerce-attribute-form",29),I("attributesChanges",function(n){N(t);let o=a(2).$index,r=a();return E(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function Ve(e,c){if(e&1){let t=G();s(0,"lazada-attribute-form",29),I("attributesChanges",function(n){N(t);let o=a(2).$index,r=a();return E(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function Ue(e,c){if(e&1&&(s(0,"div",20)(1,"div",24),f(2,Oe,1,3,"shopee-attribute-form",25)(3,De,1,2,"tiktok-attribute-form",26)(4,Me,1,2,"wooocommerce-attribute-form",26)(5,Ve,1,2,"lazada-attribute-form",26),l()()),e&2){let t,i=a().$implicit,n=a();m(2),h((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Lazada?5:-1)}}function we(e,c){if(e&1){let t=G();s(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),I("attributesChanges",function(n){N(t);let o=a().$index,r=a();return E(r.onAttributesChange(o,n))}),l()()()}if(e&2){let t=a().$implicit;m(2),p("channelId",t.id)}}function Le(e,c){if(e&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),f(6,Ne,1,1,"mat-checkbox",14),y(7,"async"),l(),s(8,"div"),_(9,"app-channel-logo",15),l(),s(10,"div",16)(11,"span"),u(12),l()()()(),s(13,"div",12)(14,"div",17),f(15,Ee,2,1,"div",18)(16,ke,1,4,"app-channel-category-select",19),l()()(),f(17,Ue,6,1,"div",20)(18,we,3,1,"div",20),l()()),e&2){let t,i=c.$implicit,n=a();m(6),h((t=v(7,8,n.defaultCategories$))?6:-1,t),m(3),p("typeId",i.type)("showChannelName",!1),m(),p("matTooltip",i.name)("matTooltipShowDelay",2500),m(2),et(i.name),m(3),h(i.type==n.channelType.Shopify||i.type==n.channelType.Plugo||i.type==n.channelType.ShopifyV2?15:16),m(2),h(i.categoryId&&i.selected?17:(n.channelType.Shopify==i.type||i.type==n.channelType.ShopifyV2)&&i.selected?18:-1)}}var mn=(()=>{class e{constructor(){this.toastr=d(Et),this.uploadProductService=d(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=ft,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(B(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.categoryId=i,o.attributes=[]),o)))}onPlatformChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.listing_platforms=i),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.attributes=i),o)))}tiktokPlatformChanges(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.listing_platforms=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((r,g)=>{if(g==i&&t.selected){let tt=this.findCategoryByChannelId(t.id,n);r.categoryId=tt?.DefaultCategoryID}return g==i&&!t.selected&&(r.categoryId=null),r}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}onRemoveCategory(t){this.channelProductUploads.update(i=>i.map((n,o)=>(o==t&&(n.categoryId=null,n.attributes=[]),n)))}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(i=>i.type==ft.Tiktok&&C.IsNotEmpty(i?.categoryId)?i.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["app-product-upload"]],features:[T([ct,Rt,st,mt])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],["color","primary",1,"example-margin",3,"ngModel"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),_(3,"i",2),u(4," Upload "),l()(),s(5,"content")(6,"div",3)(7,"h3",4),u(8,"Product To Upload"),l(),s(9,"div",5),D(10,Pe,2,7,"div",6,O),y(12,"async"),l(),s(13,"h3",7),u(14,"Channel To Upload"),l(),D(15,Le,19,10,"div",8,O),l()()()),i&2){let o;p("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),m(8),M(v(12,3,n.selectedProducts$)),m(5),M(n.channelProductUploads())}},dependencies:[Wt,Lt,zt,jt,Gt,X,V,kt,wt,Ut,Kt,Qt,Zt,Bt,Jt,Xt,qt,S],encapsulation:2,changeDetection:0})}}return e})();export{mn as ProductUploadComponent};
|