dealpos 25.42.3 → 25.42.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 (148) hide show
  1. package/browser/{chunk-UAZRVFNB.js → chunk-2IFV72LO.js} +1 -1
  2. package/browser/{chunk-OZMOBU7L.js → chunk-2W3Z4A7W.js} +1 -1
  3. package/browser/{chunk-BDN45ELK.js → chunk-2XFAQ4GA.js} +2 -2
  4. package/browser/{chunk-KGTS7TDO.js → chunk-2ZJNBDSW.js} +1 -1
  5. package/browser/chunk-3CDAAY7T.js +1 -0
  6. package/browser/{chunk-IJ3Y6CA4.js → chunk-426IRMLK.js} +1 -1
  7. package/browser/{chunk-GHPZLWLY.js → chunk-44ZVRDCY.js} +1 -1
  8. package/browser/{chunk-F6XARCNS.js → chunk-4OJ7PKTD.js} +1 -1
  9. package/browser/{chunk-PFAAD3XG.js → chunk-4PKTGPCP.js} +2 -2
  10. package/browser/{chunk-WAABNVJP.js → chunk-52PXSWVM.js} +1 -1
  11. package/browser/{chunk-UZCYUQUH.js → chunk-55M2XDOD.js} +1 -1
  12. package/browser/{chunk-SHMXCJ6Q.js → chunk-56IONBTZ.js} +1 -1
  13. package/browser/{chunk-DKPNAGIM.js → chunk-56K6E74R.js} +1 -1
  14. package/browser/{chunk-5JGMZUVO.js → chunk-5KLLMQHQ.js} +1 -1
  15. package/browser/{chunk-TY4CJST2.js → chunk-63BEECQF.js} +1 -1
  16. package/browser/{chunk-XHUPVI6X.js → chunk-6ILWIZOK.js} +1 -1
  17. package/browser/{chunk-HQQWO76P.js → chunk-6PPRM5TJ.js} +1 -1
  18. package/browser/{chunk-V7HLUR6T.js → chunk-6VOLOXGW.js} +1 -1
  19. package/browser/{chunk-4QBEH76F.js → chunk-6WFCZE7B.js} +1 -1
  20. package/browser/chunk-7N65BK2U.js +1 -0
  21. package/browser/{chunk-537VP6ZK.js → chunk-7OT23G64.js} +1 -1
  22. package/browser/chunk-7ZRPFALM.js +1 -0
  23. package/browser/{chunk-ZSE5MOHQ.js → chunk-AAXRMRTM.js} +1 -1
  24. package/browser/chunk-AXO7LQ2B.js +14 -0
  25. package/browser/{chunk-XNJJHLJK.js → chunk-B32VTPYO.js} +1 -1
  26. package/browser/{chunk-M3CM7YGB.js → chunk-B4AGJZHZ.js} +1 -1
  27. package/browser/{chunk-32HLQMIF.js → chunk-B7G563OR.js} +1 -1
  28. package/browser/{chunk-75EESXJE.js → chunk-BAKUWWQS.js} +1 -1
  29. package/browser/{chunk-SK3O35VZ.js → chunk-BARZW6AX.js} +1 -1
  30. package/browser/chunk-BBGWXLHJ.js +1 -0
  31. package/browser/{chunk-QJ4LGJCR.js → chunk-BUPX3XPT.js} +1 -1
  32. package/browser/{chunk-7STOC3NI.js → chunk-C72QSLN5.js} +1 -1
  33. package/browser/{chunk-AOHNHNJ4.js → chunk-CAGKT2C3.js} +1 -1
  34. package/browser/{chunk-VSF6PYZW.js → chunk-CKNQ2YZ5.js} +1 -1
  35. package/browser/{chunk-TQZQYUFG.js → chunk-CMHBQ7I6.js} +1 -1
  36. package/browser/{chunk-WCS36NF2.js → chunk-COUGDCZB.js} +1 -1
  37. package/browser/{chunk-VVIPBL5F.js → chunk-CPGLNSQI.js} +1 -1
  38. package/browser/{chunk-DQQS3EIT.js → chunk-CPTYFTX5.js} +1 -1
  39. package/browser/{chunk-5BZEOCFN.js → chunk-CVL2DR7E.js} +1 -1
  40. package/browser/{chunk-6WBSRYV3.js → chunk-CWA5D332.js} +1 -1
  41. package/browser/{chunk-TIZ2QYSJ.js → chunk-D465JE7P.js} +1 -1
  42. package/browser/{chunk-GPP3J3W4.js → chunk-DBERRJC6.js} +1 -1
  43. package/browser/{chunk-UVRUHQSK.js → chunk-DJQ2JBX2.js} +2 -2
  44. package/browser/chunk-E4DPE3J5.js +1 -0
  45. package/browser/{chunk-2CU7XQYN.js → chunk-EG4UO6IY.js} +1 -1
  46. package/browser/{chunk-XYXJ6BJZ.js → chunk-EO5ZOYWW.js} +7 -7
  47. package/browser/{chunk-NGOXBKLO.js → chunk-EZXAMS3I.js} +1 -1
  48. package/browser/{chunk-6A45AGTK.js → chunk-FCUQZ5CM.js} +1 -1
  49. package/browser/{chunk-GI3H7BEZ.js → chunk-FCXIRKJX.js} +1 -1
  50. package/browser/{chunk-RB5D6LBP.js → chunk-FICKBK7G.js} +1 -1
  51. package/browser/{chunk-Y6VMIGXC.js → chunk-FKLSH2TV.js} +1 -1
  52. package/browser/{chunk-SEXQYEXV.js → chunk-FVG3VTH5.js} +1 -1
  53. package/browser/{chunk-5OS5VELO.js → chunk-FVKF2ZOS.js} +1 -1
  54. package/browser/{chunk-UEQT5HE5.js → chunk-FXLWJQC3.js} +1 -1
  55. package/browser/{chunk-IQ26VFNR.js → chunk-FZCJDAJY.js} +1 -1
  56. package/browser/{chunk-HAGFCQCM.js → chunk-G3XRMYTN.js} +1 -1
  57. package/browser/{chunk-3HEL5YEK.js → chunk-GZGVL2IC.js} +1 -1
  58. package/browser/{chunk-IQ4IMICT.js → chunk-GZSXRIAG.js} +1 -1
  59. package/browser/{chunk-LH2QJXQV.js → chunk-HODSGMLE.js} +1 -1
  60. package/browser/{chunk-EENVAF36.js → chunk-HUH7L2ZO.js} +1 -1
  61. package/browser/{chunk-772SQL5I.js → chunk-HZIKNLNL.js} +1 -1
  62. package/browser/{chunk-KQXOWLTB.js → chunk-I3I7DLPY.js} +1 -1
  63. package/browser/{chunk-CD3BSGAP.js → chunk-IJ6QEGE5.js} +1 -1
  64. package/browser/{chunk-TUQ4INQ4.js → chunk-IMEZ6PAI.js} +1 -1
  65. package/browser/{chunk-GC3UJT2Q.js → chunk-IOQXROSJ.js} +1 -1
  66. package/browser/{chunk-RGMTX4XI.js → chunk-IPLQ5MJ5.js} +1 -1
  67. package/browser/{chunk-H6LHYTUN.js → chunk-J75KTT4W.js} +1 -1
  68. package/browser/{chunk-BLLHTNS3.js → chunk-JLFUF2ZE.js} +2 -2
  69. package/browser/{chunk-FAJUK2PL.js → chunk-JNZU3NGN.js} +1 -1
  70. package/browser/{chunk-SYXYAJTH.js → chunk-JOSA7X2G.js} +1 -1
  71. package/browser/{chunk-7Z6VQ4SB.js → chunk-JTH33KAU.js} +1 -1
  72. package/browser/{chunk-44ZWYZS2.js → chunk-KETSQOS7.js} +1 -1
  73. package/browser/{chunk-VOH7SSVN.js → chunk-KP74DEOF.js} +1 -1
  74. package/browser/{chunk-G37NEDUK.js → chunk-KPOJR3LK.js} +1 -1
  75. package/browser/{chunk-7LAYIAWW.js → chunk-KUG6COSS.js} +1 -1
  76. package/browser/{chunk-ZTJ2EZKC.js → chunk-L4BFVEDX.js} +1 -1
  77. package/browser/{chunk-CEPFELMI.js → chunk-LPAVUNE5.js} +1 -1
  78. package/browser/{chunk-AEHOTFB4.js → chunk-LQW5KOAB.js} +1 -1
  79. package/browser/{chunk-OG45AMIC.js → chunk-M5273AKK.js} +1 -1
  80. package/browser/{chunk-URAQZQ3A.js → chunk-MDMQSRCF.js} +1 -1
  81. package/browser/{chunk-DNSE6AZ3.js → chunk-MLU3FELE.js} +1 -1
  82. package/browser/{chunk-SRPF6NEK.js → chunk-N3FILVEH.js} +1 -1
  83. package/browser/{chunk-AQC5G2DR.js → chunk-NKGA724S.js} +1 -1
  84. package/browser/{chunk-YLVSXMRV.js → chunk-NRMRPMV4.js} +1 -1
  85. package/browser/{chunk-GGPT7WIY.js → chunk-NUQK6FIB.js} +1 -1
  86. package/browser/{chunk-GINOZV6C.js → chunk-O6PVWRA5.js} +1 -1
  87. package/browser/{chunk-BXAYNP7A.js → chunk-O7SRWU2B.js} +1 -1
  88. package/browser/{chunk-6O33MUM6.js → chunk-ODCWZ2UR.js} +1 -1
  89. package/browser/{chunk-QCXWKQ7Z.js → chunk-P3HCTQ6S.js} +1 -1
  90. package/browser/{chunk-RPHW7OGR.js → chunk-P3MV34I5.js} +8 -8
  91. package/browser/chunk-PABRBDDZ.js +1 -0
  92. package/browser/chunk-PBWJL7FL.js +1 -0
  93. package/browser/{chunk-TKNGHZIN.js → chunk-PFO64G63.js} +1 -1
  94. package/browser/{chunk-WJOZLY6Q.js → chunk-PIQYZDQP.js} +1 -1
  95. package/browser/{chunk-NXXNEU5Q.js → chunk-PNMCM55F.js} +1 -1
  96. package/browser/{chunk-2PBMTCNB.js → chunk-PS77NKMH.js} +1 -1
  97. package/browser/{chunk-UQP7S73H.js → chunk-Q6HOM6AN.js} +1 -1
  98. package/browser/{chunk-JPA7JINL.js → chunk-QC3NV2DN.js} +1 -1
  99. package/browser/{chunk-3A4C23H5.js → chunk-QIC57EUK.js} +1 -1
  100. package/browser/{chunk-2L54CRB2.js → chunk-QMNZ3US5.js} +1 -1
  101. package/browser/{chunk-PRBPKAI4.js → chunk-QOPR5ZBR.js} +1 -1
  102. package/browser/{chunk-ITLMINSX.js → chunk-QWYLRTIQ.js} +1 -1
  103. package/browser/{chunk-THXV6YJP.js → chunk-R24JXSUW.js} +1 -1
  104. package/browser/{chunk-3RWVYWJF.js → chunk-R6G33VWA.js} +1 -1
  105. package/browser/{chunk-DTU55DE5.js → chunk-RBR65IQ5.js} +1 -1
  106. package/browser/{chunk-7ERQEWVF.js → chunk-RHKLQLV3.js} +1 -1
  107. package/browser/{chunk-KBO5VO7S.js → chunk-RQGT2FPJ.js} +1 -1
  108. package/browser/{chunk-JATL56N2.js → chunk-SQBOS5SH.js} +1 -1
  109. package/browser/{chunk-JYNN4IZB.js → chunk-SS5QJI73.js} +1 -1
  110. package/browser/{chunk-TZ74SUXJ.js → chunk-SZUQ6U7I.js} +1 -1
  111. package/browser/{chunk-6G37ZXRX.js → chunk-T3BPEHU7.js} +1 -1
  112. package/browser/{chunk-W7I2T4SZ.js → chunk-TAVO3B4U.js} +1 -1
  113. package/browser/{chunk-BO3TFY6M.js → chunk-TEN5QZBG.js} +1 -1
  114. package/browser/chunk-TPLK5SYL.js +1 -0
  115. package/browser/{chunk-6EEZ723H.js → chunk-UM2PO3XQ.js} +1 -1
  116. package/browser/{chunk-LNLKT2JE.js → chunk-UMYMJXTX.js} +1 -1
  117. package/browser/{chunk-WQ7RE4CS.js → chunk-VH7PQ7LI.js} +1 -1
  118. package/browser/{chunk-IAY6YLM3.js → chunk-VIPNHU3L.js} +1 -1
  119. package/browser/{chunk-BCWXNNN7.js → chunk-VOIN2RMJ.js} +1 -1
  120. package/browser/{chunk-ZH7IWOYT.js → chunk-VQARO64W.js} +1 -1
  121. package/browser/{chunk-3C333WA4.js → chunk-VRAUKFCM.js} +1 -1
  122. package/browser/{chunk-SN4VGYRI.js → chunk-VUS6HHGO.js} +1 -1
  123. package/browser/{chunk-ZTTYI7IT.js → chunk-W2FRPHGF.js} +1 -1
  124. package/browser/{chunk-EMP32K7Q.js → chunk-WGHPXYWX.js} +1 -1
  125. package/browser/{chunk-DV7Z45N7.js → chunk-WMH3FHA2.js} +4 -4
  126. package/browser/{chunk-6CQ6XYJG.js → chunk-WP4MYTR2.js} +1 -1
  127. package/browser/{chunk-5R4YDHD4.js → chunk-WYOFJICO.js} +1 -1
  128. package/browser/{chunk-PYAKNXHZ.js → chunk-XC7KN6VV.js} +1 -1
  129. package/browser/{chunk-6PHBFF3O.js → chunk-XGKVBT5H.js} +1 -1
  130. package/browser/{chunk-4NW7A5EC.js → chunk-XNEX34OE.js} +14 -14
  131. package/browser/{chunk-A7PNRSF2.js → chunk-XPQKTZA5.js} +1 -1
  132. package/browser/{chunk-PDXIH2U4.js → chunk-XVUT3UE2.js} +1 -1
  133. package/browser/chunk-YS5M44K6.js +3 -0
  134. package/browser/{chunk-BNYTLFGU.js → chunk-YVPUXQHE.js} +1 -1
  135. package/browser/{chunk-RD5CYEVA.js → chunk-ZEHQ5G5B.js} +1 -1
  136. package/browser/{chunk-4R4W625N.js → chunk-ZIWHZGBX.js} +1 -1
  137. package/browser/{chunk-FBCM6PP2.js → chunk-ZTBNXR7X.js} +1 -1
  138. package/browser/index.html +2 -2
  139. package/browser/{main-MFGSWEQQ.js → main-VSBTHP7O.js} +2 -2
  140. package/package.json +1 -1
  141. package/browser/chunk-7MYFXXHY.js +0 -1
  142. package/browser/chunk-HMER2IC5.js +0 -1
  143. package/browser/chunk-JU5FQANB.js +0 -1
  144. package/browser/chunk-Q4H53ZUG.js +0 -1
  145. package/browser/chunk-TM46LANH.js +0 -14
  146. package/browser/chunk-UDE6XZO3.js +0 -3
  147. package/browser/chunk-VPC43VHO.js +0 -1
  148. package/browser/chunk-ZGGEHIOZ.js +0 -1
