marketplacepos 5.43.12 → 5.43.13

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 (47) hide show
  1. package/Marketplace/{chunk-64X37DDM.js → chunk-2GSWEJRP.js} +1 -1
  2. package/Marketplace/{chunk-UJJ37NMF.js → chunk-2OVYEC6Q.js} +1 -1
  3. package/Marketplace/{chunk-W2XLHQKX.js → chunk-2TRFYYCP.js} +1 -1
  4. package/Marketplace/{chunk-5WIVVYBR.js → chunk-2YFZS6SG.js} +1 -1
  5. package/Marketplace/{chunk-CWFVKONJ.js → chunk-3TDK2RMH.js} +1 -1
  6. package/Marketplace/{chunk-U6YLKCIN.js → chunk-4B4NNOKK.js} +1 -1
  7. package/Marketplace/{chunk-MLO6RETZ.js → chunk-56IX4GTG.js} +1 -1
  8. package/Marketplace/{chunk-ZFUMZWQD.js → chunk-624I4PEE.js} +1 -1
  9. package/Marketplace/{chunk-T5TPUUPB.js → chunk-6BAZYVHI.js} +2 -2
  10. package/Marketplace/{chunk-RRNK7AYL.js → chunk-6G5WVJGA.js} +1 -1
  11. package/Marketplace/{chunk-OLIX5W4T.js → chunk-6NHTTVBK.js} +1 -1
  12. package/Marketplace/{chunk-CKY4W4YX.js → chunk-AG2REZBE.js} +1 -1
  13. package/Marketplace/{chunk-AJI575A3.js → chunk-AJJSLBE3.js} +2 -2
  14. package/Marketplace/{chunk-5GH7ALQK.js → chunk-ALSCWTAY.js} +1 -1
  15. package/Marketplace/{chunk-2CKKNRWY.js → chunk-C3HL4S2R.js} +1 -1
  16. package/Marketplace/{chunk-XRDYBOEK.js → chunk-CUEO37N7.js} +1 -1
  17. package/Marketplace/{chunk-LMGGSU22.js → chunk-E6U3KRK7.js} +1 -1
  18. package/Marketplace/{chunk-5MPVI3PN.js → chunk-G2CMMGM2.js} +1 -1
  19. package/Marketplace/{chunk-L4L5OQAC.js → chunk-GMVNN57A.js} +1 -1
  20. package/Marketplace/{chunk-YDEJA4O7.js → chunk-GVL2YXE5.js} +1 -1
  21. package/Marketplace/{chunk-F7RHAUNW.js → chunk-HLOBDI4F.js} +1 -1
  22. package/Marketplace/{chunk-EH2R354T.js → chunk-IRLIWSK5.js} +1 -1
  23. package/Marketplace/{chunk-CJWADFNA.js → chunk-J7AN3ZQL.js} +1 -1
  24. package/Marketplace/{chunk-ZIYN2SNO.js → chunk-LOBNKJGT.js} +1 -1
  25. package/Marketplace/{chunk-JAU5KJNP.js → chunk-LROLRGKE.js} +1 -1
  26. package/Marketplace/{chunk-3ZYAWDIE.js → chunk-MMVLDCF6.js} +1 -1
  27. package/Marketplace/{chunk-6ROQP3RC.js → chunk-MY5ZX6JG.js} +1 -1
  28. package/Marketplace/{chunk-PMNZKH6Y.js → chunk-N3P55TG2.js} +1 -1
  29. package/Marketplace/{chunk-F7GJCFHO.js → chunk-NEYMDA6P.js} +1 -1
  30. package/Marketplace/{chunk-YEPIRHVM.js → chunk-OLCFJJOD.js} +1 -1
  31. package/Marketplace/{chunk-4DKXEPDD.js → chunk-OOCYP2XG.js} +1 -1
  32. package/Marketplace/{chunk-Q4V5TFDG.js → chunk-POR3OF22.js} +1 -1
  33. package/Marketplace/{chunk-2KUNLKEI.js → chunk-PXYBLGMN.js} +1 -1
  34. package/Marketplace/{chunk-3YQVLE5W.js → chunk-Q3MVAL6O.js} +1 -1
  35. package/Marketplace/{chunk-MFJR5HMS.js → chunk-QQXVBN22.js} +1 -1
  36. package/Marketplace/{chunk-U6ARDOJI.js → chunk-SMUCMLEE.js} +1 -1
  37. package/Marketplace/{chunk-PJ5QMIC2.js → chunk-TCS2Y6CC.js} +1 -1
  38. package/Marketplace/{chunk-EH553VTO.js → chunk-U7TVLBC5.js} +1 -1
  39. package/Marketplace/{chunk-YGEKAO5R.js → chunk-UG7VRDLB.js} +1 -1
  40. package/Marketplace/{chunk-55RGFLHB.js → chunk-V2RVHNCX.js} +1 -1
  41. package/Marketplace/{chunk-A5VA3CHW.js → chunk-WHG5PPSE.js} +1 -1
  42. package/Marketplace/{chunk-TE2KRPDL.js → chunk-WS4A4RPE.js} +1 -1
  43. package/Marketplace/{chunk-5ZAFPJZ4.js → chunk-YD5TUVFF.js} +1 -1
  44. package/Marketplace/{chunk-RBLKTSAZ.js → chunk-ZWBTWIGY.js} +1 -1
  45. package/Marketplace/index.html +2 -2
  46. package/Marketplace/{main-FEG3OGSE.js → main-2SUNMEPM.js} +1 -1
  47. package/package.json +1 -1
