marketplacepos 5.46.1 → 5.46.2

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 (55) hide show
  1. package/Marketplace/{chunk-YB4KXB2C.js → chunk-3434HH7H.js} +1 -1
  2. package/Marketplace/{chunk-DZEO4HK4.js → chunk-3GRC47DP.js} +1 -1
  3. package/Marketplace/chunk-45FZJ4W3.js +1 -0
  4. package/Marketplace/{chunk-EI65NYTN.js → chunk-4DMKVXM7.js} +1 -1
  5. package/Marketplace/{chunk-FTWATKXK.js → chunk-4JQLXONG.js} +1 -1
  6. package/Marketplace/{chunk-6VYFG4AQ.js → chunk-6RMBCW2O.js} +1 -1
  7. package/Marketplace/{chunk-DB7C3AL2.js → chunk-6VZVNRUE.js} +2 -2
  8. package/Marketplace/{chunk-V6UNCLNJ.js → chunk-72OHPB5Q.js} +1 -1
  9. package/Marketplace/{chunk-3VUO4APC.js → chunk-7AZDAPB7.js} +1 -1
  10. package/Marketplace/{chunk-7DJXZQ7M.js → chunk-7F74QXF6.js} +1 -1
  11. package/Marketplace/{chunk-26ZM2UD3.js → chunk-7VLMA7MW.js} +1 -1
  12. package/Marketplace/{chunk-UGG2CIUU.js → chunk-A57T33JT.js} +1 -1
  13. package/Marketplace/{chunk-FB2AEPXA.js → chunk-AMYZMAYI.js} +1 -1
  14. package/Marketplace/{chunk-TGQ5CJ3A.js → chunk-B2WOBUES.js} +1 -1
  15. package/Marketplace/{chunk-4TDVVQ64.js → chunk-BDKGOINV.js} +1 -1
  16. package/Marketplace/{chunk-ZUYGRGXM.js → chunk-CBAQUD22.js} +1 -1
  17. package/Marketplace/{chunk-TE5EYKIN.js → chunk-CBJR2A72.js} +1 -1
  18. package/Marketplace/{chunk-NLPXBGIX.js → chunk-CIPLCKUF.js} +1 -1
  19. package/Marketplace/{chunk-HHO2NGCF.js → chunk-CWXOXH6M.js} +1 -1
  20. package/Marketplace/{chunk-4LZODV4E.js → chunk-FNU2TKTQ.js} +1 -1
  21. package/Marketplace/{chunk-T43QRQH5.js → chunk-FYRDNKYT.js} +1 -1
  22. package/Marketplace/{chunk-OAG6OVUY.js → chunk-GPX77ZSI.js} +1 -1
  23. package/Marketplace/{chunk-MJNFY4NT.js → chunk-GRQD4D2I.js} +1 -1
  24. package/Marketplace/{chunk-2XWZQCUR.js → chunk-HGZ5B6WR.js} +1 -1
  25. package/Marketplace/{chunk-2SGPD432.js → chunk-II5QZVLR.js} +1 -1
  26. package/Marketplace/{chunk-CRKCNTXF.js → chunk-LCZ6SUUA.js} +1 -1
  27. package/Marketplace/{chunk-FIAI5SPR.js → chunk-NDLOPOFD.js} +1 -1
  28. package/Marketplace/{chunk-JYCBJ7CC.js → chunk-OEAOBG75.js} +1 -1
  29. package/Marketplace/{chunk-6CIQBRO4.js → chunk-OHSVQSCM.js} +1 -1
  30. package/Marketplace/{chunk-VIDSOLHF.js → chunk-P5YM6T6I.js} +1 -1
  31. package/Marketplace/{chunk-KRQHTRFM.js → chunk-PE4SWUEZ.js} +1 -1
  32. package/Marketplace/{chunk-ORLTYLPA.js → chunk-PL3Q6PGC.js} +1 -1
  33. package/Marketplace/{chunk-6U4YIJLC.js → chunk-PLHWGG4D.js} +2 -2
  34. package/Marketplace/{chunk-OJZ7NGRW.js → chunk-Q2B5GUDO.js} +1 -1
  35. package/Marketplace/{chunk-GKRWJPI3.js → chunk-QSHR75ZI.js} +1 -1
  36. package/Marketplace/{chunk-ISUN5G42.js → chunk-QVP2CM7Y.js} +1 -1
  37. package/Marketplace/chunk-TM6DZ3ZF.js +1 -0
  38. package/Marketplace/{chunk-ZXTHWBJ4.js → chunk-UX3OTI5X.js} +1 -1
  39. package/Marketplace/{chunk-KCFCXS2F.js → chunk-V6GFM5AQ.js} +1 -1
  40. package/Marketplace/{chunk-ZVKOEYH7.js → chunk-WAKKUK6E.js} +1 -1
  41. package/Marketplace/chunk-WEYKQCVQ.js +1 -0
  42. package/Marketplace/{chunk-FHWKSD5A.js → chunk-WWLC64XZ.js} +1 -1
  43. package/Marketplace/{chunk-F2533PAC.js → chunk-XPBMYV5W.js} +1 -1
  44. package/Marketplace/{chunk-GPGD3XQH.js → chunk-XXAV6VNB.js} +1 -1
  45. package/Marketplace/{chunk-LOU3DIPY.js → chunk-YA3VMYDA.js} +1 -1
  46. package/Marketplace/{chunk-L7TKCTLD.js → chunk-YXBR6VYQ.js} +1 -1
  47. package/Marketplace/{chunk-M7LXGXUM.js → chunk-Z3J3CSGS.js} +1 -1
  48. package/Marketplace/{chunk-DSYYZDXI.js → chunk-Z67623R4.js} +1 -1
  49. package/Marketplace/{chunk-IWKRZSYG.js → chunk-ZLNAFA4X.js} +1 -1
  50. package/Marketplace/index.html +2 -2
  51. package/Marketplace/{main-RRL4BIVO.js → main-FUX6VJVF.js} +1 -1
  52. package/package.json +1 -1
  53. package/Marketplace/chunk-2Z7CPNRS.js +0 -1
  54. package/Marketplace/chunk-EFI2CLNP.js +0 -1
  55. package/Marketplace/chunk-KFOHH7PE.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-BMYBLBSP.js";import{b as ie}from"./chunk-PHUHUFYL.js";import{a as X}from"./chunk-ORLTYLPA.js";import"./chunk-EHUVS2VB.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import{a as Y,b as Z}from"./chunk-WRJFUNM3.js";import"./chunk-JVNHFIYT.js";import{i as Q}from"./chunk-FHWKSD5A.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as J}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PW42BQIY.js";import{m as ee,n as te}from"./chunk-HJXYT6MI.js";import{A as q,c as G,h as z,m as K}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as W,H as j,J as $,f as x,g as V,h as A,n as H}from"./chunk-FXQKRJWU.js";import{Fc as v,Gb as C,Gc as p,Hb as k,Hc as B,Ic as L,Ka as M,Kc as O,Lc as F,Mb as m,Mc as R,Qc as P,Sc as w,Yb as l,ic as n,ja as I,jc as i,ka as T,kc as c,lc as f,mc as _,oa as U,ob as N,oc as S,rb as a,tc as y,uc as d,xb as D,ya as g,za as h}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _e=e=>[e];function ge(e,s){if(e&1&&(f(0),n(1,"a",9),p(2),i(),_()),e&2){let t=s.$implicit;a(),l("routerLink",w(2,_e,t.url)),a(),L(" ",t.title,"")}}var ce=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-download"]],standalone:!1,decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(o,r){o&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),c(3,"nav-tab",2),i()(),n(4,"div")(5,"div",3)(6,"a",4),c(7,"i",5),i(),n(8,"div",6)(9,"div",7),m(10,ge,3,4,"ng-container",8),i()()()()(),c(11,"router-outlet")),o&2&&(a(3),l("Tabs",r.tabs),a(7),l("ngForOf",r.moreMenu))},dependencies:[x,Y,W,j],encapsulation:2})}}return e})();var E=(()=>{class e{constructor(t){this.httpService=t}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(o){return new(o||e)(U(J))}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Se=e=>({"background-color":e});function Ce(e,s){if(e&1&&(n(0,"th"),p(1),i()),e&2){let t=s.$implicit;a(),B(t.column)}}function ye(e,s){if(e&1&&(f(0),n(1,"td"),c(2,"span",6),i(),_()),e&2){let t=s.$implicit,o=d().$implicit;a(2),l("innerHTML",o[t.prop],N)}}function ve(e,s){if(e&1&&(n(0,"tr",5),m(1,ye,3,1,"ng-container",3),i()),e&2){let t=s.$implicit,o=d();l("ngStyle",w(2,Se,t.Status>200?"#F4D6D5":"#DEE9C9")),a(),l("ngForOf",o.configs)}}var de=(()=>{class e{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},standalone:!1,decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(o,r){o&1&&(n(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),m(4,Ce,2,1,"th",3),i()(),n(5,"tbody"),m(6,ve,2,4,"tr",4),i()()()),o&2&&(a(4),l("ngForOf",r.configs),a(2),l("ngForOf",r.data))},dependencies:[x,A],encapsulation:2})}}return e})();function xe(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onNewStepperState(u))}),c(2,"i",16),p(3," New "),i(),_()}}function be(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t),d();let r=v(11);return h(r.previous())}),p(2," Back "),i(),_()}}function Ee(e,s){if(e&1){let t=S();f(0),n(1,"button",17),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onStepperNext(u))}),p(2," Next "),i(),_()}}function De(e,s){if(e&1){let t=S();f(0),n(1,"button",18),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onSubmit(u))}),p(2,"Download"),i(),_()}if(e&2){let t=d();a(),l("disabled",!t.urls)}}function Ie(e,s){e&1&&(c(0,"i",19),n(1,"span"),p(2,"Instruction"),i())}function Te(e,s){e&1&&(n(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),p(4,"Note"),i()(),n(5,"div",24)(6,"ol",25)(7,"li"),p(8," Use this form to Download Products from Tokopedia using product URL "),i(),n(9,"li"),p(10," Copy Product URL from "),n(11,"a",26),p(12,"https://seller.tokopedia.com/ "),i(),p(13," and paste in this form "),i(),n(14,"li"),p(15," Use New Line when you want to input several product URLs "),i()()()()())}function Ue(e,s){e&1&&(c(0,"i",27),n(1,"span"),p(2,"Download"),i())}function Me(e,s){if(e&1){let t=S();n(0,"div",20)(1,"textarea",28),R("ngModelChange",function(r){g(t);let u=d();return F(u.urls,r)||(u.urls=r),h(r)}),i()()}if(e&2){let t=d();a(),l("placeholder",t.urlPlaceholder),O("ngModel",t.urls)}}function Ne(e,s){e&1&&(c(0,"i",29),n(1,"span"),p(2,"Finish"),i())}function ke(e,s){if(e&1&&(n(0,"div",20),c(1,"app-response-api-list",30),i()),e&2){let t=d();a(),l("data",t.downloadResponses)("configs",t.configs)}}function Be(e,s){e&1&&(n(0,"h6"),p(1,"1"),i())}function Le(e,s){e&1&&(n(0,"h6"),p(1,"2"),i())}function Oe(e,s){e&1&&(n(0,"h6"),p(1,"3"),i())}var ue=(()=>{class e{constructor(t,o){this.downloadService=t,this.authService=o,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
