marketplacepos 6.40.2 → 6.40.4

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 (65) hide show
  1. package/Marketplace/{chunk-IT4SNYQK.js → chunk-22PAOISA.js} +1 -1
  2. package/Marketplace/{chunk-JEFVOPGN.js → chunk-2OMZDRF7.js} +1 -1
  3. package/Marketplace/{chunk-2EBT5M4I.js → chunk-37JB43TZ.js} +1 -1
  4. package/Marketplace/{chunk-X3C5DFLO.js → chunk-3XE3EN7L.js} +1 -1
  5. package/Marketplace/{chunk-NXS7JQPY.js → chunk-4N6B4XPI.js} +1 -1
  6. package/Marketplace/{chunk-CXQB3FE2.js → chunk-4XDDXOFA.js} +1 -1
  7. package/Marketplace/{chunk-WTTWRCNO.js → chunk-5GWXAIIJ.js} +1 -1
  8. package/Marketplace/{chunk-37G3PDXN.js → chunk-66UZJMEG.js} +1 -1
  9. package/Marketplace/{chunk-OX2QJCC3.js → chunk-6AJ6OXYZ.js} +1 -1
  10. package/Marketplace/{chunk-JOU7HLA4.js → chunk-6ALRREVQ.js} +1 -1
  11. package/Marketplace/{chunk-TU34BDDQ.js → chunk-6ENJB5FQ.js} +1 -1
  12. package/Marketplace/{chunk-2YIHYSPU.js → chunk-6QPID2HF.js} +1 -1
  13. package/Marketplace/{chunk-CRBJDNL7.js → chunk-7HUL6FCS.js} +1 -1
  14. package/Marketplace/{chunk-DVEXD44H.js → chunk-7TX6KRZ4.js} +1 -1
  15. package/Marketplace/{chunk-L3MO3ZCZ.js → chunk-BESHMFY6.js} +1 -1
  16. package/Marketplace/{chunk-52PEZEAZ.js → chunk-BQPQW722.js} +1 -1
  17. package/Marketplace/{chunk-MZU7P2T5.js → chunk-CDTK6FFA.js} +1 -1
  18. package/Marketplace/{chunk-ZSG2EXIR.js → chunk-E4KDJSXX.js} +1 -1
  19. package/Marketplace/{chunk-YHCPLYK6.js → chunk-FCMWKOHX.js} +1 -1
  20. package/Marketplace/{chunk-OTMZGSFO.js → chunk-G5TV2GFL.js} +1 -1
  21. package/Marketplace/{chunk-XK4J4PVA.js → chunk-GBIIMISP.js} +1 -1
  22. package/Marketplace/{chunk-RSR5AZTI.js → chunk-GEXGW662.js} +1 -1
  23. package/Marketplace/{chunk-C5O6VJ2D.js → chunk-GUTJ3MLW.js} +1 -1
  24. package/Marketplace/{chunk-QQFM2BFS.js → chunk-HWKV26BN.js} +1 -1
  25. package/Marketplace/{chunk-SDVM2OGI.js → chunk-HZUZLMFL.js} +1 -1
  26. package/Marketplace/{chunk-4WT2Y6TT.js → chunk-IJDOY3YV.js} +1 -1
  27. package/Marketplace/{chunk-OCGSMJT2.js → chunk-JEABFM76.js} +1 -1
  28. package/Marketplace/{chunk-LUWEYZ6D.js → chunk-JI77INPE.js} +1 -1
  29. package/Marketplace/{chunk-YU2EK4WR.js → chunk-JIUVRTPI.js} +1 -1
  30. package/Marketplace/{chunk-546FKO4L.js → chunk-JWTJ66SA.js} +1 -1
  31. package/Marketplace/{chunk-6BLHGE4W.js → chunk-KP6FGYJN.js} +1 -1
  32. package/Marketplace/{chunk-P4PGUHI5.js → chunk-L6QFVUU7.js} +1 -1
  33. package/Marketplace/{chunk-6NML7F6L.js → chunk-L7RAPDGZ.js} +1 -1
  34. package/Marketplace/{chunk-AZLIWO5Y.js → chunk-LPIY7K7Z.js} +2 -2
  35. package/Marketplace/{chunk-BJSFGAT5.js → chunk-M5CULQQ4.js} +1 -1
  36. package/Marketplace/{chunk-H43OTNIB.js → chunk-N2KP3GEL.js} +1 -1
  37. package/Marketplace/{chunk-AKL56CT3.js → chunk-NBYPEOMQ.js} +1 -1
  38. package/Marketplace/{chunk-GSYHZ24Q.js → chunk-NXYCQVDC.js} +1 -1
  39. package/Marketplace/{chunk-WVJMN3F2.js → chunk-OJ3IS7XD.js} +1 -1
  40. package/Marketplace/{chunk-GSRXREXU.js → chunk-P6VAX5LR.js} +1 -1
  41. package/Marketplace/{chunk-DO2G52AO.js → chunk-PIULMB67.js} +1 -1
  42. package/Marketplace/{chunk-6B7FZZSK.js → chunk-PMYXXR53.js} +1 -1
  43. package/Marketplace/{chunk-VH4YX2BF.js → chunk-PN7TXTZW.js} +1 -1
  44. package/Marketplace/{chunk-4DQBPYFS.js → chunk-QGQQJIPG.js} +1 -1
  45. package/Marketplace/{chunk-7WMEMBD2.js → chunk-RL4QFD7G.js} +1 -1
  46. package/Marketplace/{chunk-755EU56E.js → chunk-RSZ33JUY.js} +1 -1
  47. package/Marketplace/{chunk-RCFVKK5D.js → chunk-SI4IETG5.js} +1 -1
  48. package/Marketplace/{chunk-TFDDAGWF.js → chunk-SPLRAPME.js} +1 -1
  49. package/Marketplace/{chunk-K6PWLV74.js → chunk-SQZ6YXJM.js} +1 -1
  50. package/Marketplace/{chunk-TR7UPFQS.js → chunk-TAG4IJAY.js} +1 -1
  51. package/Marketplace/{chunk-E53SRMQZ.js → chunk-TT5XE57K.js} +1 -1
  52. package/Marketplace/{chunk-7X3KALOK.js → chunk-UAB7S7RK.js} +1 -1
  53. package/Marketplace/{chunk-FKVH6CLY.js → chunk-URBB3IWO.js} +1 -1
  54. package/Marketplace/{chunk-NP3B3XBB.js → chunk-UXWBNA3P.js} +1 -1
  55. package/Marketplace/{chunk-SF34YBS7.js → chunk-V4YAY2YY.js} +1 -1
  56. package/Marketplace/{chunk-PB3JMCII.js → chunk-WDOFFTQG.js} +1 -1
  57. package/Marketplace/{chunk-K3MEX6GQ.js → chunk-YWUUMFP6.js} +1 -1
  58. package/Marketplace/chunk-Z4QNLDXL.js +3 -0
  59. package/Marketplace/{chunk-4QV2PDMF.js → chunk-Z7SMVYYU.js} +1 -1
  60. package/Marketplace/{chunk-NDDUXXJF.js → chunk-ZMTWUKAI.js} +1 -1
  61. package/Marketplace/{chunk-A4TBJ6UZ.js → chunk-ZOF6UEJP.js} +1 -1
  62. package/Marketplace/index.html +2 -2
  63. package/Marketplace/{main-NQGKSBMZ.js → main-EXG3CFBS.js} +2 -2
  64. package/package.json +1 -1
  65. package/Marketplace/chunk-EHVBVNXC.js +0 -3
