marketplacepos 5.46.5 → 5.46.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/Marketplace/{chunk-OFEZTCJA.js → chunk-22ARBR7W.js} +1 -1
  2. package/Marketplace/{chunk-LEM7ESKJ.js → chunk-2BV7ZXRB.js} +1 -1
  3. package/Marketplace/{chunk-VEYUDPOA.js → chunk-2DLU2LJJ.js} +1 -1
  4. package/Marketplace/{chunk-6WE2RKUX.js → chunk-4HOZLG47.js} +1 -1
  5. package/Marketplace/{chunk-U23D2EPE.js → chunk-5BHSTOJT.js} +1 -1
  6. package/Marketplace/{chunk-HVA57ZPZ.js → chunk-5DTUHJSS.js} +1 -1
  7. package/Marketplace/{chunk-GHFADTRR.js → chunk-5EIQGYTB.js} +1 -1
  8. package/Marketplace/{chunk-WHV5AYGI.js → chunk-5KUKIH4H.js} +1 -1
  9. package/Marketplace/{chunk-BVV5R6HN.js → chunk-5Z5Y537T.js} +1 -1
  10. package/Marketplace/{chunk-C7YK5TDP.js → chunk-63ANFYRV.js} +1 -1
  11. package/Marketplace/{chunk-DGIH7HSJ.js → chunk-7TI3OR34.js} +1 -1
  12. package/Marketplace/{chunk-74AYYW2T.js → chunk-7WY57PVD.js} +1 -1
  13. package/Marketplace/{chunk-OG4QM5FO.js → chunk-7Y7SPMGZ.js} +1 -1
  14. package/Marketplace/{chunk-6NZJ2XKE.js → chunk-AWNZSJSP.js} +1 -1
  15. package/Marketplace/{chunk-7QKEL4DD.js → chunk-B2ZWLW3F.js} +1 -1
  16. package/Marketplace/{chunk-CO5XZENC.js → chunk-CBQUB3KW.js} +1 -1
  17. package/Marketplace/{chunk-5X2M3HM4.js → chunk-CRD4OUSG.js} +1 -1
  18. package/Marketplace/{chunk-KEW73FTY.js → chunk-CT73GC7O.js} +1 -1
  19. package/Marketplace/chunk-D2TELRO7.js +1 -0
  20. package/Marketplace/{chunk-6YBD22SK.js → chunk-EFB55SZR.js} +1 -1
  21. package/Marketplace/{chunk-UQL42ODX.js → chunk-ELZBUFG5.js} +1 -1
  22. package/Marketplace/chunk-EUYQST7Q.js +1 -0
  23. package/Marketplace/{chunk-CAK6MZUW.js → chunk-EXSI44LD.js} +1 -1
  24. package/Marketplace/{chunk-PHLSX23M.js → chunk-F2XHUFJC.js} +2 -2
  25. package/Marketplace/{chunk-MACYDQHW.js → chunk-F3GLNINI.js} +1 -1
  26. package/Marketplace/{chunk-DRVWJPA2.js → chunk-FHNST4Y7.js} +1 -1
  27. package/Marketplace/{chunk-XHBBUUIF.js → chunk-FKQ7ZVGD.js} +1 -1
  28. package/Marketplace/{chunk-WREH3C74.js → chunk-FOT5AJYX.js} +2 -2
  29. package/Marketplace/{chunk-RUXJCVKX.js → chunk-GSVFDIM6.js} +1 -1
  30. package/Marketplace/{chunk-5ZR5WIHG.js → chunk-GZS2MOSK.js} +1 -1
  31. package/Marketplace/{chunk-WY37QAZ4.js → chunk-JAWWMIGP.js} +1 -1
  32. package/Marketplace/{chunk-VIXNFSMT.js → chunk-JUJFPAAU.js} +1 -1
  33. package/Marketplace/{chunk-WBCI5HV5.js → chunk-JZDOMET2.js} +1 -1
  34. package/Marketplace/chunk-KTB223SK.js +1 -0
  35. package/Marketplace/{chunk-IJVKHW3C.js → chunk-KWHVCPX2.js} +1 -1
  36. package/Marketplace/{chunk-FYB62QQV.js → chunk-LLHPMXKP.js} +1 -1
  37. package/Marketplace/{chunk-VQIT62HE.js → chunk-LS7AO6KP.js} +1 -1
  38. package/Marketplace/{chunk-LRBJ5RU5.js → chunk-LXXEN7OV.js} +1 -1
  39. package/Marketplace/{chunk-6RCPPNMX.js → chunk-MGLOTL2T.js} +1 -1
  40. package/Marketplace/{chunk-7IOOG3TG.js → chunk-MZWTCBAF.js} +4 -4
  41. package/Marketplace/{chunk-774TVUXT.js → chunk-NDBC2CS6.js} +1 -1
  42. package/Marketplace/{chunk-57MSCWQ4.js → chunk-NFGFM7TW.js} +1 -1
  43. package/Marketplace/{chunk-TKV7XWBT.js → chunk-O2YNPIYM.js} +1 -1
  44. package/Marketplace/{chunk-7TQWJCUW.js → chunk-OGJMVAEL.js} +1 -1
  45. package/Marketplace/{chunk-XANN3R5J.js → chunk-OO2CSDGF.js} +1 -1
  46. package/Marketplace/{chunk-OLVWSY6L.js → chunk-P2AADVEN.js} +1 -1
  47. package/Marketplace/{chunk-SXFLJBXI.js → chunk-P2IQLBGG.js} +1 -1
  48. package/Marketplace/{chunk-KUYNX5QT.js → chunk-PTNJ3YC5.js} +1 -1
  49. package/Marketplace/{chunk-4BWA3J6V.js → chunk-QREUIGWW.js} +1 -1
  50. package/Marketplace/{chunk-BPAZ4TES.js → chunk-RGY4FVTG.js} +1 -1
  51. package/Marketplace/{chunk-RU43F4UK.js → chunk-T27ABFCP.js} +1 -1
  52. package/Marketplace/{chunk-LS2KMKMD.js → chunk-TI67Q3JR.js} +1 -1
  53. package/Marketplace/{chunk-RNZC6DAM.js → chunk-TMKLT3K2.js} +1 -1
  54. package/Marketplace/{chunk-QUEDQBZU.js → chunk-TWOIWWMO.js} +1 -1
  55. package/Marketplace/{chunk-74WQHBVN.js → chunk-URGPZLCB.js} +1 -1
  56. package/Marketplace/{chunk-GVXBDVLX.js → chunk-USBIAIK6.js} +1 -1
  57. package/Marketplace/{chunk-AY25KXUA.js → chunk-UYFUJBC4.js} +1 -1
  58. package/Marketplace/{chunk-L74PANZ5.js → chunk-V3ZRQKJA.js} +1 -1
  59. package/Marketplace/{chunk-UQFILVPA.js → chunk-WGCIF2R4.js} +2 -2
  60. package/Marketplace/{chunk-7ES3PHES.js → chunk-X4B2FYY3.js} +1 -1
  61. package/Marketplace/{chunk-JX63Y4CW.js → chunk-X52QA4QU.js} +1 -1
  62. package/Marketplace/{chunk-5EDCBXCE.js → chunk-XLWWNO5M.js} +1 -1
  63. package/Marketplace/{chunk-2REDCSBO.js → chunk-XONEJSCE.js} +1 -1
  64. package/Marketplace/{chunk-R5WARQUS.js → chunk-Y4XF2TXJ.js} +1 -1
  65. package/Marketplace/{chunk-HZPILY4V.js → chunk-YEDXFYTD.js} +1 -1
  66. package/Marketplace/{chunk-LSWILW54.js → chunk-YF4XELSP.js} +1 -1
  67. package/Marketplace/{chunk-2WHJU6CS.js → chunk-YU2SDRUC.js} +1 -1
  68. package/Marketplace/{chunk-RT3SMV6M.js → chunk-ZYQD6SBV.js} +1 -1
  69. package/Marketplace/index.html +4 -4
  70. package/Marketplace/{main-KIV2XNXR.js → main-YKZPM7WW.js} +1 -1
  71. package/package.json +1 -1
  72. package/Marketplace/chunk-EMJTQYVO.js +0 -1
  73. package/Marketplace/chunk-OLANEXLB.js +0 -1
  74. package/Marketplace/chunk-RXQX7567.js +0 -1
