marketplacepos 5.46.3 → 5.46.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/Marketplace/3rdpartylicenses.txt +43 -43
  2. package/Marketplace/{chunk-PQQSREEC.js → chunk-3PPLPXAX.js} +2 -2
  3. package/Marketplace/chunk-4BWA3J6V.js +1 -0
  4. package/Marketplace/chunk-5EDCBXCE.js +1 -0
  5. package/Marketplace/{chunk-53AH4SKO.js → chunk-5X2M3HM4.js} +1 -1
  6. package/Marketplace/{chunk-HAJDTNAW.js → chunk-5ZR5WIHG.js} +1 -1
  7. package/Marketplace/{chunk-B3RO2S3D.js → chunk-6NZJ2XKE.js} +1 -1
  8. package/Marketplace/{chunk-YIKOIRZU.js → chunk-6RCPPNMX.js} +1 -1
  9. package/Marketplace/{chunk-ER3SGZ7B.js → chunk-6WE2RKUX.js} +1 -1
  10. package/Marketplace/chunk-6YBD22SK.js +1 -0
  11. package/Marketplace/{chunk-TG5SFCNG.js → chunk-74AYYW2T.js} +1 -1
  12. package/Marketplace/{chunk-CTDSVBZQ.js → chunk-74WQHBVN.js} +1 -1
  13. package/Marketplace/{chunk-LSSYGFVV.js → chunk-774TVUXT.js} +1 -1
  14. package/Marketplace/{chunk-M7DDFDPD.js → chunk-7ES3PHES.js} +1 -1
  15. package/Marketplace/{chunk-4PL4XC3C.js → chunk-7IOOG3TG.js} +8 -8
  16. package/Marketplace/{chunk-EOYO5KJW.js → chunk-7QKEL4DD.js} +1 -1
  17. package/Marketplace/{chunk-3NCIMELL.js → chunk-7TQWJCUW.js} +1 -1
  18. package/Marketplace/{chunk-XSCE2K6J.js → chunk-AY25KXUA.js} +1 -1
  19. package/Marketplace/chunk-BVV5R6HN.js +1 -0
  20. package/Marketplace/{chunk-WIMLQM6B.js → chunk-CAK6MZUW.js} +2 -2
  21. package/Marketplace/chunk-CO5XZENC.js +1 -0
  22. package/Marketplace/{chunk-25N6ECN7.js → chunk-DRVWJPA2.js} +1 -1
  23. package/Marketplace/{chunk-GQXYHXWJ.js → chunk-DXPLB6OB.js} +1 -1
  24. package/Marketplace/chunk-EMJTQYVO.js +1 -0
  25. package/Marketplace/{chunk-BXXJEM76.js → chunk-FYB62QQV.js} +1 -1
  26. package/Marketplace/{chunk-6EMUVAZD.js → chunk-GVXBDVLX.js} +1 -1
  27. package/Marketplace/chunk-HVA57ZPZ.js +1 -0
  28. package/Marketplace/{chunk-QPC5ZTYC.js → chunk-HZPILY4V.js} +1 -1
  29. package/Marketplace/chunk-JX63Y4CW.js +1 -0
  30. package/Marketplace/{chunk-W4MTON2T.js → chunk-KEW73FTY.js} +1 -1
  31. package/Marketplace/{chunk-WBKGEDL6.js → chunk-KUYNX5QT.js} +1 -1
  32. package/Marketplace/{chunk-XSJBP4EN.js → chunk-L74PANZ5.js} +1 -1
  33. package/Marketplace/{chunk-QTTNQJAK.js → chunk-LEM7ESKJ.js} +1 -1
  34. package/Marketplace/{chunk-SBLG2UP7.js → chunk-LRBJ5RU5.js} +1 -1
  35. package/Marketplace/{chunk-V54LZUEC.js → chunk-LS2KMKMD.js} +1 -1
  36. package/Marketplace/chunk-LSWILW54.js +1 -0
  37. package/Marketplace/chunk-MACYDQHW.js +1 -0
  38. package/Marketplace/{chunk-ZC7VX6UG.js → chunk-OFEZTCJA.js} +1 -1
  39. package/Marketplace/{chunk-VHOREEP5.js → chunk-OG4QM5FO.js} +1 -1
  40. package/Marketplace/{chunk-RTF4FRXW.js → chunk-OLVWSY6L.js} +1 -1
  41. package/Marketplace/{chunk-2O4IEGGR.js → chunk-PGP3WHIS.js} +3 -3
  42. package/Marketplace/{chunk-DSAVJZIH.js → chunk-QUEDQBZU.js} +1 -1
  43. package/Marketplace/{chunk-B3HL4DNT.js → chunk-R5WARQUS.js} +1 -1
  44. package/Marketplace/chunk-RNZC6DAM.js +1 -0
  45. package/Marketplace/{chunk-E42O4ZCH.js → chunk-RT3SMV6M.js} +10 -10
  46. package/Marketplace/{chunk-JUHGMPX2.js → chunk-RUXJCVKX.js} +1 -1
  47. package/Marketplace/{chunk-EPCXMVX3.js → chunk-SXFLJBXI.js} +1 -1
  48. package/Marketplace/{chunk-6GQN3CZ7.js → chunk-U23D2EPE.js} +1 -1
  49. package/Marketplace/{chunk-CJ4F7QUO.js → chunk-UGYIOLBR.js} +1 -1
  50. package/Marketplace/{chunk-OCJXLFB4.js → chunk-UQFILVPA.js} +2 -2
  51. package/Marketplace/{chunk-XMZNTZ72.js → chunk-UQL42ODX.js} +1 -1
  52. package/Marketplace/{chunk-WHBI5II7.js → chunk-VEYUDPOA.js} +1 -1
  53. package/Marketplace/{chunk-764WEWDX.js → chunk-VIXNFSMT.js} +1 -1
  54. package/Marketplace/{chunk-ESDWGP24.js → chunk-VQIT62HE.js} +1 -1
  55. package/Marketplace/{chunk-PBHJGJHF.js → chunk-WBCI5HV5.js} +1 -1
  56. package/Marketplace/{chunk-QSERFP5U.js → chunk-WHV5AYGI.js} +1 -1
  57. package/Marketplace/{chunk-K5YVT6CU.js → chunk-WREH3C74.js} +2 -2
  58. package/Marketplace/{chunk-V33UHV5X.js → chunk-XANN3R5J.js} +1 -1
  59. package/Marketplace/{chunk-7NGIEICQ.js → chunk-XHBBUUIF.js} +1 -1
  60. package/Marketplace/index.html +2 -2
  61. package/Marketplace/{main-CVD4P432.js → main-KIV2XNXR.js} +1 -1
  62. package/package.json +1 -1
  63. package/Marketplace/chunk-6L24E3SM.js +0 -1
  64. package/Marketplace/chunk-A44LN77B.js +0 -1
  65. package/Marketplace/chunk-ACNBNSCK.js +0 -1
  66. package/Marketplace/chunk-JGKNYWZY.js +0 -1
  67. package/Marketplace/chunk-JOZJZEGN.js +0 -1
  68. package/Marketplace/chunk-MP3G42LL.js +0 -1
  69. package/Marketplace/chunk-O73TXSTZ.js +0 -1
  70. package/Marketplace/chunk-QOG52KD3.js +0 -1
  71. package/Marketplace/chunk-THMNZQLX.js +0 -1
  72. package/Marketplace/chunk-TYSVSEYQ.js +0 -1
  73. package/Marketplace/chunk-UDXV6RW2.js +0 -1
  74. package/Marketplace/chunk-VODHIYRA.js +0 -1
