marketplacepos 5.38.4 → 5.39.0
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-2ESOTQPW.js → chunk-2R6AG2TN.js} +1 -1
- package/Marketplace/{chunk-EU6PHSKS.js → chunk-3HNY24KA.js} +1 -1
- package/Marketplace/{chunk-GZIXVRJT.js → chunk-3JAUWUZS.js} +1 -1
- package/Marketplace/chunk-4QTONH3S.js +1 -0
- package/Marketplace/{chunk-U2ZMUFQ6.js → chunk-5NNUNFQO.js} +1 -1
- package/Marketplace/{chunk-3C4M544Q.js → chunk-5PJKMKKR.js} +1 -1
- package/Marketplace/{chunk-GQZES4UF.js → chunk-6ED3HFL7.js} +1 -1
- package/Marketplace/{chunk-UIM3W5B7.js → chunk-6ZH6QZJ7.js} +1 -1
- package/Marketplace/chunk-77UUIQNO.js +1 -0
- package/Marketplace/{chunk-TZXF4K2V.js → chunk-AMXLXRQK.js} +1 -1
- package/Marketplace/{chunk-54RFAHSK.js → chunk-B46JIPFY.js} +1 -1
- package/Marketplace/{chunk-ITTRZMEX.js → chunk-BIQHA7UA.js} +1 -1
- package/Marketplace/{chunk-7AVVOGZA.js → chunk-BQNAQJC7.js} +1 -1
- package/Marketplace/{chunk-ZGL7PBN6.js → chunk-BT7A2SMC.js} +2 -2
- package/Marketplace/{chunk-QRJDRFNS.js → chunk-COASPFAK.js} +1 -1
- package/Marketplace/{chunk-DYBAGP7P.js → chunk-CVD4FTNV.js} +1 -1
- package/Marketplace/{chunk-JTZJTXCN.js → chunk-DI4V7KMK.js} +1 -1
- package/Marketplace/chunk-DVOBTXAG.js +1 -0
- package/Marketplace/{chunk-SA573BZL.js → chunk-DXZ6MABM.js} +1 -1
- package/Marketplace/{chunk-PZTMYAA7.js → chunk-DZ2EE5MV.js} +1 -1
- package/Marketplace/{chunk-CZWNWUW2.js → chunk-FPN6SADB.js} +1 -1
- package/Marketplace/{chunk-E6HA2AGS.js → chunk-GBXNTL4E.js} +1 -1
- package/Marketplace/{chunk-XFCMKJV6.js → chunk-HKYVBAMV.js} +1 -1
- package/Marketplace/{chunk-WCAHHXUG.js → chunk-I47XS4UX.js} +1 -1
- package/Marketplace/{chunk-G35YVLFO.js → chunk-IJISBCWA.js} +1 -1
- package/Marketplace/{chunk-LMYPSQJN.js → chunk-IYWXW25F.js} +1 -1
- package/Marketplace/{chunk-HQL6WPF6.js → chunk-JCXJTUHA.js} +1 -1
- package/Marketplace/{chunk-T3VPBK5Q.js → chunk-LF7VSVHW.js} +1 -1
- package/Marketplace/{chunk-4RXCRDWF.js → chunk-LFMXHJYP.js} +1 -1
- package/Marketplace/{chunk-YCXXSKHC.js → chunk-LVIS3W6J.js} +1 -1
- package/Marketplace/{chunk-5X6GYYIM.js → chunk-M6FBD36V.js} +1 -1
- package/Marketplace/{chunk-YSHR4I3P.js → chunk-MOB6IFKN.js} +1 -1
- package/Marketplace/{chunk-EOPCFNMW.js → chunk-N7MU7WUP.js} +1 -1
- package/Marketplace/{chunk-HTVSJFUP.js → chunk-NG547COR.js} +1 -1
- package/Marketplace/{chunk-2OL4XZXJ.js → chunk-QR5SOM5D.js} +1 -1
- package/Marketplace/{chunk-XDUYDX35.js → chunk-QSXSGKOB.js} +1 -1
- package/Marketplace/{chunk-TTKPJA6M.js → chunk-SYOKYZLY.js} +1 -1
- package/Marketplace/{chunk-3LQNSF7T.js → chunk-TGOIGCN3.js} +1 -1
- package/Marketplace/{chunk-JYLQJCDT.js → chunk-TI5WNVPB.js} +1 -1
- package/Marketplace/{chunk-SVCUTNSP.js → chunk-TPZEWOIR.js} +2 -2
- package/Marketplace/{chunk-LQQ67QXG.js → chunk-TVH232DW.js} +2 -2
- package/Marketplace/{chunk-2JKSMF3I.js → chunk-VZWPT6DU.js} +1 -1
- package/Marketplace/{chunk-EA52MAWA.js → chunk-WM2EYHMP.js} +1 -1
- package/Marketplace/{chunk-OAS72QB2.js → chunk-YR2WEZDG.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-DFBPCCHZ.js → main-JQIG3S6Q.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-662ELWF5.js +0 -1
- package/Marketplace/chunk-BXKAE7Z3.js +0 -1
- package/Marketplace/chunk-KZTPUAO4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as f}from"./chunk-OE2JYQHN.js";import{a as i}from"./chunk-
|
|
1
|
+
import{a as h,b as f}from"./chunk-OE2JYQHN.js";import{a as i}from"./chunk-BQNAQJC7.js";import"./chunk-QSXSGKOB.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-PXB4YEY3.js";import{F as C,J as n,n as o}from"./chunk-GPEVUTDI.js";import{Eb as l,Fb as c,Wb as s,gc as u,hc as d,ic as r,ka as p,qb as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var v=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({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,P){t&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),d()()(),r(4,"router-outlet")),t&2&&(m(3),s("Tabs",P.priceTabs))},dependencies:[o,f,h,n,C],encapsulation:2})}}return e})();var M=[{path:"",component:v,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-M6FBD36V.js").then(e=>e.PricePosChannelComponent)},canActivate:[i],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-QR5SOM5D.js").then(e=>e.CustomChannelPriceComponent)},canActivate:[i],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-B46JIPFY.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[i],data:{title:"Price Single Channel Comparison"}}]}],j=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=c({type:e})}static{this.\u0275inj=p({imports:[o,n.forChild(M)]})}}return e})();export{j as PriceRoutingModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-
|
|
1
|
+
import{a as F}from"./chunk-6ED3HFL7.js";import{a as _t}from"./chunk-7KG3DC5J.js";import{a as k}from"./chunk-4ASUM4N5.js";import{a as dt,b as st,d as ft,e as ut}from"./chunk-6IAGGRZN.js";import{j as pt}from"./chunk-QSXSGKOB.js";import{e as ct}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import{l as B,m as gt}from"./chunk-BIQHA7UA.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{h as at,m as rt,y as lt}from"./chunk-DPLEMBB4.js";import{c as mt}from"./chunk-PXB4YEY3.js";import{E as ot,H as L,J as R,d as it,f as nt,g as D,j as M,k as T,m as w,n as P}from"./chunk-GPEVUTDI.js";import{$c as C,Dc as J,Eb as N,Ec as a,Fb as b,Fc as p,Gc as S,Ic as K,Jc as Q,Kb as f,Kc as X,Pc as Y,Qc as Z,Rc as tt,Wb as m,Z as O,Zc as d,_c as h,aa as z,ad as et,ca as q,f as A,gc as o,hc as n,ic as E,jc as u,ka as x,kc as g,mc as W,nb as U,ob as j,qb as r,rc as H,sc as s,v,vc as G,wb as _,ya as I,za as y}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var bt=(e,c)=>({"bg-gradient-danger":e,"bg-gradient-warning":c}),Et=()=>["/menu/notification/detail"],Dt=e=>({ID:e});function Mt(e,c){if(e&1&&(o(0,"span",14),E(1,"img",15),n(),a(2)),e&2){let t=c.item;r(),m("src",t.Img,j)("alt",t.Name),r(),S(" ",t.Name," ")}}function Tt(e,c){if(e&1&&(u(0),a(1),d(2,"number"),o(3,"span"),a(4,"s"),n(),g()),e&2){let t=s().$implicit;r(),S(" ",C(2,1,t.DurationInSecond,"1.1-1")," ")}}function wt(e,c){e&1&&a(0," - ")}function Pt(e,c){if(e&1&&(u(0),o(1,"tr",16)(2,"td")(3,"a",17),E(4,"img",18),o(5,"span"),a(6),n()()(),o(7,"td")(8,"b"),a(9),n(),E(10,"div",19),n(),o(11,"td"),f(12,Tt,5,4,"ng-container",20)(13,wt,1,0,"ng-template",null,0,et),n(),o(15,"td"),a(16),n(),o(17,"td"),a(18),d(19,"date"),n()(),g()),e&2){let t=c.$implicit,i=J(14);r(),m("ngClass",tt(14,bt,t.Status==1,t.Status==0)),r(2),m("routerLink",Y(17,Et))("queryParams",Z(18,Dt,t.ID)),r(),G("src",t.Img,j),r(2),p(t.Name),r(3),p(t.Label),r(),m("innerHTML",t.Message,U),r(2),m("ngIf",t.DurationInSecond)("ngIfElse",i),r(4),p(t.StatusLabel),r(2),p(C(19,11,t.Created,"dd MMM yyyy HH:mm"))}}function Lt(e,c){if(e&1){let t=W();u(0),o(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),d(4,"async"),d(5,"async"),H("total",function(){I(t);let l=s(2);return y(l.getRowCount())})("next",function(){I(t);let l=s(2);return y(l.getNotifications())})("previous",function(){I(t);let l=s(2);return y(l.getNotifications())}),n()()(),g()}if(e&2){let t=s().ngIf,i=s();r(3),m("filter",i.filter)("totaldata",t==null?null:t.length)("paginationTotal",h(4,4,i.rowCount$))("hasClicked",h(5,6,i.rowCount$))}}function Rt(e,c){if(e&1&&(u(0),f(1,Lt,6,8,"ng-container",13),g()),e&2){let t=c.ngIf;r(),m("ngIf",t.length>0)}}var ht=(()=>{class e{constructor(t,i,l){this.http=t,this.notificationService=i,this.authService=l,this.filter=new _t,this.destroy$=new A,this.channelOptions=l.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(q(this.destroy$)).subscribe(t=>{t.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(t=>{this.filter=t.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let t={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",t).pipe(v(i=>i.Data),v(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),O(1))}setTimeToSecond(t){return t=t.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),t}setChannelLogoToNotifications(t){return t=t.map(i=>(i.Img=mt.getChannelLogoByTypeId(i.TypeID),i)),t}getRowCount(){let t={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",t).pipe(v(i=>i.Count),O(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||e)(_(ct),_(F),_(pt))}}static{this.\u0275cmp=N({type:e,selectors:[["app-notification"]],standalone:!1,decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,l){i&1&&(o(0,"mainpanel",1),H("onSubmit",function(){return l.onFilter()}),o(1,"filters")(2,"div")(3,"h6",2),a(4,"Channel"),n(),o(5,"ng-select",3),X("ngModelChange",function($){return Q(l.filter.ChannelID,$)||(l.filter.ChannelID=$),$}),f(6,Mt,3,3,"ng-template",4),n()()(),o(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),a(16,"Channel"),n(),o(17,"th"),a(18,"Process"),n(),o(19,"th"),a(20,"Duration"),n(),o(21,"th"),a(22,"Status"),n(),o(23,"th"),a(24,"Created"),n()()(),o(25,"tbody"),f(26,Pt,20,20,"ng-container",12),d(27,"async"),n()()()()(),f(28,Rt,2,1,"ng-container",13),d(29,"async"),n()()()),i&2&&(r(5),m("clearable",!0)("items",l.channelOptions),K("ngModel",l.filter.ChannelID),r(21),m("ngForOf",h(27,5,l.notifications$)),r(2),m("ngIf",h(29,7,l.notifications$)))},dependencies:[it,nt,D,ft,dt,st,at,rt,B,L,k,M,w,T],encapsulation:2})}}return e})();function Ft(e,c){if(e&1&&(o(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),a(4,"Perflog"),n()(),o(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),a(9),n()()()()()()),e&2){let t=s().ngIf;r(9),p(t.Perflog)}}function Bt(e,c){if(e&1&&(u(0),o(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),a(5,"StackTrace"),n()(),o(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),a(10),n()()()()()(),g()),e&2){let t=s().ngIf;r(10),p(t==null?null:t.StackTrace)}}function kt(e,c){if(e&1&&(u(0),o(1,"mainpanel",1)(2,"actions")(3,"a",2),a(4,"Back"),n()(),o(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),a(12,"General"),n()(),o(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),a(18,"Created Date"),n(),o(19,"div")(20,"span"),a(21),d(22,"date"),n()()()(),o(23,"div",10)(24,"div",11)(25,"label"),a(26,"Status"),n(),o(27,"div")(28,"span"),a(29),n()()()()(),o(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),a(34,"Duration"),n(),o(35,"div")(36,"span"),a(37),d(38,"number"),n()()()(),o(39,"div",10)(40,"div",11)(41,"label"),a(42,"Label"),n(),o(43,"div")(44,"span"),a(45),n()()()()()()()()(),o(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),a(51,"Message"),n()(),o(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),a(56),n()()()()()(),f(57,Ft,10,1,"div",16)(58,Bt,11,1,"ng-container",0),n()()()(),g()),e&2){let t=c.ngIf;r(),m("headerTitle","Notification "+t.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),r(20),p(C(22,10,t.Created,"dd MMM yyyy HH:mm:ss")),r(8),p(t.StatusLabel),r(8),S("",C(38,13,t.DurationInSecond,"1.1-1")," s"),r(8),p(t.Label),r(11),p(t.Message),r(),m("ngIf",t==null?null:t.Perflog),r(),m("ngIf",t==null?null:t.StackTrace)}}var vt=(()=>{class e{constructor(t,i){this.activatedRoute=t,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(z(t=>{let i=t.ID;return this.notificationService.getNotificationDetail(i).pipe(v(l=>(l.DurationInSecond=parseInt(l.Duration)/1e3,l)))}))}static{this.\u0275fac=function(i){return new(i||e)(_(ot),_(F))}}static{this.\u0275cmp=N({type:e,selectors:[["app-detail"]],standalone:!1,decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,l){i&1&&(f(0,kt,59,16,"ng-container",0),d(1,"async")),i&2&&m("ngIf",h(1,1,l.notification$))},dependencies:[D,B,L,M,w,T],encapsulation:2})}}return e})();var $t=[{path:"",component:ht},{path:"detail",component:vt}],Ct=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=x({imports:[P,R.forChild($t)]})}}return e})();var de=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=x({imports:[P,Ct,ut,lt,gt,R,k]})}}return e})();export{de as NotificationModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ce}from"./chunk-H55YXRO5.js";import"./chunk-7477X7LJ.js";import{a as le}from"./chunk-
|
|
1
|
+
import{a as ce}from"./chunk-H55YXRO5.js";import"./chunk-7477X7LJ.js";import{a as le}from"./chunk-WM2EYHMP.js";import{a as re}from"./chunk-YR2WEZDG.js";import{a as D}from"./chunk-XHAXYWZ7.js";import{c as se,d as E}from"./chunk-6ZH6QZJ7.js";import"./chunk-BVIRHZTZ.js";import"./chunk-YXFTLQ5M.js";import"./chunk-PXU3DWYL.js";import"./chunk-AL3REAHH.js";import"./chunk-UDOCTVWA.js";import"./chunk-OLSC6KHB.js";import"./chunk-GBD4FIF3.js";import"./chunk-7TWBIV3T.js";import{a as oe}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as M}from"./chunk-QSXSGKOB.js";import{b as Z,e as ee}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as te,k as ne,l as ie,m as ae}from"./chunk-BIQHA7UA.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as J,h as K,m as q,o as X,y as Y}from"./chunk-DPLEMBB4.js";import{c as g}from"./chunk-PXB4YEY3.js";import{g as z,j as $,n as Q}from"./chunk-GPEVUTDI.js";import{Eb as j,Ec as I,G as x,Ic as F,Jc as L,Kb as _,Kc as T,Oc as H,Qa as w,Wb as h,Zc as v,_c as y,ea as B,gc as s,hc as c,ic as A,ja as k,jc as U,kc as G,lc as W,mc as N,pa as S,qb as p,rc as u,sc as m,wb as d,ya as b,za as P}from"./chunk-T5ONJF63.js";import{a as O,b as R}from"./chunk-K2H6WANG.js";var V=(()=>{class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(l=>l.ID==o?.parent?.id),a&&(a=R(O({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(l=>l.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.filter(o=>g.IsNotEmpty(o?.parent?.id)).map(o=>o?.parent?.id).filter((o,l,f)=>f.indexOf(o)===l)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,l,f)=>f.indexOf(o)===l),{locationIds:e,channelIds:a}}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();function he(r,C){if(r&1){let t=N();s(0,"button",15),u("click",function(){b(t);let e=m().ngIf,n=m();return P(n.onUpdateItems(e))}),A(1,"i",16),I(2," Update "),c()}}function de(r,C){if(r&1&&(s(0,"actions")(1,"div",13),_(2,he,3,0,"button",14),c()()),r&2){let t=C.ngIf,i=m();p(2),h("ngIf",i.productService.hasSelectionVariant(t))}}function me(r,C){r&1&&W(0)}function ue(r,C){if(r&1){let t=N();U(0),s(1,"app-table",17),u("onToggle",function(e){b(t);let n=m();return P(n.onShowDifferenceStock(e))})("onSubmit",function(e){b(t);let n=m();return P(n.updateStockByVariant(e))}),c(),G()}if(r&2){let t=C.ngIf,i=m();p(),h("data",t)("channel",i.channels())("showProductToggle",!0)("hiddenIPOSInventory",i.searchFilter.HiddenIPOSInventory)}}var ze=(()=>{class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(E),this.multiChannelService=S(V),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(B(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:D.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>g.isValidGUID(n.id)==!1),e=t.filter(n=>g.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(l=>{l.Channel?.forEach(f=>{n.push({ID:l.ID,Code:l.Code,Inventory:l.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(l=>l.selected).map(l=>l.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(l=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=D.DIFFERENCE:this.searchFilter.filterModel=D.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(re,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(x(n=>g.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}static{this.\u0275fac=function(i){return new(i||r)(d(ee),d(Z),d(te),d(oe),d(M),d(ne))}}static{this.\u0275cmp=j({type:r,selectors:[["app-multi-channel-comparison"]],features:[H([E,V])],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(s(0,"mainpanel",0),u("onSubmit",function(a){return e.onSearch(a)}),_(1,de,3,1,"actions",1),v(2,"async"),s(3,"filters"),_(4,me,1,0,"ng-container",1),v(5,"async"),s(6,"div")(7,"label",2),I(8,"Channel"),c(),s(9,"multiwarehouse-tree-select",3),u("onChannelChange",function(a){return e.onChannelChange(a)}),c()(),s(10,"div",4)(11,"label",5),I(12,"PageNumber"),c(),s(13,"input",6),T("ngModelChange",function(a){return L(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),c()(),s(14,"div",4)(15,"label",7),I(16,"Page Size"),c(),s(17,"input",8),T("ngModelChange",function(a){return L(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),c()()(),s(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),_(22,ue,2,4,"ng-container",1),v(23,"async"),s(24,"infinite-paginator",12),v(25,"async"),u("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),c()()()()()()),i&2&&(h("pageData",e.pageData)("hideSearchBox",!1),p(),h("ngIf",y(2,14,e.paginationService.data$)),p(3),h("ngIf",y(5,16,e.loader$)),p(5),h("multiple",!0),p(4),F("ngModel",e.searchFilter.PageNumber),p(4),F("ngModel",e.searchFilter.RowCount),p(5),h("ngIf",y(23,18,e.paginationService.data$)),p(2),h("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[Q,z,$,ae,ie,le,Y,J,X,K,q,se,ce],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{ze as MultiChannelComparison};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as N,b as Ot,c as Se}from"./chunk-77UUIQNO.js";import"./chunk-TI5WNVPB.js";import"./chunk-MS4AQ6UA.js";import{a as j}from"./chunk-ZD5LURJS.js";import{a as fe}from"./chunk-PPDHTO44.js";import{a as Y}from"./chunk-7KG3DC5J.js";import{b as Ce}from"./chunk-TGOIGCN3.js";import"./chunk-YXFTLQ5M.js";import{a as ee,b as ne}from"./chunk-OE2JYQHN.js";import{e as rt}from"./chunk-5NNUNFQO.js";import{a as ve}from"./chunk-LLZSSV5A.js";import{i as me,j as ue,k as he,l as _e,m as ge}from"./chunk-CRC6ZWYT.js";import"./chunk-CLKCSTGQ.js";import"./chunk-7TWBIV3T.js";import{a as B}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as Tt}from"./chunk-J3P46Z53.js";import{a as J}from"./chunk-4ASUM4N5.js";import{b as xe}from"./chunk-CVQMAWML.js";import{a as se,b as pe}from"./chunk-LEHTNMIE.js";import{a as ie,b as oe,c as re}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as X}from"./chunk-BQNAQJC7.js";import{a as Z}from"./chunk-62PFQNHJ.js";import{c as ce}from"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import{a as de}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import{a as le}from"./chunk-RIHLYYZU.js";import{f as ae}from"./chunk-Q2OEJFVT.js";import{a as ot,b as wt,d as H,e as Yt}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as L}from"./chunk-QSXSGKOB.js";import{b as G,e as W}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{b as Zt,c as qt,d as K,h as Dt,i as Qt,j as Xt,l as R,m as te}from"./chunk-BIQHA7UA.js";import{r as yt,s as Mt}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as Ht,c as it,h as A,m as U,y as It}from"./chunk-DPLEMBB4.js";import{b as z,c as C}from"./chunk-PXB4YEY3.js";import{E as Pt,F as Jt,G as nt,H as bt,J as zt,f as E,g as V,j as St,k as Kt,m as xt,n as vt}from"./chunk-GPEVUTDI.js";import{$c as Wt,Dc as $,Eb as M,Ec as d,Fb as Gt,Fc as tt,G as w,Gc as b,Ic as D,Jc as O,Kb as S,Kc as T,Pc as Q,Qa as At,Qc as st,Wb as c,Zc as F,_c as k,aa as Ct,ad as et,bc as ft,ca as kt,ea as jt,f as Rt,gc as o,hc as r,ic as _,jc as v,ka as $t,kc as P,mc as x,ob as y,pa as Vt,qb as a,rc as g,sc as s,v as Bt,wb as f,ya as m,za as u}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var Ne=()=>["/menu/products/download/by-url"],Pe=(()=>{class i{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-status"]],standalone:!1,decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){n&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),_(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),_(7,"i",5),r(),o(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),r()()()()()(),_(12,"router-outlet")),n&2&&(a(3),c("Tabs",e.productTabs),a(7),c("routerLink",Q(2,Ne)))},dependencies:[ee,Jt,bt],encapsulation:2})}}return i})();function ke(i,p){if(i&1&&(o(0,"mat-option",6)(1,"div"),_(2,"img",7),o(3,"span"),d(4),r()()()),i&2){let t=p.$implicit;c("value",t.ChannelID),a(2),c("src",t.logo,y),a(2),tt(t.Title)}}var lt=(()=>{class i{constructor(){this.dialogRef=Vt(Zt),this.channels=Vt(qt),this.channelIds=At([]),this.channelOptions=At([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((n,e,l)=>l.findIndex(h=>h.ChannelID===n.ChannelID)===e);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new Qt,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(n=>this.channelIds().includes(n.ChannelID)).map(n=>({ChannelID:n.ChannelID,ChannelItemID:n.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-modal-detach-product"]],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(n,e){n&1&&(o(0,"modal-material",0),g("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),r(),o(5,"mat-form-field",3)(6,"mat-select",4),T("ngModelChange",function(h){return O(e.channelIds,h)||(e.channelIds=h),h}),S(7,ke,5,3,"mat-option",5),r()()()()()),n&2&&(c("dynamicValidated",e.channelIds().length>0)("config",e.modalConfig),a(6),D("ngModel",e.channelIds),c("multiple",!0),a(),c("ngForOf",e.channelOptions()))},dependencies:[vt,E,Xt,le,ae,pe,se,ce,It,A,U,Mt],encapsulation:2})}}return i})();function Ve(i,p){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",14),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Ae(i,p){if(i&1){let t=x();o(0,"button",16),g("click",function(){m(t);let e=s(2);return u(e.onOpenScanDialog())}),_(1,"i",17),d(2," Scan Channel "),r()}}function Ue(i,p){if(i&1&&(v(0),S(1,Ae,3,0,"button",15),P()),i&2){let t=s();a(),c("ngIf",!t.productService.hasSelection(t.products))}}function Le(i,p){if(i&1){let t=x();v(0),o(1,"button",18),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",17),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Re(i,p){if(i&1){let t=x();v(0),o(1,"button",19),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",20),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Be(i,p){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",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)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<n.channelOptions.length)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function je(i,p){i&1&&(v(0),o(1,"div",23),_(2,"app-empty-state"),r(),P())}function $e(i,p){if(i&1){let t=x();v(0),o(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var we=(()=>{class i{constructor(t,n,e,l,h,I,ct){this.http=t,this.toastr=n,this.dialog=e,this.productService=l,this.authService=h,this.uploadProductService=I,this.route=ct,this.searchFilter=new Y,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(n=>{this.products=n.Data,this.rowCount=n.Total==null?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let n=this.products[t]?.Variants||[];this.dialog.open(Ot,{data:{title:this.products[t].Name,variants:n},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok]);this.dialog.open(N,{data:{filter:t,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(l=>C.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let h=this.productService.selectedProduct(this.products),I=this.productService.getVariantCodesProducts(h);this.scanSingleProduct(I)})}onScanSingleProduct(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(l)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${e?.Name} `,"Error")}this.searchFilter.ChannelID=C.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t=[]){let n;return t?.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(n=t[0].Code),n}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=C.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(lt,{width:"600px",data:[...n]}).afterClosed().pipe(w(e=>C.IsNotEmpty(e)),Ct(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(G),f(K),f(B),f(L),f(rt),f(nt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-in-pos"]],standalone:!1,decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,e){if(n&1){let l=x();o(0,"mainpanel",1),g("onSubmit",function(I){return m(l),u(e.searchProduct(I))}),o(1,"actions"),S(2,Ve,3,1,"button",2)(3,Ue,2,1,"ng-container",3)(4,Le,4,1,"ng-container",3)(5,Re,4,1,"ng-container",3),r(),o(6,"filters")(7,"div")(8,"label",4),d(9,"Category"),r(),o(10,"ng-select",5),g("ngModelChange",function(I){return m(l),u(e.searchFilter.Category=I)}),r()(),o(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),T("ngModelChange",function(I){return m(l),O(e.startDate,I)||(e.startDate=I),u(I)}),g("click",function(){m(l);let I=$(16);return u(I.open())}),r(),o(14,"input",9),T("ngModelChange",function(I){return m(l),O(e.endDate,I)||(e.endDate=I),u(I)}),g("click",function(){m(l);let I=$(16);return u(I.open())}),r()(),_(15,"mat-date-range-picker",null,0),r()(),o(17,"content")(18,"div",10)(19,"div",11),S(20,Be,2,11,"div",12)(21,je,3,0,"ng-container",3),r(),S(22,$e,4,5,"ng-container",3),r()()()}if(n&2){let l=$(16);c("headerTitle","In POS ("+e.rowCount+")"),a(2),ft(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)&&e.multipeScanChannels.length>0),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),a(2),c("rangePicker",l),a(),D("ngModel",e.startDate),a(),D("ngModel",e.endDate),a(6),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products.length>0)}},dependencies:[E,V,it,A,U,R,H,J,Z,j,me,ue,he,_e],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]})}}return i})();function Ge(i,p){if(i&1){let t=x();o(0,"button",11),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",12),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function We(i,p){if(i&1){let t=x();v(0),o(1,"button",13),g("click",function(){m(t);let e=s();return u(e.onOpenScanDialog())}),_(2,"i",14),d(3," Scan Channel "),r(),P()}}function Ke(i,p){if(i&1){let t=x();v(0),o(1,"button",15),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",14),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function Je(i,p){if(i&1){let t=x();v(0),o(1,"button",16),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",17),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function ze(i,p){if(i&1&&(o(0,"span",18),_(1,"img",19),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,y)("alt",t.Name),a(),b(" ",t.Name," ")}}function He(i,p){if(i&1){let t=x();o(0,"div",20)(1,"label",21),d(2,"Item ID"),r(),o(3,"input",22),T("ngModelChange",function(e){m(t);let l=s();return O(l.searchFilter.Item_id,e)||(l.searchFilter.Item_id=e),u(e)}),r()()}if(i&2){let t=s();a(3),D("ngModel",t.searchFilter.Item_id)}}function Ye(i,p){if(i&1){let t=x();o(0,"div",23)(1,"app-product-card",24),g("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenVariantDetail(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("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)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",t==null?null:t.hasScan)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function Ze(i,p){i&1&&(v(0),o(1,"div",25),_(2,"app-empty-state"),r(),P())}function qe(i,p){if(i&1){let t=x();o(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var ye=(()=>{class i{constructor(t,n,e,l,h,I,ct,gt){this.http=t,this.dialog=n,this.toastr=e,this.productService=l,this.activateRouter=h,this.authService=I,this.route=ct,this.uploadProductService=gt,this.searchFilter=new Y,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=C.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,n.Filter.ChannelID!=C.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let n=this.products[t].Variants;this.dialog.open(Ot,{data:{variants:n,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(w(n=>n)).subscribe(n=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(C.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanProducts(l)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=C.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct;let l=this.productService.selectedProduct(this.products),h=this.productService.getVariantCodesProducts(l);this.scanProducts(h)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);n?this.toastr.success(`Product Successfully scan with ${e?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${e?.Name} `,"Error"),this.searchFilter.ChannelID=C.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t){let n;return t.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(n=t[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=C.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=C.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(lt,{width:"600px",data:[...n]}).afterClosed().pipe(w(e=>C.IsNotEmpty(e)),Ct(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(G),f(B),f(Pt),f(L),f(nt),f(rt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-sold-in-channel"]],standalone:!1,decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.searchProduct(h)}),o(1,"actions"),S(2,Ge,3,1,"button",1)(3,We,4,0,"ng-container",2)(4,Ke,4,1,"ng-container",2)(5,Je,4,1,"ng-container",2),r(),o(6,"filters")(7,"div")(8,"label",3),d(9,"Channel"),r(),o(10,"ng-select",4),g("ngModelChange",function(h){return e.searchFilter.ListChannelID=h})("clear",function(){return e.onClearFilterChannel()}),S(11,ze,3,3,"ng-template",5),r()(),S(12,He,4,1,"div",6),r(),o(13,"content")(14,"div",7)(15,"div",8),S(16,Ye,2,11,"div",9)(17,Ze,3,0,"ng-container",2),r(),S(18,qe,3,4,"div",10),r()()()),n&2&&(c("headerTitle","Sold in Channel"),a(2),ft(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.multipeScanChannels.length>0&&e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),a(2),c("ngIf",e.searchFilter.ListChannelID!=null),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products==null?null:e.products.length))},dependencies:[E,V,it,A,U,R,H,ot,wt,J,Z,j],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return i})();function Xe(i,p){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s(2);return u(e.uploadMultipleProduct())}),_(1,"i",14),d(2),r()}if(i&2){let t=s(2);a(2),b(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function tn(i,p){if(i&1){let t=x();v(0),o(1,"td",29)(2,"input",30),T("ngModelChange",function(e){m(t);let l=s(2).$implicit;return O(l.selected,e)||(l.selected=e),u(e)}),g("ngModelChange",function(){m(t);let e=s(3).ngIf,l=s(3);return u(l.onSelectProduct(e))}),r()(),P()}if(i&2){let t=s(2).$implicit;a(),c("rowSpan",t==null?null:t.Variants.length),a(),D("ngModel",t.selected)}}function en(i,p){if(i&1){let t=x();v(0),o(1,"img",35),g("click",function(e){m(t);let l=s(3).$implicit,h=s(4);return u(h.onZoomImage(e,l==null?null:l.ImageUrl))}),r(),P()}if(i&2){let t=s(3).$implicit;a(),c("src",t==null?null:t.ImageUrl,y)}}function nn(i,p){i&1&&_(0,"img",36)}function on(i,p){if(i&1&&(v(0),o(1,"td",29)(2,"div",31),S(3,en,2,1,"ng-container",11)(4,nn,1,0,"ng-template",null,1,et),r()(),o(6,"td",32)(7,"h4",33)(8,"span",34),d(9),r()()(),P()),i&2){let t=$(5),n=s(2).$implicit;a(),c("rowSpan",n==null?null:n.Variants.length),a(2),c("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),a(3),c("rowSpan",n==null?null:n.Variants.length),a(2),c("matTooltip",(n==null||n.Name==null?null:n.Name.length)>50?n==null?null:n.Name:""),a(),b(" ",n==null?null:n.Name," ")}}function rn(i,p){if(i&1&&(o(0,"div")(1,"a",25),_(2,"img",37),r()()),i&2){let t=p.$implicit;a(),c("href",t.URL,y),a(),c("src",t.Img,y)("matTooltip",t.Name)}}function an(i,p){if(i&1&&(o(0,"div"),_(1,"img",37),r()),i&2){let t=p.$implicit;a(),c("src",t.Img,y)("matTooltip",t.Name)}}function ln(i,p){if(i&1&&(o(0,"tr"),S(1,tn,3,2,"ng-container",12)(2,on,10,6,"ng-container",12),o(3,"td"),d(4),r(),o(5,"td")(6,"span"),d(7),r(),o(8,"span",24)(9,"a",25),_(10,"i",26),r()()(),o(11,"td",27)(12,"div",28),S(13,rn,3,3,"div",23),r()(),o(14,"td",27)(15,"div",28),S(16,an,2,2,"div",23),r()()()),i&2){let t=p.$implicit,n=p.index,e=s(5);a(),c("ngIf",n==0),a(),c("ngIf",n==0),a(2),b(" ",t.Name," "),a(3),b(" ",t.Code," "),a(2),c("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),y),a(4),c("ngForOf",t==null?null:t.Available),a(3),c("ngForOf",t==null?null:t.NotAvailable)}}function cn(i,p){if(i&1&&(v(0),S(1,ln,17,7,"tr",23),P()),i&2){let t=p.$implicit;a(),c("ngForOf",t.Variants)}}function sn(i,p){if(i&1&&(o(0,"tbody"),S(1,cn,2,1,"ng-container",23),r()),i&2){let t=p.ngIf;a(),c("ngForOf",t)}}function pn(i,p){if(i&1&&(v(0),o(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),_(5,"th",18),o(6,"th",19),d(7,"Product"),r(),o(8,"th",20),d(9,"Variant"),r(),o(10,"th",20),d(11,"SKU"),r(),o(12,"th",21),d(13,"Available In"),r(),o(14,"th",22),d(15,"Not Available In"),r()()(),S(16,sn,2,1,"tbody",12),F(17,"async"),r()(),P()),i&2){let t=s(2);a(16),c("ngIf",k(17,1,t.data$))}}function dn(i,p){i&1&&(o(0,"div",38),_(1,"app-empty-state"),r())}function mn(i,p){if(i&1){let t=x();o(0,"span",46),g("click",function(){m(t);let e=s(4);return u(e.getRowCount())}),o(1,"i",47),d(2,"?"),r()()}}function un(i,p){if(i&1&&(o(0,"span"),d(1),F(2,"number"),r()),i&2){let t=p.ngIf;a(),tt(k(2,1,t==null?null:t.Count))}}function hn(i,p){if(i&1){let t=x();o(0,"a",48),g("click",function(){m(t);let e=s(4);return u(e.onNextPage())}),_(1,"i",49),d(2," Next"),r()}}function _n(i,p){if(i&1){let t=x();o(0,"a",50),g("click",function(){m(t);let e=s(4);return u(e.onLastPage())}),_(1,"i",51),d(2," Last"),r()}}function gn(i,p){if(i&1&&(v(0),o(1,"div",39)(2,"div",40)(3,"div",41),d(4),F(5,"number"),S(6,mn,3,0,"span",42)(7,un,3,3,"span",12),F(8,"async"),d(9),r()(),o(10,"div",43),S(11,hn,3,0,"a",44)(12,_n,3,0,"a",45),r()(),P()),i&2){let t=s().ngIf,n=s(2);a(4),b(" Showing 1 - ",k(5,6,t==null?null:t.length)," of "),a(2),c("ngIf",n.paginationService.hideCount),a(),c("ngIf",!n.paginationService.hideCount&&k(8,8,n.rowCount$)),a(2),b(" records ~ ",n.paginationService.footerPageNumber," Page "),a(2),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),a(),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function Cn(i,p){if(i&1&&(v(0),S(1,gn,13,10,"ng-container",12),P()),i&2){let t=p.ngIf;a(),c("ngIf",(t==null?null:t.length)>0)}}function fn(i,p){if(i&1){let t=x();o(0,"mainpanel",3),g("onSubmit",function(e){m(t);let l=s();return u(l.searchProduct(e))}),o(1,"actions"),S(2,Xe,3,1,"button",4),o(3,"button",5),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(4,"i",6),d(5," Scan Channel "),r(),o(6,"button",7),g("click",function(){m(t);let e=s();return u(e.openExportDialog())}),_(7,"i",8),o(8,"span"),d(9,"Export"),r()()(),o(10,"content")(11,"div",9)(12,"div",10),S(13,pn,18,3,"ng-container",11),F(14,"async"),S(15,dn,2,0,"ng-template",null,0,et),r(),S(17,Cn,2,1,"ng-container",12),F(18,"async"),r()()()}if(i&2){let t,n=$(16),e=s();c("hideSearchDropdown",!0),a(2),c("ngIf",e.hasSelectionProduct),a(11),c("ngIf",((t=k(14,5,e.data$))==null?null:t.length)>0)("ngIfElse",n),a(4),c("ngIf",k(18,7,e.data$))}}var Me=(()=>{class i{constructor(t,n,e,l,h,I,ct,gt,Ee){this.http=t,this.dialog=n,this.toastr=e,this.route=l,this.productService=h,this.paginationService=I,this.biggerPictureService=ct,this.authService=gt,this.uploadProductService=Ee,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=gt.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(jt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Bt(t=>(t=t.map(n=>(n.Variants=n.Variants.map(e=>(e.Available=this.productService.sortChannel(e.Available),e.NotAvailable=this.productService.sortChannel(e.NotAvailable),e.Available=this.assignLogoChannel(e.Available),e.NotAvailable=this.assignLogoChannel(e.NotAvailable),e)),n.Channel=n?.Variants[0]?.Available,n)),t)))}assignLogoChannel(t){return t=t.map(n=>(n.Img=C.getChannelLogoByTypeId(n.TypeID),n)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(n=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.filterSearch.ChannelID=e.ChannelID,this.filterSearch.ScanFull=e.ScanFull,this.filterSearch.UpdatedProduct=e.UpdatedProduct,this.filterSearch.Async=e.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(Ce,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(G),f(nt),f(B),f(fe),f(de),f(L),f(rt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-channel"]],standalone:!1,decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){n&1&&(S(0,fn,19,9,"mainpanel",2),F(1,"async")),n&2&&c("ngIf",k(1,1,e.loader$))},dependencies:[E,V,Ht,A,U,R,yt,j,St,xt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]})}}return i})();var Sn=i=>[i],xn=()=>[];function vn(i,p){if(i&1){let t=x();o(0,"button",15),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(1,"i",16),d(2," Scan Channel "),r()}}function Pn(i,p){if(i&1){let t=x();v(0),o(1,"button",17),g("click",function(){m(t);let e=s();return u(e.onDownloadAllProduct("SELECTED"))}),_(2,"i",18),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function bn(i,p){if(i&1&&(o(0,"span",19),_(1,"img",20),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,y)("alt",t.Name),a(),b(" ",t.Name," ")}}function In(i,p){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onCheckBoxChange",function(e){let l=m(t).index,h=s();return u(h.onSelectProduct(e,l))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onShowVariantDetail(e))})("onDownload",function(){let e=m(t).$implicit,l=s();return u(l.onDownloadProduct(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanChannel(e))}),r()()}if(i&2){let t=p.$implicit;a(),c("showRedirectIcon",!1)("title",t==null?null:t.Name)("image",t==null?null:t.Image)("imageForZoom",t==null?null:t.Image)("code",t==null?null:t.SKU)("description",(t==null||t.Variant==null?null:t.Variant.length)>0?(t==null||t.Variant==null?null:t.Variant.length)+" Variants":null)("downloadButton",!0)("channels",t!=null&&t.Channel?st(10,Sn,t==null?null:t.Channel):Q(12,xn))("showCheckBox",!0)("scanButton",!0)}}function wn(i,p){i&1&&(v(0),o(1,"div",23),_(2,"app-empty-state"),r(),P())}function yn(i,p){if(i&1){let t=x();o(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var De=(()=>{class i{constructor(t,n,e,l,h,I){this.http=t,this.dialog=n,this.productService=e,this.toastrService=l,this.activateRouter=h,this.authService=I,this.searchFilter=new Y,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(n=>(t=this.channelOptions.find(e=>e.ID==n.ChannelID),t?n.Channel=JSON.parse(JSON.stringify(t)):n.Channel=null,n)).map(n=>(n.Channel&&(n.Channel.Url=n.Url),n))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?C.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=C.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(C.GuidEMpty),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=C.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.Async=e.Async,this.onScanAll()})}onDownloadAllProduct(t){let n;t=="ALL"?n=this.products:n=this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,n){this.products[n].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let n=JSON.parse(JSON.stringify(t));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(e=>{e.Status?(this.initPageLoader(C.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let n=this.products[t].Variant;n.length>0&&this.dialog.open(Se,{data:{title:this.products[t].Name,variants:n},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(B),f(G),f(Pt),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-pos"]],standalone:!1,decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"actions"),S(2,vn,3,0,"button",1)(3,Pn,4,1,"ng-container",2),r(),o(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),r(),o(8,"ng-select",4),T("ngModelChange",function(h){return O(e.searchFilter.ChannelID,h)||(e.searchFilter.ChannelID=h),h}),S(9,bn,3,3,"ng-template",5),r()(),o(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),r(),o(13,"mat-radio-group",8),T("ngModelChange",function(h){return O(e.searchFilter.HaveSku,h)||(e.searchFilter.HaveSku=h),h}),o(14,"mat-radio-button",9),d(15," All "),r(),o(16,"mat-radio-button",9),d(17," Yes "),r(),o(18,"mat-radio-button",9),d(19," No "),r()()(),o(20,"div",6)(21,"label",7),d(22,"Item ID"),r(),o(23,"input",10),T("ngModelChange",function(h){return O(e.searchFilter.Item_id,h)||(e.searchFilter.Item_id=h),h}),r()()(),o(24,"content")(25,"div",11)(26,"div",12),S(27,In,2,13,"div",13)(28,wn,3,0,"ng-container",2),r(),S(29,yn,3,4,"div",14),r()()()),n&2&&(a(2),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ChannelID),a(5),D("ngModel",e.searchFilter.HaveSku),a(),c("value",0),a(2),c("value",1),a(2),c("value",2),a(5),D("ngModel",e.searchFilter.Item_id),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[E,V,it,A,U,R,H,ot,ie,oe,J,Z,j],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]})}}return i})();function Mn(i,p){if(i&1&&(o(0,"span",9),_(1,"img",10),r(),d(2)),i&2){let t=p.item,n=s();a(),c("src",n.getChannelLogo(t.TypeID),y),a(),b(" ",t.Name," ")}}function Dn(i,p){if(i&1&&(o(0,"div",11),_(1,"app-duplicate-product-card",12),r()),i&2){let t=p.$implicit,n=p.index;a(),c("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",n)("image",t.ThumbnailURL)("channels",t.Channels)}}function On(i,p){i&1&&(v(0),o(1,"div",13),_(2,"app-empty-state"),r(),P())}function Tn(i,p){if(i&1){let t=x();v(0),o(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())})("total",function(){m(t);let e=s();return u(e.getRowCount())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var Oe=(()=>{class i{constructor(t,n,e){this.httpService=t,this.productService=n,this.authService=e,this.searchFilter=new Y,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=e.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(n=>{this.products=n.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=C.GuidEMpty}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(B),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-duplicate-sku"]],standalone:!1,decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),r(),o(6,"ng-select",3),T("ngModelChange",function(h){return O(e.searchFilter.ListChannelID,h)||(e.searchFilter.ListChannelID=h),h}),g("clear",function(){return e.onClearFilter()}),S(7,Mn,3,2,"ng-template",4),r()()()(),o(8,"content")(9,"div",5)(10,"div",6),S(11,Dn,2,6,"div",7)(12,On,3,0,"ng-container",8),r(),S(13,Tn,4,4,"ng-container",8),r()()()),n&2&&(a(6),c("multiple",!0)("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ListChannelID),a(5),c("ngForOf",e.products),a(),c("ngIf",(e.products==null?null:e.products.length)==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[E,V,A,U,R,H,ot,wt,Tt,J,j],encapsulation:2})}}return i})();var Fn=()=>["/menu/products/status/sold-in-channel"],Te=i=>({ID:i}),En=()=>["/menu/products/status/not-in-pos"];function Nn(i,p){if(i&1&&(v(0),d(1),P()),i&2){let t=s().$implicit;a(),b(" ",t.Count," ")}}function kn(i,p){if(i&1){let t=x();o(0,"span",26),g("click",function(){m(t);let e=s().$implicit,l=s(2);return u(l.getLiveProductCount(e.ID,e))}),_(1,"i",27),r()}}function Vn(i,p){if(i&1){let t=x();o(0,"tr")(1,"td"),_(2,"img",17),o(3,"span",18),d(4),r()(),o(5,"td",19),S(6,Nn,2,1,"ng-container",6)(7,kn,2,0,"ng-template",null,1,et),r(),o(9,"td",19)(10,"a",20),d(11),F(12,"number"),r()(),o(13,"td",19)(14,"a",20),d(15),F(16,"number"),r()(),o(17,"td"),d(18),F(19,"date"),r(),o(20,"td")(21,"div",21)(22,"button",22),g("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onScanChannel(e))}),_(23,"i",23),d(24," Scan "),r(),o(25,"button",24),g("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onClearCache(e.ID))}),_(26,"i",25),d(27," Clear "),r()()()()}if(i&2){let t=p.$implicit,n=$(8),e=s(2);a(2),c("src",e.getChannelLogo(t.TypeID),y),a(2),tt(t.Name),a(2),c("ngIf",t.Count!==void 0)("ngIfElse",n),a(4),c("routerLink",Q(18,Fn))("queryParams",st(19,Te,t.ID)),a(),b(" ",k(12,11,t.SoldInChannel)," "),a(3),c("routerLink",Q(21,En))("queryParams",st(22,Te,t.ID)),a(),b(" ",k(16,13,t.NotInPOS)," "),a(3),b("",t.LastSync?Wt(19,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function An(i,p){if(i&1&&(v(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),r(),o(7,"th",11),d(8,"Live Product"),r(),o(9,"th",12),d(10,"Sold In Channel"),r(),o(11,"th",13),d(12,"Product Not in POS"),r(),o(13,"th",14),d(14,"Last Sync"),r(),_(15,"th",15),r()(),o(16,"tbody"),S(17,Vn,28,24,"tr",16),F(18,"async"),r()()(),P()),i&2){let t,n=s();a(17),c("ngForOf",(t=k(18,1,n.channels$))==null?null:t.Data)}}function Un(i,p){i&1&&(o(0,"div",28),_(1,"app-empty-state"),r())}var Fe=(()=>{class i{constructor(t,n,e,l){this.productService=t,this.toastr=n,this.dialog=e,this.authService=l,this.destroy$=new Rt,this.channelOptions=l.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,n){this.productService.getTotalProductLive(t).pipe(kt(this.destroy$)).subscribe(e=>{n.Count=e.Count})}onScanChannel(t){this.dialog.open(N,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(w(n=>C.IsNotEmpty(n))).subscribe(n=>{this.scanAllProduct(t.ID,n)})}scanAllProduct(t,n){let e=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async).pipe(w(l=>l)).subscribe(l=>{n.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(l,e,!n.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(kt(this.destroy$)).subscribe(e=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||i)(f(B),f(G),f(K),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-channel-statistic"]],standalone:!1,decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(n&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),S(5,An,19,3,"ng-container",6),F(6,"async"),S(7,Un,2,0,"ng-template",null,0,et),r()()()()()),n&2){let l,h=$(8);c("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),c("ngIf",((l=k(6,4,e.channels$))==null||l.Data==null?null:l.Data.length)>0)("ngIfElse",h)}},dependencies:[E,V,R,yt,bt,j,St,xt,Kt],encapsulation:2})}}return i})();var Ln=[{component:Pe,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:we,canActivate:[X],data:{title:"Products in POS"}},{path:"sold-in-channel",component:ye,canActivate:[X],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Me,canActivate:[X],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:De,canActivate:[X],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Oe,canActivate:[X],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:Fe,canActivate:[X],data:{title:"Channel Statistic"}}]}],uo=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Gt({type:i})}static{this.\u0275inj=$t({imports:[vt,It,te,Mt,Yt,xe,re,ne,Tt,J,Z,zt.forChild(Ln),ge,ve,lt]})}}return i})();export{uo as StatusModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./chunk-CLKCSTGQ.js";import{a as T}from"./chunk-EGTYAIU5.js";import{h as D,j as w}from"./chunk-
|
|
1
|
+
import{a as E}from"./chunk-CLKCSTGQ.js";import{a as T}from"./chunk-EGTYAIU5.js";import{h as D,j as w}from"./chunk-QSXSGKOB.js";import{b as j,e as s}from"./chunk-BUFEIJAI.js";import{b as i,c as m}from"./chunk-PXB4YEY3.js";import{G as C}from"./chunk-GPEVUTDI.js";import{B as A,G as U,J as u,Qa as I,g as k,ja as p,pa as a,q as d,v as b}from"./chunk-T5ONJF63.js";var F=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var x=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var v=class{};var R=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var O=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(D.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Vt=(()=>{class r{constructor(){this.authService=a(w),this.productService=a(T),this.shoppeUploadService=a(F),this.tiktokUploadService=a(x),this.lazadaUploadService=a(H),this.tokopediaUploadService=a(R),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(O),this.toastrHandlingService=a(E),this.toastr=a(j),this.router=a(C),this.httpService=a(s),this._selectedProduct=new k(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(U(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return I(t.map(o=>{let c=new g;return c.id=o.ID,c.name=o.Name,c.type=o.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);A(e).pipe(b(o=>{let c=[];return o.forEach(f=>{c=[...c,...f]}),c})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],c=[],f=[],S=[],y=[],P=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:c.push(l);break;case i.Tokopedia:f.push(l);break;case i.WooCommerce:S.push(l);break;case i.Shopify:y.push(l);break;case i.Plugo:P.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:c},{type:i.Tokopedia,data:f},{type:i.WooCommerce,data:S},{type:i.Shopify,data:y},{type:i.Plugo,data:P}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(c));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(f));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(S));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(P));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let c=new v;c.ChannelID=o.id,c.ChannelType=o.type,c.Products=this._selectedProduct.getValue(),o.type==i.Shopify?delete c.CategoryID:c.CategoryID=o.categoryId,o.type==i.WooCommerce||o.type==i.Shopify?c.Attribute=o.attributes[0]:c.Attributes=this.formatAttributes(o.type,o.attributes),e.push(c)}),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{F as a,x as b,H as c,z as d,Vt as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C}from"./chunk-7477X7LJ.js";import{a as h,b as y}from"./chunk-OE2JYQHN.js";import{a as r}from"./chunk-
|
|
1
|
+
import{a as C}from"./chunk-7477X7LJ.js";import{a as h,b as y}from"./chunk-OE2JYQHN.js";import{a as r}from"./chunk-BQNAQJC7.js";import"./chunk-QSXSGKOB.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-PXB4YEY3.js";import{F as v,J as o,n}from"./chunk-GPEVUTDI.js";import{Eb as l,Fb as s,Oc as f,Wb as u,gc as c,hc as d,ic as i,ka as m,qb as p}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-3JAUWUZS.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-LFMXHJYP.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-N7MU7WUP.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};
|