@@ -1 +1 @@
1
- import{a as e}from"./chunk-TFDDAGWF.js";import{a as s}from"./chunk-7KBF6RRT.js";import"./chunk-CBPURQKN.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-C5O6VJ2D.js";import"./chunk-TU34BDDQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import"./chunk-ZE4OOGMT.js";import{c as d,g as l}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as a,cc as p,dc as c,ec as m,fc as o,gb as r,yb as i}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var u=(()=>{class t{constructor(){this.tabs=a([{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"},{Title:"Tracking API",Url:"/menu/json-api/tracking-api"},{Title:"Return API",Url:"/menu/json-api/return-api"}])}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=i({type:t,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,h){n&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),m()()(),o(4,"router-outlet")),n&2&&(r(3),p("Tabs",h.tabs()))},dependencies:[s,l,d],encapsulation:2,changeDetection:0})}}return t})();var w=[{path:"",component:u,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-BJSFGAT5.js").then(t=>t.OrderApiComponent)},canActivate:[e],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-2EBT5M4I.js").then(t=>t.ProductApiComponent)},canActivate:[e],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-6BLHGE4W.js").then(t=>t.EscrowApiComponent)},canActivate:[e],data:{title:"Escrow API"}},{path:"tracking-api",loadComponent(){return import("./chunk-NXS7JQPY.js").then(t=>t.TrackingApiComponent)},canActivate:[e],data:{title:"Tracking API"}},{path:"return-api",loadComponent(){return import("./chunk-GSYHZ24Q.js").then(t=>t.ReturnApiComponent)},canActivate:[e],data:{title:"Return API"}}]}];export{w as routes};
1
+ import{a as e}from"./chunk-SPLRAPME.js";import{a as s}from"./chunk-7KBF6RRT.js";import"./chunk-CBPURQKN.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-GUTJ3MLW.js";import"./chunk-6ENJB5FQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import"./chunk-ZE4OOGMT.js";import{c as d,g as l}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as a,cc as p,dc as c,ec as m,fc as o,gb as r,yb as i}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var u=(()=>{class t{constructor(){this.tabs=a([{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"},{Title:"Tracking API",Url:"/menu/json-api/tracking-api"},{Title:"Return API",Url:"/menu/json-api/return-api"}])}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=i({type:t,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,h){n&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),m()()(),o(4,"router-outlet")),n&2&&(r(3),p("Tabs",h.tabs()))},dependencies:[s,l,d],encapsulation:2,changeDetection:0})}}return t})();var w=[{path:"",component:u,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-M5CULQQ4.js").then(t=>t.OrderApiComponent)},canActivate:[e],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-37JB43TZ.js").then(t=>t.ProductApiComponent)},canActivate:[e],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-KP6FGYJN.js").then(t=>t.EscrowApiComponent)},canActivate:[e],data:{title:"Escrow API"}},{path:"tracking-api",loadComponent(){return import("./chunk-4N6B4XPI.js").then(t=>t.TrackingApiComponent)},canActivate:[e],data:{title:"Tracking API"}},{path:"return-api",loadComponent(){return import("./chunk-NXYCQVDC.js").then(t=>t.ReturnApiComponent)},canActivate:[e],data:{title:"Return API"}}]}];export{w as routes};
@@ -1,4 +1,4 @@
1
- import{a as ae}from"./chunk-CLX6T6AB.js";import{a as Xe,b as et,c as tt,e as nt,f as it,g as ot}from"./chunk-UASBQJZD.js";import{g as at,i as rt,j as lt}from"./chunk-LLMHCE7Y.js";import"./chunk-DCGQK4V6.js";import{a as Ze,b as qe,c as Je}from"./chunk-DEBF436Y.js";import"./chunk-RZM45AEI.js";import"./chunk-H276HPOG.js";import"./chunk-SJBVLNCR.js";import{a as Ke,b as Qe}from"./chunk-P2ISUSTI.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{a as Ae,b as $e,c as We}from"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import{a as ze}from"./chunk-7X3KALOK.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-A4TBJ6UZ.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{c as Oe,d as Re,e as Be}from"./chunk-474G6BPL.js";import{b as Fe}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import{a as ne}from"./chunk-CBPURQKN.js";import"./chunk-GAI4CMX3.js";import{f as je,g as Ge,h as Ue,i as Ye,j as He}from"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import{e as Le}from"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import{qa as Pe}from"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import{b as Ie}from"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as te}from"./chunk-C5O6VJ2D.js";import"./chunk-TU34BDDQ.js";import{a as Ee}from"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as ee}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import{b as X,c as y}from"./chunk-NNVT5X6O.js";import{b as Ve,c as ke,h as W,m as L,x as Ne,z}from"./chunk-7HUEGPJN.js";import{b as be,e as Te}from"./chunk-ZE4OOGMT.js";import{g as Me}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as $,z as xe}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as F,Aa as h,Da as Q,Dc as N,Eb as k,Fc as Z,Hc as B,Ic as d,Jc as b,Kc as E,Mc as _e,Nc as we,Oc as Ce,S as pe,Sc as ve,Uc as Se,Vc as q,Wc as U,Xb as w,Y as me,Yc as A,Zb as C,ac as O,bc as R,ca as ce,cc as p,db as ue,dc as o,ec as a,ed as Y,fc as v,fd as De,gb as l,gc as x,gd as oe,ha as S,hc as M,i as de,ic as ie,id as H,mc as D,md as J,oa as m,pa as c,r as se,rc as g,rd as ye,sd as V,tc as _,wa as I,xc as he,yb as P,yc as fe,zc as ge}from"./chunk-5VYDZBNH.js";import{a as re,b as le}from"./chunk-QWWW7GFA.js";function ht(t,s){if(t&1&&(x(0,"tr")(1,"td"),d(2),M(),x(3,"td"),d(4),M(),x(5,"td"),d(6),M(),x(7,"td"),d(8),M()()),t&2){let e=s.$implicit,i=s.$index;Z("over-due",e.Exception),l(2),b(i+1),l(2),b(e.Number),l(2),b(e.Status),l(2),b(e.Exception)}}function ft(t,s){if(t&1&&O(0,ht,9,6,"tr",6,F),t&2){let e,i=_();R((e=i.downloadResult())==null?null:e.Body)}}function gt(t,s){t&1&&(x(0,"tr",5)(1,"td",7)(2,"div",8),ie(3,"i",9),M(),x(4,"h4",10),d(5," There is no order to processed "),M()()())}var dt=(()=>{class t{constructor(){this.downloadResult=V()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:15,vars:1,consts:[[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[1,"text-center"],[3,"over-due"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(i,n){if(i&1&&(x(0,"div",0)(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr"),ie(5,"th",4),x(6,"th"),d(7,"Order Number"),M(),x(8,"th"),d(9,"Status"),M(),x(10,"th"),d(11,"Exception"),M()()(),x(12,"tbody"),w(13,ft,2,0)(14,gt,6,0,"tr",5),M()()()()),i&2){let r;l(13),C(((r=n.downloadResult())==null||r.Body==null?null:r.Body.length)>0?13:14)}},encapsulation:2,changeDetection:0})}}return t})();var _t=()=>({standalone:!0}),pt=(()=>{class t{constructor(){this.datePipe=S($),this.fullWidth=V(!1),this.placeholder=V(""),this.timeChange=new I}ngOnInit(){}onTimeChange(e){let i=null;e&&(i=this.datePipe.transform(e,"HH:mm")),this.timeChange.emit(i),this.onTimePickerChange()}onShowCalendar(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onTimePickerChange(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-timepicker"]],inputs:{time:"time",fullWidth:[1,"fullWidth"],placeholder:[1,"placeholder"]},outputs:{timeChange:"timeChange"},decls:4,vars:8,consts:[["myCalendar",""],["styleClass","custom-height","id","shippingTime","appendTo","body",3,"ngModelChange","onSelect","baseZIndex","ngModel","timeOnly","ngModelOptions","placeholder"],["size","small","label","Close",3,"click"]],template:function(i,n){if(i&1){let r=D();o(0,"p-datepicker",1,0),Ce("ngModelChange",function(u){return m(r),we(n.time,u)||(n.time=u),c(u)}),g("ngModelChange",function(u){return m(r),c(n.onTimeChange(u))})("onSelect",function(){return m(r),c(n.onShowCalendar())}),o(2,"p-footer")(3,"p-button",2),g("click",function(){return m(r),N(1).hideOverlay(),c(n.onShowCalendar())}),a()()()}i&2&&(Z("full-width",n.fullWidth()),p("baseZIndex",1100),_e("ngModel",n.time),p("timeOnly",!0)("ngModelOptions",U(7,_t))("placeholder",n.placeholder()))},dependencies:[z,W,L,Je,qe,Ze,Pe],styles:["p-datepicker span.p-datepicker.custom-height{height:44px;width:70px} p-datepicker.full-width span.p-datepicker.custom-height{height:44px;width:100%!important}"],changeDetection:0})}}return t})();var j=(()=>{class t{constructor(){this.httpService=S(Te),this.toastr=S(be),this.datePipe=S($)}gerChannelDetailById(e){return this.httpService.post(ee.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(ee.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(ee.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(me(i=>{i.Data?.length===0&&this.toastrEmptyPreview(e)})):de}toastrEmptyPreview(e){let i=this.datePipe.transform(e.From,"dd MMM yyyy"),n=this.datePipe.transform(e.To,"dd MMM yyyy"),r=e.TimeFrom?e.TimeFrom:"",f=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${i} ${r} to ${n} ${f}!`,"No Orders!")}validateDatePreview(e){let i=!0;return e.downloadType==!0?y.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),i=!1):y.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),i=!1),i}getDateTitle(e,i){let n=y.formatTitleFromDate(new Date(e),new Date(i)),r=this.datePipe.transform(e,n),f=this.datePipe.transform(i,"dd MMM yyyy");return`${n==null?"":r+"-"} ${f}`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=ce({token:t,factory:t.\u0275fac})}}return t})();function wt(t,s){if(t&1&&(o(0,"ng-option",7),v(1,"img",17),d(2),a()),t&2){let e=s.$implicit;p("value",e.ID),l(),p("src",e==null?null:e.Img,ue),l(),E("",e.Name," ")}}function Ct(t,s){if(t&1){let e=D();o(0,"div",8)(1,"div",4)(2,"h5"),d(3,"Type"),a(),o(4,"p",5),d(5,"Select Type want to download"),a()(),o(6,"div",4)(7,"div",18)(8,"div")(9,"mat-radio-group",19),g("ngModelChange",function(n){m(e);let r=_();return r.downloadType.set(n),c(r.onDownloadTypeChange())}),o(10,"mat-radio-button",20),d(11," Orders "),a(),o(12,"mat-radio-button",21),d(13," Disbursement "),a()()()(),o(14,"div",22)(15,"div",23),v(16,"i",24),a(),o(17,"p",25),d(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(t&2){let e=_();l(9),p("ngModel",e.downloadType()),l(),p("value",!1),l(2),p("value",!0)}}function vt(t,s){t&1&&(o(0,"p",5),d(1," Select Disbursement date "),o(2,"span",26),d(3,"(payment date / order complete date)"),a(),d(4," of the channel you want to download (Max 1 Week). "),a())}function St(t,s){t&1&&(o(0,"p",5),d(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function Dt(t,s){if(t&1){let e=D();o(0,"div",16)(1,"app-timepicker",27),g("timeChange",function(n){m(e);let r=_();return r.startTime.set(n),c(r.onStartTimeChange())}),a(),o(2,"span",28),d(3,"-"),a(),o(4,"app-timepicker",27),g("timeChange",function(n){m(e);let r=_();return r.endTime.set(n),c(r.onEndTimeChange())}),a()()}if(t&2){let e=_();l(),p("time",e.startTime()),l(3),p("time",e.endTime())}}var mt=(()=>{class t{constructor(){this.reset=V(!1),this.authService=S(te),this.tokenService=S(Ee),this.downloadService=S(j),this.downloadType=h(!1),this.selectedChannelId=h(null),this.channelOptions=h(this.authService.getChannels()),this.channelType=X,this.selectedChannel=h(null),this.showTimePicker=h(!1),this.startDate=h(null),this.endDate=h(null),this.startTime=h("00:00"),this.endTime=h("23:59"),this.minDate=h(new Date),this.maxDate=h(new Date),this.filterData=new I,this._onRememberMeChange=ye({alias:"onRememberMeChange"}),this.rememberMe=h(!1),Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let e=this.tokenService?.getTokenValue(),i=e?.DownloadRange?JSON.parse(e?.DownloadRange):0;if(i<=0)this.minDate.set(null),this.maxDate.set(null);else{let n=new Date,r=y.addDays(n,i-1);this.minDate.set(r)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(se(e=>e?.Model),pe(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=y.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}onChangeRememberMe(e){this._onRememberMeChange.emit(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange",_onRememberMeChange:"onRememberMeChange"},features:[q([j,Le()])],decls:32,vars:13,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"row","mt-6"],[1,"col-12","d-flex","align-items-center"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"col-6","d-flex","align-items-center","gap-2","mt-10"],["type","checkbox",2,"width","16px","height","16px",3,"ngModelChange","ngModel"],[1,"ms-2"],[1,"mt-8","d-flex","align-items-center"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(i,n){if(i&1){let r=D();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),d(5,"Select a Channel"),a(),o(6,"p",5),d(7,"Select Channel want to download order"),a()(),o(8,"div",4)(9,"ng-select",6),g("ngModelChange",function(u){return m(r),n.selectedChannelId.set(u),c(n.onSelectChannel())}),O(10,wt,3,3,"ng-option",7,F),a()()(),w(12,Ct,19,3,"div",8),Y(13,"async"),o(14,"div",8)(15,"div",4)(16,"h5"),d(17,"Date Range"),a(),w(18,vt,5,0,"p",5)(19,St,2,0,"p",5),a(),o(20,"div",4)(21,"div",9)(22,"mat-date-range-input",10)(23,"input",11),g("ngModelChange",function(u){return m(r),c(n.startDate.set(u))})("click",function(){m(r);let u=N(26);return c(u.open())}),a(),o(24,"input",12),g("ngModelChange",function(u){return m(r),n.endDate.set(u),c(n.onFilterDateChange())})("click",function(){m(r);let u=N(26);return c(u.open())}),a()(),v(25,"mat-date-range-picker",null,0),a(),o(27,"div",13)(28,"input",14),g("ngModelChange",function(u){return m(r),n.rememberMe.set(u),c(n.onChangeRememberMe(u))}),a(),o(29,"h5",15),d(30,"Save Date"),a()(),w(31,Dt,5,2,"div",16),a()()()()}if(i&2){let r,f,u,ut=N(26);l(9),p("clearable",!1)("ngModel",n.selectedChannelId()),l(),R(n.channelOptions()),l(2),C((r=De(13,11,n.channelDetail$))!=null&&r.ServiceFeeWriteOff&&((r=n.selectedChannel())==null?null:r.TypeID)==n.channelType.Tokopedia?12:-1),l(6),C(n.downloadType()&&((f=n.selectedChannel())==null?null:f.TypeID)==n.channelType.Tokopedia?18:19),l(4),p("rangePicker",ut)("min",n.minDate())("max",n.maxDate()),l(),p("ngModel",n.startDate()),l(),p("ngModel",n.endDate()),l(4),p("ngModel",n.rememberMe()),l(3),C(n.showTimePicker()&&((u=n.selectedChannel())==null?null:u.TypeID)!=n.channelType.Plugo?31:-1)}},dependencies:[Be,Re,Oe,We,Ae,$e,z,ke,Ve,W,Ne,L,pt,Ye,je,He,Ge,Ue,xe],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"],changeDetection:0})}}return t})();var T=(function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t})(T||{});var G=(function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t})(G||{});var yt=(t,s)=>({"btn-secondary text-white":t,"btn-outline-dark":s}),xt=(t,s)=>({"btn-success":t,"btn-outline-success":s}),bt=(t,s)=>({"btn-warning text-white":t,"btn-outline-warning":s}),Tt=(t,s)=>({"btn-danger":t,"btn-outline-danger":s}),Mt=()=>({"min-width":"100%"}),Et=()=>({minWidth:"14rem"}),Pt=(t,s)=>({"over-due-today":t,"over-due":s});function Vt(t,s){t&1&&d(0," Created Date ")}function kt(t,s){t&1&&d(0," Modified Date ")}function Nt(t,s){if(t&1){let e=D();o(0,"p-multiselect",24),g("onChange",function(n){let r=m(e).filterCallback;return c(r(n.value))}),a()}if(t&2){let e=s.$implicit,i=_(2);p("ngModel",e)("options",i.channelStatusOptions())("panelStyle",U(3,Et))}}function It(t,s){if(t&1&&(o(0,"tr"),v(1,"th",18),o(2,"th",19),d(3,"Number"),a(),o(4,"th",20),w(5,Vt,1,0)(6,kt,1,0),a(),o(7,"th",21)(8,"div",22),d(9," Channel "),o(10,"p-columnFilter",23),k(11,Nt,1,4,"ng-template",null,3,H),a()()(),o(13,"th",21),d(14,"POS Status"),a(),o(15,"th"),d(16,"Action"),a(),v(17,"th",18),a()),t&2){let e,i=_();l(5),C(((e=i.selectedChannel())==null?null:e.TypeID)===i.channelType.WooCommerce?5:6),l(5),p("showMatchModes",!1)("showOperator",!1)("showAddButton",!1)}}function Ft(t,s){if(t&1&&(o(0,"td"),d(1),Y(2,"date"),a()),t&2){let e=_().$implicit;l(),b(oe(2,1,e.Date,"dd MMM yyyy HH:mm:ss"))}}function Ot(t,s){if(t&1&&(o(0,"td"),d(1),Y(2,"date"),a()),t&2){let e=_().$implicit;l(),b(oe(2,1,e.Modified,"dd MMM yyyy HH:mm:ss"))}}function Rt(t,s){if(t&1&&(o(0,"span"),d(1),a()),t&2){let e=_().$implicit;l(),b(e.ActionString)}}function Bt(t,s){if(t&1&&(o(0,"li"),d(1),a()),t&2){let e=s.$implicit;l(),b(e)}}function At(t,s){if(t&1&&(o(0,"ul",26),O(1,Bt,2,1,"li",null,F),a()),t&2){let e=_().$implicit;l(),R(e.ActionString)}}function $t(t,s){if(t&1&&(o(0,"span",27),v(1,"i",28),a()),t&2){let e=_().$implicit;p("title",Se("Delivery : ",e.DeliveryState,`
1
+ import{a as ae}from"./chunk-CLX6T6AB.js";import{a as Xe,b as et,c as tt,e as nt,f as it,g as ot}from"./chunk-UASBQJZD.js";import{g as at,i as rt,j as lt}from"./chunk-LLMHCE7Y.js";import"./chunk-DCGQK4V6.js";import{a as Ze,b as qe,c as Je}from"./chunk-DEBF436Y.js";import"./chunk-RZM45AEI.js";import"./chunk-H276HPOG.js";import"./chunk-SJBVLNCR.js";import{a as Ke,b as Qe}from"./chunk-P2ISUSTI.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{a as Ae,b as $e,c as We}from"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import{a as ze}from"./chunk-UAB7S7RK.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-ZOF6UEJP.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{c as Oe,d as Re,e as Be}from"./chunk-474G6BPL.js";import{b as Fe}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import{a as ne}from"./chunk-CBPURQKN.js";import"./chunk-GAI4CMX3.js";import{f as je,g as Ge,h as Ue,i as Ye,j as He}from"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import{e as Le}from"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import{qa as Pe}from"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import{b as Ie}from"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as te}from"./chunk-GUTJ3MLW.js";import"./chunk-6ENJB5FQ.js";import{a as Ee}from"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as ee}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import{b as X,c as y}from"./chunk-NNVT5X6O.js";import{b as Ve,c as ke,h as W,m as L,x as Ne,z}from"./chunk-7HUEGPJN.js";import{b as be,e as Te}from"./chunk-ZE4OOGMT.js";import{g as Me}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as $,z as xe}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as F,Aa as h,Da as Q,Dc as N,Eb as k,Fc as Z,Hc as B,Ic as d,Jc as b,Kc as E,Mc as _e,Nc as we,Oc as Ce,S as pe,Sc as ve,Uc as Se,Vc as q,Wc as U,Xb as w,Y as me,Yc as A,Zb as C,ac as O,bc as R,ca as ce,cc as p,db as ue,dc as o,ec as a,ed as Y,fc as v,fd as De,gb as l,gc as x,gd as oe,ha as S,hc as M,i as de,ic as ie,id as H,mc as D,md as J,oa as m,pa as c,r as se,rc as g,rd as ye,sd as V,tc as _,wa as I,xc as he,yb as P,yc as fe,zc as ge}from"./chunk-5VYDZBNH.js";import{a as re,b as le}from"./chunk-QWWW7GFA.js";function ht(t,s){if(t&1&&(x(0,"tr")(1,"td"),d(2),M(),x(3,"td"),d(4),M(),x(5,"td"),d(6),M(),x(7,"td"),d(8),M()()),t&2){let e=s.$implicit,i=s.$index;Z("over-due",e.Exception),l(2),b(i+1),l(2),b(e.Number),l(2),b(e.Status),l(2),b(e.Exception)}}function ft(t,s){if(t&1&&O(0,ht,9,6,"tr",6,F),t&2){let e,i=_();R((e=i.downloadResult())==null?null:e.Body)}}function gt(t,s){t&1&&(x(0,"tr",5)(1,"td",7)(2,"div",8),ie(3,"i",9),M(),x(4,"h4",10),d(5," There is no order to processed "),M()()())}var dt=(()=>{class t{constructor(){this.downloadResult=V()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:15,vars:1,consts:[[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[1,"text-center"],[3,"over-due"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(i,n){if(i&1&&(x(0,"div",0)(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr"),ie(5,"th",4),x(6,"th"),d(7,"Order Number"),M(),x(8,"th"),d(9,"Status"),M(),x(10,"th"),d(11,"Exception"),M()()(),x(12,"tbody"),w(13,ft,2,0)(14,gt,6,0,"tr",5),M()()()()),i&2){let r;l(13),C(((r=n.downloadResult())==null||r.Body==null?null:r.Body.length)>0?13:14)}},encapsulation:2,changeDetection:0})}}return t})();var _t=()=>({standalone:!0}),pt=(()=>{class t{constructor(){this.datePipe=S($),this.fullWidth=V(!1),this.placeholder=V(""),this.timeChange=new I}ngOnInit(){}onTimeChange(e){let i=null;e&&(i=this.datePipe.transform(e,"HH:mm")),this.timeChange.emit(i),this.onTimePickerChange()}onShowCalendar(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onTimePickerChange(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-timepicker"]],inputs:{time:"time",fullWidth:[1,"fullWidth"],placeholder:[1,"placeholder"]},outputs:{timeChange:"timeChange"},decls:4,vars:8,consts:[["myCalendar",""],["styleClass","custom-height","id","shippingTime","appendTo","body",3,"ngModelChange","onSelect","baseZIndex","ngModel","timeOnly","ngModelOptions","placeholder"],["size","small","label","Close",3,"click"]],template:function(i,n){if(i&1){let r=D();o(0,"p-datepicker",1,0),Ce("ngModelChange",function(u){return m(r),we(n.time,u)||(n.time=u),c(u)}),g("ngModelChange",function(u){return m(r),c(n.onTimeChange(u))})("onSelect",function(){return m(r),c(n.onShowCalendar())}),o(2,"p-footer")(3,"p-button",2),g("click",function(){return m(r),N(1).hideOverlay(),c(n.onShowCalendar())}),a()()()}i&2&&(Z("full-width",n.fullWidth()),p("baseZIndex",1100),_e("ngModel",n.time),p("timeOnly",!0)("ngModelOptions",U(7,_t))("placeholder",n.placeholder()))},dependencies:[z,W,L,Je,qe,Ze,Pe],styles:["p-datepicker span.p-datepicker.custom-height{height:44px;width:70px} p-datepicker.full-width span.p-datepicker.custom-height{height:44px;width:100%!important}"],changeDetection:0})}}return t})();var j=(()=>{class t{constructor(){this.httpService=S(Te),this.toastr=S(be),this.datePipe=S($)}gerChannelDetailById(e){return this.httpService.post(ee.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(ee.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(ee.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(me(i=>{i.Data?.length===0&&this.toastrEmptyPreview(e)})):de}toastrEmptyPreview(e){let i=this.datePipe.transform(e.From,"dd MMM yyyy"),n=this.datePipe.transform(e.To,"dd MMM yyyy"),r=e.TimeFrom?e.TimeFrom:"",f=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${i} ${r} to ${n} ${f}!`,"No Orders!")}validateDatePreview(e){let i=!0;return e.downloadType==!0?y.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),i=!1):y.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),i=!1),i}getDateTitle(e,i){let n=y.formatTitleFromDate(new Date(e),new Date(i)),r=this.datePipe.transform(e,n),f=this.datePipe.transform(i,"dd MMM yyyy");return`${n==null?"":r+"-"} ${f}`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=ce({token:t,factory:t.\u0275fac})}}return t})();function wt(t,s){if(t&1&&(o(0,"ng-option",7),v(1,"img",17),d(2),a()),t&2){let e=s.$implicit;p("value",e.ID),l(),p("src",e==null?null:e.Img,ue),l(),E("",e.Name," ")}}function Ct(t,s){if(t&1){let e=D();o(0,"div",8)(1,"div",4)(2,"h5"),d(3,"Type"),a(),o(4,"p",5),d(5,"Select Type want to download"),a()(),o(6,"div",4)(7,"div",18)(8,"div")(9,"mat-radio-group",19),g("ngModelChange",function(n){m(e);let r=_();return r.downloadType.set(n),c(r.onDownloadTypeChange())}),o(10,"mat-radio-button",20),d(11," Orders "),a(),o(12,"mat-radio-button",21),d(13," Disbursement "),a()()()(),o(14,"div",22)(15,"div",23),v(16,"i",24),a(),o(17,"p",25),d(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(t&2){let e=_();l(9),p("ngModel",e.downloadType()),l(),p("value",!1),l(2),p("value",!0)}}function vt(t,s){t&1&&(o(0,"p",5),d(1," Select Disbursement date "),o(2,"span",26),d(3,"(payment date / order complete date)"),a(),d(4," of the channel you want to download (Max 1 Week). "),a())}function St(t,s){t&1&&(o(0,"p",5),d(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function Dt(t,s){if(t&1){let e=D();o(0,"div",16)(1,"app-timepicker",27),g("timeChange",function(n){m(e);let r=_();return r.startTime.set(n),c(r.onStartTimeChange())}),a(),o(2,"span",28),d(3,"-"),a(),o(4,"app-timepicker",27),g("timeChange",function(n){m(e);let r=_();return r.endTime.set(n),c(r.onEndTimeChange())}),a()()}if(t&2){let e=_();l(),p("time",e.startTime()),l(3),p("time",e.endTime())}}var mt=(()=>{class t{constructor(){this.reset=V(!1),this.authService=S(te),this.tokenService=S(Ee),this.downloadService=S(j),this.downloadType=h(!1),this.selectedChannelId=h(null),this.channelOptions=h(this.authService.getChannels()),this.channelType=X,this.selectedChannel=h(null),this.showTimePicker=h(!1),this.startDate=h(null),this.endDate=h(null),this.startTime=h("00:00"),this.endTime=h("23:59"),this.minDate=h(new Date),this.maxDate=h(new Date),this.filterData=new I,this._onRememberMeChange=ye({alias:"onRememberMeChange"}),this.rememberMe=h(!1),Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let e=this.tokenService?.getTokenValue(),i=e?.DownloadRange?JSON.parse(e?.DownloadRange):0;if(i<=0)this.minDate.set(null),this.maxDate.set(null);else{let n=new Date,r=y.addDays(n,i-1);this.minDate.set(r)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(se(e=>e?.Model),pe(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=y.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}onChangeRememberMe(e){this._onRememberMeChange.emit(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange",_onRememberMeChange:"onRememberMeChange"},features:[q([j,Le()])],decls:32,vars:13,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"row","mt-6"],[1,"col-12","d-flex","align-items-center"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"col-6","d-flex","align-items-center","gap-2","mt-10"],["type","checkbox",2,"width","16px","height","16px",3,"ngModelChange","ngModel"],[1,"ms-2"],[1,"mt-8","d-flex","align-items-center"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(i,n){if(i&1){let r=D();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),d(5,"Select a Channel"),a(),o(6,"p",5),d(7,"Select Channel want to download order"),a()(),o(8,"div",4)(9,"ng-select",6),g("ngModelChange",function(u){return m(r),n.selectedChannelId.set(u),c(n.onSelectChannel())}),O(10,wt,3,3,"ng-option",7,F),a()()(),w(12,Ct,19,3,"div",8),Y(13,"async"),o(14,"div",8)(15,"div",4)(16,"h5"),d(17,"Date Range"),a(),w(18,vt,5,0,"p",5)(19,St,2,0,"p",5),a(),o(20,"div",4)(21,"div",9)(22,"mat-date-range-input",10)(23,"input",11),g("ngModelChange",function(u){return m(r),c(n.startDate.set(u))})("click",function(){m(r);let u=N(26);return c(u.open())}),a(),o(24,"input",12),g("ngModelChange",function(u){return m(r),n.endDate.set(u),c(n.onFilterDateChange())})("click",function(){m(r);let u=N(26);return c(u.open())}),a()(),v(25,"mat-date-range-picker",null,0),a(),o(27,"div",13)(28,"input",14),g("ngModelChange",function(u){return m(r),n.rememberMe.set(u),c(n.onChangeRememberMe(u))}),a(),o(29,"h5",15),d(30,"Save Date"),a()(),w(31,Dt,5,2,"div",16),a()()()()}if(i&2){let r,f,u,ut=N(26);l(9),p("clearable",!1)("ngModel",n.selectedChannelId()),l(),R(n.channelOptions()),l(2),C((r=De(13,11,n.channelDetail$))!=null&&r.ServiceFeeWriteOff&&((r=n.selectedChannel())==null?null:r.TypeID)==n.channelType.Tokopedia?12:-1),l(6),C(n.downloadType()&&((f=n.selectedChannel())==null?null:f.TypeID)==n.channelType.Tokopedia?18:19),l(4),p("rangePicker",ut)("min",n.minDate())("max",n.maxDate()),l(),p("ngModel",n.startDate()),l(),p("ngModel",n.endDate()),l(4),p("ngModel",n.rememberMe()),l(3),C(n.showTimePicker()&&((u=n.selectedChannel())==null?null:u.TypeID)!=n.channelType.Plugo?31:-1)}},dependencies:[Be,Re,Oe,We,Ae,$e,z,ke,Ve,W,Ne,L,pt,Ye,je,He,Ge,Ue,xe],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"],changeDetection:0})}}return t})();var T=(function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t})(T||{});var G=(function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t})(G||{});var yt=(t,s)=>({"btn-secondary text-white":t,"btn-outline-dark":s}),xt=(t,s)=>({"btn-success":t,"btn-outline-success":s}),bt=(t,s)=>({"btn-warning text-white":t,"btn-outline-warning":s}),Tt=(t,s)=>({"btn-danger":t,"btn-outline-danger":s}),Mt=()=>({"min-width":"100%"}),Et=()=>({minWidth:"14rem"}),Pt=(t,s)=>({"over-due-today":t,"over-due":s});function Vt(t,s){t&1&&d(0," Created Date ")}function kt(t,s){t&1&&d(0," Modified Date ")}function Nt(t,s){if(t&1){let e=D();o(0,"p-multiselect",24),g("onChange",function(n){let r=m(e).filterCallback;return c(r(n.value))}),a()}if(t&2){let e=s.$implicit,i=_(2);p("ngModel",e)("options",i.channelStatusOptions())("panelStyle",U(3,Et))}}function It(t,s){if(t&1&&(o(0,"tr"),v(1,"th",18),o(2,"th",19),d(3,"Number"),a(),o(4,"th",20),w(5,Vt,1,0)(6,kt,1,0),a(),o(7,"th",21)(8,"div",22),d(9," Channel "),o(10,"p-columnFilter",23),k(11,Nt,1,4,"ng-template",null,3,H),a()()(),o(13,"th",21),d(14,"POS Status"),a(),o(15,"th"),d(16,"Action"),a(),v(17,"th",18),a()),t&2){let e,i=_();l(5),C(((e=i.selectedChannel())==null?null:e.TypeID)===i.channelType.WooCommerce?5:6),l(5),p("showMatchModes",!1)("showOperator",!1)("showAddButton",!1)}}function Ft(t,s){if(t&1&&(o(0,"td"),d(1),Y(2,"date"),a()),t&2){let e=_().$implicit;l(),b(oe(2,1,e.Date,"dd MMM yyyy HH:mm:ss"))}}function Ot(t,s){if(t&1&&(o(0,"td"),d(1),Y(2,"date"),a()),t&2){let e=_().$implicit;l(),b(oe(2,1,e.Modified,"dd MMM yyyy HH:mm:ss"))}}function Rt(t,s){if(t&1&&(o(0,"span"),d(1),a()),t&2){let e=_().$implicit;l(),b(e.ActionString)}}function Bt(t,s){if(t&1&&(o(0,"li"),d(1),a()),t&2){let e=s.$implicit;l(),b(e)}}function At(t,s){if(t&1&&(o(0,"ul",26),O(1,Bt,2,1,"li",null,F),a()),t&2){let e=_().$implicit;l(),R(e.ActionString)}}function $t(t,s){if(t&1&&(o(0,"span",27),v(1,"i",28),a()),t&2){let e=_().$implicit;p("title",Se("Delivery : ",e.DeliveryState,`
2
2
  Payment : `,e.PaymentState))}}function Wt(t,s){if(t&1&&(o(0,"tr")(1,"td"),d(2),a(),o(3,"td"),d(4),a(),w(5,Ft,3,4,"td")(6,Ot,3,4,"td"),o(7,"td")(8,"span"),d(9),a(),d(10),a(),o(11,"td",25)(12,"span"),d(13),a(),d(14),a(),o(15,"td"),w(16,Rt,2,1,"span"),w(17,At,3,0,"ul",26),a(),o(18,"td"),w(19,$t,2,3,"span",27),a()()),t&2){let e,i=s.$implicit,n=s.rowIndex,r=_();l(2),b(n+1),l(2),b(i.Number),l(),C(((e=r.selectedChannel())==null?null:e.TypeID)===r.channelType.WooCommerce?5:6),l(4),E("",i.ChannelStatus," - "),l(),E("",i.ChannelStatusDescription," "),l(),B(A(13,Pt,(i==null?null:i.Action)==r.actionPreviewOrder.Update,(i==null?null:i.Action)==r.actionPreviewOrder.New)),p("matTooltip",i.POSStatus==91||i.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),l(2),E("",i.POSStatus," - "),l(),E("",i.POSStatusDescription," "),l(2),C(i.ActionString.length==1?16:-1),l(),C(i.ActionString.length>1?17:-1),l(2),C(i.ChannelStatus!=99&&i.POSStatus!=99?19:-1)}}function Lt(t,s){t&1&&(o(0,"tr",29)(1,"td",30)(2,"div",31),v(3,"i",32),a(),o(4,"h4",33),d(5," There is no order to processed "),a()()())}var ct=(()=>{class t{constructor(){this.orderPreview=V(),this.selectedChannel=V(),this.channelType=X,this.allData=h(0),this.syncData=h(0),this.wrongData=h(0),this.unsyncData=h(0),this.pillStatus=h(T.ALL),this.actionPreviewOrder=G,this.previewStatus=T,this.displayPreviewData=h([]),this.exportOrders=new I,this.channelStatusOptions=J(()=>{let e=this.orderPreview()??[],i=new Map;return e.forEach(n=>{i.has(n.ChannelStatus)||i.set(n.ChannelStatus,n.ChannelStatusDescription)}),Array.from(i.entries()).map(([n,r])=>({label:`${n} - ${r}`,value:n}))}),Q(()=>{this.orderPreview()&&(this.filterPreviewData(T.ALL),this.initLengthStatusData())},{allowSignalWrites:!0})}filterPreviewData(e){this.pillStatus.update(()=>e),this.displayPreviewData.update(()=>this.filterDataByStatus(e))}initLengthStatusData(){this.wrongData.update(()=>this.filterDataByStatus(T.WRONG).length),this.syncData.update(()=>this.filterDataByStatus(T.SYNC).length),this.allData.update(()=>this.orderPreview().length),this.unsyncData.update(()=>this.filterDataByStatus(T.UNSYNC).length)}filterDataByStatus(e){let i=[];switch(e){case T.ALL:i=this.orderPreview();break;case T.SYNC:i=this.orderPreview().filter(n=>n.Action==G.DoNothing);break;case T.WRONG:i=this.orderPreview().filter(n=>n.Action==G.Update);break;case T.UNSYNC:i=this.orderPreview().filter(n=>n.Action==G.New);break}return i}onExportOrders(){this.exportOrders.emit()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["preview-step"]],inputs:{orderPreview:[1,"orderPreview"],selectedChannel:[1,"selectedChannel"]},outputs:{exportOrders:"onExportOrders"},decls:30,vars:27,consts:[["header",""],["body",""],["emptymessage",""],["filter",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[3,"value","tableStyle"],["width","1%"],["width","25%"],["width","15%"],["width","10%"],[1,"d-flex","align-items-center","justify-content-between","gap-2"],["field","ChannelStatus","matchMode","in","display","menu",3,"showMatchModes","showOperator","showAddButton"],["optionLabel","label","optionValue","value","placeholder","All",2,"min-width","14rem","width","14rem",3,"onChange","ngModel","options","panelStyle"],["matTooltipClass","custom-width-tooltip",3,"matTooltip"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(i,n){if(i&1){let r=D();o(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"div")(5,"ul",8)(6,"li",9)(7,"button",10),g("click",function(){return m(r),c(n.filterPreviewData(n.previewStatus.ALL))}),d(8),a()(),o(9,"li",11)(10,"button",12),g("click",function(){return m(r),c(n.filterPreviewData(n.previewStatus.SYNC))}),d(11),a()(),o(12,"li",11)(13,"button",13),g("click",function(){return m(r),c(n.filterPreviewData(n.previewStatus.WRONG))}),d(14),a()(),o(15,"li",11)(16,"button",14),g("click",function(){return m(r),c(n.filterPreviewData(n.previewStatus.UNSYNC))}),d(17),a()()()(),o(18,"div")(19,"button",15),g("click",function(){return m(r),c(n.onExportOrders())}),v(20,"i",16),o(21,"span"),d(22,"Export"),a()()()()(),o(23,"p-table",17),k(24,It,18,4,"ng-template",null,0,H)(26,Wt,20,16,"ng-template",null,1,H)(28,Lt,6,0,"ng-template",null,2,H),a()()()}i&2&&(l(7),B(A(14,yt,n.pillStatus()=="all",n.pillStatus()!="all")),l(),E(" All (",n.allData(),") "),l(2),B(A(17,xt,n.pillStatus()=="sync",n.pillStatus()!="sync")),l(),E(" Existing (",n.syncData(),") "),l(2),B(A(20,bt,n.pillStatus()=="wrong",n.pillStatus()!="wrong")),l(),E(" Wrong Status (",n.wrongData(),") "),l(2),B(A(23,Tt,n.pillStatus()=="unsync",n.pillStatus()!="unsync")),l(),E(" Missing (",n.unsyncData(),") "),l(6),p("value",n.displayPreviewData())("tableStyle",U(26,Mt)))},dependencies:[ne,Ie,lt,at,rt,Qe,Ke,z,W,L,$],encapsulation:2,changeDetection:0})}}return t})();var zt=["stepper"];function jt(t,s){if(t&1){let e=D();o(0,"div",2)(1,"button",20),g("click",function(){m(e);let n=_();return c(n.onStepperBack())}),d(2," Back "),a(),o(3,"button",21),g("click",function(){m(e);let n=_();return c(n.onNextStep())}),d(4," Next "),a()()}if(t&2){let e=_();l(3),p("disabled",e.disabledNextFilter())}}function Gt(t,s){if(t&1){let e=D();o(0,"button",22),g("click",function(){m(e);let n=_();return c(n.onNextStep())}),d(1," Next "),a()}if(t&2){let e=_();p("disabled",e.disabledNextFilter())}}function Ut(t,s){if(t&1){let e=D();o(0,"button",23),g("click",function(){m(e);let n=_();return c(n.onNewDownload())}),v(1,"i",24),d(2," New "),a()}}function Yt(t,s){t&1&&(v(0,"i",25),o(1,"span"),d(2,"Filter"),a())}function Ht(t,s){t&1&&(v(0,"i",26),o(1,"span"),d(2,"Preview"),a())}function Kt(t,s){if(t&1){let e=D();o(0,"preview-step",27),g("onExportOrders",function(){m(e);let n=_();return c(n.onExportOrders())}),a()}if(t&2){let e=_();p("orderPreview",s)("selectedChannel",e.selectedChannel())}}function Qt(t,s){t&1&&(v(0,"i",28),o(1,"span"),d(2,"Finish"),a())}function Zt(t,s){t&1&&v(0,"complete-step",16),t&2&&p("downloadResult",s)}function qt(t,s){t&1&&(o(0,"h6"),d(1,"1"),a())}function Jt(t,s){t&1&&(o(0,"h6"),d(1,"2"),a())}function Xt(t,s){t&1&&(o(0,"h6"),d(1,"3"),a())}var ki=(()=>{class t{constructor(){this.downloadService=S(j),this.orderService=S(ae),this.productService=S(ze),this.authService=S(te),this.stepperSelectedIndex=h(0),this.disabledNextFilter=h(!0),this.filter=h(void 0),this.isResetFilter=h(!1),this.orderPreview=h(void 0),this.downloadPreview=h(void 0),this.pageTitle=h("Download to POS"),this.cacheKey=h(y.GuidEMpty),this.rememberMe=h(!1),this.selectedChannel=J(()=>{let e=this.filter()?.channelId;if(e)return this.productService.findChannelById(e,this.authService.getChannels())})}onFilterChange(e){this.filter.set(e),this.validateDisabledNext()}validateDisabledNext(){this.disabledNextFilter.update(()=>{let e=this.filter();return y.IsEmpty(e?.channelId)||!y.isValidDate(e.startDate)||!y.isValidDate(e.endDate)})}onNextStep(){switch(this.stepper.selectedIndex){case 0:this.onPreview();let e=this.productService.findChannelById(this.filter().channelId,this.authService.getChannels());this.setPageTitle(`Preview ${e?.Name}`);break;case 1:this.onDownload(),this.setPageTitle("Download");break}}onStepperNext(){this.stepper.selected.completed=!0,this.stepper.next()}onPreview(){let e=this.filter(),i={ID:e.channelId,From:e.startDate,To:e.endDate,IsDisbursement:e.downloadType};y.IsNotEmpty(e.startTime)&&(i=le(re({},i),{TimeFrom:e.startTime+":00",TimeTo:e.endTime+":00"})),this.downloadService.onPreviewOrder(i).subscribe(n=>{n.Data?.length>0&&(this.cacheKey.update(()=>n.CacheKey),this.onStepperNext()),this.orderPreview.set(n.Data)})}onExportOrders(){let e=this.filter(),i={ID:e.channelId,From:e.startDate?e.startDate:null,To:e.endDate?e.endDate:null},n=`Orders ${this.downloadService.getDateTitle(e.startDate,e.endDate)}`;this.orderService.exportOrders(i,n).subscribe()}onDownload(){let e=this.filter(),i={ID:e.channelId,From:e.startDate,To:e.endDate,ListPreview:[],IsDisbursement:e.downloadType,CacheKey:this.cacheKey()},n=this.orderPreview();i.ListPreview=n,this.downloadService.getDownloadOrder(i).subscribe(r=>{this.downloadPreview.set(r),this.onStepperNext()})}setPageTitle(e){let i=this.filter();this.pageTitle.update(()=>`
3
3
  ${e} (${this.downloadService.getDateTitle(i.startDate,i.endDate)})
4
4
  `)}onStepperBack(){this.stepper.previous(),this.pageTitle.update(()=>"Download to POS")}onNewDownload(){this.isResetFilter.update(()=>!this.rememberMe()),this.stepper.reset(),this.stepperSelectedIndex.update(()=>0),this.orderPreview.set(void 0),this.downloadPreview.set(void 0),this.pageTitle.update(()=>"Download to POS")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-download-v2"]],viewQuery:function(i,n){if(i&1&&he(zt,5),i&2){let r;fe(r=ge())&&(n.stepper=r.first)}},features:[q([j,ae,{provide:Xe,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:17,consts:[["stepper",""],[3,"hideSearchBox","hideSearchDropdown","headerTitle","description"],[1,"btn-group","me-3"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"disabled"],[1,"btn","btn-outline-secondary","btn-fill","d-flex","align-items-center","gap-2"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectedIndexChange","ngClass","selectedIndex"],["state","filter",3,"completed","editable"],["matStepLabel",""],[1,"w-100",3,"onFilterChange","onRememberMeChange","reset"],["state","preview",3,"editable","completed"],[3,"orderPreview","selectedChannel"],["state","finish"],[3,"downloadResult"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill","d-flex","align-items-center","gap-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt"],[1,"fa-solid","fa-filter","me-3"],[1,"fa-solid","fa-file","me-3"],[3,"onExportOrders","orderPreview","selectedChannel"],[1,"fa-solid","fa-flag","me-3"]],template:function(i,n){if(i&1){let r=D();o(0,"mainpanel",1)(1,"actions"),w(2,jt,5,1,"div",2),w(3,Gt,2,1,"button",3),w(4,Ut,3,0,"button",4),a(),o(5,"content")(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"mat-stepper",9,0),g("selectedIndexChange",function(u){return m(r),c(n.stepperSelectedIndex.set(u))}),o(12,"mat-step",10),k(13,Yt,3,0,"ng-template",11),o(14,"filter-step",12),g("onFilterChange",function(u){return m(r),c(n.onFilterChange(u))})("onRememberMeChange",function(u){return m(r),c(n.rememberMe.set(u))}),a()(),o(15,"mat-step",13),k(16,Ht,3,0,"ng-template",11),w(17,Kt,1,2,"preview-step",14),a(),o(18,"mat-step",15),k(19,Qt,3,0,"ng-template",11),w(20,Zt,1,1,"complete-step",16),a(),k(21,qt,2,0,"ng-template",17)(22,Jt,2,0,"ng-template",18)(23,Xt,2,0,"ng-template",19),a()()()()()()()}if(i&2){let r,f,u=N(11);p("hideSearchBox",!0)("hideSearchDropdown",!0)("headerTitle",n.pageTitle())("description",n.pageTitle()),l(2),C(n.stepperSelectedIndex()==1?2:-1),l(),C(n.stepperSelectedIndex()==0?3:-1),l(),C(n.stepperSelectedIndex()==2?4:-1),l(6),p("ngClass",ve("last-edited-step-"+u.selectedIndex))("selectedIndex",n.stepperSelectedIndex()),l(2),p("completed",!1)("editable",n.stepperSelectedIndex()!=2),l(2),p("reset",n.isResetFilter()),l(),p("editable",n.stepperSelectedIndex()!=2)("completed",!1),l(2),C((r=n.orderPreview())?17:-1,r),l(3),C((f=n.downloadPreview())?20:-1,f)}},dependencies:[dt,mt,ct,ot,nt,et,it,tt,Fe,Me,ne],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{padding-top:.8rem;padding-bottom:.8rem}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
@@ -1 +1 @@
1
- import{a as j}from"./chunk-ZSG2EXIR.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as O}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import{a as K}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-C5O6VJ2D.js";import"./chunk-TU34BDDQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as B}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as T,h as L,m as N,p as R,z as U}from"./chunk-7HUEGPJN.js";import{e as I}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{C as E}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as h,Ic as l,Jc as P,Pc as k,Qc as D,Rc as S,Xb as _,Zb as f,cc as s,dc as i,ec as t,ed as V,fc as w,fd as A,gb as a,ha as x,mc as v,oa as c,pa as p,rc as m,tc as g,ua as M,yb as b}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function F(n,y){if(n&1){let e=v();i(0,"input",30),m("ngModelChange",function(o){c(e);let r=g();return p(r.sku.set(o))}),t()}if(n&2){let e=g();s("ngModel",e.sku())}}function H(n,y){if(n&1){let e=v();i(0,"input",31),m("ngModelChange",function(o){c(e);let r=g();return p(r.itemId.set(o))}),t()}if(n&2){let e=g();s("ngModel",e.itemId())}}function J(n,y){if(n&1&&(i(0,"pre",28),l(1),V(2,"json"),t()),n&2){g();let e=S(35);a(),P(A(2,1,e))}}function G(n,y){n&1&&(i(0,"p",29),l(1," Your data will be shown here once it's available "),t())}var re=(()=>{class n{constructor(){this.httpService=x(I),this.destroyRef=x(M),this.productLogData=h(null),this.selectedChannel=h(null),this.sku=h(null),this.itemId=h(null),this.searchBy=h("sku")}initProductLog(){let e={ChannelID:this.selectedChannel()};this.searchBy()==="sku"?e.SKU=this.sku():e.ItemID=this.itemId(),this.httpService.post(B.GetProductApiLog,e).pipe(K(this.destroyRef)).subscribe(d=>this.productLogData.set(d))}copyToClipboard(e){if(!e)return;let d=typeof e=="string"?e:JSON.stringify(e,null,2);navigator.clipboard.writeText(d),alert("Copied to clipboard!")}static{this.\u0275fac=function(d){return new(d||n)}}static{this.\u0275cmp=b({type:n,selectors:[["app-product-api"]],decls:49,vars:12,consts:[["headerTitle","Origin Product Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],[1,"mb-2"],[1,"form-check","form-check-inline"],["type","radio","name","searchBy","id","searchBySku",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchBySku",1,"form-check-label"],["type","radio","name","searchBy","id","searchByItemId",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchByItemId",1,"form-check-label"],["type","text","placeholder","Product Code / SKU",1,"form-control","rounded-1",2,"height","40px",3,"ngModel"],["type","text","placeholder","ItemID is Product id from seller center",1,"form-control","rounded-1",2,"height","40px",3,"ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","productLogText"],[1,"text-center","my-12","text-muted"],["type","text","placeholder","Product Code / SKU",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],["type","text","placeholder","ItemID is Product id from seller center",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"]],template:function(d,o){if(d&1){let r=v();i(0,"mainpanel",0)(1,"actions")(2,"button",1),m("click",function(){return c(r),p(o.initProductLog())}),w(3,"i",2),l(4," Search "),t()(),i(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),l(12,"Channel"),t(),i(13,"p",8),l(14," View logs related to Product API Detail "),t()(),i(15,"div",9)(16,"app-channel-options-v2",10),m("ngModelChange",function(u){return c(r),p(o.selectedChannel.set(u))}),t()()(),i(17,"div",11)(18,"div",7)(19,"h6"),l(20,"Product Code / SKU"),t(),i(21,"p",8),l(22," Product SKU or Code from Channel Product "),t()(),i(23,"div",9)(24,"div",12)(25,"div",13)(26,"input",14),m("ngModelChange",function(u){return c(r),p(o.searchBy.set(u))}),t(),i(27,"label",15),l(28,"Search by SKU"),t()(),i(29,"div",13)(30,"input",16),m("ngModelChange",function(u){return c(r),p(o.searchBy.set(u))}),t(),i(31,"label",17),l(32,"Search by ItemID"),t()()(),_(33,F,1,1,"input",18),_(34,H,1,1,"input",19),t()()()(),k(35),i(36,"div",20)(37,"div",21)(38,"div",22)(39,"div",23)(40,"h5"),l(41,"Response"),t(),i(42,"button",24),m("click",function(){c(r);let u=S(35);return p(o.copyToClipboard(u))}),l(43," Copy "),t()(),i(44,"div",25)(45,"div",26)(46,"div",27),_(47,J,3,3,"pre",28)(48,G,2,0,"p",29),t()()()()()()()()()}if(d&2){s("hideSearchBox",!0)("hideSearchDropdown",!0),a(16),s("ngModel",o.selectedChannel()),a(10),s("ngModel",o.searchBy())("value","sku"),a(4),s("ngModel",o.searchBy())("value","itemid"),a(3),f(o.searchBy()==="sku"?33:-1),a(),f(o.searchBy()==="itemid"?34:-1),a();let r=D(o.productLogData());a(7),s("disabled",!r),a(5),f(r?47:48)}},dependencies:[U,T,R,L,N,O,j,E],encapsulation:2,changeDetection:0})}}return n})();export{re as ProductApiComponent};
1
+ import{a as j}from"./chunk-E4KDJSXX.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as O}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import{a as K}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-GUTJ3MLW.js";import"./chunk-6ENJB5FQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as B}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as T,h as L,m as N,p as R,z as U}from"./chunk-7HUEGPJN.js";import{e as I}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{C as E}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as h,Ic as l,Jc as P,Pc as k,Qc as D,Rc as S,Xb as _,Zb as f,cc as s,dc as i,ec as t,ed as V,fc as w,fd as A,gb as a,ha as x,mc as v,oa as c,pa as p,rc as m,tc as g,ua as M,yb as b}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function F(n,y){if(n&1){let e=v();i(0,"input",30),m("ngModelChange",function(o){c(e);let r=g();return p(r.sku.set(o))}),t()}if(n&2){let e=g();s("ngModel",e.sku())}}function H(n,y){if(n&1){let e=v();i(0,"input",31),m("ngModelChange",function(o){c(e);let r=g();return p(r.itemId.set(o))}),t()}if(n&2){let e=g();s("ngModel",e.itemId())}}function J(n,y){if(n&1&&(i(0,"pre",28),l(1),V(2,"json"),t()),n&2){g();let e=S(35);a(),P(A(2,1,e))}}function G(n,y){n&1&&(i(0,"p",29),l(1," Your data will be shown here once it's available "),t())}var re=(()=>{class n{constructor(){this.httpService=x(I),this.destroyRef=x(M),this.productLogData=h(null),this.selectedChannel=h(null),this.sku=h(null),this.itemId=h(null),this.searchBy=h("sku")}initProductLog(){let e={ChannelID:this.selectedChannel()};this.searchBy()==="sku"?e.SKU=this.sku():e.ItemID=this.itemId(),this.httpService.post(B.GetProductApiLog,e).pipe(K(this.destroyRef)).subscribe(d=>this.productLogData.set(d))}copyToClipboard(e){if(!e)return;let d=typeof e=="string"?e:JSON.stringify(e,null,2);navigator.clipboard.writeText(d),alert("Copied to clipboard!")}static{this.\u0275fac=function(d){return new(d||n)}}static{this.\u0275cmp=b({type:n,selectors:[["app-product-api"]],decls:49,vars:12,consts:[["headerTitle","Origin Product Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],[1,"mb-2"],[1,"form-check","form-check-inline"],["type","radio","name","searchBy","id","searchBySku",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchBySku",1,"form-check-label"],["type","radio","name","searchBy","id","searchByItemId",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchByItemId",1,"form-check-label"],["type","text","placeholder","Product Code / SKU",1,"form-control","rounded-1",2,"height","40px",3,"ngModel"],["type","text","placeholder","ItemID is Product id from seller center",1,"form-control","rounded-1",2,"height","40px",3,"ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","productLogText"],[1,"text-center","my-12","text-muted"],["type","text","placeholder","Product Code / SKU",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],["type","text","placeholder","ItemID is Product id from seller center",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"]],template:function(d,o){if(d&1){let r=v();i(0,"mainpanel",0)(1,"actions")(2,"button",1),m("click",function(){return c(r),p(o.initProductLog())}),w(3,"i",2),l(4," Search "),t()(),i(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),l(12,"Channel"),t(),i(13,"p",8),l(14," View logs related to Product API Detail "),t()(),i(15,"div",9)(16,"app-channel-options-v2",10),m("ngModelChange",function(u){return c(r),p(o.selectedChannel.set(u))}),t()()(),i(17,"div",11)(18,"div",7)(19,"h6"),l(20,"Product Code / SKU"),t(),i(21,"p",8),l(22," Product SKU or Code from Channel Product "),t()(),i(23,"div",9)(24,"div",12)(25,"div",13)(26,"input",14),m("ngModelChange",function(u){return c(r),p(o.searchBy.set(u))}),t(),i(27,"label",15),l(28,"Search by SKU"),t()(),i(29,"div",13)(30,"input",16),m("ngModelChange",function(u){return c(r),p(o.searchBy.set(u))}),t(),i(31,"label",17),l(32,"Search by ItemID"),t()()(),_(33,F,1,1,"input",18),_(34,H,1,1,"input",19),t()()()(),k(35),i(36,"div",20)(37,"div",21)(38,"div",22)(39,"div",23)(40,"h5"),l(41,"Response"),t(),i(42,"button",24),m("click",function(){c(r);let u=S(35);return p(o.copyToClipboard(u))}),l(43," Copy "),t()(),i(44,"div",25)(45,"div",26)(46,"div",27),_(47,J,3,3,"pre",28)(48,G,2,0,"p",29),t()()()()()()()()()}if(d&2){s("hideSearchBox",!0)("hideSearchDropdown",!0),a(16),s("ngModel",o.selectedChannel()),a(10),s("ngModel",o.searchBy())("value","sku"),a(4),s("ngModel",o.searchBy())("value","itemid"),a(3),f(o.searchBy()==="sku"?33:-1),a(),f(o.searchBy()==="itemid"?34:-1),a();let r=D(o.productLogData());a(7),s("disabled",!r),a(5),f(r?47:48)}},dependencies:[U,T,R,L,N,O,j,E],encapsulation:2,changeDetection:0})}}return n})();export{re as ProductApiComponent};
@@ -1 +1 @@
1
- import{a as ie}from"./chunk-DJ6VZBCD.js";import{a as ne}from"./chunk-RLLQHRSD.js";import{a as te}from"./chunk-ZLMUYIKY.js";import"./chunk-QK2JCSM3.js";import"./chunk-ON5KFKHE.js";import{a as ee}from"./chunk-EYHQ2ZKL.js";import"./chunk-BGFEVOPZ.js";import{a as X,b as Y,d as Z}from"./chunk-474G6BPL.js";import{b as W}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import{b as K,c as Q}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as B}from"./chunk-C5O6VJ2D.js";import"./chunk-TU34BDDQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as j,h as q,m as U,o as $,z as J}from"./chunk-7HUEGPJN.js";import{e as G}from"./chunk-ZE4OOGMT.js";import{e as H}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as V}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as D,Aa as s,Da as y,Ea as R,Eb as L,Ic as l,Jc as f,Kc as b,Wc as k,Xb as x,Xc as A,Y as S,Zb as E,ac as P,bc as F,cc as d,db as M,dc as n,ec as i,ed as O,fc as C,gb as r,gd as z,ha as _,mc as I,oa as T,pa as w,rc as g,tc as v,yb as N}from"./chunk-5VYDZBNH.js";import{a as u,b as h}from"./chunk-QWWW7GFA.js";var ae=()=>["/menu/log/rawlog/detail"],oe=o=>({ID:o});function re(o,c){if(o&1&&(n(0,"span",17),C(1,"img",18),i(),l(2)),o&2){let e=c.item;r(),d("src",e.Img,M)("alt",e.Name),r(),b(" ",e.Name," ")}}function le(o,c){if(o&1&&(n(0,"tr")(1,"td")(2,"a",23),l(3),O(4,"date"),i()(),n(5,"td"),l(6),i(),n(7,"td"),l(8),i(),n(9,"td"),l(10),i()()),o&2){let e=c.$implicit;r(2),d("routerLink",k(9,ae))("queryParams",A(10,oe,e.id)),r(),b(" ",z(4,6,e.Created,"dd MMM yyyy HH:mm:ss")," "),r(3),f(e.type),r(2),f(e.number),r(2),f(e.message)}}function me(o,c){if(o&1){let e=I();n(0,"div",15)(1,"table",19)(2,"thead",20)(3,"tr")(4,"th",21),l(5,"Date"),i(),n(6,"th"),l(7,"Type"),i(),n(8,"th"),l(9,"Number"),i(),n(10,"th"),l(11,"Message"),i()()(),n(12,"tbody"),P(13,le,11,12,"tr",null,D),i()(),n(15,"mat-paginator",22),g("page",function(t){T(e);let m=v();return w(m.changePage(t))}),i()()}if(o&2){let e=v();r(13),F(e.Result()),r(2),d("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function pe(o,c){o&1&&(n(0,"div",16),C(1,"app-empty-state"),i())}var xe=(()=>{class o{constructor(){this.http=_(G),this._RawLogService=_(ie),this.authService=_(B),this.Result=s([]),this.filter=s({RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""}),this.paginationTotal=s(0),this.paginationPageSize=s(0),this.ActionTypeList=s(null),this.channelOptions=s(this.authService.getChannels()),this.loader=K(this.http.post("/api/OrdersLoader/Get",{}),{initialValue:null}),this.reloadToken=s(0),this.resource=Q({params:()=>this.reloadToken(),stream:()=>this.http.post("api/Orders/GetRawLog",this.filter()).pipe(S(e=>{this._RawLogService.Data=e.hits;let a=[];for(let t of e.hits){let m={id:t._id,message:t._source.message,responseCode:t._source.log.responseCode,processTypeString:t._source.log.processType,type:t._source.log.type,number:t._source.log.number,Created:t._source["@timestamp_received"]};a.push(m)}this.Result.set(a),this.paginationTotal.set(e.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)}))}),y(()=>{let e=this.loader();e&&(this.filter.update(a=>u(u({},a),e.Filter)),this.ActionTypeList.set(e.Options.ActionTypeList),R(()=>this.Get()))})}Get(e){this.filter.update(a=>h(u({},a),{Number:e})),this.reloadToken.update(a=>a+1)}changePage(e){this.filter.update(a=>h(u({},a),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,a){this.filter.update(t=>h(u({},t),{[e]:a}))}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=N({type:o,selectors:[["app-raw-log"]],decls:28,vars:9,consts:[["headerTitle","Channel Push Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[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"],[1,"thead-light"],[2,"width","200px"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"]],template:function(a,t){if(a&1&&(n(0,"mainpanel",0),g("textChange",function(p){return t.updateFilter("Number",p)})("onSubmit",function(p){return t.Get(p)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),i(),n(5,"ng-select",2),g("ngModelChange",function(p){return t.updateFilter("ChannelID",p)}),L(6,re,3,3,"ng-template",3),i()(),n(7,"div",4)(8,"label",5),l(9,"From/To"),i(),n(10,"div",6)(11,"datepicker",7),g("dateChange",function(p){return t.updateFilter("From",p)}),i()(),n(12,"div")(13,"datepicker",8),g("dateChange",function(p){return t.updateFilter("To",p)}),i()()(),n(14,"div",4)(15,"label",9),l(16,"Page Number"),i(),n(17,"input",10),g("ngModelChange",function(p){return t.updateFilter("PageNumber",p)}),i()(),n(18,"div",4)(19,"label",9),l(20,"Page Size"),i(),n(21,"input",11),g("ngModelChange",function(p){return t.updateFilter("RowCount",p)}),i()()(),n(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),x(26,me,16,3,"div",15)(27,pe,2,0,"div",16),i()()()()()),a&2){let m;d("text",t.filter().Number),r(5),d("clearable",!0)("items",t.channelOptions())("ngModel",t.filter().ChannelID),r(6),d("date",t.filter().From),r(2),d("date",t.filter().To),r(4),d("ngModel",t.filter().PageNumber),r(4),d("ngModel",t.filter().RowCount),r(5),E(((m=t.Result())==null?null:m.length)>0?26:27)}},dependencies:[W,Z,J,j,$,q,U,X,Y,te,H,ne,ee,V],encapsulation:2,changeDetection:0})}}return o})();export{xe as RawLogComponent};
1
+ import{a as ie}from"./chunk-DJ6VZBCD.js";import{a as ne}from"./chunk-RLLQHRSD.js";import{a as te}from"./chunk-ZLMUYIKY.js";import"./chunk-QK2JCSM3.js";import"./chunk-ON5KFKHE.js";import{a as ee}from"./chunk-EYHQ2ZKL.js";import"./chunk-BGFEVOPZ.js";import{a as X,b as Y,d as Z}from"./chunk-474G6BPL.js";import{b as W}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import{b as K,c as Q}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as B}from"./chunk-GUTJ3MLW.js";import"./chunk-6ENJB5FQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as j,h as q,m as U,o as $,z as J}from"./chunk-7HUEGPJN.js";import{e as G}from"./chunk-ZE4OOGMT.js";import{e as H}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as V}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as D,Aa as s,Da as y,Ea as R,Eb as L,Ic as l,Jc as f,Kc as b,Wc as k,Xb as x,Xc as A,Y as S,Zb as E,ac as P,bc as F,cc as d,db as M,dc as n,ec as i,ed as O,fc as C,gb as r,gd as z,ha as _,mc as I,oa as T,pa as w,rc as g,tc as v,yb as N}from"./chunk-5VYDZBNH.js";import{a as u,b as h}from"./chunk-QWWW7GFA.js";var ae=()=>["/menu/log/rawlog/detail"],oe=o=>({ID:o});function re(o,c){if(o&1&&(n(0,"span",17),C(1,"img",18),i(),l(2)),o&2){let e=c.item;r(),d("src",e.Img,M)("alt",e.Name),r(),b(" ",e.Name," ")}}function le(o,c){if(o&1&&(n(0,"tr")(1,"td")(2,"a",23),l(3),O(4,"date"),i()(),n(5,"td"),l(6),i(),n(7,"td"),l(8),i(),n(9,"td"),l(10),i()()),o&2){let e=c.$implicit;r(2),d("routerLink",k(9,ae))("queryParams",A(10,oe,e.id)),r(),b(" ",z(4,6,e.Created,"dd MMM yyyy HH:mm:ss")," "),r(3),f(e.type),r(2),f(e.number),r(2),f(e.message)}}function me(o,c){if(o&1){let e=I();n(0,"div",15)(1,"table",19)(2,"thead",20)(3,"tr")(4,"th",21),l(5,"Date"),i(),n(6,"th"),l(7,"Type"),i(),n(8,"th"),l(9,"Number"),i(),n(10,"th"),l(11,"Message"),i()()(),n(12,"tbody"),P(13,le,11,12,"tr",null,D),i()(),n(15,"mat-paginator",22),g("page",function(t){T(e);let m=v();return w(m.changePage(t))}),i()()}if(o&2){let e=v();r(13),F(e.Result()),r(2),d("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function pe(o,c){o&1&&(n(0,"div",16),C(1,"app-empty-state"),i())}var xe=(()=>{class o{constructor(){this.http=_(G),this._RawLogService=_(ie),this.authService=_(B),this.Result=s([]),this.filter=s({RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""}),this.paginationTotal=s(0),this.paginationPageSize=s(0),this.ActionTypeList=s(null),this.channelOptions=s(this.authService.getChannels()),this.loader=K(this.http.post("/api/OrdersLoader/Get",{}),{initialValue:null}),this.reloadToken=s(0),this.resource=Q({params:()=>this.reloadToken(),stream:()=>this.http.post("api/Orders/GetRawLog",this.filter()).pipe(S(e=>{this._RawLogService.Data=e.hits;let a=[];for(let t of e.hits){let m={id:t._id,message:t._source.message,responseCode:t._source.log.responseCode,processTypeString:t._source.log.processType,type:t._source.log.type,number:t._source.log.number,Created:t._source["@timestamp_received"]};a.push(m)}this.Result.set(a),this.paginationTotal.set(e.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)}))}),y(()=>{let e=this.loader();e&&(this.filter.update(a=>u(u({},a),e.Filter)),this.ActionTypeList.set(e.Options.ActionTypeList),R(()=>this.Get()))})}Get(e){this.filter.update(a=>h(u({},a),{Number:e})),this.reloadToken.update(a=>a+1)}changePage(e){this.filter.update(a=>h(u({},a),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,a){this.filter.update(t=>h(u({},t),{[e]:a}))}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=N({type:o,selectors:[["app-raw-log"]],decls:28,vars:9,consts:[["headerTitle","Channel Push Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[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"],[1,"thead-light"],[2,"width","200px"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"]],template:function(a,t){if(a&1&&(n(0,"mainpanel",0),g("textChange",function(p){return t.updateFilter("Number",p)})("onSubmit",function(p){return t.Get(p)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),i(),n(5,"ng-select",2),g("ngModelChange",function(p){return t.updateFilter("ChannelID",p)}),L(6,re,3,3,"ng-template",3),i()(),n(7,"div",4)(8,"label",5),l(9,"From/To"),i(),n(10,"div",6)(11,"datepicker",7),g("dateChange",function(p){return t.updateFilter("From",p)}),i()(),n(12,"div")(13,"datepicker",8),g("dateChange",function(p){return t.updateFilter("To",p)}),i()()(),n(14,"div",4)(15,"label",9),l(16,"Page Number"),i(),n(17,"input",10),g("ngModelChange",function(p){return t.updateFilter("PageNumber",p)}),i()(),n(18,"div",4)(19,"label",9),l(20,"Page Size"),i(),n(21,"input",11),g("ngModelChange",function(p){return t.updateFilter("RowCount",p)}),i()()(),n(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),x(26,me,16,3,"div",15)(27,pe,2,0,"div",16),i()()()()()),a&2){let m;d("text",t.filter().Number),r(5),d("clearable",!0)("items",t.channelOptions())("ngModel",t.filter().ChannelID),r(6),d("date",t.filter().From),r(2),d("date",t.filter().To),r(4),d("ngModel",t.filter().PageNumber),r(4),d("ngModel",t.filter().RowCount),r(5),E(((m=t.Result())==null?null:m.length)>0?26:27)}},dependencies:[W,Z,J,j,$,q,U,X,Y,te,H,ne,ee,V],encapsulation:2,changeDetection:0})}}return o})();export{xe as RawLogComponent};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-ZSG2EXIR.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{e as $}from"./chunk-474G6BPL.js";import{b as B}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import{a as j}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-C5O6VJ2D.js";import"./chunk-TU34BDDQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as V}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as I,h as R,m as O,z as P}from"./chunk-7HUEGPJN.js";import{b as L,e as A}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{C as E}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as h,Ic as n,Jc as y,Pc as w,Qc as M,Rc as b,Xb as S,Zb as C,cc as m,dc as e,ec as t,ed as D,fc as _,fd as N,gb as c,ha as u,mc as x,oa as p,pa as s,rc as g,tc as T,ua as k,yb as v}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function J(r,H){if(r&1&&(e(0,"pre",21),n(1),D(2,"json"),t()),r&2){T();let i=b(25);c(),y(N(2,1,i))}}function U(r,H){r&1&&(e(0,"p",22),n(1," Your data will be shown here once it's available "),t())}var ae=(()=>{class r{constructor(){this.httpService=u(A),this.toastr=u(L),this.destroyRef=u(k),this.selectedShopId=h(null),this.trackingNumber=h(null),this.trackingLogData=h(null)}fetchLog(){if(!this.selectedShopId()||!this.trackingNumber()){this.toastr.warning("Please select a channel and enter a tracking number","Warning");return}this.httpService.get(`${V.GetTrackingNumber}?ChannelID=${this.selectedShopId()}&Number=${this.trackingNumber()}`).pipe(j(this.destroyRef)).subscribe(i=>this.trackingLogData.set(i))}copyToClipboard(i){if(!i)return;let l=typeof i=="string"?i:JSON.stringify(i,null,2);navigator.clipboard.writeText(l),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(l){return new(l||r)}}static{this.\u0275cmp=v({type:r,selectors:[["app-tracking-api"]],decls:39,vars:7,consts:[["headerTitle","Tracking API",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Enter tracking number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","trackingLogText"],[1,"text-center","my-12","text-muted"]],template:function(l,o){if(l&1){let a=x();e(0,"mainpanel",0)(1,"actions")(2,"button",1),g("click",function(){return p(a),s(o.fetchLog())}),_(3,"i",2),n(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),n(12,"Channel"),t(),e(13,"p",8),n(14," Select Shopee channel for tracking number lookup. "),t()(),e(15,"div",9)(16,"app-channel-options-v2",10),g("ngModelChange",function(d){return p(a),s(o.selectedShopId.set(d))}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),n(20,"Tracking Number"),t(),e(21,"p",8),n(22," Enter the tracking number to search. "),t()(),e(23,"div",9)(24,"input",12),g("ngModelChange",function(d){return p(a),s(o.trackingNumber.set(d))}),t()()()()(),w(25),e(26,"div",13)(27,"div",14)(28,"div",15)(29,"div",16)(30,"h5"),n(31,"Response"),t(),e(32,"button",17),g("click",function(){p(a);let d=b(25);return s(o.copyToClipboard(d))}),n(33," Copy "),t()(),e(34,"div",18)(35,"div",19)(36,"div",20),S(37,J,3,3,"pre",21)(38,U,2,0,"p",22),t()()()()()()()()()}if(l&2){m("hideSearchBox",!0)("hideSearchDropdown",!0),c(16),m("ngModel",o.selectedShopId()),c(8),m("ngModel",o.trackingNumber()),c();let a=M(o.trackingLogData());c(7),m("disabled",!a),c(5),C(a?37:38)}},dependencies:[B,$,P,I,R,O,F,E],encapsulation:2,changeDetection:0})}}return r})();export{ae as TrackingApiComponent};
1
+ import{a as F}from"./chunk-E4KDJSXX.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{e as $}from"./chunk-474G6BPL.js";import{b as B}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import{a as j}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-GUTJ3MLW.js";import"./chunk-6ENJB5FQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as V}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as I,h as R,m as O,z as P}from"./chunk-7HUEGPJN.js";import{b as L,e as A}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{C as E}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as h,Ic as n,Jc as y,Pc as w,Qc as M,Rc as b,Xb as S,Zb as C,cc as m,dc as e,ec as t,ed as D,fc as _,fd as N,gb as c,ha as u,mc as x,oa as p,pa as s,rc as g,tc as T,ua as k,yb as v}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function J(r,H){if(r&1&&(e(0,"pre",21),n(1),D(2,"json"),t()),r&2){T();let i=b(25);c(),y(N(2,1,i))}}function U(r,H){r&1&&(e(0,"p",22),n(1," Your data will be shown here once it's available "),t())}var ae=(()=>{class r{constructor(){this.httpService=u(A),this.toastr=u(L),this.destroyRef=u(k),this.selectedShopId=h(null),this.trackingNumber=h(null),this.trackingLogData=h(null)}fetchLog(){if(!this.selectedShopId()||!this.trackingNumber()){this.toastr.warning("Please select a channel and enter a tracking number","Warning");return}this.httpService.get(`${V.GetTrackingNumber}?ChannelID=${this.selectedShopId()}&Number=${this.trackingNumber()}`).pipe(j(this.destroyRef)).subscribe(i=>this.trackingLogData.set(i))}copyToClipboard(i){if(!i)return;let l=typeof i=="string"?i:JSON.stringify(i,null,2);navigator.clipboard.writeText(l),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(l){return new(l||r)}}static{this.\u0275cmp=v({type:r,selectors:[["app-tracking-api"]],decls:39,vars:7,consts:[["headerTitle","Tracking API",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Enter tracking number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","trackingLogText"],[1,"text-center","my-12","text-muted"]],template:function(l,o){if(l&1){let a=x();e(0,"mainpanel",0)(1,"actions")(2,"button",1),g("click",function(){return p(a),s(o.fetchLog())}),_(3,"i",2),n(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),n(12,"Channel"),t(),e(13,"p",8),n(14," Select Shopee channel for tracking number lookup. "),t()(),e(15,"div",9)(16,"app-channel-options-v2",10),g("ngModelChange",function(d){return p(a),s(o.selectedShopId.set(d))}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),n(20,"Tracking Number"),t(),e(21,"p",8),n(22," Enter the tracking number to search. "),t()(),e(23,"div",9)(24,"input",12),g("ngModelChange",function(d){return p(a),s(o.trackingNumber.set(d))}),t()()()()(),w(25),e(26,"div",13)(27,"div",14)(28,"div",15)(29,"div",16)(30,"h5"),n(31,"Response"),t(),e(32,"button",17),g("click",function(){p(a);let d=b(25);return s(o.copyToClipboard(d))}),n(33," Copy "),t()(),e(34,"div",18)(35,"div",19)(36,"div",20),S(37,J,3,3,"pre",21)(38,U,2,0,"p",22),t()()()()()()()()()}if(l&2){m("hideSearchBox",!0)("hideSearchDropdown",!0),c(16),m("ngModel",o.selectedShopId()),c(8),m("ngModel",o.trackingNumber()),c();let a=M(o.trackingLogData());c(7),m("disabled",!a),c(5),C(a?37:38)}},dependencies:[B,$,P,I,R,O,F,E],encapsulation:2,changeDetection:0})}}return r})();export{ae as TrackingApiComponent};
@@ -1 +1 @@
1
- import{a as ne}from"./chunk-RLLQHRSD.js";import{a as te}from"./chunk-ZLMUYIKY.js";import"./chunk-QK2JCSM3.js";import"./chunk-ON5KFKHE.js";import{a as ee}from"./chunk-EYHQ2ZKL.js";import"./chunk-BGFEVOPZ.js";import{a as X,b as Y,d as Z}from"./chunk-474G6BPL.js";import{b as W}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import{c as S}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as G}from"./chunk-C5O6VJ2D.js";import"./chunk-TU34BDDQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as J,h as U,m as $,o as K,z as Q}from"./chunk-7HUEGPJN.js";import{e as H}from"./chunk-ZE4OOGMT.js";import{e as j}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as F,Aa as s,Da as D,Ea as L,Eb as w,Ic as l,Jc as O,Kc as _,Wc as z,Xb as C,Xc as V,Y as T,Zb as x,ac as R,bc as k,cc as d,db as E,dc as n,ec as i,ed as A,fc as v,gb as r,gd as q,ha as b,l as N,mc as P,oa as y,pa as M,rc as c,tc as h,yb as I}from"./chunk-5VYDZBNH.js";import{a as u,b as f}from"./chunk-QWWW7GFA.js";var ie=()=>["/menu/log/exception/detail"],oe=o=>({ID:o});function ae(o,g){if(o&1&&(n(0,"span",17),v(1,"img",18),i(),l(2)),o&2){let e=g.item;r(),d("src",e.Img,E)("alt",e.Name),r(),_(" ",e.Name," ")}}function re(o,g){if(o&1&&v(0,"img",23),o&2){let e=h().$implicit;d("src",e.Logo,E)}}function le(o,g){if(o&1&&(n(0,"tr")(1,"td"),C(2,re,1,1,"img",23),l(3),i(),n(4,"td")(5,"a",24),l(6),i()(),n(7,"td"),l(8),A(9,"date"),i(),n(10,"td")(11,"div"),l(12),i()()()),o&2){let e=g.$implicit;r(2),x(e.Logo?2:-1),r(),_(" ",e.ChannelName," "),r(2),d("routerLink",z(10,ie))("queryParams",V(11,oe,e.id)),r(),_(" ",e.number??"N/A"," "),r(2),_(" ",q(9,7,e.date,"dd-MM-yyyy hh:mm:ss")," "),r(4),O(e.response)}}function me(o,g){if(o&1){let e=P();n(0,"mat-paginator",25),c("page",function(t){y(e);let m=h(2);return M(m.onPaginationChange(t))}),i()}if(o&2){let e=h(2);d("length",e.pageTotal())("pageSize",e.pageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function pe(o,g){if(o&1&&(n(0,"div",15)(1,"table",19)(2,"thead")(3,"tr",20)(4,"th",21),l(5,"Channel Name"),i(),n(6,"th",21),l(7,"Number"),i(),n(8,"th",21),l(9,"Date"),i(),n(10,"th"),l(11,"Exception"),i()()(),n(12,"tbody"),R(13,le,13,13,"tr",null,F),i()(),C(15,me,1,3,"mat-paginator",22),i()),o&2){let e,a=h();r(13),k(a.exceptions()),r(2),x(((e=a.exceptions())==null?null:e.length)>0?15:-1)}}function de(o,g){o&1&&(n(0,"div",16),v(1,"app-empty-state"),i())}var Ie=(()=>{class o{loadExceptions(){return this.http.post("/api/Orders/GetExceptionList",this.filter()).pipe(T(e=>{this.exceptions.set(e.hits.map(a=>{let t=a._source||{};return{id:a._id,ChannelName:t.channelId!=null?this.channelOptions().find(m=>m.ID===t.channelId)?.Name:t.shopId,Logo:t.channelId!=null?this.channelOptions().find(m=>m.ID===t.channelId)?.Img:null,number:t.error?.number,date:t["@timestamp_received"]||t["@timestamp"]||null,stackTrace:t.error?.stackTrace,response:t.error?.response,message:t.message,requestJSON:t.error?.requestJSON}})),this.pageTotal.set(e.total?.value),this.pageSize.set(this.filter().RowCount>this.pageTotal()?this.pageTotal():this.filter()?.RowCount)}))}constructor(){this.http=b(H),this.authService=b(G),this.exceptions=s([]),this.pageTotal=s(0),this.pageSize=s(0),this.filter=s({RowCount:50,PageNumber:1,Number:null,From:null,To:null,ChannelID:null}),this.channelOptions=s(this.authService.getChannels()),this.loaderResource=S({params:()=>0,stream:()=>this.http.post("/api/OrdersLoader/Get",{})}),this.reloadToken=s(0),this.filterReady=s(!1),this.resource=S({params:()=>({token:this.reloadToken(),loader:this.loaderResource.value(),ready:this.filterReady()}),stream:({params:e})=>!e.loader||!e.ready?N([]):this.loadExceptions()}),D(()=>{let e=this.loaderResource.value();e&&(this.filter.update(a=>u(u({},a),e.Filter)),this.filterReady.set(!0),L(()=>this.getData()))})}getData(e){this.filter.update(a=>f(u({},a),{Number:e})),this.reloadToken.update(a=>a+1)}onPaginationChange(e){this.filter.update(a=>f(u({},a),{PageNumber:e.pageIndex+1})),this.getData()}updateFilter(e,a){this.filter.update(t=>f(u({},t),{[e]:a}))}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=I({type:o,selectors:[["app-exception-log"]],decls:28,vars:8,consts:[["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...",3,"onSubmit"],[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"],[2,"width","10%"],[3,"length","pageSize","pageIndex"],["alt","Logo",2,"width","18px",3,"src"],[3,"routerLink","queryParams"],[3,"page","length","pageSize","pageIndex"]],template:function(a,t){a&1&&(n(0,"mainpanel",0),c("onSubmit",function(p){return t.getData(p)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),i(),n(5,"ng-select",2),c("ngModelChange",function(p){return t.updateFilter("ChannelID",p)}),w(6,ae,3,3,"ng-template",3),i()(),n(7,"div",4)(8,"label",5),l(9,"From/To"),i(),n(10,"div",6)(11,"datepicker",7),c("dateChange",function(p){return t.updateFilter("From",p)}),i()(),n(12,"div")(13,"datepicker",8),c("dateChange",function(p){return t.updateFilter("To",p)}),i()()(),n(14,"div",4)(15,"label",9),l(16,"Page Number"),i(),n(17,"input",10),c("ngModelChange",function(p){return t.updateFilter("PageNumber",p)}),i()(),n(18,"div",4)(19,"label",9),l(20,"Page Size"),i(),n(21,"input",11),c("ngModelChange",function(p){return t.updateFilter("RowCount",p)}),i()()(),n(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),C(26,pe,16,1,"div",15)(27,de,2,0,"div",16),i()()()()()),a&2&&(r(5),d("clearable",!0)("items",t.channelOptions())("ngModel",t.filter().ChannelID),r(6),d("date",t.filter().From),r(2),d("date",t.filter().To),r(4),d("ngModel",t.filter().PageNumber),r(4),d("ngModel",t.filter().RowCount),r(5),x(t.exceptions().length>0?26:27))},dependencies:[W,Z,Q,J,K,U,$,X,Y,te,j,ne,ee,B],encapsulation:2,changeDetection:0})}}return o})();export{Ie as ExceptionLogComponent};
1
+ import{a as ne}from"./chunk-RLLQHRSD.js";import{a as te}from"./chunk-ZLMUYIKY.js";import"./chunk-QK2JCSM3.js";import"./chunk-ON5KFKHE.js";import{a as ee}from"./chunk-EYHQ2ZKL.js";import"./chunk-BGFEVOPZ.js";import{a as X,b as Y,d as Z}from"./chunk-474G6BPL.js";import{b as W}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import{c as S}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as G}from"./chunk-GUTJ3MLW.js";import"./chunk-6ENJB5FQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as J,h as U,m as $,o as K,z as Q}from"./chunk-7HUEGPJN.js";import{e as H}from"./chunk-ZE4OOGMT.js";import{e as j}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as F,Aa as s,Da as D,Ea as L,Eb as w,Ic as l,Jc as O,Kc as _,Wc as z,Xb as C,Xc as V,Y as T,Zb as x,ac as R,bc as k,cc as d,db as E,dc as n,ec as i,ed as A,fc as v,gb as r,gd as q,ha as b,l as N,mc as P,oa as y,pa as M,rc as c,tc as h,yb as I}from"./chunk-5VYDZBNH.js";import{a as u,b as f}from"./chunk-QWWW7GFA.js";var ie=()=>["/menu/log/exception/detail"],oe=o=>({ID:o});function ae(o,g){if(o&1&&(n(0,"span",17),v(1,"img",18),i(),l(2)),o&2){let e=g.item;r(),d("src",e.Img,E)("alt",e.Name),r(),_(" ",e.Name," ")}}function re(o,g){if(o&1&&v(0,"img",23),o&2){let e=h().$implicit;d("src",e.Logo,E)}}function le(o,g){if(o&1&&(n(0,"tr")(1,"td"),C(2,re,1,1,"img",23),l(3),i(),n(4,"td")(5,"a",24),l(6),i()(),n(7,"td"),l(8),A(9,"date"),i(),n(10,"td")(11,"div"),l(12),i()()()),o&2){let e=g.$implicit;r(2),x(e.Logo?2:-1),r(),_(" ",e.ChannelName," "),r(2),d("routerLink",z(10,ie))("queryParams",V(11,oe,e.id)),r(),_(" ",e.number??"N/A"," "),r(2),_(" ",q(9,7,e.date,"dd-MM-yyyy hh:mm:ss")," "),r(4),O(e.response)}}function me(o,g){if(o&1){let e=P();n(0,"mat-paginator",25),c("page",function(t){y(e);let m=h(2);return M(m.onPaginationChange(t))}),i()}if(o&2){let e=h(2);d("length",e.pageTotal())("pageSize",e.pageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function pe(o,g){if(o&1&&(n(0,"div",15)(1,"table",19)(2,"thead")(3,"tr",20)(4,"th",21),l(5,"Channel Name"),i(),n(6,"th",21),l(7,"Number"),i(),n(8,"th",21),l(9,"Date"),i(),n(10,"th"),l(11,"Exception"),i()()(),n(12,"tbody"),R(13,le,13,13,"tr",null,F),i()(),C(15,me,1,3,"mat-paginator",22),i()),o&2){let e,a=h();r(13),k(a.exceptions()),r(2),x(((e=a.exceptions())==null?null:e.length)>0?15:-1)}}function de(o,g){o&1&&(n(0,"div",16),v(1,"app-empty-state"),i())}var Ie=(()=>{class o{loadExceptions(){return this.http.post("/api/Orders/GetExceptionList",this.filter()).pipe(T(e=>{this.exceptions.set(e.hits.map(a=>{let t=a._source||{};return{id:a._id,ChannelName:t.channelId!=null?this.channelOptions().find(m=>m.ID===t.channelId)?.Name:t.shopId,Logo:t.channelId!=null?this.channelOptions().find(m=>m.ID===t.channelId)?.Img:null,number:t.error?.number,date:t["@timestamp_received"]||t["@timestamp"]||null,stackTrace:t.error?.stackTrace,response:t.error?.response,message:t.message,requestJSON:t.error?.requestJSON}})),this.pageTotal.set(e.total?.value),this.pageSize.set(this.filter().RowCount>this.pageTotal()?this.pageTotal():this.filter()?.RowCount)}))}constructor(){this.http=b(H),this.authService=b(G),this.exceptions=s([]),this.pageTotal=s(0),this.pageSize=s(0),this.filter=s({RowCount:50,PageNumber:1,Number:null,From:null,To:null,ChannelID:null}),this.channelOptions=s(this.authService.getChannels()),this.loaderResource=S({params:()=>0,stream:()=>this.http.post("/api/OrdersLoader/Get",{})}),this.reloadToken=s(0),this.filterReady=s(!1),this.resource=S({params:()=>({token:this.reloadToken(),loader:this.loaderResource.value(),ready:this.filterReady()}),stream:({params:e})=>!e.loader||!e.ready?N([]):this.loadExceptions()}),D(()=>{let e=this.loaderResource.value();e&&(this.filter.update(a=>u(u({},a),e.Filter)),this.filterReady.set(!0),L(()=>this.getData()))})}getData(e){this.filter.update(a=>f(u({},a),{Number:e})),this.reloadToken.update(a=>a+1)}onPaginationChange(e){this.filter.update(a=>f(u({},a),{PageNumber:e.pageIndex+1})),this.getData()}updateFilter(e,a){this.filter.update(t=>f(u({},t),{[e]:a}))}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=I({type:o,selectors:[["app-exception-log"]],decls:28,vars:8,consts:[["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...",3,"onSubmit"],[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"],[2,"width","10%"],[3,"length","pageSize","pageIndex"],["alt","Logo",2,"width","18px",3,"src"],[3,"routerLink","queryParams"],[3,"page","length","pageSize","pageIndex"]],template:function(a,t){a&1&&(n(0,"mainpanel",0),c("onSubmit",function(p){return t.getData(p)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),i(),n(5,"ng-select",2),c("ngModelChange",function(p){return t.updateFilter("ChannelID",p)}),w(6,ae,3,3,"ng-template",3),i()(),n(7,"div",4)(8,"label",5),l(9,"From/To"),i(),n(10,"div",6)(11,"datepicker",7),c("dateChange",function(p){return t.updateFilter("From",p)}),i()(),n(12,"div")(13,"datepicker",8),c("dateChange",function(p){return t.updateFilter("To",p)}),i()()(),n(14,"div",4)(15,"label",9),l(16,"Page Number"),i(),n(17,"input",10),c("ngModelChange",function(p){return t.updateFilter("PageNumber",p)}),i()(),n(18,"div",4)(19,"label",9),l(20,"Page Size"),i(),n(21,"input",11),c("ngModelChange",function(p){return t.updateFilter("RowCount",p)}),i()()(),n(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),C(26,pe,16,1,"div",15)(27,de,2,0,"div",16),i()()()()()),a&2&&(r(5),d("clearable",!0)("items",t.channelOptions())("ngModel",t.filter().ChannelID),r(6),d("date",t.filter().From),r(2),d("date",t.filter().To),r(4),d("ngModel",t.filter().PageNumber),r(4),d("ngModel",t.filter().RowCount),r(5),x(t.exceptions().length>0?26:27))},dependencies:[W,Z,Q,J,K,U,$,X,Y,te,j,ne,ee,B],encapsulation:2,changeDetection:0})}}return o})();export{Ie as ExceptionLogComponent};
@@ -1 +1 @@
1
- import{a as Te}from"./chunk-3C3TLWKJ.js";import{a as I}from"./chunk-ISMIPSYN.js";import{a as ye,b as Fe,c as Ve,d as L,e as B}from"./chunk-SA4KQTJY.js";import{a as we}from"./chunk-CMZFAK2O.js";import{a as be,b as Me}from"./chunk-32F5EUMW.js";import{a as Se}from"./chunk-ZSG2EXIR.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{c as Pe}from"./chunk-NH7UFKXO.js";import{a as ve}from"./chunk-6YRYXHZS.js";import{a as xe}from"./chunk-VYXSV6K4.js";import"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import"./chunk-62QUGB6I.js";import{a as fe}from"./chunk-7X3KALOK.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-A4TBJ6UZ.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{d as he,e as ue}from"./chunk-474G6BPL.js";import{a as ge,b as Ce}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import{c as me}from"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as ae}from"./chunk-ZSUWHVKX.js";import{f as re}from"./chunk-C5O6VJ2D.js";import"./chunk-TU34BDDQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import{b as ie,c as oe}from"./chunk-MDHMVGYC.js";import{c as ee}from"./chunk-NNVT5X6O.js";import{b as le,c as ce,h as se,m as de,o as pe,z as _e}from"./chunk-7HUEGPJN.js";import{b as te,e as ne}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{D as T,K as Y,z as X}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as x,C as G,Eb as F,Fc as O,Ic as m,Jc as k,Kc as w,Mc as R,Nc as $,Oc as U,S as K,Sc as J,Vc as Z,Xb as h,Xc as V,Y as q,Zb as u,_b as D,ac as E,bc as N,cc as g,db as y,dc as r,ec as l,ed as b,fc as v,fd as M,gb as c,gd as Q,ha as f,mc as P,oa as d,pa as p,rc as C,tc as a,yb as j}from"./chunk-5VYDZBNH.js";import{a as H,b as W}from"./chunk-QWWW7GFA.js";var A=o=>[o];function De(o,s){if(o&1){let e=P();r(0,"button",15),C("click",function(){d(e);let t=a(),n=a(2);return p(n.updateStock(t))}),v(1,"i",16),m(2," Update "),l()}}function Ee(o,s){if(o&1){let e=P();r(0,"div",10),h(1,De,3,0,"button",12),r(2,"button",13),C("click",function(){d(e);let t=a(2);return p(t.openExportDialog())}),v(3,"i",14),r(4,"span"),m(5,"Export"),l()()()}if(o&2){let e=a(2);c(),u(e.productService.hasSelectionVariant(s)?1:-1)}}function Ne(o,s){if(o&1){let e=P();r(0,"th")(1,"input",31),C("change",function(t){d(e);let n=a(),_=a(2);return p(_.onSelectAllSKU(t.target.checked,n))}),l()()}}function Oe(o,s){if(o&1){let e=P();r(0,"input",48),U("ngModelChange",function(t){d(e);let n=a(4).$implicit;return $(n.selected,t)||(n.selected=t),p(t)}),C("ngModelChange",function(){d(e);let t=a(4).$implicit,n=a(3);return p(n.onCheckboxStateProduct(t))}),l()}if(o&2){let e=a(4).$implicit;R("ngModel",e.selected)}}function ke(o,s){if(o&1&&F(0,Oe,1,1,"ng-template",25),o&2){let e=a(6);g("ngxPermissionsOnly",V(1,A,e.rolePriceEdit))}}function Re(o,s){if(o&1){let e=P();r(0,"img",49),C("click",function(t){d(e);let n=a(3).$implicit,_=a(3);return p(_.onZoomImage(t,n==null?null:n.ImageUrl))}),l()}if(o&2){let e=a(3).$implicit;g("src",J(e.ThumbnailUrl),y)}}function $e(o,s){o&1&&v(0,"img",44)}function Ue(o,s){if(o&1&&(r(0,"small",47),m(1),l()),o&2){let e=a(3).$implicit;c(),w("(",e.Category,")")}}function Le(o,s){if(o&1&&(r(0,"td",42)(1,"div",34),h(2,ke,1,3,null,25),r(3,"div"),h(4,Re,1,2,"img",43)(5,$e,1,0,"img",44),l()()(),r(6,"td",45)(7,"span",46),m(8),l(),h(9,Ue,2,1,"small",47),l()),o&2){let e=a(2).$implicit;g("rowSpan",e.Variants.length),c(2),u((e.Variants==null?null:e.Variants.length)>1?2:-1),c(2),u(e.ThumbnailUrl?4:5),c(2),g("rowSpan",e.Variants.length),c(2),k(e.Name),c(),u(e.Category?9:-1)}}function Be(o,s){if(o&1){let e=P();r(0,"input",52),U("ngModelChange",function(t){d(e);let n=a(2).$implicit;return $(n.selected,t)||(n.selected=t),p(t)}),l()}if(o&2){let e=a(2).$implicit;R("ngModel",e.selected)}}function Ae(o,s){if(o&1&&(r(0,"td",50),h(1,Be,1,1,"input",51),l()),o&2){let e=a().$implicit;c(),u(e.UnitPrice>=0?1:-1)}}function ze(o,s){o&1&&(r(0,"div",35),m(1," Not Found "),l())}function He(o,s){if(o&1&&(r(0,"div"),m(1),b(2,"number"),l()),o&2){let e=a().$implicit;c(),w(" ",M(2,1,e.UnitPrice)," ")}}function We(o,s){if(o&1&&(r(0,"div",36)(1,"a",38),v(2,"i",53),l()()),o&2){let e=a().$implicit,i=a(4);c(),g("href",i.hostName()+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),y)}}function Ge(o,s){if(o&1){let e=P();r(0,"div",54),C("click",function(){d(e);let t=a().$implicit,n=a().$implicit,_=a(2),S=a();return p(S.openTableDialog(t,n,_))}),m(1),b(2,"number"),l()}if(o&2){let e=a().$implicit;c(),w(" ",M(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function Ke(o,s){if(o&1){let e=P();r(0,"tr",32),h(1,Le,10,6),r(2,"td",23),m(3),l(),r(4,"td",26)(5,"span",33),m(6),l()(),F(7,Ae,2,1,"ng-template",25),r(8,"td",26)(9,"div",34),h(10,ze,2,0,"div",35),h(11,He,3,3,"div"),h(12,We,3,1,"div",36),l()(),r(13,"td",26)(14,"div",34),h(15,Ge,3,3,"div",37),r(16,"div",36)(17,"a",38),v(18,"i",39),l()(),r(19,"div",36)(20,"div",40),C("click",function(){let t=d(e).$implicit,n=a(4);return p(n.refreshPrice(t))}),v(21,"i",41),l()()()()()}if(o&2){let e=s.$implicit,i=s.$index,t=a(4);c(),u(i==0?1:-1),c(2),k(e.Model),c(2),O("text-decoration-line-through",e.Discontinued),g("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),c(),w(" ",e.Code," "),c(),g("ngxPermissionsOnly",V(14,A,t.rolePriceEdit)),c(3),u((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),c(),O("bg-gradient-warning",e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price)),c(2),u(e.Channel.length>0?15:-1),c(2),g("href",e.Channel[0]==null?null:e.Channel[0].Url,y)}}function qe(o,s){if(o&1&&E(0,Ke,22,16,"tr",32,D),o&2){let e=s.$implicit;N(e.Variants)}}function je(o,s){if(o&1){let e=P();r(0,"div",11)(1,"div",17)(2,"table",18)(3,"thead",19)(4,"tr")(5,"th",20),m(6," Product "),r(7,"div")(8,"mat-slide-toggle",21),C("ngModelChange",function(t){d(e);let n=a(2);return p(n.toggleDifferentInventory.set(t))})("toggleChange",function(){d(e);let t=a(2);return p(t.onToggleDifferentInventory())}),r(9,"small",22),m(10,"FILTER DIFFERENT PRICE"),l()()()(),r(11,"th",23),m(12,"Variant"),l(),r(13,"th",24),m(14,"SKU"),l(),F(15,Ne,2,0,"ng-template",25),r(16,"th",26),m(17,"POS"),l(),r(18,"th",26)(19,"div",27),C("click",function(){d(e);let t=a(2);return p(t.openModalFilter())}),v(20,"img",28),r(21,"span",29),m(22),b(23,"stringLimit"),l()()()()(),r(24,"tbody"),E(25,qe,2,0,null,null,D),l()(),r(27,"infinite-paginator",30),b(28,"async"),C("onNextPage",function(){d(e);let t=a(2);return p(t.infinitePagination.onNextPage(t.searchFilter()))})("onLastPage",function(){d(e);let t=a(2);return p(t.infinitePagination.onLastPage(t.searchFilter()))})("onGetRowCount",function(){d(e);let t=a(2);return p(t.infinitePagination.getRowCount(t.searchFilter()))}),l()()()}if(o&2){let e,i,t,n=a(2);c(8),g("ngModel",n.toggleDifferentInventory()),c(7),g("ngxPermissionsOnly",V(16,A,n.rolePriceEdit)),c(4),g("matTooltip",((e=n.selectedChannel())==null||e.Name==null?null:e.Name.length)>=20?(e=n.selectedChannel())==null?null:e.Name:""),c(),g("src",(i=n.selectedChannel())==null?null:i.Img,y),c(2),w(" ",Q(23,11,(t=n.selectedChannel())==null?null:t.Name,20)," "),c(3),N(s),c(2),g("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",M(28,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function Je(o,s){if(o&1){let e=P();r(0,"mainpanel",1),C("textChange",function(t){d(e);let n=a();return p(n.updateFilter("text",t))})("onSubmit",function(){d(e);let t=a();return p(t.onSearch())}),r(1,"filters")(2,"div",2)(3,"div",3)(4,"h6"),m(5,"Channel"),l(),r(6,"app-channel-options-v2",4),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("ChannelID",t))}),l()(),r(7,"div",5)(8,"h6"),m(9,"Number Filter Comparator"),l(),r(10,"ng-select",6),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("NumberFilterComparator",t))}),l()(),r(11,"div",5)(12,"h6"),m(13,"Search Type"),l(),r(14,"radio-options",7),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("SearchType",t))}),l()(),r(15,"div",5)(16,"h6"),m(17,"Page Number"),l(),r(18,"input",8),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("PageNumber",t))}),l()(),r(19,"div",5)(20,"h6"),m(21,"Page Size"),l(),r(22,"input",9),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("RowCount",t))}),l()()()(),r(23,"actions"),h(24,Ee,6,1,"div",10),b(25,"async"),l(),r(26,"content"),h(27,je,29,18,"div",11),b(28,"async"),l()()}if(o&2){let e,i,t=s,n=a();g("headerTitle",n.pageTitle())("text",n.searchFilter().text)("searchBoxPlaceHolder",n.searchPlaceholder()),c(6),g("ngModel",n.searchFilter().ChannelID),c(4),g("items",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions)("clearable",!1)("ngModel",n.searchFilter().NumberFilterComparator),c(4),g("options",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions)("ngModel",n.searchFilter().SearchType),c(4),g("ngModel",n.searchFilter().PageNumber),c(4),g("ngModel",n.searchFilter().RowCount),c(2),u((e=M(25,13,n.data$))?24:-1,e),c(3),u((i=M(28,15,n.data$))?27:-1,i)}}var Et=(()=>{class o{constructor(){this.http=f(ne),this.toastr=f(te),this.dialog=f(me),this.productService=f(fe),this.biggerPictureService=f(xe),this.authService=f(re),this.mainPanelService=f(ge),this.decimalPipe=f(T),this.placeholderService=f(Pe),this.infinitePagination=f(L),this.updateResHandling=f(B),this.pageTitle=x("Price Single Channel Comparison"),this.toggleDifferentInventory=x(!1),this.loaderEndpoint=x("PriceLoader/Load"),this.dataEndpoint=x("Price/GetSingleChannelComparison"),this.rowCountApi=x("Inventory/GetInventoryByChannelRowCount"),this.searchFilter=x({}),this.hostName=x(""),this.rolePriceEdit=ae.PriceUpdate,this.channelOptions=x([]),this.selectedChannel=x(null),this.discontinuedVariantMsg=x("This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel."),this.searchPlaceholder=x("Search ...");let e=this.authService;this.hostName.set(this.authService.getDomain()),this.data$=this.infinitePagination.data$.pipe(K(1)),this.channelOptions.set(e.getChannels())}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint(),this.infinitePagination.fethRowCountEndpoint=this.rowCountApi(),this.loader$=this.http.post(`/API/${this.loaderEndpoint()}`).pipe(q(e=>{this.searchFilter.set(e.Filter),this.searchFilter.update(i=>(i.filterModel=I.ALL,i)),this.initSearchPlaceholder(),this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter().SearchType,this.searchFilter().NumberFilterComparator))}onToggleDifferentInventory(){this.toggleDifferentInventory()?this.searchFilter.update(e=>(e.filterModel=I.ALL,e)):this.searchFilter.update(e=>(e.filterModel=I.DIFFERENCE,e)),this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(i=>(i.selected=e.selected,i))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(_=>({ID:_.ID,ChannelID:_.Channel[0].ChannelID,Code:_.Code,Price:_.UnitPrice})),n={ListChannelID:[this.searchFilter().ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",n).subscribe(_=>{this.onSearch(),this.handlingUpdateStock(_.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let i=e.failure_list,t=e.success_list;this.updateResHandling.responseHandling(t,i,"Price");let n=(t||[]).map(_=>this.buildPlugoTruncationHtml(_?.Message)).filter(_=>!!_);n.length>0&&this.toastr.warning(n.join("<br>"),(i||[]).length===0?"Success with Warning":"Warning",{enableHtml:!0})}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let i={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",i).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel(),this.initSearchPlaceholder()}openTableDialog(e,i,t){let n=JSON.parse(JSON.stringify(e));this.dialog.open(ye,{data:{Name:i.Name,Variant:n,ChannelID:n?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:n?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(G(S=>ee.IsNotEmpty(S))).subscribe(S=>{this.updateItemAfterDialog(S,e)})}updateItemAfterDialog(e,i){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe({next:n=>{let _=this.productService.findChannelById(t.ID,this.channelOptions()),S=this.extractSuccessNote(n),z=this.buildPlugoTruncationHtml(S);if(z)this.toastr.warning(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${_.Name} \u2014 ${z}`,"Success with Warning",{enableHtml:!0});else{let Ie=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${_.Name} to ${Ie}`,"Success"),S&&S!=="Success"&&this.toastr.warning(S,"Warning")}this.infinitePagination.reloadPagination(this.searchFilter())},error:n=>{let _=n?.error?.Message||n?.error?.message||n?.error?.Response?.failure_list?.[0]?.Message||n?.message||"Failed to update price";this.toastr.error(_,"Error")}})}extractSuccessNote(e){return e?.Response?.success_list?.[0]?.Message??e?.response?.success_list?.[0]?.Message??e?.Response?.success_list?.[0]?.message??e?.success_list?.[0]?.Message}buildPlugoTruncationHtml(e){if(!e||e==="Success"||!e.includes("Plugo does not support decimal"))return null;let i=e.match(/Original price ([\d.,]+) was truncated to ([\d.,]+)/i);if(i){let t=this.decimalPipe.transform(parseFloat(i[1].replace(/,/g,"")))??i[1],n=this.decimalPipe.transform(parseFloat(i[2].replace(/,/g,"")))??i[2];return`${t} was rounded down to <b>${n}</b> \u2014 Plugo accepts whole numbers only.`}return e.replace(/^Success\s*-\s*Note:\s*/i,"")||e}initSelectedChannel(){this.selectedChannel.set(this.channelOptions().find(e=>e.ID==this.searchFilter().ChannelID))}onSelectAllSKU(e,i){i=i.map(t=>(t.Variants=t.Variants.map(n=>(n.selected=e,n)),t))}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}openExportDialog(){this.dialog.open(we,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountApi(),exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}updateFilter(e,i){this.searchFilter.update(t=>W(H({},t),{[e]:i}))}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=j({type:o,selectors:[["app-price-single-channel"]],features:[Z([L,Te,Y("https://resc.cloudinary.com/"),T,B])],decls:2,vars:3,consts:[["filterDialogWidth","625px",1,"single-price",3,"headerTitle","text","searchBoxPlaceHolder"],["filterDialogWidth","625px",1,"single-price",3,"textChange","onSubmit","headerTitle","text","searchBoxPlaceHolder"],[1,"dialog-filter","grid-filter"],[1,"filter-item","full"],[3,"ngModelChange","ngModel"],[1,"filter-item"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","clearable","ngModel"],[3,"ngModelChange","options","ngModel"],["type","number","placeholder","Page Number",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","placeholder","Page Size",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex"],[1,"container-fluid","mt-5"],[1,"btn","btn-success"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(i,t){if(i&1&&(h(0,Je,29,17,"mainpanel",0),b(1,"async")),i&2){let n;u((n=M(1,1,t.loader$))?0:-1,n)}},dependencies:[Ce,_e,ce,pe,le,se,de,Ve,oe,ie,Me,be,Se,ue,he,ve,Fe,X,T],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}.dialog-filter.grid-filter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;width:100%}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin-bottom:6px}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item.full[_ngcontent-%COMP%]{grid-column:1/-1}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] radio-options[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-width:0!important;width:100%!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]{height:40px;min-height:40px;border:1px solid #ccc;border-radius:4px;font-size:.875rem;padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%]:focus, .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:focus{border:1px solid #86b7fe;box-shadow:none;outline:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-select-container{height:40px!important;min-height:40px!important;align-items:center;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value-container{padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value, .dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-placeholder{font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-select{box-sizing:border-box;width:100%!important;height:40px!important;min-height:40px!important;--p-select-padding-y: 8px;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-select:not(.p-disabled):hover{border-color:#ccc}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-select-label{font-size:.875rem!important}"],changeDetection:0})}}return o})();export{Et as PriceSingleChannelComponent};
1
+ import{a as Te}from"./chunk-3C3TLWKJ.js";import{a as I}from"./chunk-ISMIPSYN.js";import{a as ye,b as Fe,c as Ve,d as L,e as B}from"./chunk-SA4KQTJY.js";import{a as we}from"./chunk-CMZFAK2O.js";import{a as be,b as Me}from"./chunk-32F5EUMW.js";import{a as Se}from"./chunk-E4KDJSXX.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{c as Pe}from"./chunk-NH7UFKXO.js";import{a as ve}from"./chunk-6YRYXHZS.js";import{a as xe}from"./chunk-VYXSV6K4.js";import"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import"./chunk-62QUGB6I.js";import{a as fe}from"./chunk-UAB7S7RK.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-ZOF6UEJP.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{d as he,e as ue}from"./chunk-474G6BPL.js";import{a as ge,b as Ce}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import{c as me}from"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as ae}from"./chunk-ZSUWHVKX.js";import{f as re}from"./chunk-GUTJ3MLW.js";import"./chunk-6ENJB5FQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import{b as ie,c as oe}from"./chunk-MDHMVGYC.js";import{c as ee}from"./chunk-NNVT5X6O.js";import{b as le,c as ce,h as se,m as de,o as pe,z as _e}from"./chunk-7HUEGPJN.js";import{b as te,e as ne}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{D as T,K as Y,z as X}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as x,C as G,Eb as F,Fc as O,Ic as m,Jc as k,Kc as w,Mc as R,Nc as $,Oc as U,S as K,Sc as J,Vc as Z,Xb as h,Xc as V,Y as q,Zb as u,_b as D,ac as E,bc as N,cc as g,db as y,dc as r,ec as l,ed as b,fc as v,fd as M,gb as c,gd as Q,ha as f,mc as P,oa as d,pa as p,rc as C,tc as a,yb as j}from"./chunk-5VYDZBNH.js";import{a as H,b as W}from"./chunk-QWWW7GFA.js";var A=o=>[o];function De(o,s){if(o&1){let e=P();r(0,"button",15),C("click",function(){d(e);let t=a(),n=a(2);return p(n.updateStock(t))}),v(1,"i",16),m(2," Update "),l()}}function Ee(o,s){if(o&1){let e=P();r(0,"div",10),h(1,De,3,0,"button",12),r(2,"button",13),C("click",function(){d(e);let t=a(2);return p(t.openExportDialog())}),v(3,"i",14),r(4,"span"),m(5,"Export"),l()()()}if(o&2){let e=a(2);c(),u(e.productService.hasSelectionVariant(s)?1:-1)}}function Ne(o,s){if(o&1){let e=P();r(0,"th")(1,"input",31),C("change",function(t){d(e);let n=a(),_=a(2);return p(_.onSelectAllSKU(t.target.checked,n))}),l()()}}function Oe(o,s){if(o&1){let e=P();r(0,"input",48),U("ngModelChange",function(t){d(e);let n=a(4).$implicit;return $(n.selected,t)||(n.selected=t),p(t)}),C("ngModelChange",function(){d(e);let t=a(4).$implicit,n=a(3);return p(n.onCheckboxStateProduct(t))}),l()}if(o&2){let e=a(4).$implicit;R("ngModel",e.selected)}}function ke(o,s){if(o&1&&F(0,Oe,1,1,"ng-template",25),o&2){let e=a(6);g("ngxPermissionsOnly",V(1,A,e.rolePriceEdit))}}function Re(o,s){if(o&1){let e=P();r(0,"img",49),C("click",function(t){d(e);let n=a(3).$implicit,_=a(3);return p(_.onZoomImage(t,n==null?null:n.ImageUrl))}),l()}if(o&2){let e=a(3).$implicit;g("src",J(e.ThumbnailUrl),y)}}function $e(o,s){o&1&&v(0,"img",44)}function Ue(o,s){if(o&1&&(r(0,"small",47),m(1),l()),o&2){let e=a(3).$implicit;c(),w("(",e.Category,")")}}function Le(o,s){if(o&1&&(r(0,"td",42)(1,"div",34),h(2,ke,1,3,null,25),r(3,"div"),h(4,Re,1,2,"img",43)(5,$e,1,0,"img",44),l()()(),r(6,"td",45)(7,"span",46),m(8),l(),h(9,Ue,2,1,"small",47),l()),o&2){let e=a(2).$implicit;g("rowSpan",e.Variants.length),c(2),u((e.Variants==null?null:e.Variants.length)>1?2:-1),c(2),u(e.ThumbnailUrl?4:5),c(2),g("rowSpan",e.Variants.length),c(2),k(e.Name),c(),u(e.Category?9:-1)}}function Be(o,s){if(o&1){let e=P();r(0,"input",52),U("ngModelChange",function(t){d(e);let n=a(2).$implicit;return $(n.selected,t)||(n.selected=t),p(t)}),l()}if(o&2){let e=a(2).$implicit;R("ngModel",e.selected)}}function Ae(o,s){if(o&1&&(r(0,"td",50),h(1,Be,1,1,"input",51),l()),o&2){let e=a().$implicit;c(),u(e.UnitPrice>=0?1:-1)}}function ze(o,s){o&1&&(r(0,"div",35),m(1," Not Found "),l())}function He(o,s){if(o&1&&(r(0,"div"),m(1),b(2,"number"),l()),o&2){let e=a().$implicit;c(),w(" ",M(2,1,e.UnitPrice)," ")}}function We(o,s){if(o&1&&(r(0,"div",36)(1,"a",38),v(2,"i",53),l()()),o&2){let e=a().$implicit,i=a(4);c(),g("href",i.hostName()+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),y)}}function Ge(o,s){if(o&1){let e=P();r(0,"div",54),C("click",function(){d(e);let t=a().$implicit,n=a().$implicit,_=a(2),S=a();return p(S.openTableDialog(t,n,_))}),m(1),b(2,"number"),l()}if(o&2){let e=a().$implicit;c(),w(" ",M(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function Ke(o,s){if(o&1){let e=P();r(0,"tr",32),h(1,Le,10,6),r(2,"td",23),m(3),l(),r(4,"td",26)(5,"span",33),m(6),l()(),F(7,Ae,2,1,"ng-template",25),r(8,"td",26)(9,"div",34),h(10,ze,2,0,"div",35),h(11,He,3,3,"div"),h(12,We,3,1,"div",36),l()(),r(13,"td",26)(14,"div",34),h(15,Ge,3,3,"div",37),r(16,"div",36)(17,"a",38),v(18,"i",39),l()(),r(19,"div",36)(20,"div",40),C("click",function(){let t=d(e).$implicit,n=a(4);return p(n.refreshPrice(t))}),v(21,"i",41),l()()()()()}if(o&2){let e=s.$implicit,i=s.$index,t=a(4);c(),u(i==0?1:-1),c(2),k(e.Model),c(2),O("text-decoration-line-through",e.Discontinued),g("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),c(),w(" ",e.Code," "),c(),g("ngxPermissionsOnly",V(14,A,t.rolePriceEdit)),c(3),u((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),c(),O("bg-gradient-warning",e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price)),c(2),u(e.Channel.length>0?15:-1),c(2),g("href",e.Channel[0]==null?null:e.Channel[0].Url,y)}}function qe(o,s){if(o&1&&E(0,Ke,22,16,"tr",32,D),o&2){let e=s.$implicit;N(e.Variants)}}function je(o,s){if(o&1){let e=P();r(0,"div",11)(1,"div",17)(2,"table",18)(3,"thead",19)(4,"tr")(5,"th",20),m(6," Product "),r(7,"div")(8,"mat-slide-toggle",21),C("ngModelChange",function(t){d(e);let n=a(2);return p(n.toggleDifferentInventory.set(t))})("toggleChange",function(){d(e);let t=a(2);return p(t.onToggleDifferentInventory())}),r(9,"small",22),m(10,"FILTER DIFFERENT PRICE"),l()()()(),r(11,"th",23),m(12,"Variant"),l(),r(13,"th",24),m(14,"SKU"),l(),F(15,Ne,2,0,"ng-template",25),r(16,"th",26),m(17,"POS"),l(),r(18,"th",26)(19,"div",27),C("click",function(){d(e);let t=a(2);return p(t.openModalFilter())}),v(20,"img",28),r(21,"span",29),m(22),b(23,"stringLimit"),l()()()()(),r(24,"tbody"),E(25,qe,2,0,null,null,D),l()(),r(27,"infinite-paginator",30),b(28,"async"),C("onNextPage",function(){d(e);let t=a(2);return p(t.infinitePagination.onNextPage(t.searchFilter()))})("onLastPage",function(){d(e);let t=a(2);return p(t.infinitePagination.onLastPage(t.searchFilter()))})("onGetRowCount",function(){d(e);let t=a(2);return p(t.infinitePagination.getRowCount(t.searchFilter()))}),l()()()}if(o&2){let e,i,t,n=a(2);c(8),g("ngModel",n.toggleDifferentInventory()),c(7),g("ngxPermissionsOnly",V(16,A,n.rolePriceEdit)),c(4),g("matTooltip",((e=n.selectedChannel())==null||e.Name==null?null:e.Name.length)>=20?(e=n.selectedChannel())==null?null:e.Name:""),c(),g("src",(i=n.selectedChannel())==null?null:i.Img,y),c(2),w(" ",Q(23,11,(t=n.selectedChannel())==null?null:t.Name,20)," "),c(3),N(s),c(2),g("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",M(28,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function Je(o,s){if(o&1){let e=P();r(0,"mainpanel",1),C("textChange",function(t){d(e);let n=a();return p(n.updateFilter("text",t))})("onSubmit",function(){d(e);let t=a();return p(t.onSearch())}),r(1,"filters")(2,"div",2)(3,"div",3)(4,"h6"),m(5,"Channel"),l(),r(6,"app-channel-options-v2",4),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("ChannelID",t))}),l()(),r(7,"div",5)(8,"h6"),m(9,"Number Filter Comparator"),l(),r(10,"ng-select",6),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("NumberFilterComparator",t))}),l()(),r(11,"div",5)(12,"h6"),m(13,"Search Type"),l(),r(14,"radio-options",7),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("SearchType",t))}),l()(),r(15,"div",5)(16,"h6"),m(17,"Page Number"),l(),r(18,"input",8),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("PageNumber",t))}),l()(),r(19,"div",5)(20,"h6"),m(21,"Page Size"),l(),r(22,"input",9),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("RowCount",t))}),l()()()(),r(23,"actions"),h(24,Ee,6,1,"div",10),b(25,"async"),l(),r(26,"content"),h(27,je,29,18,"div",11),b(28,"async"),l()()}if(o&2){let e,i,t=s,n=a();g("headerTitle",n.pageTitle())("text",n.searchFilter().text)("searchBoxPlaceHolder",n.searchPlaceholder()),c(6),g("ngModel",n.searchFilter().ChannelID),c(4),g("items",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions)("clearable",!1)("ngModel",n.searchFilter().NumberFilterComparator),c(4),g("options",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions)("ngModel",n.searchFilter().SearchType),c(4),g("ngModel",n.searchFilter().PageNumber),c(4),g("ngModel",n.searchFilter().RowCount),c(2),u((e=M(25,13,n.data$))?24:-1,e),c(3),u((i=M(28,15,n.data$))?27:-1,i)}}var Et=(()=>{class o{constructor(){this.http=f(ne),this.toastr=f(te),this.dialog=f(me),this.productService=f(fe),this.biggerPictureService=f(xe),this.authService=f(re),this.mainPanelService=f(ge),this.decimalPipe=f(T),this.placeholderService=f(Pe),this.infinitePagination=f(L),this.updateResHandling=f(B),this.pageTitle=x("Price Single Channel Comparison"),this.toggleDifferentInventory=x(!1),this.loaderEndpoint=x("PriceLoader/Load"),this.dataEndpoint=x("Price/GetSingleChannelComparison"),this.rowCountApi=x("Inventory/GetInventoryByChannelRowCount"),this.searchFilter=x({}),this.hostName=x(""),this.rolePriceEdit=ae.PriceUpdate,this.channelOptions=x([]),this.selectedChannel=x(null),this.discontinuedVariantMsg=x("This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel."),this.searchPlaceholder=x("Search ...");let e=this.authService;this.hostName.set(this.authService.getDomain()),this.data$=this.infinitePagination.data$.pipe(K(1)),this.channelOptions.set(e.getChannels())}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint(),this.infinitePagination.fethRowCountEndpoint=this.rowCountApi(),this.loader$=this.http.post(`/API/${this.loaderEndpoint()}`).pipe(q(e=>{this.searchFilter.set(e.Filter),this.searchFilter.update(i=>(i.filterModel=I.ALL,i)),this.initSearchPlaceholder(),this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter().SearchType,this.searchFilter().NumberFilterComparator))}onToggleDifferentInventory(){this.toggleDifferentInventory()?this.searchFilter.update(e=>(e.filterModel=I.ALL,e)):this.searchFilter.update(e=>(e.filterModel=I.DIFFERENCE,e)),this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(i=>(i.selected=e.selected,i))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(_=>({ID:_.ID,ChannelID:_.Channel[0].ChannelID,Code:_.Code,Price:_.UnitPrice})),n={ListChannelID:[this.searchFilter().ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",n).subscribe(_=>{this.onSearch(),this.handlingUpdateStock(_.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let i=e.failure_list,t=e.success_list;this.updateResHandling.responseHandling(t,i,"Price");let n=(t||[]).map(_=>this.buildPlugoTruncationHtml(_?.Message)).filter(_=>!!_);n.length>0&&this.toastr.warning(n.join("<br>"),(i||[]).length===0?"Success with Warning":"Warning",{enableHtml:!0})}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let i={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",i).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel(),this.initSearchPlaceholder()}openTableDialog(e,i,t){let n=JSON.parse(JSON.stringify(e));this.dialog.open(ye,{data:{Name:i.Name,Variant:n,ChannelID:n?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:n?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(G(S=>ee.IsNotEmpty(S))).subscribe(S=>{this.updateItemAfterDialog(S,e)})}updateItemAfterDialog(e,i){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe({next:n=>{let _=this.productService.findChannelById(t.ID,this.channelOptions()),S=this.extractSuccessNote(n),z=this.buildPlugoTruncationHtml(S);if(z)this.toastr.warning(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${_.Name} \u2014 ${z}`,"Success with Warning",{enableHtml:!0});else{let Ie=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${_.Name} to ${Ie}`,"Success"),S&&S!=="Success"&&this.toastr.warning(S,"Warning")}this.infinitePagination.reloadPagination(this.searchFilter())},error:n=>{let _=n?.error?.Message||n?.error?.message||n?.error?.Response?.failure_list?.[0]?.Message||n?.message||"Failed to update price";this.toastr.error(_,"Error")}})}extractSuccessNote(e){return e?.Response?.success_list?.[0]?.Message??e?.response?.success_list?.[0]?.Message??e?.Response?.success_list?.[0]?.message??e?.success_list?.[0]?.Message}buildPlugoTruncationHtml(e){if(!e||e==="Success"||!e.includes("Plugo does not support decimal"))return null;let i=e.match(/Original price ([\d.,]+) was truncated to ([\d.,]+)/i);if(i){let t=this.decimalPipe.transform(parseFloat(i[1].replace(/,/g,"")))??i[1],n=this.decimalPipe.transform(parseFloat(i[2].replace(/,/g,"")))??i[2];return`${t} was rounded down to <b>${n}</b> \u2014 Plugo accepts whole numbers only.`}return e.replace(/^Success\s*-\s*Note:\s*/i,"")||e}initSelectedChannel(){this.selectedChannel.set(this.channelOptions().find(e=>e.ID==this.searchFilter().ChannelID))}onSelectAllSKU(e,i){i=i.map(t=>(t.Variants=t.Variants.map(n=>(n.selected=e,n)),t))}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}openExportDialog(){this.dialog.open(we,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountApi(),exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}updateFilter(e,i){this.searchFilter.update(t=>W(H({},t),{[e]:i}))}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=j({type:o,selectors:[["app-price-single-channel"]],features:[Z([L,Te,Y("https://resc.cloudinary.com/"),T,B])],decls:2,vars:3,consts:[["filterDialogWidth","625px",1,"single-price",3,"headerTitle","text","searchBoxPlaceHolder"],["filterDialogWidth","625px",1,"single-price",3,"textChange","onSubmit","headerTitle","text","searchBoxPlaceHolder"],[1,"dialog-filter","grid-filter"],[1,"filter-item","full"],[3,"ngModelChange","ngModel"],[1,"filter-item"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","clearable","ngModel"],[3,"ngModelChange","options","ngModel"],["type","number","placeholder","Page Number",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","placeholder","Page Size",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex"],[1,"container-fluid","mt-5"],[1,"btn","btn-success"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(i,t){if(i&1&&(h(0,Je,29,17,"mainpanel",0),b(1,"async")),i&2){let n;u((n=M(1,1,t.loader$))?0:-1,n)}},dependencies:[Ce,_e,ce,pe,le,se,de,Ve,oe,ie,Me,be,Se,ue,he,ve,Fe,X,T],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}.dialog-filter.grid-filter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;width:100%}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin-bottom:6px}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item.full[_ngcontent-%COMP%]{grid-column:1/-1}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] radio-options[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-width:0!important;width:100%!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]{height:40px;min-height:40px;border:1px solid #ccc;border-radius:4px;font-size:.875rem;padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%]:focus, .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:focus{border:1px solid #86b7fe;box-shadow:none;outline:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-select-container{height:40px!important;min-height:40px!important;align-items:center;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value-container{padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value, .dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-placeholder{font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-select{box-sizing:border-box;width:100%!important;height:40px!important;min-height:40px!important;--p-select-padding-y: 8px;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-select:not(.p-disabled):hover{border-color:#ccc}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-select-label{font-size:.875rem!important}"],changeDetection:0})}}return o})();export{Et as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{a as ue,b as fe}from"./chunk-L3MO3ZCZ.js";import{a as _e}from"./chunk-ZZ3M52QJ.js";import{a as x}from"./chunk-ISMIPSYN.js";import{c as Ce,d as V,e as T}from"./chunk-SA4KQTJY.js";import"./chunk-4O2VD4QF.js";import"./chunk-BYK4XSP4.js";import"./chunk-G346YBOK.js";import"./chunk-SJBVLNCR.js";import"./chunk-32F5EUMW.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{c as me}from"./chunk-NH7UFKXO.js";import{a as ge}from"./chunk-6YRYXHZS.js";import"./chunk-VYXSV6K4.js";import"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import"./chunk-62QUGB6I.js";import{a as he}from"./chunk-7X3KALOK.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-A4TBJ6UZ.js";import"./chunk-BGFEVOPZ.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{d as ce,e as pe}from"./chunk-474G6BPL.js";import{a as se,b as de}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import{c as le}from"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import{a as O,b as F}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as te}from"./chunk-ZSUWHVKX.js";import{f as w}from"./chunk-C5O6VJ2D.js";import"./chunk-TU34BDDQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as N}from"./chunk-63X2BBS4.js";import{b as Z,c as ee}from"./chunk-MDHMVGYC.js";import{c as v}from"./chunk-NNVT5X6O.js";import{c as ne,h as ie,m as oe,o as re,z as ae}from"./chunk-7HUEGPJN.js";import{b as X,e as Y}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{z as q}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as P,C as R,Da as B,Eb as H,Ic as C,S as L,Vc as j,Xb as b,Xc as K,Zb as y,ca as U,cc as g,dc as l,ec as d,ed as J,fc as z,fd as Q,gb as m,ha as c,jc as G,kc as $,mc as I,md as W,oa as p,pa as h,rc as u,tc as f,ua as k,yb as A}from"./chunk-5VYDZBNH.js";import{a as _,b as S}from"./chunk-QWWW7GFA.js";var E=(()=>{class a{constructor(){this.authService=c(w),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(e,o){let t=Object.assign([],this.channelOptions),i=[],r;return e.forEach(n=>{r=t.find(s=>s.ID==n?.parent?.id),r&&(r=S(_({},r),{Name:`${n?.parent?.label} - ${n?.label}`,LocationID:n?.id}),i.push(r))}),o.forEach(n=>{r=t.find(s=>s.ID==n.id),r&&i.push(r)}),i}generateFilterLocation(e,o){let t=[],i=[],r=[];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,s,D)=>D.indexOf(n)===s)):(t=[],i=[]),r=o.map(n=>n.id),r=r.concat(i).filter((n,s,D)=>D.indexOf(n)===s),{locationIds:t,channelIds:r}}static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275prov=U({token:a,factory:a.\u0275fac})}}return a})();var Pe=a=>[a];function ve(a,M){if(a&1){let e=I();l(0,"button",17),u("click",function(){p(e);let t=f(2),i=f();return h(i.onUpdateItems(t))}),z(1,"i",18),C(2," Update "),d()}}function Me(a,M){if(a&1&&(G(0),b(1,ve,3,0,"button",16),$()),a&2){let e=f(),o=f();m(),y(o.productService.hasSelectionVariant(e)?1:-1)}}function be(a,M){if(a&1&&(l(0,"actions")(1,"div",14),H(2,Me,2,1,"ng-container",15),d()()),a&2){let e=f();m(2),g("ngxPermissionsOnly",K(1,Pe,e.inventoryUpdateRole))}}function ye(a,M){if(a&1){let e=I();l(0,"app-table",19),u("onToggle",function(t){p(e);let i=f();return h(i.onShowDifferenceStock(t))})("onSubmit",function(t){p(e);let i=f();return h(i.updateStockByVariant(t))}),d()}if(a&2){let e=f();g("data",M)("channel",e.channels())("showProductToggle",!0)("hiddenIPOSInventory",e.hiddenIPOSInventory())}}var ct=(()=>{class a{constructor(){this.http=c(Y),this.toastr=c(X),this.dialog=c(le),this.productService=c(he),this.authService=c(w),this.mainPanelService=c(se),this.placeholderService=c(me),this.destroyRef=c(k),this.paginationService=c(V),this.multiChannelService=c(E),this.updateResHandling=c(T),this.hiddenIPOSInventory=W(()=>this.paginationService.hiddenPOSInventory()),this.channelOptions=this.authService.getChannels(),this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.searchFilter=P({PageNumber:1,RowCount:100}),this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(L(1)),this.loaderData=F(this.loader$,{initialValue:null}),this.data=F(this.paginationService.data$,{initialValue:[]}),this.selectedLocations=P([]),this.selectedChannels=P([]),this.channels=P([]),this.inventoryUpdateRole=te.InventoryUpdate,this.searchPlaceholder=P("Search ..."),this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,B(()=>{let e=this.loaderData();if(!e)return;let o={PageNumber:e.Filter.PageNumber,filterModel:x.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory,SearchType:e.Filter.SearchType,NumberFilterComparator:e.Filter.NumberFilterComparator};this.searchFilter.set(o),this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(o.SearchType,o.NumberFilterComparator)),this.mainPanelService.openModalFilter()})}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=>S(_({},i),{ListChannelID:t.channelIds,ListLocationID:t.locationIds,text:e})),this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter())}initSearchPlaceholder(){let e=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(e.SearchType,e.NumberFilterComparator))}updateStock(e,o){if(e.length>0){let t=[];e.forEach(n=>{n.Channel?.forEach(s=>{t.push({ChannelItemID:s?.ChannelItemID,ChannelVariationID:s?.ChannelVariationID,Inventory:n.Inventory,LocationID:s?.LocationID})})});let r={ListChannelID:o.filter(n=>n.selected).map(n=>n.ID),List:t};this.http.post(N.UpdateInventoryChannel,r).pipe(O(this.destroyRef)).subscribe(n=>{this.paginationService.reloadPagination(this.searchFilter());for(let s=0;s<n?.length;s++)this.handlingUpdateStock(n[s])})}}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(N.UpdateUpdateQuantityByItem,t).pipe(O(this.destroyRef)).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=>S(_({},o),{filterModel:e?x.DIFFERENCE:x.ALL})),this.paginationService.reloadPagination(this.searchFilter())}onUpdateItems(e){let o=this.productService.selectedVariantProduct(e),t=this.channelOptions.filter(i=>this.channels()?.find(r=>r.ID===i.ID));this.dialog.open(ue,{data:{selectedItems:o,channels:JSON.parse(JSON.stringify(t))},width:"400px"}).afterClosed().pipe(R(i=>v.IsNotEmpty(i)),O(this.destroyRef)).subscribe(i=>{this.updateStock(o,i)})}updateSearchFilter(e,o){this.searchFilter.update(t=>S(_({},t),{[e]:o}))}static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=A({type:a,selectors:[["app-multi-channel-comparison"]],features:[j([V,E,T])],decls:31,vars:20,consts:[["headerTitle","Inventory Comparison","textButton","Search","filterDialogWidth","625px",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"dialog-filter","grid-filter"],[1,"filter-item","full"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"filter-item"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","clearable","ngModel"],[3,"ngModelChange","options","ngModel"],["type","number","id","PageNumber","placeholder","Page Number","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","input-filter",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=I();l(0,"mainpanel",0),u("onSubmit",function(n){return p(i),h(t.onSearch(n))}),b(1,be,3,3,"actions"),l(2,"filters")(3,"div",1)(4,"div",2)(5,"h6"),C(6,"Channel"),d(),l(7,"multiwarehouse-tree-select",3),u("onChannelChange",function(n){return p(i),h(t.onChannelChange(n))}),d()(),l(8,"div",4)(9,"h6"),C(10,"Number Filter Comparator"),d(),l(11,"ng-select",5),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("NumberFilterComparator",n))}),d()(),l(12,"div",4)(13,"h6"),C(14,"Search Type"),d(),l(15,"radio-options",6),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("SearchType",n))}),d()(),l(16,"div",4)(17,"h6"),C(18,"Page Number"),d(),l(19,"input",7),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("PageNumber",+n))}),d()(),l(20,"div",4)(21,"h6"),C(22,"Page Size"),d(),l(23,"input",8),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("RowCount",+n))}),d()()()(),l(24,"content")(25,"div",9)(26,"div",10)(27,"div",11),b(28,ye,1,4,"app-table",12),l(29,"infinite-paginator",13),J(30,"async"),u("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,r;g("hideSearchBox",!1)("searchBoxPlaceHolder",t.searchPlaceholder()),m(),y((i=t.data())?1:-1,i);let n=t.loaderData();m(6),g("multiple",!0),m(4),g("items",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions)("clearable",!1)("ngModel",t.searchFilter().NumberFilterComparator),m(4),g("options",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions)("ngModel",t.searchFilter().SearchType),m(4),g("ngModel",t.searchFilter().PageNumber),m(4),g("ngModel",t.searchFilter().RowCount),m(5),y((r=t.data())?28:-1,r),m(),g("totalData",t.paginationService.totalData())("hideCount",t.paginationService.hideCount())("rowCount",Q(30,18,t.paginationService.totalRowCount$))("pageNumber",t.paginationService.pageNumber())("disableNextButton",t.paginationService.disableNextButton())("goToLastPage",t.paginationService.isLastPage())}},dependencies:[de,fe,ae,ne,re,ie,oe,Ce,_e,ee,Z,pe,ce,ge,q],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}.dialog-filter.grid-filter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;width:100%}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin-bottom:6px}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item.full[_ngcontent-%COMP%]{grid-column:1/-1}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] radio-options[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-width:0!important;width:100%!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]{height:40px;min-height:40px;border:1px solid #ccc;border-radius:4px;font-size:.875rem;padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%]:focus, .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:focus{border:1px solid #86b7fe;box-shadow:none;outline:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-select-container{height:40px!important;min-height:40px!important;align-items:center;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value-container{padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value, .dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-placeholder{font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select{display:block}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-float-label{padding:0;display:block}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect{display:flex;align-items:center;box-sizing:border-box;width:100%!important;height:40px!important;min-height:40px!important;padding:0 .75rem!important;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect:not(.p-disabled).p-focus{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect-label-container{display:flex;align-items:center;flex:1 1 auto;min-height:0;overflow:hidden;padding:0}"],changeDetection:0})}}return a})();export{ct as MultiChannelComparison};
1
+ import{a as ue,b as fe}from"./chunk-BESHMFY6.js";import{a as _e}from"./chunk-ZZ3M52QJ.js";import{a as x}from"./chunk-ISMIPSYN.js";import{c as Ce,d as V,e as T}from"./chunk-SA4KQTJY.js";import"./chunk-4O2VD4QF.js";import"./chunk-BYK4XSP4.js";import"./chunk-G346YBOK.js";import"./chunk-SJBVLNCR.js";import"./chunk-32F5EUMW.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{c as me}from"./chunk-NH7UFKXO.js";import{a as ge}from"./chunk-6YRYXHZS.js";import"./chunk-VYXSV6K4.js";import"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import"./chunk-62QUGB6I.js";import{a as he}from"./chunk-UAB7S7RK.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-ZOF6UEJP.js";import"./chunk-BGFEVOPZ.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{d as ce,e as pe}from"./chunk-474G6BPL.js";import{a as se,b as de}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import{c as le}from"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import{a as O,b as F}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as te}from"./chunk-ZSUWHVKX.js";import{f as w}from"./chunk-GUTJ3MLW.js";import"./chunk-6ENJB5FQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as N}from"./chunk-63X2BBS4.js";import{b as Z,c as ee}from"./chunk-MDHMVGYC.js";import{c as v}from"./chunk-NNVT5X6O.js";import{c as ne,h as ie,m as oe,o as re,z as ae}from"./chunk-7HUEGPJN.js";import{b as X,e as Y}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{z as q}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as P,C as R,Da as B,Eb as H,Ic as C,S as L,Vc as j,Xb as b,Xc as K,Zb as y,ca as U,cc as g,dc as l,ec as d,ed as J,fc as z,fd as Q,gb as m,ha as c,jc as G,kc as $,mc as I,md as W,oa as p,pa as h,rc as u,tc as f,ua as k,yb as A}from"./chunk-5VYDZBNH.js";import{a as _,b as S}from"./chunk-QWWW7GFA.js";var E=(()=>{class a{constructor(){this.authService=c(w),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(e,o){let t=Object.assign([],this.channelOptions),i=[],r;return e.forEach(n=>{r=t.find(s=>s.ID==n?.parent?.id),r&&(r=S(_({},r),{Name:`${n?.parent?.label} - ${n?.label}`,LocationID:n?.id}),i.push(r))}),o.forEach(n=>{r=t.find(s=>s.ID==n.id),r&&i.push(r)}),i}generateFilterLocation(e,o){let t=[],i=[],r=[];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,s,D)=>D.indexOf(n)===s)):(t=[],i=[]),r=o.map(n=>n.id),r=r.concat(i).filter((n,s,D)=>D.indexOf(n)===s),{locationIds:t,channelIds:r}}static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275prov=U({token:a,factory:a.\u0275fac})}}return a})();var Pe=a=>[a];function ve(a,M){if(a&1){let e=I();l(0,"button",17),u("click",function(){p(e);let t=f(2),i=f();return h(i.onUpdateItems(t))}),z(1,"i",18),C(2," Update "),d()}}function Me(a,M){if(a&1&&(G(0),b(1,ve,3,0,"button",16),$()),a&2){let e=f(),o=f();m(),y(o.productService.hasSelectionVariant(e)?1:-1)}}function be(a,M){if(a&1&&(l(0,"actions")(1,"div",14),H(2,Me,2,1,"ng-container",15),d()()),a&2){let e=f();m(2),g("ngxPermissionsOnly",K(1,Pe,e.inventoryUpdateRole))}}function ye(a,M){if(a&1){let e=I();l(0,"app-table",19),u("onToggle",function(t){p(e);let i=f();return h(i.onShowDifferenceStock(t))})("onSubmit",function(t){p(e);let i=f();return h(i.updateStockByVariant(t))}),d()}if(a&2){let e=f();g("data",M)("channel",e.channels())("showProductToggle",!0)("hiddenIPOSInventory",e.hiddenIPOSInventory())}}var ct=(()=>{class a{constructor(){this.http=c(Y),this.toastr=c(X),this.dialog=c(le),this.productService=c(he),this.authService=c(w),this.mainPanelService=c(se),this.placeholderService=c(me),this.destroyRef=c(k),this.paginationService=c(V),this.multiChannelService=c(E),this.updateResHandling=c(T),this.hiddenIPOSInventory=W(()=>this.paginationService.hiddenPOSInventory()),this.channelOptions=this.authService.getChannels(),this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.searchFilter=P({PageNumber:1,RowCount:100}),this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(L(1)),this.loaderData=F(this.loader$,{initialValue:null}),this.data=F(this.paginationService.data$,{initialValue:[]}),this.selectedLocations=P([]),this.selectedChannels=P([]),this.channels=P([]),this.inventoryUpdateRole=te.InventoryUpdate,this.searchPlaceholder=P("Search ..."),this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,B(()=>{let e=this.loaderData();if(!e)return;let o={PageNumber:e.Filter.PageNumber,filterModel:x.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory,SearchType:e.Filter.SearchType,NumberFilterComparator:e.Filter.NumberFilterComparator};this.searchFilter.set(o),this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(o.SearchType,o.NumberFilterComparator)),this.mainPanelService.openModalFilter()})}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=>S(_({},i),{ListChannelID:t.channelIds,ListLocationID:t.locationIds,text:e})),this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter())}initSearchPlaceholder(){let e=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(e.SearchType,e.NumberFilterComparator))}updateStock(e,o){if(e.length>0){let t=[];e.forEach(n=>{n.Channel?.forEach(s=>{t.push({ChannelItemID:s?.ChannelItemID,ChannelVariationID:s?.ChannelVariationID,Inventory:n.Inventory,LocationID:s?.LocationID})})});let r={ListChannelID:o.filter(n=>n.selected).map(n=>n.ID),List:t};this.http.post(N.UpdateInventoryChannel,r).pipe(O(this.destroyRef)).subscribe(n=>{this.paginationService.reloadPagination(this.searchFilter());for(let s=0;s<n?.length;s++)this.handlingUpdateStock(n[s])})}}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(N.UpdateUpdateQuantityByItem,t).pipe(O(this.destroyRef)).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=>S(_({},o),{filterModel:e?x.DIFFERENCE:x.ALL})),this.paginationService.reloadPagination(this.searchFilter())}onUpdateItems(e){let o=this.productService.selectedVariantProduct(e),t=this.channelOptions.filter(i=>this.channels()?.find(r=>r.ID===i.ID));this.dialog.open(ue,{data:{selectedItems:o,channels:JSON.parse(JSON.stringify(t))},width:"400px"}).afterClosed().pipe(R(i=>v.IsNotEmpty(i)),O(this.destroyRef)).subscribe(i=>{this.updateStock(o,i)})}updateSearchFilter(e,o){this.searchFilter.update(t=>S(_({},t),{[e]:o}))}static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=A({type:a,selectors:[["app-multi-channel-comparison"]],features:[j([V,E,T])],decls:31,vars:20,consts:[["headerTitle","Inventory Comparison","textButton","Search","filterDialogWidth","625px",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"dialog-filter","grid-filter"],[1,"filter-item","full"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"filter-item"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","clearable","ngModel"],[3,"ngModelChange","options","ngModel"],["type","number","id","PageNumber","placeholder","Page Number","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","input-filter",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=I();l(0,"mainpanel",0),u("onSubmit",function(n){return p(i),h(t.onSearch(n))}),b(1,be,3,3,"actions"),l(2,"filters")(3,"div",1)(4,"div",2)(5,"h6"),C(6,"Channel"),d(),l(7,"multiwarehouse-tree-select",3),u("onChannelChange",function(n){return p(i),h(t.onChannelChange(n))}),d()(),l(8,"div",4)(9,"h6"),C(10,"Number Filter Comparator"),d(),l(11,"ng-select",5),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("NumberFilterComparator",n))}),d()(),l(12,"div",4)(13,"h6"),C(14,"Search Type"),d(),l(15,"radio-options",6),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("SearchType",n))}),d()(),l(16,"div",4)(17,"h6"),C(18,"Page Number"),d(),l(19,"input",7),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("PageNumber",+n))}),d()(),l(20,"div",4)(21,"h6"),C(22,"Page Size"),d(),l(23,"input",8),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("RowCount",+n))}),d()()()(),l(24,"content")(25,"div",9)(26,"div",10)(27,"div",11),b(28,ye,1,4,"app-table",12),l(29,"infinite-paginator",13),J(30,"async"),u("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,r;g("hideSearchBox",!1)("searchBoxPlaceHolder",t.searchPlaceholder()),m(),y((i=t.data())?1:-1,i);let n=t.loaderData();m(6),g("multiple",!0),m(4),g("items",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions)("clearable",!1)("ngModel",t.searchFilter().NumberFilterComparator),m(4),g("options",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions)("ngModel",t.searchFilter().SearchType),m(4),g("ngModel",t.searchFilter().PageNumber),m(4),g("ngModel",t.searchFilter().RowCount),m(5),y((r=t.data())?28:-1,r),m(),g("totalData",t.paginationService.totalData())("hideCount",t.paginationService.hideCount())("rowCount",Q(30,18,t.paginationService.totalRowCount$))("pageNumber",t.paginationService.pageNumber())("disableNextButton",t.paginationService.disableNextButton())("goToLastPage",t.paginationService.isLastPage())}},dependencies:[de,fe,ae,ne,re,ie,oe,Ce,_e,ee,Z,pe,ce,ge,q],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}.dialog-filter.grid-filter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;width:100%}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin-bottom:6px}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item.full[_ngcontent-%COMP%]{grid-column:1/-1}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] radio-options[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-width:0!important;width:100%!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]{height:40px;min-height:40px;border:1px solid #ccc;border-radius:4px;font-size:.875rem;padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%]:focus, .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:focus{border:1px solid #86b7fe;box-shadow:none;outline:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-select-container{height:40px!important;min-height:40px!important;align-items:center;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value-container{padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value, .dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-placeholder{font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select{display:block}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-float-label{padding:0;display:block}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect{display:flex;align-items:center;box-sizing:border-box;width:100%!important;height:40px!important;min-height:40px!important;padding:0 .75rem!important;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect:not(.p-disabled).p-focus{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect-label-container{display:flex;align-items:center;flex:1 1 auto;min-height:0;overflow:hidden;padding:0}"],changeDetection:0})}}return a})();export{ct as MultiChannelComparison};