@@ -1 +1 @@
1
- import{a as R}from"./chunk-LH2QJXQV.js";import{a as u,d as h,e as C}from"./chunk-ZZGSAFGO.js";import{Pa as T,Qd as N,Sc as S,Yd as v,fa as g,ja as p,kd as d,ma as c}from"./chunk-UXRO4UFY.js";var U=(i=>(i[i.PAID=0]="PAID",i[i.OVERDUE=1]="OVERDUE",i[i.SELL_ONLY=2]="SELL_ONLY",i[i.SUSPENDED=3]="SUSPENDED",i))(U||{});var O=(()=>{class n{constructor(e,o){this.document=e,this.platformId=o,this.documentIsAccessible=d(this.platformId)}static getCookieRegExp(e){let o=e.replace(/([\[\]{}()|=;+?,.*^$])/gi,"\\$1");return new RegExp("(?:^"+o+"|;\\s*"+o+")=(.*?)(?:;|$)","g")}static safeDecodeURIComponent(e){try{return decodeURIComponent(e)}catch{return e}}check(e){return this.documentIsAccessible?(e=encodeURIComponent(e),n.getCookieRegExp(e).test(this.document.cookie)):!1}get(e){if(this.check(e)){e=encodeURIComponent(e);let i=n.getCookieRegExp(e).exec(this.document.cookie);return i&&i[1]?n.safeDecodeURIComponent(i[1]):""}else return""}getAll(){if(!this.documentIsAccessible)return{};let e={},o=this.document;return o.cookie&&o.cookie!==""&&o.cookie.split(";").forEach(i=>{let[a,s]=i.split("=");e[n.safeDecodeURIComponent(a.replace(/^ /,""))]=n.safeDecodeURIComponent(s)}),e}set(e,o,i,a,s,l,f,E){if(!this.documentIsAccessible)return;if(typeof i=="number"||i instanceof Date||a||s||l||f){let I={expires:i,path:a,domain:s,secure:l,sameSite:f||"Lax",partitioned:E};this.set(e,o,I);return}let m=encodeURIComponent(e)+"="+encodeURIComponent(o)+";",r=i||{};if(r.expires)if(typeof r.expires=="number"){let I=new Date(new Date().getTime()+r.expires*1e3*60*60*24);m+="expires="+I.toUTCString()+";"}else m+="expires="+r.expires.toUTCString()+";";r.path&&(m+="path="+r.path+";"),r.domain&&(m+="domain="+r.domain+";"),r.secure===!1&&r.sameSite==="None"&&(r.secure=!0,console.warn(`[ngx-cookie-service] Cookie ${e} was forced with secure flag because sameSite=None.More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`)),r.secure&&(m+="secure;"),r.sameSite||(r.sameSite="Lax"),m+="sameSite="+r.sameSite+";",r.partitioned&&(m+="Partitioned;"),this.document.cookie=m}delete(e,o,i,a,s="Lax"){if(!this.documentIsAccessible)return;let l=new Date("Thu, 01 Jan 1970 00:00:01 GMT");this.set(e,"",{expires:l,path:o,domain:i,secure:a,sameSite:s})}deleteAll(e,o,i,a="Lax"){if(!this.documentIsAccessible)return;let s=this.getAll();for(let l in s)s.hasOwnProperty(l)&&this.delete(l,e,o,i,a)}static{this.\u0275fac=function(o){return new(o||n)(c(S),c(T))}}static{this.\u0275prov=p({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var D=class n{constructor(t,e,o,i,a,s){this.httpService=t;this.cookieService=e;this.router=o;this.roleService=i;this.intercomService=a;this.fraction=s}role=[];_returnUrl;_loginResponse;_jwtToken;set returnUrl(t){this._returnUrl=t}get returnUrl(){return this._returnUrl}login(t){return this.httpService.post("/api/Login/Web",t).pipe(g(e=>{this._loginResponse=e,e.Type=="geo"||e.Type=="totp"||this.saveLoginConfigToStorage(e)}))}loginLoader(){return this.httpService.get("/api/login/Loader")}getRedirectUrl(){let t=this.getSubscriptionStatus(),e=this.getRedirectUrlByRole();return(t==2||t==3)&&(e="/menu/Profile/Main/My_Subscription"),e}getRedirectUrlByRole(){let t,e=this.roleService;return e.dashboard.View?t="/menu/Dashboard":e.product.View?t="/menu/Products":t="/menu/Sell",t}logout(){localStorage.removeItem("ConfigData"),localStorage.removeItem("Token"),localStorage.removeItem("Roles"),localStorage.removeItem("AccountInfo"),localStorage.removeItem("CloudinaryConfig"),localStorage.removeItem("SubscriptionStatus"),this.cookieService.delete("ReportFilter","/"),this.intercomService.shutdown(),this._jwtToken=null,this.roleService.resetRoles(),this.router.navigate(["/"])}refreshToken(){this.httpService.post("/API/Authentication/RefreshToken",{}).subscribe(t=>{localStorage.removeItem("Token"),localStorage.setItem("Token",t.Token),this._jwtToken=null,this.roleService.resetRoles(),this.roleService.parseJWTRoles()})}isTokenExpired(){let t=localStorage.getItem("Token");if(t){let e=u.parseJwt(t),o=this.convertUnixTimesTamp(e.exp),i=new Date;if(o.getTime()-i.getTime()>0)return!1}return!0}isInRole(t){t.forEach(e=>e(this.role))}convertUnixTimesTamp(t){return new Date(t*1e3)}saveLoginConfigToStorage(t){localStorage.setItem("quantityFraction",JSON.stringify(t.UIConfig.Fraction.Quantity)),localStorage.setItem("amountFraction",JSON.stringify(t.UIConfig.Fraction.Amount)),this.fraction.setAmountFraction(t.UIConfig.Fraction.Amount.Minimum,t.UIConfig.Fraction.Amount.Maximum),this.fraction.setQuantityFraction(t.UIConfig.Fraction.Quantity.Minimum,t.UIConfig.Fraction.Quantity.Maximum),localStorage.setItem("AccountInfo",JSON.stringify(t?.AccountInfo)),localStorage.setItem("Token",t?.Token),localStorage.setItem("TinyMCEPlugins",t?.UIConfig.TinyMCE),this.intercomService.updateLocalStorage(t?.Intercom),localStorage.setItem("CloudinaryConfig",t?.UIConfig.CloudinaryConfig),localStorage.setItem("DataDaysRange",t?.UIConfig.DataDaysRange),localStorage.setItem("SubscriptionStatus",JSON.stringify(t?.SubscriptionStatus));let e=this.getParseToken();u.IsNotEmpty(e?.NotificationOutletID)&&localStorage.setItem("NotificationOutletID",e?.NotificationOutletID),this.roleService.parseJWTRoles(),this._loginResponse=null}getParseToken(){let t=localStorage.getItem("Token");return t&&!this._jwtToken&&(this._jwtToken=u.parseJwt(t)),this._jwtToken}get loginResponse(){return this._loginResponse}getSubscriptionStatus(){let t=localStorage.getItem("SubscriptionStatus");return t?parseInt(t):null}static \u0275fac=function(e){return new(e||n)(c(v),c(O),c(N),c(h),c(R),c(C))};static \u0275prov=p({token:n,factory:n.\u0275fac,providedIn:"root"})};export{U as a,O as b,D as c};
1
+ import{a as R}from"./chunk-HODSGMLE.js";import{a as u,d as h,e as C}from"./chunk-ZZGSAFGO.js";import{Pa as T,Qd as N,Sc as S,Yd as v,fa as g,ja as p,kd as d,ma as c}from"./chunk-UXRO4UFY.js";var U=(i=>(i[i.PAID=0]="PAID",i[i.OVERDUE=1]="OVERDUE",i[i.SELL_ONLY=2]="SELL_ONLY",i[i.SUSPENDED=3]="SUSPENDED",i))(U||{});var O=(()=>{class n{constructor(e,o){this.document=e,this.platformId=o,this.documentIsAccessible=d(this.platformId)}static getCookieRegExp(e){let o=e.replace(/([\[\]{}()|=;+?,.*^$])/gi,"\\$1");return new RegExp("(?:^"+o+"|;\\s*"+o+")=(.*?)(?:;|$)","g")}static safeDecodeURIComponent(e){try{return decodeURIComponent(e)}catch{return e}}check(e){return this.documentIsAccessible?(e=encodeURIComponent(e),n.getCookieRegExp(e).test(this.document.cookie)):!1}get(e){if(this.check(e)){e=encodeURIComponent(e);let i=n.getCookieRegExp(e).exec(this.document.cookie);return i&&i[1]?n.safeDecodeURIComponent(i[1]):""}else return""}getAll(){if(!this.documentIsAccessible)return{};let e={},o=this.document;return o.cookie&&o.cookie!==""&&o.cookie.split(";").forEach(i=>{let[a,s]=i.split("=");e[n.safeDecodeURIComponent(a.replace(/^ /,""))]=n.safeDecodeURIComponent(s)}),e}set(e,o,i,a,s,l,f,E){if(!this.documentIsAccessible)return;if(typeof i=="number"||i instanceof Date||a||s||l||f){let I={expires:i,path:a,domain:s,secure:l,sameSite:f||"Lax",partitioned:E};this.set(e,o,I);return}let m=encodeURIComponent(e)+"="+encodeURIComponent(o)+";",r=i||{};if(r.expires)if(typeof r.expires=="number"){let I=new Date(new Date().getTime()+r.expires*1e3*60*60*24);m+="expires="+I.toUTCString()+";"}else m+="expires="+r.expires.toUTCString()+";";r.path&&(m+="path="+r.path+";"),r.domain&&(m+="domain="+r.domain+";"),r.secure===!1&&r.sameSite==="None"&&(r.secure=!0,console.warn(`[ngx-cookie-service] Cookie ${e} was forced with secure flag because sameSite=None.More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`)),r.secure&&(m+="secure;"),r.sameSite||(r.sameSite="Lax"),m+="sameSite="+r.sameSite+";",r.partitioned&&(m+="Partitioned;"),this.document.cookie=m}delete(e,o,i,a,s="Lax"){if(!this.documentIsAccessible)return;let l=new Date("Thu, 01 Jan 1970 00:00:01 GMT");this.set(e,"",{expires:l,path:o,domain:i,secure:a,sameSite:s})}deleteAll(e,o,i,a="Lax"){if(!this.documentIsAccessible)return;let s=this.getAll();for(let l in s)s.hasOwnProperty(l)&&this.delete(l,e,o,i,a)}static{this.\u0275fac=function(o){return new(o||n)(c(S),c(T))}}static{this.\u0275prov=p({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var D=class n{constructor(t,e,o,i,a,s){this.httpService=t;this.cookieService=e;this.router=o;this.roleService=i;this.intercomService=a;this.fraction=s}role=[];_returnUrl;_loginResponse;_jwtToken;set returnUrl(t){this._returnUrl=t}get returnUrl(){return this._returnUrl}login(t){return this.httpService.post("/api/Login/Web",t).pipe(g(e=>{this._loginResponse=e,e.Type=="geo"||e.Type=="totp"||this.saveLoginConfigToStorage(e)}))}loginLoader(){return this.httpService.get("/api/login/Loader")}getRedirectUrl(){let t=this.getSubscriptionStatus(),e=this.getRedirectUrlByRole();return(t==2||t==3)&&(e="/menu/Profile/Main/My_Subscription"),e}getRedirectUrlByRole(){let t,e=this.roleService;return e.dashboard.View?t="/menu/Dashboard":e.product.View?t="/menu/Products":t="/menu/Sell",t}logout(){localStorage.removeItem("ConfigData"),localStorage.removeItem("Token"),localStorage.removeItem("Roles"),localStorage.removeItem("AccountInfo"),localStorage.removeItem("CloudinaryConfig"),localStorage.removeItem("SubscriptionStatus"),this.cookieService.delete("ReportFilter","/"),this.intercomService.shutdown(),this._jwtToken=null,this.roleService.resetRoles(),this.router.navigate(["/"])}refreshToken(){this.httpService.post("/API/Authentication/RefreshToken",{}).subscribe(t=>{localStorage.removeItem("Token"),localStorage.setItem("Token",t.Token),this._jwtToken=null,this.roleService.resetRoles(),this.roleService.parseJWTRoles()})}isTokenExpired(){let t=localStorage.getItem("Token");if(t){let e=u.parseJwt(t),o=this.convertUnixTimesTamp(e.exp),i=new Date;if(o.getTime()-i.getTime()>0)return!1}return!0}isInRole(t){t.forEach(e=>e(this.role))}convertUnixTimesTamp(t){return new Date(t*1e3)}saveLoginConfigToStorage(t){localStorage.setItem("quantityFraction",JSON.stringify(t.UIConfig.Fraction.Quantity)),localStorage.setItem("amountFraction",JSON.stringify(t.UIConfig.Fraction.Amount)),this.fraction.setAmountFraction(t.UIConfig.Fraction.Amount.Minimum,t.UIConfig.Fraction.Amount.Maximum),this.fraction.setQuantityFraction(t.UIConfig.Fraction.Quantity.Minimum,t.UIConfig.Fraction.Quantity.Maximum),localStorage.setItem("AccountInfo",JSON.stringify(t?.AccountInfo)),localStorage.setItem("Token",t?.Token),localStorage.setItem("TinyMCEPlugins",t?.UIConfig.TinyMCE),this.intercomService.updateLocalStorage(t?.Intercom),localStorage.setItem("CloudinaryConfig",t?.UIConfig.CloudinaryConfig),localStorage.setItem("DataDaysRange",t?.UIConfig.DataDaysRange),localStorage.setItem("SubscriptionStatus",JSON.stringify(t?.SubscriptionStatus));let e=this.getParseToken();u.IsNotEmpty(e?.NotificationOutletID)&&localStorage.setItem("NotificationOutletID",e?.NotificationOutletID),this.roleService.parseJWTRoles(),this._loginResponse=null}getParseToken(){let t=localStorage.getItem("Token");return t&&!this._jwtToken&&(this._jwtToken=u.parseJwt(t)),this._jwtToken}get loginResponse(){return this._loginResponse}getSubscriptionStatus(){let t=localStorage.getItem("SubscriptionStatus");return t?parseInt(t):null}static \u0275fac=function(e){return new(e||n)(c(v),c(O),c(N),c(h),c(R),c(C))};static \u0275prov=p({token:n,factory:n.\u0275fac,providedIn:"root"})};export{U as a,O as b,D as c};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-KPOJR3LK.js";import"./chunk-BAKUWWQS.js";import"./chunk-QWYLRTIQ.js";import"./chunk-BBGWXLHJ.js";import"./chunk-NRMRPMV4.js";import"./chunk-FCXIRKJX.js";import"./chunk-SZUQ6U7I.js";import"./chunk-SQBOS5SH.js";import"./chunk-6ILWIZOK.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import"./chunk-XZR3IMWZ.js";import"./chunk-CPGLNSQI.js";import"./chunk-YVPUXQHE.js";import"./chunk-5JJSLRVS.js";import"./chunk-O6PVWRA5.js";import"./chunk-CWITQVZH.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import"./chunk-MFCXEITE.js";import"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import"./chunk-4OJ7PKTD.js";import"./chunk-MDMQSRCF.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import"./chunk-IJ6QEGE5.js";import"./chunk-JOXTERIM.js";import"./chunk-FVKF2ZOS.js";import"./chunk-XYB3YDKL.js";import"./chunk-6ZN7JR6K.js";import"./chunk-GIKR6Y2K.js";import"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-VFTGIP5A.js";import"./chunk-LE3BKIDY.js";import"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import"./chunk-RVXZOIFQ.js";import"./chunk-7OT23G64.js";import"./chunk-HODSGMLE.js";import"./chunk-ZZGSAFGO.js";import"./chunk-GZGVL2IC.js";import"./chunk-UXRO4UFY.js";import"./chunk-7DCB7DB2.js";export{a as CompositeInventoryComponent};
@@ -1 +1 @@
1
- import{a as me}from"./chunk-NQX7EX5A.js";import{a as le}from"./chunk-4R4W625N.js";import{a as ie,c as ne,e as re,f as ae,g as oe}from"./chunk-NXXNEU5Q.js";import{a as Y}from"./chunk-FP4HFB5J.js";import{a as Z,c as ee}from"./chunk-MUJ6277G.js";import{m as X}from"./chunk-CD3BSGAP.js";import{N as te}from"./chunk-5OS5VELO.js";import{d as T}from"./chunk-XYB3YDKL.js";import{a as J}from"./chunk-2FWFPV5I.js";import{F as z,c as G,h as U,o as q}from"./chunk-RVXZOIFQ.js";import{a as K}from"./chunk-ZZGSAFGO.js";import{$a as m,Ac as F,Bc as Q,Fa as y,Fc as A,Ib as a,Jb as l,Kb as x,Lb as h,Mb as g,Ob as S,Qb as f,Rb as s,Vd as $,Y as D,Yc as H,Zc as W,cd as L,db as I,dc as C,ec as _,ed as j,fa as N,fc as k,gc as b,jc as v,jd as B,ka as O,kb as P,kc as E,lb as R,lc as w,qb as u,t as V,va as p,vb as c,wa as d,zc as M}from"./chunk-UXRO4UFY.js";function de(i,t){i&1&&(h(0),a(1,"div",5)(2,"div",6),_(3,"Edit Serial is disabled during EDIT MODE"),l(),a(4,"div"),_(5," If you make a mistake, please delete the item and then add again "),l()(),g())}function _e(i,t){if(i&1){let e=S();a(0,"mat-chip-row",19),f("removed",function(){let r=p(e).$implicit,o=s(3);return d(o.onRemoveSerialChip(r))}),_(1),a(2,"button",20),x(3,"i",21),l()()}if(i&2){let e=t.$implicit;m(),b(" ",e," ")}}function ue(i,t){if(i&1){let e=S();h(0),a(1,"div",10)(2,"div",11)(3,"mat-form-field",12),f("keyup.enter",function(r){return p(e),d(r.stopPropagation())}),a(4,"mat-chip-grid",null,1),u(6,_e,4,1,"mat-chip-row",13),a(7,"input",14,2),f("matChipInputTokenEnd",function(r){p(e);let o=C(8),pe=s(2);return d(pe.addSerial(r,o))}),l()()()(),a(9,"div",15)(10,"button",16),f("click",function(){p(e);let r=C(8),o=s(2);return d(o.submitSerial(r))}),x(11,"i",17),a(12,"strong",18),_(13,"ADD"),l()()()(),g()}if(i&2){let e=C(5),n=s(2);m(6),c("ngForOf",n.serials),m(),c("matChipInputFor",e)("matChipInputSeparatorKeyCodes",n.separatorKeysCodes)}}function he(i,t){if(i&1){let e=S();a(0,"ng-select",22),M(1,"async"),w("ngModelChange",function(r){p(e);let o=s(2);return E(o.serials,r)||(o.serials=r),d(r)}),f("remove",function(r){p(e);let o=s(2);return d(o.onRemoveSerialFromOption(r.value))})("change",function(r){p(e);let o=s(2);return d(o.onSelectSerial(r))}),l()}if(i&2){let e=s(2);c("items",F(1,3,e.serials$)),v("ngModel",e.serials),c("multiple",!0)}}function ge(i,t){if(i&1&&(h(0),a(1,"div",7)(2,"div",8),u(3,ue,14,3,"ng-container",9)(4,he,2,5,"ng-template",null,0,A),l()(),g()),i&2){let e=C(5),n=s();m(3),c("ngIf",n.isReturn)("ngIfElse",e)}}function fe(i,t){i&1&&(h(0),x(1,"th",29),g())}function Se(i,t){i&1&&(h(0),a(1,"th",30),_(2,"Expiry Date"),l(),g())}function Ce(i,t){if(i&1){let e=S();h(0),a(1,"td",32)(2,"i",33),f("click",function(){p(e);let r=s().index,o=s(2);return d(o.onRemoveSerial(r))}),l()(),g()}}function xe(i,t){if(i&1&&(h(0),a(1,"td"),_(2),M(3,"date"),l(),g()),i&2){let e=s().$implicit;m(2),b(" ",e.ExpiryDate?Q(3,1,e.ExpiryDate,"dd MMM yyyy"):"-"," ")}}function ye(i,t){if(i&1){let e=S();a(0,"tr"),u(1,Ce,3,0,"ng-container",4),a(2,"td"),_(3),l(),u(4,xe,4,4,"ng-container",4),a(5,"td")(6,"input",31),w("ngModelChange",function(r){let o=p(e).$implicit;return E(o.Quantity,r)||(o.Quantity=r),d(r)}),f("change",function(){p(e);let r=s(2);return d(r.onChangeQty())}),l()()()}if(i&2){let e=t.$implicit,n=s(2);m(),c("ngIf",!n.disabled),m(2),k(e.Number),m(),c("ngIf",n.showExpiryDate),m(2),v("ngModel",e.Quantity),c("disabled",n.disabled)("decimalPlaces",0)}}function Ie(i,t){if(i&1&&(h(0),a(1,"div",23)(2,"div",8)(3,"table",24)(4,"thead",25)(5,"tr"),u(6,fe,2,0,"ng-container",4),a(7,"th",26),_(8,"Serial Number"),l(),u(9,Se,3,0,"ng-container",4),a(10,"th",27),_(11,"Quantity"),l()()(),a(12,"tbody"),u(13,ye,7,6,"tr",28),l()()()(),g()),i&2){let e=s();m(6),c("ngIf",!e.disabled),m(3),c("ngIf",e.showExpiryDate),m(4),c("ngForOf",e.selectedSerial)}}var se=class i{constructor(t,e){this.productService=t;this.toastr=e;this.cartItemChange=new y,this.serialsChange=new y}separatorKeysCodes=[13,188];_cartItem;isReturn=!1;disabled=!1;set cartItem(t){t&&(this._cartItem=t,this.initSelectedSerial(),t.Quantity<0?this.isReturn=!0:this.getSerialVariant())}get cartItem(){return this._cartItem}cartItemChange;entityId;serials;serialsChange;serials$;selectedSerial=[];showExpiryDate;ngOnDestroy(){this.serialsChange.emit([])}initSelectedSerial(){let t=this.cartItem.Serial;t&&t.length>0&&(this.selectedSerial=t,this.checkShowExpiryDate())}getSerialVariant(){let t=this.cartItem.VariantID,e;this.serials$=this.productService.getVariantSerial(this.entityId,t).pipe(V(n=>n.map(r=>(e=new me,e.Number=r.Number,e.Quantity=r.Quantity?r.Quantity:1,e.ExpiryDate=r.ExpiryDate,e))),N(()=>{this.isReturn||(this.serials=this.generateSerialCode(this.selectedSerial))}),D())}generateSerialCode(t=[]){return t.map(e=>e.Number)}onSelectSerial(t){let e=t.filter(n=>this.selectedSerial.findIndex(r=>r.Number==n.Number)==-1);e.length>0&&(e[0].Quantity=1,this.selectedSerial=[...this.selectedSerial,...e],this.updateCartItem())}onRemoveSerial(t){this.selectedSerial=this.selectedSerial.filter((e,n)=>n!==t),this.serials=this.generateSerialCode(this.selectedSerial),this.updateCartItem()}onRemoveSerialChip(t){this.serials=this.serials.filter(e=>e!==t),this.serialsChange.emit(this.serials)}onRemoveSerialFromOption(t){this.selectedSerial=this.selectedSerial.filter(e=>e.Number!==t.Number),this.serials=this.generateSerialCode(this.selectedSerial)}onChangeQty(){this.updateCartItem()}submitSerial(t){t.value.trim()&&(this.serials.push(t.value.trim()),t.value="");let e=this.generateSerialData();this.selectedSerial=[...this.selectedSerial,...e],this.serials=[],this.updateCartItem()}generateSerialData(){return this.serials.filter(e=>this.selectedSerial.findIndex(n=>n.Number==e)==-1).map(e=>({Number:e,Quantity:this.isReturn?-1:1,ExpiryDate:null}))}addSerial(t,e){let n=(t.value||"").trim();if(n)if(this.serials.find(r=>r==n)){e.value="",this.toastr.info("Serial already exists",J.Info);return}else this.serials.push(n),this.serialsChange.emit(this.serials);t.chipInput.clear()}updateCartItem(){this.cartItem.Serial=this.selectedSerial,this.checkShowExpiryDate(),this.calculateSerialQty(),this.cartItemChange.emit(this.cartItem)}calculateSerialQty(){let t=0;this.selectedSerial.forEach(e=>{t+=e.Quantity}),this.cartItem.Quantity=t}checkShowExpiryDate(){let t=0;this.selectedSerial.forEach(e=>{K.IsNotEmpty(e.ExpiryDate)&&(t+=1)}),this.showExpiryDate=t>0}static \u0275fac=function(e){return new(e||i)(I(le),I($))};static \u0275cmp=P({type:i,selectors:[["app-item-serial"]],inputs:{disabled:"disabled",cartItem:"cartItem",entityId:"entityId",serials:"serials"},outputs:{cartItemChange:"cartItemChange",serialsChange:"serialsChange"},standalone:!1,decls:4,vars:3,consts:[["NOT_RETURN",""],["chipGrid",""],["inputChip",""],[1,"my-8"],[4,"ngIf"],[1,"alert","alert-warning","text-center","my-5","py-3"],[1,"fw-bold"],[1,"row"],[1,"col-12"],[4,"ngIf","ngIfElse"],[1,"input-group","mb-3"],[1,"col"],["appearance","outline",1,"serial-chip",3,"keyup.enter"],[3,"removed",4,"ngFor","ngForOf"],["placeholder","E.g. Serial1 Serial2",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"col-auto"],["type","button",1,"btn","btn-outline-secondary","btn-sm","add-chip",3,"click"],["aria-hidden","true",1,"fa","fa-plus","me-1","fs-6"],[1,"headings-font-family","h6","font-weight-bold"],[3,"removed"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"],["bindLabel","Number","appendTo","body","bindValue","Number","placeholder","Insert Number",1,"ng-select-multiple",3,"ngModelChange","remove","change","items","ngModel","multiple"],[1,"row","mt-8"],[1,"table","table-bordered"],[1,"thead-light"],[1,"border-end"],[1,"border-end","text-end",2,"width","60px"],[4,"ngFor","ngForOf"],[1,"border-end",2,"width","40px"],[1,"border-end",2,"width","100px"],["type","text","placeholder","Serial Quantity","autoNum","",1,"form-control","text-end",3,"ngModelChange","change","ngModel","disabled","decimalPlaces"],[1,"text-center"],["aria-hidden","true","title","Remove serial",1,"fa","fa-xmark","text-danger","cursor-pointer","fa-2x",3,"click"]],template:function(e,n){e&1&&(a(0,"div",3),u(1,de,6,0,"ng-container",4)(2,ge,6,2,"ng-container",4)(3,Ie,14,3,"ng-container",4),l()),e&2&&(m(),c("ngIf",n.disabled),m(),c("ngIf",!n.disabled),m(),c("ngIf",n.selectedSerial.length>0))},dependencies:()=>[H,W,T,G,U,q,ee,re,ae,ie,ne,X,L,j],styles:[".serial-chip[_ngcontent-%COMP%]{width:100%}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input, .serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:40px!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading{border-color:#ccc!important}.serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:8px;padding-bottom:8px}.add-chip[_ngcontent-%COMP%]{height:calc(100% - 18.4px);margin-left:1px;border-top-left-radius:0;border-bottom-left-radius:0}"]})},ce=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=R({type:i});static \u0275inj=O({imports:[B,te,T,z,Z,oe,Y]})};export{se as a,ce as b};
1
+ import{a as me}from"./chunk-NQX7EX5A.js";import{a as le}from"./chunk-ZIWHZGBX.js";import{a as ie,c as ne,e as re,f as ae,g as oe}from"./chunk-PNMCM55F.js";import{a as Y}from"./chunk-FP4HFB5J.js";import{a as Z,c as ee}from"./chunk-MUJ6277G.js";import{m as X}from"./chunk-IJ6QEGE5.js";import{N as te}from"./chunk-FVKF2ZOS.js";import{d as T}from"./chunk-XYB3YDKL.js";import{a as J}from"./chunk-2FWFPV5I.js";import{F as z,c as G,h as U,o as q}from"./chunk-RVXZOIFQ.js";import{a as K}from"./chunk-ZZGSAFGO.js";import{$a as m,Ac as F,Bc as Q,Fa as y,Fc as A,Ib as a,Jb as l,Kb as x,Lb as h,Mb as g,Ob as S,Qb as f,Rb as s,Vd as $,Y as D,Yc as H,Zc as W,cd as L,db as I,dc as C,ec as _,ed as j,fa as N,fc as k,gc as b,jc as v,jd as B,ka as O,kb as P,kc as E,lb as R,lc as w,qb as u,t as V,va as p,vb as c,wa as d,zc as M}from"./chunk-UXRO4UFY.js";function de(i,t){i&1&&(h(0),a(1,"div",5)(2,"div",6),_(3,"Edit Serial is disabled during EDIT MODE"),l(),a(4,"div"),_(5," If you make a mistake, please delete the item and then add again "),l()(),g())}function _e(i,t){if(i&1){let e=S();a(0,"mat-chip-row",19),f("removed",function(){let r=p(e).$implicit,o=s(3);return d(o.onRemoveSerialChip(r))}),_(1),a(2,"button",20),x(3,"i",21),l()()}if(i&2){let e=t.$implicit;m(),b(" ",e," ")}}function ue(i,t){if(i&1){let e=S();h(0),a(1,"div",10)(2,"div",11)(3,"mat-form-field",12),f("keyup.enter",function(r){return p(e),d(r.stopPropagation())}),a(4,"mat-chip-grid",null,1),u(6,_e,4,1,"mat-chip-row",13),a(7,"input",14,2),f("matChipInputTokenEnd",function(r){p(e);let o=C(8),pe=s(2);return d(pe.addSerial(r,o))}),l()()()(),a(9,"div",15)(10,"button",16),f("click",function(){p(e);let r=C(8),o=s(2);return d(o.submitSerial(r))}),x(11,"i",17),a(12,"strong",18),_(13,"ADD"),l()()()(),g()}if(i&2){let e=C(5),n=s(2);m(6),c("ngForOf",n.serials),m(),c("matChipInputFor",e)("matChipInputSeparatorKeyCodes",n.separatorKeysCodes)}}function he(i,t){if(i&1){let e=S();a(0,"ng-select",22),M(1,"async"),w("ngModelChange",function(r){p(e);let o=s(2);return E(o.serials,r)||(o.serials=r),d(r)}),f("remove",function(r){p(e);let o=s(2);return d(o.onRemoveSerialFromOption(r.value))})("change",function(r){p(e);let o=s(2);return d(o.onSelectSerial(r))}),l()}if(i&2){let e=s(2);c("items",F(1,3,e.serials$)),v("ngModel",e.serials),c("multiple",!0)}}function ge(i,t){if(i&1&&(h(0),a(1,"div",7)(2,"div",8),u(3,ue,14,3,"ng-container",9)(4,he,2,5,"ng-template",null,0,A),l()(),g()),i&2){let e=C(5),n=s();m(3),c("ngIf",n.isReturn)("ngIfElse",e)}}function fe(i,t){i&1&&(h(0),x(1,"th",29),g())}function Se(i,t){i&1&&(h(0),a(1,"th",30),_(2,"Expiry Date"),l(),g())}function Ce(i,t){if(i&1){let e=S();h(0),a(1,"td",32)(2,"i",33),f("click",function(){p(e);let r=s().index,o=s(2);return d(o.onRemoveSerial(r))}),l()(),g()}}function xe(i,t){if(i&1&&(h(0),a(1,"td"),_(2),M(3,"date"),l(),g()),i&2){let e=s().$implicit;m(2),b(" ",e.ExpiryDate?Q(3,1,e.ExpiryDate,"dd MMM yyyy"):"-"," ")}}function ye(i,t){if(i&1){let e=S();a(0,"tr"),u(1,Ce,3,0,"ng-container",4),a(2,"td"),_(3),l(),u(4,xe,4,4,"ng-container",4),a(5,"td")(6,"input",31),w("ngModelChange",function(r){let o=p(e).$implicit;return E(o.Quantity,r)||(o.Quantity=r),d(r)}),f("change",function(){p(e);let r=s(2);return d(r.onChangeQty())}),l()()()}if(i&2){let e=t.$implicit,n=s(2);m(),c("ngIf",!n.disabled),m(2),k(e.Number),m(),c("ngIf",n.showExpiryDate),m(2),v("ngModel",e.Quantity),c("disabled",n.disabled)("decimalPlaces",0)}}function Ie(i,t){if(i&1&&(h(0),a(1,"div",23)(2,"div",8)(3,"table",24)(4,"thead",25)(5,"tr"),u(6,fe,2,0,"ng-container",4),a(7,"th",26),_(8,"Serial Number"),l(),u(9,Se,3,0,"ng-container",4),a(10,"th",27),_(11,"Quantity"),l()()(),a(12,"tbody"),u(13,ye,7,6,"tr",28),l()()()(),g()),i&2){let e=s();m(6),c("ngIf",!e.disabled),m(3),c("ngIf",e.showExpiryDate),m(4),c("ngForOf",e.selectedSerial)}}var se=class i{constructor(t,e){this.productService=t;this.toastr=e;this.cartItemChange=new y,this.serialsChange=new y}separatorKeysCodes=[13,188];_cartItem;isReturn=!1;disabled=!1;set cartItem(t){t&&(this._cartItem=t,this.initSelectedSerial(),t.Quantity<0?this.isReturn=!0:this.getSerialVariant())}get cartItem(){return this._cartItem}cartItemChange;entityId;serials;serialsChange;serials$;selectedSerial=[];showExpiryDate;ngOnDestroy(){this.serialsChange.emit([])}initSelectedSerial(){let t=this.cartItem.Serial;t&&t.length>0&&(this.selectedSerial=t,this.checkShowExpiryDate())}getSerialVariant(){let t=this.cartItem.VariantID,e;this.serials$=this.productService.getVariantSerial(this.entityId,t).pipe(V(n=>n.map(r=>(e=new me,e.Number=r.Number,e.Quantity=r.Quantity?r.Quantity:1,e.ExpiryDate=r.ExpiryDate,e))),N(()=>{this.isReturn||(this.serials=this.generateSerialCode(this.selectedSerial))}),D())}generateSerialCode(t=[]){return t.map(e=>e.Number)}onSelectSerial(t){let e=t.filter(n=>this.selectedSerial.findIndex(r=>r.Number==n.Number)==-1);e.length>0&&(e[0].Quantity=1,this.selectedSerial=[...this.selectedSerial,...e],this.updateCartItem())}onRemoveSerial(t){this.selectedSerial=this.selectedSerial.filter((e,n)=>n!==t),this.serials=this.generateSerialCode(this.selectedSerial),this.updateCartItem()}onRemoveSerialChip(t){this.serials=this.serials.filter(e=>e!==t),this.serialsChange.emit(this.serials)}onRemoveSerialFromOption(t){this.selectedSerial=this.selectedSerial.filter(e=>e.Number!==t.Number),this.serials=this.generateSerialCode(this.selectedSerial)}onChangeQty(){this.updateCartItem()}submitSerial(t){t.value.trim()&&(this.serials.push(t.value.trim()),t.value="");let e=this.generateSerialData();this.selectedSerial=[...this.selectedSerial,...e],this.serials=[],this.updateCartItem()}generateSerialData(){return this.serials.filter(e=>this.selectedSerial.findIndex(n=>n.Number==e)==-1).map(e=>({Number:e,Quantity:this.isReturn?-1:1,ExpiryDate:null}))}addSerial(t,e){let n=(t.value||"").trim();if(n)if(this.serials.find(r=>r==n)){e.value="",this.toastr.info("Serial already exists",J.Info);return}else this.serials.push(n),this.serialsChange.emit(this.serials);t.chipInput.clear()}updateCartItem(){this.cartItem.Serial=this.selectedSerial,this.checkShowExpiryDate(),this.calculateSerialQty(),this.cartItemChange.emit(this.cartItem)}calculateSerialQty(){let t=0;this.selectedSerial.forEach(e=>{t+=e.Quantity}),this.cartItem.Quantity=t}checkShowExpiryDate(){let t=0;this.selectedSerial.forEach(e=>{K.IsNotEmpty(e.ExpiryDate)&&(t+=1)}),this.showExpiryDate=t>0}static \u0275fac=function(e){return new(e||i)(I(le),I($))};static \u0275cmp=P({type:i,selectors:[["app-item-serial"]],inputs:{disabled:"disabled",cartItem:"cartItem",entityId:"entityId",serials:"serials"},outputs:{cartItemChange:"cartItemChange",serialsChange:"serialsChange"},standalone:!1,decls:4,vars:3,consts:[["NOT_RETURN",""],["chipGrid",""],["inputChip",""],[1,"my-8"],[4,"ngIf"],[1,"alert","alert-warning","text-center","my-5","py-3"],[1,"fw-bold"],[1,"row"],[1,"col-12"],[4,"ngIf","ngIfElse"],[1,"input-group","mb-3"],[1,"col"],["appearance","outline",1,"serial-chip",3,"keyup.enter"],[3,"removed",4,"ngFor","ngForOf"],["placeholder","E.g. Serial1 Serial2",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"col-auto"],["type","button",1,"btn","btn-outline-secondary","btn-sm","add-chip",3,"click"],["aria-hidden","true",1,"fa","fa-plus","me-1","fs-6"],[1,"headings-font-family","h6","font-weight-bold"],[3,"removed"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"],["bindLabel","Number","appendTo","body","bindValue","Number","placeholder","Insert Number",1,"ng-select-multiple",3,"ngModelChange","remove","change","items","ngModel","multiple"],[1,"row","mt-8"],[1,"table","table-bordered"],[1,"thead-light"],[1,"border-end"],[1,"border-end","text-end",2,"width","60px"],[4,"ngFor","ngForOf"],[1,"border-end",2,"width","40px"],[1,"border-end",2,"width","100px"],["type","text","placeholder","Serial Quantity","autoNum","",1,"form-control","text-end",3,"ngModelChange","change","ngModel","disabled","decimalPlaces"],[1,"text-center"],["aria-hidden","true","title","Remove serial",1,"fa","fa-xmark","text-danger","cursor-pointer","fa-2x",3,"click"]],template:function(e,n){e&1&&(a(0,"div",3),u(1,de,6,0,"ng-container",4)(2,ge,6,2,"ng-container",4)(3,Ie,14,3,"ng-container",4),l()),e&2&&(m(),c("ngIf",n.disabled),m(),c("ngIf",!n.disabled),m(),c("ngIf",n.selectedSerial.length>0))},dependencies:()=>[H,W,T,G,U,q,ee,re,ae,ie,ne,X,L,j],styles:[".serial-chip[_ngcontent-%COMP%]{width:100%}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input, .serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:40px!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading{border-color:#ccc!important}.serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:8px;padding-bottom:8px}.add-chip[_ngcontent-%COMP%]{height:calc(100% - 18.4px);margin-left:1px;border-top-left-radius:0;border-bottom-left-radius:0}"]})},ce=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=R({type:i});static \u0275inj=O({imports:[B,te,T,z,Z,oe,Y]})};export{se as a,ce as b};