marketplacepos 2.7.3 → 2.7.4

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 (49) hide show
  1. package/Marketplace/174.df8669b6311f928d.js +1 -0
  2. package/Marketplace/25.b70d86f301c02577.js +1 -0
  3. package/Marketplace/360.d6aa15ddc2dfdd69.js +1 -0
  4. package/Marketplace/369.ca96e7763e20bf72.js +1 -0
  5. package/Marketplace/392.f4537160149f627a.js +1 -0
  6. package/Marketplace/397.defbf293e15c7185.js +1 -0
  7. package/Marketplace/3rdpartylicenses.txt +0 -50
  8. package/Marketplace/512.2796526d3f4c83f5.js +1 -0
  9. package/Marketplace/516.23780ce40d15b408.js +1 -0
  10. package/Marketplace/587.2e5583c1fa20a173.js +1 -0
  11. package/Marketplace/61.868e35095821a091.js +1 -0
  12. package/Marketplace/616.b7e1ec6933570169.js +1 -0
  13. package/Marketplace/628.145c54d491d3a429.js +1 -0
  14. package/Marketplace/643.3295801f0b4936a8.js +1 -0
  15. package/Marketplace/717.26634e93ca9b60ed.js +1 -0
  16. package/Marketplace/72.b0c5b137e38d6dbc.js +1 -0
  17. package/Marketplace/833.b0b60f1bcc7f56c1.js +1 -0
  18. package/Marketplace/859.b43bda3adda95fa3.js +1 -0
  19. package/Marketplace/863.490933ee2cce9279.js +1 -0
  20. package/Marketplace/874.8531eff61a70fef4.js +1 -0
  21. package/Marketplace/913.08c7bf72f6b8e4f8.js +1 -0
  22. package/Marketplace/997.6b3f954f35ff3ac0.js +1 -0
  23. package/Marketplace/index.html +2 -2
  24. package/Marketplace/main.26e031734fa543d6.js +1 -0
  25. package/Marketplace/runtime.1fd3a054bc12a0de.js +1 -0
  26. package/Marketplace/{styles.ca007450064f7ae0.css → styles.bd36b2077413d718.css} +1 -1
  27. package/package.json +1 -1
  28. package/Marketplace/174.ef0e2b8b4c9d2b0b.js +0 -1
  29. package/Marketplace/25.43ab1ee524b9049a.js +0 -1
  30. package/Marketplace/291.779ede87479fb9b2.js +0 -1
  31. package/Marketplace/360.45dba871a275bde4.js +0 -1
  32. package/Marketplace/369.fe9dd78b5ae1f834.js +0 -1
  33. package/Marketplace/397.5668d07ae2910130.js +0 -1
  34. package/Marketplace/512.8bb0df7db698606b.js +0 -1
  35. package/Marketplace/516.6cbc60a45960d8fd.js +0 -1
  36. package/Marketplace/587.b913510ac1ecfe12.js +0 -1
  37. package/Marketplace/61.b5326b8a8507ca2b.js +0 -1
  38. package/Marketplace/616.ce2eff13bf85dd2a.js +0 -1
  39. package/Marketplace/628.161d18d5f92f87c9.js +0 -1
  40. package/Marketplace/643.cee753340fd82dfa.js +0 -1
  41. package/Marketplace/717.b70435564cbfa38c.js +0 -1
  42. package/Marketplace/72.23a9b1a59cf7bfca.js +0 -1
  43. package/Marketplace/796.f712080a257b33c0.js +0 -1
  44. package/Marketplace/863.73daa64a1cf098b8.js +0 -1
  45. package/Marketplace/874.23cc68e9ff331b03.js +0 -1
  46. package/Marketplace/913.c2ffbc12dd99b85d.js +0 -1
  47. package/Marketplace/997.c2b107d851cf971c.js +0 -1
  48. package/Marketplace/main.f4b54c0122a625bf.js +0 -1
  49. package/Marketplace/runtime.aa1e68d995bcf102.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[863],{7398:(ot,N,l)=>{l.d(N,{Z:()=>x,e:()=>f});var p=l(6895),t=l(266),I=l(6806),h=l(4650);function R(_,u){if(1&_&&(h.TgZ(0,"li",2)(1,"a",3),h._uU(2),h.qZA()()),2&_){const r=u.$implicit;h.xp6(1),h.s9C("routerLink",r.Url),h.Q6J("title",r.Description?r.Description:""),h.xp6(1),h.hij(" ",r.Title," ")}}class f{}f.\u0275fac=function(u){return new(u||f)},f.\u0275cmp=h.Xpm({type:f,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs"},decls:2,vars:1,consts:[[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],["routerLinkActive","active","class","nav-item me-6",4,"ngFor","ngForOf"],["routerLinkActive","active",1,"nav-item","me-6"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink","title"]],template:function(u,r){1&u&&(h.TgZ(0,"ul",0),h.YNc(1,R,3,3,"li",1),h.qZA()),2&u&&(h.xp6(1),h.Q6J("ngForOf",r.Tabs))},dependencies:[p.sg,I.rH,I.Od]});class x{}x.\u0275fac=function(u){return new(u||x)},x.\u0275mod=h.oAB({type:x}),x.\u0275inj=h.cJS({imports:[p.ez,I.Bz,t.AV]})},9863:(ot,N,l)=>{l.r(N),l.d(N,{StatusModule:()=>E});var p=l(6895),t=l(4650),I=l(7398),h=l(6806);const R=function(){return["/menu/products/download/by-url"]};class f{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 Listed SKU",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"}]}ngOnInit(){}}f.\u0275fac=function(e){return new(e||f)},f.\u0275cmp=t.Xpm({type:f,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,n){1&e&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()(),t.TgZ(4,"div")(5,"div",3)(6,"a",4),t._UZ(7,"i",5),t.qZA(),t.TgZ(8,"div",6)(9,"div",7)(10,"a",8),t._uU(11,"Download Product By Url"),t.qZA()()()()()(),t._UZ(12,"router-outlet")),2&e&&(t.xp6(3),t.Q6J("Tabs",n.productTabs),t.xp6(7),t.Q6J("routerLink",t.DdM(2,R)))},dependencies:[I.e,h.lC,h.rH]});var x=l(1290),_=l(8231),u=l(5412),r=l(3154),g=l(9694),S=(()=>{return(i=S||(S={})).Tokopedia="https://seller.tokopedia.com",i.Shoope="https://seller.shopee.co.id",i.Tiktok="https://seller-id.tiktok.com",i.WooCommerce="https://woocommerce.dealpos.app",i.Lazada="https://sellercenter.lazada.co.id",S;var i})(),Q=l(6779),F=l(266),Y=l(6401);function tt(i,e){if(1&i&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",11),t._uU(3),t.qZA(),t.TgZ(4,"td",11),t._uU(5),t.qZA(),t.TgZ(6,"td",12)(7,"p",13),t._uU(8,"Product Not in Channel!"),t.qZA()()(),t.BQk()),2&i){const n=t.oxw().$implicit;t.xp6(3),t.hij(" ",null==n?null:n.Model,""),t.xp6(2),t.hij(" ",null==n?null:n.Code,"")}}function W(i,e){if(1&i&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&i){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Model,"")}}function nt(i,e){if(1&i&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&i){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Code,"")}}const T=function(i){return{"is-disabled":i}};function y(i,e){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,W,2,2,"td",14),t.YNc(2,nt,2,2,"td",14),t.TgZ(3,"td",11)(4,"div",15)(5,"a",16),t._UZ(6,"img",17),t.qZA(),t.TgZ(7,"div",18),t._uU(8),t.qZA()()(),t.TgZ(9,"td",11),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",19),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",19)(16,"a",20),t._UZ(17,"i",21),t.TgZ(18,"span",22),t._uU(19,"Edit"),t.qZA()()()()),2&i){const n=e.$implicit,o=e.index,a=t.oxw(3);t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(3),t.Q6J("href",n.Url,t.LSH)("title",n.Title),t.xp6(1),t.Q6J("src",a.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.Q6J("matTooltip",(null==n||null==n.Name?null:n.Name.length)>55?null==n?null:n.Name:""),t.xp6(1),t.hij(" ",n.Name," "),t.xp6(2),t.Oqu(t.lcZ(11,12,n.Price)),t.xp6(3),t.Oqu(t.lcZ(14,14,n.Inventory)),t.xp6(3),t.Q6J("href",a.getHyperlinkSellerCenter(n),t.LSH)("ngClass",t.VKq(16,T,n.TypeID==a.channelType.KalCare))("matTooltip",n.TypeID!=a.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function d(i,e){if(1&i&&t.YNc(0,y,20,18,"tr",8),2&i){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function C(i,e){if(1&i&&(t.ynx(0),t.YNc(1,tt,9,2,"ng-container",9),t.YNc(2,d,1,1,"ng-template",null,10,t.W1O),t.BQk()),2&i){const n=e.$implicit,o=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",o)}}class P{constructor(e,n){this.data=e,this.dialogRef=n,this.channelType=g.x,this.variants=e.variants,this.title=e.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new Q.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(e){return r.g.getChannelLogoByTypeId(e)}getHyperlinkSellerCenter(e){let n="javascript:void(0)";switch(e.TypeID){case g.x.ShopeeV2:n=`${S.Shoope}/portal/product/${e.ChannelItemID}`;break;case g.x.Tiktok:n=`${S.Tiktok}/product/edit/${e.ChannelItemID}`;break;case g.x.Tokopedia:n=`${S.Tokopedia}/edit-product/${e.ChannelItemID}`;break;case g.x.WooCommerce:n=`${S.WooCommerce}/wp-admin/post.php?post=${e.ChannelItemID}&action=edit`;break;case g.x.Lazada:n=`${S.Lazada}/apps/product/publish?productId=${e.ChannelItemID}`}return n}}P.\u0275fac=function(e){return new(e||P)(t.Y36(u.WI),t.Y36(u.so))},P.\u0275cmp=t.Xpm({type:P,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return n.dialogRef.close()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),t._uU(6," VARIANT "),t.TgZ(7,"sup"),t._UZ(8,"i",5),t.qZA()(),t.TgZ(9,"th",4),t._uU(10,"SKU"),t.qZA(),t.TgZ(11,"th",4),t._uU(12," PRODUCT "),t.TgZ(13,"sup"),t._UZ(14,"i",6),t.qZA()(),t.TgZ(15,"th",4),t._uU(16,"PRICE"),t.qZA(),t.TgZ(17,"th",7),t._uU(18,"INVENTORY"),t.qZA(),t._UZ(19,"th",4),t.qZA()(),t.TgZ(20,"tbody"),t.YNc(21,C,4,2,"ng-container",8),t.qZA()()()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(21),t.Q6J("ngForOf",n.variants))},dependencies:[p.mk,p.sg,p.O5,F.gM,Y.M,p.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});var m=l(9300),O=l(7579),Z=l(2722),A=l(3900),v=l(9646),U=l(9568),D=l(1318);class k{constructor(e,n){this.LocalData=e,this.httpService=n}getCategoriesByTypeId(e,n){return this.LocalData.getCategoriesByChannelType(e).pipe((0,A.w)(o=>null!=o?(0,v.of)(o):this._getCategoriesByTypeID(e,n)))}_getCategoriesByTypeID(e,n){return this.httpService.post("/api/Channel/getCategoriesByTypeID",{TypeID:e,ID:n}).pipe((0,A.w)(a=>this.LocalData.saveCategoriesByChannelType(a,e)))}}k.\u0275fac=function(e){return new(e||k)(t.LFG(U.T),t.LFG(D.O))},k.\u0275prov=t.Yz7({token:k,factory:k.\u0275fac,providedIn:"root"});var J=l(6082),B=l(7185),b=l(4006),at=l(7963);function lt(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"app-select-search",16),t.NdJ("onSelect",function(a){t.CHM(n);const s=t.oxw().index,c=t.oxw();return t.KtG(c.onSelectCategory(a,s))}),t.qZA(),t.BQk()}if(2&i){const n=t.oxw().$implicit;t.xp6(1),t.Q6J("data",n.Categories)("batchSize",30)}}function rt(i,e){if(1&i&&(t.TgZ(0,"div",17),t._UZ(1,"input",18),t.qZA()),2&i){const n=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Q6J("placeholder",o.getChannelCategory(n.TypeID))}}function st(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"tr")(2,"td",9)(3,"input",10),t.NdJ("ngModelChange",function(a){const c=t.CHM(n).$implicit;return t.KtG(c.Selected=a)})("ngModelChange",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onSelectChannel())}),t.qZA()(),t.TgZ(4,"td")(5,"div",11),t._UZ(6,"img",12),t.TgZ(7,"span",13),t._uU(8),t.qZA()()(),t.TgZ(9,"td"),t.YNc(10,lt,2,2,"ng-container",14),t.YNc(11,rt,2,1,"ng-template",null,15,t.W1O),t.qZA()(),t.BQk()}if(2&i){const n=e.$implicit,o=t.MAs(12);t.xp6(3),t.Q6J("ngModel",n.Selected),t.xp6(3),t.Q6J("src",n.Img,t.LSH),t.xp6(2),t.Oqu(n.Name),t.xp6(2),t.Q6J("ngIf",n.Categories.length>0)("ngIfElse",o)}}class M{constructor(e,n,o,a,s){this.data=e,this.channelService=n,this.productService=o,this.dialogRef=a,this.toastrService=s,this.channelOptions=[],this.uploadResponse=[],this.channelType=g.x,this.enableBtnOk=!1,this.destroy$=new O.x,this.uploadResponse=[],this.channels=this.data.channels,this.products=this.data.products,this.isMultipleProduct=e.multipleProduct}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new Q.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(n=>{this.channelService.getCategoriesByTypeId(n.channelType,n.channelId).pipe((0,Z.R)(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(n.channelType,o)})})}setCategoriesChannelOption(e,n){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==e&&(o.Categories=n),o))}initChannelOptions(){this.channelOptions=this.channels.map(e=>({Name:e.Name,Img:e.Img,ID:e.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(e.TypeID),TypeID:e.TypeID,Categories:[]}))}initDefaultChannelCategoryId(e){let n=0;return e===g.x.Lazada&&(n=6509),n}filterChannelTypeId(){return this.data.channels.map(n=>({channelType:n.TypeID,channelId:n.ID})).filter((n,o,a)=>a.findIndex(s=>n.channelType==s.channelType)==o).filter(n=>n.channelType==g.x.Tokopedia)}onSelectCategory(e,n){this.channelOptions[n].CategoryID=e,this.channelOptions[n].Selected=!0,this.onSelectChannel()}onSelectAllChannel(e){this.channelOptions=this.channelOptions.map(n=>(n.Selected=e,n)),this.enableBtnOk=e}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return-1!==this.channelOptions.findIndex(e=>e.Selected)}onClose(){this.dialogRef.close("CANCEL")}onSave(){if(!this.validateSelectedCategory())return void this.toastrService.warning("Category is required","Warning!");const e=this.channelOptions.filter(n=>n.Selected).map(n=>({CategoryID:n.CategoryID,ChannelID:n.ID}));this.submitToServer(e)}validateSelectedCategory(){return-1==this.channelOptions.filter(n=>n.Selected).filter(n=>n.TypeID==g.x.Tokopedia).findIndex(n=>0==n.CategoryID)}submitToServer(e){this.isMultipleProduct?this.uploadMultipleProduct(e):this.uploadSingleProduct(e)}uploadMultipleProduct(e){this.productService.uploadMultipleProduct(this.products,e).subscribe({next:n=>{this.dialogRef.close(n),this.productService.showToastrSuccessUploadMultiple(n,this.data.products[0])},error:n=>{this.dialogRef.close("ERROR"),this.productService.showToastErrorUploadMultiple(n,this.data.products[0])}})}uploadSingleProduct(e){this.productService.uploadSingleProduct(this.products,e).subscribe({next:n=>{this.dialogRef.close(n),this.productService.showToastrSuccessUploadMultiple(n,this.data.products[0])},error:n=>{this.dialogRef.close("ERROR"),this.productService.showToastErrorUploadMultiple(n,this.data.products[0])}})}getChannelCategory(e){let n;switch(e){case g.x.ShopeeV2:n="Perlengkapan Rumah Lainnya";break;case g.x.Tiktok:n="Perlengkapan Rumah - Dekorasi Rumah - Poster & Produck Cetak";break;case g.x.WooCommerce:n="New Product";break;case g.x.Lazada:n="Fashion Accessories / Women Accessories / Others";break;default:n="Unavailable Category"}return n}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}M.\u0275fac=function(e){return new(e||M)(t.Y36(u.WI),t.Y36(k),t.Y36(J.M),t.Y36(u.so),t.Y36(B._W))},M.\u0275cmp=t.Xpm({type:M,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"d-flex","align-items-center"],["alt","",1,"channel-logo-size",3,"src"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["EMPTY",""],["appearance","outline","bindLabel","Value","bindValue","Key","placeholder","Select Category",3,"data","batchSize","onSelect"],["matTooltip","Product Category is Harcoded, Please Change Product Category in Seller Center","matTooltipPosition","above","matTooltipClass","custom-width-tooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return n.onSave()})("onClose",function(){return n.onClose()})("onCancel",function(){return n.onClose()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3)(6,"input",4),t.NdJ("change",function(a){return n.onSelectAllChannel(a.target.checked)}),t.qZA()(),t.TgZ(7,"th",5)(8,"span",6),t._uU(9,"CHANNEL"),t.qZA()(),t.TgZ(10,"th",7)(11,"span",6),t._uU(12,"CATEGORY"),t.qZA()()()(),t.TgZ(13,"tbody"),t.YNc(14,st,13,5,"ng-container",8),t.qZA()()()()),2&e&&(t.Q6J("dynamicValidated",n.enableBtnOk)("config",n.modalConfig),t.xp6(14),t.Q6J("ngForOf",n.channelOptions))},dependencies:[p.sg,p.O5,b.Wl,b.JJ,b.On,F.gM,Y.M,at.h],styles:["input[type=checkbox]{width:15px;height:15px}img.channel-logo-size{width:24px;height:24px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}\n"],encapsulation:2});var L=l(7481),V=l(6732),X=l(6956);function ct(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",10),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onOpenScanDialog())}),t._UZ(1,"i",11),t._uU(2," Scan Channel "),t.qZA()}}function dt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",12),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScanMultipleProduct())}),t._UZ(1,"i",11),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();let o;t.xp6(2),t.hij(" Scan (",null==(o=n.productService.selectedProduct(n.products))?null:o.length,") ")}}function pt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onUploadMultipleProduct())}),t._UZ(1,"i",14),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();let o;t.xp6(2),t.hij(" Upload (",null==(o=n.productService.selectedProduct(n.products))?null:o.length,") ")}}function ht(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",15)(1,"app-product-card",16),t.NdJ("onUpload",function(){const s=t.CHM(n).$implicit,c=t.oxw();return t.KtG(c.onUploadToMultipleChannel(s))})("onScan",function(){const s=t.CHM(n).$implicit,c=t.oxw();return t.KtG(c.onScanSingleProduct(s))})("onDescEvent",function(){const s=t.CHM(n).index,c=t.oxw();return t.KtG(c.onOpenDialogVariant(s))})("onCheckBoxChange",function(a){const c=t.CHM(n).$implicit;return t.KtG(c.selected=a)}),t.qZA()()}if(2&i){const n=e.$implicit,o=t.oxw();t.xp6(1),t.Q6J("productId",n.ID)("title",null==n?null:n.Name)("image",null==n?null:n.ThumbnailUrl)("description",(null==n?null:n.Variants.length)>1?(null==n?null:n.Variants.length)+" Variants":null)("channels",o.productService.getChannelProduct(n))("code",o.getVariantCode(null==n?null:n.Variants))("showCheckBox",(null==n?null:n.Channel.length)<o.channelOptions.length)("scanButton",!0)("uploadButton",null==n?null:n.hasUpload)("imageForZoom",null==n?null:n.ImageUrl)}}class ${constructor(e,n,o,a){this.http=e,this.toastr=n,this.dialog=o,this.productService=a,this.searchFilter=new x.k,this.rowCount=0,this.getLoaderPage()}getLoaderPage(){this.productService.loader().subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter.PageNumber=e.Filter.PageNumber,this.searchFilter.RowCount=e.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.PageSize=100,this.getProducts()})}getProducts(){this.http.post("/api/product/GetInPOS",{PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text}).subscribe(n=>{this.products=n.Data,this.rowCount=null==n.Total?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=r.g.GuidEMpty,this.dialog.open(_.j,{data:{filter:e,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,m.h)(o=>r.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAllProduct()})}scanAllProduct(){null!=this.searchFilter.ChannelID?this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(e,n,!this.searchFilter.UpdatedProduct)}}):this.toastr.error("Please Select Channel","Error")}onOpenDialogVariant(e){this.dialog.open(P,{data:{title:this.products[e].Name,variants:this.products[e].Variants},width:"50%"})}onUploadMultipleProduct(){let e=this.productService.selectedProduct(this.products),n=this.productService.filterUnselectedChannel(e,this.channelOptions);this.dialog.open(M,{width:"700px",data:{title:"Upload Multiple Product",channels:n,products:e,multipleProduct:!0}}).afterClosed().pipe((0,m.h)(o=>"CANCEL"!==o)).subscribe({next:o=>{this.getProducts()}})}onUploadToMultipleChannel(e){let n=this.productService.getChannelProduct(e);e.Channel=n;let o=this.productService.filterUnselectedChannel([e],this.channelOptions);this.dialog.open(M,{width:"700px",data:{title:`Upload - ${e.Name}`,channels:o,products:[e]}}).afterClosed().pipe((0,m.h)(a=>"CANCEL"!==a)).subscribe(a=>{this.getProducts()})}searchProduct(e){this.searchFilter.text=e,this.getProducts()}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}onScanMultipleProduct(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=r.g.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[g.x.Tokopedia,g.x.Tiktok]);this.dialog.open(_.j,{data:{filter:e,channelOptions:n,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,m.h)(a=>r.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct;let s=this.productService.selectedProduct(this.products),c=this.productService.getVariantCodesProducts(s);this.scanSingleProduct(c)})}onScanSingleProduct(e){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=r.g.GuidEMpty,this.dialog.open(_.j,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,m.h)(o=>r.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID;const a=this.productService.getVariantCodesProduct(e);this.scanSingleProduct(a)})}scanSingleProduct(e){this.productService.scanSingle(this.searchFilter.ChannelID,e).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${o?.Name} `,"Error")}this.searchFilter.ChannelID=r.g.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=r.g.GuidEMpty}})}getVariantCode(e){let n;return e.length>1&&(n=(e[0].model?e[0].model:"")+e[0].Code),1==e.length&&(n=e[0].Code),n}}$.\u0275fac=function(e){return new(e||$)(t.Y36(D.O),t.Y36(B._W),t.Y36(u.uw),t.Y36(J.M))},$.\u0275cmp=t.Xpm({type:$,selectors:[["app-in-pos"]],decls:12,vars:9,consts:[["hideSearchDropdown","true","hideSearchDropdown","false","description","All products which is already available in POS",3,"headerTitle","onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",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"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous"],["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,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onScan","onDescEvent","onCheckBoxChange"]],template:function(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(a){return n.searchProduct(a)}),t.TgZ(1,"actions"),t.YNc(2,ct,3,0,"button",1),t.YNc(3,dt,3,1,"button",2),t.YNc(4,pt,3,1,"button",3),t.qZA(),t.TgZ(5,"content")(6,"div",4)(7,"div",5),t.YNc(8,ht,2,10,"div",6),t.qZA(),t.TgZ(9,"div",7)(10,"div",8)(11,"app-custom-paginator",9),t.NdJ("next",function(){return n.onNextPage()})("previous",function(){return n.onPrevPage()}),t.qZA()()()()()()),2&e&&(t.Q6J("headerTitle","In POS ("+n.rowCount+")"),t.xp6(2),t.Q6J("ngIf",!n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(4),t.Q6J("ngForOf",n.products),t.xp6(3),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0))},dependencies:[p.sg,p.O5,L.p,V.y,X.Y],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}"]});var w=l(8796);function ut(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onOpenScanDialog())}),t._UZ(1,"i",14),t._uU(2," Scan Channel "),t.qZA()}}function gt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",15),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScanMultipleProduct())}),t._UZ(1,"i",14),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();t.xp6(2),t.hij(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function mt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",16),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onUploadMultipleProductSingleChannel())}),t._UZ(1,"i",17),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();t.xp6(2),t.hij(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function _t(i,e){if(1&i&&(t.TgZ(0,"span",18),t._UZ(1,"img",19),t.qZA(),t._uU(2)),2&i){const n=e.item,o=t.oxw();t.xp6(1),t.Q6J("src",o.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}function Ct(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div")(1,"h6"),t._uU(2,"Item ID"),t.qZA(),t.TgZ(3,"input",20),t.NdJ("ngModelChange",function(a){t.CHM(n);const s=t.oxw();return t.KtG(s.searchFilter.Item_id=a)}),t.qZA()()}if(2&i){const n=t.oxw();t.xp6(3),t.Q6J("ngModel",n.searchFilter.Item_id)}}function ft(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",21)(1,"app-product-card",22),t.NdJ("onUpload",function(){const s=t.CHM(n).$implicit,c=t.oxw();return t.KtG(c.onUploadToMultipleChannel(s))})("onDescEvent",function(){const s=t.CHM(n).index,c=t.oxw();return t.KtG(c.onOpenVariantDetail(s))})("onScan",function(){const s=t.CHM(n).$implicit,c=t.oxw();return t.KtG(c.onScanSingleProduct(s))})("onCheckBoxChange",function(a){const c=t.CHM(n).$implicit;return t.KtG(c.selected=a)}),t.qZA()()}if(2&i){const n=e.$implicit,o=t.oxw();t.xp6(1),t.Q6J("productId",null==n?null:n.ID)("title",null==n?null:n.Name)("image",null==n?null:n.ThumbnailUrl)("description",(null==n||null==n.Variants?null:n.Variants.length)>1?(null==n||null==n.Variants?null:n.Variants.length)+" Variants":null)("channels",o.productService.getChannelProduct(n))("code",o.getVariantCode(null==n?null:n.Variants))("showCheckBox",null==n?null:n.hasScan)("scanButton",!0)("uploadButton",null==n?null:n.hasUpload)("imageForZoom",null==n?null:n.ImageUrl)}}function xt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),t.NdJ("total",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getRowCount())})("next",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onNextPage())})("previous",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onPreviousPage())}),t.qZA()()()}if(2&i){const n=t.oxw();t.xp6(2),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}class K{constructor(e,n,o,a,s){this.http=e,this.dialog=n,this.toastr=o,this.productService=a,this.activateRouter=s,this.searchFilter=new x.k,this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=r.g.GuidEMpty}ngOnInit(){this.activateRouter.queryParams.subscribe(e=>{this.initPageLoader(e.ID?e.ID:r.g.GuidEMpty)})}initPageLoader(e){this.productService.loader(e).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,n.Filter.ChannelID!=r.g.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}getProducts(){this.productService.findAllSoldInChannel({ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id}).subscribe(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(e){this.searchFilter.text=e,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(e){this.dialog.open(P,{data:{variants:this.products[e].Variants,title:this.products[e].Name},width:"50%"})}onOpenScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=r.g.GuidEMpty,this.dialog.open(_.j,{data:{filter:e,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,m.h)(o=>r.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAllProduct()})}scanAllProduct(){let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe((0,m.h)(n=>n)).subscribe(n=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(n,e,!this.searchFilter.UpdatedProduct),this.initPageLoader(r.g.GuidEMpty))})}onScanSingleProduct(e){e.Channel=this.productService.getChannelProduct(e);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(_.j,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,m.h)(o=>r.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID;const a=this.productService.getVariantCodesProduct(e);this.scanProduct(a)})}onUploadToMultipleChannel(e){let n=this.productService.getChannelProduct(e);e.Channel=n;let o=this.productService.filterUnselectedChannel([e],this.channelOptions);this.dialog.open(M,{width:"700px",data:{title:`Upload - ${e.Name}`,channels:o,products:[e]}}).afterClosed().pipe((0,m.h)(a=>"CANCEL"!==a)).subscribe({next:a=>{this.getProducts()}})}onScanMultipleProduct(){let e=this.productService.filterChannelByTypeId(this.channelOptions,[g.x.Tokopedia,g.x.Tiktok]);this.searchFilter.ChannelID=r.g.GuidEMpty;let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(_.j,{data:{filter:n,channelOptions:e,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,m.h)(a=>r.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct;let s=this.productService.selectedProduct(this.products),c=this.productService.getVariantCodesProducts(s);this.scanProduct(c)})}scanProduct(e){this.productService.scanSingle(this.searchFilter.ChannelID,e).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${o?.Name} `,"Error")}this.searchFilter.ChannelID=r.g.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=r.g.GuidEMpty}})}getVariantCode(e){let n;return e.length>1&&(n=(e[0].model?e[0].model:"")+e[0].Code),1==e.length&&(n=e[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=r.g.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProductSingleChannel(){let e=this.productService.selectedProduct(this.products),n=this.productService.filterUnselectedChannel(e,this.channelOptions);this.dialog.open(M,{width:"700px",data:{title:"Upload Multiple Product",channels:n,products:e,multipleProduct:!0}}).afterClosed().pipe((0,m.h)(o=>"CANCEL"!==o)).subscribe({next:o=>{this.getProducts()}})}getRowCount(){this.http.post("/api/product/GetSoldInChannelRowCount",{ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text}).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(e){return r.g.getChannelLogoByTypeId(e)}}K.\u0275fac=function(e){return new(e||K)(t.Y36(D.O),t.Y36(u.uw),t.Y36(B._W),t.Y36(J.M),t.Y36(h.gz))},K.\u0275cmp=t.Xpm({type:K,selectors:[["app-sold-in-channel"]],decls:19,vars:10,consts:[["headerTitle","Sold in Channel","description","SKU has been mapped between dealpos and marketplace",3,"onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[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"],["alt","",2,"width","18px",3,"src"],["type","text","name","Item_id","id","Item_id",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onDescEvent","onScan","onCheckBoxChange"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(a){return n.searchProduct(a)}),t.TgZ(1,"actions"),t.YNc(2,ut,3,0,"button",1),t.YNc(3,gt,3,1,"button",2),t.YNc(4,mt,3,1,"button",3),t.qZA(),t.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),t._uU(10,"Channel"),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(a){return n.searchFilter.ListChannelID=a})("clear",function(){return n.onClearFilterChannel()}),t.YNc(12,_t,3,2,"ng-template",7),t.qZA()(),t.YNc(13,Ct,4,1,"div",8),t.qZA()()(),t.TgZ(14,"content")(15,"div",9)(16,"div",10),t.YNc(17,ft,2,10,"div",11),t.qZA(),t.YNc(18,xt,3,4,"div",12),t.qZA()()()),2&e&&(t.xp6(2),t.Q6J("ngIf",!n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(7),t.Q6J("clearable",!0)("multiple",!0)("items",n.channelOptions)("ngModel",n.searchFilter.ListChannelID),t.xp6(2),t.Q6J("ngIf",null!=n.searchFilter.ListChannelID),t.xp6(4),t.Q6J("ngForOf",n.products),t.xp6(1),t.Q6J("ngIf",null==n.products?null:n.products.length))},dependencies:[p.sg,p.O5,b.Fj,b.JJ,b.On,L.p,w.w9,w.ir,V.y,X.Y],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}"]});var G=l(8063),Pt=l(8505),bt=l(4004),St=l(9425),vt=l(1739);function It(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"img",28),t.NdJ("click",function(a){t.CHM(n);const s=t.oxw(3).$implicit,c=t.oxw(3);return t.KtG(c.onZoomImage(a,null==s?null:s.ImageUrl))}),t.qZA(),t.BQk()}if(2&i){const n=t.oxw(3).$implicit;t.xp6(1),t.Q6J("src",null==n?null:n.ImageUrl,t.LSH)}}function Tt(i,e){1&i&&t._UZ(0,"img",29)}function yt(i,e){if(1&i&&(t.ynx(0),t.TgZ(1,"td",21)(2,"div",22),t.YNc(3,It,2,1,"ng-container",23),t.YNc(4,Tt,1,0,"ng-template",null,24,t.W1O),t.qZA()(),t.TgZ(6,"td",25)(7,"h4",26)(8,"span",27),t._uU(9),t.qZA()()(),t.BQk()),2&i){const n=t.MAs(5),o=t.oxw(2).$implicit;t.xp6(1),t.Q6J("rowSpan",null==o?null:o.Variants.length),t.xp6(2),t.Q6J("ngIf",null==o?null:o.ImageUrl)("ngIfElse",n),t.xp6(3),t.Q6J("rowSpan",null==o?null:o.Variants.length),t.xp6(2),t.Q6J("matTooltip",(null==o||null==o.Name?null:o.Name.length)>50?null==o?null:o.Name:""),t.xp6(1),t.hij(" ",null==o?null:o.Name," ")}}function Mt(i,e){if(1&i&&(t.TgZ(0,"div")(1,"a",17),t._UZ(2,"img",30),t.qZA()()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("href",n.URL,t.LSH),t.xp6(1),t.Q6J("src",n.Img,t.LSH)("matTooltip",n.Name)}}function Ot(i,e){if(1&i&&(t.TgZ(0,"div"),t._UZ(1,"img",30),t.qZA()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("src",n.Img,t.LSH)("matTooltip",n.Name)}}function wt(i,e){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,yt,10,6,"ng-container",13),t.TgZ(2,"td"),t._uU(3),t.qZA(),t.TgZ(4,"td")(5,"span"),t._uU(6),t.qZA(),t.TgZ(7,"span",16)(8,"a",17),t._UZ(9,"i",18),t.qZA()()(),t.TgZ(10,"td",19)(11,"div",20),t.YNc(12,Mt,3,3,"div",15),t.qZA()(),t.TgZ(13,"td",19)(14,"div",20),t.YNc(15,Ot,2,2,"div",15),t.qZA()()()),2&i){const n=e.$implicit,o=e.index,a=t.oxw(4);t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(2),t.hij(" ",n.Name," "),t.xp6(3),t.hij(" ",n.Code," "),t.xp6(2),t.Q6J("href","https://"+a.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==n?null:n.ID),t.LSH),t.xp6(4),t.Q6J("ngForOf",null==n?null:n.Available),t.xp6(3),t.Q6J("ngForOf",null==n?null:n.NotAvailable)}}function Nt(i,e){if(1&i&&(t.ynx(0),t.YNc(1,wt,16,6,"tr",15),t.BQk()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("ngForOf",n.Variants)}}function Ft(i,e){if(1&i&&(t.TgZ(0,"tbody"),t.YNc(1,Nt,2,1,"ng-container",15),t.qZA()),2&i){const n=e.ngIf;t.xp6(1),t.Q6J("ngForOf",n)}}function Zt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"span",38),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(3);return t.KtG(a.getRowCount())}),t.TgZ(1,"i",39),t._uU(2,"?"),t.qZA()()}}function At(i,e){if(1&i&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&i){const n=e.ngIf;t.xp6(1),t.Oqu(t.lcZ(2,1,null==n?null:n.Count))}}function Ut(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"a",40),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(3);return t.KtG(a.onNextPage())}),t._UZ(1,"i",41),t._uU(2," Next"),t.qZA()}}function Dt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"a",42),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(3);return t.KtG(a.onLastPage())}),t._UZ(1,"i",43),t._uU(2," Last"),t.qZA()}}function kt(i,e){if(1&i&&(t.TgZ(0,"div",31)(1,"div",32)(2,"div",33),t._uU(3),t.ALo(4,"number"),t.YNc(5,Zt,3,0,"span",34),t.YNc(6,At,3,3,"span",13),t.ALo(7,"async"),t._uU(8),t.qZA()(),t.TgZ(9,"div",35),t.YNc(10,Ut,3,0,"a",36),t.YNc(11,Dt,3,0,"a",37),t.qZA()()),2&i){const n=e.ngIf,o=t.oxw(2);t.xp6(3),t.hij(" Showing 1 - ",t.lcZ(4,6,null==n?null:n.length)," of "),t.xp6(2),t.Q6J("ngIf",o.paginationService.hideCount),t.xp6(1),t.Q6J("ngIf",!o.paginationService.hideCount&&t.lcZ(7,8,o.rowCount$)),t.xp6(2),t.hij(" records ~ ",o.paginationService.footerPageNumber," Page "),t.xp6(2),t.Q6J("ngIf",o.paginationService.disableNextButton&&!o.paginationService.goToLastPage),t.xp6(1),t.Q6J("ngIf",o.paginationService.disableNextButton&&!o.paginationService.goToLastPage)}}function Jt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"mainpanel",1),t.NdJ("onSubmit",function(a){t.CHM(n);const s=t.oxw();return t.KtG(s.searchProduct(a))}),t.TgZ(1,"actions")(2,"button",2),t.NdJ("click",function(){const s=t.CHM(n).ngIf,c=t.oxw();return t.KtG(c.openScanDialog(s))}),t._UZ(3,"i",3),t._uU(4," Scan Channel "),t.qZA()(),t.TgZ(5,"content")(6,"div",4)(7,"div",5)(8,"div",6)(9,"table",7)(10,"thead",8)(11,"tr")(12,"th",9),t._uU(13,"Product"),t.qZA(),t.TgZ(14,"th",10),t._uU(15,"Variant"),t.qZA(),t.TgZ(16,"th",10),t._uU(17,"SKU"),t.qZA(),t.TgZ(18,"th",11),t._uU(19,"Available In"),t.qZA(),t.TgZ(20,"th",12),t._uU(21,"Not Available In"),t.qZA()()(),t.YNc(22,Ft,2,1,"tbody",13),t.ALo(23,"async"),t.qZA()()(),t.YNc(24,kt,12,10,"div",14),t.ALo(25,"async"),t.qZA()()()}if(2&i){const n=t.oxw();t.Q6J("hideSearchDropdown",!0),t.xp6(22),t.Q6J("ngIf",t.lcZ(23,3,n.data$)),t.xp6(2),t.Q6J("ngIf",t.lcZ(25,5,n.data$))}}class H{constructor(e,n,o,a,s,c){this.http=e,this.dialog=n,this.toastr=o,this.productService=a,this.paginationService=s,this.biggerPictureService=c,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2"}ngOnInit(){this.initPageLoader(),this.iniData(),this.initHostName()}initHostName(){const e=localStorage.getItem("Authorization");this.hostName=JSON.parse(e)?.Host}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe((0,Pt.b)(e=>{this.filterSearch=e.Filter,this.paginationService.resetToFirstPage(e.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe((0,bt.U)(e=>e.map(n=>(n.Variants=n.Variants.map(o=>(o.Available=this.productService.sortChannel(o.Available),o.NotAvailable=this.productService.sortChannel(o.NotAvailable),o.Available=this.assignLogoChannel(o.Available),o.NotAvailable=this.assignLogoChannel(o.NotAvailable),o)),n))))}assignLogoChannel(e){return e.map(n=>(n.Img=r.g.getChannelLogoByTypeId(n.TypeID),n))}searchProduct(e){this.filterSearch.text=e,this.paginationService.resetToFirstPage(this.filterSearch)}scanAllProduct(e){let n=this.productService.findChannelById(this.filterSearch.ChannelID,e.Options.Channel);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(o=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(o,n,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(e){let n=JSON.parse(JSON.stringify(this.filterSearch));n.ChannelID=r.g.GuidEMpty,this.dialog.open(_.j,{data:{filter:n,channelOptions:e.Options.Channel},width:"40%"}).afterClosed().pipe((0,m.h)(a=>r.g.IsNotEmpty(a))).subscribe(a=>{this.filterSearch.ChannelID=a.ChannelID,this.filterSearch.ScanFull=a.ScanFull,this.filterSearch.UpdatedProduct=a.UpdatedProduct,this.filterSearch.Async=a.Async,this.scanAllProduct(e)})}getChannelLogoById(e){return r.g.getChannelLogoByTypeId(e)}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:e=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,e.Count)}})}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}ngOnDestroy(){this.paginationService.destroy()}}function Lt(i,e){if(1&i&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA()()),2&i){const n=e.$implicit;t.xp6(2),t.Oqu(null==n?null:n.Name),t.xp6(2),t.Oqu(null==n?null:n.ChannelVariationSKU)}}H.\u0275fac=function(e){return new(e||H)(t.Y36(D.O),t.Y36(u.uw),t.Y36(B._W),t.Y36(J.M),t.Y36(St.b),t.Y36(vt.k))},H.\u0275cmp=t.Xpm({type:H,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["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,"hideSearchDropdown","onSubmit"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngIf"],["class","d-flex justify-content-between mt-5",4,"ngIf"],[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"],[2,"padding-right","0px"],[4,"ngIf","ngIfElse"],["elsePic",""],[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,"src","click"],["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","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,n){1&e&&(t.YNc(0,Jt,26,7,"mainpanel",0),t.ALo(1,"async")),2&e&&t.Q6J("ngIf",t.lcZ(1,1,n.loader$))},dependencies:[p.sg,p.O5,L.p,F.gM,p.Ov,p.JJ],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%}"]});class q{constructor(e,n){this.data=e,this.dialogRef=n}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new Q.O,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}}q.\u0275fac=function(e){return new(e||q)(t.Y36(u.WI),t.Y36(u.so))},q.\u0275cmp=t.Xpm({type:q,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return n.dialogRef.close()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th"),t._uU(6,"Variant"),t.qZA(),t.TgZ(7,"th"),t._uU(8,"SKU"),t.qZA()()(),t.TgZ(9,"tbody"),t.YNc(10,Lt,5,2,"tr",4),t.qZA()()()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(10),t.Q6J("ngForOf",n.data.variants))},dependencies:[p.sg,Y.M],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]});var et=l(1948);function Et(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.openScanDialog())}),t._UZ(1,"i",14),t._uU(2," Scan Channel "),t.qZA()}}function Rt(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"button",15),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownloadAllProduct("SELECTED"))}),t._UZ(2,"i",16),t._uU(3),t.qZA(),t.BQk()}if(2&i){const n=t.oxw();let o;t.xp6(3),t.hij(" Download (",null==(o=n.productService.selectedProduct(n.products))?null:o.length,") ")}}function Qt(i,e){if(1&i&&(t.TgZ(0,"span",17),t._UZ(1,"img",18),t.qZA(),t._uU(2)),2&i){const n=e.item,o=t.oxw();t.xp6(1),t.Q6J("src",o.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}const Yt=function(i){return[i]},Bt=function(){return[]};function Vt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",19)(1,"app-product-card",20),t.NdJ("onCheckBoxChange",function(a){const c=t.CHM(n).index,Xt=t.oxw();return t.KtG(Xt.onSelectProduct(a,c))})("onDescEvent",function(){const s=t.CHM(n).index,c=t.oxw();return t.KtG(c.onShowVariantDetail(s))})("onDownload",function(){const s=t.CHM(n).$implicit,c=t.oxw();return t.KtG(c.onDownloadProduct(s))})("onScan",function(){const s=t.CHM(n).$implicit,c=t.oxw();return t.KtG(c.onScanChannel(s))}),t.qZA()()}if(2&i){const n=e.$implicit;t.xp6(1),t.Q6J("showRedirectIcon",!1)("title",null==n?null:n.Name)("image",null==n?null:n.Image)("imageForZoom",null==n?null:n.Image)("code",null==n?null:n.SKU)("description",(null==n||null==n.Variant?null:n.Variant.length)>0?(null==n||null==n.Variant?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",null!=n&&n.Channel?t.VKq(10,Yt,null==n?null:n.Channel):t.DdM(12,Bt))("showCheckBox",!0)("scanButton",!0)}}function $t(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",21)(1,"div",22)(2,"app-custom-paginator",23),t.NdJ("total",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getRowCount())})("next",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onNextPage())})("previous",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onPreviousPage())}),t.qZA()()()}if(2&i){const n=t.oxw();t.xp6(2),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}class j{constructor(e,n,o,a,s){this.http=e,this.dialog=n,this.productService=o,this.toastrService=a,this.activateRouter=s,this.searchFilter=new x.k,this.hasClickRowCount=!1}ngOnInit(){this.activateRouter.queryParams.subscribe(e=>{this.initPageLoader(e.ID?e.ID:r.g.GuidEMpty)})}initPageLoader(e){this.productService.loader(e).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",{ChannelID:this.searchFilter.ChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,HaveSku:this.searchFilter.HaveSku}).subscribe(n=>{this.products=n.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){this.products=this.products.map(e=>(e.Channel=JSON.parse(JSON.stringify(this.channelOptions.find(n=>n.ID==e.ChannelID))),e)).map(e=>(e.Channel.Url=e.Url,e))}setSkuProduct(){this.products=this.products.map(e=>(e.SKU=0==e?.Variant?.length?r.g.IsNotEmpty(e?.ChannelItemSKU)?e?.ChannelItemSKU:"SKU not assigned":e?.Variant[0]?.ChannelVariationSKU?e?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",e))}onSearch(e){this.searchFilter.text=e,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=r.g.GuidEMpty}onScanAll(){let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(r.g.GuidEMpty),this.productService.successToastrScanAllProduct(n,e,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=r.g.GuidEMpty})}openScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=r.g.GuidEMpty,this.dialog.open(_.j,{data:{filter:e,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,m.h)(o=>r.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.Async=o.Async,this.onScanAll()})}onDownloadAllProduct(e){let n;n="ALL"==e?this.products:this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(e,n){this.products[n].selected=e}onDownloadProduct(e){confirm(`Are you sure you want to Retrieve product ${e?.Name} from ${e?.Channel.Name} to POS?`)&&this.productService.downloadProduct(e).subscribe({next:()=>{this.getProducts()}})}onScanChannel(e){let n=JSON.parse(JSON.stringify(e));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(o=>{o.Status?(this.initPageLoader(r.g.GuidEMpty),this.toastrService.success(`product ${e.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${e.Name} is not existed in POS`,"Error")})}onShowVariantDetail(e){let n=this.products[e].Variant;n.length>0&&this.dialog.open(q,{data:{title:this.products[e].Name,variants:n},width:"30%"})}getRowCount(){let e={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",e).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(e){return r.g.getChannelLogoByTypeId(e)}}j.\u0275fac=function(e){return new(e||j)(t.Y36(D.O),t.Y36(u.uw),t.Y36(J.M),t.Y36(B._W),t.Y36(h.gz))},j.\u0275cmp=t.Xpm({type:j,selectors:[["app-not-in-pos"]],decls:27,vars:11,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,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],["name","haveSKU",1,"form-control","h-100","pt-3","rounded",3,"ngModel","ngModelChange"],[1,"me-5",3,"value"],[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"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton","onCheckBoxChange","onDescEvent","onDownload","onScan"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(a){return n.onSearch(a)}),t.TgZ(1,"actions"),t.YNc(2,Et,3,0,"button",1),t.YNc(3,Rt,4,1,"ng-container",2),t.qZA(),t.TgZ(4,"filters")(5,"div",3)(6,"div",4)(7,"div")(8,"h6"),t._uU(9,"Channel"),t.qZA(),t.TgZ(10,"ng-select",5),t.NdJ("ngModelChange",function(a){return n.searchFilter.ChannelID=a})("clear",function(){return n.onClearChannelFilter()}),t.YNc(11,Qt,3,2,"ng-template",6),t.qZA()(),t.TgZ(12,"div")(13,"h6"),t._uU(14,"SKU Assigned"),t.qZA(),t.TgZ(15,"mat-radio-group",7),t.NdJ("ngModelChange",function(a){return n.searchFilter.HaveSku=a}),t.TgZ(16,"mat-radio-button",8),t._uU(17," All "),t.qZA(),t.TgZ(18,"mat-radio-button",8),t._uU(19," Yes "),t.qZA(),t.TgZ(20,"mat-radio-button",8),t._uU(21," No "),t.qZA()()()()()(),t.TgZ(22,"content")(23,"div",9)(24,"div",10),t.YNc(25,Vt,2,13,"div",11),t.qZA(),t.YNc(26,$t,3,4,"div",12),t.qZA()()()),2&e&&(t.xp6(2),t.Q6J("ngIf",!n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(7),t.Q6J("clearable",!0)("items",n.channelOptions)("ngModel",n.searchFilter.ChannelID),t.xp6(5),t.Q6J("ngModel",n.searchFilter.HaveSku),t.xp6(1),t.Q6J("value",0),t.xp6(2),t.Q6J("value",1),t.xp6(2),t.Q6J("value",2),t.xp6(5),t.Q6J("ngForOf",n.products),t.xp6(1),t.Q6J("ngIf",(null==n.products?null:n.products.length)>0))},dependencies:[p.sg,p.O5,b.JJ,b.On,L.p,w.w9,w.ir,et.VQ,et.U0,V.y,X.Y],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}"]});var it=l(5631);function Kt(i,e){if(1&i&&(t.TgZ(0,"span",9),t._UZ(1,"img",10),t.qZA(),t._uU(2)),2&i){const n=e.item,o=t.oxw();t.xp6(1),t.Q6J("src",o.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}function Gt(i,e){if(1&i&&(t.TgZ(0,"div",12),t._UZ(1,"app-duplicate-product-card",13),t.qZA()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("image",n.ThumbnailURL)("channels",n.Channel)}}function Ht(i,e){if(1&i&&(t.ynx(0),t.YNc(1,Gt,2,5,"div",11),t.BQk()),2&i){const n=t.oxw();t.xp6(1),t.Q6J("ngForOf",n.products)}}function qt(i,e){1&i&&(t.TgZ(0,"div",14)(1,"div"),t._UZ(2,"i",15),t.qZA(),t.TgZ(3,"h4",16),t._uU(4,"No product found"),t.qZA(),t.TgZ(5,"h6",17),t._uU(6,"Once you have a duplicate product"),t.qZA(),t.TgZ(7,"h6",18),t._uU(8,"you`ll see them here"),t.qZA()())}function jt(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"div",19)(2,"div",20)(3,"app-custom-paginator",21),t.NdJ("next",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onNextPage())})("previous",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onPrevPage())})("total",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getRowCount())}),t.qZA()()(),t.BQk()}if(2&i){const n=t.oxw();t.xp6(3),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}class z{constructor(e,n){this.httpService=e,this.productService=n,this.searchFilter=new x.k,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader()}getPageLoader(){this.productService.loader().subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.channelOptions=e.Options.Channel,this.getProducts()})}getProducts(){this.httpService.post("/api/product/GetDuplicateInChannel",{ChannelID:this.searchFilter.ChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text}).subscribe(n=>{this.products=n.Data})}onSearch(e){this.searchFilter.text=e,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=r.g.GuidEMpty}getChannelLogo(e){return r.g.getChannelLogoByTypeId(e)}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getRowCount(){this.httpService.post("/api/product/GetDuplicateInChannelRowCount",{text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID}).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}}z.\u0275fac=function(e){return new(e||z)(t.Y36(D.O),t.Y36(J.M))},z.\u0275cmp=t.Xpm({type:z,selectors:[["app-duplicate-sku"]],decls:15,vars:6,consts:[["headerTitle","Multiple Listed SKU","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],[4,"ngIf","ngIfElse"],["EMPTY",""],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],[1,"text-secondary","fw-normal","m-2"],[1,"text-secondary","fw-normal"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous","total"]],template:function(e,n){if(1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(a){return n.onSearch(a)}),t.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),t._uU(5,"Channel"),t.qZA(),t.TgZ(6,"ng-select",2),t.NdJ("ngModelChange",function(a){return n.searchFilter.ChannelID=a})("clear",function(){return n.onClearFilter()}),t.YNc(7,Kt,3,2,"ng-template",3),t.qZA()()()(),t.TgZ(8,"content")(9,"div",4)(10,"div",5),t.YNc(11,Ht,2,1,"ng-container",6),t.YNc(12,qt,9,0,"ng-template",null,7,t.W1O),t.qZA(),t.YNc(14,jt,4,4,"ng-container",8),t.qZA()()()),2&e){const o=t.MAs(13);t.xp6(6),t.Q6J("clearable",!0)("items",n.channelOptions)("ngModel",n.searchFilter.ChannelID),t.xp6(5),t.Q6J("ngIf",(null==n.products?null:n.products.length)>0)("ngIfElse",o),t.xp6(3),t.Q6J("ngIf",(null==n.products?null:n.products.length)>0)}},dependencies:[p.sg,p.O5,b.JJ,b.On,L.p,w.w9,w.ir,it._,V.y]});var zt=l(8739);const Wt=[{component:f,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:$,canActivate:[G.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:K,canActivate:[G.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:H,canActivate:[G.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:j,canActivate:[G.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:z,canActivate:[G.a],data:{title:"Duplicate Sku in Channel"}}]}];class E{}E.\u0275fac=function(e){return new(e||E)},E.\u0275mod=t.oAB({type:E}),E.\u0275inj=t.cJS({imports:[p.ez,b.u5,L.R,F.AV,w.A0,zt.TU,et.Fk,I.Z,it._,V.y,X.Y,h.Bz.forChild(Wt)]})},9425:(ot,N,l)=>{l.d(N,{b:()=>T});var p=l(1135),t=l(7579),I=l(2722),h=l(9300),R=l(4351),f=l(4004),x=l(4482),_=l(5403),u=l(8421),r=l(4671),g=l(5032),S=l(3269),F=l(5026),Y=l(8505),tt=l(4782),W=l(4650),nt=l(1318);class T{constructor(d){this.http=d,this.pagination$=new p.X(null),this.destroy$=new t.x,this.data$=this.paginationFunction()}onNextPage(d){d.PageNumber+=1,this.pagination$.next(d)}setPageNumberFooter(d){this.footerPageNumber=d.PageNumber}setPaginationButtonState(d,C){this.disableNextButton=0==C||!(C<d.RowCount*d.PageNumber)}resetToFirstPage(d){d.PageNumber=1,this.pagination$.next(d),this.hideCount=!0,this.goToLastPage=!1}getAllData(d,C){d.RowCount=C,this.pagination$.next(d),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new p.X(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe((0,I.R)(this.destroy$),(0,h.h)(d=>null!=d),(0,R.b)(d=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(d)).pipe((0,f.U)(C=>C.Data))),function Q(...y){const d=(0,S.jO)(y);return(0,x.e)((C,P)=>{const m=y.length,O=new Array(m);let Z=y.map(()=>!1),A=!1;for(let v=0;v<m;v++)(0,u.Xf)(y[v]).subscribe((0,_.x)(P,U=>{O[v]=U,!A&&!Z[v]&&(Z[v]=!0,(A=Z.every(r.y))&&(Z=null))},g.Z));C.subscribe((0,_.x)(P,v=>{if(A){const U=[v,...O];P.next(d?d(...U):U)}}))})}(this.pagination$),(0,F.R)((d,C)=>{const[P,m]=d,[O]=C;return 1==m.PageNumber?[O,m]:[P.concat(O),m]}),(0,Y.b)(([d,C])=>{this.setPageNumberFooter(C),this.setPaginationButtonState(C,d.length)}),(0,f.U)(([d])=>d),(0,tt.d)())}}T.\u0275fac=function(d){return new(d||T)(W.LFG(nt.O))},T.\u0275prov=W.Yz7({token:T,factory:T.\u0275fac,providedIn:"root"})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[874],{1874:(Oe,D,l)=>{l.r(D),l.d(D,{PriceModule:()=>m});var s=l(6895),N=l(7398),I=l(7481),S=l(6806),p=l(4006),T=l(8796),e=l(4650);class C{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"}]}}C.\u0275fac=function(n){return new(n||C)},C.\u0275cmp=e.Xpm({type:C,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,t){1&n&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&n&&(e.xp6(3),e.Q6J("Tabs",t.priceTabs))},dependencies:[N.e,S.lC]});var J=l(8231),M=l(6304),U=l(8505),h=l(9300),_=l(3154),v=l(1318),Z=l(7185),y=l(5412),O=l(9425),F=l(6082),k=l(6114);function E(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",16),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.openScanDialog())}),e._UZ(1,"i",17),e._uU(2," Scan Channel "),e.qZA()}}function $(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,c=e.oxw(2);return e.KtG(c.onUpdateItems(i))}),e._UZ(1,"i",19),e._uU(2," Update "),e.qZA()}}function Y(o,n){if(1&o&&(e.TgZ(0,"div"),e.YNc(1,E,3,0,"button",14),e.YNc(2,$,3,0,"button",15),e.qZA()),2&o){const t=n.ngIf,a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!a.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",a.productService.hasSelectionVariant(t))}}function K(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",20)(1,"app-table",21),e.NdJ("onToggle",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.onShowDifferencePrice(i))})("onSubmit",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.updatePriceByVariant(i))}),e.ALo(2,"async"),e.qZA()()}if(2&o){const t=e.oxw().ngIf,a=e.oxw();e.xp6(1),e.Q6J("showProductToggle",!0)("data",e.lcZ(2,4,a.paginationService.data$))("channel",t.Options.Channel)("filter",t.Filter)}}function H(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",23),e._uU(2,"?"),e.qZA()()}}function R(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&o){const t=n.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t))}}function G(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",24),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onNextPage())}),e._UZ(1,"i",25),e._uU(2," Next"),e.qZA()}}function B(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",26),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onLastPage())}),e._UZ(1,"i",27),e._uU(2," Last"),e.qZA()}}function j(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("onSubmit",function(i){e.CHM(t);const c=e.oxw();return e.KtG(c.onSearch(i))}),e.TgZ(1,"actions")(2,"div",2),e.YNc(3,Y,3,2,"div",3),e.ALo(4,"async"),e.qZA()(),e.TgZ(5,"content")(6,"div",4)(7,"div",5),e.YNc(8,K,3,6,"div",6),e.ALo(9,"async"),e.qZA(),e.TgZ(10,"div",7)(11,"div",8)(12,"div",9),e._uU(13),e.ALo(14,"number"),e.ALo(15,"async"),e.YNc(16,H,3,0,"span",10),e.YNc(17,R,3,3,"span",3),e.ALo(18,"async"),e._uU(19),e.qZA()(),e.TgZ(20,"div",11),e.YNc(21,G,3,0,"a",12),e.YNc(22,B,3,0,"a",13),e.qZA()()()()()}if(2&o){const t=e.oxw();let a;e.Q6J("pageData",t.pageData)("hideSearchDropdown",!0)("textButton","Search"),e.xp6(3),e.Q6J("ngIf",e.lcZ(4,11,t.paginationService.data$)),e.xp6(5),e.Q6J("ngIf",e.lcZ(9,13,t.paginationService.data$)),e.xp6(5),e.hij(" Showing 1 - ",e.lcZ(14,15,null==(a=e.lcZ(15,17,t.paginationService.data$))?null:a.length)," of "),e.xp6(3),e.Q6J("ngIf",t.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",!t.paginationService.hideCount&&e.lcZ(18,19,t.allDataCount$)),e.xp6(2),e.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),e.xp6(2),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}class f{constructor(n,t,a,i,c){this.http=n,this.toastr=t,this.dialog=a,this.paginationService=i,this.productService=c,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe((0,U.b)(n=>{this.channelOptions=n.Options.Channel,n.Filter={PageNumber:n.Filter.PageNumber,RowCount:n.Filter.RowCount,filterModel:1},this.searchFilter=n.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onShowDifferencePrice(n){this.searchFilter.filterModel=1,n&&(this.searchFilter.filterModel=3),this.paginationService.resetToFirstPage(this.searchFilter)}onSearch(n){this.searchFilter.text=n,this.paginationService.resetToFirstPage(this.searchFilter)}openScanDialog(){this.searchFilter.ChannelID=_.g.GuidEMpty;let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(J.j,{data:{filter:n,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,h.h)(a=>_.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.initPageLoader(),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)}})}updatePrice(n){let t=this.productService.selectedVariantProduct(n);if(t.length>0){let i=t.map(r=>({ID:r.ID,Code:r.Code,Price:r.UnitPrice})),c={ListChannelID:this.channelOptions.filter(r=>r.selected).map(r=>r.ID),ListPrice:i};this.http.post("/api/Price/UpdateChannel",c).subscribe(r=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+c.ListPrice.length+" items in "+c.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(n){let t={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:n.Price-0,VariantID:n.ID};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(a=>{let i=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+n.ItemName+"("+n.VarName+") price in "+i.Name+" to "+t.Price,"Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onUpdateItems(n){const t=this.productService.selectedVariantProduct(n);this.dialog.open(M.j,{data:{selectedItems:t,channels:this.channelOptions},width:"40%"}).afterClosed().pipe((0,h.h)(a=>void 0!==a)).subscribe(a=>{this.channelOptions=a,this.updatePrice(n)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:n=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,n)}})}ngOnDestroy(){this.paginationService.destroy()}}f.\u0275fac=function(n){return new(n||f)(e.Y36(v.O),e.Y36(Z._W),e.Y36(y.uw),e.Y36(O.b),e.Y36(F.M))},f.\u0275cmp=e.Xpm({type:f,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","hideSearchDropdown","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,t){1&n&&(e.YNc(0,j,23,21,"mainpanel",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,t.loader$))},dependencies:[s.O5,I.p,k.a,s.Ov,s.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});var d=l(8705),L=l(7945),z=l(1290),Q=l(1739),w=l(1948);function W(o,n){if(1&o&&(e.TgZ(0,"mat-radio-button",3),e._uU(1),e.qZA()),2&o){const t=n.$implicit,a=n.index,i=e.oxw();e.Q6J("value",t.Key)("name",i.name)("title",i.tooltipsText[a]?i.tooltipsText[a]:""),e.xp6(1),e.hij(" ",t.Value,"")}}const X=function(o){return{"border-0 rounded":o}};class g{constructor(){this.modelChange=new e.vpe,this.border=!1,this.tooltipsText=[]}change(n){this.modelChange.emit(n)}}function ee(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",19),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onUpdateItems())}),e._UZ(1,"i",20),e._uU(2," Update "),e.qZA()}}function te(o,n){if(1&o&&(e.TgZ(0,"th",21),e._uU(1),e.qZA()),2&o){const t=n.$implicit;e.xp6(1),e.Oqu(t.Name)}}function ne(o,n){1&o&&(e.ynx(0),e.TgZ(1,"th",22),e._uU(2," Expected (POS) "),e.qZA(),e.TgZ(3,"th",22),e._uU(4," Channel "),e.qZA(),e.BQk())}function ie(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"img",34),e.NdJ("click",function(i){e.CHM(t);const c=e.oxw(3).$implicit,r=e.oxw();return e.KtG(r.onZoomImage(i,null==c?null:c.ImageUrl))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.s9C("src",null==t?null:t.ImageUrl,e.LSH)}}function oe(o,n){1&o&&e._UZ(0,"img",35)}g.\u0275fac=function(n){return new(n||g)},g.\u0275cmp=e.Xpm({type:g,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[e.jDz],decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0)(1,"mat-radio-group",1),e.NdJ("ngModelChange",function(i){return t.change(i)}),e.YNc(2,W,2,4,"mat-radio-button",2),e.qZA()()),2&n&&(e.Q6J("ngClass",e.VKq(3,X,0==t.border)),e.xp6(1),e.Q6J("ngModel",t.model),e.xp6(1),e.Q6J("ngForOf",t.options))},dependencies:[s.ez,s.mk,s.sg,w.Fk,w.VQ,w.U0,p.u5,p.JJ,p.On],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});const ae=function(o){return{"border-bottom":o}};function ce(o,n){if(1&o&&(e.ynx(0),e.TgZ(1,"td",29),e.YNc(2,ie,1,1,"img",30),e.YNc(3,oe,1,0,"ng-template",null,31,e.W1O),e.qZA(),e.TgZ(5,"td",32)(6,"h5",33),e._uU(7),e.qZA(),e._UZ(8,"br"),e.TgZ(9,"small"),e._uU(10),e.qZA()(),e.BQk()),2&o){const t=e.MAs(4),a=e.oxw().index,i=e.oxw().$implicit,c=e.oxw();e.xp6(1),e.Q6J("rowSpan",null==i?null:i.Variants.length)("ngClass",e.VKq(7,ae,a+1==c.products.length)),e.xp6(1),e.Q6J("ngIf",null==i?null:i.ImageUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",null==i?null:i.Variants.length),e.xp6(2),e.Oqu(null==i?null:i.Name),e.xp6(3),e.hij("(",null==i?null:i.Category,")")}}const re=function(o){return{"bg-gradient-warning":o}};function le(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"td",38),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"td",39),e.NdJ("click",function(){const c=e.CHM(t).$implicit,r=e.oxw(2).$implicit,b=e.oxw().$implicit,Ue=e.oxw();return e.KtG(Ue.openTableDialog(r,b,c))}),e.TgZ(5,"span",40),e._uU(6),e.ALo(7,"number"),e.qZA(),e.TgZ(8,"a",41),e.NdJ("click",function(i){return null==i?null:i.stopPropagation()}),e._UZ(9,"i",27),e.qZA()(),e.BQk()}if(2&o){const t=n.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,4,t.PriceExpected)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(8,re,t.Price!=t.PriceExpected)),e.xp6(2),e.hij(" ",e.lcZ(7,6,t.Price)," "),e.xp6(2),e.Q6J("href",t.Url,e.LSH)}}function se(o,n){1&o&&(e.TgZ(0,"td",42),e._uU(1,"X"),e.qZA(),e.TgZ(2,"td",42),e._uU(3,"X"),e.qZA())}function pe(o,n){if(1&o&&(e.ynx(0),e.YNc(1,le,10,10,"ng-container",36),e.YNc(2,se,4,0,"ng-template",null,37,e.W1O),e.BQk()),2&o){const t=n.$implicit,a=e.MAs(3),i=e.oxw().$implicit,c=e.oxw(2);e.xp6(1),e.Q6J("ngIf",c.getItemFromChannel(i,t.ID))("ngIfElse",a)}}function _e(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,ce,11,9,"ng-container",23),e.TgZ(2,"td",24),e._uU(3),e.qZA(),e.TgZ(4,"td",24)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",25)(8,"a",26),e._UZ(9,"i",27),e.qZA()()(),e.TgZ(10,"td",28)(11,"input",17),e.NdJ("ngModelChange",function(i){const r=e.CHM(t).$implicit;return e.KtG(r.selected=i)}),e.qZA()(),e.YNc(12,pe,4,2,"ng-container",18),e.qZA()}if(2&o){const t=n.$implicit,a=n.index,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",0==a),e.xp6(2),e.Oqu(null==t?null:t.Model),e.xp6(3),e.Oqu(null==t?null:t.Code),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(2),e.Q6J("hidden",null==i.searchFilter?null:i.searchFilter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",t.selected),e.xp6(1),e.Q6J("ngForOf",i.channelOptions)}}function he(o,n){if(1&o&&(e.TgZ(0,"tbody"),e.YNc(1,_e,13,7,"tr",18),e.qZA()),2&o){const t=n.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}class x{constructor(n,t,a,i,c){this.http=n,this.toastr=t,this.dialog=a,this.productService=i,this.biggerPictureService=c,this.searchFilter=new z.k,this.products=[],this.checkboxState=!1,this.initPageLoader(),this.filterTypeOptions=[{Key:d.v.ALL,Value:"All"},{Key:d.v.DIFFERENCE,Value:"Difference"}],this.filterType=d.v.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.hostName=i.getHostName()}initPageLoader(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.searchFilter.HiddenIPOSInventory=!1,this.onFilter()})}onSelectAllData(){this.products=this.products.map(n=>(n.Variants&&(n.Variants=n.Variants.map(t=>(t.selected=this.checkboxState,t))),n))}onFilter(n){this.http.post("/api/Price/GetOutletPrice",{text:n,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount}).subscribe(a=>{this.products=a.Data})}updatePrice(){let n=this.productService.selectedVariantProduct(this.products);if(n.length>0){let t=n.map(c=>c.ID),i={ListChannelID:this.channelOptions.filter(c=>c.selected).map(c=>c.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",i).subscribe({next:c=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+i.ListID.length+" items in "+i.ListChannelID.length+" channels","Success")},error:c=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(n=>(n.selected=!1,n))}getItemFromChannel(n,t){return n.Channel.find(a=>a.ChannelID==t)}onUpdateItems(){const n=this.productService.selectedVariantProduct(this.products);this.dialog.open(M.j,{data:{selectedItems:n,channels:this.channelOptions},width:"40%"}).afterClosed().pipe((0,h.h)(t=>_.g.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice()})}openTableDialog(n,t,a){let i=JSON.parse(JSON.stringify(n));this.dialog.open(L.k,{data:{Name:t.Name,Variant:i,ChannelID:a?.ChannelID,Table:"price",ChannelItemID:a?.ChannelItemID}}).afterClosed().pipe((0,h.h)(r=>_.g.IsNotEmpty(r))).subscribe(r=>{this.updateProductPrice(r,a)})}updateProductPrice(n,t){let a={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(i=>{t.Price=a.Price;const c=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) inventory in ${c.Name} to ${a.Price}`,"Success")})}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}}x.\u0275fac=function(n){return new(n||x)(e.Y36(v.O),e.Y36(Z._W),e.Y36(y.uw),e.Y36(F.M),e.Y36(Q.k))},x.\u0275cmp=e.Xpm({type:x,selectors:[["app-custom-channel-price"]],decls:31,vars:13,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"hidden"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle",3,"hidden"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(i){return t.onFilter(i)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Filter by"),e.qZA(),e.TgZ(6,"radio-options",2),e.NdJ("modelChange",function(i){return t.filterType=i}),e.qZA()()()(),e.TgZ(7,"actions")(8,"div",3),e.YNc(9,ee,3,0,"button",4),e.qZA()(),e.TgZ(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr"),e._UZ(18,"th",11),e.YNc(19,te,2,1,"th",12),e.qZA(),e.TgZ(20,"tr")(21,"th",13),e._uU(22,"Product"),e.qZA(),e.TgZ(23,"th",14),e._uU(24,"Variant"),e.qZA(),e.TgZ(25,"th",15),e._uU(26,"SKU"),e.qZA(),e.TgZ(27,"th",16)(28,"input",17),e.NdJ("ngModelChange",function(i){return t.checkboxState=i})("ngModelChange",function(){return t.onSelectAllData()}),e.qZA()(),e.YNc(29,ne,5,0,"ng-container",18),e.qZA()(),e.YNc(30,he,2,1,"tbody",18),e.qZA()()()()()()()),2&n&&(e.Q6J("pageData",t.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),e.xp6(6),e.Q6J("model",t.filterType)("options",t.filterTypeOptions)("border",!0),e.xp6(3),e.Q6J("ngIf",t.productService.hasSelectionVariant(t.products)),e.xp6(10),e.Q6J("ngForOf",t.channelOptions),e.xp6(8),e.Q6J("hidden",null==t.searchFilter?null:t.searchFilter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",t.checkboxState),e.xp6(1),e.Q6J("ngForOf",t.channelOptions),e.xp6(1),e.Q6J("ngForOf",t.products))},dependencies:[s.mk,s.sg,s.O5,p.Wl,p.JJ,p.On,I.p,g,s.JJ],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%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});var q=l(455),V=l(266);function de(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2).ngIf,c=e.oxw();return e.KtG(c.openScanDialog(i))}),e._UZ(1,"i",9),e._uU(2," Scan Channel "),e.qZA()}}function ge(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,c=e.oxw(2);return e.KtG(c.updateStock(i))}),e._UZ(1,"i",11),e._uU(2," Update "),e.qZA()}}function ue(o,n){if(1&o&&(e.TgZ(0,"actions")(1,"div",5)(2,"div"),e.YNc(3,de,3,0,"button",6),e.YNc(4,ge,3,0,"button",7),e.qZA()()()),2&o){const t=n.ngIf,a=e.oxw(2);e.xp6(3),e.Q6J("ngIf",!a.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",a.productService.hasSelectionVariant(t))}}function me(o,n){if(1&o&&(e.TgZ(0,"ng-option",32),e._UZ(1,"img",33),e._uU(2),e.qZA()),2&o){const t=n.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function Ce(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"input",53),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw(3).$implicit;return e.KtG(c.selected=i)})("ngModelChange",function(){e.CHM(t);const i=e.oxw(3).$implicit,c=e.oxw(3);return e.KtG(c.onCheckboxStateProduct(i))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.Q6J("ngModel",t.selected)}}function fe(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"img",54),e.NdJ("click",function(i){e.CHM(t);const c=e.oxw(3).$implicit,r=e.oxw(3);return e.KtG(r.onZoomImage(i,null==c?null:c.ImageUrl))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.s9C("src",t.ThumbnailUrl,e.LSH)}}function xe(o,n){1&o&&e._UZ(0,"img",55)}function Pe(o,n){if(1&o&&(e.ynx(0),e.TgZ(1,"td",46)(2,"div",47),e.YNc(3,Ce,1,1,"input",48),e.YNc(4,fe,1,1,"img",49),e.YNc(5,xe,1,0,"ng-template",null,50,e.W1O),e.qZA()(),e.TgZ(7,"td",51)(8,"span",52),e._uU(9),e.qZA(),e._UZ(10,"br"),e.TgZ(11,"small"),e._uU(12),e.qZA()(),e.BQk()),2&o){const t=e.MAs(6),a=e.oxw().$implicit,i=e.oxw().$implicit;e.xp6(1),e.Q6J("rowSpan",i.Variants.length),e.xp6(2),e.Q6J("ngIf",a.Inventory>=0||i.Variants.length>1),e.xp6(1),e.Q6J("ngIf",i.ThumbnailUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",i.Variants.length),e.xp6(2),e.Oqu(i.Name),e.xp6(3),e.hij("(",i.Category,")")}}function be(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"input",56),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw().$implicit;return e.KtG(c.selected=i)}),e.qZA()}if(2&o){const t=e.oxw().$implicit;e.Q6J("ngModel",t.selected)}}function Ie(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",57)(1,"div",58),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,c=e.oxw().$implicit,r=e.oxw(2).ngIf,b=e.oxw();return e.KtG(b.openTableDialog(i,c,r))}),e._uU(2),e.ALo(3,"number"),e.qZA()()}if(2&o){const t=e.oxw().$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t.Channel[0]?null:t.Channel[0].Price)," ")}}const Se=function(o){return{"bg-gradient-warning":o}};function Te(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,Pe,13,7,"ng-container",4),e.TgZ(2,"td",19),e._uU(3),e.qZA(),e.TgZ(4,"td",22)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",34)(8,"a",35),e._UZ(9,"i",36),e.qZA()()(),e.TgZ(10,"td",37),e.YNc(11,be,1,1,"input",38),e.qZA(),e.TgZ(12,"td",22),e._uU(13),e.ALo(14,"number"),e.qZA(),e.TgZ(15,"td",39),e.YNc(16,Ie,4,3,"div",40),e.qZA(),e.TgZ(17,"td")(18,"div",41)(19,"div",42)(20,"a",35),e._UZ(21,"i",43),e.qZA(),e._uU(22," \xa0\xa0 "),e.TgZ(23,"span",44),e.NdJ("click",function(){const c=e.CHM(t).$implicit,r=e.oxw(4);return e.KtG(r.refreshPrice(c))}),e._UZ(24,"i",45),e.qZA()()()()()}if(2&o){const t=n.$implicit,a=n.index,i=e.oxw(4);e.xp6(1),e.Q6J("ngIf",0==a),e.xp6(2),e.Oqu(t.Model),e.xp6(3),e.hij(" ",t.Code," "),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(3),e.Q6J("ngIf",t.Inventory>=0),e.xp6(2),e.hij(" ",e.lcZ(14,9,t.UnitPrice)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(11,Se,t.UnitPrice!=(null==t.Channel[0]?null:t.Channel[0].Price))),e.xp6(1),e.Q6J("ngIf",t.Channel.length>0),e.xp6(4),e.Q6J("href",null==t.Channel[0]?null:t.Channel[0].Url,e.LSH)}}function ve(o,n){if(1&o&&(e.ynx(0),e.YNc(1,Te,25,13,"tr",26),e.BQk()),2&o){const t=n.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}function Ze(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"span",59),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",60),e._uU(2,"?"),e.qZA()()}}function ye(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&o){const t=n.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Total))}}function Fe(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",64),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onNextPage())}),e._UZ(1,"i",65),e._uU(2," Next"),e.qZA()}}function we(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",66),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onLastPage())}),e._UZ(1,"i",67),e._uU(2," Last"),e.qZA()}}function Ae(o,n){if(1&o&&(e.TgZ(0,"div",61),e.YNc(1,Fe,3,0,"a",62),e.YNc(2,we,3,0,"a",63),e.qZA()),2&o){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function De(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),e._uU(7," Product "),e.TgZ(8,"div")(9,"mat-slide-toggle",17),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.toggleDifferentInventory=i)})("toggleChange",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onToggleDifferentInventory())}),e.TgZ(10,"small",18),e._uU(11,"FILTER DIFFERENT PRICE"),e.qZA()()()(),e.TgZ(12,"th",19),e._uU(13,"Variant"),e.qZA(),e.TgZ(14,"th",20),e._uU(15,"SKU"),e.qZA(),e.TgZ(16,"th")(17,"input",21),e.NdJ("change",function(i){const r=e.CHM(t).ngIf,b=e.oxw(2);return e.KtG(b.onSelectAllSKU(i.target.checked,r))}),e.qZA()(),e.TgZ(18,"th",22),e._uU(19,"POS"),e.qZA(),e.TgZ(20,"th")(21,"ng-select",23),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.searchFilter.ChannelID=i)})("change",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.search())}),e.YNc(22,me,3,3,"ng-option",24),e.qZA()(),e._UZ(23,"th",25),e.qZA()(),e.TgZ(24,"tbody"),e.YNc(25,ve,2,1,"ng-container",26),e.qZA()(),e.TgZ(26,"div",27)(27,"div",28)(28,"div",29),e._uU(29),e.ALo(30,"number"),e.YNc(31,Ze,3,0,"span",30),e.YNc(32,ye,3,3,"span",4),e.ALo(33,"async"),e._uU(34),e.qZA()(),e.YNc(35,Ae,3,2,"div",31),e.qZA()()()()}if(2&o){const t=n.ngIf,a=e.oxw().ngIf,i=e.oxw();e.xp6(9),e.Q6J("ngModel",i.toggleDifferentInventory),e.xp6(12),e.Q6J("clearable",!1)("ngModel",i.searchFilter.ChannelID),e.xp6(1),e.Q6J("ngForOf",a.Options.Channel),e.xp6(3),e.Q6J("ngForOf",t),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(30,10,null==t?null:t.length)," of "),e.xp6(2),e.Q6J("ngIf",i.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(33,12,!i.paginationService.hideCount&&i.allDataCount$)),e.xp6(2),e.hij(" records ~ ",i.paginationService.footerPageNumber," Page "),e.xp6(1),e.Q6J("ngIf",t.length>0)}}function Ne(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("textChange",function(i){e.CHM(t);const c=e.oxw();return e.KtG(c.searchFilter.text=i)})("onSubmit",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.search())}),e.TgZ(1,"filters")(2,"div",2)(3,"div")(4,"label"),e._uU(5,"Page Size"),e.qZA(),e.TgZ(6,"input",3),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw();return e.KtG(c.searchFilter.RowCount=i)}),e.qZA()()()(),e.YNc(7,ue,5,2,"actions",4),e.ALo(8,"async"),e.YNc(9,De,36,14,"content",4),e.ALo(10,"async"),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("headerTitle",t.pageTitle)("text",t.searchFilter.text),e.xp6(6),e.Q6J("ngModel",t.searchFilter.RowCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(8,5,t.paginationService.data$)),e.xp6(2),e.Q6J("ngIf",e.lcZ(10,7,t.paginationService.data$))}}class P{constructor(n,t,a,i,c,r){this.http=n,this.paginationService=t,this.toastr=a,this.dialog=i,this.productService=c,this.biggerPictureService=r,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.hostName=this.productService.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe((0,U.b)(n=>{this.searchFilter=n.Filter,this.searchFilter.filterModel=d.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}))}onToggleDifferentInventory(){this.searchFilter.filterModel=this.toggleDifferentInventory?d.v.ALL:d.v.DIFFERENCE,this.search()}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.selected=n.selected,t))}openScanDialog(n){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.g.GuidEMpty,this.dialog.open(J.j,{data:{filter:t,channelOptions:n.Options.Channel},width:"40%"}).afterClosed().pipe((0,h.h)(a=>_.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll(n)})}scanAll(n){const t=this.productService.findChannelById(this.searchFilter.ChannelID,n.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(a=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(),this.toastr.success(`Successfully scanned from ${t?.Name}`,"Success"))})}updateStock(n){let a=this.productService.selectedVariantProduct(n).map(c=>({ID:c.ID,ChannelID:c.Channel[0].ChannelID,Code:c.Code,Price:c.UnitPrice})),i={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",i).subscribe(()=>{this.search(),this.toastr.success(`Successfully updated ${i.ListPrice.length} variants in ${i.ListChannelID.length} channels`,"Success")})}refreshPrice(n){this.http.post("/api/Price/RefreshPriceChannel",{ChannelItemID:n?.Channel[0].ChannelItemID,ChannelVariationID:n?.Channel[0]?.ChannelVariationID,ChannelID:n?.Channel[0]?.ChannelID,VariantID:n.ID}).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.search()})}search(){this.paginationService.resetToFirstPage(this.searchFilter)}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:n=>{this.paginationService.getAllData(this.searchFilter,n.Total)}})}openTableDialog(n,t,a){let i=JSON.parse(JSON.stringify(n));this.dialog.open(L.k,{data:{Name:t.Name,Variant:i,ChannelID:i?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:i?.Channel[0]?.ChannelItemID}}).afterClosed().pipe((0,h.h)(r=>_.g.IsNotEmpty(r))).subscribe(r=>{this.updateItemAfterDialog(r,a,n)})}updateItemAfterDialog(n,t,a){let i={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(c=>{const r=this.productService.findChannelById(i.ID,t.Options.Channel);this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) inventory in ${r.Name} to ${i.Price}`,"Success"),a.Channel[0]&&(a.Channel[0].Price=i.Price)})}onSelectAllSKU(n,t){t=t.map(a=>(a.Variants=a.Variants.map(i=>(i.selected=n,i)),a))}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}ngOnDestroy(){this.paginationService.destroy()}}P.\u0275fac=function(n){return new(n||P)(e.Y36(v.O),e.Y36(O.b),e.Y36(Z._W),e.Y36(y.uw),e.Y36(F.M),e.Y36(Q.k))},P.\u0275cmp=e.Xpm({type:P,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],["type","checkbox",1,"me-3",3,"change"],[1,"text-end"],["name","channelOption",3,"clearable","ngModel","ngModelChange","change"],[3,"value",4,"ngFor","ngForOf"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-external-link-alt"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"text-end",3,"ngClass"],["class","row justify-content-end me-0",4,"ngIf"],[1,"row"],[1,"col-12","ps-0","d-flex","justify-content-between"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"row","justify-content-end","me-0"],[1,"col-8","ps-0","pe-12","text-end",2,"cursor","pointer",3,"click"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,t){1&n&&(e.YNc(0,Ne,11,9,"mainpanel",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,t.loader$))},dependencies:[s.mk,s.sg,s.O5,p.Fj,p.wV,p.Wl,p.JJ,p.On,I.p,T.w9,T.jq,q.Rr,V.gM,s.Ov,s.JJ],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]});var A=l(8063);const Je=[{path:"",component:C,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:f,canActivate:[A.a],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:x,canActivate:[A.a],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:P,canActivate:[A.a],data:{title:"Price Single Channel Comparison"}}]}];class u{}u.\u0275fac=function(n){return new(n||u)},u.\u0275mod=e.oAB({type:u}),u.\u0275inj=e.cJS({imports:[s.ez,S.Bz.forChild(Je)]});var Me=l(6709);class m{}m.\u0275fac=function(n){return new(n||m)},m.\u0275mod=e.oAB({type:m}),m.\u0275inj=e.cJS({imports:[s.ez,p.u5,N.Z,I.R,S.Bz,T.A0,u,p.UX,q.rP,Me.p9,V.AV,g,k.a]})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[913],{2913:(U,C,e)=>{e.r(C),e.d(C,{ProductModule:()=>p});var t=e(6806),_=e(4650);class g{}g.\u0275fac=function(m){return new(m||g)},g.\u0275cmp=_.Xpm({type:g,selectors:[["app-products"]],decls:1,vars:0,template:function(m,I){1&m&&_._UZ(0,"router-outlet")},dependencies:[t.lC],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}"]});var x=e(8063),n=e(6895);const P=[{path:"",component:g,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>Promise.all([e.e(516),e.e(592),e.e(863)]).then(e.bind(e,9863)).then(d=>d.StatusModule),canActivate:[x.a]},{path:"download",loadChildren:()=>Promise.all([e.e(970),e.e(997)]).then(e.bind(e,1997)).then(d=>d.DownloadModule),canActivate:[x.a]}]}];class f{}f.\u0275fac=function(m){return new(m||f)},f.\u0275mod=_.oAB({type:f}),f.\u0275inj=_.cJS({imports:[n.ez,t.Bz.forChild(P)]});var v=e(8739),M=e(1948),O=e(6956),b=e(5631),T=e(6732),Z=e(2594),h=e(266),r=e(7481),l=e(8796),a=e(4006);class p{}p.\u0275fac=function(m){return new(m||p)},p.\u0275mod=_.oAB({type:p}),p.\u0275inj=_.cJS({imports:[n.ez,a.u5,t.Bz,f,h.AV,r.R,l.A0,v.TU,T.y,M.Fk,O.Y,b._,Z.n]})},5631:(U,C,e)=>{e.d(C,{_:()=>h});var t=e(6895),_=e(4006),g=e(266),x=e(3154),n=e(4650),P=e(1739);function f(r,l){if(1&r){const a=n.EpF();n.ynx(0),n.TgZ(1,"img",14),n.NdJ("click",function(d){n.CHM(a);const m=n.oxw();return n.KtG(m.onZoomImage(d))}),n.qZA(),n.BQk()}if(2&r){const a=n.oxw();n.xp6(1),n.Q6J("ngSrc",a.image)("fill",!0)}}function v(r,l){1&r&&n._UZ(0,"img",15),2&r&&n.Q6J("fill",!0)}function M(r,l){if(1&r&&(n.TgZ(0,"div",16),n._UZ(1,"i",17),n.TgZ(2,"span"),n._uU(3),n.qZA()()),2&r){const a=n.oxw();n.xp6(3),n.Oqu(a.code)}}const O=function(r){return{"border-bottom":r}};function b(r,l){if(1&r&&(n.ynx(0),n.TgZ(1,"div",28)(2,"div",29),n._uU(3),n.qZA(),n.TgZ(4,"div")(5,"a",30),n._UZ(6,"i",31),n.qZA()()(),n.BQk()),2&r){const a=l.$implicit,p=l.index,d=n.oxw().$implicit;n.xp6(1),n.Q6J("ngClass",n.VKq(3,O,p!==(null==d?null:d.Map.length)-1)),n.xp6(2),n.hij(" ",a.Name," "),n.xp6(2),n.Q6J("href",a.URL,n.LSH)}}const T=function(r){return{"border-bottom-0":r}};function Z(r,l){if(1&r&&(n.TgZ(0,"div",18)(1,"h2",19)(2,"button",20)(3,"div",21),n._UZ(4,"img",22),n.TgZ(5,"span",23),n._uU(6),n.qZA(),n.TgZ(7,"span",24)(8,"h4"),n._uU(9),n.qZA()()()()(),n.TgZ(10,"div",25)(11,"div",26),n.YNc(12,b,7,5,"ng-container",27),n.qZA()()()),2&r){const a=l.$implicit,p=l.index,d=n.oxw();n.Q6J("ngClass",n.VKq(11,T,d.channels.length-1==p)),n.xp6(1),n.Q6J("id","heading"+p+d.code),n.xp6(1),n.uIk("data-bs-target","#collapse"+p+d.code)("aria-controls","#collapse"+p+d.code),n.xp6(2),n.Q6J("src",d.getChannelLogo(a.TypeID),n.LSH),n.xp6(1),n.Q6J("matTooltip",(null==a||null==a.Name?null:a.Name.length)>30?a.Name:""),n.xp6(1),n.Oqu(a.Name),n.xp6(3),n.hij("- ",a.Map.length," Listing"),n.xp6(1),n.Q6J("id","collapse"+p+d.code),n.uIk("aria-labelledby","heading"+p+d.code),n.xp6(2),n.Q6J("ngForOf",a.Map)}}class h{constructor(l){this.biggerPictureService=l}getChannelLogo(l){return x.g.getChannelLogoByTypeId(l)}onZoomImage(l){this.biggerPictureService.openBiggerPicture(l,this.imageForZoom)}}h.\u0275fac=function(l){return new(l||h)(n.Y36(P.k))},h.\u0275cmp=n.Xpm({type:h,selectors:[["app-duplicate-product-card"]],inputs:{image:"image",imageForZoom:"imageForZoom",title:"title",code:"code",channels:"channels"},standalone:!0,features:[n.jDz],decls:16,vars:5,consts:[[1,"card"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"col-8","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle"],["class","description",4,"ngIf"],[1,"card-footer",2,"padding-left","0px","padding-right","0px"],["id","accordionParent",1,"accordion","accordion-flush"],["class","accordion-item border-start-0 border-end-0",3,"ngClass",4,"ngFor","ngForOf"],[1,"rounded","imgUpload","float-left","cursor-pointer",3,"ngSrc","fill","click"],["ngSrc","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload",3,"fill"],[1,"description"],[1,"fa","fa-barcode","me-2"],[1,"accordion-item","border-start-0","border-end-0",3,"ngClass"],[1,"accordion-header",3,"id"],["type","button","data-bs-toggle","collapse","aria-expanded","true",1,"accordion-button","collapsed",2,"height","40px"],[1,"d-flex","align-items-center","justify-content-start","w-100"],["alt","",1,"channel-logo",3,"src"],[1,"fs-4","ps-4","text-ellipsis",2,"max-width","13vw",3,"matTooltip"],[1,"ps-2"],["data-bs-parent","#accordionParent",1,"accordion-collapse","collapse",3,"id"],[1,"accordion-body",2,"padding-top","0px","padding-bottom","0px"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","align-items-center","py-4",3,"ngClass"],[1,"text-ellipsis"],["target","_blank",1,"text-secondary",3,"href"],[1,"fa","fa-external-link-alt"]],template:function(l,a){if(1&l&&(n.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),n.YNc(6,f,2,2,"ng-container",6),n.YNc(7,v,1,1,"ng-template",null,7,n.W1O),n.qZA()()(),n.TgZ(9,"div",8)(10,"h4",9),n._uU(11),n.qZA(),n.YNc(12,M,4,1,"div",10),n.qZA()()(),n.TgZ(13,"div",11)(14,"div",12),n.YNc(15,Z,13,13,"div",13),n.qZA()()()),2&l){const p=n.MAs(8);n.xp6(6),n.Q6J("ngIf",a.image)("ngIfElse",p),n.xp6(5),n.hij(" ",a.title," "),n.xp6(1),n.Q6J("ngIf",a.code),n.xp6(3),n.Q6J("ngForOf",a.channels)}},dependencies:[t.ez,t.mk,t.sg,t.O5,_.u5,g.AV,g.gM,t.Zd],styles:[".productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down}.channel-logo[_ngcontent-%COMP%]{width:18px;height:18px}.accordion-button[_ngcontent-%COMP%]{background-color:#ededed69!important}.accordion-button[_ngcontent-%COMP%]:not(.collapsed){background-color:#ededed69!important;color:#333}.accordion-button[_ngcontent-%COMP%]:after{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e\")}.accordion-button[_ngcontent-%COMP%]:focus{box-shadow:none!important}.card[_ngcontent-%COMP%]{margin-bottom:0!important}"]})},6956:(U,C,e)=>{e.d(C,{Y:()=>w});var t=e(4650),_=e(3154),g=e(6895),x=e(4006),n=e(266),P=e(1739);function f(i,c){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"img",19),t.NdJ("click",function(s){t.CHM(o);const E=t.oxw();return t.KtG(E.openBiggerPicture(s))}),t.qZA(),t.BQk()}if(2&i){const o=t.oxw();t.xp6(1),t.Q6J("src",o.image,t.LSH)}}function v(i,c){1&i&&t._UZ(0,"img",20)}function M(i,c){if(1&i&&(t.ynx(0),t.TgZ(1,"span",24)(2,"a",25),t._UZ(3,"i",26),t.qZA()(),t.BQk()),2&i){const o=t.oxw(2);t.xp6(2),t.Q6J("href",o.redirectUrl,t.LSH)}}function O(i,c){if(1&i&&(t.TgZ(0,"div",21),t._UZ(1,"i",22),t.TgZ(2,"span"),t._uU(3),t.qZA(),t.YNc(4,M,4,1,"ng-container",23),t.qZA()),2&i){const o=t.oxw();t.xp6(3),t.Oqu(o.code),t.xp6(1),t.Q6J("ngIf","SKU not assigned"!==o.code&&o.showRedirectIcon)}}function b(i,c){if(1&i){const o=t.EpF();t.TgZ(0,"div",27),t.NdJ("click",function(){t.CHM(o);const s=t.oxw();return t.KtG(s.onEventDesc())}),t._UZ(1,"i",28),t.TgZ(2,"span"),t._uU(3),t.qZA()()}if(2&i){const o=t.oxw();t.xp6(3),t.Oqu(o.description)}}function T(i,c){if(1&i){const o=t.EpF();t.TgZ(0,"div",29)(1,"input",30),t.NdJ("change",function(s){t.CHM(o);const E=t.oxw();return t.KtG(E.onCheck(s.target.checked))}),t.qZA()()}}function Z(i,c){if(1&i){const o=t.EpF();t.TgZ(0,"button",31),t.NdJ("click",function(){t.CHM(o);const s=t.oxw();return t.KtG(s.onDownload())}),t._UZ(1,"i",32),t._uU(2," Download "),t.qZA()}}function h(i,c){if(1&i){const o=t.EpF();t.TgZ(0,"button",31),t.NdJ("click",function(){t.CHM(o);const s=t.oxw();return t.KtG(s.onUpload())}),t._UZ(1,"i",33),t._uU(2," Upload "),t.qZA()}}function r(i,c){if(1&i){const o=t.EpF();t.TgZ(0,"button",34),t.NdJ("click",function(){t.CHM(o);const s=t.oxw();return t.KtG(s.onScan())}),t._UZ(1,"i",35),t._uU(2," Scan "),t.qZA()}}const l=function(i){return{"me-3":i}};function a(i,c){if(1&i&&(t.ynx(0),t.TgZ(1,"a",37),t._UZ(2,"img",38),t.qZA(),t.BQk()),2&i){const o=c.$implicit,u=c.index,s=t.oxw(2);t.xp6(1),t.s9C("href",o.Url,t.LSH),t.xp6(1),t.Q6J("ngClass",t.VKq(4,l,u!=s.channels.length-1))("src",s.getChannelLogo(o),t.LSH)("matTooltip",o.Title?o.Title:o.Name)}}function p(i,c){if(1&i&&(t.ynx(0),t.YNc(1,a,3,6,"ng-container",36),t.BQk()),2&i){const o=t.oxw();t.xp6(1),t.Q6J("ngForOf",o.channels)}}const d=function(i){return{"border-bottom pb-2":i}};function m(i,c){if(1&i&&(t.TgZ(0,"li")(1,"div",42)(2,"div",43)(3,"a",37),t._UZ(4,"img",44),t.TgZ(5,"span",45),t._uU(6),t.qZA()()()()()),2&i){const o=c.$implicit,u=c.index,s=t.oxw(2);t.xp6(2),t.Q6J("ngClass",t.VKq(4,d,u!=s.channels.length-1)),t.xp6(1),t.Q6J("href",o.Url,t.LSH),t.xp6(1),t.Q6J("src",s.getChannelLogo(o),t.LSH),t.xp6(2),t.Oqu(o.Title)}}function I(i,c){if(1&i&&(t.TgZ(0,"div",39)(1,"button",40),t._uU(2),t.qZA(),t.TgZ(3,"ul",41),t.YNc(4,m,7,6,"li",36),t.qZA()()),2&i){const o=t.oxw();t.xp6(2),t.hij(" ",o.channels.length," CHANNELS "),t.xp6(2),t.Q6J("ngForOf",o.channels)}}class w{constructor(c){this.biggerPictureService=c,this.uploadButton=!1,this.scanButton=!1,this.showCheckBox=!1,this.downloadButton=!1,this.hasZoom=!0,this.showRedirectIcon=!0,this.onUploadEvent=new t.vpe,this.onScanEvent=new t.vpe,this.checkBoxChange=new t.vpe,this.onDescEvent=new t.vpe,this.onDownloadEvent=new t.vpe}ngAfterContentInit(){this.initRedirectUrl()}initRedirectUrl(){let c=localStorage.getItem("Authorization"),o=JSON.parse(c)?.Host;this.redirectUrl=`https://${o}/menu/Products/Catalog/Products/Info?ID=${this.productId}`}onUpload(){this.onUploadEvent.emit()}onScan(){this.onScanEvent.emit()}onCheck(c){this.checkBoxChange.emit(c)}onEventDesc(){this.onDescEvent.emit()}onDownload(){this.onDownloadEvent.emit()}getChannelLogo(c){return _.g.getChannelLogoByTypeId(c.TypeID)}openBiggerPicture(c){this.biggerPictureService.openBiggerPicture(c,this.imageForZoom)}}w.\u0275fac=function(c){return new(c||w)(t.Y36(P.k))},w.\u0275cmp=t.Xpm({type:w,selectors:[["app-product-card"]],inputs:{productId:"productId",uploadButton:"uploadButton",scanButton:"scanButton",showCheckBox:"showCheckBox",downloadButton:"downloadButton",image:"image",title:"title",code:"code",description:"description",channels:"channels",check:"check",imageForZoom:"imageForZoom",hasZoom:"hasZoom",showRedirectIcon:"showRedirectIcon"},outputs:{onUploadEvent:"onUpload",onScanEvent:"onScan",checkBoxChange:"onCheckBoxChange",onDescEvent:"onDescEvent",onDownloadEvent:"onDownload"},standalone:!0,features:[t.jDz],decls:26,vars:11,consts:[[1,"card",2,"margin-bottom","0px"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"col-7","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle","cursor-pointer",3,"click"],["class","description cursor-pointer",4,"ngIf"],["class","description cursor-pointer",3,"click",4,"ngIf"],[1,"col-1","gx-0","d-flex","justify-content-center"],[1,"text-end"],["class","text-end gx-0",4,"ngIf"],[1,"card-footer","d-flex","justify-content-between","py-5","bg-footer","align-items-center",2,"border-top","0.1px solid rgb(220 220 220)"],["class","fs-6 btn btn-light btn-sm me-3",3,"click",4,"ngIf"],["class","fs-6 btn btn-light btn-sm",3,"click",4,"ngIf"],["DROPDOWN",""],[1,"rounded","imgUpload","float-left",3,"src","click"],["src","https://res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload"],[1,"description","cursor-pointer"],[1,"fa","fa-barcode","me-2"],[4,"ngIf"],[1,"ms-2"],["target","_blank",2,"color","#0976b4",3,"href"],[1,"fas","fa-external-link-alt"],[1,"description","cursor-pointer",3,"click"],[1,"fa","fa-tag","me-2"],[1,"text-end","gx-0"],["type","checkbox",3,"change"],[1,"fs-6","btn","btn-light","btn-sm","me-3",3,"click"],["aria-hidden","true",1,"fa","fa-download"],["aria-hidden","true",1,"fa","fa-upload"],[1,"fs-6","btn","btn-light","btn-sm",3,"click"],[1,"fa","fa-spinner"],[4,"ngFor","ngForOf"],["target","_blank",3,"href"],["alt","",1,"img-logo",3,"ngClass","src","matTooltip"],[1,"dropdown"],["type","button","id","dropdownMenuButton1","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","fs-6","btn-sm","btn-light","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item","py-2",2,"cursor","pointer"],[3,"ngClass"],[1,"img-logo",3,"src"],[1,"ms-4"]],template:function(c,o){if(1&c&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),t.YNc(6,f,2,1,"ng-container",6),t.YNc(7,v,1,0,"ng-template",null,7,t.W1O),t.qZA()()(),t.TgZ(9,"div",8)(10,"h4",9),t.NdJ("click",function(){return o.onEventDesc()}),t._uU(11),t.qZA(),t.YNc(12,O,5,2,"div",10),t.YNc(13,b,4,1,"div",11),t.qZA(),t.TgZ(14,"div",12)(15,"div",13),t.YNc(16,T,2,0,"div",14),t.qZA()()()(),t.TgZ(17,"div",15)(18,"div"),t.YNc(19,Z,3,0,"button",16),t.YNc(20,h,3,0,"button",16),t.YNc(21,r,3,0,"button",17),t.qZA(),t.TgZ(22,"div"),t.YNc(23,p,2,1,"ng-container",6),t.YNc(24,I,5,2,"ng-template",null,18,t.W1O),t.qZA()()()),2&c){const u=t.MAs(8),s=t.MAs(25);t.xp6(6),t.Q6J("ngIf",o.image)("ngIfElse",u),t.xp6(5),t.hij(" ",o.title," "),t.xp6(1),t.Q6J("ngIf",o.code),t.xp6(1),t.Q6J("ngIf",o.description),t.xp6(3),t.Q6J("ngIf",o.showCheckBox),t.xp6(3),t.Q6J("ngIf",o.downloadButton),t.xp6(1),t.Q6J("ngIf",o.uploadButton),t.xp6(1),t.Q6J("ngIf",o.scanButton),t.xp6(2),t.Q6J("ngIf",o.channels.length<4)("ngIfElse",s)}},dependencies:[g.ez,g.mk,g.sg,g.O5,x.u5,n.AV,n.gM],styles:[".img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100%}.bg-footer[_ngcontent-%COMP%]{background-color:#ededed69}.description[_ngcontent-%COMP%]{font-weight:300;margin-left:2px}.productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down;cursor:pointer}.dropdown[_ngcontent-%COMP%] .dropdown-menu.show[_ngcontent-%COMP%]{top:unset!important}"]})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[997],{7398:(Z,y,a)=>{a.d(y,{Z:()=>l,e:()=>m});var u=a(6895),t=a(266),f=a(6806),r=a(4650);function U(d,c){if(1&d&&(r.TgZ(0,"li",2)(1,"a",3),r._uU(2),r.qZA()()),2&d){const i=c.$implicit;r.xp6(1),r.s9C("routerLink",i.Url),r.Q6J("title",i.Description?i.Description:""),r.xp6(1),r.hij(" ",i.Title," ")}}class m{}m.\u0275fac=function(c){return new(c||m)},m.\u0275cmp=r.Xpm({type:m,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs"},decls:2,vars:1,consts:[[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],["routerLinkActive","active","class","nav-item me-6",4,"ngFor","ngForOf"],["routerLinkActive","active",1,"nav-item","me-6"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink","title"]],template:function(c,i){1&c&&(r.TgZ(0,"ul",0),r.YNc(1,U,3,3,"li",1),r.qZA()),2&c&&(r.xp6(1),r.Q6J("ngForOf",i.Tabs))},dependencies:[u.sg,f.rH,f.Od]});class l{}l.\u0275fac=function(c){return new(c||l)},l.\u0275mod=r.oAB({type:l}),l.\u0275inj=r.cJS({imports:[u.ez,f.Bz,t.AV]})},1997:(Z,y,a)=>{a.r(y),a.d(y,{DownloadModule:()=>g});var u=a(6895),t=a(4650),f=a(7398),r=a(6806);const U=function(n){return[n]};function m(n,e){if(1&n&&(t.ynx(0),t.TgZ(1,"a",9),t._uU(2),t.qZA(),t.BQk()),2&n){const o=e.$implicit;t.xp6(1),t.Q6J("routerLink",t.VKq(2,U,o.url)),t.xp6(1),t.hij(" ",o.title,"")}}class l{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}}l.\u0275fac=function(e){return new(e||l)},l.\u0275cmp=t.Xpm({type:l,selectors:[["app-download"]],decls:12,vars:2,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-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(e,o){1&e&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()(),t.TgZ(4,"div")(5,"div",3)(6,"a",4),t._UZ(7,"i",5),t.qZA(),t.TgZ(8,"div",6)(9,"div",7),t.YNc(10,m,3,4,"ng-container",8),t.qZA()()()()(),t._UZ(11,"router-outlet")),2&e&&(t.xp6(3),t.Q6J("Tabs",o.tabs),t.xp6(7),t.Q6J("ngForOf",o.moreMenu))},dependencies:[u.sg,f.e,r.lC,r.rH]});var d=a(2138),c=a(1318);class i{constructor(e){this.httpService=e}download(e){return this.httpService.post("/api/Product/downloadurl",e)}}i.\u0275fac=function(e){return new(e||i)(t.LFG(c.O))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"});var w=a(501),C=a(4006),b=a(7481),_=a(8425);function x(n,e){if(1&n&&(t.TgZ(0,"th"),t._uU(1),t.qZA()),2&n){const o=e.$implicit;t.xp6(1),t.Oqu(o.column)}}function D(n,e){if(1&n&&(t.ynx(0),t.TgZ(1,"td"),t._UZ(2,"span",6),t.qZA(),t.BQk()),2&n){const o=e.$implicit,s=t.oxw().$implicit;t.xp6(2),t.Q6J("innerHTML",s[o.prop],t.oJD)}}const N=function(n){return{"background-color":n}};function S(n,e){if(1&n&&(t.TgZ(0,"tr",5),t.YNc(1,D,3,1,"ng-container",3),t.qZA()),2&n){const o=e.$implicit,s=t.oxw();t.Q6J("ngStyle",t.VKq(2,N,o.Status>200?"#F4D6D5":"#DEE9C9")),t.xp6(1),t.Q6J("ngForOf",s.configs)}}class h{constructor(){this.eventClose=new t.vpe}ngOnInit(){}onClose(){this.eventClose.emit()}}function A(n,e){if(1&n){const o=t.EpF();t.ynx(0),t.TgZ(1,"button",23),t.NdJ("click",function(){t.CHM(o);const p=t.oxw(),T=t.MAs(11);return t.KtG(p.onNewStepperState(T))}),t._UZ(2,"i",24),t._uU(3," New "),t.qZA(),t.BQk()}}function B(n,e){if(1&n){const o=t.EpF();t.ynx(0),t.TgZ(1,"button",23),t.NdJ("click",function(){t.CHM(o),t.oxw();const p=t.MAs(11);return t.KtG(p.previous())}),t._uU(2," Back "),t.qZA(),t.BQk()}}function I(n,e){if(1&n){const o=t.EpF();t.ynx(0),t.TgZ(1,"button",25),t.NdJ("click",function(){t.CHM(o);const p=t.oxw(),T=t.MAs(11);return t.KtG(p.onStepperNext(T))}),t._uU(2," Next "),t.qZA(),t.BQk()}}function O(n,e){if(1&n){const o=t.EpF();t.ynx(0),t.TgZ(1,"button",26),t.NdJ("click",function(){t.CHM(o);const p=t.oxw(),T=t.MAs(11);return t.KtG(p.onSubmit(T))}),t._uU(2,"Download"),t.qZA(),t.BQk()}if(2&n){const o=t.oxw();t.xp6(1),t.Q6J("disabled",!o.urls)}}function k(n,e){1&n&&t._uU(0,"Instruction")}function L(n,e){1&n&&t._uU(0,"Download")}function F(n,e){1&n&&t._uU(0,"Finish")}function M(n,e){1&n&&t._UZ(0,"i",27)}function J(n,e){1&n&&t._UZ(0,"i",28)}function Q(n,e){1&n&&t._UZ(0,"i",29)}h.\u0275fac=function(e){return new(e||h)},h.\u0275cmp=t.Xpm({type:h,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),t.YNc(4,x,2,1,"th",3),t.qZA()(),t.TgZ(5,"tbody"),t.YNc(6,S,2,4,"tr",4),t.qZA()()()),2&e&&(t.xp6(4),t.Q6J("ngForOf",o.configs),t.xp6(2),t.Q6J("ngForOf",o.data))},dependencies:[u.sg,u.PC]});class v{constructor(e,o){this.downloadService=e,this.authService=o,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder="https://tokopedia.com/tokoriyanadi/kaos-polos-biru\nhttps://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat",this.currentDomain=this.authService.getDomain()}onStepperChange(e){this.stepperState=e.selectedStep.state}onSubmit(e){const o=this.urls.split(/\r?\n/);this.downloadService.download(o).subscribe(s=>{this.downloadResponses=s,this.mappingLinkToProduct(),this.onStepperNext(e)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(e=>(e.Name=e?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${e.ID}" target="_blank">\n ${e?.Name}\n </a>`:"-",e))}onNewStepperState(e){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",e.reset(),this.onStepperNext(e)}onStepperNext(e){e.selected.completed=!0,e.next()}}v.\u0275fac=function(e){return new(e||v)(t.Y36(i),t.Y36(w.e))},v.\u0275cmp=t.Xpm({type:v,selectors:[["app-by-url"]],features:[t._Bn([{provide:d.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:41,vars:15,consts:[["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["labelPosition","bottom","linear","",1,"stepper-downloadByUrl",3,"selectedIndex","selectionChange"],["stepper",""],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],["state","DOWNLOAD",3,"editable","completed"],["name","url","cols","30","rows","25",1,"form-control",3,"placeholder","ngModel","ngModelChange"],["state","FINISH"],["status","error",3,"data","configs"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"disabled","click"],[1,"fa-solid","fa-info"],[1,"fa-solid","fa-download"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions"),t.YNc(2,A,4,0,"ng-container",1),t.YNc(3,B,3,0,"ng-container",1),t.YNc(4,I,3,0,"ng-container",1),t.YNc(5,O,3,1,"ng-container",1),t.qZA(),t.TgZ(6,"content")(7,"div",2)(8,"div",3)(9,"div",4)(10,"mat-stepper",5,6),t.NdJ("selectionChange",function(p){return o.onStepperChange(p)}),t.TgZ(12,"mat-step",7),t.YNc(13,k,1,0,"ng-template",8),t.TgZ(14,"div",9)(15,"div",10)(16,"div",11)(17,"h4",12),t._uU(18,"Note"),t.qZA()(),t.TgZ(19,"div",13)(20,"ol",14)(21,"li"),t._uU(22," Use this form to Download Products from Tokopedia using product URL "),t.qZA(),t.TgZ(23,"li"),t._uU(24," Copy Product URL from "),t.TgZ(25,"a",15),t._uU(26,"https://seller.tokopedia.com/ "),t.qZA(),t._uU(27," and paste in this form "),t.qZA(),t.TgZ(28,"li"),t._uU(29," Use New Line when you want to input several product URLs "),t.qZA()()()()()(),t.TgZ(30,"mat-step",16),t.YNc(31,L,1,0,"ng-template",8),t.TgZ(32,"div",9)(33,"textarea",17),t.NdJ("ngModelChange",function(p){return o.urls=p}),t.qZA()()(),t.TgZ(34,"mat-step",18),t.YNc(35,F,1,0,"ng-template",8),t.TgZ(36,"div",9),t._UZ(37,"app-response-api-list",19),t.qZA()(),t.YNc(38,M,1,0,"ng-template",20),t.YNc(39,J,1,0,"ng-template",21),t.YNc(40,Q,1,0,"ng-template",22),t.qZA()()()()()()),2&e&&(t.Q6J("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf","FINISH"==o.stepperState),t.xp6(1),t.Q6J("ngIf","DOWNLOAD"==o.stepperState),t.xp6(1),t.Q6J("ngIf","GUIDE"==o.stepperState),t.xp6(1),t.Q6J("ngIf","DOWNLOAD"==o.stepperState),t.xp6(5),t.Q6J("selectedIndex",1),t.xp6(2),t.Q6J("editable","FINISH"!=o.stepperState)("completed",!0),t.xp6(18),t.Q6J("editable","FINISH"!=o.stepperState)("completed",!1),t.xp6(3),t.Q6J("placeholder",o.urlPlaceholder)("ngModel",o.urls),t.xp6(4),t.Q6J("data",o.downloadResponses)("configs",o.configs))},dependencies:[u.O5,C.Fj,C.JJ,C.On,b.p,_.C0,_.VY,_.Vq,_.z9,h],styles:[".card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px}\n"],encapsulation:2});var P=a(8063),E=a(7392);const R=[{path:"",component:l,children:[{path:"by-url",component:v,data:{title:"Download Product By Url"},canActivate:[P.a]},{pathMatch:"full",path:"",redirectTo:"by-url"}]}];class g{}g.\u0275fac=function(e){return new(e||g)},g.\u0275mod=t.oAB({type:g}),g.\u0275inj=t.cJS({providers:[i],imports:[u.ez,C.u5,f.Z,b.R,_.T5,E.Ps,r.Bz.forChild(R)]})}}]);