@@ -1 +1 @@
1
- import{a as y,b as _t}from"./chunk-IJVKHW3C.js";import"./chunk-YERZ6W22.js";import{a as ut}from"./chunk-CO5XZENC.js";import"./chunk-FGRPTNDB.js";import"./chunk-3PPLPXAX.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{e as mt}from"./chunk-PYXL7UF7.js";import{a as dt}from"./chunk-LDL3A7NM.js";import"./chunk-OLVWSY6L.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import{m as pt,n as st}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 f,Jc as A,Kc as H,Lc as W,Mb as s,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 p,Z as D,ac as F,ad as E,bd as V,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 _,v as b,ya as d,za as u}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ft=(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=_(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(),s(4,ht,5,0,"div",22)),t&2){let i=_().$implicit;r(),f(" ",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=_().$implicit;r(),f(" ",V(2,1,i.DurationInSecond,"1.1-1")," ")}}function Et(t,c){t&1&&o(0," - ")}function Vt(t,c){t&1&&o(0," In Progress ")}function yt(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"),s(11,vt,2,0,"div")(12,Nt,5,3),n(),e(13,"td"),s(14,It,5,4,"ng-container",20)(15,Et,1,0,"ng-template",null,0,G),n(),e(17,"td")(18,"div",21),s(19,Vt,1,0)(20,yt,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=_();r(),p("ngClass",U(17,ft,a.Status==1,a.Status==0)),r(2),p("routerLink",z(20,gt))("queryParams",K(21,St,a.ID)),r(),f(" ",a.ID," "),r(3),p("src",a.Img,M),r(2),C(a.ChannelName),r(2),S(a.StateID==l.scanState.InProgress?11:12),r(3),p("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),f(" ",V(27,14,a.Created,"dd MMM yyyy HH:mm")," ")}}var Kt=(()=>{class t{constructor(){this.notificationService=P(y),this.filter=w({RowCount:20,PageNumber:1,ChannelID:null}),this.scanState=_t,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([y])],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,"app-channel-options-v2",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"),s(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),p("hideSearchBox",!0),r(8),H("ngModel",m.filter().ChannelID),r(22),p("ngForOf",l==null?null:l.Data),r(3),p("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,st,pt,dt,mt,ot,at,ut],encapsulation:2})}}return t})();export{Kt as NotificationV2Component};
1
+ import{a as y,b as _t}from"./chunk-KWHVCPX2.js";import"./chunk-YERZ6W22.js";import{a as ut}from"./chunk-CBQUB3KW.js";import"./chunk-FGRPTNDB.js";import"./chunk-3PPLPXAX.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{e as mt}from"./chunk-PYXL7UF7.js";import{a as dt}from"./chunk-LDL3A7NM.js";import"./chunk-P2AADVEN.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-EUYQST7Q.js";import{m as pt,n as st}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 f,Jc as A,Kc as H,Lc as W,Mb as s,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 p,Z as D,ac as F,ad as E,bd as V,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 _,v as b,ya as d,za as u}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ft=(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=_(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(),s(4,ht,5,0,"div",22)),t&2){let i=_().$implicit;r(),f(" ",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=_().$implicit;r(),f(" ",V(2,1,i.DurationInSecond,"1.1-1")," ")}}function Et(t,c){t&1&&o(0," - ")}function Vt(t,c){t&1&&o(0," In Progress ")}function yt(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"),s(11,vt,2,0,"div")(12,Nt,5,3),n(),e(13,"td"),s(14,It,5,4,"ng-container",20)(15,Et,1,0,"ng-template",null,0,G),n(),e(17,"td")(18,"div",21),s(19,Vt,1,0)(20,yt,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=_();r(),p("ngClass",U(17,ft,a.Status==1,a.Status==0)),r(2),p("routerLink",z(20,gt))("queryParams",K(21,St,a.ID)),r(),f(" ",a.ID," "),r(3),p("src",a.Img,M),r(2),C(a.ChannelName),r(2),S(a.StateID==l.scanState.InProgress?11:12),r(3),p("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),f(" ",V(27,14,a.Created,"dd MMM yyyy HH:mm")," ")}}var Kt=(()=>{class t{constructor(){this.notificationService=P(y),this.filter=w({RowCount:20,PageNumber:1,ChannelID:null}),this.scanState=_t,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([y])],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,"app-channel-options-v2",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"),s(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),p("hideSearchBox",!0),r(8),H("ngModel",m.filter().ChannelID),r(22),p("ngForOf",l==null?null:l.Data),r(3),p("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,st,pt,dt,mt,ot,at,ut],encapsulation:2})}}return t})();export{Kt as NotificationV2Component};
@@ -1 +1 @@
1
- import{a as H}from"./chunk-C7YK5TDP.js";import{c as q}from"./chunk-RXQX7567.js";import{A as R}from"./chunk-5PS6ZS3N.js";import{r as A,s as G}from"./chunk-MFQQEEHJ.js";import{d as V,f as z,g as B,m as j,n as Z,r as $}from"./chunk-FXQKRJWU.js";import{$c as y,Fc as D,Gb as M,Gc as p,Hc as x,Ic as u,Jc as F,Mb as m,Nc as L,Oa as I,Oc as N,Pc as k,Sc as b,Xb as C,Yb as a,ad as P,cd as U,dc as h,ic as r,jc as l,kc as g,lc as v,mc as _,oc as O,pb as f,rb as n,tc as T,uc as d,xb as E,ya as w,za as S}from"./chunk-OJMQBH6T.js";var J=t=>({"border-bottom-0":t}),K=t=>({"border-bottom":t});function Q(t,c){if(t&1){let e=O();v(0),r(1,"img",15),T("click",function(i){w(e);let s=d();return S(s.onZoomImage(i))}),l(),_()}if(t&2){let e=d();n(),a("ngSrc",e.image)("fill",!0)}}function W(t,c){t&1&&g(0,"img",16),t&2&&a("fill",!0)}function X(t,c){if(t&1&&(r(0,"div",17),g(1,"i",18),r(2,"span"),p(3),l()()),t&2){let e=d();n(3),x(e.code)}}function Y(t,c){if(t&1&&(r(0,"div",11),p(1),y(2,"number"),l()),t&2){let e=d();n(),u("",P(2,1,e.totalChannel())," Listing")}}function ee(t,c){if(t&1&&(r(0,"div",25),p(1),y(2,"number"),l()),t&2){d();let e=k(7);n(),u(" (",P(2,1,e)," Listing) ")}}function te(t,c){if(t&1&&(v(0),r(1,"div",29)(2,"div",30),p(3),l(),r(4,"div")(5,"a",31),g(6,"i",32),l()()(),_()),t&2){let e=c.$implicit,o=c.index,i=d().$implicit;n(),a("ngClass",b(4,K,o!==(i==null?null:i.Variants.length)-1)),n(2),F(" ",e.ProductName," - ",e.Name," "),n(2),a("href",e.URL,f)}}function ne(t,c){if(t&1&&(r(0,"div",19)(1,"h2",20)(2,"button",21)(3,"div",22),g(4,"img",23),r(5,"span",24),p(6),l(),L(7),m(8,ee,3,3,"div",25),l()()(),r(9,"div",26)(10,"div",27),m(11,te,7,6,"ng-container",28),l()()()),t&2){let e=c.$implicit,o=c.index,i=d();a("ngClass",b(12,J,i.channels.length-1==o)),n(),a("id","heading"+o+i.id),n(),C("data-bs-target","#collapse"+o+i.id)("aria-controls","#collapse"+o+i.id),n(2),a("src",i.getChannelLogo(e.TypeID),f),n(),a("matTooltip",(e==null||e.ChannelName==null?null:e.ChannelName.length)>30?e.ChannelName:""),n(),x(e.ChannelName),n();let s=N(e==null||e.Variants==null?null:e.Variants.length);n(),h(s>1&&(i.channels==null?null:i.channels.length)>1?8:-1),n(),a("id","collapse"+o+i.id),C("aria-labelledby","heading"+o+i.id),n(2),a("ngForOf",e.Variants)}}var ue=(()=>{class t{constructor(e){this.biggerPictureService=e,this.totalChannel=I(0)}getChannelLogo(e){return q.getChannelLogoByTypeId(e)}onZoomImage(e){this.biggerPictureService.openBiggerPicture(e,this.imageForZoom)}static{this.\u0275fac=function(o){return new(o||t)(E(H))}}static{this.\u0275cmp=M({type:t,selectors:[["app-duplicate-product-card"]],inputs:{image:"image",imageForZoom:"imageForZoom",title:"title",code:"code",channels:"channels",totalChannel:[1,"totalChannel"],id:"id"},decls:17,vars:6,consts:[["elsePic",""],[1,"card"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],[1,"col-8","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle"],["class","description",4,"ngIf"],[1,"fs-5"],[1,"card-footer",2,"padding-left","0px","padding-right","0px"],["id","accordionParent",1,"accordion","accordion-flush"],["class","accordion-item border-start-0 border-end-0",3,"ngClass",4,"ngFor","ngForOf"],[1,"rounded","imgUpload","float-left","cursor-pointer",3,"click","ngSrc","fill"],["ngSrc","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload",3,"fill"],[1,"description"],[1,"fa","fa-barcode","me-2"],[1,"accordion-item","border-start-0","border-end-0",3,"ngClass"],[1,"accordion-header",3,"id"],["type","button","data-bs-toggle","collapse","aria-expanded","true",1,"accordion-button","collapsed",2,"height","40px"],[1,"d-flex","align-items-center","justify-content-start","w-100"],["alt","",1,"channel-logo",3,"src"],[1,"fs-4","ps-4","text-ellipsis",2,"max-width","13vw",3,"matTooltip"],[1,"fs-4","ms-2"],["data-bs-parent","#accordionParent",1,"accordion-collapse","collapse",3,"id"],[1,"accordion-body",2,"padding-top","0px","padding-bottom","0px"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","align-items-center","py-4",3,"ngClass"],[1,"text-ellipsis"],["target","_blank",1,"text-secondary",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"]],template:function(o,i){if(o&1&&(r(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6),m(6,Q,2,2,"ng-container",7)(7,W,1,1,"ng-template",null,0,U),l()()(),r(9,"div",8)(10,"h4",9),p(11),l(),m(12,X,4,1,"div",10)(13,Y,3,3,"div",11),l()()(),r(14,"div",12)(15,"div",13),m(16,ne,12,14,"div",14),l()()()),o&2){let s=D(8);n(6),a("ngIf",i.image)("ngIfElse",s),n(5),u(" ",i.title," "),n(),a("ngIf",i.code),n(),h(i.totalChannel()?13:-1),n(3),a("ngForOf",i.channels)}},dependencies:[Z,V,z,B,j,R,G,A,$],styles:[`.productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down}.channel-logo[_ngcontent-%COMP%]{width:18px;height:18px}.accordion-button[_ngcontent-%COMP%]{background-color:#ededed69!important}.accordion-button[_ngcontent-%COMP%]:not(.collapsed){background-color:#ededed69!important;color:#333}.accordion-button[_ngcontent-%COMP%]:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.accordion-button[_ngcontent-%COMP%]:focus{box-shadow:none!important}.card[_ngcontent-%COMP%]{margin-bottom:0!important}`]})}}return t})();export{ue as a};
1
+ import{a as H}from"./chunk-63ANFYRV.js";import{c as q}from"./chunk-EUYQST7Q.js";import{A as R}from"./chunk-5PS6ZS3N.js";import{r as A,s as G}from"./chunk-MFQQEEHJ.js";import{d as V,f as z,g as B,m as j,n as Z,r as $}from"./chunk-FXQKRJWU.js";import{$c as y,Fc as D,Gb as M,Gc as p,Hc as x,Ic as u,Jc as F,Mb as m,Nc as L,Oa as I,Oc as N,Pc as k,Sc as b,Xb as C,Yb as a,ad as P,cd as U,dc as h,ic as r,jc as l,kc as g,lc as v,mc as _,oc as O,pb as f,rb as n,tc as T,uc as d,xb as E,ya as w,za as S}from"./chunk-OJMQBH6T.js";var J=t=>({"border-bottom-0":t}),K=t=>({"border-bottom":t});function Q(t,c){if(t&1){let e=O();v(0),r(1,"img",15),T("click",function(i){w(e);let s=d();return S(s.onZoomImage(i))}),l(),_()}if(t&2){let e=d();n(),a("ngSrc",e.image)("fill",!0)}}function W(t,c){t&1&&g(0,"img",16),t&2&&a("fill",!0)}function X(t,c){if(t&1&&(r(0,"div",17),g(1,"i",18),r(2,"span"),p(3),l()()),t&2){let e=d();n(3),x(e.code)}}function Y(t,c){if(t&1&&(r(0,"div",11),p(1),y(2,"number"),l()),t&2){let e=d();n(),u("",P(2,1,e.totalChannel())," Listing")}}function ee(t,c){if(t&1&&(r(0,"div",25),p(1),y(2,"number"),l()),t&2){d();let e=k(7);n(),u(" (",P(2,1,e)," Listing) ")}}function te(t,c){if(t&1&&(v(0),r(1,"div",29)(2,"div",30),p(3),l(),r(4,"div")(5,"a",31),g(6,"i",32),l()()(),_()),t&2){let e=c.$implicit,o=c.index,i=d().$implicit;n(),a("ngClass",b(4,K,o!==(i==null?null:i.Variants.length)-1)),n(2),F(" ",e.ProductName," - ",e.Name," "),n(2),a("href",e.URL,f)}}function ne(t,c){if(t&1&&(r(0,"div",19)(1,"h2",20)(2,"button",21)(3,"div",22),g(4,"img",23),r(5,"span",24),p(6),l(),L(7),m(8,ee,3,3,"div",25),l()()(),r(9,"div",26)(10,"div",27),m(11,te,7,6,"ng-container",28),l()()()),t&2){let e=c.$implicit,o=c.index,i=d();a("ngClass",b(12,J,i.channels.length-1==o)),n(),a("id","heading"+o+i.id),n(),C("data-bs-target","#collapse"+o+i.id)("aria-controls","#collapse"+o+i.id),n(2),a("src",i.getChannelLogo(e.TypeID),f),n(),a("matTooltip",(e==null||e.ChannelName==null?null:e.ChannelName.length)>30?e.ChannelName:""),n(),x(e.ChannelName),n();let s=N(e==null||e.Variants==null?null:e.Variants.length);n(),h(s>1&&(i.channels==null?null:i.channels.length)>1?8:-1),n(),a("id","collapse"+o+i.id),C("aria-labelledby","heading"+o+i.id),n(2),a("ngForOf",e.Variants)}}var ue=(()=>{class t{constructor(e){this.biggerPictureService=e,this.totalChannel=I(0)}getChannelLogo(e){return q.getChannelLogoByTypeId(e)}onZoomImage(e){this.biggerPictureService.openBiggerPicture(e,this.imageForZoom)}static{this.\u0275fac=function(o){return new(o||t)(E(H))}}static{this.\u0275cmp=M({type:t,selectors:[["app-duplicate-product-card"]],inputs:{image:"image",imageForZoom:"imageForZoom",title:"title",code:"code",channels:"channels",totalChannel:[1,"totalChannel"],id:"id"},decls:17,vars:6,consts:[["elsePic",""],[1,"card"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],[1,"col-8","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle"],["class","description",4,"ngIf"],[1,"fs-5"],[1,"card-footer",2,"padding-left","0px","padding-right","0px"],["id","accordionParent",1,"accordion","accordion-flush"],["class","accordion-item border-start-0 border-end-0",3,"ngClass",4,"ngFor","ngForOf"],[1,"rounded","imgUpload","float-left","cursor-pointer",3,"click","ngSrc","fill"],["ngSrc","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload",3,"fill"],[1,"description"],[1,"fa","fa-barcode","me-2"],[1,"accordion-item","border-start-0","border-end-0",3,"ngClass"],[1,"accordion-header",3,"id"],["type","button","data-bs-toggle","collapse","aria-expanded","true",1,"accordion-button","collapsed",2,"height","40px"],[1,"d-flex","align-items-center","justify-content-start","w-100"],["alt","",1,"channel-logo",3,"src"],[1,"fs-4","ps-4","text-ellipsis",2,"max-width","13vw",3,"matTooltip"],[1,"fs-4","ms-2"],["data-bs-parent","#accordionParent",1,"accordion-collapse","collapse",3,"id"],[1,"accordion-body",2,"padding-top","0px","padding-bottom","0px"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","align-items-center","py-4",3,"ngClass"],[1,"text-ellipsis"],["target","_blank",1,"text-secondary",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"]],template:function(o,i){if(o&1&&(r(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6),m(6,Q,2,2,"ng-container",7)(7,W,1,1,"ng-template",null,0,U),l()()(),r(9,"div",8)(10,"h4",9),p(11),l(),m(12,X,4,1,"div",10)(13,Y,3,3,"div",11),l()()(),r(14,"div",12)(15,"div",13),m(16,ne,12,14,"div",14),l()()()),o&2){let s=D(8);n(6),a("ngIf",i.image)("ngIfElse",s),n(5),u(" ",i.title," "),n(),a("ngIf",i.code),n(),h(i.totalChannel()?13:-1),n(3),a("ngForOf",i.channels)}},dependencies:[Z,V,z,B,j,R,G,A,$],styles:[`.productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down}.channel-logo[_ngcontent-%COMP%]{width:18px;height:18px}.accordion-button[_ngcontent-%COMP%]{background-color:#ededed69!important}.accordion-button[_ngcontent-%COMP%]:not(.collapsed){background-color:#ededed69!important;color:#333}.accordion-button[_ngcontent-%COMP%]:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.accordion-button[_ngcontent-%COMP%]:focus{box-shadow:none!important}.card[_ngcontent-%COMP%]{margin-bottom:0!important}`]})}}return t})();export{ue as a};
@@ -1 +1 @@
1
- import{a as y}from"./chunk-C7YK5TDP.js";import{c as q}from"./chunk-RXQX7567.js";import{n as w}from"./chunk-FXQKRJWU.js";import{$b as U,Gb as h,Gc as p,Hc as S,Ic as d,Jb as F,Mb as b,Oa as f,Sc as k,Yb as g,dc as x,ec as I,gc as T,hc as P,ic as r,jc as i,kc as _,oc as j,pa as v,pb as u,rb as o,tc as C,uc as s,ya as E,za as M}from"./chunk-OJMQBH6T.js";var A=(()=>{class t{transform(e){return q.getChannelLogoByTypeId(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275pipe=F({name:"channelImage",type:t,pure:!0})}}return t})();function R(t,m){if(t&1&&_(0,"img",8),t&2){let e=s().$implicit;g("src",e==null?null:e.ThumbnailURL,u)}}function z(t,m){t&1&&_(0,"img",9)}function B(t,m){if(t&1&&b(0,R,1,1,"img",8)(1,z,1,0,"img",9),t&2){let e=m.$implicit;x(e!=null&&e.ThumbnailURL?0:1)}}function O(t,m){if(t&1){let e=j();r(0,"img",17),C("click",function(a){E(e);let l=s().$implicit;return s().onZoomImage(a,l==null?null:l.ImageURL),M(a.stopPropagation())}),i()}if(t&2){let e=s().$implicit;g("src",e==null?null:e.ThumbnailURL,u)}}function $(t,m){t&1&&_(0,"img",13)}function Z(t,m){if(t&1&&(r(0,"div",15),p(1),i()),t&2){let e=s().$implicit;o(),d("x",e.Quantity,"")}}function W(t,m){if(t&1&&(r(0,"li")(1,"div",10)(2,"div",11),b(3,O,1,1,"img",12)(4,$,1,0,"img",13),r(5,"div",14)(6,"div",15),p(7),i(),r(8,"div",16),p(9),i()()(),b(10,Z,2,1,"div",15),i()()),t&2){let e=m.$implicit;o(3),x(e!=null&&e.ThumbnailURL?3:4),o(4),S(e.Name),o(2),S(e.Code),o(),x(e.Quantity>1?10:-1)}}var Y=(()=>{class t{constructor(){this.variants=f(),this.biggerPictureService=v(y)}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["variants-dropdown"]],inputs:{variants:[1,"variants"]},decls:15,vars:2,consts:[[1,"dropdown","pe-6"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","dropdown-toggle","border-0","d-flex","align-items-center","justify-content-between","gap-4","w-100",2,"padding","0px"],[1,"text-start"],[1,"fs-6"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-regular","fa-angle-down"],[1,"dropdown-menu","p-3"],[1,"ms-6","mt-3","text-black"],[1,"thumb-square","border","border-opacity-10",3,"src"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","border-opacity-10","thumb-square"],[1,"dropdown-item","d-flex","align-items-center","gap-5","justify-content-between",2,"padding-left","8px","padding-right","8px"],[1,"d-flex","align-items-center","justify-content-start","gap-5"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"src"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"thumb-square-lg","border","border-opacity-10"],[1,"lh-base"],[1,"text-black"],[1,"text-muted"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"click","src"]],template:function(n,a){if(n&1&&(r(0,"div",0)(1,"button",1)(2,"div",2)(3,"div",3),p(4),i(),r(5,"div",4),T(6,B,2,1,null,null,I),i()(),r(8,"div"),_(9,"i",5),i()(),r(10,"ul",6)(11,"h5",7),p(12),i(),T(13,W,11,4,"li",null,I),i()()),n&2){let l,c;o(4),d("",(l=a.variants())==null?null:l.length," items"),o(2),P(a.variants()),o(6),d("",(c=a.variants())==null?null:c.length," Items"),o(),P(a.variants())}},dependencies:[w],styles:[".dropdown-toggle[_ngcontent-%COMP%]:after{display:none!important}.dropdown[_ngcontent-%COMP%] .dropdown-menu.show[_ngcontent-%COMP%]{top:unset!important}.thumb-square[_ngcontent-%COMP%]{width:26px;height:26px;object-fit:contain;object-position:center}.thumb-square-lg[_ngcontent-%COMP%]{width:50px;height:50px;object-fit:contain;object-position:center}"]})}}return t})();var N=t=>({cursor:t}),rt=(()=>{class t{constructor(){this.variant=f(),this.biggerPictureService=v(y)}onZoomImage(e){let n=this.variant()?.ImageURL;n&&this.biggerPictureService.openBiggerPicture(e,n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["variant-with-image"]],inputs:{variant:[1,"variant"]},decls:8,vars:7,consts:[[1,"d-flex","align-items-center","gap-5"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"click","src"],[1,"lh-base"],[1,"text-black"],[1,"text-muted"]],template:function(n,a){if(n&1&&(r(0,"div",0)(1,"div")(2,"img",1),C("click",function(c){return a.onZoomImage(c)}),i()(),r(3,"div",2)(4,"div",3),p(5),i(),r(6,"div",4),p(7),i()()()),n&2){let l,c,V,D;o(2),U(k(5,N,(l=a.variant())!=null&&l.ImageURL?"zoom-in":"")),g("src",((c=a.variant())==null?null:c.ThumbnailURL)||"https://cdn.dealpos.app/template/products_thumb.png",u),o(3),d(" ",(V=a.variant())==null?null:V.Name," "),o(2),d(" ",(D=a.variant())==null?null:D.Code," ")}},dependencies:[w],styles:[".thumb-square-lg[_ngcontent-%COMP%]{width:50px;height:50px;object-fit:contain;object-position:center}"]})}}return t})();export{A as a,Y as b,rt as c};
1
+ import{a as y}from"./chunk-63ANFYRV.js";import{c as q}from"./chunk-EUYQST7Q.js";import{n as w}from"./chunk-FXQKRJWU.js";import{$b as U,Gb as h,Gc as p,Hc as S,Ic as d,Jb as F,Mb as b,Oa as f,Sc as k,Yb as g,dc as x,ec as I,gc as T,hc as P,ic as r,jc as i,kc as _,oc as j,pa as v,pb as u,rb as o,tc as C,uc as s,ya as E,za as M}from"./chunk-OJMQBH6T.js";var A=(()=>{class t{transform(e){return q.getChannelLogoByTypeId(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275pipe=F({name:"channelImage",type:t,pure:!0})}}return t})();function R(t,m){if(t&1&&_(0,"img",8),t&2){let e=s().$implicit;g("src",e==null?null:e.ThumbnailURL,u)}}function z(t,m){t&1&&_(0,"img",9)}function B(t,m){if(t&1&&b(0,R,1,1,"img",8)(1,z,1,0,"img",9),t&2){let e=m.$implicit;x(e!=null&&e.ThumbnailURL?0:1)}}function O(t,m){if(t&1){let e=j();r(0,"img",17),C("click",function(a){E(e);let l=s().$implicit;return s().onZoomImage(a,l==null?null:l.ImageURL),M(a.stopPropagation())}),i()}if(t&2){let e=s().$implicit;g("src",e==null?null:e.ThumbnailURL,u)}}function $(t,m){t&1&&_(0,"img",13)}function Z(t,m){if(t&1&&(r(0,"div",15),p(1),i()),t&2){let e=s().$implicit;o(),d("x",e.Quantity,"")}}function W(t,m){if(t&1&&(r(0,"li")(1,"div",10)(2,"div",11),b(3,O,1,1,"img",12)(4,$,1,0,"img",13),r(5,"div",14)(6,"div",15),p(7),i(),r(8,"div",16),p(9),i()()(),b(10,Z,2,1,"div",15),i()()),t&2){let e=m.$implicit;o(3),x(e!=null&&e.ThumbnailURL?3:4),o(4),S(e.Name),o(2),S(e.Code),o(),x(e.Quantity>1?10:-1)}}var Y=(()=>{class t{constructor(){this.variants=f(),this.biggerPictureService=v(y)}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["variants-dropdown"]],inputs:{variants:[1,"variants"]},decls:15,vars:2,consts:[[1,"dropdown","pe-6"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","dropdown-toggle","border-0","d-flex","align-items-center","justify-content-between","gap-4","w-100",2,"padding","0px"],[1,"text-start"],[1,"fs-6"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-regular","fa-angle-down"],[1,"dropdown-menu","p-3"],[1,"ms-6","mt-3","text-black"],[1,"thumb-square","border","border-opacity-10",3,"src"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","border-opacity-10","thumb-square"],[1,"dropdown-item","d-flex","align-items-center","gap-5","justify-content-between",2,"padding-left","8px","padding-right","8px"],[1,"d-flex","align-items-center","justify-content-start","gap-5"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"src"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"thumb-square-lg","border","border-opacity-10"],[1,"lh-base"],[1,"text-black"],[1,"text-muted"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"click","src"]],template:function(n,a){if(n&1&&(r(0,"div",0)(1,"button",1)(2,"div",2)(3,"div",3),p(4),i(),r(5,"div",4),T(6,B,2,1,null,null,I),i()(),r(8,"div"),_(9,"i",5),i()(),r(10,"ul",6)(11,"h5",7),p(12),i(),T(13,W,11,4,"li",null,I),i()()),n&2){let l,c;o(4),d("",(l=a.variants())==null?null:l.length," items"),o(2),P(a.variants()),o(6),d("",(c=a.variants())==null?null:c.length," Items"),o(),P(a.variants())}},dependencies:[w],styles:[".dropdown-toggle[_ngcontent-%COMP%]:after{display:none!important}.dropdown[_ngcontent-%COMP%] .dropdown-menu.show[_ngcontent-%COMP%]{top:unset!important}.thumb-square[_ngcontent-%COMP%]{width:26px;height:26px;object-fit:contain;object-position:center}.thumb-square-lg[_ngcontent-%COMP%]{width:50px;height:50px;object-fit:contain;object-position:center}"]})}}return t})();var N=t=>({cursor:t}),rt=(()=>{class t{constructor(){this.variant=f(),this.biggerPictureService=v(y)}onZoomImage(e){let n=this.variant()?.ImageURL;n&&this.biggerPictureService.openBiggerPicture(e,n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["variant-with-image"]],inputs:{variant:[1,"variant"]},decls:8,vars:7,consts:[[1,"d-flex","align-items-center","gap-5"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"click","src"],[1,"lh-base"],[1,"text-black"],[1,"text-muted"]],template:function(n,a){if(n&1&&(r(0,"div",0)(1,"div")(2,"img",1),C("click",function(c){return a.onZoomImage(c)}),i()(),r(3,"div",2)(4,"div",3),p(5),i(),r(6,"div",4),p(7),i()()()),n&2){let l,c,V,D;o(2),U(k(5,N,(l=a.variant())!=null&&l.ImageURL?"zoom-in":"")),g("src",((c=a.variant())==null?null:c.ThumbnailURL)||"https://cdn.dealpos.app/template/products_thumb.png",u),o(3),d(" ",(V=a.variant())==null?null:V.Name," "),o(2),d(" ",(D=a.variant())==null?null:D.Code," ")}},dependencies:[w],styles:[".thumb-square-lg[_ngcontent-%COMP%]{width:50px;height:50px;object-fit:contain;object-position:center}"]})}}return t})();export{A as a,Y as b,rt as c};
@@ -1,4 +1,4 @@
1
- import{a as tt,b as it,c as nt}from"./chunk-6H2KAYSB.js";import"./chunk-EYONZQ2W.js";import{a as pe}from"./chunk-FYB62QQV.js";import"./chunk-MX5SR3SR.js";import{a as Qe,b as Ze,c as qe,e as Je,f as Xe,g as et}from"./chunk-BMYBLBSP.js";import{e as Ye,k as $e,l as Ge,m as je,n as He,o as Ke}from"./chunk-KS7ACI26.js";import"./chunk-PHUHUFYL.js";import{a as Le,b as Ae,c as ze}from"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-VFATXJRG.js";import{a as Ue}from"./chunk-7ES3PHES.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import{ma as Be}from"./chunk-RC5PUUVM.js";import"./chunk-5ZR5WIHG.js";import"./chunk-ACIMXBIC.js";import{c as ke,d as Fe,e as Oe}from"./chunk-PYXL7UF7.js";import{h as Ve,i as re}from"./chunk-OLVWSY6L.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as oe}from"./chunk-CGOB6Y3X.js";import{b as Pe,e as Ie}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{b as ne,c as D}from"./chunk-RXQX7567.js";import{m as Re,n as We}from"./chunk-HJXYT6MI.js";import{A as ie,b as be,c as Me,h as ee,m as te,x as Ee}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as Ne,s as ae}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{J as Te,d as F,f as L,g as A,j as X,k as z,n as I}from"./chunk-FXQKRJWU.js";import{$c as W,Ac as Ce,Bc as Se,Cc as ve,Fc as x,Gb as P,Gc as p,Hc as k,Ic as S,Ka as B,Kc as T,Lc as b,Mb as w,Mc as M,Na as ue,Oa as O,Qc as Q,Ra as f,Rc as ye,Sc as Z,Tc as De,Yb as d,Z as $,aa as ce,ad as j,bd as xe,cd as q,dc as V,ea as G,ic as o,ja as he,jc as r,kc as C,lc as N,m as me,mc as R,oc as v,pa as y,pb as fe,rb as l,sd as J,tc as g,uc as _,v as K,xb as _e,xc as ge,ya as c,yc as we,za as h}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as se,b as de}from"./chunk-66YHNWRR.js";var pt=t=>({"over-due":t});function st(t,m){if(t&1&&(o(0,"tr",8)(1,"td"),p(2),r(),o(3,"td"),p(4),r(),o(5,"td"),p(6),r(),o(7,"td"),p(8),r()()),t&2){let e=m.$implicit,n=m.index;d("ngClass",Z(5,pt,e.Exception)),l(2),k(n+1),l(2),k(e.Number),l(2),k(e.Status),l(2),k(e.Exception)}}function dt(t,m){if(t&1&&(N(0),w(1,st,9,7,"tr",7),R()),t&2){let e,n=_();l(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function mt(t,m){t&1&&(o(0,"tr",9)(1,"td",10)(2,"div",11),C(3,"i",12),r(),o(4,"h4",13),p(5," There is no order to processed "),r()()())}var ot=(()=>{class t{constructor(){this.downloadResult=O()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),C(5,"th",5),o(6,"th"),p(7,"Order Number"),r(),o(8,"th"),p(9,"Status"),r(),o(10,"th"),p(11,"Exception"),r()()(),o(12,"tbody"),w(13,dt,2,1,"ng-container",6)(14,mt,6,0,"ng-template",null,0,q),r()()()()),n&2){let a,u=x(15);l(13),d("ngIf",((a=i.downloadResult())==null||a.Body==null?null:a.Body.length)>0)("ngIfElse",u)}},dependencies:[I,F,L,A],encapsulation:2})}}return t})();var ht=t=>({"full-width":t}),ut=()=>({standalone:!0}),rt=(()=>{class t{constructor(e){this.datePipe=e,this.fullWidth=!1,this.timeChange=new B}ngOnInit(){}onTimeChange(e){let n=null;e&&(n=this.datePipe.transform(e,"HH:mm")),this.timeChange.emit(n),this.onTimePickerChange()}onShowCalendar(){let e=document.getElementById("dropdown-filter");if(e){var n=new bootstrap.Dropdown(e);n&&(n._config.autoClose="inside")}}onTimePickerChange(){let e=document.getElementById("dropdown-filter");if(e){var n=new bootstrap.Dropdown(e);n&&(n._config.autoClose="outside")}}static{this.\u0275fac=function(n){return new(n||t)(_e(z))}}static{this.\u0275cmp=P({type:t,selectors:[["app-timepicker"]],inputs:{time:"time",fullWidth:"fullWidth"},outputs:{timeChange:"timeChange"},decls:4,vars:8,consts:[["myCalendar",""],["styleClass","custom-height","id","shippingTime","appendTo","body",3,"ngModelChange","onSelect","ngClass","baseZIndex","ngModel","timeOnly","ngModelOptions"],["size","small","label","Close",3,"click"]],template:function(n,i){if(n&1){let a=v();o(0,"p-datepicker",1,0),M("ngModelChange",function(s){return c(a),b(i.time,s)||(i.time=s),h(s)}),g("ngModelChange",function(s){return c(a),h(i.onTimeChange(s))})("onSelect",function(){return c(a),h(i.onShowCalendar())}),o(2,"p-footer")(3,"p-button",2),g("click",function(){return c(a),x(1).hideOverlay(),h(i.onShowCalendar())}),r()()()}n&2&&(d("ngClass",Z(5,ht,i.fullWidth))("baseZIndex",1100),T("ngModel",i.time),d("timeOnly",!0)("ngModelOptions",ye(7,ut)))},dependencies:[I,F,ie,ee,te,nt,it,tt,Be],styles:["p-datepicker span.p-datepicker.custom-height{height:44px;width:70px} p-datepicker.full-width span.p-datepicker.custom-height{height:44px;width:100%!important}"]})}}return t})();var Y=(()=>{class t{constructor(){this.httpService=y(Ie),this.toastr=y(Pe),this.datePipe=y(z)}gerChannelDetailById(e){return this.httpService.post(oe.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(oe.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(oe.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(G(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):me}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),a=e.TimeFrom?e.TimeFrom:"",u=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${a} to ${i} ${u}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?D.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):D.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=D.formatTitleFromDate(new Date(e),new Date(n)),a=this.datePipe.transform(e,i),u=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":a+"-"} ${u}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac})}}return t})();function ft(t,m){if(t&1&&(o(0,"ng-option",16),C(1,"img",17),p(2),r()),t&2){let e=m.$implicit;d("value",e.ID),l(),d("src",e==null?null:e.Img,fe),l(),S("",e.Name," ")}}function _t(t,m){if(t&1){let e=v();o(0,"div",8)(1,"div",4)(2,"h5"),p(3,"Type"),r(),o(4,"p",5),p(5,"Select Type want to download"),r()(),o(6,"div",4)(7,"div",18)(8,"div")(9,"mat-radio-group",19),M("ngModelChange",function(i){c(e);let a=_();return b(a.downloadType,i)||(a.downloadType=i),h(i)}),g("ngModelChange",function(){c(e);let i=_();return h(i.onDownloadTypeChange())}),o(10,"mat-radio-button",20),p(11," Orders "),r(),o(12,"mat-radio-button",21),p(13," Disbursement "),r()()()(),o(14,"div",22)(15,"div",23),C(16,"i",24),r(),o(17,"p",25),p(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),r()()()()}if(t&2){let e=_();l(9),T("ngModel",e.downloadType),l(),d("value",!1),l(2),d("value",!0)}}function gt(t,m){t&1&&(o(0,"p",5),p(1," Select Disbursement date "),o(2,"span",26),p(3,"(payment date / order complete date)"),r(),p(4," of the channel you want to download (Max 1 Week). "),r())}function wt(t,m){t&1&&(o(0,"p",5),p(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),r())}function Ct(t,m){if(t&1){let e=v();o(0,"div",12)(1,"app-timepicker",27),M("timeChange",function(i){c(e);let a=_();return b(a.startTime,i)||(a.startTime=i),h(i)}),g("timeChange",function(){c(e);let i=_();return h(i.onStartTimeChange())}),r(),o(2,"span",28),p(3,"-"),r(),o(4,"app-timepicker",27),M("timeChange",function(i){c(e);let a=_();return b(a.endTime,i)||(a.endTime=i),h(i)}),g("timeChange",function(){c(e);let i=_();return h(i.onEndTimeChange())}),r()()}if(t&2){let e=_();l(),T("time",e.startTime),l(3),T("time",e.endTime)}}var at=(()=>{class t{constructor(){this.reset=O(!1),this.authService=y(re),this.tokenService=y(Ve),this.downloadService=y(Y),this.downloadType=f(!1),this.selectedChannelId=f(null),this.channelOptions=f(this.authService.getChannels()),this.channelType=ne,this.selectedChannel=f(null),this.showTimePicker=f(!1),this.startDate=f(null),this.endDate=f(null),this.startTime=f("00:00"),this.endTime=f("23:59"),this.minDate=f(new Date),this.maxDate=f(new Date),this.filterData=new B,this._onRememberMeChange=ue({alias:"onRememberMeChange"}),this.rememberMe=f(!1),J(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let e=this.tokenService?.getTokenValue(),n=e?.DownloadRange?JSON.parse(e?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,a=D.addDays(i,n-1);this.minDate.set(a)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(K(e=>e?.Model),$(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=D.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}onChangeRememberMe(e){this._onRememberMeChange.emit(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange",_onRememberMeChange:"onRememberMeChange"},features:[Q([Y,Ye()])],decls:32,vars:14,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[1,"col-6","d-flex","align-items-center","gap-2"],["type","checkbox",2,"width","16px","height","16px",3,"ngModelChange","ngModel"],[1,"ms-2","fw-bold"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let a=v();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),p(5,"Select a Channel"),r(),o(6,"p",5),p(7,"Select Channel want to download order"),r()(),o(8,"div",4)(9,"ng-select",6),M("ngModelChange",function(s){return c(a),b(i.selectedChannelId,s)||(i.selectedChannelId=s),h(s)}),g("ngModelChange",function(){return c(a),h(i.onSelectChannel())}),w(10,ft,3,3,"ng-option",7),r()()(),w(11,_t,19,3,"div",8),W(12,"async"),o(13,"div",8)(14,"div",4)(15,"h5"),p(16,"Date Range"),r(),w(17,gt,5,0,"p",5)(18,wt,2,0,"p",5),r(),o(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),M("ngModelChange",function(s){return c(a),b(i.startDate,s)||(i.startDate=s),h(s)}),g("click",function(){c(a);let s=x(25);return h(s.open())}),r(),o(23,"input",11),M("ngModelChange",function(s){return c(a),b(i.endDate,s)||(i.endDate=s),h(s)}),g("click",function(){c(a);let s=x(25);return h(s.open())})("ngModelChange",function(){return c(a),h(i.onFilterDateChange())}),r()(),C(24,"mat-date-range-picker",null,0),r(),w(26,Ct,5,2,"div",12),r()(),o(27,"div",8)(28,"div",13)(29,"input",14),M("ngModelChange",function(s){return c(a),b(i.rememberMe,s)||(i.rememberMe=s),h(s)}),g("ngModelChange",function(s){return c(a),h(i.onChangeRememberMe(s))}),r(),o(30,"h5",15),p(31,"Remember Me"),r()()()()()}if(n&2){let a,u,s=x(25);l(9),d("clearable",!1),T("ngModel",i.selectedChannelId),l(),d("ngForOf",i.channelOptions()),l(),V((a=j(12,12,i.channelDetail$))!=null&&a.ServiceFeeWriteOff&&((a=i.selectedChannel())==null?null:a.TypeID)==i.channelType.Tokopedia?11:-1),l(6),V(i.downloadType()&&((u=i.selectedChannel())==null?null:u.TypeID)==i.channelType.Tokopedia?17:18),l(4),d("rangePicker",s)("min",i.minDate())("max",i.maxDate()),l(),T("ngModel",i.startDate),l(),T("ngModel",i.endDate),l(3),V(i.showTimePicker()?26:-1),l(3),T("ngModel",i.rememberMe)}},dependencies:[I,L,X,Oe,Fe,ke,ze,Le,Ae,ie,Me,be,ee,Ee,te,rt,He,$e,Ke,Ge,je],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var E=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(E||{});var U=function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t}(U||{});var St=(t,m)=>({"over-due-today":t,"over-due":m});function vt(t,m){if(t&1&&(o(0,"th",21),p(1),r()),t&2){let e=_();l(),S(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function yt(t,m){if(t&1&&(o(0,"td"),p(1),W(2,"date"),r()),t&2){let e=_().$implicit;l(),S(" ",xe(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function Dt(t,m){if(t&1&&(o(0,"span"),p(1),r()),t&2){let e=_().$implicit;l(),S(" ",e.ActionString," ")}}function xt(t,m){if(t&1&&(o(0,"li"),p(1),r()),t&2){let e=m.$implicit;l(),S(" ",e," ")}}function Tt(t,m){if(t&1&&(o(0,"ul",27),w(1,xt,2,1,"li",22),r()),t&2){let e=_().$implicit;l(),d("ngForOf",e.ActionString)}}function bt(t,m){if(t&1&&(o(0,"span",28),C(1,"i",29),r()),t&2){let e=_().$implicit;we("title","Delivery : ",e.DeliveryState,`
1
+ import{a as tt,b as it,c as nt}from"./chunk-6H2KAYSB.js";import"./chunk-EYONZQ2W.js";import{a as pe}from"./chunk-LLHPMXKP.js";import"./chunk-MX5SR3SR.js";import{a as Qe,b as Ze,c as qe,e as Je,f as Xe,g as et}from"./chunk-BMYBLBSP.js";import{e as Ye,k as $e,l as Ge,m as je,n as He,o as Ke}from"./chunk-KS7ACI26.js";import"./chunk-PHUHUFYL.js";import{a as Le,b as Ae,c as ze}from"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-VFATXJRG.js";import{a as Ue}from"./chunk-X4B2FYY3.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import{ma as Be}from"./chunk-RC5PUUVM.js";import"./chunk-GZS2MOSK.js";import"./chunk-ACIMXBIC.js";import{c as ke,d as Fe,e as Oe}from"./chunk-PYXL7UF7.js";import{h as Ve,i as re}from"./chunk-P2AADVEN.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as oe}from"./chunk-CGOB6Y3X.js";import{b as Pe,e as Ie}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{b as ne,c as D}from"./chunk-EUYQST7Q.js";import{m as Re,n as We}from"./chunk-HJXYT6MI.js";import{A as ie,b as be,c as Me,h as ee,m as te,x as Ee}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as Ne,s as ae}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{J as Te,d as F,f as L,g as A,j as X,k as z,n as I}from"./chunk-FXQKRJWU.js";import{$c as W,Ac as Ce,Bc as Se,Cc as ve,Fc as x,Gb as P,Gc as p,Hc as k,Ic as S,Ka as B,Kc as T,Lc as b,Mb as w,Mc as M,Na as ue,Oa as O,Qc as Q,Ra as f,Rc as ye,Sc as Z,Tc as De,Yb as d,Z as $,aa as ce,ad as j,bd as xe,cd as q,dc as V,ea as G,ic as o,ja as he,jc as r,kc as C,lc as N,m as me,mc as R,oc as v,pa as y,pb as fe,rb as l,sd as J,tc as g,uc as _,v as K,xb as _e,xc as ge,ya as c,yc as we,za as h}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as se,b as de}from"./chunk-66YHNWRR.js";var pt=t=>({"over-due":t});function st(t,m){if(t&1&&(o(0,"tr",8)(1,"td"),p(2),r(),o(3,"td"),p(4),r(),o(5,"td"),p(6),r(),o(7,"td"),p(8),r()()),t&2){let e=m.$implicit,n=m.index;d("ngClass",Z(5,pt,e.Exception)),l(2),k(n+1),l(2),k(e.Number),l(2),k(e.Status),l(2),k(e.Exception)}}function dt(t,m){if(t&1&&(N(0),w(1,st,9,7,"tr",7),R()),t&2){let e,n=_();l(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function mt(t,m){t&1&&(o(0,"tr",9)(1,"td",10)(2,"div",11),C(3,"i",12),r(),o(4,"h4",13),p(5," There is no order to processed "),r()()())}var ot=(()=>{class t{constructor(){this.downloadResult=O()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),C(5,"th",5),o(6,"th"),p(7,"Order Number"),r(),o(8,"th"),p(9,"Status"),r(),o(10,"th"),p(11,"Exception"),r()()(),o(12,"tbody"),w(13,dt,2,1,"ng-container",6)(14,mt,6,0,"ng-template",null,0,q),r()()()()),n&2){let a,u=x(15);l(13),d("ngIf",((a=i.downloadResult())==null||a.Body==null?null:a.Body.length)>0)("ngIfElse",u)}},dependencies:[I,F,L,A],encapsulation:2})}}return t})();var ht=t=>({"full-width":t}),ut=()=>({standalone:!0}),rt=(()=>{class t{constructor(e){this.datePipe=e,this.fullWidth=!1,this.timeChange=new B}ngOnInit(){}onTimeChange(e){let n=null;e&&(n=this.datePipe.transform(e,"HH:mm")),this.timeChange.emit(n),this.onTimePickerChange()}onShowCalendar(){let e=document.getElementById("dropdown-filter");if(e){var n=new bootstrap.Dropdown(e);n&&(n._config.autoClose="inside")}}onTimePickerChange(){let e=document.getElementById("dropdown-filter");if(e){var n=new bootstrap.Dropdown(e);n&&(n._config.autoClose="outside")}}static{this.\u0275fac=function(n){return new(n||t)(_e(z))}}static{this.\u0275cmp=P({type:t,selectors:[["app-timepicker"]],inputs:{time:"time",fullWidth:"fullWidth"},outputs:{timeChange:"timeChange"},decls:4,vars:8,consts:[["myCalendar",""],["styleClass","custom-height","id","shippingTime","appendTo","body",3,"ngModelChange","onSelect","ngClass","baseZIndex","ngModel","timeOnly","ngModelOptions"],["size","small","label","Close",3,"click"]],template:function(n,i){if(n&1){let a=v();o(0,"p-datepicker",1,0),M("ngModelChange",function(s){return c(a),b(i.time,s)||(i.time=s),h(s)}),g("ngModelChange",function(s){return c(a),h(i.onTimeChange(s))})("onSelect",function(){return c(a),h(i.onShowCalendar())}),o(2,"p-footer")(3,"p-button",2),g("click",function(){return c(a),x(1).hideOverlay(),h(i.onShowCalendar())}),r()()()}n&2&&(d("ngClass",Z(5,ht,i.fullWidth))("baseZIndex",1100),T("ngModel",i.time),d("timeOnly",!0)("ngModelOptions",ye(7,ut)))},dependencies:[I,F,ie,ee,te,nt,it,tt,Be],styles:["p-datepicker span.p-datepicker.custom-height{height:44px;width:70px} p-datepicker.full-width span.p-datepicker.custom-height{height:44px;width:100%!important}"]})}}return t})();var Y=(()=>{class t{constructor(){this.httpService=y(Ie),this.toastr=y(Pe),this.datePipe=y(z)}gerChannelDetailById(e){return this.httpService.post(oe.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(oe.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(oe.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(G(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):me}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),a=e.TimeFrom?e.TimeFrom:"",u=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${a} to ${i} ${u}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?D.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):D.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=D.formatTitleFromDate(new Date(e),new Date(n)),a=this.datePipe.transform(e,i),u=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":a+"-"} ${u}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac})}}return t})();function ft(t,m){if(t&1&&(o(0,"ng-option",16),C(1,"img",17),p(2),r()),t&2){let e=m.$implicit;d("value",e.ID),l(),d("src",e==null?null:e.Img,fe),l(),S("",e.Name," ")}}function _t(t,m){if(t&1){let e=v();o(0,"div",8)(1,"div",4)(2,"h5"),p(3,"Type"),r(),o(4,"p",5),p(5,"Select Type want to download"),r()(),o(6,"div",4)(7,"div",18)(8,"div")(9,"mat-radio-group",19),M("ngModelChange",function(i){c(e);let a=_();return b(a.downloadType,i)||(a.downloadType=i),h(i)}),g("ngModelChange",function(){c(e);let i=_();return h(i.onDownloadTypeChange())}),o(10,"mat-radio-button",20),p(11," Orders "),r(),o(12,"mat-radio-button",21),p(13," Disbursement "),r()()()(),o(14,"div",22)(15,"div",23),C(16,"i",24),r(),o(17,"p",25),p(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),r()()()()}if(t&2){let e=_();l(9),T("ngModel",e.downloadType),l(),d("value",!1),l(2),d("value",!0)}}function gt(t,m){t&1&&(o(0,"p",5),p(1," Select Disbursement date "),o(2,"span",26),p(3,"(payment date / order complete date)"),r(),p(4," of the channel you want to download (Max 1 Week). "),r())}function wt(t,m){t&1&&(o(0,"p",5),p(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),r())}function Ct(t,m){if(t&1){let e=v();o(0,"div",12)(1,"app-timepicker",27),M("timeChange",function(i){c(e);let a=_();return b(a.startTime,i)||(a.startTime=i),h(i)}),g("timeChange",function(){c(e);let i=_();return h(i.onStartTimeChange())}),r(),o(2,"span",28),p(3,"-"),r(),o(4,"app-timepicker",27),M("timeChange",function(i){c(e);let a=_();return b(a.endTime,i)||(a.endTime=i),h(i)}),g("timeChange",function(){c(e);let i=_();return h(i.onEndTimeChange())}),r()()}if(t&2){let e=_();l(),T("time",e.startTime),l(3),T("time",e.endTime)}}var at=(()=>{class t{constructor(){this.reset=O(!1),this.authService=y(re),this.tokenService=y(Ve),this.downloadService=y(Y),this.downloadType=f(!1),this.selectedChannelId=f(null),this.channelOptions=f(this.authService.getChannels()),this.channelType=ne,this.selectedChannel=f(null),this.showTimePicker=f(!1),this.startDate=f(null),this.endDate=f(null),this.startTime=f("00:00"),this.endTime=f("23:59"),this.minDate=f(new Date),this.maxDate=f(new Date),this.filterData=new B,this._onRememberMeChange=ue({alias:"onRememberMeChange"}),this.rememberMe=f(!1),J(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let e=this.tokenService?.getTokenValue(),n=e?.DownloadRange?JSON.parse(e?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,a=D.addDays(i,n-1);this.minDate.set(a)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(K(e=>e?.Model),$(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=D.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}onChangeRememberMe(e){this._onRememberMeChange.emit(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange",_onRememberMeChange:"onRememberMeChange"},features:[Q([Y,Ye()])],decls:32,vars:14,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[1,"col-6","d-flex","align-items-center","gap-2"],["type","checkbox",2,"width","16px","height","16px",3,"ngModelChange","ngModel"],[1,"ms-2","fw-bold"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let a=v();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),p(5,"Select a Channel"),r(),o(6,"p",5),p(7,"Select Channel want to download order"),r()(),o(8,"div",4)(9,"ng-select",6),M("ngModelChange",function(s){return c(a),b(i.selectedChannelId,s)||(i.selectedChannelId=s),h(s)}),g("ngModelChange",function(){return c(a),h(i.onSelectChannel())}),w(10,ft,3,3,"ng-option",7),r()()(),w(11,_t,19,3,"div",8),W(12,"async"),o(13,"div",8)(14,"div",4)(15,"h5"),p(16,"Date Range"),r(),w(17,gt,5,0,"p",5)(18,wt,2,0,"p",5),r(),o(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),M("ngModelChange",function(s){return c(a),b(i.startDate,s)||(i.startDate=s),h(s)}),g("click",function(){c(a);let s=x(25);return h(s.open())}),r(),o(23,"input",11),M("ngModelChange",function(s){return c(a),b(i.endDate,s)||(i.endDate=s),h(s)}),g("click",function(){c(a);let s=x(25);return h(s.open())})("ngModelChange",function(){return c(a),h(i.onFilterDateChange())}),r()(),C(24,"mat-date-range-picker",null,0),r(),w(26,Ct,5,2,"div",12),r()(),o(27,"div",8)(28,"div",13)(29,"input",14),M("ngModelChange",function(s){return c(a),b(i.rememberMe,s)||(i.rememberMe=s),h(s)}),g("ngModelChange",function(s){return c(a),h(i.onChangeRememberMe(s))}),r(),o(30,"h5",15),p(31,"Remember Me"),r()()()()()}if(n&2){let a,u,s=x(25);l(9),d("clearable",!1),T("ngModel",i.selectedChannelId),l(),d("ngForOf",i.channelOptions()),l(),V((a=j(12,12,i.channelDetail$))!=null&&a.ServiceFeeWriteOff&&((a=i.selectedChannel())==null?null:a.TypeID)==i.channelType.Tokopedia?11:-1),l(6),V(i.downloadType()&&((u=i.selectedChannel())==null?null:u.TypeID)==i.channelType.Tokopedia?17:18),l(4),d("rangePicker",s)("min",i.minDate())("max",i.maxDate()),l(),T("ngModel",i.startDate),l(),T("ngModel",i.endDate),l(3),V(i.showTimePicker()?26:-1),l(3),T("ngModel",i.rememberMe)}},dependencies:[I,L,X,Oe,Fe,ke,ze,Le,Ae,ie,Me,be,ee,Ee,te,rt,He,$e,Ke,Ge,je],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var E=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(E||{});var U=function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t}(U||{});var St=(t,m)=>({"over-due-today":t,"over-due":m});function vt(t,m){if(t&1&&(o(0,"th",21),p(1),r()),t&2){let e=_();l(),S(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function yt(t,m){if(t&1&&(o(0,"td"),p(1),W(2,"date"),r()),t&2){let e=_().$implicit;l(),S(" ",xe(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function Dt(t,m){if(t&1&&(o(0,"span"),p(1),r()),t&2){let e=_().$implicit;l(),S(" ",e.ActionString," ")}}function xt(t,m){if(t&1&&(o(0,"li"),p(1),r()),t&2){let e=m.$implicit;l(),S(" ",e," ")}}function Tt(t,m){if(t&1&&(o(0,"ul",27),w(1,xt,2,1,"li",22),r()),t&2){let e=_().$implicit;l(),d("ngForOf",e.ActionString)}}function bt(t,m){if(t&1&&(o(0,"span",28),C(1,"i",29),r()),t&2){let e=_().$implicit;we("title","Delivery : ",e.DeliveryState,`
2
2
  Payment : `,e.PaymentState,"")}}function Mt(t,m){if(t&1&&(o(0,"tr")(1,"td"),p(2),r(),o(3,"td"),p(4),r(),w(5,yt,3,4,"td",23),o(6,"td")(7,"span"),p(8),r(),p(9),r(),o(10,"td",24)(11,"span"),p(12),r(),p(13),r(),o(14,"td"),w(15,Dt,2,1,"span",23)(16,Tt,2,1,"ul",25),r(),o(17,"td"),w(18,bt,2,3,"span",26),r()()),t&2){let e,n=m.$implicit,i=m.index,a=_(2);l(2),k(i+1),l(2),k(n.Number),l(),d("ngIf",((e=a.selectedChannel())==null?null:e.TypeID)!=a.channelType.Shopee&&((e=a.selectedChannel())==null?null:e.TypeID)!==a.channelType.Tiktok),l(3),S("",n.ChannelStatus," - "),l(),S("",n.ChannelStatusDescription," "),l(),d("ngClass",De(12,St,(n==null?null:n.Action)==a.actionPreviewOrder.Update,(n==null?null:n.Action)==a.actionPreviewOrder.New))("matTooltip",n.POSStatus==91||n.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),l(2),S("",n.POSStatus," - "),l(),S("",n.POSStatusDescription," "),l(2),d("ngIf",n.ActionString.length==1),l(),d("ngIf",n.ActionString.length>1),l(2),d("ngIf",n.ChannelStatus!=99&&n.POSStatus!=99)}}function Et(t,m){if(t&1&&(N(0),w(1,Mt,19,15,"tr",22),R()),t&2){let e=_();l(),d("ngForOf",e.displayPreviewData())}}function Pt(t,m){t&1&&(o(0,"tr",30)(1,"td",31)(2,"div",32),C(3,"i",33),r(),o(4,"h4",34),p(5," There is no order to processed "),r()()())}var lt=(()=>{class t{constructor(){this.orderPreview=O(),this.selectedChannel=O(),this.channelType=ne,this.allData=f(0),this.syncData=f(0),this.wrongData=f(0),this.unsyncData=f(0),this.pillStatus=f(E.ALL),this.actionPreviewOrder=U,this.previewStatus=E,this.displayPreviewData=f([]),this.exportOrders=new B,J(()=>{this.orderPreview()&&(this.filterPreviewData(E.ALL),this.initLengthStatusData())},{allowSignalWrites:!0})}filterPreviewData(e){this.pillStatus.update(()=>e),this.displayPreviewData.update(()=>this.filterDataByStatus(e))}initLengthStatusData(){this.wrongData.update(()=>this.filterDataByStatus(E.WRONG).length),this.syncData.update(()=>this.filterDataByStatus(E.SYNC).length),this.allData.update(()=>this.orderPreview().length),this.unsyncData.update(()=>this.filterDataByStatus(E.UNSYNC).length)}filterDataByStatus(e){let n=[];switch(e){case E.ALL:n=this.orderPreview();break;case E.SYNC:n=this.orderPreview().filter(i=>i.Action==U.DoNothing);break;case E.WRONG:n=this.orderPreview().filter(i=>i.Action==U.Update);break;case E.UNSYNC:n=this.orderPreview().filter(i=>i.Action==U.New);break}return n}onExportOrders(){this.exportOrders.emit()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["preview-step"]],inputs:{orderPreview:[1,"orderPreview"],selectedChannel:[1,"selectedChannel"]},outputs:{exportOrders:"onExportOrders"},decls:41,vars:11,consts:[["EMPTY",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["width","15%"],[4,"ngFor","ngForOf"],[4,"ngIf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1){let a=v();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div")(5,"ul",5)(6,"li",6)(7,"button",7),g("click",function(){return c(a),h(i.filterPreviewData(i.previewStatus.ALL))}),p(8),r()(),o(9,"li",8)(10,"button",9),g("click",function(){return c(a),h(i.filterPreviewData(i.previewStatus.SYNC))}),p(11),r()(),o(12,"li",8)(13,"button",10),g("click",function(){return c(a),h(i.filterPreviewData(i.previewStatus.WRONG))}),p(14),r()(),o(15,"li",8)(16,"button",11),g("click",function(){return c(a),h(i.filterPreviewData(i.previewStatus.UNSYNC))}),p(17),r()()()(),o(18,"div")(19,"button",12),g("click",function(){return c(a),h(i.onExportOrders())}),C(20,"i",13),o(21,"span"),p(22,"Export"),r()()()()(),o(23,"table",14)(24,"thead",15)(25,"tr"),C(26,"th",16),o(27,"th",17),p(28,"Number"),r(),w(29,vt,2,1,"th",18),o(30,"th",19),p(31,"Channel Status"),r(),o(32,"th",19),p(33,"POS Status"),r(),o(34,"th"),p(35,"Action"),r(),C(36,"th",16),r()(),o(37,"tbody"),w(38,Et,2,1,"ng-container",20)(39,Pt,6,0,"ng-template",null,0,q),r()()()()}if(n&2){let a,u,s=x(40);l(7),d("ngClass",i.pillStatus()=="all"?"btn-secondary text-white":"btn-outline-dark"),l(),S(" All (",i.allData(),") "),l(2),d("ngClass",i.pillStatus()=="sync"?"btn-success":"btn-outline-success"),l(),S(" Existing (",i.syncData(),") "),l(2),d("ngClass",i.pillStatus()=="wrong"?"btn-warning text-white":"btn-outline-warning"),l(),S(" Wrong Status (",i.wrongData(),") "),l(2),d("ngClass",i.pillStatus()=="unsync"?"btn-danger":"btn-outline-danger"),l(),S(" Missing (",i.unsyncData(),") "),l(12),d("ngIf",((a=i.selectedChannel())==null?null:a.TypeID)!=i.channelType.Shopee&&((a=i.selectedChannel())==null?null:a.TypeID)!==i.channelType.Tiktok),l(9),d("ngIf",((u=i.displayPreviewData())==null?null:u.length)>0)("ngIfElse",s)}},dependencies:[I,F,L,A,z,ae,Ne],encapsulation:2})}}return t})();var It=["stepper"];function Vt(t,m){if(t&1){let e=v();o(0,"div",2)(1,"button",19),g("click",function(){c(e);let i=_();return h(i.onStepperBack())}),p(2," Back "),r(),o(3,"button",20),g("click",function(){c(e);let i=_();return h(i.onNextStep())}),p(4," Next "),r()()}if(t&2){let e=_();l(3),d("disabled",e.disabledNextFilter())}}function kt(t,m){if(t&1){let e=v();o(0,"button",21),g("click",function(){c(e);let i=_();return h(i.onNextStep())}),p(1," Next "),r()}if(t&2){let e=_();d("disabled",e.disabledNextFilter())}}function Ft(t,m){if(t&1){let e=v();o(0,"button",22),g("click",function(){c(e);let i=_();return h(i.onNewDownload())}),C(1,"i",23),p(2," New "),r()}}function Ot(t,m){t&1&&(C(0,"i",24),o(1,"span"),p(2,"Filter"),r())}function Nt(t,m){t&1&&(C(0,"i",25),o(1,"span"),p(2,"Preview"),r())}function Rt(t,m){if(t&1){let e=v();N(0),o(1,"preview-step",26),g("onExportOrders",function(){c(e);let i=_();return h(i.onExportOrders())}),r(),R()}if(t&2){let e=m.ngIf;l(),d("orderPreview",e)}}function Wt(t,m){t&1&&(C(0,"i",27),o(1,"span"),p(2,"Finish"),r())}function Bt(t,m){if(t&1&&(N(0),C(1,"complete-step",28),R()),t&2){let e=m.ngIf;l(),d("downloadResult",e)}}function Lt(t,m){t&1&&(o(0,"h6"),p(1,"1"),r())}function At(t,m){t&1&&(o(0,"h6"),p(1,"2"),r())}function zt(t,m){t&1&&(o(0,"h6"),p(1,"3"),r())}var hn=(()=>{class t{constructor(){this.downloadService=y(Y),this.orderService=y(pe),this.productService=y(Ue),this.authService=y(re),this.stepperSelectedIndex=f(0),this.disabledNextFilter=f(!0),this.isResetFilter=f(!1),this.pageTitle=f("Download to POS"),this.cacheKey=f(D.GuidEMpty),this.rememberMe=f(!1)}onFilterChange(e){this.filter=e,this.validateDisabledNext()}validateDisabledNext(){this.disabledNextFilter.update(()=>D.IsEmpty(this.filter?.channelId)||!D.isValidDate(this.filter.startDate)||!D.isValidDate(this.filter.endDate))}onNextStep(){switch(this.stepper.selectedIndex){case 0:this.onPreview();let e=this.productService.findChannelById(this.filter.channelId,this.authService.getChannels());this.setPageTitle(`Preview ${e?.Name}`);break;case 1:this.onDownload(),this.setPageTitle("Download");break}}onStepperNext(){this.stepper.selected.completed=!0,this.stepper.next()}onPreview(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,IsDisbursement:this.filter.downloadType};D.IsNotEmpty(this.filter.startTime)&&(e=de(se({},e),{TimeFrom:this.filter.startTime+":00",TimeTo:this.filter.endTime+":00"})),this.orderPreview$=this.downloadService.onPreviewOrder(e).pipe(G(n=>{n.Data?.length>0&&(this.cacheKey.update(()=>n.CacheKey),this.onStepperNext())}),K(n=>n.Data),$(1))}onExportOrders(){let e={ID:this.filter.channelId,From:this.filter.startDate?this.filter.startDate:null,To:this.filter.endDate?this.filter.endDate:null},n=`Orders ${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)}`;this.orderService.exportOrders(e,n).subscribe()}onDownload(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,ListPreview:[],IsDisbursement:this.filter.downloadType,CacheKey:this.cacheKey()};this.downloadPreview$=this.orderPreview$.pipe(ce(n=>(e.ListPreview=n,this.downloadService.getDownloadOrder(e))),G(()=>{this.onStepperNext()}),$(1))}setPageTitle(e){this.pageTitle.update(()=>`
3
3
  ${e} (${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)})
4
4
  `)}onStepperBack(){this.stepper.previous(),this.pageTitle.update(()=>"Download to POS")}onNewDownload(){this.isResetFilter.update(()=>!this.rememberMe()),this.stepper.reset(),this.stepperSelectedIndex.update(()=>0),this.orderPreview$=null,this.downloadPreview$=null,this.pageTitle.update(()=>"Download to POS")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-download-v2"]],viewQuery:function(n,i){if(n&1&&Ce(It,5),n&2){let a;Se(a=ve())&&(i.stepper=a.first)}},features:[Q([Y,pe,{provide:Qe,useValue:{displayDefaultIndicatorType:!1}}])],decls:26,vars:20,consts:[["stepper",""],[3,"hideSearchBox","hideSearchDropdown","headerTitle","description"],[1,"btn-group","me-3"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"disabled"],[1,"btn","btn-outline-secondary","btn-fill","d-flex","align-items-center","gap-2"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectedIndexChange","ngClass","selectedIndex"],["state","filter",3,"completed","editable"],["matStepLabel",""],[1,"w-100",3,"onFilterChange","onRememberMeChange","reset"],["state","preview",3,"editable","completed"],[4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill","d-flex","align-items-center","gap-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt"],[1,"fa-solid","fa-filter","me-3"],[1,"fa-solid","fa-file","me-3"],[3,"onExportOrders","orderPreview"],[1,"fa-solid","fa-flag","me-3"],[3,"downloadResult"]],template:function(n,i){if(n&1){let a=v();o(0,"mainpanel",1)(1,"actions"),w(2,Vt,5,1,"div",2)(3,kt,2,1,"button",3)(4,Ft,3,0,"button",4),r(),o(5,"content")(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"mat-stepper",9,0),M("selectedIndexChange",function(s){return c(a),b(i.stepperSelectedIndex,s)||(i.stepperSelectedIndex=s),h(s)}),o(12,"mat-step",10),w(13,Ot,3,0,"ng-template",11),o(14,"filter-step",12),g("onFilterChange",function(s){return c(a),h(i.onFilterChange(s))})("onRememberMeChange",function(s){return c(a),h(i.rememberMe.set(s))}),r()(),o(15,"mat-step",13),w(16,Nt,3,0,"ng-template",11)(17,Rt,2,1,"ng-container",14),W(18,"async"),r(),o(19,"mat-step",15),w(20,Wt,3,0,"ng-template",11)(21,Bt,2,1,"ng-container",14),W(22,"async"),r(),w(23,Lt,2,0,"ng-template",16)(24,At,2,0,"ng-template",17)(25,zt,2,0,"ng-template",18),r()()()()()()()}if(n&2){let a=x(11);d("hideSearchBox",!0)("hideSearchDropdown",!0)("headerTitle",i.pageTitle())("description",i.pageTitle()),l(2),V(i.stepperSelectedIndex()==1?2:-1),l(),V(i.stepperSelectedIndex()==0?3:-1),l(),V(i.stepperSelectedIndex()==2?4:-1),l(6),ge("ngClass","last-edited-step-"+a.selectedIndex),T("selectedIndex",i.stepperSelectedIndex),l(2),d("completed",!1)("editable",i.stepperSelectedIndex()!=2),l(2),d("reset",i.isResetFilter()),l(),d("editable",i.stepperSelectedIndex()!=2)("completed",!1),l(2),d("ngIf",j(18,16,i.orderPreview$)),l(4),d("ngIf",j(22,18,i.downloadPreview$))}},dependencies:[I,F,A,X,ot,at,lt,et,Je,Ze,Xe,qe,We,Re,Te,ae],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{padding-top:.8rem;padding-bottom:.8rem}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
@@ -1 +1 @@
1
- import{a as G}from"./chunk-CO5XZENC.js";import"./chunk-FGRPTNDB.js";import"./chunk-3PPLPXAX.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-OLVWSY6L.js";import"./chunk-Z3ITXK3D.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-RXQX7567.js";import{m as H,n as J}from"./chunk-HJXYT6MI.js";import{A as R,c as B,h as W,m as I}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as P,l as k,n as D}from"./chunk-FXQKRJWU.js";import{$c as b,Gb as S,Gc as i,Hc as T,Kc as g,Lc as f,Mb as x,Mc as C,Nc as V,Oc as O,Pc as _,Ra as u,Yb as w,Z as y,ad as v,dc as M,ic as e,jc as t,kc as L,oc as A,pa as E,rb as d,tc as h,uc as N,ya as s,za as c}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){N();let l=_(25);d(),T(v(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 de=(()=>{class n{constructor(){this.httpService=E(j),this.selectedChannel=u(null),this.orderNumber=u(null)}initEscrowLog(){this.escrowLog$=this.httpService.post(F.GetEscrowDetail,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(y(1))}copyToClipboard(l){if(!l)return;let p=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(p),alert("Copied to clipboard!")}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275cmp=S({type:n,selectors:[["app-escrow-api"]],decls:40,vars:9,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"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",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(p,o){if(p&1){let a=A();e(0,"mainpanel",0)(1,"actions")(2,"button",1),h("click",function(){return s(a),c(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,"app-channel-options-v2",10),C("ngModelChange",function(r){return s(a),f(o.selectedChannel,r)||(o.selectedChannel=r),c(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 s(a),f(o.orderNumber,r)||(o.orderNumber=r),c(r)}),t()()()()(),V(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(){s(a);let r=_(25);return c(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(p&2){w("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),g("ngModel",o.selectedChannel),d(8),g("ngModel",o.orderNumber),d();let a=O(v(26,6,o.escrowLog$));d(8),w("disabled",!a),d(5),M(a?38:39)}},dependencies:[D,P,k,R,B,W,I,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{de as EscrowApiComponent};
1
+ import{a as G}from"./chunk-CBQUB3KW.js";import"./chunk-FGRPTNDB.js";import"./chunk-3PPLPXAX.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-P2AADVEN.js";import"./chunk-Z3ITXK3D.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-EUYQST7Q.js";import{m as H,n as J}from"./chunk-HJXYT6MI.js";import{A as R,c as B,h as W,m as I}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as P,l as k,n as D}from"./chunk-FXQKRJWU.js";import{$c as b,Gb as S,Gc as i,Hc as T,Kc as g,Lc as f,Mb as x,Mc as C,Nc as V,Oc as O,Pc as _,Ra as u,Yb as w,Z as y,ad as v,dc as M,ic as e,jc as t,kc as L,oc as A,pa as E,rb as d,tc as h,uc as N,ya as s,za as c}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){N();let l=_(25);d(),T(v(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 de=(()=>{class n{constructor(){this.httpService=E(j),this.selectedChannel=u(null),this.orderNumber=u(null)}initEscrowLog(){this.escrowLog$=this.httpService.post(F.GetEscrowDetail,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(y(1))}copyToClipboard(l){if(!l)return;let p=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(p),alert("Copied to clipboard!")}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275cmp=S({type:n,selectors:[["app-escrow-api"]],decls:40,vars:9,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"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",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(p,o){if(p&1){let a=A();e(0,"mainpanel",0)(1,"actions")(2,"button",1),h("click",function(){return s(a),c(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,"app-channel-options-v2",10),C("ngModelChange",function(r){return s(a),f(o.selectedChannel,r)||(o.selectedChannel=r),c(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 s(a),f(o.orderNumber,r)||(o.orderNumber=r),c(r)}),t()()()()(),V(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(){s(a);let r=_(25);return c(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(p&2){w("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),g("ngModel",o.selectedChannel),d(8),g("ngModel",o.orderNumber),d();let a=O(v(26,6,o.escrowLog$));d(8),w("disabled",!a),d(5),M(a?38:39)}},dependencies:[D,P,k,R,B,W,I,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{de as EscrowApiComponent};
@@ -1,2 +1,2 @@
1
- import{b as Et}from"./chunk-R5WARQUS.js";import{a as kt}from"./chunk-PFY5UG5D.js";import{a as Te,b as ht,c as gt,d as xe,e as Ie}from"./chunk-GVXBDVLX.js";import"./chunk-DGIH7HSJ.js";import{a as ut,b as be,c as ft,d as ye,f as yt,g as vt,h as Fe,i as Tt,o as ae}from"./chunk-KS7ACI26.js";import{b as It}from"./chunk-PHUHUFYL.js";import{a as Ct}from"./chunk-2WHJU6CS.js";import"./chunk-3GDM5JNY.js";import{b as bt,d as Se}from"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{b as St}from"./chunk-PGP3WHIS.js";import"./chunk-VFATXJRG.js";import{a as Ft,b as At}from"./chunk-LYPHZP72.js";import{a as xt}from"./chunk-RHHHL4OR.js";import"./chunk-7ES3PHES.js";import{a as _t,b as ve}from"./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{a as Ce}from"./chunk-HIC5QC3Y.js";import{a as st,b as mt,f as dt}from"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-C7YK5TDP.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as pt}from"./chunk-GHFADTRR.js";import"./chunk-5ZR5WIHG.js";import"./chunk-ACIMXBIC.js";import{d as H,e as Y}from"./chunk-PYXL7UF7.js";import"./chunk-OLVWSY6L.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as ot,e as re}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{b as De,c as h}from"./chunk-RXQX7567.js";import{m as lt,n as ct}from"./chunk-HJXYT6MI.js";import{A as oe,B as G,a as Qe,c as ne,e as me,h as $,i as W,l as ge,m as Ze,n as X,q as K,r as et,s as J,t as tt,u as it,v as nt,z as q}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as rt,s as at}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as A,j as k,n as T}from"./chunk-FXQKRJWU.js";import{$ as Ye,$c as x,Fc as _e,Gb as v,Gc as f,Hb as fe,Hc as ie,Ic as Q,K as Ge,Ka as D,Kc as Ke,Lc as Je,M as He,Mb as _,Mc as qe,Na as je,Oa as Me,Qc as F,Rc as he,Xb as We,Yb as p,Z as te,Zb as Oe,ad as I,ca as se,dc as S,ea as U,ec as B,f as de,g as $e,gc as L,hc as R,ic as s,ja as M,jc as a,jd as ze,ka as ue,kc as d,lc as N,mc as w,oc as E,pa as u,rb as c,tc as y,uc as l,v as V,xa as O,xb as j,xc as Xe,ya as C,za as b}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var z=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(z||{});var le=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(le||{});var ce=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(ce||{});var Ne=class extends ge{setValue(m,e){if(m instanceof Date){let i=Math.floor(m.getTime()/1e3);super.setValue(i,e)}else super.setValue(m,e)}},we=(()=>{class t{constructor(){this.shopeeUploadService=u(Te),this.formBuilder=u(q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,n;return e=e.map(o=>(i=o?.multi_lang?.find(r=>r.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(r=>(n=r?.multi_lang?.find(g=>g.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),e}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{if(n=[],o.mandatory&&n.push(me.required),o?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new ge(null),value:new ge(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==z.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ce.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new Ne(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.attribute_id||g.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(g=>g==r.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ce.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(r=>r.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let n=[];if(h.IsNotEmpty(e)){let o={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ae=(()=>{class t{constructor(){this._calendarHeaderConfig=new $e({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $t=["class","component ts"];function Gt(t,m){if(t&1){let e=E();s(0,"button",3),y("click",function(){C(e);let n=l(2);return b(n.todayClicked())}),d(1,"i",4),a()}}function Ht(t,m){if(t&1){let e=E();s(0,"button",5),y("click",function(){C(e);let n=l(2);return b(n.clearClicked())}),d(1,"i",6),a()}}function Yt(t,m){if(t&1&&(N(0),_(1,Gt,2,0,"button",1)(2,Ht,2,0,"button",2),w()),t&2){let e=m.ngIf;c(),p("ngIf",!e.hideBtnToday),c(),p("ngIf",!e.hideBtnClear)}}var Mt=(()=>{class t{constructor(e,i,n,o,r){this._datePicker=e,this._calendar=i,this._dateAdapter=n,this.calendarService=o,this._destroyed=new de,i.stateChanges.pipe(se(this._destroyed)).subscribe(g=>r.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(j(Fe),j(vt),j(be),j(Ae),j(ze))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[O],attrs:$t,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,n){i&1&&(s(0,"mat-calendar-header"),_(1,Yt,3,2,"ng-container",0),x(2,"async"),a()),i&2&&(c(),p("ngIf",I(2,1,n.calendarConfig$)))},dependencies:[A,bt,yt,k],encapsulation:2})}}return t})(),Ot=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve]})}}return t})();function jt(t,m){if(t&1&&(s(0,"mat-label",7)(1,"span"),f(2),a()()),t&2){let e=l();p("show",e.placeholder),c(2),ie(e.placeholder)}}var Wt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Dt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=Mt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new D,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(j(Ae))}}static{this.\u0275cmp=v({type:t,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[F([{provide:be,useClass:kt,deps:[ut]},{provide:ft,useValue:Wt},{provide:Qe,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,n){if(i&1){let o=E();s(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(g){return C(o),b(n.change(g.value))})("click",function(){C(o);let g=_e(6);return b(g.open())}),a(),s(3,"span",4),y("click",function(){C(o);let g=_e(6);return b(g.open())}),d(4,"i",5),a(),s(5,"mat-datepicker",6,0),y("opened",function(){return C(o),b(n.onOpenDatepicker())})("closed",function(){return C(o),b(n.onCloseDatepicker())}),a()()}if(i&2){let o=_e(6);Oe("width",n.width||100,"%"),p("disabled",n.disabled)("appearance",n.appearance),c(),p("ngIf",n.isFloatingLabel&&n.placeholder),c(),Xe("placeholder",n.placeholder||""),p("matDatepicker",o)("min",n.minDateValidation)("max",n.maxDateValidation)("value",n.date==n.minDate?null:n.date)("disabled",n.disabled)("readonly",n.readOnly),We("data-cy",n.data_cy),c(),Oe("display",n.displayToggle?"unset":"none"),c(2),p("calendarHeaderComponent",n.headerComponent)}},dependencies:[A,Fe,Tt,dt,st,mt,_t],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
1
+ import{b as Et}from"./chunk-Y4XF2TXJ.js";import{a as kt}from"./chunk-PFY5UG5D.js";import{a as Te,b as ht,c as gt,d as xe,e as Ie}from"./chunk-USBIAIK6.js";import"./chunk-7TI3OR34.js";import{a as ut,b as be,c as ft,d as ye,f as yt,g as vt,h as Fe,i as Tt,o as ae}from"./chunk-KS7ACI26.js";import{b as It}from"./chunk-PHUHUFYL.js";import{a as Ct}from"./chunk-YU2SDRUC.js";import"./chunk-3GDM5JNY.js";import{b as bt,d as Se}from"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{b as St}from"./chunk-PGP3WHIS.js";import"./chunk-VFATXJRG.js";import{a as Ft,b as At}from"./chunk-LYPHZP72.js";import{a as xt}from"./chunk-RHHHL4OR.js";import"./chunk-X4B2FYY3.js";import{a as _t,b as ve}from"./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{a as Ce}from"./chunk-HIC5QC3Y.js";import{a as st,b as mt,f as dt}from"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-63ANFYRV.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as pt}from"./chunk-5EIQGYTB.js";import"./chunk-GZS2MOSK.js";import"./chunk-ACIMXBIC.js";import{d as H,e as Y}from"./chunk-PYXL7UF7.js";import"./chunk-P2AADVEN.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as ot,e as re}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{b as De,c as h}from"./chunk-EUYQST7Q.js";import{m as lt,n as ct}from"./chunk-HJXYT6MI.js";import{A as oe,B as G,a as Qe,c as ne,e as me,h as $,i as W,l as ge,m as Ze,n as X,q as K,r as et,s as J,t as tt,u as it,v as nt,z as q}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as rt,s as at}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as A,j as k,n as T}from"./chunk-FXQKRJWU.js";import{$ as Ye,$c as x,Fc as _e,Gb as v,Gc as f,Hb as fe,Hc as ie,Ic as Q,K as Ge,Ka as D,Kc as Ke,Lc as Je,M as He,Mb as _,Mc as qe,Na as je,Oa as Me,Qc as F,Rc as he,Xb as We,Yb as p,Z as te,Zb as Oe,ad as I,ca as se,dc as S,ea as U,ec as B,f as de,g as $e,gc as L,hc as R,ic as s,ja as M,jc as a,jd as ze,ka as ue,kc as d,lc as N,mc as w,oc as E,pa as u,rb as c,tc as y,uc as l,v as V,xa as O,xb as j,xc as Xe,ya as C,za as b}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var z=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(z||{});var le=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(le||{});var ce=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(ce||{});var Ne=class extends ge{setValue(m,e){if(m instanceof Date){let i=Math.floor(m.getTime()/1e3);super.setValue(i,e)}else super.setValue(m,e)}},we=(()=>{class t{constructor(){this.shopeeUploadService=u(Te),this.formBuilder=u(q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,n;return e=e.map(o=>(i=o?.multi_lang?.find(r=>r.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(r=>(n=r?.multi_lang?.find(g=>g.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),e}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{if(n=[],o.mandatory&&n.push(me.required),o?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new ge(null),value:new ge(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==z.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ce.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new Ne(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.attribute_id||g.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(g=>g==r.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ce.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(r=>r.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let n=[];if(h.IsNotEmpty(e)){let o={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ae=(()=>{class t{constructor(){this._calendarHeaderConfig=new $e({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $t=["class","component ts"];function Gt(t,m){if(t&1){let e=E();s(0,"button",3),y("click",function(){C(e);let n=l(2);return b(n.todayClicked())}),d(1,"i",4),a()}}function Ht(t,m){if(t&1){let e=E();s(0,"button",5),y("click",function(){C(e);let n=l(2);return b(n.clearClicked())}),d(1,"i",6),a()}}function Yt(t,m){if(t&1&&(N(0),_(1,Gt,2,0,"button",1)(2,Ht,2,0,"button",2),w()),t&2){let e=m.ngIf;c(),p("ngIf",!e.hideBtnToday),c(),p("ngIf",!e.hideBtnClear)}}var Mt=(()=>{class t{constructor(e,i,n,o,r){this._datePicker=e,this._calendar=i,this._dateAdapter=n,this.calendarService=o,this._destroyed=new de,i.stateChanges.pipe(se(this._destroyed)).subscribe(g=>r.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(j(Fe),j(vt),j(be),j(Ae),j(ze))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[O],attrs:$t,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,n){i&1&&(s(0,"mat-calendar-header"),_(1,Yt,3,2,"ng-container",0),x(2,"async"),a()),i&2&&(c(),p("ngIf",I(2,1,n.calendarConfig$)))},dependencies:[A,bt,yt,k],encapsulation:2})}}return t})(),Ot=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve]})}}return t})();function jt(t,m){if(t&1&&(s(0,"mat-label",7)(1,"span"),f(2),a()()),t&2){let e=l();p("show",e.placeholder),c(2),ie(e.placeholder)}}var Wt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Dt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=Mt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new D,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(j(Ae))}}static{this.\u0275cmp=v({type:t,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[F([{provide:be,useClass:kt,deps:[ut]},{provide:ft,useValue:Wt},{provide:Qe,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,n){if(i&1){let o=E();s(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(g){return C(o),b(n.change(g.value))})("click",function(){C(o);let g=_e(6);return b(g.open())}),a(),s(3,"span",4),y("click",function(){C(o);let g=_e(6);return b(g.open())}),d(4,"i",5),a(),s(5,"mat-datepicker",6,0),y("opened",function(){return C(o),b(n.onOpenDatepicker())})("closed",function(){return C(o),b(n.onCloseDatepicker())}),a()()}if(i&2){let o=_e(6);Oe("width",n.width||100,"%"),p("disabled",n.disabled)("appearance",n.appearance),c(),p("ngIf",n.isFloatingLabel&&n.placeholder),c(),Xe("placeholder",n.placeholder||""),p("matDatepicker",o)("min",n.minDateValidation)("max",n.maxDateValidation)("value",n.date==n.minDate?null:n.date)("disabled",n.disabled)("readonly",n.readOnly),We("data-cy",n.data_cy),c(),Oe("display",n.displayToggle?"unset":"none"),c(2),p("calendarHeaderComponent",n.headerComponent)}},dependencies:[A,Fe,Tt,dt,st,mt,_t],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
2
2
  `],encapsulation:2})}}return t})(),Nt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve,Ot,It]})}}return t})();var Ve=()=>[];function Kt(t,m){t&1&&(s(0,"span",5),f(1,"*"),a())}function Jt(t,m){if(t&1&&d(0,"ng-select",6),t&2){let e=l().$implicit;p("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(4,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function qt(t,m){if(t&1&&d(0,"input",8),t&2){let e=l(2).$implicit;p("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function zt(t,m){if(t&1&&(s(0,"option",15),f(1),a()),t&2){let e=m.$implicit;p("value",e),c(),ie(e)}}function Qt(t,m){if(t&1&&(s(0,"div",10),d(1,"input",12),s(2,"select",13)(3,"option",14),f(4,"Unit"),a(),L(5,zt,2,2,"option",15,B),a()()),t&2){let e=l(3).$implicit;p("formGroupName",e.attribute_id),c(),p("placeholder","Isi "+(e==null?null:e.name)),c(2),p("value",null),c(2),R(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function Zt(t,m){if(t&1&&d(0,"input",11),t&2){let e=l(3).$implicit;p("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function ei(t,m){if(t&1&&_(0,Qt,7,3,"div",10)(1,Zt,1,2,"input",11),t&2){let e=l(2).$implicit,i=l(2);S((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ti(t,m){if(t&1&&d(0,"datepicker",9),t&2){let e=l(2).$implicit;p("formControlName",e.attribute_id)}}function ii(t,m){if(t&1&&_(0,qt,1,2,"input",8)(1,ei,2,1)(2,ti,1,1,"datepicker",9),t&2){let e,i=l().$implicit,n=l(2);S((e=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:e===n.validationType.VALIDATOR_FLOAT_TYPE?1:e===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ni(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;p("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(3,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function oi(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;p("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(3,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function ri(t,m){if(t&1&&(s(0,"div",3)(1,"div",4),_(2,Kt,2,0,"span",5),s(3,"span"),f(4),a()(),_(5,Jt,1,5,"ng-select",6)(6,ii,3,1)(7,ni,1,4,"ng-select",7)(8,oi,1,4,"ng-select",7),a()),t&2){let e,i=m.$implicit,n=l(2);c(2),S(i.mandatory?2:-1),c(2),Q(" ",i==null?null:i.name," "),c(),S((e=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:e===n.inputType.FREE_TEXT_FILED?6:e===n.inputType.SINGLE_COMBO_BOX?7:8)}}function ai(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2),L(3,ri,9,3,"div",3,B),a()(),w()),t&2){let e=m.ngIf,i=l();c(),p("formGroup",i.form),c(2),R(e)}}var wt=(()=>{class t{constructor(){this.formCategoryService=u(we),this.attributesChanges=new D,this.inputType=z,this.formatType=le,this.validationType=ce}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(U(e=>{this.form=this.formCategoryService.createFormGroup(e),this.listenToFormChange(e)}),te(1)))}listenToFormChange(e){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(e,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[F([we]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){i&1&&(_(0,ai,5,1,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,it,nt,ne,tt,$,W,K,J,et,xt,Nt,Dt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]})}}return t})();var ee=function(t){return t.TIKTOK_SHOP="TIKTOK_SHOP",t.TOKOPEDIA="TOKOPEDIA",t}(ee||{});var Ue=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q),this.uploadProductService=u(Ie)}getAttributes(e,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(Ge(o=>this.uploadProductService.selectedProduct$.pipe(V(r=>(o=this.mappingAttributeSalesProperty(o,r),o)))))}mappingAttributeSalesProperty(e,i){let n=0;return e.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(e){let i=!1,n=[];return e.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{n=[],o.is_required&&n.push(me.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i.addControl("listingPlatform",this.formBuilder.control([ee.TIKTOK_SHOP,ee.TOKOPEDIA],[me.required])),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.id)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(r=>i[o.id]?.includes(r.id)):o.values=o.values.filter(r=>r.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function li(t,m){t&1&&(s(0,"small",6),f(1," Platform is required "),a())}function ci(t,m){t&1&&(s(0,"span",6),f(1,"*"),a())}function pi(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;p("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function si(t,m){if(t&1&&d(0,"ng-select",8),t&2){let e=l().$implicit;p("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function mi(t,m){if(t&1&&d(0,"input",9),t&2){let e=l().$implicit;p("formControlName",e.id)("placeholder",e==null?null:e.name)}}function di(t,m){if(t&1&&(s(0,"small",6),f(1),a()),t&2){let e=l().$implicit;c(),Q(" ",e==null?null:e.name," is mandatory ")}}function ui(t,m){if(t&1&&(s(0,"div",3)(1,"div",4),_(2,ci,2,0,"span",6),s(3,"span"),f(4),a()(),_(5,pi,1,4,"ng-select",7)(6,si,1,3,"ng-select",8)(7,mi,1,2,"input",9)(8,di,2,1,"small",6),a()),t&2){let e=m.$implicit;c(2),S(e.is_required?2:-1),c(2),Q(" ",e==null?null:e.name," "),c(),S(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),c(3),S(e.is_required?8:-1)}}function fi(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"span"),f(6," Platform Options"),a()(),d(7,"ng-select",5),_(8,li,2,0,"small",6),a(),L(9,ui,9,4,"div",3,B),a()(),w()),t&2){let e,i=m.ngIf,n=l();c(),p("formGroup",n.form),c(6),p("multiple",!0)("items",n.platformOptions)("clearable",!1),c(),S(!(n.form==null||(e=n.form.get("listingPlatform").errors)==null)&&e.required?8:-1),c(),R(i)}}var Vt=(()=>{class t{constructor(){this.tiktokAttributeFormService=u(Ue),this.platformChange=je({alias:"onPlatformChanges"}),this.formSubscription=new de,this.attributesChanges=new D,this.platformOptions=[{label:"TikTok Shop",value:ee.TIKTOK_SHOP},{label:"Tokopedia",value:ee.TOKOPEDIA}]}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(V(e=>e.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),U(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),te(1)))}listenToFormChange(e){let i=[];this.form.valueChanges.pipe(se(this.formSubscription)).subscribe(n=>{delete n.listingPlatform,i=this.tiktokAttributeFormService.getFilteredAttributes(e,n),this.attributesChanges.emit(i)}),this.form.get("listingPlatform").valueChanges.pipe(Ye(this.form.get("listingPlatform").value),se(this.formSubscription)).subscribe(n=>{this.platformChange.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[F([Ue]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){i&1&&(_(0,fi,11,5,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,ne,$,W,K,J,oe],encapsulation:2})}}return t})();var Be=(()=>{class t{constructor(){this.woocommerceUploadService=u(xe)}getAttributes(e,i){return this.woocommerceUploadService.getAttributes(e,i).pipe(V(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ut=(()=>{class t{constructor(){this.wooAttributeFormService=u(Be),this.channelId=Me(),this.categoryId=Me(),this.attributesChanges=new D}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[F([Be]),O],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),a(),s(4,"ng-select",3),x(5,"async"),y("change",function(r){return n.onSelectAttribute(r)}),a()()()),i&2&&(c(4),p("items",I(5,1,n.attributes$)))},dependencies:[T,k,oe,Y,H,G],encapsulation:2})}}return t})();var Le=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q)}getAttributes(e,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(V(o=>o))}createFormGroup(e){let i=this.formBuilder.group({});return e.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(e={}){return Object.values(e).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function _i(t,m){if(t&1&&(s(0,"div",3)(1,"div",4),f(2),a(),d(3,"ng-select",5),a()),t&2){let e=m.$implicit;c(2),Q(" ",e==null?null:e.variant," "),c(),p("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function hi(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2),L(3,_i,4,4,"div",3,B),a()(),w()),t&2){let e=m.ngIf,i=l();c(),p("formGroup",i.form),c(2),R(e)}}var Bt=(()=>{class t{constructor(){this.tokpedAttrFormService=u(Le),this.attributesChanges=new D}ngOnInit(){}ngOnChanges(e){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(U(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{e=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[F([Le]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){i&1&&(_(0,hi,5,1,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,$,W,K,J],encapsulation:2})}}return t})();var Re=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(U(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(e){let i=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function gi(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),a(),d(6,"input",5),a(),s(7,"div",6)(8,"div",4),f(9," Product Type "),a(),d(10,"input",7),a(),s(11,"div",6)(12,"div",4),f(13," Status "),a(),d(14,"ng-select",8),a()()(),w()),t&2){let e=m.ngIf,i=l();c(),p("formGroup",i.form),c(13),p("items",e.Options.StatusOptions)}}var Lt=(()=>{class t{constructor(){this.attributesChanges=new D,this.shopifyFormService=u(Re)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(U(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(He(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[F([Re]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){i&1&&(_(0,gi,15,2,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,G,X,ne,$,W,K,J,Y,H],encapsulation:2})}}return t})();function Ci(t,m){if(t&1&&(s(0,"div",6),d(1,"app-product-card",9),a()),t&2){let e=m.$implicit;c(),p("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function bi(t,m){if(t&1){let e=E();N(0),s(1,"mat-checkbox",21),qe("ngModelChange",function(n){C(e);let o=l().$implicit;return Je(o.selected,n)||(o.selected=n),b(n)}),y("ngModelChange",function(){let n=C(e).ngIf,o=l(),r=o.$implicit,g=o.$index,pe=l();return b(pe.onSelectChannel(r,g,n))}),a(),w()}if(t&2){let e=l().$implicit;c(),Ke("ngModel",e.selected)}}function yi(t,m){if(t&1&&(s(0,"div",18),d(1,"input",22),a()),t&2){let e=l().$implicit,i=l();p("matTooltip",e.type==i.channelType.Shopify||e.type==i.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":e.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function vi(t,m){if(t&1){let e=E();s(0,"app-channel-category-select",23),y("selectedCategory",function(n){C(e);let o=l().$index,r=l();return b(r.onCategoryChange(o,n))}),a()}if(t&2){let e=l().$implicit,i=l();p("disabled",!e.selected||e.selected&&e.type==i.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Ti(t,m){if(t&1){let e=E();s(0,"shopee-attribute-form",27),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function xi(t,m){if(t&1){let e=E();s(0,"tiktok-attribute-form",28),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))})("onPlatformChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onPlatformChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)}}function Ii(t,m){if(t&1){let e=E();s(0,"wooocommerce-attribute-form",29),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)}}function Si(t,m){if(t&1){let e=E();s(0,"tokopedia-attribute-form",29),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)}}function Fi(t,m){if(t&1&&(s(0,"div",20)(1,"div",24),_(2,Ti,1,3,"shopee-attribute-form",25)(3,xi,1,2,"tiktok-attribute-form",26)(4,Ii,1,2,"wooocommerce-attribute-form",26)(5,Si,1,2,"tokopedia-attribute-form",26),a()()),t&2){let e,i=l().$implicit,n=l();c(2),S((e=i.type)===n.channelType.Shopee?2:e===n.channelType.Tiktok?3:e===n.channelType.WooCommerce?4:e===n.channelType.Tokopedia?5:-1)}}function Ai(t,m){if(t&1){let e=E();s(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),y("attributesChanges",function(n){C(e);let o=l().$index,r=l();return b(r.onAttributesChange(o,n))}),a()()()}if(t&2){let e=l().$implicit;c(2),p("channelId",e.id)}}function ki(t,m){if(t&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,bi,2,1,"ng-container",14),x(7,"async"),a(),s(8,"div"),d(9,"app-channel-logo",15),a(),s(10,"div",16)(11,"span"),f(12),a()()()(),s(13,"div",12)(14,"div",17),_(15,yi,2,1,"div",18)(16,vi,1,4,"app-channel-category-select",19),a()()(),_(17,Fi,6,1,"div",20)(18,Ai,3,1,"div",20),a()()),t&2){let e=m.$implicit,i=l();c(6),p("ngIf",I(7,8,i.defaultCategories$)),c(3),p("typeId",e.type)("showChannelName",!1),c(),p("matTooltip",e.name)("matTooltipShowDelay",2500),c(2),ie(e.name),c(3),S(e.type==i.channelType.Shopify||e.type==i.channelType.Plugo||e.type==i.channelType.ShopifyV2?15:16),c(2),S(e.categoryId&&i.channelType.Lazada!=e.type&&e.selected?17:(i.channelType.Shopify==e.type||e.type==i.channelType.ShopifyV2)&&e.selected?18:-1)}}var Ar=(()=>{class t{constructor(){this.toastr=u(ot),this.uploadProductService=u(Ie),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=De,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(te(1))}onCategoryChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.categoryId=i,o.attributes=[]),o)))}onPlatformChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.listing_platforms=i),o)))}onAttributesChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.attributes=i),o)))}tiktokPlatformChanges(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.listing_platforms=i),o)))}onSelectChannel(e,i,n){this.channelProductUploads.update(o=>o.map((r,g)=>{if(g==i&&e.selected){let pe=this.findCategoryByChannelId(e.id,n);r.categoryId=pe?.DefaultCategoryID}return g==i&&!e.selected&&(r.categoryId=null),r}))}findCategoryByChannelId(e,i){return i.find(n=>n.ID===e)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(i=>i.type==De.Tiktok&&h.IsNotEmpty(i?.categoryId)?i.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-product-upload"]],features:[F([Te,ht,gt,xe])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return n.onUploadProduct()}),d(3,"i",2),f(4," Upload "),a()(),s(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),a(),s(9,"div",5),L(10,Ci,2,7,"div",6,B),x(12,"async"),a(),s(13,"h3",7),f(14,"Channel To Upload"),a(),L(15,ki,19,10,"div",8,B),a()()()),i&2){let o;p("hideSearchBox",!0)("hideSearchDropdown",!0),c(2),p("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),c(8),R(I(12,3,n.selectedProducts$)),c(5),R(n.channelProductUploads())}},dependencies:[T,A,k,St,ct,lt,At,Ft,pt,oe,$,Ze,at,rt,Vt,Ut,Bt,Lt,Ct,Et,wt],encapsulation:2})}}return t})();export{Ar as ProductUploadComponent};
@@ -1 +1 @@
1
- import{a as pe,b as me,c as de}from"./chunk-RU43F4UK.js";import{a as ue}from"./chunk-DRVWJPA2.js";import{a as T}from"./chunk-FYB62QQV.js";import{a as se}from"./chunk-67HPC5Y3.js";import{a as oe}from"./chunk-OLANEXLB.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.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{a as le}from"./chunk-CO5XZENC.js";import"./chunk-FGRPTNDB.js";import"./chunk-3PPLPXAX.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-C7YK5TDP.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-ACIMXBIC.js";import{a as ae}from"./chunk-LDL3A7NM.js";import"./chunk-OLVWSY6L.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import{m as ne,n as re}from"./chunk-HJXYT6MI.js";import{A as ee,c as X,h as Y,m as Z,o as $}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as te,s as ie}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as G,k as J,m as K,n as Q}from"./chunk-FXQKRJWU.js";import{$c as w,Gb as W,Gc as l,Hc as v,Ic as b,Kc as _,Lc as g,Mb as x,Mc as f,Nc as z,Oc as A,Pc as R,Qc as H,Ra as N,Rc as j,Sc as U,Yb as u,ac as I,ad as E,bd as q,dc as y,ec as D,gc as B,hc as k,ic as t,jc as i,kc as c,oc as V,pa as O,pb as F,rb as o,tc as M,uc as h,ya as m,za as d}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as P,b as L}from"./chunk-66YHNWRR.js";var ce=()=>[],he=r=>({"td-cell-hover":r});function _e(r,S){if(r&1&&c(0,"variants-dropdown",31),r&2){let e=h().$implicit;u("variants",e==null?null:e.Variants)}}function ge(r,S){if(r&1&&c(0,"variant-with-image",32),r&2){let e=h().$implicit;u("variant",e==null?null:e.Variants[0])}}function fe(r,S){if(r&1&&(t(0,"span"),l(1),i()),r&2){let e=h().$implicit;o(),b("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(r,S){if(r&1&&(t(0,"tr")(1,"td")(2,"div",24),c(3,"img",25),w(4,"channelImage"),t(5,"div",26)(6,"div"),l(7),i(),t(8,"small",27)(9,"span"),l(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div",29)(14,"div"),c(15,"order-link",30),i()(),t(16,"small"),l(17),w(18,"date"),i()()(),t(19,"td"),l(20),i(),t(21,"td"),x(22,_e,1,1,"variants-dropdown",31)(23,ge,1,1,"variant-with-image",32),i(),t(24,"td",33),l(25),w(26,"number"),i(),t(27,"td")(28,"div",28)(29,"div",29)(30,"span"),l(31),i(),x(32,fe,2,1,"span"),i(),t(33,"small"),l(34),i()()()()),r&2){let e=S.$implicit;o(3),u("src",E(4,14,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(4),v(e.Outlet),o(3),v(e.ChannelName),o(5),u("order",e),o(2),b(" ",q(18,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(3),v(e.Customer),o(),I(U(21,he,(e.Variants==null?null:e.Variants.length)>1)),o(),y((e.Variants==null?null:e.Variants.length)>1?22:23),o(3),v(E(26,19,e.Amount)),o(6),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),y(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?32:-1),o(2),b(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function Ce(r,S){if(r&1){let e=V();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Outlet"),i(),t(6,"th",20),l(7,"Number"),i(),t(8,"th",20),l(9,"Customer"),i(),t(10,"th"),l(11,"Items"),i(),t(12,"th",21),l(13,"Amount"),i(),t(14,"th",22),l(15,"Shipping"),i()()(),t(16,"tbody"),B(17,Se,35,23,"tr",null,D),i()(),t(19,"app-custom-paginator",23),M("next",function(){m(e);let n=h();return d(n.initShippedOrders())})("previous",function(){m(e);let n=h();return d(n.initShippedOrders())}),i()()}if(r&2){let e=h(),p=R(0);o(17),k(p),o(2),u("filter",e.filter())("totaldata",p==null?null:p.length)}}function ve(r,S){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var He=(()=>{class r{constructor(){this.orderService=O(T),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(p=>L(P({},p),{From:e})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}static{this.\u0275fac=function(p){return new(p||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-shipped"]],features:[H([T])],decls:34,vars:12,consts:[["headerTitle","Shipped","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[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","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","100px"],["rowCountApi","/api/orders/shippedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"]],template:function(p,n){if(p&1){let s=V();z(0),w(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return m(s),d(n.initShippedOrders())}),f("textChange",function(a){return m(s),g(n.filter().Number,a)||(n.filter().Number=a),d(a)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),i(),t(12,"app-channel-options-v2",4),f("ngModelChange",function(a){return m(s),g(n.filter().ListChannelID,a)||(n.filter().ListChannelID=a),d(a)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),f("dateChange",function(a){return m(s),g(n.filter().From,a)||(n.filter().From=a),d(a)}),i()(),t(18,"div")(19,"datepicker",8),f("dateChange",function(a){return m(s),g(n.filter().To,a)||(n.filter().To=a),d(a)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),f("ngModelChange",function(a){return m(s),g(n.filter().PageNumber,a)||(n.filter().PageNumber=a),d(a)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),f("ngModelChange",function(a){return m(s),g(n.filter().PageSize,a)||(n.filter().PageSize=a),d(a)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,Ce,20,2,"div",15)(33,ve,2,0,"div",16),i()()()()()}if(p&2){let s=A(E(1,8,n.shippedOrders$)||j(11,ce));o(2),_("text",n.filter().Number),o(10),u("multiple",!0),_("ngModel",n.filter().ListChannelID),o(5),_("date",n.filter().From),o(2),_("date",n.filter().To),o(4),_("ngModel",n.filter().PageNumber),o(4),_("ngModel",n.filter().PageSize),o(5),y(s.length>0?32:33)}},dependencies:[Q,G,K,J,re,ne,oe,ae,ee,X,$,Y,Z,pe,me,de,se,ie,te,ue,le],encapsulation:2})}}return r})();export{He as ShippedComponent};
1
+ import{a as pe,b as me,c as de}from"./chunk-T27ABFCP.js";import{a as ue}from"./chunk-FHNST4Y7.js";import{a as T}from"./chunk-LLHPMXKP.js";import{a as se}from"./chunk-67HPC5Y3.js";import{a as oe}from"./chunk-KTB223SK.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.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{a as le}from"./chunk-CBQUB3KW.js";import"./chunk-FGRPTNDB.js";import"./chunk-3PPLPXAX.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-63ANFYRV.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-ACIMXBIC.js";import{a as ae}from"./chunk-LDL3A7NM.js";import"./chunk-P2AADVEN.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-EUYQST7Q.js";import{m as ne,n as re}from"./chunk-HJXYT6MI.js";import{A as ee,c as X,h as Y,m as Z,o as $}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as te,s as ie}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as G,k as J,m as K,n as Q}from"./chunk-FXQKRJWU.js";import{$c as w,Gb as W,Gc as l,Hc as v,Ic as b,Kc as _,Lc as g,Mb as x,Mc as f,Nc as z,Oc as A,Pc as R,Qc as H,Ra as N,Rc as j,Sc as U,Yb as u,ac as I,ad as E,bd as q,dc as y,ec as D,gc as B,hc as k,ic as t,jc as i,kc as c,oc as V,pa as O,pb as F,rb as o,tc as M,uc as h,ya as m,za as d}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as P,b as L}from"./chunk-66YHNWRR.js";var ce=()=>[],he=r=>({"td-cell-hover":r});function _e(r,S){if(r&1&&c(0,"variants-dropdown",31),r&2){let e=h().$implicit;u("variants",e==null?null:e.Variants)}}function ge(r,S){if(r&1&&c(0,"variant-with-image",32),r&2){let e=h().$implicit;u("variant",e==null?null:e.Variants[0])}}function fe(r,S){if(r&1&&(t(0,"span"),l(1),i()),r&2){let e=h().$implicit;o(),b("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(r,S){if(r&1&&(t(0,"tr")(1,"td")(2,"div",24),c(3,"img",25),w(4,"channelImage"),t(5,"div",26)(6,"div"),l(7),i(),t(8,"small",27)(9,"span"),l(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div",29)(14,"div"),c(15,"order-link",30),i()(),t(16,"small"),l(17),w(18,"date"),i()()(),t(19,"td"),l(20),i(),t(21,"td"),x(22,_e,1,1,"variants-dropdown",31)(23,ge,1,1,"variant-with-image",32),i(),t(24,"td",33),l(25),w(26,"number"),i(),t(27,"td")(28,"div",28)(29,"div",29)(30,"span"),l(31),i(),x(32,fe,2,1,"span"),i(),t(33,"small"),l(34),i()()()()),r&2){let e=S.$implicit;o(3),u("src",E(4,14,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(4),v(e.Outlet),o(3),v(e.ChannelName),o(5),u("order",e),o(2),b(" ",q(18,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(3),v(e.Customer),o(),I(U(21,he,(e.Variants==null?null:e.Variants.length)>1)),o(),y((e.Variants==null?null:e.Variants.length)>1?22:23),o(3),v(E(26,19,e.Amount)),o(6),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),y(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?32:-1),o(2),b(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function Ce(r,S){if(r&1){let e=V();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Outlet"),i(),t(6,"th",20),l(7,"Number"),i(),t(8,"th",20),l(9,"Customer"),i(),t(10,"th"),l(11,"Items"),i(),t(12,"th",21),l(13,"Amount"),i(),t(14,"th",22),l(15,"Shipping"),i()()(),t(16,"tbody"),B(17,Se,35,23,"tr",null,D),i()(),t(19,"app-custom-paginator",23),M("next",function(){m(e);let n=h();return d(n.initShippedOrders())})("previous",function(){m(e);let n=h();return d(n.initShippedOrders())}),i()()}if(r&2){let e=h(),p=R(0);o(17),k(p),o(2),u("filter",e.filter())("totaldata",p==null?null:p.length)}}function ve(r,S){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var He=(()=>{class r{constructor(){this.orderService=O(T),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(p=>L(P({},p),{From:e})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}static{this.\u0275fac=function(p){return new(p||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-shipped"]],features:[H([T])],decls:34,vars:12,consts:[["headerTitle","Shipped","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[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","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","100px"],["rowCountApi","/api/orders/shippedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"]],template:function(p,n){if(p&1){let s=V();z(0),w(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return m(s),d(n.initShippedOrders())}),f("textChange",function(a){return m(s),g(n.filter().Number,a)||(n.filter().Number=a),d(a)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),i(),t(12,"app-channel-options-v2",4),f("ngModelChange",function(a){return m(s),g(n.filter().ListChannelID,a)||(n.filter().ListChannelID=a),d(a)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),f("dateChange",function(a){return m(s),g(n.filter().From,a)||(n.filter().From=a),d(a)}),i()(),t(18,"div")(19,"datepicker",8),f("dateChange",function(a){return m(s),g(n.filter().To,a)||(n.filter().To=a),d(a)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),f("ngModelChange",function(a){return m(s),g(n.filter().PageNumber,a)||(n.filter().PageNumber=a),d(a)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),f("ngModelChange",function(a){return m(s),g(n.filter().PageSize,a)||(n.filter().PageSize=a),d(a)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,Ce,20,2,"div",15)(33,ve,2,0,"div",16),i()()()()()}if(p&2){let s=A(E(1,8,n.shippedOrders$)||j(11,ce));o(2),_("text",n.filter().Number),o(10),u("multiple",!0),_("ngModel",n.filter().ListChannelID),o(5),_("date",n.filter().From),o(2),_("date",n.filter().To),o(4),_("ngModel",n.filter().PageNumber),o(4),_("ngModel",n.filter().PageSize),o(5),y(s.length>0?32:33)}},dependencies:[Q,G,K,J,re,ne,oe,ae,ee,X,$,Y,Z,pe,me,de,se,ie,te,ue,le],encapsulation:2})}}return r})();export{He as ShippedComponent};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-DGIH7HSJ.js";import{a as E}from"./chunk-7ES3PHES.js";import{i as T}from"./chunk-OLVWSY6L.js";import{a as w}from"./chunk-CGOB6Y3X.js";import{b as D,e as s}from"./chunk-WN5DZGA4.js";import{b as i,c as m}from"./chunk-RXQX7567.js";import{G as j}from"./chunk-FXQKRJWU.js";import{B as U,G as I,J as u,Ra as C,g as b,ja as c,pa as a,q as d,v as A}from"./chunk-OJMQBH6T.js";var x=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var R=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var S=class{};var V=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var N=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var _t=(()=>{class r{constructor(){this.authService=a(T),this.productService=a(E),this.shoppeUploadService=a(x),this.tiktokUploadService=a(H),this.lazadaUploadService=a(R),this.tokopediaUploadService=a(V),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(N),this.toastrHandlingService=a(F),this.toastr=a(D),this.router=a(j),this.httpService=a(s),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(I(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return C(t.map(o=>{let p=new g;return p.id=o.ID,p.name=o.Name,p.type=o.TypeID,p.categoryId=null,p.attributes=[],p.selected=!1,p}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.ShopifyV2||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(A(o=>{let p=[];return o.filter(h=>m.IsNotEmpty(h)).forEach(h=>{p=[...p,...h]}),p})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],p=[],h=[],v=[],y=[],P=[],k=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:p.push(l);break;case i.Tokopedia:h.push(l);break;case i.WooCommerce:v.push(l);break;case i.Shopify:y.push(l);break;case i.ShopifyV2:P.push(l);break;case i.Plugo:k.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:p},{type:i.Tokopedia,data:h},{type:i.WooCommerce,data:v},{type:i.Shopify,data:y},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:k}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(p));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(h));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(v));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.ShopifyV2:n.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(k));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let p=new S;p.ChannelID=o.id,p.ChannelType=o.type,p.Products=this._selectedProduct.getValue(),o.type==i.Shopify||o.type==i.ShopifyV2?delete p.CategoryID:p.CategoryID=o.categoryId,p=this.generateAttributeHttpRequest(o,p),e.push(p)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;case i.ShopifyV2:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{x as a,H as b,R as c,z as d,_t as e};
1
+ import{a as F}from"./chunk-7TI3OR34.js";import{a as E}from"./chunk-X4B2FYY3.js";import{i as T}from"./chunk-P2AADVEN.js";import{a as w}from"./chunk-CGOB6Y3X.js";import{b as D,e as s}from"./chunk-WN5DZGA4.js";import{b as i,c as m}from"./chunk-EUYQST7Q.js";import{G as j}from"./chunk-FXQKRJWU.js";import{B as U,G as I,J as u,Ra as C,g as b,ja as c,pa as a,q as d,v as A}from"./chunk-OJMQBH6T.js";var x=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var R=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var S=class{};var V=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var N=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var _t=(()=>{class r{constructor(){this.authService=a(T),this.productService=a(E),this.shoppeUploadService=a(x),this.tiktokUploadService=a(H),this.lazadaUploadService=a(R),this.tokopediaUploadService=a(V),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(N),this.toastrHandlingService=a(F),this.toastr=a(D),this.router=a(j),this.httpService=a(s),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(I(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return C(t.map(o=>{let p=new g;return p.id=o.ID,p.name=o.Name,p.type=o.TypeID,p.categoryId=null,p.attributes=[],p.selected=!1,p}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.ShopifyV2||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(A(o=>{let p=[];return o.filter(h=>m.IsNotEmpty(h)).forEach(h=>{p=[...p,...h]}),p})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],p=[],h=[],v=[],y=[],P=[],k=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:p.push(l);break;case i.Tokopedia:h.push(l);break;case i.WooCommerce:v.push(l);break;case i.Shopify:y.push(l);break;case i.ShopifyV2:P.push(l);break;case i.Plugo:k.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:p},{type:i.Tokopedia,data:h},{type:i.WooCommerce,data:v},{type:i.Shopify,data:y},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:k}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(p));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(h));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(v));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.ShopifyV2:n.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(k));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let p=new S;p.ChannelID=o.id,p.ChannelType=o.type,p.Products=this._selectedProduct.getValue(),o.type==i.Shopify||o.type==i.ShopifyV2?delete p.CategoryID:p.CategoryID=o.categoryId,p=this.generateAttributeHttpRequest(o,p),e.push(p)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;case i.ShopifyV2:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{x as a,H as b,R as c,z as d,_t as e};