marketplacepos 6.22.0 → 26.22.1

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 (61) hide show
  1. package/Marketplace/{chunk-PQ6DPGWV.js → chunk-3BREDCKV.js} +1 -1
  2. package/Marketplace/{chunk-RP6G2CES.js → chunk-3GSVXRBG.js} +1 -1
  3. package/Marketplace/{chunk-BDLDA52S.js → chunk-3J7JIJUQ.js} +1 -1
  4. package/Marketplace/{chunk-VXM5Y4GR.js → chunk-3KUW43ZX.js} +1 -1
  5. package/Marketplace/{chunk-4W5KKUO4.js → chunk-55QWQP5X.js} +1 -1
  6. package/Marketplace/{chunk-3WG7LTIE.js → chunk-5CL57SA6.js} +1 -1
  7. package/Marketplace/{chunk-F62HZQOU.js → chunk-5JH3WWNT.js} +1 -1
  8. package/Marketplace/{chunk-XDRKSCAR.js → chunk-7BKOVVHP.js} +1 -1
  9. package/Marketplace/{chunk-W2AILV7A.js → chunk-7T332QJG.js} +1 -1
  10. package/Marketplace/{chunk-HLHEFDRO.js → chunk-AMTZAWOB.js} +2 -2
  11. package/Marketplace/{chunk-5NYVKJK6.js → chunk-AMXOODMD.js} +1 -1
  12. package/Marketplace/{chunk-CB534HG5.js → chunk-B4YMOSMT.js} +1 -1
  13. package/Marketplace/{chunk-NLKDWUN2.js → chunk-BL3IBVPU.js} +1 -1
  14. package/Marketplace/{chunk-CY46TZPM.js → chunk-BNO4ABZV.js} +1 -1
  15. package/Marketplace/{chunk-WNEB2NXG.js → chunk-BXHOHRRA.js} +1 -1
  16. package/Marketplace/{chunk-PKKXSYCL.js → chunk-CM6TTBXY.js} +1 -1
  17. package/Marketplace/{chunk-6IWZMDNC.js → chunk-EA5Y3EBM.js} +1 -1
  18. package/Marketplace/{chunk-RCMEZOHR.js → chunk-FFQMVXOJ.js} +1 -1
  19. package/Marketplace/{chunk-2OISU56P.js → chunk-G2OFO4CK.js} +1 -1
  20. package/Marketplace/{chunk-KMEVPGD4.js → chunk-GQRBV5VY.js} +1 -1
  21. package/Marketplace/{chunk-3LVJIRWN.js → chunk-GTIJRYKH.js} +1 -1
  22. package/Marketplace/{chunk-4KZRIGX5.js → chunk-HXSKWZXB.js} +1 -1
  23. package/Marketplace/{chunk-UEDA5PQ4.js → chunk-I37SU7ES.js} +1 -1
  24. package/Marketplace/{chunk-OY5DRMBF.js → chunk-IK4YSHRZ.js} +1 -1
  25. package/Marketplace/{chunk-DWW6X4IM.js → chunk-JCEQO5MQ.js} +1 -1
  26. package/Marketplace/{chunk-PQPEJIAL.js → chunk-LFUTTBNY.js} +1 -1
  27. package/Marketplace/{chunk-DPTAAF3J.js → chunk-LVR4OS4B.js} +1 -1
  28. package/Marketplace/{chunk-XPKA4JBS.js → chunk-M3CHYGT3.js} +1 -1
  29. package/Marketplace/{chunk-JWM6OJIQ.js → chunk-N4CCGL4X.js} +1 -1
  30. package/Marketplace/{chunk-2L56RCRG.js → chunk-NBY7NPTT.js} +1 -1
  31. package/Marketplace/{chunk-OO4HXSYZ.js → chunk-NCKMPECJ.js} +1 -1
  32. package/Marketplace/{chunk-5DREDFZJ.js → chunk-NF2YVEGJ.js} +1 -1
  33. package/Marketplace/{chunk-URBCYMW2.js → chunk-NM5EUAHO.js} +1 -1
  34. package/Marketplace/{chunk-JLY2L5QD.js → chunk-NS3MK77F.js} +1 -1
  35. package/Marketplace/{chunk-EDCMYDUE.js → chunk-P44G63CM.js} +1 -1
  36. package/Marketplace/{chunk-NHDG2POP.js → chunk-PA6SG4LZ.js} +1 -1
  37. package/Marketplace/{chunk-I5LMJBPL.js → chunk-PLA2PFMH.js} +1 -1
  38. package/Marketplace/{chunk-HBI7IZYG.js → chunk-PMN633XT.js} +1 -1
  39. package/Marketplace/{chunk-IYP3FT4Q.js → chunk-POY7HZKL.js} +1 -1
  40. package/Marketplace/{chunk-C57MMZXM.js → chunk-Q2XY5N3O.js} +1 -1
  41. package/Marketplace/{chunk-HA5CI7HP.js → chunk-QCDMADBI.js} +1 -1
  42. package/Marketplace/{chunk-3ST6WSBQ.js → chunk-QNPKVPDG.js} +1 -1
  43. package/Marketplace/{chunk-WWNKS3RN.js → chunk-QWEHZMCI.js} +1 -1
  44. package/Marketplace/{chunk-FKN5A6EJ.js → chunk-RCBBQWSM.js} +1 -1
  45. package/Marketplace/{chunk-KX3SCV5R.js → chunk-RJUIY3OK.js} +1 -1
  46. package/Marketplace/{chunk-6SXNTYJP.js → chunk-RQFUQIZC.js} +1 -1
  47. package/Marketplace/{chunk-B34DYK6B.js → chunk-SQ2CHM4O.js} +1 -1
  48. package/Marketplace/{chunk-7WOQFYPC.js → chunk-T4QOCA2D.js} +1 -1
  49. package/Marketplace/{chunk-HK3HPBO6.js → chunk-TLUQ2PZZ.js} +1 -1
  50. package/Marketplace/{chunk-4WJK345L.js → chunk-TSRBKKHH.js} +1 -1
  51. package/Marketplace/{chunk-XP4L6ZIN.js → chunk-UP43N4BA.js} +1 -1
  52. package/Marketplace/{chunk-WYCTV5VQ.js → chunk-VGQHO3VI.js} +1 -1
  53. package/Marketplace/{chunk-UW3QQ7BU.js → chunk-VYT5DCV2.js} +1 -1
  54. package/Marketplace/{chunk-6NVZHDBR.js → chunk-XHR66HQG.js} +1 -1
  55. package/Marketplace/{chunk-ZYM7WJMC.js → chunk-XQJASAXB.js} +1 -1
  56. package/Marketplace/{chunk-Z55JNCKA.js → chunk-YORF6A5L.js} +1 -1
  57. package/Marketplace/{chunk-RLJV7KPA.js → chunk-ZL7W57ZN.js} +1 -1
  58. package/Marketplace/{chunk-OO3IAMEH.js → chunk-ZTWCZPYL.js} +1 -1
  59. package/Marketplace/index.html +2 -2
  60. package/Marketplace/{main-47GB3QAH.js → main-64N5H5LM.js} +2 -2
  61. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{a as Ot}from"./chunk-W2AILV7A.js";import"./chunk-GK6WYUPQ.js";import"./chunk-WXZ5XRM6.js";import{a as yt,b as Tt}from"./chunk-BDUUVK5L.js";import"./chunk-L2ENNT5V.js";import{a as It}from"./chunk-CJTVOKLJ.js";import{a as wt}from"./chunk-OJ4GCASY.js";import"./chunk-RVHJIVQ5.js";import{a as ht}from"./chunk-MKENTZJA.js";import{a as Ct}from"./chunk-V3PUPGL5.js";import{c as gt,e as bt,g as vt}from"./chunk-2SCD4QZY.js";import{a as mt,d as _t,e as ft,i as xt}from"./chunk-K227XGG2.js";import"./chunk-PRLMMKRO.js";import"./chunk-MMGI42DQ.js";import"./chunk-2QRSAAJG.js";import{a as U}from"./chunk-ACIMXBIC.js";import"./chunk-3ANHDTTL.js";import"./chunk-YYY663CV.js";import{b as tt,c as ct,e as ie,f as dt}from"./chunk-N77J6LFN.js";import{e as ut}from"./chunk-TRTDBHQI.js";import{a as pt,b as st}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import"./chunk-MWUZF6ZW.js";import{Aa as lt,V as Te,Y as te,Z as q,_ as H,aa as Oe,oa as it,ra as nt,sa as ue,ta as ot,v as de,w as P}from"./chunk-2VWSIT3Y.js";import"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import{h as et}from"./chunk-KMEVPGD4.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import{a as we}from"./chunk-FDTKJPLI.js";import"./chunk-I4MUFYEG.js";import"./chunk-NNVT5X6O.js";import{A as G,a as at,c as rt,h as me,m as he}from"./chunk-P6BSXX22.js";import{c as Ye}from"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{e as ce}from"./chunk-M5YUVUTR.js";import"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{D as Xe,F as se,r as re,t as je,u as We,x as Ze,y as Je,z as pe}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{$c as Ge,Ca as S,Cc as ze,Da as ke,Dc as Ne,Eb as D,Ec as C,Fb as Le,Fc as v,Ga as w,Hd as y,Ib as Be,Id as N,Ja as Ae,Jb as Fe,Jc as ve,Ka as Pe,Kb as h,Kc as Re,Mc as le,Na as De,Nc as b,Oc as f,Pc as X,Qc as A,Rc as qe,Sc as K,Tc as $,Uc as z,V as Se,Vc as He,Xb as I,aa as j,ad as Qe,bc as Z,bd as V,cd as ae,dc as J,dd as Ie,e as be,ec as Ue,gc as Ke,ha as Ve,hc as $e,ia as ne,ic as p,ja as Me,jc as c,kb as oe,kc as d,kd as L,la as Ee,lc as T,ld as B,mb as s,na as O,o as Q,od as F,pc as E,qc as k,rc as M,sc as x,sd as R,t as xe,ua as u,va as m,vd as Y,wa as W,wd as ee,xb as Ce,xc as g,zc as a}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var St=`
1
+ import{a as Ot}from"./chunk-7T332QJG.js";import"./chunk-GK6WYUPQ.js";import"./chunk-WXZ5XRM6.js";import{a as yt,b as Tt}from"./chunk-BDUUVK5L.js";import"./chunk-L2ENNT5V.js";import{a as It}from"./chunk-CJTVOKLJ.js";import{a as wt}from"./chunk-OJ4GCASY.js";import"./chunk-RVHJIVQ5.js";import{a as ht}from"./chunk-MKENTZJA.js";import{a as Ct}from"./chunk-V3PUPGL5.js";import{c as gt,e as bt,g as vt}from"./chunk-2SCD4QZY.js";import{a as mt,d as _t,e as ft,i as xt}from"./chunk-K227XGG2.js";import"./chunk-PRLMMKRO.js";import"./chunk-MMGI42DQ.js";import"./chunk-2QRSAAJG.js";import{a as U}from"./chunk-ACIMXBIC.js";import"./chunk-3ANHDTTL.js";import"./chunk-YYY663CV.js";import{b as tt,c as ct,e as ie,f as dt}from"./chunk-N77J6LFN.js";import{e as ut}from"./chunk-TRTDBHQI.js";import{a as pt,b as st}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import"./chunk-MWUZF6ZW.js";import{Aa as lt,V as Te,Y as te,Z as q,_ as H,aa as Oe,oa as it,ra as nt,sa as ue,ta as ot,v as de,w as P}from"./chunk-2VWSIT3Y.js";import"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import{h as et}from"./chunk-GQRBV5VY.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import{a as we}from"./chunk-FDTKJPLI.js";import"./chunk-I4MUFYEG.js";import"./chunk-NNVT5X6O.js";import{A as G,a as at,c as rt,h as me,m as he}from"./chunk-P6BSXX22.js";import{c as Ye}from"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{e as ce}from"./chunk-M5YUVUTR.js";import"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{D as Xe,F as se,r as re,t as je,u as We,x as Ze,y as Je,z as pe}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{$c as Ge,Ca as S,Cc as ze,Da as ke,Dc as Ne,Eb as D,Ec as C,Fb as Le,Fc as v,Ga as w,Hd as y,Ib as Be,Id as N,Ja as Ae,Jb as Fe,Jc as ve,Ka as Pe,Kb as h,Kc as Re,Mc as le,Na as De,Nc as b,Oc as f,Pc as X,Qc as A,Rc as qe,Sc as K,Tc as $,Uc as z,V as Se,Vc as He,Xb as I,aa as j,ad as Qe,bc as Z,bd as V,cd as ae,dc as J,dd as Ie,e as be,ec as Ue,gc as Ke,ha as Ve,hc as $e,ia as ne,ic as p,ja as Me,jc as c,kb as oe,kc as d,kd as L,la as Ee,lc as T,ld as B,mb as s,na as O,o as Q,od as F,pc as E,qc as k,rc as M,sc as x,sd as R,t as xe,ua as u,va as m,vd as Y,wa as W,wd as ee,xb as Ce,xc as g,zc as a}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var St=`
2
2
  .p-autocomplete {
3
3
  display: inline-flex;
4
4
  }
