marketplacepos 3.13.0 → 3.13.1

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.
Files changed (28) hide show
  1. package/Marketplace/{chunk-AZMGWQHI.js → chunk-44NPBPWD.js} +1 -1
  2. package/Marketplace/{chunk-RUBFBYVI.js → chunk-4IP4M4HU.js} +1 -1
  3. package/Marketplace/{chunk-27IRFADU.js → chunk-7GGXFJTH.js} +1 -1
  4. package/Marketplace/{chunk-CW5KDBLU.js → chunk-7Q56WDU6.js} +1 -1
  5. package/Marketplace/{chunk-WLSW7EOC.js → chunk-CBQON7JZ.js} +1 -1
  6. package/Marketplace/{chunk-AKIUNZCW.js → chunk-CJTMR3XH.js} +1 -1
  7. package/Marketplace/{chunk-ZIWIIY7R.js → chunk-DIUAKNJ7.js} +1 -1
  8. package/Marketplace/{chunk-GY7H2DNW.js → chunk-GIZWO6Z7.js} +1 -1
  9. package/Marketplace/{chunk-PVQ2T5XH.js → chunk-IOH6ZWW2.js} +1 -1
  10. package/Marketplace/{chunk-7OJNNBCN.js → chunk-ISHKU4HS.js} +1 -1
  11. package/Marketplace/{chunk-RSTDY3BK.js → chunk-IXXBZERD.js} +1 -1
  12. package/Marketplace/{chunk-B6W4BWFY.js → chunk-JAFFZL32.js} +1 -1
  13. package/Marketplace/{chunk-ENYT723T.js → chunk-JODEGY3A.js} +1 -1
  14. package/Marketplace/{chunk-52ZJ2S2T.js → chunk-KYHILYCS.js} +1 -1
  15. package/Marketplace/{chunk-2KLUGZKI.js → chunk-O2A46B27.js} +1 -1
  16. package/Marketplace/{chunk-5US3733H.js → chunk-O7ORKR43.js} +1 -1
  17. package/Marketplace/chunk-OQANLBWC.js +3 -0
  18. package/Marketplace/{chunk-M3P5OJ7T.js → chunk-RVULTBBA.js} +1 -1
  19. package/Marketplace/{chunk-HMAXDG3A.js → chunk-T6ZAW4FG.js} +1 -1
  20. package/Marketplace/{chunk-H6JEFAAC.js → chunk-TZKWQXOG.js} +1 -1
  21. package/Marketplace/{chunk-II3E425T.js → chunk-VTTUEN2J.js} +1 -1
  22. package/Marketplace/{chunk-XT632VDA.js → chunk-WBRE5DAH.js} +1 -1
  23. package/Marketplace/{chunk-VW2YGC3V.js → chunk-Y4G6RN56.js} +1 -1
  24. package/Marketplace/{chunk-ZIAISN44.js → chunk-Y7E7FG5M.js} +1 -1
  25. package/Marketplace/index.html +2 -2
  26. package/Marketplace/{main-NPVQUDS5.js → main-A3GNL4C4.js} +1 -1
  27. package/package.json +1 -1
  28. package/Marketplace/chunk-HW7H3ISH.js +0 -3
