marketplacepos 3.10.2 → 3.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/Marketplace/{chunk-6C4L2S7S.js → chunk-2CCOAUJC.js} +1 -1
  2. package/Marketplace/{chunk-6ORTAB6O.js → chunk-2E7TANNT.js} +1 -1
  3. package/Marketplace/{chunk-RS4FBR2B.js → chunk-2ILB3NSK.js} +1 -1
  4. package/Marketplace/{chunk-TZRTEOJA.js → chunk-4276ECDR.js} +1 -1
  5. package/Marketplace/{chunk-GRHKW2KQ.js → chunk-4BX3EUMQ.js} +1 -1
  6. package/Marketplace/{chunk-DG6KCZ24.js → chunk-4L6TZC4Q.js} +1 -1
  7. package/Marketplace/{chunk-PHYOU4H6.js → chunk-4RHNT4DZ.js} +1 -1
  8. package/Marketplace/{chunk-VA2Y75VY.js → chunk-52XKBWBC.js} +1 -1
  9. package/Marketplace/{chunk-VGBWD4JQ.js → chunk-5ADQ3O2A.js} +1 -1
  10. package/Marketplace/{chunk-B6BTNEL5.js → chunk-6F5PLBQH.js} +1 -1
  11. package/Marketplace/{chunk-MQ5YF2EQ.js → chunk-6FRKO4S2.js} +1 -1
  12. package/Marketplace/{chunk-UZO2VDKA.js → chunk-A6KWQYQ4.js} +1 -1
  13. package/Marketplace/{chunk-NNZ2QIAF.js → chunk-BCUSOEWI.js} +1 -1
  14. package/Marketplace/{chunk-WKWDPKZH.js → chunk-C7NKOWMY.js} +1 -1
  15. package/Marketplace/{chunk-XT3VATZ2.js → chunk-CHXSDB2F.js} +1 -1
  16. package/Marketplace/{chunk-DITYFI3U.js → chunk-CMVC2NTG.js} +1 -1
  17. package/Marketplace/{chunk-2OVWEFCG.js → chunk-E3GZ25PR.js} +1 -1
  18. package/Marketplace/chunk-F4WFV5C7.js +1 -0
  19. package/Marketplace/{chunk-V6IO53G5.js → chunk-FP2EY4DY.js} +1 -1
  20. package/Marketplace/{chunk-4R2X6SN5.js → chunk-FQV6GA74.js} +1 -1
  21. package/Marketplace/{chunk-MFWCFDSI.js → chunk-FUC2SF5Q.js} +1 -1
  22. package/Marketplace/{chunk-EJMJP3AQ.js → chunk-FWBPK3JW.js} +2 -2
  23. package/Marketplace/{chunk-MB5EFAFQ.js → chunk-FYQZXWZE.js} +1 -1
  24. package/Marketplace/{chunk-WTRYN5E5.js → chunk-HCE3NYED.js} +1 -1
  25. package/Marketplace/{chunk-C6SMFVRJ.js → chunk-HG3XRZ32.js} +1 -1
  26. package/Marketplace/chunk-HNWEYQEO.js +1 -0
  27. package/Marketplace/{chunk-3ZPC3DOZ.js → chunk-I2E3VYHO.js} +1 -1
  28. package/Marketplace/{chunk-RTSSYFK3.js → chunk-IHY6NGKX.js} +1 -1
  29. package/Marketplace/{chunk-NZ5PGMTU.js → chunk-ITCAVZN5.js} +1 -1
  30. package/Marketplace/{chunk-VWCDA6IC.js → chunk-JAGECSCV.js} +1 -1
  31. package/Marketplace/{chunk-DDXVCGNF.js → chunk-LMYBWQKO.js} +1 -1
  32. package/Marketplace/{chunk-L3QJXWW4.js → chunk-MCVGOQW3.js} +1 -1
  33. package/Marketplace/{chunk-NX7MGO3M.js → chunk-MHZTEGOR.js} +1 -1
  34. package/Marketplace/{chunk-7RZLTDIS.js → chunk-MLG7CYPK.js} +1 -1
  35. package/Marketplace/{chunk-Z24AOV6E.js → chunk-MPPVCPW6.js} +1 -1
  36. package/Marketplace/{chunk-2HHCA3NK.js → chunk-MXRTBC2I.js} +1 -1
  37. package/Marketplace/{chunk-LPSC67EP.js → chunk-N76NUVI2.js} +1 -1
  38. package/Marketplace/{chunk-5VJQDJRJ.js → chunk-NLIQ2J6A.js} +1 -1
  39. package/Marketplace/{chunk-7C4NOK37.js → chunk-NWBY55LE.js} +1 -1
  40. package/Marketplace/{chunk-CD5AKGA4.js → chunk-OI2AB7KN.js} +1 -1
  41. package/Marketplace/{chunk-6NGKE364.js → chunk-OQPXY7Z5.js} +1 -1
  42. package/Marketplace/{chunk-MIITW5F3.js → chunk-PAHXMFHZ.js} +1 -1
  43. package/Marketplace/chunk-QXR35VSU.js +5 -0
  44. package/Marketplace/{chunk-G7RXTLDR.js → chunk-SX547BDR.js} +1 -1
  45. package/Marketplace/{chunk-I2G5J34U.js → chunk-TKMWRB4W.js} +1 -1
  46. package/Marketplace/{chunk-223SSA62.js → chunk-TYL25LTY.js} +1 -1
  47. package/Marketplace/{chunk-JN7U2QOU.js → chunk-U22NLR2G.js} +1 -1
  48. package/Marketplace/{chunk-Y3MMZORK.js → chunk-V7GAS2H2.js} +1 -1
  49. package/Marketplace/{chunk-CCMD33HH.js → chunk-WAEUYRER.js} +1 -1
  50. package/Marketplace/{chunk-FGIAQ42H.js → chunk-WPB7FUQN.js} +12 -12
  51. package/Marketplace/{chunk-H6M6M4LW.js → chunk-XDA6LS5Q.js} +1 -1
  52. package/Marketplace/{chunk-GK4USVUZ.js → chunk-XM2IT53M.js} +1 -1
  53. package/Marketplace/{chunk-PIKZDDIU.js → chunk-YJTBGAYK.js} +1 -1
  54. package/Marketplace/{chunk-2TS2HEE6.js → chunk-YNZUWVLD.js} +1 -1
  55. package/Marketplace/{chunk-UYBYAC3J.js → chunk-YRDQ5HY2.js} +1 -1
  56. package/Marketplace/{chunk-YBOYS5WI.js → chunk-YUII6AII.js} +1 -1
  57. package/Marketplace/{chunk-M4MZ4PBS.js → chunk-ZJQVUUVL.js} +1 -1
  58. package/Marketplace/index.html +2 -2
  59. package/Marketplace/{main-2KHAM5PJ.js → main-YQ364KRP.js} +1 -1
  60. package/Marketplace/{styles-U2EKFDJI.css → styles-Y32ZXHRJ.css} +1 -1
  61. package/package.json +1 -1
  62. package/Marketplace/chunk-OZAOB2RM.js +0 -1
  63. package/Marketplace/chunk-POHGR6GW.js +0 -5
  64. package/Marketplace/chunk-V3BUL62F.js +0 -1
  65. /package/Marketplace/{chunk-SDNS6DZW.js → chunk-K6D5ADDS.js} +0 -0
  66. /package/Marketplace/{chunk-NNG6BZAM.js → chunk-QMX3UB7H.js} +0 -0
  67. /package/Marketplace/{chunk-ODLFLX6Z.js → chunk-WTVDIONN.js} +0 -0
  68. /package/Marketplace/{polyfills-OPLU3AGL.js → polyfills-MG5POISX.js} +0 -0