@@ -1 +1 @@
1
- import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-XDRKSCAR.js").then(t=>t.LoginComponent)},data:{title:"Dealpos x Marketplace"}},{path:"shopee",loadComponent(){return import("./chunk-IR2SK4HW.js").then(t=>t.ShopeeAuthorizedComponent)},data:{title:"Success"}},{path:"tiktok",loadComponent(){return import("./chunk-XYZ53LBF.js").then(t=>t.TiktokComponent)},data:{title:"Success"}},{path:"lazada",loadComponent(){return import("./chunk-I7CNRYKA.js").then(t=>t.LazadaComponent)},data:{title:"Success"}},{path:"shopify",loadComponent(){return import("./chunk-VRASOOOY.js").then(t=>t.ShopifyAuthorizedComponent)},data:{title:"Success"}}];export{o as routes};
1
+ import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-7BKOVVHP.js").then(t=>t.LoginComponent)},data:{title:"Dealpos x Marketplace"}},{path:"shopee",loadComponent(){return import("./chunk-IR2SK4HW.js").then(t=>t.ShopeeAuthorizedComponent)},data:{title:"Success"}},{path:"tiktok",loadComponent(){return import("./chunk-XYZ53LBF.js").then(t=>t.TiktokComponent)},data:{title:"Success"}},{path:"lazada",loadComponent(){return import("./chunk-I7CNRYKA.js").then(t=>t.LazadaComponent)},data:{title:"Success"}},{path:"shopify",loadComponent(){return import("./chunk-VRASOOOY.js").then(t=>t.ShopifyAuthorizedComponent)},data:{title:"Success"}}];export{o as routes};
@@ -1 +1 @@
1
- import{a as ne}from"./chunk-ODLKDM5E.js";import{a as te}from"./chunk-7OQSPY2H.js";import{a as ee}from"./chunk-4MYXPN55.js";import"./chunk-HH4B5NMB.js";import"./chunk-DBO3A6IW.js";import{a as $}from"./chunk-OJ4GCASY.js";import"./chunk-ACIMXBIC.js";import{a as X,b as Y,d as Z}from"./chunk-TRTDBHQI.js";import{b as Q}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import"./chunk-MWUZF6ZW.js";import"./chunk-GF2RVIIT.js";import"./chunk-ITKXL7DT.js";import"./chunk-4AL6NJY5.js";import"./chunk-YOYMZEPB.js";import"./chunk-56UGSRXX.js";import"./chunk-UB22GZAR.js";import"./chunk-F7RHG53H.js";import"./chunk-X22WXNSF.js";import"./chunk-P6EDV7BS.js";import"./chunk-TVKTNDDY.js";import"./chunk-DGB7L5EQ.js";import"./chunk-7YP3O2JY.js";import"./chunk-BKB3Y5UC.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2PONPJQD.js";import"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import{h as U}from"./chunk-KMEVPGD4.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import"./chunk-I4MUFYEG.js";import"./chunk-NNVT5X6O.js";import{A as J,c as W,h as j,m as q,o as K}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{e as H}from"./chunk-M5YUVUTR.js";import{e as B}from"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{B as V}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{Eb as T,Ga as s,Kb as L,Lc as P,Oc as p,Pc as h,Qc as S,Sc as R,Tc as k,Uc as F,ad as O,bc as M,bd as z,dc as N,fc as x,gc as E,hc as w,ic as d,jc as t,kb as I,kc as n,kd as A,lc as C,mb as m,md as G,na as v,sc as D,ua as y,va as b,xc as g,zc as f}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{a as u,b as _}from"./chunk-66YHNWRR.js";var ie=()=>["/menu/log/inventory/sync-inventory/detail"],oe=a=>({ID:a});function ae(a,c){if(a&1&&(t(0,"span",19),C(1,"img",20),n(),p(2)),a&2){let e=c.item;m(),d("src",e.Img,I)("alt",e.Name),m(),S(" ",e.Name," ")}}function re(a,c){if(a&1&&(t(0,"tr")(1,"td")(2,"a",25),p(3),A(4,"date"),n()(),t(5,"td"),p(6),n(),t(7,"td"),p(8),n(),t(9,"td"),p(10),n(),t(11,"td"),p(12),n()()),a&2){let e=c.$implicit;P("bg-gradient-warning",e.ResponseCode==400),m(2),d("routerLink",O(12,ie))("queryParams",z(13,oe,e.ID)),m(),S(" ",G(4,9,e.Created,"dd MMM yyyy HH:mm")," "),m(3),h(e.channelName),m(2),h(e.Sku),m(2),h(e.Stock),m(2),h(e.ResponseCode)}}function le(a,c){if(a&1){let e=D();t(0,"div",17)(1,"table",21)(2,"thead")(3,"tr",22)(4,"th"),p(5,"Created"),n(),t(6,"th"),p(7,"Channel"),n(),t(8,"th"),p(9,"SKU"),n(),t(10,"th"),p(11,"Stock"),n(),t(12,"th"),p(13,"Response code"),n()()(),t(14,"tbody"),E(15,re,13,15,"tr",23,x),n()(),t(17,"mat-paginator",24),g("page",function(i){y(e);let o=f();return b(o.changePage(i))}),n()()}if(a&2){let e=f();m(15),w(e.Result()),m(2),d("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function me(a,c){a&1&&(t(0,"div",18),C(1,"app-empty-state"),n())}var Me=(()=>{class a{constructor(){this.http=v(H),this._RawLogService=v(ne),this.authService=v(U),this.Result=s([]),this.filter=s({PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""}),this.ActionTypeList=s(null),this.paginationTotal=s(0),this.paginationPageSize=s(0),this.channelOptions=s(this.authService.getChannels()),this.Number=s(null),this.Load()}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(e=>{this.filter.update(r=>u(u({},r),e.Filter)),this.ActionTypeList.set(e.Options.ActionTypeList),this.Get()})}Get(e){e!=null&&this.filter.update(r=>_(u({},r),{Sku:e})),this.http.post("api/Inventory/GetLog",this.filter()).subscribe(r=>{this._RawLogService.Data=r.hits;let i=[];for(let o of r.hits){let l={ID:o._source.log.id,Created:o._source["@timestamp_received"],channelName:o._source.log.channelName,Sku:o._source.log.sku,Stock:o._source.log.stock,ResponseCode:o._source.log.responseCode};i.push(l)}this.Result.set(i),this.paginationTotal.set(r.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)})}changePage(e){this.filter.update(r=>_(u({},r),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,r){this.filter.update(i=>_(u({},i),{[e]:r}))}static{this.\u0275fac=function(r){return new(r||a)}}static{this.\u0275cmp=T({type:a,selectors:[["app-inventory-log"]],decls:32,vars:9,consts:[["headerTitle","Channel Inventory Sync","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-success"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[3,"bg-gradient-warning"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"]],template:function(r,i){if(r&1&&(t(0,"mainpanel",0),F("textChange",function(l){return k(i.filter().Sku,l)||(i.filter().Sku=l),l}),g("onSubmit",function(l){return i.Get(l)}),t(1,"actions")(2,"a",1),p(3," Order Inventory Sync Job "),n()(),t(4,"filters")(5,"div",2)(6,"div")(7,"label",3),p(8,"Channel"),n(),t(9,"ng-select",4),g("ngModelChange",function(l){return i.updateFilter("ChannelID",l)}),L(10,ae,3,3,"ng-template",5),n()(),t(11,"div",6)(12,"label",7),p(13,"From/To"),n(),t(14,"div",8)(15,"datepicker",9),g("dateChange",function(l){return i.updateFilter("From",l)}),n()(),t(16,"div")(17,"datepicker",10),g("dateChange",function(l){return i.updateFilter("To",l)}),n()()(),t(18,"div",6)(19,"label",11),p(20,"Page Number"),n(),t(21,"input",12),g("ngModelChange",function(l){return i.updateFilter("PageNumber",l)}),n()(),t(22,"div",6)(23,"label",11),p(24,"Page Size"),n(),t(25,"input",13),g("ngModelChange",function(l){return i.updateFilter("RowCount",l)}),n()()()(),t(26,"content")(27,"div",14)(28,"div",15)(29,"div",16),M(30,le,18,3,"div",17)(31,me,2,0,"div",18),n()()()()()),r&2){let o;R("text",i.filter().Sku),m(9),d("clearable",!0)("items",i.channelOptions())("ngModel",i.filter().ChannelID),m(6),d("date",i.filter().From),m(2),d("date",i.filter().To),m(4),d("ngModel",i.filter().PageNumber),m(4),d("ngModel",i.filter().RowCount),m(5),N(((o=i.Result())==null?null:o.length)>0?30:31)}},dependencies:[Q,B,Z,J,W,K,j,q,X,Y,ee,te,$,V],encapsulation:2})}}return a})();export{Me as InventoryLogComponent};
1
+ import{a as ne}from"./chunk-ODLKDM5E.js";import{a as te}from"./chunk-7OQSPY2H.js";import{a as ee}from"./chunk-4MYXPN55.js";import"./chunk-HH4B5NMB.js";import"./chunk-DBO3A6IW.js";import{a as $}from"./chunk-OJ4GCASY.js";import"./chunk-ACIMXBIC.js";import{a as X,b as Y,d as Z}from"./chunk-TRTDBHQI.js";import{b as Q}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import"./chunk-MWUZF6ZW.js";import"./chunk-GF2RVIIT.js";import"./chunk-ITKXL7DT.js";import"./chunk-4AL6NJY5.js";import"./chunk-YOYMZEPB.js";import"./chunk-56UGSRXX.js";import"./chunk-UB22GZAR.js";import"./chunk-F7RHG53H.js";import"./chunk-X22WXNSF.js";import"./chunk-P6EDV7BS.js";import"./chunk-TVKTNDDY.js";import"./chunk-DGB7L5EQ.js";import"./chunk-7YP3O2JY.js";import"./chunk-BKB3Y5UC.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2PONPJQD.js";import"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import{h as U}from"./chunk-GQRBV5VY.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import"./chunk-I4MUFYEG.js";import"./chunk-NNVT5X6O.js";import{A as J,c as W,h as j,m as q,o as K}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{e as H}from"./chunk-M5YUVUTR.js";import{e as B}from"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{B as V}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{Eb as T,Ga as s,Kb as L,Lc as P,Oc as p,Pc as h,Qc as S,Sc as R,Tc as k,Uc as F,ad as O,bc as M,bd as z,dc as N,fc as x,gc as E,hc as w,ic as d,jc as t,kb as I,kc as n,kd as A,lc as C,mb as m,md as G,na as v,sc as D,ua as y,va as b,xc as g,zc as f}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{a as u,b as _}from"./chunk-66YHNWRR.js";var ie=()=>["/menu/log/inventory/sync-inventory/detail"],oe=a=>({ID:a});function ae(a,c){if(a&1&&(t(0,"span",19),C(1,"img",20),n(),p(2)),a&2){let e=c.item;m(),d("src",e.Img,I)("alt",e.Name),m(),S(" ",e.Name," ")}}function re(a,c){if(a&1&&(t(0,"tr")(1,"td")(2,"a",25),p(3),A(4,"date"),n()(),t(5,"td"),p(6),n(),t(7,"td"),p(8),n(),t(9,"td"),p(10),n(),t(11,"td"),p(12),n()()),a&2){let e=c.$implicit;P("bg-gradient-warning",e.ResponseCode==400),m(2),d("routerLink",O(12,ie))("queryParams",z(13,oe,e.ID)),m(),S(" ",G(4,9,e.Created,"dd MMM yyyy HH:mm")," "),m(3),h(e.channelName),m(2),h(e.Sku),m(2),h(e.Stock),m(2),h(e.ResponseCode)}}function le(a,c){if(a&1){let e=D();t(0,"div",17)(1,"table",21)(2,"thead")(3,"tr",22)(4,"th"),p(5,"Created"),n(),t(6,"th"),p(7,"Channel"),n(),t(8,"th"),p(9,"SKU"),n(),t(10,"th"),p(11,"Stock"),n(),t(12,"th"),p(13,"Response code"),n()()(),t(14,"tbody"),E(15,re,13,15,"tr",23,x),n()(),t(17,"mat-paginator",24),g("page",function(i){y(e);let o=f();return b(o.changePage(i))}),n()()}if(a&2){let e=f();m(15),w(e.Result()),m(2),d("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function me(a,c){a&1&&(t(0,"div",18),C(1,"app-empty-state"),n())}var Me=(()=>{class a{constructor(){this.http=v(H),this._RawLogService=v(ne),this.authService=v(U),this.Result=s([]),this.filter=s({PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""}),this.ActionTypeList=s(null),this.paginationTotal=s(0),this.paginationPageSize=s(0),this.channelOptions=s(this.authService.getChannels()),this.Number=s(null),this.Load()}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(e=>{this.filter.update(r=>u(u({},r),e.Filter)),this.ActionTypeList.set(e.Options.ActionTypeList),this.Get()})}Get(e){e!=null&&this.filter.update(r=>_(u({},r),{Sku:e})),this.http.post("api/Inventory/GetLog",this.filter()).subscribe(r=>{this._RawLogService.Data=r.hits;let i=[];for(let o of r.hits){let l={ID:o._source.log.id,Created:o._source["@timestamp_received"],channelName:o._source.log.channelName,Sku:o._source.log.sku,Stock:o._source.log.stock,ResponseCode:o._source.log.responseCode};i.push(l)}this.Result.set(i),this.paginationTotal.set(r.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)})}changePage(e){this.filter.update(r=>_(u({},r),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,r){this.filter.update(i=>_(u({},i),{[e]:r}))}static{this.\u0275fac=function(r){return new(r||a)}}static{this.\u0275cmp=T({type:a,selectors:[["app-inventory-log"]],decls:32,vars:9,consts:[["headerTitle","Channel Inventory Sync","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-success"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[3,"bg-gradient-warning"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"]],template:function(r,i){if(r&1&&(t(0,"mainpanel",0),F("textChange",function(l){return k(i.filter().Sku,l)||(i.filter().Sku=l),l}),g("onSubmit",function(l){return i.Get(l)}),t(1,"actions")(2,"a",1),p(3," Order Inventory Sync Job "),n()(),t(4,"filters")(5,"div",2)(6,"div")(7,"label",3),p(8,"Channel"),n(),t(9,"ng-select",4),g("ngModelChange",function(l){return i.updateFilter("ChannelID",l)}),L(10,ae,3,3,"ng-template",5),n()(),t(11,"div",6)(12,"label",7),p(13,"From/To"),n(),t(14,"div",8)(15,"datepicker",9),g("dateChange",function(l){return i.updateFilter("From",l)}),n()(),t(16,"div")(17,"datepicker",10),g("dateChange",function(l){return i.updateFilter("To",l)}),n()()(),t(18,"div",6)(19,"label",11),p(20,"Page Number"),n(),t(21,"input",12),g("ngModelChange",function(l){return i.updateFilter("PageNumber",l)}),n()(),t(22,"div",6)(23,"label",11),p(24,"Page Size"),n(),t(25,"input",13),g("ngModelChange",function(l){return i.updateFilter("RowCount",l)}),n()()()(),t(26,"content")(27,"div",14)(28,"div",15)(29,"div",16),M(30,le,18,3,"div",17)(31,me,2,0,"div",18),n()()()()()),r&2){let o;R("text",i.filter().Sku),m(9),d("clearable",!0)("items",i.channelOptions())("ngModel",i.filter().ChannelID),m(6),d("date",i.filter().From),m(2),d("date",i.filter().To),m(4),d("ngModel",i.filter().PageNumber),m(4),d("ngModel",i.filter().RowCount),m(5),N(((o=i.Result())==null?null:o.length)>0?30:31)}},dependencies:[Q,B,Z,J,W,K,j,q,X,Y,ee,te,$,V],encapsulation:2})}}return a})();export{Me as InventoryLogComponent};
@@ -1 +1 @@
1
- import{a as he,b as de}from"./chunk-OO4HXSYZ.js";import"./chunk-ES53NVZX.js";import{a as ue}from"./chunk-JUQXSH2K.js";import"./chunk-YCWTJUQA.js";import{a as N}from"./chunk-ISMIPSYN.js";import{c as me,d as O,e as E}from"./chunk-6FXTADPI.js";import"./chunk-MPZOVHE7.js";import"./chunk-ZPW7UOIC.js";import"./chunk-BDUUVK5L.js";import"./chunk-L2ENNT5V.js";import"./chunk-A2K3CDHY.js";import{c as ce,d as pe}from"./chunk-45IJOZB6.js";import"./chunk-4YZPQBFT.js";import"./chunk-IFFI5CMD.js";import"./chunk-K6KO37S2.js";import"./chunk-DBO3A6IW.js";import"./chunk-CJTVOKLJ.js";import{a as se}from"./chunk-NLKDWUN2.js";import"./chunk-V3PUPGL5.js";import"./chunk-2SCD4QZY.js";import"./chunk-K227XGG2.js";import"./chunk-PRLMMKRO.js";import"./chunk-MMGI42DQ.js";import"./chunk-2QRSAAJG.js";import"./chunk-JLY2L5QD.js";import"./chunk-ACIMXBIC.js";import"./chunk-YYY663CV.js";import"./chunk-N77J6LFN.js";import{e as le}from"./chunk-TRTDBHQI.js";import{a as ae,b as re}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import{c as oe}from"./chunk-M65GNQVQ.js";import"./chunk-MWUZF6ZW.js";import"./chunk-F7RHG53H.js";import"./chunk-X22WXNSF.js";import"./chunk-P6EDV7BS.js";import"./chunk-TVKTNDDY.js";import"./chunk-DGB7L5EQ.js";import"./chunk-7YP3O2JY.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2VWSIT3Y.js";import"./chunk-2PONPJQD.js";import"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import{a as Y}from"./chunk-ZSUWHVKX.js";import{h as D}from"./chunk-KMEVPGD4.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import{a as V}from"./chunk-FDTKJPLI.js";import{b as W,c as X}from"./chunk-I4MUFYEG.js";import{c as v}from"./chunk-NNVT5X6O.js";import{A as ie,c as Z,h as ee,m as te,o as ne}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{b as Q,e as J}from"./chunk-M5YUVUTR.js";import"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{z as K}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{$c as j,E as R,Eb as B,Ga as _,Kb as k,Oc as y,Vc as $,aa as x,bc as w,bd as z,dc as F,ia as U,ic as u,jc as s,kc as d,kd as I,lc as A,ld as b,mb as m,na as c,pc as H,qc as G,sc as M,sd as q,ua as p,va as h,xc as C,zc as g}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{a as S,b as f}from"./chunk-66YHNWRR.js";var L=(()=>{class r{constructor(){this.authService=c(D),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(e,o){let t=Object.assign([],this.channelOptions),i=[],a;return e.forEach(n=>{a=t.find(l=>l.ID==n?.parent?.id),a&&(a=f(S({},a),{Name:`${n?.parent?.label} - ${n?.label}`,LocationID:n?.id}),i.push(a))}),o.forEach(n=>{a=t.find(l=>l.ID==n.id),a&&i.push(a)}),i}generateFilterLocation(e,o){let t=[],i=[],a=[];return e.length>0?(t=e.map(n=>n.id),i=e.filter(n=>v.IsNotEmpty(n?.parent?.id)).map(n=>n?.parent?.id).filter((n,l,T)=>T.indexOf(n)===l)):(t=[],i=[]),a=o.map(n=>n.id),a=a.concat(i).filter((n,l,T)=>T.indexOf(n)===l),{locationIds:t,channelIds:a}}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275prov=U({token:r,factory:r.\u0275fac})}}return r})();var ge=r=>[r];function Se(r,P){if(r&1){let e=M();s(0,"button",17),C("click",function(){p(e);let t=g(2),i=g();return h(i.onUpdateItems(t))}),A(1,"i",18),y(2," Update "),d()}}function fe(r,P){if(r&1&&(H(0),w(1,Se,3,0,"button",16),G()),r&2){let e=g(),o=g();m(),F(o.productService.hasSelectionVariant(e)?1:-1)}}function _e(r,P){if(r&1&&(s(0,"actions")(1,"div",14),k(2,fe,2,1,"ng-container",15),d()()),r&2){let e=g();m(2),u("ngxPermissionsOnly",z(1,ge,e.inventoryUpdateRole))}}function ve(r,P){if(r&1){let e=M();s(0,"app-table",19),C("onToggle",function(t){p(e);let i=g();return h(i.onShowDifferenceStock(t))})("onSubmit",function(t){p(e);let i=g();return h(i.updateStockByVariant(t))}),d()}if(r&2){let e=g();u("data",P)("channel",e.channels())("showProductToggle",!0)("hiddenIPOSInventory",e.hiddenIPOSInventory())}}var ot=(()=>{class r{constructor(){this.http=c(J),this.toastr=c(Q),this.dialog=c(oe),this.productService=c(se),this.authService=c(D),this.mainPanelService=c(ae),this.placeholderService=c(ce),this.paginationService=c(O),this.multiChannelService=c(L),this.updateResHandling=c(E),this.hiddenIPOSInventory=q(()=>this.paginationService.hiddenPOSInventory()),this.searchFilter=_({PageNumber:1,RowCount:100}),this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=_([]),this.selectedChannels=_([]),this.channels=_([]),this.inventoryUpdateRole=Y.InventoryUpdate,this.searchPlaceholder=_("Search ..."),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(x(e=>{e.Filter={PageNumber:e.Filter.PageNumber,filterModel:N.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory,SearchType:e.Filter.SearchType,NumberFilterComparator:e.Filter.NumberFilterComparator},this.searchFilter.set(e.Filter),this.initSearchPlaceholder(),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){let e=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(e.SearchType,e.NumberFilterComparator))}onChannelChange(e=[]){let o=e.filter(i=>v.isValidGUID(i.id)==!1),t=e.filter(i=>v.isValidGUID(i.id));this.selectedLocations.set(o),this.selectedChannels.set(t)}onSearch(e){let o=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(o);let t=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.update(i=>f(S({},i),{ListChannelID:t.channelIds,ListLocationID:t.locationIds,text:e})),this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter())}updateStock(e,o){if(e.length>0){let t=[];e.forEach(n=>{n.Channel?.forEach(l=>{t.push({ChannelItemID:l?.ChannelItemID,ChannelVariationID:l?.ChannelVariationID,Inventory:n.Inventory,LocationID:l?.LocationID})})});let a={ListChannelID:o.filter(n=>n.selected).map(n=>n.ID),List:t};this.http.post(V.UpdateInventoryChannel,a).subscribe(n=>{this.paginationService.reloadPagination(this.searchFilter());for(let l=0;l<n?.length;l++)this.handlingUpdateStock(n[l])})}}updateStockByVariant(e){let o=e.InventoryMultiwarehouse[0]?.LocationID,t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:e.Inventory,VariantID:e.ID,SKU:e?.Sku,LocationID:o};this.http.post(V.UpdateUpdateQuantityByItem,t).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter()),this.handlingUpdateStock(i)})}handlingUpdateStock(e){if(e){let o=e?.Response?.Fail_list,t=e?.Response?.Success_list;this.updateResHandling.responseHandling(t,o,"Stock")}else this.toastr.error(e?.Exception,"Error")}onShowDifferenceStock(e){this.searchFilter.update(o=>f(S({},o),{filterModel:e?N.DIFFERENCE:N.ALL})),this.paginationService.reloadPagination(this.searchFilter())}onUpdateItems(e){let o=this.productService.selectedVariantProduct(e),t=this.channelOptions.filter(i=>this.channels()?.find(a=>a.ID===i.ID));this.dialog.open(he,{data:{selectedItems:o,channels:JSON.parse(JSON.stringify(t))},width:"400px"}).afterClosed().pipe(R(i=>v.IsNotEmpty(i))).subscribe(i=>{this.updateStock(o,i)})}updateSearchFilter(e,o){this.searchFilter.update(t=>f(S({},t),{[e]:o}))}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=B({type:r,selectors:[["app-multi-channel-comparison"]],features:[j([O,L,E])],decls:28,vars:25,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"mb-5"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(o,t){if(o&1){let i=M();s(0,"mainpanel",0),C("onSubmit",function(n){return p(i),h(t.onSearch(n))}),w(1,_e,3,3,"actions"),I(2,"async"),s(3,"filters"),$(4),I(5,"async"),s(6,"div",1)(7,"label",2),y(8,"Channel"),d(),s(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(n){return p(i),h(t.onChannelChange(n))}),d()(),s(10,"div",1)(11,"filter-query-type",4),C("numberFilterComparatorChange",function(n){return p(i),h(t.updateSearchFilter("NumberFilterComparator",n))})("searchTypeChange",function(n){return p(i),h(t.updateSearchFilter("SearchType",n))}),d()(),s(12,"div",1)(13,"label",5),y(14,"PageNumber"),d(),s(15,"input",6),C("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("PageNumber",+n))}),d()(),s(16,"div")(17,"label",7),y(18,"Page Size"),d(),s(19,"input",8),C("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("RowCount",+n))}),d()()(),s(20,"content")(21,"div",9)(22,"div",10)(23,"div",11),w(24,ve,1,4,"app-table",12),I(25,"async"),s(26,"infinite-paginator",13),I(27,"async"),C("onNextPage",function(){return p(i),h(t.paginationService.onNextPage(t.searchFilter()))})("onLastPage",function(){return p(i),h(t.paginationService.onLastPage(t.searchFilter()))})("onGetRowCount",function(){return p(i),h(t.paginationService.getRowCount(t.searchFilter()))}),d()()()()()()}if(o&2){let i,a;u("hideSearchBox",!1)("searchBoxPlaceHolder",t.searchPlaceholder()),m(),F((i=b(2,17,t.paginationService.data$))?1:-1,i);let n=b(5,19,t.loader$);m(8),u("multiple",!0),m(2),u("numberFilterComparatorOptions",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions)("numberFilterComparator",t.searchFilter().NumberFilterComparator)("searchTypeOptions",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions)("searchType",t.searchFilter().SearchType),m(4),u("ngModel",t.searchFilter().PageNumber),m(4),u("ngModel",t.searchFilter().RowCount),m(5),F((a=b(25,21,t.paginationService.data$))?24:-1,a),m(2),u("totalData",t.paginationService.totalData())("hideCount",t.paginationService.hideCount())("rowCount",b(27,23,t.paginationService.totalRowCount$))("pageNumber",t.paginationService.pageNumber())("disableNextButton",t.paginationService.disableNextButton())("goToLastPage",t.paginationService.isLastPage())}},dependencies:[re,de,ie,Z,ne,ee,te,me,ue,X,W,le,pe,K],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"],changeDetection:0})}}return r})();export{ot as MultiChannelComparison};
1
+ import{a as he,b as de}from"./chunk-NCKMPECJ.js";import"./chunk-ES53NVZX.js";import{a as ue}from"./chunk-JUQXSH2K.js";import"./chunk-YCWTJUQA.js";import{a as N}from"./chunk-ISMIPSYN.js";import{c as me,d as O,e as E}from"./chunk-6FXTADPI.js";import"./chunk-MPZOVHE7.js";import"./chunk-ZPW7UOIC.js";import"./chunk-BDUUVK5L.js";import"./chunk-L2ENNT5V.js";import"./chunk-A2K3CDHY.js";import{c as ce,d as pe}from"./chunk-45IJOZB6.js";import"./chunk-4YZPQBFT.js";import"./chunk-IFFI5CMD.js";import"./chunk-K6KO37S2.js";import"./chunk-DBO3A6IW.js";import"./chunk-CJTVOKLJ.js";import{a as se}from"./chunk-BL3IBVPU.js";import"./chunk-V3PUPGL5.js";import"./chunk-2SCD4QZY.js";import"./chunk-K227XGG2.js";import"./chunk-PRLMMKRO.js";import"./chunk-MMGI42DQ.js";import"./chunk-2QRSAAJG.js";import"./chunk-NS3MK77F.js";import"./chunk-ACIMXBIC.js";import"./chunk-YYY663CV.js";import"./chunk-N77J6LFN.js";import{e as le}from"./chunk-TRTDBHQI.js";import{a as ae,b as re}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import{c as oe}from"./chunk-M65GNQVQ.js";import"./chunk-MWUZF6ZW.js";import"./chunk-F7RHG53H.js";import"./chunk-X22WXNSF.js";import"./chunk-P6EDV7BS.js";import"./chunk-TVKTNDDY.js";import"./chunk-DGB7L5EQ.js";import"./chunk-7YP3O2JY.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2VWSIT3Y.js";import"./chunk-2PONPJQD.js";import"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import{a as Y}from"./chunk-ZSUWHVKX.js";import{h as D}from"./chunk-GQRBV5VY.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import{a as V}from"./chunk-FDTKJPLI.js";import{b as W,c as X}from"./chunk-I4MUFYEG.js";import{c as v}from"./chunk-NNVT5X6O.js";import{A as ie,c as Z,h as ee,m as te,o as ne}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{b as Q,e as J}from"./chunk-M5YUVUTR.js";import"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{z as K}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{$c as j,E as R,Eb as B,Ga as _,Kb as k,Oc as y,Vc as $,aa as x,bc as w,bd as z,dc as F,ia as U,ic as u,jc as s,kc as d,kd as I,lc as A,ld as b,mb as m,na as c,pc as H,qc as G,sc as M,sd as q,ua as p,va as h,xc as C,zc as g}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{a as S,b as f}from"./chunk-66YHNWRR.js";var L=(()=>{class r{constructor(){this.authService=c(D),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(e,o){let t=Object.assign([],this.channelOptions),i=[],a;return e.forEach(n=>{a=t.find(l=>l.ID==n?.parent?.id),a&&(a=f(S({},a),{Name:`${n?.parent?.label} - ${n?.label}`,LocationID:n?.id}),i.push(a))}),o.forEach(n=>{a=t.find(l=>l.ID==n.id),a&&i.push(a)}),i}generateFilterLocation(e,o){let t=[],i=[],a=[];return e.length>0?(t=e.map(n=>n.id),i=e.filter(n=>v.IsNotEmpty(n?.parent?.id)).map(n=>n?.parent?.id).filter((n,l,T)=>T.indexOf(n)===l)):(t=[],i=[]),a=o.map(n=>n.id),a=a.concat(i).filter((n,l,T)=>T.indexOf(n)===l),{locationIds:t,channelIds:a}}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275prov=U({token:r,factory:r.\u0275fac})}}return r})();var ge=r=>[r];function Se(r,P){if(r&1){let e=M();s(0,"button",17),C("click",function(){p(e);let t=g(2),i=g();return h(i.onUpdateItems(t))}),A(1,"i",18),y(2," Update "),d()}}function fe(r,P){if(r&1&&(H(0),w(1,Se,3,0,"button",16),G()),r&2){let e=g(),o=g();m(),F(o.productService.hasSelectionVariant(e)?1:-1)}}function _e(r,P){if(r&1&&(s(0,"actions")(1,"div",14),k(2,fe,2,1,"ng-container",15),d()()),r&2){let e=g();m(2),u("ngxPermissionsOnly",z(1,ge,e.inventoryUpdateRole))}}function ve(r,P){if(r&1){let e=M();s(0,"app-table",19),C("onToggle",function(t){p(e);let i=g();return h(i.onShowDifferenceStock(t))})("onSubmit",function(t){p(e);let i=g();return h(i.updateStockByVariant(t))}),d()}if(r&2){let e=g();u("data",P)("channel",e.channels())("showProductToggle",!0)("hiddenIPOSInventory",e.hiddenIPOSInventory())}}var ot=(()=>{class r{constructor(){this.http=c(J),this.toastr=c(Q),this.dialog=c(oe),this.productService=c(se),this.authService=c(D),this.mainPanelService=c(ae),this.placeholderService=c(ce),this.paginationService=c(O),this.multiChannelService=c(L),this.updateResHandling=c(E),this.hiddenIPOSInventory=q(()=>this.paginationService.hiddenPOSInventory()),this.searchFilter=_({PageNumber:1,RowCount:100}),this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=_([]),this.selectedChannels=_([]),this.channels=_([]),this.inventoryUpdateRole=Y.InventoryUpdate,this.searchPlaceholder=_("Search ..."),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(x(e=>{e.Filter={PageNumber:e.Filter.PageNumber,filterModel:N.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory,SearchType:e.Filter.SearchType,NumberFilterComparator:e.Filter.NumberFilterComparator},this.searchFilter.set(e.Filter),this.initSearchPlaceholder(),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){let e=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(e.SearchType,e.NumberFilterComparator))}onChannelChange(e=[]){let o=e.filter(i=>v.isValidGUID(i.id)==!1),t=e.filter(i=>v.isValidGUID(i.id));this.selectedLocations.set(o),this.selectedChannels.set(t)}onSearch(e){let o=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(o);let t=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.update(i=>f(S({},i),{ListChannelID:t.channelIds,ListLocationID:t.locationIds,text:e})),this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter())}updateStock(e,o){if(e.length>0){let t=[];e.forEach(n=>{n.Channel?.forEach(l=>{t.push({ChannelItemID:l?.ChannelItemID,ChannelVariationID:l?.ChannelVariationID,Inventory:n.Inventory,LocationID:l?.LocationID})})});let a={ListChannelID:o.filter(n=>n.selected).map(n=>n.ID),List:t};this.http.post(V.UpdateInventoryChannel,a).subscribe(n=>{this.paginationService.reloadPagination(this.searchFilter());for(let l=0;l<n?.length;l++)this.handlingUpdateStock(n[l])})}}updateStockByVariant(e){let o=e.InventoryMultiwarehouse[0]?.LocationID,t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:e.Inventory,VariantID:e.ID,SKU:e?.Sku,LocationID:o};this.http.post(V.UpdateUpdateQuantityByItem,t).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter()),this.handlingUpdateStock(i)})}handlingUpdateStock(e){if(e){let o=e?.Response?.Fail_list,t=e?.Response?.Success_list;this.updateResHandling.responseHandling(t,o,"Stock")}else this.toastr.error(e?.Exception,"Error")}onShowDifferenceStock(e){this.searchFilter.update(o=>f(S({},o),{filterModel:e?N.DIFFERENCE:N.ALL})),this.paginationService.reloadPagination(this.searchFilter())}onUpdateItems(e){let o=this.productService.selectedVariantProduct(e),t=this.channelOptions.filter(i=>this.channels()?.find(a=>a.ID===i.ID));this.dialog.open(he,{data:{selectedItems:o,channels:JSON.parse(JSON.stringify(t))},width:"400px"}).afterClosed().pipe(R(i=>v.IsNotEmpty(i))).subscribe(i=>{this.updateStock(o,i)})}updateSearchFilter(e,o){this.searchFilter.update(t=>f(S({},t),{[e]:o}))}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=B({type:r,selectors:[["app-multi-channel-comparison"]],features:[j([O,L,E])],decls:28,vars:25,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"mb-5"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(o,t){if(o&1){let i=M();s(0,"mainpanel",0),C("onSubmit",function(n){return p(i),h(t.onSearch(n))}),w(1,_e,3,3,"actions"),I(2,"async"),s(3,"filters"),$(4),I(5,"async"),s(6,"div",1)(7,"label",2),y(8,"Channel"),d(),s(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(n){return p(i),h(t.onChannelChange(n))}),d()(),s(10,"div",1)(11,"filter-query-type",4),C("numberFilterComparatorChange",function(n){return p(i),h(t.updateSearchFilter("NumberFilterComparator",n))})("searchTypeChange",function(n){return p(i),h(t.updateSearchFilter("SearchType",n))}),d()(),s(12,"div",1)(13,"label",5),y(14,"PageNumber"),d(),s(15,"input",6),C("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("PageNumber",+n))}),d()(),s(16,"div")(17,"label",7),y(18,"Page Size"),d(),s(19,"input",8),C("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("RowCount",+n))}),d()()(),s(20,"content")(21,"div",9)(22,"div",10)(23,"div",11),w(24,ve,1,4,"app-table",12),I(25,"async"),s(26,"infinite-paginator",13),I(27,"async"),C("onNextPage",function(){return p(i),h(t.paginationService.onNextPage(t.searchFilter()))})("onLastPage",function(){return p(i),h(t.paginationService.onLastPage(t.searchFilter()))})("onGetRowCount",function(){return p(i),h(t.paginationService.getRowCount(t.searchFilter()))}),d()()()()()()}if(o&2){let i,a;u("hideSearchBox",!1)("searchBoxPlaceHolder",t.searchPlaceholder()),m(),F((i=b(2,17,t.paginationService.data$))?1:-1,i);let n=b(5,19,t.loader$);m(8),u("multiple",!0),m(2),u("numberFilterComparatorOptions",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions)("numberFilterComparator",t.searchFilter().NumberFilterComparator)("searchTypeOptions",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions)("searchType",t.searchFilter().SearchType),m(4),u("ngModel",t.searchFilter().PageNumber),m(4),u("ngModel",t.searchFilter().RowCount),m(5),F((a=b(25,21,t.paginationService.data$))?24:-1,a),m(2),u("totalData",t.paginationService.totalData())("hideCount",t.paginationService.hideCount())("rowCount",b(27,23,t.paginationService.totalRowCount$))("pageNumber",t.paginationService.pageNumber())("disableNextButton",t.paginationService.disableNextButton())("goToLastPage",t.paginationService.isLastPage())}},dependencies:[re,de,ie,Z,ne,ee,te,me,ue,X,W,le,pe,K],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"],changeDetection:0})}}return r})();export{ot as MultiChannelComparison};
@@ -1 +1 @@
1
- import{a as te,b as ne}from"./chunk-7OQSPY2H.js";import{a as ee}from"./chunk-4MYXPN55.js";import{a as $}from"./chunk-W2AILV7A.js";import"./chunk-GK6WYUPQ.js";import"./chunk-WXZ5XRM6.js";import"./chunk-BDUUVK5L.js";import"./chunk-L2ENNT5V.js";import"./chunk-HH4B5NMB.js";import"./chunk-DBO3A6IW.js";import{a as Z}from"./chunk-OJ4GCASY.js";import"./chunk-RVHJIVQ5.js";import"./chunk-MKENTZJA.js";import"./chunk-V3PUPGL5.js";import"./chunk-2SCD4QZY.js";import"./chunk-K227XGG2.js";import"./chunk-PRLMMKRO.js";import"./chunk-MMGI42DQ.js";import"./chunk-2QRSAAJG.js";import"./chunk-ACIMXBIC.js";import"./chunk-3ANHDTTL.js";import"./chunk-YYY663CV.js";import"./chunk-N77J6LFN.js";import{b as Y}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import"./chunk-MWUZF6ZW.js";import"./chunk-GF2RVIIT.js";import"./chunk-ITKXL7DT.js";import"./chunk-4AL6NJY5.js";import"./chunk-YOYMZEPB.js";import"./chunk-56UGSRXX.js";import"./chunk-UB22GZAR.js";import"./chunk-F7RHG53H.js";import"./chunk-X22WXNSF.js";import"./chunk-P6EDV7BS.js";import"./chunk-TVKTNDDY.js";import"./chunk-DGB7L5EQ.js";import"./chunk-7YP3O2JY.js";import"./chunk-BKB3Y5UC.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2VWSIT3Y.js";import"./chunk-2PONPJQD.js";import"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import{h as q}from"./chunk-KMEVPGD4.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import"./chunk-I4MUFYEG.js";import{c as H}from"./chunk-NNVT5X6O.js";import{A as X,c as G,h as J,m as K,o as Q}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{e as U}from"./chunk-M5YUVUTR.js";import{e as W,g as j}from"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{B as V,D as A}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{Eb as M,Ga as _,Oc as r,Pc as u,Qc as S,Sc as N,Tc as I,Uc as F,bc as x,bd as k,dc as E,fc as L,gc as T,hc as P,ic as p,jc as t,kb as y,kc as n,kd as v,lc as f,ld as z,mb as o,md as B,na as C,sc as R,sd as h,ua as D,va as O,xc as s,zc as w}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{a as g,b}from"./chunk-66YHNWRR.js";var ie=l=>({ID:l});function oe(l,c){if(l&1&&(t(0,"tr")(1,"td"),r(2),n(),t(3,"td"),f(4,"img",23),n(),t(5,"td"),r(6),n(),t(7,"td",24)(8,"a",25),r(9),v(10,"number"),n()(),t(11,"td"),r(12),n(),t(13,"td"),r(14),v(15,"date"),n()()),l&2){let e=c.$implicit;o(2),u(e._source.ChannelName),o(2),p("src",e.logo,y),o(2),u(e._source.DateRange),o(2),p("queryParams",k(12,ie,e._source.ID)),o(),S(" ",z(10,7,e._source.CountOrder)," "),o(3),u(e._source.UserLogin),o(2),S(" ",B(15,9,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," ")}}function re(l,c){if(l&1){let e=R();t(0,"div",14)(1,"table",16)(2,"thead")(3,"tr",17)(4,"th",18),r(5,"Channel"),n(),t(6,"th",19),r(7,"Type"),n(),t(8,"th",20),r(9,"Download Date Range"),n(),t(10,"th",21),r(11,"Count"),n(),t(12,"th"),r(13,"User Login"),n(),t(14,"th"),r(15,"Created"),n()()(),t(16,"tbody"),T(17,oe,16,14,"tr",null,L),n()(),t(19,"mat-paginator",22),s("page",function(a){D(e);let m=w();return O(m.onPaginationChange(a))}),n()()}if(l&2){let e,i=w();o(17),P(i.downloadOrders()),o(2),p("length",i.paginationTotal())("pageSize",i.paginationPageSize())("pageIndex",((e=i.filter())==null?null:e.PageNumber)==0?0:((e=i.filter())==null?null:e.PageNumber)-1)}}function ae(l,c){l&1&&(t(0,"div",15),f(1,"app-empty-state"),n())}var Me=(()=>{class l{constructor(){this.http=C(U),this.authService=C(q),this.downloadOrdersResponse=_(null),this.downloadOrders=h(()=>{let e=this.downloadOrdersResponse();return e?e.hits.map(i=>(i.logo=H.getChannelLogoByTypeId(i._source.TypeID),i)):[]}),this.filter=_({PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""}),this.paginationTotal=h(()=>this.downloadOrdersResponse()?.total.value??0),this.paginationPageSize=h(()=>{let e=this.paginationTotal();return this.filter().RowCount>e?e:this.filter().RowCount}),this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter.set(e.Filter),this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter()).subscribe(e=>{this.downloadOrdersResponse.set(e)})}onPaginationChange(e){this.filter.update(i=>b(g({},i),{PageNumber:e.pageIndex+1})),this.getDownloadOrders()}onFilterChange(e){this.filter.update(i=>g(g({},i),e))}static{this.\u0275fac=function(i){return new(i||l)}}static{this.\u0275cmp=M({type:l,selectors:[["app-download-order-log"]],decls:27,vars:7,consts:[["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/order/log/detail",3,"queryParams"]],template:function(i,a){if(i&1&&(t(0,"mainpanel",0),s("onSubmit",function(){return a.getDownloadOrders()}),t(1,"filters")(2,"div")(3,"label",1),r(4,"Channel"),n(),t(5,"app-channel-options-v2",2),s("ngModelChange",function(d){return a.onFilterChange({ChannelID:d})}),n()(),t(6,"div",3)(7,"label",4),r(8,"From/To"),n(),t(9,"div",5)(10,"datepicker",6),s("dateChange",function(d){return a.onFilterChange({From:d})}),n()(),t(11,"div")(12,"datepicker",7),s("dateChange",function(d){return a.onFilterChange({To:d})}),n()()(),t(13,"div",3)(14,"label",8),r(15,"Page Number"),n(),t(16,"input",9),s("ngModelChange",function(d){return a.onFilterChange({PageNumber:+d})}),n()(),t(17,"div",3)(18,"label",8),r(19,"Page Size"),n(),t(20,"input",10),F("ngModelChange",function(d){return I(a.filter().RowCount,d)||(a.filter().RowCount=d),d}),n()()(),t(21,"content")(22,"div",11)(23,"div",12)(24,"div",13),x(25,re,20,3,"div",14)(26,ae,2,0,"div",15),n()()()()()),i&2){let m;p("hideSearchBox",!0),o(5),p("ngModel",a.filter().ChannelID),o(5),p("date",a.filter().From),o(2),p("date",a.filter().To),o(4),p("ngModel",a.filter().PageNumber),o(4),N("ngModel",a.filter().RowCount),o(5),E(((m=a.downloadOrders())==null?null:m.length)>0?25:26)}},dependencies:[ne,te,Y,X,G,Q,J,K,ee,j,W,Z,$,V,A],encapsulation:2,changeDetection:0})}}return l})();export{Me as DownloadOrderLogComponent};
1
+ import{a as te,b as ne}from"./chunk-7OQSPY2H.js";import{a as ee}from"./chunk-4MYXPN55.js";import{a as $}from"./chunk-7T332QJG.js";import"./chunk-GK6WYUPQ.js";import"./chunk-WXZ5XRM6.js";import"./chunk-BDUUVK5L.js";import"./chunk-L2ENNT5V.js";import"./chunk-HH4B5NMB.js";import"./chunk-DBO3A6IW.js";import{a as Z}from"./chunk-OJ4GCASY.js";import"./chunk-RVHJIVQ5.js";import"./chunk-MKENTZJA.js";import"./chunk-V3PUPGL5.js";import"./chunk-2SCD4QZY.js";import"./chunk-K227XGG2.js";import"./chunk-PRLMMKRO.js";import"./chunk-MMGI42DQ.js";import"./chunk-2QRSAAJG.js";import"./chunk-ACIMXBIC.js";import"./chunk-3ANHDTTL.js";import"./chunk-YYY663CV.js";import"./chunk-N77J6LFN.js";import{b as Y}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import"./chunk-MWUZF6ZW.js";import"./chunk-GF2RVIIT.js";import"./chunk-ITKXL7DT.js";import"./chunk-4AL6NJY5.js";import"./chunk-YOYMZEPB.js";import"./chunk-56UGSRXX.js";import"./chunk-UB22GZAR.js";import"./chunk-F7RHG53H.js";import"./chunk-X22WXNSF.js";import"./chunk-P6EDV7BS.js";import"./chunk-TVKTNDDY.js";import"./chunk-DGB7L5EQ.js";import"./chunk-7YP3O2JY.js";import"./chunk-BKB3Y5UC.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2VWSIT3Y.js";import"./chunk-2PONPJQD.js";import"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import{h as q}from"./chunk-GQRBV5VY.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import"./chunk-I4MUFYEG.js";import{c as H}from"./chunk-NNVT5X6O.js";import{A as X,c as G,h as J,m as K,o as Q}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{e as U}from"./chunk-M5YUVUTR.js";import{e as W,g as j}from"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{B as V,D as A}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{Eb as M,Ga as _,Oc as r,Pc as u,Qc as S,Sc as N,Tc as I,Uc as F,bc as x,bd as k,dc as E,fc as L,gc as T,hc as P,ic as p,jc as t,kb as y,kc as n,kd as v,lc as f,ld as z,mb as o,md as B,na as C,sc as R,sd as h,ua as D,va as O,xc as s,zc as w}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{a as g,b}from"./chunk-66YHNWRR.js";var ie=l=>({ID:l});function oe(l,c){if(l&1&&(t(0,"tr")(1,"td"),r(2),n(),t(3,"td"),f(4,"img",23),n(),t(5,"td"),r(6),n(),t(7,"td",24)(8,"a",25),r(9),v(10,"number"),n()(),t(11,"td"),r(12),n(),t(13,"td"),r(14),v(15,"date"),n()()),l&2){let e=c.$implicit;o(2),u(e._source.ChannelName),o(2),p("src",e.logo,y),o(2),u(e._source.DateRange),o(2),p("queryParams",k(12,ie,e._source.ID)),o(),S(" ",z(10,7,e._source.CountOrder)," "),o(3),u(e._source.UserLogin),o(2),S(" ",B(15,9,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," ")}}function re(l,c){if(l&1){let e=R();t(0,"div",14)(1,"table",16)(2,"thead")(3,"tr",17)(4,"th",18),r(5,"Channel"),n(),t(6,"th",19),r(7,"Type"),n(),t(8,"th",20),r(9,"Download Date Range"),n(),t(10,"th",21),r(11,"Count"),n(),t(12,"th"),r(13,"User Login"),n(),t(14,"th"),r(15,"Created"),n()()(),t(16,"tbody"),T(17,oe,16,14,"tr",null,L),n()(),t(19,"mat-paginator",22),s("page",function(a){D(e);let m=w();return O(m.onPaginationChange(a))}),n()()}if(l&2){let e,i=w();o(17),P(i.downloadOrders()),o(2),p("length",i.paginationTotal())("pageSize",i.paginationPageSize())("pageIndex",((e=i.filter())==null?null:e.PageNumber)==0?0:((e=i.filter())==null?null:e.PageNumber)-1)}}function ae(l,c){l&1&&(t(0,"div",15),f(1,"app-empty-state"),n())}var Me=(()=>{class l{constructor(){this.http=C(U),this.authService=C(q),this.downloadOrdersResponse=_(null),this.downloadOrders=h(()=>{let e=this.downloadOrdersResponse();return e?e.hits.map(i=>(i.logo=H.getChannelLogoByTypeId(i._source.TypeID),i)):[]}),this.filter=_({PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""}),this.paginationTotal=h(()=>this.downloadOrdersResponse()?.total.value??0),this.paginationPageSize=h(()=>{let e=this.paginationTotal();return this.filter().RowCount>e?e:this.filter().RowCount}),this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter.set(e.Filter),this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter()).subscribe(e=>{this.downloadOrdersResponse.set(e)})}onPaginationChange(e){this.filter.update(i=>b(g({},i),{PageNumber:e.pageIndex+1})),this.getDownloadOrders()}onFilterChange(e){this.filter.update(i=>g(g({},i),e))}static{this.\u0275fac=function(i){return new(i||l)}}static{this.\u0275cmp=M({type:l,selectors:[["app-download-order-log"]],decls:27,vars:7,consts:[["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/order/log/detail",3,"queryParams"]],template:function(i,a){if(i&1&&(t(0,"mainpanel",0),s("onSubmit",function(){return a.getDownloadOrders()}),t(1,"filters")(2,"div")(3,"label",1),r(4,"Channel"),n(),t(5,"app-channel-options-v2",2),s("ngModelChange",function(d){return a.onFilterChange({ChannelID:d})}),n()(),t(6,"div",3)(7,"label",4),r(8,"From/To"),n(),t(9,"div",5)(10,"datepicker",6),s("dateChange",function(d){return a.onFilterChange({From:d})}),n()(),t(11,"div")(12,"datepicker",7),s("dateChange",function(d){return a.onFilterChange({To:d})}),n()()(),t(13,"div",3)(14,"label",8),r(15,"Page Number"),n(),t(16,"input",9),s("ngModelChange",function(d){return a.onFilterChange({PageNumber:+d})}),n()(),t(17,"div",3)(18,"label",8),r(19,"Page Size"),n(),t(20,"input",10),F("ngModelChange",function(d){return I(a.filter().RowCount,d)||(a.filter().RowCount=d),d}),n()()(),t(21,"content")(22,"div",11)(23,"div",12)(24,"div",13),x(25,re,20,3,"div",14)(26,ae,2,0,"div",15),n()()()()()),i&2){let m;p("hideSearchBox",!0),o(5),p("ngModel",a.filter().ChannelID),o(5),p("date",a.filter().From),o(2),p("date",a.filter().To),o(4),p("ngModel",a.filter().PageNumber),o(4),N("ngModel",a.filter().RowCount),o(5),E(((m=a.downloadOrders())==null?null:m.length)>0?25:26)}},dependencies:[ne,te,Y,X,G,Q,J,K,ee,j,W,Z,$,V,A],encapsulation:2,changeDetection:0})}}return l})();export{Me as DownloadOrderLogComponent};
@@ -1 +1 @@
1
- import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-6SCWPWLK.js").then(t=>t.OrdersV2Component)},children:[{path:"to-ship",loadComponent(){return import("./chunk-5NYVKJK6.js").then(t=>t.ReadyToShipComponent)},title:"To Ship"},{path:"awaiting-collection",loadComponent(){return import("./chunk-KX3SCV5R.js").then(t=>t.AwaitingCollectionComponent)},title:"Awaiting Collection"},{path:"shipped",loadComponent(){return import("./chunk-ZYM7WJMC.js").then(t=>t.ShippedComponent)},title:"Shipped"},{path:"completed",loadComponent(){return import("./chunk-UW3QQ7BU.js").then(t=>t.CompletedComponent)},title:"Completed"},{path:"all",loadComponent(){return import("./chunk-4KZRIGX5.js").then(t=>t.AllComponent)},title:"All Orders"},{path:"cancelled",loadComponent(){return import("./chunk-2OISU56P.js").then(t=>t.CancelledComponent)},title:"Cancelled"},{path:"download",loadComponent(){return import("./chunk-HK3HPBO6.js").then(t=>t.DownloadV2Component)},title:"Download"},{path:"log",loadComponent(){return import("./chunk-4W5KKUO4.js").then(t=>t.DownloadOrderLogComponent)},title:"Download Log"},{path:"log/detail",loadComponent(){return import("./chunk-GLL2GK36.js").then(t=>t.DownloadOrderDetailComponent)},title:"Download Log Detail"},{path:"",pathMatch:"full",redirectTo:"to-ship"}]}];export{o as routes};
1
+ import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-6SCWPWLK.js").then(t=>t.OrdersV2Component)},children:[{path:"to-ship",loadComponent(){return import("./chunk-AMXOODMD.js").then(t=>t.ReadyToShipComponent)},title:"To Ship"},{path:"awaiting-collection",loadComponent(){return import("./chunk-RJUIY3OK.js").then(t=>t.AwaitingCollectionComponent)},title:"Awaiting Collection"},{path:"shipped",loadComponent(){return import("./chunk-XQJASAXB.js").then(t=>t.ShippedComponent)},title:"Shipped"},{path:"completed",loadComponent(){return import("./chunk-VYT5DCV2.js").then(t=>t.CompletedComponent)},title:"Completed"},{path:"all",loadComponent(){return import("./chunk-HXSKWZXB.js").then(t=>t.AllComponent)},title:"All Orders"},{path:"cancelled",loadComponent(){return import("./chunk-G2OFO4CK.js").then(t=>t.CancelledComponent)},title:"Cancelled"},{path:"download",loadComponent(){return import("./chunk-TLUQ2PZZ.js").then(t=>t.DownloadV2Component)},title:"Download"},{path:"log",loadComponent(){return import("./chunk-55QWQP5X.js").then(t=>t.DownloadOrderLogComponent)},title:"Download Log"},{path:"log/detail",loadComponent(){return import("./chunk-GLL2GK36.js").then(t=>t.DownloadOrderDetailComponent)},title:"Download Log Detail"},{path:"",pathMatch:"full",redirectTo:"to-ship"}]}];export{o as routes};
@@ -1 +1 @@
1
- import{a as ie,b as ae}from"./chunk-7OQSPY2H.js";import"./chunk-HH4B5NMB.js";import"./chunk-DBO3A6IW.js";import{a as ne}from"./chunk-OJ4GCASY.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-TRTDBHQI.js";import{b as X}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import"./chunk-MWUZF6ZW.js";import"./chunk-4AL6NJY5.js";import"./chunk-56UGSRXX.js";import"./chunk-UB22GZAR.js";import"./chunk-X22WXNSF.js";import"./chunk-TVKTNDDY.js";import"./chunk-7YP3O2JY.js";import"./chunk-BKB3Y5UC.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2PONPJQD.js";import"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import{h as G}from"./chunk-KMEVPGD4.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import"./chunk-I4MUFYEG.js";import{c as H}from"./chunk-NNVT5X6O.js";import{A as W,h as K,m as Q}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{e as U}from"./chunk-M5YUVUTR.js";import"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{B as J,C as k,z as V}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{$c as z,Eb as $,Ga as v,Kb as w,Oc as r,Pc as f,Qc as b,V as I,Y as M,bc as B,cc as P,dc as T,e as L,ec as F,gc as O,hc as j,ia as N,ic as d,jc as i,kb as S,kc as a,kd as m,lc as u,ld as s,mb as l,md as A,na as g,sc as q,t as D,ua as E,va as R,xc as C,zc as x}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{a as _}from"./chunk-66YHNWRR.js";var y=(()=>{class n{constructor(){this.httpService=g(U),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(M(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac})}}return n})();function le(n,h){if(n&1&&(i(0,"span",10),u(1,"img",11),a(),r(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),b(" ",e.Name," ")}}function re(n,h){if(n&1&&(i(0,"tr")(1,"td"),u(2,"img",17),i(3,"span"),r(4),a()(),i(5,"td")(6,"span",18),r(7),m(8,"json"),a()(),i(9,"td"),r(10),m(11,"json"),a(),i(12,"td"),r(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),b(" ",e.ChannelName," "),l(3),f(s(8,5,e.Request)),l(3),f(s(11,7,e.Response)),l(3),f(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function pe(n,h){if(n&1){let e=q();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),r(5,"Channel"),a(),i(6,"th"),r(7,"Request"),a(),i(8,"th"),r(9,"Response"),a(),i(10,"th",15),r(11,"Created"),a()()(),i(12,"tbody"),O(13,re,15,12,"tr",null,F),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),C("page",function(p){E(e);let o=x();return R(o.channelLogService.onPaginationChange(p))}),a()()}if(n&2){let e,t,p,o,c=x();l(13),j((e=s(15,3,c.channelLogs$))==null?null:e.Data),l(3),d("length",(t=s(17,5,c.channelLogs$))==null?null:t.Count)("pageSize",(p=s(18,7,c.filter$))==null?null:p.RowCount)("pageIndex",(o=s(19,9,c.filter$))!=null&&o.PageNumber?0:((o=s(20,11,c.filter$))==null?null:o.PageNumber)-1)}}function me(n,h){n&1&&(i(0,"div",9),u(1,"app-empty-state"),a())}var Be=(()=>{class n{constructor(){this.channelLogService=g(y),this.authService=g(G),this.channelOptions=v(this.authService.getChannels()),this.channelLogs$=this.channelLogService.log$.pipe(D(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=H.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),I(1)),this.channelID=v(null),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID()})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=$({type:n,selectors:[["app-channel-log"]],features:[z([y])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[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,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,p){if(t&1&&(i(0,"mainpanel",0),C("onSubmit",function(){return p.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),r(5,"Channel"),a(),i(6,"ng-select",3),C("ngModelChange",function(c){return p.channelID.set(c)}),w(7,le,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),B(12,pe,21,13,"div",8),m(13,"async"),P(14,me,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",p.channelOptions())("ngModel",p.channelID()),l(6),T(((o=s(13,5,p.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[X,ne,ae,ie,te,ee,Y,Z,W,K,Q,V,J,k],encapsulation:2,changeDetection:0})}}return n})();export{Be as ChannelLogComponent};
1
+ import{a as ie,b as ae}from"./chunk-7OQSPY2H.js";import"./chunk-HH4B5NMB.js";import"./chunk-DBO3A6IW.js";import{a as ne}from"./chunk-OJ4GCASY.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-TRTDBHQI.js";import{b as X}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import"./chunk-MWUZF6ZW.js";import"./chunk-4AL6NJY5.js";import"./chunk-56UGSRXX.js";import"./chunk-UB22GZAR.js";import"./chunk-X22WXNSF.js";import"./chunk-TVKTNDDY.js";import"./chunk-7YP3O2JY.js";import"./chunk-BKB3Y5UC.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2PONPJQD.js";import"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import{h as G}from"./chunk-GQRBV5VY.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import"./chunk-I4MUFYEG.js";import{c as H}from"./chunk-NNVT5X6O.js";import{A as W,h as K,m as Q}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{e as U}from"./chunk-M5YUVUTR.js";import"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{B as J,C as k,z as V}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{$c as z,Eb as $,Ga as v,Kb as w,Oc as r,Pc as f,Qc as b,V as I,Y as M,bc as B,cc as P,dc as T,e as L,ec as F,gc as O,hc as j,ia as N,ic as d,jc as i,kb as S,kc as a,kd as m,lc as u,ld as s,mb as l,md as A,na as g,sc as q,t as D,ua as E,va as R,xc as C,zc as x}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{a as _}from"./chunk-66YHNWRR.js";var y=(()=>{class n{constructor(){this.httpService=g(U),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(M(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac})}}return n})();function le(n,h){if(n&1&&(i(0,"span",10),u(1,"img",11),a(),r(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),b(" ",e.Name," ")}}function re(n,h){if(n&1&&(i(0,"tr")(1,"td"),u(2,"img",17),i(3,"span"),r(4),a()(),i(5,"td")(6,"span",18),r(7),m(8,"json"),a()(),i(9,"td"),r(10),m(11,"json"),a(),i(12,"td"),r(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),b(" ",e.ChannelName," "),l(3),f(s(8,5,e.Request)),l(3),f(s(11,7,e.Response)),l(3),f(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function pe(n,h){if(n&1){let e=q();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),r(5,"Channel"),a(),i(6,"th"),r(7,"Request"),a(),i(8,"th"),r(9,"Response"),a(),i(10,"th",15),r(11,"Created"),a()()(),i(12,"tbody"),O(13,re,15,12,"tr",null,F),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),C("page",function(p){E(e);let o=x();return R(o.channelLogService.onPaginationChange(p))}),a()()}if(n&2){let e,t,p,o,c=x();l(13),j((e=s(15,3,c.channelLogs$))==null?null:e.Data),l(3),d("length",(t=s(17,5,c.channelLogs$))==null?null:t.Count)("pageSize",(p=s(18,7,c.filter$))==null?null:p.RowCount)("pageIndex",(o=s(19,9,c.filter$))!=null&&o.PageNumber?0:((o=s(20,11,c.filter$))==null?null:o.PageNumber)-1)}}function me(n,h){n&1&&(i(0,"div",9),u(1,"app-empty-state"),a())}var Be=(()=>{class n{constructor(){this.channelLogService=g(y),this.authService=g(G),this.channelOptions=v(this.authService.getChannels()),this.channelLogs$=this.channelLogService.log$.pipe(D(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=H.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),I(1)),this.channelID=v(null),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID()})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=$({type:n,selectors:[["app-channel-log"]],features:[z([y])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[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,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,p){if(t&1&&(i(0,"mainpanel",0),C("onSubmit",function(){return p.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),r(5,"Channel"),a(),i(6,"ng-select",3),C("ngModelChange",function(c){return p.channelID.set(c)}),w(7,le,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),B(12,pe,21,13,"div",8),m(13,"async"),P(14,me,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",p.channelOptions())("ngModel",p.channelID()),l(6),T(((o=s(13,5,p.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[X,ne,ae,ie,te,ee,Y,Z,W,K,Q,V,J,k],encapsulation:2,changeDetection:0})}}return n})();export{Be as ChannelLogComponent};
@@ -1 +1 @@
1
- import{a as X}from"./chunk-ZSUWHVKX.js";import{a as G,h as J}from"./chunk-KMEVPGD4.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import{a as Y}from"./chunk-I4MUFYEG.js";import{a as b,c as W}from"./chunk-NNVT5X6O.js";import{A as le,c as Z,h as ee,i as te,k as ne,m as ie,n as oe,t as re,u as ae,v as se,w as de}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{b as Q}from"./chunk-M5YUVUTR.js";import{d as K}from"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{z as H}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{Dc as A,Eb as y,Ec as U,Fc as F,Ga as f,Jc as S,Nc as T,Oc as s,Pc as N,Qc as R,Rc as j,V as I,bc as _,cd as z,dc as h,fc as O,gc as P,hc as E,ia as D,ic as x,jc as o,kb as C,kc as r,kd as $,lc as m,ld as q,mb as a,mc as v,nc as M,oc as V,sc as k,tc as L,ua as p,va as g,wd as B,xb as w,xc as u,zc as d}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function ue(t,c){if(t&1&&(v(0,"swiper-slide")(1,"div")(2,"a",1),V(3,"img",2),M()(),v(4,"a",3),s(5),M(),v(6,"p",4),s(7),M()()),t&2){let e=c.$implicit;a(2),L("href",e.href,C),a(),L("src",e.imgSrc,C),a(),L("href",e.href,C),a(),N(e.title),a(2),N(e.description)}}var me=(()=>{class t{constructor(){this.newsList=B([])}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=y({type:t,selectors:[["POS-news-swiper"]],inputs:{newsList:[1,"newsList"]},decls:3,vars:0,consts:[["pagination","true","pagination-clickable","true","autoplay-delay","5000","autoplay-disable-on-interaction","false",2,"margin-top","30px"],["target","_blank",3,"href"],[1,"border-0","rounded-1","mb-8",2,"width","252px","height","152px",3,"src"],["target","_blank",1,"fw-bold","h5","text-success","header-title","fs-4",3,"href"],[2,"margin-bottom","3rem"]],template:function(n,i){n&1&&(v(0,"swiper-container",0),P(1,ue,8,5,"swiper-slide",null,O),M()),n&2&&(a(),E(i.newsList()))},styles:["swiper-container[_ngcontent-%COMP%]{--swiper-pagination-bullet-inactive-color: #89b03e;--swiper-pagination-color: #89b03e}"],changeDetection:0})}}return t})();var pe=(()=>{class t{constructor(){}getBrowserName(){let e=window.navigator.userAgent.toLowerCase();switch(!0){case(e.indexOf("edge")>-1||e.indexOf("edg")>-1):return"edge";case e.indexOf("opr")>-1:return"opera";case e.indexOf("chrome")>-1:return"chrome";case e.indexOf("trident")>-1:return"ie";case e.indexOf("firefox")>-1:return"firefox";case e.indexOf("safari")>-1:return"safari";default:return"other"}}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var _e=["subdomainEl"],he=(t,c)=>({"rounded-end":t,"border-end-0":c});function xe(t,c){if(t&1&&(o(0,"div",33),m(1,"img",34),r()),t&2){let e=c.$implicit;a(),x("src",e.img,C)("title",e.title)("alt",e.title)}}function be(t,c){if(t&1){let e=k();o(0,"div",15)(1,"h3",16),s(2,"DealPOS Omnichannel"),r(),o(3,"small",17),s(4," Multichannel Inventory Management Software "),r()(),o(5,"form",18)(6,"div",19)(7,"div",20)(8,"div",21)(9,"span"),m(10,"i",22),r()(),o(11,"input",23,0),u("ngModelChange",function(i){p(e);let l=d();return g(l.subdomain.set(i))}),r(),o(13,"div")(14,"select",24),u("ngModelChange",function(i){p(e);let l=d();return g(l.domain.set(i))}),o(15,"option",25),s(16," .dealpos.co.id "),r(),o(17,"option",26),s(18,".dealpos.net"),r(),o(19,"option",27),s(20,".dealpos.com"),r(),o(21,"option",28),s(22,".dealpos.app"),r()()()(),o(23,"div",29)(24,"button",30),u("click",function(){p(e);let i=d();return g(i.onNextState())}),s(25," Next "),r()(),o(26,"div",31)(27,"div",32),P(28,xe,2,3,"div",33,O),r()()()()}if(t&2){let e=d();a(11),x("ngModel",e.subdomain()),a(3),x("ngModel",e.domain()),a(14),E(e.channels)}}function Ce(t,c){t&1&&(o(0,"p"),s(1,"Username is required"),r())}function we(t,c){if(t&1&&(o(0,"div",44),m(1,"div",54),o(2,"div",55),_(3,Ce,2,0,"p"),r()()),t&2){d();let e=S(14);a(3),h(e.errors.required?3:-1)}}function ve(t,c){if(t&1){let e=k();o(0,"i",57),u("click",function(){p(e);let i=d(3);return g(i.hideShowPassword())}),r()}if(t&2){let e=d(3);T("fa "+e.passwordIcon())}}function Me(t,c){if(t&1&&(o(0,"span",47),_(1,ve,1,2,"i",56),r()),t&2){let e=d(2);a(),h(e.password()?1:-1)}}function Se(t,c){t&1&&(o(0,"p"),s(1,"Password is required"),r())}function ye(t,c){if(t&1&&(o(0,"div",44),m(1,"div",54),o(2,"div",55),_(3,Se,2,0,"p"),r()()),t&2){d();let e=S(21);a(3),h(e.errors.required?3:-1)}}function Oe(t,c){if(t&1){let e=k();o(0,"div",35)(1,"h3",36),s(2,"Sign in"),r(),o(3,"h3",37),s(4," to "),o(5,"h6",38),s(6),r(),o(7,"i",39),u("click",function(){p(e);let i=d();return g(i.onEditDomain())}),r()()(),o(8,"form",40)(9,"div",41)(10,"div",21)(11,"span"),m(12,"i",42),r()(),o(13,"input",43,1),u("ngModelChange",function(i){p(e);let l=d();return g(l.username.set(i))}),r()(),_(15,we,4,1,"div",44),o(16,"div",20)(17,"div",21)(18,"span"),m(19,"i",45),r()(),o(20,"input",46,2),u("ngModelChange",function(i){p(e);let l=d();return g(l.password.set(i))}),r(),_(22,Me,2,1,"span",47),r(),_(23,ye,4,1,"div",44),o(24,"div",48)(25,"button",49),u("click",function(){p(e);let i=d();return g(i.onLogin())}),s(26," Log in "),r()(),o(27,"div",50),m(28,"hr"),o(29,"span",51),s(30,"or"),r(),m(31,"hr"),r(),o(32,"div")(33,"button",52),u("click",function(i){p(e);let l=d();return g(l.onLoginByGoogle(i))}),m(34,"i",53),s(35," Sign In with Google "),r()()()}if(t&2){let e=S(14),n=S(21),i=d();a(6),j(" (",i.subdomain(),"",i.domain(),") "),a(7),x("ngModel",i.username()),a(2),h(e.invalid&&(e.dirty||e.touched)?15:-1),a(5),T(z(10,he,i.browser()=="edge",i.browser()!="edge")),x("type",i.passwordType())("ngModel",i.password()),a(2),h(i.browser()!="edge"?22:-1),a(),h(n.invalid&&(n.dirty||n.touched)?23:-1)}}var He=(()=>{class t{constructor(e,n,i,l,ge){this._router=e,this.toastr=n,this.checkBrowser=i,this.authService=l,this.ngxPermission=ge,this.username=f(""),this.password=f(""),this.subdomain=f(""),this.domain=f(".dealpos.co.id"),this.loginState=f("FORM_DOMAIN"),this.passwordType=f("password"),this.passwordIcon=f("fa-eye"),this.browser=f(""),this.channels=[{title:"Shopee",img:b.SHOOPE},{title:"Tokopedia",img:b.TOKOPEDIA},{title:"Tiktok",img:b.TIKTOK},{title:"Woocommerce",img:b.WOOCOMMERCE},{title:"Lazada",img:b.LAZADA},{title:"Shopify",img:b.SHOPIFY},{title:"Plugo",img:b.PLUGONEW}],this.version=G.version,this.news$=l.getNews().pipe(I(1))}ngOnInit(){this.initLogin(),this.browser.set(this.checkBrowser.getBrowserName()),document.body.classList.add("login-body"),this.initChangeLogUrl()}initChangeLogUrl(){let e=`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${this.version}`;this.changelogUrl=e}ngAfterViewInit(){this.setAutoFocusDomain()}initLogin(){let e=JSON.parse(localStorage.getItem("Authorization"));if(e){this.username.set(e?.username||""),this.subdomain.set(e?.Host?.split(".")[0]||"");let n=e?.Host?.split("dealpos");this.domain.set(`.dealpos${n[1]}`),this.authService.isActiveToken()&&this._router.navigate(["menu"])}}onNextState(){if(W.IsEmpty(this.subdomain())){this.toastr.warning("Account Domain is required","Warning");return}this.parseSubdomain(),this.loginState.set("FORM_AUTH")}parseSubdomain(){let e=this.subdomain(),n=e.indexOf(".dealpos");n!=-1&&this.subdomain.set(e.substring(0,n))}onEditDomain(){this.loginState.set("FORM_DOMAIN")}onLogin(){let e={Host:`${this.subdomain()}${this.domain()}`,Username:this.username(),Password:this.password()};this.authService.login(e).subscribe(n=>{this.onSuccessLogin(n)})}onLoginByGoogle(e){let n=`${this.subdomain()}${this.domain()}`;this.authService.loginWithGoogle(e,n).subscribe(i=>{this.onSuccessLogin(i)})}onSuccessLogin(e){this.ngxPermission.hasPermission([X.DashboardView]).then(n=>{n?this._router.navigate(["menu/dashboard"]):e?.TotalChannel<1?this._router.navigate(["menu/channel"]):this._router.navigate(["menu/products"])})}setAutoFocusDomain(){this.subdomainEl.nativeElement.focus()}hideShowPassword(){this.passwordType.set(this.passwordType()==="text"?"password":"text"),this.passwordIcon.set(this.passwordIcon()==="fa-eye"?"fa-eye-slash":"fa-eye")}ngOnDestroy(){document.body.classList.remove("login-body")}static{this.\u0275fac=function(n){return new(n||t)(w(K),w(Q),w(pe),w(J),w(Y))}}static{this.\u0275cmp=y({type:t,selectors:[["app-login"]],viewQuery:function(n,i){if(n&1&&A(_e,5),n&2){let l;U(l=F())&&(i.subdomainEl=l.first)}},decls:18,vars:6,consts:[["subdomainEl",""],["usernameCtrl","ngModel"],["passwordCtrl","ngModel"],[1,"container-fluid"],[1,"row","mx-auto","bg-white","login-pane"],[1,"col-md-5","order-md-first","order-last","border-end","features-pane","pt-12","pb-9"],[1,"fw-normal","fs-2","header-title","text-center"],[3,"newsList"],[1,"col-md-7","order-md-last","order-first","py-12","sign-in-pane"],[1,"d-flex","copyright",2,"margin-left","20px"],[1,"align-self-center","me-5"],["target","_blank","href","http://www.dealpos.com"],[1,"version",2,"margin-right","18px"],["target","_blank",1,"text-dark","fst-italic",3,"href"],[1,"fa-solid","fa-circle-exclamation","ms-2",2,"font-size","16px"],[1,"text-md-start","text-center"],[1,"fs-2","header-title","me-2","fw-normal"],[1,"text-secondary-emphasis","fst-italic",2,"font-size","11px"],[2,"margin-top","38px"],[1,"form-block","mt-5"],[1,"input-group","input-group-lg","mt-8"],[1,"input-group-text","rounded-start","border-end-0",2,"width","52px"],[1,"fa-solid","fa-cloud"],["placeholder","Store Address","aria-label","Store Address","aria-describedby","basic-addon1","autofocus","","name","Store Address",1,"form-control","form-control-lg","rounded-end-0","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","ngModel"],["name","domainOption",1,"form-select","form-control","form-control-lg","border-start-0","border-start","rounded-end","rounded-start-0","domain-option",2,"height","58px",3,"ngModelChange","ngModel"],["selected","","value",".dealpos.co.id"],["value",".dealpos.net"],["value",".dealpos.com"],["value",".dealpos.app"],[1,"w-100",2,"margin-top","1.8rem"],["name","next","data-cy","next","type","submit",1,"btn","btn-xl","btn-success","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"d-flex","align-items-center","justify-content-center",2,"margin-top","2.1rem"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,""],[1,"border-0",2,"width","34px","height","34px",3,"src","title","alt"],[1,"d-flex","align-items-center","justify-content-start","mb-2"],[1,"robotoslab","fw-normal"],[1,"ms-2","fw-normal"],[1,"me-2","robotoslab","d-inline-block","text-success"],["title","Edit Store Address",1,"fa-solid","fa-edit","link-success","fs-5","pointer",3,"click"],[2,"margin-top","29px"],[1,"input-group","input-group-lg"],[1,"fas","fa-user","fa-lg"],["id","txtUsername","type","text","data-cy","username","required","","placeholder","Username","aria-label","Username","aria-describedby","basic-addon1","autofocus","","name","username",1,"form-control","form-control-lg","rounded-end","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-start","w-50","mb-4",2,"height","16px"],[1,"fas","fa-key","fa-lg"],["id","txtPassword","data-cy","password","placeholder","Password","aria-label","Password","aria-describedby","basic-addon1","autofocus","","name","password","required","",1,"form-control","form-control-lg","rounded-end","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","type","ngModel"],[1,"input-group-text","border-start-0","rounded-end"],[1,"w-100","mt-8"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-success","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"divider","d-flex","align-items-center","justify-content-center"],[1,"mx-4","text-muted"],[1,"btn","btn-social-login","text-success","w-100","fw-bold",3,"click"],[1,"fa-brands","fa-google"],[2,"width","52px"],[1,"text-danger","ps-1"],[3,"class"],[3,"click"]],template:function(n,i){n&1&&(o(0,"div",3)(1,"div",4)(2,"div",5)(3,"h3",6),s(4,"New Features"),r(),m(5,"POS-news-swiper",7),$(6,"async"),r(),o(7,"div",8),_(8,be,30,2)(9,Oe,36,13),r()(),o(10,"div",9)(11,"span",10),s(12,"powered by :"),r(),m(13,"a",11),r(),o(14,"div",12)(15,"a",13),s(16),m(17,"i",14),r()()()),n&2&&(a(5),x("newsList",q(6,4,i.news$)),a(3),h(i.loginState()=="FORM_DOMAIN"?8:9),a(7),x("href",i.changelogUrl,C),a(),R("version ",i.version))},dependencies:[me,le,oe,ae,se,Z,re,ee,te,de,ie,ne,H],styles:[".login-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:115px}@media(max-width:768px){.login-pane[_ngcontent-%COMP%]{margin-top:0}}@media only screen and (max-width:1300px)and (min-width:1024px){.login-pane[_ngcontent-%COMP%]{margin-top:30px}}.header-title[_ngcontent-%COMP%]{font-family:Roboto Slab}.carousel-inner[_ngcontent-%COMP%]{height:310px}.carousel-inner[_ngcontent-%COMP%] div.carousel-item[_ngcontent-%COMP%]{top:28px}@media(max-width:820px){.carousel-indicators[_ngcontent-%COMP%]{bottom:-8px}}.carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ddd;width:1.25rem;height:.375rem;transition:.3s}.carousel-indicators[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--bs-success)}.sign-in-pane[_ngcontent-%COMP%]{padding:0 3rem 0 3.5rem}@media(max-width:768px){.sign-in-pane[_ngcontent-%COMP%]{padding:24px 12px}.sign-in-pane[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:8px!important}}@media(min-width:1200px){.sign-in-pane[_ngcontent-%COMP%]{border-bottom:1px solid #89b03e;border-right:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:0 10px 10px 0}}.subscription.danger[_ngcontent-%COMP%]{background-color:#f2dede;border-color:#eb415d;color:#a94442}.subscription.warning[_ngcontent-%COMP%]{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}@media(max-width:768px){.features-pane[_ngcontent-%COMP%]{border-right:0px!important}}@media(min-width:1200px){.features-pane[_ngcontent-%COMP%]{border-left:1px solid #89b03e;border-bottom:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:10px 0 0 10px}}.copyright[_ngcontent-%COMP%]{position:absolute;bottom:1.25rem;left:1.25rem}.copyright[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:8.125rem;height:2.5rem;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png);background-position:left top;background-repeat:no-repeat;background-size:contain}.version[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem;position:absolute}@media(max-width:768px){.copyright[_ngcontent-%COMP%], .version[_ngcontent-%COMP%]{position:static;margin-top:10px}.copyright[_ngcontent-%COMP%]{justify-content:center}}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%], .btn-login[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited i[_ngcontent-%COMP%]{color:#f4f4f4!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited{margin-left:-10px}.domain-option[_ngcontent-%COMP%]{padding:.75rem;color:#343434;font-size:.875rem;width:8.5rem}"],changeDetection:0})}}return t})();export{He as LoginComponent};
1
+ import{a as X}from"./chunk-ZSUWHVKX.js";import{a as G,h as J}from"./chunk-GQRBV5VY.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import{a as Y}from"./chunk-I4MUFYEG.js";import{a as b,c as W}from"./chunk-NNVT5X6O.js";import{A as le,c as Z,h as ee,i as te,k as ne,m as ie,n as oe,t as re,u as ae,v as se,w as de}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{b as Q}from"./chunk-M5YUVUTR.js";import{d as K}from"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{z as H}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{Dc as A,Eb as y,Ec as U,Fc as F,Ga as f,Jc as S,Nc as T,Oc as s,Pc as N,Qc as R,Rc as j,V as I,bc as _,cd as z,dc as h,fc as O,gc as P,hc as E,ia as D,ic as x,jc as o,kb as C,kc as r,kd as $,lc as m,ld as q,mb as a,mc as v,nc as M,oc as V,sc as k,tc as L,ua as p,va as g,wd as B,xb as w,xc as u,zc as d}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function ue(t,c){if(t&1&&(v(0,"swiper-slide")(1,"div")(2,"a",1),V(3,"img",2),M()(),v(4,"a",3),s(5),M(),v(6,"p",4),s(7),M()()),t&2){let e=c.$implicit;a(2),L("href",e.href,C),a(),L("src",e.imgSrc,C),a(),L("href",e.href,C),a(),N(e.title),a(2),N(e.description)}}var me=(()=>{class t{constructor(){this.newsList=B([])}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=y({type:t,selectors:[["POS-news-swiper"]],inputs:{newsList:[1,"newsList"]},decls:3,vars:0,consts:[["pagination","true","pagination-clickable","true","autoplay-delay","5000","autoplay-disable-on-interaction","false",2,"margin-top","30px"],["target","_blank",3,"href"],[1,"border-0","rounded-1","mb-8",2,"width","252px","height","152px",3,"src"],["target","_blank",1,"fw-bold","h5","text-success","header-title","fs-4",3,"href"],[2,"margin-bottom","3rem"]],template:function(n,i){n&1&&(v(0,"swiper-container",0),P(1,ue,8,5,"swiper-slide",null,O),M()),n&2&&(a(),E(i.newsList()))},styles:["swiper-container[_ngcontent-%COMP%]{--swiper-pagination-bullet-inactive-color: #89b03e;--swiper-pagination-color: #89b03e}"],changeDetection:0})}}return t})();var pe=(()=>{class t{constructor(){}getBrowserName(){let e=window.navigator.userAgent.toLowerCase();switch(!0){case(e.indexOf("edge")>-1||e.indexOf("edg")>-1):return"edge";case e.indexOf("opr")>-1:return"opera";case e.indexOf("chrome")>-1:return"chrome";case e.indexOf("trident")>-1:return"ie";case e.indexOf("firefox")>-1:return"firefox";case e.indexOf("safari")>-1:return"safari";default:return"other"}}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var _e=["subdomainEl"],he=(t,c)=>({"rounded-end":t,"border-end-0":c});function xe(t,c){if(t&1&&(o(0,"div",33),m(1,"img",34),r()),t&2){let e=c.$implicit;a(),x("src",e.img,C)("title",e.title)("alt",e.title)}}function be(t,c){if(t&1){let e=k();o(0,"div",15)(1,"h3",16),s(2,"DealPOS Omnichannel"),r(),o(3,"small",17),s(4," Multichannel Inventory Management Software "),r()(),o(5,"form",18)(6,"div",19)(7,"div",20)(8,"div",21)(9,"span"),m(10,"i",22),r()(),o(11,"input",23,0),u("ngModelChange",function(i){p(e);let l=d();return g(l.subdomain.set(i))}),r(),o(13,"div")(14,"select",24),u("ngModelChange",function(i){p(e);let l=d();return g(l.domain.set(i))}),o(15,"option",25),s(16," .dealpos.co.id "),r(),o(17,"option",26),s(18,".dealpos.net"),r(),o(19,"option",27),s(20,".dealpos.com"),r(),o(21,"option",28),s(22,".dealpos.app"),r()()()(),o(23,"div",29)(24,"button",30),u("click",function(){p(e);let i=d();return g(i.onNextState())}),s(25," Next "),r()(),o(26,"div",31)(27,"div",32),P(28,xe,2,3,"div",33,O),r()()()()}if(t&2){let e=d();a(11),x("ngModel",e.subdomain()),a(3),x("ngModel",e.domain()),a(14),E(e.channels)}}function Ce(t,c){t&1&&(o(0,"p"),s(1,"Username is required"),r())}function we(t,c){if(t&1&&(o(0,"div",44),m(1,"div",54),o(2,"div",55),_(3,Ce,2,0,"p"),r()()),t&2){d();let e=S(14);a(3),h(e.errors.required?3:-1)}}function ve(t,c){if(t&1){let e=k();o(0,"i",57),u("click",function(){p(e);let i=d(3);return g(i.hideShowPassword())}),r()}if(t&2){let e=d(3);T("fa "+e.passwordIcon())}}function Me(t,c){if(t&1&&(o(0,"span",47),_(1,ve,1,2,"i",56),r()),t&2){let e=d(2);a(),h(e.password()?1:-1)}}function Se(t,c){t&1&&(o(0,"p"),s(1,"Password is required"),r())}function ye(t,c){if(t&1&&(o(0,"div",44),m(1,"div",54),o(2,"div",55),_(3,Se,2,0,"p"),r()()),t&2){d();let e=S(21);a(3),h(e.errors.required?3:-1)}}function Oe(t,c){if(t&1){let e=k();o(0,"div",35)(1,"h3",36),s(2,"Sign in"),r(),o(3,"h3",37),s(4," to "),o(5,"h6",38),s(6),r(),o(7,"i",39),u("click",function(){p(e);let i=d();return g(i.onEditDomain())}),r()()(),o(8,"form",40)(9,"div",41)(10,"div",21)(11,"span"),m(12,"i",42),r()(),o(13,"input",43,1),u("ngModelChange",function(i){p(e);let l=d();return g(l.username.set(i))}),r()(),_(15,we,4,1,"div",44),o(16,"div",20)(17,"div",21)(18,"span"),m(19,"i",45),r()(),o(20,"input",46,2),u("ngModelChange",function(i){p(e);let l=d();return g(l.password.set(i))}),r(),_(22,Me,2,1,"span",47),r(),_(23,ye,4,1,"div",44),o(24,"div",48)(25,"button",49),u("click",function(){p(e);let i=d();return g(i.onLogin())}),s(26," Log in "),r()(),o(27,"div",50),m(28,"hr"),o(29,"span",51),s(30,"or"),r(),m(31,"hr"),r(),o(32,"div")(33,"button",52),u("click",function(i){p(e);let l=d();return g(l.onLoginByGoogle(i))}),m(34,"i",53),s(35," Sign In with Google "),r()()()}if(t&2){let e=S(14),n=S(21),i=d();a(6),j(" (",i.subdomain(),"",i.domain(),") "),a(7),x("ngModel",i.username()),a(2),h(e.invalid&&(e.dirty||e.touched)?15:-1),a(5),T(z(10,he,i.browser()=="edge",i.browser()!="edge")),x("type",i.passwordType())("ngModel",i.password()),a(2),h(i.browser()!="edge"?22:-1),a(),h(n.invalid&&(n.dirty||n.touched)?23:-1)}}var He=(()=>{class t{constructor(e,n,i,l,ge){this._router=e,this.toastr=n,this.checkBrowser=i,this.authService=l,this.ngxPermission=ge,this.username=f(""),this.password=f(""),this.subdomain=f(""),this.domain=f(".dealpos.co.id"),this.loginState=f("FORM_DOMAIN"),this.passwordType=f("password"),this.passwordIcon=f("fa-eye"),this.browser=f(""),this.channels=[{title:"Shopee",img:b.SHOOPE},{title:"Tokopedia",img:b.TOKOPEDIA},{title:"Tiktok",img:b.TIKTOK},{title:"Woocommerce",img:b.WOOCOMMERCE},{title:"Lazada",img:b.LAZADA},{title:"Shopify",img:b.SHOPIFY},{title:"Plugo",img:b.PLUGONEW}],this.version=G.version,this.news$=l.getNews().pipe(I(1))}ngOnInit(){this.initLogin(),this.browser.set(this.checkBrowser.getBrowserName()),document.body.classList.add("login-body"),this.initChangeLogUrl()}initChangeLogUrl(){let e=`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${this.version}`;this.changelogUrl=e}ngAfterViewInit(){this.setAutoFocusDomain()}initLogin(){let e=JSON.parse(localStorage.getItem("Authorization"));if(e){this.username.set(e?.username||""),this.subdomain.set(e?.Host?.split(".")[0]||"");let n=e?.Host?.split("dealpos");this.domain.set(`.dealpos${n[1]}`),this.authService.isActiveToken()&&this._router.navigate(["menu"])}}onNextState(){if(W.IsEmpty(this.subdomain())){this.toastr.warning("Account Domain is required","Warning");return}this.parseSubdomain(),this.loginState.set("FORM_AUTH")}parseSubdomain(){let e=this.subdomain(),n=e.indexOf(".dealpos");n!=-1&&this.subdomain.set(e.substring(0,n))}onEditDomain(){this.loginState.set("FORM_DOMAIN")}onLogin(){let e={Host:`${this.subdomain()}${this.domain()}`,Username:this.username(),Password:this.password()};this.authService.login(e).subscribe(n=>{this.onSuccessLogin(n)})}onLoginByGoogle(e){let n=`${this.subdomain()}${this.domain()}`;this.authService.loginWithGoogle(e,n).subscribe(i=>{this.onSuccessLogin(i)})}onSuccessLogin(e){this.ngxPermission.hasPermission([X.DashboardView]).then(n=>{n?this._router.navigate(["menu/dashboard"]):e?.TotalChannel<1?this._router.navigate(["menu/channel"]):this._router.navigate(["menu/products"])})}setAutoFocusDomain(){this.subdomainEl.nativeElement.focus()}hideShowPassword(){this.passwordType.set(this.passwordType()==="text"?"password":"text"),this.passwordIcon.set(this.passwordIcon()==="fa-eye"?"fa-eye-slash":"fa-eye")}ngOnDestroy(){document.body.classList.remove("login-body")}static{this.\u0275fac=function(n){return new(n||t)(w(K),w(Q),w(pe),w(J),w(Y))}}static{this.\u0275cmp=y({type:t,selectors:[["app-login"]],viewQuery:function(n,i){if(n&1&&A(_e,5),n&2){let l;U(l=F())&&(i.subdomainEl=l.first)}},decls:18,vars:6,consts:[["subdomainEl",""],["usernameCtrl","ngModel"],["passwordCtrl","ngModel"],[1,"container-fluid"],[1,"row","mx-auto","bg-white","login-pane"],[1,"col-md-5","order-md-first","order-last","border-end","features-pane","pt-12","pb-9"],[1,"fw-normal","fs-2","header-title","text-center"],[3,"newsList"],[1,"col-md-7","order-md-last","order-first","py-12","sign-in-pane"],[1,"d-flex","copyright",2,"margin-left","20px"],[1,"align-self-center","me-5"],["target","_blank","href","http://www.dealpos.com"],[1,"version",2,"margin-right","18px"],["target","_blank",1,"text-dark","fst-italic",3,"href"],[1,"fa-solid","fa-circle-exclamation","ms-2",2,"font-size","16px"],[1,"text-md-start","text-center"],[1,"fs-2","header-title","me-2","fw-normal"],[1,"text-secondary-emphasis","fst-italic",2,"font-size","11px"],[2,"margin-top","38px"],[1,"form-block","mt-5"],[1,"input-group","input-group-lg","mt-8"],[1,"input-group-text","rounded-start","border-end-0",2,"width","52px"],[1,"fa-solid","fa-cloud"],["placeholder","Store Address","aria-label","Store Address","aria-describedby","basic-addon1","autofocus","","name","Store Address",1,"form-control","form-control-lg","rounded-end-0","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","ngModel"],["name","domainOption",1,"form-select","form-control","form-control-lg","border-start-0","border-start","rounded-end","rounded-start-0","domain-option",2,"height","58px",3,"ngModelChange","ngModel"],["selected","","value",".dealpos.co.id"],["value",".dealpos.net"],["value",".dealpos.com"],["value",".dealpos.app"],[1,"w-100",2,"margin-top","1.8rem"],["name","next","data-cy","next","type","submit",1,"btn","btn-xl","btn-success","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"d-flex","align-items-center","justify-content-center",2,"margin-top","2.1rem"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,""],[1,"border-0",2,"width","34px","height","34px",3,"src","title","alt"],[1,"d-flex","align-items-center","justify-content-start","mb-2"],[1,"robotoslab","fw-normal"],[1,"ms-2","fw-normal"],[1,"me-2","robotoslab","d-inline-block","text-success"],["title","Edit Store Address",1,"fa-solid","fa-edit","link-success","fs-5","pointer",3,"click"],[2,"margin-top","29px"],[1,"input-group","input-group-lg"],[1,"fas","fa-user","fa-lg"],["id","txtUsername","type","text","data-cy","username","required","","placeholder","Username","aria-label","Username","aria-describedby","basic-addon1","autofocus","","name","username",1,"form-control","form-control-lg","rounded-end","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-start","w-50","mb-4",2,"height","16px"],[1,"fas","fa-key","fa-lg"],["id","txtPassword","data-cy","password","placeholder","Password","aria-label","Password","aria-describedby","basic-addon1","autofocus","","name","password","required","",1,"form-control","form-control-lg","rounded-end","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","type","ngModel"],[1,"input-group-text","border-start-0","rounded-end"],[1,"w-100","mt-8"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-success","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"divider","d-flex","align-items-center","justify-content-center"],[1,"mx-4","text-muted"],[1,"btn","btn-social-login","text-success","w-100","fw-bold",3,"click"],[1,"fa-brands","fa-google"],[2,"width","52px"],[1,"text-danger","ps-1"],[3,"class"],[3,"click"]],template:function(n,i){n&1&&(o(0,"div",3)(1,"div",4)(2,"div",5)(3,"h3",6),s(4,"New Features"),r(),m(5,"POS-news-swiper",7),$(6,"async"),r(),o(7,"div",8),_(8,be,30,2)(9,Oe,36,13),r()(),o(10,"div",9)(11,"span",10),s(12,"powered by :"),r(),m(13,"a",11),r(),o(14,"div",12)(15,"a",13),s(16),m(17,"i",14),r()()()),n&2&&(a(5),x("newsList",q(6,4,i.news$)),a(3),h(i.loginState()=="FORM_DOMAIN"?8:9),a(7),x("href",i.changelogUrl,C),a(),R("version ",i.version))},dependencies:[me,le,oe,ae,se,Z,re,ee,te,de,ie,ne,H],styles:[".login-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:115px}@media(max-width:768px){.login-pane[_ngcontent-%COMP%]{margin-top:0}}@media only screen and (max-width:1300px)and (min-width:1024px){.login-pane[_ngcontent-%COMP%]{margin-top:30px}}.header-title[_ngcontent-%COMP%]{font-family:Roboto Slab}.carousel-inner[_ngcontent-%COMP%]{height:310px}.carousel-inner[_ngcontent-%COMP%] div.carousel-item[_ngcontent-%COMP%]{top:28px}@media(max-width:820px){.carousel-indicators[_ngcontent-%COMP%]{bottom:-8px}}.carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ddd;width:1.25rem;height:.375rem;transition:.3s}.carousel-indicators[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--bs-success)}.sign-in-pane[_ngcontent-%COMP%]{padding:0 3rem 0 3.5rem}@media(max-width:768px){.sign-in-pane[_ngcontent-%COMP%]{padding:24px 12px}.sign-in-pane[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:8px!important}}@media(min-width:1200px){.sign-in-pane[_ngcontent-%COMP%]{border-bottom:1px solid #89b03e;border-right:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:0 10px 10px 0}}.subscription.danger[_ngcontent-%COMP%]{background-color:#f2dede;border-color:#eb415d;color:#a94442}.subscription.warning[_ngcontent-%COMP%]{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}@media(max-width:768px){.features-pane[_ngcontent-%COMP%]{border-right:0px!important}}@media(min-width:1200px){.features-pane[_ngcontent-%COMP%]{border-left:1px solid #89b03e;border-bottom:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:10px 0 0 10px}}.copyright[_ngcontent-%COMP%]{position:absolute;bottom:1.25rem;left:1.25rem}.copyright[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:8.125rem;height:2.5rem;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png);background-position:left top;background-repeat:no-repeat;background-size:contain}.version[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem;position:absolute}@media(max-width:768px){.copyright[_ngcontent-%COMP%], .version[_ngcontent-%COMP%]{position:static;margin-top:10px}.copyright[_ngcontent-%COMP%]{justify-content:center}}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%], .btn-login[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited i[_ngcontent-%COMP%]{color:#f4f4f4!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited{margin-left:-10px}.domain-option[_ngcontent-%COMP%]{padding:.75rem;color:#343434;font-size:.875rem;width:8.5rem}"],changeDetection:0})}}return t})();export{He as LoginComponent};
@@ -1 +1 @@
1
- import{a as J,b as K}from"./chunk-GK6WYUPQ.js";import{b as R}from"./chunk-WXZ5XRM6.js";import{a as q,b as H}from"./chunk-L2ENNT5V.js";import{a as z}from"./chunk-RVHJIVQ5.js";import{b as U,c as j}from"./chunk-MKENTZJA.js";import{a as B}from"./chunk-ACIMXBIC.js";import{ra as F}from"./chunk-2VWSIT3Y.js";import{h as E}from"./chunk-KMEVPGD4.js";import{b as N}from"./chunk-NNVT5X6O.js";import{A,a as W,h as P,m as G}from"./chunk-P6BSXX22.js";import{$c as L,Eb as T,Ga as y,Jb as v,Kb as M,Oc as _,Pc as g,Sc as f,Tc as x,Uc as S,bc as D,dc as I,ic as r,jc as p,kb as V,kc as m,lc as b,mb as d,na as O,od as k,sc as C,ua as a,va as s,wd as h,xc as u,zc as o}from"./chunk-KCXC4XYC.js";function Q(l,c){if(l&1){let e=C();p(0,"div",7)(1,"p-checkbox",8),S("ngModelChange",function(t){let n=a(e).$implicit;return x(n.selected,t)||(n.selected=t),s(t)}),u("ngModelChange",function(t){let n=a(e).$implicit,w=o(2);return s(w.onGroupSelect(t,n))}),m(),b(2,"img",9),p(3,"span"),_(4),m()()}if(l&2){let e=c.$implicit;d(),r("binary",!0),f("ngModel",e.selected),d(),r("src",e.img,V),d(2),g(e.label)}}function X(l,c){if(l&1&&(p(0,"div"),_(1),m()),l&2){let e=c.$implicit;d(),g(e.Name)}}function Y(l,c){if(l&1){let e=C();p(0,"p-multiselect",5,0),u("click",function(){a(e);let t=o();return s(t.onClickSelect())}),S("ngModelChange",function(t){a(e);let n=o();return x(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){a(e);let n=o();return s(n.onChannelChange(t))})("onClear",function(){a(e);let t=o();return s(t.onClearSelectedChannel())}),M(2,Q,5,4,"ng-template",null,1,k)(4,X,2,1,"ng-template",6),m()}if(l&2){let e=o();r("options",e.multiselectOptions())("placeholder",e.placeholder()),f("ngModel",e.selectedChannels),r("showClear",e.clearable())("autofocusFilter",!0)("maxSelectedLabels",e.maxSelectedLabels())("group",!0)}}function Z(l,c){if(l&1&&(p(0,"div",11),b(1,"img",12),p(2,"div"),_(3),m()()),l&2){let e=c.$implicit;d(),r("src",e.logo,V),d(2),g(e.Name)}}function $(l,c){if(l&1){let e=C();p(0,"p-select",10,2),u("click",function(){a(e);let t=o();return s(t.onClickSelect())}),S("ngModelChange",function(t){a(e);let n=o();return x(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){a(e);let n=o();return s(n.onChannelChange(t))}),M(2,Z,4,2,"ng-template",6),m()}if(l&2){let e=o();r("options",e.options())("placeholder",e.placeholder()),f("ngModel",e.selectedChannels),r("showClear",e.clearable())("autofocusFilter",!0)("filter",!0)}}var fe=(()=>{class l extends z{constructor(){super(),this.authService=O(E),this.multiple=h(!1),this.clearable=h(!0),this.placeholder=h("Select Channels"),this.options=y(this.authService.getChannels()),this.maxSelectedLabels=h(6),this.multiselectOptions=y([]),this.onChange=e=>{},this.initMultiSelectOptions()}initMultiSelectOptions(){let e=this.authService.getChannels(),i=[];e.forEach(t=>{let n=i.find(w=>w.value===t.TypeID);n?n.items.push(t):(n={label:N[t.TypeID],selected:!1,img:t.Img,value:t.TypeID,items:[t]},i.push(n))}),this.multiselectOptions.set(i)}onGroupSelect(e,i){this.selectedChannels=this.selectedChannels?this.selectedChannels:[];let t=i.items.map(n=>n.ID);e?this.selectedChannels=[...this.selectedChannels,...t.filter(n=>!this.selectedChannels.includes(n))]:this.selectedChannels=this.selectedChannels.filter(n=>!t.includes(n)),this.onChange(this.selectedChannels)}onChannelChange(e){this.multiple()?e=e||[]:e=e||B.GuidEmpty,this.checkSelectedGroup(),this.onChange(e)}checkSelectedGroup(){this.multiselectOptions.update(e=>(e.forEach(i=>{let t=i.items.map(n=>n.ID);i.selected=t.every(n=>this.selectedChannels.includes(n))}),e))}onClearSelectedChannel(){this.multiselectOptions.update(e=>(e.forEach(i=>{i.selected=!1}),e)),this.onChange([])}onClickSelect(){this.initTopPosition(),setTimeout(()=>{this.adjustOverlayPosition()},0)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||l)}}static{this.\u0275cmp=T({type:l,selectors:[["app-channel-options-v2"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"],placeholder:[1,"placeholder"],maxSelectedLabels:[1,"maxSelectedLabels"]},features:[L([{provide:W,multi:!0,useExisting:l}]),v],decls:2,vars:1,consts:[["multiSelect",""],["group",""],["select",""],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels","group"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","filter"],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"click","ngModelChange","onClear","options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels","group"],["pTemplate","item"],[1,"flex","items-center"],[1,"me-3",3,"ngModelChange","binary","ngModel"],[1,"me-2",2,"width","18px",3,"src"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","filter"],[1,"d-flex","align-items-center","gap-2"],[2,"width","18px",3,"src"]],template:function(i,t){i&1&&D(0,Y,5,7,"p-multiselect",3)(1,$,3,6,"p-select",4),i&2&&I(t.multiple()?0:1)},dependencies:[K,J,F,R,A,P,G,j,U,H,q],styles:["li.p-multiselect-option{margin-left:30px}"],changeDetection:0})}}return l})();export{fe as a};
1
+ import{a as J,b as K}from"./chunk-GK6WYUPQ.js";import{b as R}from"./chunk-WXZ5XRM6.js";import{a as q,b as H}from"./chunk-L2ENNT5V.js";import{a as z}from"./chunk-RVHJIVQ5.js";import{b as U,c as j}from"./chunk-MKENTZJA.js";import{a as B}from"./chunk-ACIMXBIC.js";import{ra as F}from"./chunk-2VWSIT3Y.js";import{h as E}from"./chunk-GQRBV5VY.js";import{b as N}from"./chunk-NNVT5X6O.js";import{A,a as W,h as P,m as G}from"./chunk-P6BSXX22.js";import{$c as L,Eb as T,Ga as y,Jb as v,Kb as M,Oc as _,Pc as g,Sc as f,Tc as x,Uc as S,bc as D,dc as I,ic as r,jc as p,kb as V,kc as m,lc as b,mb as d,na as O,od as k,sc as C,ua as a,va as s,wd as h,xc as u,zc as o}from"./chunk-KCXC4XYC.js";function Q(l,c){if(l&1){let e=C();p(0,"div",7)(1,"p-checkbox",8),S("ngModelChange",function(t){let n=a(e).$implicit;return x(n.selected,t)||(n.selected=t),s(t)}),u("ngModelChange",function(t){let n=a(e).$implicit,w=o(2);return s(w.onGroupSelect(t,n))}),m(),b(2,"img",9),p(3,"span"),_(4),m()()}if(l&2){let e=c.$implicit;d(),r("binary",!0),f("ngModel",e.selected),d(),r("src",e.img,V),d(2),g(e.label)}}function X(l,c){if(l&1&&(p(0,"div"),_(1),m()),l&2){let e=c.$implicit;d(),g(e.Name)}}function Y(l,c){if(l&1){let e=C();p(0,"p-multiselect",5,0),u("click",function(){a(e);let t=o();return s(t.onClickSelect())}),S("ngModelChange",function(t){a(e);let n=o();return x(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){a(e);let n=o();return s(n.onChannelChange(t))})("onClear",function(){a(e);let t=o();return s(t.onClearSelectedChannel())}),M(2,Q,5,4,"ng-template",null,1,k)(4,X,2,1,"ng-template",6),m()}if(l&2){let e=o();r("options",e.multiselectOptions())("placeholder",e.placeholder()),f("ngModel",e.selectedChannels),r("showClear",e.clearable())("autofocusFilter",!0)("maxSelectedLabels",e.maxSelectedLabels())("group",!0)}}function Z(l,c){if(l&1&&(p(0,"div",11),b(1,"img",12),p(2,"div"),_(3),m()()),l&2){let e=c.$implicit;d(),r("src",e.logo,V),d(2),g(e.Name)}}function $(l,c){if(l&1){let e=C();p(0,"p-select",10,2),u("click",function(){a(e);let t=o();return s(t.onClickSelect())}),S("ngModelChange",function(t){a(e);let n=o();return x(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){a(e);let n=o();return s(n.onChannelChange(t))}),M(2,Z,4,2,"ng-template",6),m()}if(l&2){let e=o();r("options",e.options())("placeholder",e.placeholder()),f("ngModel",e.selectedChannels),r("showClear",e.clearable())("autofocusFilter",!0)("filter",!0)}}var fe=(()=>{class l extends z{constructor(){super(),this.authService=O(E),this.multiple=h(!1),this.clearable=h(!0),this.placeholder=h("Select Channels"),this.options=y(this.authService.getChannels()),this.maxSelectedLabels=h(6),this.multiselectOptions=y([]),this.onChange=e=>{},this.initMultiSelectOptions()}initMultiSelectOptions(){let e=this.authService.getChannels(),i=[];e.forEach(t=>{let n=i.find(w=>w.value===t.TypeID);n?n.items.push(t):(n={label:N[t.TypeID],selected:!1,img:t.Img,value:t.TypeID,items:[t]},i.push(n))}),this.multiselectOptions.set(i)}onGroupSelect(e,i){this.selectedChannels=this.selectedChannels?this.selectedChannels:[];let t=i.items.map(n=>n.ID);e?this.selectedChannels=[...this.selectedChannels,...t.filter(n=>!this.selectedChannels.includes(n))]:this.selectedChannels=this.selectedChannels.filter(n=>!t.includes(n)),this.onChange(this.selectedChannels)}onChannelChange(e){this.multiple()?e=e||[]:e=e||B.GuidEmpty,this.checkSelectedGroup(),this.onChange(e)}checkSelectedGroup(){this.multiselectOptions.update(e=>(e.forEach(i=>{let t=i.items.map(n=>n.ID);i.selected=t.every(n=>this.selectedChannels.includes(n))}),e))}onClearSelectedChannel(){this.multiselectOptions.update(e=>(e.forEach(i=>{i.selected=!1}),e)),this.onChange([])}onClickSelect(){this.initTopPosition(),setTimeout(()=>{this.adjustOverlayPosition()},0)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||l)}}static{this.\u0275cmp=T({type:l,selectors:[["app-channel-options-v2"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"],placeholder:[1,"placeholder"],maxSelectedLabels:[1,"maxSelectedLabels"]},features:[L([{provide:W,multi:!0,useExisting:l}]),v],decls:2,vars:1,consts:[["multiSelect",""],["group",""],["select",""],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels","group"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","filter"],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"click","ngModelChange","onClear","options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels","group"],["pTemplate","item"],[1,"flex","items-center"],[1,"me-3",3,"ngModelChange","binary","ngModel"],[1,"me-2",2,"width","18px",3,"src"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","filter"],[1,"d-flex","align-items-center","gap-2"],[2,"width","18px",3,"src"]],template:function(i,t){i&1&&D(0,Y,5,7,"p-multiselect",3)(1,$,3,6,"p-select",4),i&2&&I(t.multiple()?0:1)},dependencies:[K,J,F,R,A,P,G,j,U,H,q],styles:["li.p-multiselect-option{margin-left:30px}"],changeDetection:0})}}return l})();export{fe as a};
@@ -1,2 +1,2 @@
1
- import{a as be}from"./chunk-4PIQA6ZR.js";import"./chunk-4VNQYYVV.js";import{a as m}from"./chunk-IYP3FT4Q.js";import{c as _e}from"./chunk-K6KO37S2.js";import"./chunk-DBO3A6IW.js";import{b as he}from"./chunk-JLY2L5QD.js";import"./chunk-ACIMXBIC.js";import{a as ge}from"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import{a as fe}from"./chunk-MWUZF6ZW.js";import"./chunk-DGB7L5EQ.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2PONPJQD.js";import{b as ue}from"./chunk-BQCLUDBO.js";import{B as ie,D as ne,H as ae,l as W,m as X,q as Y,u as ee,v as te}from"./chunk-TM7PL3CC.js";import{a}from"./chunk-ZSUWHVKX.js";import{b as q,h as pe}from"./chunk-KMEVPGD4.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import{a as de,b as me,c as ce}from"./chunk-I4MUFYEG.js";import"./chunk-NNVT5X6O.js";import"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import"./chunk-M5YUVUTR.js";import{c as oe,d as re,e as se,f as le,g as A}from"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{B as K,F as Q,r as J,z as Z}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{Da as L,Eb as x,Fb as b,Gb as F,Hd as w,Kb as S,Lc as M,Nc as E,Oc as p,Pa as N,Pc as y,Qc as C,bc as _,cc as $,dc as v,fc as j,gc as G,hc as H,ic as u,ja as f,jc as o,kb as U,kc as l,kd as T,lc as h,ld as D,mb as s,na as r,t as R,wb as V,xc as z,za as B,zc as c}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{i as k}from"./chunk-66YHNWRR.js";var P=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[a.DashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[a.ProductView]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[a.InventoryView]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[a.PriceView]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/order",Roles:[a.OrderView]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[a.ChannelView]},{Icon:"fa-solid fa-user",Title:"Users",Url:"/menu/users",Roles:[a.UserView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[a.Report]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[a.LogisticView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[a.DevView]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",Roles:[a.JsonApiView]}]}get getMenu(){return this.menus}};var ve="mat-badge-content",we=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275cmp=x({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
2
- `],encapsulation:2,changeDetection:0})}return e})(),Ce=(()=>{class e{_ngZone=r(L);_elementRef=r(N);_ariaDescriber=r(ie);_renderer=r(V);_animationsDisabled=ae();_idGenerator=r(te);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=r(Y);_document=r(B);constructor(){let t=r(W);t.load(we),t.load(X)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(ve),this._animationsDisabled&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&!this._animationsDisabled?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${ve}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=F({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&M("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",w],disabled:[2,"matBadgeDisabled","disabled",w],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",w]}})}return e})(),xe=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=b({type:e});static \u0275inj=f({imports:[ee,ne]})}return e})();function Oe(e,d){if(e&1&&(o(0,"p",21),p(1),l()),e&2){let t=c(3).$implicit;s(),C(" ",t.Title," ")}}function ke(e,d){if(e&1&&(o(0,"p"),p(1),l()),e&2){let t=c(3).$implicit;s(),y(t.Title)}}function Se(e,d){if(e&1&&(o(0,"a",18),h(1,"i"),_(2,Oe,2,1,"p",21)(3,ke,2,1,"p"),l()),e&2){let t=c(2).$implicit;u("href",t.Url,U),s(),E(t.Icon),s(),v(t.Badge?2:3)}}function ze(e,d){if(e&1&&S(0,Se,4,4,"a",20),e&2){let t=c().$implicit;u("ngxPermissionsOnly",t.Roles)}}function Ee(e,d){if(e&1&&(o(0,"p",21),p(1),l()),e&2){let t=c(4).$implicit;s(),C(" ",t.Title," ")}}function Te(e,d){if(e&1&&(o(0,"p"),p(1),l()),e&2){let t=c(4).$implicit;s(),y(t.Title)}}function De(e,d){if(e&1&&(_(0,Ee,2,1,"p",21),T(1,"async"),$(2,Te,2,1,"p")),e&2){let t=c(4);v(D(1,1,t.notifications$)!=0?0:2)}}function Ae(e,d){if(e&1&&(o(0,"p"),p(1),l()),e&2){let t=c(3).$implicit;s(),y(t.Title)}}function Ie(e,d){if(e&1&&(o(0,"a",19),h(1,"i"),_(2,De,3,3)(3,Ae,2,1,"p"),l()),e&2){let t=c(2).$implicit,i=c();u("matTooltip",i.isCollapseSidebar?t.Title:"")("routerLink",t.Url),s(),E(t.Icon),s(),v(t.Badge?2:3)}}function Re(e,d){if(e&1&&S(0,Ie,4,5,"a",22),e&2){let t=c().$implicit;u("ngxPermissionsOnly",t.Roles)}}function Be(e,d){if(e&1&&(o(0,"li",16),_(1,ze,1,1,"a",18)(2,Re,1,1,"a",19),l()),e&2){let t=d.$implicit;s(),v(t.ExternalLink?1:2)}}var Me=(()=>{class e{constructor(){this.toggleSidebarService=r(ge),this.notificationService=r(he),this.decodeTokenService=r(q),this.authService=r(pe),this.Menu={};let t=this.decodeTokenService;this.isCollapseSidebar=!1,this.token=t.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new P().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(R(t=>t.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["app-menu"]],standalone:!1,decls:29,vars:8,consts:[[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["routerLink","/menu/profile",1,"dropdown-item","h5",2,"cursor","pointer"],["aria-hidden","true",1,"fa-user","fas"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active"],[1,"main-panel"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"]],template:function(i,n){i&1&&(o(0,"div",0),T(1,"async"),o(2,"div",1)(3,"button",2),z("click",function(){return n.onCallapseSidebar()}),h(4,"i",3),l(),o(5,"div",4)(6,"div",5)(7,"a",6),p(8),l(),o(9,"div",7)(10,"div",8),p(11),l(),h(12,"div",9),o(13,"a",10),h(14,"i",11),p(15,"\xA0 "),o(16,"span"),p(17,"My Profile"),l()(),o(18,"a",12),z("click",function(){return n.onLogout()}),h(19,"i",13),p(20,"\xA0 "),o(21,"span"),p(22," Log Out"),l()()()()(),o(23,"div",14)(24,"ul",15),G(25,Be,3,1,"li",16,j),l()()(),o(27,"div",17),h(28,"router-outlet"),l()()),i&2&&(M("nav-open",D(1,6,n.toggleState$)),s(2),u("ngClass",n.isCollapseSidebar?"collapses":""),s(2),u("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),s(4),C(" ",n.storeName," "),s(3),C(" ",n.token==null?null:n.token.LID," "),s(14),H(n.Menu))},dependencies:[J,oe,se,le,ue,Ce,me,Z],styles:["@media(max-width:468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width:992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]})}}return e})();var g=(e,d)=>k(null,null,function*(){let t=r(de),i=r(re),n=e.data?.roles||[],O=e.data?.redirectUrl||"/";return n.length===0||(yield Le(t,n))?!0:(i.navigate([O]),!1)});function Le(e,d){return k(this,null,function*(){let t=d.map(n=>e.hasPermission(n));return(yield Promise.all(t)).some(n=>n)})}var Ne=[{path:"",component:Me,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"profile",loadChildren:()=>import("./chunk-DRTTOWOD.js").then(e=>e.routes),canActivate:[m],data:{title:"My Profile"}},{path:"dashboard",loadChildren:()=>import("./chunk-5YFF6ZKM.js").then(e=>e.routes),canActivate:[m,g,be],data:{title:"Dashboard",roles:[a.DashboardView],redirectUrl:"/menu/products"}},{path:"products",loadChildren:()=>import("./chunk-RCMEZOHR.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Products",roles:[a.ProductView],redirectUrl:"/menu/inventory"}},{path:"inventory",loadChildren:()=>import("./chunk-NHDG2POP.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Inventory",roles:[a.InventoryView],redirectUrl:"/menu/price"}},{path:"price",loadChildren:()=>import("./chunk-3LVJIRWN.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Price",roles:[a.PriceView],redirectUrl:"/menu/Order"}},{path:"order",loadChildren:()=>import("./chunk-3WG7LTIE.js").then(e=>e.routes),canActivate:[m],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-I5LMJBPL.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Report",roles:[a.Report],redirectUrl:"/menu/Logistic"}},{path:"Logistic",loadComponent(){return import("./chunk-6NVZHDBR.js").then(e=>e.LogisticComponent)},canActivate:[m,g],data:{title:"Logistic",roles:[a.LogisticView],redirectUrl:"/menu/channel"}},{path:"channel",loadChildren:()=>import("./chunk-DWW6X4IM.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Marketplace",roles:[a.ChannelView],redirectUrl:"/menu/log"}},{path:"log",loadChildren:()=>import("./chunk-CB534HG5.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Orders",roles:[a.DevView]}},{path:"users",loadChildren:()=>import("./chunk-3YUDY74I.js").then(e=>e.userRoutes),canActivate:[m,g],data:{title:"Users",roles:[a.UserView],redirectUrl:"/menu/dashboard"}},{path:"json-api",loadChildren:()=>import("./chunk-WYCTV5VQ.js").then(e=>e.routes),canActivate:[m],data:{title:"Json API"}}]}],ye=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=f({imports:[A.forChild(Ne),A]})}}return e})();var At=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=f({providers:[K],imports:[Q,ye,fe,xe,ce.forChild(),_e]})}}return e})();export{At as MenuModule};
1
+ import{a as be}from"./chunk-4PIQA6ZR.js";import"./chunk-4VNQYYVV.js";import{a as m}from"./chunk-POY7HZKL.js";import{c as _e}from"./chunk-K6KO37S2.js";import"./chunk-DBO3A6IW.js";import{b as he}from"./chunk-NS3MK77F.js";import"./chunk-ACIMXBIC.js";import{a as ge}from"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import{a as fe}from"./chunk-MWUZF6ZW.js";import"./chunk-DGB7L5EQ.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2PONPJQD.js";import{b as ue}from"./chunk-BQCLUDBO.js";import{B as ie,D as ne,H as ae,l as W,m as X,q as Y,u as ee,v as te}from"./chunk-TM7PL3CC.js";import{a}from"./chunk-ZSUWHVKX.js";import{b as q,h as pe}from"./chunk-GQRBV5VY.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import{a as de,b as me,c as ce}from"./chunk-I4MUFYEG.js";import"./chunk-NNVT5X6O.js";import"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import"./chunk-M5YUVUTR.js";import{c as oe,d as re,e as se,f as le,g as A}from"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{B as K,F as Q,r as J,z as Z}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{Da as L,Eb as x,Fb as b,Gb as F,Hd as w,Kb as S,Lc as M,Nc as E,Oc as p,Pa as N,Pc as y,Qc as C,bc as _,cc as $,dc as v,fc as j,gc as G,hc as H,ic as u,ja as f,jc as o,kb as U,kc as l,kd as T,lc as h,ld as D,mb as s,na as r,t as R,wb as V,xc as z,za as B,zc as c}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{i as k}from"./chunk-66YHNWRR.js";var P=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[a.DashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[a.ProductView]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[a.InventoryView]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[a.PriceView]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/order",Roles:[a.OrderView]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[a.ChannelView]},{Icon:"fa-solid fa-user",Title:"Users",Url:"/menu/users",Roles:[a.UserView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[a.Report]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[a.LogisticView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[a.DevView]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",Roles:[a.JsonApiView]}]}get getMenu(){return this.menus}};var ve="mat-badge-content",we=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275cmp=x({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
2
+ `],encapsulation:2,changeDetection:0})}return e})(),Ce=(()=>{class e{_ngZone=r(L);_elementRef=r(N);_ariaDescriber=r(ie);_renderer=r(V);_animationsDisabled=ae();_idGenerator=r(te);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=r(Y);_document=r(B);constructor(){let t=r(W);t.load(we),t.load(X)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(ve),this._animationsDisabled&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&!this._animationsDisabled?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${ve}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=F({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&M("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",w],disabled:[2,"matBadgeDisabled","disabled",w],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",w]}})}return e})(),xe=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=b({type:e});static \u0275inj=f({imports:[ee,ne]})}return e})();function Oe(e,d){if(e&1&&(o(0,"p",21),p(1),l()),e&2){let t=c(3).$implicit;s(),C(" ",t.Title," ")}}function ke(e,d){if(e&1&&(o(0,"p"),p(1),l()),e&2){let t=c(3).$implicit;s(),y(t.Title)}}function Se(e,d){if(e&1&&(o(0,"a",18),h(1,"i"),_(2,Oe,2,1,"p",21)(3,ke,2,1,"p"),l()),e&2){let t=c(2).$implicit;u("href",t.Url,U),s(),E(t.Icon),s(),v(t.Badge?2:3)}}function ze(e,d){if(e&1&&S(0,Se,4,4,"a",20),e&2){let t=c().$implicit;u("ngxPermissionsOnly",t.Roles)}}function Ee(e,d){if(e&1&&(o(0,"p",21),p(1),l()),e&2){let t=c(4).$implicit;s(),C(" ",t.Title," ")}}function Te(e,d){if(e&1&&(o(0,"p"),p(1),l()),e&2){let t=c(4).$implicit;s(),y(t.Title)}}function De(e,d){if(e&1&&(_(0,Ee,2,1,"p",21),T(1,"async"),$(2,Te,2,1,"p")),e&2){let t=c(4);v(D(1,1,t.notifications$)!=0?0:2)}}function Ae(e,d){if(e&1&&(o(0,"p"),p(1),l()),e&2){let t=c(3).$implicit;s(),y(t.Title)}}function Ie(e,d){if(e&1&&(o(0,"a",19),h(1,"i"),_(2,De,3,3)(3,Ae,2,1,"p"),l()),e&2){let t=c(2).$implicit,i=c();u("matTooltip",i.isCollapseSidebar?t.Title:"")("routerLink",t.Url),s(),E(t.Icon),s(),v(t.Badge?2:3)}}function Re(e,d){if(e&1&&S(0,Ie,4,5,"a",22),e&2){let t=c().$implicit;u("ngxPermissionsOnly",t.Roles)}}function Be(e,d){if(e&1&&(o(0,"li",16),_(1,ze,1,1,"a",18)(2,Re,1,1,"a",19),l()),e&2){let t=d.$implicit;s(),v(t.ExternalLink?1:2)}}var Me=(()=>{class e{constructor(){this.toggleSidebarService=r(ge),this.notificationService=r(he),this.decodeTokenService=r(q),this.authService=r(pe),this.Menu={};let t=this.decodeTokenService;this.isCollapseSidebar=!1,this.token=t.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new P().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(R(t=>t.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["app-menu"]],standalone:!1,decls:29,vars:8,consts:[[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["routerLink","/menu/profile",1,"dropdown-item","h5",2,"cursor","pointer"],["aria-hidden","true",1,"fa-user","fas"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active"],[1,"main-panel"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"]],template:function(i,n){i&1&&(o(0,"div",0),T(1,"async"),o(2,"div",1)(3,"button",2),z("click",function(){return n.onCallapseSidebar()}),h(4,"i",3),l(),o(5,"div",4)(6,"div",5)(7,"a",6),p(8),l(),o(9,"div",7)(10,"div",8),p(11),l(),h(12,"div",9),o(13,"a",10),h(14,"i",11),p(15,"\xA0 "),o(16,"span"),p(17,"My Profile"),l()(),o(18,"a",12),z("click",function(){return n.onLogout()}),h(19,"i",13),p(20,"\xA0 "),o(21,"span"),p(22," Log Out"),l()()()()(),o(23,"div",14)(24,"ul",15),G(25,Be,3,1,"li",16,j),l()()(),o(27,"div",17),h(28,"router-outlet"),l()()),i&2&&(M("nav-open",D(1,6,n.toggleState$)),s(2),u("ngClass",n.isCollapseSidebar?"collapses":""),s(2),u("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),s(4),C(" ",n.storeName," "),s(3),C(" ",n.token==null?null:n.token.LID," "),s(14),H(n.Menu))},dependencies:[J,oe,se,le,ue,Ce,me,Z],styles:["@media(max-width:468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width:992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]})}}return e})();var g=(e,d)=>k(null,null,function*(){let t=r(de),i=r(re),n=e.data?.roles||[],O=e.data?.redirectUrl||"/";return n.length===0||(yield Le(t,n))?!0:(i.navigate([O]),!1)});function Le(e,d){return k(this,null,function*(){let t=d.map(n=>e.hasPermission(n));return(yield Promise.all(t)).some(n=>n)})}var Ne=[{path:"",component:Me,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"profile",loadChildren:()=>import("./chunk-DRTTOWOD.js").then(e=>e.routes),canActivate:[m],data:{title:"My Profile"}},{path:"dashboard",loadChildren:()=>import("./chunk-5YFF6ZKM.js").then(e=>e.routes),canActivate:[m,g,be],data:{title:"Dashboard",roles:[a.DashboardView],redirectUrl:"/menu/products"}},{path:"products",loadChildren:()=>import("./chunk-FFQMVXOJ.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Products",roles:[a.ProductView],redirectUrl:"/menu/inventory"}},{path:"inventory",loadChildren:()=>import("./chunk-PA6SG4LZ.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Inventory",roles:[a.InventoryView],redirectUrl:"/menu/price"}},{path:"price",loadChildren:()=>import("./chunk-GTIJRYKH.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Price",roles:[a.PriceView],redirectUrl:"/menu/Order"}},{path:"order",loadChildren:()=>import("./chunk-5CL57SA6.js").then(e=>e.routes),canActivate:[m],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-PLA2PFMH.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Report",roles:[a.Report],redirectUrl:"/menu/Logistic"}},{path:"Logistic",loadComponent(){return import("./chunk-XHR66HQG.js").then(e=>e.LogisticComponent)},canActivate:[m,g],data:{title:"Logistic",roles:[a.LogisticView],redirectUrl:"/menu/channel"}},{path:"channel",loadChildren:()=>import("./chunk-JCEQO5MQ.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Marketplace",roles:[a.ChannelView],redirectUrl:"/menu/log"}},{path:"log",loadChildren:()=>import("./chunk-B4YMOSMT.js").then(e=>e.routes),canActivate:[m,g],data:{title:"Orders",roles:[a.DevView]}},{path:"users",loadChildren:()=>import("./chunk-3YUDY74I.js").then(e=>e.userRoutes),canActivate:[m,g],data:{title:"Users",roles:[a.UserView],redirectUrl:"/menu/dashboard"}},{path:"json-api",loadChildren:()=>import("./chunk-VGQHO3VI.js").then(e=>e.routes),canActivate:[m],data:{title:"Json API"}}]}],ye=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=f({imports:[A.forChild(Ne),A]})}}return e})();var At=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=f({providers:[K],imports:[Q,ye,fe,xe,ce.forChild(),_e]})}}return e})();export{At as MenuModule};
@@ -1 +1 @@
1
- import{a as ge,b as Ce}from"./chunk-NDOVDHNA.js";import{a as pe,b as ce,c as ue}from"./chunk-CKU644YK.js";import{a as he}from"./chunk-C57MMZXM.js";import{a as O}from"./chunk-URNP457I.js";import{a as _e}from"./chunk-4MYXPN55.js";import"./chunk-LCIOJHJ4.js";import"./chunk-FDYHLFQ3.js";import{a as me}from"./chunk-W2AILV7A.js";import"./chunk-GK6WYUPQ.js";import"./chunk-WXZ5XRM6.js";import"./chunk-BDUUVK5L.js";import"./chunk-L2ENNT5V.js";import{a as de}from"./chunk-ZA4X34GE.js";import"./chunk-IFFI5CMD.js";import{a as se}from"./chunk-OJ4GCASY.js";import"./chunk-RVHJIVQ5.js";import"./chunk-MKENTZJA.js";import"./chunk-V3PUPGL5.js";import"./chunk-2SCD4QZY.js";import"./chunk-K227XGG2.js";import"./chunk-PRLMMKRO.js";import"./chunk-MMGI42DQ.js";import"./chunk-2QRSAAJG.js";import"./chunk-ACIMXBIC.js";import"./chunk-3ANHDTTL.js";import"./chunk-YYY663CV.js";import"./chunk-N77J6LFN.js";import"./chunk-TRTDBHQI.js";import{b as ae}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import{a as le}from"./chunk-MWUZF6ZW.js";import"./chunk-GF2RVIIT.js";import"./chunk-ITKXL7DT.js";import"./chunk-4AL6NJY5.js";import"./chunk-YOYMZEPB.js";import"./chunk-56UGSRXX.js";import"./chunk-UB22GZAR.js";import"./chunk-F7RHG53H.js";import"./chunk-X22WXNSF.js";import"./chunk-P6EDV7BS.js";import"./chunk-TVKTNDDY.js";import"./chunk-DGB7L5EQ.js";import"./chunk-7YP3O2JY.js";import"./chunk-BKB3Y5UC.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2VWSIT3Y.js";import"./chunk-2PONPJQD.js";import{b as re}from"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import"./chunk-KMEVPGD4.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import"./chunk-I4MUFYEG.js";import{b as X}from"./chunk-NNVT5X6O.js";import{A as oe,b as Z,c as ee,h as te,m as ie,o as ne}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{b as Y}from"./chunk-M5YUVUTR.js";import"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{B as J,D as K}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{$c as j,Dc as D,Eb as P,Ec as L,Fc as A,Ga as T,Nc as z,Oc as s,Pc as v,Qc as b,Sc as B,Tc as H,Uc as W,Vc as $,Wc as Q,Xc as R,bc as f,bd as q,dc as S,ec as N,gc as k,hc as I,ic as p,jc as t,kb as F,kc as n,kd as w,lc as h,ld as E,mb as l,md as U,na as x,sc as y,sd as G,ua as d,va as m,xc as _,zc as c}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{a as M,b as V}from"./chunk-66YHNWRR.js";var fe=["contextMenu"],Se=r=>({"td-cell-hover":r});function ye(r,g){if(r&1){let e=y();t(0,"button",20),_("click",function(){d(e);let i=c();return m(i.setMultipleFulfillment())}),s(1," Set Fulfillment "),n()}}function ve(r,g){if(r&1&&h(0,"variants-dropdown",38),r&2){let e=c().$implicit;p("variants",e==null?null:e.Variants)}}function be(r,g){if(r&1&&h(0,"variant-with-image",39),r&2){let e=c().$implicit;p("variant",e==null?null:e.Variants[0])}}function xe(r,g){if(r&1&&(t(0,"span"),s(1),n()),r&2){let e=c().$implicit;l(),b("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Te(r,g){if(r&1){let e=y();t(0,"div",41)(1,"button",45),_("click",function(){d(e);let i=c().$implicit,a=c(2);return m(a.refreshShippingAndRefNumber(i))}),h(2,"i",46),n()()}}function we(r,g){if(r&1){let e=y();t(0,"button",47),_("click",function(){d(e);let i=c().$implicit,a=c(2);return m(a.onSetFulfillment(i))}),s(1," Set Fulfillment "),n()}}function Me(r,g){if(r&1){let e=y();t(0,"tr")(1,"td")(2,"input",30),W("ngModelChange",function(i){let a=d(e).$implicit;return H(a.selected,i)||(a.selected=i),m(i)}),_("ngModelChange",function(){d(e);let i=c(2),a=R(0);return m(i.onSelectOrder(a))}),n()(),t(3,"td")(4,"div",31),h(5,"img",32),w(6,"channelImage"),t(7,"div",33)(8,"div"),s(9),n(),t(10,"small",34)(11,"span"),s(12),n()()()()(),t(13,"td")(14,"div",35)(15,"div"),h(16,"order-link",36),n(),t(17,"small"),s(18),w(19,"date"),n(),h(20,"br"),t(21,"small"),h(22,"i",37),s(23),n()()(),t(24,"td"),f(25,ve,1,1,"variants-dropdown",38)(26,be,1,1,"variant-with-image",39),n(),t(27,"td",40),s(28),w(29,"number"),n(),t(30,"td",41)(31,"div",42)(32,"div",35)(33,"div",43)(34,"span"),s(35),n(),f(36,xe,2,1,"span"),n(),t(37,"small"),s(38),n()(),f(39,Te,3,0,"div",41),n()(),t(40,"td",41),f(41,we,2,0,"button",44),n()()}if(r&2){let e=g.$implicit,o=c(2);l(2),B("ngModel",e.selected),p("disabled",o.selectedChannelType()!=null&&o.selectedChannelType()!=e.MarketType),l(3),p("src",E(6,18,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(4),v(e.Outlet),l(3),v(e.ChannelName),l(4),p("order",e),l(2),b(" ",U(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(5),b(" ",e.Customer," "),l(),z(q(25,Se,(e.Variants==null?null:e.Variants.length)>1)),l(),S((e.Variants==null?null:e.Variants.length)>1?25:26),l(3),v(E(29,23,e.Amount)),l(7),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),S(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?36:-1),l(2),b(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),l(),S(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?39:-1),l(2),S((e==null?null:e.MarketType)!=o.channelType.WooCommerce?41:-1)}}function Ve(r,g){if(r&1){let e=y();t(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),h(4,"th",24),t(5,"th",25),s(6,"Outlet"),n(),t(7,"th",25),s(8,"Number"),n(),t(9,"th"),s(10,"Items"),n(),t(11,"th",26),s(12,"Amount"),n(),t(13,"th",27),s(14,"Shipping"),n(),h(15,"th",28),n()(),t(16,"tbody"),k(17,Me,42,27,"tr",null,N),n()(),t(19,"app-custom-paginator",29),_("next",function(){d(e);let i=c();return m(i.initReadyToShip())})("previous",function(){d(e);let i=c();return m(i.initReadyToShip())}),n()()}if(r&2){let e=c(),o=R(0);l(17),I(o),l(2),p("filter",e.filter())("totaldata",o==null?null:o.length)}}function Re(r,g){r&1&&(t(0,"div",18),h(1,"app-empty-state"),n())}var et=(()=>{class r{constructor(){this.toastr=x(Y),this.orderService=x(O),this.fulfillmentService=x(ge),this.channelType=X,this.selectedOrders=T([]),this.selectedChannelType=G(()=>{let e=null;return this.selectedOrders().length>0&&(e=this.selectedOrders()[0].MarketType),e}),this.readyToShip=T([]),this.filter=T({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}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(o=>V(M({},o),{From:e})),this.initReadyToShip()}initReadyToShip(){this.orderService.getReadyToShipOrders(this.filter()).subscribe(e=>{this.readyToShip.set(e),this.selectedOrders.set([])})}onFilterPropertyChange(e,o){this.filter.update(i=>V(M({},i),{[e]:o}))}onSetFulfillment(e){this.fulfillmentService.setFulfillmentOrder(e).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(e){this.orderService.refreshShippingCourier(e.ShopID,e.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(e){let o=e.filter(i=>i.selected);this.selectedOrders.set(o)}onMouseHover(e,o){(!o.LogisticService?.Name||!o.ReferenceNumber)&&this.contextMenuEl.show(e,o)}onSelectContextItem(e){e.item?.id==="refresh"&&this.refreshShippingAndRefNumber(e.data)}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=P({type:r,selectors:[["app-ready-to-ship"]],viewQuery:function(o,i){if(o&1&&D(fe,5),o&2){let a;L(a=A())&&(i.contextMenuEl=a.first)}},features:[j([O])],decls:36,vars:11,consts:[["contextMenu",""],["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["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"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],[2,"width","150px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[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"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(o,i){if(o&1){let a=y();$(0),t(1,"mainpanel",1),_("onSubmit",function(){return d(a),m(i.initReadyToShip())})("textChange",function(u){return d(a),m(i.onFilterPropertyChange("Number",u))}),t(2,"actions"),f(3,ye,2,0,"button",2),t(4,"a",3),h(5,"i",4),t(6,"span"),s(7,"Order Fulfillment Display"),n()()(),t(8,"filters")(9,"div")(10,"label",5),s(11,"Channel"),n(),t(12,"app-channel-options-v2",6),_("ngModelChange",function(u){return d(a),m(i.onFilterPropertyChange("ListChannelID",u))}),n()(),t(13,"div",7)(14,"label",5),s(15,"From/To"),n(),t(16,"div",8)(17,"datepicker",9),_("dateChange",function(u){return d(a),m(i.onFilterPropertyChange("From",u))}),n()(),t(18,"div")(19,"datepicker",10),_("dateChange",function(u){return d(a),m(i.onFilterPropertyChange("To",u))}),n()()(),t(20,"div",7)(21,"label",11),s(22,"Page Number"),n(),t(23,"input",12),_("ngModelChange",function(u){return d(a),m(i.onFilterPropertyChange("PageNumber",+u))}),n()(),t(24,"div",7)(25,"label",11),s(26,"Page Size"),n(),t(27,"input",13),_("ngModelChange",function(u){return d(a),m(i.onFilterPropertyChange("PageSize",+u))}),n()()(),t(28,"content")(29,"div",14)(30,"div",15)(31,"div",16),f(32,Ve,20,2,"div",17)(33,Re,2,0,"div",18),n()()()()(),t(34,"app-context-menu",19,0),_("onSelectItem",function(u){return d(a),m(i.onSelectContextItem(u))}),n()}if(o&2){let a=Q(i.readyToShip());l(),p("text",i.filter().Number),l(2),S(i.selectedOrders().length>0?3:-1),l(9),p("multiple",!0)("ngModel",i.filter().ListChannelID),l(5),p("date",i.filter().From),l(2),p("date",i.filter().To),l(4),p("ngModel",i.filter().PageNumber),l(4),p("ngModel",i.filter().PageSize),l(5),S(a.length>0?32:33),l(2),p("items",i.contextMenuItems)}},dependencies:[ae,se,de,oe,ee,ne,Z,te,ie,ce,ue,_e,he,le,re,Ce,me,pe,J,K],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"],changeDetection:0})}}return r})();export{et as ReadyToShipComponent};
1
+ import{a as ge,b as Ce}from"./chunk-NDOVDHNA.js";import{a as pe,b as ce,c as ue}from"./chunk-CKU644YK.js";import{a as he}from"./chunk-Q2XY5N3O.js";import{a as O}from"./chunk-URNP457I.js";import{a as _e}from"./chunk-4MYXPN55.js";import"./chunk-LCIOJHJ4.js";import"./chunk-FDYHLFQ3.js";import{a as me}from"./chunk-7T332QJG.js";import"./chunk-GK6WYUPQ.js";import"./chunk-WXZ5XRM6.js";import"./chunk-BDUUVK5L.js";import"./chunk-L2ENNT5V.js";import{a as de}from"./chunk-ZA4X34GE.js";import"./chunk-IFFI5CMD.js";import{a as se}from"./chunk-OJ4GCASY.js";import"./chunk-RVHJIVQ5.js";import"./chunk-MKENTZJA.js";import"./chunk-V3PUPGL5.js";import"./chunk-2SCD4QZY.js";import"./chunk-K227XGG2.js";import"./chunk-PRLMMKRO.js";import"./chunk-MMGI42DQ.js";import"./chunk-2QRSAAJG.js";import"./chunk-ACIMXBIC.js";import"./chunk-3ANHDTTL.js";import"./chunk-YYY663CV.js";import"./chunk-N77J6LFN.js";import"./chunk-TRTDBHQI.js";import{b as ae}from"./chunk-5DRZPE5O.js";import"./chunk-MZRZ7VV3.js";import"./chunk-M65GNQVQ.js";import{a as le}from"./chunk-MWUZF6ZW.js";import"./chunk-GF2RVIIT.js";import"./chunk-ITKXL7DT.js";import"./chunk-4AL6NJY5.js";import"./chunk-YOYMZEPB.js";import"./chunk-56UGSRXX.js";import"./chunk-UB22GZAR.js";import"./chunk-F7RHG53H.js";import"./chunk-X22WXNSF.js";import"./chunk-P6EDV7BS.js";import"./chunk-TVKTNDDY.js";import"./chunk-DGB7L5EQ.js";import"./chunk-7YP3O2JY.js";import"./chunk-BKB3Y5UC.js";import"./chunk-TPJEJZPT.js";import"./chunk-ISRTMJUH.js";import"./chunk-2VWSIT3Y.js";import"./chunk-2PONPJQD.js";import{b as re}from"./chunk-BQCLUDBO.js";import"./chunk-TM7PL3CC.js";import"./chunk-GQRBV5VY.js";import"./chunk-CXGF2BT5.js";import"./chunk-QXRG5XYP.js";import"./chunk-FDTKJPLI.js";import"./chunk-I4MUFYEG.js";import{b as X}from"./chunk-NNVT5X6O.js";import{A as oe,b as Z,c as ee,h as te,m as ie,o as ne}from"./chunk-P6BSXX22.js";import"./chunk-EISQQYRT.js";import"./chunk-34FX4M3J.js";import{b as Y}from"./chunk-M5YUVUTR.js";import"./chunk-RRBAJSPM.js";import"./chunk-D7WVAWLI.js";import{B as J,D as K}from"./chunk-MLQKT6FW.js";import"./chunk-ASFPLYOZ.js";import{$c as j,Dc as D,Eb as P,Ec as L,Fc as A,Ga as T,Nc as z,Oc as s,Pc as v,Qc as b,Sc as B,Tc as H,Uc as W,Vc as $,Wc as Q,Xc as R,bc as f,bd as q,dc as S,ec as N,gc as k,hc as I,ic as p,jc as t,kb as F,kc as n,kd as w,lc as h,ld as E,mb as l,md as U,na as x,sc as y,sd as G,ua as d,va as m,xc as _,zc as c}from"./chunk-KCXC4XYC.js";import"./chunk-WFMAM73Y.js";import{a as M,b as V}from"./chunk-66YHNWRR.js";var fe=["contextMenu"],Se=r=>({"td-cell-hover":r});function ye(r,g){if(r&1){let e=y();t(0,"button",20),_("click",function(){d(e);let i=c();return m(i.setMultipleFulfillment())}),s(1," Set Fulfillment "),n()}}function ve(r,g){if(r&1&&h(0,"variants-dropdown",38),r&2){let e=c().$implicit;p("variants",e==null?null:e.Variants)}}function be(r,g){if(r&1&&h(0,"variant-with-image",39),r&2){let e=c().$implicit;p("variant",e==null?null:e.Variants[0])}}function xe(r,g){if(r&1&&(t(0,"span"),s(1),n()),r&2){let e=c().$implicit;l(),b("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Te(r,g){if(r&1){let e=y();t(0,"div",41)(1,"button",45),_("click",function(){d(e);let i=c().$implicit,a=c(2);return m(a.refreshShippingAndRefNumber(i))}),h(2,"i",46),n()()}}function we(r,g){if(r&1){let e=y();t(0,"button",47),_("click",function(){d(e);let i=c().$implicit,a=c(2);return m(a.onSetFulfillment(i))}),s(1," Set Fulfillment "),n()}}function Me(r,g){if(r&1){let e=y();t(0,"tr")(1,"td")(2,"input",30),W("ngModelChange",function(i){let a=d(e).$implicit;return H(a.selected,i)||(a.selected=i),m(i)}),_("ngModelChange",function(){d(e);let i=c(2),a=R(0);return m(i.onSelectOrder(a))}),n()(),t(3,"td")(4,"div",31),h(5,"img",32),w(6,"channelImage"),t(7,"div",33)(8,"div"),s(9),n(),t(10,"small",34)(11,"span"),s(12),n()()()()(),t(13,"td")(14,"div",35)(15,"div"),h(16,"order-link",36),n(),t(17,"small"),s(18),w(19,"date"),n(),h(20,"br"),t(21,"small"),h(22,"i",37),s(23),n()()(),t(24,"td"),f(25,ve,1,1,"variants-dropdown",38)(26,be,1,1,"variant-with-image",39),n(),t(27,"td",40),s(28),w(29,"number"),n(),t(30,"td",41)(31,"div",42)(32,"div",35)(33,"div",43)(34,"span"),s(35),n(),f(36,xe,2,1,"span"),n(),t(37,"small"),s(38),n()(),f(39,Te,3,0,"div",41),n()(),t(40,"td",41),f(41,we,2,0,"button",44),n()()}if(r&2){let e=g.$implicit,o=c(2);l(2),B("ngModel",e.selected),p("disabled",o.selectedChannelType()!=null&&o.selectedChannelType()!=e.MarketType),l(3),p("src",E(6,18,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(4),v(e.Outlet),l(3),v(e.ChannelName),l(4),p("order",e),l(2),b(" ",U(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(5),b(" ",e.Customer," "),l(),z(q(25,Se,(e.Variants==null?null:e.Variants.length)>1)),l(),S((e.Variants==null?null:e.Variants.length)>1?25:26),l(3),v(E(29,23,e.Amount)),l(7),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),S(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?36:-1),l(2),b(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),l(),S(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?39:-1),l(2),S((e==null?null:e.MarketType)!=o.channelType.WooCommerce?41:-1)}}function Ve(r,g){if(r&1){let e=y();t(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),h(4,"th",24),t(5,"th",25),s(6,"Outlet"),n(),t(7,"th",25),s(8,"Number"),n(),t(9,"th"),s(10,"Items"),n(),t(11,"th",26),s(12,"Amount"),n(),t(13,"th",27),s(14,"Shipping"),n(),h(15,"th",28),n()(),t(16,"tbody"),k(17,Me,42,27,"tr",null,N),n()(),t(19,"app-custom-paginator",29),_("next",function(){d(e);let i=c();return m(i.initReadyToShip())})("previous",function(){d(e);let i=c();return m(i.initReadyToShip())}),n()()}if(r&2){let e=c(),o=R(0);l(17),I(o),l(2),p("filter",e.filter())("totaldata",o==null?null:o.length)}}function Re(r,g){r&1&&(t(0,"div",18),h(1,"app-empty-state"),n())}var et=(()=>{class r{constructor(){this.toastr=x(Y),this.orderService=x(O),this.fulfillmentService=x(ge),this.channelType=X,this.selectedOrders=T([]),this.selectedChannelType=G(()=>{let e=null;return this.selectedOrders().length>0&&(e=this.selectedOrders()[0].MarketType),e}),this.readyToShip=T([]),this.filter=T({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}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(o=>V(M({},o),{From:e})),this.initReadyToShip()}initReadyToShip(){this.orderService.getReadyToShipOrders(this.filter()).subscribe(e=>{this.readyToShip.set(e),this.selectedOrders.set([])})}onFilterPropertyChange(e,o){this.filter.update(i=>V(M({},i),{[e]:o}))}onSetFulfillment(e){this.fulfillmentService.setFulfillmentOrder(e).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(e){this.orderService.refreshShippingCourier(e.ShopID,e.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(e){let o=e.filter(i=>i.selected);this.selectedOrders.set(o)}onMouseHover(e,o){(!o.LogisticService?.Name||!o.ReferenceNumber)&&this.contextMenuEl.show(e,o)}onSelectContextItem(e){e.item?.id==="refresh"&&this.refreshShippingAndRefNumber(e.data)}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=P({type:r,selectors:[["app-ready-to-ship"]],viewQuery:function(o,i){if(o&1&&D(fe,5),o&2){let a;L(a=A())&&(i.contextMenuEl=a.first)}},features:[j([O])],decls:36,vars:11,consts:[["contextMenu",""],["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["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"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],[2,"width","150px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[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"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(o,i){if(o&1){let a=y();$(0),t(1,"mainpanel",1),_("onSubmit",function(){return d(a),m(i.initReadyToShip())})("textChange",function(u){return d(a),m(i.onFilterPropertyChange("Number",u))}),t(2,"actions"),f(3,ye,2,0,"button",2),t(4,"a",3),h(5,"i",4),t(6,"span"),s(7,"Order Fulfillment Display"),n()()(),t(8,"filters")(9,"div")(10,"label",5),s(11,"Channel"),n(),t(12,"app-channel-options-v2",6),_("ngModelChange",function(u){return d(a),m(i.onFilterPropertyChange("ListChannelID",u))}),n()(),t(13,"div",7)(14,"label",5),s(15,"From/To"),n(),t(16,"div",8)(17,"datepicker",9),_("dateChange",function(u){return d(a),m(i.onFilterPropertyChange("From",u))}),n()(),t(18,"div")(19,"datepicker",10),_("dateChange",function(u){return d(a),m(i.onFilterPropertyChange("To",u))}),n()()(),t(20,"div",7)(21,"label",11),s(22,"Page Number"),n(),t(23,"input",12),_("ngModelChange",function(u){return d(a),m(i.onFilterPropertyChange("PageNumber",+u))}),n()(),t(24,"div",7)(25,"label",11),s(26,"Page Size"),n(),t(27,"input",13),_("ngModelChange",function(u){return d(a),m(i.onFilterPropertyChange("PageSize",+u))}),n()()(),t(28,"content")(29,"div",14)(30,"div",15)(31,"div",16),f(32,Ve,20,2,"div",17)(33,Re,2,0,"div",18),n()()()()(),t(34,"app-context-menu",19,0),_("onSelectItem",function(u){return d(a),m(i.onSelectContextItem(u))}),n()}if(o&2){let a=Q(i.readyToShip());l(),p("text",i.filter().Number),l(2),S(i.selectedOrders().length>0?3:-1),l(9),p("multiple",!0)("ngModel",i.filter().ListChannelID),l(5),p("date",i.filter().From),l(2),p("date",i.filter().To),l(4),p("ngModel",i.filter().PageNumber),l(4),p("ngModel",i.filter().PageSize),l(5),S(a.length>0?32:33),l(2),p("items",i.contextMenuItems)}},dependencies:[ae,se,de,oe,ee,ne,Z,te,ie,ce,ue,_e,he,le,re,Ce,me,pe,J,K],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"],changeDetection:0})}}return r})();export{et as ReadyToShipComponent};