@@ -1 +1 @@
1
- import{a as Ce}from"./chunk-BRTVFFDI.js";import{a as oe}from"./chunk-662E5VTA.js";import{c as fe}from"./chunk-NNPT3RN6.js";import{a as ue,b as xe}from"./chunk-G6CZHXQI.js";import{c as de}from"./chunk-M4VGME5L.js";import{a as ge}from"./chunk-5WVUQE43.js";import{g as se}from"./chunk-AAIK6JQ3.js";import{g as ae}from"./chunk-PVQ2T5XH.js";import{d as me,g as pe}from"./chunk-PIDUM6XT.js";import{t as ce,u as _e}from"./chunk-43TMSPFC.js";import{b as ee,h as te,k as ne,u as ie}from"./chunk-F5YRASNU.js";import{e as re,f as le}from"./chunk-2UXFUEON.js";import{Eb as b,Fb as p,Gb as k,Ha as v,Hb as y,Ia as r,Ib as H,Ja as I,Jb as O,Kb as D,Lb as N,Nb as Z,Pb as T,V as L,Wb as $,Xb as R,Ya as s,Yb as K,Zb as w,_a as m,c as W,fb as P,ga as z,gb as E,ib as M,jb as V,kb as c,lb as _,mb as S,nb as x,oa as g,ob as f,pa as d,pb as U,pc as X,qb as C,rc as Y,sc as q,tb as h,uc as G,vb as a,yb as A,yc as J,za as B,zc as Q}from"./chunk-77JORVC2.js";var j=t=>[t],he=t=>({"text-decoration-line-through":t}),Te=t=>({"ms-10":t}),be=t=>({"bg-gradient-warning":t});function ve(t,l){if(t&1){let n=C();c(0,"mat-slide-toggle",14),h("toggleChange",function(){g(n);let e=a();return e.toggleStatus=!e.toggleStatus,d(e.onToggle())}),c(1,"small",15),p(2),_()()}if(t&2){let n=a();r(2),y(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Se(t,l){if(t&1){let n=C();c(0,"th")(1,"input",16),N("ngModelChange",function(e){g(n);let o=a();return D(o.checkboxState,e)||(o.checkboxState=e),d(e)}),h("ngModelChange",function(){g(n);let e=a();return d(e.onCheckboxStateChange())}),_()()}if(t&2){let n=a();r(),O("ngModel",n.checkboxState)}}function ye(t,l){t&1&&(c(0,"th",11),p(1,"POS"),_())}function we(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),S(4,"img",20),c(5,"div",21),p(6),$(7,"stringLimit"),_()()()(),f()),t&2){let n=l.$implicit;r(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),r(),m("src",n==null?null:n.Img,v),r(2),H(" ",K(7,4,n.Name,20),"",(n.Name==null?null:n.Name.length)>20?"...":""," ")}}function Fe(t,l){t&1&&U(0)}function Ie(t,l){if(t&1&&(x(0),s(1,Fe,1,0,"ng-container",34),f()),t&2){a();let n=b(7);r(),m("ngTemplateOutlet",n)}}function Pe(t,l){t&1&&U(0)}function Ee(t,l){if(t&1&&s(0,Pe,1,0,"ng-container",34),t&2){a(2);let n=b(7);m("ngTemplateOutlet",n)}}function Me(t,l){if(t&1&&s(0,Ee,1,1,"ng-template",12),t&2){let n=a(4);m("ngxPermissionsOnly",T(1,j,n.rolePriceEdit))}}function Ve(t,l){if(t&1){let n=C();x(0),c(1,"input",35),N("ngModelChange",function(e){g(n);let o=a(4).$implicit;return D(o.selected,e)||(o.selected=e),d(e)}),h("ngModelChange",function(){g(n);let e=a(4).$implicit,o=a();return d(o.onCheckboxStateProduct(e.ID))}),_(),f()}if(t&2){let n=a(4).$implicit;r(),O("ngModel",n.selected)}}function ke(t,l){if(t&1&&s(0,Ve,2,1,"ng-container",22),t&2){let n=a(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function Oe(t,l){if(t&1){let n=C();x(0),c(1,"img",36),h("click",function(e){g(n);let o=a(3).$implicit,u=a();return d(u.onZoomImage(e,o==null?null:o.ImageUrl))}),_(),f()}if(t&2){let n=a(3).$implicit;r(),A("src",n==null?null:n.ThumbnailUrl,v)}}function De(t,l){t&1&&S(0,"img",37)}function Ne(t,l){if(t&1&&(x(0),c(1,"td",29)(2,"div",30),s(3,Ie,2,1,"ng-container",31)(4,Me,1,3,"ng-template",null,0,w)(6,ke,1,1,"ng-template",null,1,w),c(8,"div",26),s(9,Oe,2,1,"ng-container",31)(10,De,1,0,"ng-template",null,2,w),_()()(),c(12,"td",32)(13,"div"),p(14),_(),c(15,"small",33),p(16),_()(),f()),t&2){let n=b(5),i=b(11),e=a(2).$implicit,o=a();r(),m("rowSpan",e==null?null:e.Variants.length),r(2),m("ngIf",o.table=="inventory")("ngIfElse",n),r(5),m("ngClass",T(9,Te,(e==null||e.Variants==null?null:e.Variants.length)<=1)),r(),m("ngIf",e==null?null:e.ThumbnailUrl)("ngIfElse",i),r(3),m("rowSpan",e==null?null:e.Variants.length),r(2),k(e==null?null:e.Name),r(2),y("(",e==null?null:e.Category,")")}}function $e(t,l){if(t&1){let n=C();c(0,"input",16),N("ngModelChange",function(e){g(n);let o=a(2).$implicit;return D(o.selected,e)||(o.selected=e),d(e)}),_()}if(t&2){let n=a(2).$implicit;O("ngModel",n.selected)}}function Be(t,l){if(t&1&&(c(0,"td",38),s(1,$e,1,1,"input",39),_()),t&2){let n=a().$implicit,i=a(2);r(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Ue(t,l){if(t&1&&(c(0,"td",24),p(1),$(2,"number"),_()),t&2){let n=a().$implicit,i=a(2);r(),k(R(2,1,i.printPOS(n)))}}function Re(t,l){if(t&1){let n=C();x(0),c(1,"td",40),h("click",function(){g(n);let e=a().$implicit,o=a().$implicit,u=a().$implicit,F=a();return d(F.openTableDialog(u.Name,o,e.ID,u.ChannelItemID))}),c(2,"div",30)(3,"div",41),p(4),$(5,"number"),_(),c(6,"a",42),h("click",function(e){return g(n),d(e==null?null:e.stopPropagation())}),S(7,"i",28),_()()(),f()}if(t&2){let n=l.$implicit,i=a(2).$implicit,e=a(2);r(),m("ngClass",T(5,be,e.printPOS(i)!=e.printItem(n))),r(3),y(" ",R(5,3,e.printItem(n))," "),r(2),m("href",n.Url,v)}}function je(t,l){t&1&&(c(0,"td",43)(1,"div",30)(2,"span"),p(3,"X"),_()()())}function We(t,l){if(t&1&&s(0,Re,8,7,"ng-container",31)(1,je,4,0,"ng-template",null,3,w),t&2){let n=l.$implicit,i=b(2),e=a().$implicit,o=a(2);m("ngIf",o.getItemFromChannel(e,n.ID))("ngIfElse",i)}}function Le(t,l){if(t&1&&(c(0,"tr"),s(1,Ne,17,11,"ng-container",22),c(2,"td",23),p(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),p(7),_(),c(8,"div",21)(9,"a",27),S(10,"i",28),_()()()(),s(11,Be,2,1,"ng-template",12)(12,Ue,3,3,"td",24),M(13,We,3,2,null,null,E),_()),t&2){let n=l.$implicit,i=l.$index,e=a(2);r(),m("ngIf",i==0),r(2),k(n==null?null:n.Model),r(2),m("matTooltip",n.Discontinued?e.discontinuedVariantMsg:""),r(),m("ngClass",T(8,he,n.Discontinued)),r(),y(" ",n.Code," "),r(2),m("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),v),r(2),m("ngxPermissionsOnly",T(10,j,e.rolePriceEdit)),r(),P(e.filter!=null&&e.filter.HiddenIPOSInventory?-1:12),r(),V(e.channel)}}function ze(t,l){if(t&1&&(c(0,"tbody"),M(1,Le,15,12,"tr",null,E),_()),t&2){let n=l.$implicit;r(),V(n.Variants)}}var ft=(()=>{let l=class l{constructor(i,e,o){this.dialog=i,this.biggerPictureService=e,this.authService=o,this.showProductToggle=!1,this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new B,this.destroy$=new W,this.toggle=new B,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let e=this.data.filter(o=>o.ID==i);e.length>0&&(e=e.map(o=>(o.Variants=o.Variants.map(u=>(u.selected=o.selected,u)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(e=>(e.selected=this.checkboxState,e)),i))}getItemFromChannel(i,e){return i.Channel.find(o=>o.ChannelID==e)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,e,o,u){this.dialog.open(Ce,{data:{Name:i,Variant:e,ChannelID:o,Table:this.table,ChannelItemID:u}}).afterClosed().pipe(L(this.destroy$)).subscribe(F=>{F!=null&&this.onSubmit.emit(F)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,e){this.biggerPictureService.openBiggerPicture(i,e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(e){return new(e||l)(I(me),I(ge),I(ae))},l.\u0275cmp=z({type:l,selectors:[["app-table"]],inputs:{filter:"filter",data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle"},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[Z],decls:18,vars:6,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(e,o){e&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),p(7,"Product"),_(),s(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),p(10,"Variant"),_(),c(11,"th",11),p(12,"SKU"),_(),s(13,Se,2,1,"ng-template",12)(14,ye,2,0,"th",11)(15,we,8,7,"ng-container",13),_()(),M(16,ze,3,0,"tbody",null,E),_()()),e&2&&(r(8),P(o.showProductToggle?8:-1),r(5),m("ngxPermissionsOnly",T(4,j,o.rolePriceEdit)),r(),P(o.filter!=null&&o.filter.HiddenIPOSInventory?-1:14),r(),m("ngForOf",o.channel),r(),V(o.data))},dependencies:[Q,X,Y,q,G,J,ie,ee,te,ne,xe,ue,pe,se,de,le,re,_e,ce,fe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let t=l;return t})();export{ft as a};
1
+ import{a as Ce}from"./chunk-BRTVFFDI.js";import{a as oe}from"./chunk-662E5VTA.js";import{c as fe}from"./chunk-NNPT3RN6.js";import{a as ue,b as xe}from"./chunk-G6CZHXQI.js";import{c as de}from"./chunk-M4VGME5L.js";import{a as ge}from"./chunk-5WVUQE43.js";import{g as se}from"./chunk-AAIK6JQ3.js";import{g as ae}from"./chunk-IOH6ZWW2.js";import{d as me,g as pe}from"./chunk-PIDUM6XT.js";import{t as ce,u as _e}from"./chunk-43TMSPFC.js";import{b as ee,h as te,k as ne,u as ie}from"./chunk-F5YRASNU.js";import{e as re,f as le}from"./chunk-2UXFUEON.js";import{Eb as b,Fb as p,Gb as k,Ha as v,Hb as y,Ia as r,Ib as H,Ja as I,Jb as O,Kb as D,Lb as N,Nb as Z,Pb as T,V as L,Wb as $,Xb as R,Ya as s,Yb as K,Zb as w,_a as m,c as W,fb as P,ga as z,gb as E,ib as M,jb as V,kb as c,lb as _,mb as S,nb as x,oa as g,ob as f,pa as d,pb as U,pc as X,qb as C,rc as Y,sc as q,tb as h,uc as G,vb as a,yb as A,yc as J,za as B,zc as Q}from"./chunk-77JORVC2.js";var j=t=>[t],he=t=>({"text-decoration-line-through":t}),Te=t=>({"ms-10":t}),be=t=>({"bg-gradient-warning":t});function ve(t,l){if(t&1){let n=C();c(0,"mat-slide-toggle",14),h("toggleChange",function(){g(n);let e=a();return e.toggleStatus=!e.toggleStatus,d(e.onToggle())}),c(1,"small",15),p(2),_()()}if(t&2){let n=a();r(2),y(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Se(t,l){if(t&1){let n=C();c(0,"th")(1,"input",16),N("ngModelChange",function(e){g(n);let o=a();return D(o.checkboxState,e)||(o.checkboxState=e),d(e)}),h("ngModelChange",function(){g(n);let e=a();return d(e.onCheckboxStateChange())}),_()()}if(t&2){let n=a();r(),O("ngModel",n.checkboxState)}}function ye(t,l){t&1&&(c(0,"th",11),p(1,"POS"),_())}function we(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),S(4,"img",20),c(5,"div",21),p(6),$(7,"stringLimit"),_()()()(),f()),t&2){let n=l.$implicit;r(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),r(),m("src",n==null?null:n.Img,v),r(2),H(" ",K(7,4,n.Name,20),"",(n.Name==null?null:n.Name.length)>20?"...":""," ")}}function Fe(t,l){t&1&&U(0)}function Ie(t,l){if(t&1&&(x(0),s(1,Fe,1,0,"ng-container",34),f()),t&2){a();let n=b(7);r(),m("ngTemplateOutlet",n)}}function Pe(t,l){t&1&&U(0)}function Ee(t,l){if(t&1&&s(0,Pe,1,0,"ng-container",34),t&2){a(2);let n=b(7);m("ngTemplateOutlet",n)}}function Me(t,l){if(t&1&&s(0,Ee,1,1,"ng-template",12),t&2){let n=a(4);m("ngxPermissionsOnly",T(1,j,n.rolePriceEdit))}}function Ve(t,l){if(t&1){let n=C();x(0),c(1,"input",35),N("ngModelChange",function(e){g(n);let o=a(4).$implicit;return D(o.selected,e)||(o.selected=e),d(e)}),h("ngModelChange",function(){g(n);let e=a(4).$implicit,o=a();return d(o.onCheckboxStateProduct(e.ID))}),_(),f()}if(t&2){let n=a(4).$implicit;r(),O("ngModel",n.selected)}}function ke(t,l){if(t&1&&s(0,Ve,2,1,"ng-container",22),t&2){let n=a(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function Oe(t,l){if(t&1){let n=C();x(0),c(1,"img",36),h("click",function(e){g(n);let o=a(3).$implicit,u=a();return d(u.onZoomImage(e,o==null?null:o.ImageUrl))}),_(),f()}if(t&2){let n=a(3).$implicit;r(),A("src",n==null?null:n.ThumbnailUrl,v)}}function De(t,l){t&1&&S(0,"img",37)}function Ne(t,l){if(t&1&&(x(0),c(1,"td",29)(2,"div",30),s(3,Ie,2,1,"ng-container",31)(4,Me,1,3,"ng-template",null,0,w)(6,ke,1,1,"ng-template",null,1,w),c(8,"div",26),s(9,Oe,2,1,"ng-container",31)(10,De,1,0,"ng-template",null,2,w),_()()(),c(12,"td",32)(13,"div"),p(14),_(),c(15,"small",33),p(16),_()(),f()),t&2){let n=b(5),i=b(11),e=a(2).$implicit,o=a();r(),m("rowSpan",e==null?null:e.Variants.length),r(2),m("ngIf",o.table=="inventory")("ngIfElse",n),r(5),m("ngClass",T(9,Te,(e==null||e.Variants==null?null:e.Variants.length)<=1)),r(),m("ngIf",e==null?null:e.ThumbnailUrl)("ngIfElse",i),r(3),m("rowSpan",e==null?null:e.Variants.length),r(2),k(e==null?null:e.Name),r(2),y("(",e==null?null:e.Category,")")}}function $e(t,l){if(t&1){let n=C();c(0,"input",16),N("ngModelChange",function(e){g(n);let o=a(2).$implicit;return D(o.selected,e)||(o.selected=e),d(e)}),_()}if(t&2){let n=a(2).$implicit;O("ngModel",n.selected)}}function Be(t,l){if(t&1&&(c(0,"td",38),s(1,$e,1,1,"input",39),_()),t&2){let n=a().$implicit,i=a(2);r(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Ue(t,l){if(t&1&&(c(0,"td",24),p(1),$(2,"number"),_()),t&2){let n=a().$implicit,i=a(2);r(),k(R(2,1,i.printPOS(n)))}}function Re(t,l){if(t&1){let n=C();x(0),c(1,"td",40),h("click",function(){g(n);let e=a().$implicit,o=a().$implicit,u=a().$implicit,F=a();return d(F.openTableDialog(u.Name,o,e.ID,u.ChannelItemID))}),c(2,"div",30)(3,"div",41),p(4),$(5,"number"),_(),c(6,"a",42),h("click",function(e){return g(n),d(e==null?null:e.stopPropagation())}),S(7,"i",28),_()()(),f()}if(t&2){let n=l.$implicit,i=a(2).$implicit,e=a(2);r(),m("ngClass",T(5,be,e.printPOS(i)!=e.printItem(n))),r(3),y(" ",R(5,3,e.printItem(n))," "),r(2),m("href",n.Url,v)}}function je(t,l){t&1&&(c(0,"td",43)(1,"div",30)(2,"span"),p(3,"X"),_()()())}function We(t,l){if(t&1&&s(0,Re,8,7,"ng-container",31)(1,je,4,0,"ng-template",null,3,w),t&2){let n=l.$implicit,i=b(2),e=a().$implicit,o=a(2);m("ngIf",o.getItemFromChannel(e,n.ID))("ngIfElse",i)}}function Le(t,l){if(t&1&&(c(0,"tr"),s(1,Ne,17,11,"ng-container",22),c(2,"td",23),p(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),p(7),_(),c(8,"div",21)(9,"a",27),S(10,"i",28),_()()()(),s(11,Be,2,1,"ng-template",12)(12,Ue,3,3,"td",24),M(13,We,3,2,null,null,E),_()),t&2){let n=l.$implicit,i=l.$index,e=a(2);r(),m("ngIf",i==0),r(2),k(n==null?null:n.Model),r(2),m("matTooltip",n.Discontinued?e.discontinuedVariantMsg:""),r(),m("ngClass",T(8,he,n.Discontinued)),r(),y(" ",n.Code," "),r(2),m("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),v),r(2),m("ngxPermissionsOnly",T(10,j,e.rolePriceEdit)),r(),P(e.filter!=null&&e.filter.HiddenIPOSInventory?-1:12),r(),V(e.channel)}}function ze(t,l){if(t&1&&(c(0,"tbody"),M(1,Le,15,12,"tr",null,E),_()),t&2){let n=l.$implicit;r(),V(n.Variants)}}var ft=(()=>{let l=class l{constructor(i,e,o){this.dialog=i,this.biggerPictureService=e,this.authService=o,this.showProductToggle=!1,this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new B,this.destroy$=new W,this.toggle=new B,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let e=this.data.filter(o=>o.ID==i);e.length>0&&(e=e.map(o=>(o.Variants=o.Variants.map(u=>(u.selected=o.selected,u)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(e=>(e.selected=this.checkboxState,e)),i))}getItemFromChannel(i,e){return i.Channel.find(o=>o.ChannelID==e)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,e,o,u){this.dialog.open(Ce,{data:{Name:i,Variant:e,ChannelID:o,Table:this.table,ChannelItemID:u}}).afterClosed().pipe(L(this.destroy$)).subscribe(F=>{F!=null&&this.onSubmit.emit(F)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,e){this.biggerPictureService.openBiggerPicture(i,e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(e){return new(e||l)(I(me),I(ge),I(ae))},l.\u0275cmp=z({type:l,selectors:[["app-table"]],inputs:{filter:"filter",data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle"},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[Z],decls:18,vars:6,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(e,o){e&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),p(7,"Product"),_(),s(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),p(10,"Variant"),_(),c(11,"th",11),p(12,"SKU"),_(),s(13,Se,2,1,"ng-template",12)(14,ye,2,0,"th",11)(15,we,8,7,"ng-container",13),_()(),M(16,ze,3,0,"tbody",null,E),_()()),e&2&&(r(8),P(o.showProductToggle?8:-1),r(5),m("ngxPermissionsOnly",T(4,j,o.rolePriceEdit)),r(),P(o.filter!=null&&o.filter.HiddenIPOSInventory?-1:14),r(),m("ngForOf",o.channel),r(),V(o.data))},dependencies:[Q,X,Y,q,G,J,ie,ee,te,ne,xe,ue,pe,se,de,le,re,_e,ce,fe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let t=l;return t})();export{ft as a};
@@ -1 +1 @@
1
- import{a as O,b as It,d as Q,e as de}from"./chunk-WLSW7EOC.js";import{a as q}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-FCVAME75.js";import"./chunk-CP7VAKTQ.js";import{a as pe}from"./chunk-LIS3LB3F.js";import{f as re,g as ae,h as le,i as ce,j as se}from"./chunk-7GNI4BOW.js";import"./chunk-OFRBPREK.js";import{a as Xt,b as te}from"./chunk-7CEWM7GE.js";import{a as X,b as wt}from"./chunk-TX43EE6N.js";import{a as z}from"./chunk-N23ZYP7G.js";import{a as ee,b as ne,c as ie}from"./chunk-DXJFMERC.js";import{b as me}from"./chunk-7NWB2VB2.js";import"./chunk-IP2WADIR.js";import"./chunk-MEGPKKGI.js";import{a as rt,b as bt,d as Z,e as Yt}from"./chunk-2Y4N4NSS.js";import{a as nt}from"./chunk-M3P5OJ7T.js";import{a as B}from"./chunk-NNPT3RN6.js";import"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import{a as oe}from"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as L}from"./chunk-PVQ2T5XH.js";import{b as G,e as A}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as J,l as R,m as Qt}from"./chunk-PIDUM6XT.js";import{t as vt,u as qt}from"./chunk-43TMSPFC.js";import{P as Zt}from"./chunk-4TYJR476.js";import{b as zt,c as ot,h as W,k as K,u as Ht}from"./chunk-F5YRASNU.js";import{b as Y,c as _}from"./chunk-2UXFUEON.js";import{$ as Lt,B as y,Eb as j,F as kt,Fb as m,Gb as Ct,Ha as N,Hb as I,Ia as c,Ja as x,Jb as D,Kb as T,Lb as E,O as Vt,Ob as et,Pb as ct,Q as Ut,T as H,V as lt,Wb as F,X as _t,Xb as k,Y as At,Ya as S,Yb as jt,Zb as it,_a as s,aa as Rt,bd as xt,c as gt,ca as Bt,cd as Kt,d as Ft,ed as Pt,ga as M,gd as Jt,ha as $t,kb as a,lb as l,mb as C,nb as b,oa as u,ob as v,pa as h,q as at,qb as P,rc as V,sc as U,tb as f,vb as p,vc as ft,wc as Gt,yc as St,zc as Wt}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var ve=()=>["/menu/products/download/by-url"],ue=(()=>{let r=class r{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"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],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(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),C(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),m(11,"Download Product By Url"),l()()()()()(),C(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",et(2,ve)))},dependencies:[Xt,Kt,Pt]});let o=r;return o})();function Ie(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.onOpenScanDialog())}),C(1,"i",14),m(2," Scan Channel "),l()}}function we(o,r){if(o&1&&(b(0),S(1,Ie,3,0,"button",12),v()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function ye(o,r){if(o&1){let n=P();b(0),a(1,"button",15),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Me(o,r){if(o&1){let n=P();b(0),a(1,"button",16),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",17),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Ne(o,r){if(o&1){let n=P();a(0,"div",18)(1,"app-product-card",19),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null?null:n.Variants.length)>1?(n==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function Fe(o,r){o&1&&(b(0),a(1,"div",20),C(2,"app-empty-state"),l(),v())}function Oe(o,r){if(o&1){let n=P();b(0),a(1,"div",21)(2,"div",22)(3,"app-custom-paginator",23),f("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPrevPage())}),l()()(),v()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var ge=(()=>{let r=class r{constructor(t,e,i,d,g){this.http=t,this.toastr=e,this.dialog=i,this.productService=d,this.authService=g,this.searchFilter=new q,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,[Y.Tokopedia,Y.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(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(O,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.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 e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(It,{data:{title:this.products[t].Name,variants:this.products[t].Variants},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>_.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>_.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onNextPage(){this.getProducts()}onPrevPage(){this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok]);this.dialog.open(O,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(d=>_.IsNotEmpty(d))).subscribe(d=>{this.searchFilter.ChannelID=d.ChannelID,this.searchFilter.ScanFull=d.ScanFull,this.searchFilter.UpdatedProduct=d.UpdatedProduct;let g=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(g);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=_.GuidEMpty,this.dialog.open(O,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(d)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=_.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}};r.\u0275fac=function(e){return new(e||r)(x(A),x(G),x(J),x(B),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:22,vars:13,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[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","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","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[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"]],template:function(e,i){if(e&1){let d=P();a(0,"mainpanel",1),f("onSubmit",function(w){return u(d),h(i.searchProduct(w))}),a(1,"actions"),S(2,we,2,1,"ng-container",2)(3,ye,4,1,"ng-container",2)(4,Me,4,1,"ng-container",2),l(),a(5,"filters")(6,"div")(7,"label",3),m(8,"Category"),l(),a(9,"ng-select",4),f("ngModelChange",function(w){return u(d),h(i.searchFilter.Category=w)}),l()(),a(10,"div",5)(11,"mat-date-range-input",6)(12,"input",7),E("ngModelChange",function(w){return u(d),T(i.startDate,w)||(i.startDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l(),a(13,"input",8),E("ngModelChange",function(w){return u(d),T(i.endDate,w)||(i.endDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l()(),C(14,"mat-date-range-picker",null,0),l()(),a(16,"content")(17,"div",9)(18,"div",10),S(19,Ne,2,10,"div",11)(20,Fe,3,0,"ng-container",2),l(),S(21,Oe,4,4,"ng-container",2),l()()()}if(e&2){let d=j(15);s("headerTitle","In POS ("+i.rowCount+")"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",d),c(),D("ngModel",i.startDate),c(),D("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[V,U,ot,W,K,R,Z,z,X,$,le,re,ae,ce],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}"]});let o=r;return o})();function De(o,r){if(o&1){let n=P();b(0),a(1,"button",10),f("click",function(){u(n);let e=p();return h(e.onOpenScanDialog())}),C(2,"i",11),m(3," Scan Channel "),l(),v()}}function Te(o,r){if(o&1){let n=P();b(0),a(1,"button",12),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",11),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function Ee(o,r){if(o&1){let n=P();b(0),a(1,"button",13),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function ke(o,r){if(o&1&&(a(0,"span",15),C(1,"img",16),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,N)("alt",n.Name),c(),I(" ",n.Name," ")}}function Ve(o,r){if(o&1){let n=P();a(0,"div",17)(1,"label",18),m(2,"Item ID"),l(),a(3,"input",19),E("ngModelChange",function(e){u(n);let i=p();return T(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),h(e)}),l()()}if(o&2){let n=p();c(3),D("ngModel",n.searchFilter.Item_id)}}function Ue(o,r){if(o&1){let n=P();a(0,"div",20)(1,"app-product-card",21),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenVariantDetail(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function Ae(o,r){o&1&&(b(0),a(1,"div",22),C(2,"app-empty-state"),l(),v())}function Le(o,r){if(o&1){let n=P();a(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var _e=(()=>{let r=class r{constructor(t,e,i,d,g,w){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.activateRouter=g,this.authService=w,this.searchFilter=new q,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=_.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=_.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.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(e=>{this.products=e.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 e=this.products[t].Variants;this.dialog.open(It,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(O,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.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(y(e=>e)).subscribe(e=>{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(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(_.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(O,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanProducts(d)})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>_.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}onScanMultipleProduct(){this.searchFilter.ChannelID=_.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(O,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let d=this.productService.selectedProduct(this.products),g=this.productService.getVariantCodesProducts(d);this.scanProducts(g)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=_.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=_.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>_.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(G),x(B),x(xt),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],decls:18,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],[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","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","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[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(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.searchProduct(g)}),a(1,"actions"),S(2,De,4,0,"ng-container",1)(3,Te,4,1,"ng-container",1)(4,Ee,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),m(8,"Channel"),l(),a(9,"ng-select",3),f("ngModelChange",function(g){return i.searchFilter.ListChannelID=g})("clear",function(){return i.onClearFilterChannel()}),S(10,ke,3,3,"ng-template",4),l()(),S(11,Ve,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),S(15,Ue,2,10,"div",8)(16,Ae,3,0,"ng-container",1),l(),S(17,Le,3,4,"div",9),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[V,U,ot,W,K,R,Z,rt,bt,z,X,$],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}"]});let o=r;return o})();var Ce=(()=>{let r=class r{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new Ft(null),this.destroy$=new gt,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,e){e==0?this.disableNextButton=!0:this.disableNextButton=!(e<t.RowCount*t.PageNumber)}reloadPagination(t){_.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,e){t.RowCount=e,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new Ft(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(lt(this.destroy$),y(t=>t!=null),kt(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(at(e=>e.Data))),At(this.pagination$),Vt((t,e)=>{let[i,d]=t,[g]=e;return d.PageNumber==1?[g,d]:[i.concat(g),d]}),_t(([t,e])=>{this.setPageNumberFooter(e),this.setPaginationButtonState(e,t.length)}),at(([t])=>t),Ut())}};r.\u0275fac=function(e){return new(e||r)(Bt(A))},r.\u0275prov=Lt({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();function $e(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.uploadMultipleProduct())}),C(1,"i",14),m(2),l()}if(o&2){let n=p(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function je(o,r){if(o&1){let n=P();b(0),a(1,"td",29)(2,"input",30),E("ngModelChange",function(e){u(n);let i=p(2).$implicit;return T(i.selected,e)||(i.selected=e),h(e)}),f("ngModelChange",function(){u(n);let e=p(3).ngIf,i=p(3);return h(i.onSelectProduct(e))}),l()(),v()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),D("ngModel",n.selected)}}function Ge(o,r){if(o&1){let n=P();b(0),a(1,"img",35),f("click",function(e){u(n);let i=p(3).$implicit,d=p(4);return h(d.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),v()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,N)}}function We(o,r){o&1&&C(0,"img",36)}function Ke(o,r){if(o&1&&(b(0),a(1,"td",29)(2,"div",31),S(3,Ge,2,1,"ng-container",11)(4,We,1,0,"ng-template",null,1,it),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),m(9),l()()(),v()),o&2){let n=j(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),I(" ",t==null?null:t.Name," ")}}function Je(o,r){if(o&1&&(a(0,"div")(1,"a",25),C(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,N),c(),s("src",n.Img,N)("matTooltip",n.Name)}}function ze(o,r){if(o&1&&(a(0,"div"),C(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,N)("matTooltip",n.Name)}}function He(o,r){if(o&1&&(a(0,"tr"),S(1,je,3,2,"ng-container",12)(2,Ke,10,6,"ng-container",12),a(3,"td"),m(4),l(),a(5,"td")(6,"span"),m(7),l(),a(8,"span",24)(9,"a",25),C(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),S(13,Je,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),S(16,ze,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),N),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function Ye(o,r){if(o&1&&(b(0),S(1,He,17,7,"tr",23),v()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function Ze(o,r){if(o&1&&(a(0,"tbody"),S(1,Ye,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function qe(o,r){if(o&1&&(b(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),C(5,"th",18),a(6,"th",19),m(7,"Product"),l(),a(8,"th",20),m(9,"Variant"),l(),a(10,"th",20),m(11,"SKU"),l(),a(12,"th",21),m(13,"Available In"),l(),a(14,"th",22),m(15,"Not Available In"),l()()(),S(16,Ze,2,1,"tbody",12),F(17,"async"),l()(),v()),o&2){let n=p(2);c(16),s("ngIf",k(17,1,n.data$))}}function Qe(o,r){o&1&&(a(0,"div",38),C(1,"app-empty-state"),l())}function Xe(o,r){if(o&1){let n=P();a(0,"span",46),f("click",function(){u(n);let e=p(4);return h(e.getRowCount())}),a(1,"i",47),m(2,"?"),l()()}}function tn(o,r){if(o&1&&(a(0,"span"),m(1),F(2,"number"),l()),o&2){let n=r.ngIf;c(),Ct(k(2,1,n==null?null:n.Count))}}function en(o,r){if(o&1){let n=P();a(0,"a",48),f("click",function(){u(n);let e=p(4);return h(e.onNextPage())}),C(1,"i",49),m(2," Next"),l()}}function nn(o,r){if(o&1){let n=P();a(0,"a",50),f("click",function(){u(n);let e=p(4);return h(e.onLastPage())}),C(1,"i",51),m(2," Last"),l()}}function on(o,r){if(o&1&&(b(0),a(1,"div",39)(2,"div",40)(3,"div",41),m(4),F(5,"number"),S(6,Xe,3,0,"span",42)(7,tn,3,3,"span",12),F(8,"async"),m(9),l()(),a(10,"div",43),S(11,en,3,0,"a",44)(12,nn,3,0,"a",45),l()(),v()),o&2){let n=p().ngIf,t=p(2);c(4),I(" Showing 1 - ",k(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&k(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function rn(o,r){if(o&1&&(b(0),S(1,on,13,10,"ng-container",12),v()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function an(o,r){if(o&1){let n=P();a(0,"mainpanel",3),f("onSubmit",function(e){u(n);let i=p();return h(i.searchProduct(e))}),a(1,"actions"),S(2,$e,3,1,"button",4),a(3,"button",5),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(4,"i",6),m(5," Scan Channel "),l(),a(6,"button",7),f("click",function(){u(n);let e=p();return h(e.openExportDialog())}),C(7,"i",8),a(8,"span"),m(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),S(13,qe,18,3,"ng-container",11),F(14,"async"),S(15,Qe,2,0,"ng-template",null,0,it),l(),S(17,rn,2,1,"ng-container",12),F(18,"async"),l()()()}if(o&2){let n,t=j(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=k(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",k(18,7,e.data$))}}var fe=(()=>{let r=class r{constructor(t,e,i,d,g,w,Et){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.paginationService=g,this.biggerPictureService=w,this.authService=Et,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Et.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(_t(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(at(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=_.getChannelLogoByTypeId(e.TypeID),e)),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(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=_.GuidEMpty,this.dialog.open(O,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.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,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){let t=this.getUniqueChannels();t=t.map(e=>(e.ID=e.ChannelID,e)),this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:t}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e)),H(e=>{let i=this.getSelectedProductIds();return this.productService.uploadNotInChannel(i,e)})).subscribe({next:()=>{this.paginationService.reloadPagination(this.filterSearch),this.selectedProducts=[],this.hasSelectionProduct=!1},error:e=>{this.selectedProducts=[],this.hasSelectionProduct=!1}})}getSelectedProductIds(){return this.selectedProducts.map(e=>({ID:e.ProductID}))}getUniqueChannels(){let t=[];return this.selectedProducts.forEach(e=>{t=[...t,...e.Variants[0].NotAvailable]}),t=t.filter((e,i,d)=>d.findIndex(g=>g.ChannelID==e.ChannelID)==i),t}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(pe,{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()}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(G),x(B),x(Ce),x(oe),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],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-lg","fa-external-link-alt","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(e,i){e&1&&(S(0,an,19,9,"mainpanel",2),F(1,"async")),e&2&&s("ngIf",k(1,1,i.loader$))},dependencies:[V,U,zt,W,K,R,vt,$,ft,St],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%}"]});let o=r;return o})();var ln=o=>[o],cn=()=>[];function sn(o,r){if(o&1){let n=P();a(0,"button",15),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(1,"i",16),m(2," Scan Channel "),l()}}function pn(o,r){if(o&1){let n=P();b(0),a(1,"button",17),f("click",function(){u(n);let e=p();return h(e.onDownloadAllProduct("SELECTED"))}),C(2,"i",18),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function dn(o,r){if(o&1&&(a(0,"span",19),C(1,"img",20),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,N)("alt",n.Name),c(),I(" ",n.Name," ")}}function mn(o,r){if(o&1){let n=P();a(0,"div",21)(1,"app-product-card",22),f("onCheckBoxChange",function(e){let i=u(n).index,d=p();return h(d.onSelectProduct(e,i))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onShowVariantDetail(e))})("onDownload",function(){let e=u(n).$implicit,i=p();return h(i.onDownloadProduct(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?ct(10,ln,n==null?null:n.Channel):et(12,cn))("showCheckBox",!0)("scanButton",!0)}}function un(o,r){o&1&&(b(0),a(1,"div",23),C(2,"app-empty-state"),l(),v())}function hn(o,r){if(o&1){let n=P();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var Se=(()=>{let r=class r{constructor(t,e,i,d,g,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=d,this.activateRouter=g,this.authService=w,this.searchFilter=new q,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.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(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?_.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=_.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(e=>{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(_.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=_.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(O,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].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 e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(_.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 e=this.products[t].Variant;e.length>0&&this.dialog.open(de,{data:{title:this.products[t].Name,variants:e},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(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(B),x(G),x(xt),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],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(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.onSearch(g)}),a(1,"actions"),S(2,sn,3,0,"button",1)(3,pn,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),m(7,"Channel"),l(),a(8,"ng-select",4),E("ngModelChange",function(g){return T(i.searchFilter.ChannelID,g)||(i.searchFilter.ChannelID=g),g}),S(9,dn,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),m(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),E("ngModelChange",function(g){return T(i.searchFilter.HaveSku,g)||(i.searchFilter.HaveSku=g),g}),a(14,"mat-radio-button",9),m(15," All "),l(),a(16,"mat-radio-button",9),m(17," Yes "),l(),a(18,"mat-radio-button",9),m(19," No "),l()()(),a(20,"div",6)(21,"label",7),m(22,"Item ID"),l(),a(23,"input",10),E("ngModelChange",function(g){return T(i.searchFilter.Item_id,g)||(i.searchFilter.Item_id=g),g}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),S(27,mn,2,13,"div",13)(28,un,3,0,"ng-container",2),l(),S(29,hn,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),D("ngModel",i.searchFilter.ChannelID),c(5),D("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),D("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,ot,W,K,R,Z,rt,ee,ne,z,X,$],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}"]});let o=r;return o})();function gn(o,r){if(o&1&&(a(0,"span",9),C(1,"img",10),l(),m(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),N),c(),I(" ",n.Name," ")}}function _n(o,r){if(o&1&&(a(0,"div",11),C(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function Cn(o,r){o&1&&(b(0),a(1,"div",13),C(2,"app-empty-state"),l(),v())}function fn(o,r){if(o&1){let n=P();b(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),f("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPrevPage())})("total",function(){u(n);let e=p();return h(e.getRowCount())}),l()()(),v()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var xe=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new q,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.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(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=_.GuidEMpty}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(x(A),x(B),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],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(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.onSearch(g)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),m(5,"Channel"),l(),a(6,"ng-select",3),E("ngModelChange",function(g){return T(i.searchFilter.ListChannelID,g)||(i.searchFilter.ListChannelID=g),g}),f("clear",function(){return i.onClearFilter()}),S(7,gn,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),S(11,_n,2,6,"div",7)(12,Cn,3,0,"ng-container",8),l(),S(13,fn,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),D("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,W,K,R,Z,rt,bt,wt,z,$]});let o=r;return o})();var Sn=()=>["/menu/products/status/sold-in-channel"],Pe=o=>({ID:o}),xn=()=>["/menu/products/status/not-in-pos"];function Pn(o,r){if(o&1&&(b(0),m(1),v()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function bn(o,r){if(o&1){let n=P();a(0,"span",26),f("click",function(){u(n);let e=p().$implicit,i=p(2);return h(i.getLiveProductCount(e.ID,e))}),C(1,"i",27),l()}}function vn(o,r){if(o&1){let n=P();a(0,"tr")(1,"td"),C(2,"img",17),a(3,"span",18),m(4),l()(),a(5,"td",19),S(6,Pn,2,1,"ng-container",6)(7,bn,2,0,"ng-template",null,1,it),l(),a(9,"td",19)(10,"a",20),m(11),F(12,"number"),l()(),a(13,"td",19)(14,"a",20),m(15),F(16,"number"),l()(),a(17,"td"),m(18),F(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onScanChannel(e))}),C(23,"i",23),m(24," Scan "),l(),a(25,"button",24),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onClearCache(e.ID))}),C(26,"i",25),m(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=j(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),N),c(2),Ct(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",et(18,Sn))("queryParams",ct(19,Pe,n.ID)),c(),I(" ",k(12,11,n.SoldInChannel)," "),c(3),s("routerLink",et(21,xn))("queryParams",ct(22,Pe,n.ID)),c(),I(" ",k(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?jt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function In(o,r){if(o&1&&(b(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),m(6,"Channel"),l(),a(7,"th",11),m(8,"Live Product"),l(),a(9,"th",12),m(10,"Sold In Channel"),l(),a(11,"th",13),m(12,"Product Not in POS"),l(),a(13,"th",14),m(14,"Last Sync"),l(),C(15,"th",15),l()(),a(16,"tbody"),S(17,vn,28,24,"tr",16),F(18,"async"),l()()(),v()),o&2){let n,t=p();c(17),s("ngForOf",(n=k(18,1,t.channels$))==null?null:n.Data)}}function wn(o,r){o&1&&(a(0,"div",28),C(1,"app-empty-state"),l())}var be=(()=>{let r=class r{constructor(t,e,i,d){this.productService=t,this.toastr=e,this.dialog=i,this.authService=d,this.destroy$=new gt,this.channelOptions=d.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(lt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(O,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(d=>d)).subscribe(d=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(d,i,!e.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(lt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(x(B),x(G),x(J),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],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(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),S(5,In,19,3,"ng-container",6),F(6,"async"),S(7,wn,2,0,"ng-template",null,0,it),l()()()()()),e&2){let d,g=j(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((d=k(6,4,i.channels$))==null||d.Data==null?null:d.Data.length)>0)("ngIfElse",g)}},dependencies:[V,U,R,vt,Pt,$,ft,St,Gt]});let o=r;return o})();var yn=[{component:ue,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:ge,canActivate:[nt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:_e,canActivate:[nt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:fe,canActivate:[nt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Se,canActivate:[nt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:xe,canActivate:[nt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:be,canActivate:[nt],data:{title:"Channel Statistic"}}]}],Bi=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=$t({type:r}),r.\u0275inj=Rt({imports:[Wt,Ht,Qt,qt,Yt,me,ie,te,wt,z,X,Jt.forChild(yn),se,Zt]});let o=r;return o})();export{Bi as StatusModule};
1
+ import{a as O,b as It,d as Q,e as de}from"./chunk-CBQON7JZ.js";import{a as q}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-FCVAME75.js";import"./chunk-CP7VAKTQ.js";import{a as pe}from"./chunk-LIS3LB3F.js";import{f as re,g as ae,h as le,i as ce,j as se}from"./chunk-7GNI4BOW.js";import"./chunk-OFRBPREK.js";import{a as Xt,b as te}from"./chunk-7CEWM7GE.js";import{a as X,b as wt}from"./chunk-TX43EE6N.js";import{a as z}from"./chunk-N23ZYP7G.js";import{a as ee,b as ne,c as ie}from"./chunk-DXJFMERC.js";import{b as me}from"./chunk-7NWB2VB2.js";import"./chunk-IP2WADIR.js";import"./chunk-MEGPKKGI.js";import{a as rt,b as bt,d as Z,e as Yt}from"./chunk-2Y4N4NSS.js";import{a as nt}from"./chunk-RVULTBBA.js";import{a as B}from"./chunk-NNPT3RN6.js";import"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import{a as oe}from"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as L}from"./chunk-IOH6ZWW2.js";import{b as G,e as A}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as J,l as R,m as Qt}from"./chunk-PIDUM6XT.js";import{t as vt,u as qt}from"./chunk-43TMSPFC.js";import{P as Zt}from"./chunk-4TYJR476.js";import{b as zt,c as ot,h as W,k as K,u as Ht}from"./chunk-F5YRASNU.js";import{b as Y,c as _}from"./chunk-2UXFUEON.js";import{$ as Lt,B as y,Eb as j,F as kt,Fb as m,Gb as Ct,Ha as N,Hb as I,Ia as c,Ja as x,Jb as D,Kb as T,Lb as E,O as Vt,Ob as et,Pb as ct,Q as Ut,T as H,V as lt,Wb as F,X as _t,Xb as k,Y as At,Ya as S,Yb as jt,Zb as it,_a as s,aa as Rt,bd as xt,c as gt,ca as Bt,cd as Kt,d as Ft,ed as Pt,ga as M,gd as Jt,ha as $t,kb as a,lb as l,mb as C,nb as b,oa as u,ob as v,pa as h,q as at,qb as P,rc as V,sc as U,tb as f,vb as p,vc as ft,wc as Gt,yc as St,zc as Wt}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var ve=()=>["/menu/products/download/by-url"],ue=(()=>{let r=class r{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"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],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(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),C(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),m(11,"Download Product By Url"),l()()()()()(),C(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",et(2,ve)))},dependencies:[Xt,Kt,Pt]});let o=r;return o})();function Ie(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.onOpenScanDialog())}),C(1,"i",14),m(2," Scan Channel "),l()}}function we(o,r){if(o&1&&(b(0),S(1,Ie,3,0,"button",12),v()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function ye(o,r){if(o&1){let n=P();b(0),a(1,"button",15),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Me(o,r){if(o&1){let n=P();b(0),a(1,"button",16),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",17),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Ne(o,r){if(o&1){let n=P();a(0,"div",18)(1,"app-product-card",19),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null?null:n.Variants.length)>1?(n==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function Fe(o,r){o&1&&(b(0),a(1,"div",20),C(2,"app-empty-state"),l(),v())}function Oe(o,r){if(o&1){let n=P();b(0),a(1,"div",21)(2,"div",22)(3,"app-custom-paginator",23),f("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPrevPage())}),l()()(),v()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var ge=(()=>{let r=class r{constructor(t,e,i,d,g){this.http=t,this.toastr=e,this.dialog=i,this.productService=d,this.authService=g,this.searchFilter=new q,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,[Y.Tokopedia,Y.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(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(O,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.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 e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(It,{data:{title:this.products[t].Name,variants:this.products[t].Variants},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>_.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>_.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onNextPage(){this.getProducts()}onPrevPage(){this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok]);this.dialog.open(O,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(d=>_.IsNotEmpty(d))).subscribe(d=>{this.searchFilter.ChannelID=d.ChannelID,this.searchFilter.ScanFull=d.ScanFull,this.searchFilter.UpdatedProduct=d.UpdatedProduct;let g=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(g);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=_.GuidEMpty,this.dialog.open(O,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(d)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=_.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}};r.\u0275fac=function(e){return new(e||r)(x(A),x(G),x(J),x(B),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:22,vars:13,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[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","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","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[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"]],template:function(e,i){if(e&1){let d=P();a(0,"mainpanel",1),f("onSubmit",function(w){return u(d),h(i.searchProduct(w))}),a(1,"actions"),S(2,we,2,1,"ng-container",2)(3,ye,4,1,"ng-container",2)(4,Me,4,1,"ng-container",2),l(),a(5,"filters")(6,"div")(7,"label",3),m(8,"Category"),l(),a(9,"ng-select",4),f("ngModelChange",function(w){return u(d),h(i.searchFilter.Category=w)}),l()(),a(10,"div",5)(11,"mat-date-range-input",6)(12,"input",7),E("ngModelChange",function(w){return u(d),T(i.startDate,w)||(i.startDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l(),a(13,"input",8),E("ngModelChange",function(w){return u(d),T(i.endDate,w)||(i.endDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l()(),C(14,"mat-date-range-picker",null,0),l()(),a(16,"content")(17,"div",9)(18,"div",10),S(19,Ne,2,10,"div",11)(20,Fe,3,0,"ng-container",2),l(),S(21,Oe,4,4,"ng-container",2),l()()()}if(e&2){let d=j(15);s("headerTitle","In POS ("+i.rowCount+")"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",d),c(),D("ngModel",i.startDate),c(),D("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[V,U,ot,W,K,R,Z,z,X,$,le,re,ae,ce],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}"]});let o=r;return o})();function De(o,r){if(o&1){let n=P();b(0),a(1,"button",10),f("click",function(){u(n);let e=p();return h(e.onOpenScanDialog())}),C(2,"i",11),m(3," Scan Channel "),l(),v()}}function Te(o,r){if(o&1){let n=P();b(0),a(1,"button",12),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",11),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function Ee(o,r){if(o&1){let n=P();b(0),a(1,"button",13),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function ke(o,r){if(o&1&&(a(0,"span",15),C(1,"img",16),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,N)("alt",n.Name),c(),I(" ",n.Name," ")}}function Ve(o,r){if(o&1){let n=P();a(0,"div",17)(1,"label",18),m(2,"Item ID"),l(),a(3,"input",19),E("ngModelChange",function(e){u(n);let i=p();return T(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),h(e)}),l()()}if(o&2){let n=p();c(3),D("ngModel",n.searchFilter.Item_id)}}function Ue(o,r){if(o&1){let n=P();a(0,"div",20)(1,"app-product-card",21),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenVariantDetail(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function Ae(o,r){o&1&&(b(0),a(1,"div",22),C(2,"app-empty-state"),l(),v())}function Le(o,r){if(o&1){let n=P();a(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var _e=(()=>{let r=class r{constructor(t,e,i,d,g,w){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.activateRouter=g,this.authService=w,this.searchFilter=new q,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=_.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=_.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.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(e=>{this.products=e.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 e=this.products[t].Variants;this.dialog.open(It,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(O,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.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(y(e=>e)).subscribe(e=>{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(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(_.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(O,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanProducts(d)})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>_.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}onScanMultipleProduct(){this.searchFilter.ChannelID=_.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(O,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let d=this.productService.selectedProduct(this.products),g=this.productService.getVariantCodesProducts(d);this.scanProducts(g)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=_.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=_.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>_.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(G),x(B),x(xt),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],decls:18,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],[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","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","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[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(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.searchProduct(g)}),a(1,"actions"),S(2,De,4,0,"ng-container",1)(3,Te,4,1,"ng-container",1)(4,Ee,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),m(8,"Channel"),l(),a(9,"ng-select",3),f("ngModelChange",function(g){return i.searchFilter.ListChannelID=g})("clear",function(){return i.onClearFilterChannel()}),S(10,ke,3,3,"ng-template",4),l()(),S(11,Ve,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),S(15,Ue,2,10,"div",8)(16,Ae,3,0,"ng-container",1),l(),S(17,Le,3,4,"div",9),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[V,U,ot,W,K,R,Z,rt,bt,z,X,$],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}"]});let o=r;return o})();var Ce=(()=>{let r=class r{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new Ft(null),this.destroy$=new gt,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,e){e==0?this.disableNextButton=!0:this.disableNextButton=!(e<t.RowCount*t.PageNumber)}reloadPagination(t){_.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,e){t.RowCount=e,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new Ft(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(lt(this.destroy$),y(t=>t!=null),kt(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(at(e=>e.Data))),At(this.pagination$),Vt((t,e)=>{let[i,d]=t,[g]=e;return d.PageNumber==1?[g,d]:[i.concat(g),d]}),_t(([t,e])=>{this.setPageNumberFooter(e),this.setPaginationButtonState(e,t.length)}),at(([t])=>t),Ut())}};r.\u0275fac=function(e){return new(e||r)(Bt(A))},r.\u0275prov=Lt({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();function $e(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.uploadMultipleProduct())}),C(1,"i",14),m(2),l()}if(o&2){let n=p(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function je(o,r){if(o&1){let n=P();b(0),a(1,"td",29)(2,"input",30),E("ngModelChange",function(e){u(n);let i=p(2).$implicit;return T(i.selected,e)||(i.selected=e),h(e)}),f("ngModelChange",function(){u(n);let e=p(3).ngIf,i=p(3);return h(i.onSelectProduct(e))}),l()(),v()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),D("ngModel",n.selected)}}function Ge(o,r){if(o&1){let n=P();b(0),a(1,"img",35),f("click",function(e){u(n);let i=p(3).$implicit,d=p(4);return h(d.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),v()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,N)}}function We(o,r){o&1&&C(0,"img",36)}function Ke(o,r){if(o&1&&(b(0),a(1,"td",29)(2,"div",31),S(3,Ge,2,1,"ng-container",11)(4,We,1,0,"ng-template",null,1,it),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),m(9),l()()(),v()),o&2){let n=j(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),I(" ",t==null?null:t.Name," ")}}function Je(o,r){if(o&1&&(a(0,"div")(1,"a",25),C(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,N),c(),s("src",n.Img,N)("matTooltip",n.Name)}}function ze(o,r){if(o&1&&(a(0,"div"),C(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,N)("matTooltip",n.Name)}}function He(o,r){if(o&1&&(a(0,"tr"),S(1,je,3,2,"ng-container",12)(2,Ke,10,6,"ng-container",12),a(3,"td"),m(4),l(),a(5,"td")(6,"span"),m(7),l(),a(8,"span",24)(9,"a",25),C(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),S(13,Je,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),S(16,ze,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),N),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function Ye(o,r){if(o&1&&(b(0),S(1,He,17,7,"tr",23),v()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function Ze(o,r){if(o&1&&(a(0,"tbody"),S(1,Ye,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function qe(o,r){if(o&1&&(b(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),C(5,"th",18),a(6,"th",19),m(7,"Product"),l(),a(8,"th",20),m(9,"Variant"),l(),a(10,"th",20),m(11,"SKU"),l(),a(12,"th",21),m(13,"Available In"),l(),a(14,"th",22),m(15,"Not Available In"),l()()(),S(16,Ze,2,1,"tbody",12),F(17,"async"),l()(),v()),o&2){let n=p(2);c(16),s("ngIf",k(17,1,n.data$))}}function Qe(o,r){o&1&&(a(0,"div",38),C(1,"app-empty-state"),l())}function Xe(o,r){if(o&1){let n=P();a(0,"span",46),f("click",function(){u(n);let e=p(4);return h(e.getRowCount())}),a(1,"i",47),m(2,"?"),l()()}}function tn(o,r){if(o&1&&(a(0,"span"),m(1),F(2,"number"),l()),o&2){let n=r.ngIf;c(),Ct(k(2,1,n==null?null:n.Count))}}function en(o,r){if(o&1){let n=P();a(0,"a",48),f("click",function(){u(n);let e=p(4);return h(e.onNextPage())}),C(1,"i",49),m(2," Next"),l()}}function nn(o,r){if(o&1){let n=P();a(0,"a",50),f("click",function(){u(n);let e=p(4);return h(e.onLastPage())}),C(1,"i",51),m(2," Last"),l()}}function on(o,r){if(o&1&&(b(0),a(1,"div",39)(2,"div",40)(3,"div",41),m(4),F(5,"number"),S(6,Xe,3,0,"span",42)(7,tn,3,3,"span",12),F(8,"async"),m(9),l()(),a(10,"div",43),S(11,en,3,0,"a",44)(12,nn,3,0,"a",45),l()(),v()),o&2){let n=p().ngIf,t=p(2);c(4),I(" Showing 1 - ",k(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&k(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function rn(o,r){if(o&1&&(b(0),S(1,on,13,10,"ng-container",12),v()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function an(o,r){if(o&1){let n=P();a(0,"mainpanel",3),f("onSubmit",function(e){u(n);let i=p();return h(i.searchProduct(e))}),a(1,"actions"),S(2,$e,3,1,"button",4),a(3,"button",5),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(4,"i",6),m(5," Scan Channel "),l(),a(6,"button",7),f("click",function(){u(n);let e=p();return h(e.openExportDialog())}),C(7,"i",8),a(8,"span"),m(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),S(13,qe,18,3,"ng-container",11),F(14,"async"),S(15,Qe,2,0,"ng-template",null,0,it),l(),S(17,rn,2,1,"ng-container",12),F(18,"async"),l()()()}if(o&2){let n,t=j(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=k(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",k(18,7,e.data$))}}var fe=(()=>{let r=class r{constructor(t,e,i,d,g,w,Et){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.paginationService=g,this.biggerPictureService=w,this.authService=Et,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Et.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(_t(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(at(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=_.getChannelLogoByTypeId(e.TypeID),e)),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(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=_.GuidEMpty,this.dialog.open(O,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.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,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){let t=this.getUniqueChannels();t=t.map(e=>(e.ID=e.ChannelID,e)),this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:t}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e)),H(e=>{let i=this.getSelectedProductIds();return this.productService.uploadNotInChannel(i,e)})).subscribe({next:()=>{this.paginationService.reloadPagination(this.filterSearch),this.selectedProducts=[],this.hasSelectionProduct=!1},error:e=>{this.selectedProducts=[],this.hasSelectionProduct=!1}})}getSelectedProductIds(){return this.selectedProducts.map(e=>({ID:e.ProductID}))}getUniqueChannels(){let t=[];return this.selectedProducts.forEach(e=>{t=[...t,...e.Variants[0].NotAvailable]}),t=t.filter((e,i,d)=>d.findIndex(g=>g.ChannelID==e.ChannelID)==i),t}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(pe,{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()}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(G),x(B),x(Ce),x(oe),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],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-lg","fa-external-link-alt","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(e,i){e&1&&(S(0,an,19,9,"mainpanel",2),F(1,"async")),e&2&&s("ngIf",k(1,1,i.loader$))},dependencies:[V,U,zt,W,K,R,vt,$,ft,St],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%}"]});let o=r;return o})();var ln=o=>[o],cn=()=>[];function sn(o,r){if(o&1){let n=P();a(0,"button",15),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(1,"i",16),m(2," Scan Channel "),l()}}function pn(o,r){if(o&1){let n=P();b(0),a(1,"button",17),f("click",function(){u(n);let e=p();return h(e.onDownloadAllProduct("SELECTED"))}),C(2,"i",18),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function dn(o,r){if(o&1&&(a(0,"span",19),C(1,"img",20),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,N)("alt",n.Name),c(),I(" ",n.Name," ")}}function mn(o,r){if(o&1){let n=P();a(0,"div",21)(1,"app-product-card",22),f("onCheckBoxChange",function(e){let i=u(n).index,d=p();return h(d.onSelectProduct(e,i))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onShowVariantDetail(e))})("onDownload",function(){let e=u(n).$implicit,i=p();return h(i.onDownloadProduct(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?ct(10,ln,n==null?null:n.Channel):et(12,cn))("showCheckBox",!0)("scanButton",!0)}}function un(o,r){o&1&&(b(0),a(1,"div",23),C(2,"app-empty-state"),l(),v())}function hn(o,r){if(o&1){let n=P();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var Se=(()=>{let r=class r{constructor(t,e,i,d,g,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=d,this.activateRouter=g,this.authService=w,this.searchFilter=new q,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.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(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?_.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=_.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(e=>{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(_.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=_.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(O,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].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 e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(_.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 e=this.products[t].Variant;e.length>0&&this.dialog.open(de,{data:{title:this.products[t].Name,variants:e},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(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(B),x(G),x(xt),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],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(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.onSearch(g)}),a(1,"actions"),S(2,sn,3,0,"button",1)(3,pn,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),m(7,"Channel"),l(),a(8,"ng-select",4),E("ngModelChange",function(g){return T(i.searchFilter.ChannelID,g)||(i.searchFilter.ChannelID=g),g}),S(9,dn,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),m(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),E("ngModelChange",function(g){return T(i.searchFilter.HaveSku,g)||(i.searchFilter.HaveSku=g),g}),a(14,"mat-radio-button",9),m(15," All "),l(),a(16,"mat-radio-button",9),m(17," Yes "),l(),a(18,"mat-radio-button",9),m(19," No "),l()()(),a(20,"div",6)(21,"label",7),m(22,"Item ID"),l(),a(23,"input",10),E("ngModelChange",function(g){return T(i.searchFilter.Item_id,g)||(i.searchFilter.Item_id=g),g}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),S(27,mn,2,13,"div",13)(28,un,3,0,"ng-container",2),l(),S(29,hn,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),D("ngModel",i.searchFilter.ChannelID),c(5),D("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),D("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,ot,W,K,R,Z,rt,ee,ne,z,X,$],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}"]});let o=r;return o})();function gn(o,r){if(o&1&&(a(0,"span",9),C(1,"img",10),l(),m(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),N),c(),I(" ",n.Name," ")}}function _n(o,r){if(o&1&&(a(0,"div",11),C(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function Cn(o,r){o&1&&(b(0),a(1,"div",13),C(2,"app-empty-state"),l(),v())}function fn(o,r){if(o&1){let n=P();b(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),f("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPrevPage())})("total",function(){u(n);let e=p();return h(e.getRowCount())}),l()()(),v()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var xe=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new q,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.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(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=_.GuidEMpty}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(x(A),x(B),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],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(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.onSearch(g)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),m(5,"Channel"),l(),a(6,"ng-select",3),E("ngModelChange",function(g){return T(i.searchFilter.ListChannelID,g)||(i.searchFilter.ListChannelID=g),g}),f("clear",function(){return i.onClearFilter()}),S(7,gn,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),S(11,_n,2,6,"div",7)(12,Cn,3,0,"ng-container",8),l(),S(13,fn,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),D("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,W,K,R,Z,rt,bt,wt,z,$]});let o=r;return o})();var Sn=()=>["/menu/products/status/sold-in-channel"],Pe=o=>({ID:o}),xn=()=>["/menu/products/status/not-in-pos"];function Pn(o,r){if(o&1&&(b(0),m(1),v()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function bn(o,r){if(o&1){let n=P();a(0,"span",26),f("click",function(){u(n);let e=p().$implicit,i=p(2);return h(i.getLiveProductCount(e.ID,e))}),C(1,"i",27),l()}}function vn(o,r){if(o&1){let n=P();a(0,"tr")(1,"td"),C(2,"img",17),a(3,"span",18),m(4),l()(),a(5,"td",19),S(6,Pn,2,1,"ng-container",6)(7,bn,2,0,"ng-template",null,1,it),l(),a(9,"td",19)(10,"a",20),m(11),F(12,"number"),l()(),a(13,"td",19)(14,"a",20),m(15),F(16,"number"),l()(),a(17,"td"),m(18),F(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onScanChannel(e))}),C(23,"i",23),m(24," Scan "),l(),a(25,"button",24),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onClearCache(e.ID))}),C(26,"i",25),m(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=j(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),N),c(2),Ct(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",et(18,Sn))("queryParams",ct(19,Pe,n.ID)),c(),I(" ",k(12,11,n.SoldInChannel)," "),c(3),s("routerLink",et(21,xn))("queryParams",ct(22,Pe,n.ID)),c(),I(" ",k(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?jt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function In(o,r){if(o&1&&(b(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),m(6,"Channel"),l(),a(7,"th",11),m(8,"Live Product"),l(),a(9,"th",12),m(10,"Sold In Channel"),l(),a(11,"th",13),m(12,"Product Not in POS"),l(),a(13,"th",14),m(14,"Last Sync"),l(),C(15,"th",15),l()(),a(16,"tbody"),S(17,vn,28,24,"tr",16),F(18,"async"),l()()(),v()),o&2){let n,t=p();c(17),s("ngForOf",(n=k(18,1,t.channels$))==null?null:n.Data)}}function wn(o,r){o&1&&(a(0,"div",28),C(1,"app-empty-state"),l())}var be=(()=>{let r=class r{constructor(t,e,i,d){this.productService=t,this.toastr=e,this.dialog=i,this.authService=d,this.destroy$=new gt,this.channelOptions=d.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(lt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(O,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(d=>d)).subscribe(d=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(d,i,!e.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(lt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(x(B),x(G),x(J),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],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(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),S(5,In,19,3,"ng-container",6),F(6,"async"),S(7,wn,2,0,"ng-template",null,0,it),l()()()()()),e&2){let d,g=j(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((d=k(6,4,i.channels$))==null||d.Data==null?null:d.Data.length)>0)("ngIfElse",g)}},dependencies:[V,U,R,vt,Pt,$,ft,St,Gt]});let o=r;return o})();var yn=[{component:ue,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:ge,canActivate:[nt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:_e,canActivate:[nt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:fe,canActivate:[nt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Se,canActivate:[nt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:xe,canActivate:[nt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:be,canActivate:[nt],data:{title:"Channel Statistic"}}]}],Bi=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=$t({type:r}),r.\u0275inj=Rt({imports:[Wt,Ht,Qt,qt,Yt,me,ie,te,wt,z,X,Jt.forChild(yn),se,Zt]});let o=r;return o})();export{Bi as StatusModule};
@@ -1 +1 @@
1
- import{a as v,b}from"./chunk-7CEWM7GE.js";import{a as r}from"./chunk-M3P5OJ7T.js";import"./chunk-PVQ2T5XH.js";import"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import"./chunk-2UXFUEON.js";import{Ia as s,Nb as f,_a as u,aa as l,cd as h,ga as m,gd as i,ha as c,kb as d,lb as C,mb as a,zc as o}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var T=(()=>{let e=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"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-ZIAISN44.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-B6W4BWFY.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-5US3733H.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
1
+ import{a as v,b}from"./chunk-7CEWM7GE.js";import{a as r}from"./chunk-RVULTBBA.js";import"./chunk-IOH6ZWW2.js";import"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import"./chunk-2UXFUEON.js";import{Ia as s,Nb as f,_a as u,aa as l,cd as h,ga as m,gd as i,ha as c,kb as d,lb as C,mb as a,zc as o}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var T=(()=>{let e=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"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-Y7E7FG5M.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-JAFFZL32.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-O7ORKR43.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};