@@ -1 +1 @@
1
- import{a as ze}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-SDNS6DZW.js";import{a as Ke,b as Ge,c as He}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-DG6KCZ24.js";import{a as N,b as fe,c as xe,d as ve,e as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-G7RXTLDR.js";import{a as Ce}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-Z24AOV6E.js";import{b as Je}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-B6BTNEL5.js";import{a as Ze,b as qe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-6C4L2S7S.js";import{a as de}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-ODLFLX6Z.js";import{a as q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-NNZ2QIAF.js";import{a as Z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-6ORTAB6O.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-V6IO53G5.js";import{a as Ae,b as je}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-GRHKW2KQ.js";import{a as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-UZO2VDKA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-TZRTEOJA.js";import{a as ke,b as Oe,d as $e,e as Le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-223SSA62.js";import{a as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-M4MZ4PBS.js";import{d as K,k as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-EJMJP3AQ.js";import{a as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2OVWEFCG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2HHCA3NK.js";import{B as Be,C as J,D as Ue,q as ue,r as Re,u as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-5VJQDJRJ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-DDXVCGNF.js";import{b as ce,c as se,h as M,k as F,m as pe,u as me,v as Fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-MFWCFDSI.js";import{c as z,e as _e,f as Ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-PHYOU4H6.js";import{$a as l,Aa as V,Ac as le,B as k,Fb as v,Ga as r,Gb as S,Ha as b,Hb as re,La as De,Ob as W,Q as te,Qa as s,Wa as d,X as O,_b as $,aa as ne,ab as c,ac as L,bb as P,bc as R,cb as y,db as w,ea as D,ec as B,fa as ie,fb as x,hc as U,ic as A,ja as _,jb as h,ka as g,lb as p,ob as ae,q as Y,qb as Q,rb as m,sb as E,tb as I,ub as oe,wb as Ee,wc as Me,yb as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2TS2HEE6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-NNG6BZAM.js";function mt(i,o){if(i&1){let t=x();l(0,"button",18),h("click",function(){_(t);let n=p().ngIf,a=p(2);return g(a.onUpdateItems(n))}),P(1,"i",19),m(2," Update "),c()}}function dt(i,o){if(i&1&&(l(0,"div"),d(1,mt,3,0,"button",17),c()),i&2){let t=o.ngIf,e=p(2);r(1),s("ngIf",e.productService.hasSelectionVariant(t))}}function _t(i,o){if(i&1){let t=x();l(0,"div",20)(1,"app-table",21),h("onToggle",function(n){_(t);let a=p(2);return g(a.onShowDifferencePrice(n))})("onSubmit",function(n){_(t);let a=p(2);return g(a.updatePriceByVariant(n))}),v(2,"async"),c()()}if(i&2){let t=p().ngIf,e=p();r(1),s("showProductToggle",!0)("data",S(2,4,e.paginationService.data$))("channel",e.channelOptions)("filter",t.Filter)}}function gt(i,o){if(i&1){let t=x();l(0,"span",22),h("click",function(){_(t);let n=p(2);return g(n.getRowCount())}),l(1,"i",23),m(2,"?"),c()()}}function ut(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t))}}function ht(i,o){if(i&1){let t=x();l(0,"a",24),h("click",function(){_(t);let n=p(2);return g(n.onNextPage())}),P(1,"i",25),m(2," Next"),c()}}function Ct(i,o){if(i&1){let t=x();l(0,"a",26),h("click",function(){_(t);let n=p(2);return g(n.onLastPage())}),P(1,"i",27),m(2," Last"),c()}}function ft(i,o){if(i&1){let t=x();l(0,"mainpanel",1),h("onSubmit",function(n){_(t);let a=p();return g(a.onSearch(n))}),l(1,"actions")(2,"div",2),d(3,dt,2,1,"div",3),v(4,"async"),c()(),l(5,"filters")(6,"div")(7,"label",4),m(8,"Page Number"),c(),l(9,"input",5),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.PageNumber=n)}),c()(),l(10,"div",6)(11,"label",4),m(12,"Page Size"),c(),l(13,"input",5),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.RowCount=n)}),c()()(),l(14,"content")(15,"div",7)(16,"div",8),d(17,_t,3,6,"div",9),v(18,"async"),c(),l(19,"div",10)(20,"div",11)(21,"div",12),m(22),v(23,"number"),v(24,"async"),d(25,gt,3,0,"span",13)(26,ut,3,3,"span",3),v(27,"async"),m(28),c()(),l(29,"div",14),d(30,ht,3,0,"a",15)(31,Ct,3,0,"a",16),c()()()()()}if(i&2){let t=p(),e;s("pageData",t.pageData)("textButton","Search"),r(3),s("ngIf",S(4,12,t.paginationService.data$)),r(6),s("ngModel",t.searchFilter.PageNumber),r(4),s("ngModel",t.searchFilter.RowCount),r(4),s("ngIf",S(18,14,t.paginationService.data$)),r(5),I(" Showing 1 - ",S(23,16,(e=S(24,18,t.paginationService.data$))==null?null:e.length)," of "),r(3),s("ngIf",t.paginationService.hideCount),r(1),s("ngIf",!t.paginationService.hideCount&&S(27,20,t.allDataCount$)),r(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),r(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}var it=(()=>{let o=class o{constructor(e,n,a,u,C,f){this.http=e,this.toastr=n,this.dialog=a,this.paginationService=u,this.productService=C,this.authService=f,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(O(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.paginationService.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updatePrice(e){let n=this.productService.selectedVariantProduct(e);if(n.length>0){let u=n.map(f=>({ID:f.ID,Code:f.Code,Price:f.UnitPrice}));var a=this.channelOptions.filter(f=>f.selected).map(f=>f.ID);let C={ListChannelID:a,ListPrice:u};this.http.post("/api/Price/UpdateChannel",C).subscribe(f=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+C.ListPrice.length+" items in "+C.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let n={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(a=>{let u=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+u.Name+" to "+n.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(e){let n=this.productService.selectedVariantProduct(e);this.dialog.open(Ce,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(k(a=>a!==void 0)).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}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:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(K),b(H),b(q),b(Z),b(G))},o.\u0275cmp=D({type:o,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"mt-5"],[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 border-start-0","title","Load all products",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(d(0,ft,32,22,"mainpanel",0),v(1,"async")),n&2&&s("ngIf",S(1,1,a.loader$))},dependencies:[R,se,pe,M,F,J,ve,B,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function xt(i,o){if(i&1&&(l(0,"mat-radio-button",3),m(1),c()),i&2){let t=o.$implicit,e=o.index,n=p();s("value",t.Key)("name",n.name)("title",n.tooltipsText[e]?n.tooltipsText[e]:""),r(1),I(" ",t.Value,"")}}var vt=i=>({"border-0 rounded":i}),Pe=(()=>{let o=class o{constructor(){this.modelChange=new De,this.border=!1,this.tooltipsText=[]}change(e){this.modelChange.emit(e)}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=D({type:o,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[Ee],decls:3,vars:5,consts:[[1,"form-control","h-100","rounded-1",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(n,a){n&1&&(l(0,"div",0)(1,"mat-radio-group",1),h("ngModelChange",function(C){return a.change(C)}),d(2,xt,2,4,"mat-radio-button",2),c()()),n&2&&(s("ngClass",T(3,vt,a.border==!1)),r(1),s("ngModel",a.model),r(1),s("ngForOf",a.options))},dependencies:[A,$,L,He,Ke,Ge,me,M,F],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});let i=o;return i})();function wt(i,o){if(i&1){let t=x();y(0),l(1,"div")(2,"label",23),m(3,"Filter by"),c(),l(4,"radio-options",24),h("modelChange",function(n){_(t);let a=p();return g(a.filterType=n)}),c()(),w()}if(i&2){let t=p();r(4),s("model",t.filterType)("options",t.filterTypeOptions)("border",!0)}}function Tt(i,o){if(i&1){let t=x();l(0,"button",27),h("click",function(){_(t);let n=p().ngIf,a=p();return g(a.onUpdateItems(n))}),P(1,"i",28),m(2," Update "),c()}}function Vt(i,o){if(i&1&&(y(0),l(1,"div",25),d(2,Tt,3,0,"button",26),c(),w()),i&2){let t=o.ngIf,e=p();r(2),s("ngIf",e.productService.hasSelectionVariant(t))}}function Dt(i,o){if(i&1&&(l(0,"th",29)(1,"div",30),P(2,"img",31),l(3,"div",32),m(4),v(5,"stringLimit"),c()()()),i&2){let t=o.$implicit;r(1),s("matTooltip",(t.Name==null?null:t.Name.length)>20?t.Name:""),r(1),s("src",t==null?null:t.Img,V),r(2),oe("",re(5,4,t.Name,20),"",(t.Name==null?null:t.Name.length)>20?"...":"","")}}function Et(i,o){if(i&1){let t=x();l(0,"th")(1,"input",33),h("ngModelChange",function(n){_(t);let a=p();return g(a.checkboxState=n)})("ngModelChange",function(){_(t);let n=p();return g(n.onSelectAllData())}),c()()}if(i&2){let t=p();r(1),s("ngModel",t.checkboxState)}}function Mt(i,o){i&1&&(y(0),l(1,"th",34)(2,"span"),m(3,"Expected"),c(),l(4,"span",35),m(5,"(POS)"),c()(),l(6,"th",34),m(7," Channel "),c(),w())}function Ft(i,o){if(i&1){let t=x();l(0,"img",48),h("click",function(n){_(t);let a=p(3).$implicit,u=p(2);return g(u.onZoomImage(n,a==null?null:a.ImageUrl))}),c()}if(i&2){let t=p(3).$implicit;ae("src",t==null?null:t.ImageUrl,V)}}function Nt(i,o){i&1&&P(0,"img",49)}var kt=i=>({"border-bottom":i});function Ot(i,o){if(i&1&&(y(0),l(1,"td",42),d(2,Ft,1,1,"img",43)(3,Nt,1,0,"ng-template",null,44,W),c(),l(5,"td",45)(6,"h5",46),m(7),c(),l(8,"small",47),m(9),c()(),w()),i&2){let t=Q(4),e=p().index,n=p().$implicit,a=p().ngIf;r(1),s("rowSpan",n==null?null:n.Variants.length)("ngClass",T(7,kt,e+1==a.length)),r(1),s("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),r(3),s("rowSpan",n==null?null:n.Variants.length),r(2),E(n==null?null:n.Name),r(2),I("(",n==null?null:n.Category,")")}}function $t(i,o){if(i&1){let t=x();l(0,"td",50)(1,"input",33),h("ngModelChange",function(n){_(t);let a=p().$implicit;return g(a.selected=n)}),c()()}if(i&2){let t=p().$implicit;r(1),s("ngModel",t.selected)}}var Lt=i=>({"bg-gradient-warning":i});function Rt(i,o){if(i&1){let t=x();y(0),l(1,"td",53),m(2),v(3,"number"),c(),l(4,"td",54),h("click",function(){let a=_(t).$implicit,u=p(2).$implicit,C=p().$implicit,f=p(2);return g(f.openTableDialog(u,C,a))}),l(5,"div",55)(6,"div",56),m(7),v(8,"number"),c(),l(9,"a",57),h("click",function(n){return n==null?null:n.stopPropagation()}),P(10,"i",41),c()()(),w()}if(i&2){let t=o.$implicit;r(2),I(" ",S(3,4,t.PriceExpected)," "),r(2),s("ngClass",T(8,Lt,t.Price!=t.PriceExpected)),r(3),I(" ",S(8,6,t.Price)," "),r(2),s("href",t.Url,V)}}function Bt(i,o){i&1&&(l(0,"td",58),m(1,"X"),c(),l(2,"td",58),m(3,"X"),c())}function Ut(i,o){if(i&1&&(y(0),d(1,Rt,11,10,"ng-container",51)(2,Bt,4,0,"ng-template",null,52,W),w()),i&2){let t=o.$implicit,e=Q(3),n=p().$implicit,a=p(3);r(1),s("ngIf",a.getItemFromChannel(n,t.ID))("ngIfElse",e)}}var At=i=>({"text-decoration-line-through":i}),at=i=>[i];function jt(i,o){if(i&1&&(l(0,"tr"),d(1,Ot,10,9,"ng-container",1),l(2,"td",36),m(3),c(),l(4,"td",37)(5,"div",38)(6,"div",39),m(7),c(),l(8,"div",32)(9,"a",40),P(10,"i",41),c()()()(),d(11,$t,2,1,"ng-template",14)(12,Ut,4,2,"ng-container",15),c()),i&2){let t=o.$implicit,e=o.index,n=p(3);r(1),s("ngIf",e==0),r(2),E(t==null?null:t.Model),r(1),s("matTooltip",t.isDiscontinued?n.discontinuedVariantMsg:""),r(2),s("ngClass",T(8,At,t.isDiscontinued)),r(1),I(" ",t==null?null:t.Code,""),r(2),s("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),V),r(2),s("ngxPermissionsOnly",T(10,at,n.rolePriceEdit)),r(1),s("ngForOf",n.channelOptions)}}function zt(i,o){if(i&1&&(l(0,"tbody"),d(1,jt,13,12,"tr",15),c()),i&2){let t=o.$implicit;r(1),s("ngForOf",t.Variants)}}function Kt(i,o){if(i&1&&(y(0),d(1,zt,2,1,"tbody",15),w()),i&2){let t=o.ngIf;r(1),s("ngForOf",t)}}function Gt(i,o){if(i&1){let t=x();l(0,"span",59),h("click",function(){_(t);let n=p();return g(n.getRowCount())}),l(1,"i",60),m(2,"?"),c()()}}function Ht(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t))}}function Jt(i,o){if(i&1){let t=x();l(0,"a",61),h("click",function(){_(t);let n=p();return g(n.onNextPage())}),P(1,"i",62),m(2," Next"),c()}}function Zt(i,o){if(i&1){let t=x();l(0,"a",63),h("click",function(){_(t);let n=p();return g(n.onLastPage())}),P(1,"i",64),m(2," Last"),c()}}var ot=(()=>{let o=class o{constructor(e,n,a,u,C,f,be){this.http=e,this.toastr=n,this.dialog=a,this.productService=u,this.authService=C,this.biggerPictureService=f,this.paginationService=be,this.searchFilter=new ze,this.checkboxState=!1,this.rolePriceEdit=de.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:N.ALL,Value:"All"},{Key:N.DIFFERENCE,Value:"Difference"}],this.filterType=N.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination()}initPagination(){this.paginationService.fetchDataEndpoint="Price/GetOutletPrice",this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.paginationService.data$.pipe(Y(e=>(e=e.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.isDiscontinued=a.Discontinued=="Yes",a))),n)),e)),te(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(O(e=>{this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{}).pipe(O(e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}))}getRowCount(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{})}onSelectAllData(){this.data$=this.data$.pipe(Y(e=>(e.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.selected=this.checkboxState,a))),n)),e)))}onFilter(e){let n={text:e,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.paginationService.reloadPagination(n)}updatePrice(e){let n=this.productService.selectedVariantProduct(e);if(n.length>0){let a=n.map(f=>f.ID),C={ListChannelID:this.channelOptions.filter(f=>f.selected).map(f=>f.ID),ListID:a};this.http.post("/api/Price/UpdateChannelOutletPrice",C).subscribe({next:f=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+C.ListID.length+" items in "+C.ListChannelID.length+" channels","Success")},error:f=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,n){return e.Channel.find(a=>a.ChannelID==n)}onUpdateItems(e){let n=this.productService.selectedVariantProduct(e);this.dialog.open(Ce,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(k(a=>z.IsNotEmpty(a))).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}openTableDialog(e,n,a){let u=JSON.parse(JSON.stringify(e));this.dialog.open(fe,{data:{Name:n.Name,Variant:u,ChannelID:a?.ChannelID,Table:"price",ChannelItemID:a?.ChannelItemID}}).afterClosed().pipe(k(f=>z.IsNotEmpty(f))).subscribe(f=>{this.updateProductPrice(f,a)})}updateProductPrice(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(u=>{n.Price=a.Price;let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${C.Name} to ${a.Price}`,"Success")})}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(K),b(H),b(Z),b(G),b(he),b(q))},o.\u0275cmp=D({type:o,selectors:[["app-custom-channel-price"]],decls:42,vars:30,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2","class","w-100","class","text-center border-bottom-0 border text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[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"],[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 border-start-0","title","Load all products",3,"click",4,"ngIf"],[1,"fw-bold","mb-2"],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"],[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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){if(n&1&&(l(0,"mainpanel",0),h("onSubmit",function(C){return a.onFilter(C)}),l(1,"filters"),d(2,wt,5,3,"ng-container",1),v(3,"async"),c(),l(4,"actions"),d(5,Vt,3,1,"ng-container",1),v(6,"async"),c(),l(7,"content")(8,"div",2)(9,"div",3)(10,"div",4)(11,"div",5)(12,"table",6)(13,"thead",7)(14,"tr",8),P(15,"th",9),d(16,Dt,6,7,"th",10),c(),l(17,"tr")(18,"th",11)(19,"span"),m(20," Product "),c()(),l(21,"th",12),m(22,"Variant"),c(),l(23,"th",13),m(24,"SKU"),c(),d(25,Et,2,1,"ng-template",14)(26,Mt,8,0,"ng-container",15),c()(),d(27,Kt,2,1,"ng-container",1),v(28,"async"),c()()()(),l(29,"div",16)(30,"div",17)(31,"div",18),m(32),v(33,"number"),v(34,"async"),d(35,Gt,3,0,"span",19)(36,Ht,3,3,"span",1),v(37,"async"),m(38),c()(),l(39,"div",20),d(40,Jt,3,0,"a",21)(41,Zt,3,0,"a",22),c()()()()()),n&2){let u;s("pageData",a.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",S(3,16,a.loader$)),r(3),s("ngIf",S(6,18,a.data$)),r(11),s("ngForOf",a.channelOptions),r(9),s("ngxPermissionsOnly",T(28,at,a.rolePriceEdit)),r(1),s("ngForOf",a.channelOptions),r(1),s("ngIf",S(28,20,a.data$)),r(5),I(" Showing 1 - ",S(33,22,(u=S(34,24,a.paginationService.data$))==null?null:u.length)," of "),r(3),s("ngIf",a.paginationService.hideCount),r(1),s("ngIf",!a.paginationService.hideCount&&S(37,26,a.totalData$)),r(2),I(" records ~ ",a.paginationService.footerPageNumber," Page "),r(2),s("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage),r(1),s("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage)}},dependencies:[$,L,R,ce,M,F,J,ue,Pe,_e,B,U,xe],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}"]});let i=o;return i})();function qt(i,o){if(i&1&&(l(0,"span",9),P(1,"img",10),c(),m(2)),i&2){let t=o.item;r(1),s("src",t==null?null:t.Img,V),r(1),I(" ",t.Name," ")}}function Xt(i,o){if(i&1){let t=x();l(0,"button",13),h("click",function(){_(t);let n=p().ngIf,a=p(2);return g(a.updateStock(n))}),P(1,"i",14),m(2," Update "),c()}}function Yt(i,o){if(i&1&&(l(0,"actions")(1,"div",11),d(2,Xt,3,0,"button",12),c()()),i&2){let t=o.ngIf,e=p(2);r(2),s("ngIf",e.productService.hasSelectionVariant(t))}}function Qt(i,o){if(i&1){let t=x();l(0,"th")(1,"input",34),h("change",function(n){_(t);let a=p().ngIf,u=p(2);return g(u.onSelectAllSKU(n.target.checked,a))}),c()()}}function Wt(i,o){if(i&1){let t=x();l(0,"input",52),h("ngModelChange",function(n){_(t);let a=p(4).$implicit;return g(a.selected=n)})("ngModelChange",function(){_(t);let n=p(4).$implicit,a=p(3);return g(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=p(4).$implicit;s("ngModel",t.selected)}}var Te=i=>[i];function en(i,o){if(i&1&&(y(0),d(1,Wt,1,1,"ng-template",23),w()),i&2){let t=p(6);r(1),s("ngxPermissionsOnly",T(1,Te,t.rolePriceEdit))}}function tn(i,o){if(i&1){let t=x();y(0),l(1,"img",53),h("click",function(n){_(t);let a=p(3).$implicit,u=p(3);return g(u.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),w()}if(i&2){let t=p(3).$implicit;r(1),ae("src",t.ThumbnailUrl,V)}}function nn(i,o){i&1&&P(0,"img",54)}function an(i,o){if(i&1&&(y(0),P(1,"br"),l(2,"small"),m(3),c(),w()),i&2){let t=p(3).$implicit;r(3),I("(",t.Category,")")}}var on=i=>({"ms-10":i});function rn(i,o){if(i&1&&(y(0),l(1,"td",46)(2,"div",47),d(3,en,2,3,"ng-container",8),l(4,"div",36),d(5,tn,2,1,"ng-container",48)(6,nn,1,0,"ng-template",null,49,W),c()()(),l(8,"td",50)(9,"span",51),m(10),c(),d(11,an,4,1,"ng-container",8),c(),w()),i&2){let t=Q(7),e=p(2).$implicit,n=p(3);r(1),s("rowSpan",e.Variants.length),r(2),s("ngIf",(e.Variants==null?null:e.Variants.length)>1),r(1),s("ngClass",T(8,on,(e.Variants==null?null:e.Variants.length)<=1)),r(1),s("ngIf",e.ThumbnailUrl)("ngIfElse",t),r(3),s("rowSpan",e.Variants.length),r(2),E(e.Name),r(1),s("ngIf",(e==null?null:e.CategoryID)!==null&&(e==null?null:e.CategoryID)!=n.guidEmpty)}}function ln(i,o){if(i&1){let t=x();l(0,"input",57),h("ngModelChange",function(n){_(t);let a=p(2).$implicit;return g(a.selected=n)}),c()}if(i&2){let t=p(2).$implicit;s("ngModel",t.selected)}}function cn(i,o){if(i&1&&(l(0,"td",55),d(1,ln,1,1,"input",56),c()),i&2){let t=p().$implicit;r(1),s("ngIf",t.Inventory>=0)}}function sn(i,o){i&1&&(l(0,"div",58),m(1,"Not Found"),c())}function pn(i,o){if(i&1&&(l(0,"div"),m(1),v(2,"number"),c()),i&2){let t=p().$implicit;r(1),I(" ",S(2,1,t.UnitPrice),"")}}function mn(i,o){if(i&1&&(y(0),l(1,"div",41)(2,"a",42),P(3,"i",59),c()(),w()),i&2){let t=p().$implicit,e=p(4);r(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),V)}}function dn(i,o){if(i&1){let t=x();l(0,"div",60),h("click",function(){_(t);let n=p().$implicit,a=p().$implicit,u=p(2).ngIf,C=p();return g(C.openTableDialog(n,a,u))}),m(1),v(2,"number"),c()}if(i&2){let t=p().$implicit;r(1),I(" ",S(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}var _n=i=>({"text-decoration-line-through":i}),gn=i=>({"bg-gradient-warning":i});function un(i,o){if(i&1){let t=x();l(0,"tr"),d(1,rn,12,10,"ng-container",8),l(2,"td",21),m(3),c(),l(4,"td",35)(5,"span",36),m(6),c()(),d(7,cn,2,1,"ng-template",23),l(8,"td",24)(9,"div",37),d(10,sn,2,0,"div",38)(11,pn,3,3,"div",8)(12,mn,4,1,"ng-container",8),c()(),l(13,"td",39)(14,"div",37),d(15,dn,3,3,"div",40),l(16,"div",41)(17,"a",42),P(18,"i",43),c()(),l(19,"div",41)(20,"div",44),h("click",function(){let a=_(t).$implicit,u=p(4);return g(u.refreshPrice(a))}),P(21,"i",45),c()()()()()}if(i&2){let t=o.$implicit,e=o.index,n=p(4);r(1),s("ngIf",e==0),r(2),E(t.Model),r(1),s("matTooltip",t.isDiscontinued?n.discontinuedVariantMsg:""),r(1),s("ngClass",T(12,_n,t.isDiscontinued)),r(1),I(" ",t.Code," "),r(1),s("ngxPermissionsOnly",T(14,Te,n.rolePriceEdit)),r(3),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)!=null),r(1),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)==null),r(1),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)==null),r(1),s("ngClass",T(16,gn,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),r(2),s("ngIf",t.Channel.length>0),r(2),s("href",t.Channel[0]==null?null:t.Channel[0].Url,V)}}function hn(i,o){if(i&1&&(y(0),d(1,un,22,18,"tr",28),w()),i&2){let t=o.$implicit;r(1),s("ngForOf",t.Variants)}}function Cn(i,o){if(i&1){let t=x();l(0,"span",60),h("click",function(){_(t);let n=p(3);return g(n.getRowCount())}),l(1,"i",61),m(2,"?"),c()()}}function fn(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t.Total))}}function xn(i,o){if(i&1){let t=x();l(0,"a",65),h("click",function(){_(t);let n=p(4);return g(n.onNextPage())}),P(1,"i",66),m(2," Next"),c()}}function vn(i,o){if(i&1){let t=x();l(0,"a",67),h("click",function(){_(t);let n=p(4);return g(n.onLastPage())}),P(1,"i",68),m(2," Last"),c()}}function Sn(i,o){if(i&1&&(l(0,"div",62),d(1,xn,3,0,"a",63)(2,vn,3,0,"a",64),c()),i&2){let t=p(3);r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Pn(i,o){if(i&1){let t=x();l(0,"content")(1,"div",15)(2,"div",16)(3,"table",17)(4,"thead",18)(5,"tr")(6,"th",19),m(7," Product "),l(8,"div")(9,"mat-slide-toggle",20),h("ngModelChange",function(n){_(t);let a=p(2);return g(a.toggleDifferentInventory=n)})("toggleChange",function(){_(t);let n=p(2);return g(n.onToggleDifferentInventory())}),l(10,"small",6),m(11,"FILTER DIFFERENT PRICE"),c()()()(),l(12,"th",21),m(13,"Variant"),c(),l(14,"th",22),m(15,"SKU"),c(),d(16,Qt,2,0,"ng-template",23),l(17,"th",24),m(18,"POS"),c(),l(19,"th",24)(20,"div",25),h("click",function(){_(t);let n=p(2);return g(n.openModalFilter())}),P(21,"img",26),l(22,"span",27),m(23),v(24,"stringLimit"),c()()()()(),l(25,"tbody"),d(26,hn,2,1,"ng-container",28),c()(),l(27,"div",29)(28,"div",30)(29,"div",31),m(30),v(31,"number"),d(32,Cn,3,0,"span",32)(33,fn,3,3,"span",8),v(34,"async"),m(35),c()(),d(36,Sn,3,2,"div",33),c()()()()}if(i&2){let t=o.ngIf,e=p(2);r(9),s("ngModel",e.toggleDifferentInventory),r(7),s("ngxPermissionsOnly",T(19,Te,e.rolePriceEdit)),r(4),s("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),r(1),s("src",e.selectedChannel==null?null:e.selectedChannel.Img,V),r(2),oe(" ",re(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),r(3),s("ngForOf",t),r(4),I(" Showing 1 - ",S(31,15,t==null?null:t.length)," of "),r(2),s("ngIf",e.paginationService.hideCount),r(1),s("ngIf",S(34,17,!e.paginationService.hideCount&&e.allDataCount$)),r(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),r(1),s("ngIf",t.length>0)}}function bn(i,o){if(i&1){let t=x();l(0,"mainpanel",1),h("textChange",function(n){_(t);let a=p();return g(a.searchFilter.text=n)})("onSubmit",function(){_(t);let n=p();return g(n.onSearch())}),l(1,"filters")(2,"div")(3,"label",2),m(4,"Channel"),c(),l(5,"ng-select",3),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.ChannelID=n)}),d(6,qt,3,2,"ng-template",4),c()(),l(7,"div",5)(8,"label",6),m(9,"Page Number"),c(),l(10,"input",7),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.PageNumber=n)}),c()(),l(11,"div",5)(12,"label",6),m(13,"Page Size"),c(),l(14,"input",7),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.RowCount=n)}),c()()(),d(15,Yt,3,1,"actions",8),v(16,"async"),d(17,Pn,37,21,"content",8),v(18,"async"),c()}if(i&2){let t=p();s("headerTitle",t.pageTitle)("text",t.searchFilter.text),r(5),s("clearable",!1)("items",t.channelOptions)("ngModel",t.searchFilter.ChannelID),r(5),s("ngModel",t.searchFilter.PageNumber),r(4),s("ngModel",t.searchFilter.RowCount),r(1),s("ngIf",S(16,9,t.data$)),r(2),s("ngIf",S(18,11,t.data$))}}var rt=(()=>{let o=class o{constructor(e,n,a,u,C,f,be,Ve,st){this.http=e,this.paginationService=n,this.toastr=a,this.dialog=u,this.productService=C,this.biggerPictureService=f,this.inventoryService=be,this.authService=Ve,this.mainPanelService=st,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=de.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=z.GuidEMpty,this.hostName=this.authService.getDomain(),this.data$=this.paginationService.data$.pipe(te(1),Y(pt=>pt.map(ee=>(ee.Variants&&(ee.Variants=ee.Variants.map(Ie=>(Ie.isDiscontinued=Ie.Discontinued=="Yes",Ie))),ee)))),this.channelOptions=Ve.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(O(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=N.ALL,this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=N.ALL:this.searchFilter.filterModel=N.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),u={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",u).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}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:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e.Total)}})}openTableDialog(e,n,a){let u=JSON.parse(JSON.stringify(e));this.dialog.open(fe,{data:{Name:n.Name,Variant:u,ChannelID:u?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:u?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(k(f=>z.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(u=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${C.Name} to ${a.Price}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(u=>(u.selected=e,u)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(q),b(K),b(H),b(Z),b(he),b(Se),b(G),b(Be))},o.\u0275cmp=D({type:o,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[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,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"ms-1"],[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","checkbox",1,"me-3",3,"change"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[3,"ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"fas","external-link-custom","fa-external-link-alt"],[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 border-start-0","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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(d(0,bn,19,13,"mainpanel",0),v(1,"async")),n&2&&s("ngIf",S(1,1,a.loader$))},dependencies:[$,L,R,se,pe,ce,M,F,J,$e,ke,Oe,Ze,ue,_e,B,U,xe],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]});let i=o;return i})();var lt=(()=>{let o=class o{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=D({type:o,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(l(0,"nav",0)(1,"div",1)(2,"div"),P(3,"nav-tab",2),c()()(),P(4,"router-outlet")),n&2&&(r(3),s("Tabs",a.priceTabs))},dependencies:[Ae,Me]});let i=o;return i})();var In=[{path:"",component:lt,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:it,canActivate:[ge],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:ot,canActivate:[ge],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:rt,canActivate:[ge],data:{title:"Price Single Channel Comparison"}}]}],ct=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=ie({type:o}),o.\u0275inj=ne({imports:[A,le.forChild(In)]});let i=o;return i})();var $i=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=ie({type:o}),o.\u0275inj=ne({providers:[Se],imports:[A,me,je,Ue,le,Le,ct,Fe,qe,Je,Re,Pe,ve,Ne.forChild()]});let i=o;return i})();export{$i as PriceModule};
1
+ import{a as ze}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-K6D5ADDS.js";import{a as Ke,b as Ge,c as He}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-4L6TZC4Q.js";import{a as N,b as fe,c as xe,d as ve,e as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-SX547BDR.js";import{a as Ce}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-MPPVCPW6.js";import{b as Je}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-6F5PLBQH.js";import{a as Ze,b as qe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-2CCOAUJC.js";import{a as de}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-WTVDIONN.js";import{a as q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-BCUSOEWI.js";import{a as Z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-2E7TANNT.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-FP2EY4DY.js";import{a as Ae,b as je}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-4BX3EUMQ.js";import{a as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-A6KWQYQ4.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-4276ECDR.js";import{a as ke,b as Oe,d as $e,e as Le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-TYL25LTY.js";import{a as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-ZJQVUUVL.js";import{d as K,k as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-FWBPK3JW.js";import{a as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-E3GZ25PR.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-MXRTBC2I.js";import{B as Be,C as J,D as Ue,q as ue,r as Re,u as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-NLIQ2J6A.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-LMYBWQKO.js";import{b as ce,c as se,h as M,k as F,m as pe,u as me,v as Fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-FUC2SF5Q.js";import{c as z,e as _e,f as Ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-4RHNT4DZ.js";import{$a as l,Aa as V,Ac as le,B as k,Fb as v,Ga as r,Gb as S,Ha as b,Hb as re,La as De,Ob as W,Q as te,Qa as s,Wa as d,X as O,_b as $,aa as ne,ab as c,ac as L,bb as P,bc as R,cb as y,db as w,ea as D,ec as B,fa as ie,fb as x,hc as U,ic as A,ja as _,jb as h,ka as g,lb as p,ob as ae,q as Y,qb as Q,rb as m,sb as E,tb as I,ub as oe,wb as Ee,wc as Me,yb as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-YNZUWVLD.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-QMX3UB7H.js";function mt(i,o){if(i&1){let t=x();l(0,"button",18),h("click",function(){_(t);let n=p().ngIf,a=p(2);return g(a.onUpdateItems(n))}),P(1,"i",19),m(2," Update "),c()}}function dt(i,o){if(i&1&&(l(0,"div"),d(1,mt,3,0,"button",17),c()),i&2){let t=o.ngIf,e=p(2);r(1),s("ngIf",e.productService.hasSelectionVariant(t))}}function _t(i,o){if(i&1){let t=x();l(0,"div",20)(1,"app-table",21),h("onToggle",function(n){_(t);let a=p(2);return g(a.onShowDifferencePrice(n))})("onSubmit",function(n){_(t);let a=p(2);return g(a.updatePriceByVariant(n))}),v(2,"async"),c()()}if(i&2){let t=p().ngIf,e=p();r(1),s("showProductToggle",!0)("data",S(2,4,e.paginationService.data$))("channel",e.channelOptions)("filter",t.Filter)}}function gt(i,o){if(i&1){let t=x();l(0,"span",22),h("click",function(){_(t);let n=p(2);return g(n.getRowCount())}),l(1,"i",23),m(2,"?"),c()()}}function ut(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t))}}function ht(i,o){if(i&1){let t=x();l(0,"a",24),h("click",function(){_(t);let n=p(2);return g(n.onNextPage())}),P(1,"i",25),m(2," Next"),c()}}function Ct(i,o){if(i&1){let t=x();l(0,"a",26),h("click",function(){_(t);let n=p(2);return g(n.onLastPage())}),P(1,"i",27),m(2," Last"),c()}}function ft(i,o){if(i&1){let t=x();l(0,"mainpanel",1),h("onSubmit",function(n){_(t);let a=p();return g(a.onSearch(n))}),l(1,"actions")(2,"div",2),d(3,dt,2,1,"div",3),v(4,"async"),c()(),l(5,"filters")(6,"div")(7,"label",4),m(8,"Page Number"),c(),l(9,"input",5),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.PageNumber=n)}),c()(),l(10,"div",6)(11,"label",4),m(12,"Page Size"),c(),l(13,"input",5),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.RowCount=n)}),c()()(),l(14,"content")(15,"div",7)(16,"div",8),d(17,_t,3,6,"div",9),v(18,"async"),c(),l(19,"div",10)(20,"div",11)(21,"div",12),m(22),v(23,"number"),v(24,"async"),d(25,gt,3,0,"span",13)(26,ut,3,3,"span",3),v(27,"async"),m(28),c()(),l(29,"div",14),d(30,ht,3,0,"a",15)(31,Ct,3,0,"a",16),c()()()()()}if(i&2){let t=p(),e;s("pageData",t.pageData)("textButton","Search"),r(3),s("ngIf",S(4,12,t.paginationService.data$)),r(6),s("ngModel",t.searchFilter.PageNumber),r(4),s("ngModel",t.searchFilter.RowCount),r(4),s("ngIf",S(18,14,t.paginationService.data$)),r(5),I(" Showing 1 - ",S(23,16,(e=S(24,18,t.paginationService.data$))==null?null:e.length)," of "),r(3),s("ngIf",t.paginationService.hideCount),r(1),s("ngIf",!t.paginationService.hideCount&&S(27,20,t.allDataCount$)),r(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),r(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}var it=(()=>{let o=class o{constructor(e,n,a,u,C,f){this.http=e,this.toastr=n,this.dialog=a,this.paginationService=u,this.productService=C,this.authService=f,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(O(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.paginationService.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updatePrice(e){let n=this.productService.selectedVariantProduct(e);if(n.length>0){let u=n.map(f=>({ID:f.ID,Code:f.Code,Price:f.UnitPrice}));var a=this.channelOptions.filter(f=>f.selected).map(f=>f.ID);let C={ListChannelID:a,ListPrice:u};this.http.post("/api/Price/UpdateChannel",C).subscribe(f=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+C.ListPrice.length+" items in "+C.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let n={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(a=>{let u=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+u.Name+" to "+n.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(e){let n=this.productService.selectedVariantProduct(e);this.dialog.open(Ce,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(k(a=>a!==void 0)).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}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:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(K),b(H),b(q),b(Z),b(G))},o.\u0275cmp=D({type:o,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"mt-5"],[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 border-start-0","title","Load all products",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(d(0,ft,32,22,"mainpanel",0),v(1,"async")),n&2&&s("ngIf",S(1,1,a.loader$))},dependencies:[R,se,pe,M,F,J,ve,B,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function xt(i,o){if(i&1&&(l(0,"mat-radio-button",3),m(1),c()),i&2){let t=o.$implicit,e=o.index,n=p();s("value",t.Key)("name",n.name)("title",n.tooltipsText[e]?n.tooltipsText[e]:""),r(1),I(" ",t.Value,"")}}var vt=i=>({"border-0 rounded":i}),Pe=(()=>{let o=class o{constructor(){this.modelChange=new De,this.border=!1,this.tooltipsText=[]}change(e){this.modelChange.emit(e)}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=D({type:o,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[Ee],decls:3,vars:5,consts:[[1,"form-control","h-100","rounded-1",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(n,a){n&1&&(l(0,"div",0)(1,"mat-radio-group",1),h("ngModelChange",function(C){return a.change(C)}),d(2,xt,2,4,"mat-radio-button",2),c()()),n&2&&(s("ngClass",T(3,vt,a.border==!1)),r(1),s("ngModel",a.model),r(1),s("ngForOf",a.options))},dependencies:[A,$,L,He,Ke,Ge,me,M,F],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});let i=o;return i})();function wt(i,o){if(i&1){let t=x();y(0),l(1,"div")(2,"label",23),m(3,"Filter by"),c(),l(4,"radio-options",24),h("modelChange",function(n){_(t);let a=p();return g(a.filterType=n)}),c()(),w()}if(i&2){let t=p();r(4),s("model",t.filterType)("options",t.filterTypeOptions)("border",!0)}}function Tt(i,o){if(i&1){let t=x();l(0,"button",27),h("click",function(){_(t);let n=p().ngIf,a=p();return g(a.onUpdateItems(n))}),P(1,"i",28),m(2," Update "),c()}}function Vt(i,o){if(i&1&&(y(0),l(1,"div",25),d(2,Tt,3,0,"button",26),c(),w()),i&2){let t=o.ngIf,e=p();r(2),s("ngIf",e.productService.hasSelectionVariant(t))}}function Dt(i,o){if(i&1&&(l(0,"th",29)(1,"div",30),P(2,"img",31),l(3,"div",32),m(4),v(5,"stringLimit"),c()()()),i&2){let t=o.$implicit;r(1),s("matTooltip",(t.Name==null?null:t.Name.length)>20?t.Name:""),r(1),s("src",t==null?null:t.Img,V),r(2),oe("",re(5,4,t.Name,20),"",(t.Name==null?null:t.Name.length)>20?"...":"","")}}function Et(i,o){if(i&1){let t=x();l(0,"th")(1,"input",33),h("ngModelChange",function(n){_(t);let a=p();return g(a.checkboxState=n)})("ngModelChange",function(){_(t);let n=p();return g(n.onSelectAllData())}),c()()}if(i&2){let t=p();r(1),s("ngModel",t.checkboxState)}}function Mt(i,o){i&1&&(y(0),l(1,"th",34)(2,"span"),m(3,"Expected"),c(),l(4,"span",35),m(5,"(POS)"),c()(),l(6,"th",34),m(7," Channel "),c(),w())}function Ft(i,o){if(i&1){let t=x();l(0,"img",48),h("click",function(n){_(t);let a=p(3).$implicit,u=p(2);return g(u.onZoomImage(n,a==null?null:a.ImageUrl))}),c()}if(i&2){let t=p(3).$implicit;ae("src",t==null?null:t.ImageUrl,V)}}function Nt(i,o){i&1&&P(0,"img",49)}var kt=i=>({"border-bottom":i});function Ot(i,o){if(i&1&&(y(0),l(1,"td",42),d(2,Ft,1,1,"img",43)(3,Nt,1,0,"ng-template",null,44,W),c(),l(5,"td",45)(6,"h5",46),m(7),c(),l(8,"small",47),m(9),c()(),w()),i&2){let t=Q(4),e=p().index,n=p().$implicit,a=p().ngIf;r(1),s("rowSpan",n==null?null:n.Variants.length)("ngClass",T(7,kt,e+1==a.length)),r(1),s("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),r(3),s("rowSpan",n==null?null:n.Variants.length),r(2),E(n==null?null:n.Name),r(2),I("(",n==null?null:n.Category,")")}}function $t(i,o){if(i&1){let t=x();l(0,"td",50)(1,"input",33),h("ngModelChange",function(n){_(t);let a=p().$implicit;return g(a.selected=n)}),c()()}if(i&2){let t=p().$implicit;r(1),s("ngModel",t.selected)}}var Lt=i=>({"bg-gradient-warning":i});function Rt(i,o){if(i&1){let t=x();y(0),l(1,"td",53),m(2),v(3,"number"),c(),l(4,"td",54),h("click",function(){let a=_(t).$implicit,u=p(2).$implicit,C=p().$implicit,f=p(2);return g(f.openTableDialog(u,C,a))}),l(5,"div",55)(6,"div",56),m(7),v(8,"number"),c(),l(9,"a",57),h("click",function(n){return n==null?null:n.stopPropagation()}),P(10,"i",41),c()()(),w()}if(i&2){let t=o.$implicit;r(2),I(" ",S(3,4,t.PriceExpected)," "),r(2),s("ngClass",T(8,Lt,t.Price!=t.PriceExpected)),r(3),I(" ",S(8,6,t.Price)," "),r(2),s("href",t.Url,V)}}function Bt(i,o){i&1&&(l(0,"td",58),m(1,"X"),c(),l(2,"td",58),m(3,"X"),c())}function Ut(i,o){if(i&1&&(y(0),d(1,Rt,11,10,"ng-container",51)(2,Bt,4,0,"ng-template",null,52,W),w()),i&2){let t=o.$implicit,e=Q(3),n=p().$implicit,a=p(3);r(1),s("ngIf",a.getItemFromChannel(n,t.ID))("ngIfElse",e)}}var At=i=>({"text-decoration-line-through":i}),at=i=>[i];function jt(i,o){if(i&1&&(l(0,"tr"),d(1,Ot,10,9,"ng-container",1),l(2,"td",36),m(3),c(),l(4,"td",37)(5,"div",38)(6,"div",39),m(7),c(),l(8,"div",32)(9,"a",40),P(10,"i",41),c()()()(),d(11,$t,2,1,"ng-template",14)(12,Ut,4,2,"ng-container",15),c()),i&2){let t=o.$implicit,e=o.index,n=p(3);r(1),s("ngIf",e==0),r(2),E(t==null?null:t.Model),r(1),s("matTooltip",t.isDiscontinued?n.discontinuedVariantMsg:""),r(2),s("ngClass",T(8,At,t.isDiscontinued)),r(1),I(" ",t==null?null:t.Code,""),r(2),s("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),V),r(2),s("ngxPermissionsOnly",T(10,at,n.rolePriceEdit)),r(1),s("ngForOf",n.channelOptions)}}function zt(i,o){if(i&1&&(l(0,"tbody"),d(1,jt,13,12,"tr",15),c()),i&2){let t=o.$implicit;r(1),s("ngForOf",t.Variants)}}function Kt(i,o){if(i&1&&(y(0),d(1,zt,2,1,"tbody",15),w()),i&2){let t=o.ngIf;r(1),s("ngForOf",t)}}function Gt(i,o){if(i&1){let t=x();l(0,"span",59),h("click",function(){_(t);let n=p();return g(n.getRowCount())}),l(1,"i",60),m(2,"?"),c()()}}function Ht(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t))}}function Jt(i,o){if(i&1){let t=x();l(0,"a",61),h("click",function(){_(t);let n=p();return g(n.onNextPage())}),P(1,"i",62),m(2," Next"),c()}}function Zt(i,o){if(i&1){let t=x();l(0,"a",63),h("click",function(){_(t);let n=p();return g(n.onLastPage())}),P(1,"i",64),m(2," Last"),c()}}var ot=(()=>{let o=class o{constructor(e,n,a,u,C,f,be){this.http=e,this.toastr=n,this.dialog=a,this.productService=u,this.authService=C,this.biggerPictureService=f,this.paginationService=be,this.searchFilter=new ze,this.checkboxState=!1,this.rolePriceEdit=de.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:N.ALL,Value:"All"},{Key:N.DIFFERENCE,Value:"Difference"}],this.filterType=N.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination()}initPagination(){this.paginationService.fetchDataEndpoint="Price/GetOutletPrice",this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.paginationService.data$.pipe(Y(e=>(e=e.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.isDiscontinued=a.Discontinued=="Yes",a))),n)),e)),te(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(O(e=>{this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{}).pipe(O(e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}))}getRowCount(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{})}onSelectAllData(){this.data$=this.data$.pipe(Y(e=>(e.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.selected=this.checkboxState,a))),n)),e)))}onFilter(e){let n={text:e,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.paginationService.reloadPagination(n)}updatePrice(e){let n=this.productService.selectedVariantProduct(e);if(n.length>0){let a=n.map(f=>f.ID),C={ListChannelID:this.channelOptions.filter(f=>f.selected).map(f=>f.ID),ListID:a};this.http.post("/api/Price/UpdateChannelOutletPrice",C).subscribe({next:f=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+C.ListID.length+" items in "+C.ListChannelID.length+" channels","Success")},error:f=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,n){return e.Channel.find(a=>a.ChannelID==n)}onUpdateItems(e){let n=this.productService.selectedVariantProduct(e);this.dialog.open(Ce,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(k(a=>z.IsNotEmpty(a))).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}openTableDialog(e,n,a){let u=JSON.parse(JSON.stringify(e));this.dialog.open(fe,{data:{Name:n.Name,Variant:u,ChannelID:a?.ChannelID,Table:"price",ChannelItemID:a?.ChannelItemID}}).afterClosed().pipe(k(f=>z.IsNotEmpty(f))).subscribe(f=>{this.updateProductPrice(f,a)})}updateProductPrice(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(u=>{n.Price=a.Price;let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${C.Name} to ${a.Price}`,"Success")})}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(K),b(H),b(Z),b(G),b(he),b(q))},o.\u0275cmp=D({type:o,selectors:[["app-custom-channel-price"]],decls:42,vars:30,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2","class","w-100","class","text-center border-bottom-0 border text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[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"],[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 border-start-0","title","Load all products",3,"click",4,"ngIf"],[1,"fw-bold","mb-2"],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"],[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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){if(n&1&&(l(0,"mainpanel",0),h("onSubmit",function(C){return a.onFilter(C)}),l(1,"filters"),d(2,wt,5,3,"ng-container",1),v(3,"async"),c(),l(4,"actions"),d(5,Vt,3,1,"ng-container",1),v(6,"async"),c(),l(7,"content")(8,"div",2)(9,"div",3)(10,"div",4)(11,"div",5)(12,"table",6)(13,"thead",7)(14,"tr",8),P(15,"th",9),d(16,Dt,6,7,"th",10),c(),l(17,"tr")(18,"th",11)(19,"span"),m(20," Product "),c()(),l(21,"th",12),m(22,"Variant"),c(),l(23,"th",13),m(24,"SKU"),c(),d(25,Et,2,1,"ng-template",14)(26,Mt,8,0,"ng-container",15),c()(),d(27,Kt,2,1,"ng-container",1),v(28,"async"),c()()()(),l(29,"div",16)(30,"div",17)(31,"div",18),m(32),v(33,"number"),v(34,"async"),d(35,Gt,3,0,"span",19)(36,Ht,3,3,"span",1),v(37,"async"),m(38),c()(),l(39,"div",20),d(40,Jt,3,0,"a",21)(41,Zt,3,0,"a",22),c()()()()()),n&2){let u;s("pageData",a.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",S(3,16,a.loader$)),r(3),s("ngIf",S(6,18,a.data$)),r(11),s("ngForOf",a.channelOptions),r(9),s("ngxPermissionsOnly",T(28,at,a.rolePriceEdit)),r(1),s("ngForOf",a.channelOptions),r(1),s("ngIf",S(28,20,a.data$)),r(5),I(" Showing 1 - ",S(33,22,(u=S(34,24,a.paginationService.data$))==null?null:u.length)," of "),r(3),s("ngIf",a.paginationService.hideCount),r(1),s("ngIf",!a.paginationService.hideCount&&S(37,26,a.totalData$)),r(2),I(" records ~ ",a.paginationService.footerPageNumber," Page "),r(2),s("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage),r(1),s("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage)}},dependencies:[$,L,R,ce,M,F,J,ue,Pe,_e,B,U,xe],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}"]});let i=o;return i})();function qt(i,o){if(i&1&&(l(0,"span",9),P(1,"img",10),c(),m(2)),i&2){let t=o.item;r(1),s("src",t==null?null:t.Img,V),r(1),I(" ",t.Name," ")}}function Xt(i,o){if(i&1){let t=x();l(0,"button",13),h("click",function(){_(t);let n=p().ngIf,a=p(2);return g(a.updateStock(n))}),P(1,"i",14),m(2," Update "),c()}}function Yt(i,o){if(i&1&&(l(0,"actions")(1,"div",11),d(2,Xt,3,0,"button",12),c()()),i&2){let t=o.ngIf,e=p(2);r(2),s("ngIf",e.productService.hasSelectionVariant(t))}}function Qt(i,o){if(i&1){let t=x();l(0,"th")(1,"input",34),h("change",function(n){_(t);let a=p().ngIf,u=p(2);return g(u.onSelectAllSKU(n.target.checked,a))}),c()()}}function Wt(i,o){if(i&1){let t=x();l(0,"input",52),h("ngModelChange",function(n){_(t);let a=p(4).$implicit;return g(a.selected=n)})("ngModelChange",function(){_(t);let n=p(4).$implicit,a=p(3);return g(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=p(4).$implicit;s("ngModel",t.selected)}}var Te=i=>[i];function en(i,o){if(i&1&&(y(0),d(1,Wt,1,1,"ng-template",23),w()),i&2){let t=p(6);r(1),s("ngxPermissionsOnly",T(1,Te,t.rolePriceEdit))}}function tn(i,o){if(i&1){let t=x();y(0),l(1,"img",53),h("click",function(n){_(t);let a=p(3).$implicit,u=p(3);return g(u.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),w()}if(i&2){let t=p(3).$implicit;r(1),ae("src",t.ThumbnailUrl,V)}}function nn(i,o){i&1&&P(0,"img",54)}function an(i,o){if(i&1&&(y(0),P(1,"br"),l(2,"small"),m(3),c(),w()),i&2){let t=p(3).$implicit;r(3),I("(",t.Category,")")}}var on=i=>({"ms-10":i});function rn(i,o){if(i&1&&(y(0),l(1,"td",46)(2,"div",47),d(3,en,2,3,"ng-container",8),l(4,"div",36),d(5,tn,2,1,"ng-container",48)(6,nn,1,0,"ng-template",null,49,W),c()()(),l(8,"td",50)(9,"span",51),m(10),c(),d(11,an,4,1,"ng-container",8),c(),w()),i&2){let t=Q(7),e=p(2).$implicit,n=p(3);r(1),s("rowSpan",e.Variants.length),r(2),s("ngIf",(e.Variants==null?null:e.Variants.length)>1),r(1),s("ngClass",T(8,on,(e.Variants==null?null:e.Variants.length)<=1)),r(1),s("ngIf",e.ThumbnailUrl)("ngIfElse",t),r(3),s("rowSpan",e.Variants.length),r(2),E(e.Name),r(1),s("ngIf",(e==null?null:e.CategoryID)!==null&&(e==null?null:e.CategoryID)!=n.guidEmpty)}}function ln(i,o){if(i&1){let t=x();l(0,"input",57),h("ngModelChange",function(n){_(t);let a=p(2).$implicit;return g(a.selected=n)}),c()}if(i&2){let t=p(2).$implicit;s("ngModel",t.selected)}}function cn(i,o){if(i&1&&(l(0,"td",55),d(1,ln,1,1,"input",56),c()),i&2){let t=p().$implicit;r(1),s("ngIf",t.Inventory>=0)}}function sn(i,o){i&1&&(l(0,"div",58),m(1,"Not Found"),c())}function pn(i,o){if(i&1&&(l(0,"div"),m(1),v(2,"number"),c()),i&2){let t=p().$implicit;r(1),I(" ",S(2,1,t.UnitPrice),"")}}function mn(i,o){if(i&1&&(y(0),l(1,"div",41)(2,"a",42),P(3,"i",59),c()(),w()),i&2){let t=p().$implicit,e=p(4);r(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),V)}}function dn(i,o){if(i&1){let t=x();l(0,"div",60),h("click",function(){_(t);let n=p().$implicit,a=p().$implicit,u=p(2).ngIf,C=p();return g(C.openTableDialog(n,a,u))}),m(1),v(2,"number"),c()}if(i&2){let t=p().$implicit;r(1),I(" ",S(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}var _n=i=>({"text-decoration-line-through":i}),gn=i=>({"bg-gradient-warning":i});function un(i,o){if(i&1){let t=x();l(0,"tr"),d(1,rn,12,10,"ng-container",8),l(2,"td",21),m(3),c(),l(4,"td",35)(5,"span",36),m(6),c()(),d(7,cn,2,1,"ng-template",23),l(8,"td",24)(9,"div",37),d(10,sn,2,0,"div",38)(11,pn,3,3,"div",8)(12,mn,4,1,"ng-container",8),c()(),l(13,"td",39)(14,"div",37),d(15,dn,3,3,"div",40),l(16,"div",41)(17,"a",42),P(18,"i",43),c()(),l(19,"div",41)(20,"div",44),h("click",function(){let a=_(t).$implicit,u=p(4);return g(u.refreshPrice(a))}),P(21,"i",45),c()()()()()}if(i&2){let t=o.$implicit,e=o.index,n=p(4);r(1),s("ngIf",e==0),r(2),E(t.Model),r(1),s("matTooltip",t.isDiscontinued?n.discontinuedVariantMsg:""),r(1),s("ngClass",T(12,_n,t.isDiscontinued)),r(1),I(" ",t.Code," "),r(1),s("ngxPermissionsOnly",T(14,Te,n.rolePriceEdit)),r(3),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)!=null),r(1),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)==null),r(1),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)==null),r(1),s("ngClass",T(16,gn,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),r(2),s("ngIf",t.Channel.length>0),r(2),s("href",t.Channel[0]==null?null:t.Channel[0].Url,V)}}function hn(i,o){if(i&1&&(y(0),d(1,un,22,18,"tr",28),w()),i&2){let t=o.$implicit;r(1),s("ngForOf",t.Variants)}}function Cn(i,o){if(i&1){let t=x();l(0,"span",60),h("click",function(){_(t);let n=p(3);return g(n.getRowCount())}),l(1,"i",61),m(2,"?"),c()()}}function fn(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t.Total))}}function xn(i,o){if(i&1){let t=x();l(0,"a",65),h("click",function(){_(t);let n=p(4);return g(n.onNextPage())}),P(1,"i",66),m(2," Next"),c()}}function vn(i,o){if(i&1){let t=x();l(0,"a",67),h("click",function(){_(t);let n=p(4);return g(n.onLastPage())}),P(1,"i",68),m(2," Last"),c()}}function Sn(i,o){if(i&1&&(l(0,"div",62),d(1,xn,3,0,"a",63)(2,vn,3,0,"a",64),c()),i&2){let t=p(3);r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Pn(i,o){if(i&1){let t=x();l(0,"content")(1,"div",15)(2,"div",16)(3,"table",17)(4,"thead",18)(5,"tr")(6,"th",19),m(7," Product "),l(8,"div")(9,"mat-slide-toggle",20),h("ngModelChange",function(n){_(t);let a=p(2);return g(a.toggleDifferentInventory=n)})("toggleChange",function(){_(t);let n=p(2);return g(n.onToggleDifferentInventory())}),l(10,"small",6),m(11,"FILTER DIFFERENT PRICE"),c()()()(),l(12,"th",21),m(13,"Variant"),c(),l(14,"th",22),m(15,"SKU"),c(),d(16,Qt,2,0,"ng-template",23),l(17,"th",24),m(18,"POS"),c(),l(19,"th",24)(20,"div",25),h("click",function(){_(t);let n=p(2);return g(n.openModalFilter())}),P(21,"img",26),l(22,"span",27),m(23),v(24,"stringLimit"),c()()()()(),l(25,"tbody"),d(26,hn,2,1,"ng-container",28),c()(),l(27,"div",29)(28,"div",30)(29,"div",31),m(30),v(31,"number"),d(32,Cn,3,0,"span",32)(33,fn,3,3,"span",8),v(34,"async"),m(35),c()(),d(36,Sn,3,2,"div",33),c()()()()}if(i&2){let t=o.ngIf,e=p(2);r(9),s("ngModel",e.toggleDifferentInventory),r(7),s("ngxPermissionsOnly",T(19,Te,e.rolePriceEdit)),r(4),s("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),r(1),s("src",e.selectedChannel==null?null:e.selectedChannel.Img,V),r(2),oe(" ",re(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),r(3),s("ngForOf",t),r(4),I(" Showing 1 - ",S(31,15,t==null?null:t.length)," of "),r(2),s("ngIf",e.paginationService.hideCount),r(1),s("ngIf",S(34,17,!e.paginationService.hideCount&&e.allDataCount$)),r(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),r(1),s("ngIf",t.length>0)}}function bn(i,o){if(i&1){let t=x();l(0,"mainpanel",1),h("textChange",function(n){_(t);let a=p();return g(a.searchFilter.text=n)})("onSubmit",function(){_(t);let n=p();return g(n.onSearch())}),l(1,"filters")(2,"div")(3,"label",2),m(4,"Channel"),c(),l(5,"ng-select",3),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.ChannelID=n)}),d(6,qt,3,2,"ng-template",4),c()(),l(7,"div",5)(8,"label",6),m(9,"Page Number"),c(),l(10,"input",7),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.PageNumber=n)}),c()(),l(11,"div",5)(12,"label",6),m(13,"Page Size"),c(),l(14,"input",7),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.RowCount=n)}),c()()(),d(15,Yt,3,1,"actions",8),v(16,"async"),d(17,Pn,37,21,"content",8),v(18,"async"),c()}if(i&2){let t=p();s("headerTitle",t.pageTitle)("text",t.searchFilter.text),r(5),s("clearable",!1)("items",t.channelOptions)("ngModel",t.searchFilter.ChannelID),r(5),s("ngModel",t.searchFilter.PageNumber),r(4),s("ngModel",t.searchFilter.RowCount),r(1),s("ngIf",S(16,9,t.data$)),r(2),s("ngIf",S(18,11,t.data$))}}var rt=(()=>{let o=class o{constructor(e,n,a,u,C,f,be,Ve,st){this.http=e,this.paginationService=n,this.toastr=a,this.dialog=u,this.productService=C,this.biggerPictureService=f,this.inventoryService=be,this.authService=Ve,this.mainPanelService=st,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=de.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=z.GuidEMpty,this.hostName=this.authService.getDomain(),this.data$=this.paginationService.data$.pipe(te(1),Y(pt=>pt.map(ee=>(ee.Variants&&(ee.Variants=ee.Variants.map(Ie=>(Ie.isDiscontinued=Ie.Discontinued=="Yes",Ie))),ee)))),this.channelOptions=Ve.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(O(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=N.ALL,this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=N.ALL:this.searchFilter.filterModel=N.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),u={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",u).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}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:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e.Total)}})}openTableDialog(e,n,a){let u=JSON.parse(JSON.stringify(e));this.dialog.open(fe,{data:{Name:n.Name,Variant:u,ChannelID:u?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:u?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(k(f=>z.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(u=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${C.Name} to ${a.Price}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(u=>(u.selected=e,u)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(q),b(K),b(H),b(Z),b(he),b(Se),b(G),b(Be))},o.\u0275cmp=D({type:o,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[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,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"ms-1"],[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","checkbox",1,"me-3",3,"change"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[3,"ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"fas","external-link-custom","fa-external-link-alt"],[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 border-start-0","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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(d(0,bn,19,13,"mainpanel",0),v(1,"async")),n&2&&s("ngIf",S(1,1,a.loader$))},dependencies:[$,L,R,se,pe,ce,M,F,J,$e,ke,Oe,Ze,ue,_e,B,U,xe],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]});let i=o;return i})();var lt=(()=>{let o=class o{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=D({type:o,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(l(0,"nav",0)(1,"div",1)(2,"div"),P(3,"nav-tab",2),c()()(),P(4,"router-outlet")),n&2&&(r(3),s("Tabs",a.priceTabs))},dependencies:[Ae,Me]});let i=o;return i})();var In=[{path:"",component:lt,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:it,canActivate:[ge],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:ot,canActivate:[ge],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:rt,canActivate:[ge],data:{title:"Price Single Channel Comparison"}}]}],ct=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=ie({type:o}),o.\u0275inj=ne({imports:[A,le.forChild(In)]});let i=o;return i})();var $i=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=ie({type:o}),o.\u0275inj=ne({providers:[Se],imports:[A,me,je,Ue,le,Le,ct,Fe,qe,Je,Re,Pe,ve,Ne.forChild()]});let i=o;return i})();export{$i as PriceModule};
@@ -1,2 +1,2 @@
1
- import{a as Ie,b as Me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-DG6KCZ24.js";import{a as De}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-I2G5J34U.js";import{g as xe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-TZRTEOJA.js";import{d as be,e as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-223SSA62.js";import{d as ye,j as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-EJMJP3AQ.js";import{a as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2OVWEFCG.js";import{A as w,q as A,s as D,t as O,z as E}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-5VJQDJRJ.js";import{_ as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-DDXVCGNF.js";import{b as Ce,h as F,k as L,u as _e}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-MFWCFDSI.js";import{b as p,c as _}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-PHYOU4H6.js";import{$ as oe,$a as l,Aa as M,B as ne,Fb as R,Ga as s,Gb as q,H as ie,Ha as g,Hb as ce,K as ae,La as J,Ob as W,Pa as Y,Qa as d,Ra as se,T as G,V as j,Wa as u,_b as pe,aa as le,ab as r,ac as x,bb as C,bc as U,c as $,ca as K,cb as V,db as N,ea as y,fa as re,fb as k,fc as me,hc as he,ic as fe,ja as v,jb as f,ka as I,lb as h,n as ee,q as te,qb as z,rb as c,sb as S,tb as T,xc as ue,yb as de}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2TS2HEE6.js";function Pe(o,n){if(o&1&&(l(0,"mat-option",9)(1,"div",10),C(2,"img",11),l(3,"span"),c(4),r()()()),o&2){let i=n.$implicit;d("value",i.ID)("disabled",i.disabled),s(1),d("matTooltip",i.disabled?"Single Product Scan disabled for this type of Channel":null),s(1),d("src",i.Img,M),s(2),S(i.Name)}}function Ve(o,n){if(o&1){let i=k();l(0,"div",12)(1,"label",13),c(2,"Scan Type"),r(),l(3,"mat-radio-group",14),f("ngModelChange",function(e){v(i);let a=h();return I(a.filter.ScanFull=e)}),l(4,"mat-radio-button",15),c(5," Full (Include Inactive Products) "),r(),l(6,"mat-radio-button",16),c(7," Active "),r()()()}if(o&2){let i=h();s(3),d("ngModel",i.filter.ScanFull),s(1),d("value",!0),s(2),d("value",!1)}}function Ne(o,n){if(o&1){let i=k();l(0,"div",17)(1,"label",3),c(2),R(3,"date"),r(),l(4,"mat-radio-group",18),f("ngModelChange",function(e){v(i);let a=h();return I(a.filter.UpdatedProduct=e)}),l(5,"mat-radio-button",19),c(6," Scan All Products "),r(),l(7,"mat-radio-button",20),c(8),r()()()}if(o&2){let i=h();s(2),T(" Last Scan: ",ce(3,6,i.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),s(2),d("ngModel",i.filter.UpdatedProduct),s(1),d("value",!1),s(2),d("value",!0)("matTooltip",i.selectedChannel.TypeID==i.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),s(1),T(" ",i.selectedChannel.TypeID==i.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Ue(o,n){if(o&1){let i=k();l(0,"div",17)(1,"label",3),c(2," Scan Option "),r(),l(3,"mat-radio-group",21),f("ngModelChange",function(e){v(i);let a=h();return I(a.filter.Async=e)}),l(4,"mat-radio-button",22),c(5," Asynchronous (Get Notified when Complete) "),r(),l(6,"mat-radio-button",23),c(7," Synchronous (Wait until Complete) "),r()()()}if(o&2){let i=h();s(3),d("ngModel",i.filter.Async),s(1),d("value",!0),s(2),d("value",!1)}}var at=(()=>{let n=class n{constructor(t,e,a){this.dialogRef=t,this.data=e,this.router=a,this.channelType=p,this.disabledChannelOption=!1,this.filter={ChannelID:_.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=_.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=_.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title="Scan Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==p.Tiktok||t.TypeID==p.Tokopedia||t.TypeID==p.Lazada||t.TypeID==p.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let e=this.filterChannelById(t);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&_.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==p.Shopee||this.selectedChannel.TypeID==p.Tiktok||this.selectedChannel.TypeID==p.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=p.WooCommerce&&this.selectedChannel?.TypeID!=p.KalCare&&this.selectedChannel?.TypeID!=p.None&&_.IsNotEmpty(this.selectedChannel?.LastSync)&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let e;return this.channelOptions&&(e=this.channelOptions.find(a=>a.ID==t)),e}submit(){this.selectedChannel.TypeID==p.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):(this.beforeSubmit(),this.dialogRef.close(this.filter))}beforeSubmit(){this.filter.UpdatedProduct&&(this.filter.Async=!1)}isNotEmpty(t){return _.IsNotEmpty(t)}onClose(){this.dialogRef.close()}};n.\u0275fac=function(e){return new(e||n)(g(D),g(O),g(ue))},n.\u0275cmp=y({type:n,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"disabled","ngModel","ngModelChange"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"mt-8"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,a){e&1&&(l(0,"modal-material",0),f("onOk",function(){return a.submit()})("onClose",function(){return a.onClose()})("onCancel",function(){return a.onClose()}),l(1,"div",1)(2,"div",2)(3,"label",3),c(4,"Select a Channel"),r(),l(5,"mat-form-field",4)(6,"mat-select",5),f("ngModelChange",function(b){return a.filter.ChannelID=b})("ngModelChange",function(b){return a.onSelectChannel(b)}),u(7,Pe,5,5,"mat-option",6),r()(),u(8,Ve,8,3,"div",7)(9,Ne,9,9,"div",8)(10,Ue,8,3,"div",8),r()()()),e&2&&(d("dynamicValidated",a.isNotEmpty(a.filter.ChannelID))("config",a.modalConfig),s(6),d("disabled",a.disabledChannelOption)("ngModel",a.filter.ChannelID),s(1),d("ngForOf",a.channelOptions),s(1),d("ngIf",!a.isSingleChannel&&a.isNotEmpty(a.filter.ChannelID)),s(1),d("ngIf",a.hasScanUpdate),s(1),d("ngIf",!(a.filter!=null&&a.filter.UpdatedProduct)&&!a.isSingleChannel&&a.isNotEmpty(a.filter.ChannelID)))},dependencies:[x,U,F,L,Ie,Me,xe,De,ve,A,w,me],encapsulation:2});let o=n;return o})();var P=function(o){return o.Tokopedia="https://seller.tokopedia.com",o.Shoope="https://seller.shopee.co.id",o.Tiktok="https://seller-id.tiktok.com",o.WooCommerce="https://woocommerce.dealpos.app",o.Lazada="https://sellercenter.lazada.co.id",o}(P||{});function Fe(o,n){if(o&1&&(V(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),N()),o&2){let i=h().$implicit;s(3),T(" ",i==null?null:i.Model,""),s(2),T(" ",i==null?null:i.Code,"")}}function Le(o,n){if(o&1&&(l(0,"td",11),c(1),r()),o&2){let i=h(3).$implicit;Y("rowspan",i.Channel.length),s(1),T(" ",i==null?null:i.Model,"")}}function Ae(o,n){if(o&1&&(l(0,"td",11),c(1),r()),o&2){let i=h(3).$implicit;Y("rowspan",i.Channel.length),s(1),T(" ",i==null?null:i.Code,"")}}var $e=o=>({"is-disabled":o});function Re(o,n){if(o&1&&(l(0,"tr"),u(1,Le,2,2,"td",14)(2,Ae,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),C(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),R(11,"number"),r(),l(12,"td",19),c(13),R(14,"number"),r(),l(15,"td",19)(16,"a",20),C(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),o&2){let i=n.$implicit,t=n.index,e=h(3);s(1),d("ngIf",t==0),s(1),d("ngIf",t==0),s(3),d("href",i.Url,M)("title",i.Title),s(1),d("src",e.getChannelLogo(i.TypeID),M),s(1),d("matTooltip",(i==null||i.Name==null?null:i.Name.length)>55?i==null?null:i.Name:""),s(1),T(" ",i.Name," "),s(2),S(q(11,12,i.Price)),s(3),S(q(14,14,i.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(i),M)("ngClass",de(16,$e,i.TypeID==e.channelType.KalCare))("matTooltip",i.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Be(o,n){if(o&1&&u(0,Re,20,18,"tr",8),o&2){let i=h().$implicit;d("ngForOf",i==null?null:i.Channel)}}function je(o,n){if(o&1&&(V(0),u(1,Fe,9,2,"ng-container",9)(2,Be,1,1,"ng-template",null,10,W),N()),o&2){let i=n.$implicit,t=z(3);s(1),d("ngIf",!i.Channel||i.Channel.length<1)("ngIfElse",t)}}var mt=(()=>{let n=class n{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=p,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case p.Shopee:e=`${P.Shoope}/portal/product/${t.ChannelItemID}`;break;case p.Tiktok:e=`${P.Tiktok}/product/edit/${t.ChannelItemID}`;break;case p.Tokopedia:e=`${P.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case p.WooCommerce:e=`${P.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case p.Lazada:e=`${P.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};n.\u0275fac=function(e){return new(e||n)(g(O),g(D))},n.\u0275cmp=y({type:n,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,a){e&1&&(l(0,"modal-material",0),f("onCancel",function(){return a.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),c(6," VARIANT "),l(7,"sup"),C(8,"i",5),r()(),l(9,"th",4),c(10,"SKU"),r(),l(11,"th",4),c(12," PRODUCT "),l(13,"sup"),C(14,"i",6),r()(),l(15,"th",4),c(16,"PRICE"),r(),l(17,"th",7),c(18,"INVENTORY"),r(),C(19,"th",4),r()(),l(20,"tbody"),u(21,je,4,2,"ng-container",8),r()()()()),e&2&&(d("config",a.modalConfig),s(21),d("ngForOf",a.variants))},dependencies:[pe,x,U,A,w,he],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let o=n;return o})();var H=class{constructor(){this._input$=new $,this._destroy$=new $,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(ie(200),ae(),te(n=>(n&&(n=n.toLowerCase()),this.filterData(n))),ne(n=>n!==void 0),j(this._destroy$)).subscribe(n=>{this._dataBuffer=n.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(n){let i=-1,t;return this._data.filter(a=>(t=JSON.stringify(a).toLowerCase(),i=t.indexOf(n),i!==-1||n==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(n){this._data=n||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(n,i){if(_.IsNotEmpty(n)){let t=this._data.filter(e=>e[i].toString().toLowerCase().indexOf(n)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(n){this._bufferSize=n}onScrollToEnd(){this.fetchMore()}fetchMore(){let n=this._dataBuffer.length,i=this._data.slice(n,this._bufferSize+n);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(i)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var we=(()=>{let n=class n{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.width="100%",this.clearable=!0,this.disabled=!1,this.ngSelectInfiniteScroll=new H,this.selectedChange=new J,this.selectedLabel=new J}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=y({type:n,selectors:[["ng-select-infinite"]],inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel"},decls:1,vars:12,consts:[[3,"disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable","appendTo","clear","scrollToEnd","change"]],template:function(e,a){e&1&&(l(0,"ng-select",0),f("clear",function(){return a.ngSelectInfiniteScroll.onClear()})("scrollToEnd",function(){return a.ngSelectInfiniteScroll.onScrollToEnd()})("change",function(b){return a.onSelectChange(b)}),r()),e&2&&(se("width",a.width),d("disabled",a.disabled)("virtualScroll",!0)("typeahead",a.ngSelectInfiniteScroll.input$)("items",a.ngSelectInfiniteScroll.bufferData)("bindLabel",a.bindLabel)("bindValue",a.bindValue)("placeholder",a.placeholder)("ngModel",a.selected)("clearable",a.clearable)("appendTo",a.parent))},dependencies:[be,F,L]});let o=n;return o})(),Ot=(()=>{let n=class n{};n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=re({type:n}),n.\u0275inj=le({imports:[fe,Te,_e]});let o=n;return o})();var ke=(()=>{let n=class n{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(G(a=>a!=null?ee(a):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let a={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",a).pipe(G(m=>this.LocalData.saveCategoriesByChannelType(m,t)))}};n.\u0275fac=function(e){return new(e||n)(K(Se),K(ge))},n.\u0275prov=oe({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();function He(o,n){if(o&1){let i=k();V(0),l(1,"ng-select-infinite",16),f("selectedChange",function(e){v(i);let a=h().index,m=h();return I(m.onSelectCategory(e,a))}),r(),N()}if(o&2){let i=h().$implicit;s(1),d("items",i.Categories)("clearable",!1)}}function Ge(o,n){if(o&1&&(l(0,"div",17),C(1,"input",18),r()),o&2){let i=h().$implicit,t=h();d("matTooltip",t.channelType.WooCommerce==i.TypeID||t.channelType.Shopify==i.TypeID?"":"Product Category is Harcoded, Please Change Product Category in Seller Center"),s(1),d("placeholder",t.getChannelCategory(i.TypeID))}}function Ke(o,n){if(o&1){let i=k();V(0),l(1,"tr")(2,"td",9)(3,"input",10),f("ngModelChange",function(e){let m=v(i).$implicit;return I(m.Selected=e)})("ngModelChange",function(){v(i);let e=h();return I(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",11),C(6,"img",12),l(7,"span",13),c(8),r()()(),l(9,"td"),u(10,He,2,2,"ng-container",14)(11,Ge,2,2,"ng-template",null,15,W),r()(),N()}if(o&2){let i=n.$implicit,t=z(12);s(3),d("ngModel",i.Selected),s(3),d("src",i==null?null:i.Img,M)("alt",i.Name),s(2),S(i.Name),s(2),d("ngIf",i.Categories.length>0)("ngIfElse",t)}}var Lt=(()=>{let n=class n{constructor(t,e,a,m){this.data=t,this.channelService=e,this.dialogRef=a,this.toastrService=m,this.channelOptions=[],this.uploadResponse=[],this.channelType=p,this.enableBtnOk=!1,this.destroy$=new $,this.uploadResponse=[],this.channels=this.data.channels,this.product=t.product}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(j(this.destroy$)).subscribe(a=>{this.setCategoriesChannelOption(e.channelType,a)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(a=>(a.TypeID==t&&(a.Categories=e),a))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case p.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,a,m)=>m.findIndex(b=>e.channelType==b.channelType)==a).filter(e=>e.channelType==p.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close()}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==p.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case p.Shopee:e="Aksesoris Fashion";break;case p.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case p.WooCommerce:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;case p.Lazada:e="Fashion Accessories / Women Accessories / Others";break;case p.Shopify:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};n.\u0275fac=function(e){return new(e||n)(g(O),g(ke),g(D),g(ye))},n.\u0275cmp=y({type:n,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src","alt"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["EMPTY",""],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"items","clearable","selectedChange"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,a){e&1&&(l(0,"modal-material",0),f("onOk",function(){return a.onSave()})("onClose",function(){return a.onClose()})("onCancel",function(){return a.onClose()}),l(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3)(6,"input",4),f("change",function(b){return a.onSelectAllChannel(b.target.checked)}),r()(),l(7,"th",5)(8,"span",6),c(9,"CHANNEL"),r()(),l(10,"th",7)(11,"span",6),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),u(14,Ke,13,6,"ng-container",8),r()()()()),e&2&&(d("dynamicValidated",a.enableBtnOk)("config",a.modalConfig),s(14),d("ngForOf",a.channelOptions))},dependencies:[x,U,Ce,F,L,A,w,we],styles:[`input[type=checkbox]{width:15px;height:15px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
1
+ import{a as Ie,b as Me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-4L6TZC4Q.js";import{a as De}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-TKMWRB4W.js";import{g as xe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-4276ECDR.js";import{d as be,e as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-TYL25LTY.js";import{d as ye,j as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-FWBPK3JW.js";import{a as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-E3GZ25PR.js";import{A as w,q as A,s as D,t as O,z as E}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-NLIQ2J6A.js";import{_ as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-LMYBWQKO.js";import{b as Ce,h as F,k as L,u as _e}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-FUC2SF5Q.js";import{b as p,c as _}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-4RHNT4DZ.js";import{$ as oe,$a as l,Aa as M,B as ne,Fb as R,Ga as s,Gb as q,H as ie,Ha as g,Hb as ce,K as ae,La as J,Ob as W,Pa as Y,Qa as d,Ra as se,T as G,V as j,Wa as u,_b as pe,aa as le,ab as r,ac as x,bb as C,bc as U,c as $,ca as K,cb as V,db as N,ea as y,fa as re,fb as k,fc as me,hc as he,ic as fe,ja as v,jb as f,ka as I,lb as h,n as ee,q as te,qb as z,rb as c,sb as S,tb as T,xc as ue,yb as de}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-YNZUWVLD.js";function Pe(o,n){if(o&1&&(l(0,"mat-option",9)(1,"div",10),C(2,"img",11),l(3,"span"),c(4),r()()()),o&2){let i=n.$implicit;d("value",i.ID)("disabled",i.disabled),s(1),d("matTooltip",i.disabled?"Single Product Scan disabled for this type of Channel":null),s(1),d("src",i.Img,M),s(2),S(i.Name)}}function Ve(o,n){if(o&1){let i=k();l(0,"div",12)(1,"label",13),c(2,"Scan Type"),r(),l(3,"mat-radio-group",14),f("ngModelChange",function(e){v(i);let a=h();return I(a.filter.ScanFull=e)}),l(4,"mat-radio-button",15),c(5," Full (Include Inactive Products) "),r(),l(6,"mat-radio-button",16),c(7," Active "),r()()()}if(o&2){let i=h();s(3),d("ngModel",i.filter.ScanFull),s(1),d("value",!0),s(2),d("value",!1)}}function Ne(o,n){if(o&1){let i=k();l(0,"div",17)(1,"label",3),c(2),R(3,"date"),r(),l(4,"mat-radio-group",18),f("ngModelChange",function(e){v(i);let a=h();return I(a.filter.UpdatedProduct=e)}),l(5,"mat-radio-button",19),c(6," Scan All Products "),r(),l(7,"mat-radio-button",20),c(8),r()()()}if(o&2){let i=h();s(2),T(" Last Scan: ",ce(3,6,i.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),s(2),d("ngModel",i.filter.UpdatedProduct),s(1),d("value",!1),s(2),d("value",!0)("matTooltip",i.selectedChannel.TypeID==i.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),s(1),T(" ",i.selectedChannel.TypeID==i.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Ue(o,n){if(o&1){let i=k();l(0,"div",17)(1,"label",3),c(2," Scan Option "),r(),l(3,"mat-radio-group",21),f("ngModelChange",function(e){v(i);let a=h();return I(a.filter.Async=e)}),l(4,"mat-radio-button",22),c(5," Asynchronous (Get Notified when Complete) "),r(),l(6,"mat-radio-button",23),c(7," Synchronous (Wait until Complete) "),r()()()}if(o&2){let i=h();s(3),d("ngModel",i.filter.Async),s(1),d("value",!0),s(2),d("value",!1)}}var at=(()=>{let n=class n{constructor(t,e,a){this.dialogRef=t,this.data=e,this.router=a,this.channelType=p,this.disabledChannelOption=!1,this.filter={ChannelID:_.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=_.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=_.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title="Scan Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==p.Tiktok||t.TypeID==p.Tokopedia||t.TypeID==p.Lazada||t.TypeID==p.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let e=this.filterChannelById(t);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&_.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==p.Shopee||this.selectedChannel.TypeID==p.Tiktok||this.selectedChannel.TypeID==p.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=p.WooCommerce&&this.selectedChannel?.TypeID!=p.KalCare&&this.selectedChannel?.TypeID!=p.None&&_.IsNotEmpty(this.selectedChannel?.LastSync)&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let e;return this.channelOptions&&(e=this.channelOptions.find(a=>a.ID==t)),e}submit(){this.selectedChannel.TypeID==p.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):(this.beforeSubmit(),this.dialogRef.close(this.filter))}beforeSubmit(){this.filter.UpdatedProduct&&(this.filter.Async=!1)}isNotEmpty(t){return _.IsNotEmpty(t)}onClose(){this.dialogRef.close()}};n.\u0275fac=function(e){return new(e||n)(g(D),g(O),g(ue))},n.\u0275cmp=y({type:n,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"disabled","ngModel","ngModelChange"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"mt-8"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,a){e&1&&(l(0,"modal-material",0),f("onOk",function(){return a.submit()})("onClose",function(){return a.onClose()})("onCancel",function(){return a.onClose()}),l(1,"div",1)(2,"div",2)(3,"label",3),c(4,"Select a Channel"),r(),l(5,"mat-form-field",4)(6,"mat-select",5),f("ngModelChange",function(b){return a.filter.ChannelID=b})("ngModelChange",function(b){return a.onSelectChannel(b)}),u(7,Pe,5,5,"mat-option",6),r()(),u(8,Ve,8,3,"div",7)(9,Ne,9,9,"div",8)(10,Ue,8,3,"div",8),r()()()),e&2&&(d("dynamicValidated",a.isNotEmpty(a.filter.ChannelID))("config",a.modalConfig),s(6),d("disabled",a.disabledChannelOption)("ngModel",a.filter.ChannelID),s(1),d("ngForOf",a.channelOptions),s(1),d("ngIf",!a.isSingleChannel&&a.isNotEmpty(a.filter.ChannelID)),s(1),d("ngIf",a.hasScanUpdate),s(1),d("ngIf",!(a.filter!=null&&a.filter.UpdatedProduct)&&!a.isSingleChannel&&a.isNotEmpty(a.filter.ChannelID)))},dependencies:[x,U,F,L,Ie,Me,xe,De,ve,A,w,me],encapsulation:2});let o=n;return o})();var P=function(o){return o.Tokopedia="https://seller.tokopedia.com",o.Shoope="https://seller.shopee.co.id",o.Tiktok="https://seller-id.tiktok.com",o.WooCommerce="https://woocommerce.dealpos.app",o.Lazada="https://sellercenter.lazada.co.id",o}(P||{});function Fe(o,n){if(o&1&&(V(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),N()),o&2){let i=h().$implicit;s(3),T(" ",i==null?null:i.Model,""),s(2),T(" ",i==null?null:i.Code,"")}}function Le(o,n){if(o&1&&(l(0,"td",11),c(1),r()),o&2){let i=h(3).$implicit;Y("rowspan",i.Channel.length),s(1),T(" ",i==null?null:i.Model,"")}}function Ae(o,n){if(o&1&&(l(0,"td",11),c(1),r()),o&2){let i=h(3).$implicit;Y("rowspan",i.Channel.length),s(1),T(" ",i==null?null:i.Code,"")}}var $e=o=>({"is-disabled":o});function Re(o,n){if(o&1&&(l(0,"tr"),u(1,Le,2,2,"td",14)(2,Ae,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),C(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),R(11,"number"),r(),l(12,"td",19),c(13),R(14,"number"),r(),l(15,"td",19)(16,"a",20),C(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),o&2){let i=n.$implicit,t=n.index,e=h(3);s(1),d("ngIf",t==0),s(1),d("ngIf",t==0),s(3),d("href",i.Url,M)("title",i.Title),s(1),d("src",e.getChannelLogo(i.TypeID),M),s(1),d("matTooltip",(i==null||i.Name==null?null:i.Name.length)>55?i==null?null:i.Name:""),s(1),T(" ",i.Name," "),s(2),S(q(11,12,i.Price)),s(3),S(q(14,14,i.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(i),M)("ngClass",de(16,$e,i.TypeID==e.channelType.KalCare))("matTooltip",i.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Be(o,n){if(o&1&&u(0,Re,20,18,"tr",8),o&2){let i=h().$implicit;d("ngForOf",i==null?null:i.Channel)}}function je(o,n){if(o&1&&(V(0),u(1,Fe,9,2,"ng-container",9)(2,Be,1,1,"ng-template",null,10,W),N()),o&2){let i=n.$implicit,t=z(3);s(1),d("ngIf",!i.Channel||i.Channel.length<1)("ngIfElse",t)}}var mt=(()=>{let n=class n{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=p,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case p.Shopee:e=`${P.Shoope}/portal/product/${t.ChannelItemID}`;break;case p.Tiktok:e=`${P.Tiktok}/product/edit/${t.ChannelItemID}`;break;case p.Tokopedia:e=`${P.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case p.WooCommerce:e=`${P.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case p.Lazada:e=`${P.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};n.\u0275fac=function(e){return new(e||n)(g(O),g(D))},n.\u0275cmp=y({type:n,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,a){e&1&&(l(0,"modal-material",0),f("onCancel",function(){return a.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),c(6," VARIANT "),l(7,"sup"),C(8,"i",5),r()(),l(9,"th",4),c(10,"SKU"),r(),l(11,"th",4),c(12," PRODUCT "),l(13,"sup"),C(14,"i",6),r()(),l(15,"th",4),c(16,"PRICE"),r(),l(17,"th",7),c(18,"INVENTORY"),r(),C(19,"th",4),r()(),l(20,"tbody"),u(21,je,4,2,"ng-container",8),r()()()()),e&2&&(d("config",a.modalConfig),s(21),d("ngForOf",a.variants))},dependencies:[pe,x,U,A,w,he],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let o=n;return o})();var H=class{constructor(){this._input$=new $,this._destroy$=new $,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(ie(200),ae(),te(n=>(n&&(n=n.toLowerCase()),this.filterData(n))),ne(n=>n!==void 0),j(this._destroy$)).subscribe(n=>{this._dataBuffer=n.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(n){let i=-1,t;return this._data.filter(a=>(t=JSON.stringify(a).toLowerCase(),i=t.indexOf(n),i!==-1||n==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(n){this._data=n||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(n,i){if(_.IsNotEmpty(n)){let t=this._data.filter(e=>e[i].toString().toLowerCase().indexOf(n)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(n){this._bufferSize=n}onScrollToEnd(){this.fetchMore()}fetchMore(){let n=this._dataBuffer.length,i=this._data.slice(n,this._bufferSize+n);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(i)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var we=(()=>{let n=class n{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.width="100%",this.clearable=!0,this.disabled=!1,this.ngSelectInfiniteScroll=new H,this.selectedChange=new J,this.selectedLabel=new J}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=y({type:n,selectors:[["ng-select-infinite"]],inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel"},decls:1,vars:12,consts:[[3,"disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable","appendTo","clear","scrollToEnd","change"]],template:function(e,a){e&1&&(l(0,"ng-select",0),f("clear",function(){return a.ngSelectInfiniteScroll.onClear()})("scrollToEnd",function(){return a.ngSelectInfiniteScroll.onScrollToEnd()})("change",function(b){return a.onSelectChange(b)}),r()),e&2&&(se("width",a.width),d("disabled",a.disabled)("virtualScroll",!0)("typeahead",a.ngSelectInfiniteScroll.input$)("items",a.ngSelectInfiniteScroll.bufferData)("bindLabel",a.bindLabel)("bindValue",a.bindValue)("placeholder",a.placeholder)("ngModel",a.selected)("clearable",a.clearable)("appendTo",a.parent))},dependencies:[be,F,L]});let o=n;return o})(),Ot=(()=>{let n=class n{};n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=re({type:n}),n.\u0275inj=le({imports:[fe,Te,_e]});let o=n;return o})();var ke=(()=>{let n=class n{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(G(a=>a!=null?ee(a):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let a={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",a).pipe(G(m=>this.LocalData.saveCategoriesByChannelType(m,t)))}};n.\u0275fac=function(e){return new(e||n)(K(Se),K(ge))},n.\u0275prov=oe({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();function He(o,n){if(o&1){let i=k();V(0),l(1,"ng-select-infinite",16),f("selectedChange",function(e){v(i);let a=h().index,m=h();return I(m.onSelectCategory(e,a))}),r(),N()}if(o&2){let i=h().$implicit;s(1),d("items",i.Categories)("clearable",!1)}}function Ge(o,n){if(o&1&&(l(0,"div",17),C(1,"input",18),r()),o&2){let i=h().$implicit,t=h();d("matTooltip",t.channelType.WooCommerce==i.TypeID||t.channelType.Shopify==i.TypeID?"":"Product Category is Harcoded, Please Change Product Category in Seller Center"),s(1),d("placeholder",t.getChannelCategory(i.TypeID))}}function Ke(o,n){if(o&1){let i=k();V(0),l(1,"tr")(2,"td",9)(3,"input",10),f("ngModelChange",function(e){let m=v(i).$implicit;return I(m.Selected=e)})("ngModelChange",function(){v(i);let e=h();return I(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",11),C(6,"img",12),l(7,"span",13),c(8),r()()(),l(9,"td"),u(10,He,2,2,"ng-container",14)(11,Ge,2,2,"ng-template",null,15,W),r()(),N()}if(o&2){let i=n.$implicit,t=z(12);s(3),d("ngModel",i.Selected),s(3),d("src",i==null?null:i.Img,M)("alt",i.Name),s(2),S(i.Name),s(2),d("ngIf",i.Categories.length>0)("ngIfElse",t)}}var Lt=(()=>{let n=class n{constructor(t,e,a,m){this.data=t,this.channelService=e,this.dialogRef=a,this.toastrService=m,this.channelOptions=[],this.uploadResponse=[],this.channelType=p,this.enableBtnOk=!1,this.destroy$=new $,this.uploadResponse=[],this.channels=this.data.channels,this.product=t.product}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(j(this.destroy$)).subscribe(a=>{this.setCategoriesChannelOption(e.channelType,a)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(a=>(a.TypeID==t&&(a.Categories=e),a))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case p.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,a,m)=>m.findIndex(b=>e.channelType==b.channelType)==a).filter(e=>e.channelType==p.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close()}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==p.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case p.Shopee:e="Aksesoris Fashion";break;case p.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case p.WooCommerce:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;case p.Lazada:e="Fashion Accessories / Women Accessories / Others";break;case p.Shopify:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};n.\u0275fac=function(e){return new(e||n)(g(O),g(ke),g(D),g(ye))},n.\u0275cmp=y({type:n,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src","alt"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["EMPTY",""],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"items","clearable","selectedChange"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,a){e&1&&(l(0,"modal-material",0),f("onOk",function(){return a.onSave()})("onClose",function(){return a.onClose()})("onCancel",function(){return a.onClose()}),l(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3)(6,"input",4),f("change",function(b){return a.onSelectAllChannel(b.target.checked)}),r()(),l(7,"th",5)(8,"span",6),c(9,"CHANNEL"),r()(),l(10,"th",7)(11,"span",6),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),u(14,Ke,13,6,"ng-container",8),r()()()()),e&2&&(d("dynamicValidated",a.enableBtnOk)("config",a.modalConfig),s(14),d("ngForOf",a.channelOptions))},dependencies:[x,U,Ce,F,L,A,w,we],styles:[`input[type=checkbox]{width:15px;height:15px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
2
2
  `],encapsulation:2});let o=n;return o})();function Je(o,n){if(o&1&&(l(0,"tr")(1,"td"),c(2),r(),l(3,"td"),c(4),r()()),o&2){let i=n.$implicit;s(2),S(i==null?null:i.Name),s(2),S(i==null?null:i.ChannelVariationSKU)}}var Bt=(()=>{let n=class n{constructor(t,e){this.data=t,this.dialogRef=e}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}};n.\u0275fac=function(e){return new(e||n)(g(O),g(D))},n.\u0275cmp=y({type:n,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(e,a){e&1&&(l(0,"modal-material",0),f("onCancel",function(){return a.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th"),c(6,"Variant"),r(),l(7,"th"),c(8,"SKU"),r()()(),l(9,"tbody"),u(10,Je,5,2,"tr",4),r()()()()),e&2&&(d("config",a.modalConfig),s(10),d("ngForOf",a.data.variants))},dependencies:[x,w],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]});let o=n;return o})();export{at as a,mt as b,Ot as c,Lt as d,Bt as e};
@@ -1 +1 @@
1
- import{a as b}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-C6SMFVRJ.js";import{a as h,b as P}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-XT3VATZ2.js";import{a as C}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-VGBWD4JQ.js";import{c as M}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-DG6KCZ24.js";import{b as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-6NGKE364.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-I2G5J34U.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-H6M6M4LW.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-UZO2VDKA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-TZRTEOJA.js";import{e as s}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-223SSA62.js";import{a as p}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-M4MZ4PBS.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-EJMJP3AQ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2OVWEFCG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2HHCA3NK.js";import{D as u,r as f}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-5VJQDJRJ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-DDXVCGNF.js";import{u as g}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-MFWCFDSI.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-PHYOU4H6.js";import{Ac as m,aa as e,bb as c,ea as d,fa as r,ic as i,wc as l}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2TS2HEE6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-NNG6BZAM.js";var _=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=d({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(n,v){n&1&&c(0,"router-outlet")},dependencies:[l],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=t;return o})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-MQ5YF2EQ.js").then(o=>o.StatusModule),canActivate:[p]},{path:"download",loadChildren:()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-POHGR6GW.js").then(o=>o.DownloadModule),canActivate:[p]}]}],w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,m.forChild(y)]});let o=t;return o})();var W=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,m,w,f,u,s,O,C,M,h,P,b]});let o=t;return o})();export{W as ProductModule};
1
+ import{a as b}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-HG3XRZ32.js";import{a as h,b as P}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-CHXSDB2F.js";import{a as C}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-5ADQ3O2A.js";import{c as M}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-4L6TZC4Q.js";import{b as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-OQPXY7Z5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-TKMWRB4W.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-XDA6LS5Q.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-A6KWQYQ4.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-4276ECDR.js";import{e as s}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-TYL25LTY.js";import{a as p}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-ZJQVUUVL.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-FWBPK3JW.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-E3GZ25PR.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-MXRTBC2I.js";import{D as u,r as f}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-NLIQ2J6A.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-LMYBWQKO.js";import{u as g}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-FUC2SF5Q.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-4RHNT4DZ.js";import{Ac as m,aa as e,bb as c,ea as d,fa as r,ic as i,wc as l}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-YNZUWVLD.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-QMX3UB7H.js";var _=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=d({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(n,v){n&1&&c(0,"router-outlet")},dependencies:[l],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=t;return o})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-6FRKO4S2.js").then(o=>o.StatusModule),canActivate:[p]},{path:"download",loadChildren:()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.10.3/Marketplace/chunk-QXR35VSU.js").then(o=>o.DownloadModule),canActivate:[p]}]}],w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,m.forChild(y)]});let o=t;return o})();var W=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,m,w,f,u,s,O,C,M,h,P,b]});let o=t;return o})();export{W as ProductModule};