1
+ import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-BMYBLBSP.js";import{b as ie}from"./chunk-PHUHUFYL.js";import{a as X}from"./chunk-PL3Q6PGC.js";import"./chunk-EHUVS2VB.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import{a as Y,b as Z}from"./chunk-WRJFUNM3.js";import"./chunk-JVNHFIYT.js";import{i as Q}from"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as J}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PW42BQIY.js";import{m as ee,n as te}from"./chunk-HJXYT6MI.js";import{A as q,c as G,h as z,m as K}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as W,H as j,J as $,f as x,g as V,h as A,n as H}from"./chunk-FXQKRJWU.js";import{Fc as v,Gb as C,Gc as p,Hb as k,Hc as B,Ic as L,Ka as M,Kc as O,Lc as F,Mb as m,Mc as R,Qc as P,Sc as w,Yb as l,ic as n,ja as I,jc as i,ka as T,kc as c,lc as f,mc as _,oa as U,ob as N,oc as S,rb as a,tc as y,uc as d,xb as D,ya as g,za as h}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _e=e=>[e];function ge(e,s){if(e&1&&(f(0),n(1,"a",9),p(2),i(),_()),e&2){let t=s.$implicit;a(),l("routerLink",w(2,_e,t.url)),a(),L(" ",t.title,"")}}var ce=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-download"]],standalone:!1,decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(o,r){o&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),c(3,"nav-tab",2),i()(),n(4,"div")(5,"div",3)(6,"a",4),c(7,"i",5),i(),n(8,"div",6)(9,"div",7),m(10,ge,3,4,"ng-container",8),i()()()()(),c(11,"router-outlet")),o&2&&(a(3),l("Tabs",r.tabs),a(7),l("ngForOf",r.moreMenu))},dependencies:[x,Y,W,j],encapsulation:2})}}return e})();var E=(()=>{class e{constructor(t){this.httpService=t}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(o){return new(o||e)(U(J))}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Se=e=>({"background-color":e});function Ce(e,s){if(e&1&&(n(0,"th"),p(1),i()),e&2){let t=s.$implicit;a(),B(t.column)}}function ye(e,s){if(e&1&&(f(0),n(1,"td"),c(2,"span",6),i(),_()),e&2){let t=s.$implicit,o=d().$implicit;a(2),l("innerHTML",o[t.prop],N)}}function ve(e,s){if(e&1&&(n(0,"tr",5),m(1,ye,3,1,"ng-container",3),i()),e&2){let t=s.$implicit,o=d();l("ngStyle",w(2,Se,t.Status>200?"#F4D6D5":"#DEE9C9")),a(),l("ngForOf",o.configs)}}var de=(()=>{class e{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},standalone:!1,decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(o,r){o&1&&(n(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),m(4,Ce,2,1,"th",3),i()(),n(5,"tbody"),m(6,ve,2,4,"tr",4),i()()()),o&2&&(a(4),l("ngForOf",r.configs),a(2),l("ngForOf",r.data))},dependencies:[x,A],encapsulation:2})}}return e})();function xe(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onNewStepperState(u))}),c(2,"i",16),p(3," New "),i(),_()}}function be(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t),d();let r=v(11);return h(r.previous())}),p(2," Back "),i(),_()}}function Ee(e,s){if(e&1){let t=S();f(0),n(1,"button",17),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onStepperNext(u))}),p(2," Next "),i(),_()}}function De(e,s){if(e&1){let t=S();f(0),n(1,"button",18),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onSubmit(u))}),p(2,"Download"),i(),_()}if(e&2){let t=d();a(),l("disabled",!t.urls)}}function Ie(e,s){e&1&&(c(0,"i",19),n(1,"span"),p(2,"Instruction"),i())}function Te(e,s){e&1&&(n(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),p(4,"Note"),i()(),n(5,"div",24)(6,"ol",25)(7,"li"),p(8," Use this form to Download Products from Tokopedia using product URL "),i(),n(9,"li"),p(10," Copy Product URL from "),n(11,"a",26),p(12,"https://seller.tokopedia.com/ "),i(),p(13," and paste in this form "),i(),n(14,"li"),p(15," Use New Line when you want to input several product URLs "),i()()()()())}function Ue(e,s){e&1&&(c(0,"i",27),n(1,"span"),p(2,"Download"),i())}function Me(e,s){if(e&1){let t=S();n(0,"div",20)(1,"textarea",28),R("ngModelChange",function(r){g(t);let u=d();return F(u.urls,r)||(u.urls=r),h(r)}),i()()}if(e&2){let t=d();a(),l("placeholder",t.urlPlaceholder),O("ngModel",t.urls)}}function Ne(e,s){e&1&&(c(0,"i",29),n(1,"span"),p(2,"Finish"),i())}function ke(e,s){if(e&1&&(n(0,"div",20),c(1,"app-response-api-list",30),i()),e&2){let t=d();a(),l("data",t.downloadResponses)("configs",t.configs)}}function Be(e,s){e&1&&(n(0,"h6"),p(1,"1"),i())}function Le(e,s){e&1&&(n(0,"h6"),p(1,"2"),i())}function Oe(e,s){e&1&&(n(0,"h6"),p(1,"3"),i())}var ue=(()=>{class e{constructor(t,o){this.downloadService=t,this.authService=o,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
2
2
  https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(t){this.stepperState=t.selectedStep.state}onSubmit(t){let o=this.urls.split(/\r?\n/);this.downloadService.download(o).subscribe(r=>{this.downloadResponses=r,this.mappingLinkToProduct(),this.onStepperNext(t)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(t=>(t.Name=t?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${t.ID}" target="_blank">
3
3
  ${t?.Name}
4
4
  </a>`:"-",t))}onNewStepperState(t){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",t.reset(),this.onStepperNext(t)}onStepperNext(t){t.selected.completed=!0,t.next()}static{this.\u0275fac=function(o){return new(o||e)(D(E),D(Q))}}static{this.\u0275cmp=C({type:e,selectors:[["app-by-url"]],standalone:!1,features:[P([{provide:ne,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(o,r){if(o&1){let u=S();n(0,"mainpanel",1)(1,"actions"),m(2,xe,4,0,"ng-container",2)(3,be,3,0,"ng-container",2)(4,Ee,3,0,"ng-container",2)(5,De,3,1,"ng-container",2),i(),n(6,"content")(7,"div",3)(8,"div",4)(9,"div",5)(10,"mat-stepper",6,0),y("selectionChange",function(fe){return g(u),h(r.onStepperChange(fe))}),n(12,"mat-step",7),m(13,Ie,3,0,"ng-template",8)(14,Te,16,0,"ng-template",9),i(),n(15,"mat-step",10),m(16,Ue,3,0,"ng-template",8)(17,Me,2,2,"ng-template",9),i(),n(18,"mat-step",11),m(19,Ne,3,0,"ng-template",8)(20,ke,2,2,"ng-template",9),i(),m(21,Be,2,0,"ng-template",12)(22,Le,2,0,"ng-template",13)(23,Oe,2,0,"ng-template",14),i()()()()()()}o&2&&(l("hideSearchBox",!0)("hideSearchDropdown",!0),a(2),l("ngIf",r.stepperState=="FINISH"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(),l("ngIf",r.stepperState=="GUIDE"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(5),l("selectedIndex",1),a(2),l("editable",r.stepperState!="FINISH")("completed",!0),a(3),l("editable",r.stepperState!="FINISH")("completed",!1))},dependencies:[V,G,z,K,ee,le,oe,pe,re,ae,de],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
@@ -0,0 +1 @@
1
+ import{a as V,b as ft}from"./chunk-45FZJ4W3.js";import"./chunk-YERZ6W22.js";import{a as ut}from"./chunk-CWXOXH6M.js";import{a as dt}from"./chunk-LDL3A7NM.js";import"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{e as mt}from"./chunk-PYXL7UF7.js";import"./chunk-PW42BQIY.js";import{m as st,n as pt}from"./chunk-HJXYT6MI.js";import{A as ct,h as rt,m as lt}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as at,J as ot,d as Q,f as X,g as Z,j as tt,k as et,m as it,n as nt}from"./chunk-FXQKRJWU.js";import{$c as g,Fc as $,Gb as T,Gc as o,Hc as C,Ic as _,Jc as A,Kc as H,Lc as W,Mb as p,Mc as q,Nc as J,Qc as j,Ra as w,Rc as z,Sc as K,Tc as U,Uc as Y,Yb as s,Z as D,ac as F,ad as E,bd as y,cd as G,dc as S,ec as L,gc as k,hc as B,ic as e,jc as n,kc as R,lc as h,mc as N,oc as O,pa as P,pb as M,rb as r,tc as I,uc as f,v as b,ya as d,za as u}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _t=(t,c)=>({"bg-gradient-danger":t,"bg-gradient-warning":c}),gt=()=>["/menu/products/status/notification/detailV2"],St=t=>({ID:t}),Ct=(t,c,i)=>({"text-warning":t,"text-success":c,"text-danger":i});function vt(t,c){t&1&&(e(0,"div"),o(1," Scan in progress. You will be notified once it is complete. "),n())}function xt(t,c){if(t&1&&(e(0,"div"),o(1),g(2,"number"),n()),t&2){let i=c.$implicit;r(),A(" ",i.Key,": ",E(2,2,i.Value)," ")}}function ht(t,c){if(t&1&&(e(0,"div",22)(1,"div",21),o(2,"Status Product:"),n(),k(3,xt,3,4,"div",null,L),n()),t&2){let i=f(2).$implicit;r(3),B(i.ParsedStatus)}}function Nt(t,c){if(t&1&&(e(0,"div",21),o(1),n(),e(2,"div"),o(3),n(),p(4,ht,5,0,"div",22)),t&2){let i=f().$implicit;r(),_(" ",i.ProcessLabel," "),r(2),C(i.ProcessDescription),r(),S(i!=null&&i.ParsedStatus&&(i==null||i.ParsedStatus==null?null:i.ParsedStatus.length)>0?4:-1)}}function It(t,c){if(t&1&&(h(0),o(1),g(2,"number"),e(3,"span"),o(4,"s"),n(),N()),t&2){let i=f().$implicit;r(),_(" ",y(2,1,i.DurationInSecond,"1.1-1")," ")}}function Et(t,c){t&1&&o(0," - ")}function yt(t,c){t&1&&o(0," In Progress ")}function Vt(t,c){t&1&&o(0," Completed ")}function bt(t,c){t&1&&o(0," Failed ")}function Dt(t,c){if(t&1&&(h(0),e(1,"tr",16)(2,"td")(3,"a",17),o(4),n()(),e(5,"td")(6,"div",18),R(7,"img",19),e(8,"span"),o(9),n()()(),e(10,"td"),p(11,vt,2,0,"div")(12,Nt,5,3),n(),e(13,"td"),p(14,It,5,4,"ng-container",20)(15,Et,1,0,"ng-template",null,0,G),n(),e(17,"td")(18,"div",21),p(19,yt,1,0)(20,Vt,1,0)(21,bt,1,0),n()(),e(22,"td",22)(23,"div"),o(24),n(),e(25,"div"),o(26),g(27,"date"),n()()(),N()),t&2){let i,a=c.$implicit,m=$(16),l=f();r(),s("ngClass",U(17,_t,a.Status==1,a.Status==0)),r(2),s("routerLink",z(20,gt))("queryParams",K(21,St,a.ID)),r(),_(" ",a.ID," "),r(3),s("src",a.Img,M),r(2),C(a.ChannelName),r(2),S(a.StateID==l.scanState.InProgress?11:12),r(3),s("ngIf",a.DurationInSecond)("ngIfElse",m),r(4),F(Y(23,Ct,a.StateID==l.scanState.InProgress,a.StateID==l.scanState.Completed,a.StateID==l.scanState.Failed)),r(),S((i=a.StateID)===l.scanState.InProgress?19:i===l.scanState.Completed?20:i===l.scanState.Failed?21:-1),r(5),C(a.LoginID),r(2),_(" ",y(27,14,a.Created,"dd MMM yyyy HH:mm")," ")}}var Kt=(()=>{class t{constructor(){this.notificationService=P(V),this.filter=w({RowCount:20,PageNumber:1,ChannelID:null}),this.scanState=ft,this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotificationList(this.filter()).pipe(b(i=>(i.Data=i.Data.map(a=>(a.StatusProduct&&(a.ParsedStatus=JSON.parse(a.StatusProduct)),a)),i)),D(1))}onFilter(){this.initNotifications()}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-notificationV2"]],features:[j([V])],decls:36,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/notification",1,"btn","btn-outline-secondary","btn-lg"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","260px"],[4,"ngFor","ngForOf"],[1,"col-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked"],[3,"ngClass"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","gap-3"],[1,"channelLogo-md",3,"src","alt"],[4,"ngIf","ngIfElse"],[1,"fw-bold"],[1,"lh-base"]],template:function(a,m){if(a&1){let l=O();J(0),g(1,"async"),e(2,"mainpanel",1),I("onSubmit",function(){return d(l),u(m.onFilter())}),e(3,"actions")(4,"a",2),o(5," Back "),n()(),e(6,"filters")(7,"div")(8,"label",3),o(9,"Channel"),n(),e(10,"channel-select-options",4),q("ngModelChange",function(x){return d(l),W(m.filter().ChannelID,x)||(m.filter().ChannelID=x),u(x)}),n()()(),e(11,"content")(12,"div",5)(13,"div",6)(14,"div",7)(15,"div",8)(16,"table",9)(17,"thead",10)(18,"tr",11)(19,"th",12),o(20,"Job ID"),n(),e(21,"th"),o(22,"Channel"),n(),e(23,"th"),o(24,"Process"),n(),e(25,"th"),o(26,"Duration"),n(),e(27,"th"),o(28,"Status"),n(),e(29,"th"),o(30,"Creator"),n()()(),e(31,"tbody"),p(32,Dt,28,27,"ng-container",13),n()()()()(),e(33,"div",6)(34,"div",14)(35,"app-custom-paginator",15),I("next",function(){return d(l),u(m.initNotifications())})("previous",function(){return d(l),u(m.initNotifications())}),n()()()()()()}if(a&2){let l=E(1,7,m.notifications$);r(2),s("hideSearchBox",!0),r(8),H("ngModel",m.filter().ChannelID),r(22),s("ngForOf",l==null?null:l.Data),r(3),s("filter",m.filter())("totaldata",l==null||l.Data==null?null:l.Data.length)("paginationTotal",l==null?null:l.Count)("hasClicked",!0)}},dependencies:[nt,Q,X,Z,tt,it,et,ct,rt,lt,pt,st,dt,mt,ot,at,ut],encapsulation:2})}}return t})();export{Kt as NotificationV2Component};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-ORLTYLPA.js";import{a as C}from"./chunk-IITU3NV6.js";import{a as h,b as y}from"./chunk-WRJFUNM3.js";import"./chunk-FHWKSD5A.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PW42BQIY.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as v,J as o,n}from"./chunk-FXQKRJWU.js";import{Gb as l,Hb as s,Qc as f,Yb as u,ic as c,jc as d,ka as m,kc as i,rb as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-L7TKCTLD.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-4LZODV4E.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-YB4KXB2C.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};
1
+ import{a as r}from"./chunk-PL3Q6PGC.js";import{a as C}from"./chunk-IITU3NV6.js";import{a as h,b as y}from"./chunk-WRJFUNM3.js";import"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PW42BQIY.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as v,J as o,n}from"./chunk-FXQKRJWU.js";import{Gb as l,Hb as s,Qc as f,Yb as u,ic as c,jc as d,ka as m,kc as i,rb as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-YXBR6VYQ.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-FNU2TKTQ.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-3434HH7H.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};
@@ -1 +1 @@
1
- import{a as fe,b as _e}from"./chunk-FGRPTNDB.js";import{a as ge}from"./chunk-EHBCYQSG.js";import{a as pe}from"./chunk-A44LN77B.js";import{a as le,b as se}from"./chunk-PQQSREEC.js";import{b as de}from"./chunk-GRYGUILI.js";import{b as me}from"./chunk-OXWPLJEW.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as ue}from"./chunk-2XWZQCUR.js";import{a as he}from"./chunk-RGAWEFPQ.js";import{c as Ce,d as U,e as W}from"./chunk-NWWYOZ4V.js";import"./chunk-YTCIQBSO.js";import"./chunk-LYPHZP72.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-RHHHL4OR.js";import{a as ce}from"./chunk-KRQHTRFM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import{na as re}from"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-3YP6ORBR.js";import"./chunk-6VYFG4AQ.js";import{i as R}from"./chunk-FHWKSD5A.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as k}from"./chunk-CGOB6Y3X.js";import{b as ee,e as te}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as O}from"./chunk-PW42BQIY.js";import{d as ie,l as ne,m as oe,n as ae}from"./chunk-HJXYT6MI.js";import{A as N,a as Y,c as Z,h as L,m as E,o as $}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as K,j as Q,m as X,n as F}from"./chunk-FXQKRJWU.js";import{$c as v,G as j,Gb as T,Gc as C,Hc as B,Kb as z,Kc as _,Lc as P,Mb as f,Mc as w,Nc as q,Oa as V,Qc as D,Ra as M,Yb as m,Z as G,ad as x,dc as J,ea as H,ic as r,jc as p,kc as y,oc as I,pa as S,pb as A,rb as d,tc as u,uc as h,xb as b,ya as l,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function be(o,g){if(o&1&&(r(0,"div",6),y(1,"img",7),r(2,"div"),C(3),p()()),o&2){let e=g.$implicit;d(),m("src",e.logo,A),d(2),B(e.Name)}}function ye(o,g){if(o&1){let e=I();r(0,"p-multiselect",4,0),u("click",function(){l(e);let t=h();return s(t.onClickSelect())}),w("ngModelChange",function(t){l(e);let n=h();return P(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){l(e);let n=h();return s(n.onChannelChange(t))}),f(2,be,4,2,"ng-template",5),p()}if(o&2){let e=h();m("options",e.options())("placeholder",e.placeholder()),_("ngModel",e.selectedChannels),m("showClear",e.clearable())("autofocusFilter",!0)("maxSelectedLabels",e.maxSelectedLabels())}}function Ie(o,g){if(o&1&&(r(0,"div",6),y(1,"img",7),r(2,"div"),C(3),p()()),o&2){let e=g.$implicit;d(),m("src",e.logo,A),d(2),B(e.Name)}}function Ve(o,g){if(o&1){let e=I();r(0,"p-select",8,1),u("click",function(){l(e);let t=h();return s(t.onClickSelect())}),w("ngModelChange",function(t){l(e);let n=h();return P(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){l(e);let n=h();return s(n.onChannelChange(t))}),f(2,Ie,4,2,"ng-template",5),p()}if(o&2){let e=h();m("options",e.options())("placeholder",e.placeholder()),_("ngModel",e.selectedChannels),m("showClear",e.clearable())("autofocusFilter",!0)("filter",!0)}}var Pe=(()=>{class o extends pe{constructor(){super(),this.authService=S(R),this.multiple=V(!1),this.clearable=V(!0),this.placeholder=V("Select Channels"),this.options=M(this.authService.getChannels()),this.maxSelectedLabels=V(6),this.onChange=e=>{},this.options.update(e=>e.map(i=>(i.logo=O.getChannelLogoByTypeId(i.TypeID),i)))}ngAfterViewInit(){this.initTopPosition()}onChannelChange(e){this.onChange(e)}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=T({type:o,selectors:[["app-channel-options-v2"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"],placeholder:[1,"placeholder"],maxSelectedLabels:[1,"maxSelectedLabels"]},features:[D([{provide:Y,multi:!0,useExisting:o}]),z],decls:2,vars:1,consts:[["multiSelect",""],["select",""],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","filter"],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["pTemplate","item"],[1,"d-flex","align-items-center","gap-2"],[2,"width","18px",3,"src"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","filter"]],template:function(i,t){i&1&&f(0,ye,3,6,"p-multiselect",2)(1,Ve,3,6,"p-select",3),i&2&&J(t.multiple()?0:1)},dependencies:[F,_e,fe,re,me,N,L,E,se,le],encapsulation:2})}}return o})();function Me(o,g){if(o&1){let e=I();r(0,"button",16),u("click",function(){l(e);let t=h().ngIf,n=h();return s(n.onUpdateItems(t))}),y(1,"i",17),C(2," Update "),p()}}function ve(o,g){if(o&1&&(r(0,"div"),f(1,Me,3,0,"button",15),p()),o&2){let e=g.ngIf,i=h();d(),m("ngIf",i.productService.hasSelectionVariant(e))}}var ht=(()=>{class o{constructor(e,i,t,n,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=c,this.infinitePagination=S(U),this.updateResHandling=S(W),this.mainPanelService=S(ne),this.channelOptions=M([]),this.searchFilter=M({PageNumber:1,RowCount:50,filterModel:1,text:"",ListChannelID:[]}),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(G())}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(H(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter.set(e.Filter),this.mainPanelService.openModalFilter()}))}onShowDifferencePrice(e){let i=1;e&&(i=3),this.searchFilter.update(t=>(t.filterModel=i,t)),this.infinitePagination.reloadPagination(this.searchFilter())}onSearch(e){this.searchFilter.update(i=>(i.text=e,i)),this.infinitePagination.reloadPagination(this.searchFilter()),this.filterSelectedChannels()}onUpdateItems(e){let i=JSON.parse(JSON.stringify(this.channelOptions())),t=this.productService.selectedVariantProduct(e);this.dialog.open(he,{data:{title:"Updating Price",selectedItems:t,channels:i},width:"400px"}).afterClosed().pipe(j(n=>O.IsNotEmpty(n))).subscribe(n=>{this.channelOptions.set(n),this.updatePrice(e)})}filterSelectedChannels(){let i=this.authService.getChannels().filter(t=>this.searchFilter().ListChannelID?.indexOf(t.ID)!==-1);this.channelOptions.set(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(a=>({ID:a.ID,Code:a.Code,Price:a.UnitPrice})),c={ListChannelID:this.getSelectedChannels().map(a=>a.ID),ListPrice:t};this.http.post(k.UpdateChannelPrice,c).subscribe(a=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(a),this.resetSelectedChannels()})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post(k.UpdatePriceById,i).subscribe(t=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(t)})}handlingUpdatePrice(e){let i=e?.Response?.success_list,t=e?.Response?.failure_list,n=this.getSelectedChannels();i?.length>0||t?.length>0?this.updateResHandling.responseHandling(i,t,"Price",n):this.toastr.error(e[0]?.Exception,"Error")}openExportDialog(){this.dialog.open(de,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}resetSelectedChannels(){this.channelOptions.update(e=>(e.forEach(i=>{i.selected=!1}),e))}getSelectedChannels(){return this.channelOptions().filter(e=>e.selected)}static{this.\u0275fac=function(i){return new(i||o)(b(te),b(ee),b(ie),b(ce),b(R))}}static{this.\u0275cmp=T({type:o,selectors:[["app-price-pos-channel"]],features:[D([U,X,ge,W])],decls:32,vars:23,consts:[["headerTitle","Price Comparison","textButton","Search",3,"onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["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"]],template:function(i,t){if(i&1){let n=I();q(0),v(1,"async"),r(2,"mainpanel",0),u("onSubmit",function(a){return l(n),s(t.onSearch(a))}),r(3,"actions")(4,"div",1),f(5,ve,2,1,"div",2),v(6,"async"),r(7,"button",3),u("click",function(){return l(n),s(t.openExportDialog())}),y(8,"i",4),r(9,"span"),C(10,"Export"),p()()()(),r(11,"filters")(12,"div",5)(13,"label",6),C(14,"Channel"),p(),r(15,"app-channel-options-v2",7),w("ngModelChange",function(a){return l(n),P(t.searchFilter().ListChannelID,a)||(t.searchFilter().ListChannelID=a),s(a)}),p()(),r(16,"div",5)(17,"label",8),C(18,"Page Number"),p(),r(19,"input",9),w("ngModelChange",function(a){return l(n),P(t.searchFilter().PageNumber,a)||(t.searchFilter().PageNumber=a),s(a)}),p()(),r(20,"div")(21,"label",8),C(22,"Page Size"),p(),r(23,"input",9),w("ngModelChange",function(a){return l(n),P(t.searchFilter().RowCount,a)||(t.searchFilter().RowCount=a),s(a)}),p()()(),r(24,"content")(25,"div",10)(26,"div",11)(27,"div",12)(28,"app-table",13),v(29,"async"),u("onToggle",function(a){return l(n),s(t.onShowDifferencePrice(a))})("onSubmit",function(a){return l(n),s(t.updatePriceByVariant(a))}),p(),r(30,"infinite-paginator",14),v(31,"async"),u("onNextPage",function(){return l(n),s(t.infinitePagination.onNextPage(t.searchFilter()))})("onLastPage",function(){return l(n),s(t.infinitePagination.onLastPage(t.searchFilter()))})("onGetRowCount",function(){return l(n),s(t.infinitePagination.getRowCount(t.searchFilter()))}),p()()()()()()}i&2&&(x(1,15,t.loader$),d(5),m("ngIf",x(6,17,t.data$)),d(10),m("multiple",!0),_("ngModel",t.searchFilter().ListChannelID),d(4),_("ngModel",t.searchFilter().PageNumber),d(4),_("ngModel",t.searchFilter().RowCount),d(5),m("showProductToggle",!0)("data",x(29,19,t.data$))("channel",t.channelOptions())("hiddenIPOSInventory",!1),d(2),m("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",x(31,21,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[F,K,Q,N,Z,$,L,E,Ce,ae,oe,ue,Pe],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return o})();export{ht as PricePosChannelComponent};
1
+ import{a as fe,b as _e}from"./chunk-FGRPTNDB.js";import{a as ge}from"./chunk-EHBCYQSG.js";import{a as pe}from"./chunk-A44LN77B.js";import{a as le,b as se}from"./chunk-PQQSREEC.js";import{b as de}from"./chunk-GRYGUILI.js";import{b as me}from"./chunk-OXWPLJEW.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as ue}from"./chunk-HGZ5B6WR.js";import{a as he}from"./chunk-RGAWEFPQ.js";import{c as Ce,d as U,e as W}from"./chunk-NWWYOZ4V.js";import"./chunk-YTCIQBSO.js";import"./chunk-LYPHZP72.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-RHHHL4OR.js";import{a as ce}from"./chunk-PE4SWUEZ.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import{na as re}from"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-3YP6ORBR.js";import"./chunk-6RMBCW2O.js";import{i as R}from"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as k}from"./chunk-CGOB6Y3X.js";import{b as ee,e as te}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as O}from"./chunk-PW42BQIY.js";import{d as ie,l as ne,m as oe,n as ae}from"./chunk-HJXYT6MI.js";import{A as N,a as Y,c as Z,h as L,m as E,o as $}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as K,j as Q,m as X,n as F}from"./chunk-FXQKRJWU.js";import{$c as v,G as j,Gb as T,Gc as C,Hc as B,Kb as z,Kc as _,Lc as P,Mb as f,Mc as w,Nc as q,Oa as V,Qc as D,Ra as M,Yb as m,Z as G,ad as x,dc as J,ea as H,ic as r,jc as p,kc as y,oc as I,pa as S,pb as A,rb as d,tc as u,uc as h,xb as b,ya as l,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function be(o,g){if(o&1&&(r(0,"div",6),y(1,"img",7),r(2,"div"),C(3),p()()),o&2){let e=g.$implicit;d(),m("src",e.logo,A),d(2),B(e.Name)}}function ye(o,g){if(o&1){let e=I();r(0,"p-multiselect",4,0),u("click",function(){l(e);let t=h();return s(t.onClickSelect())}),w("ngModelChange",function(t){l(e);let n=h();return P(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){l(e);let n=h();return s(n.onChannelChange(t))}),f(2,be,4,2,"ng-template",5),p()}if(o&2){let e=h();m("options",e.options())("placeholder",e.placeholder()),_("ngModel",e.selectedChannels),m("showClear",e.clearable())("autofocusFilter",!0)("maxSelectedLabels",e.maxSelectedLabels())}}function Ie(o,g){if(o&1&&(r(0,"div",6),y(1,"img",7),r(2,"div"),C(3),p()()),o&2){let e=g.$implicit;d(),m("src",e.logo,A),d(2),B(e.Name)}}function Ve(o,g){if(o&1){let e=I();r(0,"p-select",8,1),u("click",function(){l(e);let t=h();return s(t.onClickSelect())}),w("ngModelChange",function(t){l(e);let n=h();return P(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){l(e);let n=h();return s(n.onChannelChange(t))}),f(2,Ie,4,2,"ng-template",5),p()}if(o&2){let e=h();m("options",e.options())("placeholder",e.placeholder()),_("ngModel",e.selectedChannels),m("showClear",e.clearable())("autofocusFilter",!0)("filter",!0)}}var Pe=(()=>{class o extends pe{constructor(){super(),this.authService=S(R),this.multiple=V(!1),this.clearable=V(!0),this.placeholder=V("Select Channels"),this.options=M(this.authService.getChannels()),this.maxSelectedLabels=V(6),this.onChange=e=>{},this.options.update(e=>e.map(i=>(i.logo=O.getChannelLogoByTypeId(i.TypeID),i)))}ngAfterViewInit(){this.initTopPosition()}onChannelChange(e){this.onChange(e)}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=T({type:o,selectors:[["app-channel-options-v2"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"],placeholder:[1,"placeholder"],maxSelectedLabels:[1,"maxSelectedLabels"]},features:[D([{provide:Y,multi:!0,useExisting:o}]),z],decls:2,vars:1,consts:[["multiSelect",""],["select",""],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","filter"],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["pTemplate","item"],[1,"d-flex","align-items-center","gap-2"],[2,"width","18px",3,"src"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","filter"]],template:function(i,t){i&1&&f(0,ye,3,6,"p-multiselect",2)(1,Ve,3,6,"p-select",3),i&2&&J(t.multiple()?0:1)},dependencies:[F,_e,fe,re,me,N,L,E,se,le],encapsulation:2})}}return o})();function Me(o,g){if(o&1){let e=I();r(0,"button",16),u("click",function(){l(e);let t=h().ngIf,n=h();return s(n.onUpdateItems(t))}),y(1,"i",17),C(2," Update "),p()}}function ve(o,g){if(o&1&&(r(0,"div"),f(1,Me,3,0,"button",15),p()),o&2){let e=g.ngIf,i=h();d(),m("ngIf",i.productService.hasSelectionVariant(e))}}var ht=(()=>{class o{constructor(e,i,t,n,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=c,this.infinitePagination=S(U),this.updateResHandling=S(W),this.mainPanelService=S(ne),this.channelOptions=M([]),this.searchFilter=M({PageNumber:1,RowCount:50,filterModel:1,text:"",ListChannelID:[]}),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(G())}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(H(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter.set(e.Filter),this.mainPanelService.openModalFilter()}))}onShowDifferencePrice(e){let i=1;e&&(i=3),this.searchFilter.update(t=>(t.filterModel=i,t)),this.infinitePagination.reloadPagination(this.searchFilter())}onSearch(e){this.searchFilter.update(i=>(i.text=e,i)),this.infinitePagination.reloadPagination(this.searchFilter()),this.filterSelectedChannels()}onUpdateItems(e){let i=JSON.parse(JSON.stringify(this.channelOptions())),t=this.productService.selectedVariantProduct(e);this.dialog.open(he,{data:{title:"Updating Price",selectedItems:t,channels:i},width:"400px"}).afterClosed().pipe(j(n=>O.IsNotEmpty(n))).subscribe(n=>{this.channelOptions.set(n),this.updatePrice(e)})}filterSelectedChannels(){let i=this.authService.getChannels().filter(t=>this.searchFilter().ListChannelID?.indexOf(t.ID)!==-1);this.channelOptions.set(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(a=>({ID:a.ID,Code:a.Code,Price:a.UnitPrice})),c={ListChannelID:this.getSelectedChannels().map(a=>a.ID),ListPrice:t};this.http.post(k.UpdateChannelPrice,c).subscribe(a=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(a),this.resetSelectedChannels()})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post(k.UpdatePriceById,i).subscribe(t=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(t)})}handlingUpdatePrice(e){let i=e?.Response?.success_list,t=e?.Response?.failure_list,n=this.getSelectedChannels();i?.length>0||t?.length>0?this.updateResHandling.responseHandling(i,t,"Price",n):this.toastr.error(e[0]?.Exception,"Error")}openExportDialog(){this.dialog.open(de,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}resetSelectedChannels(){this.channelOptions.update(e=>(e.forEach(i=>{i.selected=!1}),e))}getSelectedChannels(){return this.channelOptions().filter(e=>e.selected)}static{this.\u0275fac=function(i){return new(i||o)(b(te),b(ee),b(ie),b(ce),b(R))}}static{this.\u0275cmp=T({type:o,selectors:[["app-price-pos-channel"]],features:[D([U,X,ge,W])],decls:32,vars:23,consts:[["headerTitle","Price Comparison","textButton","Search",3,"onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["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"]],template:function(i,t){if(i&1){let n=I();q(0),v(1,"async"),r(2,"mainpanel",0),u("onSubmit",function(a){return l(n),s(t.onSearch(a))}),r(3,"actions")(4,"div",1),f(5,ve,2,1,"div",2),v(6,"async"),r(7,"button",3),u("click",function(){return l(n),s(t.openExportDialog())}),y(8,"i",4),r(9,"span"),C(10,"Export"),p()()()(),r(11,"filters")(12,"div",5)(13,"label",6),C(14,"Channel"),p(),r(15,"app-channel-options-v2",7),w("ngModelChange",function(a){return l(n),P(t.searchFilter().ListChannelID,a)||(t.searchFilter().ListChannelID=a),s(a)}),p()(),r(16,"div",5)(17,"label",8),C(18,"Page Number"),p(),r(19,"input",9),w("ngModelChange",function(a){return l(n),P(t.searchFilter().PageNumber,a)||(t.searchFilter().PageNumber=a),s(a)}),p()(),r(20,"div")(21,"label",8),C(22,"Page Size"),p(),r(23,"input",9),w("ngModelChange",function(a){return l(n),P(t.searchFilter().RowCount,a)||(t.searchFilter().RowCount=a),s(a)}),p()()(),r(24,"content")(25,"div",10)(26,"div",11)(27,"div",12)(28,"app-table",13),v(29,"async"),u("onToggle",function(a){return l(n),s(t.onShowDifferencePrice(a))})("onSubmit",function(a){return l(n),s(t.updatePriceByVariant(a))}),p(),r(30,"infinite-paginator",14),v(31,"async"),u("onNextPage",function(){return l(n),s(t.infinitePagination.onNextPage(t.searchFilter()))})("onLastPage",function(){return l(n),s(t.infinitePagination.onLastPage(t.searchFilter()))})("onGetRowCount",function(){return l(n),s(t.infinitePagination.getRowCount(t.searchFilter()))}),p()()()()()()}i&2&&(x(1,15,t.loader$),d(5),m("ngIf",x(6,17,t.data$)),d(10),m("multiple",!0),_("ngModel",t.searchFilter().ListChannelID),d(4),_("ngModel",t.searchFilter().PageNumber),d(4),_("ngModel",t.searchFilter().RowCount),d(5),m("showProductToggle",!0)("data",x(29,19,t.data$))("channel",t.channelOptions())("hiddenIPOSInventory",!1),d(2),m("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",x(31,21,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[F,K,Q,N,Z,$,L,E,Ce,ae,oe,ue,Pe],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return o})();export{ht as PricePosChannelComponent};
@@ -1 +1 @@
1
- import{f as L}from"./chunk-FHWKSD5A.js";import{c as o}from"./chunk-PW42BQIY.js";import{H as y,J as D,n as b}from"./chunk-FXQKRJWU.js";import{Gb as v,Gc as u,Ic as d,Mb as I,Oa as _,Tc as C,Yb as s,dc as x,ic as m,ja as h,jc as c,pa as i,pb as k,rb as l,rd as f,uc as p}from"./chunk-OJMQBH6T.js";var O=(()=>{class e{constructor(){this.localDataService=i(L),this.baseUrl=this.localDataService.getHostName()}getBaseUrl(r){let t="";return o.IsNotEmpty(r.ID)?t=`https://${this.baseUrl}/menu/Orders/Orders/Customer_Invoice/Info?ID=${r.ID}`:t="/menu/Order/detail",t}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var S=(e,a)=>({Number:e,Outlet:a});function U(e,a){if(e&1&&(m(0,"a",0),u(1),c()),e&2){let r,t=p();s("href",t.baseUrl(),k),l(),d(" ",(r=t.order())==null?null:r.Number," ")}}function N(e,a){if(e&1&&(m(0,"a",1),u(1),c()),e&2){let r,t,n=p();s("routerLink",n.baseUrl())("queryParams",C(3,S,(r=n.order())==null?null:r.Number,(r=n.order())==null?null:r.Outlet)),l(),d(" ",(t=n.order())==null?null:t.Number," ")}}var G=(()=>{class e{constructor(){this.order=_(),this.generateLinkService=i(O),this.baseUrl=f(()=>this.generateLinkService.getBaseUrl(this.order())),this.hasOrderID=f(()=>o.IsNotEmpty(this.order()?.ID))}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=v({type:e,selectors:[["order-link"]],inputs:{order:[1,"order"]},decls:2,vars:1,consts:[["target","_blank",3,"href"],["target","_blank",3,"routerLink","queryParams"]],template:function(t,n){t&1&&I(0,U,2,2,"a",0)(1,N,2,6,"a",1),t&2&&x(n.hasOrderID()?0:1)},dependencies:[b,D,y],encapsulation:2})}}return e})();export{G as a};
1
+ import{f as L}from"./chunk-WWLC64XZ.js";import{c as o}from"./chunk-PW42BQIY.js";import{H as y,J as D,n as b}from"./chunk-FXQKRJWU.js";import{Gb as v,Gc as u,Ic as d,Mb as I,Oa as _,Tc as C,Yb as s,dc as x,ic as m,ja as h,jc as c,pa as i,pb as k,rb as l,rd as f,uc as p}from"./chunk-OJMQBH6T.js";var O=(()=>{class e{constructor(){this.localDataService=i(L),this.baseUrl=this.localDataService.getHostName()}getBaseUrl(r){let t="";return o.IsNotEmpty(r.ID)?t=`https://${this.baseUrl}/menu/Orders/Orders/Customer_Invoice/Info?ID=${r.ID}`:t="/menu/Order/detail",t}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var S=(e,a)=>({Number:e,Outlet:a});function U(e,a){if(e&1&&(m(0,"a",0),u(1),c()),e&2){let r,t=p();s("href",t.baseUrl(),k),l(),d(" ",(r=t.order())==null?null:r.Number," ")}}function N(e,a){if(e&1&&(m(0,"a",1),u(1),c()),e&2){let r,t,n=p();s("routerLink",n.baseUrl())("queryParams",C(3,S,(r=n.order())==null?null:r.Number,(r=n.order())==null?null:r.Outlet)),l(),d(" ",(t=n.order())==null?null:t.Number," ")}}var G=(()=>{class e{constructor(){this.order=_(),this.generateLinkService=i(O),this.baseUrl=f(()=>this.generateLinkService.getBaseUrl(this.order())),this.hasOrderID=f(()=>o.IsNotEmpty(this.order()?.ID))}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=v({type:e,selectors:[["order-link"]],inputs:{order:[1,"order"]},decls:2,vars:1,consts:[["target","_blank",3,"href"],["target","_blank",3,"routerLink","queryParams"]],template:function(t,n){t&1&&I(0,U,2,2,"a",0)(1,N,2,6,"a",1),t&2&&x(n.hasOrderID()?0:1)},dependencies:[b,D,y],encapsulation:2})}}return e})();export{G as a};
@@ -0,0 +1 @@
1
+ import{a as D,b as z}from"./chunk-45FZJ4W3.js";import"./chunk-YERZ6W22.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PW42BQIY.js";import{m as G,n as J}from"./chunk-HJXYT6MI.js";import"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{r as q}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{E as O,H as j,J as $,g as B,j as F,k as N,m as A,n as H}from"./chunk-FXQKRJWU.js";import{$c as f,Gb as M,Gc as n,Hc as s,Ic as I,Mb as m,Qc as k,Ra as u,Uc as R,Yb as p,Z as E,aa as P,ac as w,ad as V,bd as T,dc as L,ic as i,jc as t,kc as C,lc as S,mc as b,oc as y,pa as _,rb as r,tc as h,uc as d,ya as x,za as g}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var K=(a,c,o)=>({"text-warning":a,"text-success":c,"text-danger":o});function Q(a,c){a&1&&n(0," In Progress ")}function U(a,c){a&1&&n(0," Completed ")}function W(a,c){a&1&&n(0," Failed ")}function X(a,c){if(a&1){let o=y();i(0,"div",15)(1,"div",17)(2,"div",18)(3,"h5"),n(4,"PerfLog"),t(),i(5,"div")(6,"button",19),h("click",function(){x(o);let l=d().ngIf,v=d();return g(v.copyPerfLogToClipboard(l))}),C(7,"i",20),t()()(),i(8,"div",21)(9,"div",22)(10,"div",23)(11,"pre"),n(12),t()()()()()()}if(a&2){let o=d().ngIf,e=d();r(6),p("matTooltip",e.copyToClipboardPerflog()),r(6),s(o.PerfLog)}}function Y(a,c){if(a&1&&(S(0),i(1,"div",25)(2,"div",17)(3,"div",7)(4,"h5"),n(5,"StackTrace"),t()(),i(6,"div",8)(7,"div",22)(8,"div",23)(9,"pre"),n(10),t()()()()()(),b()),a&2){let o=d().ngIf;r(10),s(o==null?null:o.Exception)}}function Z(a,c){if(a&1){let o=y();S(0),i(1,"mainpanel",1)(2,"actions")(3,"a",2),n(4,"Back"),t()(),i(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),n(12,"General"),t()(),i(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),n(18,"Created Date"),t(),i(19,"div")(20,"span"),n(21),f(22,"date"),t()()()(),i(23,"div",12)(24,"div",11)(25,"label"),n(26,"Duration"),t(),i(27,"div",13)(28,"span"),n(29),f(30,"number"),t()()()(),i(31,"div",14)(32,"div",11)(33,"label"),n(34,"Creator"),t(),i(35,"div")(36,"span"),n(37),t()()()(),i(38,"div",15)(39,"div",11)(40,"label"),n(41,"Status"),t(),i(42,"div"),m(43,Q,1,0)(44,U,1,0)(45,W,1,0),t()()()(),i(46,"div",16)(47,"div",15)(48,"div",11)(49,"label"),n(50,"Job ID"),t(),i(51,"div"),n(52),t()()(),i(53,"div",15)(54,"div",11)(55,"label"),n(56,"Label"),t(),i(57,"div")(58,"span"),n(59),t()()()()()()()()(),i(60,"div",4)(61,"div",15)(62,"div",17)(63,"div",18)(64,"h5"),n(65,"Message"),t(),i(66,"div")(67,"button",19),h("click",function(){let l=x(o).ngIf,v=d();return g(v.copyMessageToClipboard(l))}),C(68,"i",20),t()()(),i(69,"div",21)(70,"div",22)(71,"div",23)(72,"pre"),n(73),t()()()()()(),m(74,X,13,2,"div",24)(75,Y,11,1,"ng-container",0),t()()()(),b()}if(a&2){let o,e=c.ngIf,l=d();r(),p("headerTitle","Notification "+e.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),r(20),s(T(22,15,e.Created,"dd MMM yyyy HH:mm:ss")),r(8),I("",T(30,18,e.DurationInSecond,"1.1-1")," s"),r(8),s(e.LoginID),r(5),w(R(21,K,e.StateID==l.scanState.InProgress,e.StateID==l.scanState.Completed,e.StateID==l.scanState.Failed)),r(),L((o=e.StateID)===l.scanState.InProgress?43:o===l.scanState.Completed?44:o===l.scanState.Failed?45:-1),r(9),I(" ",e.ID," "),r(7),s(e.ProcessLabel),r(8),p("matTooltip",l.copyToClipboardMessage()),r(6),s(e.ProcessDescription),r(),p("ngIf",e==null?null:e.PerfLog),r(),p("ngIf",e==null?null:e.Exception)}}var ve=(()=>{class a{constructor(){this.notificationService=_(D),this.activatedRoute=_(O),this.scanState=z,this.copyToClipboardPerflog=u("Copy log to clipboard"),this.copyToClipboardMessage=u("Copy message to clipboard")}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(P(o=>{let e=o.ID;return this.notificationService.getNotificationDetail(e).pipe(E(1))}))}copyMessageToClipboard(o){navigator.clipboard.writeText(o.ProcessDescription||"").then(()=>{this.copyToClipboardMessage.set("Message copied!"),setTimeout(()=>{this.copyToClipboardMessage.set("Copy message to clipboard")},5e3)})}copyPerfLogToClipboard(o){navigator.clipboard.writeText(o.PerfLog||"").then(()=>{this.copyToClipboardPerflog.set("PerfLog copied!"),setTimeout(()=>{this.copyToClipboardPerflog.set("Copy log to clipboard")},5e3)})}static{this.\u0275fac=function(e){return new(e||a)}}static{this.\u0275cmp=M({type:a,selectors:[["app-detail"]],features:[k([D])],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notificationV2",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-3"],[1,"info-label-group"],[1,"col-1"],[1,"text-center"],[1,"col-2"],[1,"col-sm-6"],[1,"row","mt-4"],[1,"card"],[1,"card-header","d-flex","align-items-center","justify-content-between"],[1,"btn","btn-icon-only",3,"click","matTooltip"],[1,"fa-solid","fa-copy","fs-3"],[1,"card-body","border","mx-8","my-6","rounded-1"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(e,l){e&1&&(m(0,Z,76,25,"ng-container",0),f(1,"async")),e&2&&p("ngIf",V(1,1,l.notification$))},dependencies:[H,B,F,A,N,J,G,$,j,q],encapsulation:2})}}return a})();export{ve as DetailComponent};
@@ -1,3 +1,3 @@
1
- import{a as T}from"./chunk-Z3ITXK3D.js";import{a as Ye}from"./chunk-ACIMXBIC.js";import{a as Ke,b as me,c as ze,d as Ve,e as Se,f as qe,g as ve,h as Ge,i as G,j as we,k as y}from"./chunk-TGMCGROM.js";import{a as Xe}from"./chunk-CGOB6Y3X.js";import{e as re}from"./chunk-WN5DZGA4.js";import{b as ge,c as te}from"./chunk-PW42BQIY.js";import{b as Je}from"./chunk-V3USB3ZU.js";import{a as Ze}from"./chunk-ERXVXBTU.js";import{G as We,n as Ue,o as $e,p as He}from"./chunk-FXQKRJWU.js";import{F as Oe,G as Ne,Hb as $,La as L,O as de,Ra as ee,T as Me,Wa as U,Z as he,aa as x,ba as pe,c as g,dd as Fe,ea as V,ed as Le,f as Y,id as q,j as xe,ja as A,k as Re,ka as B,ma as E,n as K,o as Q,oa as h,p as R,pa as F,q as z,qa as Be,ua as fe,v as D,w as je}from"./chunk-OJMQBH6T.js";import{a as ue,i as I}from"./chunk-66YHNWRR.js";var Qe={production:!0,version:"5.46.1",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var kt="firebase",At="11.10.0";G(kt,At,"app");var H=new Fe("ANGULARFIRE2_VERSION");var et=(r,s)=>{let e=s?[s]:Ge(),t=[];return e.forEach(n=>{n.container.getProvider(r).instances.forEach(i=>{t.includes(i)||t.push(i)})}),t},ke=function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r}(ke||{}),Dr=q()&&typeof Zone<"u"?ke.WARN:ke.SILENT;var ne=class{zone;delegate;constructor(s,e=Re){this.zone=s,this.delegate=e}now(){return this.delegate.now()}schedule(s,e,t){let n=this.zone,o=function(i){n?n.runGuarded(()=>{s.apply(this,[i])}):s.apply(this,[i])};return this.delegate.schedule(o,e,t)}},Ae=(()=>{class r{outsideAngular;insideAngular;constructor(){let e=F(L);this.outsideAngular=e.runOutsideAngular(()=>new ne(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new ne(typeof Zone>"u"?void 0:Zone.current,xe))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var It=new Map,Et={activated:!1,tokenObservers:[]},Tt={initialized:!1,enabled:!1};function C(r){return It.get(r)||Object.assign({},Et)}function ot(){return Tt}var yt="https://content-firebaseappcheck.googleapis.com/v1";var Ct="exchangeDebugToken",tt={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Ur=24*60*60*1e3;var Ee=class{constructor(s,e,t,n,o){if(this.operation=s,this.retryPolicy=e,this.getWaitDuration=t,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(s){return I(this,null,function*(){this.stop();try{this.pending=new me,this.pending.promise.catch(e=>{}),yield Pt(this.getNextRun(s)),this.pending.resolve(),yield this.pending.promise,this.pending=new me,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(s){if(s)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function Pt(r){return new Promise(s=>{setTimeout(s,r)})}var Dt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},O=new Ve("appCheck","AppCheck",Dt);function it(r){if(!C(r).activated)throw O.create("use-before-activation",{appName:r.name})}function st(t,n){return I(this,arguments,function*({url:r,body:s},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let f=yield i.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(s),headers:o},l;try{l=yield fetch(r,a)}catch(f){throw O.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw O.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw O.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw O.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:c.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function at(r,s){let{projectId:e,appId:t,apiKey:n}=r.options;return{url:`${yt}/projects/${e}/apps/${t}:${Ct}?key=${n}`,body:{debug_token:s}}}var _t="firebase-app-check-database",xt=1,Te="firebase-app-check-store";var oe=null;function Rt(){return oe||(oe=new Promise((r,s)=>{try{let e=indexedDB.open(_t,xt);e.onsuccess=t=>{r(t.target.result)},e.onerror=t=>{var n;s(O.create("storage-open",{originalErrorMessage:(n=t.target.error)===null||n===void 0?void 0:n.message}))},e.onupgradeneeded=t=>{let n=t.target.result;switch(t.oldVersion){case 0:n.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(e){s(O.create("storage-open",{originalErrorMessage:e?.message}))}}),oe)}function jt(r,s){return Ot(Nt(r),s)}function Ot(r,s){return I(this,null,function*(){let t=(yield Rt()).transaction(Te,"readwrite"),o=t.objectStore(Te).put({compositeKey:r,value:s});return new Promise((i,a)=>{o.onsuccess=l=>{i()},t.onerror=l=>{var c;a(O.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Nt(r){return`${r.options.appId}-${r.name}`}var J=new qe("@firebase/app-check");function be(r,s){return ze()?jt(r,s).catch(e=>{J.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function ct(){return ot().enabled}function lt(){return I(this,null,function*(){let r=ot();if(r.enabled&&r.token)return r.token.promise;throw Error(`
1
+ import{a as T}from"./chunk-Z3ITXK3D.js";import{a as Ye}from"./chunk-ACIMXBIC.js";import{a as Ke,b as me,c as ze,d as Ve,e as Se,f as qe,g as ve,h as Ge,i as G,j as we,k as y}from"./chunk-TGMCGROM.js";import{a as Xe}from"./chunk-CGOB6Y3X.js";import{e as re}from"./chunk-WN5DZGA4.js";import{b as ge,c as te}from"./chunk-PW42BQIY.js";import{b as Je}from"./chunk-V3USB3ZU.js";import{a as Ze}from"./chunk-ERXVXBTU.js";import{G as We,n as Ue,o as $e,p as He}from"./chunk-FXQKRJWU.js";import{F as Oe,G as Ne,Hb as $,La as L,O as de,Ra as ee,T as Me,Wa as U,Z as he,aa as x,ba as pe,c as g,dd as Fe,ea as V,ed as Le,f as Y,id as q,j as xe,ja as A,k as Re,ka as B,ma as E,n as K,o as Q,oa as h,p as R,pa as F,q as z,qa as Be,ua as fe,v as D,w as je}from"./chunk-OJMQBH6T.js";import{a as ue,i as I}from"./chunk-66YHNWRR.js";var Qe={production:!0,version:"5.46.2",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var kt="firebase",At="11.10.0";G(kt,At,"app");var H=new Fe("ANGULARFIRE2_VERSION");var et=(r,s)=>{let e=s?[s]:Ge(),t=[];return e.forEach(n=>{n.container.getProvider(r).instances.forEach(i=>{t.includes(i)||t.push(i)})}),t},ke=function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r}(ke||{}),Dr=q()&&typeof Zone<"u"?ke.WARN:ke.SILENT;var ne=class{zone;delegate;constructor(s,e=Re){this.zone=s,this.delegate=e}now(){return this.delegate.now()}schedule(s,e,t){let n=this.zone,o=function(i){n?n.runGuarded(()=>{s.apply(this,[i])}):s.apply(this,[i])};return this.delegate.schedule(o,e,t)}},Ae=(()=>{class r{outsideAngular;insideAngular;constructor(){let e=F(L);this.outsideAngular=e.runOutsideAngular(()=>new ne(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new ne(typeof Zone>"u"?void 0:Zone.current,xe))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var It=new Map,Et={activated:!1,tokenObservers:[]},Tt={initialized:!1,enabled:!1};function C(r){return It.get(r)||Object.assign({},Et)}function ot(){return Tt}var yt="https://content-firebaseappcheck.googleapis.com/v1";var Ct="exchangeDebugToken",tt={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Ur=24*60*60*1e3;var Ee=class{constructor(s,e,t,n,o){if(this.operation=s,this.retryPolicy=e,this.getWaitDuration=t,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(s){return I(this,null,function*(){this.stop();try{this.pending=new me,this.pending.promise.catch(e=>{}),yield Pt(this.getNextRun(s)),this.pending.resolve(),yield this.pending.promise,this.pending=new me,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(s){if(s)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function Pt(r){return new Promise(s=>{setTimeout(s,r)})}var Dt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},O=new Ve("appCheck","AppCheck",Dt);function it(r){if(!C(r).activated)throw O.create("use-before-activation",{appName:r.name})}function st(t,n){return I(this,arguments,function*({url:r,body:s},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let f=yield i.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(s),headers:o},l;try{l=yield fetch(r,a)}catch(f){throw O.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw O.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw O.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw O.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:c.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function at(r,s){let{projectId:e,appId:t,apiKey:n}=r.options;return{url:`${yt}/projects/${e}/apps/${t}:${Ct}?key=${n}`,body:{debug_token:s}}}var _t="firebase-app-check-database",xt=1,Te="firebase-app-check-store";var oe=null;function Rt(){return oe||(oe=new Promise((r,s)=>{try{let e=indexedDB.open(_t,xt);e.onsuccess=t=>{r(t.target.result)},e.onerror=t=>{var n;s(O.create("storage-open",{originalErrorMessage:(n=t.target.error)===null||n===void 0?void 0:n.message}))},e.onupgradeneeded=t=>{let n=t.target.result;switch(t.oldVersion){case 0:n.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(e){s(O.create("storage-open",{originalErrorMessage:e?.message}))}}),oe)}function jt(r,s){return Ot(Nt(r),s)}function Ot(r,s){return I(this,null,function*(){let t=(yield Rt()).transaction(Te,"readwrite"),o=t.objectStore(Te).put({compositeKey:r,value:s});return new Promise((i,a)=>{o.onsuccess=l=>{i()},t.onerror=l=>{var c;a(O.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Nt(r){return`${r.options.appId}-${r.name}`}var J=new qe("@firebase/app-check");function be(r,s){return ze()?jt(r,s).catch(e=>{J.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function ct(){return ot().enabled}function lt(){return I(this,null,function*(){let r=ot();if(r.enabled&&r.token)return r.token.promise;throw Error(`
2
2
  Can't get debug token in production mode.
3
3
  `)})}var Mt={error:"UNKNOWN_ERROR"};function Bt(r){return Ke.encodeString(JSON.stringify(r),!1)}function ye(r,s=!1,e=!1){return I(this,null,function*(){let t=r.app;it(t);let n=C(t),o=n.token,i;if(o&&!Z(o)&&(n.token=void 0,o=void 0),!o){let c=yield n.cachedTokenPromise;c&&(Z(c)?o=c:yield be(t,void 0))}if(!s&&o&&Z(o))return{token:o.token};let a=!1;if(ct())try{n.exchangeTokenPromise||(n.exchangeTokenPromise=st(at(t,yield lt()),r.heartbeatServiceProvider).finally(()=>{n.exchangeTokenPromise=void 0}),a=!0);let c=yield n.exchangeTokenPromise;return yield be(t,c),n.token=c,{token:c.token}}catch(c){return c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?J.warn(c.message):e&&J.error(c),Ie(c)}try{n.exchangeTokenPromise||(n.exchangeTokenPromise=n.provider.getToken().finally(()=>{n.exchangeTokenPromise=void 0}),a=!0),o=yield C(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?J.warn(c.message):e&&J.error(c),i=c}let l;return o?i?Z(o)?l={token:o.token,internalError:i}:l=Ie(i):(l={token:o.token},n.token=o,yield be(t,o)):l=Ie(i),a&&$t(t,l),l})}function Ft(r){return I(this,null,function*(){let s=r.app;it(s);let{provider:e}=C(s);if(ct()){let t=yield lt(),{token:n}=yield st(at(s,t),r.heartbeatServiceProvider);return{token:n}}else{let{token:t}=yield e.getToken();return{token:t}}})}function Lt(r,s,e,t){let{app:n}=r,o=C(n),i={next:e,error:t,type:s};if(o.tokenObservers=[...o.tokenObservers,i],o.token&&Z(o.token)){let a=o.token;Promise.resolve().then(()=>{e({token:a.token}),rt(r)}).catch(()=>{})}o.cachedTokenPromise.then(()=>rt(r))}function ut(r,s){let e=C(r),t=e.tokenObservers.filter(n=>n.next!==s);t.length===0&&e.tokenRefresher&&e.tokenRefresher.isRunning()&&e.tokenRefresher.stop(),e.tokenObservers=t}function rt(r){let{app:s}=r,e=C(s),t=e.tokenRefresher;t||(t=Ut(r),e.tokenRefresher=t),!t.isRunning()&&e.isTokenAutoRefreshEnabled&&t.start()}function Ut(r){let{app:s}=r;return new Ee(()=>I(null,null,function*(){let e=C(s),t;if(e.token?t=yield ye(r,!0):t=yield ye(r),t.error)throw t.error;if(t.internalError)throw t.internalError}),()=>!0,()=>{let e=C(s);if(e.token){let t=e.token.issuedAtTimeMillis+(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)*.5+3e5,n=e.token.expireTimeMillis-5*60*1e3;return t=Math.min(t,n),Math.max(0,t-Date.now())}else return 0},tt.RETRIAL_MIN_WAIT,tt.RETRIAL_MAX_WAIT)}function $t(r,s){let e=C(r).tokenObservers;for(let t of e)try{t.type==="EXTERNAL"&&s.error!=null?t.error(s.error):t.next(s)}catch{}}function Z(r){return r.expireTimeMillis-Date.now()>0}function Ie(r){return{token:Bt(Mt),error:r}}var Ce=class{constructor(s,e){this.app=s,this.heartbeatServiceProvider=e}_delete(){let{tokenObservers:s}=C(this.app);for(let e of s)ut(this.app,e.next);return Promise.resolve()}};function Ht(r,s){return new Ce(r,s)}function Wt(r){return{getToken:s=>ye(r,s),getLimitedUseToken:()=>Ft(r),addTokenListener:s=>Lt(r,"INTERNAL",s),removeTokenListener:s=>ut(r.app,s)}}var Kt="@firebase/app-check",zt="0.10.1";var Vt="app-check",nt="app-check-internal";function qt(){ve(new Se(Vt,r=>{let s=r.getProvider("app").getImmediate(),e=r.getProvider("heartbeat");return Ht(s,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,s,e)=>{r.getProvider(nt).initialize()})),ve(new Se(nt,r=>{let s=r.getProvider("app-check").getImmediate();return Wt(s)},"PUBLIC").setInstantiationMode("EXPLICIT")),G(Kt,zt)}qt();var Gt="app-check";var ie=class{constructor(){return et(Gt)}};var Jt=["localhost","0.0.0.0","127.0.0.1"],tn=typeof window<"u"&&Jt.includes(window.location.hostname);var dt=(()=>{class r{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let t=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return typeof t=="string"&&(t=[t]),t||[]}ParseToken(e){try{let n=e.split(".")[0].replace("-","+").replace("_","/"),o=JSON.parse(window.atob(n)),a=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(a));return l.header=o,l}catch{return!1}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Yt="firebase",Qt="11.10.0";y.registerVersion(Yt,Qt,"app-compat");var er=["ngOnDestroy"],pt=(r,s,e,t={})=>new Proxy(r,{get:(n,o)=>e.runOutsideAngular(()=>{if(r[o])return t?.spy?.get&&t.spy.get(o,r[o]),r[o];if(er.indexOf(o)>-1)return()=>{};let i=s.toPromise().then(a=>{let l=a?.[o];return typeof l=="function"?l.bind(a):l?.then?l.then(c=>e.run(()=>c)):e.run(()=>l)});return new Proxy(()=>{},{get:(a,l)=>i[l],apply:(a,l,c)=>i.then(d=>{let u=d?.(...c);return t?.spy?.apply&&t.spy.apply(o,c,u),u})})})});var se=class{constructor(s){return s}},ae=new E("angularfire2.app.options"),ce=new E("angularfire2.app.name");function Pe(r,s,e){let t=typeof e=="string"&&e||"[DEFAULT]",n=typeof e=="object"&&e||{};n.name=n.name||t;let i=y.apps.filter(a=>a&&a.name===n.name)[0]||s.runOutsideAngular(()=>y.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(i.options)){let a=!!module.hot;tr("error",`${i.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new se(i)}var tr=(r,...s)=>{q()&&typeof console<"u"&&console[r](...s)},rr={provide:se,useFactory:Pe,deps:[ae,L,[new Be,ce]]},Jo=(()=>{class r{static initializeApp(e,t){return{ngModule:r,providers:[{provide:ae,useValue:e},{provide:ce,useValue:t}]}}constructor(e){y.registerVersion("angularfire",H.full,"core"),y.registerVersion("angularfire",H.full,"app-compat"),y.registerVersion("angular",Le.full,e.toString())}static \u0275fac=function(t){return new(t||r)(h(U))};static \u0275mod=$({type:r});static \u0275inj=B({providers:[rr]})}return r})();function ft(r,s,e,t,n){let[,o,i]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(o)return nr(n,i)||(ht("error",`${s} was already initialized on the ${e} Firebase App with different settings.${or?" You may need to reload as Firebase is not HMR aware.":""}`),ht("warn",{is:n,was:i})),o;{let a=t();return globalThis.\u0275AngularfireInstanceCache.push([r,a,n]),a}}function nr(r,s){try{return r.toString()===s.toString()}catch{return r===s}}var or=typeof module<"u"&&!!module.hot,ht=(r,...s)=>{q()&&typeof console<"u"&&console[r](...s)};globalThis.\u0275AngularfireInstanceCache||=[];var ir=new E("angularfire2.auth.use-emulator"),sr=new E("angularfire2.auth.settings"),ar=new E("angularfire2.auth.tenant-id"),cr=new E("angularfire2.auth.langugage-code"),lr=new E("angularfire2.auth.use-device-language"),ur=new E("angularfire.auth.persistence"),dr=(r,s,e,t,n,o,i,a)=>ft(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let l=s.runOutsideAngular(()=>r.auth());if(e&&l.useEmulator(...e),t&&(l.tenantId=t),l.languageCode=n,o&&l.useDeviceLanguage(),i)for(let[c,d]of Object.entries(i))l.settings[c]=d;return a&&l.setPersistence(a),l},[e,t,n,o,i,a]),De=(()=>{class r{injector=F(fe);authState;idToken;user;idTokenResult;credential;constructor(e,t,n,o,i,a,l,c,d,u,p,f){let W=new Y,N=z(void 0).pipe(K(i.outsideAngular),x(()=>o.runOutsideAngular(()=>import("./chunk-GCECFUOP.js"))),D(()=>Pe(e,o,t)),D(P=>dr(P,o,a,c,d,u,l,p)),he({bufferSize:1,refCount:!1}));if(He(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=z(null);else{N.pipe(Me()).subscribe();let P=N.pipe(x(S=>S.getRedirectResult().then(_=>_,()=>null)),Je(this.injector),he({bufferSize:1,refCount:!1})),X=N.pipe(x(S=>new g(_=>({unsubscribe:o.runOutsideAngular(()=>S.onAuthStateChanged(M=>_.next(M),M=>_.error(M),()=>_.complete()))})))),le=N.pipe(x(S=>new g(_=>({unsubscribe:o.runOutsideAngular(()=>S.onIdTokenChanged(M=>_.next(M),M=>_.error(M),()=>_.complete()))}))));this.authState=P.pipe(pe(X),Q(i.outsideAngular),K(i.insideAngular)),this.user=P.pipe(pe(le),Q(i.outsideAngular),K(i.insideAngular)),this.idToken=this.user.pipe(x(S=>S?R(S.getIdToken()):z(null))),this.idTokenResult=this.user.pipe(x(S=>S?R(S.getIdTokenResult()):z(null))),this.credential=Oe(P,W,this.authState.pipe(Ne(S=>!S))).pipe(D(S=>S?.user?S:null),Q(i.outsideAngular),K(i.insideAngular))}return pt(this,N,o,{spy:{apply:(P,X,le)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&le.then(S=>W.next(S))}}})}static \u0275fac=function(t){return new(t||r)(h(ae),h(ce,8),h(U),h(L),h(Ae),h(ir,8),h(sr,8),h(ar,8),h(cr,8),h(lr,8),h(ur,8),h(ie,8))};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),di=(()=>{class r{constructor(){y.registerVersion("angularfire",H.full,"auth-compat")}static \u0275fac=function(t){return new(t||r)};static \u0275mod=$({type:r});static \u0275inj=B({providers:[De]})}return r})();function m(r,s,e,t){return new Promise((n,o)=>{r||o("IndexedDB not available");let i=r.open(s,e),a;i.onsuccess=l=>{a=i.result,n(a)},i.onerror=l=>{o(`IndexedDB error: ${i.error}`)},typeof t=="function"&&(i.onupgradeneeded=l=>{t(l,a)})})}function gt(r,s,e,t,n){if(!r)return;let o=r.open(s,e);o.onupgradeneeded=i=>{let a=i.target.result;t.forEach(c=>{if(!a.objectStoreNames.contains(c.store)){let d=a.createObjectStore(c.store,c.storeConfig);c.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let l=n&&n();l&&Object.keys(l).map(c=>parseInt(c,10)).filter(c=>c>i.oldVersion).sort((c,d)=>c-d).forEach(c=>{l[c](a,o.transaction)}),a.close()},o.onsuccess=i=>{i.target.result.close()}}function pr(r,s,e){if(!r||!s||!e)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(t=>{try{let n=s+1,o=indexedDB.open(r,n);o.onupgradeneeded=i=>{let a=i.target.result;a.deleteObjectStore(e),a.close(),console.log("onupgradeneeded"),t.next(!0),t.complete()},o.onerror=i=>t.error(i)}catch(n){t.error(n)}})}function fr(r,s){return r.objectStoreNames.contains(s)}function b(r,s,e){r||e("You need to use the openDatabase function to create a database before you query it!"),fr(r,s)||e(`objectStore does not exists: ${s}`)}function w(r,s){let e=r.transaction(s.storeName,s.dbMode);return e.onerror=s.error,e.onabort=s.abort,e}function k(r,s,e,t){return{storeName:s,dbMode:r,error:n=>{e(n)},abort:n=>{e(n)}}}var v=function(r){return r.readonly="readonly",r.readwrite="readwrite",r}(v||{}),mt=new E(null),_e=(()=>{class r{constructor(e,t){if(this.dbConfig=e,this.platformId=t,!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!e.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=$e(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,gt(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),m(this.indexedDB,e.name).then(n=>{n.version!==e.version&&(this.dbConfig.version=n.version)}))}createObjectStore(e,t){let n=[e];gt(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,t)}add(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let l=w(i,k(v.readwrite,e,d=>o.error(d))).objectStore(e),c=n?l.add(t,n):l.add(t);c.onsuccess=d=>I(this,null,function*(){let u=d.target.result,p=l.get(u);p.onsuccess=f=>{o.next(f.target.result),o.complete()}})}).catch(i=>o.error(i))})}bulkAdd(e,t){let n=new Promise((o,i)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let c=w(a,k(v.readwrite,e,o,i)).objectStore(e),d=t.map(u=>new Promise((p,f)=>{let W=u.key;delete u.key;let N=W?c.add(u,W):c.add(u);N.onsuccess=P=>{let X=P.target.result;p(X)}}));o(Promise.all(d))}).catch(a=>i(a))});return R(n)}bulkDelete(e,t){let n=t.map(o=>new Promise((i,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(l=>{let c=w(l,k(v.readwrite,e,a,i));c.objectStore(e).delete(o),c.oncomplete=()=>{this.getAll(e).pipe(de(1)).subscribe(u=>{i(u)})}}).catch(l=>a(l))}));return R(Promise.all(n))}getByKey(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{let l=w(o,k(v.readonly,e,n.error)).objectStore(e).get(t);l.onsuccess=c=>{n.next(c.target.result),n.complete()},l.onerror=c=>{n.error(c)}}).catch(o=>n.error(o))})}bulkGet(e,t){let n=t.map(o=>this.getByKey(e,o));return new g(o=>{je(n).subscribe(i=>{o.next(i),o.complete()})})}getByID(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,c=>n.error(c));let l=w(o,k(v.readonly,e,n.error,n.next)).objectStore(e).get(t);l.onsuccess=c=>{n.next(c.target.result)}}).catch(o=>n.error(o))})}getByIndex(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,e,u=>o.error(u));let d=w(i,k(v.readonly,e,o.error)).objectStore(e).index(t).get(n);d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}getAll(e){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{b(n,e,l=>t.error(l));let a=w(n,k(v.readonly,e,t.error,t.next)).objectStore(e).getAll();a.onerror=l=>{t.error(l)},a.onsuccess=({target:{result:l}})=>{t.next(l),t.complete()}}).catch(n=>t.error(n))})}update(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,c=>n.error(c));let a=w(o,k(v.readwrite,e,c=>n.error(c))).objectStore(e),l=a.put(t);l.onsuccess=c=>I(this,null,function*(){let d=c.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(o=>n.error(o))})}delete(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,l=>n.error(l));let i=w(o,k(v.readwrite,e,l=>n.error(l)));i.objectStore(e).delete(t),i.oncomplete=()=>{this.getAll(e).pipe(de(1)).subscribe(l=>{n.next(l),n.complete()})}}).catch(o=>n.error(o))})}deleteByKey(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,l=>n.error(l));let i=w(o,k(v.readwrite,e,l=>n.error(l))),a=i.objectStore(e);i.oncomplete=()=>{n.next(!0),n.complete()},a.delete(t)}).catch(o=>n.error(o))})}clear(e){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{b(n,e,a=>t.error(a));let o=w(n,k(v.readwrite,e,a=>t.error(a)));o.objectStore(e).clear(),o.oncomplete=()=>{t.next(!0),t.complete()}}).catch(n=>t.error(n))})}deleteDatabase(){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(t=>I(this,null,function*(){yield t.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{e.next(!0),e.complete()},n.onerror=o=>e.error(o),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(t=>e.error(t))})}openCursor(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,c=>n.error(c));let a=w(o,k(v.readonly,e,n.error)).objectStore(e),l=t===void 0?a.openCursor():a.openCursor(t);l.onsuccess=c=>{n.next(c),n.complete()}}).catch(o=>n.error(o))})}openCursorByIndex(e,t,n,o=v.readonly){let i=new Y;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,e,p=>{i.error(p)});let u=w(a,k(o,e,p=>{i.error(p)},()=>{i.next()})).objectStore(e).index(t).openCursor(n);u.onsuccess=p=>{i.next(p)}}).catch(a=>i.error(a)),i}getAllByIndex(e,t,n){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,e,p=>i.error(p));let u=w(a,k(v.readonly,e,i.error)).objectStore(e).index(t).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push(f.value),f.continue()):(i.next(o),i.complete())}}).catch(a=>i.error(a))})}getAllKeysByIndex(e,t,n){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,e,p=>i.error(p));let u=w(a,k(v.readonly,e,i.error)).objectStore(e).index(t).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(i.next(o),i.complete())}}).catch(a=>i.error(a))})}count(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,c=>n.error(c));let l=w(o,k(v.readonly,e,n.error)).objectStore(e).count(t);l.onerror=c=>n.error(c),l.onsuccess=c=>{n.next(c.target.result),n.complete()}}).catch(o=>n.error(o))})}countByIndex(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,e,u=>o.error(u));let d=w(i,k(v.readonly,e,o.error)).objectStore(e).index(t).count(n);d.onerror=u=>o.error(u),d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}deleteObjectStore(e){return pr(this.dbConfig.name,++this.dbConfig.version,e)}}return r.\u0275fac=function(e){return new(e||r)(h(mt),h(U))},r.\u0275prov=A({token:r,factory:r.\u0275fac}),r})(),wi=(()=>{class r{static forRoot(e){return{ngModule:r,providers:[_e,{provide:mt,useValue:e}]}}}return r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=$({type:r}),r.\u0275inj=B({imports:[[Ue]]}),r})();var St=(()=>{class r{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,t){let n=this.getKey(t);return this.db.add(this.DATABASE,e,n).pipe(D(o=>e))}getCategoriesByChannelType(e){let t=this.getKey(e);return this.db.getByKey(this.DATABASE,t)}getKey(e){let t="";switch(e){case ge.Lazada:t="Lazada";break;case ge.Tokopedia:t="Tokopedia";break}return t}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}static{this.\u0275fac=function(t){return new(t||r)(h(_e))}}static{this.\u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var vt=(()=>{class r{inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let t={Enabled:!0};e&&(t=ue(ue({},t),e)),localStorage.setItem("Intercom",JSON.stringify(t))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return te.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var wt=(()=>{class r{constructor(){this.httpService=F(re),this.currentUser=ee(null),this.tokenValue=ee(null),this.channels=ee([])}refreshToken(){return this.httpService.get(Xe.RefreshToken).pipe(V(e=>{this.updateTokenInLocalStorage(e)}))}updateTokenInLocalStorage(e){this.saveUserToLocalStorage(e),this.saveChannelsToLocalStorage(e.Channels)}saveUserToLocalStorage(e){let t=JSON.stringify(e);localStorage.setItem(T.USER,t)}getUser(){if(this.currentUser())return this.currentUser();{let e=localStorage.getItem(T.USER);return this.currentUser.set(e?JSON.parse(e):null),this.currentUser()}}getTokenValue(){let e=this.getUser();if(!this.tokenValue()){let t=Ye.parseJwt(e?.Token.access_token);this.tokenValue.set(t)}return this.tokenValue()}saveChannelsToLocalStorage(e){let t=JSON.stringify(e);localStorage.setItem(T.CHANNELS,t)}getChannels(){if(this.channels().length==0){let e=localStorage.getItem(T.CHANNELS),t=e?JSON.parse(e):[];this.channels.set(t)}return this.channels()}clearStorage(){localStorage.removeItem(T.USER),localStorage.removeItem(T.CHANNELS),this.currentUser.set(null),this.tokenValue.set(null),this.channels.set([])}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Ui=(()=>{class r{constructor(e,t,n,o,i,a,l,c){this.httpService=e,this.tokenDecodeService=t,this.afAuth=n,this.ngxPermission=o,this.localDataService=i,this.router=a,this.intercomService=l,this.tokenService=c}login(e){return this.httpService.post("/api/token/Login",e).pipe(V(t=>{this.setLocalStorage(t,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(Qe.news).pipe(D(e=>e?.items?.map(t=>t?.properties)))}loginWithGoogle(e,t){e.preventDefault();let n=new we;return n.setCustomParameters({prompt:"select_account"}),R(this.afAuth.signInWithPopup(n)).pipe(D(o=>o.credential),D(o=>o.idToken),x(o=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:o,Host:t}))),V(o=>{this.setLocalStorage(o,t,null),this.loadPermissions()}))}setLocalStorage(e,t,n){this.tokenService.updateTokenInLocalStorage(e),localStorage.setItem(T.AUTHORIZATION,JSON.stringify({Host:t,username:n})),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem(T.USER);if(te.IsNotEmpty(e)){let t=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(t)}}getChannels(){return this.tokenService.getChannels()}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=this.tokenService.getUser(),t=new Date;if(e!=null){let n=new Date(e.Token.expiredAt);return t<n?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem(T.AUTHORIZATION);this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.tokenService.clearStorage(),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}static{this.\u0275fac=function(t){return new(t||r)(h(re),h(dt),h(De),h(Ze),h(St),h(We),h(vt),h(wt))}}static{this.\u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{Qe as a,dt as b,Jo as c,di as d,wi as e,St as f,vt as g,wt as h,Ui as i};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-HHO2NGCF.js";import"./chunk-FHWKSD5A.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as F}from"./chunk-CGOB6Y3X.js";import{e as j}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PYXL7UF7.js";import"./chunk-PW42BQIY.js";import{m as H,n as J}from"./chunk-HJXYT6MI.js";import{A as R,c as k,h as B,m as W}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as D,l as I,n as P}from"./chunk-FXQKRJWU.js";import{$c as b,Gb as S,Gc as i,Hc as N,Kc as g,Lc as f,Mb as x,Mc as C,Nc as O,Oc as V,Pc as _,Ra as w,Yb as m,Z as v,ad as y,dc as M,ic as e,jc as t,kc as L,oc as T,pa as E,rb as p,tc as h,uc as A,ya as d,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function Y(n,U){if(n&1&&(e(0,"pre",21),i(1),b(2,"json"),t()),n&2){A();let l=_(25);p(),N(y(2,1,l))}}function q(n,U){n&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var pe=(()=>{class n{constructor(){this.httpService=E(j),this.selectedChannel=w(null),this.orderNumber=w(null)}initEscrowLog(){this.escrowLog$=this.httpService.post(F.GetEscrowDetail,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(v(1))}copyToClipboard(l){if(!l)return;let c=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(c),alert("Copied to clipboard!")}static{this.\u0275fac=function(c){return new(c||n)}}static{this.\u0275cmp=S({type:n,selectors:[["app-escrow-api"]],decls:40,vars:10,consts:[["headerTitle","Origin Escrow Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel","onlyInputTypeID"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","escrowLogText"],[1,"text-center","my-12","text-muted"]],template:function(c,o){if(c&1){let a=T();e(0,"mainpanel",0)(1,"actions")(2,"button",1),h("click",function(){return d(a),s(o.initEscrowLog())}),L(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Escrow API "),t()(),e(15,"div",9)(16,"channel-select-options",10),C("ngModelChange",function(r){return d(a),f(o.selectedChannel,r)||(o.selectedChannel=r),s(r)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),C("ngModelChange",function(r){return d(a),f(o.orderNumber,r)||(o.orderNumber=r),s(r)}),t()()()()(),O(25),b(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),h("click",function(){d(a);let r=_(25);return s(o.copyToClipboard(r))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),x(38,Y,3,3,"pre",21)(39,q,2,0,"p",22),t()()()()()()()()()}if(c&2){m("hideSearchBox",!0)("hideSearchDropdown",!0),p(16),g("ngModel",o.selectedChannel),m("onlyInputTypeID",5),p(8),g("ngModel",o.orderNumber),p();let a=V(y(26,7,o.escrowLog$));p(8),m("disabled",!a),p(5),M(a?38:39)}},dependencies:[P,D,I,R,k,B,W,J,H,G],styles:[".container-fluid[_ngcontent-%COMP%]{padding-bottom:1rem}#escrowLogText[_ngcontent-%COMP%]{white-space:pre-wrap;word-break:break-word}"]})}}return n})();export{pe as EscrowApiComponent};
1
+ import{a as G}from"./chunk-CWXOXH6M.js";import"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as F}from"./chunk-CGOB6Y3X.js";import{e as j}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PYXL7UF7.js";import"./chunk-PW42BQIY.js";import{m as H,n as J}from"./chunk-HJXYT6MI.js";import{A as R,c as k,h as B,m as W}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as D,l as I,n as P}from"./chunk-FXQKRJWU.js";import{$c as b,Gb as S,Gc as i,Hc as N,Kc as g,Lc as f,Mb as x,Mc as C,Nc as O,Oc as V,Pc as _,Ra as w,Yb as m,Z as v,ad as y,dc as M,ic as e,jc as t,kc as L,oc as T,pa as E,rb as p,tc as h,uc as A,ya as d,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function Y(n,U){if(n&1&&(e(0,"pre",21),i(1),b(2,"json"),t()),n&2){A();let l=_(25);p(),N(y(2,1,l))}}function q(n,U){n&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var pe=(()=>{class n{constructor(){this.httpService=E(j),this.selectedChannel=w(null),this.orderNumber=w(null)}initEscrowLog(){this.escrowLog$=this.httpService.post(F.GetEscrowDetail,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(v(1))}copyToClipboard(l){if(!l)return;let c=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(c),alert("Copied to clipboard!")}static{this.\u0275fac=function(c){return new(c||n)}}static{this.\u0275cmp=S({type:n,selectors:[["app-escrow-api"]],decls:40,vars:10,consts:[["headerTitle","Origin Escrow Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel","onlyInputTypeID"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","escrowLogText"],[1,"text-center","my-12","text-muted"]],template:function(c,o){if(c&1){let a=T();e(0,"mainpanel",0)(1,"actions")(2,"button",1),h("click",function(){return d(a),s(o.initEscrowLog())}),L(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Escrow API "),t()(),e(15,"div",9)(16,"channel-select-options",10),C("ngModelChange",function(r){return d(a),f(o.selectedChannel,r)||(o.selectedChannel=r),s(r)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),C("ngModelChange",function(r){return d(a),f(o.orderNumber,r)||(o.orderNumber=r),s(r)}),t()()()()(),O(25),b(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),h("click",function(){d(a);let r=_(25);return s(o.copyToClipboard(r))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),x(38,Y,3,3,"pre",21)(39,q,2,0,"p",22),t()()()()()()()()()}if(c&2){m("hideSearchBox",!0)("hideSearchDropdown",!0),p(16),g("ngModel",o.selectedChannel),m("onlyInputTypeID",5),p(8),g("ngModel",o.orderNumber),p();let a=V(y(26,7,o.escrowLog$));p(8),m("disabled",!a),p(5),M(a?38:39)}},dependencies:[P,D,I,R,k,B,W,J,H,G],styles:[".container-fluid[_ngcontent-%COMP%]{padding-bottom:1rem}#escrowLogText[_ngcontent-%COMP%]{white-space:pre-wrap;word-break:break-word}"]})}}return n})();export{pe as EscrowApiComponent};
@@ -1 +1 @@
1
- import{a as Me}from"./chunk-EHBCYQSG.js";import{a as Fe,b as Ve}from"./chunk-GRYGUILI.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as Te,b as De,c as Ee,d as B,e as U}from"./chunk-NWWYOZ4V.js";import{a as ve,b as be}from"./chunk-YTCIQBSO.js";import"./chunk-RHHHL4OR.js";import{a as Ie}from"./chunk-KRQHTRFM.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as ce}from"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import{a as ye}from"./chunk-3YP6ORBR.js";import"./chunk-6VYFG4AQ.js";import{i as ge}from"./chunk-FHWKSD5A.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as pe,e as _e}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as he,b as Ce,d as ue,e as xe}from"./chunk-PYXL7UF7.js";import{c as se}from"./chunk-PW42BQIY.js";import{d as fe,l as Pe,m as Se,n as we}from"./chunk-HJXYT6MI.js";import{A as le,b as ne,c as ie,h as oe,m as ae,o as re}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as me,c as de}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{d as Q,g as X,j as Y,m as D,n as ee,q as te}from"./chunk-FXQKRJWU.js";import{$c as v,Fc as q,G as W,Gb as j,Gc as d,Hc as L,Ic as b,Kc as w,Lc as I,Mb as h,Mc as y,Qc as K,Sc as T,Yb as m,Z as A,ad as F,bd as J,cd as Z,dc as P,ea as $,ec as N,gc as k,hc as R,ic as a,jc as c,kc as S,lc as z,mc as G,oc as u,pa as M,pb as V,rb as l,tc as C,uc as r,xb as f,xc as H,ya as p,za as _}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var O=i=>[i],Le=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i});function Ue(i,s){if(i&1&&(a(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),m("src",e==null?null:e.Img,V),l(),b(" ",e.Name," ")}}function Oe(i,s){if(i&1){let e=u();a(0,"button",16),C("click",function(){p(e);let t=r().ngIf,o=r(2);return _(o.updateStock(t))}),S(1,"i",17),d(2," Update "),c()}}function We(i,s){if(i&1){let e=u();a(0,"actions")(1,"div",12),h(2,Oe,3,0,"button",13),a(3,"button",14),C("click",function(){p(e);let t=r(2);return _(t.openExportDialog())}),S(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),m("ngIf",n.productService.hasSelectionVariant(e))}}function Ae(i,s){if(i&1){let e=u();a(0,"th")(1,"input",32),C("change",function(t){p(e);let o=r().ngIf,g=r(2);return _(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function $e(i,s){if(i&1){let e=u();a(0,"input",49),y("ngModelChange",function(t){p(e);let o=r(4).$implicit;return I(o.selected,t)||(o.selected=t),_(t)}),C("ngModelChange",function(){p(e);let t=r(4).$implicit,o=r(3);return _(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;w("ngModel",e.selected)}}function je(i,s){if(i&1&&h(0,$e,1,1,"ng-template",26),i&2){let e=r(6);m("ngxPermissionsOnly",T(1,O,e.rolePriceEdit))}}function ze(i,s){if(i&1){let e=u();z(0),a(1,"img",50),C("click",function(t){p(e);let o=r(3).$implicit,g=r(3);return _(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),G()}if(i&2){let e=r(3).$implicit;l(),H("src",e.ThumbnailUrl,V)}}function Ge(i,s){i&1&&S(0,"img",51)}function He(i,s){if(i&1&&(a(0,"small",48),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function qe(i,s){if(i&1&&(a(0,"td",44)(1,"div",35),h(2,je,1,3,null,26),a(3,"div"),h(4,ze,2,1,"ng-container",45)(5,Ge,1,0,"ng-template",null,0,Z),c()()(),a(7,"td",46)(8,"span",47),d(9),c(),h(10,He,2,1,"small",48),c()),i&2){let e=q(6),n=r(2).$implicit;m("rowSpan",n.Variants.length),l(2),P((n.Variants==null?null:n.Variants.length)>1?2:-1),l(2),m("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),m("rowSpan",n.Variants.length),l(2),L(n.Name),l(),P(n.Category?10:-1)}}function Ke(i,s){if(i&1){let e=u();a(0,"input",54),y("ngModelChange",function(t){p(e);let o=r(2).$implicit;return I(o.selected,t)||(o.selected=t),_(t)}),c()}if(i&2){let e=r(2).$implicit;w("ngModel",e.selected)}}function Je(i,s){if(i&1&&(a(0,"td",52),h(1,Ke,1,1,"input",53),c()),i&2){let e=r().$implicit;l(),P(e.UnitPrice>=0?1:-1)}}function Ze(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Qe(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.UnitPrice)," ")}}function Xe(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),S(2,"i",55),c()()),i&2){let e=r().$implicit,n=r(4);l(),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function Ye(i,s){if(i&1){let e=u();a(0,"div",56),C("click",function(){p(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,x=r();return _(x.openTableDialog(t,o,g))}),d(1),v(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function et(i,s){if(i&1){let e=u();a(0,"tr",33),h(1,qe,11,7),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Je,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Ze,2,0,"div",36)(11,Qe,3,3,"div")(12,Xe,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,Ye,3,3,"div",39),a(16,"div",37)(17,"a",40),S(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=p(e).$implicit,o=r(4);return _(o.refreshPrice(t))}),S(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),P(n==0?1:-1),l(2),L(e.Model),l(2),m("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",T(12,Le,e.Discontinued)),l(),b(" ",e.Code," "),l(),m("ngxPermissionsOnly",T(14,O,t.rolePriceEdit)),l(3),P((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),m("ngClass",T(16,Be,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),P(e.Channel.length>0?15:-1),l(2),m("href",e.Channel[0]==null?null:e.Channel[0].Url,V)}}function tt(i,s){if(i&1&&k(0,et,22,18,"tr",33,N),i&2){let e=s.$implicit;R(e.Variants)}}function nt(i,s){if(i&1){let e=u();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(t){p(e);let o=r(2);return I(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),_(t)}),C("toggleChange",function(){p(e);let t=r(2);return _(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,Ae,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){p(e);let t=r(2);return _(t.openModalFilter())}),S(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,tt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){p(e);let t=r(2);return _(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),w("ngModel",n.toggleDifferentInventory),l(7),m("ngxPermissionsOnly",T(16,O,n.rolePriceEdit)),l(4),m("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),m("src",n.selectedChannel==null?null:n.selectedChannel.Img,V),l(2),b(" ",J(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),R(e),l(2),m("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",F(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function it(i,s){if(i&1){let e=u();a(0,"mainpanel",2),y("textChange",function(t){p(e);let o=r();return I(o.searchFilter.text,t)||(o.searchFilter.text=t),_(t)}),C("onSubmit",function(){p(e);let t=r();return _(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),y("ngModelChange",function(t){p(e);let o=r();return I(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),_(t)}),h(6,Ue,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),y("ngModelChange",function(t){p(e);let o=r();return I(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),_(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),y("ngModelChange",function(t){p(e);let o=r();return I(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),_(t)}),c()()(),h(15,We,7,1,"actions",9),v(16,"async"),h(17,nt,30,18,"content",9),v(18,"async"),c()}if(i&2){let e=r();m("headerTitle",e.pageTitle),w("text",e.searchFilter.text),l(5),m("clearable",!1)("items",e.channelOptions),w("ngModel",e.searchFilter.ChannelID),l(5),w("ngModel",e.searchFilter.PageNumber),l(4),w("ngModel",e.searchFilter.RowCount),l(),m("ngIf",F(16,9,e.data$)),l(2),m("ngIf",F(18,11,e.data$))}}var Wt=(()=>{class i{constructor(e,n,t,o,g,x,Ne,ke,Re){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.authService=x,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Re,this.infinitePagination=M(B),this.updateResHandling=M(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ce.PriceUpdate,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.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=x.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.updateResHandling.responseHandling(t,n,"Price")}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(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(Te,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(x=>se.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,n){let t={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",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),x=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${x}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Ve,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(f(_e),f(pe),f(fe),f(Ie),f(ye),f(ge),f(Pe),f(Fe),f(D))}}static{this.\u0275cmp=j({type:i,selectors:[["app-price-single-channel"]],features:[K([B,Me,te("https://res.cloudinary.com/"),D,U])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[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,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["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"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,it,19,13,"mainpanel",1),v(1,"async")),n&2&&m("ngIf",F(1,1,t.loader$))},dependencies:[ee,Q,X,Y,D,we,Se,xe,ue,he,Ce,le,ie,re,ne,oe,ae,De,Ee,de,me,be,ve],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}"],changeDetection:0})}}return i})();export{Wt as PriceSingleChannelComponent};
1
+ import{a as Me}from"./chunk-EHBCYQSG.js";import{a as Fe,b as Ve}from"./chunk-GRYGUILI.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as Te,b as De,c as Ee,d as B,e as U}from"./chunk-NWWYOZ4V.js";import{a as ve,b as be}from"./chunk-YTCIQBSO.js";import"./chunk-RHHHL4OR.js";import{a as Ie}from"./chunk-PE4SWUEZ.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as ce}from"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import{a as ye}from"./chunk-3YP6ORBR.js";import"./chunk-6RMBCW2O.js";import{i as ge}from"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as pe,e as _e}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as he,b as Ce,d as ue,e as xe}from"./chunk-PYXL7UF7.js";import{c as se}from"./chunk-PW42BQIY.js";import{d as fe,l as Pe,m as Se,n as we}from"./chunk-HJXYT6MI.js";import{A as le,b as ne,c as ie,h as oe,m as ae,o as re}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as me,c as de}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{d as Q,g as X,j as Y,m as D,n as ee,q as te}from"./chunk-FXQKRJWU.js";import{$c as v,Fc as q,G as W,Gb as j,Gc as d,Hc as L,Ic as b,Kc as w,Lc as I,Mb as h,Mc as y,Qc as K,Sc as T,Yb as m,Z as A,ad as F,bd as J,cd as Z,dc as P,ea as $,ec as N,gc as k,hc as R,ic as a,jc as c,kc as S,lc as z,mc as G,oc as u,pa as M,pb as V,rb as l,tc as C,uc as r,xb as f,xc as H,ya as p,za as _}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var O=i=>[i],Le=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i});function Ue(i,s){if(i&1&&(a(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),m("src",e==null?null:e.Img,V),l(),b(" ",e.Name," ")}}function Oe(i,s){if(i&1){let e=u();a(0,"button",16),C("click",function(){p(e);let t=r().ngIf,o=r(2);return _(o.updateStock(t))}),S(1,"i",17),d(2," Update "),c()}}function We(i,s){if(i&1){let e=u();a(0,"actions")(1,"div",12),h(2,Oe,3,0,"button",13),a(3,"button",14),C("click",function(){p(e);let t=r(2);return _(t.openExportDialog())}),S(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),m("ngIf",n.productService.hasSelectionVariant(e))}}function Ae(i,s){if(i&1){let e=u();a(0,"th")(1,"input",32),C("change",function(t){p(e);let o=r().ngIf,g=r(2);return _(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function $e(i,s){if(i&1){let e=u();a(0,"input",49),y("ngModelChange",function(t){p(e);let o=r(4).$implicit;return I(o.selected,t)||(o.selected=t),_(t)}),C("ngModelChange",function(){p(e);let t=r(4).$implicit,o=r(3);return _(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;w("ngModel",e.selected)}}function je(i,s){if(i&1&&h(0,$e,1,1,"ng-template",26),i&2){let e=r(6);m("ngxPermissionsOnly",T(1,O,e.rolePriceEdit))}}function ze(i,s){if(i&1){let e=u();z(0),a(1,"img",50),C("click",function(t){p(e);let o=r(3).$implicit,g=r(3);return _(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),G()}if(i&2){let e=r(3).$implicit;l(),H("src",e.ThumbnailUrl,V)}}function Ge(i,s){i&1&&S(0,"img",51)}function He(i,s){if(i&1&&(a(0,"small",48),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function qe(i,s){if(i&1&&(a(0,"td",44)(1,"div",35),h(2,je,1,3,null,26),a(3,"div"),h(4,ze,2,1,"ng-container",45)(5,Ge,1,0,"ng-template",null,0,Z),c()()(),a(7,"td",46)(8,"span",47),d(9),c(),h(10,He,2,1,"small",48),c()),i&2){let e=q(6),n=r(2).$implicit;m("rowSpan",n.Variants.length),l(2),P((n.Variants==null?null:n.Variants.length)>1?2:-1),l(2),m("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),m("rowSpan",n.Variants.length),l(2),L(n.Name),l(),P(n.Category?10:-1)}}function Ke(i,s){if(i&1){let e=u();a(0,"input",54),y("ngModelChange",function(t){p(e);let o=r(2).$implicit;return I(o.selected,t)||(o.selected=t),_(t)}),c()}if(i&2){let e=r(2).$implicit;w("ngModel",e.selected)}}function Je(i,s){if(i&1&&(a(0,"td",52),h(1,Ke,1,1,"input",53),c()),i&2){let e=r().$implicit;l(),P(e.UnitPrice>=0?1:-1)}}function Ze(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Qe(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.UnitPrice)," ")}}function Xe(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),S(2,"i",55),c()()),i&2){let e=r().$implicit,n=r(4);l(),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function Ye(i,s){if(i&1){let e=u();a(0,"div",56),C("click",function(){p(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,x=r();return _(x.openTableDialog(t,o,g))}),d(1),v(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function et(i,s){if(i&1){let e=u();a(0,"tr",33),h(1,qe,11,7),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Je,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Ze,2,0,"div",36)(11,Qe,3,3,"div")(12,Xe,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,Ye,3,3,"div",39),a(16,"div",37)(17,"a",40),S(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=p(e).$implicit,o=r(4);return _(o.refreshPrice(t))}),S(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),P(n==0?1:-1),l(2),L(e.Model),l(2),m("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",T(12,Le,e.Discontinued)),l(),b(" ",e.Code," "),l(),m("ngxPermissionsOnly",T(14,O,t.rolePriceEdit)),l(3),P((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),m("ngClass",T(16,Be,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),P(e.Channel.length>0?15:-1),l(2),m("href",e.Channel[0]==null?null:e.Channel[0].Url,V)}}function tt(i,s){if(i&1&&k(0,et,22,18,"tr",33,N),i&2){let e=s.$implicit;R(e.Variants)}}function nt(i,s){if(i&1){let e=u();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(t){p(e);let o=r(2);return I(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),_(t)}),C("toggleChange",function(){p(e);let t=r(2);return _(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,Ae,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){p(e);let t=r(2);return _(t.openModalFilter())}),S(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,tt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){p(e);let t=r(2);return _(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),w("ngModel",n.toggleDifferentInventory),l(7),m("ngxPermissionsOnly",T(16,O,n.rolePriceEdit)),l(4),m("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),m("src",n.selectedChannel==null?null:n.selectedChannel.Img,V),l(2),b(" ",J(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),R(e),l(2),m("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",F(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function it(i,s){if(i&1){let e=u();a(0,"mainpanel",2),y("textChange",function(t){p(e);let o=r();return I(o.searchFilter.text,t)||(o.searchFilter.text=t),_(t)}),C("onSubmit",function(){p(e);let t=r();return _(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),y("ngModelChange",function(t){p(e);let o=r();return I(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),_(t)}),h(6,Ue,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),y("ngModelChange",function(t){p(e);let o=r();return I(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),_(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),y("ngModelChange",function(t){p(e);let o=r();return I(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),_(t)}),c()()(),h(15,We,7,1,"actions",9),v(16,"async"),h(17,nt,30,18,"content",9),v(18,"async"),c()}if(i&2){let e=r();m("headerTitle",e.pageTitle),w("text",e.searchFilter.text),l(5),m("clearable",!1)("items",e.channelOptions),w("ngModel",e.searchFilter.ChannelID),l(5),w("ngModel",e.searchFilter.PageNumber),l(4),w("ngModel",e.searchFilter.RowCount),l(),m("ngIf",F(16,9,e.data$)),l(2),m("ngIf",F(18,11,e.data$))}}var Wt=(()=>{class i{constructor(e,n,t,o,g,x,Ne,ke,Re){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.authService=x,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Re,this.infinitePagination=M(B),this.updateResHandling=M(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ce.PriceUpdate,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.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=x.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.updateResHandling.responseHandling(t,n,"Price")}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(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(Te,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(x=>se.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,n){let t={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",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),x=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${x}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Ve,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(f(_e),f(pe),f(fe),f(Ie),f(ye),f(ge),f(Pe),f(Fe),f(D))}}static{this.\u0275cmp=j({type:i,selectors:[["app-price-single-channel"]],features:[K([B,Me,te("https://res.cloudinary.com/"),D,U])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[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,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["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"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,it,19,13,"mainpanel",1),v(1,"async")),n&2&&m("ngIf",F(1,1,t.loader$))},dependencies:[ee,Q,X,Y,D,we,Se,xe,ue,he,Ce,le,ie,re,ne,oe,ae,De,Ee,de,me,be,ve],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}"],changeDetection:0})}}return i})();export{Wt as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{a as ae}from"./chunk-67HPC5Y3.js";import{a as ie}from"./chunk-OLANEXLB.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import{a as oe,b as re}from"./chunk-ABYG6YZT.js";import"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{i as Q}from"./chunk-FHWKSD5A.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as K}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as X,b as Z,d as $,e as ee}from"./chunk-PYXL7UF7.js";import{c as J}from"./chunk-PW42BQIY.js";import{m as te,n as ne}from"./chunk-HJXYT6MI.js";import{A as Y,c as U,h as j,m as q,o as G}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as A,J as H,f as W,g as F,k as B,m as k,n as z}from"./chunk-FXQKRJWU.js";import{$c as L,Fc as P,Gb as T,Gc as l,Hc as S,Ic as y,Kc as c,Lc as u,Mb as w,Mc as h,Sc as I,Yb as m,ad as N,bd as V,cd as R,ic as t,jc as n,kc as C,lc as M,mc as x,oc as O,pb as b,rb as r,tc as E,uc as v,xb as D,ya as p,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var le=a=>({ID:a});function de(a,f){if(a&1&&(t(0,"span",17),C(1,"img",18),n(),l(2)),a&2){let e=f.item;r(),m("src",e.Img,b)("alt",e.Name),r(),y(" ",e.Name," ")}}function me(a,f){if(a&1&&(t(0,"tr")(1,"td"),l(2),n(),t(3,"td"),C(4,"img",28),n(),t(5,"td"),l(6),n(),t(7,"td",29)(8,"a",30),l(9),L(10,"number"),n()(),t(11,"td"),l(12),n(),t(13,"td"),l(14),L(15,"date"),n()()),a&2){let e=f.$implicit;r(2),S(e._source.ChannelName),r(2),m("src",e.logo,b),r(2),S(e._source.DateRange),r(2),m("queryParams",I(12,le,e._source.ID)),r(),y(" ",N(10,7,e._source.CountOrder)," "),r(3),S(e._source.UserLogin),r(2),y(" ",V(15,9,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," ")}}function pe(a,f){if(a&1){let e=O();M(0),t(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),l(6,"Channel"),n(),t(7,"th",23),l(8,"Type"),n(),t(9,"th",24),l(10,"Download Date Range"),n(),t(11,"th",25),l(12,"Count"),n(),t(13,"th"),l(14,"User Login"),n(),t(15,"th"),l(16,"Created"),n()()(),t(17,"tbody"),w(18,me,16,14,"tr",26),n()(),t(19,"mat-paginator",27),E("page",function(i){p(e);let d=v();return s(d.onPaginationChange(i))}),n()(),x()}if(a&2){let e=v();r(18),m("ngForOf",e.downloadOrders),r(),m("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function se(a,f){a&1&&(t(0,"div",31),C(1,"app-empty-state"),n())}var xe=(()=>{class a{constructor(e,g){this.http=e,this.authService=g,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter=e.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(e=>{this.downloadOrders=e.hits,this.setChannelLogo(),this.paginationTotal=e.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(e=>(e.logo=J.getChannelLogoByTypeId(e._source.TypeID),e))}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getDownloadOrders()}static{this.\u0275fac=function(g){return new(g||a)(D(K),D(Q))}}static{this.\u0275cmp=T({type:a,selectors:[["app-download-order-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/Order/Download_Order_Log/Detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(g,i){if(g&1){let d=O();t(0,"mainpanel",1),E("onSubmit",function(){return p(d),s(i.getDownloadOrders())}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),n(),t(5,"ng-select",3),h("ngModelChange",function(o){return p(d),u(i.filter.ChannelID,o)||(i.filter.ChannelID=o),s(o)}),w(6,de,3,3,"ng-template",4),n()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),n(),t(10,"div",7)(11,"datepicker",8),h("dateChange",function(o){return p(d),u(i.filter.From,o)||(i.filter.From=o),s(o)}),n()(),t(12,"div")(13,"datepicker",9),h("dateChange",function(o){return p(d),u(i.filter.To,o)||(i.filter.To=o),s(o)}),n()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),n(),t(17,"input",11),h("ngModelChange",function(o){return p(d),u(i.filter.PageNumber,o)||(i.filter.PageNumber=o),s(o)}),n()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),n(),t(21,"input",12),h("ngModelChange",function(o){return p(d),u(i.filter.RowCount,o)||(i.filter.RowCount=o),s(o)}),n()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),w(26,pe,20,4,"ng-container",16)(27,se,2,0,"ng-template",null,0,R),n()()()()()}if(g&2){let d=P(28);m("hideSearchBox",!0),r(5),m("clearable",!0)("items",i.channelOptions),c("ngModel",i.filter.ChannelID),r(6),c("date",i.filter.From),r(2),c("date",i.filter.To),r(4),c("ngModel",i.filter.PageNumber),r(4),c("ngModel",i.filter.RowCount),r(5),m("ngIf",(i.downloadOrders==null?null:i.downloadOrders.length)>0)("ngIfElse",d)}},dependencies:[z,W,F,k,B,re,oe,ne,te,ee,$,X,Z,Y,U,G,j,q,ae,H,A,ie],encapsulation:2})}}return a})();export{xe as DownloadOrderLogComponent};
1
+ import{a as ae}from"./chunk-67HPC5Y3.js";import{a as ie}from"./chunk-OLANEXLB.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import{a as oe,b as re}from"./chunk-ABYG6YZT.js";import"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{i as Q}from"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as K}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as X,b as Z,d as $,e as ee}from"./chunk-PYXL7UF7.js";import{c as J}from"./chunk-PW42BQIY.js";import{m as te,n as ne}from"./chunk-HJXYT6MI.js";import{A as Y,c as U,h as j,m as q,o as G}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as A,J as H,f as W,g as F,k as B,m as k,n as z}from"./chunk-FXQKRJWU.js";import{$c as L,Fc as P,Gb as T,Gc as l,Hc as S,Ic as y,Kc as c,Lc as u,Mb as w,Mc as h,Sc as I,Yb as m,ad as N,bd as V,cd as R,ic as t,jc as n,kc as C,lc as M,mc as x,oc as O,pb as b,rb as r,tc as E,uc as v,xb as D,ya as p,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var le=a=>({ID:a});function de(a,f){if(a&1&&(t(0,"span",17),C(1,"img",18),n(),l(2)),a&2){let e=f.item;r(),m("src",e.Img,b)("alt",e.Name),r(),y(" ",e.Name," ")}}function me(a,f){if(a&1&&(t(0,"tr")(1,"td"),l(2),n(),t(3,"td"),C(4,"img",28),n(),t(5,"td"),l(6),n(),t(7,"td",29)(8,"a",30),l(9),L(10,"number"),n()(),t(11,"td"),l(12),n(),t(13,"td"),l(14),L(15,"date"),n()()),a&2){let e=f.$implicit;r(2),S(e._source.ChannelName),r(2),m("src",e.logo,b),r(2),S(e._source.DateRange),r(2),m("queryParams",I(12,le,e._source.ID)),r(),y(" ",N(10,7,e._source.CountOrder)," "),r(3),S(e._source.UserLogin),r(2),y(" ",V(15,9,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," ")}}function pe(a,f){if(a&1){let e=O();M(0),t(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),l(6,"Channel"),n(),t(7,"th",23),l(8,"Type"),n(),t(9,"th",24),l(10,"Download Date Range"),n(),t(11,"th",25),l(12,"Count"),n(),t(13,"th"),l(14,"User Login"),n(),t(15,"th"),l(16,"Created"),n()()(),t(17,"tbody"),w(18,me,16,14,"tr",26),n()(),t(19,"mat-paginator",27),E("page",function(i){p(e);let d=v();return s(d.onPaginationChange(i))}),n()(),x()}if(a&2){let e=v();r(18),m("ngForOf",e.downloadOrders),r(),m("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function se(a,f){a&1&&(t(0,"div",31),C(1,"app-empty-state"),n())}var xe=(()=>{class a{constructor(e,g){this.http=e,this.authService=g,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter=e.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(e=>{this.downloadOrders=e.hits,this.setChannelLogo(),this.paginationTotal=e.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(e=>(e.logo=J.getChannelLogoByTypeId(e._source.TypeID),e))}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getDownloadOrders()}static{this.\u0275fac=function(g){return new(g||a)(D(K),D(Q))}}static{this.\u0275cmp=T({type:a,selectors:[["app-download-order-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/Order/Download_Order_Log/Detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(g,i){if(g&1){let d=O();t(0,"mainpanel",1),E("onSubmit",function(){return p(d),s(i.getDownloadOrders())}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),n(),t(5,"ng-select",3),h("ngModelChange",function(o){return p(d),u(i.filter.ChannelID,o)||(i.filter.ChannelID=o),s(o)}),w(6,de,3,3,"ng-template",4),n()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),n(),t(10,"div",7)(11,"datepicker",8),h("dateChange",function(o){return p(d),u(i.filter.From,o)||(i.filter.From=o),s(o)}),n()(),t(12,"div")(13,"datepicker",9),h("dateChange",function(o){return p(d),u(i.filter.To,o)||(i.filter.To=o),s(o)}),n()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),n(),t(17,"input",11),h("ngModelChange",function(o){return p(d),u(i.filter.PageNumber,o)||(i.filter.PageNumber=o),s(o)}),n()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),n(),t(21,"input",12),h("ngModelChange",function(o){return p(d),u(i.filter.RowCount,o)||(i.filter.RowCount=o),s(o)}),n()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),w(26,pe,20,4,"ng-container",16)(27,se,2,0,"ng-template",null,0,R),n()()()()()}if(g&2){let d=P(28);m("hideSearchBox",!0),r(5),m("clearable",!0)("items",i.channelOptions),c("ngModel",i.filter.ChannelID),r(6),c("date",i.filter.From),r(2),c("date",i.filter.To),r(4),c("ngModel",i.filter.PageNumber),r(4),c("ngModel",i.filter.RowCount),r(5),m("ngIf",(i.downloadOrders==null?null:i.downloadOrders.length)>0)("ngIfElse",d)}},dependencies:[z,W,F,k,B,re,oe,ne,te,ee,$,X,Z,Y,U,G,j,q,ae,H,A,ie],encapsulation:2})}}return a})();export{xe as DownloadOrderLogComponent};
@@ -1 +1 @@
1
- import{a as ge}from"./chunk-OHVOVAKD.js";import"./chunk-IITU3NV6.js";import{a as de}from"./chunk-2XWZQCUR.js";import{a as me}from"./chunk-RGAWEFPQ.js";import{a as w}from"./chunk-XHAXYWZ7.js";import{c as ue,d as O,e as V}from"./chunk-NWWYOZ4V.js";import"./chunk-YTCIQBSO.js";import"./chunk-2O4IEGGR.js";import"./chunk-VFATXJRG.js";import"./chunk-LYPHZP72.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-RHHHL4OR.js";import{a as he}from"./chunk-KRQHTRFM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as ne}from"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-3YP6ORBR.js";import"./chunk-6VYFG4AQ.js";import{i as M}from"./chunk-FHWKSD5A.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as R}from"./chunk-CGOB6Y3X.js";import{b as ie,e as ae}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as f}from"./chunk-PW42BQIY.js";import{d as le,l as se,m as ce,n as pe}from"./chunk-HJXYT6MI.js";import{A as te,c as X,h as Y,m as Z,o as ee}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as oe,c as re}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as Q,j as K,n as q}from"./chunk-FXQKRJWU.js";import{$c as I,G as j,Gb as G,Gc as S,Kc as E,Lc as x,Mb as g,Mc as T,Qc as $,Ra as P,Sc as J,Yb as h,ad as v,ea as A,ic as l,ja as H,jc as p,kc as W,lc as F,mc as N,nc as z,oc as L,pa as u,rb as c,tc as C,uc as m,xb as d,ya as y,za as b}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as k,b as B}from"./chunk-66YHNWRR.js";var U=(()=>{class r{constructor(){this.authService=u(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(e,i){let t=Object.assign([],this.channelOptions),n=[],a;return e.forEach(o=>{a=t.find(s=>s.ID==o?.parent?.id),a&&(a=B(k({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=t.find(s=>s.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(e,i){let t=[],n=[],a=[];return e.length>0?(t=e.map(o=>o.id),n=e.filter(o=>f.IsNotEmpty(o?.parent?.id)).map(o=>o?.parent?.id).filter((o,s,D)=>D.indexOf(o)===s)):(t=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,D)=>D.indexOf(o)===s),{locationIds:t,channelIds:a}}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=H({token:r,factory:r.\u0275fac})}}return r})();var fe=r=>[r];function _e(r,_){if(r&1){let e=L();l(0,"button",16),C("click",function(){y(e);let t=m(2).ngIf,n=m();return b(n.onUpdateItems(t))}),W(1,"i",17),S(2," Update "),p()}}function Se(r,_){if(r&1&&(F(0),g(1,_e,3,0,"button",15),N()),r&2){let e=m().ngIf,i=m();c(),h("ngIf",i.productService.hasSelectionVariant(e))}}function Ie(r,_){if(r&1&&(l(0,"actions")(1,"div",13),g(2,Se,2,1,"ng-container",14),p()()),r&2){let e=m();c(2),h("ngxPermissionsOnly",J(1,fe,e.inventoryUpdateRole))}}function ve(r,_){r&1&&z(0)}function ye(r,_){if(r&1){let e=L();F(0),l(1,"app-table",18),C("onToggle",function(t){y(e);let n=m();return b(n.onShowDifferenceStock(t))})("onSubmit",function(t){y(e);let n=m();return b(n.updateStockByVariant(t))}),p(),N()}if(r&2){let e=_.ngIf,i=m();c(),h("data",e)("channel",i.channels())("showProductToggle",!0)("hiddenIPOSInventory",i.searchFilter.HiddenIPOSInventory)}}var at=(()=>{class r{constructor(e,i,t,n,a,o){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=u(O),this.multiChannelService=u(U),this.updateResHandling=u(V),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=P([]),this.selectedChannels=P([]),this.channels=P([]),this.inventoryUpdateRole=ne.InventoryUpdate,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(A(e=>{e.Filter={PageNumber:e.Filter.PageNumber,filterModel:w.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory},this.searchFilter=e.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(e=[]){let i=e.filter(n=>f.isValidGUID(n.id)==!1),t=e.filter(n=>f.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(t)}onSearch(e){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let t=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=t.channelIds,this.searchFilter.ListLocationID=t.locationIds,this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updateStock(e,i){if(e.length>0){let t=[];e.forEach(o=>{o.Channel?.forEach(s=>{t.push({ChannelItemID:s?.ChannelItemID,ChannelVariationID:s?.ChannelVariationID,Inventory:o.Inventory,LocationID:s?.LocationID})})});let a={ListChannelID:i.filter(o=>o.selected).map(o=>o.ID),List:t};this.http.post(R.UpdateInventoryChannel,a).subscribe(o=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+a.List.length+" variants in "+a.ListChannelID.length+" channels","Success")})}}updateStockByVariant(e){let i=e.InventoryMultiwarehouse[0]?.LocationID,t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:e.Inventory,VariantID:e.ID,SKU:e?.Sku,LocationID:i};this.http.post(R.UpdateUpdateQuantityByItem,t).subscribe(n=>{this.paginationService.reloadPagination(this.searchFilter),this.handlingUpdateStock(n)})}handlingUpdateStock(e){if(e){let i=e?.Response?.Fail_list,t=e?.Response?.Success_list;this.updateResHandling.responseHandling(t,i,"Stock")}else this.toastr.error(e?.Exception,"Error")}onShowDifferenceStock(e){e?this.searchFilter.filterModel=w.DIFFERENCE:this.searchFilter.filterModel=w.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e),t=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(me,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(t))},width:"400px"}).afterClosed().pipe(j(n=>f.IsNotEmpty(n))).subscribe(n=>{this.updateStock(i,n)})}static{this.\u0275fac=function(i){return new(i||r)(d(ae),d(ie),d(le),d(he),d(M),d(se))}}static{this.\u0275cmp=G({type:r,selectors:[["app-multi-channel-comparison"]],features:[$([O,U,V])],decls:26,vars:21,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,t){i&1&&(l(0,"mainpanel",0),C("onSubmit",function(a){return t.onSearch(a)}),g(1,Ie,3,3,"actions",1),I(2,"async"),l(3,"filters"),g(4,ve,1,0,"ng-container",1),I(5,"async"),l(6,"div")(7,"label",2),S(8,"Channel"),p(),l(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(a){return t.onChannelChange(a)}),p()(),l(10,"div",4)(11,"label",5),S(12,"PageNumber"),p(),l(13,"input",6),T("ngModelChange",function(a){return x(t.searchFilter.PageNumber,a)||(t.searchFilter.PageNumber=a),a}),p()(),l(14,"div",4)(15,"label",7),S(16,"Page Size"),p(),l(17,"input",8),T("ngModelChange",function(a){return x(t.searchFilter.RowCount,a)||(t.searchFilter.RowCount=a),a}),p()()(),l(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),g(22,ye,2,4,"ng-container",1),I(23,"async"),l(24,"infinite-paginator",12),I(25,"async"),C("onNextPage",function(){return t.paginationService.onNextPage(t.searchFilter)})("onLastPage",function(){return t.paginationService.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.paginationService.getRowCount(t.searchFilter)}),p()()()()()()),i&2&&(h("hideSearchBox",!1),c(),h("ngIf",v(2,13,t.paginationService.data$)),c(3),h("ngIf",v(5,15,t.loader$)),c(5),h("multiple",!0),c(4),E("ngModel",t.searchFilter.PageNumber),c(4),E("ngModel",t.searchFilter.RowCount),c(5),h("ngIf",v(23,17,t.paginationService.data$)),c(2),h("totalData",t.paginationService.totalData())("hideCount",t.paginationService.hideCount())("rowCount",v(25,19,t.paginationService.totalRowCount$))("pageNumber",t.paginationService.pageNumber())("disableNextButton",t.paginationService.disableNextButton())("goToLastPage",t.paginationService.isLastPage()))},dependencies:[q,Q,K,pe,ce,de,te,X,ee,Y,Z,ue,ge,re,oe],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{at as MultiChannelComparison};
1
+ import{a as ge}from"./chunk-OHVOVAKD.js";import"./chunk-IITU3NV6.js";import{a as de}from"./chunk-HGZ5B6WR.js";import{a as me}from"./chunk-RGAWEFPQ.js";import{a as w}from"./chunk-XHAXYWZ7.js";import{c as ue,d as O,e as V}from"./chunk-NWWYOZ4V.js";import"./chunk-YTCIQBSO.js";import"./chunk-2O4IEGGR.js";import"./chunk-VFATXJRG.js";import"./chunk-LYPHZP72.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-RHHHL4OR.js";import{a as he}from"./chunk-PE4SWUEZ.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as ne}from"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-3YP6ORBR.js";import"./chunk-6RMBCW2O.js";import{i as M}from"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as R}from"./chunk-CGOB6Y3X.js";import{b as ie,e as ae}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as f}from"./chunk-PW42BQIY.js";import{d as le,l as se,m as ce,n as pe}from"./chunk-HJXYT6MI.js";import{A as te,c as X,h as Y,m as Z,o as ee}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as oe,c as re}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as Q,j as K,n as q}from"./chunk-FXQKRJWU.js";import{$c as I,G as j,Gb as G,Gc as S,Kc as E,Lc as x,Mb as g,Mc as T,Qc as $,Ra as P,Sc as J,Yb as h,ad as v,ea as A,ic as l,ja as H,jc as p,kc as W,lc as F,mc as N,nc as z,oc as L,pa as u,rb as c,tc as C,uc as m,xb as d,ya as y,za as b}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as k,b as B}from"./chunk-66YHNWRR.js";var U=(()=>{class r{constructor(){this.authService=u(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(e,i){let t=Object.assign([],this.channelOptions),n=[],a;return e.forEach(o=>{a=t.find(s=>s.ID==o?.parent?.id),a&&(a=B(k({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=t.find(s=>s.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(e,i){let t=[],n=[],a=[];return e.length>0?(t=e.map(o=>o.id),n=e.filter(o=>f.IsNotEmpty(o?.parent?.id)).map(o=>o?.parent?.id).filter((o,s,D)=>D.indexOf(o)===s)):(t=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,D)=>D.indexOf(o)===s),{locationIds:t,channelIds:a}}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=H({token:r,factory:r.\u0275fac})}}return r})();var fe=r=>[r];function _e(r,_){if(r&1){let e=L();l(0,"button",16),C("click",function(){y(e);let t=m(2).ngIf,n=m();return b(n.onUpdateItems(t))}),W(1,"i",17),S(2," Update "),p()}}function Se(r,_){if(r&1&&(F(0),g(1,_e,3,0,"button",15),N()),r&2){let e=m().ngIf,i=m();c(),h("ngIf",i.productService.hasSelectionVariant(e))}}function Ie(r,_){if(r&1&&(l(0,"actions")(1,"div",13),g(2,Se,2,1,"ng-container",14),p()()),r&2){let e=m();c(2),h("ngxPermissionsOnly",J(1,fe,e.inventoryUpdateRole))}}function ve(r,_){r&1&&z(0)}function ye(r,_){if(r&1){let e=L();F(0),l(1,"app-table",18),C("onToggle",function(t){y(e);let n=m();return b(n.onShowDifferenceStock(t))})("onSubmit",function(t){y(e);let n=m();return b(n.updateStockByVariant(t))}),p(),N()}if(r&2){let e=_.ngIf,i=m();c(),h("data",e)("channel",i.channels())("showProductToggle",!0)("hiddenIPOSInventory",i.searchFilter.HiddenIPOSInventory)}}var at=(()=>{class r{constructor(e,i,t,n,a,o){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=u(O),this.multiChannelService=u(U),this.updateResHandling=u(V),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=P([]),this.selectedChannels=P([]),this.channels=P([]),this.inventoryUpdateRole=ne.InventoryUpdate,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(A(e=>{e.Filter={PageNumber:e.Filter.PageNumber,filterModel:w.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory},this.searchFilter=e.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(e=[]){let i=e.filter(n=>f.isValidGUID(n.id)==!1),t=e.filter(n=>f.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(t)}onSearch(e){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let t=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=t.channelIds,this.searchFilter.ListLocationID=t.locationIds,this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updateStock(e,i){if(e.length>0){let t=[];e.forEach(o=>{o.Channel?.forEach(s=>{t.push({ChannelItemID:s?.ChannelItemID,ChannelVariationID:s?.ChannelVariationID,Inventory:o.Inventory,LocationID:s?.LocationID})})});let a={ListChannelID:i.filter(o=>o.selected).map(o=>o.ID),List:t};this.http.post(R.UpdateInventoryChannel,a).subscribe(o=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+a.List.length+" variants in "+a.ListChannelID.length+" channels","Success")})}}updateStockByVariant(e){let i=e.InventoryMultiwarehouse[0]?.LocationID,t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:e.Inventory,VariantID:e.ID,SKU:e?.Sku,LocationID:i};this.http.post(R.UpdateUpdateQuantityByItem,t).subscribe(n=>{this.paginationService.reloadPagination(this.searchFilter),this.handlingUpdateStock(n)})}handlingUpdateStock(e){if(e){let i=e?.Response?.Fail_list,t=e?.Response?.Success_list;this.updateResHandling.responseHandling(t,i,"Stock")}else this.toastr.error(e?.Exception,"Error")}onShowDifferenceStock(e){e?this.searchFilter.filterModel=w.DIFFERENCE:this.searchFilter.filterModel=w.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e),t=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(me,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(t))},width:"400px"}).afterClosed().pipe(j(n=>f.IsNotEmpty(n))).subscribe(n=>{this.updateStock(i,n)})}static{this.\u0275fac=function(i){return new(i||r)(d(ae),d(ie),d(le),d(he),d(M),d(se))}}static{this.\u0275cmp=G({type:r,selectors:[["app-multi-channel-comparison"]],features:[$([O,U,V])],decls:26,vars:21,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,t){i&1&&(l(0,"mainpanel",0),C("onSubmit",function(a){return t.onSearch(a)}),g(1,Ie,3,3,"actions",1),I(2,"async"),l(3,"filters"),g(4,ve,1,0,"ng-container",1),I(5,"async"),l(6,"div")(7,"label",2),S(8,"Channel"),p(),l(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(a){return t.onChannelChange(a)}),p()(),l(10,"div",4)(11,"label",5),S(12,"PageNumber"),p(),l(13,"input",6),T("ngModelChange",function(a){return x(t.searchFilter.PageNumber,a)||(t.searchFilter.PageNumber=a),a}),p()(),l(14,"div",4)(15,"label",7),S(16,"Page Size"),p(),l(17,"input",8),T("ngModelChange",function(a){return x(t.searchFilter.RowCount,a)||(t.searchFilter.RowCount=a),a}),p()()(),l(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),g(22,ye,2,4,"ng-container",1),I(23,"async"),l(24,"infinite-paginator",12),I(25,"async"),C("onNextPage",function(){return t.paginationService.onNextPage(t.searchFilter)})("onLastPage",function(){return t.paginationService.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.paginationService.getRowCount(t.searchFilter)}),p()()()()()()),i&2&&(h("hideSearchBox",!1),c(),h("ngIf",v(2,13,t.paginationService.data$)),c(3),h("ngIf",v(5,15,t.loader$)),c(5),h("multiple",!0),c(4),E("ngModel",t.searchFilter.PageNumber),c(4),E("ngModel",t.searchFilter.RowCount),c(5),h("ngIf",v(23,17,t.paginationService.data$)),c(2),h("totalData",t.paginationService.totalData())("hideCount",t.paginationService.hideCount())("rowCount",v(25,19,t.paginationService.totalRowCount$))("pageNumber",t.paginationService.pageNumber())("disableNextButton",t.paginationService.disableNextButton())("goToLastPage",t.paginationService.isLastPage()))},dependencies:[q,Q,K,pe,ce,de,te,X,ee,Y,Z,ue,ge,re,oe],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{at as MultiChannelComparison};