@@ -1 +1 @@
1
- import{a as Q}from"./chunk-THMNZQLX.js";import{a as J}from"./chunk-C7YK5TDP.js";import{a as z}from"./chunk-GHFADTRR.js";import{a as q}from"./chunk-LDL3A7NM.js";import"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as y}from"./chunk-CGOB6Y3X.js";import{e as H}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PYXL7UF7.js";import"./chunk-RXQX7567.js";import{m as Z,n as j}from"./chunk-HJXYT6MI.js";import{A as G,h as W,m as $}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as N,J as O,j as A,m as R,n as F}from"./chunk-FXQKRJWU.js";import{$c as w,Gb as b,Gc as a,Hc as g,Kc as K,Lc as P,Mb as k,Mc as T,Nc as B,Ra as D,Yb as s,Z as V,ad as v,dc as U,ec as I,gc as E,hc as L,ic as e,jc as t,kc as c,oc as x,pa as C,pb as M,rb as l,tc as S,uc as _,ya as m,za as u}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function X(o,h){if(o&1){let i=x();e(0,"img",21),S("click",function(r){m(i);let n=_().$implicit,d=_();return u(d.onZoomImage(r,n==null?null:n.ImageUrl))}),t()}if(o&2){let i=_().$implicit;s("src",i==null?null:i.ThumbnailUrl,M)}}function Y(o,h){o&1&&c(0,"img",17)}function ee(o,h){if(o&1&&(e(0,"tr")(1,"td")(2,"div",15),k(3,X,1,1,"img",16)(4,Y,1,0,"img",17),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td")(10,"div",18),c(11,"app-channel-logo",19),e(12,"span"),a(13),t()()(),e(14,"td",20),a(15),w(16,"number"),t()()),o&2){let i=h.$implicit;l(3),U(i.ImageUrl?3:4),l(3),g(i.Name),l(2),g(i.SKU),l(3),s("typeId",i.TypeID),l(2),g(i.ChannelName),l(2),g(v(16,6,i.Count))}}var xe=(()=>{class o{constructor(){this.httpService=C(H),this.biggerPictureService=C(J),this.filter=D({PageNumber:1,RowCount:20,ListChannelID:[]}),this.rowCountApi=y.GetMultilistingSKUCount,this.initMultipleListingSKU()}initMultipleListingSKU(){this.multipleListingSKU$=this.httpService.post(y.GetMultiListingSKU,this.filter()).pipe(V(1))}onZoomImage(i,p){this.biggerPictureService.openBiggerPicture(i,p)}static{this.\u0275fac=function(p){return new(p||o)}}static{this.\u0275cmp=b({type:o,selectors:[["app-duplicate-sku-v2"]],decls:33,vars:8,consts:[["headerTitle","Duplicate SKU","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/duplicate-sku",1,"d-flex","align-items-center","gap-2","btn","btn-outline-secondary","btn-lg"],[1,"fa-solid","fa-credit-card"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[2,"width","200px"],[2,"width","250px"],[1,"text-end",2,"width","50px"],[3,"next","previous","filter","totaldata","rowCountApi"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"d-flex","align-items-center"],[3,"typeId"],[1,"text-end"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"]],template:function(p,r){if(p&1){let n=x();B(0),w(1,"async"),e(2,"mainpanel",0),S("onSubmit",function(){return m(n),u(r.initMultipleListingSKU())}),e(3,"actions")(4,"a",1),c(5,"i",2),e(6,"span"),a(7,"Card View"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"channel-select-options",4),T("ngModelChange",function(f){return m(n),P(r.filter().ListChannelID,f)||(r.filter().ListChannelID=f),u(f)}),t()()(),e(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),c(20,"th",10),e(21,"th"),a(22,"Product"),t(),e(23,"th",11),a(24,"SKU"),t(),e(25,"th",12),a(26,"Channel"),t(),e(27,"th",13),a(28,"Count"),t()()(),e(29,"tbody"),E(30,ee,17,8,"tr",null,I),t()(),e(32,"app-custom-paginator",14),S("next",function(){return m(n),u(r.initMultipleListingSKU())})("previous",function(){return m(n),u(r.initMultipleListingSKU())}),t()()()()()()}if(p&2){let n=v(1,6,r.multipleListingSKU$);l(2),s("hideSearchBox",!0),l(10),s("multiple",!0),K("ngModel",r.filter().ListChannelID),l(18),L(n==null?null:n.Data),l(2),s("filter",r.filter())("totaldata",n==null||n.Data==null?null:n.Data.length)("rowCountApi",r.rowCountApi)}},dependencies:[F,A,R,j,Z,q,O,N,z,Q,G,W,$],encapsulation:2})}}return o})();export{xe as DuplicateSkuV2Component};
1
+ import{a as Q}from"./chunk-CO5XZENC.js";import"./chunk-FGRPTNDB.js";import"./chunk-3PPLPXAX.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as J}from"./chunk-C7YK5TDP.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as z}from"./chunk-GHFADTRR.js";import{a as q}from"./chunk-LDL3A7NM.js";import"./chunk-OLVWSY6L.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as y}from"./chunk-CGOB6Y3X.js";import{e as H}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import{m as Z,n as j}from"./chunk-HJXYT6MI.js";import{A as G,h as W,m as $}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as N,J as O,j as A,m as R,n as F}from"./chunk-FXQKRJWU.js";import{$c as w,Gb as b,Gc as a,Hc as g,Kc as K,Lc as P,Mb as k,Mc as T,Nc as B,Ra as D,Yb as s,Z as V,ad as v,dc as U,ec as I,gc as E,hc as L,ic as e,jc as t,kc as c,oc as x,pa as C,pb as M,rb as l,tc as _,uc as S,ya as m,za as u}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function X(o,h){if(o&1){let i=x();e(0,"img",21),_("click",function(r){m(i);let n=S().$implicit,d=S();return u(d.onZoomImage(r,n==null?null:n.ImageUrl))}),t()}if(o&2){let i=S().$implicit;s("src",i==null?null:i.ThumbnailUrl,M)}}function Y(o,h){o&1&&c(0,"img",17)}function ee(o,h){if(o&1&&(e(0,"tr")(1,"td")(2,"div",15),k(3,X,1,1,"img",16)(4,Y,1,0,"img",17),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td")(10,"div",18),c(11,"app-channel-logo",19),e(12,"span"),a(13),t()()(),e(14,"td",20),a(15),w(16,"number"),t()()),o&2){let i=h.$implicit;l(3),U(i.ImageUrl?3:4),l(3),g(i.Name),l(2),g(i.SKU),l(3),s("typeId",i.TypeID),l(2),g(i.ChannelName),l(2),g(v(16,6,i.Count))}}var xe=(()=>{class o{constructor(){this.httpService=C(H),this.biggerPictureService=C(J),this.filter=D({PageNumber:1,RowCount:20,ListChannelID:[]}),this.rowCountApi=y.GetMultilistingSKUCount,this.initMultipleListingSKU()}initMultipleListingSKU(){this.multipleListingSKU$=this.httpService.post(y.GetMultiListingSKU,this.filter()).pipe(V(1))}onZoomImage(i,p){this.biggerPictureService.openBiggerPicture(i,p)}static{this.\u0275fac=function(p){return new(p||o)}}static{this.\u0275cmp=b({type:o,selectors:[["app-duplicate-sku-v2"]],decls:33,vars:8,consts:[["headerTitle","Duplicate SKU","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/duplicate-sku",1,"d-flex","align-items-center","gap-2","btn","btn-outline-secondary","btn-lg"],[1,"fa-solid","fa-credit-card"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[2,"width","200px"],[2,"width","250px"],[1,"text-end",2,"width","50px"],[3,"next","previous","filter","totaldata","rowCountApi"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"d-flex","align-items-center"],[3,"typeId"],[1,"text-end"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"]],template:function(p,r){if(p&1){let n=x();B(0),w(1,"async"),e(2,"mainpanel",0),_("onSubmit",function(){return m(n),u(r.initMultipleListingSKU())}),e(3,"actions")(4,"a",1),c(5,"i",2),e(6,"span"),a(7,"Card View"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"app-channel-options-v2",4),T("ngModelChange",function(f){return m(n),P(r.filter().ListChannelID,f)||(r.filter().ListChannelID=f),u(f)}),t()()(),e(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),c(20,"th",10),e(21,"th"),a(22,"Product"),t(),e(23,"th",11),a(24,"SKU"),t(),e(25,"th",12),a(26,"Channel"),t(),e(27,"th",13),a(28,"Count"),t()()(),e(29,"tbody"),E(30,ee,17,8,"tr",null,I),t()(),e(32,"app-custom-paginator",14),_("next",function(){return m(n),u(r.initMultipleListingSKU())})("previous",function(){return m(n),u(r.initMultipleListingSKU())}),t()()()()()()}if(p&2){let n=v(1,6,r.multipleListingSKU$);l(2),s("hideSearchBox",!0),l(10),s("multiple",!0),K("ngModel",r.filter().ListChannelID),l(18),L(n==null?null:n.Data),l(2),s("filter",r.filter())("totaldata",n==null||n.Data==null?null:n.Data.length)("rowCountApi",r.rowCountApi)}},dependencies:[F,A,R,j,Z,q,O,N,z,Q,G,W,$],encapsulation:2})}}return o})();export{xe as DuplicateSkuV2Component};
@@ -1,4 +1,4 @@
1
- import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-BMYBLBSP.js";import{b as ie}from"./chunk-PHUHUFYL.js";import{a as X}from"./chunk-LSSYGFVV.js";import"./chunk-EHUVS2VB.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import{a as Y,b as Z}from"./chunk-WRJFUNM3.js";import"./chunk-JVNHFIYT.js";import{i as Q}from"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as J}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import{m as ee,n as te}from"./chunk-HJXYT6MI.js";import{A as q,c as G,h as z,m as K}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as W,H as j,J as $,f as x,g as V,h as A,n as H}from"./chunk-FXQKRJWU.js";import{Fc as v,Gb as C,Gc as p,Hb as k,Hc as B,Ic as L,Ka as M,Kc as O,Lc as F,Mb as m,Mc as R,Qc as P,Sc as w,Yb as l,ic as n,ja as I,jc as i,ka as T,kc as c,lc as f,mc as _,oa as U,ob as N,oc as S,rb as a,tc as y,uc as d,xb as D,ya as g,za as h}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _e=e=>[e];function ge(e,s){if(e&1&&(f(0),n(1,"a",9),p(2),i(),_()),e&2){let t=s.$implicit;a(),l("routerLink",w(2,_e,t.url)),a(),L(" ",t.title,"")}}var ce=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-download"]],standalone:!1,decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(o,r){o&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),c(3,"nav-tab",2),i()(),n(4,"div")(5,"div",3)(6,"a",4),c(7,"i",5),i(),n(8,"div",6)(9,"div",7),m(10,ge,3,4,"ng-container",8),i()()()()(),c(11,"router-outlet")),o&2&&(a(3),l("Tabs",r.tabs),a(7),l("ngForOf",r.moreMenu))},dependencies:[x,Y,W,j],encapsulation:2})}}return e})();var E=(()=>{class e{constructor(t){this.httpService=t}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(o){return new(o||e)(U(J))}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Se=e=>({"background-color":e});function Ce(e,s){if(e&1&&(n(0,"th"),p(1),i()),e&2){let t=s.$implicit;a(),B(t.column)}}function ye(e,s){if(e&1&&(f(0),n(1,"td"),c(2,"span",6),i(),_()),e&2){let t=s.$implicit,o=d().$implicit;a(2),l("innerHTML",o[t.prop],N)}}function ve(e,s){if(e&1&&(n(0,"tr",5),m(1,ye,3,1,"ng-container",3),i()),e&2){let t=s.$implicit,o=d();l("ngStyle",w(2,Se,t.Status>200?"#F4D6D5":"#DEE9C9")),a(),l("ngForOf",o.configs)}}var de=(()=>{class e{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},standalone:!1,decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(o,r){o&1&&(n(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),m(4,Ce,2,1,"th",3),i()(),n(5,"tbody"),m(6,ve,2,4,"tr",4),i()()()),o&2&&(a(4),l("ngForOf",r.configs),a(2),l("ngForOf",r.data))},dependencies:[x,A],encapsulation:2})}}return e})();function xe(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onNewStepperState(u))}),c(2,"i",16),p(3," New "),i(),_()}}function be(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t),d();let r=v(11);return h(r.previous())}),p(2," Back "),i(),_()}}function Ee(e,s){if(e&1){let t=S();f(0),n(1,"button",17),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onStepperNext(u))}),p(2," Next "),i(),_()}}function De(e,s){if(e&1){let t=S();f(0),n(1,"button",18),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onSubmit(u))}),p(2,"Download"),i(),_()}if(e&2){let t=d();a(),l("disabled",!t.urls)}}function Ie(e,s){e&1&&(c(0,"i",19),n(1,"span"),p(2,"Instruction"),i())}function Te(e,s){e&1&&(n(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),p(4,"Note"),i()(),n(5,"div",24)(6,"ol",25)(7,"li"),p(8," Use this form to Download Products from Tokopedia using product URL "),i(),n(9,"li"),p(10," Copy Product URL from "),n(11,"a",26),p(12,"https://seller.tokopedia.com/ "),i(),p(13," and paste in this form "),i(),n(14,"li"),p(15," Use New Line when you want to input several product URLs "),i()()()()())}function Ue(e,s){e&1&&(c(0,"i",27),n(1,"span"),p(2,"Download"),i())}function Me(e,s){if(e&1){let t=S();n(0,"div",20)(1,"textarea",28),R("ngModelChange",function(r){g(t);let u=d();return F(u.urls,r)||(u.urls=r),h(r)}),i()()}if(e&2){let t=d();a(),l("placeholder",t.urlPlaceholder),O("ngModel",t.urls)}}function Ne(e,s){e&1&&(c(0,"i",29),n(1,"span"),p(2,"Finish"),i())}function ke(e,s){if(e&1&&(n(0,"div",20),c(1,"app-response-api-list",30),i()),e&2){let t=d();a(),l("data",t.downloadResponses)("configs",t.configs)}}function Be(e,s){e&1&&(n(0,"h6"),p(1,"1"),i())}function Le(e,s){e&1&&(n(0,"h6"),p(1,"2"),i())}function Oe(e,s){e&1&&(n(0,"h6"),p(1,"3"),i())}var ue=(()=>{class e{constructor(t,o){this.downloadService=t,this.authService=o,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
1
+ import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-BMYBLBSP.js";import{b as ie}from"./chunk-PHUHUFYL.js";import{a as X}from"./chunk-774TVUXT.js";import"./chunk-EHUVS2VB.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import{a as Y,b as Z}from"./chunk-WRJFUNM3.js";import"./chunk-JVNHFIYT.js";import{i as Q}from"./chunk-OLVWSY6L.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as J}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import{m as ee,n as te}from"./chunk-HJXYT6MI.js";import{A as q,c as G,h as z,m as K}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as W,H as j,J as $,f as x,g as V,h as A,n as H}from"./chunk-FXQKRJWU.js";import{Fc as v,Gb as C,Gc as p,Hb as k,Hc as B,Ic as L,Ka as M,Kc as O,Lc as F,Mb as m,Mc as R,Qc as P,Sc as w,Yb as l,ic as n,ja as I,jc as i,ka as T,kc as c,lc as f,mc as _,oa as U,ob as N,oc as S,rb as a,tc as y,uc as d,xb as D,ya as g,za as h}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _e=e=>[e];function ge(e,s){if(e&1&&(f(0),n(1,"a",9),p(2),i(),_()),e&2){let t=s.$implicit;a(),l("routerLink",w(2,_e,t.url)),a(),L(" ",t.title,"")}}var ce=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-download"]],standalone:!1,decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(o,r){o&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),c(3,"nav-tab",2),i()(),n(4,"div")(5,"div",3)(6,"a",4),c(7,"i",5),i(),n(8,"div",6)(9,"div",7),m(10,ge,3,4,"ng-container",8),i()()()()(),c(11,"router-outlet")),o&2&&(a(3),l("Tabs",r.tabs),a(7),l("ngForOf",r.moreMenu))},dependencies:[x,Y,W,j],encapsulation:2})}}return e})();var E=(()=>{class e{constructor(t){this.httpService=t}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(o){return new(o||e)(U(J))}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Se=e=>({"background-color":e});function Ce(e,s){if(e&1&&(n(0,"th"),p(1),i()),e&2){let t=s.$implicit;a(),B(t.column)}}function ye(e,s){if(e&1&&(f(0),n(1,"td"),c(2,"span",6),i(),_()),e&2){let t=s.$implicit,o=d().$implicit;a(2),l("innerHTML",o[t.prop],N)}}function ve(e,s){if(e&1&&(n(0,"tr",5),m(1,ye,3,1,"ng-container",3),i()),e&2){let t=s.$implicit,o=d();l("ngStyle",w(2,Se,t.Status>200?"#F4D6D5":"#DEE9C9")),a(),l("ngForOf",o.configs)}}var de=(()=>{class e{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},standalone:!1,decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(o,r){o&1&&(n(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),m(4,Ce,2,1,"th",3),i()(),n(5,"tbody"),m(6,ve,2,4,"tr",4),i()()()),o&2&&(a(4),l("ngForOf",r.configs),a(2),l("ngForOf",r.data))},dependencies:[x,A],encapsulation:2})}}return e})();function xe(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onNewStepperState(u))}),c(2,"i",16),p(3," New "),i(),_()}}function be(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t),d();let r=v(11);return h(r.previous())}),p(2," Back "),i(),_()}}function Ee(e,s){if(e&1){let t=S();f(0),n(1,"button",17),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onStepperNext(u))}),p(2," Next "),i(),_()}}function De(e,s){if(e&1){let t=S();f(0),n(1,"button",18),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onSubmit(u))}),p(2,"Download"),i(),_()}if(e&2){let t=d();a(),l("disabled",!t.urls)}}function Ie(e,s){e&1&&(c(0,"i",19),n(1,"span"),p(2,"Instruction"),i())}function Te(e,s){e&1&&(n(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),p(4,"Note"),i()(),n(5,"div",24)(6,"ol",25)(7,"li"),p(8," Use this form to Download Products from Tokopedia using product URL "),i(),n(9,"li"),p(10," Copy Product URL from "),n(11,"a",26),p(12,"https://seller.tokopedia.com/ "),i(),p(13," and paste in this form "),i(),n(14,"li"),p(15," Use New Line when you want to input several product URLs "),i()()()()())}function Ue(e,s){e&1&&(c(0,"i",27),n(1,"span"),p(2,"Download"),i())}function Me(e,s){if(e&1){let t=S();n(0,"div",20)(1,"textarea",28),R("ngModelChange",function(r){g(t);let u=d();return F(u.urls,r)||(u.urls=r),h(r)}),i()()}if(e&2){let t=d();a(),l("placeholder",t.urlPlaceholder),O("ngModel",t.urls)}}function Ne(e,s){e&1&&(c(0,"i",29),n(1,"span"),p(2,"Finish"),i())}function ke(e,s){if(e&1&&(n(0,"div",20),c(1,"app-response-api-list",30),i()),e&2){let t=d();a(),l("data",t.downloadResponses)("configs",t.configs)}}function Be(e,s){e&1&&(n(0,"h6"),p(1,"1"),i())}function Le(e,s){e&1&&(n(0,"h6"),p(1,"2"),i())}function Oe(e,s){e&1&&(n(0,"h6"),p(1,"3"),i())}var ue=(()=>{class e{constructor(t,o){this.downloadService=t,this.authService=o,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
2
2
  https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(t){this.stepperState=t.selectedStep.state}onSubmit(t){let o=this.urls.split(/\r?\n/);this.downloadService.download(o).subscribe(r=>{this.downloadResponses=r,this.mappingLinkToProduct(),this.onStepperNext(t)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(t=>(t.Name=t?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${t.ID}" target="_blank">
3
3
  ${t?.Name}
4
4
  </a>`:"-",t))}onNewStepperState(t){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",t.reset(),this.onStepperNext(t)}onStepperNext(t){t.selected.completed=!0,t.next()}static{this.\u0275fac=function(o){return new(o||e)(D(E),D(Q))}}static{this.\u0275cmp=C({type:e,selectors:[["app-by-url"]],standalone:!1,features:[P([{provide:ne,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(o,r){if(o&1){let u=S();n(0,"mainpanel",1)(1,"actions"),m(2,xe,4,0,"ng-container",2)(3,be,3,0,"ng-container",2)(4,Ee,3,0,"ng-container",2)(5,De,3,1,"ng-container",2),i(),n(6,"content")(7,"div",3)(8,"div",4)(9,"div",5)(10,"mat-stepper",6,0),y("selectionChange",function(fe){return g(u),h(r.onStepperChange(fe))}),n(12,"mat-step",7),m(13,Ie,3,0,"ng-template",8)(14,Te,16,0,"ng-template",9),i(),n(15,"mat-step",10),m(16,Ue,3,0,"ng-template",8)(17,Me,2,2,"ng-template",9),i(),n(18,"mat-step",11),m(19,Ne,3,0,"ng-template",8)(20,ke,2,2,"ng-template",9),i(),m(21,Be,2,0,"ng-template",12)(22,Le,2,0,"ng-template",13)(23,Oe,2,0,"ng-template",14),i()()()()()()}o&2&&(l("hideSearchBox",!0)("hideSearchDropdown",!0),a(2),l("ngIf",r.stepperState=="FINISH"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(),l("ngIf",r.stepperState=="GUIDE"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(5),l("selectedIndex",1),a(2),l("editable",r.stepperState!="FINISH")("completed",!0),a(3),l("editable",r.stepperState!="FINISH")("completed",!1))},dependencies:[V,G,z,K,ee,le,oe,pe,re,ae,de],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-EHBCYQSG.js";import{b as ze}from"./chunk-GRYGUILI.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as Ze}from"./chunk-QTTNQJAK.js";import"./chunk-IITU3NV6.js";import{a as ee}from"./chunk-XHAXYWZ7.js";import{a as Ge,b as Ye,c as Ke,d as J,e as te}from"./chunk-TKV7XWBT.js";import{a as Qe,b as He}from"./chunk-YTCIQBSO.js";import"./chunk-2O4IEGGR.js";import"./chunk-VFATXJRG.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-RHHHL4OR.js";import{a as We}from"./chunk-M7DDFDPD.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as q}from"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as Ue,b as Be,c as $e}from"./chunk-GHVAGYK3.js";import"./chunk-JVNHFIYT.js";import{a as je}from"./chunk-C7YK5TDP.js";import"./chunk-HAJDTNAW.js";import"./chunk-ACIMXBIC.js";import{i as Te}from"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as X}from"./chunk-CGOB6Y3X.js";import{b as ve,e as Ie}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{e as De}from"./chunk-PYXL7UF7.js";import{c as f}from"./chunk-RXQX7567.js";import{b as Me,c as Ve,d as ke,j as Re,k as Le,l as Ne,m as Ae,n as Oe}from"./chunk-HJXYT6MI.js";import{A as ye,b as Ce,c as ge,h as fe,m as xe,o as Se}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as we,b as be,c as Fe}from"./chunk-ERXVXBTU.js";import{r as Pe,s as Ee}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ue,J as he,d as me,g as de,j as $,k as W,m as _e,n as j}from"./chunk-FXQKRJWU.js";import{$c as g,Fc as K,G as Q,Gb as U,Gc as c,Hc as O,Ic as I,Kc as b,Lc as F,Mb as h,Mc as T,Nc as re,Oc as se,Pc as ce,Qc as B,Ra as V,Rc as pe,Sc as M,Yb as m,Z as N,ac as ae,ad as y,bd as k,cd as Z,dc as v,ea as H,ec as z,gc as G,hc as Y,ic as a,jc as l,kc as x,lc as P,mc as E,oc as S,pa as w,pb as A,rb as s,tc as C,uc as r,v as L,xb as D,xc as le,ya as d,za as _}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as oe}from"./chunk-66YHNWRR.js";var tt=()=>["/menu/order/download"];function nt(n,p){if(n&1&&(a(0,"li",4)(1,"div"),c(2," The last time you manually download your order is on "),a(3,"span",8),c(4),g(5,"date"),l()(),a(6,"div",9),c(7),l()()),n&2){r();let e=ce(0);s(4),I(" ",k(5,2,e==null?null:e.OrderDownloadLatestOn,"dd MMM yyyy HH:mm")," "),s(3),I("(",e==null?null:e.calculatedDate,")")}}function it(n,p){n&1&&(a(0,"li",4),c(1," The last time you manually download your order is on (-) "),l())}var qe=(()=>{class n{constructor(){this.dialogRef=w(Me),this.data=w(Ve),this.modalConfig=new Re,this.inventoryService=w(R),this.lastDownloadInfo$=this.inventoryService.getLastInfoDownloadInventory(this.data.channelId).pipe(L(e=>{let o=e.OrderDownloadLatestOn!=f.MinDate,t=null,i=null;return o&&(t=new Date(e.OrderDownloadLatestOn),i=f.convertToReadableDate(t)),{OrderDownloadLatestOn:t,calculatedDate:i}}),N(1)),this.selectedProducts=V(this.data.selectedProducts||[]),this.modalConfig.title="Manual Inventory Sync",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}onUpdate(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=U({type:n,selectors:[["app-dialog-update-product-info"]],features:[B([R])],decls:16,vars:8,consts:[[3,"onCancel","config"],["content",""],[1,"container"],[1,"mt-8"],[1,"lh-base"],["footer",""],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","routerLink"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","keyup.F2"],[1,"fw-bold","me-1"],[1,"fw-bold"]],template:function(o,t){if(o&1){let i=S();re(0),g(1,"async"),a(2,"modal-material",0),C("onCancel",function(){return d(i),_(t.onCancel())}),a(3,"div",1)(4,"div",2)(5,"h4"),c(6),l(),a(7,"div",3)(8,"ul"),h(9,nt,8,5,"li",4)(10,it,2,0,"li",4),l()()()(),a(11,"div",5)(12,"a",6),C("click",function(){return d(i),_(t.onCancel())}),c(13," Download "),l(),a(14,"button",7),C("click",function(){return d(i),_(t.onUpdate())})("keyup.F2",function(){return d(i),_(t.onUpdate())}),c(15," Update Anyway "),l()()()}if(o&2){let i=se(y(1,4,t.lastDownloadInfo$));s(2),m("config",t.modalConfig),s(4),I("",t.selectedProducts().length," Product(s) will be updated."),s(3),v(i!=null&&i.OrderDownloadLatestOn?9:10),s(3),m("routerLink",pe(7,tt))}},dependencies:[Le,j,$,W,he,ue],encapsulation:2})}}return n})();var ne=n=>[n],ot=n=>({"text-decoration-line-through":n}),at=n=>({"me-10":n}),lt=n=>({"bg-gradient-warning":n}),rt=n=>({cursor:n});function st(n,p){if(n&1){let e=S();a(0,"button",39),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onScanInventory(t))}),x(1,"i",40),c(2,"Refresh "),l()}}function ct(n,p){if(n&1){let e=S();a(0,"div",37)(1,"button",41),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onOpenDialogUpdateStockInfo(t))}),x(2,"i",42),c(3," Update "),l(),x(4,"button",43),a(5,"ul",44)(6,"a",45),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(7,"i",46),a(8,"span"),c(9,"Export"),l()()()()}}function pt(n,p){if(n&1){let e=S();a(0,"button",47),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(1,"i",46),a(2,"span"),c(3,"Export"),l()()}}function mt(n,p){if(n&1&&(a(0,"div"),h(1,st,3,0,"button",36)(2,ct,10,0,"div",37)(3,pt,4,0,"button",38),l()),n&2){let e=p.ngIf,o=r(2);s(),m("ngIf",o.productService.hasSelectionVariant(e)),s(),v(o.productService.hasSelectionVariant(e)?2:3)}}function dt(n,p){n&1&&(a(0,"div",48)(1,"span"),c(2," showing only different stock, please press next to populate more data "),l()())}function _t(n,p){if(n&1){let e=S();a(0,"th")(1,"input",49),T("ngModelChange",function(t){d(e);let i=r(3);return F(i.checkboxState,t)||(i.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=d(e).ngIf,i=r(3);return _(i.onCheckboxStateChange(t))}),l()()}if(n&2){let e=r(3);s(),b("ngModel",e.checkboxState)}}function ut(n,p){if(n&1&&(P(0),h(1,_t,2,1,"th",5),g(2,"async"),E()),n&2){let e=r(2);s(),m("ngIf",y(2,1,e.products$))}}function ht(n,p){n&1&&(a(0,"th",33),c(1," Reserved "),l())}function Ct(n,p){if(n&1){let e=S();a(0,"input",65),T("ngModelChange",function(t){d(e);let i=r(4).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),C("ngModelChange",function(){d(e);let t=r(4).$implicit,i=r(2);return _(i.onCheckboxStateProduct(t))}),l()}if(n&2){let e=r(4).$implicit;b("ngModel",e.selected)}}function gt(n,p){if(n&1&&(P(0),a(1,"div",63),h(2,Ct,1,1,"input",64),l(),E()),n&2){let e=r(3).$implicit;s(),m("ngClass",M(2,at,e.Variants.length<=1)),s(),v(e.Variants.length>1?2:-1)}}function ft(n,p){if(n&1){let e=S();a(0,"img",66),C("click",function(t){d(e);let i=r(3).$implicit,u=r(2);return _(u.onZoomImage(t,i==null?null:i.ImageUrl))}),l()}if(n&2){let e=r(3).$implicit;le("src",e==null?null:e.ThumbnailUrl,A)}}function xt(n,p){n&1&&x(0,"img",60)}function St(n,p){if(n&1&&(x(0,"br"),a(1,"div",67),x(2,"i",68),a(3,"small"),c(4),l()()),n&2){let e=r(3).$implicit;s(4),I("(",e==null?null:e.Category,")")}}function yt(n,p){if(n&1&&(a(0,"td",58)(1,"div",14),h(2,gt,3,4,"ng-container",27),a(3,"div"),h(4,ft,1,1,"img",59)(5,xt,1,0,"img",60),l()()(),a(6,"td",61)(7,"span",62),c(8),l(),h(9,St,5,1),l()),n&2){let e=r(2).$implicit,o=r(2);m("rowSpan",e==null?null:e.Variants.length),s(2),m("ngxPermissionsOnly",M(6,ne,o.inventoryUpdateRole)),s(2),v(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),O(e==null?null:e.Name),s(),v(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function vt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(3).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(3).$implicit;b("ngModel",e.selected)}}function It(n,p){if(n&1&&h(0,vt,1,1,"input",70),n&2){let e=r(2).$implicit;v((e==null?null:e.Inventory)<=1e5?0:-1)}}function wt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(2).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(2).$implicit;b("ngModel",e.selected)}}function bt(n,p){if(n&1&&(P(0),a(1,"td",69),h(2,It,1,1)(3,wt,1,1,"input",70),l(),E()),n&2){let e=r().$implicit;s(2),v((e==null?null:e.Channel[0].TypeID)==1?2:(e==null?null:e.Inventory)>=0?3:-1)}}function Ft(n,p){n&1&&(a(0,"div",71),c(1," Not Found "),l())}function Tt(n,p){if(n&1&&(a(0,"div")(1,"span",72),c(2),g(3,"number"),l(),c(4," => "),a(5,"span",73),c(6),g(7,"number"),l()()),n&2){let e=r().$implicit;s(2),I(" ",y(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),O(y(7,4,e==null?null:e.Inventory))}}function Dt(n,p){if(n&1&&(c(0),g(1,"number")),n&2){let e=r().$implicit;I(" ",y(1,1,e==null?null:e.Inventory)," ")}}function Pt(n,p){if(n&1&&(P(0),a(1,"div",74)(2,"a",75),x(3,"i",76),l()(),E()),n&2){let e=r().$implicit,o=r(3);s(2),m("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),A)}}function Et(n,p){if(n&1){let e=S();a(0,"span",81),C("click",function(){d(e);let t=r(2).$implicit,i=r().$implicit,u=r(2);return _(u.openTableDialog(i,t))}),c(1),g(2,"number"),l()}if(n&2){let e=r(2).$implicit,o=r(3);ae(M(5,rt,o.hasInventoryEdit())),s(),I(" ",y(2,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function Mt(n,p){if(n&1){let e=S();a(0,"td",77)(1,"div",53)(2,"div"),h(3,Et,3,7,"span",78),g(4,"async"),l(),a(5,"div",74)(6,"a",75),x(7,"i",76),l()(),a(8,"div",74)(9,"span",79),C("click",function(){d(e);let t=r().$implicit,i=r(3);return _(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",80),l()()()()}if(n&2){let e=r().$implicit,o=r(3);m("ngClass",M(5,lt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",y(4,3,o.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,A)}}function Vt(n,p){if(n&1&&(P(0),a(1,"span",82),c(2),g(3,"number"),l(),E()),n&2){let e=r(2).$implicit;s(2),I(" (",y(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function kt(n,p){n&1&&c(0," - ")}function Rt(n,p){if(n&1&&(P(0),a(1,"td",51),h(2,Vt,4,3,"ng-container",57)(3,kt,1,0,"ng-template",null,1,Z),l(),E()),n&2){let e=K(4),o=r().$implicit;s(2),m("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function Lt(n,p){n&1&&(P(0),c(1," - "),E())}function Nt(n,p){if(n&1&&(a(0,"span",83),g(1,"date"),c(2),g(3,"date"),l()),n&2){let e=r().$implicit;m("matTooltip",k(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",k(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function At(n,p){if(n&1&&(a(0,"tr"),h(1,yt,10,8),a(2,"td",50),c(3),l(),a(4,"td",51)(5,"span",52),c(6),l()(),h(7,bt,4,1,"ng-container",27),a(8,"td")(9,"div",53),h(10,Ft,2,0,"div",54)(11,Tt,8,6,"div")(12,Dt,2,3)(13,Pt,4,1,"ng-container",5),l()(),h(14,Mt,11,7,"td",55)(15,Rt,5,2,"ng-container",5),a(16,"td",56),h(17,Lt,2,0,"ng-container",57)(18,Nt,4,8,"ng-template",null,0,Z),l()()),n&2){let e=p.$implicit,o=p.$index,t=K(19),i=r(3);s(),v(o==0?1:-1),s(2),O(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",M(14,ot,e.Discontinued)),s(),O(e==null?null:e.Code),s(),m("ngxPermissionsOnly",M(16,ne,i.inventoryUpdateRole)),s(3),m("ngIf",(e==null?null:e.I)==null),s(),v((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?11:-1),s(),v((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?12:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function Ot(n,p){if(n&1&&(a(0,"tbody"),G(1,At,20,18,"tr",null,z),l()),n&2){let e=p.$implicit;s(),Y(e.Variants)}}function Ut(n,p){if(n&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){d(e);let i=r();return _(i.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,mt,4,2,"div",5),g(4,"async"),l()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),l(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){d(e);let i=r();return _(i.onChannelChange(t))}),l()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),l(),a(13,"input",10),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),_(t)}),l()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),l(),a(17,"input",12),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),_(t)}),l()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),l(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),_(t)}),l(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),_(t)}),l()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,dt,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){d(e);let i=r();return _(i.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){d(e);let t=r();return t.showDifferenceStock=!t.showDifferenceStock,_(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),l()()(),a(39,"th",25),c(40,"Variant"),l(),a(41,"th",26),c(42,"SKU"),l(),h(43,ut,3,3,"ng-container",27),a(44,"th",28),c(45," POS "),l(),a(46,"th",29)(47,"div",30),C("click",function(){d(e);let t=r();return _(t.openModalFilter())}),x(48,"img",31),a(49,"span",32),c(50),g(51,"stringLimit"),l()()(),h(52,ht,2,0,"th",33),a(53,"th",34),c(54,"Last Sync"),l()()(),G(55,Ot,3,0,"tbody",null,z),g(57,"async"),l(),a(58,"infinite-paginator",35),g(59,"async"),C("onNextPage",function(){d(e);let t=r();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){d(e);let t=r();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){d(e);let t=r();return _(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()()()()}if(n&2){let e,o,t,i=r();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",y(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngxPermissionsOnly",M(30,ne,i.inventoryUpdateRole)),s(4),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(o=i.channelIdentity())==null?null:o.img,A),s(2),I(" ",k(51,23,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),v(i.isShowReservedColumn?52:-1),s(3),Y(y(57,26,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",y(59,28,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var An=(()=>{class n{constructor(e,o,t,i,u,ie,Xe){this.http=e,this.toastr=o,this.dialog=t,this.productService=i,this.authService=u,this.biggerPictureService=ie,this.mainPanelService=Xe,this.infinitePagination=w(J),this.ngxPermissionsService=w(we),this.updateResHandling=w(te),this.inventoryService=w(R),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,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.guidEmpty=f.GuidEMpty,this.selectedChannel=V(null),this.channelIdentity=V({img:null,label:null}),this.inventoryUpdateRole=q.InventoryUpdate,this.hasInventoryEdit=V(!0),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.initRoles(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe(H(e=>{this.checkShowReservedColumn(e)}),L(e=>(e=this.calculateAvailableStock(e),e)),N(1)),this.products$=this.sourceObs$}initRoles(){this.ngxPermissionsService.hasPermission(q.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e))}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((i,u)=>(i+=u.I?.Available||0,i),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(i=>{t=i.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(N(1),H(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
1
+ import{a as R}from"./chunk-EHBCYQSG.js";import{b as ze}from"./chunk-GRYGUILI.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as Ze}from"./chunk-LEM7ESKJ.js";import"./chunk-IITU3NV6.js";import{a as ee}from"./chunk-XHAXYWZ7.js";import{a as Ge,b as Ye,c as Ke,d as J,e as te}from"./chunk-TKV7XWBT.js";import{a as Qe,b as He}from"./chunk-YTCIQBSO.js";import"./chunk-PGP3WHIS.js";import"./chunk-VFATXJRG.js";import"./chunk-RHHHL4OR.js";import{a as We}from"./chunk-7ES3PHES.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as q}from"./chunk-UMP6ZMEJ.js";import{a as Ue,b as Be,c as $e}from"./chunk-GHVAGYK3.js";import"./chunk-JVNHFIYT.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as je}from"./chunk-C7YK5TDP.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-5ZR5WIHG.js";import"./chunk-ACIMXBIC.js";import{e as De}from"./chunk-PYXL7UF7.js";import{i as Te}from"./chunk-OLVWSY6L.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as X}from"./chunk-CGOB6Y3X.js";import{b as ve,e as Ie}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as f}from"./chunk-RXQX7567.js";import{b as Me,c as Ve,d as ke,j as Re,k as Le,l as Ne,m as Ae,n as Oe}from"./chunk-HJXYT6MI.js";import{A as ye,b as Ce,c as ge,h as fe,m as xe,o as Se}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as we,b as be,c as Fe}from"./chunk-ERXVXBTU.js";import{r as Pe,s as Ee}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ue,J as he,d as me,g as de,j as $,k as W,m as _e,n as j}from"./chunk-FXQKRJWU.js";import{$c as g,Fc as K,G as Q,Gb as U,Gc as c,Hc as O,Ic as I,Kc as b,Lc as F,Mb as h,Mc as T,Nc as re,Oc as se,Pc as ce,Qc as B,Ra as V,Rc as pe,Sc as M,Yb as m,Z as N,ac as ae,ad as y,bd as k,cd as Z,dc as v,ea as H,ec as z,gc as G,hc as Y,ic as a,jc as l,kc as x,lc as P,mc as E,oc as S,pa as w,pb as A,rb as s,tc as C,uc as r,v as L,xb as D,xc as le,ya as d,za as _}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as oe}from"./chunk-66YHNWRR.js";var tt=()=>["/menu/order/download"];function nt(n,p){if(n&1&&(a(0,"li",4)(1,"div"),c(2," The last time you manually download your order is on "),a(3,"span",8),c(4),g(5,"date"),l()(),a(6,"div",9),c(7),l()()),n&2){r();let e=ce(0);s(4),I(" ",k(5,2,e==null?null:e.OrderDownloadLatestOn,"dd MMM yyyy HH:mm")," "),s(3),I("(",e==null?null:e.calculatedDate,")")}}function it(n,p){n&1&&(a(0,"li",4),c(1," The last time you manually download your order is on (-) "),l())}var qe=(()=>{class n{constructor(){this.dialogRef=w(Me),this.data=w(Ve),this.modalConfig=new Re,this.inventoryService=w(R),this.lastDownloadInfo$=this.inventoryService.getLastInfoDownloadInventory(this.data.channelId).pipe(L(e=>{let o=e.OrderDownloadLatestOn!=f.MinDate,t=null,i=null;return o&&(t=new Date(e.OrderDownloadLatestOn),i=f.convertToReadableDate(t)),{OrderDownloadLatestOn:t,calculatedDate:i}}),N(1)),this.selectedProducts=V(this.data.selectedProducts||[]),this.modalConfig.title="Manual Inventory Sync",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}onUpdate(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=U({type:n,selectors:[["app-dialog-update-product-info"]],features:[B([R])],decls:16,vars:8,consts:[[3,"onCancel","config"],["content",""],[1,"container"],[1,"mt-8"],[1,"lh-base"],["footer",""],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","routerLink"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","keyup.F2"],[1,"fw-bold","me-1"],[1,"fw-bold"]],template:function(o,t){if(o&1){let i=S();re(0),g(1,"async"),a(2,"modal-material",0),C("onCancel",function(){return d(i),_(t.onCancel())}),a(3,"div",1)(4,"div",2)(5,"h4"),c(6),l(),a(7,"div",3)(8,"ul"),h(9,nt,8,5,"li",4)(10,it,2,0,"li",4),l()()()(),a(11,"div",5)(12,"a",6),C("click",function(){return d(i),_(t.onCancel())}),c(13," Download "),l(),a(14,"button",7),C("click",function(){return d(i),_(t.onUpdate())})("keyup.F2",function(){return d(i),_(t.onUpdate())}),c(15," Update Anyway "),l()()()}if(o&2){let i=se(y(1,4,t.lastDownloadInfo$));s(2),m("config",t.modalConfig),s(4),I("",t.selectedProducts().length," Product(s) will be updated."),s(3),v(i!=null&&i.OrderDownloadLatestOn?9:10),s(3),m("routerLink",pe(7,tt))}},dependencies:[Le,j,$,W,he,ue],encapsulation:2})}}return n})();var ne=n=>[n],ot=n=>({"text-decoration-line-through":n}),at=n=>({"me-10":n}),lt=n=>({"bg-gradient-warning":n}),rt=n=>({cursor:n});function st(n,p){if(n&1){let e=S();a(0,"button",39),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onScanInventory(t))}),x(1,"i",40),c(2,"Refresh "),l()}}function ct(n,p){if(n&1){let e=S();a(0,"div",37)(1,"button",41),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onOpenDialogUpdateStockInfo(t))}),x(2,"i",42),c(3," Update "),l(),x(4,"button",43),a(5,"ul",44)(6,"a",45),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(7,"i",46),a(8,"span"),c(9,"Export"),l()()()()}}function pt(n,p){if(n&1){let e=S();a(0,"button",47),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(1,"i",46),a(2,"span"),c(3,"Export"),l()()}}function mt(n,p){if(n&1&&(a(0,"div"),h(1,st,3,0,"button",36)(2,ct,10,0,"div",37)(3,pt,4,0,"button",38),l()),n&2){let e=p.ngIf,o=r(2);s(),m("ngIf",o.productService.hasSelectionVariant(e)),s(),v(o.productService.hasSelectionVariant(e)?2:3)}}function dt(n,p){n&1&&(a(0,"div",48)(1,"span"),c(2," showing only different stock, please press next to populate more data "),l()())}function _t(n,p){if(n&1){let e=S();a(0,"th")(1,"input",49),T("ngModelChange",function(t){d(e);let i=r(3);return F(i.checkboxState,t)||(i.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=d(e).ngIf,i=r(3);return _(i.onCheckboxStateChange(t))}),l()()}if(n&2){let e=r(3);s(),b("ngModel",e.checkboxState)}}function ut(n,p){if(n&1&&(P(0),h(1,_t,2,1,"th",5),g(2,"async"),E()),n&2){let e=r(2);s(),m("ngIf",y(2,1,e.products$))}}function ht(n,p){n&1&&(a(0,"th",33),c(1," Reserved "),l())}function Ct(n,p){if(n&1){let e=S();a(0,"input",65),T("ngModelChange",function(t){d(e);let i=r(4).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),C("ngModelChange",function(){d(e);let t=r(4).$implicit,i=r(2);return _(i.onCheckboxStateProduct(t))}),l()}if(n&2){let e=r(4).$implicit;b("ngModel",e.selected)}}function gt(n,p){if(n&1&&(P(0),a(1,"div",63),h(2,Ct,1,1,"input",64),l(),E()),n&2){let e=r(3).$implicit;s(),m("ngClass",M(2,at,e.Variants.length<=1)),s(),v(e.Variants.length>1?2:-1)}}function ft(n,p){if(n&1){let e=S();a(0,"img",66),C("click",function(t){d(e);let i=r(3).$implicit,u=r(2);return _(u.onZoomImage(t,i==null?null:i.ImageUrl))}),l()}if(n&2){let e=r(3).$implicit;le("src",e==null?null:e.ThumbnailUrl,A)}}function xt(n,p){n&1&&x(0,"img",60)}function St(n,p){if(n&1&&(x(0,"br"),a(1,"div",67),x(2,"i",68),a(3,"small"),c(4),l()()),n&2){let e=r(3).$implicit;s(4),I("(",e==null?null:e.Category,")")}}function yt(n,p){if(n&1&&(a(0,"td",58)(1,"div",14),h(2,gt,3,4,"ng-container",27),a(3,"div"),h(4,ft,1,1,"img",59)(5,xt,1,0,"img",60),l()()(),a(6,"td",61)(7,"span",62),c(8),l(),h(9,St,5,1),l()),n&2){let e=r(2).$implicit,o=r(2);m("rowSpan",e==null?null:e.Variants.length),s(2),m("ngxPermissionsOnly",M(6,ne,o.inventoryUpdateRole)),s(2),v(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),O(e==null?null:e.Name),s(),v(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function vt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(3).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(3).$implicit;b("ngModel",e.selected)}}function It(n,p){if(n&1&&h(0,vt,1,1,"input",70),n&2){let e=r(2).$implicit;v((e==null?null:e.Inventory)<=1e5?0:-1)}}function wt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(2).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(2).$implicit;b("ngModel",e.selected)}}function bt(n,p){if(n&1&&(P(0),a(1,"td",69),h(2,It,1,1)(3,wt,1,1,"input",70),l(),E()),n&2){let e=r().$implicit;s(2),v((e==null?null:e.Channel[0].TypeID)==1?2:(e==null?null:e.Inventory)>=0?3:-1)}}function Ft(n,p){n&1&&(a(0,"div",71),c(1," Not Found "),l())}function Tt(n,p){if(n&1&&(a(0,"div")(1,"span",72),c(2),g(3,"number"),l(),c(4," => "),a(5,"span",73),c(6),g(7,"number"),l()()),n&2){let e=r().$implicit;s(2),I(" ",y(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),O(y(7,4,e==null?null:e.Inventory))}}function Dt(n,p){if(n&1&&(c(0),g(1,"number")),n&2){let e=r().$implicit;I(" ",y(1,1,e==null?null:e.Inventory)," ")}}function Pt(n,p){if(n&1&&(P(0),a(1,"div",74)(2,"a",75),x(3,"i",76),l()(),E()),n&2){let e=r().$implicit,o=r(3);s(2),m("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),A)}}function Et(n,p){if(n&1){let e=S();a(0,"span",81),C("click",function(){d(e);let t=r(2).$implicit,i=r().$implicit,u=r(2);return _(u.openTableDialog(i,t))}),c(1),g(2,"number"),l()}if(n&2){let e=r(2).$implicit,o=r(3);ae(M(5,rt,o.hasInventoryEdit())),s(),I(" ",y(2,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function Mt(n,p){if(n&1){let e=S();a(0,"td",77)(1,"div",53)(2,"div"),h(3,Et,3,7,"span",78),g(4,"async"),l(),a(5,"div",74)(6,"a",75),x(7,"i",76),l()(),a(8,"div",74)(9,"span",79),C("click",function(){d(e);let t=r().$implicit,i=r(3);return _(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",80),l()()()()}if(n&2){let e=r().$implicit,o=r(3);m("ngClass",M(5,lt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",y(4,3,o.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,A)}}function Vt(n,p){if(n&1&&(P(0),a(1,"span",82),c(2),g(3,"number"),l(),E()),n&2){let e=r(2).$implicit;s(2),I(" (",y(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function kt(n,p){n&1&&c(0," - ")}function Rt(n,p){if(n&1&&(P(0),a(1,"td",51),h(2,Vt,4,3,"ng-container",57)(3,kt,1,0,"ng-template",null,1,Z),l(),E()),n&2){let e=K(4),o=r().$implicit;s(2),m("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function Lt(n,p){n&1&&(P(0),c(1," - "),E())}function Nt(n,p){if(n&1&&(a(0,"span",83),g(1,"date"),c(2),g(3,"date"),l()),n&2){let e=r().$implicit;m("matTooltip",k(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",k(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function At(n,p){if(n&1&&(a(0,"tr"),h(1,yt,10,8),a(2,"td",50),c(3),l(),a(4,"td",51)(5,"span",52),c(6),l()(),h(7,bt,4,1,"ng-container",27),a(8,"td")(9,"div",53),h(10,Ft,2,0,"div",54)(11,Tt,8,6,"div")(12,Dt,2,3)(13,Pt,4,1,"ng-container",5),l()(),h(14,Mt,11,7,"td",55)(15,Rt,5,2,"ng-container",5),a(16,"td",56),h(17,Lt,2,0,"ng-container",57)(18,Nt,4,8,"ng-template",null,0,Z),l()()),n&2){let e=p.$implicit,o=p.$index,t=K(19),i=r(3);s(),v(o==0?1:-1),s(2),O(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",M(14,ot,e.Discontinued)),s(),O(e==null?null:e.Code),s(),m("ngxPermissionsOnly",M(16,ne,i.inventoryUpdateRole)),s(3),m("ngIf",(e==null?null:e.I)==null),s(),v((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?11:-1),s(),v((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?12:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function Ot(n,p){if(n&1&&(a(0,"tbody"),G(1,At,20,18,"tr",null,z),l()),n&2){let e=p.$implicit;s(),Y(e.Variants)}}function Ut(n,p){if(n&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){d(e);let i=r();return _(i.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,mt,4,2,"div",5),g(4,"async"),l()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),l(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){d(e);let i=r();return _(i.onChannelChange(t))}),l()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),l(),a(13,"input",10),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),_(t)}),l()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),l(),a(17,"input",12),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),_(t)}),l()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),l(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),_(t)}),l(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),_(t)}),l()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,dt,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){d(e);let i=r();return _(i.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){d(e);let t=r();return t.showDifferenceStock=!t.showDifferenceStock,_(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),l()()(),a(39,"th",25),c(40,"Variant"),l(),a(41,"th",26),c(42,"SKU"),l(),h(43,ut,3,3,"ng-container",27),a(44,"th",28),c(45," POS "),l(),a(46,"th",29)(47,"div",30),C("click",function(){d(e);let t=r();return _(t.openModalFilter())}),x(48,"img",31),a(49,"span",32),c(50),g(51,"stringLimit"),l()()(),h(52,ht,2,0,"th",33),a(53,"th",34),c(54,"Last Sync"),l()()(),G(55,Ot,3,0,"tbody",null,z),g(57,"async"),l(),a(58,"infinite-paginator",35),g(59,"async"),C("onNextPage",function(){d(e);let t=r();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){d(e);let t=r();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){d(e);let t=r();return _(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()()()()}if(n&2){let e,o,t,i=r();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",y(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngxPermissionsOnly",M(30,ne,i.inventoryUpdateRole)),s(4),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(o=i.channelIdentity())==null?null:o.img,A),s(2),I(" ",k(51,23,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),v(i.isShowReservedColumn?52:-1),s(3),Y(y(57,26,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",y(59,28,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var An=(()=>{class n{constructor(e,o,t,i,u,ie,Xe){this.http=e,this.toastr=o,this.dialog=t,this.productService=i,this.authService=u,this.biggerPictureService=ie,this.mainPanelService=Xe,this.infinitePagination=w(J),this.ngxPermissionsService=w(we),this.updateResHandling=w(te),this.inventoryService=w(R),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,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.guidEmpty=f.GuidEMpty,this.selectedChannel=V(null),this.channelIdentity=V({img:null,label:null}),this.inventoryUpdateRole=q.InventoryUpdate,this.hasInventoryEdit=V(!0),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.initRoles(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe(H(e=>{this.checkShowReservedColumn(e)}),L(e=>(e=this.calculateAvailableStock(e),e)),N(1)),this.products$=this.sourceObs$}initRoles(){this.ngxPermissionsService.hasPermission(q.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e))}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((i,u)=>(i+=u.I?.Available||0,i),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(i=>{t=i.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(N(1),H(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(e){this.searchFilter.text=e,this.setChannelFilter(),this.initReloadData()}openModalFilter(){this.mainPanelService.openModalFilter()}onOpenDialogUpdateStockInfo(e){let o=this.productService.selectedVariantProduct(e);this.dialog.open(qe,{data:{channelId:o[0]?.Channel[0]?.ChannelID,selectedProducts:o}}).afterClosed().pipe(Q(t=>t===!0)).subscribe(()=>{this.updateStock(o)})}updateStock(e){if(e.length>0){let o=this.searchFilter.LocationID,t=e.map(u=>oe({ChannelItemID:u?.Channel[0]?.ChannelItemID,ChannelVariationID:u?.Channel[0]?.ChannelVariationID,Inventory:u.Inventory},f.IsNotEmpty(o)&&{LocationID:o})),i={ListChannelID:[this.searchFilter.ChannelID],List:t};this.http.post(X.UpdateInventoryChannel,i).subscribe(u=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(u)})}}handlingUpdateStock(e){if(e[0]?.Response){let o=e[0]?.Response?.Fail_list,t=e[0]?.Response?.Success_list;this.updateResHandling.responseHandling(t,o,"Stock")}else this.toastr.error(e[0]?.Exception,"Error")}refreshInventory(e,o,t,i){let u={ChannelItemID:e,ChannelVariationID:o,ChannelID:t,VariantID:i};this.http.post("/api/Inventory/RefreshInventoryChannel",u).subscribe(ie=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(e){e.Variants=e.Variants.map(o=>(o.Inventory>=0&&(o.selected=e.selected),o))}onCheckboxStateChange(e){e=e.map(o=>(o.Variants=o.Variants.map(t=>(t.selected=this.checkboxState,t)),o))}openTableDialog(e,o){this.hasInventoryEdit()&&this.dialog.open(Ge,{data:{Name:e.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"inventory",ChannelItemID:e.ChannelItemID}}).afterClosed().pipe(Q(i=>f.IsNotEmpty(i))).subscribe(i=>{this.updateItemAfterDialog(i)})}updateItemAfterDialog(e){let o=e.InventoryMultiwarehouse[0]?.LocationID,t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:e?.Inventory,VariantID:e.ID,SKU:e?.Sku,LocationID:o};this.http.post(X.UpdateUpdateQuantityByItem,t).subscribe(i=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([i])})}onScanInventory(e){let o=this.productService.selectedVariantProduct(e);this.inventoryService.refreshInventory(o).subscribe(()=>{this.initReloadData(),this.toastr.success("Inventory refreshed successfully","Success")})}openExportDialog(){this.dialog.open(ze,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=ee.DIFFERENCE:this.searchFilter.filterModel=ee.ALL,this.initReloadData()}onZoomImage(e,o){this.biggerPictureService.openBiggerPicture(e,o)}onSortVariant(e){if(e.direction==""){this.products$=this.sourceObs$;return}this.products$=this.products$.pipe(L(o=>o.map(t=>(t.Variants=t.Variants.sort((i,u)=>f.compare(i.I?.Available,u.I?.Available,e.direction==="asc")),t)).sort((t,i)=>f.compare(t.totalAvailable,i.totalAvailable,e.direction==="asc"))))}static{this.\u0275fac=function(o){return new(o||n)(D(Ie),D(ve),D(ke),D(We),D(Te),D(je),D(Ne))}}static{this.\u0275cmp=U({type:n,selectors:[["app-single-channel-comparison"]],features:[B([J,R,te])],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],["matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],[4,"ngxPermissionsOnly"],["scope","col","mat-sort-header","Available","arrowPosition","before",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-outline-dark me-3","matTooltip","Fetch the latest stock directly from the channel",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary","shadow","rounded"],["matTooltip","Fetch the latest stock directly from the channel",1,"btn","btn-outline-dark","me-3",3,"click"],[1,"fa-solid","fa-arrows-rotate","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-success","btn-sm","dropdown-toggle","border-start"],[1,"dropdown-menu","dropdown-menu-end","pointer"],["role","button",1,"dropdown-item","cursor-pointer","fs-5",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[3,"ngClass"],["type","checkbox",1,"me-3",3,"ngModel"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-end",3,"ngClass"],[3,"class","click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(o,t){o&1&&(h(0,Ut,60,32,"mainpanel",2),g(1,"async")),o&2&&m("ngIf",y(1,1,t.loader$))},dependencies:[j,me,de,$,_e,W,Oe,Ae,De,ye,ge,Se,Ce,fe,xe,Ye,Ke,Fe,be,He,Qe,Ee,Pe,$e,Ue,Be,Ze],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]})}}return n})();export{An as SingleChannelComparisonComponent};
@@ -0,0 +1 @@
1
+ import{a as xe,b as ve}from"./chunk-L74PANZ5.js";import{a as ge,b as Ce,c as Se}from"./chunk-RU43F4UK.js";import{a as be}from"./chunk-DRVWJPA2.js";import{a as F}from"./chunk-FYB62QQV.js";import{a as ye}from"./chunk-67HPC5Y3.js";import"./chunk-XPCRS7AL.js";import"./chunk-MX5SR3SR.js";import{a as he}from"./chunk-OLANEXLB.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{a as fe}from"./chunk-CO5XZENC.js";import"./chunk-FGRPTNDB.js";import"./chunk-3PPLPXAX.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-C7YK5TDP.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-ACIMXBIC.js";import"./chunk-PYXL7UF7.js";import{a as _e}from"./chunk-LDL3A7NM.js";import"./chunk-OLVWSY6L.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as de}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{b as se}from"./chunk-RXQX7567.js";import{m as ce,n as ue}from"./chunk-HJXYT6MI.js";import{A as ae,b as ie,c as ne,h as oe,m as re,o as le}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as me,s as pe}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as Z,k as $,m as ee,n as te}from"./chunk-FXQKRJWU.js";import{$c as w,Ac as H,Bc as Q,Cc as j,Gb as W,Gc as d,Hc as T,Ic as R,Kc as g,Lc as C,Mb as b,Mc as S,Nc as q,Oc as U,Pc as P,Qc as G,Ra as O,Rc as J,Sc as K,Yb as h,Z as L,ac as D,ad as E,bd as X,dc as x,ea as I,ec as B,gc as A,hc as z,ic as i,jc as n,kc as u,oc as v,pa as V,pb as k,rb as l,rd as Y,tc as f,uc as c,ya as m,za as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as M,b as N}from"./chunk-66YHNWRR.js";var Te=["contextMenu"],we=()=>[],Me=r=>({"td-cell-hover":r});function Ve(r,_){if(r&1){let e=v();i(0,"button",20),f("click",function(){m(e);let t=c();return p(t.setMultipleFulfillment())}),d(1," Set Fulfillment "),n()}}function Re(r,_){if(r&1&&u(0,"variants-dropdown",37),r&2){let e=c().$implicit;h("variants",e==null?null:e.Variants)}}function Ee(r,_){if(r&1&&u(0,"variant-with-image",38),r&2){let e=c().$implicit;h("variant",e==null?null:e.Variants[0])}}function Oe(r,_){if(r&1&&(i(0,"span"),d(1),n()),r&2){let e=c().$implicit;l(),R("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Pe(r,_){if(r&1){let e=v();i(0,"div",40)(1,"button",44),f("click",function(){m(e);let t=c().$implicit,s=c(2);return p(s.refreshShippingAndRefNumber(t))}),u(2,"i",45),n()()}}function Fe(r,_){if(r&1){let e=v();i(0,"button",46),f("click",function(){m(e);let t=c().$implicit,s=c(2);return p(s.onSetFulfillment(t))}),d(1," Set Fulfillment "),n()}}function Ne(r,_){if(r&1){let e=v();i(0,"tr")(1,"td")(2,"input",30),S("ngModelChange",function(t){let s=m(e).$implicit;return C(s.selected,t)||(s.selected=t),p(t)}),f("ngModelChange",function(){m(e);let t=c(2),s=P(0);return p(t.onSelectOrder(s))}),n()(),i(3,"td")(4,"div",31),u(5,"img",32),w(6,"channelImage"),i(7,"div",33)(8,"div"),d(9),n(),i(10,"small",34)(11,"span"),d(12),n()()()()(),i(13,"td")(14,"div",35)(15,"div"),u(16,"order-link",36),n(),i(17,"small"),d(18),w(19,"date"),n()()(),i(20,"td"),d(21),n(),i(22,"td"),b(23,Re,1,1,"variants-dropdown",37)(24,Ee,1,1,"variant-with-image",38),n(),i(25,"td",39),d(26),w(27,"number"),n(),i(28,"td",40)(29,"div",41)(30,"div",35)(31,"div",42)(32,"span"),d(33),n(),b(34,Oe,2,1,"span"),n(),i(35,"small"),d(36),n()(),b(37,Pe,3,0,"div",40),n()(),i(38,"td",40),b(39,Fe,2,0,"button",43),n()()}if(r&2){let e=_.$implicit,o=c(2);l(2),g("ngModel",e.selected),h("disabled",o.selectedChannelType()!=null&&o.selectedChannelType()!=e.MarketType),l(3),h("src",E(6,18,e==null?null:e.MarketType),k)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(4),T(e.Outlet),l(3),T(e.ChannelName),l(4),h("order",e),l(2),R(" ",X(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(3),T(e.Customer),l(),D(K(25,Me,(e.Variants==null?null:e.Variants.length)>1)),l(),x((e.Variants==null?null:e.Variants.length)>1?23:24),l(3),T(E(27,23,e.Amount)),l(7),T(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?34:-1),l(2),R(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),l(),x(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?37:-1),l(2),x((e==null?null:e.MarketType)!=o.channelType.WooCommerce?39:-1)}}function Le(r,_){if(r&1){let e=v();i(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),u(4,"th",24),i(5,"th",25),d(6,"Outlet"),n(),i(7,"th",25),d(8,"Number"),n(),i(9,"th",25),d(10,"Customer"),n(),i(11,"th"),d(12,"Items"),n(),i(13,"th",26),d(14,"Amount"),n(),i(15,"th",27),d(16,"Shipping"),n(),u(17,"th",28),n()(),i(18,"tbody"),A(19,Ne,40,27,"tr",null,B),n()(),i(21,"app-custom-paginator",29),f("next",function(){m(e);let t=c();return p(t.initReadyToShip())})("previous",function(){m(e);let t=c();return p(t.initReadyToShip())}),n()()}if(r&2){let e=c(),o=P(0);l(19),z(o),l(2),h("filter",e.filter())("totaldata",o==null?null:o.length)}}function Ie(r,_){r&1&&(i(0,"div",18),u(1,"app-empty-state"),n())}var dt=(()=>{class r{constructor(){this.toastr=V(de),this.orderService=V(F),this.fulfillmentService=V(xe),this.channelType=se,this.selectedOrders=O([]),this.selectedChannelType=Y(()=>{let e=null;return this.selectedOrders().length>0&&(e=this.selectedOrders()[0].MarketType),e}),this.filter=O({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(o=>N(M({},o),{From:e})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.orderService.getReadyToShipOrders(this.filter()).pipe(I(()=>{this.selectedOrders.set([])}),L(1))}onFilterChange(e){this.filter.update(o=>M(M({},o),e))}onSetFulfillment(e){this.fulfillmentService.setFulfillmentOrder(e).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(e){this.orderService.refreshShippingCourier(e.ShopID,e.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(e){let o=e.filter(t=>t.selected);this.selectedOrders.set(o)}onMouseHover(e,o){(!o.LogisticService?.Name||!o.ReferenceNumber)&&this.contextMenuEl.show(e,o)}onSelectContextItem(e){e.item?.id==="refresh"&&this.refreshShippingAndRefNumber(e.data)}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-ready-to-ship"]],viewQuery:function(o,t){if(o&1&&H(Te,5),o&2){let s;Q(s=j())&&(t.contextMenuEl=s.first)}},features:[G([F])],decls:37,vars:14,consts:[["contextMenu",""],["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","100px"],[2,"width","150px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(o,t){if(o&1){let s=v();q(0),w(1,"async"),i(2,"mainpanel",1),f("onSubmit",function(){return m(s),p(t.initReadyToShip())}),S("textChange",function(a){return m(s),C(t.filter().Number,a)||(t.filter().Number=a),p(a)}),i(3,"actions"),b(4,Ve,2,0,"button",2),i(5,"a",3),u(6,"i",4),i(7,"span"),d(8,"Order Fulfillment Display"),n()()(),i(9,"filters")(10,"div")(11,"label",5),d(12,"Channel"),n(),i(13,"app-channel-options-v2",6),S("ngModelChange",function(a){return m(s),C(t.filter().ListChannelID,a)||(t.filter().ListChannelID=a),p(a)}),n()(),i(14,"div",7)(15,"label",5),d(16,"From/To"),n(),i(17,"div",8)(18,"datepicker",9),S("dateChange",function(a){return m(s),C(t.filter().From,a)||(t.filter().From=a),p(a)}),n()(),i(19,"div")(20,"datepicker",10),S("dateChange",function(a){return m(s),C(t.filter().To,a)||(t.filter().To=a),p(a)}),n()()(),i(21,"div",7)(22,"label",11),d(23,"Page Number"),n(),i(24,"input",12),S("ngModelChange",function(a){return m(s),C(t.filter().PageNumber,a)||(t.filter().PageNumber=a),p(a)}),n()(),i(25,"div",7)(26,"label",11),d(27,"Page Size"),n(),i(28,"input",13),S("ngModelChange",function(a){return m(s),C(t.filter().PageSize,a)||(t.filter().PageSize=a),p(a)}),n()()(),i(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),b(33,Le,22,2,"div",17)(34,Ie,2,0,"div",18),n()()()()(),i(35,"app-context-menu",19,0),f("onSelectItem",function(a){return m(s),p(t.onSelectContextItem(a))}),n()}if(o&2){let s=U(E(1,10,t.readyToShip$)||J(13,we));l(2),g("text",t.filter().Number),l(2),x(t.selectedOrders().length>0?4:-1),l(9),h("multiple",!0),g("ngModel",t.filter().ListChannelID),l(5),g("date",t.filter().From),l(2),g("date",t.filter().To),l(4),g("ngModel",t.filter().PageNumber),l(4),g("ngModel",t.filter().PageSize),l(5),x(s.length>0?33:34),l(2),h("items",t.contextMenuItems)}},dependencies:[te,Z,ee,$,ue,ce,he,_e,ae,ne,le,ie,oe,re,ge,Ce,Se,ye,be,pe,me,ve,fe],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]})}}return r})();export{dt as ReadyToShipComponent};
@@ -1,4 +1,4 @@
1
- import{a as B}from"./chunk-PIBVGTHJ.js";import{a as Ge,b as Pe}from"./chunk-FGRPTNDB.js";import{a as Le,b as Qe}from"./chunk-OXWPLJEW.js";import{a as Oe,b as Ve}from"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import{a as ke}from"./chunk-RHHHL4OR.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import{a as Ne}from"./chunk-YFDFIBAG.js";import{T as Ee,fa as Ie,la as Re,ma as xe,na as k,oa as O}from"./chunk-RC5PUUVM.js";import"./chunk-CGOB6Y3X.js";import{b as Te}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{d as Se,e as we}from"./chunk-PYXL7UF7.js";import{c as D}from"./chunk-RXQX7567.js";import{m as De,n as Ue}from"./chunk-HJXYT6MI.js";import{A as Ce,c as ye,h as be,m as ve}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{r as Me,s as Fe}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{E as he,G as fe,H as ge,J as _e,d as x,g as pe,h as ce,i as me,j as ue,n as N}from"./chunk-FXQKRJWU.js";import{$c as se,Bc as _,Ca as V,Cc as y,Gb as U,Gc as c,Hb as X,Hc as S,Ic as re,Kb as Y,Kc as w,Lc as M,Mb as u,Mc as F,Nc as le,Qc as I,Ra as f,Rc as R,Sc as W,Xb as Z,Yb as l,Z as q,aa as A,ac as ee,ad as de,dc as te,ea as z,gc as ne,hc as ie,ic as a,ja as H,jc as r,ka as J,kc as ae,lc as L,mc as Q,nc as T,oc as G,pa as b,pb as K,rb as o,tc as P,uc as h,v as j,vc as oe,wc as E,ya as v,za as C,zc as g}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var Ae=["header"],ze=["title"],He=["subtitle"],Je=["content"],Ke=["footer"],Xe=["*",[["p-header"]],[["p-footer"]]],Ye=["*","p-header","p-footer"];function Ze(e,p){e&1&&T(0)}function et(e,p){if(e&1&&(a(0,"div",8),E(1,1),u(2,Ze,1,0,"ng-container",6),r()),e&2){let n=h();o(2),l("ngTemplateOutlet",n.headerTemplate||n._headerTemplate)}}function tt(e,p){if(e&1&&(L(0),c(1),Q()),e&2){let n=h(2);o(),S(n.header)}}function nt(e,p){e&1&&T(0)}function it(e,p){if(e&1&&(a(0,"div",9),u(1,tt,2,1,"ng-container",10)(2,nt,1,0,"ng-container",6),r()),e&2){let n=h();o(),l("ngIf",n.header&&!n._titleTemplate&&!n.titleTemplate),o(),l("ngTemplateOutlet",n.titleTemplate||n._titleTemplate)}}function at(e,p){if(e&1&&(L(0),c(1),Q()),e&2){let n=h(2);o(),S(n.subheader)}}function ot(e,p){e&1&&T(0)}function rt(e,p){if(e&1&&(a(0,"div",11),u(1,at,2,1,"ng-container",10)(2,ot,1,0,"ng-container",6),r()),e&2){let n=h();o(),l("ngIf",n.subheader&&!n._subtitleTemplate&&!n.subtitleTemplate),o(),l("ngTemplateOutlet",n.subtitleTemplate||n._subtitleTemplate)}}function lt(e,p){e&1&&T(0)}function st(e,p){e&1&&T(0)}function dt(e,p){if(e&1&&(a(0,"div",12),E(1,2),u(2,st,1,0,"ng-container",6),r()),e&2){let n=h();o(2),l("ngTemplateOutlet",n.footerTemplate||n._footerTemplate)}}var pt=({dt:e})=>`
1
+ import{a as B}from"./chunk-PIBVGTHJ.js";import{a as ke}from"./chunk-RHHHL4OR.js";import{a as Ge,b as Pe}from"./chunk-FGRPTNDB.js";import{a as Oe,b as Ve}from"./chunk-OXWPLJEW.js";import{a as Le,b as Qe}from"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import{a as Ne}from"./chunk-YFDFIBAG.js";import{T as Ee,fa as Ie,la as Re,ma as xe,na as k,oa as O}from"./chunk-RC5PUUVM.js";import{d as Se,e as we}from"./chunk-PYXL7UF7.js";import"./chunk-CGOB6Y3X.js";import{b as Te}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as D}from"./chunk-RXQX7567.js";import{m as De,n as Ue}from"./chunk-HJXYT6MI.js";import{A as Ce,c as ye,h as be,m as ve}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{r as Me,s as Fe}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{E as he,G as fe,H as ge,J as _e,d as x,g as pe,h as ce,i as me,j as ue,n as N}from"./chunk-FXQKRJWU.js";import{$c as se,Bc as _,Ca as V,Cc as y,Gb as U,Gc as c,Hb as X,Hc as S,Ic as re,Kb as Y,Kc as w,Lc as M,Mb as u,Mc as F,Nc as le,Qc as I,Ra as f,Rc as R,Sc as W,Xb as Z,Yb as l,Z as q,aa as A,ac as ee,ad as de,dc as te,ea as z,gc as ne,hc as ie,ic as a,ja as H,jc as r,ka as J,kc as ae,lc as L,mc as Q,nc as T,oc as G,pa as b,pb as K,rb as o,tc as P,uc as h,v as j,vc as oe,wc as E,ya as v,za as C,zc as g}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var Ae=["header"],ze=["title"],He=["subtitle"],Je=["content"],Ke=["footer"],Xe=["*",[["p-header"]],[["p-footer"]]],Ye=["*","p-header","p-footer"];function Ze(e,p){e&1&&T(0)}function et(e,p){if(e&1&&(a(0,"div",8),E(1,1),u(2,Ze,1,0,"ng-container",6),r()),e&2){let n=h();o(2),l("ngTemplateOutlet",n.headerTemplate||n._headerTemplate)}}function tt(e,p){if(e&1&&(L(0),c(1),Q()),e&2){let n=h(2);o(),S(n.header)}}function nt(e,p){e&1&&T(0)}function it(e,p){if(e&1&&(a(0,"div",9),u(1,tt,2,1,"ng-container",10)(2,nt,1,0,"ng-container",6),r()),e&2){let n=h();o(),l("ngIf",n.header&&!n._titleTemplate&&!n.titleTemplate),o(),l("ngTemplateOutlet",n.titleTemplate||n._titleTemplate)}}function at(e,p){if(e&1&&(L(0),c(1),Q()),e&2){let n=h(2);o(),S(n.subheader)}}function ot(e,p){e&1&&T(0)}function rt(e,p){if(e&1&&(a(0,"div",11),u(1,at,2,1,"ng-container",10)(2,ot,1,0,"ng-container",6),r()),e&2){let n=h();o(),l("ngIf",n.subheader&&!n._subtitleTemplate&&!n.subtitleTemplate),o(),l("ngTemplateOutlet",n.subtitleTemplate||n._subtitleTemplate)}}function lt(e,p){e&1&&T(0)}function st(e,p){e&1&&T(0)}function dt(e,p){if(e&1&&(a(0,"div",12),E(1,2),u(2,st,1,0,"ng-container",6),r()),e&2){let n=h();o(2),l("ngTemplateOutlet",n.footerTemplate||n._footerTemplate)}}var pt=({dt:e})=>`
2
2
  .p-card {
3
3
  background: ${e("card.background")};
4
4
  color: ${e("card.color")};
@@ -29,5 +29,5 @@ import{a as B}from"./chunk-PIBVGTHJ.js";import{a as Ge,b as Pe}from"./chunk-FGRP
29
29
  .p-card-subtitle {
30
30
  color: ${e("card.subtitle.color")};
31
31
  }
32
- `,ct={root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"},We=(()=>{class e extends Ie{name="card";theme=pt;classes=ct;static \u0275fac=(()=>{let n;return function(t){return(n||(n=V(e)))(t||e)}})();static \u0275prov=H({token:e,factory:e.\u0275fac})}return e})();var mt=(()=>{class e extends Ne{header;subheader;set style(n){Ee(this._style(),n)||this._style.set(n)}styleClass;headerFacet;footerFacet;headerTemplate;titleTemplate;subtitleTemplate;contentTemplate;footerTemplate;_headerTemplate;_titleTemplate;_subtitleTemplate;_contentTemplate;_footerTemplate;_style=f(null);_componentStyle=b(We);getBlockableElement(){return this.el.nativeElement.children[0]}templates;ngAfterContentInit(){this.templates.forEach(n=>{switch(n.getType()){case"header":this._headerTemplate=n.template;break;case"title":this._titleTemplate=n.template;break;case"subtitle":this._subtitleTemplate=n.template;break;case"content":this._contentTemplate=n.template;break;case"footer":this._footerTemplate=n.template;break;default:this._contentTemplate=n.template;break}})}static \u0275fac=(()=>{let n;return function(t){return(n||(n=V(e)))(t||e)}})();static \u0275cmp=U({type:e,selectors:[["p-card"]],contentQueries:function(s,t,i){if(s&1&&(g(i,Re,5),g(i,xe,5),g(i,Ae,4),g(i,ze,4),g(i,He,4),g(i,Je,4),g(i,Ke,4),g(i,k,4)),s&2){let d;_(d=y())&&(t.headerFacet=d.first),_(d=y())&&(t.footerFacet=d.first),_(d=y())&&(t.headerTemplate=d.first),_(d=y())&&(t.titleTemplate=d.first),_(d=y())&&(t.subtitleTemplate=d.first),_(d=y())&&(t.contentTemplate=d.first),_(d=y())&&(t.footerTemplate=d.first),_(d=y())&&(t.templates=d)}},inputs:{header:"header",subheader:"subheader",style:"style",styleClass:"styleClass"},features:[I([We]),Y],ngContentSelectors:Ye,decls:9,vars:10,consts:[[3,"ngClass","ngStyle"],["class","p-card-header",4,"ngIf"],[1,"p-card-body"],["class","p-card-title",4,"ngIf"],["class","p-card-subtitle",4,"ngIf"],[1,"p-card-content"],[4,"ngTemplateOutlet"],["class","p-card-footer",4,"ngIf"],[1,"p-card-header"],[1,"p-card-title"],[4,"ngIf"],[1,"p-card-subtitle"],[1,"p-card-footer"]],template:function(s,t){s&1&&(oe(Xe),a(0,"div",0),u(1,et,3,1,"div",1),a(2,"div",2),u(3,it,3,2,"div",3)(4,rt,3,2,"div",4),a(5,"div",5),E(6),u(7,lt,1,0,"ng-container",6),r(),u(8,dt,3,1,"div",7),r()()),s&2&&(ee(t.styleClass),l("ngClass","p-card p-component")("ngStyle",t._style()),Z("data-pc-name","card"),o(),l("ngIf",t.headerFacet||t.headerTemplate||t._headerTemplate),o(2),l("ngIf",t.header||t.titleTemplate||t._titleTemplate),o(),l("ngIf",t.subheader||t.subtitleTemplate||t._subtitleTemplate),o(3),l("ngTemplateOutlet",t.contentTemplate||t._contentTemplate),o(),l("ngIf",t.footerFacet||t.footerTemplate||t._footerTemplate))},dependencies:[N,x,pe,me,ce,O],encapsulation:2,changeDetection:0})}return e})(),Be=(()=>{class e{static \u0275fac=function(s){return new(s||e)};static \u0275mod=X({type:e});static \u0275inj=J({imports:[mt,O,O]})}return e})();var $e=e=>({empty:e}),$=()=>[],ut=(e,p)=>p.ID;function ht(e,p){if(e&1&&(a(0,"div",34),ae(1,"img",35),a(2,"div"),c(3),r()()),e&2){let n=p.$implicit;o(),l("src",n.logo,K),o(2),S(n.Name)}}function ft(e,p){if(e&1){let n=G();a(0,"p-chip",38),P("onRemove",function(){let t=v(n).$implicit,i=h(3);return C(i.onRemoveChannel(t.ID))}),r()}if(e&2){let n=p.$implicit;l("label",n.Name)("image",n.logo)("alt",n.Name)("removable",!0)}}function gt(e,p){if(e&1&&ne(0,ft,1,4,"p-chip",37,ut),e&2){let n=h().$implicit;ie(n)}}function _t(e,p){if(e&1&&(a(0,"span"),c(1),r()),e&2){let n=h().$implicit;o(),re("",n.length," channels selected")}}function yt(e,p){if(e&1&&(a(0,"div",36),u(1,gt,2,0)(2,_t,2,1,"span"),r()),e&2){let n=p.$implicit;o(),te((n==null?null:n.length)<=10?1:2)}}var dn=(()=>{class e{constructor(){this.toastr=b(Te),this.userService=b(B),this.activatedRoute=b(he),this.route=b(fe),this.selectedUser=f(null),this.selectedGroup=f(null),this.selectedChannel=f([]),this.selectedUserName=f(null),this.orderDownloadDaysRange=f(0),this.isEditMode=f(!1),this.userFormLoader$=this.activatedRoute.queryParams.pipe(A(n=>{let s=n.ID||null;return this.userService.getUserFormLoader(s).pipe(q(1),z(t=>{this.isEditMode.set(D.IsNotEmpty(s)),this.selectedGroup.set(D.IsNotEmpty(t.Form?.GroupID)?t.Form?.GroupID:null),this.selectedUser.set(D.IsNotEmpty(t.Form?.ID)?t.Form?.ID:null),this.orderDownloadDaysRange.set(t.Form?.DownloadOrderDaysRange||0),this.findSelectedUserName(t.Options?.Users,this.selectedUser()),this.selectedChannel.set(t.UserChannels||[])}),j(t=>(t.Options.Channels=D.assignChannelLogo(t.Options.Channels),console.log(t),t)))}))}findSelectedUserName(n,s){let t=n.find(i=>i.ID===s);this.selectedUserName.set(t?t.Name:null)}onSave(){if(!this.selectedUser()||!this.selectedGroup()){this.toastr.error("Please select both user and group","Error");return}this.userService.onInviteUser({ID:this.selectedUser(),GroupID:this.selectedGroup(),UserChannels:this.selectedChannel()||[],DownloadOrderDaysRange:this.orderDownloadDaysRange()}).subscribe({next:()=>{this.toastr.success("User updated successfully","Success"),this.route.navigate(["/menu/users/users"])}})}onRemoveChannel(n){let t=(this.selectedChannel()||[]).filter(i=>i!==n);this.selectedChannel.set(t)}static{this.\u0275fac=function(s){return new(s||e)}}static{this.\u0275cmp=U({type:e,selectors:[["app-user-form"]],features:[I([B])],decls:56,vars:23,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["routerLink","/menu/users/users",1,"btn","btn-secondary","me-3"],[1,"btn","btn-success",3,"click"],[1,"container-fluid","py-5","bg-light-gray"],[1,"row","mt-8"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body","mt-8","pb-4"],[1,"row"],[1,"col-6"],[1,"form-label-group","w-100",3,"ngClass"],["bindLabel","Name","bindValue","ID","placeholder","Select User","id","userSelection",1,"height-sm",3,"ngModelChange","items","ngModel","disabled"],["for","userSelection"],["bindLabel","Name","bindValue","ID","placeholder","Select Group","id","groupSelection",1,"height-sm",3,"ngModelChange","items","ngModel"],["for","groupSelection"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["role","presentation",1,"nav-item"],["id","channel-tab","data-bs-toggle","tab","data-bs-target","#channel-tab-pane","type","button","role","tab","aria-controls","channel-tab-pane","aria-selected","true",1,"nav-link","active"],["id","restriction-tab","data-bs-toggle","tab","data-bs-target","#restriction-tab-pane","type","button","role","tab","aria-controls","restriction-tab-pane","aria-selected","false",1,"nav-link"],[1,"card","rounded-0","border-top-0"],[1,"card-body","pb-4"],["id","myTabContent",1,"tab-content","mt-3"],["id","channel-tab-pane","role","tabpanel","aria-labelledby","channel-tab","tabindex","0",1,"tab-pane","fade","show","active","pb-9"],["variant","on",1,"w-100"],["optionLabel","Name","optionValue","ID","display","chip","id","channelSelection",1,"w-100","channel-multiselect",2,"--p-multiselect-padding-y","14px",3,"ngModelChange","options","ngModel","maxSelectedLabels"],["pTemplate","item"],["pTemplate","selectedItems"],["for","channelSelection"],[1,"mt-4"],["id","restriction-tab-pane","role","tabpanel","aria-labelledby","restriction-tab-pane","tabindex","1",1,"tab-pane","fade"],["matTooltip","How many days of past orders this user can download.","matTooltipPosition","above",1,"form-label-group","mb-3"],["type","text","id","daysRange","name","daysRange","data-toggle","tooltip","title","daysRange","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","daysRange"],[1,"d-flex","align-items-center","gap-2"],[2,"width","18px",3,"src"],[1,"d-flex","flex-wrap","gap-1"],[1,"me-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt","removable"],[1,"me-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"onRemove","label","image","alt","removable"]],template:function(s,t){if(s&1){let i=G();le(0),se(1,"async"),a(2,"mainpanel",0)(3,"actions")(4,"a",1),c(5," Cancel "),r(),a(6,"button",2),P("click",function(){return v(i),C(t.onSave())}),c(7,"Save"),r()(),a(8,"content")(9,"div",3)(10,"div",4)(11,"div",5)(12,"div",6)(13,"div",7)(14,"h3"),c(15,"User Information"),r()(),a(16,"div",8)(17,"div",9)(18,"div",10)(19,"div",11)(20,"ng-select",12),F("ngModelChange",function(m){return v(i),M(t.selectedUser,m)||(t.selectedUser=m),C(m)}),r(),a(21,"label",13),c(22,"Select User"),r()()(),a(23,"div",10)(24,"div",11)(25,"ng-select",14),F("ngModelChange",function(m){return v(i),M(t.selectedGroup,m)||(t.selectedGroup=m),C(m)}),r(),a(26,"label",15),c(27,"Select Group"),r()()()()()()()(),a(28,"div",9)(29,"div",5)(30,"ul",16)(31,"li",17)(32,"button",18),c(33," Channels Filter "),r()(),a(34,"li",17)(35,"button",19),c(36," Restriction "),r()()(),a(37,"div",20)(38,"div",21)(39,"div",22)(40,"div",23)(41,"p-floatlabel",24)(42,"p-multiselect",25),F("ngModelChange",function(m){return v(i),M(t.selectedChannel,m)||(t.selectedChannel=m),C(m)}),u(43,ht,4,2,"ng-template",26)(44,yt,3,1,"ng-template",27),r(),a(45,"label",28),c(46,"Select Channels"),r()(),a(47,"div",29),c(48," When no channel filter is assigned all channel will be visible "),r()(),a(49,"div",30)(50,"div",9)(51,"div",10)(52,"div",31)(53,"input",32),F("ngModelChange",function(m){return v(i),M(t.orderDownloadDaysRange,m)||(t.orderDownloadDaysRange=m),C(m)}),r(),a(54,"label",33),c(55,"Download Order Days Range"),r()()()()()()()()()()()()()}if(s&2){let i=de(1,14,t.userFormLoader$);o(2),l("headerTitle",t.selectedUserName()?" Edit User Access - "+t.selectedUserName():"User Form")("hideSearchBox",!0)("hideSearchDropdown",!0),o(17),l("ngClass",W(16,$e,!t.selectedUser())),o(),l("items",(i==null||i.Options==null?null:i.Options.Users)||R(18,$)),w("ngModel",t.selectedUser),l("disabled",t.isEditMode()),o(4),l("ngClass",W(19,$e,!t.selectedGroup())),o(),l("items",(i==null||i.Options==null?null:i.Options.Groups)||R(21,$)),w("ngModel",t.selectedGroup),o(17),l("options",(i==null||i.Options==null?null:i.Options.Channels)||R(22,$)),w("ngModel",t.selectedChannel),l("maxSelectedLabels",10),o(11),w("ngModel",t.orderDownloadDaysRange)}},dependencies:[N,x,ue,Ue,De,Ce,ye,be,ve,Pe,Ge,k,we,Se,Be,Qe,Le,Ve,Oe,_e,ge,ke,Fe,Me],styles:[`.nav-tabs .nav-link.active:hover,.nav-tabs .nav-link.active:focus,.nav-tabs .nav-item.show .nav-link:hover,.nav-tabs .nav-item.show .nav-link:focus{background-color:#fff!important;border-color:#dee2e6 #dee2e6 #fff}
32
+ `,ct={root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"},We=(()=>{class e extends Ie{name="card";theme=pt;classes=ct;static \u0275fac=(()=>{let n;return function(t){return(n||(n=V(e)))(t||e)}})();static \u0275prov=H({token:e,factory:e.\u0275fac})}return e})();var mt=(()=>{class e extends Ne{header;subheader;set style(n){Ee(this._style(),n)||this._style.set(n)}styleClass;headerFacet;footerFacet;headerTemplate;titleTemplate;subtitleTemplate;contentTemplate;footerTemplate;_headerTemplate;_titleTemplate;_subtitleTemplate;_contentTemplate;_footerTemplate;_style=f(null);_componentStyle=b(We);getBlockableElement(){return this.el.nativeElement.children[0]}templates;ngAfterContentInit(){this.templates.forEach(n=>{switch(n.getType()){case"header":this._headerTemplate=n.template;break;case"title":this._titleTemplate=n.template;break;case"subtitle":this._subtitleTemplate=n.template;break;case"content":this._contentTemplate=n.template;break;case"footer":this._footerTemplate=n.template;break;default:this._contentTemplate=n.template;break}})}static \u0275fac=(()=>{let n;return function(t){return(n||(n=V(e)))(t||e)}})();static \u0275cmp=U({type:e,selectors:[["p-card"]],contentQueries:function(s,t,i){if(s&1&&(g(i,Re,5),g(i,xe,5),g(i,Ae,4),g(i,ze,4),g(i,He,4),g(i,Je,4),g(i,Ke,4),g(i,k,4)),s&2){let d;_(d=y())&&(t.headerFacet=d.first),_(d=y())&&(t.footerFacet=d.first),_(d=y())&&(t.headerTemplate=d.first),_(d=y())&&(t.titleTemplate=d.first),_(d=y())&&(t.subtitleTemplate=d.first),_(d=y())&&(t.contentTemplate=d.first),_(d=y())&&(t.footerTemplate=d.first),_(d=y())&&(t.templates=d)}},inputs:{header:"header",subheader:"subheader",style:"style",styleClass:"styleClass"},features:[I([We]),Y],ngContentSelectors:Ye,decls:9,vars:10,consts:[[3,"ngClass","ngStyle"],["class","p-card-header",4,"ngIf"],[1,"p-card-body"],["class","p-card-title",4,"ngIf"],["class","p-card-subtitle",4,"ngIf"],[1,"p-card-content"],[4,"ngTemplateOutlet"],["class","p-card-footer",4,"ngIf"],[1,"p-card-header"],[1,"p-card-title"],[4,"ngIf"],[1,"p-card-subtitle"],[1,"p-card-footer"]],template:function(s,t){s&1&&(oe(Xe),a(0,"div",0),u(1,et,3,1,"div",1),a(2,"div",2),u(3,it,3,2,"div",3)(4,rt,3,2,"div",4),a(5,"div",5),E(6),u(7,lt,1,0,"ng-container",6),r(),u(8,dt,3,1,"div",7),r()()),s&2&&(ee(t.styleClass),l("ngClass","p-card p-component")("ngStyle",t._style()),Z("data-pc-name","card"),o(),l("ngIf",t.headerFacet||t.headerTemplate||t._headerTemplate),o(2),l("ngIf",t.header||t.titleTemplate||t._titleTemplate),o(),l("ngIf",t.subheader||t.subtitleTemplate||t._subtitleTemplate),o(3),l("ngTemplateOutlet",t.contentTemplate||t._contentTemplate),o(),l("ngIf",t.footerFacet||t.footerTemplate||t._footerTemplate))},dependencies:[N,x,pe,me,ce,O],encapsulation:2,changeDetection:0})}return e})(),Be=(()=>{class e{static \u0275fac=function(s){return new(s||e)};static \u0275mod=X({type:e});static \u0275inj=J({imports:[mt,O,O]})}return e})();var $e=e=>({empty:e}),$=()=>[],ut=(e,p)=>p.ID;function ht(e,p){if(e&1&&(a(0,"div",34),ae(1,"img",35),a(2,"div"),c(3),r()()),e&2){let n=p.$implicit;o(),l("src",n.logo,K),o(2),S(n.Name)}}function ft(e,p){if(e&1){let n=G();a(0,"p-chip",38),P("onRemove",function(){let t=v(n).$implicit,i=h(3);return C(i.onRemoveChannel(t.ID))}),r()}if(e&2){let n=p.$implicit;l("label",n.Name)("image",n.logo)("alt",n.Name)("removable",!0)}}function gt(e,p){if(e&1&&ne(0,ft,1,4,"p-chip",37,ut),e&2){let n=h().$implicit;ie(n)}}function _t(e,p){if(e&1&&(a(0,"span"),c(1),r()),e&2){let n=h().$implicit;o(),re("",n.length," channels selected")}}function yt(e,p){if(e&1&&(a(0,"div",36),u(1,gt,2,0)(2,_t,2,1,"span"),r()),e&2){let n=p.$implicit;o(),te((n==null?null:n.length)<=10?1:2)}}var dn=(()=>{class e{constructor(){this.toastr=b(Te),this.userService=b(B),this.activatedRoute=b(he),this.route=b(fe),this.selectedUser=f(null),this.selectedGroup=f(null),this.selectedChannel=f([]),this.selectedUserName=f(null),this.orderDownloadDaysRange=f(0),this.isEditMode=f(!1),this.userFormLoader$=this.activatedRoute.queryParams.pipe(A(n=>{let s=n.ID||null;return this.userService.getUserFormLoader(s).pipe(q(1),z(t=>{this.isEditMode.set(D.IsNotEmpty(s)),this.selectedGroup.set(D.IsNotEmpty(t.Form?.GroupID)?t.Form?.GroupID:null),this.selectedUser.set(D.IsNotEmpty(t.Form?.ID)?t.Form?.ID:null),this.orderDownloadDaysRange.set(t.Form?.DownloadOrderDaysRange||0),this.findSelectedUserName(t.Options?.Users,this.selectedUser()),this.selectedChannel.set(t.UserChannels||[])}),j(t=>(t.Options.Channels=D.assignChannelLogo(t.Options.Channels),console.log(t),t)))}))}findSelectedUserName(n,s){let t=n.find(i=>i.ID===s);this.selectedUserName.set(t?t.Name:null)}onSave(){if(!this.selectedUser()||!this.selectedGroup()){this.toastr.error("Please select both user and group","Error");return}this.userService.onInviteUser({ID:this.selectedUser(),GroupID:this.selectedGroup(),UserChannels:this.selectedChannel()||[],DownloadOrderDaysRange:this.orderDownloadDaysRange()}).subscribe({next:()=>{this.toastr.success("User updated successfully","Success"),this.route.navigate(["/menu/users/users"])}})}onRemoveChannel(n){let t=(this.selectedChannel()||[]).filter(i=>i!==n);this.selectedChannel.set(t)}static{this.\u0275fac=function(s){return new(s||e)}}static{this.\u0275cmp=U({type:e,selectors:[["app-user-form"]],features:[I([B])],decls:56,vars:23,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["routerLink","/menu/users/users",1,"btn","btn-secondary","me-3"],[1,"btn","btn-success",3,"click"],[1,"container-fluid","py-5","bg-light-gray"],[1,"row","mt-8"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body","mt-8","pb-4"],[1,"row"],[1,"col-6"],[1,"form-label-group","w-100",3,"ngClass"],["bindLabel","Name","bindValue","ID","placeholder","Select User","id","userSelection",1,"height-sm",3,"ngModelChange","items","ngModel","disabled"],["for","userSelection"],["bindLabel","Name","bindValue","ID","placeholder","Select Group","id","groupSelection",1,"height-sm",3,"ngModelChange","items","ngModel"],["for","groupSelection"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["role","presentation",1,"nav-item"],["id","channel-tab","data-bs-toggle","tab","data-bs-target","#channel-tab-pane","type","button","role","tab","aria-controls","channel-tab-pane","aria-selected","true",1,"nav-link","active"],["id","restriction-tab","data-bs-toggle","tab","data-bs-target","#restriction-tab-pane","type","button","role","tab","aria-controls","restriction-tab-pane","aria-selected","false",1,"nav-link"],[1,"card","rounded-0","border-top-0"],[1,"card-body","pb-4"],["id","myTabContent",1,"tab-content","mt-3"],["id","channel-tab-pane","role","tabpanel","aria-labelledby","channel-tab","tabindex","0",1,"tab-pane","fade","show","active","pb-9"],["variant","on",1,"w-100"],["optionLabel","Name","optionValue","ID","display","chip","id","channelSelection",1,"w-100","channel-multiselect",2,"--p-multiselect-padding-y","14px",3,"ngModelChange","options","ngModel","maxSelectedLabels"],["pTemplate","item"],["pTemplate","selectedItems"],["for","channelSelection"],[1,"mt-4"],["id","restriction-tab-pane","role","tabpanel","aria-labelledby","restriction-tab-pane","tabindex","1",1,"tab-pane","fade"],["matTooltip","How many days of past orders this user can download.","matTooltipPosition","above",1,"form-label-group","mb-3"],["type","text","id","daysRange","name","daysRange","data-toggle","tooltip","title","daysRange","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","daysRange"],[1,"d-flex","align-items-center","gap-2"],[2,"width","18px",3,"src"],[1,"d-flex","flex-wrap","gap-1"],[1,"me-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt","removable"],[1,"me-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"onRemove","label","image","alt","removable"]],template:function(s,t){if(s&1){let i=G();le(0),se(1,"async"),a(2,"mainpanel",0)(3,"actions")(4,"a",1),c(5," Cancel "),r(),a(6,"button",2),P("click",function(){return v(i),C(t.onSave())}),c(7,"Save"),r()(),a(8,"content")(9,"div",3)(10,"div",4)(11,"div",5)(12,"div",6)(13,"div",7)(14,"h3"),c(15,"User Information"),r()(),a(16,"div",8)(17,"div",9)(18,"div",10)(19,"div",11)(20,"ng-select",12),F("ngModelChange",function(m){return v(i),M(t.selectedUser,m)||(t.selectedUser=m),C(m)}),r(),a(21,"label",13),c(22,"Select User"),r()()(),a(23,"div",10)(24,"div",11)(25,"ng-select",14),F("ngModelChange",function(m){return v(i),M(t.selectedGroup,m)||(t.selectedGroup=m),C(m)}),r(),a(26,"label",15),c(27,"Select Group"),r()()()()()()()(),a(28,"div",9)(29,"div",5)(30,"ul",16)(31,"li",17)(32,"button",18),c(33," Channels Filter "),r()(),a(34,"li",17)(35,"button",19),c(36," Restriction "),r()()(),a(37,"div",20)(38,"div",21)(39,"div",22)(40,"div",23)(41,"p-floatlabel",24)(42,"p-multiselect",25),F("ngModelChange",function(m){return v(i),M(t.selectedChannel,m)||(t.selectedChannel=m),C(m)}),u(43,ht,4,2,"ng-template",26)(44,yt,3,1,"ng-template",27),r(),a(45,"label",28),c(46,"Select Channels"),r()(),a(47,"div",29),c(48," When no channel filter is assigned all channel will be visible "),r()(),a(49,"div",30)(50,"div",9)(51,"div",10)(52,"div",31)(53,"input",32),F("ngModelChange",function(m){return v(i),M(t.orderDownloadDaysRange,m)||(t.orderDownloadDaysRange=m),C(m)}),r(),a(54,"label",33),c(55,"Download Order Days Range"),r()()()()()()()()()()()()()}if(s&2){let i=de(1,14,t.userFormLoader$);o(2),l("headerTitle",t.selectedUserName()?" Edit User Access - "+t.selectedUserName():"User Form")("hideSearchBox",!0)("hideSearchDropdown",!0),o(17),l("ngClass",W(16,$e,!t.selectedUser())),o(),l("items",(i==null||i.Options==null?null:i.Options.Users)||R(18,$)),w("ngModel",t.selectedUser),l("disabled",t.isEditMode()),o(4),l("ngClass",W(19,$e,!t.selectedGroup())),o(),l("items",(i==null||i.Options==null?null:i.Options.Groups)||R(21,$)),w("ngModel",t.selectedGroup),o(17),l("options",(i==null||i.Options==null?null:i.Options.Channels)||R(22,$)),w("ngModel",t.selectedChannel),l("maxSelectedLabels",10),o(11),w("ngModel",t.orderDownloadDaysRange)}},dependencies:[N,x,ue,Ue,De,Ce,ye,be,ve,Pe,Ge,k,we,Se,Be,Ve,Oe,Qe,Le,_e,ge,ke,Fe,Me],styles:[`.nav-tabs .nav-link.active:hover,.nav-tabs .nav-link.active:focus,.nav-tabs .nav-item.show .nav-link:hover,.nav-tabs .nav-item.show .nav-link:focus{background-color:#fff!important;border-color:#dee2e6 #dee2e6 #fff}
33
33
  `],encapsulation:2})}}return e})();export{dn as UserFormComponent};
@@ -0,0 +1 @@
1
+ import{a as z,b as B}from"./chunk-FGRPTNDB.js";import{a as W,b as A,c as U}from"./chunk-3PPLPXAX.js";import{b as j}from"./chunk-OXWPLJEW.js";import{na as P}from"./chunk-RC5PUUVM.js";import{i as I}from"./chunk-OLVWSY6L.js";import{A as E,a as k,h as D,m as N}from"./chunk-5PS6ZS3N.js";import{n as F}from"./chunk-FXQKRJWU.js";import{Gb as T,Gc as x,Hc as S,Kb as v,Kc as w,Lc as V,Mb as h,Mc as y,Oa as m,Qc as L,Ra as b,Yb as s,dc as O,ic as p,jc as C,kc as g,oc as f,pa as M,pb as _,rb as d,tc as u,uc as l,ya as a,za as r}from"./chunk-OJMQBH6T.js";function G(t,c){if(t&1&&(p(0,"div",6),g(1,"img",7),p(2,"div"),x(3),C()()),t&2){let e=c.$implicit;d(),s("src",e.logo,_),d(2),S(e.Name)}}function R(t,c){if(t&1){let e=f();p(0,"p-multiselect",4,0),u("click",function(){a(e);let n=l();return r(n.onClickSelect())}),y("ngModelChange",function(n){a(e);let o=l();return V(o.selectedChannels,n)||(o.selectedChannels=n),r(n)}),u("ngModelChange",function(n){a(e);let o=l();return r(o.onChannelChange(n))}),h(2,G,4,2,"ng-template",5),C()}if(t&2){let e=l();s("options",e.options())("placeholder",e.placeholder()),w("ngModel",e.selectedChannels),s("showClear",e.clearable())("autofocusFilter",!0)("maxSelectedLabels",e.maxSelectedLabels())}}function q(t,c){if(t&1&&(p(0,"div",6),g(1,"img",7),p(2,"div"),x(3),C()()),t&2){let e=c.$implicit;d(),s("src",e.logo,_),d(2),S(e.Name)}}function H(t,c){if(t&1){let e=f();p(0,"p-select",8,1),u("click",function(){a(e);let n=l();return r(n.onClickSelect())}),y("ngModelChange",function(n){a(e);let o=l();return V(o.selectedChannels,n)||(o.selectedChannels=n),r(n)}),u("ngModelChange",function(n){a(e);let o=l();return r(o.onChannelChange(n))}),h(2,q,4,2,"ng-template",5),C()}if(t&2){let e=l();s("options",e.options())("placeholder",e.placeholder()),w("ngModel",e.selectedChannels),s("showClear",e.clearable())("autofocusFilter",!0)("filter",!0)}}var re=(()=>{class t extends U{constructor(){super(),this.authService=M(I),this.multiple=m(!1),this.clearable=m(!0),this.placeholder=m("Select Channels"),this.options=b(this.authService.getChannels()),this.maxSelectedLabels=m(6),this.onChange=e=>{}}onChannelChange(e){this.onChange(e)}onClickSelect(){this.initTopPosition(),setTimeout(()=>{this.adjustOverlayPosition()},0)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-channel-options-v2"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"],placeholder:[1,"placeholder"],maxSelectedLabels:[1,"maxSelectedLabels"]},features:[L([{provide:k,multi:!0,useExisting:t}]),v],decls:2,vars:1,consts:[["multiSelect",""],["select",""],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","filter"],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["pTemplate","item"],[1,"d-flex","align-items-center","gap-2"],[2,"width","18px",3,"src"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","filter"]],template:function(i,n){i&1&&h(0,R,3,6,"p-multiselect",2)(1,H,3,6,"p-select",3),i&2&&O(n.multiple()?0:1)},dependencies:[F,B,z,P,j,E,D,N,A,W],encapsulation:2})}}return t})();export{re as a};
@@ -1 +1 @@
1
- import{f as L}from"./chunk-RTF4FRXW.js";import{c as o}from"./chunk-RXQX7567.js";import{H as y,J as D,n as b}from"./chunk-FXQKRJWU.js";import{Gb as v,Gc as u,Ic as d,Mb as I,Oa as _,Tc as C,Yb as s,dc as x,ic as m,ja as h,jc as c,pa as i,pb as k,rb as l,rd as f,uc as p}from"./chunk-OJMQBH6T.js";var O=(()=>{class e{constructor(){this.localDataService=i(L),this.baseUrl=this.localDataService.getHostName()}getBaseUrl(r){let t="";return o.IsNotEmpty(r.ID)?t=`https://${this.baseUrl}/menu/Orders/Orders/Customer_Invoice/Info?ID=${r.ID}`:t="/menu/Order/detail",t}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var S=(e,a)=>({Number:e,Outlet:a});function U(e,a){if(e&1&&(m(0,"a",0),u(1),c()),e&2){let r,t=p();s("href",t.baseUrl(),k),l(),d(" ",(r=t.order())==null?null:r.Number," ")}}function N(e,a){if(e&1&&(m(0,"a",1),u(1),c()),e&2){let r,t,n=p();s("routerLink",n.baseUrl())("queryParams",C(3,S,(r=n.order())==null?null:r.Number,(r=n.order())==null?null:r.Outlet)),l(),d(" ",(t=n.order())==null?null:t.Number," ")}}var G=(()=>{class e{constructor(){this.order=_(),this.generateLinkService=i(O),this.baseUrl=f(()=>this.generateLinkService.getBaseUrl(this.order())),this.hasOrderID=f(()=>o.IsNotEmpty(this.order()?.ID))}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=v({type:e,selectors:[["order-link"]],inputs:{order:[1,"order"]},decls:2,vars:1,consts:[["target","_blank",3,"href"],["target","_blank",3,"routerLink","queryParams"]],template:function(t,n){t&1&&I(0,U,2,2,"a",0)(1,N,2,6,"a",1),t&2&&x(n.hasOrderID()?0:1)},dependencies:[b,D,y],encapsulation:2})}}return e})();export{G as a};
1
+ import{f as L}from"./chunk-OLVWSY6L.js";import{c as o}from"./chunk-RXQX7567.js";import{H as y,J as D,n as b}from"./chunk-FXQKRJWU.js";import{Gb as v,Gc as u,Ic as d,Mb as I,Oa as _,Tc as C,Yb as s,dc as x,ic as m,ja as h,jc as c,pa as i,pb as k,rb as l,rd as f,uc as p}from"./chunk-OJMQBH6T.js";var O=(()=>{class e{constructor(){this.localDataService=i(L),this.baseUrl=this.localDataService.getHostName()}getBaseUrl(r){let t="";return o.IsNotEmpty(r.ID)?t=`https://${this.baseUrl}/menu/Orders/Orders/Customer_Invoice/Info?ID=${r.ID}`:t="/menu/Order/detail",t}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var S=(e,a)=>({Number:e,Outlet:a});function U(e,a){if(e&1&&(m(0,"a",0),u(1),c()),e&2){let r,t=p();s("href",t.baseUrl(),k),l(),d(" ",(r=t.order())==null?null:r.Number," ")}}function N(e,a){if(e&1&&(m(0,"a",1),u(1),c()),e&2){let r,t,n=p();s("routerLink",n.baseUrl())("queryParams",C(3,S,(r=n.order())==null?null:r.Number,(r=n.order())==null?null:r.Outlet)),l(),d(" ",(t=n.order())==null?null:t.Number," ")}}var G=(()=>{class e{constructor(){this.order=_(),this.generateLinkService=i(O),this.baseUrl=f(()=>this.generateLinkService.getBaseUrl(this.order())),this.hasOrderID=f(()=>o.IsNotEmpty(this.order()?.ID))}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=v({type:e,selectors:[["order-link"]],inputs:{order:[1,"order"]},decls:2,vars:1,consts:[["target","_blank",3,"href"],["target","_blank",3,"routerLink","queryParams"]],template:function(t,n){t&1&&I(0,U,2,2,"a",0)(1,N,2,6,"a",1),t&2&&x(n.hasOrderID()?0:1)},dependencies:[b,D,y],encapsulation:2})}}return e})();export{G as a};
@@ -1,4 +1,4 @@
1
- import{a as we}from"./chunk-DAXM2MPK.js";import{a as ft}from"./chunk-XPCRS7AL.js";import{a as bt}from"./chunk-GH5FTODR.js";import{a as _t}from"./chunk-BKRCW7SH.js";import{a as ht,c as mt,d as gt}from"./chunk-QW4EOJRM.js";import{a as yt}from"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as ae}from"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import{a as Ce}from"./chunk-YFDFIBAG.js";import{A as st,P as ce,R as C,S as M,T as Oe,V as ve,_ as ct,aa as lt,f as tt,fa as rt,k as it,ka as pt,n as nt,na as dt,oa as U,pa as ut,q as ot,r as se,x as at}from"./chunk-RC5PUUVM.js";import"./chunk-CGOB6Y3X.js";import{b as je}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{m as Ze,n as et}from"./chunk-HJXYT6MI.js";import{A as Ue,a as qe,b as ze,h as Qe,m as We}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as Xe,b as Je,c as Ye}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as Ne,J as He,d as _e,f as Ke,g as ye,h as Re,i as be,j as Ae,m as Be,n as W}from"./chunk-FXQKRJWU.js";import{$b as Ee,$c as ne,Ac as B,Bc as O,Ca as ke,Cc as v,Fc as te,Gb as A,Gc as g,Hb as Me,Hc as R,Ic as $,Ka as w,Kb as pe,Kc as N,Lc as H,Mb as m,Mc as q,Nc as ue,Oc as Pe,Pc as he,Qc as ie,Ra as V,Rc as fe,Sc as z,Tc as $e,Xb as _,Yb as r,Z as le,ac as Z,ad as oe,cd as Q,dc as de,ec as Le,gc as Fe,hc as Ge,ia as Ie,ic as d,ja as Te,jc as u,ka as Se,kc as P,lc as x,mc as I,nc as ee,oc as T,od as S,pa as K,pd as me,q as xe,rb as c,rd as ge,sd as De,tc as y,uc as p,xa as Ve,xb as re,ya as h,za as f,zc as k}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as L,b as F}from"./chunk-66YHNWRR.js";var xt=t=>({$implicit:t});function It(t,s){t&1&&ee(0)}function Tt(t,s){if(t&1&&(x(0),m(1,It,1,0,"ng-container",8),I()),t&2){let e=p().$implicit,n=p();c(),r("ngTemplateOutlet",n.optionTemplate)("ngTemplateOutletContext",z(2,xt,e==null?null:e.option))}}function St(t,s){if(t&1&&(d(0,"span",9),g(1),u()),t&2){let e=p().$implicit,n=p();_("data-pc-section","text"),c(),R(n.getOptionLabelToRender(e))}}function Vt(t,s){t&1&&P(0,"AngleRightIcon")}function kt(t,s){}function Mt(t,s){t&1&&m(0,kt,0,0,"ng-template")}function Et(t,s){if(t&1&&(d(0,"span",10),m(1,Vt,1,0,"AngleRightIcon",11)(2,Mt,1,0,null,12),u()),t&2){let e=p(2);_("data-pc-section","groupIcon"),c(),r("ngIf",!e.groupicon),c(),r("ngTemplateOutlet",e.groupicon)}}function Lt(t,s){if(t&1){let e=T();d(0,"p-cascadeselect-sub",13),y("onChange",function(i){h(e);let o=p(2);return f(o.onChange.emit(i))})("onFocusChange",function(i){h(e);let o=p(2);return f(o.onFocusChange.emit(i))})("onFocusEnterChange",function(i){h(e);let o=p(2);return f(o.onFocusEnterChange.emit(i))}),u()}if(t&2){let e=p().$implicit,n=p();r("role","group")("selectId",n.selectId)("focusedOptionId",n.focusedOptionId)("activeOptionPath",n.activeOptionPath)("options",n.getOptionGroupChildren(e))("optionLabel",n.optionLabel)("optionValue",n.optionValue)("level",n.level+1)("optionGroupLabel",n.optionGroupLabel)("optionGroupChildren",n.optionGroupChildren)("dirty",n.dirty)("optionTemplate",n.optionTemplate)}}function Ft(t,s){if(t&1){let e=T();d(0,"li",3)(1,"div",4),y("click",function(i){let o=h(e).$implicit,a=p();return f(a.onOptionClick(i,o))})("mouseenter",function(i){let o=h(e).$implicit,a=p();return f(a.onOptionMouseEnter(i,o))})("mousemove",function(i){let o=h(e).$implicit,a=p();return f(a.onOptionMouseMove(i,o))}),m(2,Tt,2,4,"ng-container",5)(3,St,2,2,"ng-template",null,0,Q)(5,Et,3,3,"span",6),u(),m(6,Lt,1,12,"p-cascadeselect-sub",7),u()}if(t&2){let e=s.$implicit,n=s.index,i=te(4),o=p();r("ngClass",o.getItemClass(e))("id",o.getOptionId(e)),_("aria-level",o.level+1)("aria-setsize",o.options.length)("data-pc-section","item")("aria-label",o.getOptionLabelToRender(e))("aria-selected",o.isOptionGroup(e)?void 0:o.isOptionSelected(e))("aria-posinset",n+1),c(),_("data-pc-section","content"),c(),r("ngIf",o.optionTemplate)("ngIfElse",i),c(3),r("ngIf",o.isOptionGroup(e)),c(),r("ngIf",o.isOptionGroup(e)&&o.isOptionActive(e))}}var Gt=["value"],Pt=["option"],$t=["header"],Dt=["footer"],Kt=["triggericon"],Rt=["loadingicon"],At=["optiongroupicon"],Bt=["clearicon"],Nt=["focusInput"],Ht=["container"],qt=["panel"],zt=["overlay"],Qt=(t,s)=>({$implicit:t,placeholder:s}),Wt=t=>({"p-cascadeselect-overlay p-component":!0,"p-cascadeselect-mobile-active":t});function Ut(t,s){t&1&&ee(0)}function jt(t,s){if(t&1&&(x(0),m(1,Ut,1,0,"ng-container",16),I()),t&2){let e=p();c(),r("ngTemplateOutlet",e.valueTemplate||e._valueTemplate)("ngTemplateOutletContext",$e(2,Qt,e.value,e.placeholder))}}function Xt(t,s){if(t&1&&g(0),t&2){let e=p();$(" ",e.label()," ")}}function Jt(t,s){if(t&1){let e=T();d(0,"TimesIcon",18),y("click",function(i){h(e);let o=p(2);return f(o.clear(i))}),u()}t&2&&_("data-pc-section","clearicon")("aria-hidden",!0)}function Yt(t,s){}function Zt(t,s){t&1&&m(0,Yt,0,0,"ng-template")}function ei(t,s){if(t&1){let e=T();d(0,"span",18),y("click",function(i){h(e);let o=p(2);return f(o.clear(i))}),m(1,Zt,1,0,null,19),u()}if(t&2){let e=p(2);_("data-pc-section","clearicon")("aria-hidden",!0),c(),r("ngTemplateOutlet",e.clearIconTemplate||e._clearIconTemplate)}}function ti(t,s){if(t&1&&(x(0),m(1,Jt,1,2,"TimesIcon",17)(2,ei,2,3,"span",17),I()),t&2){let e=p();c(),r("ngIf",!e.clearIconTemplate&&!e._clearIconTemplate),c(),r("ngIf",e.clearIconTemplate||e._clearIconTemplate)}}function ii(t,s){t&1&&ee(0)}function ni(t,s){if(t&1&&(x(0),m(1,ii,1,0,"ng-container",19),I()),t&2){let e=p(2);c(),r("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function oi(t,s){if(t&1&&P(0,"span",22),t&2){let e=p(3);r("ngClass","p-cascadeselect-loading-icon pi-spin "+e.loadingIcon)}}function ai(t,s){t&1&&P(0,"span",23),t&2&&Z("p-cascadeselect-loading-icon pi pi-spinner pi-spin")}function si(t,s){if(t&1&&(x(0),m(1,oi,1,1,"span",20)(2,ai,1,2,"span",21),I()),t&2){let e=p(2);c(),r("ngIf",e.loadingIcon),c(),r("ngIf",!e.loadingIcon)}}function ci(t,s){if(t&1&&(x(0),m(1,ni,2,1,"ng-container",12)(2,si,3,2,"ng-container",12),I()),t&2){let e=p();c(),r("ngIf",e.loadingIconTemplate||e._loadingIconTemplate),c(),r("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate)}}function li(t,s){t&1&&P(0,"ChevronDownIcon",26),t&2&&r("styleClass","p-cascadeselect-dropdown-icon")}function ri(t,s){}function pi(t,s){t&1&&m(0,ri,0,0,"ng-template")}function di(t,s){if(t&1&&(d(0,"span",27),m(1,pi,1,0,null,19),u()),t&2){let e=p(2);c(),r("ngTemplateOutlet",e.triggerIconTemplate||e._triggerIconTemplate)}}function ui(t,s){if(t&1&&m(0,li,1,1,"ChevronDownIcon",24)(1,di,2,1,"span",25),t&2){let e=p();r("ngIf",!e.triggerIconTemplate&&!e._triggerIconTemplate),c(),r("ngIf",e.triggerIconTemplate||e._triggerIconTemplate)}}function hi(t,s){}function fi(t,s){t&1&&m(0,hi,0,0,"ng-template")}function mi(t,s){}function gi(t,s){t&1&&m(0,mi,0,0,"ng-template")}function _i(t,s){if(t&1){let e=T();d(0,"div",28,6),m(2,fi,1,0,null,19),d(3,"div",29)(4,"p-cascadeselect-sub",30),y("onChange",function(i){h(e);let o=p();return f(o.onOptionClick(i))})("onFocusChange",function(i){h(e);let o=p();return f(o.onOptionMouseMove(i))})("onFocusEnterChange",function(i){h(e);let o=p();return f(o.onOptionMouseEnter(i))}),u()(),d(5,"span",14),g(6),u(),m(7,gi,1,0,null,19),u()}if(t&2){let e=p();Z(e.panelStyleClass),r("ngClass",z(24,Wt,e.queryMatches()))("ngStyle",e.panelStyle),_("data-pc-section","panel"),c(2),r("ngTemplateOutlet",e.headerTemplate||e._headerTemplate),c(),_("data-pc-section","wrapper"),c(),r("options",e.processedOptions)("selectId",e.id)("focusedOptionId",e.focused?e.focusedOptionId:void 0)("activeOptionPath",e.activeOptionPath())("optionLabel",e.optionLabel)("optionValue",e.optionValue)("level",0)("optionTemplate",e.optionTemplate||e._optionTemplate)("groupicon",e.groupIconTemplate||e.groupIconTemplate)("optionGroupLabel",e.optionGroupLabel)("optionGroupChildren",e.optionGroupChildren)("optionDisabled",e.optionDisabled)("root",!0)("dirty",e.dirty)("role","tree"),c(2),$(" ",e.selectedMessageText," "),c(),r("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}var yi=({dt:t})=>`
1
+ import{a as we}from"./chunk-DAXM2MPK.js";import{a as ft}from"./chunk-XPCRS7AL.js";import{a as bt}from"./chunk-GH5FTODR.js";import{a as ae}from"./chunk-UMP6ZMEJ.js";import{a as _t}from"./chunk-BKRCW7SH.js";import{a as ht,c as mt,d as gt}from"./chunk-QW4EOJRM.js";import{a as yt}from"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-OZ7LWNOK.js";import{a as Ce}from"./chunk-YFDFIBAG.js";import{A as st,P as ce,R as C,S as M,T as Oe,V as ve,_ as ct,aa as lt,f as tt,fa as rt,k as it,ka as pt,n as nt,na as dt,oa as U,pa as ut,q as ot,r as se,x as at}from"./chunk-RC5PUUVM.js";import"./chunk-CGOB6Y3X.js";import{b as je}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{m as Ze,n as et}from"./chunk-HJXYT6MI.js";import{A as Ue,a as qe,b as ze,h as Qe,m as We}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as Xe,b as Je,c as Ye}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as Ne,J as He,d as _e,f as Ke,g as ye,h as Re,i as be,j as Ae,m as Be,n as W}from"./chunk-FXQKRJWU.js";import{$b as Ee,$c as ne,Ac as B,Bc as O,Ca as ke,Cc as v,Fc as te,Gb as A,Gc as g,Hb as Me,Hc as R,Ic as $,Ka as w,Kb as pe,Kc as N,Lc as H,Mb as m,Mc as q,Nc as ue,Oc as Pe,Pc as he,Qc as ie,Ra as V,Rc as fe,Sc as z,Tc as $e,Xb as _,Yb as r,Z as le,ac as Z,ad as oe,cd as Q,dc as de,ec as Le,gc as Fe,hc as Ge,ia as Ie,ic as d,ja as Te,jc as u,ka as Se,kc as P,lc as x,mc as I,nc as ee,oc as T,od as S,pa as K,pd as me,q as xe,rb as c,rd as ge,sd as De,tc as y,uc as p,xa as Ve,xb as re,ya as h,za as f,zc as k}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as L,b as F}from"./chunk-66YHNWRR.js";var xt=t=>({$implicit:t});function It(t,s){t&1&&ee(0)}function Tt(t,s){if(t&1&&(x(0),m(1,It,1,0,"ng-container",8),I()),t&2){let e=p().$implicit,n=p();c(),r("ngTemplateOutlet",n.optionTemplate)("ngTemplateOutletContext",z(2,xt,e==null?null:e.option))}}function St(t,s){if(t&1&&(d(0,"span",9),g(1),u()),t&2){let e=p().$implicit,n=p();_("data-pc-section","text"),c(),R(n.getOptionLabelToRender(e))}}function Vt(t,s){t&1&&P(0,"AngleRightIcon")}function kt(t,s){}function Mt(t,s){t&1&&m(0,kt,0,0,"ng-template")}function Et(t,s){if(t&1&&(d(0,"span",10),m(1,Vt,1,0,"AngleRightIcon",11)(2,Mt,1,0,null,12),u()),t&2){let e=p(2);_("data-pc-section","groupIcon"),c(),r("ngIf",!e.groupicon),c(),r("ngTemplateOutlet",e.groupicon)}}function Lt(t,s){if(t&1){let e=T();d(0,"p-cascadeselect-sub",13),y("onChange",function(i){h(e);let o=p(2);return f(o.onChange.emit(i))})("onFocusChange",function(i){h(e);let o=p(2);return f(o.onFocusChange.emit(i))})("onFocusEnterChange",function(i){h(e);let o=p(2);return f(o.onFocusEnterChange.emit(i))}),u()}if(t&2){let e=p().$implicit,n=p();r("role","group")("selectId",n.selectId)("focusedOptionId",n.focusedOptionId)("activeOptionPath",n.activeOptionPath)("options",n.getOptionGroupChildren(e))("optionLabel",n.optionLabel)("optionValue",n.optionValue)("level",n.level+1)("optionGroupLabel",n.optionGroupLabel)("optionGroupChildren",n.optionGroupChildren)("dirty",n.dirty)("optionTemplate",n.optionTemplate)}}function Ft(t,s){if(t&1){let e=T();d(0,"li",3)(1,"div",4),y("click",function(i){let o=h(e).$implicit,a=p();return f(a.onOptionClick(i,o))})("mouseenter",function(i){let o=h(e).$implicit,a=p();return f(a.onOptionMouseEnter(i,o))})("mousemove",function(i){let o=h(e).$implicit,a=p();return f(a.onOptionMouseMove(i,o))}),m(2,Tt,2,4,"ng-container",5)(3,St,2,2,"ng-template",null,0,Q)(5,Et,3,3,"span",6),u(),m(6,Lt,1,12,"p-cascadeselect-sub",7),u()}if(t&2){let e=s.$implicit,n=s.index,i=te(4),o=p();r("ngClass",o.getItemClass(e))("id",o.getOptionId(e)),_("aria-level",o.level+1)("aria-setsize",o.options.length)("data-pc-section","item")("aria-label",o.getOptionLabelToRender(e))("aria-selected",o.isOptionGroup(e)?void 0:o.isOptionSelected(e))("aria-posinset",n+1),c(),_("data-pc-section","content"),c(),r("ngIf",o.optionTemplate)("ngIfElse",i),c(3),r("ngIf",o.isOptionGroup(e)),c(),r("ngIf",o.isOptionGroup(e)&&o.isOptionActive(e))}}var Gt=["value"],Pt=["option"],$t=["header"],Dt=["footer"],Kt=["triggericon"],Rt=["loadingicon"],At=["optiongroupicon"],Bt=["clearicon"],Nt=["focusInput"],Ht=["container"],qt=["panel"],zt=["overlay"],Qt=(t,s)=>({$implicit:t,placeholder:s}),Wt=t=>({"p-cascadeselect-overlay p-component":!0,"p-cascadeselect-mobile-active":t});function Ut(t,s){t&1&&ee(0)}function jt(t,s){if(t&1&&(x(0),m(1,Ut,1,0,"ng-container",16),I()),t&2){let e=p();c(),r("ngTemplateOutlet",e.valueTemplate||e._valueTemplate)("ngTemplateOutletContext",$e(2,Qt,e.value,e.placeholder))}}function Xt(t,s){if(t&1&&g(0),t&2){let e=p();$(" ",e.label()," ")}}function Jt(t,s){if(t&1){let e=T();d(0,"TimesIcon",18),y("click",function(i){h(e);let o=p(2);return f(o.clear(i))}),u()}t&2&&_("data-pc-section","clearicon")("aria-hidden",!0)}function Yt(t,s){}function Zt(t,s){t&1&&m(0,Yt,0,0,"ng-template")}function ei(t,s){if(t&1){let e=T();d(0,"span",18),y("click",function(i){h(e);let o=p(2);return f(o.clear(i))}),m(1,Zt,1,0,null,19),u()}if(t&2){let e=p(2);_("data-pc-section","clearicon")("aria-hidden",!0),c(),r("ngTemplateOutlet",e.clearIconTemplate||e._clearIconTemplate)}}function ti(t,s){if(t&1&&(x(0),m(1,Jt,1,2,"TimesIcon",17)(2,ei,2,3,"span",17),I()),t&2){let e=p();c(),r("ngIf",!e.clearIconTemplate&&!e._clearIconTemplate),c(),r("ngIf",e.clearIconTemplate||e._clearIconTemplate)}}function ii(t,s){t&1&&ee(0)}function ni(t,s){if(t&1&&(x(0),m(1,ii,1,0,"ng-container",19),I()),t&2){let e=p(2);c(),r("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function oi(t,s){if(t&1&&P(0,"span",22),t&2){let e=p(3);r("ngClass","p-cascadeselect-loading-icon pi-spin "+e.loadingIcon)}}function ai(t,s){t&1&&P(0,"span",23),t&2&&Z("p-cascadeselect-loading-icon pi pi-spinner pi-spin")}function si(t,s){if(t&1&&(x(0),m(1,oi,1,1,"span",20)(2,ai,1,2,"span",21),I()),t&2){let e=p(2);c(),r("ngIf",e.loadingIcon),c(),r("ngIf",!e.loadingIcon)}}function ci(t,s){if(t&1&&(x(0),m(1,ni,2,1,"ng-container",12)(2,si,3,2,"ng-container",12),I()),t&2){let e=p();c(),r("ngIf",e.loadingIconTemplate||e._loadingIconTemplate),c(),r("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate)}}function li(t,s){t&1&&P(0,"ChevronDownIcon",26),t&2&&r("styleClass","p-cascadeselect-dropdown-icon")}function ri(t,s){}function pi(t,s){t&1&&m(0,ri,0,0,"ng-template")}function di(t,s){if(t&1&&(d(0,"span",27),m(1,pi,1,0,null,19),u()),t&2){let e=p(2);c(),r("ngTemplateOutlet",e.triggerIconTemplate||e._triggerIconTemplate)}}function ui(t,s){if(t&1&&m(0,li,1,1,"ChevronDownIcon",24)(1,di,2,1,"span",25),t&2){let e=p();r("ngIf",!e.triggerIconTemplate&&!e._triggerIconTemplate),c(),r("ngIf",e.triggerIconTemplate||e._triggerIconTemplate)}}function hi(t,s){}function fi(t,s){t&1&&m(0,hi,0,0,"ng-template")}function mi(t,s){}function gi(t,s){t&1&&m(0,mi,0,0,"ng-template")}function _i(t,s){if(t&1){let e=T();d(0,"div",28,6),m(2,fi,1,0,null,19),d(3,"div",29)(4,"p-cascadeselect-sub",30),y("onChange",function(i){h(e);let o=p();return f(o.onOptionClick(i))})("onFocusChange",function(i){h(e);let o=p();return f(o.onOptionMouseMove(i))})("onFocusEnterChange",function(i){h(e);let o=p();return f(o.onOptionMouseEnter(i))}),u()(),d(5,"span",14),g(6),u(),m(7,gi,1,0,null,19),u()}if(t&2){let e=p();Z(e.panelStyleClass),r("ngClass",z(24,Wt,e.queryMatches()))("ngStyle",e.panelStyle),_("data-pc-section","panel"),c(2),r("ngTemplateOutlet",e.headerTemplate||e._headerTemplate),c(),_("data-pc-section","wrapper"),c(),r("options",e.processedOptions)("selectId",e.id)("focusedOptionId",e.focused?e.focusedOptionId:void 0)("activeOptionPath",e.activeOptionPath())("optionLabel",e.optionLabel)("optionValue",e.optionValue)("level",0)("optionTemplate",e.optionTemplate||e._optionTemplate)("groupicon",e.groupIconTemplate||e.groupIconTemplate)("optionGroupLabel",e.optionGroupLabel)("optionGroupChildren",e.optionGroupChildren)("optionDisabled",e.optionDisabled)("root",!0)("dirty",e.dirty)("role","tree"),c(2),$(" ",e.selectedMessageText," "),c(),r("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}var yi=({dt:t})=>`
2
2
  .p-cascadeselect {
3
3
  display: inline-flex;
4
4
  cursor: pointer;
@@ -0,0 +1 @@
1
+ import{a as k}from"./chunk-PIBVGTHJ.js";import{a as Ve}from"./chunk-GH5FTODR.js";import{a as Y}from"./chunk-UMP6ZMEJ.js";import{a as Me,c as be}from"./chunk-3PPLPXAX.js";import{a as ke,b as Ee}from"./chunk-EPBVNII2.js";import{b as Te,c as De}from"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{d as Ce,e as fe}from"./chunk-PYXL7UF7.js";import{a as ue}from"./chunk-Z3ITXK3D.js";import"./chunk-CGOB6Y3X.js";import{b as Z}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as de}from"./chunk-RXQX7567.js";import{b as xe,c as te,d as ye,j as Se,k as ve,m as Ue,n as we}from"./chunk-HJXYT6MI.js";import{A as H,b as me,h as q,m as j}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as _e,b as ge,c as he}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ce,J as pe,j as $,n as z}from"./chunk-FXQKRJWU.js";import{$b as K,$c as F,G as se,Gb as B,Gc as g,Hc as Q,Ic as D,Kb as le,Kc as U,Lc as w,Mb as f,Mc as M,Nc as O,Oc as N,Pc as h,Qc as W,Ra as S,Rc as X,Sc as ee,Yb as _,Z as E,ad as A,dc as v,ea as J,ec as V,gc as P,hc as I,ic as o,jc as s,kc as L,lc as b,mc as T,oc as y,pa as x,pb as ae,q as oe,rb as a,rd as R,tc as C,uc as l,v as G,ya as c,za as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as ne,b as re}from"./chunk-66YHNWRR.js";var ie=function(i){return i.ERROR="https://res.cloudinary.com/pos/image/upload/v1705387550/POS/Images/Cashier/globalerror.svg",i.UNAUTHORIZED="https://res.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",i.EMPTY_LIST="https://res.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg",i.REMOVE="https://res.cloudinary.com/pos/image/upload/v1706156973/icons/globalerrorclear.svg",i}(ie||{});var Pe=()=>({display:"d-flex"});function Ae(i,m){if(i&1&&(o(0,"div",6),L(1,"img",9),o(2,"p",10),g(3," All users already migrated. "),s()()),i&2){let e=l();a(),_("src",e.emptyStateIcon,ae)}}function Re(i,m){if(i&1){let e=y();o(0,"div",14)(1,"p-checkBox",15),M("ngModelChange",function(t){let n=c(e).$implicit;return w(n.selected,t)||(n.selected=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(2),n=h(0);return p(t.onUserCheckChange(n))}),s(),o(2,"label",16),g(3),s()()}if(i&2){let e=m.$implicit;a(),K(X(7,Pe)),_("binary",!0)("id",e.ID),U("ngModel",e.selected),a(),_("for",e.ID),a(),D(" ",e.Name," ")}}function Ge(i,m){if(i&1){let e=y();o(0,"div",11)(1,"p-checkBox",12),M("ngModelChange",function(t){c(e);let n=l();return w(n.isCheckAll,t)||(n.isCheckAll=t),p(t)}),C("ngModelChange",function(t){c(e);let n=l(),d=h(0);return p(n.onCheckAllChange(t,d))}),s(),o(2,"label",13),g(3," Check All "),s()(),P(4,Re,4,8,"div",14,V)}if(i&2){let e=l(),r=h(0);a(),K(X(4,Pe)),_("binary",!0),U("ngModel",e.isCheckAll),a(3),I(r)}}var Ie=(()=>{class i extends be{constructor(){super(),this.dialogRef=x(xe),this.data=x(te),this.userService=x(k),this.dialogData=x(te),this.toastr=x(Z),this.userGroups=R(()=>this.dialogData.userGroups||[]),this.availableUsers=R(()=>{let e=new Map;return this.dialogData.availableUsers.forEach(r=>e.set(r.ID,r)),e}),this.migrateLoader$=this.userService.getUserMigrateLoader().pipe(G(e=>e.Data),G(e=>e.filter(t=>this.availableUsers().has(t.ID)===!1)),G(e=>e.map(t=>(t.selected=!0,t))),E(1)),this.isCheckAll=S(!0),this.selectedGroup=S(null),this.emptyStateIcon=ie.EMPTY_LIST,this.config=new Se,this.config.title="Migrate Users",this.config.customWidth="600px"}ngAfterViewInit(){this.initTopPosition()}ngOnDestroy(){this.stopOverlayObserver()}onUserCheckChange(e){let r=e.every(t=>t.selected);this.isCheckAll.set(r)}onCheckAllChange(e,r){this.isCheckAll.set(e),r.forEach(t=>t.selected=e)}onClose(){this.dialogRef.close(!1)}onSubmit(e){let r=e.filter(n=>n.selected);if(r.length===0){this.toastr.error("Please select at least one user","Error");return}if(de.IsEmpty(this.selectedGroup())){this.toastr.error("Please select a user group","Error");return}let t={userIds:r.map(n=>n.ID),groupId:this.selectedGroup()};this.userService.migrateUser(t).subscribe(()=>{this.dialogRef.close(!0),this.toastr.success("Users migrated successfully","Success")})}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-migrate-dialog"]],features:[W([k]),le],decls:15,vars:8,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[1,"row"],[1,"col","border-end"],[1,"modal-title","mb-8"],[1,"user-list-scroll","mt-5",2,"max-height","300x","overflow-y","auto","overflow-x","hidden","box-sizing","border-box"],[1,"d-flex","flex-column","align-items-center","mt-5"],[1,"col"],["optionLabel","Name","optionValue","ID","placeholder","Select a group","filterBy","Name","appendTo","body",1,"w-100",3,"click","ngModelChange","options","filter","ngModel"],["alt","No users found",2,"width","100px","height","100px",3,"src"],[1,"text-muted","mt-4","opacity-50",2,"margin-bottom","0px"],[1,"d-flex","w-100","align-items-center","mb-4"],["id","checkBoxAll",3,"ngModelChange","binary","ngModel"],["for","checkBoxAll",1,"ms-2"],[1,"d-flex","w-100","align-items-center","mb-3","ms-10"],[3,"ngModelChange","binary","id","ngModel"],[1,"ms-2",3,"for"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),o(2,"modal-material",0),C("onClose",function(){return c(n),p(t.onClose())})("onCancel",function(){return c(n),p(t.onClose())})("onOk",function(){c(n);let u=h(0);return p(t.onSubmit(u))}),o(3,"div",1)(4,"div",2)(5,"div",3)(6,"h5",4),g(7,"Users from POS"),s(),o(8,"div",5),f(9,Ae,4,1,"div",6)(10,Ge,6,5),s()(),o(11,"div",7)(12,"h5",4),g(13,"Assign Group"),s(),o(14,"p-select",8),C("click",function(){return c(n),p(t.onClickSelect())}),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()()()()}if(r&2){let n=N(A(1,5,t.migrateLoader$));a(2),_("config",t.config),a(7),v((n==null?null:n.length)===0?9:10),a(5),_("options",t.userGroups())("filter",!0),U("ngModel",t.selectedGroup)}},dependencies:[z,$,ve,H,q,j,Te,Me],styles:[".user-list-scroll[_ngcontent-%COMP%]{max-height:160px;overflow-y:auto;overflow-x:hidden;box-sizing:border-box}"]})}}return i})();var Le=i=>({ID:i});function Be(i,m){if(i&1){let e=y();o(0,"button",13),C("click",function(){c(e);let t=l(2),n=h(0);return p(t.onDeleteUser(n==null?null:n.Filter))}),L(1,"i",14),g(2),s()}if(i&2){let e,r=l(2);a(2),D(" Delete (",(e=r.selectedUsers())==null?null:e.length,") ")}}function We(i,m){if(i&1&&(b(0),f(1,Be,3,1,"button",12),T()),i&2){let e,r=l();a(),v(((e=r.selectedUsers())==null?null:e.length)>0?1:-1)}}function $e(i,m){if(i&1){let e=y();b(0),o(1,"button",15),C("click",function(){c(e);let t=l(),n=h(0),d=h(2);return p(t.onMigrateUser(n==null||n.Options==null?null:n.Options.Groups,d==null?null:d.Data))}),g(2," Migrate "),s(),T()}}function ze(i,m){i&1&&(b(0),o(1,"a",16),g(2," Invite "),s(),T())}function qe(i,m){if(i&1){let e=y();b(0),o(1,"th",17)(2,"div",18)(3,"input",19),C("change",function(t){c(e);let n=l(),d=h(2);return p(n.onCheckAllUser(t.target.checked,d==null?null:d.Data))}),s()()(),T()}}function je(i,m){if(i&1){let e=y();o(0,"div",18)(1,"input",23),M("ngModelChange",function(t){c(e);let n=l(2).$implicit;return w(n.checked,t)||(n.checked=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(3),n=h(2);return p(t.onSelectUser(n==null?null:n.Data))}),s()()}if(i&2){let e=l(2).$implicit;a(),U("ngModel",e.checked)}}function He(i,m){if(i&1&&(b(0),o(1,"td"),f(2,je,2,1,"div",18),s(),T()),i&2){let e,r=l().$implicit,t=l();a(2),v(r.Name!==((e=t.currentLoginUser())==null?null:e.username)?2:-1)}}function Ye(i,m){if(i&1&&(o(0,"a",20),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.UserID)),a(),D(" ",e.Name," ")}}function Ze(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.Name)}}function Je(i,m){if(i&1&&(o(0,"a",21),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.GroupID)),a(),D(" ",e.GroupName," ")}}function Ke(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.GroupName)}}function Qe(i,m){if(i&1&&L(0,"p-chip",24),i&2){let e=m.$implicit;_("label",e.Name)("image",e.Logo)("alt",e.Name)}}function Xe(i,m){if(i&1&&P(0,Qe,1,3,"p-chip",24,V),i&2){let e=l().$implicit;I(e.Channels)}}function et(i,m){i&1&&(o(0,"span"),g(1,"All Channels"),s())}function tt(i,m){if(i&1&&(o(0,"tr"),f(1,He,3,1,"ng-container",3),o(2,"td"),f(3,Ye,2,4,"a",20)(4,Ze,2,1,"span"),s(),o(5,"td"),f(6,Je,2,4,"a",21)(7,Ke,2,1,"span"),s(),o(8,"td")(9,"div",22),f(10,Xe,2,0)(11,et,2,0,"span"),s()()()),i&2){let e=m.$implicit,r=l();a(),_("ngxPermissionsOnly",r.userDeleteRole),a(2),v(r.hasUserEditRole()?3:4),a(3),v(r.hasUserEditRole()?6:7),a(4),v((e.Channels==null?null:e.Channels.length)>0?10:11)}}function it(i,m){if(i&1){let e=y();o(0,"app-mat-paginator-no-count",25),C("next",function(){c(e);let t=l(),n=h(0);return p(t.onNextPage(n==null?null:n.Filter))})("previous",function(){c(e);let t=l(),n=h(0);return p(t.onPrevPage(n==null?null:n.Filter))}),s()}if(i&2){l();let e=h(0),r=h(2);_("filter",e==null?null:e.Filter)("totaldata",r==null||r.Data==null?null:r.Data.length)("paginationTotal",r==null?null:r.Count)("hasClicked",!0)("alwaysShowNextButton",!0)}}var zt=(()=>{class i{constructor(){this.usersService=x(k),this.permissionService=x(_e),this.toastService=x(Z),this.dialog=x(ye),this.userInviteOptions=S([]),this.searchText=S(null),this.selectedGroup=S(null),this.userLoader$=this.usersService.getLoader().pipe(J(e=>{this.userInviteOptions.set(e.Options.Users),this.initUsers(e.Filter)}),E(1)),this.users$=oe({Count:0,Data:[]}),this.userAddRole=Y.UserInvite,this.userDeleteRole=Y.UserDelete,this.hasUserEditRole=S(!1),this.selectedUsers=S([]),this.currentLoginUser=R(()=>{let e=localStorage.getItem(ue.AUTHORIZATION);return e?JSON.parse(e):null}),this.permissionService.hasPermission(Y.UserEdit).then(e=>{this.hasUserEditRole.set(e)})}initUsers(e){let r=re(ne({},e),{Name:this.searchText(),GroupID:this.selectedGroup()});this.users$=this.usersService.getUsers(r).pipe(J(t=>this.filterUserInvtiteOptions(t.Data)),E(1))}filterUserInvtiteOptions(e){this.userInviteOptions.update(r=>r.filter(t=>e.findIndex(n=>n.UserID===t.ID)===-1))}onCheckAllUser(e,r){r.forEach(n=>{n.Name!==this.currentLoginUser()?.username&&(n.checked=e)});let t=r.filter(n=>n.checked);this.selectedUsers.set(t)}onSelectUser(e){let r=e.filter(t=>t.checked);this.selectedUsers.set(r)}onDeleteUser(e={PageNumber:1,PageSize:10}){let r=this.selectedUsers().map(n=>n.UserID);confirm("Are you sure you want to delete selected users?")&&this.usersService.deleteUsers(r).subscribe(()=>{this.selectedUsers.set([]),this.toastService.success("User deleted successfully","Success"),this.initUsers(e)})}onMigrateUser(e,r){this.dialog.open(Ie,{data:{userGroups:e,availableUsers:r}}).afterClosed().pipe(se(t=>t===!0)).subscribe(()=>{this.initUsers({PageNumber:1,PageSize:10})})}onNextPage(e){e.PageNumber+=1,this.initUsers(e)}onPrevPage(e){e.PageNumber-=1,this.initUsers(e)}onSuccessUpdateUser(e){e.PageNumber=1,this.initUsers(e)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-users"]],features:[W([k])],decls:33,vars:17,consts:[["headerTitle","Users","description","Manage your users and their permissions",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","ID","placeholder","Select Group",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[4,"ngxPermissionsOnly"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","15%"],[3,"filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"],[3,"onSuccessUpdateUser","groups","users"],[1,"btn","btn-danger","me-3"],[1,"btn","btn-danger","me-3",3,"click"],[1,"fa","fa-trash","me-1"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-success"],[2,"width","5px"],[1,"d-flex"],["name","selectAll","type","checkbox",3,"change"],["routerLink","/menu/users/users/info",3,"queryParams"],["routerLink","/menu/users/groups/info",3,"queryParams"],[1,"lh-base"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),O(2),F(3,"async"),o(4,"mainpanel",0),M("textChange",function(u){return c(n),w(t.searchText,u)||(t.searchText=u),p(u)}),C("onSubmit",function(){c(n);let u=h(0);return p(t.initUsers(u==null?null:u.Filter))}),o(5,"filters")(6,"div")(7,"label",1),g(8,"Group"),s(),o(9,"ng-select",2),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()(),o(10,"actions"),f(11,We,2,1,"ng-container",3)(12,$e,3,0,"ng-container",3)(13,ze,3,0,"ng-container",3),s(),o(14,"content")(15,"div",4)(16,"div",5)(17,"div",6)(18,"table",7)(19,"thead",8)(20,"tr"),f(21,qe,4,0,"ng-container",3),o(22,"th",9),g(23,"Login ID"),s(),o(24,"th",9),g(25,"Group"),s(),o(26,"th"),g(27,"Channel"),s()()(),o(28,"tbody"),P(29,tt,12,4,"tr",null,V),s()(),f(31,it,1,5,"app-mat-paginator-no-count",10),s()()()()(),o(32,"invite-group",11),C("onSuccessUpdateUser",function(){c(n);let u=h(0);return p(t.onSuccessUpdateUser(u==null?null:u.Filter))}),s()}if(r&2){let n=N(A(1,11,t.userLoader$));a(2);let d=N(A(3,14,t.users$));a(2),U("text",t.searchText),a(5),_("clearable",!0)("items",n==null||n.Options==null?null:n.Options.Groups),U("ngModel",t.selectedGroup),a(2),_("ngxPermissionsOnly",t.userDeleteRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(8),_("ngxPermissionsOnly",t.userDeleteRole),a(8),I(d==null?null:d.Data),a(2),v(n?31:-1),a(),_("groups",n==null||n.Options==null?null:n.Options.Groups)("users",t.userInviteOptions())}},dependencies:[z,$,we,Ue,pe,ce,Ve,he,ge,fe,Ce,H,me,q,j,De,Ee,ke],encapsulation:2})}}return i})();export{zt as UsersComponent};
@@ -1,2 +1,2 @@
1
- import{h as m}from"./chunk-RTF4FRXW.js";import{a as n}from"./chunk-CGOB6Y3X.js";import{e as u}from"./chunk-WN5DZGA4.js";import{ea as h,ja as c,pa as s,v as a}from"./chunk-OJMQBH6T.js";var f=(()=>{class i{constructor(){}convertToCSV(t,e){let r;if(typeof t=="string")r=t;else{var o=typeof t=="object"?t:JSON.parse(t);r=this.transformToCSVStringFormat(o)}this.downloadCSV(r,e)}transformToCSVStringFormat(t){if(!t||!t.length)return;let e=",",r=Object.keys(t[0]);return t.map(l=>r.map(d=>{let p=l[d]===null||l[d]===void 0?"":l[d];return p=p instanceof Date?p.toLocaleString():p.toString().replace(/"/g,'""'),p.search(/("|,|\n)/g)>=0&&(p=`"${p}"`),p}).join(e)).join(`
1
+ import{h as m}from"./chunk-OLVWSY6L.js";import{a as n}from"./chunk-CGOB6Y3X.js";import{e as u}from"./chunk-WN5DZGA4.js";import{ea as h,ja as c,pa as s,v as a}from"./chunk-OJMQBH6T.js";var f=(()=>{class i{constructor(){}convertToCSV(t,e){let r;if(typeof t=="string")r=t;else{var o=typeof t=="object"?t:JSON.parse(t);r=this.transformToCSVStringFormat(o)}this.downloadCSV(r,e)}transformToCSVStringFormat(t){if(!t||!t.length)return;let e=",",r=Object.keys(t[0]);return t.map(l=>r.map(d=>{let p=l[d]===null||l[d]===void 0?"":l[d];return p=p instanceof Date?p.toLocaleString():p.toString().replace(/"/g,'""'),p.search(/("|,|\n)/g)>=0&&(p=`"${p}"`),p}).join(e)).join(`
2
2
  `)}downloadCSV(t,e){var r=new Blob([t],{type:"text/csv;charset=utf8;"}),o=document.createElement("a");o.setAttribute("href",window.URL.createObjectURL(r)),o.setAttribute("download",e),document.body.appendChild(o),o.click(),document.body.removeChild(o)}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var w=(()=>{class i{constructor(){this.httpService=s(u),this.tokenService=s(m),this.exportService=s(f)}getShippedOrders(t){return this.httpService.post(n.GetShipped,t).pipe(a(e=>e.Data||[]))}getReadyToShipOrders(t){return this.httpService.post(n.GetToShip,t).pipe(a(e=>e?.Data))}getCompletedOrders(t){return this.httpService.post(n.GetCompleted,t).pipe(a(e=>e?.Data||[]))}getCancelledOrders(t){return this.httpService.post(n.GetCancelled,t).pipe(a(e=>e.Data))}getAwaitingCollectionOrders(t){return this.httpService.post(n.GetAwaitingCollection,t).pipe(a(e=>e?.Data))}getOrderDefaultValue(){return this.httpService.get(n.getOrderDaysFrom).pipe(a(t=>{let e=Number(t.Days??0),r=new Date;return e===0?null:new Date(r.setDate(r.getDate()-e))}))}getAllOrders(t){return this.httpService.post(n.GetAll,t).pipe(a(e=>e.Data))}exportOrders(t,e){return this.httpService.post("api/Orders/ExportOrder",t).pipe(h(r=>{this.exportService.convertToCSV(r,e)}))}refreshShippingCourier(t,e){let r={ShopID:t,OrderNumber:e};return this.httpService.post(n.RefreshShippingCourierAndRefNumber,r)}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275prov=c({token:i,factory:i.\u0275fac})}}return i})();export{w as a};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-DGIH7HSJ.js";import{a as E}from"./chunk-M7DDFDPD.js";import{i as T}from"./chunk-RTF4FRXW.js";import{a as w}from"./chunk-CGOB6Y3X.js";import{b as D,e as s}from"./chunk-WN5DZGA4.js";import{b as i,c as m}from"./chunk-RXQX7567.js";import{G as j}from"./chunk-FXQKRJWU.js";import{B as U,G as I,J as u,Ra as C,g as b,ja as c,pa as a,q as d,v as A}from"./chunk-OJMQBH6T.js";var x=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var R=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var S=class{};var V=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var N=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var _t=(()=>{class r{constructor(){this.authService=a(T),this.productService=a(E),this.shoppeUploadService=a(x),this.tiktokUploadService=a(H),this.lazadaUploadService=a(R),this.tokopediaUploadService=a(V),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(N),this.toastrHandlingService=a(F),this.toastr=a(D),this.router=a(j),this.httpService=a(s),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(I(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return C(t.map(o=>{let p=new g;return p.id=o.ID,p.name=o.Name,p.type=o.TypeID,p.categoryId=null,p.attributes=[],p.selected=!1,p}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.ShopifyV2||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(A(o=>{let p=[];return o.filter(h=>m.IsNotEmpty(h)).forEach(h=>{p=[...p,...h]}),p})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],p=[],h=[],v=[],y=[],P=[],k=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:p.push(l);break;case i.Tokopedia:h.push(l);break;case i.WooCommerce:v.push(l);break;case i.Shopify:y.push(l);break;case i.ShopifyV2:P.push(l);break;case i.Plugo:k.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:p},{type:i.Tokopedia,data:h},{type:i.WooCommerce,data:v},{type:i.Shopify,data:y},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:k}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(p));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(h));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(v));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.ShopifyV2:n.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(k));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let p=new S;p.ChannelID=o.id,p.ChannelType=o.type,p.Products=this._selectedProduct.getValue(),o.type==i.Shopify||o.type==i.ShopifyV2?delete p.CategoryID:p.CategoryID=o.categoryId,p=this.generateAttributeHttpRequest(o,p),e.push(p)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;case i.ShopifyV2:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{x as a,H as b,R as c,z as d,_t as e};
1
+ import{a as F}from"./chunk-DGIH7HSJ.js";import{a as E}from"./chunk-7ES3PHES.js";import{i as T}from"./chunk-OLVWSY6L.js";import{a as w}from"./chunk-CGOB6Y3X.js";import{b as D,e as s}from"./chunk-WN5DZGA4.js";import{b as i,c as m}from"./chunk-RXQX7567.js";import{G as j}from"./chunk-FXQKRJWU.js";import{B as U,G as I,J as u,Ra as C,g as b,ja as c,pa as a,q as d,v as A}from"./chunk-OJMQBH6T.js";var x=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var R=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var S=class{};var V=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var N=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var _t=(()=>{class r{constructor(){this.authService=a(T),this.productService=a(E),this.shoppeUploadService=a(x),this.tiktokUploadService=a(H),this.lazadaUploadService=a(R),this.tokopediaUploadService=a(V),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(N),this.toastrHandlingService=a(F),this.toastr=a(D),this.router=a(j),this.httpService=a(s),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(I(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return C(t.map(o=>{let p=new g;return p.id=o.ID,p.name=o.Name,p.type=o.TypeID,p.categoryId=null,p.attributes=[],p.selected=!1,p}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.ShopifyV2||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(A(o=>{let p=[];return o.filter(h=>m.IsNotEmpty(h)).forEach(h=>{p=[...p,...h]}),p})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],p=[],h=[],v=[],y=[],P=[],k=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:p.push(l);break;case i.Tokopedia:h.push(l);break;case i.WooCommerce:v.push(l);break;case i.Shopify:y.push(l);break;case i.ShopifyV2:P.push(l);break;case i.Plugo:k.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:p},{type:i.Tokopedia,data:h},{type:i.WooCommerce,data:v},{type:i.Shopify,data:y},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:k}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(p));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(h));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(v));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.ShopifyV2:n.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(k));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let p=new S;p.ChannelID=o.id,p.ChannelType=o.type,p.Products=this._selectedProduct.getValue(),o.type==i.Shopify||o.type==i.ShopifyV2?delete p.CategoryID:p.CategoryID=o.categoryId,p=this.generateAttributeHttpRequest(o,p),e.push(p)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;case i.ShopifyV2:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{x as a,H as b,R as c,z as d,_t as e};