marketplacepos 2.3.3 → 2.3.6

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 (33) hide show
  1. package/Marketplace/146.0e22010167a973df.js +1 -0
  2. package/Marketplace/285.1f547ef81e91fc15.js +1 -0
  3. package/Marketplace/288.9b236c96f7411cc2.js +1 -0
  4. package/Marketplace/402.76aaae9b8dfdc4fd.js +1 -0
  5. package/Marketplace/458.fc07b0f91bb6df5f.js +1 -0
  6. package/Marketplace/466.79ee2406f755f577.js +1 -0
  7. package/Marketplace/472.0e5a2ab01c896887.js +1 -0
  8. package/Marketplace/512.84e77b4b4a7a1db7.js +1 -0
  9. package/Marketplace/717.5259a4803cce95ab.js +1 -0
  10. package/Marketplace/767.297995f3aba0da57.js +1 -0
  11. package/Marketplace/832.2b70bf9326d693b9.js +1 -0
  12. package/Marketplace/970.d9ed984ff8f29661.js +1 -0
  13. package/Marketplace/common.f2cd628914f2fae7.js +1 -0
  14. package/Marketplace/index.html +2 -2
  15. package/Marketplace/main.7b5711d2efb046b5.js +1 -0
  16. package/Marketplace/runtime.4e6ea83bf40a8d41.js +1 -0
  17. package/Marketplace/{styles.44d414097ff92971.css → styles.84477c613818f650.css} +1 -1
  18. package/package.json +1 -1
  19. package/Marketplace/1.b49e619a73fb2a86.js +0 -1
  20. package/Marketplace/115.44f051b23469a3a3.js +0 -1
  21. package/Marketplace/22.a407f0f0bc2ca4e6.js +0 -1
  22. package/Marketplace/285.17f6cbef78acd327.js +0 -1
  23. package/Marketplace/46.3815daacf4a89802.js +0 -1
  24. package/Marketplace/466.fd29b7965d5e28a4.js +0 -1
  25. package/Marketplace/472.8a5a65585a8eae0d.js +0 -1
  26. package/Marketplace/512.eddb4675a9016de6.js +0 -1
  27. package/Marketplace/518.c5dbfdd31a6ddcfc.js +0 -1
  28. package/Marketplace/717.62ca448a74adc1c2.js +0 -1
  29. package/Marketplace/763.698000c82516136b.js +0 -1
  30. package/Marketplace/767.0ce42314dea8dfea.js +0 -1
  31. package/Marketplace/common.34d3e7dcd2b85c7a.js +0 -1
  32. package/Marketplace/main.efbf88d695aa7333.js +0 -1
  33. package/Marketplace/runtime.32f2458eef006b95.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[472],{1472:(dn,d,s)=>{s.r(d),s.d(d,{InventoryModule:()=>gn});var u=s(6895),n=s(4650),h=s(8252),f=s(7398);let F=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,a){1&t&&(n.TgZ(0,"nav",0)(1,"div",1)(2,"div"),n._UZ(3,"nav-tab",2),n.qZA()()(),n._UZ(4,"router-outlet")),2&t&&(n.xp6(3),n.Q6J("Tabs",a.inventoryTabs))},dependencies:[h.lC,f.e]}),e})();var v=s(5241),A=s(2486),C=s(8505),I=s(1318),y=s(7185),x=s(5412),b=s(7287),m=s(7481),S=s(488);function D(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",17),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2).ngIf,i=n.oxw();return n.KtG(i.openScanDialog(o.Options.Channel))}),n._UZ(1,"i",18),n._uU(2," Scan Channel "),n.qZA()}}function N(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",19),n.NdJ("click",function(){n.CHM(t);const o=n.oxw().ngIf,i=n.oxw().ngIf,r=n.oxw();return n.KtG(r.onUpdateItems(o,i.Options.Channel))}),n._UZ(1,"i",20),n._uU(2," Update "),n.qZA()}}function P(e,l){if(1&e&&(n.TgZ(0,"actions")(1,"div",14)(2,"div"),n.YNc(3,D,3,0,"button",15),n.YNc(4,N,3,0,"button",16),n.qZA()()()),2&e){const t=l.ngIf,a=n.oxw(2);n.xp6(3),n.Q6J("ngIf",!a.hasSelection(t)),n.xp6(1),n.Q6J("ngIf",a.hasSelection(t))}}function M(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"app-table",21),n.NdJ("onToggle",function(o){n.CHM(t);const i=n.oxw(2);return n.KtG(i.onShowDifferenceStock(o))})("onSubmit",function(o){const r=n.CHM(t).ngIf,c=n.oxw(2);return n.KtG(c.UpdateStockByVariant(o,r))}),n.qZA()}if(2&e){const t=l.ngIf,a=n.oxw().ngIf,o=n.oxw();n.Q6J("data",t)("channel",o.channelOptions)("showProductToggle",!0)("filter",a.Filter)}}function R(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",22),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.getAllDataCount())}),n.TgZ(1,"i",23),n._uU(2,"?"),n.qZA()()}}function U(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,t))}}function k(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",24),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.nextPage())}),n._UZ(1,"i",25),n._uU(2," Next"),n.qZA()}}function J(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",26),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.getAllData())}),n._UZ(1,"i",27),n._uU(2," Last"),n.qZA()}}function L(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(o){n.CHM(t);const i=n.oxw();return n.KtG(i.onSearch(o))}),n.YNc(1,P,5,2,"actions",2),n.ALo(2,"async"),n.TgZ(3,"content")(4,"div",3)(5,"div",4)(6,"div",5),n.YNc(7,M,1,4,"app-table",6),n.ALo(8,"async"),n.TgZ(9,"div",7)(10,"div",8)(11,"div",9),n._uU(12),n.ALo(13,"number"),n.ALo(14,"async"),n.YNc(15,R,3,0,"span",10),n.YNc(16,U,3,3,"span",2),n.ALo(17,"async"),n._uU(18),n.qZA()(),n.TgZ(19,"div",11),n.YNc(20,k,3,0,"a",12),n.YNc(21,J,3,0,"a",13),n.qZA()()()()()()()}if(2&e){const t=n.oxw();let a;n.Q6J("pageData",t.pageData)("hideSearchBox",!1)("hideSearchDropdown",!0)("textButton","Search"),n.xp6(1),n.Q6J("ngIf",n.lcZ(2,12,t.paginationService.data$)),n.xp6(6),n.Q6J("ngIf",n.lcZ(8,14,t.paginationService.data$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(13,16,null==(a=n.lcZ(14,18,t.paginationService.data$))?null:a.length)," of "),n.xp6(3),n.Q6J("ngIf",t.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(17,20,!t.paginationService.hideCount&&t.allDataCount$)),n.xp6(2),n.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),n.xp6(2),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}let Q=(()=>{class e{constructor(t,a,o,i){this.http=t,this.toastr=a,this.dialog=o,this.paginationService=i,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe((0,C.b)(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:1,RowCount:t.Filter.PageSize},this.searchFilter=t.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t,a){let o=this.getSelected(t);if(o.length>0){let r=[];o.forEach(p=>r.push({ID:p.ID,Code:p.Code,Inventory:p.Inventory}));var i=[];for(let p of a)p.selected&&i.push(p.ID);let c={ListChannelID:i,List:r};this.http.post("/api/Inventory/UpdateChannel",c).subscribe(p=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+c.List.length+" variants in "+c.ListChannelID.length+" channels","Success")})}}openScanDialog(t){this.dialog.open(v.j,{data:{filter:this.searchFilter,Channel:t},width:"30%"}).afterClosed().subscribe(o=>{null!=o&&(this.searchFilter=o.filter,this.searchFilter.sync?this.RefreshChannel():this.searchFilter.sync||this.RefreshChannel())})}RefreshChannel(){let t={ID:this.searchFilter.ChannelID,ScanFull:this.searchFilter.ScanFull};this.http.post("/api/product/ScanOptimized",t).subscribe(a=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully scanned from "+this.getChannelName(t.ID),"Success")})}UpdateStockByVariant(t,a){let o={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",o).subscribe(i=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+this.getChannelName(o.ID)+" to "+o.NewQuantity,"Success");for(let r of a)if(r.ChannelItemID===t.ChannelItemID)for(let c of r.Variants)c.ChannelVariationID==t.ChannelVariantID&&(c.Stock=parseFloat(t.Inventory))})}getSelected(t){let a=[];if(t){for(let o of t)for(let i of o.Variants)i.selected&&a.push(i);return a}return[]}hasSelection(t){return!!t&&this.getSelected(t).length>0}getChannelName(t){return this.channelOptions.find(o=>o.ID==t).Name}onShowDifferenceStock(t){this.searchFilter.filterModel=t?3:1,this.paginationService.resetToFirstPage(this.searchFilter)}onUpdateItems(t,a){const o=this.getSelected(t);this.dialog.open(A.j,{data:{selectedItems:o,channels:a},width:"40%"}).afterClosed().subscribe(i=>{i&&this.updateStock(t,i)})}getAllDataCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,{})}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}}return e.\u0275fac=function(t){return new(t||e)(n.Y36(I.O),n.Y36(y._W),n.Y36(x.uw),n.Y36(b.b))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-inventory-pos"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,a){1&t&&(n.YNc(0,L,22,22,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,a.loader$))},dependencies:[u.O5,m.p,S.a,u.Ov,u.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),e})();var O=s(7945),T=s(9300),V=s(6082),_=s(4006),g=s(8796),Z=s(455);function q(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",32),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2).ngIf,i=n.oxw();return n.KtG(i.openScanDialog(o))}),n._UZ(1,"i",33),n._uU(2," Scan Channel "),n.qZA()}}function Y(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",34),n.NdJ("click",function(){n.CHM(t);const o=n.oxw().ngIf,i=n.oxw(2);return n.KtG(i.updateStock(o))}),n._UZ(1,"i",35),n._uU(2," Update"),n.qZA()}}function $(e,l){if(1&e&&(n.TgZ(0,"div"),n.YNc(1,q,3,0,"button",30),n.YNc(2,Y,3,0,"button",31),n.qZA()),2&e){const t=l.ngIf,a=n.oxw(2);n.xp6(1),n.Q6J("ngIf",!a.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",a.productService.hasSelectionVariant(t))}}function K(e,l){1&e&&(n.TgZ(0,"div",36)(1,"span"),n._uU(2," showing only different stock, please press next to populate more data "),n.qZA()())}function G(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"th")(1,"input",37),n.NdJ("ngModelChange",function(o){n.CHM(t);const i=n.oxw(2);return n.KtG(i.checkboxState=o)})("ngModelChange",function(){const i=n.CHM(t).ngIf,r=n.oxw(2);return n.KtG(r.onCheckboxStateChange(i))}),n.qZA()()}if(2&e){const t=n.oxw(2);n.xp6(1),n.Q6J("ngModel",t.checkboxState)}}function E(e,l){if(1&e&&(n.TgZ(0,"ng-option",38),n._UZ(1,"img",39),n._uU(2),n.qZA()),2&e){const t=l.$implicit;n.Q6J("value",t.ID),n.xp6(1),n.s9C("src",t.Img,n.LSH),n.xp6(1),n.Oqu(t.Name)}}function H(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",57),n.NdJ("ngModelChange",function(o){n.CHM(t);const i=n.oxw(3).$implicit;return n.KtG(i.selected=o)})("ngModelChange",function(){n.CHM(t);const o=n.oxw(3).$implicit,i=n.oxw(2);return n.KtG(i.onCheckboxStateProduct(o))}),n.qZA()}if(2&e){const t=n.oxw(3).$implicit;n.Q6J("ngModel",t.selected)}}function B(e,l){if(1&e&&n._UZ(0,"img",58),2&e){const t=n.oxw(3).$implicit;n.s9C("src",null==t?null:t.ThumbnailUrl,n.LSH)}}function j(e,l){1&e&&n._UZ(0,"img",59)}function z(e,l){if(1&e&&(n.ynx(0),n.TgZ(1,"td",50)(2,"div",51),n.YNc(3,H,1,1,"input",52),n.YNc(4,B,1,1,"img",53),n.YNc(5,j,1,0,"ng-template",null,54,n.W1O),n.qZA()(),n.TgZ(7,"td",55)(8,"span",56),n._uU(9),n.qZA(),n._UZ(10,"br"),n.TgZ(11,"small"),n._uU(12),n.qZA()(),n.BQk()),2&e){const t=n.MAs(6),a=n.oxw().$implicit,o=n.oxw().$implicit;n.xp6(1),n.Q6J("rowSpan",null==o?null:o.Variants.length),n.xp6(2),n.Q6J("ngIf",(null==a?null:a.Inventory)>=0||o.Variants.length>1),n.xp6(1),n.Q6J("ngIf",null==o?null:o.ThumbnailUrl)("ngIfElse",t),n.xp6(3),n.Q6J("rowSpan",null==o?null:o.Variants.length),n.xp6(2),n.Oqu(null==o?null:o.Name),n.xp6(3),n.hij("(",null==o?null:o.Category,")")}}function W(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",37),n.NdJ("ngModelChange",function(o){n.CHM(t);const i=n.oxw().$implicit;return n.KtG(i.selected=o)}),n.qZA()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngModel",t.selected)}}function X(e,l){if(1&e&&(n.TgZ(0,"span")(1,"span",60),n._uU(2),n.ALo(3,"number"),n.qZA(),n._uU(4," => "),n.TgZ(5,"span",61),n._uU(6),n.ALo(7,"number"),n.qZA()()),2&e){const t=n.oxw().$implicit;n.xp6(2),n.hij(" ",n.lcZ(3,2,null==t||null==t.I?null:t.I.Available),""),n.xp6(4),n.Oqu(n.lcZ(7,4,null==t?null:t.Inventory))}}function nn(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=n.oxw().$implicit;n.xp6(1),n.hij(" ",n.lcZ(2,1,null==t?null:t.Inventory)," ")}}const tn=function(e){return{"bg-err":e}};function en(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"td",62)(1,"div",63)(2,"div",64),n.NdJ("click",function(){n.CHM(t);const o=n.oxw().$implicit,i=n.oxw(),r=i.$implicit,c=i.ngForOf,p=n.oxw(2);return n.KtG(p.openTableDialog(r,o,c))}),n._uU(3),n.ALo(4,"number"),n.qZA()()()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngClass",n.VKq(4,tn,(null==t?null:t.Inventory)!=(null==t||null==t.Channel[0]?null:t.Channel[0].Inventory))),n.xp6(3),n.hij(" ",n.lcZ(4,2,null==t||null==t.Channel[0]?null:t.Channel[0].Inventory)," ")}}function an(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"tr"),n.YNc(1,z,13,7,"ng-container",3),n.TgZ(2,"td",40),n._uU(3),n.qZA(),n.TgZ(4,"td",41),n._uU(5),n.qZA(),n.TgZ(6,"td",42),n.YNc(7,W,1,1,"input",43),n.qZA(),n.TgZ(8,"td",41),n.YNc(9,X,8,6,"span",3),n.YNc(10,nn,3,3,"span",3),n.qZA(),n.YNc(11,en,5,6,"td",44),n.TgZ(12,"td")(13,"div",10)(14,"div",45)(15,"a",46),n._UZ(16,"i",47),n.qZA(),n._uU(17," \xa0\xa0 "),n.TgZ(18,"span",48),n.NdJ("click",function(){const i=n.CHM(t).$implicit,r=n.oxw(3);return n.KtG(r.RefreshInventory(null==i||null==i.Channel[0]?null:i.Channel[0].ChannelItemID,null==i||null==i.Channel[0]?null:i.Channel[0].ChannelVariationID,null==i||null==i.Channel[0]?null:i.Channel[0].ChannelID,null==i?null:i.ID))}),n._UZ(19,"i",49),n.qZA()()()()()}if(2&e){const t=l.$implicit,a=l.index;n.xp6(1),n.Q6J("ngIf",0==a),n.xp6(2),n.Oqu(null==t?null:t.Model),n.xp6(2),n.hij(" ",null==t?null:t.Code," "),n.xp6(2),n.Q6J("ngIf",(null==t?null:t.Inventory)>=0),n.xp6(2),n.Q6J("ngIf",(null==t?null:t.Inventory)!=(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",(null==t?null:t.Inventory)==(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",null==t?null:t.Channel),n.xp6(4),n.Q6J("href",null==t||null==t.Channel[0]?null:t.Channel[0].Url,n.LSH)}}function on(e,l){if(1&e&&(n.TgZ(0,"tbody"),n.YNc(1,an,20,8,"tr",24),n.qZA()),2&e){const t=l.$implicit;n.xp6(1),n.Q6J("ngForOf",t.Variants)}}function ln(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",65),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.getRowCount())}),n.TgZ(1,"i",66),n._uU(2,"?"),n.qZA()()}}function rn(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,null==t?null:t.Total))}}function sn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",70),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(3);return n.KtG(o.onNextPage())}),n._UZ(1,"i",71),n._uU(2," Next"),n.qZA()}}function cn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",72),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(3);return n.KtG(o.onLastPage())}),n._UZ(1,"i",73),n._uU(2," Last"),n.qZA()}}function pn(e,l){if(1&e&&(n.TgZ(0,"div",67),n.YNc(1,sn,3,0,"a",68),n.YNc(2,cn,3,0,"a",69),n.qZA()),2&e){const t=n.oxw(2);n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function un(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(o){n.CHM(t);const i=n.oxw();return n.KtG(i.onSearch(o))}),n.TgZ(1,"actions")(2,"div",2),n.YNc(3,$,3,2,"div",3),n.ALo(4,"async"),n.qZA()(),n.TgZ(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),n._uU(10,"PageNumber"),n.qZA(),n.TgZ(11,"input",6),n.NdJ("ngModelChange",function(o){n.CHM(t);const i=n.oxw();return n.KtG(i.searchFilter.PageNumber=o)}),n.qZA()(),n.TgZ(12,"div")(13,"label",7),n._uU(14,"Page Size"),n.qZA(),n.TgZ(15,"input",8),n.NdJ("ngModelChange",function(o){n.CHM(t);const i=n.oxw();return n.KtG(i.searchFilter.RowCount=o)}),n.qZA()()()()(),n.TgZ(16,"content")(17,"div",9)(18,"div",10)(19,"div",11),n.YNc(20,K,3,0,"div",12),n.TgZ(21,"table",13)(22,"thead",14)(23,"tr")(24,"th",15),n._uU(25,"Product "),n._UZ(26,"br"),n.TgZ(27,"mat-slide-toggle",16),n.NdJ("toggleChange",function(){n.CHM(t);const o=n.oxw();return o.showDifferenceStock=!o.showDifferenceStock,n.KtG(o.onShowDifferenceStock())}),n.TgZ(28,"small",17),n._uU(29,"Filter Different Inventory"),n.qZA()()(),n.TgZ(30,"th",18),n._uU(31,"Variant"),n.qZA(),n.TgZ(32,"th",19),n._uU(33,"SKU"),n.qZA(),n.YNc(34,G,2,1,"th",3),n.ALo(35,"async"),n.TgZ(36,"th",20),n._uU(37,"POS"),n.qZA(),n.TgZ(38,"th")(39,"ng-select",21),n.NdJ("change",function(o){n.CHM(t);const i=n.oxw();return n.KtG(i.onFilterChannel(o))})("ngModelChange",function(o){n.CHM(t);const i=n.oxw();return n.KtG(i.searchFilter.ChannelID=o)}),n.YNc(40,E,3,3,"ng-option",22),n.qZA()(),n._UZ(41,"th",23),n.qZA()(),n.YNc(42,on,2,1,"tbody",24),n.ALo(43,"async"),n.qZA(),n.TgZ(44,"div",25)(45,"div",26)(46,"div",27),n._uU(47),n.ALo(48,"number"),n.ALo(49,"async"),n.YNc(50,ln,3,0,"span",28),n.YNc(51,rn,3,3,"span",3),n.ALo(52,"async"),n._uU(53),n.qZA()(),n.YNc(54,pn,3,2,"div",29),n.ALo(55,"async"),n.qZA()()()()()()}if(2&e){const t=l.ngIf,a=n.oxw();let o,i;n.Q6J("headerTitle","Inventory Comparison")("pageData",a.pageData)("hideSearchBox",!1),n.xp6(3),n.Q6J("ngIf",n.lcZ(4,17,a.paginationService.data$)),n.xp6(8),n.Q6J("ngModel",a.searchFilter.PageNumber),n.xp6(4),n.Q6J("ngModel",a.searchFilter.RowCount),n.xp6(5),n.Q6J("ngIf",3==(null==a.searchFilter?null:a.searchFilter.filterModel)),n.xp6(14),n.Q6J("ngIf",n.lcZ(35,19,a.paginationService.data$)),n.xp6(5),n.Q6J("clearable",!1)("ngModel",a.searchFilter.ChannelID),n.xp6(1),n.Q6J("ngForOf",t.Options.Channel),n.xp6(2),n.Q6J("ngForOf",n.lcZ(43,21,a.paginationService.data$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(48,23,null==(o=n.lcZ(49,25,a.paginationService.data$))?null:o.length)," of "),n.xp6(3),n.Q6J("ngIf",a.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(52,27,!a.paginationService.hideCount&&a.rowCount$)),n.xp6(2),n.hij(" records ~ ",a.paginationService.footerPageNumber," Page "),n.xp6(1),n.Q6J("ngIf",(null==(i=n.lcZ(55,29,a.paginationService.data$))?null:i.length)>0)}}let _n=(()=>{class e{constructor(t,a,o,i,r){this.http=t,this.toastr=a,this.dialog=o,this.paginationService=i,this.productService=r,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.initLoader()}initLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe((0,C.b)(t=>{this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.paginationService.resetToFirstPage(this.searchFilter),t.Filter.IsMarketplaceAppActive||this.toastr.warning("Automatic inventory sync disabled.\n Please enable Dealpos X Marketplace Apps integration in POS Configuration","Warning")}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}onFilterChannel(t){this.searchFilter.ChannelID=t,this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t){const a=this.productService.selectedVariantProduct(t);if(a.length>0){let i=a.map(c=>({ID:c.ID,Code:c.Code,Inventory:c.Inventory}));var o=[];o.push(this.searchFilter.ChannelID);let r={ListChannelID:o,List:i};this.http.post("/api/Inventory/UpdateChannel",r).subscribe(c=>{this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+r.List.length+" variants in "+r.ListChannelID.length+" channels","Success")})}}openScanDialog(t){const a=Object.assign({},this.searchFilter);this.dialog.open(v.j,{data:{filter:a,Channel:t.Options.Channel},width:"30%"}).afterClosed().pipe((0,T.h)(i=>i)).subscribe(i=>{this.searchFilter=i.filter,this.searchFilter.sync&&this.refreshChannel(t)})}refreshChannel(t){let a={ID:this.searchFilter.ChannelID,ScanFull:this.searchFilter.ScanFull};const o=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.http.post("/api/product/ScanOptimized",a).subscribe(i=>{this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully scanned from "+o?.Name,"Success")})}RefreshInventory(t,a,o,i){this.http.post("/api/Inventory/RefreshInventoryChannel",{ChannelItemID:t,ChannelVariationID:a,ChannelID:o,VariantID:i}).subscribe(c=>{this.toastr.success("Successfully updated","Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(a=>(a.Inventory>=0&&(a.selected=t.selected),a))}onCheckboxStateChange(t){t=t.map(a=>(a.Variants=a.Variants.map(o=>(o.selected=this.checkboxState,o)),a))}openTableDialog(t,a,o){this.dialog.open(O.k,{data:{Name:t.Name,Variant:a,ChannelID:a?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe((0,T.h)(r=>r)).subscribe(r=>{this.updateItemAfterDialog(r,o)})}updateItemAfterDialog(t,a){let o={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};const i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",o).subscribe(r=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+i?.Name+" to "+o.NewQuantity,"Success"),a=a.map(c=>(c.ChannelItemID===t.ChannelItemID&&(c.Variants=c.Variants.map(p=>(p.ChannelVariationID==t.ChannelVariantID&&(p.Stock=t.Inventory),p))),c))})}onShowDifferenceStock(){this.searchFilter.filterModel=this.showDifferenceStock?3:1,this.paginationService.resetToFirstPage(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){const t={ChannelID:this.searchFilter.ChannelID,PageNumber:1};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){this.http.post(`${this.rowCountApi}`,{ChannelID:this.searchFilter.ChannelID,PageNumber:1}).subscribe({next:a=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,a)}})}}return e.\u0275fac=function(t){return new(t||e)(n.Y36(I.O),n.Y36(y._W),n.Y36(x.uw),n.Y36(b.b),n.Y36(V.M))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-inventory-realtime"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","36%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","20%"],["scope","col",1,"text-end","w-10"],[3,"clearable","ngModel","change","ngModelChange"],[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"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"text-start"],[1,"text-end"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"col-12","ps-0","d-flex","justify-content-between"],["target","_blank",2,"color","#333333",3,"href"],[1,"fas","fa-lg","fa-external-link-alt"],[1,"pl-5",3,"click"],[1,"fas","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","style","margin-left: 20px",3,"src",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",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-12","pe-12","text-end",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(t,a){1&t&&(n.YNc(0,un,56,31,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,a.loader$))},dependencies:[u.mk,u.sg,u.O5,_.Fj,_.wV,_.Wl,_.JJ,_.On,g.w9,g.jq,Z.Rr,m.p,u.Ov,u.JJ],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas[_ngcontent-%COMP%]{font-size:13px}"]}),e})();var w=s(8063);const hn=[{path:"",component:F,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:Q,canActivate:[w.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:_n,canActivate:[w.a],data:{title:"Inventory Comparison"}}]}];let mn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[u.ez,h.Bz.forChild(hn)]}),e})(),gn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[u.ez,mn,h.Bz,f.Z,_.u5,g.A0,Z.rP,m.R,S.U]}),e})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[512],{5512:(M,r,i)=>{i.r(r),i.d(r,{LogisticModule:()=>S});var c=i(6895),m=i(8252),t=i(4650),d=i(1318),u=i(7185),a=i(4006),p=i(7481),f=i(9549),g=i(4385),C=i(3238);function L(n,s){if(1&n&&(t.TgZ(0,"mat-option",15),t._uU(1),t.qZA()),2&n){const e=s.$implicit;t.Q6J("value",e.ID),t.xp6(1),t.hij(" ",e.Name,"")}}function T(n,s){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.TgZ(7,"td")(8,"input",16),t.NdJ("ngModelChange",function(l){const b=t.CHM(e).$implicit;return t.KtG(b.ProductSKU=l)}),t.qZA()()()}if(2&n){const e=s.$implicit;t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Service),t.xp6(2),t.Oqu(e.Type),t.xp6(2),t.Q6J("ngModel",e.ProductSKU)}}const Z=[{path:"",component:(()=>{class n{constructor(e,o){this.http=e,this.toastr=o,this.filter={ChannelID:""},this.pageData={Title:"Logistic",Nav:[]},this.LoaderChannel()}ngOnInit(){}Submit(){this.http.post("/api/Logistic/Submit",this.list).subscribe(e=>{this.toastr.success("Success","Update Complete!",{timeOut:5e3,enableHtml:!0}),this.Get()})}LoaderChannel(){this.http.post("/api/Logistic/Load",{}).subscribe(e=>{this.Channel=e.Options.Channel,this.filter=e.Filter,this.Name=this.Channel[0].Name,this.Get()})}Get(){this.http.post("/api/Logistic/Get",this.filter).subscribe(e=>{let o=this.Channel.find(l=>l.ID==this.filter.ChannelID);null!=o&&(this.Name=o.Name),this.list=e})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(d.O),t.Y36(u._W))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-logistic"]],decls:30,vars:5,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"headerTitle","hideSearchDropdown","onSubmit"],["container",""],[1,"mb-3","fw-normal"],["appearance","outline"],["name","channelid","placeholder","Channel",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"value"],["type","text","placeholder","SKU",1,"form-control","w-50",3,"ngModel","ngModelChange"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(){return o.Get()}),t.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h5",2),t._uU(5,"Select a Channel"),t.qZA(),t.TgZ(6,"mat-form-field",3)(7,"mat-select",4),t.NdJ("ngModelChange",function(h){return o.filter.ChannelID=h}),t.YNc(8,L,2,2,"mat-option",5),t.qZA()()()()(),t.TgZ(9,"actions")(10,"a",6),t.NdJ("click",function(){return o.Submit()}),t._uU(11,"Submit"),t.qZA()(),t.TgZ(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13)(20,"th"),t._uU(21,"Logistic"),t.qZA(),t.TgZ(22,"th"),t._uU(23,"Service"),t.qZA(),t.TgZ(24,"th"),t._uU(25,"Type"),t.qZA(),t.TgZ(26,"th"),t._uU(27,"SKU"),t.qZA()()(),t.TgZ(28,"tbody"),t.YNc(29,T,9,4,"tr",14),t.qZA()()()()()()()()),2&e&&(t.Q6J("headerTitle","Logistic Courier - "+o.Name)("hideSearchDropdown",!1),t.xp6(7),t.Q6J("ngModel",o.filter.ChannelID),t.xp6(1),t.Q6J("ngForOf",o.Channel),t.xp6(21),t.Q6J("ngForOf",o.list))},dependencies:[c.sg,a.Fj,a.JJ,a.On,p.p,f.KE,g.gD,C.ey]}),n})()}];let v=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[c.ez,m.Bz.forChild(Z)]}),n})(),S=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[c.ez,m.Bz,v,a.u5,p.R,g.LD]}),n})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[717],{6717:(Z,d,o)=>{o.r(d),o.d(d,{NotificationModule:()=>N});var l=o(6895),m=o(8252),t=o(4650),f=o(1318),h=o(8796),c=o(4006),u=o(7481);function p(e,i){if(1&e&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.qZA()()),2&e){const n=i.$implicit;t.xp6(2),t.Oqu(t.xi3(3,4,n.Created,"dd MMM yyyy hh:mm")),t.xp6(3),t.Oqu(n.Name),t.xp6(2),t.Oqu(n.Body),t.xp6(2),t.Oqu(n.URL)}}const g=[{path:"",component:(()=>{class e{constructor(n){this.http=n,this.filter={ChannelID:""},this.Load()}ngOnInit(){}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(n=>{this.filter=n.Filter,this.Channel=n.Options.Channel,this.Get()})}Get(){this.http.post("/api/Orders/GetPushNotification",this.filter).subscribe(n=>{this.data=n.Data;for(let a of this.data){let r=this.Channel.find(s=>s.ID===a.ChannelID);null!=r&&(a.Name=r.Name)}})}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(f.O))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-notification"]],decls:25,vars:5,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"headerTitle","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(n,a){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(){return a.Get()}),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(s){return a.filter.ChannelID=s}),t.qZA()()()(),t.TgZ(7,"content")(8,"div",3)(9,"div",4)(10,"div",5)(11,"div",6)(12,"table",7)(13,"thead")(14,"tr",8)(15,"th"),t._uU(16,"Created"),t.qZA(),t.TgZ(17,"th"),t._uU(18,"Channel"),t.qZA(),t.TgZ(19,"th"),t._uU(20,"Body"),t.qZA(),t.TgZ(21,"th"),t._uU(22,"Url"),t.qZA()()(),t.TgZ(23,"tbody"),t.YNc(24,p,10,7,"tr",9),t.qZA()()()()()()()()),2&n&&(t.Q6J("headerTitle","Notification"),t.xp6(6),t.Q6J("clearable",!0)("items",a.Channel)("ngModel",a.filter.ChannelID),t.xp6(18),t.Q6J("ngForOf",a.data))},dependencies:[l.sg,h.w9,c.JJ,c.On,u.p,l.uU]}),e})()}];let C=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[l.ez,m.Bz.forChild(g)]}),e})(),N=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[l.ez,C,h.A0,c.u5,u.R]}),e})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[767],{6767:(le,Z,d)=>{d.r(Z),d.d(Z,{LogsModule:()=>re});var s=d(6895),e=d(4650),l=d(8252),v=d(7398);let y=(()=>{class o{constructor(){this.ObjectlogTabs=[{Title:"Sync Orders",Url:"/menu/log/order"},{Title:"Inventory Log ",Url:"/menu/log/inventory"},{Title:"Marketplace Webhook ",Url:"/menu/log/rawlog"},{Title:"Application Exception ",Url:"/menu/log/exception"}]}ngOnInit(){}}return o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-logs"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,n){1&t&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&t&&(e.xp6(3),e.Q6J("Tabs",n.ObjectlogTabs))},dependencies:[l.lC,v.e]}),o})();var c=d(1318);let m=(()=>{class o{constructor(){}get Data(){return this._Data}set Data(t){this._Data=t}Fill(t){return this._Data.find(n=>n._id==t)}}return o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var p=d(4006),u=d(7481),_=d(8739),T=d(8796),f=d(5585);const b=function(){return["/menu/log/order/detail"]},A=function(o){return{ID:o}};function q(o,r){if(1&o&&(e.TgZ(0,"tr",16)(1,"td")(2,"a",17),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA()()),2&o){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(10,b))("queryParams",e.VKq(11,A,t.ID)),e.xp6(1),e.hij(" ",e.xi3(4,7,t.Created,"dd MMM yyyy HH:mm")," "),e.xp6(3),e.Oqu(t.MarketTypeString),e.xp6(2),e.Oqu(t.POSActionTypeString),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.ResponseCode)}}let L=(()=>{class o{constructor(t,n,i){this.http=t,this.url=n,this._RawLogService=i,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCodeList:[],From:"",To:""},this.Load()}ngOnInit(){this.maxDate=new Date}Load(){this.url.queryParamMap.subscribe(t=>{let n=t.params;this.filter.From=n.From,this.filter.To=n.To,this.filter.ChannelID=n.ChannelID,this.filter.ActionType=n.ActionType,this.http.post("/api/OrdersLoader/GetErrorLog",this.filter).subscribe(i=>{this.filter=i.Filter,this.Channel=i.Options.Channel,this.ActionTypeList=i.Options.ActionTypeList,this.Get()})})}Get(t){this.filter.Number=t,this.filter.StatusCodeList=[400,401,403,429,500,503],this.http.post("/api/Orders/GetErrorLog",this.filter).subscribe(n=>{this._RawLogService.Data=n.hits,this.Result=Array();for(let i of n.hits)this.Result.push({ID:i._id,Created:i._source["@timestamp_received"],MarketTypeString:i._source.log.type,POSActionTypeString:i._source.message,Number:i._source.log.number,ResponseCode:i._source.log.responseCode});this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}getDayDiff(t,n){return(n.getTime()-t.getTime())/864e5}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(l.gz),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-error-log"]],decls:45,vars:16,consts:[["searchBoxPlaceHolder","Invoice Number..",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],["class","over-due",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[1,"over-due"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.Number=a})("onSubmit",function(a){return n.Get(a)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(a){return n.filter.ChannelID=a}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Action"),e.qZA(),e.TgZ(10,"ng-select",3),e.NdJ("ngModelChange",function(a){return n.filter.ActionType=a}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"From/To"),e.qZA(),e.TgZ(14,"datepicker",4),e.NdJ("dateChange",function(a){return n.filter.From=a}),e.qZA(),e.TgZ(15,"datepicker",5),e.NdJ("dateChange",function(a){return n.filter.To=a}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Number"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(a){return n.filter.PageNumber=a}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Page Size"),e.qZA(),e.TgZ(23,"input",7),e.NdJ("ngModelChange",function(a){return n.filter.RowCount=a}),e.qZA()()()(),e.TgZ(24,"content")(25,"div",8)(26,"div",9)(27,"div",10)(28,"div",11)(29,"table",12)(30,"thead")(31,"tr",13)(32,"th"),e._uU(33,"Date"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Channel"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"Actions"),e.qZA(),e.TgZ(38,"th"),e._uU(39,"Number"),e.qZA(),e.TgZ(40,"th"),e._uU(41,"Code"),e.qZA()()(),e.TgZ(42,"tbody"),e.YNc(43,q,13,13,"tr",14),e.qZA()(),e.TgZ(44,"mat-paginator",15),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Error Log")("text",n.Number),e.xp6(6),e.Q6J("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),e.xp6(4),e.Q6J("clearable",!0)("items",n.ActionTypeList)("ngModel",n.filter.ActionType),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.RowCount),e.xp6(20),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.sg,p.Fj,p.wV,p.JJ,p.On,l.yS,u.p,_.NW,T.w9,f.QB,s.uU]}),o})();var h=d(8063);const O=function(){return["/menu/log/order/detail"]},S=function(o){return{ID:o}},U=function(o,r){return{"bg-warning":o,"bg-success":r}};function I(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",17),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td")(12,"span",18),e._uU(13),e.qZA()()()),2&o){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(11,O))("queryParams",e.VKq(12,S,t.ID)),e.xp6(1),e.hij(" ",e.xi3(4,8,t.Created,"dd MMM yyyy HH:mm")," "),e.xp6(3),e.Oqu(t.MarketTypeString),e.xp6(2),e.Oqu(t.POSActionTypeString),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Q6J("ngClass",e.WLB(14,U,200!==t.ResponseCode,200===t.ResponseCode)),e.xp6(1),e.Oqu(t.ResponseCode)}}let N=(()=>{class o{constructor(t,n,i){this.http=t,this._RawLogService=n,this.route=i,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""}}ngOnInit(){this.route.queryParams.subscribe(t=>{this.responseCode=t.responseCode,null!=this.responseCode?this.Load(t):this.Load()})}Load(t={}){this.http.post("/api/OrdersLoader/Get",t).subscribe(n=>{this.filter=n.Filter,this.Channel=n.Options.Channel,this.ActionTypeList=n.Options.ActionTypeList,this.Get()})}Get(t){this.filter.Number=t,this.http.post("/api/Orders/Get",this.filter).subscribe(n=>{this._RawLogService.Data=n.hits,this.Result=Array();for(let i of n.hits)this.Result.push({ID:i._id,Created:i._source["@timestamp_received"],shopId:i._source.shopId,MarketTypeString:i._source.log.type,POSActionTypeString:i._source.message,Number:i._source.log.number,ResponseCode:i._source.log.responseCode});this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(m),e.Y36(l.gz))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-order"]],decls:49,vars:17,consts:[["searchBoxPlaceHolder","Invoice Number..",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","text","name","StatusCode",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"],[1,"text-white","p-1","rounded","response-desc",3,"ngClass"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.Number=a})("onSubmit",function(a){return n.Get(a)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(a){return n.filter.ChannelID=a}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Action"),e.qZA(),e.TgZ(10,"ng-select",3),e.NdJ("ngModelChange",function(a){return n.filter.ActionType=a}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"From/To"),e.qZA(),e.TgZ(14,"datepicker",4),e.NdJ("dateChange",function(a){return n.filter.From=a}),e.qZA(),e.TgZ(15,"datepicker",5),e.NdJ("dateChange",function(a){return n.filter.To=a}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Response Code"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(a){return n.filter.StatusCode=a}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Page Number"),e.qZA(),e.TgZ(23,"input",7),e.NdJ("ngModelChange",function(a){return n.filter.PageNumber=a}),e.qZA()(),e.TgZ(24,"div")(25,"h6"),e._uU(26,"Page Size"),e.qZA(),e.TgZ(27,"input",8),e.NdJ("ngModelChange",function(a){return n.filter.RowCount=a}),e.qZA()()()(),e.TgZ(28,"content")(29,"div",9)(30,"div",10)(31,"div",11)(32,"div",12)(33,"table",13)(34,"thead")(35,"tr",14)(36,"th"),e._uU(37,"Date"),e.qZA(),e.TgZ(38,"th"),e._uU(39,"Channel"),e.qZA(),e.TgZ(40,"th"),e._uU(41,"Actions"),e.qZA(),e.TgZ(42,"th"),e._uU(43,"Number"),e.qZA(),e.TgZ(44,"th"),e._uU(45,"Code"),e.qZA()()(),e.TgZ(46,"tbody"),e.YNc(47,I,14,17,"tr",15),e.qZA()(),e.TgZ(48,"mat-paginator",16),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Order Log")("text",n.Number),e.xp6(6),e.Q6J("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),e.xp6(4),e.Q6J("clearable",!0)("items",n.ActionTypeList)("ngModel",n.filter.ActionType),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(4),e.Q6J("ngModel",n.filter.StatusCode),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.RowCount),e.xp6(20),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.mk,s.sg,p.Fj,p.wV,p.JJ,p.On,l.yS,u.p,_.NW,T.w9,f.QB,s.uU]}),o})();const D=function(){return["/menu/log/inventory/detail"]},w=function(o){return{ID:o}};function R(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",15),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA()()),2&o){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(10,D))("queryParams",e.VKq(11,w,t.ID)),e.xp6(1),e.hij(" ",e.xi3(4,7,t.Created,"dd MMM yyyy HH:mm")," "),e.xp6(3),e.Oqu(t.channelName),e.xp6(2),e.Oqu(t.Sku),e.xp6(2),e.Oqu(t.Stock),e.xp6(2),e.Oqu(t.ResponseCode)}}let M=(()=>{class o{constructor(t,n){this.http=t,this._RawLogService=n,this.Result=Array(),this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load()}ngOnInit(){}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(t=>{this.filter=t.Filter,this.Channel=t.Options.Channel,this.ActionTypeList=t.Options.ActionTypeList,this.Get()})}Get(t){null!=t&&(this.filter.Sku=t),this.http.post("api/Inventory/GetLog",this.filter).subscribe(n=>{this._RawLogService.Data=n.hits,this.Result=Array();for(let i of n.hits)this.Result.push({ID:i._source.log.id,Created:i._source["@timestamp_received"],channelName:i._source.log.channelName,Sku:i._source.log.sku,Stock:i._source.log.stock,ResponseCode:i._source.log.responseCode});this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount,this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-inventory-log"]],decls:41,vars:13,consts:[["searchBoxPlaceHolder","Enter SKU...",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt=3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.filter.Sku=a})("onSubmit",function(a){return n.Get(a)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(a){return n.filter.ChannelID=a}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"From/To"),e.qZA(),e.TgZ(10,"datepicker",3),e.NdJ("dateChange",function(a){return n.filter.From=a}),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(a){return n.filter.To=a}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Number"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(a){return n.filter.PageNumber=a}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Size"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(a){return n.filter.RowCount=a}),e.qZA()()()(),e.TgZ(20,"content")(21,"div",7)(22,"div",8)(23,"div",9)(24,"div",10)(25,"table",11)(26,"thead")(27,"tr",12)(28,"th"),e._uU(29,"Created"),e.qZA(),e.TgZ(30,"th"),e._uU(31,"Channel"),e.qZA(),e.TgZ(32,"th"),e._uU(33,"SKU"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Stock"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"Response code"),e.qZA()()(),e.TgZ(38,"tbody"),e.YNc(39,R,13,13,"tr",13),e.qZA()(),e.TgZ(40,"mat-paginator",14),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Inventory Log")("text",n.filter.Sku),e.xp6(6),e.Q6J("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.RowCount),e.xp6(20),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.sg,p.Fj,p.wV,p.JJ,p.On,l.yS,u.p,_.NW,T.w9,f.QB,s.uU]}),o})();const x=function(){return["/menu/log/rawlog/detail"]},J=function(o){return{ID:o}};function k(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",9),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA()()),2&o){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(10,x))("queryParams",e.VKq(11,J,t.id)),e.xp6(1),e.hij(" ",e.xi3(4,7,t.Created,"dd MMM yyyy HH:mm")," "),e.xp6(3),e.Oqu(t.number),e.xp6(2),e.Oqu(t.type),e.xp6(2),e.Oqu(t.message),e.xp6(2),e.Oqu(t.processTypeString)}}function P(o,r){if(1&o&&(e.TgZ(0,"div",2)(1,"div",3)(2,"div",4)(3,"table",5)(4,"thead",6)(5,"tr")(6,"th",7),e._uU(7,"Date"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Number"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Type"),e.qZA(),e.TgZ(12,"th"),e._uU(13,"Status"),e.qZA(),e.TgZ(14,"th"),e._uU(15,"Process"),e.qZA()()(),e.TgZ(16,"tbody"),e.YNc(17,k,13,13,"tr",8),e.qZA()()()()()),2&o){const t=e.oxw();e.xp6(17),e.Q6J("ngForOf",t.Result)}}let F=(()=>{class o{constructor(t,n){this.http=t,this._RawLogService=n,this.Result=Array(),this.list=[],this.filter={},this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.filter={Number:"",PageNumber:1,RowCount:20,ChannelID:"",Status:""}}ngOnInit(){}Get(t){if(null!=t){let n=[];n.push(t),this.http.post("api/Orders/GetRawLog",n).subscribe(i=>{this._RawLogService.Data=i.hits,this.Result=Array();for(let a of i.hits){let g={};g=a._source.error?{id:a._id,message:a._source.message,processTypeString:a._source.error.processType,type:a._source.error.type,number:a._source.error.number,Created:a._source["@timestamp_received"]}:{id:a._id,message:a._source.message,processTypeString:a._source.log.processType,type:a._source.log.type,number:a._source.log.number,Created:a._source["@timestamp_received"]},this.Result.push(g)}})}}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-raw-log"]],decls:3,vars:3,consts:[["searchBoxPlaceHolder","Invoice Number..","hideSearchDropdown","true",3,"headerTitle","text","textChange","onSubmit"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.filter.Number=a})("onSubmit",function(a){return n.Get(a)}),e.TgZ(1,"content"),e.YNc(2,P,18,1,"div",1),e.qZA()()),2&t&&(e.Q6J("headerTitle","Raw Log")("text",n.filter.Number),e.xp6(2),e.Q6J("ngIf",n.Result.length>0))},dependencies:[s.sg,s.O5,l.yS,u.p,s.uU]}),o})();class Q{constructor(r,t){this._document=t;const n=this._textarea=this._document.createElement("textarea"),i=n.style;i.position="fixed",i.top=i.opacity="0",i.left="-999em",n.setAttribute("aria-hidden","true"),n.value=r,this._document.body.appendChild(n)}copy(){const r=this._textarea;let t=!1;try{if(r){const n=this._document.activeElement;r.select(),r.setSelectionRange(0,r.value.length),t=this._document.execCommand("copy"),n&&n.focus()}}catch{}return t}destroy(){const r=this._textarea;r&&(r.remove(),this._textarea=void 0)}}let Y=(()=>{class o{constructor(t){this._document=t}copy(t){const n=this.beginCopy(t),i=n.copy();return n.destroy(),i}beginCopy(t){return new Q(t,this._document)}}return o.\u0275fac=function(t){return new(t||o)(e.LFG(s.K0))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();const E=new e.OlP("CDK_COPY_TO_CLIPBOARD_CONFIG");let z=(()=>{class o{constructor(t,n,i){this._clipboard=t,this._ngZone=n,this.text="",this.attempts=1,this.copied=new e.vpe,this._pending=new Set,i&&null!=i.attempts&&(this.attempts=i.attempts)}copy(t=this.attempts){if(t>1){let n=t;const i=this._clipboard.beginCopy(this.text);this._pending.add(i);const a=()=>{const g=i.copy();g||!--n||this._destroyed?(this._currentTimeout=null,this._pending.delete(i),i.destroy(),this.copied.emit(g)):this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(a,1))};a()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(t=>t.destroy()),this._pending.clear(),this._destroyed=!0}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(Y),e.Y36(e.R0b),e.Y36(E,8))},o.\u0275dir=e.lG2({type:o,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(t,n){1&t&&e.NdJ("click",function(){return n.copy()})},inputs:{text:["cdkCopyToClipboard","text"],attempts:["cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"}}),o})(),G=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({}),o})();function B(o,r){1&o&&e._UZ(0,"img",21)}function H(o,r){1&o&&e._UZ(0,"img",22)}function j(o,r){if(1&o&&(e.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"h5"),e._uU(4,"General"),e.qZA()(),e.TgZ(5,"div",7)(6,"div",2)(7,"div",8)(8,"div",9)(9,"label"),e._uU(10,"Date"),e.qZA(),e.TgZ(11,"div")(12,"span"),e._uU(13),e.ALo(14,"date"),e.qZA()()()(),e.TgZ(15,"div",10)(16,"div",9)(17,"label"),e._uU(18,"Market Place Type"),e.qZA(),e.YNc(19,B,1,0,"img",11),e.YNc(20,H,1,0,"img",12),e.TgZ(21,"a",13)(22,"span",14),e._uU(23),e.qZA(),e._UZ(24,"br"),e.TgZ(25,"small",15),e._uU(26),e.qZA()()()(),e.TgZ(27,"div",10)(28,"div",9)(29,"label"),e._uU(30,"Number"),e.qZA(),e.TgZ(31,"div")(32,"span"),e._uU(33),e.qZA()()()(),e.TgZ(34,"div",8)(35,"div",9)(36,"label"),e._uU(37,"Process Type"),e.qZA(),e.TgZ(38,"div")(39,"span"),e._uU(40),e.qZA()()()(),e.TgZ(41,"div",4)(42,"div",9)(43,"label"),e._uU(44,"Authorization Header"),e.qZA(),e.TgZ(45,"div")(46,"span"),e._uU(47),e.qZA()()()(),e.TgZ(48,"div",16)(49,"div",5)(50,"div",17)(51,"div",18)(52,"h3"),e._uU(53,"Request"),e.qZA()(),e.TgZ(54,"div",19)(55,"button",20),e._uU(56,"Copy to clipboard"),e.qZA()()(),e.TgZ(57,"div",7),e._uU(58),e.qZA()()()()()()()),2&o){const t=e.oxw();e.xp6(13),e.Oqu(e.xi3(14,11,t.data.Created,"dd MMM yyyy HH:mm:ss")),e.xp6(6),e.Q6J("ngIf",1==t.data.TypeID),e.xp6(1),e.Q6J("ngIf",0==t.data.TypeID),e.xp6(1),e.s9C("href",t.data.ShopLink,e.LSH),e.xp6(2),e.Oqu(t.data.ShopName),e.xp6(3),e.Oqu(t.data.ShopLink),e.xp6(7),e.Oqu(t.data._source.log.number),e.xp6(7),e.Oqu(t.data._source.log.processType),e.xp6(7),e.Oqu(t.data._source.log.authorizationHeader),e.xp6(8),e.Q6J("cdkCopyToClipboard",t.data._source.log.request),e.xp6(3),e.hij(" ",t.data._source.log.request," ")}}function K(o,r){if(1&o&&(e.TgZ(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),e._uU(4,"General"),e.qZA()(),e.TgZ(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),e._uU(10,"Date"),e.qZA(),e.TgZ(11,"div")(12,"span"),e._uU(13),e.ALo(14,"date"),e.qZA()()()(),e.TgZ(15,"div",6)(16,"div",12)(17,"label"),e._uU(18,"SKU"),e.qZA(),e.TgZ(19,"div")(20,"span"),e._uU(21),e.qZA()()()(),e.TgZ(22,"div",6)(23,"div",12)(24,"label"),e._uU(25,"Channel"),e.qZA(),e.TgZ(26,"div")(27,"span"),e._uU(28),e.qZA()()()(),e.TgZ(29,"div",6)(30,"div",12)(31,"label"),e._uU(32,"Response Code"),e.qZA(),e.TgZ(33,"div")(34,"span"),e._uU(35),e.qZA()()()()()()()()),2&o){const t=e.oxw();e.xp6(13),e.Oqu(e.xi3(14,4,t.data.Created,"dd MMM yyyy")),e.xp6(8),e.Oqu(t.data.Sku),e.xp6(7),e.Oqu(t.data.ChannelName),e.xp6(7),e.Oqu(t.data.ResponseCode)}}function W(o,r){if(1&o){const t=e.EpF();e.TgZ(0,"a",14),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.Retry())}),e._uU(1,"Retry"),e.qZA()}}function ee(o,r){1&o&&e._UZ(0,"img",12)}function te(o,r){1&o&&e._UZ(0,"img",13)}function ne(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td"),e.YNc(2,ee,1,0,"img",9),e.YNc(3,te,1,0,"img",10),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td")(9,"div",11),e._uU(10),e.qZA(),e.TgZ(11,"div"),e._uU(12),e.qZA()()()),2&o){const t=r.$implicit;e.xp6(2),e.Q6J("ngIf",1==t.TypeID),e.xp6(1),e.Q6J("ngIf",0==t.TypeID),e.xp6(2),e.Oqu(t.Date),e.xp6(2),e.Oqu(t.Number),e.xp6(3),e.Oqu(t.message),e.xp6(2),e.Oqu(t.stackTrace)}}const ie=[{path:"",component:y,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:N,canActivate:[h.a],data:{title:"Orders Log"}},{path:"inventory",component:M,canActivate:[h.a],data:{title:"Inventory Log"}},{path:"rawlog",component:F,canActivate:[h.a],data:{title:"Raw Log"}},{path:"rawlog/detail",component:(()=>{class o{constructor(t,n,i){this.route=t,this.http=n,this._RawLogService=i,this.route.queryParams.subscribe(a=>{let g=JSON.parse(localStorage.getItem("channel"));if(this.ID=a.ID,this.data=this._RawLogService.Fill(this.ID),this.data.Created=this.data._source["@timestamp_received"],g.length>0){const C=g.find(se=>se.ShopID==this.data._source.shopId);C?(this.data.TypeID=C.TypeID,this.data.ShopName=C.Name,this.data.ShopLink=C.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(l.gz),e.Y36(c.O),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-raw-detail"]],decls:5,vars:4,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-2"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-2"],[1,"info-label-group"],[1,"col-sm-4"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["target","_blank",3,"href"],[1,"fw-bold"],[1,"text-dark"],[1,"col-sm-12","mt-2"],[1,"card-header","d-lg-flex"],[1,"me-auto"],[1,"d-sm-block","mt-2"],[3,"cdkCopyToClipboard"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",1,"me-2"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",1,"me-2"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),e.YNc(4,j,59,14,"div",3),e.qZA()()()()),2&t&&(e.Q6J("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(4),e.Q6J("ngIf",n.data))},dependencies:[s.O5,u.p,z,s.uU]}),o})(),canActivate:[h.a],data:{title:"Raw Log Detail"}},{path:"errorlog",component:L,canActivate:[h.a],data:{title:"Error Log"}},{path:"inventory/detail",component:(()=>{class o{constructor(t,n,i){this.route=t,this.http=n,this._RawLogService=i,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(a=>{this.ID=a.ID,this.Load()})}ngOnInit(){}Load(){this.http.post("/api/Inventory/GetInventoryLogDeatil",{ID:this.ID}).subscribe(n=>{this.data.Created=n.hits[0]._source["@timestamp_received"],this.data.Sku=n.hits[0]._source.log.sku,this.data.ChannelName=n.hits[0]._source.log.channelName,this.data.ResponseCode=n.hits[0]._source.log.responseCode,this.request=JSON.parse(n.hits[0]._source.log.request),this.response=n.hits[0]._source.log.response})}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(l.gz),e.Y36(c.O),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-inventory-detail"]],decls:30,vars:9,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2)(6,"div",3),e.YNc(7,K,36,7,"div",4),e.qZA(),e.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),e._uU(13,"Request"),e.qZA()(),e.TgZ(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),e._uU(18),e.ALo(19,"json"),e.qZA()()()()()(),e.TgZ(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),e._uU(24,"Response"),e.qZA()(),e.TgZ(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),e._uU(29),e.qZA()()()()()()()()()()),2&t&&(e.Q6J("headerTitle","Inventory Detail")("pageData","Inventory Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(7),e.Q6J("ngIf",n.data),e.xp6(11),e.Oqu(e.lcZ(19,7,n.request)),e.xp6(11),e.Oqu(n.response))},dependencies:[s.O5,l.yS,u.p,s.Ts,s.uU]}),o})(),canActivate:[h.a],data:{title:"Inventory Details"}},{path:"order/detail",component:(()=>{class o{constructor(t,n){this.route=t,this.http=n,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(i=>{this.ID=i.ID,this.Load()})}ngOnInit(){}Retry(){this.http.post("/api/Orders/Retry",{ID:this.ID}).subscribe(n=>{alert(JSON.stringify(n))})}Load(){this.http.post("/api/Orders/GetDetail",{ID:this.ID}).subscribe(n=>{for(let i of n.hits)this.Number=i._source.log.number,this.MarketTypeString=i._source.log.type,this.ResponseCode=i._source.log.responseCode,this.POSActionTypeString=i._source.message,this.ProcessDuration=0,this.Created=i._source["@timestamp_received"],this.request=JSON.parse(i._source.log.request),this.response=JSON.parse(i._source.log.response),this.shopId=i._source.shopId})}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(l.gz),e.Y36(c.O))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-orderdetail"]],decls:82,vars:20,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),e._uU(11,"General"),e.qZA()(),e.TgZ(12,"div",7)(13,"div",3)(14,"div",8)(15,"div",9)(16,"label"),e._uU(17,"Date"),e.qZA(),e.TgZ(18,"div")(19,"span"),e._uU(20),e.ALo(21,"date"),e.qZA()()()(),e.TgZ(22,"div",8)(23,"div",9)(24,"label"),e._uU(25,"Number"),e.qZA(),e.TgZ(26,"div")(27,"span"),e._uU(28),e.qZA()()()(),e.TgZ(29,"div",8)(30,"div",9)(31,"label"),e._uU(32,"Type"),e.qZA(),e.TgZ(33,"div")(34,"span"),e._uU(35),e.qZA()()()(),e.TgZ(36,"div",8)(37,"div",9)(38,"label"),e._uU(39,"Response Code"),e.qZA(),e.TgZ(40,"div")(41,"span"),e._uU(42),e.qZA()()()(),e.TgZ(43,"div",8)(44,"div",9)(45,"label"),e._uU(46,"ShopID"),e.qZA(),e.TgZ(47,"div")(48,"span"),e._uU(49),e.qZA()()()(),e.TgZ(50,"div",8)(51,"div",9)(52,"label"),e._uU(53,"Action"),e.qZA(),e.TgZ(54,"div")(55,"span"),e._uU(56),e.qZA()()()()()()()()(),e.TgZ(57,"div",10)(58,"div",8)(59,"div",5)(60,"div",6)(61,"h5"),e._uU(62,"Request"),e.qZA()(),e.TgZ(63,"div",7)(64,"div",4)(65,"div",11)(66,"pre"),e._uU(67),e.ALo(68,"json"),e.qZA()()(),e.TgZ(69,"actions",12),e.YNc(70,W,2,0,"a",13),e.qZA()()()(),e.TgZ(71,"div",8)(72,"div",5)(73,"div",6)(74,"h5"),e._uU(75,"Response"),e.qZA()(),e.TgZ(76,"div",7)(77,"div",4)(78,"div",11)(79,"pre"),e._uU(80),e.ALo(81,"json"),e.qZA()()()()()()()()()()),2&t&&(e.Q6J("headerTitle","Order #"+n.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(20),e.Oqu(e.xi3(21,13,n.Created,"dd MMM yyyy HH:mm:ss")),e.xp6(8),e.Oqu(n.Number),e.xp6(7),e.Oqu(n.MarketTypeString),e.xp6(7),e.Oqu(n.ResponseCode),e.xp6(7),e.Oqu(n.shopId),e.xp6(7),e.Oqu(n.POSActionTypeString),e.xp6(11),e.Oqu(e.lcZ(68,16,n.request)),e.xp6(3),e.Q6J("ngIf","200"!=n.ResponseCode&&"201"!=n.ResponseCode),e.xp6(10),e.Oqu(e.lcZ(81,18,n.response)))},dependencies:[s.O5,l.yS,u.p,s.Ts,s.uU]}),o})(),canActivate:[h.a],data:{title:"Order Details"}},{path:"exception",component:(()=>{class o{constructor(t){this.http=t,this.Result=Array(),this.filter={RowCount:50,PageNumber:1},this.Load()}ngOnInit(){}Load(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(t=>{this.Result=Array();for(let n of t.hits)this.Result.push({TypeID:"Shopee"==n._source.error.type?0:1,Number:n._source.error.number,Date:n._source["@timestamp_received"],stackTrace:n._source.error.stackTrace,message:n._source.message});this.paginationTotal=t.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Load()}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-exception-log"]],decls:21,vars:5,consts:[["searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true",3,"headerTitle"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],[1,"fw-bold"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e._UZ(1,"filters"),e.TgZ(2,"content")(3,"div",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead")(9,"tr",6)(10,"th"),e._uU(11,"Channel"),e.qZA(),e.TgZ(12,"th"),e._uU(13,"Date"),e.qZA(),e.TgZ(14,"th"),e._uU(15,"Number"),e.qZA(),e.TgZ(16,"th"),e._uU(17,"Exception"),e.qZA()()(),e.TgZ(18,"tbody"),e.YNc(19,ne,13,6,"tr",7),e.qZA()(),e.TgZ(20,"mat-paginator",8),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Exception Log"),e.xp6(19),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.sg,s.O5,u.p,_.NW]}),o})(),canActivate:[h.a],data:{title:"Exception Log"}}]}];let ae=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[s.ez,l.Bz.forChild(ie)]}),o})(),re=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[s.ez,p.u5,p.UX,ae,l.Bz,u.R,G,_.TU,T.A0,f.ZU,v.Z]}),o})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[832],{7398:(L,N,c)=>{c.d(N,{Z:()=>v,e:()=>t});var u=c(6895),_=c(8252),i=c(4650);function Z(f,d){if(1&f&&(i.TgZ(0,"li",2)(1,"a",3),i._uU(2),i.qZA()()),2&f){const s=d.$implicit;i.xp6(1),i.s9C("routerLink",s.Url),i.xp6(1),i.hij(" ",s.Title," ")}}let t=(()=>{class f{}return f.\u0275fac=function(s){return new(s||f)},f.\u0275cmp=i.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"]],template:function(s,g){1&s&&(i.TgZ(0,"ul",0),i.YNc(1,Z,3,2,"li",1),i.qZA()),2&s&&(i.xp6(1),i.Q6J("ngForOf",g.Tabs))},dependencies:[u.sg,_.yS,_.Od]}),f})(),v=(()=>{class f{}return f.\u0275fac=function(s){return new(s||f)},f.\u0275mod=i.oAB({type:f}),f.\u0275inj=i.cJS({imports:[u.ez,_.Bz]}),f})()},832:(L,N,c)=>{c.r(N),c.d(N,{ProductModule:()=>jt});var u=c(6895),_=c(7398),i=c(4006),Z=c(8252),t=c(4650);let v=(()=>{class o{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/sold-in-channel"},{Title:"Not in Channel",Url:"/menu/products/not-in-channel"},{Title:"Not in POS",Url:"/menu/products/not-in-pos"},{Title:"In POS",Url:"/menu/products/in-pos"},{Title:"Duplicate SKU",Url:"/menu/products/duplicate-sku"}]}}return o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-products"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,e){1&n&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()()(),t._UZ(4,"router-outlet")),2&n&&(t.xp6(3),t.Q6J("Tabs",e.productTabs))},dependencies:[_.e,Z.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}}"]}),o})();class f{}var d=c(5241),s=c(5412),g=c(3841);let x=(()=>{class o{constructor(n){this.LocalData=n}GetCategories(n,e,a){return new Promise(r=>{this.LocalData.getListByKey(n).then(p=>{null!=p?r(p):this.getCategoriesByTypeID(n,e,a).then(b=>{r(b)})})})}getCategoriesByTypeID(n,e,a){return new Promise(r=>{a.post("/api/Channel/getCategoriesByTypeID",{TypeID:n,ID:e}).subscribe(b=>{this.LocalData.saveList(b,n),r(b)})})}}return o.\u0275fac=function(n){return new(n||o)(t.LFG(g.F))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var O=c(1318),E=c(8966);function I(o,l){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"h5",4),t._uU(2,"Category"),t.qZA(),t.TgZ(3,"app-select-search",10),t.NdJ("onSelect",function(a){t.CHM(n);const r=t.oxw();return t.KtG(r.onSelectCategory(a))}),t.qZA(),t.BQk()}if(2&o){const n=t.oxw();t.xp6(3),t.Q6J("appearance","outline")("batchSize",30)("data",n.options)("bindLabel","Value")("bindValue","Key")("placeholder","Select Category")}}let M=(()=>{class o{constructor(n,e,a,r){this.data=n,this.channelCategoriesService=e,this.http=a,this.dialogRef=r,this.item=n.item,this.selectItemMissingChannel=n.selectedItemMissingChannel,this.options=[],this.optionVisible=!1}onSelectItem(n){this.selectedChannelID=n;let e=this.selectItemMissingChannel.find(a=>a.ID==n);!e||1!==e.TypeID&&6!==e.TypeID&&7!==e.TypeID?this.optionVisible=!1:this.channelCategoriesService.GetCategories(e.TypeID,e.ID,this.http).then(a=>{this.options=a,this.optionVisible=!0}).catch(a=>{console.error(a)})}onSelectCategory(n){this.selectedCategoryID=n}onClose(){this.dialogRef.close()}onSave(){this.selectedChannelID&&(this.selectedCategoryID||!this.optionVisible)&&this.dialogRef.close({channelID:this.selectedChannelID,categoryID:this.selectedCategoryID})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI),t.Y36(x),t.Y36(O.O),t.Y36(s.so))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-uploadProductDialog"]],decls:16,vars:7,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0","border-top","border-bottom"],[1,"row"],[1,"col-12"],[1,"mb-3","fw-normal"],[3,"appearance","data","bindLabel","bindValue","placeholder","onSelect"],[4,"ngIf"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"],[3,"appearance","batchSize","data","bindLabel","bindValue","placeholder","onSelect"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t.TgZ(2,"mat-dialog-content",1)(3,"div",2)(4,"div",3)(5,"h5",4),t._uU(6,"Channel :"),t.qZA(),t.TgZ(7,"app-select-search",5),t.NdJ("onSelect",function(r){return e.onSelectItem(r)}),t.qZA()()(),t.TgZ(8,"div",2)(9,"div",3),t.YNc(10,I,4,6,"ng-container",6),t.qZA()()(),t.TgZ(11,"mat-dialog-actions",7)(12,"button",8),t.NdJ("click",function(){return e.onClose()}),t._uU(13,"Cancel"),t.qZA(),t.TgZ(14,"button",9),t.NdJ("click",function(){return e.onSave()}),t._uU(15,"Upload"),t.qZA()()),2&n&&(t.xp6(1),t.hij("Upload ",null==e.item?null:e.item.Name,""),t.xp6(6),t.Q6J("appearance","outline")("data",e.selectItemMissingChannel)("bindLabel","Name")("bindValue","ID")("placeholder","Choose "),t.xp6(3),t.Q6J("ngIf",e.optionVisible))},dependencies:[u.O5,s.uh,s.xY,s.H8,E.h],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),o})();function C(o,l){if(1&o&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",9),t._uU(3),t.qZA(),t.TgZ(4,"td",9),t._uU(5),t.qZA(),t.TgZ(6,"td",10)(7,"p",11),t._uU(8,"Product Not in Channel!"),t.qZA()()(),t.BQk()),2&o){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 h(o,l){if(1&o&&(t.TgZ(0,"td",9),t._uU(1),t.qZA()),2&o){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Model,"")}}function D(o,l){if(1&o&&(t.TgZ(0,"td",9),t._uU(1),t.qZA()),2&o){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Code,"")}}function U(o,l){1&o&&t._UZ(0,"img",18)}function Q(o,l){1&o&&t._UZ(0,"img",19)}function Y(o,l){1&o&&t._UZ(0,"img",20)}function S(o,l){1&o&&t._UZ(0,"img",21)}function A(o,l){if(1&o&&(t.TgZ(0,"tr")(1,"td",9),t._uU(2),t.qZA(),t.YNc(3,h,2,2,"td",12),t.YNc(4,D,2,2,"td",12),t.TgZ(5,"td",9),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",9),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",9)(12,"a",13),t.YNc(13,U,1,0,"img",14),t.YNc(14,Q,1,0,"img",15),t.YNc(15,Y,1,0,"img",16),t.YNc(16,S,1,0,"img",17),t.qZA()()()),2&o){const n=l.$implicit,e=l.index;t.xp6(2),t.Oqu(n.Name),t.xp6(1),t.Q6J("ngIf",0==e),t.xp6(1),t.Q6J("ngIf",0==e),t.xp6(2),t.Oqu(t.lcZ(7,11,n.Price)),t.xp6(3),t.Oqu(t.lcZ(10,13,n.Inventory)),t.xp6(3),t.s9C("href",n.Url,t.LSH),t.s9C("title",n.Title),t.xp6(1),t.Q6J("ngIf",1==n.TypeID),t.xp6(1),t.Q6J("ngIf",0==n.TypeID||5==n.TypeID),t.xp6(1),t.Q6J("ngIf",2==n.TypeID),t.xp6(1),t.Q6J("ngIf",6==n.TypeID)}}function m(o,l){if(1&o&&t.YNc(0,A,17,15,"tr",6),2&o){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function P(o,l){if(1&o&&(t.ynx(0),t.YNc(1,C,9,2,"ng-container",7),t.YNc(2,m,1,1,"ng-template",null,8,t.W1O),t.BQk()),2&o){const n=l.$implicit,e=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",e)}}let k=(()=>{class o{constructor(n){this.data=n,this.variants=n.variants,this.title=n.title}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-variant"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3","text-center"],[1,"pb-5","mx-0"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"sticky-top"],[1,"text-center","sticky-top"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-center"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-center",4,"ngIf"],["target","_blank",3,"href","title"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead",3)(6,"tr",4)(7,"th",5),t._uU(8,"PRODUCT"),t.qZA(),t.TgZ(9,"th",5),t._uU(10,"VARIANT"),t.qZA(),t.TgZ(11,"th",5),t._uU(12,"SKU"),t.qZA(),t.TgZ(13,"th",5),t._uU(14,"PRICE"),t.qZA(),t.TgZ(15,"th",5),t._uU(16,"INVENTORY"),t.qZA(),t.TgZ(17,"th",5),t._uU(18,"CHANNEL"),t.qZA()()(),t.TgZ(19,"tbody"),t.YNc(20,P,4,2,"ng-container",6),t.qZA()()()),2&n&&(t.xp6(1),t.Oqu(e.title),t.xp6(19),t.Q6J("ngForOf",e.variants))},dependencies:[u.sg,u.O5,s.uh,s.xY,u.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important}"]}),o})();var T=(()=>{return(o=T||(T={})).SHOOPE="//res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",o.WOOCOMMERCE="//res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",o.TOKOPEDIA="//res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",o.TIKTOK="//res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",o.LAZADA="//res.cloudinary.com/pos/image/upload/w_30/v1641528003/icons/marketplace_icons/lazada.png",T;var o})(),w=c(9300),F=c(7185),y=c(7481),J=c(266);function $(o,l){if(1&o&&(t.TgZ(0,"span",16),t._UZ(1,"i",17),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&o){const n=t.oxw();t.xp6(3),t.Oqu(n.code)}}function j(o,l){if(1&o&&(t.TgZ(0,"span",16),t._UZ(1,"i",18),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&o){const n=t.oxw();t.xp6(3),t.Oqu(n.description)}}function W(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"div",19)(1,"input",20),t.NdJ("change",function(a){t.CHM(n);const r=t.oxw();return t.KtG(r.onCheck(a.target.checked))}),t.qZA()()}}function z(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"button",21),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownload())}),t._UZ(1,"i",22),t._uU(2," Download "),t.qZA()}}function X(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"button",21),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onUpload())}),t._UZ(1,"i",23),t._uU(2," Upload "),t.qZA()}}function tt(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"button",24),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScan())}),t._UZ(1,"i",25),t._uU(2," Scan "),t.qZA()}}const nt=function(o){return{"me-3":o}};function et(o,l){if(1&o&&(t.ynx(0),t.TgZ(1,"a",27),t._UZ(2,"img",28),t.qZA(),t.BQk()),2&o){const n=l.$implicit,e=l.index,a=t.oxw(2);t.xp6(1),t.s9C("href",n.Url,t.LSH),t.xp6(1),t.Q6J("ngClass",t.VKq(4,nt,e!=a.channels.length-1))("src",a.getChannelLogo(n),t.LSH)("matTooltip",n.Title?n.Title:n.Name)}}function ot(o,l){if(1&o&&(t.ynx(0),t.YNc(1,et,3,6,"ng-container",26),t.BQk()),2&o){const n=t.oxw();t.xp6(1),t.Q6J("ngForOf",n.channels)}}const at=function(o){return{"border-bottom pb-2":o}};function it(o,l){if(1&o&&(t.TgZ(0,"li")(1,"div",32)(2,"div",33)(3,"a",27),t._UZ(4,"img",34),t.TgZ(5,"span",35),t._uU(6),t.qZA()()()()()),2&o){const n=l.$implicit,e=l.index,a=t.oxw(2);t.xp6(2),t.Q6J("ngClass",t.VKq(4,at,e!=a.channels.length-1)),t.xp6(1),t.s9C("href",n.Url,t.LSH),t.xp6(1),t.Q6J("src",a.getChannelLogo(n),t.LSH),t.xp6(2),t.Oqu(n.Title)}}function lt(o,l){if(1&o&&(t.TgZ(0,"div",29)(1,"button",30),t._uU(2),t.qZA(),t.TgZ(3,"ul",31),t.YNc(4,it,7,6,"li",26),t.qZA()()),2&o){const n=t.oxw();t.xp6(2),t.hij(" ",n.channels.length," CHANNELS "),t.xp6(2),t.Q6J("ngForOf",n.channels)}}let R=(()=>{class o{constructor(){this.uploadButton=!1,this.scanButton=!1,this.showCheckBox=!1,this.downloadButton=!1,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}onUpload(){this.onUploadEvent.emit()}onScan(){this.onScanEvent.emit()}onCheck(n){this.checkBoxChange.emit(n)}onEventDesc(){this.onDescEvent.emit()}onDownload(){this.onDownloadEvent.emit()}getChannelLogo(n){let e;switch(n.TypeID){case 0:case 5:e=T.SHOOPE;break;case 1:e=T.TOKOPEDIA;break;case 2:e=T.WOOCOMMERCE;break;case 6:e=T.TIKTOK}return e}}return o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-product-card"]],inputs:{uploadButton:"uploadButton",scanButton:"scanButton",showCheckBox:"showCheckBox",downloadButton:"downloadButton",productImage:"productImage",title:"title",code:"code",description:"description",channels:"channels",check:"check"},outputs:{onUploadEvent:"onUpload",onScanEvent:"onScan",checkBoxChange:"onCheckBoxChange",onDescEvent:"onDescEvent",onDownloadEvent:"onDownload"},decls:22,vars:10,consts:[[1,"card",2,"margin-bottom","0px"],[1,"card-body","py-6"],[1,"row"],[1,"col-auto"],["alt","",1,"rounded","float-left",2,"width","110px","height","110px",3,"src"],[1,"col","cursor-pointer","d-flex","justify-content-between",2,"padding-left","0px"],[1,"d-flex","flex-column",3,"click"],[1,"itemTitle"],["class","description",4,"ngIf"],[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"],[4,"ngIf","ngIfElse"],["DROPDOWN",""],[1,"description"],[1,"fa","fa-barcode","me-2"],[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(n,e){if(1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t._UZ(4,"img",4),t.qZA(),t.TgZ(5,"div",5)(6,"div",6),t.NdJ("click",function(){return e.onEventDesc()}),t.TgZ(7,"h4",7),t._uU(8),t.qZA(),t.YNc(9,$,4,1,"span",8),t.YNc(10,j,4,1,"span",8),t.qZA(),t.TgZ(11,"div",9),t.YNc(12,W,2,0,"div",10),t.qZA()()()(),t.TgZ(13,"div",11)(14,"div"),t.YNc(15,z,3,0,"button",12),t.YNc(16,X,3,0,"button",12),t.YNc(17,tt,3,0,"button",13),t.qZA(),t.TgZ(18,"div"),t.YNc(19,ot,2,1,"ng-container",14),t.YNc(20,lt,5,2,"ng-template",null,15,t.W1O),t.qZA()()()),2&n){const a=t.MAs(21);t.xp6(4),t.Q6J("src",e.productImage,t.LSH),t.xp6(4),t.Oqu(e.title),t.xp6(1),t.Q6J("ngIf",e.code),t.xp6(1),t.Q6J("ngIf",e.description),t.xp6(2),t.Q6J("ngIf",e.showCheckBox),t.xp6(3),t.Q6J("ngIf",e.downloadButton),t.xp6(1),t.Q6J("ngIf",e.uploadButton),t.xp6(1),t.Q6J("ngIf",e.scanButton),t.xp6(2),t.Q6J("ngIf",e.channels.length<4)("ngIfElse",a)}},dependencies:[u.mk,u.sg,u.O5,J.gM],styles:[".img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:200px}.bg-footer[_ngcontent-%COMP%]{background-color:#ededed69}.description[_ngcontent-%COMP%]{font-weight:300;margin-left:2px}"]}),o})();function rt(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"span",10),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getTotal())}),t.TgZ(1,"i",11),t._uU(2,"?"),t.qZA()()}}function ct(o,l){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const n=t.oxw();t.xp6(1),t.Oqu(t.lcZ(2,1,n.paginationTotal))}}let K=(()=>{class o{constructor(){this.get=new t.vpe,this.change=new t.vpe,this.next=new t.vpe,this.previous=new t.vpe,this.total=new t.vpe,this.hasClicked=!1}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.change.emit(this.filter)}getTotal(){this.total.emit()}PreviousPage(){this.previous.emit()}NextPage(){this.next.emit()}}return o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-custom-paginator"]],inputs:{filter:"filter",paginationTotal:"paginationTotal",totaldata:"totaldata",hasClicked:"hasClicked"},outputs:{get:"get",change:"change",next:"next",previous:"previous",total:"total"},decls:16,vars:11,consts:[[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"],[4,"ngIf"],[1,"btn-group"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"hidden","click"],[1,"fas","fa-arrow-left"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"hidden","click"],[1,"fas","fa-arrow-right"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"]],template:function(n,e){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3),t.ALo(4,"number"),t.ALo(5,"number"),t.YNc(6,rt,3,0,"span",3),t.YNc(7,ct,3,3,"span",4),t._uU(8),t.qZA()(),t.TgZ(9,"div",5)(10,"a",6),t.NdJ("click",function(){return e.PreviousPage()}),t._UZ(11,"i",7),t._uU(12," Prev"),t.qZA(),t.TgZ(13,"a",8),t.NdJ("click",function(){return e.NextPage()}),t._UZ(14,"i",9),t._uU(15," Next"),t.qZA()()()),2&n&&(t.xp6(3),t.AsE(" Showing ",t.lcZ(4,7,e.filter.PageSize*(e.filter.PageNumber-1)+1)," - ",t.lcZ(5,9,e.filter.PageSize*(e.filter.PageNumber-1)+e.totaldata)," of "),t.xp6(3),t.Q6J("ngIf",!e.hasClicked),t.xp6(1),t.Q6J("ngIf",e.hasClicked),t.xp6(1),t.hij(" records ~ ",e.filter.PageNumber," Page "),t.xp6(2),t.Q6J("hidden",1==e.filter.PageNumber),t.xp6(3),t.Q6J("hidden",e.filter.PageSize*(e.filter.PageNumber-1)+e.totaldata==e.paginationTotal||e.totaldata<e.filter.PageSize))},dependencies:[u.O5,u.JJ]}),o})();function st(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"div",11)(1,"app-product-card",12),t.NdJ("onUpload",function(){const r=t.CHM(n).$implicit,p=t.oxw();return t.KtG(p.openUploadModal(r))})("onDescEvent",function(){const r=t.CHM(n).index,p=t.oxw();return t.KtG(p.DialogVariant(r))})("onScan",function(){const r=t.CHM(n).$implicit,p=t.oxw();return t.KtG(p.onScanProduct(r))})("onCheckBoxChange",function(a){const p=t.CHM(n).index,b=t.oxw();return t.KtG(b.onSelectProduct(p,a))}),t.qZA()()}if(2&o){const n=l.$implicit,e=t.oxw();t.xp6(1),t.Q6J("title",null==n?null:n.Name)("productImage",null==n?null:n.ImageUrl)("description",(null==n?null:n.Variants.length)>1?(null==n?null:n.Variants.length)+" Variants":null)("channels",e.sortVariant(null==n?null:n.Variants))("code",e.getVariantCode(null==n?null:n.Variants))("showCheckBox",(null==n?null:n.Channel.length)<e.Channel.length)("scanButton",!1)("uploadButton",!0)}}let dt=(()=>{class o{constructor(n,e,a){this.http=n,this.toastr=e,this.dialog=a,this.filterScanChannel=new f,this.total=0,this.loading=!1,this.syncupdatefull=!1,this.OptionVisible=!1,this.channelLogo=T,this.Load()}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.Channel=n.Options.Channel,this.filterScanChannel.PageNumber=n.Filter.PageNumber,this.filterScanChannel.RowCount=n.Filter.RowCount,this.filterScanChannel.ChannelID=null,this.filterScanChannel.sync=!0,this.filterScanChannel.PageSize=100,this.TokopediaCategory=n.Options.Tokopedia,this.ShopeeCategory=n.Options.Shopee,this.GetProducts()})}GetProducts(){this.http.post("/api/product/GetInPOS",{PageNumber:this.filterScanChannel.PageNumber,RowCount:this.filterScanChannel.RowCount}).subscribe(e=>{this.data=e.Data,this.total=e.Total,this.paginationTotal=null==e.Total?this.filterScanChannel.RowCount:e.Total.toString(),this.paginationPageSize=this.filterScanChannel.RowCount>this.paginationTotal?this.paginationTotal:this.filterScanChannel.RowCount})}SyncFast(){null!=this.filterScanChannel.ChannelID?this.http.post("/api/product/ScanOptimized",{ID:this.filterScanChannel.ChannelID,ScanFull:this.filterScanChannel.ScanFull}).subscribe(e=>{this.GetProducts();let a=e.NotInPOS?e.NotInPOS.Product:0,r=e.InChannel?e.InChannel.Product:0;this.toastr.success(a+r+" found in "+this.getChannelName(this.filterScanChannel.ChannelID)+"</br> ( "+r+" In POS + "+a+" Not In POS )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}):this.toastr.error("Please Select Channel","Error")}SyncProductMap(){null!=this.filterScanChannel.ChannelID?this.http.post("/api/product/SyncUpdateMap",{ID:this.filterScanChannel.ChannelID}).subscribe(e=>{this.data=e.Data}).add(()=>{this.GetProducts()}):this.toastr.error("Please Select Channel","Error")}DialogVariant(n){this.dialogName=this.data[n].Name,this.variant=this.data[n].Variants,this.dialog.open(k,{data:{title:this.data[n].Name,variants:this.data[n].Variants},width:"40%"})}onNextPage(){this.filterScanChannel.PageNumber=this.filterScanChannel.PageNumber+1,this.GetProducts()}onPrevPage(){this.filterScanChannel.PageNumber=this.filterScanChannel.PageNumber-1,this.GetProducts()}SearchProduct(n){this.http.post("/api/product/GetInPOS",{Text:n}).subscribe(a=>{this.data=a.Data})}openUploadModal(n){let e;this.selectedItem=n,e=0==n.Channel.length?this.Channel:this.Channel.filter(a=>!n.Channel.some(r=>a.ID==r.ChannelID)),this.dialog.open(M,{width:"600px",data:{item:n,selectedItemMissingChannel:e}}).afterClosed().subscribe(a=>{if(a){let r=a.channelID,p=a.categoryID,b=[];b.push(this.selectedItem.ID),this.uploadProduct(r,b,p)}})}openUploadBulkModal(){this.dialog.open(M,{width:"350px",data:{item:null,selectedItemMissingChannel:this.Channel}}).afterClosed().subscribe(n=>{if(n){let r=n.channelID,p=n.categoryID;var e=this.getSelected();if(e.length>0){var a=[];e.forEach(b=>a.push(b.ID)),this.uploadProduct(r,a,p)}}})}uploadProduct(n,e,a){this.http.post("/api/product/UploadToMarketplace",{ChannelID:n,Products:e,CategoryID:a||0}).subscribe(p=>{this.GetProducts();let b=this.Channel.find(Wt=>Wt.ID==n);this.toastr.success(e.length>1?"Successfully uploaded "+e.length+" Product to channel "+b.Name:this.selectedItem.Name+" Successfully Created","Success")})}sortVariant(n){var e=[];for(let a of n)if(null!=a.Channel)for(let r of a.Channel)0==e.filter(p=>p.ChannelID==r.ChannelID).length&&e.push(r);return this.sortChannel(e)}sortChannel(n){return n.sort((e,a)=>e.TypeID<a.TypeID?1:e.TypeID===a.TypeID?0:-1)}openScanDialog(){this.dialog.open(d.j,{data:{filter:this.filterScanChannel,Channel:this.Channel},width:"30%"}).afterClosed().subscribe(e=>{null!=e&&(this.filterScanChannel=e.filter,this.filterScanChannel.sync?this.SyncFast():this.filterScanChannel.sync||this.SyncFast())})}openScanSingleDialog(){this.dialog.open(d.j,{data:{filter:this.filterScanChannel,Channel:this.Channel.filter(e=>1==e.TypeID||6==e.TypeID),isSingleChannel:this.hasSelection()},width:"30%"}).afterClosed().subscribe(e=>{null!=e&&(this.filterScanChannel=e.filter,this.ScanSingle())})}ScanSingle(){if(null!=this.filterScanChannel.ChannelID){var n=[],e=this.getSelected();if(e.length>0)for(const a of e)for(let r of a.Variants)n.push(r.Code);this.scanSingleChannel(n)}else this.toastr.error("Please Select Channel","Error")}getSelected(){return this.data?this.data.filter(n=>n.selected):[]}hasSelection(){return!!this.data&&this.getSelected().length>0}onScanProduct(n){this.dialog.open(d.j,{data:{filter:this.filterScanChannel,Channel:this.Channel.filter(e=>1==e.TypeID||6==e.TypeID),isSingleChannel:!0,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,w.h)(e=>e)).subscribe(e=>{this.filterScanChannel=e.filter;const a=n?.Variants.map(r=>r.Code);this.scanSingleChannel(a)})}scanSingleChannel(n){this.http.post("/api/product/ScanSingle",{ID:this.filterScanChannel.ChannelID,SKU:n}).subscribe(a=>{this.GetProducts(),a?this.toastr.success("Successfully Scan ","Success"):this.toastr.error("This product is not existed in Tokopedia ","Error")})}onSelectProduct(n,e){this.data[n].selected=e}getChannelName(n){return this.Channel.find(a=>a.ID==n).Name}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(O.O),t.Y36(F._W),t.Y36(s.uw))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-in-pos"]],decls:15,vars:9,consts:[["hideSearchDropdown","true","hideSearchDropdown","false",3,"headerTitle","onSubmit"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"hidden","click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"hidden","click"],["aria-hidden","true",1,"fa","fa-upload"],[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"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"title","productImage","description","channels","code","showCheckBox","scanButton","uploadButton","onUpload","onDescEvent","onScan","onCheckBoxChange"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(r){return e.SearchProduct(r)}),t.TgZ(1,"actions")(2,"button",1),t.NdJ("click",function(){return e.openScanSingleDialog()}),t._UZ(3,"i",2),t._uU(4),t.qZA(),t.TgZ(5,"button",3),t.NdJ("click",function(){return e.openUploadBulkModal()}),t._UZ(6,"i",4),t._uU(7," Upload Bulk "),t.qZA()(),t.TgZ(8,"content")(9,"div",5)(10,"div",6),t.YNc(11,st,2,8,"div",7),t.qZA(),t.TgZ(12,"div",8)(13,"div",9)(14,"app-custom-paginator",10),t.NdJ("next",function(){return e.onNextPage()})("previous",function(){return e.onPrevPage()}),t.qZA()()()()()()),2&n&&(t.Q6J("headerTitle","In POS ("+e.total+")"),t.xp6(2),t.Q6J("hidden",!e.hasSelection()),t.xp6(2),t.hij(" Scan Selected Product (",e.getSelected().length,") "),t.xp6(1),t.Q6J("hidden",!e.hasSelection()),t.xp6(6),t.Q6J("ngForOf",e.data),t.xp6(3),t.Q6J("filter",e.filterScanChannel)("totaldata",null==e.data?null:e.data.length)("paginationTotal",e.paginationTotal)("hasClicked",!0))},dependencies:[u.sg,y.p,R,K],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}}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}"]}),o})();var q=c(9694);let G=(()=>{class o{}return o.GuidEMpty="00000000-0000-0000-0000-000000000000",o})();var H=c(6082),B=c(8796);function pt(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"button",14),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.openScanDialog())}),t._UZ(1,"i",15),t._uU(2," Scan Channel "),t.qZA()}}function ut(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"button",16),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScanProductSelected())}),t._UZ(1,"i",15),t._uU(2),t.qZA()}if(2&o){const n=t.oxw();t.xp6(2),t.hij(" Scan Selected Product (",n.productService.selectedProduct(n.products).length,") ")}}function ht(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"div",17)(1,"app-product-card",18),t.NdJ("onUpload",function(){const r=t.CHM(n).$implicit,p=t.oxw();return t.KtG(p.onUploadProduct(r))})("onDescEvent",function(){const r=t.CHM(n).index,p=t.oxw();return t.KtG(p.onOpenVariantDetail(r))})("onScan",function(){const r=t.CHM(n).$implicit,p=t.oxw();return t.KtG(p.onScanSingleProduct(r))})("onCheckBoxChange",function(a){const p=t.CHM(n).$implicit;return t.KtG(p.selected=a)}),t.qZA()()}if(2&o){const n=l.$implicit,e=t.oxw();t.xp6(1),t.Q6J("title",null==n?null:n.Name)("productImage",null==n?null:n.ImageUrl)("description",(null==n||null==n.Variants?null:n.Variants.length)>1?(null==n||null==n.Variants?null:n.Variants.length)+" Variants":null)("channels",e.getChannelProduct(n))("code",e.getVariantCode(null==n?null:n.Variants))("showCheckBox",null==n?null:n.hasScan)("scanButton",null==n?null:n.hasScan)("uploadButton",null==n?null:n.hasUpload)}}let gt=(()=>{class o{constructor(n,e,a,r){this.http=n,this.dialog=e,this.toastr=a,this.productService=r,this.searchFilter=new f,this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=G.GuidEMpty,this.onLoad()}onLoad(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.searchFilter.ChannelID=n.Filter.ChannelID,this.searchFilter.sync=!1,this.searchFilter.mode=1,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.productService.findAllSoldInChannel(this.searchFilter).subscribe(n=>{this.products=n.Data,this.checkProductHasUploadBtn(),this.checkProductHasScanButton()})}checkProductHasUploadBtn(){let n;this.products=this.products.map(e=>(e.Channel=this.getChannelProduct(e),n=this.productService.filterUnselectedChannel(e,this.channelOptions),e.hasUpload=n.length>0,e))}checkProductHasScanButton(){let n,e;this.products=this.products.map(a=>(a.Channel=this.getChannelProduct(a),n=this.productService.filterUnselectedChannel(a,this.channelOptions),e=this.productService.filterChannel(n,[q.x.Tiktok,q.x.Tokopedia]),a.hasScan=e.length>0,a))}searchProduct(n){this.searchFilter.text=n,this.hasClickRowCount=!1,this.getProducts()}syncProduct(){null!==this.searchFilter.ChannelID&&null!=this.searchFilter.mode?this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct).subscribe(n=>{let e=n.NotInPOS?n.NotInPOS.Product:0,a=n.InChannel?n.InChannel.Product:0;this.toastr.success(e+a+" found in "+this.getChannelName(this.searchFilter.ChannelID)+"</br> ( "+a+" In POS + "+e+" Not In POS )","Scan Complete!",{timeOut:5e3,enableHtml:!0}),this.searchFilter.ChannelID=this.guidEmpty}).add(()=>{this.getProducts()}):alert("Please select channel")}onOpenVariantDetail(n){this.dialog.open(k,{data:{variants:this.products[n].Variants,title:this.products[n].Name},width:"40%"})}getChannelProduct(n){const e=n.Variants;var a=[];for(let r of e)if(null!=r.Channel)for(let p of r.Channel)0==a.filter(b=>b.ChannelID==p.ChannelID).length&&a.push(p);return this.productService.sortChannel(a)}openScanDialog(){this.dialog.open(d.j,{data:{filter:this.searchFilter,Channel:this.channelOptions},width:"40%"}).afterClosed().subscribe(e=>{null!=e&&(this.searchFilter=e.filter,this.syncProduct())})}onScanSingleProduct(n){n.Channel=this.getChannelProduct(n);let e=this.productService.filterUnselectedChannel(n,this.channelOptions),a=this.productService.filterChannel(e,[q.x.Tiktok,q.x.Tokopedia]);this.dialog.open(d.j,{data:{filter:Object.assign({},this.searchFilter),Channel:a,showScanUpdateType:!1,showScanType:!1,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,w.h)(r=>r)).subscribe(r=>{this.searchFilter=r.filter;const p=this.productService.getVariantCodesProduct(n);this.scanSingleChannel(p)})}onUploadProduct(n){n.Channel=this.getChannelProduct(n);const e=this.productService.filterUnselectedChannel(n,this.channelOptions);this.dialog.open(M,{width:"600px",data:{item:n,selectedItemMissingChannel:e}}).afterClosed().pipe((0,w.h)(a=>a)).subscribe(a=>{this.uploadProduct(n,a.channelID,a.categoryID)})}onScanProductSelected(){this.dialog.open(d.j,{data:{filter:this.searchFilter,Channel:this.channelOptions.filter(e=>1==e.TypeID||6==e.TypeID),isSingleChannel:!0,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,w.h)(e=>e)).subscribe(e=>{if(null!=e){this.searchFilter=e.filter;let a=this.productService.selectedProduct(this.products),r=this.productService.getVariantCodesProducts(a);this.scanSingleChannel(r)}})}uploadProduct(n,e,a){this.productService.uploadSingleProduct(n,e,a).subscribe(r=>{this.getProducts()})}scanSingleChannel(n){this.productService.scanSingle(this.searchFilter.ChannelID,n).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let a=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${a?.Name} `,"Error")}this.searchFilter.ChannelID=this.guidEmpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=this.guidEmpty}})}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=this.guidEmpty}onUploadBulk(){this.dialog.open(M,{width:"350px",data:{item:null,selectedItemMissingChannel:this.channelOptions}}).afterClosed().subscribe(n=>{n&&this.uploadListProduct(n.channelID,n.categoryID)})}uploadListProduct(n,e){const a=this.productService.selectedProduct(this.products);this.productService.uploadProducts(a,n,e).subscribe(r=>{this.getProducts();const p=this.productService.findChannelById(n,this.channelOptions);this.toastr.success(a.length>1?"Successfully uploaded "+a.length+" Product to channel "+p?.Name:p?.Name+" Successfully Created","Success")})}getChannelName(n){return this.channelOptions.find(a=>a.ID==n).Name}getRowCount(){this.http.post("/api/product/GetSoldInChannelRowCount",{ChannelID:this.searchFilter.ChannelID}).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(O.O),t.Y36(s.uw),t.Y36(F._W),t.Y36(H.M))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-sold-in-channel"]],decls:21,vars:11,consts:[["headerTitle","Sold in Channel",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"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"hidden","click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],[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"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","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,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"title","productImage","description","channels","code","showCheckBox","scanButton","uploadButton","onUpload","onDescEvent","onScan","onCheckBoxChange"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(r){return e.searchProduct(r)}),t.TgZ(1,"actions"),t.YNc(2,pt,3,0,"button",1),t.YNc(3,ut,3,1,"button",2),t.TgZ(4,"button",3),t.NdJ("click",function(){return e.onUploadBulk()}),t._UZ(5,"i",4),t._uU(6," Upload Bulk "),t.qZA()(),t.TgZ(7,"filters")(8,"div",5)(9,"div",6)(10,"div")(11,"h6"),t._uU(12,"Channel"),t.qZA(),t.TgZ(13,"ng-select",7),t.NdJ("ngModelChange",function(r){return e.searchFilter.ChannelID=r})("clear",function(){return e.onClearFilterChannel()}),t.qZA()()()()(),t.TgZ(14,"content")(15,"div",8)(16,"div",9),t.YNc(17,ht,2,8,"div",10),t.qZA(),t.TgZ(18,"div",11)(19,"div",12)(20,"app-custom-paginator",13),t.NdJ("total",function(){return e.getRowCount()})("next",function(){return e.onNextPage()})("previous",function(){return e.onPreviousPage()}),t.qZA()()()()()()),2&n&&(t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("hidden",!e.productService.hasSelection(e.products)),t.xp6(9),t.Q6J("clearable",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID==e.guidEmpty?null:e.searchFilter.ChannelID),t.xp6(4),t.Q6J("ngForOf",e.products),t.xp6(3),t.Q6J("filter",e.searchFilter)("totaldata",null==e.products?null:e.products.length)("paginationTotal",e.rowCount)("hasClicked",e.hasClickRowCount))},dependencies:[u.sg,u.O5,i.JJ,i.On,y.p,B.w9,R,K],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}}"]}),o})();var mt=c(8505),_t=c(7287);function Ct(o,l){if(1&o&&t._UZ(0,"img",29),2&o){const n=t.oxw().$implicit;t.s9C("src",null==n?null:n.ImageUrl,t.LSH)}}function ft(o,l){1&o&&t._UZ(0,"img",30)}function bt(o,l){if(1&o&&(t.TgZ(0,"li"),t._uU(1),t.qZA()),2&o){const n=l.$implicit;t.xp6(1),t.Oqu(null==n?null:n.Model)}}function Pt(o,l){if(1&o&&(t.TgZ(0,"li"),t._uU(1),t.qZA()),2&o){const n=l.$implicit;t.xp6(1),t.Oqu(null==n?null:n.Title)}}function St(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"tbody")(1,"tr")(2,"td",22),t.YNc(3,Ct,1,1,"img",23),t.YNc(4,ft,1,0,"ng-template",null,24,t.W1O),t.TgZ(6,"h4",25),t._uU(7),t.qZA()(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.TgZ(10,"td")(11,"ul",26),t.YNc(12,bt,2,1,"li",13),t.qZA()(),t.TgZ(13,"td"),t._uU(14),t.qZA(),t.TgZ(15,"td")(16,"ul",26),t.YNc(17,Pt,2,1,"li",13),t.qZA()(),t.TgZ(18,"td")(19,"button",27),t.NdJ("click",function(){const r=t.CHM(n).$implicit,p=t.oxw().ngIf,b=t.oxw();return t.KtG(b.openUploadModal(r,p))}),t._UZ(20,"i",28),t._uU(21," Upload "),t.qZA()()()()}if(2&o){const n=l.$implicit,e=t.MAs(5);t.xp6(3),t.Q6J("ngIf",null==n?null:n.ImageUrl)("ngIfElse",e),t.xp6(4),t.Oqu(null==n?null:n.Name),t.xp6(2),t.Oqu(null==n?null:n.Category),t.xp6(3),t.Q6J("ngForOf",n.Variants),t.xp6(2),t.Oqu(null==n?null:n.Code),t.xp6(3),t.Q6J("ngForOf",n.Channel)}}function xt(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"span",31),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(2);return t.KtG(a.getRowCount())}),t.TgZ(1,"i",32),t._uU(2,"?"),t.qZA()()}}function It(o,l){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const n=l.ngIf;t.xp6(1),t.Oqu(t.lcZ(2,1,n))}}function Tt(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"a",33),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(2);return t.KtG(a.onNextPage())}),t._UZ(1,"i",34),t._uU(2," Next"),t.qZA()}}function vt(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"a",35),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(2);return t.KtG(a.onLastPage())}),t._UZ(1,"i",36),t._uU(2," Last"),t.qZA()}}function yt(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"mainpanel",1),t.NdJ("onSubmit",function(a){t.CHM(n);const r=t.oxw();return t.KtG(r.searchProduct(a))}),t.TgZ(1,"actions")(2,"button",2),t.NdJ("click",function(){const r=t.CHM(n).ngIf,p=t.oxw();return t.KtG(p.openScanDialog(r))}),t._UZ(3,"i",3),t._uU(4," Scan Channel "),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){t.CHM(n);const r=t.oxw();return t.KtG(r.onFilterMissingChannel(a))})("clear",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onClearFilterChannel())}),t.qZA()()()()(),t.TgZ(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"table",10)(17,"thead",11)(18,"tr")(19,"th",12),t._uU(20,"Product"),t.qZA(),t.TgZ(21,"th"),t._uU(22,"Category"),t.qZA(),t.TgZ(23,"th"),t._uU(24,"Variant"),t.qZA(),t.TgZ(25,"th"),t._uU(26,"SKU"),t.qZA(),t.TgZ(27,"th"),t._uU(28,"Missing Channel"),t.qZA(),t.TgZ(29,"th"),t._uU(30,"Actions"),t.qZA()()(),t.YNc(31,St,22,7,"tbody",13),t.ALo(32,"async"),t.qZA()()(),t.TgZ(33,"div",14)(34,"div",15)(35,"div",16),t._uU(36),t.ALo(37,"number"),t.ALo(38,"async"),t.YNc(39,xt,3,0,"span",17),t.YNc(40,It,3,3,"span",18),t.ALo(41,"async"),t._uU(42),t.qZA()(),t.TgZ(43,"div",19),t.YNc(44,Tt,3,0,"a",20),t.YNc(45,vt,3,0,"a",21),t.qZA()()()()()}if(2&o){const n=l.ngIf,e=t.oxw();let a;t.xp6(11),t.Q6J("clearable",!0)("items",n.Options.Channel)("ngModel",e.filterSearch.ChannelID==e.guidEmpty?null:e.filterSearch.ChannelID),t.xp6(20),t.Q6J("ngForOf",t.lcZ(32,10,e.getData$())),t.xp6(5),t.hij(" Showing 1 - ",t.lcZ(37,12,null==(a=t.lcZ(38,14,e.paginationService.data$))?null:a.length)," of "),t.xp6(3),t.Q6J("ngIf",e.paginationService.hideCount),t.xp6(1),t.Q6J("ngIf",t.lcZ(41,16,!e.paginationService.hideCount&&e.rowCount$)),t.xp6(2),t.hij(" records ~ ",e.paginationService.footerPageNumber," Page "),t.xp6(2),t.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),t.xp6(1),t.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}let Ot=(()=>{class o{constructor(n,e,a,r,p){this.http=n,this.dialog=e,this.toastr=a,this.productService=r,this.paginationService=p,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannel",this.guidEmpty=G.GuidEMpty,this.initLoader()}initLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe((0,mt.b)(n=>{this.filterSearch=n.Filter,this.paginationService.resetToFirstPage(n.Filter)}))}getData$(){return this.paginationService.data$}searchProduct(n){this.filterSearch.text=n,this.paginationService.resetToFirstPage(this.filterSearch)}syncProduct(n){let e=this.productService.findChannelById(this.filterSearch.ChannelID,n.Options.Channel);this.productService.scanNotInChannel(n.Filter.ChannelID).subscribe(a=>{let r=a.NotInChannel?a.NotInChannel.Product:0,p=a.InChannel?a.InChannel.Product:0;this.toastr.success(r+p+" found in "+e.Name+"</br> ( "+p+" In POS + "+r+" Not In Channel )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}).add(()=>{this.paginationService.resetToFirstPage(this.filterSearch)})}openScanDialog(n){this.dialog.open(d.j,{data:{filter:this.filterSearch,Channel:n.Options.Channel,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,w.h)(a=>a)).subscribe(a=>{this.filterSearch=a.filter,this.syncProduct(n)})}openUploadModal(n,e){let a,r=e.Options.Channel.filter(p=>(a=n.Channel.findIndex(b=>b.ChannelID==p.ID),a>-1));this.dialog.open(M,{width:"350px",data:{item:n,selectedItemMissingChannel:r}}).afterClosed().subscribe(p=>{p&&this.uploadProduct(n,p.channelID,p.CategoryID,e)})}onFilterMissingChannel(n){this.filterSearch.ChannelID=n}onClearFilterChannel(){this.filterSearch.ChannelID=this.guidEmpty}uploadProduct(n,e,a,r){let p=this.productService.findChannelById(e,r.Options.Channel);this.productService.uploadSingleProduct(n,e,a).subscribe(b=>{this.paginationService.resetToFirstPage(r.Filter),this.toastr.success("Successfully uploaded "+n.Name+" to "+p.Name,"Success")})}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:n=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,n)}})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(O.O),t.Y36(s.uw),t.Y36(F._W),t.Y36(H.M),t.Y36(_t.b))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel",3,"onSubmit",4,"ngIf"],["headerTitle","Not in Channel",3,"onSubmit"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"ms-5"],[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"],[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"],[1,"text-start"],["class","border rounded","style","width: 40px",3,"src",4,"ngIf","ngIfElse"],["elsePic",""],[1,"ms-5","d-inline","fw-normal"],[2,"padding-left","0px"],[1,"btn","btn-link","btn-sm",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"border","rounded",2,"width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){1&n&&(t.YNc(0,yt,46,18,"mainpanel",0),t.ALo(1,"async")),2&n&&t.Q6J("ngIf",t.lcZ(1,1,e.loader$))},dependencies:[u.sg,u.O5,i.JJ,i.On,y.p,B.w9,u.Ov,u.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}}thead[_ngcontent-%COMP%]{position:sticky;top:0}"]}),o})();function Mt(o,l){1&o&&(t.TgZ(0,"a",6)(1,"b"),t._uU(2,"seller.shopee.co.id "),t.qZA(),t._UZ(3,"i",7),t.qZA())}function Zt(o,l){1&o&&(t.TgZ(0,"a",8)(1,"b"),t._uU(2,"seller.tokopedia.com "),t.qZA(),t._UZ(3,"i",7),t.qZA())}let Dt=(()=>{class o{constructor(n){this.data=n,this.dialogName=n.name,this.type=n.type}ngOnInit(){}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-instruction"]],decls:24,vars:3,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0"],[1,"me-5","mt-5","text-larger"],[1,"mb-5"],["href","http://seller.shopee.co.id","target","_blank",4,"ngIf"],["href","http://seller.tokopedia.com","target","_blank",4,"ngIf"],["href","http://seller.shopee.co.id","target","_blank"],[1,"fas","fa-sm","fa-external-link-alt"],["href","http://seller.tokopedia.com","target","_blank"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1,"Download Products to POS"),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"ol",2)(5,"li",3),t._uU(6," Go to Seller Marketplace account"),t._UZ(7,"br"),t.YNc(8,Mt,4,0,"a",4),t.YNc(9,Zt,4,0,"a",5),t.qZA(),t.TgZ(10,"li",3),t._uU(11," Input SKU (Stock Keeping Unit) for "),t._UZ(12,"br"),t.TgZ(13,"b"),t._uU(14),t.qZA()(),t.TgZ(15,"li",3),t._uU(16,"Press "),t.TgZ(17,"b"),t._uU(18,'"Scan"'),t.qZA(),t._uU(19," channel again"),t.qZA(),t.TgZ(20,"li",3)(21,"b"),t._uU(22,'"Download"'),t.qZA(),t._uU(23," button will now be available"),t.qZA()()()),2&n&&(t.xp6(8),t.Q6J("ngIf",0==e.type),t.xp6(1),t.Q6J("ngIf",1==e.type),t.xp6(5),t.Oqu(e.dialogName))},dependencies:[u.O5,s.uh,s.xY],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.text-larger[_ngcontent-%COMP%]{font-size:larger}"]}),o})();function wt(o,l){if(1&o&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA()()),2&o){const n=l.$implicit;t.xp6(2),t.Oqu(null==n?null:n.ChannelVariationSKU),t.xp6(2),t.Oqu(null==n?null:n.Name)}}let Nt=(()=>{class o{constructor(n){this.data=n}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-variants"]],decls:13,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3","text-center"],[1,"pb-5","mx-0","pt-2","px-10","d-flex","justify-content-center"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead",3)(6,"tr")(7,"th"),t._uU(8,"Variation"),t.qZA(),t.TgZ(9,"th"),t._uU(10,"SKU"),t.qZA()()(),t.TgZ(11,"tbody"),t.YNc(12,wt,5,2,"tr",4),t.qZA()()()),2&n&&(t.xp6(1),t.Oqu(null==e.data?null:e.data.title),t.xp6(11),t.Q6J("ngForOf",e.data.variants))},dependencies:[u.sg],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),o})();function Ut(o,l){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"button",11),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownloadAllProduct("SELECTED"))}),t._UZ(2,"i",12),t._uU(3),t.qZA(),t.BQk()}if(2&o){const n=t.oxw();t.xp6(3),t.hij(" Selected Download Product (",n.getSelected().length,") ")}}function kt(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"button",11),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownloadAllProduct("ALL"))}),t._UZ(1,"i",12),t._uU(2," Download "),t.qZA()}}const At=function(o){return[o]},Ft=function(){return[]};function Jt(o,l){if(1&o){const n=t.EpF();t.TgZ(0,"div",13)(1,"app-product-card",14),t.NdJ("onCheckBoxChange",function(a){const p=t.CHM(n).index,b=t.oxw();return t.KtG(b.onSelectProduct(a,p))})("onDescEvent",function(){const r=t.CHM(n).index,p=t.oxw();return t.KtG(p.showVariantDetail(r))})("onDownload",function(){const r=t.CHM(n).$implicit,p=t.oxw();return t.KtG(p.onDownloadProduct(r))}),t.qZA()()}if(2&o){const n=l.$implicit;t.xp6(1),t.Q6J("title",null==n?null:n.Name)("productImage",null==n?null:n.Image)("code",0==(null==n||null==n.Variant?null:n.Variant.length)?null==n?null:n.ChannelItemSKU:null)("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(7,At,null==n?null:n.Channel):t.DdM(9,Ft))("showCheckBox",null==n?null:n.upload)}}let Et=(()=>{class o{constructor(n,e,a){this.http=n,this.toastr=e,this.dialog=a,this.filter=new f,this.loading=!1,this.syncupdatefull=!1}ngOnInit(){this.Load()}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.Channel=n.Options.Channel,this.filter=n.Filter,this.filter.ChannelID=null,this.filter.sync=!0,this.GetProducts()})}GetProducts(){this.http.post("/api/product/GetProductChannelNotPOS",{ID:this.filter.ChannelID}).subscribe(e=>{this.data=e.Data,this.uploadStatus(),this.mapChannelToProduct(),this.originalData=this.data})}mapChannelToProduct(){this.data=this.data.map(n=>(n.Channel=this.Channel.find(e=>e.ID==n.ChannelID),n))}uploadStatus(){for(let n of this.data)n.fullTitle=!1,n.upload=n.Variant.length>0?null==n.Variant.find(a=>null==a.ChannelVariationSKU):null!=n.ChannelItemSKU}SearchProduct(n){var e=this.originalData;null!=this.filter.ChannelID&&(e=e.filter(a=>a.ChannelID==this.filter.ChannelID)),null!=n&&""!=n&&(e=e.filter(a=>null!==a.Name&&a.Name.toLowerCase().includes(n.toLowerCase()))).length<1&&(e=this.originalData.filter(a=>null!==a.ChannelItemSKU&&a.ChannelItemSKU.includes(n))),this.data=e}GetProductChannel(n){return this.ch=this.Channel.find(e=>e.Name==n.Channel),!!this.ch}Refresh(){null!==this.filter.ChannelID&&null!=this.filter.mode?this.http.post("/api/product/ScanOptimized",{ID:this.filter.ChannelID,mode:this.filter.mode,ScanFull:this.filter.ScanFull}).subscribe(e=>{this.GetProducts();let a=e.NotInPOS?e.NotInPOS.Product:0;this.toastr.success(a+" found in "+this.getChannelName(this.filter.ChannelID)+"</br> ( "+a+" Not In POS )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}):alert("Please select channel")}openScanDialog(){this.dialog.open(d.j,{data:{filter:this.filter,Channel:this.Channel,showScanUpdateType:!1},width:"30%"}).afterClosed().subscribe(e=>{null!=e&&(this.filter=e.filter,this.Refresh())})}getSelected(){return this.data?this.data.filter(n=>n.selected):[]}hasSelection(){return!!this.data&&this.getSelected().length>0}onDownloadAllProduct(n){let e;if(e="ALL"==n?this.data:this.getSelected(),e.length>0){let a=[];e.forEach(r=>a.push(r)),this.http.post("/api/product/DownloadMultipleProductFromChannel",a).subscribe(r=>{this.GetProducts(),this.toastr.success("Retrieved Product successfully!","Success")})}}onSelectProduct(n,e){this.data[e].selected=n}onDownloadProduct(n){confirm(`Are you sure you want to Retrieve product ${n?.Name} from ${n?.Channel?.Name} to POS?`)&&this.http.post("/api/product/DownloadProductFromChannel",{ChannelItemID:n.ChannelItemID,ChannelID:n.ChannelID}).subscribe(a=>{this.GetProducts(),this.toastr.success("Retrieved Product successfully!","Success")})}getChannelName(n){return this.Channel.find(a=>a.ID==n).Name}openInstruction(n){this.dialogName=n.Name,this.GetProductChannel(n),this.dialogType=this.ch.TypeID,this.dialog.open(Dt,{data:{type:this.dialogType,name:this.dialogName},width:"30%"})}showFullTitle(n){n.fullTitle=!n.fullTitle}showVariantDetail(n){this.dialogName=this.data[n].Name;let e=this.data[n].Variant;e.length>0&&this.dialog.open(Nt,{data:{title:this.data[n].Name,variants:e},width:"30%"})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(O.O),t.Y36(F._W),t.Y36(s.uw))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-not-in-pos"]],decls:19,vars:7,consts:[["textButton"," Search",3,"headerTitle","onSubmit"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[4,"ngIf","ngIfElse"],["DOWNLOAD_ALL",""],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],[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"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"title","productImage","code","description","downloadButton","channels","showCheckBox","onCheckBoxChange","onDescEvent","onDownload"]],template:function(n,e){if(1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(r){return e.SearchProduct(r)}),t.TgZ(1,"actions")(2,"button",1),t.NdJ("click",function(){return e.openScanDialog()}),t._UZ(3,"i",2),t._uU(4," Scan Channel "),t.qZA(),t.YNc(5,Ut,4,1,"ng-container",3),t.YNc(6,kt,3,0,"ng-template",null,4,t.W1O),t.qZA(),t.TgZ(8,"filters")(9,"div",5)(10,"div",6)(11,"div")(12,"h6"),t._uU(13,"Channel"),t.qZA(),t.TgZ(14,"ng-select",7),t.NdJ("ngModelChange",function(r){return e.filter.ChannelID=r}),t.qZA()()()()(),t.TgZ(15,"content")(16,"div",8)(17,"div",9),t.YNc(18,Jt,2,10,"div",10),t.qZA()()()()),2&n){const a=t.MAs(7);t.Q6J("headerTitle","Not in POS ("+(e.originalData?e.originalData.length:"0")+")"),t.xp6(5),t.Q6J("ngIf",e.hasSelection())("ngIfElse",a),t.xp6(9),t.Q6J("clearable",!0)("items",e.Channel)("ngModel",e.filter.ChannelID),t.xp6(4),t.Q6J("ngForOf",e.data)}},dependencies:[u.sg,u.O5,i.JJ,i.On,y.p,B.w9,R],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}}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]}),o})();function Lt(o,l){1&o&&t._UZ(0,"img",16)}function Bt(o,l){1&o&&t._UZ(0,"img",17)}function Vt(o,l){if(1&o&&(t.TgZ(0,"div",18)(1,"table",19)(2,"tr")(3,"td",20),t._UZ(4,"img",21),t.qZA(),t.TgZ(5,"td",22)(6,"a",23),t._uU(7),t.qZA(),t.TgZ(8,"div"),t._uU(9),t.ALo(10,"number"),t.qZA()()()()()),2&o){const n=l.$implicit;t.xp6(4),t.s9C("src",n.ImageURL,t.LSH),t.xp6(2),t.s9C("href",n.URL,t.LSH),t.xp6(1),t.Oqu(n.Name),t.xp6(2),t.hij("Rp. ",t.lcZ(10,4,n.Price),"")}}function qt(o,l){if(1&o&&(t.TgZ(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",4)(4,"div",9),t.YNc(5,Lt,1,0,"img",10),t.YNc(6,Bt,1,0,"img",11),t.qZA(),t.TgZ(7,"div",12)(8,"h4"),t._uU(9),t.qZA()()()(),t.TgZ(10,"div",13)(11,"div",14),t.YNc(12,Vt,11,6,"div",15),t.qZA()()()()),2&o){const n=l.$implicit;t.xp6(5),t.Q6J("ngIf",1==n.TypeID),t.xp6(1),t.Q6J("ngIf",0==n.TypeID),t.xp6(3),t.AsE("",null==n?null:n.SKU," (",null==n||null==n.Child?null:n.Child.length," Alies)"),t.xp6(3),t.Q6J("ngForOf",n.Child)}}let Qt=(()=>{class o{constructor(n){this.http=n,this.filter={ChannelID:""},this.Load()}ngOnInit(){}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.filter.ChannelID=null,this.Channel=n.Options.Channel,this.Get()})}SearchProduct(n){}Get(){this.http.post("/api/product/GetDuplicateSkuInChannel",this.filter).subscribe(n=>{this.data=n.Data})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(O.O))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-duplicate-sku"]],decls:12,vars:5,consts:[["textButton"," Search",3,"headerTitle","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-4",4,"ngFor","ngForOf"],[1,"col-md-4"],[1,"card"],[1,"card-header","border-bottom"],[1,"col-md-1","pb-2"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],[1,"col-10","text-center"],[1,"card-body"],[1,"row","g-0","p-5"],["class","col-md-12",4,"ngFor","ngForOf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],[1,"col-md-12"],[1,"table"],[2,"width","100px"],[1,"img-thumbnail",3,"src"],[1,"text-start"],["target","_blank",3,"href"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(){return e.Get()}),t._UZ(1,"actions"),t.TgZ(2,"filters")(3,"div",1)(4,"div")(5,"h6"),t._uU(6,"Channel"),t.qZA(),t.TgZ(7,"ng-select",2),t.NdJ("ngModelChange",function(r){return e.filter.ChannelID=r}),t.qZA()()()(),t.TgZ(8,"content")(9,"div",3)(10,"div",4),t.YNc(11,qt,13,5,"div",5),t.qZA()()()()),2&n&&(t.Q6J("headerTitle","Duplicate Sku ("+(e.data?e.data.length:"0")+")"),t.xp6(7),t.Q6J("clearable",!0)("items",e.Channel)("ngModel",e.filter.ChannelID),t.xp6(4),t.Q6J("ngForOf",e.data))},dependencies:[u.sg,u.O5,i.JJ,i.On,y.p,B.w9,u.JJ]}),o})();var V=c(8063);const Yt=[{path:"",component:v,children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:dt,canActivate:[V.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:gt,canActivate:[V.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Ot,canActivate:[V.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Et,canActivate:[V.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Qt,canActivate:[V.a],data:{title:"Duplicate Sku in Channel"}}]}];let Rt=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez,Z.Bz.forChild(Yt)]}),o})();var Kt=c(8739),Gt=c(2594);let Ht=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez,i.u5,J.AV]}),o})(),$t=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez]}),o})(),jt=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez,_.Z,i.u5,Z.Bz,Rt,J.AV,y.R,B.A0,Kt.TU,Gt.K,Ht,$t]}),o})()},5241:(L,N,c)=>{c.d(N,{j:()=>E});var u=c(5412),_=c(9694),i=c(4650),Z=c(6895),t=c(4006),v=c(1948),f=c(9549),d=c(4385),s=c(3238);function g(I,M){if(1&I&&(i.TgZ(0,"mat-option",11),i._UZ(1,"img",12),i._uU(2),i.qZA()),2&I){const C=M.$implicit;i.Q6J("value",C.ID),i.xp6(1),i.Q6J("src",C.Img,i.LSH),i.xp6(1),i.hij(" ",C.Name," ")}}function x(I,M){if(1&I){const C=i.EpF();i.TgZ(0,"div")(1,"h5",2),i._uU(2,"Scan Type"),i.qZA(),i.TgZ(3,"mat-radio-group",13),i.NdJ("ngModelChange",function(D){i.CHM(C);const U=i.oxw();return i.KtG(U.data.filter.ScanFull=D)}),i.TgZ(4,"mat-radio-button",14),i._uU(5," Full "),i.qZA(),i.TgZ(6,"mat-radio-button",15),i._uU(7," Active "),i.qZA()()()}if(2&I){const C=i.oxw();i.xp6(3),i.Q6J("ngModel",C.data.filter.ScanFull)("disabled",C.isDisabledOptions),i.xp6(1),i.Q6J("value",!0),i.xp6(2),i.Q6J("value",!1)}}function O(I,M){if(1&I){const C=i.EpF();i.TgZ(0,"div",16)(1,"h5",2),i._uU(2),i.ALo(3,"date"),i.qZA(),i.TgZ(4,"mat-radio-group",17),i.NdJ("ngModelChange",function(D){i.CHM(C);const U=i.oxw();return i.KtG(U.data.filter.UpdatedProduct=D)}),i.TgZ(5,"mat-radio-button",18),i._uU(6," Scan All Products "),i.qZA(),i.TgZ(7,"mat-radio-button",19),i._uU(8," Scan Updated Products "),i.qZA()()()}if(2&I){const C=i.oxw();i.xp6(2),i.hij(" Last Scan: ",i.xi3(3,5,C.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),i.xp6(2),i.Q6J("ngModel",C.data.filter.UpdatedProduct)("disabled",C.isDisabledOptions),i.xp6(1),i.Q6J("value",!1),i.xp6(2),i.Q6J("value",!0)}}let E=(()=>{class I{constructor(C,h){this.dialogRef=C,this.data=h,this.channelType=_.x,this.showScanType=void 0===h.showScanType||h.showScanType,this.showScanUpdateType=void 0===h.showScanUpdateType||h.showScanUpdateType}ngOnInit(){this.data.filter.mode=0,this.data.filter.sync=!0,this.data.filter.ScanFull=!0,this.data.filter.UpdatedProduct=!1,this.isSingleChannel=void 0!==this.data.isSingleChannel&&this.data.isSingleChannel,this.selectedChannel=this.filterChannelById(this.data?.filter?.ChannelID),this.data.Channel.length<2&&(this.data.filter.ChannelID=this.data.Channel[0].ID)}onSelectChannel(C){let h=this.filterChannelById(C);this.selectedChannel=h,h&&h.TypeID==_.x.Tokopedia?(this.data.filter.ScanFull=!0,this.isDisabledOptions=!0):(this.data.filter.ScanFull=!1,this.isDisabledOptions=!1)}filterChannelById(C){let h;return this.data.Channel&&(h=this.data.Channel.find(D=>D.ID==C)),h}submit(){this.dialogRef.close(this.data)}close(){this.dialogRef.close()}}return I.\u0275fac=function(C){return new(C||I)(i.Y36(u.so),i.Y36(u.WI))},I.\u0275cmp=i.Xpm({type:I,selectors:[["app-scan-dialog"]],decls:16,vars:4,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0","border-top","border-bottom"],[1,"mb-3","fw-normal"],["appearance","outline"],["name","channelid","placeholder","Channel",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["class","mt-8",4,"ngIf"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],["name","scanType",1,"form-control","h-100","pt-5","round",3,"ngModel","disabled","ngModelChange"],["data-toggle","tooltip","title","Full Scan Product",1,"me-5",3,"value"],["data-toggle","tooltip","title","Only Active Product",1,"me-5",3,"value"],[1,"mt-8"],["name","ScanFull",1,"form-control","h-100","pt-5","round",3,"ngModel","disabled","ngModelChange"],["data-toggle","tooltip","title","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["data-toggle","tooltip","title","Scan only products that have been updated since the last channel scan",1,"me-5",3,"value"]],template:function(C,h){1&C&&(i.TgZ(0,"h1",0),i._uU(1,"Scan Marketplace"),i.qZA(),i.TgZ(2,"mat-dialog-content",1)(3,"div")(4,"h5",2),i._uU(5,"Select a Channel"),i.qZA(),i.TgZ(6,"mat-form-field",3)(7,"mat-select",4),i.NdJ("ngModelChange",function(U){return h.data.filter.ChannelID=U})("ngModelChange",function(U){return h.onSelectChannel(U)}),i.YNc(8,g,3,3,"mat-option",5),i.qZA()()(),i.YNc(9,x,8,4,"div",6),i.YNc(10,O,9,8,"div",7),i.qZA(),i.TgZ(11,"mat-dialog-actions",8)(12,"button",9),i.NdJ("click",function(){return h.close()}),i._uU(13," Cancel "),i.qZA(),i.TgZ(14,"button",10),i.NdJ("click",function(){return h.submit()}),i._uU(15," Scan "),i.qZA()()),2&C&&(i.xp6(7),i.Q6J("ngModel",h.data.filter.ChannelID),i.xp6(1),i.Q6J("ngForOf",h.data.Channel),i.xp6(1),i.Q6J("ngIf",(null==h.data?null:h.data.filter.ChannelID)&&h.showScanType||!h.isSingleChannel),i.xp6(1),i.Q6J("ngIf",((null==h.selectedChannel?null:h.selectedChannel.TypeID)==h.channelType.ShopeeV2||(null==h.selectedChannel?null:h.selectedChannel.TypeID)==h.channelType.Tiktok)&&(null==h.selectedChannel?null:h.selectedChannel.LastSync)&&h.showScanUpdateType))},dependencies:[Z.sg,Z.O5,t.JJ,t.On,u.uh,u.xY,u.H8,v.VQ,v.U0,f.KE,d.gD,s.ey,Z.uU],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:60px}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]}),I})()},9694:(L,N,c)=>{c.d(N,{x:()=>u});var u=(()=>{return(_=u||(u={}))[_.Shopee=0]="Shopee",_[_.Tokopedia=1]="Tokopedia",_[_.WooCommerce=2]="WooCommerce",_[_.None=3]="None",_[_.KalCare=4]="KalCare",_[_.ShopeeV2=5]="ShopeeV2",_[_.Tiktok=6]="Tiktok",_[_.Lazada=7]="Lazada",u;var _})()},7287:(L,N,c)=>{c.d(N,{b:()=>Y});var u=c(4482),_=c(5403),i=c(8421),Z=c(4671),t=c(5032),v=c(3269),d=c(4707),s=c(3099),x=c(1135),O=c(7579),E=c(2722),I=c(9300),M=c(4351),C=c(4004),h=c(5026),D=c(8505),U=c(4650),Q=c(1318);let Y=(()=>{class S{constructor(m){this.http=m,this.pagination$=new x.X(null),this.destroy$=new O.x,this.data$=this.paginationFunction()}onNextPage(m){m.PageNumber+=1,this.pagination$.next(m)}setPageNumberFooter(m){this.footerPageNumber=m.PageNumber}setPaginationButtonState(m,P){this.disableNextButton=0==P||!(P<m.RowCount*m.PageNumber)}resetToFirstPage(m){m.PageNumber=1,this.pagination$.next(m),this.hideCount=!0,this.goToLastPage=!1}getAllData(m,P){m.RowCount=P,this.pagination$.next(m),this.goToLastPage=!0}paginationFunction(){return this.pagination$.pipe((0,E.R)(this.destroy$),(0,I.h)(m=>null!=m),(0,M.b)(m=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(m)).pipe((0,C.U)(P=>P.Data))),function f(...S){const A=(0,v.jO)(S);return(0,u.e)((m,P)=>{const k=S.length,T=new Array(k);let w=S.map(()=>!1),F=!1;for(let y=0;y<k;y++)(0,i.Xf)(S[y]).subscribe((0,_.x)(P,J=>{T[y]=J,!F&&!w[y]&&(w[y]=!0,(F=w.every(Z.y))&&(w=null))},t.Z));m.subscribe((0,_.x)(P,y=>{if(F){const J=[y,...T];P.next(A?A(...J):J)}}))})}(this.pagination$),(0,h.R)((m,P)=>{const[k,T]=m,[w]=P;return 1==T.PageNumber?[w,T]:[k.concat(w),T]}),(0,D.b)(([m,P])=>{this.setPageNumberFooter(P),this.setPaginationButtonState(P,m.length)}),(0,C.U)(([m])=>m),function g(S,A,m){let P,k=!1;return S&&"object"==typeof S?({bufferSize:P=1/0,windowTime:A=1/0,refCount:k=!1,scheduler:m}=S):P=S??1/0,(0,s.B)({connector:()=>new d.t(P,A,m),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:k})}())}}return S.\u0275fac=function(m){return new(m||S)(U.LFG(Q.O))},S.\u0275prov=U.Yz7({token:S,factory:S.\u0275fac,providedIn:"root"}),S})()},6082:(L,N,c)=>{c.d(N,{M:()=>t});var u=c(8505),_=c(4650),i=c(1318),Z=c(7185);let t=(()=>{class v{constructor(d,s){this.httpService=d,this.toastrService=s}filterChannel(d,s){return d.filter(g=>-1!==s.findIndex(x=>g.TypeID==x))}uploadSingleProduct(d,s,g){return this.httpService.post("/api/product/UploadToMarketplace",{ChannelID:s,Products:[d.ID],CategoryID:g||0}).pipe((0,u.b)(()=>{this.toastrService.success(d.Name+" Successfully Created","Success")}))}uploadProducts(d,s,g){const x=d.map(E=>E.ID);return this.httpService.post("/api/product/UploadToMarketplace",{ChannelID:s,Products:x,CategoryID:g||0})}scanSingle(d,s){return this.httpService.post("/api/product/ScanSingle",{ID:d,SKU:s})}scanNotInChannel(d){return this.httpService.post("/api/product/ScanNotinChannel",{ID:d})}findAllSoldInChannel(d){return this.httpService.post("/api/product/GetSoldInChannel",d)}scanAll(d,s,g){return this.httpService.post("/api/product/ScanOptimized",{ID:d,ScanFull:s,UpdatedProduct:g})}getVariantCodesProduct(d){return d.Variants.map(g=>g.Code)}getVariantCodesProducts(d=[]){let s=[];return d.forEach(g=>{g.Variants.forEach(x=>{s=[...s,x.Code]})}),s}filterUnselectedChannel(d,s){let g;return g=d.Channel&&0!=d.Channel.length?s.filter(x=>-1===d.Channel.findIndex(O=>O.ChannelID==x.ID)):s,g}findChannelById(d,s){return s.find(g=>g.ID==d)}sortChannel(d){return d.sort((s,g)=>s.TypeID<g.TypeID?1:s.TypeID===g.TypeID?0:-1)}hasSelection(d=[]){return this.selectedProduct(d).length>0}selectedProduct(d=[]){return d.filter(s=>s.selected)}hasSelectionVariant(d){return this.selectedVariantProduct(d).length>0}selectedVariantProduct(d){let s=[];return d.forEach(g=>{s=[...s,...g.Variants.filter(x=>x.selected)]}),s}}return v.\u0275fac=function(d){return new(d||v)(_.LFG(i.O),_.LFG(Z._W))},v.\u0275prov=_.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[970],{7970:(De,P,c)=>{c.r(P),c.d(P,{PriceModule:()=>Fe});var s=c(6895),Z=c(7398),d=c(7481),g=c(8252),p=c(4006),u=c(8796),e=c(4650);let D=(()=>{class n{constructor(){this.priceTabs=[{Title:"Price Single Channel",Url:"/menu/price/SingleChannel"},{Title:"POS vs Channel Price",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,i){1&t&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&t&&(e.xp6(3),e.Q6J("Tabs",i.priceTabs))},dependencies:[Z.e,g.lC]}),n})();var T=c(5241),S=c(2486),I=c(8505),h=c(9300),m=c(1318),f=c(7185),C=c(5412),v=c(7287),x=c(1948);function J(n,a){if(1&n&&(e.TgZ(0,"mat-radio-button",3),e._uU(1),e.qZA()),2&n){const t=a.$implicit,i=a.index,o=e.oxw();e.Q6J("value",t.Key)("name",o.name)("title",o.tooltipsText[i]?o.tooltipsText[i]:""),e.xp6(1),e.hij(" ",t.Value,"")}}const N=function(n){return{"border-0":n}};let y=(()=>{class n{constructor(){this.modelChange=new e.vpe,this.border=!1,this.tooltipsText=[]}change(t){this.modelChange.emit(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},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(t,i){1&t&&(e.TgZ(0,"div",0)(1,"mat-radio-group",1),e.NdJ("ngModelChange",function(l){return i.change(l)}),e.YNc(2,J,2,4,"mat-radio-button",2),e.qZA()()),2&t&&(e.Q6J("ngClass",e.VKq(3,N,0==i.border)),e.xp6(1),e.Q6J("ngModel",i.model),e.xp6(1),e.Q6J("ngForOf",i.options))},dependencies:[s.mk,s.sg,x.VQ,x.U0,p.JJ,p.On],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]}),n})(),O=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[s.ez,x.Fk,p.u5]}),n})();var w=c(488);function q(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.openScanDialog())}),e._UZ(1,"i",19),e._uU(2," Scan Channel "),e.qZA()}}function k(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"button",20),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().ngIf,l=e.oxw(2);return e.KtG(l.onUpdateItems(o))}),e._UZ(1,"i",21),e._uU(2," Update "),e.qZA()}}function Q(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,q,3,0,"button",16),e.YNc(2,k,3,0,"button",17),e.qZA()),2&n){const t=a.ngIf,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!i.hasSelection(t)),e.xp6(1),e.Q6J("ngIf",i.hasSelection(t))}}function L(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"div",22)(1,"app-table",23),e.NdJ("onSubmit",function(o){e.CHM(t);const l=e.oxw(2);return e.KtG(l.UpdatePriceByVariant(o))}),e.ALo(2,"async"),e.qZA()()}if(2&n){const t=e.oxw().ngIf,i=e.oxw();e.xp6(1),e.Q6J("data",e.lcZ(2,3,i.paginationService.data$))("channel",t.Options.Channel)("filter",t.Filter)}}function R(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.getRowCount())}),e.TgZ(1,"i",25),e._uU(2,"?"),e.qZA()()}}function $(n,a){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=a.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t))}}function Y(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"a",26),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onNextPage())}),e._UZ(1,"i",27),e._uU(2," Next"),e.qZA()}}function V(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"a",28),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onLastPage())}),e._UZ(1,"i",29),e._uU(2," Last"),e.qZA()}}function E(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("onSubmit",function(o){e.CHM(t);const l=e.oxw();return e.KtG(l.onSearch(o))}),e.TgZ(1,"filters")(2,"div",2)(3,"div")(4,"h6"),e._uU(5,"Filter by"),e.qZA(),e.TgZ(6,"radio-options",3),e.NdJ("modelChange",function(o){e.CHM(t);const l=e.oxw();return e.KtG(l.searchFilter.filterModel=o)}),e.qZA()()()(),e.TgZ(7,"actions")(8,"div",4),e.YNc(9,Q,3,2,"div",5),e.ALo(10,"async"),e.qZA()(),e.TgZ(11,"content")(12,"div",6)(13,"div",7),e.YNc(14,L,3,5,"div",8),e.ALo(15,"async"),e.qZA(),e.TgZ(16,"div",9)(17,"div",10)(18,"div",11),e._uU(19),e.ALo(20,"number"),e.ALo(21,"async"),e.YNc(22,R,3,0,"span",12),e.YNc(23,$,3,3,"span",5),e.ALo(24,"async"),e._uU(25),e.qZA()(),e.TgZ(26,"div",13),e.YNc(27,Y,3,0,"a",14),e.YNc(28,V,3,0,"a",15),e.qZA()()()()()}if(2&n){const t=e.oxw();let i;e.Q6J("pageData",t.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),e.xp6(6),e.Q6J("model",t.searchFilter.filterModel)("options",t.filterOptions)("border",!1),e.xp6(3),e.Q6J("ngIf",e.lcZ(10,15,t.paginationService.data$)),e.xp6(5),e.Q6J("ngIf",e.lcZ(15,17,t.paginationService.data$)),e.xp6(5),e.hij(" Showing 1 - ",e.lcZ(20,19,null==(i=e.lcZ(21,21,t.paginationService.data$))?null:i.length)," of "),e.xp6(3),e.Q6J("ngIf",t.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",!t.paginationService.hideCount&&e.lcZ(24,23,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)}}let K=(()=>{class n{constructor(t,i,o,l){this.http=t,this.toastr=i,this.dialog=o,this.paginationService=l,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.initLoaderPage(),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}]}}initLoaderPage(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe((0,I.b)(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1},this.searchFilter=t.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}openScanDialog(){this.dialog.open(T.j,{data:{filter:this.searchFilter,Channel:this.channelOptions},width:"30%"}).afterClosed().subscribe(i=>{null!=i&&(this.searchFilter=i.filter,this.refreshChannel())})}refreshChannel(){this.http.post("/api/product/ScanOptimized",{ID:this.searchFilter.ChannelID,ScanFull:this.searchFilter.ScanFull}).subscribe(i=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully scanned from "+this.getChannelName(this.searchFilter.ChannelID),"Success")})}UpdatePrice(t){let i=this.getSelected(t);if(i.length>0){let l=[];i.forEach(_=>l.push({ID:_.ID,Code:_.Code,Price:_.UnitPrice}));var o=[];for(let _ of this.channelOptions)_.selected&&o.push(_.ID);let r={ListChannelID:o,ListPrice:l};this.http.post("/api/Price/UpdateChannel",r).subscribe(_=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+r.ListPrice.length+" items in "+r.ListChannelID.length+" channels","Success")})}}getSelected(t){let i=Array();if(t){for(let o of t)for(let l of o.Variants)l.selected&&i.push(l);return i}return[]}hasSelection(t){return!!t&&this.getSelected(t).length>0}UpdatePriceByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(o=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") price in "+this.getChannelName(i.ID)+" to "+i.Price,"Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}getChannelName(t){return this.channelOptions.find(o=>o.ID==t).Name}onUpdateItems(t){const i=this.getSelected(t);this.dialog.open(S.j,{data:{selectedItems:i,channels:this.channelOptions},width:"40%"}).afterClosed().pipe((0,h.h)(o=>void 0!==o)).subscribe(o=>{this.channelOptions=o,this.UpdatePrice(t)})}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:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(m.O),e.Y36(f._W),e.Y36(C.uw),e.Y36(v.b))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-price-pos"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[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"],["table","price",3,"data","channel","filter","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(t,i){1&t&&(e.YNc(0,E,29,25,"mainpanel",0),e.ALo(1,"async")),2&t&&e.Q6J("ngIf",e.lcZ(1,1,i.loader$))},dependencies:[s.O5,d.p,y,w.a,s.Ov,s.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),n})();var A=c(6709);function H(n,a){if(1&n&&(e.TgZ(0,"th",33),e._uU(1),e.qZA()),2&n){const t=a.$implicit;e.xp6(1),e.Oqu(t.Name)}}function B(n,a){1&n&&(e.ynx(0),e.TgZ(1,"th",34),e._uU(2," Expected (POS) "),e.qZA(),e.TgZ(3,"th",34),e._uU(4," Channel "),e.qZA(),e.BQk())}function G(n,a){if(1&n&&e._UZ(0,"img",43),2&n){const t=e.oxw(3).$implicit;e.s9C("src",null==t?null:t.ImageUrl,e.LSH)}}function j(n,a){1&n&&e._UZ(0,"img",44)}const z=function(n){return{"border-bottom":n}};function W(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"td",38),e.YNc(2,G,1,1,"img",39),e.YNc(3,j,1,0,"ng-template",null,40,e.W1O),e.qZA(),e.TgZ(5,"td",41)(6,"h5",42),e._uU(7),e.qZA(),e._UZ(8,"br"),e.TgZ(9,"small"),e._uU(10),e.qZA()(),e.BQk()),2&n){const t=e.MAs(4),i=e.oxw().index,o=e.oxw().$implicit,l=e.oxw();e.xp6(1),e.Q6J("rowSpan",null==o?null:o.Variants.length)("ngClass",e.VKq(7,z,i+1==l.data.length)),e.xp6(1),e.Q6J("ngIf",null==o?null:o.ImageUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",null==o?null:o.Variants.length),e.xp6(2),e.Oqu(null==o?null:o.Name),e.xp6(3),e.hij("(",null==o?null:o.Category,")")}}const X=function(n){return{"bg-err":n}};function ee(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"td",47),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"td",48)(5,"div",49)(6,"div",50),e._uU(7),e.ALo(8,"number"),e._UZ(9,"br"),e.qZA(),e.TgZ(10,"div",51)(11,"a",52),e._UZ(12,"i",53),e.qZA()()()(),e.BQk()),2&n){const t=a.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,4,t.PriceExpected)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(8,X,t.Price!=t.PriceExpected)),e.xp6(3),e.hij(" ",e.lcZ(8,6,t.Price)," "),e.xp6(4),e.Q6J("href",t.Url,e.LSH)}}function te(n,a){1&n&&(e.TgZ(0,"td",54),e._uU(1,"X"),e.qZA(),e.TgZ(2,"td",54),e._uU(3,"X"),e.qZA())}function ne(n,a){if(1&n&&(e.ynx(0),e.YNc(1,ee,13,10,"ng-container",45),e.YNc(2,te,4,0,"ng-template",null,46,e.W1O),e.BQk()),2&n){const t=a.$implicit,i=e.MAs(3),o=e.oxw().$implicit,l=e.oxw(2);e.xp6(1),e.Q6J("ngIf",l.getItemFromChannel(o,t.ID))("ngIfElse",i)}}function ie(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,W,11,9,"ng-container",35),e.TgZ(2,"td",36),e._uU(3),e.qZA(),e.TgZ(4,"td",36),e._uU(5),e.qZA(),e.TgZ(6,"td",37)(7,"input",18),e.NdJ("ngModelChange",function(o){const r=e.CHM(t).$implicit;return e.KtG(r.selected=o)}),e.qZA()(),e.YNc(8,ne,4,2,"ng-container",19),e.qZA()}if(2&n){const t=a.$implicit,i=a.index,o=e.oxw(2);e.xp6(1),e.Q6J("ngIf",0==i),e.xp6(2),e.Oqu(null==t?null:t.Model),e.xp6(2),e.Oqu(null==t?null:t.Code),e.xp6(1),e.Q6J("hidden",null==o.filter?null:o.filter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",t.selected),e.xp6(1),e.Q6J("ngForOf",o.Channel)}}function oe(n,a){if(1&n&&(e.TgZ(0,"tbody"),e.YNc(1,ie,9,6,"tr",19),e.qZA()),2&n){const t=a.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}function ae(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"li")(1,"mat-checkbox",55),e.NdJ("ngModelChange",function(o){const r=e.CHM(t).$implicit;return e.KtG(r.selected=o)}),e.TgZ(2,"div",3)(3,"h6",56),e._uU(4),e.qZA()()()()}if(2&n){const t=a.$implicit;e.xp6(1),e.Q6J("ngModel",t.selected),e.xp6(3),e.Oqu(t.Name)}}let le=(()=>{class n{constructor(t,i,o){this.http=t,this.toastr=i,this.dialog=o,this.filter={ChannelID:""},this.loading=!1,this.checkboxState=!1,this.LoaderChannel(),this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.filterModel=1,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]}}ngOnInit(){}LoaderChannel(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(t=>{this.Channel=t.Options.Channel,this.filter=t.Filter,this.filter.HiddenIPOSInventory=!1,this.Filter()})}onCheckboxStateChange(){for(let t of this.data)for(let i of t.Variants)i.selected=this.checkboxState}getSelected(){let t=Array();if(this.data){for(let i of this.data)for(let o of i.Variants)o.selected&&t.push(o);return t}return[]}hasSelection(){return!!this.data&&this.getSelected().length>0}Filter(t){this.http.post("/api/Price/GetOutletPrice",{text:t,filterModel:this.filterModel,PageNumber:this.filter.PageNumber,RowCount:this.filter.RowCount}).subscribe(o=>{this.data=o.Data})}UpdatePrice(){let t=this.getSelected();if(t.length>0){let o=[];t.forEach(r=>o.push(r.ID));var i=[];for(let r of this.Channel)r.selected&&i.push(r.ID);let l={ListChannelID:i,ListID:o};this.http.post("/api/Price/UpdateChannelOutletPrice",l).subscribe(r=>{this.info=r.Data,this.Filter(),this.toastr.success("Successfully updated "+l.ListID.length+" items in "+l.ListChannelID.length+" channels","Success")})}}getItemFromChannel(t,i){return t.Channel.find(o=>o.ChannelID==i)}Actual(t){return t.Price}Expected(t){return t.PriceExpected}UpdatePriceByVariant(t,i,o,l){this.http.post("/api/Price/UpdatePriceByID",{ID:this.filter.ChannelID,ChannelItemID:t,ChannelVariantID:i,Price:o,VariantID:l}).subscribe(_=>{this.toastr.success(_.Data,"Success",{closeButton:!0,positionClass:"toast-bottom-right"});for(let M of this.data)if(M.ChannelItemID===t)for(let F of M.Variants)F.ChannelVariationID==i&&(F.Price=parseFloat(o))})}onUpdateItems(){const t=this.getSelected();this.dialog.open(S.j,{data:{selectedItems:t,channels:this.Channel},width:"40%"}).afterClosed().pipe((0,h.h)(i=>void 0!==i)).subscribe(i=>{this.Channel=i,this.UpdatePrice()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(m.O),e.Y36(f._W),e.Y36(C.uw))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-price-realtime"]],decls:58,vars:16,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"hidden","click"],[1,"fas","fa-chevron-circle-up"],[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"],["id","ModalScan","tabindex","-1","role","dialog","aria-labelledby","ModalScan","aria-hidden","true",1,"modal","pe-0","ps-5","ms-5"],[1,"modal-dialog","modal-dialog-centered","w-75"],[1,"modal-content","w-50"],[1,"modal-header"],["id","exampleModalLabel",1,"modal-title"],["type","button","data-dismiss","modal","aria-label","Close",1,"close"],["aria-hidden","true"],[1,"modal-body"],[1,"fw-light"],[1,"no-bullet"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-success",3,"click"],["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,"align-middle",3,"hidden"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img",3,"src",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img",3,"src"],["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","pointer","cell-hover"],[1,"text-end","border","pointer","cell-hover",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-8","px-0","text-center"],[1,"col-2","ps-0","text-start","align-self-center"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt"],[1,"table-white","border","text-end",2,"color","red"],[3,"ngModel","ngModelChange"],[1,"fw-light","me-2","my-auto"]],template:function(t,i){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return i.Filter(l)}),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(l){return i.filterModel=l}),e.qZA()()()(),e.TgZ(7,"actions")(8,"div",3)(9,"button",4),e.NdJ("click",function(){return i.onUpdateItems()}),e._UZ(10,"i",5),e._uU(11," Update "),e.qZA()()(),e.TgZ(12,"content")(13,"div",6)(14,"div",7)(15,"div",8)(16,"div",9)(17,"table",10)(18,"thead",11)(19,"tr"),e._UZ(20,"th",12),e.YNc(21,H,2,1,"th",13),e.qZA(),e.TgZ(22,"tr")(23,"th",14),e._uU(24,"Product"),e.qZA(),e.TgZ(25,"th",15),e._uU(26,"Variant"),e.qZA(),e.TgZ(27,"th",16),e._uU(28,"SKU"),e.qZA(),e.TgZ(29,"th",17)(30,"input",18),e.NdJ("ngModelChange",function(l){return i.checkboxState=l})("ngModelChange",function(){return i.onCheckboxStateChange()}),e.qZA()(),e.YNc(31,B,5,0,"ng-container",19),e.qZA()(),e.YNc(32,oe,2,1,"tbody",19),e.qZA()()()()(),e.TgZ(33,"div",20)(34,"div",21)(35,"div",22)(36,"div",23)(37,"h5",24),e._uU(38,"Update Price from POS to Channel"),e.qZA(),e.TgZ(39,"button",25)(40,"span",26),e._uU(41,"\xd7"),e.qZA()()(),e.TgZ(42,"div",27)(43,"div")(44,"h6",28),e._uU(45),e._UZ(46,"br")(47,"br"),e._uU(48," Choose channels to update : "),e._UZ(49,"br")(50,"br"),e.qZA(),e.TgZ(51,"ul",29),e.YNc(52,ae,5,2,"li",19),e.qZA()()(),e.TgZ(53,"div",30)(54,"button",31),e._uU(55,"Close"),e.qZA(),e.TgZ(56,"button",32),e.NdJ("click",function(){return i.UpdatePrice()}),e._uU(57,"Update"),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Price Comparison")("pageData",i.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),e.xp6(6),e.Q6J("model",i.filterModel)("options",i.Options)("border",!1),e.xp6(3),e.Q6J("hidden",!i.hasSelection()),e.xp6(12),e.Q6J("ngForOf",i.Channel),e.xp6(8),e.Q6J("hidden",null==i.filter?null:i.filter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",i.checkboxState),e.xp6(1),e.Q6J("ngForOf",i.Channel),e.xp6(1),e.Q6J("ngForOf",i.data),e.xp6(13),e.hij("Updating ",i.getSelected().length," items "),e.xp6(7),e.Q6J("ngForOf",i.Channel))},dependencies:[s.mk,s.sg,s.O5,p.Wl,p.JJ,p.On,d.p,y,A.oG,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}"]}),n})();var re=c(7945),ce=c(6082),U=c(455);function se(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2).ngIf,l=e.oxw();return e.KtG(l.openScanDialog(o))}),e._UZ(1,"i",9),e._uU(2," Scan Channel "),e.qZA()}}function pe(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().ngIf,l=e.oxw(2);return e.KtG(l.updateStock(o))}),e._UZ(1,"i",11),e._uU(2," Update "),e.qZA()}}function _e(n,a){if(1&n&&(e.TgZ(0,"actions")(1,"div",5)(2,"div"),e.YNc(3,se,3,0,"button",6),e.YNc(4,pe,3,0,"button",7),e.qZA()(),e._UZ(5,"div")(6,"div"),e.qZA()),2&n){const t=a.ngIf,i=e.oxw(2);e.xp6(3),e.Q6J("ngIf",!i.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",i.productService.hasSelectionVariant(t))}}function de(n,a){if(1&n&&(e.TgZ(0,"ng-option",32),e._UZ(1,"img",33),e._uU(2),e.qZA()),2&n){const t=a.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function he(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"input",51),e.NdJ("ngModelChange",function(o){e.CHM(t);const l=e.oxw(3).$implicit;return e.KtG(l.selected=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(3).$implicit,l=e.oxw(3);return e.KtG(l.onCheckboxStateProduct(o))}),e.qZA()}if(2&n){const t=e.oxw(3).$implicit;e.Q6J("ngModel",t.selected)}}function ge(n,a){if(1&n&&e._UZ(0,"img",52),2&n){const t=e.oxw(3).$implicit;e.s9C("src",t.ThumbnailUrl,e.LSH)}}function ue(n,a){1&n&&e._UZ(0,"img",53)}function me(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"td",44)(2,"div",45),e.YNc(3,he,1,1,"input",46),e.YNc(4,ge,1,1,"img",47),e.YNc(5,ue,1,0,"ng-template",null,48,e.W1O),e.qZA()(),e.TgZ(7,"td",49)(8,"span",50),e._uU(9),e.qZA(),e._UZ(10,"br"),e.TgZ(11,"small"),e._uU(12),e.qZA()(),e.BQk()),2&n){const t=e.MAs(6),i=e.oxw().$implicit,o=e.oxw().$implicit;e.xp6(1),e.Q6J("rowSpan",o.Variants.length),e.xp6(2),e.Q6J("ngIf",i.Inventory>=0||o.Variants.length>1),e.xp6(1),e.Q6J("ngIf",o.ThumbnailUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",o.Variants.length),e.xp6(2),e.Oqu(o.Name),e.xp6(3),e.hij("(",o.Category,")")}}function fe(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"input",54),e.NdJ("ngModelChange",function(o){e.CHM(t);const l=e.oxw().$implicit;return e.KtG(l.selected=o)}),e.qZA()}if(2&n){const t=e.oxw().$implicit;e.Q6J("ngModel",t.selected)}}function Ce(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"div",55)(1,"div",56),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,l=e.oxw().$implicit,r=e.oxw(2).ngIf,_=e.oxw();return e.KtG(_.openTableDialog(o,l,r))}),e._uU(2),e.ALo(3,"number"),e.qZA()()}if(2&n){const t=e.oxw().$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t.Channel[0]?null:t.Channel[0].Price)," ")}}const xe=function(n){return{"bg-err":n}};function be(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,me,13,7,"ng-container",4),e.TgZ(2,"td",19),e._uU(3),e.qZA(),e.TgZ(4,"td",22),e._uU(5),e.qZA(),e.TgZ(6,"td",34),e.YNc(7,fe,1,1,"input",35),e.qZA(),e.TgZ(8,"td",22),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td",36),e.YNc(12,Ce,4,3,"div",37),e.qZA(),e.TgZ(13,"td")(14,"div",38)(15,"div",39)(16,"a",40),e._UZ(17,"i",41),e.qZA(),e._uU(18," \xa0\xa0 "),e.TgZ(19,"span",42),e.NdJ("click",function(){const l=e.CHM(t).$implicit,r=e.oxw(4);return e.KtG(r.refreshPrice(l))}),e._UZ(20,"i",43),e.qZA()()()()()}if(2&n){const t=a.$implicit,i=a.index;e.xp6(1),e.Q6J("ngIf",0==i),e.xp6(2),e.Oqu(t.Model),e.xp6(2),e.hij(" ",t.Code," "),e.xp6(2),e.Q6J("ngIf",t.Inventory>=0),e.xp6(2),e.hij(" ",e.lcZ(10,8,t.UnitPrice)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(10,xe,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 Pe(n,a){if(1&n&&(e.ynx(0),e.YNc(1,be,21,12,"tr",26),e.BQk()),2&n){const t=a.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}function Ze(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"span",57),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.getRowCount())}),e.TgZ(1,"i",58),e._uU(2,"?"),e.qZA()()}}function Te(n,a){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=a.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Total))}}function Se(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"a",62),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(4);return e.KtG(o.onNextPage())}),e._UZ(1,"i",63),e._uU(2," Next"),e.qZA()}}function Ie(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"a",64),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(4);return e.KtG(o.onLastPage())}),e._UZ(1,"i",65),e._uU(2," Last"),e.qZA()}}function ve(n,a){if(1&n&&(e.TgZ(0,"div",59),e.YNc(1,Se,3,0,"a",60),e.YNc(2,Ie,3,0,"a",61),e.qZA()),2&n){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 ye(n,a){if(1&n){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(o){e.CHM(t);const l=e.oxw(2);return e.KtG(l.toggleDifferentInventory=o)})("toggleChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onToggleDifferentInventory())}),e.TgZ(10,"small",18),e._uU(11,"Filter Different Inventory"),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(o){const r=e.CHM(t).ngIf,_=e.oxw(2);return e.KtG(_.onSelectAllSKU(o.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(o){e.CHM(t);const l=e.oxw().ngIf;return e.KtG(l.Filter.ChannelID=o)})("change",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.search())}),e.YNc(22,de,3,3,"ng-option",24),e.qZA()(),e._UZ(23,"th",25),e.qZA()(),e.TgZ(24,"tbody"),e.YNc(25,Pe,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,Te,3,3,"span",4),e.ALo(33,"async"),e._uU(34),e.qZA()(),e.YNc(35,ve,3,2,"div",31),e.qZA()()()()}if(2&n){const t=a.ngIf,i=e.oxw().ngIf,o=e.oxw();e.xp6(9),e.Q6J("ngModel",o.toggleDifferentInventory),e.xp6(12),e.Q6J("clearable",!1)("ngModel",i.Filter.ChannelID),e.xp6(1),e.Q6J("ngForOf",i.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",o.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(33,12,!o.paginationService.hideCount&&o.allDataCount$)),e.xp6(2),e.hij(" records ~ ",o.paginationService.footerPageNumber," Page "),e.xp6(1),e.Q6J("ngIf",t.length>0)}}function we(n,a){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("textChange",function(o){e.CHM(t);const l=e.oxw();return e.KtG(l.searchFilter.text=o)})("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.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(o){const r=e.CHM(t).ngIf;return e.KtG(r.Filter.RowCount=o)}),e.qZA()()()(),e.YNc(7,_e,7,2,"actions",4),e.ALo(8,"async"),e.YNc(9,ye,36,14,"content",4),e.ALo(10,"async"),e.qZA()}if(2&n){const t=a.ngIf,i=e.oxw();e.Q6J("headerTitle",i.pageTitle)("text",i.searchFilter.text),e.xp6(6),e.Q6J("ngModel",t.Filter.RowCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(8,5,i.paginationService.data$)),e.xp6(2),e.Q6J("ngIf",e.lcZ(10,7,i.paginationService.data$))}}let Ae=(()=>{class n{constructor(t,i,o,l,r){this.http=t,this.paginationService=i,this.toastr=o,this.dialog=l,this.productService=r,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount"}ngOnInit(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe((0,I.b)(t=>{this.searchFilter=t.Filter,this.searchFilter.filterModel=1,this.paginationService.resetToFirstPage(this.searchFilter)}))}onToggleDifferentInventory(){this.searchFilter.filterModel=this.toggleDifferentInventory?1:3,this.search()}onCheckboxStateProduct(t){t.Variants=t.Variants.map(i=>(i.selected=t.selected,i))}openScanDialog(t){this.dialog.open(T.j,{data:{filter:this.searchFilter,Channel:t.Options.Channel},width:"30%"}).afterClosed().pipe((0,h.h)(i=>i)).subscribe(i=>{this.refreshChannel(t)})}refreshChannel(t){const i=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.http.post("/api/product/ScanOptimized",{ID:this.searchFilter.ChannelID,ScanFull:this.searchFilter.ScanFull}).subscribe(()=>{this.search(),this.toastr.success(`Successfully scanned from ${i?.Name}`,"Success")})}updateStock(t){let o=this.productService.selectedVariantProduct(t).map(r=>({ID:r.ID,ChannelID:r.Channel[0].ChannelID,Code:r.Code,Price:r.UnitPrice})),l={ListChannelID:[this.searchFilter.ChannelID],ListPrice:o};this.http.post("/api/Price/UpdateChannel",l).subscribe(()=>{this.search(),this.toastr.success(`Successfully updated ${l.ListPrice.length} variants in ${l.ListChannelID.length} channels`,"Success")})}refreshPrice(t){this.http.post("/api/Price/RefreshPriceChannel",{ChannelItemID:t?.Channel[0].ChannelItemID,ChannelVariationID:t?.Channel[0]?.ChannelVariationID,ChannelID:t?.Channel[0]?.ChannelID,VariantID:t.ID}).subscribe(o=>{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:t=>{this.paginationService.getAllData(this.searchFilter,t.Total)}})}openTableDialog(t,i,o){this.dialog.open(re.k,{data:{Name:i.Name,Variant:t,ChannelID:t?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:t?.Channel[0]?.ChannelItemID}}).afterClosed().pipe((0,h.h)(r=>r)).subscribe(r=>{this.updateItemAfterDialog(r,o)})}updateItemAfterDialog(t,i){const o=this.productService.findChannelById(this.searchFilter.ChannelID,i.Options.Channel);let l={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:parseFloat(t.Price),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Price/UpdatePriceByID",l).subscribe(r=>{this.toastr.success(`Successfully updated ${t.ItemName} (${t.VarName}) inventory in ${o.Name} to ${l.Price}`,"Success")})}onSelectAllSKU(t,i){i=i.map(o=>(o.Variants=o.Variants.map(l=>(l.selected=t,l)),o))}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(m.O),e.Y36(v.b),e.Y36(f._W),e.Y36(C.uw),e.Y36(ce.M))},n.\u0275cmp=e.Xpm({type:n,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,"font-weight-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,"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"],["target","_blank",2,"color","#333333",3,"href"],[1,"fas","custom-size","fa-lg","fa-external-link-alt"],[1,"pl-5",3,"click"],[1,"fas","custom-size","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","style","margin-left: 20px",3,"src",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",2,"margin-left","20px",3,"src"],["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(t,i){1&t&&(e.YNc(0,we,11,9,"mainpanel",0),e.ALo(1,"async")),2&t&&e.Q6J("ngIf",e.lcZ(1,1,i.loader$))},dependencies:[s.mk,s.sg,s.O5,p.Fj,p.wV,p.Wl,p.JJ,p.On,d.p,u.w9,u.jq,U.Rr,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}"]}),n})();var b=c(8063);const Ue=[{path:"",component:D,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:K,canActivate:[b.a],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:le,canActivate:[b.a],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:Ae,canActivate:[b.a],data:{title:"Price Single Channel Comparison"}}]}];let Me=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[s.ez,g.Bz.forChild(Ue)]}),n})(),Fe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[s.ez,p.u5,Z.Z,d.R,g.Bz,u.A0,Me,p.UX,U.rP,O,A.p9,w.U]}),n})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[592],{4810:(d,u,i)=>{i.d(u,{T:()=>e});var l=i(4650);let e=(()=>{class r{constructor(){}getBrowserName(){const a=window.navigator.userAgent.toLowerCase();switch(!0){case a.indexOf("edge")>-1||a.indexOf("edg")>-1:return"edge";case a.indexOf("opr")>-1:return"opera";case a.indexOf("chrome")>-1:return"chrome";case a.indexOf("trident")>-1:return"ie";case a.indexOf("firefox")>-1:return"firefox";case a.indexOf("safari")>-1:return"safari";default:return"other"}}}return r.\u0275fac=function(a){return new(a||r)},r.\u0275prov=l.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"}),r})()},2594:(d,u,i)=>{i.d(u,{K:()=>g,n:()=>a});var l=i(6895),e=i(4650);function r(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"span",10),e.NdJ("click",function(){e.CHM(o);const c=e.oxw();return c.getTotal(),e.KtG(c.hasClicked=!0)}),e.TgZ(1,"i",11),e._uU(2,"?"),e.qZA()()}}function p(t,s){if(1&t&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&t){const o=e.oxw();e.xp6(1),e.Oqu(e.lcZ(2,1,o.paginationTotal))}}let a=(()=>{class t{constructor(){this.get=new e.vpe,this.change=new e.vpe,this.next=new e.vpe,this.previous=new e.vpe,this.total=new e.vpe,this.hasClicked=!1}changePage(o){this.filter.PageNumber=o.pageIndex+1,this.change.emit(this.filter)}getTotal(){this.total.emit()}PreviousPage(){this.previous.emit()}NextPage(){this.next.emit()}}return t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-mat-paginator-no-count"]],inputs:{filter:"filter",paginationTotal:"paginationTotal",totaldata:"totaldata",hasClicked:"hasClicked"},outputs:{get:"get",change:"change",next:"next",previous:"previous",total:"total"},decls:13,vars:10,consts:[[1,"d-flex","justify-content-end","mt-5"],[1,"d-sm-block","collapse","mt-3","me-5"],[1,"text-dark","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary","btn-sm","me-3","border-0",3,"disabled","click"],[1,"fas","fa-chevron-left"],["role","button",1,"btn","btn-outline-secondary","btn-sm","border-0",3,"disabled","click"],[1,"fas","fa-chevron-right"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e._uU(3),e.ALo(4,"number"),e.ALo(5,"number"),e.YNc(6,r,3,0,"span",3),e.YNc(7,p,3,3,"span",4),e.qZA()(),e.TgZ(8,"div",5)(9,"button",6),e.NdJ("click",function(){return n.PreviousPage()}),e._UZ(10,"i",7),e.qZA(),e.TgZ(11,"button",8),e.NdJ("click",function(){return n.NextPage()}),e._UZ(12,"i",9),e.qZA()()()),2&o&&(e.xp6(3),e.AsE(" Showing ",e.lcZ(4,6,n.filter.PageSize*(n.filter.PageNumber-1)+1)," - ",e.lcZ(5,8,n.filter.PageSize*(n.filter.PageNumber-1)+n.totaldata)," of "),e.xp6(3),e.Q6J("ngIf",!n.hasClicked),e.xp6(1),e.Q6J("ngIf",n.hasClicked),e.xp6(2),e.Q6J("disabled",1==n.filter.PageNumber),e.xp6(2),e.Q6J("disabled",n.filter.PageSize*(n.filter.PageNumber-1)+n.totaldata==n.paginationTotal||n.totaldata<n.filter.PageSize))},dependencies:[l.O5,l.JJ]}),t})(),g=(()=>{class t{}return t.\u0275fac=function(o){return new(o||t)},t.\u0275mod=e.oAB({type:t}),t.\u0275inj=e.cJS({imports:[l.ez]}),t})()}}]);