@@ -1 +1 @@
1
- import{g as C}from"./chunk-YGEKAO5R.js";import{a as r}from"./chunk-5HO2IJ47.js";import{b as a,c as u}from"./chunk-PW42BQIY.js";import{b as l,e as S}from"./chunk-JXSBFTQM.js";import{aa as p,ea as h,ja as c,oa as o,v as s}from"./chunk-B7KTCPKC.js";var y=(()=>{class i{constructor(e,t,n){this.httpService=e,this.toastr=t,this.tokenService=n}saveChannel(e){return this.httpService.post("/api/Channel/SubmitChannel",e).pipe(p(t=>this.tokenService.refreshToken().pipe(s(n=>t))))}getLastSync(e){return this.httpService.get(`${r.ChannelGetLastSyncByID}/?ID=${e}`)}getChannel(e){return this.httpService.post(r.GetChannel,e)}getChannelLoader(){return this.httpService.get(r.GetChannelLoader)}testShopID(e){return this.httpService.post(r.TestShopID,e).pipe(h(t=>{this.showTostrSuccessTestShopID(t)}))}updateChannelIndex(e){return this.httpService.post(r.UpdateChannelIndex,e)}deleteChannel(e){return this.httpService.post(r.DeleteChannel,e)}mapChannelImage(e){return e.map(t=>(t.img=u.getChannelLogoByTypeId(t.TypeID),t))}showTostrSuccessTestShopID(e){let t="";for(var n in e)t+=n+" : "+e[n]+"<br/>";this.toastr.success(t,"Success",{enableHtml:!0,closeButton:!0,positionClass:"toast-bottom-right"})}getRegisterByOutletName(e){return this.httpService.post(r.GetRegisterByOutletName,{Outlet:e})}getChannelRowCount(e){return this.httpService.post(r.GetChannelRowCount,e).pipe(s(t=>t.Count))}getChannelWarehouse(e){return this.httpService.get(`${r.GetChannelWarehouse}/?ChannelID=${e}`)}unSynchronizedWarehouse(e){return this.httpService.delete(`${r.UnSynchronizedWarehouse}?ID=${e}`)}authorizedChannel(e){let t=this.getApiAuthorize(e);return this.httpService.post(`/api/${t}`,null).pipe(h(n=>{window.open(n.Url,"_blank")}))}getApiAuthorize(e){let t;switch(e){case a.Shopee:t="ChannelAuthorization/ShopeeV2_URL";break;case a.Tiktok:t="ChannelAuthorization/Tiktok_URL";break;case a.Lazada:t="ChannelAuthorization/Lazada_URL";break}return t}static{this.\u0275fac=function(t){return new(t||i)(o(S),o(l),o(C))}}static{this.\u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{y as a};
1
+ import{g as C}from"./chunk-UG7VRDLB.js";import{a as r}from"./chunk-5HO2IJ47.js";import{b as a,c as u}from"./chunk-PW42BQIY.js";import{b as l,e as S}from"./chunk-JXSBFTQM.js";import{aa as p,ea as h,ja as c,oa as o,v as s}from"./chunk-B7KTCPKC.js";var y=(()=>{class i{constructor(e,t,n){this.httpService=e,this.toastr=t,this.tokenService=n}saveChannel(e){return this.httpService.post("/api/Channel/SubmitChannel",e).pipe(p(t=>this.tokenService.refreshToken().pipe(s(n=>t))))}getLastSync(e){return this.httpService.get(`${r.ChannelGetLastSyncByID}/?ID=${e}`)}getChannel(e){return this.httpService.post(r.GetChannel,e)}getChannelLoader(){return this.httpService.get(r.GetChannelLoader)}testShopID(e){return this.httpService.post(r.TestShopID,e).pipe(h(t=>{this.showTostrSuccessTestShopID(t)}))}updateChannelIndex(e){return this.httpService.post(r.UpdateChannelIndex,e)}deleteChannel(e){return this.httpService.post(r.DeleteChannel,e)}mapChannelImage(e){return e.map(t=>(t.img=u.getChannelLogoByTypeId(t.TypeID),t))}showTostrSuccessTestShopID(e){let t="";for(var n in e)t+=n+" : "+e[n]+"<br/>";this.toastr.success(t,"Success",{enableHtml:!0,closeButton:!0,positionClass:"toast-bottom-right"})}getRegisterByOutletName(e){return this.httpService.post(r.GetRegisterByOutletName,{Outlet:e})}getChannelRowCount(e){return this.httpService.post(r.GetChannelRowCount,e).pipe(s(t=>t.Count))}getChannelWarehouse(e){return this.httpService.get(`${r.GetChannelWarehouse}/?ChannelID=${e}`)}unSynchronizedWarehouse(e){return this.httpService.delete(`${r.UnSynchronizedWarehouse}?ID=${e}`)}authorizedChannel(e){let t=this.getApiAuthorize(e);return this.httpService.post(`/api/${t}`,null).pipe(h(n=>{window.open(n.Url,"_blank")}))}getApiAuthorize(e){let t;switch(e){case a.Shopee:t="ChannelAuthorization/ShopeeV2_URL";break;case a.Tiktok:t="ChannelAuthorization/Tiktok_URL";break;case a.Lazada:t="ChannelAuthorization/Lazada_URL";break}return t}static{this.\u0275fac=function(t){return new(t||i)(o(S),o(l),o(C))}}static{this.\u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{y as a};
@@ -1 +1 @@
1
- import{a as Te,b as be}from"./chunk-5BSS4CVK.js";import{a as Ce,b as fe}from"./chunk-CIIO2CJ6.js";import{b as xe}from"./chunk-H3J5OAIG.js";import{a as he}from"./chunk-SYUFPF3D.js";import{a as ue}from"./chunk-J2KWRDVH.js";import{a as F}from"./chunk-UMP6ZMEJ.js";import{h as pe}from"./chunk-YGEKAO5R.js";import{c as ae}from"./chunk-PW42BQIY.js";import{a as le,b as ce,c as _e}from"./chunk-SWQXSJ7O.js";import{d as de,h as ge}from"./chunk-CLER2MX6.js";import{A as re,b as ne,h as ie,m as oe}from"./chunk-6QYD6NIJ.js";import{r as se,s as me}from"./chunk-YCH6HHU3.js";import{d as Y,f as G,g as J,i as Q,m as ee,n as te}from"./chunk-M2FCTYGU.js";import{$c as $,Fc as b,Gb as Z,Gc as m,Hc as O,Ic as y,Ka as R,Kc as k,Lc as D,Mb as s,Mc as N,Oa as j,Ra as B,Sc as T,Tc as K,Yb as p,ad as W,bd as X,ca as A,cd as w,dc as S,ec as E,f as z,gc as M,hc as V,ic as c,jc as _,kc as I,lc as x,mc as h,nc as L,oc as C,pa as H,pb as v,rb as a,tc as f,uc as o,xb as P,xc as q,ya as d,za as g}from"./chunk-B7KTCPKC.js";var U=t=>[t],ve=t=>({"text-decoration-line-through":t}),Se=t=>({"text-danger":t}),Ie=(t,l)=>({"bg-gradient-warning":t,"cell-hover pointer":l});function we(t,l){if(t&1){let e=C();c(0,"mat-slide-toggle",13),f("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),c(1,"small",14),m(2),_()()}if(t&2){let e=o();a(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Fe(t,l){if(t&1){let e=C();c(0,"th")(1,"input",16),N("ngModelChange",function(n){d(e);let r=o(2);return D(r.checkboxState,n)||(r.checkboxState=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);a(),k("ngModel",e.checkboxState)}}function Pe(t,l){if(t&1&&(s(0,Fe,2,1,"ng-template",15),c(1,"th",11),m(2,"POS"),_()),t&2){let e=o();p("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function Ee(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),m(6),$(7,"stringLimit"),_()()()(),h()),t&2){let e=l.$implicit;a(3),p("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),a(),p("src",e==null?null:e.Img,v),a(2),y(" ",X(7,3,e.Name,20)," ")}}function Me(t,l){t&1&&L(0)}function Ve(t,l){if(t&1&&s(0,Me,1,0,"ng-container",33),t&2){o(2);let e=b(7);p("ngTemplateOutlet",e)}}function Oe(t,l){if(t&1&&(x(0),s(1,Ve,1,1,"ng-template",15),h()),t&2){let e=o(4);a(),p("ngxPermissionsOnly",T(1,U,e.roleInventoryUpdate))}}function ke(t,l){t&1&&L(0)}function De(t,l){if(t&1&&s(0,ke,1,0,"ng-container",33),t&2){o(2);let e=b(7);p("ngTemplateOutlet",e)}}function Ne(t,l){if(t&1&&s(0,De,1,1,"ng-template",15),t&2){let e=o(4);p("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function $e(t,l){if(t&1){let e=C();x(0),c(1,"div")(2,"input",34),N("ngModelChange",function(n){d(e);let r=o(4).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(4).$implicit,r=o();return g(r.onCheckboxStateProduct(n.ID))}),_()(),h()}if(t&2){let e=o(4).$implicit;a(2),k("ngModel",e.selected),p("disabled",!(e!=null&&e.Category))}}function Ue(t,l){if(t&1&&s(0,$e,3,2,"ng-container",22),t&2){let e=o(3).$implicit;p("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function Re(t,l){if(t&1){let e=C();x(0),c(1,"img",35),f("click",function(n){d(e);let r=o(3).$implicit,u=o();return g(u.onZoomImage(n,r==null?null:r.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;a(),q("src",e==null?null:e.ThumbnailUrl,v)}}function je(t,l){t&1&&I(0,"img",36)}function Be(t,l){if(t&1&&(x(0),c(1,"td",28)(2,"div",29),s(3,Oe,2,3,"ng-container",30)(4,Ne,1,3,"ng-template",null,0,w)(6,Ue,1,1,"ng-template",null,1,w),c(8,"div"),s(9,Re,2,1,"ng-container",30)(10,je,1,0,"ng-template",null,2,w),_()()(),c(12,"td",31)(13,"div"),m(14),_(),c(15,"small",32),m(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,r=o();a(),p("rowSpan",n==null?null:n.Variants.length),a(2),p("ngIf",r.table=="inventory")("ngIfElse",e),a(6),p("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),a(3),p("rowSpan",n==null?null:n.Variants.length),a(2),O(n==null?null:n.Name),a(),p("ngClass",T(9,Se,!(n!=null&&n.Category))),a(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function Le(t,l){if(t&1&&(c(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);p("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),v)}}function We(t,l){if(t&1){let e=C();c(0,"input",40),N("ngModelChange",function(n){d(e);let r=o(3).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),p("disabled",!(i!=null&&i.Category))}}function ze(t,l){if(t&1&&(c(0,"td",38),s(1,We,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);a(),p("ngIf",i.printPOS(e)>=0||i.table=="price")}}function Ae(t,l){if(t&1&&(s(0,ze,2,1,"ng-template",15),c(1,"td",24),m(2),$(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);p("ngxPermissionsOnly",T(4,U,i.rolePriceEdit)),a(2),O(W(3,2,i.printPOS(e)))}}function He(t,l){if(t&1){let e=C();x(0),c(1,"td",41),f("click",function(){d(e);let n=o().$implicit,r=o().$implicit,u=o().$implicit,ye=o();return g(ye.onUpdateData(u.Name,r,n.ID,u.ChannelItemID))}),c(2,"div",42)(3,"div",43),m(4),$(5,"number"),_(),c(6,"a",44),f("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=l.$implicit,i=o(2).$implicit,n=o(2);a(),p("ngClass",K(5,Ie,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table=="price"||n.hasInventoryEdit()&&n.table=="inventory")),a(3),y(" ",W(5,3,n.printItem(e))," "),a(2),p("href",e.Url,v)}}function Ze(t,l){t&1&&(c(0,"td",45)(1,"div",42)(2,"span"),m(3,"X"),_()()())}function qe(t,l){if(t&1&&s(0,He,8,8,"ng-container",30)(1,Ze,4,0,"ng-template",null,3,w),t&2){let e=l.$implicit,i=b(2),n=o().$implicit,r=o(2);p("ngIf",r.getItemFromChannel(n,e))("ngIfElse",i)}}function Ke(t,l){if(t&1&&(c(0,"tr"),s(1,Be,17,11,"ng-container",22),c(2,"td",23),m(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),m(7),_(),c(8,"div",21),s(9,Le,2,1,"a",27),_()()(),s(10,Ae,4,6),M(11,qe,3,2,null,null,E),_()),t&2){let e=l.$implicit,i=l.$index,n=o().$implicit,r=o();a(),p("ngIf",i==0),a(2),O(e==null?null:e.Model),a(2),p("matTooltip",e.Discontinued?r.discontinuedVariantMsg:""),a(),p("ngClass",T(7,ve,e.Discontinued)),a(),y(" ",e.Code," "),a(2),S(n.Category?9:-1),a(),S(r.hiddenIPOSInventory()==!1?10:-1),a(),V(r.channel)}}function Xe(t,l){if(t&1&&(c(0,"tbody"),M(1,Ke,13,9,"tr",null,E),_()),t&2){let e=l.$implicit;a(),V(e.Variants)}}var yt=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.permissionsService=H(le),this.showProductToggle=!1,this.multiwarehouse=j(!1),this.hiddenIPOSInventory=j(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=F.PriceUpdate,this.roleInventoryUpdate=F.InventoryUpdate,this.hasPriceEdit=B(!1),this.hasInventoryEdit=B(!1),this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new R,this.destroy$=new z,this.toggle=new R,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles(),this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}initRoles(){this.permissionsService.hasPermission(F.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e)),this.permissionsService.hasPermission(F.PriceUpdate).then(e=>this.hasPriceEdit.set(e))}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(r=>(r.selected=n.selected,r)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(r=>ae.IsNotEmpty(i.LocationID)?r.LocationID==i.LocationID:r.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}onUpdateData(e,i,n,r){this.hasPriceEdit()&&this.table=="price"&&this.onOpenDialogUpdate(e,i,n,r),this.hasInventoryEdit()&&this.table=="inventory"&&this.onOpenDialogUpdate(e,i,n,r)}onOpenDialogUpdate(e,i,n,r){this.dialog.open(Te,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:r}}).afterClosed().pipe(A(this.destroy$)).subscribe(u=>{u!=null&&this.onSubmit.emit(u)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(P(de),P(he),P(pe))}}static{this.\u0275cmp=Z({type:t,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(i,n){i&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),m(7,"Product"),_(),s(8,we,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),m(10,"Variant"),_(),c(11,"th",11),m(12,"SKU"),_(),s(13,Pe,3,3)(14,Ee,8,6,"ng-container",12),_()(),M(15,Xe,3,0,"tbody",null,E),_()()),i&2&&(a(8),S(n.showProductToggle?8:-1),a(5),S(n.hiddenIPOSInventory()==!1?13:-1),a(),p("ngForOf",n.channel),a(),V(n.data))},dependencies:[te,Y,G,J,Q,ee,re,ne,ie,oe,fe,Ce,ge,ue,xe,_e,ce,me,se,be],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]})}}return t})();export{yt as a};
1
+ import{a as Te,b as be}from"./chunk-5BSS4CVK.js";import{a as Ce,b as fe}from"./chunk-CIIO2CJ6.js";import{b as xe}from"./chunk-H3J5OAIG.js";import{a as he}from"./chunk-SYUFPF3D.js";import{a as ue}from"./chunk-J2KWRDVH.js";import{a as F}from"./chunk-UMP6ZMEJ.js";import{h as pe}from"./chunk-UG7VRDLB.js";import{c as ae}from"./chunk-PW42BQIY.js";import{a as le,b as ce,c as _e}from"./chunk-SWQXSJ7O.js";import{d as de,h as ge}from"./chunk-CLER2MX6.js";import{A as re,b as ne,h as ie,m as oe}from"./chunk-6QYD6NIJ.js";import{r as se,s as me}from"./chunk-YCH6HHU3.js";import{d as Y,f as G,g as J,i as Q,m as ee,n as te}from"./chunk-M2FCTYGU.js";import{$c as $,Fc as b,Gb as Z,Gc as m,Hc as O,Ic as y,Ka as R,Kc as k,Lc as D,Mb as s,Mc as N,Oa as j,Ra as B,Sc as T,Tc as K,Yb as p,ad as W,bd as X,ca as A,cd as w,dc as S,ec as E,f as z,gc as M,hc as V,ic as c,jc as _,kc as I,lc as x,mc as h,nc as L,oc as C,pa as H,pb as v,rb as a,tc as f,uc as o,xb as P,xc as q,ya as d,za as g}from"./chunk-B7KTCPKC.js";var U=t=>[t],ve=t=>({"text-decoration-line-through":t}),Se=t=>({"text-danger":t}),Ie=(t,l)=>({"bg-gradient-warning":t,"cell-hover pointer":l});function we(t,l){if(t&1){let e=C();c(0,"mat-slide-toggle",13),f("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),c(1,"small",14),m(2),_()()}if(t&2){let e=o();a(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Fe(t,l){if(t&1){let e=C();c(0,"th")(1,"input",16),N("ngModelChange",function(n){d(e);let r=o(2);return D(r.checkboxState,n)||(r.checkboxState=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);a(),k("ngModel",e.checkboxState)}}function Pe(t,l){if(t&1&&(s(0,Fe,2,1,"ng-template",15),c(1,"th",11),m(2,"POS"),_()),t&2){let e=o();p("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function Ee(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),m(6),$(7,"stringLimit"),_()()()(),h()),t&2){let e=l.$implicit;a(3),p("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),a(),p("src",e==null?null:e.Img,v),a(2),y(" ",X(7,3,e.Name,20)," ")}}function Me(t,l){t&1&&L(0)}function Ve(t,l){if(t&1&&s(0,Me,1,0,"ng-container",33),t&2){o(2);let e=b(7);p("ngTemplateOutlet",e)}}function Oe(t,l){if(t&1&&(x(0),s(1,Ve,1,1,"ng-template",15),h()),t&2){let e=o(4);a(),p("ngxPermissionsOnly",T(1,U,e.roleInventoryUpdate))}}function ke(t,l){t&1&&L(0)}function De(t,l){if(t&1&&s(0,ke,1,0,"ng-container",33),t&2){o(2);let e=b(7);p("ngTemplateOutlet",e)}}function Ne(t,l){if(t&1&&s(0,De,1,1,"ng-template",15),t&2){let e=o(4);p("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function $e(t,l){if(t&1){let e=C();x(0),c(1,"div")(2,"input",34),N("ngModelChange",function(n){d(e);let r=o(4).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(4).$implicit,r=o();return g(r.onCheckboxStateProduct(n.ID))}),_()(),h()}if(t&2){let e=o(4).$implicit;a(2),k("ngModel",e.selected),p("disabled",!(e!=null&&e.Category))}}function Ue(t,l){if(t&1&&s(0,$e,3,2,"ng-container",22),t&2){let e=o(3).$implicit;p("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function Re(t,l){if(t&1){let e=C();x(0),c(1,"img",35),f("click",function(n){d(e);let r=o(3).$implicit,u=o();return g(u.onZoomImage(n,r==null?null:r.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;a(),q("src",e==null?null:e.ThumbnailUrl,v)}}function je(t,l){t&1&&I(0,"img",36)}function Be(t,l){if(t&1&&(x(0),c(1,"td",28)(2,"div",29),s(3,Oe,2,3,"ng-container",30)(4,Ne,1,3,"ng-template",null,0,w)(6,Ue,1,1,"ng-template",null,1,w),c(8,"div"),s(9,Re,2,1,"ng-container",30)(10,je,1,0,"ng-template",null,2,w),_()()(),c(12,"td",31)(13,"div"),m(14),_(),c(15,"small",32),m(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,r=o();a(),p("rowSpan",n==null?null:n.Variants.length),a(2),p("ngIf",r.table=="inventory")("ngIfElse",e),a(6),p("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),a(3),p("rowSpan",n==null?null:n.Variants.length),a(2),O(n==null?null:n.Name),a(),p("ngClass",T(9,Se,!(n!=null&&n.Category))),a(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function Le(t,l){if(t&1&&(c(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);p("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),v)}}function We(t,l){if(t&1){let e=C();c(0,"input",40),N("ngModelChange",function(n){d(e);let r=o(3).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),p("disabled",!(i!=null&&i.Category))}}function ze(t,l){if(t&1&&(c(0,"td",38),s(1,We,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);a(),p("ngIf",i.printPOS(e)>=0||i.table=="price")}}function Ae(t,l){if(t&1&&(s(0,ze,2,1,"ng-template",15),c(1,"td",24),m(2),$(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);p("ngxPermissionsOnly",T(4,U,i.rolePriceEdit)),a(2),O(W(3,2,i.printPOS(e)))}}function He(t,l){if(t&1){let e=C();x(0),c(1,"td",41),f("click",function(){d(e);let n=o().$implicit,r=o().$implicit,u=o().$implicit,ye=o();return g(ye.onUpdateData(u.Name,r,n.ID,u.ChannelItemID))}),c(2,"div",42)(3,"div",43),m(4),$(5,"number"),_(),c(6,"a",44),f("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=l.$implicit,i=o(2).$implicit,n=o(2);a(),p("ngClass",K(5,Ie,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table=="price"||n.hasInventoryEdit()&&n.table=="inventory")),a(3),y(" ",W(5,3,n.printItem(e))," "),a(2),p("href",e.Url,v)}}function Ze(t,l){t&1&&(c(0,"td",45)(1,"div",42)(2,"span"),m(3,"X"),_()()())}function qe(t,l){if(t&1&&s(0,He,8,8,"ng-container",30)(1,Ze,4,0,"ng-template",null,3,w),t&2){let e=l.$implicit,i=b(2),n=o().$implicit,r=o(2);p("ngIf",r.getItemFromChannel(n,e))("ngIfElse",i)}}function Ke(t,l){if(t&1&&(c(0,"tr"),s(1,Be,17,11,"ng-container",22),c(2,"td",23),m(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),m(7),_(),c(8,"div",21),s(9,Le,2,1,"a",27),_()()(),s(10,Ae,4,6),M(11,qe,3,2,null,null,E),_()),t&2){let e=l.$implicit,i=l.$index,n=o().$implicit,r=o();a(),p("ngIf",i==0),a(2),O(e==null?null:e.Model),a(2),p("matTooltip",e.Discontinued?r.discontinuedVariantMsg:""),a(),p("ngClass",T(7,ve,e.Discontinued)),a(),y(" ",e.Code," "),a(2),S(n.Category?9:-1),a(),S(r.hiddenIPOSInventory()==!1?10:-1),a(),V(r.channel)}}function Xe(t,l){if(t&1&&(c(0,"tbody"),M(1,Ke,13,9,"tr",null,E),_()),t&2){let e=l.$implicit;a(),V(e.Variants)}}var yt=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.permissionsService=H(le),this.showProductToggle=!1,this.multiwarehouse=j(!1),this.hiddenIPOSInventory=j(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=F.PriceUpdate,this.roleInventoryUpdate=F.InventoryUpdate,this.hasPriceEdit=B(!1),this.hasInventoryEdit=B(!1),this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new R,this.destroy$=new z,this.toggle=new R,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles(),this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}initRoles(){this.permissionsService.hasPermission(F.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e)),this.permissionsService.hasPermission(F.PriceUpdate).then(e=>this.hasPriceEdit.set(e))}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(r=>(r.selected=n.selected,r)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(r=>ae.IsNotEmpty(i.LocationID)?r.LocationID==i.LocationID:r.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}onUpdateData(e,i,n,r){this.hasPriceEdit()&&this.table=="price"&&this.onOpenDialogUpdate(e,i,n,r),this.hasInventoryEdit()&&this.table=="inventory"&&this.onOpenDialogUpdate(e,i,n,r)}onOpenDialogUpdate(e,i,n,r){this.dialog.open(Te,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:r}}).afterClosed().pipe(A(this.destroy$)).subscribe(u=>{u!=null&&this.onSubmit.emit(u)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(P(de),P(he),P(pe))}}static{this.\u0275cmp=Z({type:t,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(i,n){i&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),m(7,"Product"),_(),s(8,we,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),m(10,"Variant"),_(),c(11,"th",11),m(12,"SKU"),_(),s(13,Pe,3,3)(14,Ee,8,6,"ng-container",12),_()(),M(15,Xe,3,0,"tbody",null,E),_()()),i&2&&(a(8),S(n.showProductToggle?8:-1),a(5),S(n.hiddenIPOSInventory()==!1?13:-1),a(),p("ngForOf",n.channel),a(),V(n.data))},dependencies:[te,Y,G,J,Q,ee,re,ne,ie,oe,fe,Ce,ge,ue,xe,_e,ce,me,se,be],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]})}}return t})();export{yt as a};
@@ -1 +1 @@
1
- import{a as T}from"./chunk-ZIYN2SNO.js";import{a as E}from"./chunk-DRHWRRQV.js";import{h as w}from"./chunk-YGEKAO5R.js";import{a as D}from"./chunk-5HO2IJ47.js";import{b as i,c as m}from"./chunk-PW42BQIY.js";import{b as j,e as s}from"./chunk-JXSBFTQM.js";import{G as C}from"./chunk-M2FCTYGU.js";import{B as A,G as U,J as u,Ra as I,g as k,ja as p,pa as a,q as d,v as b}from"./chunk-B7KTCPKC.js";var F=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var x=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var v=class{};var R=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var O=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(D.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Vt=(()=>{class r{constructor(){this.authService=a(w),this.productService=a(T),this.shoppeUploadService=a(F),this.tiktokUploadService=a(x),this.lazadaUploadService=a(H),this.tokopediaUploadService=a(R),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(O),this.toastrHandlingService=a(E),this.toastr=a(j),this.router=a(C),this.httpService=a(s),this._selectedProduct=new k(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(U(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return I(t.map(o=>{let c=new g;return c.id=o.ID,c.name=o.Name,c.type=o.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);A(e).pipe(b(o=>{let c=[];return o.forEach(f=>{c=[...c,...f]}),c})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],c=[],f=[],S=[],y=[],P=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:c.push(l);break;case i.Tokopedia:f.push(l);break;case i.WooCommerce:S.push(l);break;case i.Shopify:y.push(l);break;case i.Plugo:P.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:c},{type:i.Tokopedia,data:f},{type:i.WooCommerce,data:S},{type:i.Shopify,data:y},{type:i.Plugo,data:P}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(c));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(f));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(S));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(P));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let c=new v;c.ChannelID=o.id,c.ChannelType=o.type,c.Products=this._selectedProduct.getValue(),o.type==i.Shopify?delete c.CategoryID:c.CategoryID=o.categoryId,o.type==i.WooCommerce||o.type==i.Shopify?c.Attribute=o.attributes[0]:c.Attributes=this.formatAttributes(o.type,o.attributes),e.push(c)}),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{F as a,x as b,H as c,z as d,Vt as e};
1
+ import{a as T}from"./chunk-LOBNKJGT.js";import{a as E}from"./chunk-DRHWRRQV.js";import{h as w}from"./chunk-UG7VRDLB.js";import{a as D}from"./chunk-5HO2IJ47.js";import{b as i,c as m}from"./chunk-PW42BQIY.js";import{b as j,e as s}from"./chunk-JXSBFTQM.js";import{G as C}from"./chunk-M2FCTYGU.js";import{B as A,G as U,J as u,Ra as I,g as k,ja as p,pa as a,q as d,v as b}from"./chunk-B7KTCPKC.js";var F=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var x=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var v=class{};var R=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var O=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(D.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Vt=(()=>{class r{constructor(){this.authService=a(w),this.productService=a(T),this.shoppeUploadService=a(F),this.tiktokUploadService=a(x),this.lazadaUploadService=a(H),this.tokopediaUploadService=a(R),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(O),this.toastrHandlingService=a(E),this.toastr=a(j),this.router=a(C),this.httpService=a(s),this._selectedProduct=new k(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(U(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return I(t.map(o=>{let c=new g;return c.id=o.ID,c.name=o.Name,c.type=o.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);A(e).pipe(b(o=>{let c=[];return o.forEach(f=>{c=[...c,...f]}),c})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],c=[],f=[],S=[],y=[],P=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:c.push(l);break;case i.Tokopedia:f.push(l);break;case i.WooCommerce:S.push(l);break;case i.Shopify:y.push(l);break;case i.Plugo:P.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:c},{type:i.Tokopedia,data:f},{type:i.WooCommerce,data:S},{type:i.Shopify,data:y},{type:i.Plugo,data:P}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(c));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(f));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(S));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(P));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let c=new v;c.ChannelID=o.id,c.ChannelType=o.type,c.Products=this._selectedProduct.getValue(),o.type==i.Shopify?delete c.CategoryID:c.CategoryID=o.categoryId,o.type==i.WooCommerce||o.type==i.Shopify?c.Attribute=o.attributes[0]:c.Attributes=this.formatAttributes(o.type,o.attributes),e.push(c)}),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{F as a,x as b,H as c,z as d,Vt as e};
@@ -1 +1 @@
1
- import{a as x}from"./chunk-PE5AFID4.js";import{g as u}from"./chunk-YGEKAO5R.js";import{b as h,d as C,i as M,j as v,k as S}from"./chunk-CLER2MX6.js";import{G as g,n as p}from"./chunk-M2FCTYGU.js";import{Gb as m,Gc as t,Yb as f,ic as i,ja as s,jc as n,kc as d,pa as o,tc as c}from"./chunk-B7KTCPKC.js";var y=(()=>{class e{constructor(){this.dialogRef=o(h),this.route=o(g),this.modalConfig=new v,this.modalConfig.title="Switch to modern authorization",this.modalConfig.customWidth="450px",this.modalConfig.hideCancel=!0,this.modalConfig.headerType=M.Warning,this.modalConfig.okText="Setup"}onClose(){this.dialogRef.close()}onOk(){this.dialogRef.close(),this.route.navigate(["/menu/users"])}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=m({type:e,selectors:[["app-modal-user-migration-confirmation"]],decls:19,vars:1,consts:[[3,"onOk","onCancel","config"],["content",""],[1,"d-flex","align-items-center","justify-content-between","gap-6"],[1,"text-center",2,"width","300px"],[1,"fa-solid","fa-users-gear","fa-6x"],[1,"lh-base"],["href","https://support.dealpos.com/en/collections/16213478-user-group","target","_blank"]],template:function(r,l){r&1&&(i(0,"modal-material",0),c("onOk",function(){return l.onOk()})("onCancel",function(){return l.onClose()}),i(1,"div",1)(2,"div",2)(3,"div",3),d(4,"i",4),n(),i(5,"div",5)(6,"p"),t(7," We have introduced a new Modern Authorization, Please switch from "),i(8,"b"),t(9,"legacy"),n(),t(10," to "),i(11,"b"),t(12,"modern"),n(),t(13," authorization by inviting your users. "),n(),i(14,"div"),t(15," Please refer to this "),i(16,"a",6),t(17,"article"),n(),t(18," for more information "),n()()()()()),r&2&&f("config",l.modalConfig)},dependencies:[p,S],encapsulation:2})}}return e})();var R=(()=>{class e{constructor(){this.dialog=o(C),this.tokenService=o(u),this.dialogRef=null}openDialogMigrationConfirmation(){this.tokenService.getUser()?.AuthorizationMode===x.Legacy&&!this.dialogRef&&(this.dialogRef=this.dialog.open(y),this.dialogRef.afterClosed().subscribe(()=>{this.dialogRef=null}))}resetDialogState(){this.dialogRef&&(this.dialogRef.close(),this.dialogRef=null)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var B=(e,b)=>(o(R).openDialogMigrationConfirmation(),!0);export{B as a};
1
+ import{a as x}from"./chunk-PE5AFID4.js";import{g as u}from"./chunk-UG7VRDLB.js";import{b as h,d as C,i as M,j as v,k as S}from"./chunk-CLER2MX6.js";import{G as g,n as p}from"./chunk-M2FCTYGU.js";import{Gb as m,Gc as t,Yb as f,ic as i,ja as s,jc as n,kc as d,pa as o,tc as c}from"./chunk-B7KTCPKC.js";var y=(()=>{class e{constructor(){this.dialogRef=o(h),this.route=o(g),this.modalConfig=new v,this.modalConfig.title="Switch to modern authorization",this.modalConfig.customWidth="450px",this.modalConfig.hideCancel=!0,this.modalConfig.headerType=M.Warning,this.modalConfig.okText="Setup"}onClose(){this.dialogRef.close()}onOk(){this.dialogRef.close(),this.route.navigate(["/menu/users"])}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=m({type:e,selectors:[["app-modal-user-migration-confirmation"]],decls:19,vars:1,consts:[[3,"onOk","onCancel","config"],["content",""],[1,"d-flex","align-items-center","justify-content-between","gap-6"],[1,"text-center",2,"width","300px"],[1,"fa-solid","fa-users-gear","fa-6x"],[1,"lh-base"],["href","https://support.dealpos.com/en/collections/16213478-user-group","target","_blank"]],template:function(r,l){r&1&&(i(0,"modal-material",0),c("onOk",function(){return l.onOk()})("onCancel",function(){return l.onClose()}),i(1,"div",1)(2,"div",2)(3,"div",3),d(4,"i",4),n(),i(5,"div",5)(6,"p"),t(7," We have introduced a new Modern Authorization, Please switch from "),i(8,"b"),t(9,"legacy"),n(),t(10," to "),i(11,"b"),t(12,"modern"),n(),t(13," authorization by inviting your users. "),n(),i(14,"div"),t(15," Please refer to this "),i(16,"a",6),t(17,"article"),n(),t(18," for more information "),n()()()()()),r&2&&f("config",l.modalConfig)},dependencies:[p,S],encapsulation:2})}}return e})();var R=(()=>{class e{constructor(){this.dialog=o(C),this.tokenService=o(u),this.dialogRef=null}openDialogMigrationConfirmation(){this.tokenService.getUser()?.AuthorizationMode===x.Legacy&&!this.dialogRef&&(this.dialogRef=this.dialog.open(y),this.dialogRef.afterClosed().subscribe(()=>{this.dialogRef=null}))}resetDialogState(){this.dialogRef&&(this.dialogRef.close(),this.dialogRef=null)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var B=(e,b)=>(o(R).openDialogMigrationConfirmation(),!0);export{B as a};
@@ -1 +1 @@
1
- import{a as i}from"./chunk-5MPVI3PN.js";import{a as h,b as f}from"./chunk-7PN4XLNE.js";import"./chunk-YGEKAO5R.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as C,J as n,n as o}from"./chunk-M2FCTYGU.js";import{Gb as l,Hb as c,Yb as s,ic as u,jc as d,ka as p,kc as r,rb as m}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var v=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,P){t&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),d()()(),r(4,"router-outlet")),t&2&&(m(3),s("Tabs",P.priceTabs))},dependencies:[o,f,h,n,C],encapsulation:2})}}return e})();var M=[{path:"",component:v,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-ZFUMZWQD.js").then(e=>e.PricePosChannelComponent)},canActivate:[i],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-5ZAFPJZ4.js").then(e=>e.CustomChannelPriceComponent)},canActivate:[i],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-XRDYBOEK.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[i],data:{title:"Price Single Channel Comparison"}}]}],j=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=c({type:e})}static{this.\u0275inj=p({imports:[o,n.forChild(M)]})}}return e})();export{j as PriceRoutingModule};
1
+ import{a as i}from"./chunk-G2CMMGM2.js";import{a as h,b as f}from"./chunk-7PN4XLNE.js";import"./chunk-UG7VRDLB.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as C,J as n,n as o}from"./chunk-M2FCTYGU.js";import{Gb as l,Hb as c,Yb as s,ic as u,jc as d,ka as p,kc as r,rb as m}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var v=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,P){t&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),d()()(),r(4,"router-outlet")),t&2&&(m(3),s("Tabs",P.priceTabs))},dependencies:[o,f,h,n,C],encapsulation:2})}}return e})();var M=[{path:"",component:v,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-624I4PEE.js").then(e=>e.PricePosChannelComponent)},canActivate:[i],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-YD5TUVFF.js").then(e=>e.CustomChannelPriceComponent)},canActivate:[i],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-CUEO37N7.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[i],data:{title:"Price Single Channel Comparison"}}]}],j=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=c({type:e})}static{this.\u0275inj=p({imports:[o,n.forChild(M)]})}}return e})();export{j as PriceRoutingModule};
@@ -1 +1 @@
1
- import{a as _e,b as he,c as Se}from"./chunk-V5BKQSAT.js";import{a as we}from"./chunk-55RGFLHB.js";import{a as ge}from"./chunk-EH553VTO.js";import{a as Ce}from"./chunk-722SRHLY.js";import{a as fe}from"./chunk-YSJSAVBS.js";import{a as ue}from"./chunk-EPVCMYCI.js";import"./chunk-O5LFGGB2.js";import"./chunk-M5JQ7BGW.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-BFU7VKO3.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-CMTBBXR5.js";import{a as de}from"./chunk-WPW3D4MQ.js";import{g as le}from"./chunk-YGEKAO5R.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as ae}from"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import{b as v}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{b as oe,e as re}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as ce,n as se}from"./chunk-CLER2MX6.js";import{A as ne,c as $,h as ee,m as te,o as ie}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as me,s as pe}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as Q,k as X,m as Y,n as Z}from"./chunk-M2FCTYGU.js";import{$c as y,Gb as O,Gc as l,Hc as b,Ic as E,Kc as _,Lc as h,Mb as x,Mc as S,Nc as H,Oc as U,Pc as G,Qc as q,Ra as F,Sc as J,Yb as C,Z as D,ac as B,ad as k,bd as K,dc as T,ec as z,gc as R,hc as j,ic as t,ja as I,jc as i,kc as d,oc as V,pa as f,pb as W,rb as a,tc as L,uc as g,v as N,ya as c,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as M,b as P}from"./chunk-66YHNWRR.js";var A=(()=>{class n{constructor(){this.httpService=f(re),this.shippingLabelService=f(Ce),this.toastrService=f(oe)}getAwaitingCollectionOrders(e){return this.httpService.post(ae.GetAwaitingCollection,e).pipe(N(m=>m?.Data))}printShippingLabel(e){switch(e?.MarketType){case v.Shopee:this.shippingLabelService.printShippingLabelShopee(e.Number,e.ShopID);break;case v.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e.Number,e.ShopID);break;case v.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e.Number);break;case v.Lazada:this.shippingLabelService.printShippingLabelLazada(e.Number,e.ShopID);break;case v.Shopify:this.toastrService.error("Shopify not supported","Error Not supported");break}}static{this.\u0275fac=function(m){return new(m||n)}}static{this.\u0275prov=I({token:n,factory:n.\u0275fac})}}return n})();var be=n=>({"td-cell-hover":n});function ye(n,w){if(n&1&&d(0,"variants-dropdown",30),n&2){let e=g().$implicit;C("variants",e==null?null:e.Variants)}}function xe(n,w){if(n&1&&d(0,"variant-with-image",31),n&2){let e=g().$implicit;C("variant",e==null?null:e.Variants[0])}}function Te(n,w){if(n&1&&(t(0,"span"),l(1),i()),n&2){let e=g().$implicit;a(),E("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Ve(n,w){if(n&1){let e=V();t(0,"tr")(1,"td"),l(2),i(),t(3,"td")(4,"div",26)(5,"div",27)(6,"div"),d(7,"img",28),y(8,"channelImage"),i(),t(9,"div"),d(10,"order-link",29),i()(),t(11,"small"),l(12),y(13,"date"),i()()(),t(14,"td"),l(15),i(),t(16,"td"),x(17,ye,1,1,"variants-dropdown",30)(18,xe,1,1,"variant-with-image",31),i(),t(19,"td",32),l(20),y(21,"number"),i(),t(22,"td")(23,"div",26)(24,"div",27)(25,"span"),l(26),i(),x(27,Te,2,1,"span"),i(),t(28,"small"),l(29),i()()(),t(30,"td",33)(31,"button",34),L("click",function(){let o=c(e).$implicit,p=g(2);return s(p.onPrintShippingLabel(o))}),d(32,"i",35),i()()()}if(n&2){let e=w.$implicit;a(2),b(e.Outlet),a(5),C("src",k(8,13,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(3),C("order",e),a(2),E(" ",K(13,15,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(3),b(e.Customer),a(),B(J(20,be,(e.Variants==null?null:e.Variants.length)>1)),a(),T((e.Variants==null?null:e.Variants.length)>1?17:18),a(3),b(k(21,18,e.Amount)),a(6),b(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),T(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?27:-1),a(2),E(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function Le(n,w){if(n&1){let e=V();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Outlet"),i(),t(6,"th",21),l(7,"Number"),i(),t(8,"th",21),l(9,"Customer"),i(),t(10,"th"),l(11,"Items"),i(),t(12,"th",22),l(13,"Amount"),i(),t(14,"th",23),l(15,"Shipping"),i(),d(16,"th",24),i()(),t(17,"tbody"),R(18,Ve,33,22,"tr",null,z),i()(),t(20,"app-custom-paginator",25),L("next",function(){c(e);let o=g();return s(o.initAwaitingCollection())})("previous",function(){c(e);let o=g();return s(o.initAwaitingCollection())}),i()()}if(n&2){let e=g(),m=G(0);a(18),j(m),a(2),C("filter",e.filter())("totaldata",m==null?null:m.length)}}function Ee(n,w){n&1&&(t(0,"div",16),d(1,"app-empty-state"),i())}var at=(()=>{class n{constructor(){this.awaitingCollectionService=f(A),this.tokenService=f(le),this.filter=F({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){let e=this.tokenService.getTokenValue(),m=Number(e?.orddfl??0),o=new Date,p=m===0?null:new Date(o.setDate(o.getDate()-m));this.filter.update(u=>P(M({},u),{From:p})),this.initAwaitingCollection()}initAwaitingCollection(){this.awaitingCollections$=this.awaitingCollectionService.getAwaitingCollectionOrders(this.filter()).pipe(D(1))}getOrderDefaultValue(){return this.tokenService.getTokenValue()?.orddfl??null}onPrintShippingLabel(e){this.awaitingCollectionService.printShippingLabel(e)}static{this.\u0275fac=function(m){return new(m||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-awaiting-collection"]],features:[q([A])],decls:34,vars:11,consts:[["headerTitle","Awaiting Collection","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","100px"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[2,"width","150px"],[2,"width","10px"],["rowCountApi","/api/orders/awaitingcollectioncount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"text-end","td-cell-hover"],["type","button","aria-label","Print order","title","Print","matTooltip","Print shipping label",1,"btn","p-0","border-0","bg-transparent",3,"click"],[1,"fa-solid","fa-print","fs-3"]],template:function(m,o){if(m&1){let p=V();H(0),y(1,"async"),t(2,"mainpanel",0),L("onSubmit",function(){return c(p),s(o.initAwaitingCollection())}),S("textChange",function(r){return c(p),h(o.filter().Number,r)||(o.filter().Number=r),s(r)}),t(3,"actions")(4,"a",1),d(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"From/To"),i(),t(12,"channel-select-options",4),S("ngModelChange",function(r){return c(p),h(o.filter().ListChannelID,r)||(o.filter().ListChannelID=r),s(r)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),S("dateChange",function(r){return c(p),h(o.filter().From,r)||(o.filter().From=r),s(r)}),i()(),t(18,"div")(19,"datepicker",8),S("dateChange",function(r){return c(p),h(o.filter().To,r)||(o.filter().To=r),s(r)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),S("ngModelChange",function(r){return c(p),h(o.filter().PageNumber,r)||(o.filter().PageNumber=r),s(r)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),S("ngModelChange",function(r){return c(p),h(o.filter().PageSize,r)||(o.filter().PageSize=r),s(r)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,Le,21,2,"div",15)(33,Ee,2,0,"div",16),i()()()()()}if(m&2){let p=U(k(1,8,o.awaitingCollections$));a(2),_("text",o.filter().Number),a(10),C("multiple",!0),_("ngModel",o.filter().ListChannelID),a(5),_("date",o.filter().From),a(2),_("date",o.filter().To),a(4),_("ngModel",o.filter().PageNumber),a(4),_("ngModel",o.filter().PageSize),a(5),T((p==null?null:p.length)>0?32:33)}},dependencies:[Z,Q,Y,X,se,ce,ue,de,ne,$,ie,ee,te,_e,he,Se,fe,ge,pe,me,we],encapsulation:2})}}return n})();export{at as AwaitingCollectionComponent};
1
+ import{a as _e,b as he,c as Se}from"./chunk-V5BKQSAT.js";import{a as we}from"./chunk-V2RVHNCX.js";import{a as ge}from"./chunk-U7TVLBC5.js";import{a as Ce}from"./chunk-722SRHLY.js";import{a as fe}from"./chunk-YSJSAVBS.js";import{a as ue}from"./chunk-EPVCMYCI.js";import"./chunk-O5LFGGB2.js";import"./chunk-M5JQ7BGW.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-BFU7VKO3.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-CMTBBXR5.js";import{a as de}from"./chunk-WPW3D4MQ.js";import{g as le}from"./chunk-UG7VRDLB.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as ae}from"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import{b as v}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{b as oe,e as re}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as ce,n as se}from"./chunk-CLER2MX6.js";import{A as ne,c as $,h as ee,m as te,o as ie}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as me,s as pe}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as Q,k as X,m as Y,n as Z}from"./chunk-M2FCTYGU.js";import{$c as y,Gb as O,Gc as l,Hc as b,Ic as E,Kc as _,Lc as h,Mb as x,Mc as S,Nc as H,Oc as U,Pc as G,Qc as q,Ra as F,Sc as J,Yb as C,Z as D,ac as B,ad as k,bd as K,dc as T,ec as z,gc as R,hc as j,ic as t,ja as I,jc as i,kc as d,oc as V,pa as f,pb as W,rb as a,tc as L,uc as g,v as N,ya as c,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as M,b as P}from"./chunk-66YHNWRR.js";var A=(()=>{class n{constructor(){this.httpService=f(re),this.shippingLabelService=f(Ce),this.toastrService=f(oe)}getAwaitingCollectionOrders(e){return this.httpService.post(ae.GetAwaitingCollection,e).pipe(N(m=>m?.Data))}printShippingLabel(e){switch(e?.MarketType){case v.Shopee:this.shippingLabelService.printShippingLabelShopee(e.Number,e.ShopID);break;case v.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e.Number,e.ShopID);break;case v.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e.Number);break;case v.Lazada:this.shippingLabelService.printShippingLabelLazada(e.Number,e.ShopID);break;case v.Shopify:this.toastrService.error("Shopify not supported","Error Not supported");break}}static{this.\u0275fac=function(m){return new(m||n)}}static{this.\u0275prov=I({token:n,factory:n.\u0275fac})}}return n})();var be=n=>({"td-cell-hover":n});function ye(n,w){if(n&1&&d(0,"variants-dropdown",30),n&2){let e=g().$implicit;C("variants",e==null?null:e.Variants)}}function xe(n,w){if(n&1&&d(0,"variant-with-image",31),n&2){let e=g().$implicit;C("variant",e==null?null:e.Variants[0])}}function Te(n,w){if(n&1&&(t(0,"span"),l(1),i()),n&2){let e=g().$implicit;a(),E("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Ve(n,w){if(n&1){let e=V();t(0,"tr")(1,"td"),l(2),i(),t(3,"td")(4,"div",26)(5,"div",27)(6,"div"),d(7,"img",28),y(8,"channelImage"),i(),t(9,"div"),d(10,"order-link",29),i()(),t(11,"small"),l(12),y(13,"date"),i()()(),t(14,"td"),l(15),i(),t(16,"td"),x(17,ye,1,1,"variants-dropdown",30)(18,xe,1,1,"variant-with-image",31),i(),t(19,"td",32),l(20),y(21,"number"),i(),t(22,"td")(23,"div",26)(24,"div",27)(25,"span"),l(26),i(),x(27,Te,2,1,"span"),i(),t(28,"small"),l(29),i()()(),t(30,"td",33)(31,"button",34),L("click",function(){let o=c(e).$implicit,p=g(2);return s(p.onPrintShippingLabel(o))}),d(32,"i",35),i()()()}if(n&2){let e=w.$implicit;a(2),b(e.Outlet),a(5),C("src",k(8,13,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(3),C("order",e),a(2),E(" ",K(13,15,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(3),b(e.Customer),a(),B(J(20,be,(e.Variants==null?null:e.Variants.length)>1)),a(),T((e.Variants==null?null:e.Variants.length)>1?17:18),a(3),b(k(21,18,e.Amount)),a(6),b(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),T(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?27:-1),a(2),E(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function Le(n,w){if(n&1){let e=V();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Outlet"),i(),t(6,"th",21),l(7,"Number"),i(),t(8,"th",21),l(9,"Customer"),i(),t(10,"th"),l(11,"Items"),i(),t(12,"th",22),l(13,"Amount"),i(),t(14,"th",23),l(15,"Shipping"),i(),d(16,"th",24),i()(),t(17,"tbody"),R(18,Ve,33,22,"tr",null,z),i()(),t(20,"app-custom-paginator",25),L("next",function(){c(e);let o=g();return s(o.initAwaitingCollection())})("previous",function(){c(e);let o=g();return s(o.initAwaitingCollection())}),i()()}if(n&2){let e=g(),m=G(0);a(18),j(m),a(2),C("filter",e.filter())("totaldata",m==null?null:m.length)}}function Ee(n,w){n&1&&(t(0,"div",16),d(1,"app-empty-state"),i())}var at=(()=>{class n{constructor(){this.awaitingCollectionService=f(A),this.tokenService=f(le),this.filter=F({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){let e=this.tokenService.getTokenValue(),m=Number(e?.orddfl??0),o=new Date,p=m===0?null:new Date(o.setDate(o.getDate()-m));this.filter.update(u=>P(M({},u),{From:p})),this.initAwaitingCollection()}initAwaitingCollection(){this.awaitingCollections$=this.awaitingCollectionService.getAwaitingCollectionOrders(this.filter()).pipe(D(1))}getOrderDefaultValue(){return this.tokenService.getTokenValue()?.orddfl??null}onPrintShippingLabel(e){this.awaitingCollectionService.printShippingLabel(e)}static{this.\u0275fac=function(m){return new(m||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-awaiting-collection"]],features:[q([A])],decls:34,vars:11,consts:[["headerTitle","Awaiting Collection","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","100px"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[2,"width","150px"],[2,"width","10px"],["rowCountApi","/api/orders/awaitingcollectioncount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"text-end","td-cell-hover"],["type","button","aria-label","Print order","title","Print","matTooltip","Print shipping label",1,"btn","p-0","border-0","bg-transparent",3,"click"],[1,"fa-solid","fa-print","fs-3"]],template:function(m,o){if(m&1){let p=V();H(0),y(1,"async"),t(2,"mainpanel",0),L("onSubmit",function(){return c(p),s(o.initAwaitingCollection())}),S("textChange",function(r){return c(p),h(o.filter().Number,r)||(o.filter().Number=r),s(r)}),t(3,"actions")(4,"a",1),d(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"From/To"),i(),t(12,"channel-select-options",4),S("ngModelChange",function(r){return c(p),h(o.filter().ListChannelID,r)||(o.filter().ListChannelID=r),s(r)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),S("dateChange",function(r){return c(p),h(o.filter().From,r)||(o.filter().From=r),s(r)}),i()(),t(18,"div")(19,"datepicker",8),S("dateChange",function(r){return c(p),h(o.filter().To,r)||(o.filter().To=r),s(r)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),S("ngModelChange",function(r){return c(p),h(o.filter().PageNumber,r)||(o.filter().PageNumber=r),s(r)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),S("ngModelChange",function(r){return c(p),h(o.filter().PageSize,r)||(o.filter().PageSize=r),s(r)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,Le,21,2,"div",15)(33,Ee,2,0,"div",16),i()()()()()}if(m&2){let p=U(k(1,8,o.awaitingCollections$));a(2),_("text",o.filter().Number),a(10),C("multiple",!0),_("ngModel",o.filter().ListChannelID),a(5),_("date",o.filter().From),a(2),_("date",o.filter().To),a(4),_("ngModel",o.filter().PageNumber),a(4),_("ngModel",o.filter().PageSize),a(5),T((p==null?null:p.length)>0?32:33)}},dependencies:[Z,Q,Y,X,se,ce,ue,de,ne,$,ie,ee,te,_e,he,Se,fe,ge,pe,me,we],encapsulation:2})}}return n})();export{at as AwaitingCollectionComponent};
@@ -1 +1 @@
1
- import{a as Re,b as Ne,c as Le}from"./chunk-V5BKQSAT.js";import{a as Ae}from"./chunk-55RGFLHB.js";import{a as Ie}from"./chunk-EH553VTO.js";import{a as Ve}from"./chunk-YSJSAVBS.js";import{a as Ee}from"./chunk-EPVCMYCI.js";import"./chunk-O5LFGGB2.js";import"./chunk-M5JQ7BGW.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-CMTBBXR5.js";import{a as Fe}from"./chunk-WPW3D4MQ.js";import{g as xe}from"./chunk-YGEKAO5R.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as M}from"./chunk-5HO2IJ47.js";import{c as Z,d as $,e as ee}from"./chunk-5JVEEL2T.js";import{b as C,c as K}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{b as Te,e as G}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{b as te,c as ie,d as we,e as ne,f as oe,g as Oe,h as re,m as Me,n as Pe}from"./chunk-CLER2MX6.js";import{A as V,c as ke,h as H,m as U,o as ve}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as be,s as De}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as Ce,k as z,m as ye,n as O}from"./chunk-M2FCTYGU.js";import{$c as b,G as ae,Gb as D,Gc as a,Hc as y,Ic as B,Kc as k,Lc as v,Mb as E,Mc as T,Na as q,Nc as ue,Oa as J,Oc as he,Pc as ge,Qc as fe,Ra as S,Rc as _e,Sc as Se,Yb as u,Z as me,_b as le,aa as pe,ac as de,ad as Q,bd as I,dc as P,ec as N,gc as L,hc as A,ic as o,ja as F,jc as r,kc as x,oc as w,pa as c,pb as ce,rb as p,rd as X,tc as d,uc as h,v as j,ya as f,za as _}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as W,b as Y}from"./chunk-66YHNWRR.js";function Je(n,g){if(n&1){let e=w();o(0,"div",10),d("click",function(){f(e);let i=h();return _(i.onSelectDelivery("DROP_OFF"))}),o(1,"div",11),x(2,"i",12),o(3,"h3",13),a(4,"Drop off"),r()(),o(5,"p",14),a(6," You can drop off your package at the nearest shipping counter in your city. "),r()()}if(n&2){let e=h();le("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="PICK_UP")("selected",e.selectedDelivery()==="DROP_OFF")}}function Qe(n,g){if(n&1){let e=w();o(0,"div",10),d("click",function(){f(e);let i=h();return _(i.onSelectDelivery("PICK_UP"))}),o(1,"div",11),x(2,"i",15),o(3,"h3",16),a(4,"Pick up"),r()(),o(5,"p",17),a(6," The courier will collect the package from your address. "),r()()}if(n&2){let e=h();le("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="DROP_OFF")("selected",e.selectedDelivery()==="PICK_UP")}}var We=(()=>{class n{constructor(){this.data=c(ie),this.dialogRef=c(te),this.selectedDelivery=S("DROP_OFF"),this.showPickup=S(!0),this.showDropOff=S(!0),this.initOptionsCondition()}onSelectDelivery(e){this.selectedDelivery.set(e)}initOptionsCondition(){switch(this.data.channelType){case C.Shopee:break;case C.Tiktok:this.showPickup.set(this.data.options?.Form?.information?.can_pickup),this.showDropOff.set(this.data.options?.Form?.information?.can_drop_off);break}}onConfirm(){this.dialogRef.close(this.selectedDelivery())}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["app-delivery-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-8"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"ms-2"],[1,"text-secondary-emphasis"],[1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[1,"pb-0"],[1,"d-flex","align-items-center","justify-content-center","gap-12"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"text-muted","selected"],[1,"d-flex","justify-content-end",2,"margin-top","1.5rem"],[1,"btn","btn-light-blue","me-3","text-primary","btn-lg","fw-bold","mx-3","py-6",2,"width","70px",3,"click"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"click"],[1,"text-center"],[1,"fa-solid","fa-cart-shopping-fast","fa-4x"],[1,"mt-4","titlew"],[1,"text-center","mt-4","lh-sm","subtitlew"],[1,"fa-solid","fa-hand-holding-box","fa-4x"],[1,"mt-4"],[1,"text-center","mt-4","lh-sm"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),a(4,"Delivery Order"),r(),o(5,"div",3),a(6,"Your selected order(s) will be set to"),r()(),o(7,"div")(8,"i",4),d("click",function(){return i.onClose()}),r()()()(),o(9,"mat-dialog-content",5)(10,"div",6),E(11,Je,7,4,"div",7)(12,Qe,7,4,"div",7),r(),o(13,"div",8)(14,"button",9),d("click",function(){return i.onConfirm()}),a(15," OK "),r()()()),t&2&&(p(11),P(i.showPickup()?11:-1),p(),P(i.showDropOff()?12:-1))},dependencies:[O,re,ne,oe],styles:[".delivery-option[_ngcontent-%COMP%]{width:14rem;height:12rem;border:1px solid #656565}.delivery-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.delivery-option.text-muted[_ngcontent-%COMP%]{border-color:#000;color:#000}.delivery-option.selected[_ngcontent-%COMP%]{color:#5e9708;border-color:#5e9708}.delivery-option.selected[_ngcontent-%COMP%] .titlew[_ngcontent-%COMP%]{color:#5e9708;font-weight:700}.delivery-option.selected[_ngcontent-%COMP%] .subtitlew[_ngcontent-%COMP%]{color:#5e9708}"]})}}return n})();function Ze(n,g){if(n&1&&(o(0,"ng-option",3),a(1),r()),n&2){let e=g.$implicit;u("value",e==null?null:e.address_id)("matTooltip",e==null?null:e.address),p(),y(e==null?null:e.address)}}function $e(n,g){if(n&1&&(o(0,"ng-option",6)(1,"span",7),a(2),b(3,"date"),r(),o(4,"span"),a(5),r()()),n&2){let e=g.$implicit;u("value",e==null?null:e.pickup_time_id),p(2),y(I(3,3,e==null?null:e.date,"d MMMM")),p(3),y(e==null?null:e.time_text)}}var ze=(()=>{class n{constructor(){this.shippingOptions=J(),this.onFormChanges=q(),this.addressList=X(()=>this.shippingOptions()?.response?.pickup?.address_list||[]),this.selectedShipping=S(null),this.timeOptions=S(this.convertTimestampToDate(this.addressList()[0]?.time_slot_list||[])),this.pickupTime=S(null)}onAddressChange(e){let t=this.addressList().find(i=>i.address_id===e);this.timeOptions.set(this.convertTimestampToDate(t?.time_slot_list||[])),this.pickupTime.set(null)}onValueChanges(){this.onFormChanges.emit({address_id:this.selectedShipping(),pickup_time_id:this.pickupTime()})}convertTimestampToDate(e){return e.map(t=>{let i=new Date(t.date*1e3);return Y(W({},t),{date:i})})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["shopee-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:12,vars:4,consts:[[1,"mb-6"],["for","address",1,"mb-2","text-muted"],["id","address","placeholder","Select Address to Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value","matTooltip"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Date Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"label",1),a(2,"Address"),r(),o(3,"ng-select",2),T("ngModelChange",function(s){return v(i.selectedShipping,s)||(i.selectedShipping=s),s}),d("ngModelChange",function(s){return i.onAddressChange(s),i.onValueChanges()}),L(4,Ze,2,3,"ng-option",3,N),r()(),o(6,"div",0)(7,"label",4),a(8,"Date"),r(),o(9,"ng-select",5),T("ngModelChange",function(s){return v(i.pickupTime,s)||(i.pickupTime=s),s}),d("ngModelChange",function(){return i.onValueChanges()}),L(10,$e,6,6,"ng-option",6,N),r()()),t&2&&(p(3),u("clearable",!1),k("ngModel",i.selectedShipping),p(),A(i.addressList()),p(5),u("clearable",!1),k("ngModel",i.pickupTime),p(),A(i.timeOptions()))},dependencies:[O,z,ee,$,Z,V,H,U,De,be],encapsulation:2})}}return n})();function et(n,g){if(n&1&&(o(0,"ng-option",3)(1,"span",4),a(2),b(3,"date"),r(),o(4,"span"),a(5),b(6,"date"),r(),o(7,"span",5),a(8,"-"),r(),o(9,"span"),a(10),b(11,"date"),r()()),n&2){let e=g.$implicit,t=g.$index;u("value",t),p(2),y(I(3,4,e==null?null:e.start_date,"d MMMM")),p(3),y(I(6,7,e==null?null:e.start_date,"HH:mm")),p(5),y(I(11,10,e==null?null:e.end_date,"HH:mm"))}}var He=(()=>{class n{constructor(){this.shippingOptions=J(),this.onFormChanges=q(),this.timeOptions=X(()=>this.shippingOptions()?.Options?.pickup_slots),this.selectedTimeIndex=S(null)}onValueChanges(){let e=this.timeOptions()[this.selectedTimeIndex()];this.onFormChanges.emit({start_time:e?.start_time,end_time:e?.end_time})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["tiktok-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:6,vars:2,consts:[[1,"mb-6"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Time Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"],[1,"mx-1"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"label",1),a(2,"Time"),r(),o(3,"ng-select",2),T("ngModelChange",function(s){return v(i.selectedTimeIndex,s)||(i.selectedTimeIndex=s),s}),d("ngModelChange",function(){return i.onValueChanges()}),L(4,et,12,13,"ng-option",3,N),r()()),t&2&&(p(3),u("clearable",!1),k("ngModel",i.selectedTimeIndex),p(),A(i.timeOptions()))},dependencies:[O,z,ee,$,Z,V,H,U],encapsulation:2})}}return n})();function tt(n,g){if(n&1){let e=w();o(0,"shopee-pickup",10),d("onFormChanges",function(i){f(e);let l=h();return _(l.onFormChanges(i))}),r()}if(n&2){let e=h();u("shippingOptions",e.dialogData.shippingOptions)}}function it(n,g){if(n&1){let e=w();o(0,"tiktok-pickup",10),d("onFormChanges",function(i){f(e);let l=h();return _(l.onFormChanges(i))}),r()}if(n&2){let e=h();u("shippingOptions",e.dialogData.shippingOptions)}}var Ue=(()=>{class n{constructor(){this.dialogRef=c(te),this.dialogData=c(ie),this.shippingOptions=S(this.dialogData.shippingOptions),this.channelType=S(this.dialogData.channelType),this.order=S(this.dialogData.order),this.channelTypeEnum=C,this.pickupData=S(null)}onFormChanges(e){this.pickupData.set(e)}onClose(){this.dialogRef.close()}onSave(){let e=this.generatePickupData();this.dialogRef.close(e)}generatePickupData(){switch(this.channelType()){case C.Shopee:return{OrderNumber:this.order().Number,ShopID:this.order().ShopID,pickup:this.pickupData()};case C.Tiktok:return{handover_method:"PICKUP",PackageID:this.shippingOptions().Form?.information?.PackageID,ShopID:this.order().ShopID,pickup_slot:this.pickupData()}}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["app-pickup-dialog"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-6"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"lh-base","mt-6"],[1,"text-muted","fs-6"],["role","button",1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[2,"padding-bottom","10px"],[3,"shippingOptions"],[1,"d-flex","justify-content-end","align-items-center","w-100","pe-8","mb-4"],[1,"btn","btn-outline-secondary","me-4",2,"width","70px",3,"click"],[1,"btn","btn-success",2,"width","70px",3,"click"],[3,"onFormChanges","shippingOptions"]],template:function(t,i){if(t&1&&(o(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),a(4,"Set Pickup"),r(),o(5,"div",2)(6,"div",3),a(7,"Shipping Method"),r(),o(8,"div",3),a(9),r()()(),o(10,"div")(11,"i",4),d("click",function(){return i.onClose()}),r()()()(),o(12,"mat-dialog-content",5),E(13,tt,1,1,"shopee-pickup",6)(14,it,1,1,"tiktok-pickup",6),r(),o(15,"mat-dialog-actions")(16,"div",7)(17,"button",8),d("click",function(){return i.onClose()}),a(18," Cancel "),r(),o(19,"button",9),d("click",function(){return i.onSave()}),a(20," Ok "),r()()()),t&2){let l,s;p(9),B(" ",!((l=i.order())==null||l.LogisticService==null)&&l.LogisticService.Name?(l=i.order())==null||l.LogisticService==null?null:l.LogisticService.Name:"-"," "),p(4),P((s=i.channelType())===i.channelTypeEnum.Shopee?13:s===i.channelTypeEnum.Tiktok?14:-1)}},dependencies:[O,re,ne,Oe,oe,V,ze,He],styles:['ng-select.shipping-timepicker .ng-arrow{border:none!important;width:0;height:0} ng-select.shipping-timepicker .ng-arrow-wrapper{width:28px;display:flex;align-items:center;justify-content:center} ng-select.shipping-timepicker .ng-arrow-wrapper:after{content:"\\f107";font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-style:normal;font-weight:400!important;font-size:16px;line-height:1;display:inline-block;color:#6b7280;pointer-events:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto}.label-opacity[_ngcontent-%COMP%]{opacity:.7}']})}}return n})();var se=(()=>{class n{constructor(){this.httpService=c(G)}getReadyToShipOrders(e){return this.httpService.post(M.GetToShip,e).pipe(j(t=>t?.Data))}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac})}}return n})();var Ke=(()=>{class n{constructor(){this.httpService=c(G)}getShippingOptions(e,t){return this.httpService.post(M.GetTiktokShippingOptions,{OrderNumber:e,ShopID:t}).pipe(j(i=>this.formatDatePickUpOptions(i)))}pickupOrder(e){return this.httpService.post(M.TiktokSelectShipping,e)}dropOffOrder(e,t){let i={handover_method:"DROP_OFF",PackageID:e,ShopID:t};return this.httpService.post(M.TiktokSelectShipping,i)}formatDatePickUpOptions(e){return e?.Options?.pickup_slots&&(e.Options.pickup_slots=e?.Options?.pickup_slots.map(t=>{let i=K.convertTimestampToDate(t.start_time),l=K.convertTimestampToDate(t.end_time);return t.start_date=i,t.end_date=l,t})),e}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Ge=(()=>{class n{constructor(){this.httpService=c(G)}getShippingOptions(e,t){return this.httpService.post(M.GetShopeeShippingOptions,{OrderNumber:e,ShopID:t})}pickupOrder(e){return this.httpService.post(M.ShopeeSelectShipping,e)}dropOffOrder(e,t){let i={OrderNumber:e,ShopID:t,dropoff:{}};return this.httpService.post(M.ShopeeSelectShipping,i)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Ye=(()=>{class n{constructor(){this.shopeeShippingService=c(Ge),this.tiktokShippingService=c(Ke)}getShippingOptions(e,t,i){switch(i){case C.Shopee:return this.getShopeeShippingOptions(e,t);case C.Tiktok:return this.getTiktokShippingOptions(e,t)}}pickupOrder(e,t){switch(e.MarketType){case C.Shopee:return this.shopeeShippingService.pickupOrder(t);case C.Tiktok:return this.tiktokShippingService.pickupOrder(t)}}dropOffOrder(e,t){switch(e.MarketType){case C.Shopee:return this.shopeeShippingService.dropOffOrder(e.Number,e.ShopID);case C.Tiktok:let i=t?.Form?.information?.PackageID;return this.tiktokShippingService.dropOffOrder(i,e.ShopID)}}getShopeeShippingOptions(e,t){return this.shopeeShippingService.getShippingOptions(e,t)}getTiktokShippingOptions(e,t){return this.tiktokShippingService.getShippingOptions(e,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var nt=()=>[],ot=n=>({"td-cell-hover":n});function rt(n,g){if(n&1&&x(0,"variants-dropdown",30),n&2){let e=h().$implicit;u("variants",e==null?null:e.Variants)}}function at(n,g){if(n&1&&x(0,"variant-with-image",31),n&2){let e=h().$implicit;u("variant",e==null?null:e.Variants[0])}}function pt(n,g){if(n&1&&(o(0,"span"),a(1),r()),n&2){let e=h().$implicit;p(),B("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function lt(n,g){if(n&1){let e=w();o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"div",26)(5,"div",27)(6,"div"),x(7,"img",28),b(8,"channelImage"),r(),o(9,"div"),x(10,"order-link",29),r()(),o(11,"small"),a(12),b(13,"date"),r()()(),o(14,"td"),a(15),r(),o(16,"td"),E(17,rt,1,1,"variants-dropdown",30)(18,at,1,1,"variant-with-image",31),r(),o(19,"td",32),a(20),b(21,"number"),r(),o(22,"td")(23,"div",26)(24,"div",27)(25,"span"),a(26),r(),E(27,pt,2,1,"span"),r(),o(28,"small"),a(29),r()()(),o(30,"td",33)(31,"button",34),d("click",function(){let i=f(e).$implicit,l=h(2);return _(l.onSetFulfillment(i))}),a(32," Set Fulfillment "),r()()()}if(n&2){let e=g.$implicit;p(2),y(e.Outlet),p(5),u("src",Q(8,13,e==null?null:e.MarketType),ce)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),p(3),u("order",e),p(2),B(" ",I(13,15,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),p(3),y(e.Customer),p(),de(Se(20,ot,(e.Variants==null?null:e.Variants.length)>1)),p(),P((e.Variants==null?null:e.Variants.length)>1?17:18),p(3),y(Q(21,18,e.Amount)),p(6),y(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),p(),P(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?27:-1),p(2),B(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function st(n,g){if(n&1){let e=w();o(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Outlet"),r(),o(6,"th",21),a(7,"Number"),r(),o(8,"th",21),a(9,"Customer"),r(),o(10,"th"),a(11,"Items"),r(),o(12,"th",22),a(13,"Amount"),r(),o(14,"th",23),a(15,"Shipping"),r(),x(16,"th",24),r()(),o(17,"tbody"),L(18,lt,33,22,"tr",null,N),r()(),o(20,"app-custom-paginator",25),d("next",function(){f(e);let i=h();return _(i.initReadyToShip())})("previous",function(){f(e);let i=h();return _(i.initReadyToShip())}),r()()}if(n&2){let e=h(),t=ge(0);p(18),A(t),p(2),u("filter",e.filter())("totaldata",t==null?null:t.length)}}function mt(n,g){n&1&&(o(0,"div",16),x(1,"app-empty-state"),r())}var Ri=(()=>{class n{constructor(){this.readyToShipService=c(se),this.dialog=c(we),this.pickupService=c(Ye),this.toastr=c(Te),this.tokenService=c(xe),this.filter=S({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){let e=this.tokenService.getTokenValue(),t=Number(e?.orddfl??0),i=new Date,l=t===0?null:new Date(i.setDate(i.getDate()-t));this.filter.update(s=>Y(W({},s),{From:l})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.readyToShipService.getReadyToShipOrders(this.filter()).pipe(me(1))}onFilterChange(e){this.filter.update(t=>W(W({},t),e))}getOrderDefaultValue(){return this.tokenService.getTokenValue()?.orddfl??null}onSetFulfillment(e){this.pickupService.getShippingOptions(e.Number,e.ShopID,e.MarketType).pipe(pe(t=>this.dialog.open(We,{height:"400px",width:"530px",data:{options:t,channelType:e.MarketType}}).afterClosed().pipe(ae(i=>K.IsNotEmpty(i)),j(i=>({type:i,order:e,options:t}))))).subscribe(t=>{t.type=="PICK_UP"?this.onSelectPickup(t.order,t.options):this.onSelectDropOff(t.order,t.options)})}onSelectPickup(e,t){this.dialog.open(Ue,{width:"530px",data:{order:e,shippingOptions:t,channelType:e.MarketType},disableClose:!0}).afterClosed().pipe(ae(i=>K.IsNotEmpty(i)),pe(i=>this.pickupService.pickupOrder(e,i))).subscribe(()=>{this.toastr.success("Pickup order created successfully","Success"),this.initReadyToShip()})}onSelectDropOff(e,t){this.pickupService.dropOffOrder(e,t).subscribe(()=>{this.toastr.success("Drop-off order created successfully","Success"),this.initReadyToShip()})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["app-ready-to-ship"]],features:[fe([se])],decls:34,vars:12,consts:[["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","100px"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[2,"width","150px"],[2,"width","160px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(t,i){if(t&1){let l=w();ue(0),b(1,"async"),o(2,"mainpanel",0),d("onSubmit",function(){return f(l),_(i.initReadyToShip())}),T("textChange",function(m){return f(l),v(i.filter().Number,m)||(i.filter().Number=m),_(m)}),o(3,"actions")(4,"a",1),x(5,"i",2),o(6,"span"),a(7,"Order Fulfillment Display"),r()()(),o(8,"filters")(9,"div")(10,"label",3),a(11,"From/To"),r(),o(12,"channel-select-options",4),T("ngModelChange",function(m){return f(l),v(i.filter().ListChannelID,m)||(i.filter().ListChannelID=m),_(m)}),r()(),o(13,"div",5)(14,"label",3),a(15,"From/To"),r(),o(16,"div",6)(17,"datepicker",7),T("dateChange",function(m){return f(l),v(i.filter().From,m)||(i.filter().From=m),_(m)}),r()(),o(18,"div")(19,"datepicker",8),T("dateChange",function(m){return f(l),v(i.filter().To,m)||(i.filter().To=m),_(m)}),r()()(),o(20,"div",5)(21,"label",9),a(22,"Page Number"),r(),o(23,"input",10),T("ngModelChange",function(m){return f(l),v(i.filter().PageNumber,m)||(i.filter().PageNumber=m),_(m)}),r()(),o(24,"div",5)(25,"label",9),a(26,"Page Size"),r(),o(27,"input",11),T("ngModelChange",function(m){return f(l),v(i.filter().PageSize,m)||(i.filter().PageSize=m),_(m)}),r()()(),o(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),E(32,st,21,2,"div",15)(33,mt,2,0,"div",16),r()()()()()}if(t&2){let l=he(Q(1,8,i.readyToShip$)||_e(11,nt));p(2),k("text",i.filter().Number),p(10),u("multiple",!0),k("ngModel",i.filter().ListChannelID),p(5),k("date",i.filter().From),p(2),k("date",i.filter().To),p(4),k("ngModel",i.filter().PageNumber),p(4),k("ngModel",i.filter().PageSize),p(5),P(l.length>0?32:33)}},dependencies:[O,Ce,ye,z,Pe,Me,Ee,Fe,V,ke,ve,H,U,Re,Ne,Le,Ve,Ie,Ae],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]})}}return n})();export{Ri as ReadyToShipComponent};
1
+ import{a as Re,b as Ne,c as Le}from"./chunk-V5BKQSAT.js";import{a as Ae}from"./chunk-V2RVHNCX.js";import{a as Ie}from"./chunk-U7TVLBC5.js";import{a as Ve}from"./chunk-YSJSAVBS.js";import{a as Ee}from"./chunk-EPVCMYCI.js";import"./chunk-O5LFGGB2.js";import"./chunk-M5JQ7BGW.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-CMTBBXR5.js";import{a as Fe}from"./chunk-WPW3D4MQ.js";import{g as xe}from"./chunk-UG7VRDLB.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as M}from"./chunk-5HO2IJ47.js";import{c as Z,d as $,e as ee}from"./chunk-5JVEEL2T.js";import{b as C,c as K}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{b as Te,e as G}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{b as te,c as ie,d as we,e as ne,f as oe,g as Oe,h as re,m as Me,n as Pe}from"./chunk-CLER2MX6.js";import{A as V,c as ke,h as H,m as U,o as ve}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as be,s as De}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as Ce,k as z,m as ye,n as O}from"./chunk-M2FCTYGU.js";import{$c as b,G as ae,Gb as D,Gc as a,Hc as y,Ic as B,Kc as k,Lc as v,Mb as E,Mc as T,Na as q,Nc as ue,Oa as J,Oc as he,Pc as ge,Qc as fe,Ra as S,Rc as _e,Sc as Se,Yb as u,Z as me,_b as le,aa as pe,ac as de,ad as Q,bd as I,dc as P,ec as N,gc as L,hc as A,ic as o,ja as F,jc as r,kc as x,oc as w,pa as c,pb as ce,rb as p,rd as X,tc as d,uc as h,v as j,ya as f,za as _}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as W,b as Y}from"./chunk-66YHNWRR.js";function Je(n,g){if(n&1){let e=w();o(0,"div",10),d("click",function(){f(e);let i=h();return _(i.onSelectDelivery("DROP_OFF"))}),o(1,"div",11),x(2,"i",12),o(3,"h3",13),a(4,"Drop off"),r()(),o(5,"p",14),a(6," You can drop off your package at the nearest shipping counter in your city. "),r()()}if(n&2){let e=h();le("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="PICK_UP")("selected",e.selectedDelivery()==="DROP_OFF")}}function Qe(n,g){if(n&1){let e=w();o(0,"div",10),d("click",function(){f(e);let i=h();return _(i.onSelectDelivery("PICK_UP"))}),o(1,"div",11),x(2,"i",15),o(3,"h3",16),a(4,"Pick up"),r()(),o(5,"p",17),a(6," The courier will collect the package from your address. "),r()()}if(n&2){let e=h();le("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="DROP_OFF")("selected",e.selectedDelivery()==="PICK_UP")}}var We=(()=>{class n{constructor(){this.data=c(ie),this.dialogRef=c(te),this.selectedDelivery=S("DROP_OFF"),this.showPickup=S(!0),this.showDropOff=S(!0),this.initOptionsCondition()}onSelectDelivery(e){this.selectedDelivery.set(e)}initOptionsCondition(){switch(this.data.channelType){case C.Shopee:break;case C.Tiktok:this.showPickup.set(this.data.options?.Form?.information?.can_pickup),this.showDropOff.set(this.data.options?.Form?.information?.can_drop_off);break}}onConfirm(){this.dialogRef.close(this.selectedDelivery())}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["app-delivery-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-8"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"ms-2"],[1,"text-secondary-emphasis"],[1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[1,"pb-0"],[1,"d-flex","align-items-center","justify-content-center","gap-12"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"text-muted","selected"],[1,"d-flex","justify-content-end",2,"margin-top","1.5rem"],[1,"btn","btn-light-blue","me-3","text-primary","btn-lg","fw-bold","mx-3","py-6",2,"width","70px",3,"click"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"click"],[1,"text-center"],[1,"fa-solid","fa-cart-shopping-fast","fa-4x"],[1,"mt-4","titlew"],[1,"text-center","mt-4","lh-sm","subtitlew"],[1,"fa-solid","fa-hand-holding-box","fa-4x"],[1,"mt-4"],[1,"text-center","mt-4","lh-sm"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),a(4,"Delivery Order"),r(),o(5,"div",3),a(6,"Your selected order(s) will be set to"),r()(),o(7,"div")(8,"i",4),d("click",function(){return i.onClose()}),r()()()(),o(9,"mat-dialog-content",5)(10,"div",6),E(11,Je,7,4,"div",7)(12,Qe,7,4,"div",7),r(),o(13,"div",8)(14,"button",9),d("click",function(){return i.onConfirm()}),a(15," OK "),r()()()),t&2&&(p(11),P(i.showPickup()?11:-1),p(),P(i.showDropOff()?12:-1))},dependencies:[O,re,ne,oe],styles:[".delivery-option[_ngcontent-%COMP%]{width:14rem;height:12rem;border:1px solid #656565}.delivery-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.delivery-option.text-muted[_ngcontent-%COMP%]{border-color:#000;color:#000}.delivery-option.selected[_ngcontent-%COMP%]{color:#5e9708;border-color:#5e9708}.delivery-option.selected[_ngcontent-%COMP%] .titlew[_ngcontent-%COMP%]{color:#5e9708;font-weight:700}.delivery-option.selected[_ngcontent-%COMP%] .subtitlew[_ngcontent-%COMP%]{color:#5e9708}"]})}}return n})();function Ze(n,g){if(n&1&&(o(0,"ng-option",3),a(1),r()),n&2){let e=g.$implicit;u("value",e==null?null:e.address_id)("matTooltip",e==null?null:e.address),p(),y(e==null?null:e.address)}}function $e(n,g){if(n&1&&(o(0,"ng-option",6)(1,"span",7),a(2),b(3,"date"),r(),o(4,"span"),a(5),r()()),n&2){let e=g.$implicit;u("value",e==null?null:e.pickup_time_id),p(2),y(I(3,3,e==null?null:e.date,"d MMMM")),p(3),y(e==null?null:e.time_text)}}var ze=(()=>{class n{constructor(){this.shippingOptions=J(),this.onFormChanges=q(),this.addressList=X(()=>this.shippingOptions()?.response?.pickup?.address_list||[]),this.selectedShipping=S(null),this.timeOptions=S(this.convertTimestampToDate(this.addressList()[0]?.time_slot_list||[])),this.pickupTime=S(null)}onAddressChange(e){let t=this.addressList().find(i=>i.address_id===e);this.timeOptions.set(this.convertTimestampToDate(t?.time_slot_list||[])),this.pickupTime.set(null)}onValueChanges(){this.onFormChanges.emit({address_id:this.selectedShipping(),pickup_time_id:this.pickupTime()})}convertTimestampToDate(e){return e.map(t=>{let i=new Date(t.date*1e3);return Y(W({},t),{date:i})})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["shopee-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:12,vars:4,consts:[[1,"mb-6"],["for","address",1,"mb-2","text-muted"],["id","address","placeholder","Select Address to Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value","matTooltip"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Date Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"label",1),a(2,"Address"),r(),o(3,"ng-select",2),T("ngModelChange",function(s){return v(i.selectedShipping,s)||(i.selectedShipping=s),s}),d("ngModelChange",function(s){return i.onAddressChange(s),i.onValueChanges()}),L(4,Ze,2,3,"ng-option",3,N),r()(),o(6,"div",0)(7,"label",4),a(8,"Date"),r(),o(9,"ng-select",5),T("ngModelChange",function(s){return v(i.pickupTime,s)||(i.pickupTime=s),s}),d("ngModelChange",function(){return i.onValueChanges()}),L(10,$e,6,6,"ng-option",6,N),r()()),t&2&&(p(3),u("clearable",!1),k("ngModel",i.selectedShipping),p(),A(i.addressList()),p(5),u("clearable",!1),k("ngModel",i.pickupTime),p(),A(i.timeOptions()))},dependencies:[O,z,ee,$,Z,V,H,U,De,be],encapsulation:2})}}return n})();function et(n,g){if(n&1&&(o(0,"ng-option",3)(1,"span",4),a(2),b(3,"date"),r(),o(4,"span"),a(5),b(6,"date"),r(),o(7,"span",5),a(8,"-"),r(),o(9,"span"),a(10),b(11,"date"),r()()),n&2){let e=g.$implicit,t=g.$index;u("value",t),p(2),y(I(3,4,e==null?null:e.start_date,"d MMMM")),p(3),y(I(6,7,e==null?null:e.start_date,"HH:mm")),p(5),y(I(11,10,e==null?null:e.end_date,"HH:mm"))}}var He=(()=>{class n{constructor(){this.shippingOptions=J(),this.onFormChanges=q(),this.timeOptions=X(()=>this.shippingOptions()?.Options?.pickup_slots),this.selectedTimeIndex=S(null)}onValueChanges(){let e=this.timeOptions()[this.selectedTimeIndex()];this.onFormChanges.emit({start_time:e?.start_time,end_time:e?.end_time})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["tiktok-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:6,vars:2,consts:[[1,"mb-6"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Time Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"],[1,"mx-1"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"label",1),a(2,"Time"),r(),o(3,"ng-select",2),T("ngModelChange",function(s){return v(i.selectedTimeIndex,s)||(i.selectedTimeIndex=s),s}),d("ngModelChange",function(){return i.onValueChanges()}),L(4,et,12,13,"ng-option",3,N),r()()),t&2&&(p(3),u("clearable",!1),k("ngModel",i.selectedTimeIndex),p(),A(i.timeOptions()))},dependencies:[O,z,ee,$,Z,V,H,U],encapsulation:2})}}return n})();function tt(n,g){if(n&1){let e=w();o(0,"shopee-pickup",10),d("onFormChanges",function(i){f(e);let l=h();return _(l.onFormChanges(i))}),r()}if(n&2){let e=h();u("shippingOptions",e.dialogData.shippingOptions)}}function it(n,g){if(n&1){let e=w();o(0,"tiktok-pickup",10),d("onFormChanges",function(i){f(e);let l=h();return _(l.onFormChanges(i))}),r()}if(n&2){let e=h();u("shippingOptions",e.dialogData.shippingOptions)}}var Ue=(()=>{class n{constructor(){this.dialogRef=c(te),this.dialogData=c(ie),this.shippingOptions=S(this.dialogData.shippingOptions),this.channelType=S(this.dialogData.channelType),this.order=S(this.dialogData.order),this.channelTypeEnum=C,this.pickupData=S(null)}onFormChanges(e){this.pickupData.set(e)}onClose(){this.dialogRef.close()}onSave(){let e=this.generatePickupData();this.dialogRef.close(e)}generatePickupData(){switch(this.channelType()){case C.Shopee:return{OrderNumber:this.order().Number,ShopID:this.order().ShopID,pickup:this.pickupData()};case C.Tiktok:return{handover_method:"PICKUP",PackageID:this.shippingOptions().Form?.information?.PackageID,ShopID:this.order().ShopID,pickup_slot:this.pickupData()}}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["app-pickup-dialog"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-6"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"lh-base","mt-6"],[1,"text-muted","fs-6"],["role","button",1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[2,"padding-bottom","10px"],[3,"shippingOptions"],[1,"d-flex","justify-content-end","align-items-center","w-100","pe-8","mb-4"],[1,"btn","btn-outline-secondary","me-4",2,"width","70px",3,"click"],[1,"btn","btn-success",2,"width","70px",3,"click"],[3,"onFormChanges","shippingOptions"]],template:function(t,i){if(t&1&&(o(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),a(4,"Set Pickup"),r(),o(5,"div",2)(6,"div",3),a(7,"Shipping Method"),r(),o(8,"div",3),a(9),r()()(),o(10,"div")(11,"i",4),d("click",function(){return i.onClose()}),r()()()(),o(12,"mat-dialog-content",5),E(13,tt,1,1,"shopee-pickup",6)(14,it,1,1,"tiktok-pickup",6),r(),o(15,"mat-dialog-actions")(16,"div",7)(17,"button",8),d("click",function(){return i.onClose()}),a(18," Cancel "),r(),o(19,"button",9),d("click",function(){return i.onSave()}),a(20," Ok "),r()()()),t&2){let l,s;p(9),B(" ",!((l=i.order())==null||l.LogisticService==null)&&l.LogisticService.Name?(l=i.order())==null||l.LogisticService==null?null:l.LogisticService.Name:"-"," "),p(4),P((s=i.channelType())===i.channelTypeEnum.Shopee?13:s===i.channelTypeEnum.Tiktok?14:-1)}},dependencies:[O,re,ne,Oe,oe,V,ze,He],styles:['ng-select.shipping-timepicker .ng-arrow{border:none!important;width:0;height:0} ng-select.shipping-timepicker .ng-arrow-wrapper{width:28px;display:flex;align-items:center;justify-content:center} ng-select.shipping-timepicker .ng-arrow-wrapper:after{content:"\\f107";font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-style:normal;font-weight:400!important;font-size:16px;line-height:1;display:inline-block;color:#6b7280;pointer-events:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto}.label-opacity[_ngcontent-%COMP%]{opacity:.7}']})}}return n})();var se=(()=>{class n{constructor(){this.httpService=c(G)}getReadyToShipOrders(e){return this.httpService.post(M.GetToShip,e).pipe(j(t=>t?.Data))}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac})}}return n})();var Ke=(()=>{class n{constructor(){this.httpService=c(G)}getShippingOptions(e,t){return this.httpService.post(M.GetTiktokShippingOptions,{OrderNumber:e,ShopID:t}).pipe(j(i=>this.formatDatePickUpOptions(i)))}pickupOrder(e){return this.httpService.post(M.TiktokSelectShipping,e)}dropOffOrder(e,t){let i={handover_method:"DROP_OFF",PackageID:e,ShopID:t};return this.httpService.post(M.TiktokSelectShipping,i)}formatDatePickUpOptions(e){return e?.Options?.pickup_slots&&(e.Options.pickup_slots=e?.Options?.pickup_slots.map(t=>{let i=K.convertTimestampToDate(t.start_time),l=K.convertTimestampToDate(t.end_time);return t.start_date=i,t.end_date=l,t})),e}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Ge=(()=>{class n{constructor(){this.httpService=c(G)}getShippingOptions(e,t){return this.httpService.post(M.GetShopeeShippingOptions,{OrderNumber:e,ShopID:t})}pickupOrder(e){return this.httpService.post(M.ShopeeSelectShipping,e)}dropOffOrder(e,t){let i={OrderNumber:e,ShopID:t,dropoff:{}};return this.httpService.post(M.ShopeeSelectShipping,i)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Ye=(()=>{class n{constructor(){this.shopeeShippingService=c(Ge),this.tiktokShippingService=c(Ke)}getShippingOptions(e,t,i){switch(i){case C.Shopee:return this.getShopeeShippingOptions(e,t);case C.Tiktok:return this.getTiktokShippingOptions(e,t)}}pickupOrder(e,t){switch(e.MarketType){case C.Shopee:return this.shopeeShippingService.pickupOrder(t);case C.Tiktok:return this.tiktokShippingService.pickupOrder(t)}}dropOffOrder(e,t){switch(e.MarketType){case C.Shopee:return this.shopeeShippingService.dropOffOrder(e.Number,e.ShopID);case C.Tiktok:let i=t?.Form?.information?.PackageID;return this.tiktokShippingService.dropOffOrder(i,e.ShopID)}}getShopeeShippingOptions(e,t){return this.shopeeShippingService.getShippingOptions(e,t)}getTiktokShippingOptions(e,t){return this.tiktokShippingService.getShippingOptions(e,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var nt=()=>[],ot=n=>({"td-cell-hover":n});function rt(n,g){if(n&1&&x(0,"variants-dropdown",30),n&2){let e=h().$implicit;u("variants",e==null?null:e.Variants)}}function at(n,g){if(n&1&&x(0,"variant-with-image",31),n&2){let e=h().$implicit;u("variant",e==null?null:e.Variants[0])}}function pt(n,g){if(n&1&&(o(0,"span"),a(1),r()),n&2){let e=h().$implicit;p(),B("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function lt(n,g){if(n&1){let e=w();o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"div",26)(5,"div",27)(6,"div"),x(7,"img",28),b(8,"channelImage"),r(),o(9,"div"),x(10,"order-link",29),r()(),o(11,"small"),a(12),b(13,"date"),r()()(),o(14,"td"),a(15),r(),o(16,"td"),E(17,rt,1,1,"variants-dropdown",30)(18,at,1,1,"variant-with-image",31),r(),o(19,"td",32),a(20),b(21,"number"),r(),o(22,"td")(23,"div",26)(24,"div",27)(25,"span"),a(26),r(),E(27,pt,2,1,"span"),r(),o(28,"small"),a(29),r()()(),o(30,"td",33)(31,"button",34),d("click",function(){let i=f(e).$implicit,l=h(2);return _(l.onSetFulfillment(i))}),a(32," Set Fulfillment "),r()()()}if(n&2){let e=g.$implicit;p(2),y(e.Outlet),p(5),u("src",Q(8,13,e==null?null:e.MarketType),ce)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),p(3),u("order",e),p(2),B(" ",I(13,15,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),p(3),y(e.Customer),p(),de(Se(20,ot,(e.Variants==null?null:e.Variants.length)>1)),p(),P((e.Variants==null?null:e.Variants.length)>1?17:18),p(3),y(Q(21,18,e.Amount)),p(6),y(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),p(),P(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?27:-1),p(2),B(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function st(n,g){if(n&1){let e=w();o(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Outlet"),r(),o(6,"th",21),a(7,"Number"),r(),o(8,"th",21),a(9,"Customer"),r(),o(10,"th"),a(11,"Items"),r(),o(12,"th",22),a(13,"Amount"),r(),o(14,"th",23),a(15,"Shipping"),r(),x(16,"th",24),r()(),o(17,"tbody"),L(18,lt,33,22,"tr",null,N),r()(),o(20,"app-custom-paginator",25),d("next",function(){f(e);let i=h();return _(i.initReadyToShip())})("previous",function(){f(e);let i=h();return _(i.initReadyToShip())}),r()()}if(n&2){let e=h(),t=ge(0);p(18),A(t),p(2),u("filter",e.filter())("totaldata",t==null?null:t.length)}}function mt(n,g){n&1&&(o(0,"div",16),x(1,"app-empty-state"),r())}var Ri=(()=>{class n{constructor(){this.readyToShipService=c(se),this.dialog=c(we),this.pickupService=c(Ye),this.toastr=c(Te),this.tokenService=c(xe),this.filter=S({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){let e=this.tokenService.getTokenValue(),t=Number(e?.orddfl??0),i=new Date,l=t===0?null:new Date(i.setDate(i.getDate()-t));this.filter.update(s=>Y(W({},s),{From:l})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.readyToShipService.getReadyToShipOrders(this.filter()).pipe(me(1))}onFilterChange(e){this.filter.update(t=>W(W({},t),e))}getOrderDefaultValue(){return this.tokenService.getTokenValue()?.orddfl??null}onSetFulfillment(e){this.pickupService.getShippingOptions(e.Number,e.ShopID,e.MarketType).pipe(pe(t=>this.dialog.open(We,{height:"400px",width:"530px",data:{options:t,channelType:e.MarketType}}).afterClosed().pipe(ae(i=>K.IsNotEmpty(i)),j(i=>({type:i,order:e,options:t}))))).subscribe(t=>{t.type=="PICK_UP"?this.onSelectPickup(t.order,t.options):this.onSelectDropOff(t.order,t.options)})}onSelectPickup(e,t){this.dialog.open(Ue,{width:"530px",data:{order:e,shippingOptions:t,channelType:e.MarketType},disableClose:!0}).afterClosed().pipe(ae(i=>K.IsNotEmpty(i)),pe(i=>this.pickupService.pickupOrder(e,i))).subscribe(()=>{this.toastr.success("Pickup order created successfully","Success"),this.initReadyToShip()})}onSelectDropOff(e,t){this.pickupService.dropOffOrder(e,t).subscribe(()=>{this.toastr.success("Drop-off order created successfully","Success"),this.initReadyToShip()})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["app-ready-to-ship"]],features:[fe([se])],decls:34,vars:12,consts:[["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","100px"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[2,"width","150px"],[2,"width","160px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(t,i){if(t&1){let l=w();ue(0),b(1,"async"),o(2,"mainpanel",0),d("onSubmit",function(){return f(l),_(i.initReadyToShip())}),T("textChange",function(m){return f(l),v(i.filter().Number,m)||(i.filter().Number=m),_(m)}),o(3,"actions")(4,"a",1),x(5,"i",2),o(6,"span"),a(7,"Order Fulfillment Display"),r()()(),o(8,"filters")(9,"div")(10,"label",3),a(11,"From/To"),r(),o(12,"channel-select-options",4),T("ngModelChange",function(m){return f(l),v(i.filter().ListChannelID,m)||(i.filter().ListChannelID=m),_(m)}),r()(),o(13,"div",5)(14,"label",3),a(15,"From/To"),r(),o(16,"div",6)(17,"datepicker",7),T("dateChange",function(m){return f(l),v(i.filter().From,m)||(i.filter().From=m),_(m)}),r()(),o(18,"div")(19,"datepicker",8),T("dateChange",function(m){return f(l),v(i.filter().To,m)||(i.filter().To=m),_(m)}),r()()(),o(20,"div",5)(21,"label",9),a(22,"Page Number"),r(),o(23,"input",10),T("ngModelChange",function(m){return f(l),v(i.filter().PageNumber,m)||(i.filter().PageNumber=m),_(m)}),r()(),o(24,"div",5)(25,"label",9),a(26,"Page Size"),r(),o(27,"input",11),T("ngModelChange",function(m){return f(l),v(i.filter().PageSize,m)||(i.filter().PageSize=m),_(m)}),r()()(),o(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),E(32,st,21,2,"div",15)(33,mt,2,0,"div",16),r()()()()()}if(t&2){let l=he(Q(1,8,i.readyToShip$)||_e(11,nt));p(2),k("text",i.filter().Number),p(10),u("multiple",!0),k("ngModel",i.filter().ListChannelID),p(5),k("date",i.filter().From),p(2),k("date",i.filter().To),p(4),k("ngModel",i.filter().PageNumber),p(4),k("ngModel",i.filter().PageSize),p(5),P(l.length>0?32:33)}},dependencies:[O,Ce,ye,z,Pe,Me,Ee,Fe,V,ke,ve,H,U,Re,Ne,Le,Ve,Ie,Ae],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]})}}return n})();export{Ri as ReadyToShipComponent};
@@ -1 +1 @@
1
- import{a as X}from"./chunk-UJJ37NMF.js";import{a as Q}from"./chunk-3NMM37H7.js";import"./chunk-BFU7VKO3.js";import{b as K}from"./chunk-L64EL5OU.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{c as Y,d as D}from"./chunk-5BSS4CVK.js";import"./chunk-CIIO2CJ6.js";import{a as J}from"./chunk-ZIYN2SNO.js";import"./chunk-M5XGP4SG.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-CMTBBXR5.js";import{h as $}from"./chunk-YGEKAO5R.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as G,e as W}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as H,m as q,n as z}from"./chunk-CLER2MX6.js";import{A as k,c as B,h as O,m as U,o as j}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as R,j as L,m as x,n as A}from"./chunk-M2FCTYGU.js";import{$c as _,G as V,Gb as N,Gc as g,Kc as S,Lc as v,Mb as f,Mc as y,Qc as E,Yb as u,Z as T,ad as C,ea as F,ic as a,jc as p,kc as I,oc as b,pa as M,rb as d,tc as P,uc as o,xb as h,ya as s,za as l}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function Z(r,w){if(r&1){let e=b();a(0,"button",15),P("click",function(){s(e);let t=o().ngIf,n=o(2);return l(n.onUpdateItems(t))}),I(1,"i",16),g(2," Update "),p()}}function ee(r,w){if(r&1&&(a(0,"div"),f(1,Z,3,0,"button",14),p()),r&2){let e=w.ngIf,i=o(2);d(),u("ngIf",i.productService.hasSelectionVariant(e))}}function te(r,w){if(r&1){let e=b();a(0,"mainpanel",1),P("onSubmit",function(t){s(e);let n=o();return l(n.onSearch(t))}),a(1,"actions")(2,"div",2),f(3,ee,2,1,"div",3),_(4,"async"),a(5,"button",4),P("click",function(){s(e);let t=o();return l(t.openExportDialog())}),I(6,"i",5),a(7,"span"),g(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),g(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),l(t)}),p()(),a(14,"div",8)(15,"label",6),g(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),l(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),_(23,"async"),P("onToggle",function(t){s(e);let n=o();return l(n.onShowDifferencePrice(t))})("onSubmit",function(t){s(e);let n=o();return l(n.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),_(25,"async"),P("onNextPage",function(){s(e);let t=o();return l(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(e);let t=o();return l(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(e);let t=o();return l(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let e=o();u("textButton","Search"),d(3),u("ngIf",C(4,14,e.data$)),d(10),S("ngModel",e.searchFilter.PageNumber),d(4),S("ngModel",e.searchFilter.RowCount),d(5),u("showProductToggle",!0)("data",C(23,16,e.data$))("channel",e.channelOptions)("hiddenIPOSInventory",!1),d(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",C(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var be=(()=>{class r{constructor(e,i,t,n,m,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=m,this.decimalPipe=c,this.infinitePagination=M(D),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(F(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let n=i.map(c=>({ID:c.ID,Code:c.Code,Price:c.UnitPrice}));var t=this.channelOptions.filter(c=>c.selected).map(c=>c.ID);let m={ListChannelID:t,ListPrice:n};this.http.post("/api/Price/UpdateChannel",m).subscribe(c=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+m.ListPrice.length+" items in "+m.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(t=>{let n=this.productService.findChannelById(i.ID,this.channelOptions),m=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+n.Name+" to "+m,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Q,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(V(t=>t!==void 0)).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openExportDialog(){this.dialog.open(K,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||r)(h(W),h(G),h(H),h(J),h($),h(x))}}static{this.\u0275cmp=N({type:r,selectors:[["app-price-pos-channel"]],features:[E([D,x])],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,t){i&1&&(f(0,te,26,20,"mainpanel",0),_(1,"async")),i&2&&u("ngIf",C(1,1,t.loader$))},dependencies:[A,R,L,k,B,j,O,U,Y,z,q,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{be as PricePosChannelComponent};
1
+ import{a as X}from"./chunk-2OVYEC6Q.js";import{a as Q}from"./chunk-3NMM37H7.js";import"./chunk-BFU7VKO3.js";import{b as K}from"./chunk-L64EL5OU.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{c as Y,d as D}from"./chunk-5BSS4CVK.js";import"./chunk-CIIO2CJ6.js";import{a as J}from"./chunk-LOBNKJGT.js";import"./chunk-M5XGP4SG.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-CMTBBXR5.js";import{h as $}from"./chunk-UG7VRDLB.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as G,e as W}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as H,m as q,n as z}from"./chunk-CLER2MX6.js";import{A as k,c as B,h as O,m as U,o as j}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as R,j as L,m as x,n as A}from"./chunk-M2FCTYGU.js";import{$c as _,G as V,Gb as N,Gc as g,Kc as S,Lc as v,Mb as f,Mc as y,Qc as E,Yb as u,Z as T,ad as C,ea as F,ic as a,jc as p,kc as I,oc as b,pa as M,rb as d,tc as P,uc as o,xb as h,ya as s,za as l}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function Z(r,w){if(r&1){let e=b();a(0,"button",15),P("click",function(){s(e);let t=o().ngIf,n=o(2);return l(n.onUpdateItems(t))}),I(1,"i",16),g(2," Update "),p()}}function ee(r,w){if(r&1&&(a(0,"div"),f(1,Z,3,0,"button",14),p()),r&2){let e=w.ngIf,i=o(2);d(),u("ngIf",i.productService.hasSelectionVariant(e))}}function te(r,w){if(r&1){let e=b();a(0,"mainpanel",1),P("onSubmit",function(t){s(e);let n=o();return l(n.onSearch(t))}),a(1,"actions")(2,"div",2),f(3,ee,2,1,"div",3),_(4,"async"),a(5,"button",4),P("click",function(){s(e);let t=o();return l(t.openExportDialog())}),I(6,"i",5),a(7,"span"),g(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),g(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),l(t)}),p()(),a(14,"div",8)(15,"label",6),g(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),l(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),_(23,"async"),P("onToggle",function(t){s(e);let n=o();return l(n.onShowDifferencePrice(t))})("onSubmit",function(t){s(e);let n=o();return l(n.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),_(25,"async"),P("onNextPage",function(){s(e);let t=o();return l(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(e);let t=o();return l(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(e);let t=o();return l(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let e=o();u("textButton","Search"),d(3),u("ngIf",C(4,14,e.data$)),d(10),S("ngModel",e.searchFilter.PageNumber),d(4),S("ngModel",e.searchFilter.RowCount),d(5),u("showProductToggle",!0)("data",C(23,16,e.data$))("channel",e.channelOptions)("hiddenIPOSInventory",!1),d(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",C(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var be=(()=>{class r{constructor(e,i,t,n,m,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=m,this.decimalPipe=c,this.infinitePagination=M(D),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(F(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let n=i.map(c=>({ID:c.ID,Code:c.Code,Price:c.UnitPrice}));var t=this.channelOptions.filter(c=>c.selected).map(c=>c.ID);let m={ListChannelID:t,ListPrice:n};this.http.post("/api/Price/UpdateChannel",m).subscribe(c=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+m.ListPrice.length+" items in "+m.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(t=>{let n=this.productService.findChannelById(i.ID,this.channelOptions),m=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+n.Name+" to "+m,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Q,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(V(t=>t!==void 0)).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openExportDialog(){this.dialog.open(K,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||r)(h(W),h(G),h(H),h(J),h($),h(x))}}static{this.\u0275cmp=N({type:r,selectors:[["app-price-pos-channel"]],features:[E([D,x])],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,t){i&1&&(f(0,te,26,20,"mainpanel",0),_(1,"async")),i&2&&u("ngIf",C(1,1,t.loader$))},dependencies:[A,R,L,k,B,j,O,U,Y,z,q,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{be as PricePosChannelComponent};